jodit 4.18.11 → 4.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/es2015/jodit.css +10 -1
- package/es2015/jodit.fat.min.css +1 -1
- package/es2015/jodit.fat.min.js +18 -12
- package/es2015/jodit.js +2489 -305
- package/es2015/jodit.min.css +1 -1
- package/es2015/jodit.min.js +18 -12
- 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 +18 -12
- package/es2018/jodit.min.css +1 -1
- package/es2018/jodit.min.js +18 -12
- package/es2018/plugins/debug/debug.min.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021/jodit.css +10 -1
- package/es2021/jodit.fat.min.css +1 -1
- package/es2021/jodit.fat.min.js +26 -19
- package/es2021/jodit.js +2451 -302
- package/es2021/jodit.min.css +1 -1
- package/es2021/jodit.min.js +26 -19
- 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 +10 -1
- package/es2021.en/jodit.fat.min.css +1 -1
- package/es2021.en/jodit.fat.min.js +29 -22
- package/es2021.en/jodit.js +2425 -276
- package/es2021.en/jodit.min.css +1 -1
- package/es2021.en/jodit.min.js +29 -22
- 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 +11 -2
- package/es5/jodit.fat.min.css +1 -1
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +2873 -365
- 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 +44 -1
- package/esm/config.js +2 -1
- package/esm/core/constants.js +1 -1
- package/esm/core/dom/dom.js +4 -2
- package/esm/core/event-emitter/event-emitter.js +1 -0
- package/esm/core/helpers/utils/align.d.ts +6 -1
- package/esm/core/helpers/utils/align.js +22 -12
- package/esm/core/helpers/utils/image-caption.d.ts +24 -0
- package/esm/core/helpers/utils/image-caption.js +43 -0
- package/esm/core/helpers/utils/index.d.ts +1 -0
- package/esm/core/helpers/utils/index.js +1 -0
- package/esm/core/selection/selection.d.ts +3 -0
- package/esm/core/selection/selection.js +20 -5
- package/esm/core/selection/style/api/list/toggle-ordered-list.d.ts +1 -1
- package/esm/core/selection/style/api/list/toggle-ordered-list.js +30 -4
- package/esm/core/selection/style/transactions.js +1 -1
- package/esm/core/ui/helpers/focus-form-field.d.ts +12 -0
- package/esm/core/ui/helpers/focus-form-field.js +21 -0
- package/esm/jodit.js +18 -2
- package/esm/langs/ar.d.ts +2 -0
- package/esm/langs/ar.js +2 -0
- package/esm/langs/az.d.ts +2 -0
- package/esm/langs/az.js +2 -0
- package/esm/langs/cs_cz.d.ts +2 -0
- package/esm/langs/cs_cz.js +2 -0
- package/esm/langs/de.d.ts +2 -0
- package/esm/langs/de.js +2 -0
- package/esm/langs/es.d.ts +2 -0
- package/esm/langs/es.js +2 -0
- package/esm/langs/fa.d.ts +2 -0
- package/esm/langs/fa.js +2 -0
- package/esm/langs/fi.d.ts +2 -0
- package/esm/langs/fi.js +2 -0
- package/esm/langs/fr.d.ts +2 -0
- package/esm/langs/fr.js +2 -0
- package/esm/langs/he.d.ts +2 -0
- package/esm/langs/he.js +2 -0
- package/esm/langs/hu.d.ts +2 -0
- package/esm/langs/hu.js +2 -0
- package/esm/langs/id.d.ts +2 -0
- package/esm/langs/id.js +2 -0
- package/esm/langs/it.d.ts +2 -0
- package/esm/langs/it.js +2 -0
- package/esm/langs/ja.d.ts +2 -0
- package/esm/langs/ja.js +2 -0
- package/esm/langs/ko.d.ts +2 -0
- package/esm/langs/ko.js +2 -0
- package/esm/langs/mn.d.ts +2 -0
- package/esm/langs/mn.js +2 -0
- package/esm/langs/nl.d.ts +2 -0
- package/esm/langs/nl.js +2 -0
- package/esm/langs/no.d.ts +2 -0
- package/esm/langs/no.js +2 -0
- package/esm/langs/pl.d.ts +2 -0
- package/esm/langs/pl.js +2 -0
- package/esm/langs/pt_br.d.ts +2 -0
- package/esm/langs/pt_br.js +2 -0
- package/esm/langs/ru.d.ts +2 -0
- package/esm/langs/ru.js +2 -0
- package/esm/langs/sk.d.ts +2 -0
- package/esm/langs/sk.js +2 -0
- package/esm/langs/sv.d.ts +2 -0
- package/esm/langs/sv.js +2 -0
- package/esm/langs/tr.d.ts +2 -0
- package/esm/langs/tr.js +2 -0
- package/esm/langs/ua.d.ts +2 -0
- package/esm/langs/ua.js +2 -0
- package/esm/langs/zh_cn.d.ts +2 -0
- package/esm/langs/zh_cn.js +2 -0
- package/esm/langs/zh_tw.d.ts +2 -0
- package/esm/langs/zh_tw.js +2 -0
- package/esm/modules/table/table.d.ts +27 -0
- package/esm/modules/table/table.js +110 -2
- package/esm/modules/toolbar/button/button.js +11 -3
- package/esm/modules/uploader/helpers/send-files.js +3 -1
- package/esm/modules/widget/tabs/tabs.js +2 -0
- package/esm/plugins/all.d.ts +1 -0
- package/esm/plugins/all.js +1 -0
- package/esm/plugins/backspace/backspace.js +17 -1
- package/esm/plugins/backspace/cases/check-remove-char.js +1 -11
- package/esm/plugins/backspace/helpers.d.ts +5 -0
- package/esm/plugins/backspace/helpers.js +11 -0
- package/esm/plugins/clean-html/clean-html.js +2 -2
- 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-format/remove-format-for-word.d.ts +16 -0
- package/esm/plugins/clean-html/helpers/remove-format/remove-format-for-word.js +109 -0
- package/esm/plugins/drag-and-drop-element/drag-and-drop-element.js +4 -2
- package/esm/plugins/format-block/config.d.ts +13 -0
- package/esm/plugins/format-block/config.js +38 -1
- package/esm/plugins/format-block/content-fonts.d.ts +17 -0
- package/esm/plugins/format-block/content-fonts.js +156 -0
- package/esm/plugins/image-caption/config.d.ts +31 -0
- package/esm/plugins/image-caption/config.js +11 -0
- package/esm/plugins/image-caption/image-caption.d.ts +140 -0
- package/esm/plugins/image-caption/image-caption.js +799 -0
- package/esm/plugins/image-processor/image-processor.d.ts +2 -1
- package/esm/plugins/image-processor/image-processor.js +9 -4
- package/esm/plugins/image-properties/config.js +1 -0
- package/esm/plugins/image-properties/image-properties.js +19 -5
- package/esm/plugins/image-properties/interface.d.ts +6 -0
- package/esm/plugins/image-properties/readers/align.d.ts +1 -1
- package/esm/plugins/image-properties/readers/index.js +9 -3
- package/esm/plugins/image-properties/readers/margin.d.ts +1 -1
- package/esm/plugins/image-properties/readers/size.d.ts +5 -1
- package/esm/plugins/image-properties/readers/size.js +4 -5
- package/esm/plugins/image-properties/ui/ui-image-main-tab.d.ts +2 -0
- package/esm/plugins/image-properties/ui/ui-image-main-tab.js +20 -0
- package/esm/plugins/image-properties/writers/caption.d.ts +15 -0
- package/esm/plugins/image-properties/writers/caption.js +18 -0
- package/esm/plugins/image-properties/writers/index.js +15 -10
- package/esm/plugins/image-properties/writers/link.js +7 -2
- package/esm/plugins/image-properties/writers/margin.d.ts +1 -1
- package/esm/plugins/image-properties/writers/size.d.ts +5 -2
- package/esm/plugins/image-properties/writers/size.js +16 -2
- package/esm/plugins/indent/helpers.d.ts +9 -0
- package/esm/plugins/indent/helpers.js +23 -3
- package/esm/plugins/indent/indent.js +2 -20
- package/esm/plugins/index.d.ts +1 -0
- package/esm/plugins/inline-popup/config/config.js +4 -0
- package/esm/plugins/inline-popup/config/items/cells.js +29 -0
- package/esm/plugins/inline-popup/config/items/img.js +35 -5
- package/esm/plugins/inline-popup/icons/caption.svg.js +1 -0
- package/esm/plugins/inline-popup/icons/headerrow.svg.js +1 -0
- package/esm/plugins/inline-popup/inline-popup.js +3 -2
- package/esm/plugins/placeholder/placeholder.js +7 -1
- package/esm/plugins/resize-cells/resize-cells.d.ts +49 -0
- package/esm/plugins/resize-cells/resize-cells.js +247 -13
- package/esm/plugins/resizer/resizer.js +13 -2
- package/esm/plugins/select-cells/select-cells.d.ts +5 -0
- package/esm/plugins/select-cells/select-cells.js +29 -11
- package/esm/plugins/tab/cases/index.d.ts +1 -0
- package/esm/plugins/tab/cases/index.js +1 -0
- package/esm/plugins/tab/cases/on-tab-inside-li.js +3 -1
- package/esm/plugins/tab/cases/tab-spaces.d.ts +32 -0
- package/esm/plugins/tab/cases/tab-spaces.js +263 -0
- package/esm/plugins/tab/config.d.ts +10 -0
- package/esm/plugins/tab/config.js +2 -1
- package/esm/plugins/tab/tab.js +61 -6
- package/esm/types/types.d.ts +16 -0
- package/esm/types/uploader.d.ts +6 -0
- package/package.json +1 -1
- package/types/config.d.ts +44 -1
- package/types/core/helpers/utils/align.d.ts +6 -1
- package/types/core/helpers/utils/image-caption.d.ts +24 -0
- package/types/core/helpers/utils/index.d.ts +1 -0
- package/types/core/selection/selection.d.ts +3 -0
- package/types/core/selection/style/api/list/toggle-ordered-list.d.ts +1 -1
- package/types/core/ui/helpers/focus-form-field.d.ts +12 -0
- package/types/langs/ar.d.ts +2 -0
- package/types/langs/az.d.ts +2 -0
- package/types/langs/cs_cz.d.ts +2 -0
- package/types/langs/de.d.ts +2 -0
- package/types/langs/es.d.ts +2 -0
- package/types/langs/fa.d.ts +2 -0
- package/types/langs/fi.d.ts +2 -0
- package/types/langs/fr.d.ts +2 -0
- package/types/langs/he.d.ts +2 -0
- package/types/langs/hu.d.ts +2 -0
- package/types/langs/id.d.ts +2 -0
- package/types/langs/it.d.ts +2 -0
- package/types/langs/ja.d.ts +2 -0
- package/types/langs/ko.d.ts +2 -0
- package/types/langs/mn.d.ts +2 -0
- package/types/langs/nl.d.ts +2 -0
- package/types/langs/no.d.ts +2 -0
- package/types/langs/pl.d.ts +2 -0
- package/types/langs/pt_br.d.ts +2 -0
- package/types/langs/ru.d.ts +2 -0
- package/types/langs/sk.d.ts +2 -0
- package/types/langs/sv.d.ts +2 -0
- package/types/langs/tr.d.ts +2 -0
- package/types/langs/ua.d.ts +2 -0
- package/types/langs/zh_cn.d.ts +2 -0
- package/types/langs/zh_tw.d.ts +2 -0
- package/types/modules/table/table.d.ts +27 -0
- package/types/plugins/backspace/helpers.d.ts +5 -0
- package/types/plugins/clean-html/helpers/index.d.ts +1 -0
- package/types/plugins/clean-html/helpers/remove-format/remove-format-for-word.d.ts +16 -0
- package/types/plugins/format-block/config.d.ts +13 -0
- package/types/plugins/format-block/content-fonts.d.ts +17 -0
- package/types/plugins/image-caption/config.d.ts +31 -0
- package/types/plugins/image-caption/image-caption.d.ts +140 -0
- package/types/plugins/image-processor/image-processor.d.ts +2 -1
- package/types/plugins/image-properties/interface.d.ts +6 -0
- package/types/plugins/image-properties/readers/align.d.ts +1 -1
- package/types/plugins/image-properties/readers/margin.d.ts +1 -1
- package/types/plugins/image-properties/readers/size.d.ts +5 -1
- package/types/plugins/image-properties/ui/ui-image-main-tab.d.ts +2 -0
- package/types/plugins/image-properties/writers/caption.d.ts +15 -0
- package/types/plugins/image-properties/writers/margin.d.ts +1 -1
- package/types/plugins/image-properties/writers/size.d.ts +5 -2
- package/types/plugins/indent/helpers.d.ts +9 -0
- package/types/plugins/index.d.ts +1 -0
- package/types/plugins/resize-cells/resize-cells.d.ts +49 -0
- package/types/plugins/select-cells/select-cells.d.ts +5 -0
- package/types/plugins/tab/cases/index.d.ts +1 -0
- package/types/plugins/tab/cases/tab-spaces.d.ts +32 -0
- package/types/plugins/tab/config.d.ts +10 -0
- package/types/types/types.d.ts +16 -0
- package/types/types/uploader.d.ts +6 -0
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.
|
|
4
|
+
* Version: v4.19.0
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -744,7 +744,8 @@ let ConfigPrototype = {};
|
|
|
744
744
|
* spaces. An alignment can also list several such sets, to recognise each
|
|
745
745
|
* of them; aligning writes the first. A media wrapper (see
|
|
746
746
|
* `mediaWrappers`), and Jodit's own `jodit` and `jodit-media` wrappers,
|
|
747
|
-
* are aligned with the classes for the media in them
|
|
747
|
+
* are aligned with the classes for the media in them, and a captioned
|
|
748
|
+
* image's wrapper (see `imageCaption`) with those for `img`.
|
|
748
749
|
*
|
|
749
750
|
* ```javascript
|
|
750
751
|
* const media = {
|
|
@@ -1823,7 +1824,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1823
1824
|
* ```
|
|
1824
1825
|
* @packageDocumentation
|
|
1825
1826
|
* @module constants
|
|
1826
|
-
*/ const APP_VERSION = "4.
|
|
1827
|
+
*/ const APP_VERSION = "4.19.0";
|
|
1827
1828
|
// prettier-ignore
|
|
1828
1829
|
const ES = "es2021";
|
|
1829
1830
|
const IS_ES_MODERN = true;
|
|
@@ -3281,7 +3282,10 @@ const TEMP_ELEMENT_REG_EXP = new RegExp(`<([a-z]+)[^>]+${jodit_core_constants__W
|
|
|
3281
3282
|
/**
|
|
3282
3283
|
* The node is editable
|
|
3283
3284
|
*/ static isContentEditable(node, root) {
|
|
3284
|
-
|
|
3285
|
+
// The nearest element that says decides, as an editable caption inside
|
|
3286
|
+
// a non-editable figure is editable
|
|
3287
|
+
const host = Dom.closest(node, (elm)=>Dom.isElement(elm) && elm.hasAttribute('contenteditable'), root);
|
|
3288
|
+
return Dom.isNode(node) && host?.getAttribute('contenteditable') !== 'false';
|
|
3285
3289
|
}
|
|
3286
3290
|
static isEmpty(node, condNoEmptyElement = jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.NO_EMPTY_TAGS) {
|
|
3287
3291
|
if (!node) {
|
|
@@ -4014,6 +4018,7 @@ const TEMP_ELEMENT_REG_EXP = new RegExp(`<([a-z]+)[^>]+${jodit_core_constants__W
|
|
|
4014
4018
|
'screenY',
|
|
4015
4019
|
'clientX',
|
|
4016
4020
|
'clientY',
|
|
4021
|
+
'view',
|
|
4017
4022
|
'target',
|
|
4018
4023
|
'srcElement',
|
|
4019
4024
|
'currentTarget',
|
|
@@ -7821,6 +7826,7 @@ function trimChars(value, chars) {
|
|
|
7821
7826
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
7822
7827
|
/* harmony export */ alignElement: function() { return /* binding */ alignElement; },
|
|
7823
7828
|
/* harmony export */ clearAlign: function() { return /* binding */ clearAlign; },
|
|
7829
|
+
/* harmony export */ clearHAlign: function() { return /* binding */ clearHAlign; },
|
|
7824
7830
|
/* harmony export */ getAlignClasses: function() { return /* binding */ getAlignClasses; },
|
|
7825
7831
|
/* harmony export */ getHAlign: function() { return /* binding */ getHAlign; },
|
|
7826
7832
|
/* harmony export */ hAlignElement: function() { return /* binding */ hAlignElement; }
|
|
@@ -7829,7 +7835,8 @@ function trimChars(value, chars) {
|
|
|
7829
7835
|
/* harmony import */ var jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(17312);
|
|
7830
7836
|
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7909);
|
|
7831
7837
|
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(80991);
|
|
7832
|
-
/* harmony import */ var
|
|
7838
|
+
/* harmony import */ var jodit_core_helpers_utils_image_caption__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(66638);
|
|
7839
|
+
/* harmony import */ var jodit_core_helpers_utils_media_wrapper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(83314);
|
|
7833
7840
|
/*!
|
|
7834
7841
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
7835
7842
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -7841,6 +7848,7 @@ function trimChars(value, chars) {
|
|
|
7841
7848
|
|
|
7842
7849
|
|
|
7843
7850
|
|
|
7851
|
+
|
|
7844
7852
|
// The sets of class names an alignment lists, the first being the one to write
|
|
7845
7853
|
const classSets = (value)=>((0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_1__.isArray)(value) ? value : [
|
|
7846
7854
|
value ?? ''
|
|
@@ -7848,7 +7856,7 @@ const classSets = (value)=>((0,jodit_core_helpers_checker_is_array__WEBPACK_IMPO
|
|
|
7848
7856
|
/**
|
|
7849
7857
|
* The class names to align `elm` with: `alignClasses` for its tag, or for the
|
|
7850
7858
|
* media in it when it wraps media (a `mediaWrappers` wrapper, `jodit` or
|
|
7851
|
-
* `jodit-media`)
|
|
7859
|
+
* `jodit-media`) or a captioned image (see `imageCaption`)
|
|
7852
7860
|
*/ function getAlignClasses(jodit, elm) {
|
|
7853
7861
|
if (!elm) {
|
|
7854
7862
|
return null;
|
|
@@ -7856,7 +7864,7 @@ const classSets = (value)=>((0,jodit_core_helpers_checker_is_array__WEBPACK_IMPO
|
|
|
7856
7864
|
const media = jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(elm, new Set([
|
|
7857
7865
|
'jodit',
|
|
7858
7866
|
'jodit-media'
|
|
7859
|
-
])) ? elm.firstElementChild : (0,
|
|
7867
|
+
])) ? elm.firstElementChild : (0,jodit_core_helpers_utils_media_wrapper__WEBPACK_IMPORTED_MODULE_5__.getWrappedMedia)(jodit, elm) ?? (0,jodit_core_helpers_utils_image_caption__WEBPACK_IMPORTED_MODULE_4__.getCaptionedImage)(jodit, elm);
|
|
7860
7868
|
return jodit.o.alignClasses?.[(media ?? elm).nodeName.toLowerCase()] ?? null;
|
|
7861
7869
|
}
|
|
7862
7870
|
/**
|
|
@@ -7864,17 +7872,8 @@ const classSets = (value)=>((0,jodit_core_helpers_checker_is_array__WEBPACK_IMPO
|
|
|
7864
7872
|
* when they are given
|
|
7865
7873
|
*/ function hAlignElement(image, align, classes) {
|
|
7866
7874
|
if (classes) {
|
|
7867
|
-
|
|
7868
|
-
Object.values(classes).forEach((value)=>classSets(value).forEach((set)=>image.classList.remove(...set)));
|
|
7875
|
+
clearHAlign(image, classes);
|
|
7869
7876
|
image.classList.add(...classSets(classes[align || 'normal'])[0] ?? []);
|
|
7870
|
-
[
|
|
7871
|
-
'class',
|
|
7872
|
-
'style'
|
|
7873
|
-
].forEach((name)=>{
|
|
7874
|
-
if (!(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(image, name)?.trim()) {
|
|
7875
|
-
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(image, name, null);
|
|
7876
|
-
}
|
|
7877
|
-
});
|
|
7878
7877
|
return;
|
|
7879
7878
|
}
|
|
7880
7879
|
if (align && align !== 'normal') {
|
|
@@ -7899,6 +7898,23 @@ const classSets = (value)=>((0,jodit_core_helpers_checker_is_array__WEBPACK_IMPO
|
|
|
7899
7898
|
;(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.clearCenterAlign)(image);
|
|
7900
7899
|
}
|
|
7901
7900
|
}
|
|
7901
|
+
/**
|
|
7902
|
+
* Remove the alignment `hAlignElement` set on an element, with the classes of
|
|
7903
|
+
* every alignment in `classes`
|
|
7904
|
+
*/ function clearHAlign(elm, classes) {
|
|
7905
|
+
hAlignElement(elm, 'normal');
|
|
7906
|
+
if (classes) {
|
|
7907
|
+
Object.values(classes).forEach((value)=>classSets(value).forEach((set)=>elm.classList.remove(...set)));
|
|
7908
|
+
}
|
|
7909
|
+
[
|
|
7910
|
+
'class',
|
|
7911
|
+
'style'
|
|
7912
|
+
].forEach((name)=>{
|
|
7913
|
+
if (!(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(elm, name)?.trim()) {
|
|
7914
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(elm, name, null);
|
|
7915
|
+
}
|
|
7916
|
+
});
|
|
7917
|
+
}
|
|
7902
7918
|
/**
|
|
7903
7919
|
* The alignment `hAlignElement` has set on an element
|
|
7904
7920
|
*/ function getHAlign(elm, classes) {
|
|
@@ -9039,6 +9055,57 @@ const getClassName = (obj)=>{
|
|
|
9039
9055
|
/* harmony export */ ]);
|
|
9040
9056
|
|
|
9041
9057
|
|
|
9058
|
+
/***/ }),
|
|
9059
|
+
|
|
9060
|
+
/***/ 66638:
|
|
9061
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
9062
|
+
|
|
9063
|
+
"use strict";
|
|
9064
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
9065
|
+
/* harmony export */ getCaptionWrapper: function() { return /* binding */ getCaptionWrapper; },
|
|
9066
|
+
/* harmony export */ getCaptionedImage: function() { return /* binding */ getCaptionedImage; },
|
|
9067
|
+
/* harmony export */ getImageCaption: function() { return /* binding */ getImageCaption; }
|
|
9068
|
+
/* harmony export */ });
|
|
9069
|
+
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
|
|
9070
|
+
/* harmony import */ var jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(88475);
|
|
9071
|
+
/*!
|
|
9072
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
9073
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
9074
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
9075
|
+
*/ /**
|
|
9076
|
+
* @module helpers/utils
|
|
9077
|
+
*/
|
|
9078
|
+
|
|
9079
|
+
const isPart = (node, part)=>jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isHTMLElement(node) && node.nodeName.toLowerCase() === part.tag.toLowerCase() && (!part.className || node.classList.contains(part.className));
|
|
9080
|
+
/**
|
|
9081
|
+
* The caption in `wrapper`, an element holding an image and its caption (see
|
|
9082
|
+
* `imageCaption`)
|
|
9083
|
+
*/ function getImageCaption(jodit, wrapper) {
|
|
9084
|
+
const markup = jodit.o.imageCaption;
|
|
9085
|
+
if (!markup || !isPart(wrapper, markup.wrapper)) {
|
|
9086
|
+
return null;
|
|
9087
|
+
}
|
|
9088
|
+
return (0,jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_1__.toArray)(wrapper.getElementsByTagName(markup.caption.tag)).find((elm)=>isPart(elm, markup.caption)) ?? null;
|
|
9089
|
+
}
|
|
9090
|
+
/**
|
|
9091
|
+
* The image in `wrapper` when it is an element holding one image and its
|
|
9092
|
+
* caption (see `imageCaption`)
|
|
9093
|
+
*/ function getCaptionedImage(jodit, wrapper) {
|
|
9094
|
+
const caption = getImageCaption(jodit, wrapper);
|
|
9095
|
+
if (!caption) {
|
|
9096
|
+
return null;
|
|
9097
|
+
}
|
|
9098
|
+
const images = wrapper.getElementsByTagName('img');
|
|
9099
|
+
return images.length === 1 && !caption.contains(images[0]) ? images[0] : null;
|
|
9100
|
+
}
|
|
9101
|
+
/**
|
|
9102
|
+
* The element holding an image and its caption (see `imageCaption`) that is
|
|
9103
|
+
* or holds `node`
|
|
9104
|
+
*/ function getCaptionWrapper(jodit, node) {
|
|
9105
|
+
return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.closest(node, (elm)=>Boolean(getCaptionedImage(jodit, elm)), jodit.editor);
|
|
9106
|
+
}
|
|
9107
|
+
|
|
9108
|
+
|
|
9042
9109
|
/***/ }),
|
|
9043
9110
|
|
|
9044
9111
|
/***/ 93640:
|
|
@@ -9047,15 +9114,15 @@ const getClassName = (obj)=>{
|
|
|
9047
9114
|
"use strict";
|
|
9048
9115
|
__webpack_require__.r(__webpack_exports__);
|
|
9049
9116
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
9050
|
-
/* harmony export */ $$: function() { return /* reexport safe */
|
|
9117
|
+
/* harmony export */ $$: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_27__.$$; },
|
|
9051
9118
|
/* harmony export */ ConfigDeepFlatten: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.ConfigDeepFlatten; },
|
|
9052
9119
|
/* harmony export */ ConfigFlatten: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.ConfigFlatten; },
|
|
9053
9120
|
/* harmony export */ ConfigMerge: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.ConfigMerge; },
|
|
9054
9121
|
/* harmony export */ ConfigProto: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.ConfigProto; },
|
|
9055
9122
|
/* harmony export */ ConnectionError: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.ConnectionError; },
|
|
9056
|
-
/* harmony export */ LimitedStack: function() { return /* reexport safe */
|
|
9123
|
+
/* harmony export */ LimitedStack: function() { return /* reexport safe */ _stack__WEBPACK_IMPORTED_MODULE_29__.LimitedStack; },
|
|
9057
9124
|
/* harmony export */ OptionsError: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.OptionsError; },
|
|
9058
|
-
/* harmony export */ UNSAFE_PROTO_KEYS: function() { return /* reexport safe */
|
|
9125
|
+
/* harmony export */ UNSAFE_PROTO_KEYS: function() { return /* reexport safe */ _is_unsafe_proto_key__WEBPACK_IMPORTED_MODULE_19__.UNSAFE_PROTO_KEYS; },
|
|
9059
9126
|
/* harmony export */ abort: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.abort; },
|
|
9060
9127
|
/* harmony export */ alignElement: function() { return /* reexport safe */ _align__WEBPACK_IMPORTED_MODULE_0__.alignElement; },
|
|
9061
9128
|
/* harmony export */ alreadyLoadedList: function() { return /* reexport safe */ _append_script__WEBPACK_IMPORTED_MODULE_1__.alreadyLoadedList; },
|
|
@@ -9065,19 +9132,20 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
9065
9132
|
/* harmony export */ attrRaw: function() { return /* reexport safe */ _attr__WEBPACK_IMPORTED_MODULE_3__.attrRaw; },
|
|
9066
9133
|
/* harmony export */ browser: function() { return /* reexport safe */ _browser__WEBPACK_IMPORTED_MODULE_4__.browser; },
|
|
9067
9134
|
/* harmony export */ buildQuery: function() { return /* reexport safe */ _build_query__WEBPACK_IMPORTED_MODULE_5__.buildQuery; },
|
|
9068
|
-
/* harmony export */ call: function() { return /* reexport safe */
|
|
9069
|
-
/* harmony export */ callPromise: function() { return /* reexport safe */
|
|
9070
|
-
/* harmony export */ callThis: function() { return /* reexport safe */
|
|
9135
|
+
/* harmony export */ call: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_30__.call; },
|
|
9136
|
+
/* harmony export */ callPromise: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_30__.callPromise; },
|
|
9137
|
+
/* harmony export */ callThis: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_30__.callThis; },
|
|
9071
9138
|
/* harmony export */ clearAlign: function() { return /* reexport safe */ _align__WEBPACK_IMPORTED_MODULE_0__.clearAlign; },
|
|
9072
9139
|
/* harmony export */ clearCenterAlign: function() { return /* reexport safe */ _css__WEBPACK_IMPORTED_MODULE_9__.clearCenterAlign; },
|
|
9073
|
-
/* harmony export */
|
|
9140
|
+
/* harmony export */ clearHAlign: function() { return /* reexport safe */ _align__WEBPACK_IMPORTED_MODULE_0__.clearHAlign; },
|
|
9141
|
+
/* harmony export */ cns: function() { return /* reexport safe */ _mark_deprecated__WEBPACK_IMPORTED_MODULE_20__.cns; },
|
|
9074
9142
|
/* harmony export */ completeUrl: function() { return /* reexport safe */ _complete_url__WEBPACK_IMPORTED_MODULE_6__.completeUrl; },
|
|
9075
9143
|
/* harmony export */ connection: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.connection; },
|
|
9076
9144
|
/* harmony export */ convertMediaUrlToVideoEmbed: function() { return /* reexport safe */ _convert_media_url_to_video_embed__WEBPACK_IMPORTED_MODULE_8__.convertMediaUrlToVideoEmbed; },
|
|
9077
|
-
/* harmony export */ createMediaWrapper: function() { return /* reexport safe */
|
|
9145
|
+
/* harmony export */ createMediaWrapper: function() { return /* reexport safe */ _media_wrapper__WEBPACK_IMPORTED_MODULE_21__.createMediaWrapper; },
|
|
9078
9146
|
/* harmony export */ css: function() { return /* reexport safe */ _css__WEBPACK_IMPORTED_MODULE_9__.css; },
|
|
9079
9147
|
/* harmony export */ cssInline: function() { return /* reexport safe */ _css__WEBPACK_IMPORTED_MODULE_9__.cssInline; },
|
|
9080
|
-
/* harmony export */ cssPath: function() { return /* reexport safe */
|
|
9148
|
+
/* harmony export */ cssPath: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_27__.cssPath; },
|
|
9081
9149
|
/* harmony export */ ctrlKey: function() { return /* reexport safe */ _ctrl_key__WEBPACK_IMPORTED_MODULE_10__.ctrlKey; },
|
|
9082
9150
|
/* harmony export */ dataBind: function() { return /* reexport safe */ _data_bind__WEBPACK_IMPORTED_MODULE_11__.dataBind; },
|
|
9083
9151
|
/* harmony export */ defaultLanguage: function() { return /* reexport safe */ _default_language__WEBPACK_IMPORTED_MODULE_12__.defaultLanguage; },
|
|
@@ -9085,45 +9153,48 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
9085
9153
|
/* harmony export */ fastClone: function() { return /* reexport safe */ _extend__WEBPACK_IMPORTED_MODULE_14__.fastClone; },
|
|
9086
9154
|
/* harmony export */ get: function() { return /* reexport safe */ _get__WEBPACK_IMPORTED_MODULE_15__.get; },
|
|
9087
9155
|
/* harmony export */ getAlignClasses: function() { return /* reexport safe */ _align__WEBPACK_IMPORTED_MODULE_0__.getAlignClasses; },
|
|
9156
|
+
/* harmony export */ getCaptionWrapper: function() { return /* reexport safe */ _image_caption__WEBPACK_IMPORTED_MODULE_18__.getCaptionWrapper; },
|
|
9157
|
+
/* harmony export */ getCaptionedImage: function() { return /* reexport safe */ _image_caption__WEBPACK_IMPORTED_MODULE_18__.getCaptionedImage; },
|
|
9088
9158
|
/* harmony export */ getClassName: function() { return /* reexport safe */ _get_class_name__WEBPACK_IMPORTED_MODULE_16__.getClassName; },
|
|
9089
|
-
/* harmony export */ getDataTransfer: function() { return /* reexport safe */
|
|
9159
|
+
/* harmony export */ getDataTransfer: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_30__.getDataTransfer; },
|
|
9090
9160
|
/* harmony export */ getHAlign: function() { return /* reexport safe */ _align__WEBPACK_IMPORTED_MODULE_0__.getHAlign; },
|
|
9091
|
-
/* harmony export */
|
|
9092
|
-
/* harmony export */
|
|
9093
|
-
/* harmony export */
|
|
9094
|
-
/* harmony export */
|
|
9161
|
+
/* harmony export */ getImageCaption: function() { return /* reexport safe */ _image_caption__WEBPACK_IMPORTED_MODULE_18__.getImageCaption; },
|
|
9162
|
+
/* harmony export */ getMediaWrapper: function() { return /* reexport safe */ _media_wrapper__WEBPACK_IMPORTED_MODULE_21__.getMediaWrapper; },
|
|
9163
|
+
/* harmony export */ getPropertyDescriptor: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_30__.getPropertyDescriptor; },
|
|
9164
|
+
/* harmony export */ getWrappedMedia: function() { return /* reexport safe */ _media_wrapper__WEBPACK_IMPORTED_MODULE_21__.getWrappedMedia; },
|
|
9165
|
+
/* harmony export */ getXPathByElement: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_27__.getXPathByElement; },
|
|
9095
9166
|
/* harmony export */ hAlignElement: function() { return /* reexport safe */ _align__WEBPACK_IMPORTED_MODULE_0__.hAlignElement; },
|
|
9096
9167
|
/* harmony export */ humanSizeToBytes: function() { return /* reexport safe */ _human_size_to_bytes__WEBPACK_IMPORTED_MODULE_17__.humanSizeToBytes; },
|
|
9097
|
-
/* harmony export */ inView: function() { return /* reexport safe */
|
|
9168
|
+
/* harmony export */ inView: function() { return /* reexport safe */ _scroll_into_view__WEBPACK_IMPORTED_MODULE_26__.inView; },
|
|
9098
9169
|
/* harmony export */ isAtom: function() { return /* reexport safe */ _extend__WEBPACK_IMPORTED_MODULE_14__.isAtom; },
|
|
9099
|
-
/* harmony export */ isUnsafeProtoKey: function() { return /* reexport safe */
|
|
9170
|
+
/* harmony export */ isUnsafeProtoKey: function() { return /* reexport safe */ _is_unsafe_proto_key__WEBPACK_IMPORTED_MODULE_19__.isUnsafeProtoKey; },
|
|
9100
9171
|
/* harmony export */ keepNames: function() { return /* reexport safe */ _get_class_name__WEBPACK_IMPORTED_MODULE_16__.keepNames; },
|
|
9101
|
-
/* harmony export */ keys: function() { return /* reexport safe */
|
|
9102
|
-
/* harmony export */ loadImage: function() { return /* reexport safe */
|
|
9172
|
+
/* harmony export */ keys: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_30__.keys; },
|
|
9173
|
+
/* harmony export */ loadImage: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_30__.loadImage; },
|
|
9103
9174
|
/* harmony export */ loadNext: function() { return /* reexport safe */ _append_script__WEBPACK_IMPORTED_MODULE_1__.loadNext; },
|
|
9104
9175
|
/* harmony export */ loadNextStyle: function() { return /* reexport safe */ _append_script__WEBPACK_IMPORTED_MODULE_1__.loadNextStyle; },
|
|
9105
9176
|
/* harmony export */ markAsAtomic: function() { return /* reexport safe */ _extend__WEBPACK_IMPORTED_MODULE_14__.markAsAtomic; },
|
|
9106
|
-
/* harmony export */ markDeprecated: function() { return /* reexport safe */
|
|
9107
|
-
/* harmony export */ markOwner: function() { return /* reexport safe */
|
|
9108
|
-
/* harmony export */ memorizeExec: function() { return /* reexport safe */
|
|
9177
|
+
/* harmony export */ markDeprecated: function() { return /* reexport safe */ _mark_deprecated__WEBPACK_IMPORTED_MODULE_20__.markDeprecated; },
|
|
9178
|
+
/* harmony export */ markOwner: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_30__.markOwner; },
|
|
9179
|
+
/* harmony export */ memorizeExec: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_30__.memorizeExec; },
|
|
9109
9180
|
/* harmony export */ options: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.options; },
|
|
9110
|
-
/* harmony export */ parseQuery: function() { return /* reexport safe */
|
|
9111
|
-
/* harmony export */ prepareEmbedCode: function() { return /* reexport safe */
|
|
9112
|
-
/* harmony export */ prepareMedia: function() { return /* reexport safe */
|
|
9113
|
-
/* harmony export */ previewBox: function() { return /* reexport safe */
|
|
9114
|
-
/* harmony export */ refs: function() { return /* reexport safe */
|
|
9115
|
-
/* harmony export */ reset: function() { return /* reexport safe */
|
|
9116
|
-
/* harmony export */ resolveElement: function() { return /* reexport safe */
|
|
9117
|
-
/* harmony export */ scrollIntoViewIfNeeded: function() { return /* reexport safe */
|
|
9118
|
-
/* harmony export */ set: function() { return /* reexport safe */
|
|
9119
|
-
/* harmony export */ wrapMedia: function() { return /* reexport safe */
|
|
9181
|
+
/* harmony export */ parseQuery: function() { return /* reexport safe */ _parse_query__WEBPACK_IMPORTED_MODULE_22__.parseQuery; },
|
|
9182
|
+
/* harmony export */ prepareEmbedCode: function() { return /* reexport safe */ _prepare_media__WEBPACK_IMPORTED_MODULE_23__.prepareEmbedCode; },
|
|
9183
|
+
/* harmony export */ prepareMedia: function() { return /* reexport safe */ _prepare_media__WEBPACK_IMPORTED_MODULE_23__.prepareMedia; },
|
|
9184
|
+
/* harmony export */ previewBox: function() { return /* reexport safe */ _print__WEBPACK_IMPORTED_MODULE_24__.previewBox; },
|
|
9185
|
+
/* harmony export */ refs: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_27__.refs; },
|
|
9186
|
+
/* harmony export */ reset: function() { return /* reexport safe */ _reset__WEBPACK_IMPORTED_MODULE_25__.reset; },
|
|
9187
|
+
/* harmony export */ resolveElement: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_27__.resolveElement; },
|
|
9188
|
+
/* harmony export */ scrollIntoViewIfNeeded: function() { return /* reexport safe */ _scroll_into_view__WEBPACK_IMPORTED_MODULE_26__.scrollIntoViewIfNeeded; },
|
|
9189
|
+
/* harmony export */ set: function() { return /* reexport safe */ _set__WEBPACK_IMPORTED_MODULE_28__.set; },
|
|
9190
|
+
/* harmony export */ wrapMedia: function() { return /* reexport safe */ _media_wrapper__WEBPACK_IMPORTED_MODULE_21__.wrapMedia; }
|
|
9120
9191
|
/* harmony export */ });
|
|
9121
9192
|
/* harmony import */ var _align__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16849);
|
|
9122
9193
|
/* harmony import */ var _append_script__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(47760);
|
|
9123
9194
|
/* harmony import */ var _assert__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(28712);
|
|
9124
9195
|
/* harmony import */ var _assert__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_assert__WEBPACK_IMPORTED_MODULE_2__);
|
|
9125
9196
|
/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
9126
|
-
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _assert__WEBPACK_IMPORTED_MODULE_2__) if(["default","alignElement","clearAlign","getAlignClasses","getHAlign","hAlignElement","alreadyLoadedList","appendScriptAsync","appendStyleAsync","loadNext","loadNextStyle"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = function(key) { return _assert__WEBPACK_IMPORTED_MODULE_2__[key]; }.bind(0, __WEBPACK_IMPORT_KEY__)
|
|
9197
|
+
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _assert__WEBPACK_IMPORTED_MODULE_2__) if(["default","alignElement","clearAlign","clearHAlign","getAlignClasses","getHAlign","hAlignElement","alreadyLoadedList","appendScriptAsync","appendStyleAsync","loadNext","loadNextStyle"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = function(key) { return _assert__WEBPACK_IMPORTED_MODULE_2__[key]; }.bind(0, __WEBPACK_IMPORT_KEY__)
|
|
9127
9198
|
/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
9128
9199
|
/* harmony import */ var _attr__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7909);
|
|
9129
9200
|
/* harmony import */ var _browser__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(26136);
|
|
@@ -9140,18 +9211,19 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
9140
9211
|
/* harmony import */ var _get__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(89308);
|
|
9141
9212
|
/* harmony import */ var _get_class_name__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(421);
|
|
9142
9213
|
/* harmony import */ var _human_size_to_bytes__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(37427);
|
|
9143
|
-
/* harmony import */ var
|
|
9144
|
-
/* harmony import */ var
|
|
9145
|
-
/* harmony import */ var
|
|
9146
|
-
/* harmony import */ var
|
|
9147
|
-
/* harmony import */ var
|
|
9148
|
-
/* harmony import */ var
|
|
9149
|
-
/* harmony import */ var
|
|
9150
|
-
/* harmony import */ var
|
|
9151
|
-
/* harmony import */ var
|
|
9152
|
-
/* harmony import */ var
|
|
9153
|
-
/* harmony import */ var
|
|
9154
|
-
/* harmony import */ var
|
|
9214
|
+
/* harmony import */ var _image_caption__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(66638);
|
|
9215
|
+
/* harmony import */ var _is_unsafe_proto_key__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(78048);
|
|
9216
|
+
/* harmony import */ var _mark_deprecated__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(49385);
|
|
9217
|
+
/* harmony import */ var _media_wrapper__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(83314);
|
|
9218
|
+
/* harmony import */ var _parse_query__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(36310);
|
|
9219
|
+
/* harmony import */ var _prepare_media__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89214);
|
|
9220
|
+
/* harmony import */ var _print__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(57075);
|
|
9221
|
+
/* harmony import */ var _reset__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(43379);
|
|
9222
|
+
/* harmony import */ var _scroll_into_view__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(60898);
|
|
9223
|
+
/* harmony import */ var _selector__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(28723);
|
|
9224
|
+
/* harmony import */ var _set__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(52144);
|
|
9225
|
+
/* harmony import */ var _stack__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(42820);
|
|
9226
|
+
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(71125);
|
|
9155
9227
|
/*!
|
|
9156
9228
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
9157
9229
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -9188,6 +9260,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
9188
9260
|
|
|
9189
9261
|
|
|
9190
9262
|
|
|
9263
|
+
|
|
9191
9264
|
|
|
9192
9265
|
|
|
9193
9266
|
/***/ }),
|
|
@@ -11779,7 +11852,10 @@ class Selection {
|
|
|
11779
11852
|
/**
|
|
11780
11853
|
* Checks whether the editor currently in focus
|
|
11781
11854
|
*/ isFocused() {
|
|
11782
|
-
|
|
11855
|
+
const active = this.doc.activeElement;
|
|
11856
|
+
// An editable element inside the editor, as an image's caption, has the
|
|
11857
|
+
// focus while the caret is in it
|
|
11858
|
+
return Boolean(this.doc.hasFocus && this.doc.hasFocus() && active && (this.area === active || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isHTMLElement(active) && active.isContentEditable && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isOrContains(this.area, active)));
|
|
11783
11859
|
}
|
|
11784
11860
|
/**
|
|
11785
11861
|
* Returns the current element under the cursor inside editor
|
|
@@ -12242,12 +12318,21 @@ class Selection {
|
|
|
12242
12318
|
* there: the arrow keys then have nothing to move from and the selection
|
|
12243
12319
|
* cannot be escaped. Selecting the island itself keeps the range in editable
|
|
12244
12320
|
* content, so the caret can step over it. See #1184
|
|
12321
|
+
*
|
|
12322
|
+
* An editable element inside an island, as an image's caption, is editable
|
|
12323
|
+
* content of its own, so the search stops there.
|
|
12245
12324
|
*/ __closestNotEditable(node) {
|
|
12246
12325
|
const { area } = this;
|
|
12247
12326
|
let result = null, elm = node.parentNode;
|
|
12248
12327
|
while(elm && elm !== area && area.contains(elm)){
|
|
12249
|
-
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isElement(elm)
|
|
12250
|
-
|
|
12328
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isElement(elm)) {
|
|
12329
|
+
const editable = elm.getAttribute('contenteditable');
|
|
12330
|
+
if (editable === 'true') {
|
|
12331
|
+
break;
|
|
12332
|
+
}
|
|
12333
|
+
if (editable === 'false') {
|
|
12334
|
+
result = elm;
|
|
12335
|
+
}
|
|
12251
12336
|
}
|
|
12252
12337
|
elm = elm.parentNode;
|
|
12253
12338
|
}
|
|
@@ -13203,7 +13288,7 @@ function elementsEqualAttributes(elm1, elm2) {
|
|
|
13203
13288
|
/**
|
|
13204
13289
|
* Replaces `ul->ol` or `ol->ul`, apply styles to the list, or remove a list item from it
|
|
13205
13290
|
* @private
|
|
13206
|
-
*/ function toggleOrderedList(commitStyle, li, jodit, mode) {
|
|
13291
|
+
*/ function toggleOrderedList(commitStyle, li, jodit, mode, collapsed = false) {
|
|
13207
13292
|
if (!li) {
|
|
13208
13293
|
return mode;
|
|
13209
13294
|
}
|
|
@@ -13232,16 +13317,36 @@ function elementsEqualAttributes(elm1, elm2) {
|
|
|
13232
13317
|
}
|
|
13233
13318
|
// ul => ol, ol => ul or ul => ul.class1
|
|
13234
13319
|
if (mode === jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.REPLACE || isChangeMode || !isSameList) {
|
|
13235
|
-
|
|
13236
|
-
const
|
|
13320
|
+
// With just a caret, Word converts the whole list
|
|
13321
|
+
const items = collapsed && !isSameList ? Array.from(list.children).filter((item)=>jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isLeaf(item)) : [
|
|
13322
|
+
li
|
|
13323
|
+
];
|
|
13324
|
+
let newList;
|
|
13325
|
+
for (const item of items){
|
|
13326
|
+
newList = keepNumbering(item, (itemList)=>(0,_wrap_list__WEBPACK_IMPORTED_MODULE_7__.wrapList)(commitStyle, unwrapList(jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.REPLACE, itemList, item, jodit, commitStyle), jodit));
|
|
13327
|
+
}
|
|
13237
13328
|
hook(jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.REPLACE, newList, commitStyle);
|
|
13238
13329
|
return jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.REPLACE;
|
|
13239
13330
|
}
|
|
13240
13331
|
}
|
|
13241
|
-
const wrapper = unwrapList((/* inlined export .UNWRAP */"unwrap"),
|
|
13332
|
+
const wrapper = keepNumbering(li, (itemList)=>unwrapList((/* inlined export .UNWRAP */"unwrap"), itemList, li, jodit, commitStyle));
|
|
13242
13333
|
hook((/* inlined export .UNWRAP */"unwrap"), wrapper, commitStyle);
|
|
13243
13334
|
return (/* inlined export .UNWRAP */"unwrap");
|
|
13244
13335
|
}
|
|
13336
|
+
/**
|
|
13337
|
+
* Takes `item` out of its list with `takeOut`, and carries a numbered list's
|
|
13338
|
+
* count on past it, as Word does: 1, a bullet, then 2
|
|
13339
|
+
*/ function keepNumbering(item, takeOut) {
|
|
13340
|
+
const list = item.parentElement;
|
|
13341
|
+
const rest = item.nextElementSibling;
|
|
13342
|
+
const next = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(list, 'ol') ? (parseInt(list.getAttribute('start') || '1', 10) || 1) + Array.from(list.children).indexOf(item) : 0;
|
|
13343
|
+
const result = takeOut(list);
|
|
13344
|
+
const restList = rest?.parentElement;
|
|
13345
|
+
if (next && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(restList, 'ol')) {
|
|
13346
|
+
next > 1 ? restList.setAttribute('start', String(next)) : restList.removeAttribute('start');
|
|
13347
|
+
}
|
|
13348
|
+
return result;
|
|
13349
|
+
}
|
|
13245
13350
|
/**
|
|
13246
13351
|
* Other attributes, such as a class, still move the items into a new list,
|
|
13247
13352
|
* where the `beforeWrapList` hook can add markup to each of them
|
|
@@ -14017,7 +14122,7 @@ const transactions = {
|
|
|
14017
14122
|
exec (value) {
|
|
14018
14123
|
return {
|
|
14019
14124
|
...value,
|
|
14020
|
-
mode: (0,jodit_core_selection_style_api__WEBPACK_IMPORTED_MODULE_3__.toggleOrderedList)(value.style, value.element, value.jodit, value.mode),
|
|
14125
|
+
mode: (0,jodit_core_selection_style_api__WEBPACK_IMPORTED_MODULE_3__.toggleOrderedList)(value.style, value.element, value.jodit, value.mode, value.collapsed),
|
|
14021
14126
|
next: states.END
|
|
14022
14127
|
};
|
|
14023
14128
|
}
|
|
@@ -16962,6 +17067,35 @@ UISpacer = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_0__.__decorate)(
|
|
|
16962
17067
|
/* harmony export */ ]);
|
|
16963
17068
|
|
|
16964
17069
|
|
|
17070
|
+
/***/ }),
|
|
17071
|
+
|
|
17072
|
+
/***/ 29577:
|
|
17073
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
17074
|
+
|
|
17075
|
+
"use strict";
|
|
17076
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
17077
|
+
/* harmony export */ focusFormField: function() { return /* binding */ focusFormField; }
|
|
17078
|
+
/* harmony export */ });
|
|
17079
|
+
/* harmony import */ var jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(88475);
|
|
17080
|
+
/*!
|
|
17081
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
17082
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
17083
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
17084
|
+
*/ /**
|
|
17085
|
+
* @module ui
|
|
17086
|
+
*/
|
|
17087
|
+
/**
|
|
17088
|
+
* Focuses the first text field shown in a form inside `box`, so that typing
|
|
17089
|
+
* fills it in rather than replacing the selected content, as in a dialog. A
|
|
17090
|
+
* form round `box`, as the image properties dialog's round its tabs, doesn't
|
|
17091
|
+
* count, and neither do fields outside a form, as the color picker's
|
|
17092
|
+
*/ function focusFormField(box) {
|
|
17093
|
+
(0,jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_0__.toArray)(box.getElementsByTagName('form')).flatMap((form)=>(0,jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_0__.toArray)(form.querySelectorAll('input:not([type]), input[type="text"], input[type="url"], textarea'))).find((field)=>field.offsetParent)?.focus({
|
|
17094
|
+
preventScroll: true
|
|
17095
|
+
});
|
|
17096
|
+
}
|
|
17097
|
+
|
|
17098
|
+
|
|
16965
17099
|
/***/ }),
|
|
16966
17100
|
|
|
16967
17101
|
/***/ 15982:
|
|
@@ -18213,6 +18347,12 @@ View.defaultOptions = {
|
|
|
18213
18347
|
|
|
18214
18348
|
|
|
18215
18349
|
|
|
18350
|
+
const FOCUS_EVENTS = new Set([
|
|
18351
|
+
'focus',
|
|
18352
|
+
'blur',
|
|
18353
|
+
'focusin',
|
|
18354
|
+
'focusout'
|
|
18355
|
+
]);
|
|
18216
18356
|
const __defaultStyleDisplayKey = 'data-jodit-default-style-display';
|
|
18217
18357
|
const __defaultClassesKey = 'data-jodit-default-classes';
|
|
18218
18358
|
const NOEDIT = {
|
|
@@ -19250,16 +19390,30 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
19250
19390
|
if (place) {
|
|
19251
19391
|
this.setCurrentPlace(place);
|
|
19252
19392
|
}
|
|
19253
|
-
}).on(editor, 'compositionend', this.synchronizeValues).on(editor, 'selectionchange selectionstart keydown keyup input keypress dblclick mousedown mouseup ' + 'click copy cut dragstart drop dragover paste resize touchstart touchend focus blur', (event)=>{
|
|
19393
|
+
}).on(editor, 'compositionend', this.synchronizeValues).on(editor, 'selectionchange selectionstart keydown keyup input keypress dblclick mousedown mouseup ' + 'click copy cut dragstart drop dragover paste resize touchstart touchend focus blur focusin focusout', (event)=>{
|
|
19254
19394
|
if (this.o.readonly || this.__isSilentChange) {
|
|
19255
19395
|
return;
|
|
19256
19396
|
}
|
|
19397
|
+
let type = event.type;
|
|
19398
|
+
// `focus` and `blur` don't bubble from an editable element inside
|
|
19399
|
+
// the editor, as an image's caption, so `focusin` and `focusout`
|
|
19400
|
+
// stand in for them there. The focus moving between the editor
|
|
19401
|
+
// and such an element stays in the editor
|
|
19402
|
+
if (FOCUS_EVENTS.has(type)) {
|
|
19403
|
+
const inner = type === 'focusin' || type === 'focusout';
|
|
19404
|
+
if (inner === (event.target === editor) || jodit_modules__WEBPACK_IMPORTED_MODULE_10__.Dom.isOrContains(editor, event.relatedTarget)) {
|
|
19405
|
+
return;
|
|
19406
|
+
}
|
|
19407
|
+
if (inner) {
|
|
19408
|
+
type = type === 'focusin' ? 'focus' : 'blur';
|
|
19409
|
+
}
|
|
19410
|
+
}
|
|
19257
19411
|
const w = this.ew;
|
|
19258
19412
|
if (event instanceof w.KeyboardEvent && event.isComposing) {
|
|
19259
19413
|
return;
|
|
19260
19414
|
}
|
|
19261
19415
|
if (this.e && this.e.fire) {
|
|
19262
|
-
if (this.e.fire(
|
|
19416
|
+
if (this.e.fire(type, event) === false) {
|
|
19263
19417
|
return false;
|
|
19264
19418
|
}
|
|
19265
19419
|
this.synchronizeValues();
|
|
@@ -24382,6 +24536,11 @@ StatusBar = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)
|
|
|
24382
24536
|
|
|
24383
24537
|
|
|
24384
24538
|
|
|
24539
|
+
const SECTIONS = new Set([
|
|
24540
|
+
'thead',
|
|
24541
|
+
'tbody',
|
|
24542
|
+
'tfoot'
|
|
24543
|
+
]);
|
|
24385
24544
|
const markedValue = new WeakMap();
|
|
24386
24545
|
class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_1__.ViewComponent {
|
|
24387
24546
|
/** @override */ className() {
|
|
@@ -24540,7 +24699,13 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_1__.ViewCompon
|
|
|
24540
24699
|
}
|
|
24541
24700
|
});
|
|
24542
24701
|
}
|
|
24543
|
-
|
|
24702
|
+
const section = line && line.parentElement;
|
|
24703
|
+
// Below the header rows, a row is a body row
|
|
24704
|
+
if (after && line && !line.nextElementSibling && jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isTag(section, 'thead')) {
|
|
24705
|
+
const body = Table.__bodyOf(table, section, create);
|
|
24706
|
+
body.insertBefore(row, body.firstChild);
|
|
24707
|
+
Table.__setCellsTag(row, 'td', create);
|
|
24708
|
+
} else if (after && line && line.nextSibling) {
|
|
24544
24709
|
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.after(line, row);
|
|
24545
24710
|
} else if (!after && line) {
|
|
24546
24711
|
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.before(line, row);
|
|
@@ -24548,6 +24713,78 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_1__.ViewCompon
|
|
|
24548
24713
|
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);
|
|
24549
24714
|
}
|
|
24550
24715
|
}
|
|
24716
|
+
/**
|
|
24717
|
+
* The table's first `<tbody>`, made after `head` when there's none
|
|
24718
|
+
*/ static __bodyOf(table, head, create) {
|
|
24719
|
+
let body = table.tBodies[0];
|
|
24720
|
+
if (!body) {
|
|
24721
|
+
body = create.element('tbody');
|
|
24722
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.after(head, body);
|
|
24723
|
+
}
|
|
24724
|
+
return body;
|
|
24725
|
+
}
|
|
24726
|
+
/**
|
|
24727
|
+
* Makes the row's cells `<td>`, or `<th>` with a column scope unless they
|
|
24728
|
+
* have one, keeping their content and attributes. The cells it replaces
|
|
24729
|
+
* go in `replaced`, with their replacements
|
|
24730
|
+
*/ static __setCellsTag(row, tag, create, replaced) {
|
|
24731
|
+
;(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.toArray)(row.cells).forEach((cell)=>{
|
|
24732
|
+
const next = jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isTag(cell, tag) ? cell : jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.replace(cell, tag, create, true);
|
|
24733
|
+
if (next !== cell) {
|
|
24734
|
+
replaced?.set(cell, next);
|
|
24735
|
+
}
|
|
24736
|
+
if (tag === 'td') {
|
|
24737
|
+
(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(next, 'scope', null);
|
|
24738
|
+
} else if (!next.hasAttribute('scope')) {
|
|
24739
|
+
(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(next, 'scope', 'col');
|
|
24740
|
+
}
|
|
24741
|
+
});
|
|
24742
|
+
}
|
|
24743
|
+
/**
|
|
24744
|
+
* The table has a header row: a `<thead>` with a row in it
|
|
24745
|
+
*/ hasHeaderRow(table) {
|
|
24746
|
+
return Boolean(table.tHead?.rows.length);
|
|
24747
|
+
}
|
|
24748
|
+
/**
|
|
24749
|
+
* Header rows can always go back into the body. The first row can become
|
|
24750
|
+
* one unless a cell in it spans into the next, as a span can't cross from
|
|
24751
|
+
* the `<thead>` into the `<tbody>`
|
|
24752
|
+
*/ canToggleHeaderRow(table) {
|
|
24753
|
+
const [row] = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.toArray)(table.rows);
|
|
24754
|
+
return this.hasHeaderRow(table) || Boolean(row && (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.toArray)(row.cells).every((cell)=>cell.rowSpan < 2));
|
|
24755
|
+
}
|
|
24756
|
+
/**
|
|
24757
|
+
* Moves the first row into a `<thead>`, its cells becoming
|
|
24758
|
+
* `<th scope="col">`, or the header rows back to the start of the
|
|
24759
|
+
* `<tbody>` as `<td>`. Their content, attributes and spans stay. Returns
|
|
24760
|
+
* the cells it replaced, with their replacements
|
|
24761
|
+
*/ toggleHeaderRow(table) {
|
|
24762
|
+
const replaced = new Map();
|
|
24763
|
+
const create = this.j.createInside;
|
|
24764
|
+
const head = table.tHead;
|
|
24765
|
+
if (!this.canToggleHeaderRow(table)) {
|
|
24766
|
+
return replaced;
|
|
24767
|
+
}
|
|
24768
|
+
if (head && this.hasHeaderRow(table)) {
|
|
24769
|
+
const body = Table.__bodyOf(table, head, create);
|
|
24770
|
+
const first = body.firstChild;
|
|
24771
|
+
(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.toArray)(head.rows).forEach((row)=>{
|
|
24772
|
+
body.insertBefore(row, first);
|
|
24773
|
+
Table.__setCellsTag(row, 'td', create, replaced);
|
|
24774
|
+
});
|
|
24775
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.safeRemove(head);
|
|
24776
|
+
} else {
|
|
24777
|
+
const [row] = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.toArray)(table.rows);
|
|
24778
|
+
const thead = head || create.element('thead');
|
|
24779
|
+
if (!head) {
|
|
24780
|
+
// Setting it puts it after a caption and column groups
|
|
24781
|
+
table.tHead = thead;
|
|
24782
|
+
}
|
|
24783
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.append(thead, row);
|
|
24784
|
+
Table.__setCellsTag(row, 'th', create, replaced);
|
|
24785
|
+
}
|
|
24786
|
+
return replaced;
|
|
24787
|
+
}
|
|
24551
24788
|
/**
|
|
24552
24789
|
* Inserts a new line after row what contains the selected cell
|
|
24553
24790
|
*
|
|
@@ -24604,7 +24841,13 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_1__.ViewCompon
|
|
|
24604
24841
|
(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(cell, 'rowspan', rowSpan - 1 > 1 ? rowSpan - 1 : null);
|
|
24605
24842
|
}
|
|
24606
24843
|
});
|
|
24844
|
+
const section = row.parentElement;
|
|
24607
24845
|
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.safeRemove(row);
|
|
24846
|
+
// A section left without rows goes too, so a table whose header row
|
|
24847
|
+
// was deleted has no `<thead>`
|
|
24848
|
+
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isTag(section, SECTIONS) && !section.rows.length) {
|
|
24849
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.safeRemove(section);
|
|
24850
|
+
}
|
|
24608
24851
|
}
|
|
24609
24852
|
/**
|
|
24610
24853
|
* Remove row
|
|
@@ -25025,7 +25268,10 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_1__.ViewCompon
|
|
|
25025
25268
|
const selector = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.cssPath)(td);
|
|
25026
25269
|
selector && selectors.push(selector);
|
|
25027
25270
|
});
|
|
25028
|
-
|
|
25271
|
+
// Across cells, the browser's own text selection, which a drag makes
|
|
25272
|
+
// as well, isn't shown
|
|
25273
|
+
const hidden = selectors.length > 1 ? selectors.map((selector)=>`${selector}::selection,${selector} ::selection`).join(',') + '{background:transparent}' : '';
|
|
25274
|
+
style.innerHTML = selectors.length ? selectors.join(',') + `{${this.jodit.options.table.selectionCellStyle}}` + hidden : '';
|
|
25029
25275
|
}));
|
|
25030
25276
|
}
|
|
25031
25277
|
}
|
|
@@ -25063,10 +25309,11 @@ const instance = (j)=>j.getInstance('Table', j.o);
|
|
|
25063
25309
|
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(7909);
|
|
25064
25310
|
/* harmony import */ var jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(71125);
|
|
25065
25311
|
/* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(59400);
|
|
25066
|
-
/* harmony import */ var
|
|
25067
|
-
/* harmony import */ var
|
|
25068
|
-
/* harmony import */ var
|
|
25069
|
-
/* harmony import */ var
|
|
25312
|
+
/* harmony import */ var jodit_core_ui_helpers_focus_form_field__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(29577);
|
|
25313
|
+
/* harmony import */ var jodit_core_ui_helpers_get_control_type__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(15982);
|
|
25314
|
+
/* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(29434);
|
|
25315
|
+
/* harmony import */ var jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(51116);
|
|
25316
|
+
/* harmony import */ var _factory__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(4274);
|
|
25070
25317
|
/*!
|
|
25071
25318
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
25072
25319
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -25098,6 +25345,7 @@ const instance = (j)=>j.getInstance('Table', j.o);
|
|
|
25098
25345
|
|
|
25099
25346
|
|
|
25100
25347
|
|
|
25348
|
+
|
|
25101
25349
|
|
|
25102
25350
|
|
|
25103
25351
|
const INPUT_TAGS = new Set([
|
|
@@ -25200,7 +25448,7 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__.U
|
|
|
25200
25448
|
configurable: true
|
|
25201
25449
|
});
|
|
25202
25450
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.append(container, button);
|
|
25203
|
-
const trigger = this.j.c.fromHTML(`<span role="button" aria-haspopup="true" aria-expanded="false" class="${cn}__trigger">${
|
|
25451
|
+
const trigger = this.j.c.fromHTML(`<span role="button" aria-haspopup="true" aria-expanded="false" class="${cn}__trigger">${jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_22__.Icon.get('chevron')}</span>`);
|
|
25204
25452
|
// For caching
|
|
25205
25453
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.append(button, trigger);
|
|
25206
25454
|
return container;
|
|
@@ -25255,7 +25503,7 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__.U
|
|
|
25255
25503
|
state.icon.iconURL = ctr.iconURL;
|
|
25256
25504
|
} else {
|
|
25257
25505
|
const name = ctr.icon || ctr.name;
|
|
25258
|
-
state.icon.name =
|
|
25506
|
+
state.icon.name = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_22__.Icon.exists(name) || this.j.o.extraIcons?.[name] ? name : '';
|
|
25259
25507
|
}
|
|
25260
25508
|
if (!ctr.iconURL && !state.icon.name) {
|
|
25261
25509
|
state.text = ctr.text || ctr.name;
|
|
@@ -25285,6 +25533,9 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__.U
|
|
|
25285
25533
|
const elm = ctr.popup(this.j, target, this.__closePopup, this);
|
|
25286
25534
|
if (elm) {
|
|
25287
25535
|
popup.setContent((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_13__.isString)(elm) ? this.j.c.fromHTML(elm) : elm).open(()=>(0,jodit_core_helpers_size__WEBPACK_IMPORTED_MODULE_14__.position)(this.container), false, this.j.o.allowTabNavigation ? this.container : undefined);
|
|
25536
|
+
// The focus stays in the content for a list, which
|
|
25537
|
+
// typing searches, but goes to a form, as in a dialog
|
|
25538
|
+
(0,jodit_core_ui_helpers_focus_form_field__WEBPACK_IMPORTED_MODULE_20__.focusFormField)(popup.container);
|
|
25288
25539
|
} else {
|
|
25289
25540
|
this.__closePopup();
|
|
25290
25541
|
}
|
|
@@ -25424,7 +25675,7 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__.U
|
|
|
25424
25675
|
/**
|
|
25425
25676
|
* Create an open popup list
|
|
25426
25677
|
*/ __openControlList(control) {
|
|
25427
|
-
const controls = this.jodit.options.controls ?? {}, getControl = (key)=>(0,
|
|
25678
|
+
const controls = this.jodit.options.controls ?? {}, getControl = (key)=>(0,jodit_core_ui_helpers_get_control_type__WEBPACK_IMPORTED_MODULE_21__.findControlType)(key, controls);
|
|
25428
25679
|
const list = control.list;
|
|
25429
25680
|
const menu = this.openPopup();
|
|
25430
25681
|
menu.parentElement = this;
|
|
@@ -25432,7 +25683,7 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__.U
|
|
|
25432
25683
|
if (content) {
|
|
25433
25684
|
return this.__openMenu(menu, content);
|
|
25434
25685
|
}
|
|
25435
|
-
const toolbar = (0,
|
|
25686
|
+
const toolbar = (0,_factory__WEBPACK_IMPORTED_MODULE_24__.makeCollection)(this.j);
|
|
25436
25687
|
toolbar.parentElement = menu;
|
|
25437
25688
|
toolbar.mode = 'vertical';
|
|
25438
25689
|
const isListItem = (key)=>(0,jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_12__.isPlainObject)(key) && 'title' in key && 'value' in key;
|
|
@@ -25496,7 +25747,7 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__.U
|
|
|
25496
25747
|
}
|
|
25497
25748
|
openPopup() {
|
|
25498
25749
|
this.__closePopup();
|
|
25499
|
-
this.openedPopup = new
|
|
25750
|
+
this.openedPopup = new jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_23__.Popup(this.j, false);
|
|
25500
25751
|
this.j.e.on(this.ow, 'mousedown touchstart', this.onOutsideClick).on('escape closeAllPopups', this.onOutsideClick).on('keydown', this.__onEditorKeyDown).on(this.openedPopup.container, 'keydown', this.__onPopupKeyDown);
|
|
25501
25752
|
return this.openedPopup;
|
|
25502
25753
|
}
|
|
@@ -25514,15 +25765,18 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__.U
|
|
|
25514
25765
|
this.openedPopup = null;
|
|
25515
25766
|
this.j.e.off(this.ow, 'mousedown touchstart', this.onOutsideClick).off('escape closeAllPopups', this.onOutsideClick).off('keydown', this.__onEditorKeyDown);
|
|
25516
25767
|
// The keyboard brought the focus into the dropdown: give it back to
|
|
25517
|
-
// the button, otherwise it would fall out to the document
|
|
25518
|
-
|
|
25768
|
+
// the button, otherwise it would fall out to the document. A form
|
|
25769
|
+
// gives it back to the content, with the selection it was opened for
|
|
25770
|
+
const { activeElement } = this.od, hadFocus = activeElement && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isOrContains(popup.container, activeElement), inForm = hadFocus && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.closest(activeElement, 'form', popup.container);
|
|
25519
25771
|
this.state.activated = false;
|
|
25520
25772
|
popup.close();
|
|
25521
25773
|
popup.destruct();
|
|
25522
25774
|
if (this.trigger) {
|
|
25523
25775
|
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_17__.attr)(this.trigger, 'aria-expanded', false);
|
|
25524
25776
|
}
|
|
25525
|
-
if (
|
|
25777
|
+
if (inForm && (0,jodit_core_helpers_checker_is_jodit_object__WEBPACK_IMPORTED_MODULE_11__.isJoditObject)(this.j)) {
|
|
25778
|
+
this.j.s.focus();
|
|
25779
|
+
} else if (hadFocus) {
|
|
25526
25780
|
this.focus();
|
|
25527
25781
|
}
|
|
25528
25782
|
}
|
|
@@ -26515,6 +26769,7 @@ function readImagesWithReader(fileList, imagesExtensions, promises, uploader, ha
|
|
|
26515
26769
|
continue;
|
|
26516
26770
|
}
|
|
26517
26771
|
const reader = new FileReader();
|
|
26772
|
+
const { name } = file;
|
|
26518
26773
|
const readerPromise = uploader.j.async.promise((resolve, reject)=>{
|
|
26519
26774
|
reader.onerror = reject;
|
|
26520
26775
|
reader.onloadend = ()=>{
|
|
@@ -26525,6 +26780,9 @@ function readImagesWithReader(fileList, imagesExtensions, promises, uploader, ha
|
|
|
26525
26780
|
],
|
|
26526
26781
|
isImages: [
|
|
26527
26782
|
true
|
|
26783
|
+
],
|
|
26784
|
+
fileNames: [
|
|
26785
|
+
name
|
|
26528
26786
|
]
|
|
26529
26787
|
};
|
|
26530
26788
|
const handler = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.isFunction)(handlerSuccess) ? handlerSuccess : defaultHandlerSuccess;
|
|
@@ -27170,6 +27428,7 @@ function val(elm, name, value) {
|
|
|
27170
27428
|
/* harmony import */ var jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(91565);
|
|
27171
27429
|
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7909);
|
|
27172
27430
|
/* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4099);
|
|
27431
|
+
/* harmony import */ var jodit_core_ui_helpers_focus_form_field__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(29577);
|
|
27173
27432
|
/*!
|
|
27174
27433
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
27175
27434
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -27184,6 +27443,7 @@ function val(elm, name, value) {
|
|
|
27184
27443
|
|
|
27185
27444
|
|
|
27186
27445
|
|
|
27446
|
+
|
|
27187
27447
|
/**
|
|
27188
27448
|
* Build tabs system
|
|
27189
27449
|
*
|
|
@@ -27264,6 +27524,7 @@ function val(elm, name, value) {
|
|
|
27264
27524
|
if (state) {
|
|
27265
27525
|
state.activeTab = name;
|
|
27266
27526
|
}
|
|
27527
|
+
;(0,jodit_core_ui_helpers_focus_form_field__WEBPACK_IMPORTED_MODULE_5__.focusFormField)(tab);
|
|
27267
27528
|
return false;
|
|
27268
27529
|
});
|
|
27269
27530
|
nameToTab[name] = {
|
|
@@ -28185,6 +28446,12 @@ class backspace extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__.Plugin {
|
|
|
28185
28446
|
if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isOrContains(jodit.editor, fakeNode)) {
|
|
28186
28447
|
return;
|
|
28187
28448
|
}
|
|
28449
|
+
// An editable element inside non-editable content, as an image's
|
|
28450
|
+
// caption is, keeps the caret, so nothing past its edge goes
|
|
28451
|
+
const host = jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.closest(fakeNode, (elm)=>jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isElement(elm) && elm.hasAttribute('contenteditable') && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isContentEditable(elm.parentNode, jodit.editor), jodit.editor);
|
|
28452
|
+
if (host && sel.cursorInTheEdge(backspace, host, fakeNode)) {
|
|
28453
|
+
return false;
|
|
28454
|
+
}
|
|
28188
28455
|
if (jodit.e.fire('backSpaceBeforeCases', backspace, fakeNode)) {
|
|
28189
28456
|
return false;
|
|
28190
28457
|
}
|
|
@@ -28232,7 +28499,13 @@ class backspace extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__.Plugin {
|
|
|
28232
28499
|
if (!range.collapsed || !around.isPointInRange(range.startContainer, range.startOffset)) {
|
|
28233
28500
|
return;
|
|
28234
28501
|
}
|
|
28235
|
-
|
|
28502
|
+
// The search for text skips text of only non-breaking spaces, but the
|
|
28503
|
+
// browser types after it
|
|
28504
|
+
let before = fakeNode.previousSibling;
|
|
28505
|
+
while(jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isText(before) && !/\S|\u00A0/.test(before.data)){
|
|
28506
|
+
before = before.previousSibling;
|
|
28507
|
+
}
|
|
28508
|
+
const text = jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isText(before) ? before : (0,_helpers__WEBPACK_IMPORTED_MODULE_10__.findMostNestedNeighbor)(fakeNode, false, jodit.editor, true);
|
|
28236
28509
|
const link = jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.closest(text, 'a', jodit.editor);
|
|
28237
28510
|
if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isText(text) || !jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isContentEditable(text, jodit.editor) || link && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isOrContains(link, fakeNode) || jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.closest(text, jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isBlock, jodit.editor) !== jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.closest(fakeNode, jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isBlock, jodit.editor)) {
|
|
28238
28511
|
return;
|
|
@@ -28818,7 +29091,7 @@ function checkRemoveChar(jodit, fakeNode, backspace, mode, stopBeforeSpace = fal
|
|
|
28818
29091
|
}
|
|
28819
29092
|
if (charRemoved) {
|
|
28820
29093
|
removeEmptyForParent(fakeNode, 'a');
|
|
28821
|
-
addBRInsideEmptyBlock(jodit, fakeNode);
|
|
29094
|
+
(0,jodit_plugins_backspace_helpers__WEBPACK_IMPORTED_MODULE_3__.addBRInsideEmptyBlock)(jodit, fakeNode);
|
|
28822
29095
|
jodit.s.setCursorBefore(fakeNode);
|
|
28823
29096
|
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(fakeNode.previousSibling, 'br') && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.findNotEmptySibling(fakeNode, false)) {
|
|
28824
29097
|
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.after(fakeNode, jodit.createInside.element('br'));
|
|
@@ -28853,13 +29126,6 @@ function getNextInlineSibling(sibling, backspace, root) {
|
|
|
28853
29126
|
parent = p;
|
|
28854
29127
|
}
|
|
28855
29128
|
}
|
|
28856
|
-
/**
|
|
28857
|
-
* Helper add BR element inside empty block element
|
|
28858
|
-
*/ function addBRInsideEmptyBlock(jodit, node) {
|
|
28859
|
-
if (node.parentElement !== jodit.editor && jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(node.parentElement) && jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.each(node.parentElement, jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmptyTextNode)) {
|
|
28860
|
-
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.after(node, jodit.createInside.element('br'));
|
|
28861
|
-
}
|
|
28862
|
-
}
|
|
28863
29129
|
function tryRemoveChar(sibling, backspace, step, anotherSibling) {
|
|
28864
29130
|
// For Unicode escapes
|
|
28865
29131
|
let value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.toArray)(sibling.nodeValue);
|
|
@@ -29447,6 +29713,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.delete = {
|
|
|
29447
29713
|
|
|
29448
29714
|
"use strict";
|
|
29449
29715
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
29716
|
+
/* harmony export */ addBRInsideEmptyBlock: function() { return /* binding */ addBRInsideEmptyBlock; },
|
|
29450
29717
|
/* harmony export */ findMostNestedNeighbor: function() { return /* binding */ findMostNestedNeighbor; },
|
|
29451
29718
|
/* harmony export */ getMoveFilter: function() { return /* binding */ getMoveFilter; }
|
|
29452
29719
|
/* harmony export */ });
|
|
@@ -29484,6 +29751,14 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.delete = {
|
|
|
29484
29751
|
*/ function getMoveFilter(jodit) {
|
|
29485
29752
|
return (node)=>jodit.e.fire('backSpaceIsMovedIgnore', node) !== true;
|
|
29486
29753
|
}
|
|
29754
|
+
/**
|
|
29755
|
+
* Helper add BR element inside empty block element
|
|
29756
|
+
* @private
|
|
29757
|
+
*/ function addBRInsideEmptyBlock(jodit, node) {
|
|
29758
|
+
if (node.parentElement !== jodit.editor && jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock(node.parentElement) && jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.each(node.parentElement, jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmptyTextNode)) {
|
|
29759
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.after(node, jodit.createInside.element('br'));
|
|
29760
|
+
}
|
|
29761
|
+
}
|
|
29487
29762
|
|
|
29488
29763
|
|
|
29489
29764
|
/***/ }),
|
|
@@ -29868,7 +30143,7 @@ class cleanHtml extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_7__.Pl
|
|
|
29868
30143
|
beforeCommand(command) {
|
|
29869
30144
|
if (command.toLowerCase() === 'removeformat') {
|
|
29870
30145
|
if (this.j.s.isCollapsed()) {
|
|
29871
|
-
(0,_helpers__WEBPACK_IMPORTED_MODULE_10__.
|
|
30146
|
+
(0,_helpers__WEBPACK_IMPORTED_MODULE_10__.removeFormatForWord)(this.j);
|
|
29872
30147
|
} else {
|
|
29873
30148
|
(0,_helpers__WEBPACK_IMPORTED_MODULE_10__.removeFormatForSelection)(this.j);
|
|
29874
30149
|
}
|
|
@@ -30167,16 +30442,17 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.controls.eraser = {
|
|
|
30167
30442
|
"use strict";
|
|
30168
30443
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
30169
30444
|
/* harmony export */ getHash: function() { return /* reexport safe */ _get_hash__WEBPACK_IMPORTED_MODULE_0__.getHash; },
|
|
30170
|
-
/* harmony export */ removeFormatForCollapsedSelection: function() { return /* reexport safe */ _remove_format_remove_format_for_collapsed_selection__WEBPACK_IMPORTED_MODULE_1__.removeFormatForCollapsedSelection; },
|
|
30171
30445
|
/* harmony export */ removeFormatForSelection: function() { return /* reexport safe */ _remove_format_remove_format_for_selection__WEBPACK_IMPORTED_MODULE_2__.removeFormatForSelection; },
|
|
30172
|
-
/* harmony export */
|
|
30173
|
-
/* harmony export */
|
|
30446
|
+
/* harmony export */ removeFormatForWord: function() { return /* reexport safe */ _remove_format_remove_format_for_word__WEBPACK_IMPORTED_MODULE_3__.removeFormatForWord; },
|
|
30447
|
+
/* harmony export */ removePlaceholderBr: function() { return /* reexport safe */ _remove_placeholder_br__WEBPACK_IMPORTED_MODULE_4__.removePlaceholderBr; },
|
|
30448
|
+
/* harmony export */ visitNodeWalker: function() { return /* reexport safe */ _visitor_visit_node_walker__WEBPACK_IMPORTED_MODULE_5__.visitNodeWalker; }
|
|
30174
30449
|
/* harmony export */ });
|
|
30175
30450
|
/* harmony import */ var _get_hash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5650);
|
|
30176
30451
|
/* harmony import */ var _remove_format_remove_format_for_collapsed_selection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(37431);
|
|
30177
30452
|
/* harmony import */ var _remove_format_remove_format_for_selection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(70195);
|
|
30178
|
-
/* harmony import */ var
|
|
30179
|
-
/* harmony import */ var
|
|
30453
|
+
/* harmony import */ var _remove_format_remove_format_for_word__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(54189);
|
|
30454
|
+
/* harmony import */ var _remove_placeholder_br__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(53626);
|
|
30455
|
+
/* harmony import */ var _visitor_visit_node_walker__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(45219);
|
|
30180
30456
|
/*!
|
|
30181
30457
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
30182
30458
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -30191,6 +30467,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.controls.eraser = {
|
|
|
30191
30467
|
|
|
30192
30468
|
|
|
30193
30469
|
|
|
30470
|
+
|
|
30194
30471
|
/***/ }),
|
|
30195
30472
|
|
|
30196
30473
|
/***/ 28665:
|
|
@@ -30350,6 +30627,127 @@ const VIMEO_EMBED = /^(https?:)?\/\/player\.vimeo\.com\/video\//i;
|
|
|
30350
30627
|
}
|
|
30351
30628
|
|
|
30352
30629
|
|
|
30630
|
+
/***/ }),
|
|
30631
|
+
|
|
30632
|
+
/***/ 54189:
|
|
30633
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
30634
|
+
|
|
30635
|
+
"use strict";
|
|
30636
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
30637
|
+
/* harmony export */ removeFormatForWord: function() { return /* binding */ removeFormatForWord; }
|
|
30638
|
+
/* harmony export */ });
|
|
30639
|
+
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
|
|
30640
|
+
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
|
|
30641
|
+
/* harmony import */ var _remove_format_for_selection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(70195);
|
|
30642
|
+
/*!
|
|
30643
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
30644
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
30645
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
30646
|
+
*/ /**
|
|
30647
|
+
* @module plugins/clean-html
|
|
30648
|
+
*/
|
|
30649
|
+
|
|
30650
|
+
|
|
30651
|
+
/**
|
|
30652
|
+
* With just a caret, Word clears the formatting of the word the caret is
|
|
30653
|
+
* inside, and does nothing at a word's start or end. This selects the word,
|
|
30654
|
+
* clears it as a selection, and puts the caret back where it was.
|
|
30655
|
+
* @private
|
|
30656
|
+
*/ function removeFormatForWord(jodit) {
|
|
30657
|
+
const { range } = jodit.s;
|
|
30658
|
+
const block = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(range.startContainer, jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock, jodit.editor);
|
|
30659
|
+
if (!block) {
|
|
30660
|
+
return;
|
|
30661
|
+
}
|
|
30662
|
+
const texts = textsOf(block);
|
|
30663
|
+
const text = texts.map((node)=>jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isText(node) ? node.nodeValue : ' ').join('');
|
|
30664
|
+
const at = textOffset(texts, range);
|
|
30665
|
+
if (!isWordChar(text[at - 1]) || !isWordChar(text[at])) {
|
|
30666
|
+
return;
|
|
30667
|
+
}
|
|
30668
|
+
let start = at, end = at;
|
|
30669
|
+
while(isWordChar(text[start - 1])){
|
|
30670
|
+
start -= 1;
|
|
30671
|
+
}
|
|
30672
|
+
while(isWordChar(text[end])){
|
|
30673
|
+
end += 1;
|
|
30674
|
+
}
|
|
30675
|
+
const word = jodit.s.createRange();
|
|
30676
|
+
word.setStart(...positionAt(texts, start, true));
|
|
30677
|
+
word.setEnd(...positionAt(texts, end, false));
|
|
30678
|
+
jodit.s.selectRange(word);
|
|
30679
|
+
(0,_remove_format_for_selection__WEBPACK_IMPORTED_MODULE_2__.removeFormatForSelection)(jodit);
|
|
30680
|
+
// The text is the same, so the caret goes back to the same character
|
|
30681
|
+
const caret = jodit.s.createRange();
|
|
30682
|
+
caret.setStart(...positionAt(textsOf(block), at, false));
|
|
30683
|
+
jodit.s.selectRange(caret);
|
|
30684
|
+
}
|
|
30685
|
+
function isWordChar(char) {
|
|
30686
|
+
return Boolean(char && char !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE && /\S/.test(char));
|
|
30687
|
+
}
|
|
30688
|
+
/**
|
|
30689
|
+
* The block's own text nodes, in order, leaving out those of blocks inside
|
|
30690
|
+
* it. A line break, an image or another inseparable element ends a word, so
|
|
30691
|
+
* it is kept as a one-character piece
|
|
30692
|
+
*/ function textsOf(block) {
|
|
30693
|
+
const texts = [];
|
|
30694
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.each(block, (node)=>{
|
|
30695
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(node, jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock, block)) {
|
|
30696
|
+
return;
|
|
30697
|
+
}
|
|
30698
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isText(node) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(node, jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INSEPARABLE_TAGS)) {
|
|
30699
|
+
texts.push(node);
|
|
30700
|
+
}
|
|
30701
|
+
});
|
|
30702
|
+
return texts;
|
|
30703
|
+
}
|
|
30704
|
+
function lengthOf(piece) {
|
|
30705
|
+
return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isText(piece) ? piece.nodeValue?.length ?? 0 : 1;
|
|
30706
|
+
}
|
|
30707
|
+
/**
|
|
30708
|
+
* How many characters of `texts` come before the caret, which can be in a
|
|
30709
|
+
* text node or between nodes
|
|
30710
|
+
*/ function textOffset(texts, caret) {
|
|
30711
|
+
let at = 0;
|
|
30712
|
+
for (const piece of texts){
|
|
30713
|
+
if (piece === caret.startContainer) {
|
|
30714
|
+
return at + caret.startOffset;
|
|
30715
|
+
}
|
|
30716
|
+
const length = lengthOf(piece);
|
|
30717
|
+
// This piece ends after the caret, so the caret is before it
|
|
30718
|
+
if (caret.comparePoint(piece, jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isText(piece) ? length : 0) > 0) {
|
|
30719
|
+
return at;
|
|
30720
|
+
}
|
|
30721
|
+
at += length;
|
|
30722
|
+
}
|
|
30723
|
+
return at;
|
|
30724
|
+
}
|
|
30725
|
+
/**
|
|
30726
|
+
* The text node and offset of the `at`th character. Where two text nodes
|
|
30727
|
+
* meet, `later` picks the start of the second over the end of the first
|
|
30728
|
+
*/ function positionAt(texts, at, later) {
|
|
30729
|
+
let before = 0;
|
|
30730
|
+
let last = null;
|
|
30731
|
+
for (const piece of texts){
|
|
30732
|
+
const length = lengthOf(piece);
|
|
30733
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isText(piece) && (at < before + length || !later && at === before + length)) {
|
|
30734
|
+
return [
|
|
30735
|
+
piece,
|
|
30736
|
+
at - before
|
|
30737
|
+
];
|
|
30738
|
+
}
|
|
30739
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isText(piece)) {
|
|
30740
|
+
last = piece;
|
|
30741
|
+
}
|
|
30742
|
+
before += length;
|
|
30743
|
+
}
|
|
30744
|
+
return [
|
|
30745
|
+
last,
|
|
30746
|
+
last?.nodeValue?.length ?? 0
|
|
30747
|
+
];
|
|
30748
|
+
}
|
|
30749
|
+
|
|
30750
|
+
|
|
30353
30751
|
/***/ }),
|
|
30354
30752
|
|
|
30355
30753
|
/***/ 53626:
|
|
@@ -31999,7 +32397,8 @@ var DragState = /*#__PURE__*/ (/* unused pure expression or super */ null && (fu
|
|
|
31999
32397
|
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isTag(lastTarget.parentElement, 'a') && lastTarget.parentElement.firstChild === lastTarget && lastTarget.parentElement.lastChild === lastTarget) {
|
|
32000
32398
|
lastTarget = lastTarget.parentElement;
|
|
32001
32399
|
}
|
|
32002
|
-
|
|
32400
|
+
// A captioned image goes with its caption
|
|
32401
|
+
this.startDragging((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.getCaptionWrapper)(this.j, lastTarget) ?? lastTarget, event);
|
|
32003
32402
|
}
|
|
32004
32403
|
/**
|
|
32005
32404
|
* Prepare the ghost element and switch to the waiting state.
|
|
@@ -34051,8 +34450,9 @@ const libraries = new Map();
|
|
|
34051
34450
|
/* harmony import */ var jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(62101);
|
|
34052
34451
|
/* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(29434);
|
|
34053
34452
|
/* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5266);
|
|
34054
|
-
/* harmony import */ var
|
|
34055
|
-
/* harmony import */ var
|
|
34453
|
+
/* harmony import */ var _content_fonts__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(50995);
|
|
34454
|
+
/* harmony import */ var _paragraph_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(29348);
|
|
34455
|
+
/* harmony import */ var _paragraph_svg__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_paragraph_svg__WEBPACK_IMPORTED_MODULE_5__);
|
|
34056
34456
|
/*!
|
|
34057
34457
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
34058
34458
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -34064,7 +34464,39 @@ const libraries = new Map();
|
|
|
34064
34464
|
|
|
34065
34465
|
|
|
34066
34466
|
|
|
34067
|
-
|
|
34467
|
+
|
|
34468
|
+
jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_2__.Icon.set('paragraph', (_paragraph_svg__WEBPACK_IMPORTED_MODULE_5___default()));
|
|
34469
|
+
jodit_config__WEBPACK_IMPORTED_MODULE_3__.Config.prototype.formatBlock = {
|
|
34470
|
+
// Opt in: previews keep the toolbar's styles unless the integrator lists
|
|
34471
|
+
// the properties to copy, e.g. ['font-family', 'font-weight', 'color']
|
|
34472
|
+
previewProperties: []
|
|
34473
|
+
};
|
|
34474
|
+
/**
|
|
34475
|
+
* The list is outside the editing area, and in iframe mode outside its
|
|
34476
|
+
* document, so a preview would take the toolbar's styles. This reads how the
|
|
34477
|
+
* content shows a tag from a probe in the editing area
|
|
34478
|
+
*/ function previewStyle(editor, tag) {
|
|
34479
|
+
const { previewProperties } = editor.o.formatBlock;
|
|
34480
|
+
if (!previewProperties.length) {
|
|
34481
|
+
return '';
|
|
34482
|
+
}
|
|
34483
|
+
const probe = editor.createInside.element(tag, {
|
|
34484
|
+
style: 'display: none'
|
|
34485
|
+
});
|
|
34486
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.append(editor.editor, probe);
|
|
34487
|
+
const style = editor.ew.getComputedStyle(probe);
|
|
34488
|
+
const size = parseFloat(style.fontSize) || 16;
|
|
34489
|
+
const css = previewProperties.map((prop)=>{
|
|
34490
|
+
let value = style.getPropertyValue(prop);
|
|
34491
|
+
if (value && prop === 'font-family') {
|
|
34492
|
+
value = (0,_content_fonts__WEBPACK_IMPORTED_MODULE_4__.withContentFonts)(editor, value);
|
|
34493
|
+
}
|
|
34494
|
+
// Each browser knows only one of the smoothing properties
|
|
34495
|
+
return value ? `;${prop}:${value.replace(/(-?[\d.]+)px/g, (_, px)=>`${parseFloat(px) / size}em`).replace(/"/g, "'")}` : '';
|
|
34496
|
+
}).join('');
|
|
34497
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(probe);
|
|
34498
|
+
return css;
|
|
34499
|
+
}
|
|
34068
34500
|
jodit_config__WEBPACK_IMPORTED_MODULE_3__.Config.prototype.controls.paragraph = {
|
|
34069
34501
|
command: 'formatBlock',
|
|
34070
34502
|
value (editor, button) {
|
|
@@ -34103,11 +34535,164 @@ jodit_config__WEBPACK_IMPORTED_MODULE_3__.Config.prototype.controls.paragraph =
|
|
|
34103
34535
|
isActive: (editor, button)=>{
|
|
34104
34536
|
return button.state.value !== editor.o.enter && (0,jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(button.control.list) && Boolean(button.control.list[button.state.value]);
|
|
34105
34537
|
},
|
|
34106
|
-
childTemplate: (e, key, value)=>`<${key} style="margin:0;padding:0"><span>${e.i18n(value)}</span></${key}>`,
|
|
34538
|
+
childTemplate: (e, key, value)=>`<${key} style="margin:0;padding:0${previewStyle(e, key)}"><span>${e.i18n(value)}</span></${key}>`,
|
|
34107
34539
|
tooltip: 'Insert format block'
|
|
34108
34540
|
};
|
|
34109
34541
|
|
|
34110
34542
|
|
|
34543
|
+
/***/ }),
|
|
34544
|
+
|
|
34545
|
+
/***/ 50995:
|
|
34546
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
34547
|
+
|
|
34548
|
+
"use strict";
|
|
34549
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
34550
|
+
/* harmony export */ withContentFonts: function() { return /* binding */ withContentFonts; }
|
|
34551
|
+
/* harmony export */ });
|
|
34552
|
+
/*!
|
|
34553
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
34554
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
34555
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
34556
|
+
*/ /**
|
|
34557
|
+
* @module plugins/format-block
|
|
34558
|
+
*/ const carried = new WeakMap();
|
|
34559
|
+
const fetched = new Map();
|
|
34560
|
+
let editors = 0;
|
|
34561
|
+
/**
|
|
34562
|
+
* In iframe mode the content's web fonts load only in the iframe, but the
|
|
34563
|
+
* Paragraph list is in the page, so its previews would fall back to the
|
|
34564
|
+
* page's fonts. This adds the content's web fonts to the page under names
|
|
34565
|
+
* only this editor uses, so nothing else on the page can pick them up, and
|
|
34566
|
+
* puts those names first in a preview's `font-family`
|
|
34567
|
+
*/ function withContentFonts(editor, fontFamily) {
|
|
34568
|
+
const { ed, od } = editor;
|
|
34569
|
+
if (ed === od) {
|
|
34570
|
+
return fontFamily;
|
|
34571
|
+
}
|
|
34572
|
+
const state = carriedFor(editor);
|
|
34573
|
+
carry(editor, state);
|
|
34574
|
+
const webFonts = new Set();
|
|
34575
|
+
ed.fonts.forEach((face)=>webFonts.add(familyName(face.family)));
|
|
34576
|
+
return fontFamily.split(',').map((family)=>{
|
|
34577
|
+
const name = familyName(family);
|
|
34578
|
+
return webFonts.has(name) ? `"${state.prefix}${name}", ${family.trim()}` : family.trim();
|
|
34579
|
+
}).join(', ');
|
|
34580
|
+
}
|
|
34581
|
+
function carriedFor(editor) {
|
|
34582
|
+
let state = carried.get(editor);
|
|
34583
|
+
if (!state) {
|
|
34584
|
+
const { od } = editor;
|
|
34585
|
+
const created = {
|
|
34586
|
+
prefix: `jodit-preview-${++editors}-`,
|
|
34587
|
+
faces: new Map(),
|
|
34588
|
+
pending: false
|
|
34589
|
+
};
|
|
34590
|
+
carried.set(editor, created);
|
|
34591
|
+
editor.e.on('beforeDestruct', ()=>created.faces.forEach((face)=>od.fonts.delete(face)));
|
|
34592
|
+
state = created;
|
|
34593
|
+
}
|
|
34594
|
+
return state;
|
|
34595
|
+
}
|
|
34596
|
+
/**
|
|
34597
|
+
* It looks each time the list opens, since the content's stylesheets may
|
|
34598
|
+
* still have been loading the time before
|
|
34599
|
+
*/ function carry(editor, state) {
|
|
34600
|
+
// Every preview in the list asks, but one look is enough
|
|
34601
|
+
if (state.pending) {
|
|
34602
|
+
return;
|
|
34603
|
+
}
|
|
34604
|
+
state.pending = true;
|
|
34605
|
+
const { ed, od } = editor;
|
|
34606
|
+
Promise.all(Array.from(ed.styleSheets, (sheet)=>fontsOf(sheet, ed.baseURI))).then((lists)=>{
|
|
34607
|
+
state.pending = false;
|
|
34608
|
+
if (editor.isInDestruct) {
|
|
34609
|
+
return;
|
|
34610
|
+
}
|
|
34611
|
+
lists.flat().forEach((font)=>{
|
|
34612
|
+
const key = JSON.stringify(font);
|
|
34613
|
+
if (!state.faces.has(key)) {
|
|
34614
|
+
const face = new FontFace(state.prefix + font.family, font.source, font.descriptors);
|
|
34615
|
+
od.fonts.add(face);
|
|
34616
|
+
state.faces.set(key, face);
|
|
34617
|
+
}
|
|
34618
|
+
});
|
|
34619
|
+
});
|
|
34620
|
+
}
|
|
34621
|
+
/**
|
|
34622
|
+
* The web fonts a stylesheet and those it imports declare
|
|
34623
|
+
*/ function fontsOf(sheet, base) {
|
|
34624
|
+
let rules;
|
|
34625
|
+
try {
|
|
34626
|
+
rules = sheet.cssRules;
|
|
34627
|
+
} catch {
|
|
34628
|
+
// Another site's stylesheet can't be read, but it can be fetched if
|
|
34629
|
+
// the site allows it, as Google Fonts does
|
|
34630
|
+
const { href } = sheet;
|
|
34631
|
+
if (!href) {
|
|
34632
|
+
return Promise.resolve([]);
|
|
34633
|
+
}
|
|
34634
|
+
let fonts = fetched.get(href);
|
|
34635
|
+
if (!fonts) {
|
|
34636
|
+
fonts = fetchFonts(href);
|
|
34637
|
+
fetched.set(href, fonts);
|
|
34638
|
+
}
|
|
34639
|
+
return fonts;
|
|
34640
|
+
}
|
|
34641
|
+
return fontsIn(rules, sheet.href ?? base);
|
|
34642
|
+
}
|
|
34643
|
+
function fontsIn(rules, base) {
|
|
34644
|
+
return Promise.all(Array.from(rules, (rule)=>{
|
|
34645
|
+
if ('styleSheet' in rule) {
|
|
34646
|
+
const { styleSheet } = rule;
|
|
34647
|
+
return styleSheet ? fontsOf(styleSheet, base) : [];
|
|
34648
|
+
}
|
|
34649
|
+
if ('cssRules' in rule) {
|
|
34650
|
+
return fontsIn(rule.cssRules, base);
|
|
34651
|
+
}
|
|
34652
|
+
return rule.cssText.startsWith('@font-face') ? [
|
|
34653
|
+
fontOf(rule, base)
|
|
34654
|
+
] : [];
|
|
34655
|
+
})).then((lists)=>lists.flat());
|
|
34656
|
+
}
|
|
34657
|
+
function fontOf(rule, base) {
|
|
34658
|
+
const value = (prop)=>rule.style.getPropertyValue(prop) || undefined;
|
|
34659
|
+
return {
|
|
34660
|
+
family: familyName(rule.style.getPropertyValue('font-family')),
|
|
34661
|
+
source: withAbsoluteUrls(rule.style.getPropertyValue('src'), base),
|
|
34662
|
+
descriptors: {
|
|
34663
|
+
style: value('font-style'),
|
|
34664
|
+
weight: value('font-weight'),
|
|
34665
|
+
stretch: value('font-stretch'),
|
|
34666
|
+
unicodeRange: value('unicode-range')
|
|
34667
|
+
}
|
|
34668
|
+
};
|
|
34669
|
+
}
|
|
34670
|
+
function fetchFonts(href) {
|
|
34671
|
+
return fetch(href).then((response)=>response.text()).then((text)=>{
|
|
34672
|
+
const doc = document.implementation.createHTMLDocument('');
|
|
34673
|
+
const style = doc.createElement('style');
|
|
34674
|
+
style.textContent = text;
|
|
34675
|
+
doc.head.appendChild(style);
|
|
34676
|
+
return style.sheet ? fontsIn(style.sheet.cssRules, href) : [];
|
|
34677
|
+
}).catch(()=>[]);
|
|
34678
|
+
}
|
|
34679
|
+
function familyName(family) {
|
|
34680
|
+
return family.replace(/["']/g, '').trim().toLowerCase();
|
|
34681
|
+
}
|
|
34682
|
+
/**
|
|
34683
|
+
* The fonts are added to the page, so a relative URL would point somewhere
|
|
34684
|
+
* else
|
|
34685
|
+
*/ function withAbsoluteUrls(css, base) {
|
|
34686
|
+
return css.replace(/url\(\s*(["']?)(.*?)\1\s*\)/g, (match, quote, url)=>{
|
|
34687
|
+
try {
|
|
34688
|
+
return `url("${new URL(url, base).href}")`;
|
|
34689
|
+
} catch {
|
|
34690
|
+
return match;
|
|
34691
|
+
}
|
|
34692
|
+
});
|
|
34693
|
+
}
|
|
34694
|
+
|
|
34695
|
+
|
|
34111
34696
|
/***/ }),
|
|
34112
34697
|
|
|
34113
34698
|
/***/ 53390:
|
|
@@ -34790,6 +35375,806 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeSandbox = null;
|
|
|
34790
35375
|
jodit_core_global__WEBPACK_IMPORTED_MODULE_2__.pluginSystem.add('iframe', iframe);
|
|
34791
35376
|
|
|
34792
35377
|
|
|
35378
|
+
/***/ }),
|
|
35379
|
+
|
|
35380
|
+
/***/ 61396:
|
|
35381
|
+
/***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
|
|
35382
|
+
|
|
35383
|
+
"use strict";
|
|
35384
|
+
/* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5266);
|
|
35385
|
+
/*!
|
|
35386
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
35387
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
35388
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
35389
|
+
*/ /**
|
|
35390
|
+
* @module plugins/image-caption
|
|
35391
|
+
*/
|
|
35392
|
+
jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.imageCaption = {
|
|
35393
|
+
wrapper: {
|
|
35394
|
+
tag: 'figure',
|
|
35395
|
+
className: ''
|
|
35396
|
+
},
|
|
35397
|
+
inner: null,
|
|
35398
|
+
caption: {
|
|
35399
|
+
tag: 'figcaption',
|
|
35400
|
+
className: ''
|
|
35401
|
+
}
|
|
35402
|
+
};
|
|
35403
|
+
|
|
35404
|
+
|
|
35405
|
+
/***/ }),
|
|
35406
|
+
|
|
35407
|
+
/***/ 43058:
|
|
35408
|
+
/***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
|
|
35409
|
+
|
|
35410
|
+
"use strict";
|
|
35411
|
+
/* unused harmony export imageCaption */
|
|
35412
|
+
/* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25045);
|
|
35413
|
+
/* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31635);
|
|
35414
|
+
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(81937);
|
|
35415
|
+
/* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(84839);
|
|
35416
|
+
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(23211);
|
|
35417
|
+
/* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(28077);
|
|
35418
|
+
/* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(65946);
|
|
35419
|
+
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(80991);
|
|
35420
|
+
/* harmony import */ var jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(18855);
|
|
35421
|
+
/* harmony import */ var jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(42259);
|
|
35422
|
+
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(61396);
|
|
35423
|
+
/*!
|
|
35424
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
35425
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
35426
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
35427
|
+
*/ /**
|
|
35428
|
+
* [[include:plugins/image-caption/README.md]]
|
|
35429
|
+
* @packageDocumentation
|
|
35430
|
+
* @module plugins/image-caption
|
|
35431
|
+
*/
|
|
35432
|
+
|
|
35433
|
+
|
|
35434
|
+
|
|
35435
|
+
|
|
35436
|
+
|
|
35437
|
+
|
|
35438
|
+
|
|
35439
|
+
|
|
35440
|
+
|
|
35441
|
+
|
|
35442
|
+
const MARGINS = [
|
|
35443
|
+
'margin-top',
|
|
35444
|
+
'margin-right',
|
|
35445
|
+
'margin-bottom',
|
|
35446
|
+
'margin-left'
|
|
35447
|
+
];
|
|
35448
|
+
const ARROWS = new Set([
|
|
35449
|
+
jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.KEY_UP,
|
|
35450
|
+
jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.KEY_DOWN,
|
|
35451
|
+
jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.KEY_LEFT,
|
|
35452
|
+
jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.KEY_RIGHT
|
|
35453
|
+
]);
|
|
35454
|
+
// Blocks that only hold text, which a block wrapper can't go inside
|
|
35455
|
+
const TEXT_BLOCK = /^(P|H[1-6]|PRE)$/i;
|
|
35456
|
+
// They would replace the caption with a heading, quote or list
|
|
35457
|
+
const BLOCK_COMMANDS = new Set([
|
|
35458
|
+
'formatblock',
|
|
35459
|
+
'insertorderedlist',
|
|
35460
|
+
'insertunorderedlist'
|
|
35461
|
+
]);
|
|
35462
|
+
const PLACEHOLDER = 'data-jodit-placeholder';
|
|
35463
|
+
/**
|
|
35464
|
+
* Jodit's focus colour round a caption being typed in, in place of the
|
|
35465
|
+
* browser's, and a placeholder in a blank caption. `:where` leaves both for
|
|
35466
|
+
* the content's own styles to change
|
|
35467
|
+
*/ const CAPTION_STYLE = ':where(.jodit-wysiwyg [contenteditable=false] [contenteditable=true]:focus){outline:1px solid var(--jd-color-border-selected,#1e88e5)}' + `:where(.jodit-wysiwyg [${PLACEHOLDER}]){position:relative}` + `:where(.jodit-wysiwyg [${PLACEHOLDER}])::before{position:absolute;top:0;right:0;left:0;padding:inherit;color:var(--jd-color-placeholder,#a5a5a5);content:attr(${PLACEHOLDER});pointer-events:none}`;
|
|
35468
|
+
/**
|
|
35469
|
+
* Captions images: wraps an image in `imageCaption`'s elements and back, and
|
|
35470
|
+
* keeps the caret in the caption
|
|
35471
|
+
*/ class imageCaption extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_8__.Plugin {
|
|
35472
|
+
/** @override */ afterInit(jodit) {
|
|
35473
|
+
// It goes in the editing document, so iframe mode has it whatever `iframeStyle` holds
|
|
35474
|
+
(0,jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.getContainer)(jodit, 'imageCaption', 'style', true).textContent = CAPTION_STYLE;
|
|
35475
|
+
jodit.e.on('beforeCommandSelectall', this.__onSelectAll, {
|
|
35476
|
+
top: true
|
|
35477
|
+
});
|
|
35478
|
+
this.onChangePlace();
|
|
35479
|
+
}
|
|
35480
|
+
/**
|
|
35481
|
+
* Gives `image` a caption, or takes it away, as `on` says, or else the
|
|
35482
|
+
* other way round from how it is. Returns the caption it gave, or null
|
|
35483
|
+
* when it took one away
|
|
35484
|
+
*/ onToggleImageCaption(image, on) {
|
|
35485
|
+
const wrapper = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.getCaptionWrapper)(this.j, image);
|
|
35486
|
+
if (wrapper && on !== true) {
|
|
35487
|
+
const fresh = this.__freshCaption(wrapper);
|
|
35488
|
+
if (fresh) {
|
|
35489
|
+
this.__unrecorded(()=>this.__restore(fresh));
|
|
35490
|
+
} else {
|
|
35491
|
+
this.__uncaption(wrapper, image);
|
|
35492
|
+
}
|
|
35493
|
+
return null;
|
|
35494
|
+
}
|
|
35495
|
+
if (!wrapper && on !== false) {
|
|
35496
|
+
return this.__caption(image);
|
|
35497
|
+
}
|
|
35498
|
+
}
|
|
35499
|
+
__freshCaption(wrapper) {
|
|
35500
|
+
const fresh = this.__fresh;
|
|
35501
|
+
if (!fresh || fresh.wrapper !== wrapper || wrapper.parentNode !== fresh.parent || wrapper.previousSibling !== fresh.previous || wrapper.nextSibling !== fresh.next || shape(wrapper, fresh.image) !== fresh.shape || (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.getImageCaption)(this.j, wrapper) !== fresh.caption || !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isEmpty(fresh.caption)) {
|
|
35502
|
+
return null;
|
|
35503
|
+
}
|
|
35504
|
+
return fresh;
|
|
35505
|
+
}
|
|
35506
|
+
/**
|
|
35507
|
+
* Giving a caption isn't a step in the history of its own, as the first
|
|
35508
|
+
* thing typed in it is, so Undo never brings back a blank caption
|
|
35509
|
+
*/ __caption(image) {
|
|
35510
|
+
const { j } = this;
|
|
35511
|
+
const { snapshot } = j.history;
|
|
35512
|
+
// The steps before it are recorded first
|
|
35513
|
+
j.setEditorValue();
|
|
35514
|
+
j.e.fire('internalUpdate');
|
|
35515
|
+
const before = snapshot.make();
|
|
35516
|
+
let fresh;
|
|
35517
|
+
snapshot.transaction(()=>{
|
|
35518
|
+
fresh = this.__fresh = {
|
|
35519
|
+
...this.__wrap(image),
|
|
35520
|
+
before
|
|
35521
|
+
};
|
|
35522
|
+
j.setEditorValue();
|
|
35523
|
+
});
|
|
35524
|
+
// The value is as it was, so no `change` updates the toolbars
|
|
35525
|
+
j.e.fire('updateToolbar');
|
|
35526
|
+
return fresh.caption;
|
|
35527
|
+
}
|
|
35528
|
+
/**
|
|
35529
|
+
* Changes the content with no step in the history of its own, so Undo
|
|
35530
|
+
* never brings back a blank caption. A step still open takes it in
|
|
35531
|
+
*/ __unrecorded(changes) {
|
|
35532
|
+
const { j } = this;
|
|
35533
|
+
j.setEditorValue();
|
|
35534
|
+
this.__fresh = null;
|
|
35535
|
+
j.history.snapshot.transaction(()=>{
|
|
35536
|
+
changes();
|
|
35537
|
+
j.setEditorValue();
|
|
35538
|
+
});
|
|
35539
|
+
j.e.fire('internalUpdate');
|
|
35540
|
+
j.e.fire('updateToolbar');
|
|
35541
|
+
}
|
|
35542
|
+
__wrap(image) {
|
|
35543
|
+
const { j } = this;
|
|
35544
|
+
const { wrapper: wrapperPart, inner, caption: captionPart } = j.o.imageCaption;
|
|
35545
|
+
const link = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(image, 'a', j.editor);
|
|
35546
|
+
const target = link && !link.textContent?.trim() && link.getElementsByTagName('img').length === 1 ? link : image;
|
|
35547
|
+
const attributes = [
|
|
35548
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(image, 'style'),
|
|
35549
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(image, 'class')
|
|
35550
|
+
];
|
|
35551
|
+
const place = target.parentNode;
|
|
35552
|
+
const width = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_7__.cssInline)(image, 'width') || pixels((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(image, 'width')) || (image.offsetWidth ? `${image.offsetWidth}px` : '');
|
|
35553
|
+
const classes = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.getAlignClasses)(j, image);
|
|
35554
|
+
const align = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.getHAlign)(image, classes);
|
|
35555
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.clearHAlign)(image, classes);
|
|
35556
|
+
const wrapper = this.__create(wrapperPart);
|
|
35557
|
+
const box = inner ? this.__create(inner) : wrapper;
|
|
35558
|
+
const caption = this.__create(captionPart);
|
|
35559
|
+
caption.appendChild(j.createInside.element('br'));
|
|
35560
|
+
const split = this.__insert(wrapper, target);
|
|
35561
|
+
if (box !== wrapper) {
|
|
35562
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.append(wrapper, box);
|
|
35563
|
+
}
|
|
35564
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.append(box, [
|
|
35565
|
+
target,
|
|
35566
|
+
caption
|
|
35567
|
+
]);
|
|
35568
|
+
moveMargins(image, wrapper);
|
|
35569
|
+
// The wrapper takes the image's width, and the image fills it, so the
|
|
35570
|
+
// caption wraps under the image
|
|
35571
|
+
if (width) {
|
|
35572
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(wrapper, 'width', width);
|
|
35573
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(image, 'width', '100%');
|
|
35574
|
+
}
|
|
35575
|
+
;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.hAlignElement)(wrapper, align, (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.getAlignClasses)(j, wrapper));
|
|
35576
|
+
this.__mark(wrapper);
|
|
35577
|
+
return {
|
|
35578
|
+
caption,
|
|
35579
|
+
wrapper,
|
|
35580
|
+
image,
|
|
35581
|
+
target,
|
|
35582
|
+
place,
|
|
35583
|
+
split,
|
|
35584
|
+
attributes,
|
|
35585
|
+
parent: wrapper.parentNode,
|
|
35586
|
+
previous: wrapper.previousSibling,
|
|
35587
|
+
next: wrapper.nextSibling,
|
|
35588
|
+
shape: shape(wrapper, image)
|
|
35589
|
+
};
|
|
35590
|
+
}
|
|
35591
|
+
/**
|
|
35592
|
+
* Puts the image back as it was before its caption: in the line the
|
|
35593
|
+
* caption split, and with its own alignment, margins and width. The image
|
|
35594
|
+
* goes into the part of the line holding the caret, so the caret stays
|
|
35595
|
+
*/ __restore(fresh) {
|
|
35596
|
+
const { wrapper, image, target, place, split, attributes } = fresh;
|
|
35597
|
+
if (!split) {
|
|
35598
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.before(wrapper, target);
|
|
35599
|
+
} else if (!split.head && !split.tail) {
|
|
35600
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.append(place, target);
|
|
35601
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.before(wrapper, split.block);
|
|
35602
|
+
} else {
|
|
35603
|
+
const { sel } = this.j.s;
|
|
35604
|
+
const caret = sel?.rangeCount ? sel.getRangeAt(0).startContainer : null;
|
|
35605
|
+
const { head, tail } = split;
|
|
35606
|
+
if (head && !(tail && caret && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isOrContains(tail, caret))) {
|
|
35607
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.append(head, [
|
|
35608
|
+
target,
|
|
35609
|
+
...(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.toArray)(tail?.childNodes ?? [])
|
|
35610
|
+
]);
|
|
35611
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove(tail);
|
|
35612
|
+
} else if (tail) {
|
|
35613
|
+
const first = tail.firstChild;
|
|
35614
|
+
[
|
|
35615
|
+
...(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.toArray)(head?.childNodes ?? []),
|
|
35616
|
+
target
|
|
35617
|
+
].forEach((node)=>tail.insertBefore(node, first));
|
|
35618
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove(head);
|
|
35619
|
+
}
|
|
35620
|
+
}
|
|
35621
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove(wrapper);
|
|
35622
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(image, {
|
|
35623
|
+
style: attributes[0],
|
|
35624
|
+
class: attributes[1]
|
|
35625
|
+
});
|
|
35626
|
+
}
|
|
35627
|
+
__uncaption(wrapper, image) {
|
|
35628
|
+
const { j } = this;
|
|
35629
|
+
// Read while the wrapper is still one, with its caption
|
|
35630
|
+
const align = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.getHAlign)(wrapper, (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.getAlignClasses)(j, wrapper));
|
|
35631
|
+
const width = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_7__.cssInline)(wrapper, 'width');
|
|
35632
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.getImageCaption)(j, wrapper));
|
|
35633
|
+
const target = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(image, 'a', wrapper) ?? image;
|
|
35634
|
+
moveMargins(wrapper, image);
|
|
35635
|
+
if (width) {
|
|
35636
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(image, 'width', width);
|
|
35637
|
+
}
|
|
35638
|
+
;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.hAlignElement)(image, align, (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.getAlignClasses)(j, image));
|
|
35639
|
+
// A block wrapper leaves the image in a paragraph of its own
|
|
35640
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isBlock(wrapper) && wrapper.parentNode === j.editor && j.o.enter.toLowerCase() !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.BR) {
|
|
35641
|
+
const line = j.createInside.element(j.o.enter);
|
|
35642
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.before(wrapper, line);
|
|
35643
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.append(line, target);
|
|
35644
|
+
} else {
|
|
35645
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.before(wrapper, target);
|
|
35646
|
+
}
|
|
35647
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove(wrapper);
|
|
35648
|
+
}
|
|
35649
|
+
__create({ tag, className }) {
|
|
35650
|
+
return this.j.createInside.element(tag, className ? {
|
|
35651
|
+
class: className
|
|
35652
|
+
} : {});
|
|
35653
|
+
}
|
|
35654
|
+
/**
|
|
35655
|
+
* Puts `wrapper` where `target` is. A block can't go in a paragraph, so the
|
|
35656
|
+
* paragraph is split round it, and a part left empty goes
|
|
35657
|
+
*/ __insert(wrapper, target) {
|
|
35658
|
+
const { j } = this;
|
|
35659
|
+
const block = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isBlock(wrapper) ? jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(target, jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isBlock, j.editor) : null;
|
|
35660
|
+
if (!block || !TEXT_BLOCK.test(block.nodeName)) {
|
|
35661
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.before(target, wrapper);
|
|
35662
|
+
return null;
|
|
35663
|
+
}
|
|
35664
|
+
const range = j.ed.createRange();
|
|
35665
|
+
range.setStartBefore(block);
|
|
35666
|
+
range.setEndBefore(target);
|
|
35667
|
+
const start = range.extractContents();
|
|
35668
|
+
range.setStartAfter(target);
|
|
35669
|
+
range.setEndAfter(block);
|
|
35670
|
+
const end = range.extractContents();
|
|
35671
|
+
const [head, tail] = [
|
|
35672
|
+
start,
|
|
35673
|
+
end
|
|
35674
|
+
].map((part, index)=>{
|
|
35675
|
+
const line = part.firstChild;
|
|
35676
|
+
if (!line || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isEmpty(line)) {
|
|
35677
|
+
return null;
|
|
35678
|
+
}
|
|
35679
|
+
;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.call)(index ? jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.after : jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.before, block, line);
|
|
35680
|
+
return line;
|
|
35681
|
+
});
|
|
35682
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.before(block, wrapper);
|
|
35683
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove(block);
|
|
35684
|
+
return {
|
|
35685
|
+
block,
|
|
35686
|
+
head,
|
|
35687
|
+
tail
|
|
35688
|
+
};
|
|
35689
|
+
}
|
|
35690
|
+
/**
|
|
35691
|
+
* The wrapper can't be edited, apart from its caption, so typing can't
|
|
35692
|
+
* land between the image and the caption
|
|
35693
|
+
*/ __mark(wrapper) {
|
|
35694
|
+
;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(wrapper, 'contenteditable', false);
|
|
35695
|
+
const caption = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.getImageCaption)(this.j, wrapper);
|
|
35696
|
+
if (caption) {
|
|
35697
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(caption, 'contenteditable', true);
|
|
35698
|
+
this.__placeholder(caption);
|
|
35699
|
+
}
|
|
35700
|
+
}
|
|
35701
|
+
__placeholder(caption) {
|
|
35702
|
+
const text = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isEmpty(caption) ? this.j.i18n('Caption') : null;
|
|
35703
|
+
if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(caption, PLACEHOLDER) !== text) {
|
|
35704
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(caption, PLACEHOLDER, text);
|
|
35705
|
+
}
|
|
35706
|
+
}
|
|
35707
|
+
onChange() {
|
|
35708
|
+
const { j } = this;
|
|
35709
|
+
if (j.isInDestruct || j.getMode() === jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.MODE_SOURCE) {
|
|
35710
|
+
return;
|
|
35711
|
+
}
|
|
35712
|
+
;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.toArray)(j.editor.getElementsByTagName(j.o.imageCaption.wrapper.tag)).forEach((elm)=>{
|
|
35713
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isHTMLElement(elm) && (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.getCaptionedImage)(j, elm)) {
|
|
35714
|
+
this.__mark(elm);
|
|
35715
|
+
}
|
|
35716
|
+
});
|
|
35717
|
+
}
|
|
35718
|
+
/**
|
|
35719
|
+
* The placeholder goes with the first letter typed or pasted, and comes
|
|
35720
|
+
* back when the last is deleted
|
|
35721
|
+
*/ onInput() {
|
|
35722
|
+
const caption = this.__caretCaption();
|
|
35723
|
+
if (caption) {
|
|
35724
|
+
this.__placeholder(caption);
|
|
35725
|
+
}
|
|
35726
|
+
}
|
|
35727
|
+
/**
|
|
35728
|
+
* The editor's own attributes stay out of the value, as the caption would
|
|
35729
|
+
* be editable on the page. So does a caption given and left blank, as
|
|
35730
|
+
* leaving it takes it off, so saving at once keeps the image as it was
|
|
35731
|
+
*/ onAfterGetValueFromEditor(data) {
|
|
35732
|
+
if (!data.value.includes('contenteditable')) {
|
|
35733
|
+
return;
|
|
35734
|
+
}
|
|
35735
|
+
const { j } = this;
|
|
35736
|
+
const template = j.c.element('template');
|
|
35737
|
+
template.innerHTML = data.value;
|
|
35738
|
+
const wrappers = (root)=>(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.toArray)(root.querySelectorAll(j.o.imageCaption.wrapper.tag)).filter((wrapper)=>(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.getCaptionedImage)(j, wrapper));
|
|
35739
|
+
const copies = wrappers(template.content);
|
|
35740
|
+
const fresh = this.__fresh && this.__freshCaption(this.__fresh.wrapper);
|
|
35741
|
+
const copy = fresh && copies[wrappers(j.editor).indexOf(fresh.wrapper)];
|
|
35742
|
+
const placed = fresh && copy && placedIn(j, fresh, copy);
|
|
35743
|
+
let changed = false;
|
|
35744
|
+
if (placed) {
|
|
35745
|
+
this.__restore(placed);
|
|
35746
|
+
changed = true;
|
|
35747
|
+
}
|
|
35748
|
+
copies.forEach((wrapper)=>{
|
|
35749
|
+
[
|
|
35750
|
+
wrapper,
|
|
35751
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.getImageCaption)(j, wrapper)
|
|
35752
|
+
].forEach((elm)=>[
|
|
35753
|
+
'contenteditable',
|
|
35754
|
+
PLACEHOLDER
|
|
35755
|
+
].forEach((name)=>{
|
|
35756
|
+
if (elm?.hasAttribute(name)) {
|
|
35757
|
+
elm.removeAttribute(name);
|
|
35758
|
+
changed = true;
|
|
35759
|
+
}
|
|
35760
|
+
}));
|
|
35761
|
+
});
|
|
35762
|
+
if (changed) {
|
|
35763
|
+
data.value = template.innerHTML;
|
|
35764
|
+
}
|
|
35765
|
+
}
|
|
35766
|
+
onChangePlace() {
|
|
35767
|
+
const { j } = this;
|
|
35768
|
+
// Captured, to come first: the editor's own `focusout` listener can stop
|
|
35769
|
+
// the event as it fires `blur`, and an image's `mousedown` listener
|
|
35770
|
+
// moves the focus before the press reaches the editor
|
|
35771
|
+
j.e.off([
|
|
35772
|
+
j.editor,
|
|
35773
|
+
j.ow,
|
|
35774
|
+
j.ew
|
|
35775
|
+
], '.imageCaption').on(j.editor, 'focusout.imageCaption', this.__onFocusOut, {
|
|
35776
|
+
capture: true
|
|
35777
|
+
}).on(j.editor, 'mousedown.imageCaption', this.__onMouseDown, {
|
|
35778
|
+
capture: true
|
|
35779
|
+
}).on([
|
|
35780
|
+
j.ow,
|
|
35781
|
+
j.ew
|
|
35782
|
+
], 'mouseup.imageCaption', this.__onMouseUp);
|
|
35783
|
+
}
|
|
35784
|
+
__onMouseDown(event) {
|
|
35785
|
+
this.__press = event.target;
|
|
35786
|
+
}
|
|
35787
|
+
/**
|
|
35788
|
+
* A caption left blank goes when the focus leaves it. That's checked once
|
|
35789
|
+
* the focus has landed, as switching windows or opening the editor's own
|
|
35790
|
+
* popups keeps it, and once a press that took the focus is over, as the
|
|
35791
|
+
* browsers fire no click when its target moves
|
|
35792
|
+
*/ __onFocusOut(event) {
|
|
35793
|
+
const caption = event.target;
|
|
35794
|
+
if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.getImageCaption)(this.j, (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.getCaptionWrapper)(this.j, caption)) !== caption) {
|
|
35795
|
+
return;
|
|
35796
|
+
}
|
|
35797
|
+
if (this.__press) {
|
|
35798
|
+
this.__afterPress.push(caption);
|
|
35799
|
+
} else {
|
|
35800
|
+
this.__dropBlank(caption, null);
|
|
35801
|
+
}
|
|
35802
|
+
}
|
|
35803
|
+
__onMouseUp() {
|
|
35804
|
+
const press = this.__press;
|
|
35805
|
+
this.__press = null;
|
|
35806
|
+
this.__afterPress.splice(0).forEach((caption)=>this.__dropBlank(caption, press));
|
|
35807
|
+
}
|
|
35808
|
+
__dropBlank(caption, press) {
|
|
35809
|
+
// `async.setTimeout` runs a timeout of 0 at once
|
|
35810
|
+
this.j.async.setTimeout(()=>{
|
|
35811
|
+
const { j } = this;
|
|
35812
|
+
const wrapper = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.getCaptionWrapper)(j, caption);
|
|
35813
|
+
const image = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.getCaptionedImage)(j, wrapper);
|
|
35814
|
+
if (!wrapper || !image || !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isEmpty(caption) || this.__keepsFocus(caption)) {
|
|
35815
|
+
return;
|
|
35816
|
+
}
|
|
35817
|
+
const clicked = Boolean(press && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isOrContains(wrapper, press));
|
|
35818
|
+
const fresh = this.__freshCaption(wrapper);
|
|
35819
|
+
this.__unrecorded(()=>fresh ? this.__restore(fresh) : this.__uncaption(wrapper, image));
|
|
35820
|
+
// The click opened the image's popup below the caption, so it
|
|
35821
|
+
// opens again below the image, as after the popup's Caption button
|
|
35822
|
+
if (clicked) {
|
|
35823
|
+
j.e.fire('recalcPositionPopup');
|
|
35824
|
+
j.e.fire('closeAllPopups');
|
|
35825
|
+
}
|
|
35826
|
+
}, 1);
|
|
35827
|
+
}
|
|
35828
|
+
/**
|
|
35829
|
+
* The caption has the focus, or had it when another window took it, or
|
|
35830
|
+
* the editor's own popups and dialogs have it, as the link form
|
|
35831
|
+
*/ __keepsFocus(caption) {
|
|
35832
|
+
const { j } = this;
|
|
35833
|
+
const doc = caption.ownerDocument;
|
|
35834
|
+
if (doc.activeElement === caption && (doc.hasFocus() || !j.od.hasFocus())) {
|
|
35835
|
+
return true;
|
|
35836
|
+
}
|
|
35837
|
+
const active = j.od.activeElement;
|
|
35838
|
+
return Boolean(active && active !== j.iframe && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isOrContains(j.editor, active) && (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isOrContains(j.container, active) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(active, (elm)=>jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isElement(elm) && (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(elm, 'data-editor_id') === j.id, j.od.body)));
|
|
35839
|
+
}
|
|
35840
|
+
/**
|
|
35841
|
+
* The caption the caret is in
|
|
35842
|
+
*/ __caretCaption() {
|
|
35843
|
+
const { s } = this.j;
|
|
35844
|
+
if (!s.isInsideArea) {
|
|
35845
|
+
return null;
|
|
35846
|
+
}
|
|
35847
|
+
const node = s.range.startContainer;
|
|
35848
|
+
const caption = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.getImageCaption)(this.j, (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.getCaptionWrapper)(this.j, node));
|
|
35849
|
+
return caption && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isOrContains(caption, node) ? caption : null;
|
|
35850
|
+
}
|
|
35851
|
+
/**
|
|
35852
|
+
* Enter in a caption starts a line after the image, and Shift+Enter
|
|
35853
|
+
* breaks the caption's line, as everywhere
|
|
35854
|
+
*/ onBeforeEnter(event) {
|
|
35855
|
+
const caption = event?.shiftKey ? null : this.__caretCaption();
|
|
35856
|
+
const wrapper = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.getCaptionWrapper)(this.j, caption);
|
|
35857
|
+
if (!wrapper) {
|
|
35858
|
+
return;
|
|
35859
|
+
}
|
|
35860
|
+
const { j } = this;
|
|
35861
|
+
this.__focusEditor();
|
|
35862
|
+
// The Enter plugin breaks the line after an inline wrapper
|
|
35863
|
+
if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isBlock(wrapper)) {
|
|
35864
|
+
j.s.setCursorAfter(wrapper);
|
|
35865
|
+
return;
|
|
35866
|
+
}
|
|
35867
|
+
const line = this.__line();
|
|
35868
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.after(wrapper, line);
|
|
35869
|
+
j.s.setCursorIn(line);
|
|
35870
|
+
j.synchronizeValues();
|
|
35871
|
+
return false;
|
|
35872
|
+
}
|
|
35873
|
+
/**
|
|
35874
|
+
* The caption keeps the focus, as an editable element of its own, and
|
|
35875
|
+
* would take the caret back, so the editor takes it before the caret
|
|
35876
|
+
* leaves the caption
|
|
35877
|
+
*/ __focusEditor() {
|
|
35878
|
+
this.j.editor.focus({
|
|
35879
|
+
preventScroll: true
|
|
35880
|
+
});
|
|
35881
|
+
}
|
|
35882
|
+
__line() {
|
|
35883
|
+
const { j } = this;
|
|
35884
|
+
const line = j.createInside.element(j.o.enter);
|
|
35885
|
+
if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(line, 'br')) {
|
|
35886
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.append(line, j.createInside.element('br'));
|
|
35887
|
+
}
|
|
35888
|
+
return line;
|
|
35889
|
+
}
|
|
35890
|
+
/**
|
|
35891
|
+
* A caption holds text. An image, a table or a block put in it would end
|
|
35892
|
+
* the captioned image, so it goes after the image, as Enter would
|
|
35893
|
+
*/ onBeforeInsertNode(node) {
|
|
35894
|
+
const wrapper = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.getCaptionWrapper)(this.j, this.__caretCaption());
|
|
35895
|
+
if (!wrapper || !holdsMoreThanText(node)) {
|
|
35896
|
+
return;
|
|
35897
|
+
}
|
|
35898
|
+
const { j } = this;
|
|
35899
|
+
this.__focusEditor();
|
|
35900
|
+
if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isBlock(wrapper)) {
|
|
35901
|
+
j.s.setCursorAfter(wrapper);
|
|
35902
|
+
return;
|
|
35903
|
+
}
|
|
35904
|
+
const line = this.__line();
|
|
35905
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.after(wrapper, line);
|
|
35906
|
+
j.s.setCursorIn(line);
|
|
35907
|
+
}
|
|
35908
|
+
/**
|
|
35909
|
+
* A selected captioned image goes as an image on a line of its own does,
|
|
35910
|
+
* leaving the line empty, rather than joining the lines either side
|
|
35911
|
+
*/ onBeforeCommandDelete() {
|
|
35912
|
+
const wrapper = this.__selectedWrapper();
|
|
35913
|
+
if (!wrapper || !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isBlock(wrapper)) {
|
|
35914
|
+
return;
|
|
35915
|
+
}
|
|
35916
|
+
const line = this.__line();
|
|
35917
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.before(wrapper, line);
|
|
35918
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove(wrapper);
|
|
35919
|
+
this.j.s.setCursorIn(line);
|
|
35920
|
+
return false;
|
|
35921
|
+
}
|
|
35922
|
+
/**
|
|
35923
|
+
* The captioned image the selection holds, as a click on the image selects
|
|
35924
|
+
*/ __selectedWrapper() {
|
|
35925
|
+
const { s } = this.j;
|
|
35926
|
+
if (!s.isInsideArea || s.isCollapsed()) {
|
|
35927
|
+
return null;
|
|
35928
|
+
}
|
|
35929
|
+
const { startContainer, startOffset, endContainer, endOffset } = s.range;
|
|
35930
|
+
const node = startContainer.childNodes[startOffset];
|
|
35931
|
+
return startContainer === endContainer && endOffset === startOffset + 1 && (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.getCaptionedImage)(this.j, node) ? node : null;
|
|
35932
|
+
}
|
|
35933
|
+
onKeyDown(event) {
|
|
35934
|
+
this.__arrow = null;
|
|
35935
|
+
// Typing replaces a selected captioned image, on the line it leaves
|
|
35936
|
+
if (event.key?.length === 1 && !event.ctrlKey && !event.metaKey && this.__selectedWrapper()) {
|
|
35937
|
+
this.j.execCommand('Delete');
|
|
35938
|
+
return;
|
|
35939
|
+
}
|
|
35940
|
+
if (!ARROWS.has(event.key) || event.shiftKey || event.altKey || event.ctrlKey || event.metaKey || !this.j.s.isCollapsed()) {
|
|
35941
|
+
return;
|
|
35942
|
+
}
|
|
35943
|
+
const caption = this.__caretCaption();
|
|
35944
|
+
if (caption) {
|
|
35945
|
+
this.__arrow = {
|
|
35946
|
+
key: event.key,
|
|
35947
|
+
range: this.j.s.range.cloneRange(),
|
|
35948
|
+
caption
|
|
35949
|
+
};
|
|
35950
|
+
}
|
|
35951
|
+
}
|
|
35952
|
+
/**
|
|
35953
|
+
* An arrow key that couldn't move the caret in the caption takes it out,
|
|
35954
|
+
* past the image, as the caption is an editable element of its own
|
|
35955
|
+
*/ onKeyUp(event) {
|
|
35956
|
+
const arrow = this.__arrow;
|
|
35957
|
+
this.__arrow = null;
|
|
35958
|
+
if (!arrow || event.key !== arrow.key || (0,jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_9__.isMoved)(this.j, arrow.range)) {
|
|
35959
|
+
return;
|
|
35960
|
+
}
|
|
35961
|
+
const wrapper = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.getCaptionWrapper)(this.j, arrow.caption);
|
|
35962
|
+
if (!wrapper) {
|
|
35963
|
+
return;
|
|
35964
|
+
}
|
|
35965
|
+
const forward = arrow.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.KEY_DOWN || arrow.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.KEY_RIGHT;
|
|
35966
|
+
const { s } = this.j;
|
|
35967
|
+
this.__focusEditor();
|
|
35968
|
+
if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isBlock(wrapper)) {
|
|
35969
|
+
if (forward) {
|
|
35970
|
+
s.setCursorAfter(wrapper);
|
|
35971
|
+
} else {
|
|
35972
|
+
s.setCursorBefore(wrapper);
|
|
35973
|
+
}
|
|
35974
|
+
return;
|
|
35975
|
+
}
|
|
35976
|
+
const sibling = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.findNotEmptySibling(wrapper, !forward);
|
|
35977
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isHTMLElement(sibling)) {
|
|
35978
|
+
s.setCursorIn(sibling, forward);
|
|
35979
|
+
return;
|
|
35980
|
+
}
|
|
35981
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isText(sibling)) {
|
|
35982
|
+
if (forward) {
|
|
35983
|
+
s.setCursorBefore(sibling);
|
|
35984
|
+
} else {
|
|
35985
|
+
s.setCursorAfter(sibling);
|
|
35986
|
+
}
|
|
35987
|
+
return;
|
|
35988
|
+
}
|
|
35989
|
+
const line = this.__line();
|
|
35990
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.call)(forward ? jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.after : jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.before, wrapper, line);
|
|
35991
|
+
s.setCursorIn(line);
|
|
35992
|
+
this.j.synchronizeValues();
|
|
35993
|
+
}
|
|
35994
|
+
onBeforeCommand(command) {
|
|
35995
|
+
const name = command.toLowerCase();
|
|
35996
|
+
if (BLOCK_COMMANDS.has(name) && this.__caretCaption()) {
|
|
35997
|
+
return false;
|
|
35998
|
+
}
|
|
35999
|
+
// A caption given and left blank was never a step, so Undo takes it off
|
|
36000
|
+
const fresh = name === 'undo' && this.__fresh ? this.__freshCaption(this.__fresh.wrapper) : null;
|
|
36001
|
+
if (fresh) {
|
|
36002
|
+
this.__unrecorded(()=>{
|
|
36003
|
+
this.__restore(fresh);
|
|
36004
|
+
this.j.history.snapshot.restore(fresh.before);
|
|
36005
|
+
});
|
|
36006
|
+
return false;
|
|
36007
|
+
}
|
|
36008
|
+
}
|
|
36009
|
+
/**
|
|
36010
|
+
* Select all in a caption selects the caption, as the caption is an
|
|
36011
|
+
* editable element of its own
|
|
36012
|
+
*/ __onSelectAll() {
|
|
36013
|
+
const caption = this.__caretCaption();
|
|
36014
|
+
if (caption) {
|
|
36015
|
+
this.j.e.stopPropagation('beforeCommandSelectall');
|
|
36016
|
+
this.j.s.select(caption, true);
|
|
36017
|
+
return false;
|
|
36018
|
+
}
|
|
36019
|
+
}
|
|
36020
|
+
/** @override */ beforeDestruct(jodit) {
|
|
36021
|
+
jodit.e.off('beforeCommandSelectall', this.__onSelectAll).off([
|
|
36022
|
+
jodit.editor,
|
|
36023
|
+
jodit.ow,
|
|
36024
|
+
jodit.ew
|
|
36025
|
+
], '.imageCaption');
|
|
36026
|
+
}
|
|
36027
|
+
constructor(...args){
|
|
36028
|
+
super(...args), /**
|
|
36029
|
+
* The caption given last, while nothing has changed round it and it's
|
|
36030
|
+
* still blank, so taking it off can put everything back as it was
|
|
36031
|
+
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__fresh", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__press", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__afterPress", []), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__arrow", null);
|
|
36032
|
+
}
|
|
36033
|
+
}
|
|
36034
|
+
;(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
36035
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.watch)(':toggleImageCaption')
|
|
36036
|
+
], imageCaption.prototype, "onToggleImageCaption", null);
|
|
36037
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
36038
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.watch)([
|
|
36039
|
+
':change',
|
|
36040
|
+
':afterInit',
|
|
36041
|
+
':afterSetMode',
|
|
36042
|
+
':changePlace'
|
|
36043
|
+
]),
|
|
36044
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.debounce)()
|
|
36045
|
+
], imageCaption.prototype, "onChange", null);
|
|
36046
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
36047
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.watch)([
|
|
36048
|
+
':input',
|
|
36049
|
+
':keyup',
|
|
36050
|
+
':afterPaste'
|
|
36051
|
+
])
|
|
36052
|
+
], imageCaption.prototype, "onInput", null);
|
|
36053
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
36054
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.watch)(':afterGetValueFromEditor')
|
|
36055
|
+
], imageCaption.prototype, "onAfterGetValueFromEditor", null);
|
|
36056
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
36057
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.watch)(':changePlace')
|
|
36058
|
+
], imageCaption.prototype, "onChangePlace", null);
|
|
36059
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
36060
|
+
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.autobind
|
|
36061
|
+
], imageCaption.prototype, "__onMouseDown", null);
|
|
36062
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
36063
|
+
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.autobind
|
|
36064
|
+
], imageCaption.prototype, "__onFocusOut", null);
|
|
36065
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
36066
|
+
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.autobind
|
|
36067
|
+
], imageCaption.prototype, "__onMouseUp", null);
|
|
36068
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
36069
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.watch)(':beforeEnter')
|
|
36070
|
+
], imageCaption.prototype, "onBeforeEnter", null);
|
|
36071
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
36072
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.watch)(':beforeInsertNode')
|
|
36073
|
+
], imageCaption.prototype, "onBeforeInsertNode", null);
|
|
36074
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
36075
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.watch)(':beforeCommandDelete')
|
|
36076
|
+
], imageCaption.prototype, "onBeforeCommandDelete", null);
|
|
36077
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
36078
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.watch)(':keydown')
|
|
36079
|
+
], imageCaption.prototype, "onKeyDown", null);
|
|
36080
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
36081
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.watch)(':keyup')
|
|
36082
|
+
], imageCaption.prototype, "onKeyUp", null);
|
|
36083
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
36084
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.watch)(':beforeCommand')
|
|
36085
|
+
], imageCaption.prototype, "onBeforeCommand", null);
|
|
36086
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
36087
|
+
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.autobind
|
|
36088
|
+
], imageCaption.prototype, "__onSelectAll", null);
|
|
36089
|
+
/**
|
|
36090
|
+
* `fresh` in `wrapper`, a copy of its wrapper, with the lines round it, made
|
|
36091
|
+
* from the editor's value
|
|
36092
|
+
*/ function placedIn(jodit, fresh, wrapper) {
|
|
36093
|
+
const image = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.getCaptionedImage)(jodit, wrapper);
|
|
36094
|
+
const { split } = fresh;
|
|
36095
|
+
if (!image) {
|
|
36096
|
+
return null;
|
|
36097
|
+
}
|
|
36098
|
+
const placed = {
|
|
36099
|
+
wrapper,
|
|
36100
|
+
image,
|
|
36101
|
+
target: jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(image, 'a', wrapper) ?? image,
|
|
36102
|
+
place: fresh.place,
|
|
36103
|
+
split: null,
|
|
36104
|
+
attributes: fresh.attributes
|
|
36105
|
+
};
|
|
36106
|
+
if (split) {
|
|
36107
|
+
const head = split.head ? wrapper.previousSibling : null;
|
|
36108
|
+
const tail = split.tail ? wrapper.nextSibling : null;
|
|
36109
|
+
if (split.head && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isHTMLElement(head) || split.tail && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isHTMLElement(tail)) {
|
|
36110
|
+
return null;
|
|
36111
|
+
}
|
|
36112
|
+
const block = split.block.cloneNode(true);
|
|
36113
|
+
placed.split = {
|
|
36114
|
+
block,
|
|
36115
|
+
head: head,
|
|
36116
|
+
tail: tail
|
|
36117
|
+
};
|
|
36118
|
+
placed.place = counterpart(split.block, fresh.place, block);
|
|
36119
|
+
}
|
|
36120
|
+
return placed;
|
|
36121
|
+
}
|
|
36122
|
+
/**
|
|
36123
|
+
* The node in `copy`, a clone of `root`, where `node` is in `root`
|
|
36124
|
+
*/ function counterpart(root, node, copy) {
|
|
36125
|
+
const path = [];
|
|
36126
|
+
for(let elm = node; elm !== root && elm.parentNode; elm = elm.parentNode){
|
|
36127
|
+
path.unshift((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.toArray)(elm.parentNode.childNodes).indexOf(elm));
|
|
36128
|
+
}
|
|
36129
|
+
return path.reduce((elm, index)=>elm.childNodes[index], copy);
|
|
36130
|
+
}
|
|
36131
|
+
/**
|
|
36132
|
+
* The attributes of a caption's wrapper and image that the image's
|
|
36133
|
+
* alignment, margins and size are in
|
|
36134
|
+
*/ function shape(wrapper, image) {
|
|
36135
|
+
return [
|
|
36136
|
+
wrapper,
|
|
36137
|
+
image
|
|
36138
|
+
].flatMap((elm)=>[
|
|
36139
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(elm, 'style'),
|
|
36140
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(elm, 'class')
|
|
36141
|
+
]).join('|');
|
|
36142
|
+
}
|
|
36143
|
+
/**
|
|
36144
|
+
* The node is, or holds, more than text and inline formatting: an image, a
|
|
36145
|
+
* table, a rule or another block
|
|
36146
|
+
*/ function holdsMoreThanText(node) {
|
|
36147
|
+
if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isElement(node) && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isFragment(node)) {
|
|
36148
|
+
return false;
|
|
36149
|
+
}
|
|
36150
|
+
return [
|
|
36151
|
+
node,
|
|
36152
|
+
...(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.toArray)(node.querySelectorAll('*'))
|
|
36153
|
+
].some((elm)=>jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isElement(elm) && (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isBlock(elm) || jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.NO_EMPTY_TAGS.has(elm.nodeName.toLowerCase())));
|
|
36154
|
+
}
|
|
36155
|
+
/**
|
|
36156
|
+
* A `width` attribute's value as a CSS width
|
|
36157
|
+
*/ function pixels(value) {
|
|
36158
|
+
if (!value) {
|
|
36159
|
+
return '';
|
|
36160
|
+
}
|
|
36161
|
+
return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.isNumeric)(value) ? `${value}px` : value;
|
|
36162
|
+
}
|
|
36163
|
+
function moveMargins(from, to) {
|
|
36164
|
+
MARGINS.forEach((side)=>{
|
|
36165
|
+
const value = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_7__.cssInline)(from, side);
|
|
36166
|
+
if (value) {
|
|
36167
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(to, side, value);
|
|
36168
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(from, side, '');
|
|
36169
|
+
}
|
|
36170
|
+
});
|
|
36171
|
+
if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(from, 'style')?.trim()) {
|
|
36172
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(from, 'style', null);
|
|
36173
|
+
}
|
|
36174
|
+
}
|
|
36175
|
+
jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.pluginSystem.add('imageCaption', imageCaption);
|
|
36176
|
+
|
|
36177
|
+
|
|
34793
36178
|
/***/ }),
|
|
34794
36179
|
|
|
34795
36180
|
/***/ 51034:
|
|
@@ -34897,7 +36282,8 @@ const SELECTED_TAGS = new Set([
|
|
|
34897
36282
|
* paints the rest of a block image's line with its parent's highlight. See #1528.
|
|
34898
36283
|
* Media in a wrapper (`jodit-media`, the resizer's `jodit` for an embed, or
|
|
34899
36284
|
* one from `mediaWrappers`) isn't highlighted either, as Safari paints its
|
|
34900
|
-
* wrapper's whole line, and its resize frame shows it's selected
|
|
36285
|
+
* wrapper's whole line, and its resize frame shows it's selected. Nor is
|
|
36286
|
+
* a captioned image's caption
|
|
34901
36287
|
*/ onSelectionChange() {
|
|
34902
36288
|
const { jodit } = this;
|
|
34903
36289
|
jodit.editor.classList.toggle(IMAGE_SELECTED, isImageSelected(jodit));
|
|
@@ -34919,9 +36305,11 @@ const SELECTED_TAGS = new Set([
|
|
|
34919
36305
|
if (elm.src && /^data:/.test(elm.src)) {
|
|
34920
36306
|
replaceDataURIToBlobUUID(editor, elm);
|
|
34921
36307
|
}
|
|
36308
|
+
// A captioned image is selected with its caption, so Delete
|
|
36309
|
+
// removes both
|
|
34922
36310
|
editor.e.on(elm, 'mousedown touchstart', ()=>{
|
|
34923
36311
|
removeCaretText(elm);
|
|
34924
|
-
editor.s.select(elm);
|
|
36312
|
+
editor.s.select((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.getCaptionWrapper)(editor, elm) ?? elm);
|
|
34925
36313
|
});
|
|
34926
36314
|
}
|
|
34927
36315
|
});
|
|
@@ -34951,7 +36339,7 @@ function isImageSelected(jodit) {
|
|
|
34951
36339
|
}
|
|
34952
36340
|
const { startContainer, startOffset, endContainer, endOffset } = sel.getRangeAt(0);
|
|
34953
36341
|
const node = startContainer.childNodes[startOffset];
|
|
34954
|
-
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);
|
|
36342
|
+
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) ?? (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.getCaptionedImage)(jodit, node))) && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isOrContains(jodit.editor, startContainer);
|
|
34955
36343
|
}
|
|
34956
36344
|
/**
|
|
34957
36345
|
* Remove the invisible-space text beside an image, which only held a caret.
|
|
@@ -35017,6 +36405,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.image = {
|
|
|
35017
36405
|
useImageEditor: true,
|
|
35018
36406
|
editTitle: true,
|
|
35019
36407
|
editAlt: true,
|
|
36408
|
+
showCaptionCheckbox: true,
|
|
35020
36409
|
editLink: true,
|
|
35021
36410
|
editSize: true,
|
|
35022
36411
|
editBorderRadius: true,
|
|
@@ -35114,10 +36503,12 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.image = {
|
|
|
35114
36503
|
dialog.close();
|
|
35115
36504
|
});
|
|
35116
36505
|
buttons.remove.onAction(()=>{
|
|
36506
|
+
const { sourceImage } = this.state;
|
|
36507
|
+
const target = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.getCaptionWrapper)(j, sourceImage) ?? sourceImage;
|
|
35117
36508
|
const caret = j.s.createRange();
|
|
35118
|
-
caret.setStartBefore(
|
|
36509
|
+
caret.setStartBefore(target);
|
|
35119
36510
|
caret.collapse(true);
|
|
35120
|
-
j.s.removeNode(
|
|
36511
|
+
j.s.removeNode(target);
|
|
35121
36512
|
dialog.close();
|
|
35122
36513
|
j.s.selectRange(caret);
|
|
35123
36514
|
});
|
|
@@ -35139,12 +36530,22 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.image = {
|
|
|
35139
36530
|
if (j.isInDestruct || !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isOrContains(j.editor, sourceImage)) {
|
|
35140
36531
|
return;
|
|
35141
36532
|
}
|
|
36533
|
+
const wrapper = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.getCaptionWrapper)(j, sourceImage);
|
|
36534
|
+
const caption = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.getImageCaption)(j, wrapper);
|
|
36535
|
+
// A blank caption, as one the dialog has added, takes the caret, as
|
|
36536
|
+
// the image popup's Caption button does
|
|
36537
|
+
if (caption && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isEmpty(caption)) {
|
|
36538
|
+
j.s.setCursorIn(caption);
|
|
36539
|
+
return;
|
|
36540
|
+
}
|
|
36541
|
+
// A captioned image is selected with its caption, as a click selects it
|
|
36542
|
+
const target = wrapper ?? sourceImage;
|
|
35142
36543
|
if (j.o.image.selectImageAfterClose) {
|
|
35143
|
-
j.s.select(
|
|
36544
|
+
j.s.select(target);
|
|
35144
36545
|
return;
|
|
35145
36546
|
}
|
|
35146
36547
|
const caret = j.s.createRange();
|
|
35147
|
-
caret.setStartAfter(
|
|
36548
|
+
caret.setStartAfter(target);
|
|
35148
36549
|
caret.collapse(true);
|
|
35149
36550
|
j.s.selectRange(caret);
|
|
35150
36551
|
});
|
|
@@ -35277,6 +36678,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.image = {
|
|
|
35277
36678
|
borderRadius: 0,
|
|
35278
36679
|
imageTitle: '',
|
|
35279
36680
|
imageAlt: '',
|
|
36681
|
+
imageCaption: false,
|
|
35280
36682
|
imageLink: '',
|
|
35281
36683
|
imageLinkOpenInNewTab: false,
|
|
35282
36684
|
imageWidth: 0,
|
|
@@ -35346,10 +36748,11 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_4__.pluginSystem.add('imageProperties
|
|
|
35346
36748
|
/* harmony import */ var jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16849);
|
|
35347
36749
|
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7909);
|
|
35348
36750
|
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(80991);
|
|
35349
|
-
/* harmony import */ var
|
|
35350
|
-
/* harmony import */ var
|
|
35351
|
-
/* harmony import */ var
|
|
35352
|
-
/* harmony import */ var
|
|
36751
|
+
/* harmony import */ var jodit_core_helpers_utils_image_caption__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(66638);
|
|
36752
|
+
/* harmony import */ var _align__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(26633);
|
|
36753
|
+
/* harmony import */ var _link__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(79310);
|
|
36754
|
+
/* harmony import */ var _margin__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(18380);
|
|
36755
|
+
/* harmony import */ var _size__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(57339);
|
|
35353
36756
|
/*!
|
|
35354
36757
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
35355
36758
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -35363,12 +36766,18 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_4__.pluginSystem.add('imageProperties
|
|
|
35363
36766
|
|
|
35364
36767
|
|
|
35365
36768
|
|
|
36769
|
+
|
|
35366
36770
|
/**
|
|
35367
36771
|
* Read values from image and set it to state
|
|
35368
36772
|
* @private
|
|
35369
36773
|
*/ async function readValuesFromImage(j, state) {
|
|
35370
36774
|
const { sourceImage: image, values } = state;
|
|
35371
|
-
|
|
36775
|
+
// A captioned image's caption element holds its place on the page and
|
|
36776
|
+
// its width
|
|
36777
|
+
const wrapper = (0,jodit_core_helpers_utils_image_caption__WEBPACK_IMPORTED_MODULE_3__.getCaptionWrapper)(j, image);
|
|
36778
|
+
const box = wrapper ?? image;
|
|
36779
|
+
values.imageCaption = Boolean(wrapper);
|
|
36780
|
+
(0,_align__WEBPACK_IMPORTED_MODULE_4__.readAlign)(box, values, (0,jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_0__.getAlignClasses)(j, box));
|
|
35372
36781
|
// Border radius
|
|
35373
36782
|
values.borderRadius = parseInt((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__.cssInline)(image, 'border-radius') || '0', 10) || 0;
|
|
35374
36783
|
// Id
|
|
@@ -35382,13 +36791,13 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_4__.pluginSystem.add('imageProperties
|
|
|
35382
36791
|
// Classes
|
|
35383
36792
|
values.classes = ((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'class') || '').replace(/jodit_focused_image[\s]*/, '');
|
|
35384
36793
|
// Margins
|
|
35385
|
-
(0,
|
|
36794
|
+
(0,_margin__WEBPACK_IMPORTED_MODULE_6__.readMargins)(box, values, state);
|
|
35386
36795
|
// Link
|
|
35387
|
-
(0,
|
|
36796
|
+
(0,_link__WEBPACK_IMPORTED_MODULE_5__.readLink)(state, j, values);
|
|
35388
36797
|
// Src
|
|
35389
36798
|
values.imageSrc = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'src') || '';
|
|
35390
36799
|
// Image size
|
|
35391
|
-
return (0,
|
|
36800
|
+
return (0,_size__WEBPACK_IMPORTED_MODULE_7__.readSizes)(image, values, state, wrapper);
|
|
35392
36801
|
}
|
|
35393
36802
|
|
|
35394
36803
|
|
|
@@ -35490,13 +36899,13 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_4__.pluginSystem.add('imageProperties
|
|
|
35490
36899
|
|
|
35491
36900
|
|
|
35492
36901
|
|
|
35493
|
-
/** @private */ async function readSizes(image, values, state) {
|
|
36902
|
+
/** @private */ async function readSizes(image, values, state, captionWrapper) {
|
|
35494
36903
|
try {
|
|
35495
36904
|
await image.decode();
|
|
35496
36905
|
} catch (e) {
|
|
35497
36906
|
console.error(e);
|
|
35498
36907
|
}
|
|
35499
|
-
const width = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'width', true) || (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'width') || false;
|
|
36908
|
+
const width = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__.css)(captionWrapper ?? image, 'width', true) || (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'width') || false;
|
|
35500
36909
|
const height = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'height', true) || (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'height') || false;
|
|
35501
36910
|
values.imageWidth = width !== false ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_3__.normalSizeFromString)(width) : image.offsetWidth || image.naturalWidth;
|
|
35502
36911
|
if ((0,jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_0__.isNumeric)(values.imageWidth)) {
|
|
@@ -35769,6 +37178,12 @@ class UIImageMainTab extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_
|
|
|
35769
37178
|
<label>~Alternative~</label>
|
|
35770
37179
|
<input type="text" class="jodit-input &__imageAlt"/>
|
|
35771
37180
|
</div>
|
|
37181
|
+
<div class="jodit-form__group &__captionCheckbox">
|
|
37182
|
+
<label class="jodit_vertical_middle">
|
|
37183
|
+
<input type="checkbox" class="jodit-checkbox &__imageCaption"/>
|
|
37184
|
+
<span>~Caption~</span>
|
|
37185
|
+
</label>
|
|
37186
|
+
</div>
|
|
35772
37187
|
<div class="jodit-form__group &__editLink">
|
|
35773
37188
|
<label>~Link~</label>
|
|
35774
37189
|
<input type="text" class="jodit-input &__imageLink"/>
|
|
@@ -35813,6 +37228,13 @@ class UIImageMainTab extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_
|
|
|
35813
37228
|
onAltChange() {
|
|
35814
37229
|
this.state.values.imageAlt = this.getElm('imageAlt').value;
|
|
35815
37230
|
}
|
|
37231
|
+
onStateCaptionChange() {
|
|
37232
|
+
const caption = this.getElm('imageCaption');
|
|
37233
|
+
caption.checked = this.state.values.imageCaption;
|
|
37234
|
+
}
|
|
37235
|
+
onCaptionChange() {
|
|
37236
|
+
this.state.values.imageCaption = this.getElm('imageCaption').checked;
|
|
37237
|
+
}
|
|
35816
37238
|
onStateImageLinkChange() {
|
|
35817
37239
|
const imageLink = this.getElm('imageLink');
|
|
35818
37240
|
imageLink.value = this.state.values.imageLink;
|
|
@@ -35843,6 +37265,10 @@ class UIImageMainTab extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_
|
|
|
35843
37265
|
'editAlt',
|
|
35844
37266
|
'editAlt'
|
|
35845
37267
|
],
|
|
37268
|
+
[
|
|
37269
|
+
'showCaptionCheckbox',
|
|
37270
|
+
'captionCheckbox'
|
|
37271
|
+
],
|
|
35846
37272
|
[
|
|
35847
37273
|
'editLink',
|
|
35848
37274
|
'editLink'
|
|
@@ -35896,6 +37322,12 @@ class UIImageMainTab extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_
|
|
|
35896
37322
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
35897
37323
|
(0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_4__.watch)('imageAlt:change')
|
|
35898
37324
|
], UIImageMainTab.prototype, "onAltChange", null);
|
|
37325
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
37326
|
+
(0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_4__.watch)('state.values.imageCaption')
|
|
37327
|
+
], UIImageMainTab.prototype, "onStateCaptionChange", null);
|
|
37328
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
37329
|
+
(0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_4__.watch)('imageCaption:change')
|
|
37330
|
+
], UIImageMainTab.prototype, "onCaptionChange", null);
|
|
35899
37331
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
35900
37332
|
(0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_4__.watch)('state.values.imageLink')
|
|
35901
37333
|
], UIImageMainTab.prototype, "onStateImageLinkChange", null);
|
|
@@ -36344,6 +37776,35 @@ UIImagePositionTab = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__
|
|
|
36344
37776
|
/* harmony export */ ]);
|
|
36345
37777
|
|
|
36346
37778
|
|
|
37779
|
+
/***/ }),
|
|
37780
|
+
|
|
37781
|
+
/***/ 6602:
|
|
37782
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
37783
|
+
|
|
37784
|
+
"use strict";
|
|
37785
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
37786
|
+
/* harmony export */ applyCaption: function() { return /* binding */ applyCaption; }
|
|
37787
|
+
/* harmony export */ });
|
|
37788
|
+
/* harmony import */ var jodit_core_helpers_utils_image_caption__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(66638);
|
|
37789
|
+
/*!
|
|
37790
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
37791
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
37792
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
37793
|
+
*/ /**
|
|
37794
|
+
* @module plugins/image-properties
|
|
37795
|
+
*/
|
|
37796
|
+
/**
|
|
37797
|
+
* Gives the image a caption or takes it away, and returns the element that
|
|
37798
|
+
* holds the image's place on the page: the caption's, or the image
|
|
37799
|
+
* @private
|
|
37800
|
+
*/ function applyCaption(j, image, imageCaption) {
|
|
37801
|
+
if (j.o.image.showCaptionCheckbox) {
|
|
37802
|
+
j.e.fire('toggleImageCaption', image, imageCaption);
|
|
37803
|
+
}
|
|
37804
|
+
return (0,jodit_core_helpers_utils_image_caption__WEBPACK_IMPORTED_MODULE_0__.getCaptionWrapper)(j, image) ?? image;
|
|
37805
|
+
}
|
|
37806
|
+
|
|
37807
|
+
|
|
36347
37808
|
/***/ }),
|
|
36348
37809
|
|
|
36349
37810
|
/***/ 71552:
|
|
@@ -36356,9 +37817,10 @@ UIImagePositionTab = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__
|
|
|
36356
37817
|
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
|
|
36357
37818
|
/* harmony import */ var jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(93640);
|
|
36358
37819
|
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(80991);
|
|
36359
|
-
/* harmony import */ var
|
|
36360
|
-
/* harmony import */ var
|
|
36361
|
-
/* harmony import */ var
|
|
37820
|
+
/* harmony import */ var _caption__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6602);
|
|
37821
|
+
/* harmony import */ var _link__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(49422);
|
|
37822
|
+
/* harmony import */ var _margin__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(21132);
|
|
37823
|
+
/* harmony import */ var _size__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(49147);
|
|
36362
37824
|
/*!
|
|
36363
37825
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
36364
37826
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -36371,11 +37833,12 @@ UIImagePositionTab = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__
|
|
|
36371
37833
|
|
|
36372
37834
|
|
|
36373
37835
|
|
|
37836
|
+
|
|
36374
37837
|
/**
|
|
36375
37838
|
* Apply form's values to image
|
|
36376
37839
|
* @private
|
|
36377
37840
|
*/ function applyValuesToImage(j, state, image) {
|
|
36378
|
-
const { style, imageSrc, borderRadius, imageTitle, imageAlt, imageLink, imageWidth, imageHeight, marginTop, marginRight, marginBottom, marginLeft, imageLinkOpenInNewTab, align, classes, id } = state.values;
|
|
37841
|
+
const { style, imageSrc, borderRadius, imageTitle, imageAlt, imageCaption, imageLink, imageWidth, imageHeight, marginTop, marginRight, marginBottom, marginLeft, imageLinkOpenInNewTab, align, classes, id } = state.values;
|
|
36379
37842
|
const opt = j.o;
|
|
36380
37843
|
// styles
|
|
36381
37844
|
if (opt.image.editStyle) {
|
|
@@ -36385,7 +37848,7 @@ UIImagePositionTab = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__
|
|
|
36385
37848
|
if (imageSrc) {
|
|
36386
37849
|
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'src', imageSrc);
|
|
36387
37850
|
} else {
|
|
36388
|
-
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(image);
|
|
37851
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove((0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.getCaptionWrapper)(j, image) ?? image);
|
|
36389
37852
|
return;
|
|
36390
37853
|
}
|
|
36391
37854
|
// Border radius
|
|
@@ -36395,21 +37858,24 @@ UIImagePositionTab = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__
|
|
|
36395
37858
|
// Alt
|
|
36396
37859
|
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'alt', imageAlt || null);
|
|
36397
37860
|
// Link
|
|
36398
|
-
(0,
|
|
36399
|
-
// Size
|
|
36400
|
-
(0,_size__WEBPACK_IMPORTED_MODULE_5__.applySize)(image, imageWidth, imageHeight, state.sizeIsLocked);
|
|
36401
|
-
// Margin
|
|
36402
|
-
if (j.o.image.editMargins) {
|
|
36403
|
-
(0,_margin__WEBPACK_IMPORTED_MODULE_4__.applyMargin)(j, marginTop, marginRight, marginBottom, marginLeft, image, state.marginIsLocked);
|
|
36404
|
-
}
|
|
37861
|
+
(0,_link__WEBPACK_IMPORTED_MODULE_4__.applyLink)(j, image, imageLink, imageLinkOpenInNewTab);
|
|
36405
37862
|
if (opt.image.editClass) {
|
|
36406
37863
|
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'class', classes || null);
|
|
36407
37864
|
}
|
|
36408
37865
|
if (opt.image.editId) {
|
|
36409
37866
|
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'id', id || null);
|
|
36410
37867
|
}
|
|
37868
|
+
// The caption's element takes the image's place on the page and its width,
|
|
37869
|
+
// so it's added or taken away after the image's own style and classes
|
|
37870
|
+
const box = (0,_caption__WEBPACK_IMPORTED_MODULE_3__.applyCaption)(j, image, imageCaption);
|
|
37871
|
+
// Size
|
|
37872
|
+
(0,_size__WEBPACK_IMPORTED_MODULE_6__.applySize)(image, imageWidth, imageHeight, state.sizeIsLocked, box);
|
|
37873
|
+
// Margin
|
|
37874
|
+
if (j.o.image.editMargins) {
|
|
37875
|
+
(0,_margin__WEBPACK_IMPORTED_MODULE_5__.applyMargin)(j, marginTop, marginRight, marginBottom, marginLeft, box, state.marginIsLocked);
|
|
37876
|
+
}
|
|
36411
37877
|
if (opt.image.editAlign) {
|
|
36412
|
-
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.hAlignElement)(
|
|
37878
|
+
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.hAlignElement)(box, align, (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.getAlignClasses)(j, box));
|
|
36413
37879
|
}
|
|
36414
37880
|
}
|
|
36415
37881
|
|
|
@@ -36425,6 +37891,7 @@ UIImagePositionTab = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__
|
|
|
36425
37891
|
/* harmony export */ });
|
|
36426
37892
|
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
|
|
36427
37893
|
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7909);
|
|
37894
|
+
/* harmony import */ var jodit_core_helpers_utils_image_caption__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(66638);
|
|
36428
37895
|
/*!
|
|
36429
37896
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
36430
37897
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -36433,6 +37900,7 @@ UIImagePositionTab = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__
|
|
|
36433
37900
|
* @module plugins/image-properties
|
|
36434
37901
|
*/
|
|
36435
37902
|
|
|
37903
|
+
|
|
36436
37904
|
/** @private */ function applyLink(j, image, imageLink, imageLinkOpenInNewTab) {
|
|
36437
37905
|
// Link
|
|
36438
37906
|
let link = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.closest(image, 'a', j.editor);
|
|
@@ -36446,8 +37914,11 @@ UIImagePositionTab = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__
|
|
|
36446
37914
|
const relParts = ((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(link, 'rel') || '').split(/\s+/).filter((p)=>p && p !== 'noopener' && p !== 'noreferrer');
|
|
36447
37915
|
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(link, 'rel', relParts.length ? relParts.join(' ') : null);
|
|
36448
37916
|
}
|
|
36449
|
-
} else {
|
|
36450
|
-
|
|
37917
|
+
} else if (link && link.parentNode) {
|
|
37918
|
+
// Froala keeps a linked image's caption inside the link
|
|
37919
|
+
if ((0,jodit_core_helpers_utils_image_caption__WEBPACK_IMPORTED_MODULE_2__.getCaptionWrapper)(j, image)) {
|
|
37920
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.unwrap(link);
|
|
37921
|
+
} else {
|
|
36451
37922
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.replace(link, image, undefined, false, true);
|
|
36452
37923
|
}
|
|
36453
37924
|
}
|
|
@@ -36529,7 +38000,19 @@ UIImagePositionTab = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__
|
|
|
36529
38000
|
|
|
36530
38001
|
|
|
36531
38002
|
|
|
36532
|
-
/**
|
|
38003
|
+
/**
|
|
38004
|
+
* A captioned image fills its caption's element, `box`, which takes the width
|
|
38005
|
+
* @private
|
|
38006
|
+
*/ function applySize(image, imageWidth, imageHeight, sizeIsLocked, box = image) {
|
|
38007
|
+
if (box !== image) {
|
|
38008
|
+
const width = imageWidth ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_3__.normalSizeToString)(imageWidth) : null;
|
|
38009
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__.css)(box, 'width', width);
|
|
38010
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__.css)(image, {
|
|
38011
|
+
width: width && '100%',
|
|
38012
|
+
height: sizeIsLocked || !imageHeight ? null : (0,_utils_utils__WEBPACK_IMPORTED_MODULE_3__.normalSizeToString)(imageHeight)
|
|
38013
|
+
});
|
|
38014
|
+
return;
|
|
38015
|
+
}
|
|
36533
38016
|
// Size
|
|
36534
38017
|
if (imageWidth !== image.offsetWidth || imageHeight !== image.offsetHeight) {
|
|
36535
38018
|
const updatedWidth = imageWidth ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_3__.normalSizeToString)(imageWidth) : null;
|
|
@@ -36696,6 +38179,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_3__.Config.prototype.indentMargin = 10;
|
|
|
36696
38179
|
|
|
36697
38180
|
"use strict";
|
|
36698
38181
|
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
|
|
38182
|
+
/* harmony import */ var jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(93640);
|
|
38183
|
+
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(80991);
|
|
36699
38184
|
/*!
|
|
36700
38185
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
36701
38186
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -36703,12 +38188,35 @@ jodit_config__WEBPACK_IMPORTED_MODULE_3__.Config.prototype.indentMargin = 10;
|
|
|
36703
38188
|
*/ /**
|
|
36704
38189
|
* @module plugins/indent
|
|
36705
38190
|
*/
|
|
38191
|
+
|
|
38192
|
+
|
|
36706
38193
|
/**
|
|
36707
38194
|
* Get style rule key for current direction
|
|
36708
38195
|
* @internal
|
|
36709
38196
|
*/ const getKey = (direction, box)=>`${jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isCell(box) ? 'padding' : 'margin'}${direction === 'rtl' ? 'Right' : 'Left'}`;
|
|
38197
|
+
/**
|
|
38198
|
+
* Indents or outdents a box by `indentMargin`
|
|
38199
|
+
* @internal
|
|
38200
|
+
*/ const applyIndentToBox = (processedElements, currentBox, editor, command)=>{
|
|
38201
|
+
if (!currentBox) {
|
|
38202
|
+
return;
|
|
38203
|
+
}
|
|
38204
|
+
if (processedElements.has(currentBox)) {
|
|
38205
|
+
return;
|
|
38206
|
+
}
|
|
38207
|
+
const key = getKey(editor.o.direction, currentBox);
|
|
38208
|
+
processedElements.add(currentBox);
|
|
38209
|
+
const current = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__.cssInline)(currentBox, key);
|
|
38210
|
+
let value = current ? parseInt(current, 10) : 0;
|
|
38211
|
+
value += editor.o.indentMargin * (command === 'outdent' ? -1 : 1);
|
|
38212
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__.css)(currentBox, key, value > 0 ? value : '');
|
|
38213
|
+
if (!(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(currentBox, 'style')) {
|
|
38214
|
+
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(currentBox, 'style', null);
|
|
38215
|
+
}
|
|
38216
|
+
};
|
|
36710
38217
|
|
|
36711
38218
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, [
|
|
38219
|
+
/* harmony export */ "applyIndentToBox", 0, /* binding */ applyIndentToBox,
|
|
36712
38220
|
/* harmony export */ "getKey", 0, /* binding */ getKey
|
|
36713
38221
|
/* harmony export */ ]);
|
|
36714
38222
|
|
|
@@ -36724,9 +38232,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_3__.Config.prototype.indentMargin = 10;
|
|
|
36724
38232
|
/* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(27795);
|
|
36725
38233
|
/* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(28077);
|
|
36726
38234
|
/* harmony import */ var jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(93640);
|
|
36727
|
-
/* harmony import */ var
|
|
36728
|
-
/* harmony import */ var
|
|
36729
|
-
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(11917);
|
|
38235
|
+
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(42360);
|
|
38236
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(11917);
|
|
36730
38237
|
/*!
|
|
36731
38238
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
36732
38239
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -36741,24 +38248,6 @@ jodit_config__WEBPACK_IMPORTED_MODULE_3__.Config.prototype.indentMargin = 10;
|
|
|
36741
38248
|
|
|
36742
38249
|
|
|
36743
38250
|
|
|
36744
|
-
|
|
36745
|
-
const applyIndentToBox = (processedElements, currentBox, editor, command)=>{
|
|
36746
|
-
if (!currentBox) {
|
|
36747
|
-
return;
|
|
36748
|
-
}
|
|
36749
|
-
if (processedElements.has(currentBox)) {
|
|
36750
|
-
return;
|
|
36751
|
-
}
|
|
36752
|
-
const key = (0,_helpers__WEBPACK_IMPORTED_MODULE_6__.getKey)(editor.o.direction, currentBox);
|
|
36753
|
-
processedElements.add(currentBox);
|
|
36754
|
-
const current = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_4__.cssInline)(currentBox, key);
|
|
36755
|
-
let value = current ? parseInt(current, 10) : 0;
|
|
36756
|
-
value += editor.o.indentMargin * (command === 'outdent' ? -1 : 1);
|
|
36757
|
-
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_4__.css)(currentBox, key, value > 0 ? value : '');
|
|
36758
|
-
if (!(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(currentBox, 'style')) {
|
|
36759
|
-
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(currentBox, 'style', null);
|
|
36760
|
-
}
|
|
36761
|
-
};
|
|
36762
38251
|
/**
|
|
36763
38252
|
* Indents the line containing the selection or insertion point.
|
|
36764
38253
|
*/ function indent(editor) {
|
|
@@ -36777,7 +38266,7 @@ const applyIndentToBox = (processedElements, currentBox, editor, command)=>{
|
|
|
36777
38266
|
if (isBrMode && editor.s.isCollapsed()) {
|
|
36778
38267
|
if (current) {
|
|
36779
38268
|
const box = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.wrapNextInline(current, enterBlock, editor);
|
|
36780
|
-
applyIndentToBox(processedElements, box, editor, command);
|
|
38269
|
+
(0,_helpers__WEBPACK_IMPORTED_MODULE_5__.applyIndentToBox)(processedElements, box, editor, command);
|
|
36781
38270
|
return false;
|
|
36782
38271
|
}
|
|
36783
38272
|
}
|
|
@@ -36791,7 +38280,7 @@ const applyIndentToBox = (processedElements, currentBox, editor, command)=>{
|
|
|
36791
38280
|
editor.s.restore();
|
|
36792
38281
|
return false;
|
|
36793
38282
|
}
|
|
36794
|
-
applyIndentToBox(processedElements, currentBox, editor, command);
|
|
38283
|
+
;(0,_helpers__WEBPACK_IMPORTED_MODULE_5__.applyIndentToBox)(processedElements, currentBox, editor, command);
|
|
36795
38284
|
editor.s.restore();
|
|
36796
38285
|
});
|
|
36797
38286
|
editor.synchronizeValues();
|
|
@@ -36843,48 +38332,49 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__.pluginSystem.add('indent', indent
|
|
|
36843
38332
|
/* harmony import */ var jodit_plugins_hr_hr__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(2952);
|
|
36844
38333
|
/* harmony import */ var jodit_plugins_iframe_iframe__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(81144);
|
|
36845
38334
|
/* harmony import */ var jodit_plugins_image_image__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(90826);
|
|
36846
|
-
/* harmony import */ var
|
|
36847
|
-
/* harmony import */ var
|
|
36848
|
-
/* harmony import */ var
|
|
36849
|
-
/* harmony import */ var
|
|
36850
|
-
/* harmony import */ var
|
|
36851
|
-
/* harmony import */ var
|
|
36852
|
-
/* harmony import */ var
|
|
36853
|
-
/* harmony import */ var
|
|
36854
|
-
/* harmony import */ var
|
|
36855
|
-
/* harmony import */ var
|
|
36856
|
-
/* harmony import */ var
|
|
36857
|
-
/* harmony import */ var
|
|
36858
|
-
/* harmony import */ var
|
|
36859
|
-
/* harmony import */ var
|
|
36860
|
-
/* harmony import */ var
|
|
36861
|
-
/* harmony import */ var
|
|
36862
|
-
/* harmony import */ var
|
|
36863
|
-
/* harmony import */ var
|
|
36864
|
-
/* harmony import */ var
|
|
36865
|
-
/* harmony import */ var
|
|
36866
|
-
/* harmony import */ var
|
|
36867
|
-
/* harmony import */ var
|
|
36868
|
-
/* harmony import */ var
|
|
36869
|
-
/* harmony import */ var
|
|
36870
|
-
/* harmony import */ var
|
|
36871
|
-
/* harmony import */ var
|
|
36872
|
-
/* harmony import */ var
|
|
36873
|
-
/* harmony import */ var
|
|
36874
|
-
/* harmony import */ var
|
|
36875
|
-
/* harmony import */ var
|
|
36876
|
-
/* harmony import */ var
|
|
36877
|
-
/* harmony import */ var
|
|
36878
|
-
/* harmony import */ var
|
|
36879
|
-
/* harmony import */ var
|
|
36880
|
-
/* harmony import */ var
|
|
36881
|
-
/* harmony import */ var
|
|
36882
|
-
/* harmony import */ var
|
|
36883
|
-
/* harmony import */ var
|
|
36884
|
-
/* harmony import */ var
|
|
36885
|
-
/* harmony import */ var
|
|
36886
|
-
/* harmony import */ var
|
|
36887
|
-
/* harmony import */ var
|
|
38335
|
+
/* harmony import */ var jodit_plugins_image_caption_image_caption__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(43058);
|
|
38336
|
+
/* harmony import */ var jodit_plugins_image_processor_image_processor__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(39978);
|
|
38337
|
+
/* harmony import */ var jodit_plugins_image_properties_image_properties__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(90886);
|
|
38338
|
+
/* harmony import */ var jodit_plugins_indent_indent__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(39000);
|
|
38339
|
+
/* harmony import */ var jodit_plugins_inline_popup_inline_popup__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(88952);
|
|
38340
|
+
/* harmony import */ var jodit_plugins_justify_justify__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(64094);
|
|
38341
|
+
/* harmony import */ var jodit_plugins_key_arrow_outside_key_arrow_outside__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(18210);
|
|
38342
|
+
/* harmony import */ var jodit_plugins_limit_limit__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(50662);
|
|
38343
|
+
/* harmony import */ var jodit_plugins_line_height_line_height__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(58354);
|
|
38344
|
+
/* harmony import */ var jodit_plugins_link_link__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(68624);
|
|
38345
|
+
/* harmony import */ var jodit_plugins_media_media__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(76830);
|
|
38346
|
+
/* harmony import */ var jodit_plugins_mobile_mobile__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(74240);
|
|
38347
|
+
/* harmony import */ var jodit_plugins_ordered_list_ordered_list__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(98792);
|
|
38348
|
+
/* harmony import */ var jodit_plugins_paste_paste__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(23422);
|
|
38349
|
+
/* harmony import */ var jodit_plugins_paste_from_word_paste_from_word__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(96730);
|
|
38350
|
+
/* harmony import */ var jodit_plugins_paste_storage_paste_storage__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(7758);
|
|
38351
|
+
/* harmony import */ var jodit_plugins_placeholder_placeholder__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(28346);
|
|
38352
|
+
/* harmony import */ var jodit_plugins_powered_by_jodit_powered_by_jodit__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(198);
|
|
38353
|
+
/* harmony import */ var jodit_plugins_preview_preview__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(49690);
|
|
38354
|
+
/* harmony import */ var jodit_plugins_print_print__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(41134);
|
|
38355
|
+
/* harmony import */ var jodit_plugins_redo_undo_redo_undo__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(59758);
|
|
38356
|
+
/* harmony import */ var jodit_plugins_resize_cells_resize_cells__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(14248);
|
|
38357
|
+
/* harmony import */ var jodit_plugins_resize_handler_resize_handler__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(72214);
|
|
38358
|
+
/* harmony import */ var jodit_plugins_resizer_resizer__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(74522);
|
|
38359
|
+
/* harmony import */ var jodit_plugins_search_search__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(30500);
|
|
38360
|
+
/* harmony import */ var jodit_plugins_select_select__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(98988);
|
|
38361
|
+
/* harmony import */ var jodit_plugins_select_cells_select_cells__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(2756);
|
|
38362
|
+
/* harmony import */ var jodit_plugins_size_size__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(44322);
|
|
38363
|
+
/* harmony import */ var jodit_plugins_source_source__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(13810);
|
|
38364
|
+
/* harmony import */ var jodit_plugins_spellcheck_spellcheck__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(90204);
|
|
38365
|
+
/* harmony import */ var jodit_plugins_stat_stat__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(86236);
|
|
38366
|
+
/* harmony import */ var jodit_plugins_sticky_sticky__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(67582);
|
|
38367
|
+
/* harmony import */ var jodit_plugins_symbols_symbols__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(11774);
|
|
38368
|
+
/* harmony import */ var jodit_plugins_ai_assistant_ai_assistant__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(14774);
|
|
38369
|
+
/* harmony import */ var jodit_plugins_tab_tab__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(81582);
|
|
38370
|
+
/* harmony import */ var jodit_plugins_table_table__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(7994);
|
|
38371
|
+
/* harmony import */ var jodit_plugins_table_keyboard_navigation_table_keyboard_navigation__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(30110);
|
|
38372
|
+
/* harmony import */ var jodit_plugins_toolbar_navigation_toolbar_navigation__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(74192);
|
|
38373
|
+
/* harmony import */ var jodit_plugins_video_video__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(34142);
|
|
38374
|
+
/* harmony import */ var jodit_plugins_video_properties_video_properties__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(40878);
|
|
38375
|
+
/* harmony import */ var jodit_plugins_wrap_nodes_wrap_nodes__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(22980);
|
|
38376
|
+
/* harmony import */ var jodit_plugins_dtd_dtd__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(56894);
|
|
38377
|
+
/* harmony import */ var jodit_plugins_xpath_xpath__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(52014);
|
|
36888
38378
|
/*!
|
|
36889
38379
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
36890
38380
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -36958,6 +38448,7 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__.pluginSystem.add('indent', indent
|
|
|
36958
38448
|
|
|
36959
38449
|
|
|
36960
38450
|
|
|
38451
|
+
|
|
36961
38452
|
|
|
36962
38453
|
|
|
36963
38454
|
/***/ }),
|
|
@@ -36978,16 +38469,20 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__.pluginSystem.add('indent', indent
|
|
|
36978
38469
|
/* harmony import */ var jodit_plugins_inline_popup_icons_addcolumn_svg__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(jodit_plugins_inline_popup_icons_addcolumn_svg__WEBPACK_IMPORTED_MODULE_8__);
|
|
36979
38470
|
/* harmony import */ var jodit_plugins_inline_popup_icons_addrow_svg__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(64637);
|
|
36980
38471
|
/* harmony import */ var jodit_plugins_inline_popup_icons_addrow_svg__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(jodit_plugins_inline_popup_icons_addrow_svg__WEBPACK_IMPORTED_MODULE_9__);
|
|
36981
|
-
/* harmony import */ var
|
|
36982
|
-
/* harmony import */ var
|
|
36983
|
-
/* harmony import */ var
|
|
36984
|
-
/* harmony import */ var
|
|
36985
|
-
/* harmony import */ var
|
|
36986
|
-
/* harmony import */ var
|
|
36987
|
-
/* harmony import */ var
|
|
36988
|
-
/* harmony import */ var
|
|
36989
|
-
/* harmony import */ var
|
|
36990
|
-
/* harmony import */ var
|
|
38472
|
+
/* harmony import */ var jodit_plugins_inline_popup_icons_caption_svg__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(92148);
|
|
38473
|
+
/* harmony import */ var jodit_plugins_inline_popup_icons_caption_svg__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(jodit_plugins_inline_popup_icons_caption_svg__WEBPACK_IMPORTED_MODULE_10__);
|
|
38474
|
+
/* harmony import */ var jodit_plugins_inline_popup_icons_headerrow_svg__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(20115);
|
|
38475
|
+
/* harmony import */ var jodit_plugins_inline_popup_icons_headerrow_svg__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(jodit_plugins_inline_popup_icons_headerrow_svg__WEBPACK_IMPORTED_MODULE_11__);
|
|
38476
|
+
/* harmony import */ var jodit_plugins_inline_popup_icons_merge_svg__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(94190);
|
|
38477
|
+
/* harmony import */ var jodit_plugins_inline_popup_icons_merge_svg__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(jodit_plugins_inline_popup_icons_merge_svg__WEBPACK_IMPORTED_MODULE_12__);
|
|
38478
|
+
/* harmony import */ var jodit_plugins_inline_popup_icons_splitg_svg__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(51957);
|
|
38479
|
+
/* harmony import */ var jodit_plugins_inline_popup_icons_splitg_svg__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(jodit_plugins_inline_popup_icons_splitg_svg__WEBPACK_IMPORTED_MODULE_13__);
|
|
38480
|
+
/* harmony import */ var jodit_plugins_inline_popup_icons_splitv_svg__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(71940);
|
|
38481
|
+
/* harmony import */ var jodit_plugins_inline_popup_icons_splitv_svg__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(jodit_plugins_inline_popup_icons_splitv_svg__WEBPACK_IMPORTED_MODULE_14__);
|
|
38482
|
+
/* harmony import */ var jodit_plugins_inline_popup_icons_th_svg__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(43218);
|
|
38483
|
+
/* harmony import */ var jodit_plugins_inline_popup_icons_th_svg__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(jodit_plugins_inline_popup_icons_th_svg__WEBPACK_IMPORTED_MODULE_15__);
|
|
38484
|
+
/* harmony import */ var jodit_plugins_inline_popup_icons_th_list_svg__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(48007);
|
|
38485
|
+
/* harmony import */ var jodit_plugins_inline_popup_icons_th_list_svg__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(jodit_plugins_inline_popup_icons_th_list_svg__WEBPACK_IMPORTED_MODULE_16__);
|
|
36991
38486
|
/*!
|
|
36992
38487
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
36993
38488
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -37009,13 +38504,15 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__.pluginSystem.add('indent', indent
|
|
|
37009
38504
|
|
|
37010
38505
|
|
|
37011
38506
|
|
|
38507
|
+
|
|
38508
|
+
|
|
37012
38509
|
jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.toolbarInline = true;
|
|
37013
38510
|
jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.toolbarInlineForSelection = false;
|
|
37014
38511
|
jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.toolbarInlineDisableFor = [];
|
|
37015
38512
|
jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.toolbarInlineDisabledButtons = [
|
|
37016
38513
|
'source'
|
|
37017
38514
|
];
|
|
37018
|
-
jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_1__.Icon.set('addcolumn', (jodit_plugins_inline_popup_icons_addcolumn_svg__WEBPACK_IMPORTED_MODULE_8___default())).set('addrow', (jodit_plugins_inline_popup_icons_addrow_svg__WEBPACK_IMPORTED_MODULE_9___default())).set('merge', (
|
|
38515
|
+
jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_1__.Icon.set('addcolumn', (jodit_plugins_inline_popup_icons_addcolumn_svg__WEBPACK_IMPORTED_MODULE_8___default())).set('addrow', (jodit_plugins_inline_popup_icons_addrow_svg__WEBPACK_IMPORTED_MODULE_9___default())).set('caption', (jodit_plugins_inline_popup_icons_caption_svg__WEBPACK_IMPORTED_MODULE_10___default())).set('headerrow', (jodit_plugins_inline_popup_icons_headerrow_svg__WEBPACK_IMPORTED_MODULE_11___default())).set('merge', (jodit_plugins_inline_popup_icons_merge_svg__WEBPACK_IMPORTED_MODULE_12___default())).set('th', (jodit_plugins_inline_popup_icons_th_svg__WEBPACK_IMPORTED_MODULE_15___default())).set('splitg', (jodit_plugins_inline_popup_icons_splitg_svg__WEBPACK_IMPORTED_MODULE_13___default())).set('splitv', (jodit_plugins_inline_popup_icons_splitv_svg__WEBPACK_IMPORTED_MODULE_14___default())).set('th-list', (jodit_plugins_inline_popup_icons_th_list_svg__WEBPACK_IMPORTED_MODULE_16___default()));
|
|
37019
38516
|
// Register cell popup buttons as global controls so they can be
|
|
37020
38517
|
// referenced by name in custom popup configurations.
|
|
37021
38518
|
// Skip buttons that already exist in controls (e.g. 'align' from justify plugin).
|
|
@@ -37096,8 +38593,10 @@ const isSafeHref = (href)=>/^(https?:|mailto:|tel:)/i.test(href.trim()) && !/^(j
|
|
|
37096
38593
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
37097
38594
|
|
|
37098
38595
|
"use strict";
|
|
37099
|
-
/* harmony import */ var
|
|
37100
|
-
/* harmony import */ var
|
|
38596
|
+
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
|
|
38597
|
+
/* harmony import */ var jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(28686);
|
|
38598
|
+
/* harmony import */ var jodit_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(23599);
|
|
38599
|
+
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(80991);
|
|
37101
38600
|
/*!
|
|
37102
38601
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
37103
38602
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -37106,7 +38605,9 @@ const isSafeHref = (href)=>/^(https?:|mailto:|tel:)/i.test(href.trim()) && !/^(j
|
|
|
37106
38605
|
* @module plugins/inline-popup
|
|
37107
38606
|
*/
|
|
37108
38607
|
|
|
37109
|
-
|
|
38608
|
+
|
|
38609
|
+
|
|
38610
|
+
const cmd = (control)=>control.args && (0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_1__.isString)(control.args[0]) ? control.args[0].toLowerCase() : '';
|
|
37110
38611
|
/* harmony default export */ __webpack_exports__["default"] = ([
|
|
37111
38612
|
'brushCell',
|
|
37112
38613
|
{
|
|
@@ -37121,7 +38622,7 @@ const cmd = (control)=>control.args && (0,jodit_core_helpers_checker__WEBPACK_IM
|
|
|
37121
38622
|
exec: (editor, table, { control })=>{
|
|
37122
38623
|
const command = cmd(control);
|
|
37123
38624
|
editor.getInstance('Table', editor.o).getAllSelectedCells().forEach((cell)=>{
|
|
37124
|
-
(0,
|
|
38625
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.css)(cell, 'vertical-align', command === 'normal' ? '' : command);
|
|
37125
38626
|
});
|
|
37126
38627
|
},
|
|
37127
38628
|
tooltip: 'Vertical align'
|
|
@@ -37151,7 +38652,7 @@ const cmd = (control)=>control.args && (0,jodit_core_helpers_checker__WEBPACK_IM
|
|
|
37151
38652
|
tableaddcolumnafter: 'Insert column after'
|
|
37152
38653
|
},
|
|
37153
38654
|
exec: (editor, table, { control })=>{
|
|
37154
|
-
if (!(0,
|
|
38655
|
+
if (!(0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_1__.isJoditObject)(editor)) {
|
|
37155
38656
|
return;
|
|
37156
38657
|
}
|
|
37157
38658
|
if (!control.args) {
|
|
@@ -37169,7 +38670,7 @@ const cmd = (control)=>control.args && (0,jodit_core_helpers_checker__WEBPACK_IM
|
|
|
37169
38670
|
tableaddrowafter: 'Insert row below'
|
|
37170
38671
|
},
|
|
37171
38672
|
exec: (editor, table, { control })=>{
|
|
37172
|
-
if (!(0,
|
|
38673
|
+
if (!(0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_1__.isJoditObject)(editor)) {
|
|
37173
38674
|
return;
|
|
37174
38675
|
}
|
|
37175
38676
|
if (!control.args) {
|
|
@@ -37180,6 +38681,25 @@ const cmd = (control)=>control.args && (0,jodit_core_helpers_checker__WEBPACK_IM
|
|
|
37180
38681
|
},
|
|
37181
38682
|
tooltip: 'Add row'
|
|
37182
38683
|
},
|
|
38684
|
+
{
|
|
38685
|
+
name: 'headerrow',
|
|
38686
|
+
exec: (editor, table)=>{
|
|
38687
|
+
if (!(0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_1__.isJoditObject)(editor) || !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(table, 'table')) {
|
|
38688
|
+
return;
|
|
38689
|
+
}
|
|
38690
|
+
editor.execCommand('tableheaderrow', false, table);
|
|
38691
|
+
const [cell] = editor.getInstance('Table', editor.o).getAllSelectedCells();
|
|
38692
|
+
// Beside the cell that replaced the one it opened for
|
|
38693
|
+
if (cell) {
|
|
38694
|
+
editor.e.fire('showPopup', table, ()=>(0,jodit_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_2__.position)(cell, editor), 'cells');
|
|
38695
|
+
}
|
|
38696
|
+
// The popup stays open, so the button shows the new state
|
|
38697
|
+
return true;
|
|
38698
|
+
},
|
|
38699
|
+
isActive: (editor, button)=>jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(button.target, 'table') && editor.getInstance('Table', editor.o).hasHeaderRow(button.target),
|
|
38700
|
+
isDisabled: (editor, button)=>!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(button.target, 'table') || !editor.getInstance('Table', editor.o).canToggleHeaderRow(button.target),
|
|
38701
|
+
tooltip: 'Header row'
|
|
38702
|
+
},
|
|
37183
38703
|
{
|
|
37184
38704
|
name: 'deleteTable',
|
|
37185
38705
|
icon: 'bin',
|
|
@@ -37190,7 +38710,7 @@ const cmd = (control)=>control.args && (0,jodit_core_helpers_checker__WEBPACK_IM
|
|
|
37190
38710
|
tableempty: 'Empty cell'
|
|
37191
38711
|
},
|
|
37192
38712
|
exec: (editor, table, { control })=>{
|
|
37193
|
-
if (!(0,
|
|
38713
|
+
if (!(0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_1__.isJoditObject)(editor)) {
|
|
37194
38714
|
return;
|
|
37195
38715
|
}
|
|
37196
38716
|
if (!control.args) {
|
|
@@ -37254,7 +38774,8 @@ const cmd = (control)=>control.args && (0,jodit_core_helpers_checker__WEBPACK_IM
|
|
|
37254
38774
|
/* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(85932);
|
|
37255
38775
|
/* harmony import */ var jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(16849);
|
|
37256
38776
|
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(80991);
|
|
37257
|
-
/* harmony import */ var
|
|
38777
|
+
/* harmony import */ var jodit_core_helpers_utils_image_caption__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(66638);
|
|
38778
|
+
/* harmony import */ var jodit_core_helpers_utils_media_wrapper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(83314);
|
|
37258
38779
|
/*!
|
|
37259
38780
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
37260
38781
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -37266,6 +38787,7 @@ const cmd = (control)=>control.args && (0,jodit_core_helpers_checker__WEBPACK_IM
|
|
|
37266
38787
|
|
|
37267
38788
|
|
|
37268
38789
|
|
|
38790
|
+
|
|
37269
38791
|
// A Normal image sits where the text of its line is aligned (#1531)
|
|
37270
38792
|
const lineAlign = (editor, elm)=>{
|
|
37271
38793
|
const block = elm && jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.closest(elm, jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock, editor.editor) || editor.editor;
|
|
@@ -37286,7 +38808,12 @@ const lineAlign = (editor, elm)=>{
|
|
|
37286
38808
|
return 'left';
|
|
37287
38809
|
}
|
|
37288
38810
|
};
|
|
37289
|
-
|
|
38811
|
+
// A captioned image is aligned by the element holding it and its caption
|
|
38812
|
+
const alignedBox = (editor, elm)=>(0,jodit_core_helpers_utils_image_caption__WEBPACK_IMPORTED_MODULE_4__.getCaptionWrapper)(editor, elm) ?? elm;
|
|
38813
|
+
const currentAlign = (editor, elm)=>{
|
|
38814
|
+
const box = alignedBox(editor, elm);
|
|
38815
|
+
return box ? (0,jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_2__.getHAlign)(box, (0,jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_2__.getAlignClasses)(editor, box)) : 'normal';
|
|
38816
|
+
};
|
|
37290
38817
|
const align = {
|
|
37291
38818
|
name: 'left',
|
|
37292
38819
|
childTemplate: (_, __, value)=>value,
|
|
@@ -37311,14 +38838,15 @@ const align = {
|
|
|
37311
38838
|
'img',
|
|
37312
38839
|
'jodit',
|
|
37313
38840
|
'jodit-media'
|
|
37314
|
-
])) && (0,
|
|
38841
|
+
])) && (0,jodit_core_helpers_utils_media_wrapper__WEBPACK_IMPORTED_MODULE_5__.getMediaWrapper)(editor, elm) !== elm) {
|
|
37315
38842
|
return;
|
|
37316
38843
|
}
|
|
37317
38844
|
const command = control.args && (0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_1__.isString)(control.args[0]) ? control.args[0].toLowerCase() : '';
|
|
37318
38845
|
if (!command) {
|
|
37319
38846
|
return false;
|
|
37320
38847
|
}
|
|
37321
|
-
|
|
38848
|
+
const box = alignedBox(editor, elm);
|
|
38849
|
+
(0,jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_2__.hAlignElement)(box, command, (0,jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_2__.getAlignClasses)(editor, box));
|
|
37322
38850
|
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(elm, new Set([
|
|
37323
38851
|
'jodit',
|
|
37324
38852
|
'jodit-media'
|
|
@@ -37337,7 +38865,7 @@ const align = {
|
|
|
37337
38865
|
icon: 'bin',
|
|
37338
38866
|
tooltip: 'Delete',
|
|
37339
38867
|
exec: (editor, image)=>{
|
|
37340
|
-
image && editor.s.removeNode(image);
|
|
38868
|
+
image && editor.s.removeNode((0,jodit_core_helpers_utils_image_caption__WEBPACK_IMPORTED_MODULE_4__.getCaptionWrapper)(editor, image) ?? image);
|
|
37341
38869
|
}
|
|
37342
38870
|
},
|
|
37343
38871
|
{
|
|
@@ -37350,6 +38878,24 @@ const align = {
|
|
|
37350
38878
|
},
|
|
37351
38879
|
tooltip: 'Edit'
|
|
37352
38880
|
},
|
|
38881
|
+
{
|
|
38882
|
+
name: 'caption',
|
|
38883
|
+
exec: (editor, image)=>{
|
|
38884
|
+
if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(image, 'img')) {
|
|
38885
|
+
return;
|
|
38886
|
+
}
|
|
38887
|
+
const caption = editor.e.fire('toggleImageCaption', image);
|
|
38888
|
+
editor.synchronizeValues();
|
|
38889
|
+
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isHTMLElement(caption)) {
|
|
38890
|
+
editor.e.fire('hideResizer');
|
|
38891
|
+
editor.s.setCursorIn(caption);
|
|
38892
|
+
} else {
|
|
38893
|
+
editor.e.fire('recalcPositionPopup');
|
|
38894
|
+
}
|
|
38895
|
+
},
|
|
38896
|
+
isActive: (editor, button)=>Boolean((0,jodit_core_helpers_utils_image_caption__WEBPACK_IMPORTED_MODULE_4__.getCaptionWrapper)(editor, button.target)),
|
|
38897
|
+
tooltip: 'Caption'
|
|
38898
|
+
},
|
|
37353
38899
|
{
|
|
37354
38900
|
name: 'valign',
|
|
37355
38901
|
list: [
|
|
@@ -37359,13 +38905,14 @@ const align = {
|
|
|
37359
38905
|
'Normal'
|
|
37360
38906
|
],
|
|
37361
38907
|
tooltip: 'Vertical align',
|
|
37362
|
-
// `vertical-align` only moves an image in the line, not a floated or block
|
|
38908
|
+
// `vertical-align` only moves an image in the line, not a floated or block
|
|
38909
|
+
// one, nor a captioned one, which is placed by its caption's element
|
|
37363
38910
|
isDisabled: (editor, button)=>{
|
|
37364
38911
|
const image = button.target;
|
|
37365
38912
|
return Boolean(image && ([
|
|
37366
38913
|
'left',
|
|
37367
38914
|
'right'
|
|
37368
|
-
].includes((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.css)(image, 'float')) || (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.css)(image, 'display') === 'block'));
|
|
38915
|
+
].includes((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.css)(image, 'float')) || (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.css)(image, 'display') === 'block' || (0,jodit_core_helpers_utils_image_caption__WEBPACK_IMPORTED_MODULE_4__.getCaptionWrapper)(editor, image)));
|
|
37369
38916
|
},
|
|
37370
38917
|
exec: (editor, image, { control })=>{
|
|
37371
38918
|
if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(image, 'img')) {
|
|
@@ -37484,8 +39031,8 @@ const align = {
|
|
|
37484
39031
|
if (target && type && this.canShowPopupForType(type)) {
|
|
37485
39032
|
const isMedia = type === 'jodit-media';
|
|
37486
39033
|
// Beside the media in a wrapper kept in the content, which can fill
|
|
37487
|
-
// the line
|
|
37488
|
-
const bound = mediaWrapper && (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.getWrappedMedia)(this.j, mediaWrapper) || target;
|
|
39034
|
+
// the line, and below a captioned image's caption, so it stays in view
|
|
39035
|
+
const bound = mediaWrapper && (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.getWrappedMedia)(this.j, mediaWrapper) || (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.getCaptionWrapper)(this.j, target) || target;
|
|
37489
39036
|
this.showPopup(()=>this.__bound(bound, isMedia), type, target);
|
|
37490
39037
|
return false;
|
|
37491
39038
|
}
|
|
@@ -40369,6 +41916,11 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.useInputsPlaceholder
|
|
|
40369
41916
|
* Check if root node is empty
|
|
40370
41917
|
* @private
|
|
40371
41918
|
*/ function isEditorEmpty(root) {
|
|
41919
|
+
// A non-breaking space is typed, where other white space can just lay out
|
|
41920
|
+
// the HTML
|
|
41921
|
+
return isBlank(root) && !root.textContent?.includes(jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.NBSP_SPACE);
|
|
41922
|
+
}
|
|
41923
|
+
function isBlank(root) {
|
|
40372
41924
|
if (!root.firstChild) {
|
|
40373
41925
|
return true;
|
|
40374
41926
|
}
|
|
@@ -40897,6 +42449,10 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.tableAllowCellResize
|
|
|
40897
42449
|
|
|
40898
42450
|
|
|
40899
42451
|
const key = 'table_processor_observer-resize';
|
|
42452
|
+
/**
|
|
42453
|
+
* How near the top or bottom of what a row scrolls in the pointer starts
|
|
42454
|
+
* scrolling it, as the editor's iframe passes on no moves outside it
|
|
42455
|
+
*/ const SCROLL_EDGE = 20;
|
|
40900
42456
|
/**
|
|
40901
42457
|
* Process tables in editor
|
|
40902
42458
|
*/ class resizeCells extends jodit_modules__WEBPACK_IMPORTED_MODULE_8__.Plugin {
|
|
@@ -40916,7 +42472,11 @@ const key = 'table_processor_observer-resize';
|
|
|
40916
42472
|
}
|
|
40917
42473
|
hideResizeHandle() {
|
|
40918
42474
|
this.hideTimeout = this.j.async.setTimeout(()=>{
|
|
40919
|
-
|
|
42475
|
+
// A late move from inside the cell can come once the pointer
|
|
42476
|
+
// is on the handle, which covers the border
|
|
42477
|
+
if (!this.resizeHandler.matches(':hover')) {
|
|
42478
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove(this.resizeHandler);
|
|
42479
|
+
}
|
|
40920
42480
|
}, {
|
|
40921
42481
|
timeout: this.j.defaultTimeout,
|
|
40922
42482
|
label: 'hideResizer'
|
|
@@ -40933,6 +42493,30 @@ const key = 'table_processor_observer-resize';
|
|
|
40933
42493
|
this.startX = event.clientX;
|
|
40934
42494
|
this.j.lock(key);
|
|
40935
42495
|
this.resizeHandler.classList.add('jodit-table-resizer_moved');
|
|
42496
|
+
if (this.workRow) {
|
|
42497
|
+
this.startY = event.clientY;
|
|
42498
|
+
this.startHeight = this.workRow.offsetHeight;
|
|
42499
|
+
this.rowStyle = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(this.workRow, 'style');
|
|
42500
|
+
this.scrolled = 0;
|
|
42501
|
+
this.anchored = scrollersOf(this.workRow).map((elm)=>{
|
|
42502
|
+
const style = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(elm, 'style');
|
|
42503
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_7__.css)(elm, 'overflowAnchor', 'none');
|
|
42504
|
+
return [
|
|
42505
|
+
elm,
|
|
42506
|
+
style
|
|
42507
|
+
];
|
|
42508
|
+
});
|
|
42509
|
+
return false;
|
|
42510
|
+
}
|
|
42511
|
+
this.startStyles = [
|
|
42512
|
+
this.workTable,
|
|
42513
|
+
...(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.$$)('td,th', this.workTable)
|
|
42514
|
+
].map((elm)=>[
|
|
42515
|
+
elm,
|
|
42516
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(elm, 'style')
|
|
42517
|
+
]);
|
|
42518
|
+
this.startLeft = parseFloat(this.resizeHandler.style.left);
|
|
42519
|
+
this.startEdge = this.columnEdge();
|
|
40936
42520
|
let box;
|
|
40937
42521
|
this.minX = 0;
|
|
40938
42522
|
this.maxX = 1000000;
|
|
@@ -40965,6 +42549,14 @@ const key = 'table_processor_observer-resize';
|
|
|
40965
42549
|
this.j.e.fire('closeAllPopups');
|
|
40966
42550
|
let x = event.clientX;
|
|
40967
42551
|
const workplacePosition = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.offset)(this.resizeHandler.parentNode || this.j.od.documentElement, this.j, this.j.od, true);
|
|
42552
|
+
if (this.workRow) {
|
|
42553
|
+
const view = scrollViewOf(this.workRow);
|
|
42554
|
+
this.pointerY = Math.min(Math.max(event.clientY, view.top), view.bottom) + (!this.j.o.iframe ? 0 : workplacePosition.top);
|
|
42555
|
+
this.resizeRow(this.workRow);
|
|
42556
|
+
this.scrollAlong(view, event.clientY);
|
|
42557
|
+
this.j.s.sel?.removeAllRanges();
|
|
42558
|
+
return;
|
|
42559
|
+
}
|
|
40968
42560
|
if (x < this.minX) {
|
|
40969
42561
|
x = this.minX;
|
|
40970
42562
|
}
|
|
@@ -40972,7 +42564,14 @@ const key = 'table_processor_observer-resize';
|
|
|
40972
42564
|
x = this.maxX;
|
|
40973
42565
|
}
|
|
40974
42566
|
this.resizeDelta = x - this.startX + (!this.j.o.iframe ? 0 : workplacePosition.left);
|
|
40975
|
-
|
|
42567
|
+
this.restoreStyles();
|
|
42568
|
+
this.resizeColumnsOrTable();
|
|
42569
|
+
const tableBox = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.offset)(this.workTable, this.j, this.j.ed);
|
|
42570
|
+
Object.assign(this.resizeHandler.style, {
|
|
42571
|
+
left: this.startLeft + this.columnEdge() - this.startEdge + 'px',
|
|
42572
|
+
top: tableBox.top - workplacePosition.top + 'px',
|
|
42573
|
+
height: tableBox.height + 'px'
|
|
42574
|
+
});
|
|
40976
42575
|
const sel = this.j.s.sel;
|
|
40977
42576
|
sel && sel.removeAllRanges();
|
|
40978
42577
|
}
|
|
@@ -40989,17 +42588,96 @@ const key = 'table_processor_observer-resize';
|
|
|
40989
42588
|
this.drag = false;
|
|
40990
42589
|
this.j.e.off(this.j.ew, 'mousemove.table touchmove.table', this.onMouseMove);
|
|
40991
42590
|
this.resizeHandler.classList.remove('jodit-table-resizer_moved');
|
|
40992
|
-
if (this.
|
|
40993
|
-
|
|
40994
|
-
|
|
40995
|
-
|
|
42591
|
+
if (this.workRow) {
|
|
42592
|
+
this.j.async.cancelAnimationFrame(this.scrollFrame);
|
|
42593
|
+
this.anchored.forEach(([elm, style])=>(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(elm, 'style', style));
|
|
42594
|
+
this.anchored = [];
|
|
42595
|
+
const height = this.workRow.offsetHeight;
|
|
42596
|
+
if (height !== this.startHeight) {
|
|
42597
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_7__.css)(this.workRow, 'height', height + 'px');
|
|
40996
42598
|
} else {
|
|
40997
|
-
this.
|
|
42599
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(this.workRow, 'style', this.rowStyle);
|
|
42600
|
+
}
|
|
42601
|
+
} else {
|
|
42602
|
+
this.restoreStyles();
|
|
42603
|
+
if (this.startX !== e.clientX) {
|
|
42604
|
+
this.resizeColumnsOrTable();
|
|
40998
42605
|
}
|
|
40999
42606
|
}
|
|
41000
42607
|
this.j.synchronizeValues();
|
|
41001
42608
|
this.j.s.focus();
|
|
41002
42609
|
}
|
|
42610
|
+
resizeColumnsOrTable() {
|
|
42611
|
+
if (this.wholeTable == null) {
|
|
42612
|
+
this.resizeColumns();
|
|
42613
|
+
} else {
|
|
42614
|
+
this.resizeTable();
|
|
42615
|
+
}
|
|
42616
|
+
}
|
|
42617
|
+
restoreStyles() {
|
|
42618
|
+
this.startStyles.forEach(([elm, style])=>(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(elm, 'style', style));
|
|
42619
|
+
}
|
|
42620
|
+
/**
|
|
42621
|
+
* Where the border the handle is on lies: the work cell's left side
|
|
42622
|
+
* for the table's left edge, otherwise its right side
|
|
42623
|
+
*/ columnEdge() {
|
|
42624
|
+
const { left, right } = this.workCell.getBoundingClientRect();
|
|
42625
|
+
return this.wholeTable === true ? left : right;
|
|
42626
|
+
}
|
|
42627
|
+
/**
|
|
42628
|
+
* Sets the row's height from where the pointer is, and how far the drag
|
|
42629
|
+
* has scrolled. The browser keeps the row as tall as its content
|
|
42630
|
+
*/ resizeRow(row) {
|
|
42631
|
+
const height = Math.max(0, Math.round(this.startHeight + this.pointerY - this.startY + this.scrolled));
|
|
42632
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_7__.css)(row, 'height', height + 'px');
|
|
42633
|
+
this.placeRowHandle(row);
|
|
42634
|
+
return row.offsetHeight === height;
|
|
42635
|
+
}
|
|
42636
|
+
/**
|
|
42637
|
+
* While the pointer is near or past the top or bottom of the part of the
|
|
42638
|
+
* row's scroller in view, scrolls it on, and the row's border with it
|
|
42639
|
+
*/ scrollAlong(view, clientY) {
|
|
42640
|
+
this.j.async.cancelAnimationFrame(this.scrollFrame);
|
|
42641
|
+
const past = clientY < view.top + SCROLL_EDGE ? clientY - view.top - SCROLL_EDGE : clientY > view.bottom - SCROLL_EDGE ? clientY - view.bottom + SCROLL_EDGE : 0;
|
|
42642
|
+
if (!past) {
|
|
42643
|
+
return;
|
|
42644
|
+
}
|
|
42645
|
+
const { scroller } = view;
|
|
42646
|
+
const step = Math.sign(past) * Math.min(Math.ceil(Math.abs(past) / 2), 20);
|
|
42647
|
+
const scroll = ()=>{
|
|
42648
|
+
const { workRow } = this;
|
|
42649
|
+
if (!workRow) {
|
|
42650
|
+
return;
|
|
42651
|
+
}
|
|
42652
|
+
const scrollTop = scroller.scrollTop;
|
|
42653
|
+
if (step > 0) {
|
|
42654
|
+
// Growing the row first makes the room to scroll down into
|
|
42655
|
+
this.scrolled += step;
|
|
42656
|
+
this.resizeRow(workRow);
|
|
42657
|
+
scroller.scrollTop = scrollTop + step;
|
|
42658
|
+
const missed = step - (scroller.scrollTop - scrollTop);
|
|
42659
|
+
if (missed > 0.5) {
|
|
42660
|
+
this.scrolled -= missed;
|
|
42661
|
+
this.resizeRow(workRow);
|
|
42662
|
+
return;
|
|
42663
|
+
}
|
|
42664
|
+
this.placeRowHandle(workRow);
|
|
42665
|
+
} else {
|
|
42666
|
+
scroller.scrollTop = scrollTop + step;
|
|
42667
|
+
const moved = scroller.scrollTop - scrollTop;
|
|
42668
|
+
this.scrolled += moved;
|
|
42669
|
+
// A row at its content's height can't follow the pointer up
|
|
42670
|
+
if (!moved || !this.resizeRow(workRow)) {
|
|
42671
|
+
scroller.scrollTop = scrollTop;
|
|
42672
|
+
this.scrolled -= moved;
|
|
42673
|
+
this.resizeRow(workRow);
|
|
42674
|
+
return;
|
|
42675
|
+
}
|
|
42676
|
+
}
|
|
42677
|
+
this.scrollFrame = this.j.async.requestAnimationFrame(scroll);
|
|
42678
|
+
};
|
|
42679
|
+
this.scrollFrame = this.j.async.requestAnimationFrame(scroll);
|
|
42680
|
+
}
|
|
41003
42681
|
/**
|
|
41004
42682
|
* Resize only one column
|
|
41005
42683
|
*/ resizeColumns() {
|
|
@@ -41042,15 +42720,20 @@ const key = 'table_processor_observer-resize';
|
|
|
41042
42720
|
}
|
|
41043
42721
|
/**
|
|
41044
42722
|
* Calc helper resize handle position
|
|
41045
|
-
*/ calcHandlePosition(table, cell, offsetX = 0, delta = 0) {
|
|
42723
|
+
*/ calcHandlePosition(table, cell, offsetX = 0, delta = 0, clientY = NaN) {
|
|
41046
42724
|
const box = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.offset)(cell, this.j, this.j.ed);
|
|
41047
42725
|
if (offsetX > jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.NEARBY && offsetX < box.width - jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.NEARBY) {
|
|
41048
|
-
this.
|
|
42726
|
+
if (!this.calcRowHandlePosition(cell, clientY)) {
|
|
42727
|
+
this.hideResizeHandle();
|
|
42728
|
+
}
|
|
41049
42729
|
return;
|
|
41050
42730
|
}
|
|
42731
|
+
this.workRow = null;
|
|
42732
|
+
this.resizeHandler.classList.remove('jodit-table-resizer_row');
|
|
41051
42733
|
const workplacePosition = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.offset)(this.j.workplace, this.j, this.j.od, true), parentBox = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.offset)(table, this.j, this.j.ed);
|
|
41052
42734
|
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_7__.css)(this.resizeHandler, 'left', (offsetX <= jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.NEARBY ? box.left : box.left + box.width) - workplacePosition.left + delta + 'px');
|
|
41053
42735
|
Object.assign(this.resizeHandler.style, {
|
|
42736
|
+
width: '',
|
|
41054
42737
|
height: parentBox.height + 'px',
|
|
41055
42738
|
top: parentBox.top - workplacePosition.top + 'px'
|
|
41056
42739
|
});
|
|
@@ -41063,6 +42746,36 @@ const key = 'table_processor_observer-resize';
|
|
|
41063
42746
|
this.setWorkCell(cell, !nextTD ? false : null);
|
|
41064
42747
|
}
|
|
41065
42748
|
}
|
|
42749
|
+
/**
|
|
42750
|
+
* Shows the handle across the table on the border below a row, near the
|
|
42751
|
+
* cell's bottom or near its top, which is the bottom of the row above.
|
|
42752
|
+
* The table's top edge has no row above it
|
|
42753
|
+
*/ calcRowHandlePosition(cell, clientY) {
|
|
42754
|
+
const { top, bottom } = cell.getBoundingClientRect();
|
|
42755
|
+
const table = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.up(cell, (elm)=>jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(elm, 'table'), this.j.editor);
|
|
42756
|
+
const index = cell.parentNode.rowIndex;
|
|
42757
|
+
const row = Math.abs(bottom - clientY) <= jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.NEARBY ? table.rows[index + cell.rowSpan - 1] : Math.abs(clientY - top) <= jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.NEARBY ? table.rows[index - 1] : null;
|
|
42758
|
+
if (!row) {
|
|
42759
|
+
return false;
|
|
42760
|
+
}
|
|
42761
|
+
this.workRow = row;
|
|
42762
|
+
this.workTable = table;
|
|
42763
|
+
this.resizeHandler.classList.add('jodit-table-resizer_row');
|
|
42764
|
+
this.placeRowHandle(row);
|
|
42765
|
+
this.showResizeHandle();
|
|
42766
|
+
return true;
|
|
42767
|
+
}
|
|
42768
|
+
/**
|
|
42769
|
+
* Lays the handle across the table on the border below the row
|
|
42770
|
+
*/ placeRowHandle(row) {
|
|
42771
|
+
const workplacePosition = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.offset)(this.j.workplace, this.j, this.j.od, true), tableBox = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.offset)(this.workTable, this.j, this.j.ed), rowBox = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.offset)(row, this.j, this.j.ed);
|
|
42772
|
+
Object.assign(this.resizeHandler.style, {
|
|
42773
|
+
left: tableBox.left - workplacePosition.left + 'px',
|
|
42774
|
+
width: tableBox.width + 'px',
|
|
42775
|
+
height: '',
|
|
42776
|
+
top: rowBox.top + rowBox.height - workplacePosition.top + 'px'
|
|
42777
|
+
});
|
|
42778
|
+
}
|
|
41066
42779
|
/** @override */ afterInit(editor) {
|
|
41067
42780
|
if (!editor.o.tableAllowCellResize) {
|
|
41068
42781
|
return;
|
|
@@ -41070,7 +42783,7 @@ const key = 'table_processor_observer-resize';
|
|
|
41070
42783
|
editor.e.off(this.j.ow, '.resize-cells').off('.resize-cells').on('change.resize-cells afterCommand.resize-cells afterSetMode.resize-cells', ()=>{
|
|
41071
42784
|
;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.$$)('table', editor.editor).forEach(this.observe);
|
|
41072
42785
|
}).on(this.j.ow, 'scroll.resize-cells', ()=>{
|
|
41073
|
-
if (!this.drag) {
|
|
42786
|
+
if (!this.drag || this.workRow) {
|
|
41074
42787
|
return;
|
|
41075
42788
|
}
|
|
41076
42789
|
const parent = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.up(this.workCell, (elm)=>jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(elm, 'table'), editor.editor);
|
|
@@ -41094,7 +42807,7 @@ const key = 'table_processor_observer-resize';
|
|
|
41094
42807
|
}
|
|
41095
42808
|
;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.dataBind)(table, key, true);
|
|
41096
42809
|
this.j.e.on(table, 'mouseleave.resize-cells', (e)=>{
|
|
41097
|
-
if (this.resizeHandler && this.resizeHandler !== e.relatedTarget) {
|
|
42810
|
+
if (!this.drag && this.resizeHandler && this.resizeHandler !== e.relatedTarget) {
|
|
41098
42811
|
this.hideResizeHandle();
|
|
41099
42812
|
}
|
|
41100
42813
|
}).on(table, 'mousemove.resize-cells touchmove.resize-cells', this.j.async.throttle((event)=>{
|
|
@@ -41105,7 +42818,7 @@ const key = 'table_processor_observer-resize';
|
|
|
41105
42818
|
if (!cell) {
|
|
41106
42819
|
return;
|
|
41107
42820
|
}
|
|
41108
|
-
this.calcHandlePosition(table, cell, event.offsetX);
|
|
42821
|
+
this.calcHandlePosition(table, cell, event.offsetX, 0, event.clientY);
|
|
41109
42822
|
}, {
|
|
41110
42823
|
timeout: this.j.defaultTimeout
|
|
41111
42824
|
}));
|
|
@@ -41123,9 +42836,21 @@ const key = 'table_processor_observer-resize';
|
|
|
41123
42836
|
this.resizeHandler = this.j.c.div('jodit-table-resizer');
|
|
41124
42837
|
this.j.e.on(this.resizeHandler, 'mousedown.table touchstart.table', this.onHandleMouseDown).on(this.resizeHandler, 'mouseenter.table', ()=>{
|
|
41125
42838
|
this.j.async.clearTimeout(this.hideTimeout);
|
|
42839
|
+
}).on(this.resizeHandler, 'mouseleave.table', ()=>{
|
|
42840
|
+
if (!this.drag) {
|
|
42841
|
+
this.hideResizeHandle();
|
|
42842
|
+
}
|
|
41126
42843
|
});
|
|
41127
42844
|
}
|
|
41128
|
-
}), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "hideTimeout", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "drag", false), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "wholeTable", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "workCell", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "workTable", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "minX", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "maxX", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "startX", 0)
|
|
42845
|
+
}), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "hideTimeout", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "drag", false), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "wholeTable", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "workCell", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "workTable", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "minX", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "maxX", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "startX", 0), /**
|
|
42846
|
+
* The table's and its cells' styles as a column drag started, put back
|
|
42847
|
+
* before each new width
|
|
42848
|
+
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "startStyles", []), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "startLeft", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "startEdge", 0), /**
|
|
42849
|
+
* The row whose height the handle sets, or null while it sets a width
|
|
42850
|
+
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "workRow", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "startY", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "startHeight", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "rowStyle", null), /**
|
|
42851
|
+
* The boxes that scroll the row, with their styles, as a row drag turns
|
|
42852
|
+
* off their scroll anchoring, which would move the border off the pointer
|
|
42853
|
+
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "anchored", []), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "scrolled", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "scrollFrame", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "pointerY", 0);
|
|
41129
42854
|
}
|
|
41130
42855
|
}
|
|
41131
42856
|
;(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
@@ -41140,6 +42865,44 @@ const key = 'table_processor_observer-resize';
|
|
|
41140
42865
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
41141
42866
|
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.autobind
|
|
41142
42867
|
], resizeCells.prototype, "observe", null);
|
|
42868
|
+
/**
|
|
42869
|
+
* The boxes around the row that can scroll it, nearest first, and its
|
|
42870
|
+
* document's
|
|
42871
|
+
*/ function scrollersOf(row) {
|
|
42872
|
+
const doc = row.ownerDocument;
|
|
42873
|
+
const root = doc.scrollingElement || doc.documentElement;
|
|
42874
|
+
const scrollers = [];
|
|
42875
|
+
for(let elm = row.parentElement; elm && elm !== root; elm = elm.parentElement){
|
|
42876
|
+
if (/auto|scroll|overlay/.test(String((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_7__.css)(elm, 'overflowY')))) {
|
|
42877
|
+
scrollers.push(elm);
|
|
42878
|
+
}
|
|
42879
|
+
}
|
|
42880
|
+
return [
|
|
42881
|
+
...scrollers,
|
|
42882
|
+
root
|
|
42883
|
+
];
|
|
42884
|
+
}
|
|
42885
|
+
/**
|
|
42886
|
+
* What scrolls the row up and down, the nearest box around it with more
|
|
42887
|
+
* than it shows or else its document, and the part of it in the window's view
|
|
42888
|
+
*/ function scrollViewOf(row) {
|
|
42889
|
+
const height = row.ownerDocument.defaultView?.innerHeight ?? 0;
|
|
42890
|
+
const scrollers = scrollersOf(row);
|
|
42891
|
+
const scroller = scrollers.find((elm)=>elm.scrollHeight > elm.clientHeight) ?? scrollers[scrollers.length - 1];
|
|
42892
|
+
if (scroller === scrollers[scrollers.length - 1]) {
|
|
42893
|
+
return {
|
|
42894
|
+
scroller,
|
|
42895
|
+
top: 0,
|
|
42896
|
+
bottom: height
|
|
42897
|
+
};
|
|
42898
|
+
}
|
|
42899
|
+
const top = scroller.getBoundingClientRect().top + scroller.clientTop;
|
|
42900
|
+
return {
|
|
42901
|
+
scroller,
|
|
42902
|
+
top: Math.max(top, 0),
|
|
42903
|
+
bottom: Math.min(top + scroller.clientHeight, height)
|
|
42904
|
+
};
|
|
42905
|
+
}
|
|
41143
42906
|
jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.pluginSystem.add('resizeCells', resizeCells);
|
|
41144
42907
|
|
|
41145
42908
|
|
|
@@ -41621,6 +43384,14 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
|
|
|
41621
43384
|
return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.offset)(this.rect.parentNode || this.j.od.documentElement, this.j, this.j.od, true);
|
|
41622
43385
|
}
|
|
41623
43386
|
applySize(element, key, value) {
|
|
43387
|
+
// A captioned image fills the element holding it and its caption,
|
|
43388
|
+
// which takes the width
|
|
43389
|
+
const wrapper = key === 'width' && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(element, 'img') ? (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.getCaptionWrapper)(this.j, element) : null;
|
|
43390
|
+
if (wrapper) {
|
|
43391
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(wrapper, 'width', value);
|
|
43392
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(element, 'width', '100%');
|
|
43393
|
+
return;
|
|
43394
|
+
}
|
|
41624
43395
|
const changeAttrs = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isImage(element) && this.j.o.resizer.forImageChangeAttributes;
|
|
41625
43396
|
if (changeAttrs) {
|
|
41626
43397
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(element, key, value);
|
|
@@ -41643,7 +43414,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
|
|
|
41643
43414
|
return;
|
|
41644
43415
|
}
|
|
41645
43416
|
if (this.element.tagName !== 'JODIT') {
|
|
41646
|
-
this.j.s.select(this.element);
|
|
43417
|
+
this.j.s.select((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.getCaptionWrapper)(this.j, this.element) ?? this.element);
|
|
41647
43418
|
} else {
|
|
41648
43419
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove(this.element);
|
|
41649
43420
|
this.hide();
|
|
@@ -42851,8 +44622,9 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
|
|
|
42851
44622
|
'touchstartTd',
|
|
42852
44623
|
'touchstartTh'
|
|
42853
44624
|
].map((e)=>e + '.select-cells').join(' '), this.onStartSelection)// For `clickEditor` correct working. Because `mousedown` on first cell
|
|
42854
|
-
// and mouseup on another cell call `click` only for
|
|
42855
|
-
|
|
44625
|
+
// and mouseup on another cell call `click` only for their common
|
|
44626
|
+
// ancestor: the row, the section, or the table across sections
|
|
44627
|
+
.on('clickTr clickTbody clickThead clickTfoot clickTable', ()=>{
|
|
42856
44628
|
const cellsCount = this.__tableModule.getAllSelectedCells().length;
|
|
42857
44629
|
if (cellsCount) {
|
|
42858
44630
|
if (cellsCount > 1) {
|
|
@@ -43013,14 +44785,6 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
|
|
|
43013
44785
|
}
|
|
43014
44786
|
this.j.e.fire('hidePopup');
|
|
43015
44787
|
e.stopPropagation();
|
|
43016
|
-
// Hack for FireFox for force redraw selection
|
|
43017
|
-
(()=>{
|
|
43018
|
-
const n = this.j.createInside.fromHTML('<div style="color:rgba(0,0,0,0.01);width:0;height:0"> </div>');
|
|
43019
|
-
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.append(cell, n);
|
|
43020
|
-
this.j.async.setTimeout(()=>{
|
|
43021
|
-
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove(n);
|
|
43022
|
-
}, this.j.defaultTimeout / 5);
|
|
43023
|
-
})();
|
|
43024
44788
|
}
|
|
43025
44789
|
/**
|
|
43026
44790
|
* On click in outside - remove selection
|
|
@@ -43117,7 +44881,7 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
|
|
|
43117
44881
|
this.j.synchronizeValues();
|
|
43118
44882
|
return false;
|
|
43119
44883
|
}
|
|
43120
|
-
if (/table(splitv|splitg|merge|empty|bin|binrow|bincolumn|addcolumn|addrow)/.test(command)) {
|
|
44884
|
+
if (/table(splitv|splitg|merge|empty|bin|binrow|bincolumn|addcolumn|addrow|headerrow)/.test(command)) {
|
|
43121
44885
|
command = command.replace('table', '');
|
|
43122
44886
|
const cells = this.__tableModule.getAllSelectedCells();
|
|
43123
44887
|
if (cells.length) {
|
|
@@ -43184,6 +44948,9 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
|
|
|
43184
44948
|
case 'addrowbefore':
|
|
43185
44949
|
this.__tableModule.appendRow(table, cell.parentNode, command === 'addrowafter');
|
|
43186
44950
|
break;
|
|
44951
|
+
case 'headerrow':
|
|
44952
|
+
this.__toggleHeaderRow(table, cells);
|
|
44953
|
+
break;
|
|
43187
44954
|
}
|
|
43188
44955
|
if (/^bin(row|column)$/.test(command) && !this.__tableModule.getColumnsCount(table)) {
|
|
43189
44956
|
this.__removeTable(table);
|
|
@@ -43192,6 +44959,26 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
|
|
|
43192
44959
|
return false;
|
|
43193
44960
|
}
|
|
43194
44961
|
}
|
|
44962
|
+
/**
|
|
44963
|
+
* Turns the table's header row on or off. The caret and the marked cells
|
|
44964
|
+
* move to the cells that replace them
|
|
44965
|
+
*/ __toggleHeaderRow(table, cells) {
|
|
44966
|
+
const module = this.__tableModule;
|
|
44967
|
+
this.j.s.save();
|
|
44968
|
+
const replaced = module.toggleHeaderRow(table);
|
|
44969
|
+
this.j.s.restore();
|
|
44970
|
+
cells.forEach((cell)=>{
|
|
44971
|
+
const next = replaced.get(cell);
|
|
44972
|
+
if (next) {
|
|
44973
|
+
module.removeSelection(cell);
|
|
44974
|
+
module.addSelection(next);
|
|
44975
|
+
}
|
|
44976
|
+
});
|
|
44977
|
+
// As after the click that marked it, the command's own change keeps
|
|
44978
|
+
// the marks, so the popup can stay open for another toggle
|
|
44979
|
+
const anchor = this.__selectedCell ?? cells[0];
|
|
44980
|
+
this.__selectedCell = replaced.get(anchor) ?? anchor;
|
|
44981
|
+
}
|
|
43195
44982
|
/**
|
|
43196
44983
|
* The cell that takes the caret when rows or columns are deleted: the next
|
|
43197
44984
|
* one in the same column (or row) that is not deleted, else the previous one
|
|
@@ -45524,9 +47311,13 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_3__.pluginSystem.add('symbols', symbo
|
|
|
45524
47311
|
|
|
45525
47312
|
"use strict";
|
|
45526
47313
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
45527
|
-
/* harmony export */ onTabInsideLi: function() { return /* reexport safe */ _on_tab_inside_li__WEBPACK_IMPORTED_MODULE_0__.onTabInsideLi; }
|
|
47314
|
+
/* harmony export */ onTabInsideLi: function() { return /* reexport safe */ _on_tab_inside_li__WEBPACK_IMPORTED_MODULE_0__.onTabInsideLi; },
|
|
47315
|
+
/* harmony export */ onTabSpaces: function() { return /* reexport safe */ _tab_spaces__WEBPACK_IMPORTED_MODULE_1__.onTabSpaces; },
|
|
47316
|
+
/* harmony export */ removeTabSpaces: function() { return /* reexport safe */ _tab_spaces__WEBPACK_IMPORTED_MODULE_1__.removeTabSpaces; },
|
|
47317
|
+
/* harmony export */ tabsToSpaces: function() { return /* reexport safe */ _tab_spaces__WEBPACK_IMPORTED_MODULE_1__.tabsToSpaces; }
|
|
45528
47318
|
/* harmony export */ });
|
|
45529
47319
|
/* harmony import */ var _on_tab_inside_li__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8837);
|
|
47320
|
+
/* harmony import */ var _tab_spaces__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(34614);
|
|
45530
47321
|
/*!
|
|
45531
47322
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
45532
47323
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -45536,6 +47327,7 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_3__.pluginSystem.add('symbols', symbo
|
|
|
45536
47327
|
*/
|
|
45537
47328
|
|
|
45538
47329
|
|
|
47330
|
+
|
|
45539
47331
|
/***/ }),
|
|
45540
47332
|
|
|
45541
47333
|
/***/ 8837:
|
|
@@ -45561,7 +47353,9 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_3__.pluginSystem.add('symbols', symbo
|
|
|
45561
47353
|
* If so then add an internal list
|
|
45562
47354
|
* @private
|
|
45563
47355
|
*/ function onTabInsideLi(jodit, shift = false) {
|
|
45564
|
-
|
|
47356
|
+
// Focused with no range, as WebKit can leave it, there's no caret to
|
|
47357
|
+
// mark
|
|
47358
|
+
if (!jodit.o.tab.tabInsideLiInsertNewList || !jodit.s.isInsideArea) {
|
|
45565
47359
|
return false;
|
|
45566
47360
|
}
|
|
45567
47361
|
const [fake, fake2] = fakeCursors(jodit);
|
|
@@ -45658,6 +47452,281 @@ function removeNestedList(jodit, list, li) {
|
|
|
45658
47452
|
}
|
|
45659
47453
|
|
|
45660
47454
|
|
|
47455
|
+
/***/ }),
|
|
47456
|
+
|
|
47457
|
+
/***/ 34614:
|
|
47458
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
47459
|
+
|
|
47460
|
+
"use strict";
|
|
47461
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
47462
|
+
/* harmony export */ onTabSpaces: function() { return /* binding */ onTabSpaces; },
|
|
47463
|
+
/* harmony export */ removeTabSpaces: function() { return /* binding */ removeTabSpaces; },
|
|
47464
|
+
/* harmony export */ tabsToSpaces: function() { return /* binding */ tabsToSpaces; }
|
|
47465
|
+
/* harmony export */ });
|
|
47466
|
+
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
|
|
47467
|
+
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
|
|
47468
|
+
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(80991);
|
|
47469
|
+
/* harmony import */ var jodit_plugins_backspace_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(15200);
|
|
47470
|
+
/* harmony import */ var jodit_plugins_indent_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(11917);
|
|
47471
|
+
/*!
|
|
47472
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
47473
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
47474
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
47475
|
+
*/ /**
|
|
47476
|
+
* @module plugins/tab
|
|
47477
|
+
*/
|
|
47478
|
+
|
|
47479
|
+
|
|
47480
|
+
|
|
47481
|
+
|
|
47482
|
+
const KEEPS_TABS = new Set([
|
|
47483
|
+
'pre',
|
|
47484
|
+
'pre-wrap',
|
|
47485
|
+
'break-spaces'
|
|
47486
|
+
]);
|
|
47487
|
+
const KEEPS_TABS_TAGS = new Set([
|
|
47488
|
+
'pre',
|
|
47489
|
+
'textarea',
|
|
47490
|
+
'style',
|
|
47491
|
+
'script'
|
|
47492
|
+
]);
|
|
47493
|
+
/**
|
|
47494
|
+
* With `tab.spaces`, outside table cells: Tab at a caret inserts the spaces,
|
|
47495
|
+
* or a tab where white space is kept, as in `pre`, and in a list's first item
|
|
47496
|
+
* it indents the list, as Word does. Shift+Tab takes them out again. Tab or
|
|
47497
|
+
* Shift+Tab with a selection indents or outdents it. Neither moves the focus
|
|
47498
|
+
* on: Escape and then Tab does that
|
|
47499
|
+
* @private
|
|
47500
|
+
*/ function onTabSpaces(jodit, shift) {
|
|
47501
|
+
const { spaces } = jodit.o.tab;
|
|
47502
|
+
const current = jodit.s.current();
|
|
47503
|
+
if (!spaces || jodit.o.readonly || jodit.isLocked) {
|
|
47504
|
+
return false;
|
|
47505
|
+
}
|
|
47506
|
+
// The editor has the focus but no caret, so there's nowhere to put
|
|
47507
|
+
// anything, but the focus stays
|
|
47508
|
+
if (!current) {
|
|
47509
|
+
return true;
|
|
47510
|
+
}
|
|
47511
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(current, jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isCell, jodit.editor)) {
|
|
47512
|
+
return false;
|
|
47513
|
+
}
|
|
47514
|
+
if (!jodit.s.isCollapsed()) {
|
|
47515
|
+
jodit.execCommand(shift ? 'outdent' : 'indent');
|
|
47516
|
+
return true;
|
|
47517
|
+
}
|
|
47518
|
+
const li = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(current, 'li', jodit.editor);
|
|
47519
|
+
const list = li && !li.previousElementSibling && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isList(li.parentElement) ? li.parentElement : null;
|
|
47520
|
+
if (list && (!shift || isIndented(jodit, list))) {
|
|
47521
|
+
(0,jodit_plugins_indent_helpers__WEBPACK_IMPORTED_MODULE_4__.applyIndentToBox)(new Set(), list, jodit, shift ? 'outdent' : 'indent');
|
|
47522
|
+
jodit.synchronizeValues();
|
|
47523
|
+
return true;
|
|
47524
|
+
}
|
|
47525
|
+
if (shift) {
|
|
47526
|
+
unindent(jodit, current, spaces);
|
|
47527
|
+
return true;
|
|
47528
|
+
}
|
|
47529
|
+
const element = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(current) ? current : current.parentElement;
|
|
47530
|
+
const keepsTabs = element && KEEPS_TABS.has(jodit.ew.getComputedStyle(element).whiteSpace);
|
|
47531
|
+
jodit.s.insertNode(jodit.createInside.text(keepsTabs ? '\t' : jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.NBSP_SPACE.repeat(spaces)));
|
|
47532
|
+
return true;
|
|
47533
|
+
}
|
|
47534
|
+
/**
|
|
47535
|
+
* Shift+Tab at a caret takes out a tab or up to `spaces` spaces just before
|
|
47536
|
+
* it, then a tab or up to `spaces` spaces at the start of its line, then the
|
|
47537
|
+
* indent of its block
|
|
47538
|
+
*/ function unindent(jodit, current, spaces) {
|
|
47539
|
+
const block = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(current, jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock, jodit.editor);
|
|
47540
|
+
const caret = jodit.createInside.fake();
|
|
47541
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeInsertNode(jodit.s.range, caret);
|
|
47542
|
+
let removed;
|
|
47543
|
+
try {
|
|
47544
|
+
removed = removeTabBefore(caret) || removeTabSpaces(jodit, caret, true) || removeLineIndent(jodit, block ?? jodit.editor, caret, spaces);
|
|
47545
|
+
if (removed) {
|
|
47546
|
+
(0,jodit_plugins_backspace_helpers__WEBPACK_IMPORTED_MODULE_3__.addBRInsideEmptyBlock)(jodit, caret);
|
|
47547
|
+
}
|
|
47548
|
+
} finally{
|
|
47549
|
+
jodit.s.setCursorBefore(caret);
|
|
47550
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(caret);
|
|
47551
|
+
}
|
|
47552
|
+
if (removed) {
|
|
47553
|
+
jodit.synchronizeValues();
|
|
47554
|
+
} else if (block && isIndented(jodit, block)) {
|
|
47555
|
+
jodit.execCommand('outdent');
|
|
47556
|
+
}
|
|
47557
|
+
}
|
|
47558
|
+
function removeTabBefore(caret) {
|
|
47559
|
+
const before = caret.previousSibling;
|
|
47560
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isText(before) && before.data.endsWith('\t')) {
|
|
47561
|
+
before.deleteData(before.length - 1, 1);
|
|
47562
|
+
return true;
|
|
47563
|
+
}
|
|
47564
|
+
return false;
|
|
47565
|
+
}
|
|
47566
|
+
function removeLineIndent(jodit, block, caret, spaces) {
|
|
47567
|
+
const { whiteSpace } = jodit.ew.getComputedStyle(block);
|
|
47568
|
+
const walker = jodit.ed.createTreeWalker(block, NodeFilter.SHOW_TEXT | NodeFilter.SHOW_ELEMENT, {
|
|
47569
|
+
acceptNode: (node)=>jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(node) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT
|
|
47570
|
+
});
|
|
47571
|
+
const [start, offset] = lineStart(walker, caret, KEEPS_TABS.has(whiteSpace) || whiteSpace === 'pre-line');
|
|
47572
|
+
return removeIndentAt(walker, start, offset, caret, spaces);
|
|
47573
|
+
}
|
|
47574
|
+
/**
|
|
47575
|
+
* Where the caret's line starts: after a `<br>`, after a newline where white
|
|
47576
|
+
* space keeps it, or at the caret
|
|
47577
|
+
*/ function lineStart(walker, caret, keepsBreaks) {
|
|
47578
|
+
let start = null;
|
|
47579
|
+
let offset = 0;
|
|
47580
|
+
for(let node = walker.nextNode(); node && node !== caret; node = walker.nextNode()){
|
|
47581
|
+
const lineBreak = keepsBreaks && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isText(node) ? node.data.lastIndexOf('\n') : -1;
|
|
47582
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(node, 'br')) {
|
|
47583
|
+
start = null;
|
|
47584
|
+
} else if (lineBreak >= 0) {
|
|
47585
|
+
start = node;
|
|
47586
|
+
offset = lineBreak + 1;
|
|
47587
|
+
} else if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isText(node) && !start) {
|
|
47588
|
+
start = node;
|
|
47589
|
+
offset = 0;
|
|
47590
|
+
}
|
|
47591
|
+
}
|
|
47592
|
+
return start ? [
|
|
47593
|
+
start,
|
|
47594
|
+
offset
|
|
47595
|
+
] : [
|
|
47596
|
+
caret,
|
|
47597
|
+
0
|
|
47598
|
+
];
|
|
47599
|
+
}
|
|
47600
|
+
function removeIndentAt(walker, start, startOffset, caret, spaces) {
|
|
47601
|
+
let removed = 0;
|
|
47602
|
+
let offset = startOffset;
|
|
47603
|
+
walker.currentNode = start;
|
|
47604
|
+
for(let node = start; node && removed < spaces && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(node, 'br'); node = walker.nextNode()){
|
|
47605
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isText(node) && node !== caret) {
|
|
47606
|
+
const [end, count] = scanIndent(node.data, offset, spaces - removed, !removed);
|
|
47607
|
+
node.deleteData(offset, end - offset);
|
|
47608
|
+
removed += count;
|
|
47609
|
+
if (offset < node.length) {
|
|
47610
|
+
break;
|
|
47611
|
+
}
|
|
47612
|
+
}
|
|
47613
|
+
offset = 0;
|
|
47614
|
+
}
|
|
47615
|
+
return removed > 0;
|
|
47616
|
+
}
|
|
47617
|
+
/**
|
|
47618
|
+
* Where up to `count` spaces from `offset` end, and how many there were. A
|
|
47619
|
+
* tab at the start of a line is a whole indent
|
|
47620
|
+
*/ function scanIndent(text, offset, count, atLineStart) {
|
|
47621
|
+
if (atLineStart && text[offset] === '\t') {
|
|
47622
|
+
return [
|
|
47623
|
+
offset + 1,
|
|
47624
|
+
count
|
|
47625
|
+
];
|
|
47626
|
+
}
|
|
47627
|
+
let end = offset;
|
|
47628
|
+
let found = 0;
|
|
47629
|
+
for(; end < text.length && found < count; end += 1){
|
|
47630
|
+
const char = text[end];
|
|
47631
|
+
if (char !== ' ' && char !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.NBSP_SPACE && char !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE) {
|
|
47632
|
+
break;
|
|
47633
|
+
}
|
|
47634
|
+
if (char !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE) {
|
|
47635
|
+
found += 1;
|
|
47636
|
+
}
|
|
47637
|
+
}
|
|
47638
|
+
return [
|
|
47639
|
+
end,
|
|
47640
|
+
found
|
|
47641
|
+
];
|
|
47642
|
+
}
|
|
47643
|
+
function isIndented(jodit, box) {
|
|
47644
|
+
return parseInt((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__.cssInline)(box, (0,jodit_plugins_indent_helpers__WEBPACK_IMPORTED_MODULE_4__.getKey)(jodit.o.direction, box)) || '0', 10) > 0;
|
|
47645
|
+
}
|
|
47646
|
+
/**
|
|
47647
|
+
* With `tab.spaces`, Backspace just after that many spaces removes them
|
|
47648
|
+
* together, as it would a tab. With `upTo`, as for Shift+Tab, fewer will do,
|
|
47649
|
+
* if one of them is non-breaking, so a space between words stays
|
|
47650
|
+
* @private
|
|
47651
|
+
*/ function removeTabSpaces(jodit, caret, upTo = false) {
|
|
47652
|
+
const { spaces } = jodit.o.tab;
|
|
47653
|
+
if (!spaces) {
|
|
47654
|
+
return false;
|
|
47655
|
+
}
|
|
47656
|
+
const range = jodit.s.createRange();
|
|
47657
|
+
range.setEndBefore(caret);
|
|
47658
|
+
let count = 0;
|
|
47659
|
+
let nonBreaking = false;
|
|
47660
|
+
for(let node = caret.previousSibling; jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isText(node) && count < spaces; node = node.previousSibling){
|
|
47661
|
+
let offset = node.length;
|
|
47662
|
+
for(; offset > 0 && count < spaces; offset -= 1){
|
|
47663
|
+
const char = node.data[offset - 1];
|
|
47664
|
+
if (char === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.NBSP_SPACE) {
|
|
47665
|
+
nonBreaking = true;
|
|
47666
|
+
} else if (char !== ' ' && char !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE) {
|
|
47667
|
+
break;
|
|
47668
|
+
}
|
|
47669
|
+
if (char !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE) {
|
|
47670
|
+
count += 1;
|
|
47671
|
+
}
|
|
47672
|
+
}
|
|
47673
|
+
range.setStart(node, offset);
|
|
47674
|
+
if (offset && count < spaces) {
|
|
47675
|
+
break;
|
|
47676
|
+
}
|
|
47677
|
+
}
|
|
47678
|
+
if (upTo ? !nonBreaking : count < spaces) {
|
|
47679
|
+
return false;
|
|
47680
|
+
}
|
|
47681
|
+
range.deleteContents();
|
|
47682
|
+
// An emptied line keeps a <br>, as after any Backspace, or it has no
|
|
47683
|
+
// height to hold the caret
|
|
47684
|
+
(0,jodit_plugins_backspace_helpers__WEBPACK_IMPORTED_MODULE_3__.addBRInsideEmptyBlock)(jodit, caret);
|
|
47685
|
+
return true;
|
|
47686
|
+
}
|
|
47687
|
+
/**
|
|
47688
|
+
* With `tab.spaces`, a tab in pasted text becomes the spaces, as HTML would
|
|
47689
|
+
* show it as one space. Tabs in white space that's kept, and those that only
|
|
47690
|
+
* lay out the HTML, stay as they are
|
|
47691
|
+
* @private
|
|
47692
|
+
*/ function tabsToSpaces(jodit, html) {
|
|
47693
|
+
const { spaces } = jodit.o.tab;
|
|
47694
|
+
const current = jodit.s.current();
|
|
47695
|
+
const target = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(current) ? current : current?.parentElement;
|
|
47696
|
+
if (!spaces || !html.includes('\t') || target && KEEPS_TABS.has(jodit.ew.getComputedStyle(target).whiteSpace)) {
|
|
47697
|
+
return;
|
|
47698
|
+
}
|
|
47699
|
+
// A template parses without loading images or running scripts
|
|
47700
|
+
const template = jodit.ed.createElement('template');
|
|
47701
|
+
template.innerHTML = html;
|
|
47702
|
+
const walker = jodit.ed.createTreeWalker(template.content, NodeFilter.SHOW_TEXT);
|
|
47703
|
+
let changed = false;
|
|
47704
|
+
for(let node = walker.nextNode(); node; node = walker.nextNode()){
|
|
47705
|
+
const text = node.nodeValue ?? '';
|
|
47706
|
+
if (text.includes('\t') && text.trim() && !keepsTabs(node)) {
|
|
47707
|
+
node.nodeValue = text.replace(/\t/g, jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.NBSP_SPACE.repeat(spaces));
|
|
47708
|
+
changed = true;
|
|
47709
|
+
}
|
|
47710
|
+
}
|
|
47711
|
+
return changed ? template.innerHTML : undefined;
|
|
47712
|
+
}
|
|
47713
|
+
/**
|
|
47714
|
+
* The fragment isn't rendered, so this reads the white space its own styles
|
|
47715
|
+
* and tags set. The text of `<style>` and `<script>` isn't shown at all
|
|
47716
|
+
*/ function keepsTabs(node) {
|
|
47717
|
+
for(let el = node.parentElement; el; el = el.parentElement){
|
|
47718
|
+
const { whiteSpace } = el.style;
|
|
47719
|
+
if (whiteSpace) {
|
|
47720
|
+
return KEEPS_TABS.has(whiteSpace);
|
|
47721
|
+
}
|
|
47722
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(el, KEEPS_TABS_TAGS)) {
|
|
47723
|
+
return true;
|
|
47724
|
+
}
|
|
47725
|
+
}
|
|
47726
|
+
return false;
|
|
47727
|
+
}
|
|
47728
|
+
|
|
47729
|
+
|
|
45661
47730
|
/***/ }),
|
|
45662
47731
|
|
|
45663
47732
|
/***/ 69023:
|
|
@@ -45673,7 +47742,8 @@ function removeNestedList(jodit, list, li) {
|
|
|
45673
47742
|
* @module plugins/tab
|
|
45674
47743
|
*/
|
|
45675
47744
|
jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.tab = {
|
|
45676
|
-
tabInsideLiInsertNewList: true
|
|
47745
|
+
tabInsideLiInsertNewList: true,
|
|
47746
|
+
spaces: 0
|
|
45677
47747
|
};
|
|
45678
47748
|
|
|
45679
47749
|
|
|
@@ -45683,13 +47753,15 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.tab = {
|
|
|
45683
47753
|
/***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
|
|
45684
47754
|
|
|
45685
47755
|
"use strict";
|
|
45686
|
-
/* harmony import */ var
|
|
45687
|
-
/* harmony import */ var
|
|
45688
|
-
/* harmony import */ var
|
|
45689
|
-
/* harmony import */ var
|
|
45690
|
-
/* harmony import */ var
|
|
45691
|
-
/* harmony import */ var
|
|
45692
|
-
/* harmony import */ var
|
|
47756
|
+
/* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25045);
|
|
47757
|
+
/* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31635);
|
|
47758
|
+
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(81937);
|
|
47759
|
+
/* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(84839);
|
|
47760
|
+
/* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(28077);
|
|
47761
|
+
/* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(85932);
|
|
47762
|
+
/* harmony import */ var jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(91206);
|
|
47763
|
+
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(69023);
|
|
47764
|
+
/* harmony import */ var _cases__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(2923);
|
|
45693
47765
|
/*!
|
|
45694
47766
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
45695
47767
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -45705,34 +47777,97 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.tab = {
|
|
|
45705
47777
|
|
|
45706
47778
|
|
|
45707
47779
|
|
|
45708
|
-
|
|
45709
|
-
|
|
47780
|
+
|
|
47781
|
+
|
|
47782
|
+
const MODIFIER_KEYS = new Set([
|
|
47783
|
+
'Shift',
|
|
47784
|
+
'Control',
|
|
47785
|
+
'Alt',
|
|
47786
|
+
'Meta',
|
|
47787
|
+
'CapsLock'
|
|
47788
|
+
]);
|
|
47789
|
+
class tab extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__.Plugin {
|
|
47790
|
+
afterInit(jodit) {
|
|
47791
|
+
// Without a namespace it runs ahead of table navigation, which would
|
|
47792
|
+
// take a released Tab
|
|
47793
|
+
jodit.e.on('keydown', this.__onKeyDownFirst, {
|
|
47794
|
+
top: true
|
|
47795
|
+
});
|
|
47796
|
+
}
|
|
47797
|
+
// An Escape that closes a popup has done its job
|
|
47798
|
+
__endRelease() {
|
|
47799
|
+
this.__released = false;
|
|
47800
|
+
}
|
|
47801
|
+
__onKeyDownFirst(event) {
|
|
47802
|
+
const released = this.__released;
|
|
47803
|
+
if (!MODIFIER_KEYS.has(event.key)) {
|
|
47804
|
+
this.__released = event.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.KEY_ESC && this.j.o.tab.spaces > 0;
|
|
47805
|
+
}
|
|
47806
|
+
// The browser moves the focus
|
|
47807
|
+
if (released && event.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.KEY_TAB) {
|
|
47808
|
+
this.j.e.stopPropagation('keydown');
|
|
47809
|
+
}
|
|
47810
|
+
}
|
|
45710
47811
|
__onTab(event) {
|
|
45711
|
-
if (event.key ===
|
|
47812
|
+
if (event.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.KEY_TAB && (this.__onShift(event.shiftKey) || (0,_cases__WEBPACK_IMPORTED_MODULE_8__.onTabSpaces)(this.j, event.shiftKey))) {
|
|
45712
47813
|
return false;
|
|
45713
47814
|
}
|
|
45714
47815
|
}
|
|
47816
|
+
__onBackspace(backspace, fakeNode) {
|
|
47817
|
+
if (backspace && (0,_cases__WEBPACK_IMPORTED_MODULE_8__.removeTabSpaces)(this.j, fakeNode)) {
|
|
47818
|
+
return true;
|
|
47819
|
+
}
|
|
47820
|
+
}
|
|
47821
|
+
__onPasteInsert(html) {
|
|
47822
|
+
if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_5__.isString)(html)) {
|
|
47823
|
+
return (0,_cases__WEBPACK_IMPORTED_MODULE_8__.tabsToSpaces)(this.j, html);
|
|
47824
|
+
}
|
|
47825
|
+
}
|
|
45715
47826
|
__onCommand(command) {
|
|
45716
47827
|
if ((command === 'indent' || command === 'outdent') && this.__onShift(command === 'outdent')) {
|
|
45717
47828
|
return false;
|
|
45718
47829
|
}
|
|
45719
47830
|
}
|
|
45720
47831
|
__onShift(shift) {
|
|
45721
|
-
const res = (0,
|
|
47832
|
+
const res = (0,_cases__WEBPACK_IMPORTED_MODULE_8__.onTabInsideLi)(this.j, shift);
|
|
45722
47833
|
if (res) {
|
|
45723
47834
|
this.j.e.fire('afterTab', shift);
|
|
45724
47835
|
}
|
|
45725
47836
|
return res;
|
|
45726
47837
|
}
|
|
45727
|
-
beforeDestruct(jodit) {
|
|
47838
|
+
beforeDestruct(jodit) {
|
|
47839
|
+
jodit.e.off('keydown', this.__onKeyDownFirst);
|
|
47840
|
+
}
|
|
47841
|
+
constructor(...args){
|
|
47842
|
+
super(...args), /**
|
|
47843
|
+
* With `tab.spaces`, Tab stays in the editor, so an Escape lets the next
|
|
47844
|
+
* Tab move the focus on, as in code editors. A modifier key keeps it, and
|
|
47845
|
+
* any other key or a click ends it
|
|
47846
|
+
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__released", false);
|
|
47847
|
+
}
|
|
45728
47848
|
}
|
|
45729
|
-
;(0,
|
|
45730
|
-
(0,
|
|
47849
|
+
;(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
47850
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.watch)([
|
|
47851
|
+
':mousedown.tab',
|
|
47852
|
+
':beforePopupClose.tab'
|
|
47853
|
+
])
|
|
47854
|
+
], tab.prototype, "__endRelease", null);
|
|
47855
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
47856
|
+
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.autobind
|
|
47857
|
+
], tab.prototype, "__onKeyDownFirst", null);
|
|
47858
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
47859
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.watch)(':keydown.tab')
|
|
45731
47860
|
], tab.prototype, "__onTab", null);
|
|
45732
|
-
(0,
|
|
45733
|
-
(0,
|
|
47861
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
47862
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.watch)(':backSpaceBeforeCases.tab')
|
|
47863
|
+
], tab.prototype, "__onBackspace", null);
|
|
47864
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
47865
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.watch)(':beforePasteInsert.tab')
|
|
47866
|
+
], tab.prototype, "__onPasteInsert", null);
|
|
47867
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
47868
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.watch)(':beforeCommand.tab')
|
|
45734
47869
|
], tab.prototype, "__onCommand", null);
|
|
45735
|
-
|
|
47870
|
+
jodit_core_global__WEBPACK_IMPORTED_MODULE_4__.pluginSystem.add('tab', tab);
|
|
45736
47871
|
|
|
45737
47872
|
|
|
45738
47873
|
/***/ }),
|
|
@@ -47648,7 +49783,7 @@ module.exports["default"] = {"Type something":"Start writing...","pencil":"Edit"
|
|
|
47648
49783
|
/***/ 53414:
|
|
47649
49784
|
/***/ (function(module) {
|
|
47650
49785
|
|
|
47651
|
-
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","Close","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"]
|
|
49786
|
+
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","Caption","Center","Change mode","Chars: %d","Choose Content to Paste","Circle","Class name","Classes","Clean","Clear Formatting","Close","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","Header row","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"]
|
|
47652
49787
|
|
|
47653
49788
|
/***/ }),
|
|
47654
49789
|
|
|
@@ -47869,6 +50004,20 @@ module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=
|
|
|
47869
50004
|
|
|
47870
50005
|
/***/ }),
|
|
47871
50006
|
|
|
50007
|
+
/***/ 92148:
|
|
50008
|
+
/***/ (function(module) {
|
|
50009
|
+
|
|
50010
|
+
module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"> <g fill=\"none\"> <rect x=\"3\" y=\"3\" width=\"18\" height=\"13\" rx=\"2\"/><path d=\"m3 13 5-4 4 3 3-3 6 5\"/><path d=\"M7 21h10\"/> </g> </svg>"
|
|
50011
|
+
|
|
50012
|
+
/***/ }),
|
|
50013
|
+
|
|
50014
|
+
/***/ 20115:
|
|
50015
|
+
/***/ (function(module) {
|
|
50016
|
+
|
|
50017
|
+
module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"> <g fill=\"none\"> <rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"2.5\"/><path d=\"M3 9V5.5A2.5 2.5 0 0 1 5.5 3h13A2.5 2.5 0 0 1 21 5.5V9z\" fill=\"currentColor\"/><path d=\"M3 15h18M9 9v12M15 9v12\"/> </g> </svg>"
|
|
50018
|
+
|
|
50019
|
+
/***/ }),
|
|
50020
|
+
|
|
47872
50021
|
/***/ 94190:
|
|
47873
50022
|
/***/ (function(module) {
|
|
47874
50023
|
|