jodit 4.18.12 → 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 +22 -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 +2464 -300
- 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 +2426 -297
- 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 +2400 -271
- 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 +2823 -360
- 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/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/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
|
}
|
|
@@ -16982,6 +17067,35 @@ UISpacer = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_0__.__decorate)(
|
|
|
16982
17067
|
/* harmony export */ ]);
|
|
16983
17068
|
|
|
16984
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
|
+
|
|
16985
17099
|
/***/ }),
|
|
16986
17100
|
|
|
16987
17101
|
/***/ 15982:
|
|
@@ -18233,6 +18347,12 @@ View.defaultOptions = {
|
|
|
18233
18347
|
|
|
18234
18348
|
|
|
18235
18349
|
|
|
18350
|
+
const FOCUS_EVENTS = new Set([
|
|
18351
|
+
'focus',
|
|
18352
|
+
'blur',
|
|
18353
|
+
'focusin',
|
|
18354
|
+
'focusout'
|
|
18355
|
+
]);
|
|
18236
18356
|
const __defaultStyleDisplayKey = 'data-jodit-default-style-display';
|
|
18237
18357
|
const __defaultClassesKey = 'data-jodit-default-classes';
|
|
18238
18358
|
const NOEDIT = {
|
|
@@ -19270,16 +19390,30 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
19270
19390
|
if (place) {
|
|
19271
19391
|
this.setCurrentPlace(place);
|
|
19272
19392
|
}
|
|
19273
|
-
}).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)=>{
|
|
19274
19394
|
if (this.o.readonly || this.__isSilentChange) {
|
|
19275
19395
|
return;
|
|
19276
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
|
+
}
|
|
19277
19411
|
const w = this.ew;
|
|
19278
19412
|
if (event instanceof w.KeyboardEvent && event.isComposing) {
|
|
19279
19413
|
return;
|
|
19280
19414
|
}
|
|
19281
19415
|
if (this.e && this.e.fire) {
|
|
19282
|
-
if (this.e.fire(
|
|
19416
|
+
if (this.e.fire(type, event) === false) {
|
|
19283
19417
|
return false;
|
|
19284
19418
|
}
|
|
19285
19419
|
this.synchronizeValues();
|
|
@@ -24402,6 +24536,11 @@ StatusBar = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)
|
|
|
24402
24536
|
|
|
24403
24537
|
|
|
24404
24538
|
|
|
24539
|
+
const SECTIONS = new Set([
|
|
24540
|
+
'thead',
|
|
24541
|
+
'tbody',
|
|
24542
|
+
'tfoot'
|
|
24543
|
+
]);
|
|
24405
24544
|
const markedValue = new WeakMap();
|
|
24406
24545
|
class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_1__.ViewComponent {
|
|
24407
24546
|
/** @override */ className() {
|
|
@@ -24560,7 +24699,13 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_1__.ViewCompon
|
|
|
24560
24699
|
}
|
|
24561
24700
|
});
|
|
24562
24701
|
}
|
|
24563
|
-
|
|
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) {
|
|
24564
24709
|
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.after(line, row);
|
|
24565
24710
|
} else if (!after && line) {
|
|
24566
24711
|
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.before(line, row);
|
|
@@ -24568,6 +24713,78 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_1__.ViewCompon
|
|
|
24568
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);
|
|
24569
24714
|
}
|
|
24570
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
|
+
}
|
|
24571
24788
|
/**
|
|
24572
24789
|
* Inserts a new line after row what contains the selected cell
|
|
24573
24790
|
*
|
|
@@ -24624,7 +24841,13 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_1__.ViewCompon
|
|
|
24624
24841
|
(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(cell, 'rowspan', rowSpan - 1 > 1 ? rowSpan - 1 : null);
|
|
24625
24842
|
}
|
|
24626
24843
|
});
|
|
24844
|
+
const section = row.parentElement;
|
|
24627
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
|
+
}
|
|
24628
24851
|
}
|
|
24629
24852
|
/**
|
|
24630
24853
|
* Remove row
|
|
@@ -25045,7 +25268,10 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_1__.ViewCompon
|
|
|
25045
25268
|
const selector = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.cssPath)(td);
|
|
25046
25269
|
selector && selectors.push(selector);
|
|
25047
25270
|
});
|
|
25048
|
-
|
|
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 : '';
|
|
25049
25275
|
}));
|
|
25050
25276
|
}
|
|
25051
25277
|
}
|
|
@@ -25083,10 +25309,11 @@ const instance = (j)=>j.getInstance('Table', j.o);
|
|
|
25083
25309
|
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(7909);
|
|
25084
25310
|
/* harmony import */ var jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(71125);
|
|
25085
25311
|
/* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(59400);
|
|
25086
|
-
/* harmony import */ var
|
|
25087
|
-
/* harmony import */ var
|
|
25088
|
-
/* harmony import */ var
|
|
25089
|
-
/* 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);
|
|
25090
25317
|
/*!
|
|
25091
25318
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
25092
25319
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -25118,6 +25345,7 @@ const instance = (j)=>j.getInstance('Table', j.o);
|
|
|
25118
25345
|
|
|
25119
25346
|
|
|
25120
25347
|
|
|
25348
|
+
|
|
25121
25349
|
|
|
25122
25350
|
|
|
25123
25351
|
const INPUT_TAGS = new Set([
|
|
@@ -25220,7 +25448,7 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__.U
|
|
|
25220
25448
|
configurable: true
|
|
25221
25449
|
});
|
|
25222
25450
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.append(container, button);
|
|
25223
|
-
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>`);
|
|
25224
25452
|
// For caching
|
|
25225
25453
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.append(button, trigger);
|
|
25226
25454
|
return container;
|
|
@@ -25275,7 +25503,7 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__.U
|
|
|
25275
25503
|
state.icon.iconURL = ctr.iconURL;
|
|
25276
25504
|
} else {
|
|
25277
25505
|
const name = ctr.icon || ctr.name;
|
|
25278
|
-
state.icon.name =
|
|
25506
|
+
state.icon.name = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_22__.Icon.exists(name) || this.j.o.extraIcons?.[name] ? name : '';
|
|
25279
25507
|
}
|
|
25280
25508
|
if (!ctr.iconURL && !state.icon.name) {
|
|
25281
25509
|
state.text = ctr.text || ctr.name;
|
|
@@ -25305,6 +25533,9 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__.U
|
|
|
25305
25533
|
const elm = ctr.popup(this.j, target, this.__closePopup, this);
|
|
25306
25534
|
if (elm) {
|
|
25307
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);
|
|
25308
25539
|
} else {
|
|
25309
25540
|
this.__closePopup();
|
|
25310
25541
|
}
|
|
@@ -25444,7 +25675,7 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__.U
|
|
|
25444
25675
|
/**
|
|
25445
25676
|
* Create an open popup list
|
|
25446
25677
|
*/ __openControlList(control) {
|
|
25447
|
-
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);
|
|
25448
25679
|
const list = control.list;
|
|
25449
25680
|
const menu = this.openPopup();
|
|
25450
25681
|
menu.parentElement = this;
|
|
@@ -25452,7 +25683,7 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__.U
|
|
|
25452
25683
|
if (content) {
|
|
25453
25684
|
return this.__openMenu(menu, content);
|
|
25454
25685
|
}
|
|
25455
|
-
const toolbar = (0,
|
|
25686
|
+
const toolbar = (0,_factory__WEBPACK_IMPORTED_MODULE_24__.makeCollection)(this.j);
|
|
25456
25687
|
toolbar.parentElement = menu;
|
|
25457
25688
|
toolbar.mode = 'vertical';
|
|
25458
25689
|
const isListItem = (key)=>(0,jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_12__.isPlainObject)(key) && 'title' in key && 'value' in key;
|
|
@@ -25516,7 +25747,7 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__.U
|
|
|
25516
25747
|
}
|
|
25517
25748
|
openPopup() {
|
|
25518
25749
|
this.__closePopup();
|
|
25519
|
-
this.openedPopup = new
|
|
25750
|
+
this.openedPopup = new jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_23__.Popup(this.j, false);
|
|
25520
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);
|
|
25521
25752
|
return this.openedPopup;
|
|
25522
25753
|
}
|
|
@@ -25534,15 +25765,18 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__.U
|
|
|
25534
25765
|
this.openedPopup = null;
|
|
25535
25766
|
this.j.e.off(this.ow, 'mousedown touchstart', this.onOutsideClick).off('escape closeAllPopups', this.onOutsideClick).off('keydown', this.__onEditorKeyDown);
|
|
25536
25767
|
// The keyboard brought the focus into the dropdown: give it back to
|
|
25537
|
-
// the button, otherwise it would fall out to the document
|
|
25538
|
-
|
|
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);
|
|
25539
25771
|
this.state.activated = false;
|
|
25540
25772
|
popup.close();
|
|
25541
25773
|
popup.destruct();
|
|
25542
25774
|
if (this.trigger) {
|
|
25543
25775
|
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_17__.attr)(this.trigger, 'aria-expanded', false);
|
|
25544
25776
|
}
|
|
25545
|
-
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) {
|
|
25546
25780
|
this.focus();
|
|
25547
25781
|
}
|
|
25548
25782
|
}
|
|
@@ -26535,6 +26769,7 @@ function readImagesWithReader(fileList, imagesExtensions, promises, uploader, ha
|
|
|
26535
26769
|
continue;
|
|
26536
26770
|
}
|
|
26537
26771
|
const reader = new FileReader();
|
|
26772
|
+
const { name } = file;
|
|
26538
26773
|
const readerPromise = uploader.j.async.promise((resolve, reject)=>{
|
|
26539
26774
|
reader.onerror = reject;
|
|
26540
26775
|
reader.onloadend = ()=>{
|
|
@@ -26545,6 +26780,9 @@ function readImagesWithReader(fileList, imagesExtensions, promises, uploader, ha
|
|
|
26545
26780
|
],
|
|
26546
26781
|
isImages: [
|
|
26547
26782
|
true
|
|
26783
|
+
],
|
|
26784
|
+
fileNames: [
|
|
26785
|
+
name
|
|
26548
26786
|
]
|
|
26549
26787
|
};
|
|
26550
26788
|
const handler = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.isFunction)(handlerSuccess) ? handlerSuccess : defaultHandlerSuccess;
|
|
@@ -27190,6 +27428,7 @@ function val(elm, name, value) {
|
|
|
27190
27428
|
/* harmony import */ var jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(91565);
|
|
27191
27429
|
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7909);
|
|
27192
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);
|
|
27193
27432
|
/*!
|
|
27194
27433
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
27195
27434
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -27204,6 +27443,7 @@ function val(elm, name, value) {
|
|
|
27204
27443
|
|
|
27205
27444
|
|
|
27206
27445
|
|
|
27446
|
+
|
|
27207
27447
|
/**
|
|
27208
27448
|
* Build tabs system
|
|
27209
27449
|
*
|
|
@@ -27284,6 +27524,7 @@ function val(elm, name, value) {
|
|
|
27284
27524
|
if (state) {
|
|
27285
27525
|
state.activeTab = name;
|
|
27286
27526
|
}
|
|
27527
|
+
;(0,jodit_core_ui_helpers_focus_form_field__WEBPACK_IMPORTED_MODULE_5__.focusFormField)(tab);
|
|
27287
27528
|
return false;
|
|
27288
27529
|
});
|
|
27289
27530
|
nameToTab[name] = {
|
|
@@ -28205,6 +28446,12 @@ class backspace extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__.Plugin {
|
|
|
28205
28446
|
if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isOrContains(jodit.editor, fakeNode)) {
|
|
28206
28447
|
return;
|
|
28207
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
|
+
}
|
|
28208
28455
|
if (jodit.e.fire('backSpaceBeforeCases', backspace, fakeNode)) {
|
|
28209
28456
|
return false;
|
|
28210
28457
|
}
|
|
@@ -28252,7 +28499,13 @@ class backspace extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__.Plugin {
|
|
|
28252
28499
|
if (!range.collapsed || !around.isPointInRange(range.startContainer, range.startOffset)) {
|
|
28253
28500
|
return;
|
|
28254
28501
|
}
|
|
28255
|
-
|
|
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);
|
|
28256
28509
|
const link = jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.closest(text, 'a', jodit.editor);
|
|
28257
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)) {
|
|
28258
28511
|
return;
|
|
@@ -28838,7 +29091,7 @@ function checkRemoveChar(jodit, fakeNode, backspace, mode, stopBeforeSpace = fal
|
|
|
28838
29091
|
}
|
|
28839
29092
|
if (charRemoved) {
|
|
28840
29093
|
removeEmptyForParent(fakeNode, 'a');
|
|
28841
|
-
addBRInsideEmptyBlock(jodit, fakeNode);
|
|
29094
|
+
(0,jodit_plugins_backspace_helpers__WEBPACK_IMPORTED_MODULE_3__.addBRInsideEmptyBlock)(jodit, fakeNode);
|
|
28842
29095
|
jodit.s.setCursorBefore(fakeNode);
|
|
28843
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)) {
|
|
28844
29097
|
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.after(fakeNode, jodit.createInside.element('br'));
|
|
@@ -28873,13 +29126,6 @@ function getNextInlineSibling(sibling, backspace, root) {
|
|
|
28873
29126
|
parent = p;
|
|
28874
29127
|
}
|
|
28875
29128
|
}
|
|
28876
|
-
/**
|
|
28877
|
-
* Helper add BR element inside empty block element
|
|
28878
|
-
*/ function addBRInsideEmptyBlock(jodit, node) {
|
|
28879
|
-
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)) {
|
|
28880
|
-
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.after(node, jodit.createInside.element('br'));
|
|
28881
|
-
}
|
|
28882
|
-
}
|
|
28883
29129
|
function tryRemoveChar(sibling, backspace, step, anotherSibling) {
|
|
28884
29130
|
// For Unicode escapes
|
|
28885
29131
|
let value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.toArray)(sibling.nodeValue);
|
|
@@ -29467,6 +29713,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.delete = {
|
|
|
29467
29713
|
|
|
29468
29714
|
"use strict";
|
|
29469
29715
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
29716
|
+
/* harmony export */ addBRInsideEmptyBlock: function() { return /* binding */ addBRInsideEmptyBlock; },
|
|
29470
29717
|
/* harmony export */ findMostNestedNeighbor: function() { return /* binding */ findMostNestedNeighbor; },
|
|
29471
29718
|
/* harmony export */ getMoveFilter: function() { return /* binding */ getMoveFilter; }
|
|
29472
29719
|
/* harmony export */ });
|
|
@@ -29504,6 +29751,14 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.delete = {
|
|
|
29504
29751
|
*/ function getMoveFilter(jodit) {
|
|
29505
29752
|
return (node)=>jodit.e.fire('backSpaceIsMovedIgnore', node) !== true;
|
|
29506
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
|
+
}
|
|
29507
29762
|
|
|
29508
29763
|
|
|
29509
29764
|
/***/ }),
|
|
@@ -29888,7 +30143,7 @@ class cleanHtml extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_7__.Pl
|
|
|
29888
30143
|
beforeCommand(command) {
|
|
29889
30144
|
if (command.toLowerCase() === 'removeformat') {
|
|
29890
30145
|
if (this.j.s.isCollapsed()) {
|
|
29891
|
-
(0,_helpers__WEBPACK_IMPORTED_MODULE_10__.
|
|
30146
|
+
(0,_helpers__WEBPACK_IMPORTED_MODULE_10__.removeFormatForWord)(this.j);
|
|
29892
30147
|
} else {
|
|
29893
30148
|
(0,_helpers__WEBPACK_IMPORTED_MODULE_10__.removeFormatForSelection)(this.j);
|
|
29894
30149
|
}
|
|
@@ -30187,16 +30442,17 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.controls.eraser = {
|
|
|
30187
30442
|
"use strict";
|
|
30188
30443
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
30189
30444
|
/* harmony export */ getHash: function() { return /* reexport safe */ _get_hash__WEBPACK_IMPORTED_MODULE_0__.getHash; },
|
|
30190
|
-
/* harmony export */ removeFormatForCollapsedSelection: function() { return /* reexport safe */ _remove_format_remove_format_for_collapsed_selection__WEBPACK_IMPORTED_MODULE_1__.removeFormatForCollapsedSelection; },
|
|
30191
30445
|
/* harmony export */ removeFormatForSelection: function() { return /* reexport safe */ _remove_format_remove_format_for_selection__WEBPACK_IMPORTED_MODULE_2__.removeFormatForSelection; },
|
|
30192
|
-
/* harmony export */
|
|
30193
|
-
/* 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; }
|
|
30194
30449
|
/* harmony export */ });
|
|
30195
30450
|
/* harmony import */ var _get_hash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5650);
|
|
30196
30451
|
/* harmony import */ var _remove_format_remove_format_for_collapsed_selection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(37431);
|
|
30197
30452
|
/* harmony import */ var _remove_format_remove_format_for_selection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(70195);
|
|
30198
|
-
/* harmony import */ var
|
|
30199
|
-
/* 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);
|
|
30200
30456
|
/*!
|
|
30201
30457
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
30202
30458
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -30211,6 +30467,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.controls.eraser = {
|
|
|
30211
30467
|
|
|
30212
30468
|
|
|
30213
30469
|
|
|
30470
|
+
|
|
30214
30471
|
/***/ }),
|
|
30215
30472
|
|
|
30216
30473
|
/***/ 28665:
|
|
@@ -30370,6 +30627,127 @@ const VIMEO_EMBED = /^(https?:)?\/\/player\.vimeo\.com\/video\//i;
|
|
|
30370
30627
|
}
|
|
30371
30628
|
|
|
30372
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
|
+
|
|
30373
30751
|
/***/ }),
|
|
30374
30752
|
|
|
30375
30753
|
/***/ 53626:
|
|
@@ -32019,7 +32397,8 @@ var DragState = /*#__PURE__*/ (/* unused pure expression or super */ null && (fu
|
|
|
32019
32397
|
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isTag(lastTarget.parentElement, 'a') && lastTarget.parentElement.firstChild === lastTarget && lastTarget.parentElement.lastChild === lastTarget) {
|
|
32020
32398
|
lastTarget = lastTarget.parentElement;
|
|
32021
32399
|
}
|
|
32022
|
-
|
|
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);
|
|
32023
32402
|
}
|
|
32024
32403
|
/**
|
|
32025
32404
|
* Prepare the ghost element and switch to the waiting state.
|
|
@@ -34071,8 +34450,9 @@ const libraries = new Map();
|
|
|
34071
34450
|
/* harmony import */ var jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(62101);
|
|
34072
34451
|
/* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(29434);
|
|
34073
34452
|
/* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5266);
|
|
34074
|
-
/* harmony import */ var
|
|
34075
|
-
/* 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__);
|
|
34076
34456
|
/*!
|
|
34077
34457
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
34078
34458
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -34084,7 +34464,39 @@ const libraries = new Map();
|
|
|
34084
34464
|
|
|
34085
34465
|
|
|
34086
34466
|
|
|
34087
|
-
|
|
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
|
+
}
|
|
34088
34500
|
jodit_config__WEBPACK_IMPORTED_MODULE_3__.Config.prototype.controls.paragraph = {
|
|
34089
34501
|
command: 'formatBlock',
|
|
34090
34502
|
value (editor, button) {
|
|
@@ -34123,11 +34535,164 @@ jodit_config__WEBPACK_IMPORTED_MODULE_3__.Config.prototype.controls.paragraph =
|
|
|
34123
34535
|
isActive: (editor, button)=>{
|
|
34124
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]);
|
|
34125
34537
|
},
|
|
34126
|
-
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}>`,
|
|
34127
34539
|
tooltip: 'Insert format block'
|
|
34128
34540
|
};
|
|
34129
34541
|
|
|
34130
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
|
+
|
|
34131
34696
|
/***/ }),
|
|
34132
34697
|
|
|
34133
34698
|
/***/ 53390:
|
|
@@ -34810,6 +35375,806 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeSandbox = null;
|
|
|
34810
35375
|
jodit_core_global__WEBPACK_IMPORTED_MODULE_2__.pluginSystem.add('iframe', iframe);
|
|
34811
35376
|
|
|
34812
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
|
+
|
|
34813
36178
|
/***/ }),
|
|
34814
36179
|
|
|
34815
36180
|
/***/ 51034:
|
|
@@ -34917,7 +36282,8 @@ const SELECTED_TAGS = new Set([
|
|
|
34917
36282
|
* paints the rest of a block image's line with its parent's highlight. See #1528.
|
|
34918
36283
|
* Media in a wrapper (`jodit-media`, the resizer's `jodit` for an embed, or
|
|
34919
36284
|
* one from `mediaWrappers`) isn't highlighted either, as Safari paints its
|
|
34920
|
-
* 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
|
|
34921
36287
|
*/ onSelectionChange() {
|
|
34922
36288
|
const { jodit } = this;
|
|
34923
36289
|
jodit.editor.classList.toggle(IMAGE_SELECTED, isImageSelected(jodit));
|
|
@@ -34939,9 +36305,11 @@ const SELECTED_TAGS = new Set([
|
|
|
34939
36305
|
if (elm.src && /^data:/.test(elm.src)) {
|
|
34940
36306
|
replaceDataURIToBlobUUID(editor, elm);
|
|
34941
36307
|
}
|
|
36308
|
+
// A captioned image is selected with its caption, so Delete
|
|
36309
|
+
// removes both
|
|
34942
36310
|
editor.e.on(elm, 'mousedown touchstart', ()=>{
|
|
34943
36311
|
removeCaretText(elm);
|
|
34944
|
-
editor.s.select(elm);
|
|
36312
|
+
editor.s.select((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.getCaptionWrapper)(editor, elm) ?? elm);
|
|
34945
36313
|
});
|
|
34946
36314
|
}
|
|
34947
36315
|
});
|
|
@@ -34971,7 +36339,7 @@ function isImageSelected(jodit) {
|
|
|
34971
36339
|
}
|
|
34972
36340
|
const { startContainer, startOffset, endContainer, endOffset } = sel.getRangeAt(0);
|
|
34973
36341
|
const node = startContainer.childNodes[startOffset];
|
|
34974
|
-
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);
|
|
34975
36343
|
}
|
|
34976
36344
|
/**
|
|
34977
36345
|
* Remove the invisible-space text beside an image, which only held a caret.
|
|
@@ -35037,6 +36405,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.image = {
|
|
|
35037
36405
|
useImageEditor: true,
|
|
35038
36406
|
editTitle: true,
|
|
35039
36407
|
editAlt: true,
|
|
36408
|
+
showCaptionCheckbox: true,
|
|
35040
36409
|
editLink: true,
|
|
35041
36410
|
editSize: true,
|
|
35042
36411
|
editBorderRadius: true,
|
|
@@ -35134,10 +36503,12 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.image = {
|
|
|
35134
36503
|
dialog.close();
|
|
35135
36504
|
});
|
|
35136
36505
|
buttons.remove.onAction(()=>{
|
|
36506
|
+
const { sourceImage } = this.state;
|
|
36507
|
+
const target = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.getCaptionWrapper)(j, sourceImage) ?? sourceImage;
|
|
35137
36508
|
const caret = j.s.createRange();
|
|
35138
|
-
caret.setStartBefore(
|
|
36509
|
+
caret.setStartBefore(target);
|
|
35139
36510
|
caret.collapse(true);
|
|
35140
|
-
j.s.removeNode(
|
|
36511
|
+
j.s.removeNode(target);
|
|
35141
36512
|
dialog.close();
|
|
35142
36513
|
j.s.selectRange(caret);
|
|
35143
36514
|
});
|
|
@@ -35159,12 +36530,22 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.image = {
|
|
|
35159
36530
|
if (j.isInDestruct || !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isOrContains(j.editor, sourceImage)) {
|
|
35160
36531
|
return;
|
|
35161
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;
|
|
35162
36543
|
if (j.o.image.selectImageAfterClose) {
|
|
35163
|
-
j.s.select(
|
|
36544
|
+
j.s.select(target);
|
|
35164
36545
|
return;
|
|
35165
36546
|
}
|
|
35166
36547
|
const caret = j.s.createRange();
|
|
35167
|
-
caret.setStartAfter(
|
|
36548
|
+
caret.setStartAfter(target);
|
|
35168
36549
|
caret.collapse(true);
|
|
35169
36550
|
j.s.selectRange(caret);
|
|
35170
36551
|
});
|
|
@@ -35297,6 +36678,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.image = {
|
|
|
35297
36678
|
borderRadius: 0,
|
|
35298
36679
|
imageTitle: '',
|
|
35299
36680
|
imageAlt: '',
|
|
36681
|
+
imageCaption: false,
|
|
35300
36682
|
imageLink: '',
|
|
35301
36683
|
imageLinkOpenInNewTab: false,
|
|
35302
36684
|
imageWidth: 0,
|
|
@@ -35366,10 +36748,11 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_4__.pluginSystem.add('imageProperties
|
|
|
35366
36748
|
/* harmony import */ var jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16849);
|
|
35367
36749
|
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7909);
|
|
35368
36750
|
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(80991);
|
|
35369
|
-
/* harmony import */ var
|
|
35370
|
-
/* harmony import */ var
|
|
35371
|
-
/* harmony import */ var
|
|
35372
|
-
/* 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);
|
|
35373
36756
|
/*!
|
|
35374
36757
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
35375
36758
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -35383,12 +36766,18 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_4__.pluginSystem.add('imageProperties
|
|
|
35383
36766
|
|
|
35384
36767
|
|
|
35385
36768
|
|
|
36769
|
+
|
|
35386
36770
|
/**
|
|
35387
36771
|
* Read values from image and set it to state
|
|
35388
36772
|
* @private
|
|
35389
36773
|
*/ async function readValuesFromImage(j, state) {
|
|
35390
36774
|
const { sourceImage: image, values } = state;
|
|
35391
|
-
|
|
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));
|
|
35392
36781
|
// Border radius
|
|
35393
36782
|
values.borderRadius = parseInt((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__.cssInline)(image, 'border-radius') || '0', 10) || 0;
|
|
35394
36783
|
// Id
|
|
@@ -35402,13 +36791,13 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_4__.pluginSystem.add('imageProperties
|
|
|
35402
36791
|
// Classes
|
|
35403
36792
|
values.classes = ((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'class') || '').replace(/jodit_focused_image[\s]*/, '');
|
|
35404
36793
|
// Margins
|
|
35405
|
-
(0,
|
|
36794
|
+
(0,_margin__WEBPACK_IMPORTED_MODULE_6__.readMargins)(box, values, state);
|
|
35406
36795
|
// Link
|
|
35407
|
-
(0,
|
|
36796
|
+
(0,_link__WEBPACK_IMPORTED_MODULE_5__.readLink)(state, j, values);
|
|
35408
36797
|
// Src
|
|
35409
36798
|
values.imageSrc = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'src') || '';
|
|
35410
36799
|
// Image size
|
|
35411
|
-
return (0,
|
|
36800
|
+
return (0,_size__WEBPACK_IMPORTED_MODULE_7__.readSizes)(image, values, state, wrapper);
|
|
35412
36801
|
}
|
|
35413
36802
|
|
|
35414
36803
|
|
|
@@ -35510,13 +36899,13 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_4__.pluginSystem.add('imageProperties
|
|
|
35510
36899
|
|
|
35511
36900
|
|
|
35512
36901
|
|
|
35513
|
-
/** @private */ async function readSizes(image, values, state) {
|
|
36902
|
+
/** @private */ async function readSizes(image, values, state, captionWrapper) {
|
|
35514
36903
|
try {
|
|
35515
36904
|
await image.decode();
|
|
35516
36905
|
} catch (e) {
|
|
35517
36906
|
console.error(e);
|
|
35518
36907
|
}
|
|
35519
|
-
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;
|
|
35520
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;
|
|
35521
36910
|
values.imageWidth = width !== false ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_3__.normalSizeFromString)(width) : image.offsetWidth || image.naturalWidth;
|
|
35522
36911
|
if ((0,jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_0__.isNumeric)(values.imageWidth)) {
|
|
@@ -35789,6 +37178,12 @@ class UIImageMainTab extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_
|
|
|
35789
37178
|
<label>~Alternative~</label>
|
|
35790
37179
|
<input type="text" class="jodit-input &__imageAlt"/>
|
|
35791
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>
|
|
35792
37187
|
<div class="jodit-form__group &__editLink">
|
|
35793
37188
|
<label>~Link~</label>
|
|
35794
37189
|
<input type="text" class="jodit-input &__imageLink"/>
|
|
@@ -35833,6 +37228,13 @@ class UIImageMainTab extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_
|
|
|
35833
37228
|
onAltChange() {
|
|
35834
37229
|
this.state.values.imageAlt = this.getElm('imageAlt').value;
|
|
35835
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
|
+
}
|
|
35836
37238
|
onStateImageLinkChange() {
|
|
35837
37239
|
const imageLink = this.getElm('imageLink');
|
|
35838
37240
|
imageLink.value = this.state.values.imageLink;
|
|
@@ -35863,6 +37265,10 @@ class UIImageMainTab extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_
|
|
|
35863
37265
|
'editAlt',
|
|
35864
37266
|
'editAlt'
|
|
35865
37267
|
],
|
|
37268
|
+
[
|
|
37269
|
+
'showCaptionCheckbox',
|
|
37270
|
+
'captionCheckbox'
|
|
37271
|
+
],
|
|
35866
37272
|
[
|
|
35867
37273
|
'editLink',
|
|
35868
37274
|
'editLink'
|
|
@@ -35916,6 +37322,12 @@ class UIImageMainTab extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_
|
|
|
35916
37322
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
35917
37323
|
(0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_4__.watch)('imageAlt:change')
|
|
35918
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);
|
|
35919
37331
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
35920
37332
|
(0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_4__.watch)('state.values.imageLink')
|
|
35921
37333
|
], UIImageMainTab.prototype, "onStateImageLinkChange", null);
|
|
@@ -36364,6 +37776,35 @@ UIImagePositionTab = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__
|
|
|
36364
37776
|
/* harmony export */ ]);
|
|
36365
37777
|
|
|
36366
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
|
+
|
|
36367
37808
|
/***/ }),
|
|
36368
37809
|
|
|
36369
37810
|
/***/ 71552:
|
|
@@ -36376,9 +37817,10 @@ UIImagePositionTab = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__
|
|
|
36376
37817
|
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
|
|
36377
37818
|
/* harmony import */ var jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(93640);
|
|
36378
37819
|
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(80991);
|
|
36379
|
-
/* harmony import */ var
|
|
36380
|
-
/* harmony import */ var
|
|
36381
|
-
/* 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);
|
|
36382
37824
|
/*!
|
|
36383
37825
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
36384
37826
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -36391,11 +37833,12 @@ UIImagePositionTab = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__
|
|
|
36391
37833
|
|
|
36392
37834
|
|
|
36393
37835
|
|
|
37836
|
+
|
|
36394
37837
|
/**
|
|
36395
37838
|
* Apply form's values to image
|
|
36396
37839
|
* @private
|
|
36397
37840
|
*/ function applyValuesToImage(j, state, image) {
|
|
36398
|
-
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;
|
|
36399
37842
|
const opt = j.o;
|
|
36400
37843
|
// styles
|
|
36401
37844
|
if (opt.image.editStyle) {
|
|
@@ -36405,7 +37848,7 @@ UIImagePositionTab = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__
|
|
|
36405
37848
|
if (imageSrc) {
|
|
36406
37849
|
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'src', imageSrc);
|
|
36407
37850
|
} else {
|
|
36408
|
-
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);
|
|
36409
37852
|
return;
|
|
36410
37853
|
}
|
|
36411
37854
|
// Border radius
|
|
@@ -36415,21 +37858,24 @@ UIImagePositionTab = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__
|
|
|
36415
37858
|
// Alt
|
|
36416
37859
|
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'alt', imageAlt || null);
|
|
36417
37860
|
// Link
|
|
36418
|
-
(0,
|
|
36419
|
-
// Size
|
|
36420
|
-
(0,_size__WEBPACK_IMPORTED_MODULE_5__.applySize)(image, imageWidth, imageHeight, state.sizeIsLocked);
|
|
36421
|
-
// Margin
|
|
36422
|
-
if (j.o.image.editMargins) {
|
|
36423
|
-
(0,_margin__WEBPACK_IMPORTED_MODULE_4__.applyMargin)(j, marginTop, marginRight, marginBottom, marginLeft, image, state.marginIsLocked);
|
|
36424
|
-
}
|
|
37861
|
+
(0,_link__WEBPACK_IMPORTED_MODULE_4__.applyLink)(j, image, imageLink, imageLinkOpenInNewTab);
|
|
36425
37862
|
if (opt.image.editClass) {
|
|
36426
37863
|
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'class', classes || null);
|
|
36427
37864
|
}
|
|
36428
37865
|
if (opt.image.editId) {
|
|
36429
37866
|
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'id', id || null);
|
|
36430
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
|
+
}
|
|
36431
37877
|
if (opt.image.editAlign) {
|
|
36432
|
-
(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));
|
|
36433
37879
|
}
|
|
36434
37880
|
}
|
|
36435
37881
|
|
|
@@ -36445,6 +37891,7 @@ UIImagePositionTab = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__
|
|
|
36445
37891
|
/* harmony export */ });
|
|
36446
37892
|
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
|
|
36447
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);
|
|
36448
37895
|
/*!
|
|
36449
37896
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
36450
37897
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -36453,6 +37900,7 @@ UIImagePositionTab = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__
|
|
|
36453
37900
|
* @module plugins/image-properties
|
|
36454
37901
|
*/
|
|
36455
37902
|
|
|
37903
|
+
|
|
36456
37904
|
/** @private */ function applyLink(j, image, imageLink, imageLinkOpenInNewTab) {
|
|
36457
37905
|
// Link
|
|
36458
37906
|
let link = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.closest(image, 'a', j.editor);
|
|
@@ -36466,8 +37914,11 @@ UIImagePositionTab = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__
|
|
|
36466
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');
|
|
36467
37915
|
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(link, 'rel', relParts.length ? relParts.join(' ') : null);
|
|
36468
37916
|
}
|
|
36469
|
-
} else {
|
|
36470
|
-
|
|
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 {
|
|
36471
37922
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.replace(link, image, undefined, false, true);
|
|
36472
37923
|
}
|
|
36473
37924
|
}
|
|
@@ -36549,7 +38000,19 @@ UIImagePositionTab = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__
|
|
|
36549
38000
|
|
|
36550
38001
|
|
|
36551
38002
|
|
|
36552
|
-
/**
|
|
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
|
+
}
|
|
36553
38016
|
// Size
|
|
36554
38017
|
if (imageWidth !== image.offsetWidth || imageHeight !== image.offsetHeight) {
|
|
36555
38018
|
const updatedWidth = imageWidth ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_3__.normalSizeToString)(imageWidth) : null;
|
|
@@ -36716,6 +38179,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_3__.Config.prototype.indentMargin = 10;
|
|
|
36716
38179
|
|
|
36717
38180
|
"use strict";
|
|
36718
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);
|
|
36719
38184
|
/*!
|
|
36720
38185
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
36721
38186
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -36723,12 +38188,35 @@ jodit_config__WEBPACK_IMPORTED_MODULE_3__.Config.prototype.indentMargin = 10;
|
|
|
36723
38188
|
*/ /**
|
|
36724
38189
|
* @module plugins/indent
|
|
36725
38190
|
*/
|
|
38191
|
+
|
|
38192
|
+
|
|
36726
38193
|
/**
|
|
36727
38194
|
* Get style rule key for current direction
|
|
36728
38195
|
* @internal
|
|
36729
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
|
+
};
|
|
36730
38217
|
|
|
36731
38218
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, [
|
|
38219
|
+
/* harmony export */ "applyIndentToBox", 0, /* binding */ applyIndentToBox,
|
|
36732
38220
|
/* harmony export */ "getKey", 0, /* binding */ getKey
|
|
36733
38221
|
/* harmony export */ ]);
|
|
36734
38222
|
|
|
@@ -36744,9 +38232,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_3__.Config.prototype.indentMargin = 10;
|
|
|
36744
38232
|
/* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(27795);
|
|
36745
38233
|
/* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(28077);
|
|
36746
38234
|
/* harmony import */ var jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(93640);
|
|
36747
|
-
/* harmony import */ var
|
|
36748
|
-
/* harmony import */ var
|
|
36749
|
-
/* 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);
|
|
36750
38237
|
/*!
|
|
36751
38238
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
36752
38239
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -36761,24 +38248,6 @@ jodit_config__WEBPACK_IMPORTED_MODULE_3__.Config.prototype.indentMargin = 10;
|
|
|
36761
38248
|
|
|
36762
38249
|
|
|
36763
38250
|
|
|
36764
|
-
|
|
36765
|
-
const applyIndentToBox = (processedElements, currentBox, editor, command)=>{
|
|
36766
|
-
if (!currentBox) {
|
|
36767
|
-
return;
|
|
36768
|
-
}
|
|
36769
|
-
if (processedElements.has(currentBox)) {
|
|
36770
|
-
return;
|
|
36771
|
-
}
|
|
36772
|
-
const key = (0,_helpers__WEBPACK_IMPORTED_MODULE_6__.getKey)(editor.o.direction, currentBox);
|
|
36773
|
-
processedElements.add(currentBox);
|
|
36774
|
-
const current = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_4__.cssInline)(currentBox, key);
|
|
36775
|
-
let value = current ? parseInt(current, 10) : 0;
|
|
36776
|
-
value += editor.o.indentMargin * (command === 'outdent' ? -1 : 1);
|
|
36777
|
-
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_4__.css)(currentBox, key, value > 0 ? value : '');
|
|
36778
|
-
if (!(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(currentBox, 'style')) {
|
|
36779
|
-
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(currentBox, 'style', null);
|
|
36780
|
-
}
|
|
36781
|
-
};
|
|
36782
38251
|
/**
|
|
36783
38252
|
* Indents the line containing the selection or insertion point.
|
|
36784
38253
|
*/ function indent(editor) {
|
|
@@ -36797,7 +38266,7 @@ const applyIndentToBox = (processedElements, currentBox, editor, command)=>{
|
|
|
36797
38266
|
if (isBrMode && editor.s.isCollapsed()) {
|
|
36798
38267
|
if (current) {
|
|
36799
38268
|
const box = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.wrapNextInline(current, enterBlock, editor);
|
|
36800
|
-
applyIndentToBox(processedElements, box, editor, command);
|
|
38269
|
+
(0,_helpers__WEBPACK_IMPORTED_MODULE_5__.applyIndentToBox)(processedElements, box, editor, command);
|
|
36801
38270
|
return false;
|
|
36802
38271
|
}
|
|
36803
38272
|
}
|
|
@@ -36811,7 +38280,7 @@ const applyIndentToBox = (processedElements, currentBox, editor, command)=>{
|
|
|
36811
38280
|
editor.s.restore();
|
|
36812
38281
|
return false;
|
|
36813
38282
|
}
|
|
36814
|
-
applyIndentToBox(processedElements, currentBox, editor, command);
|
|
38283
|
+
;(0,_helpers__WEBPACK_IMPORTED_MODULE_5__.applyIndentToBox)(processedElements, currentBox, editor, command);
|
|
36815
38284
|
editor.s.restore();
|
|
36816
38285
|
});
|
|
36817
38286
|
editor.synchronizeValues();
|
|
@@ -36863,48 +38332,49 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__.pluginSystem.add('indent', indent
|
|
|
36863
38332
|
/* harmony import */ var jodit_plugins_hr_hr__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(2952);
|
|
36864
38333
|
/* harmony import */ var jodit_plugins_iframe_iframe__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(81144);
|
|
36865
38334
|
/* harmony import */ var jodit_plugins_image_image__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(90826);
|
|
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
|
|
36888
|
-
/* harmony import */ var
|
|
36889
|
-
/* harmony import */ var
|
|
36890
|
-
/* harmony import */ var
|
|
36891
|
-
/* harmony import */ var
|
|
36892
|
-
/* harmony import */ var
|
|
36893
|
-
/* harmony import */ var
|
|
36894
|
-
/* harmony import */ var
|
|
36895
|
-
/* harmony import */ var
|
|
36896
|
-
/* harmony import */ var
|
|
36897
|
-
/* harmony import */ var
|
|
36898
|
-
/* harmony import */ var
|
|
36899
|
-
/* harmony import */ var
|
|
36900
|
-
/* harmony import */ var
|
|
36901
|
-
/* harmony import */ var
|
|
36902
|
-
/* harmony import */ var
|
|
36903
|
-
/* harmony import */ var
|
|
36904
|
-
/* harmony import */ var
|
|
36905
|
-
/* harmony import */ var
|
|
36906
|
-
/* harmony import */ var
|
|
36907
|
-
/* 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);
|
|
36908
38378
|
/*!
|
|
36909
38379
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
36910
38380
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -36978,6 +38448,7 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__.pluginSystem.add('indent', indent
|
|
|
36978
38448
|
|
|
36979
38449
|
|
|
36980
38450
|
|
|
38451
|
+
|
|
36981
38452
|
|
|
36982
38453
|
|
|
36983
38454
|
/***/ }),
|
|
@@ -36998,16 +38469,20 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__.pluginSystem.add('indent', indent
|
|
|
36998
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__);
|
|
36999
38470
|
/* harmony import */ var jodit_plugins_inline_popup_icons_addrow_svg__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(64637);
|
|
37000
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__);
|
|
37001
|
-
/* harmony import */ var
|
|
37002
|
-
/* harmony import */ var
|
|
37003
|
-
/* harmony import */ var
|
|
37004
|
-
/* harmony import */ var
|
|
37005
|
-
/* harmony import */ var
|
|
37006
|
-
/* harmony import */ var
|
|
37007
|
-
/* harmony import */ var
|
|
37008
|
-
/* harmony import */ var
|
|
37009
|
-
/* harmony import */ var
|
|
37010
|
-
/* 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__);
|
|
37011
38486
|
/*!
|
|
37012
38487
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
37013
38488
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -37029,13 +38504,15 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__.pluginSystem.add('indent', indent
|
|
|
37029
38504
|
|
|
37030
38505
|
|
|
37031
38506
|
|
|
38507
|
+
|
|
38508
|
+
|
|
37032
38509
|
jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.toolbarInline = true;
|
|
37033
38510
|
jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.toolbarInlineForSelection = false;
|
|
37034
38511
|
jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.toolbarInlineDisableFor = [];
|
|
37035
38512
|
jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.toolbarInlineDisabledButtons = [
|
|
37036
38513
|
'source'
|
|
37037
38514
|
];
|
|
37038
|
-
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()));
|
|
37039
38516
|
// Register cell popup buttons as global controls so they can be
|
|
37040
38517
|
// referenced by name in custom popup configurations.
|
|
37041
38518
|
// Skip buttons that already exist in controls (e.g. 'align' from justify plugin).
|
|
@@ -37116,8 +38593,10 @@ const isSafeHref = (href)=>/^(https?:|mailto:|tel:)/i.test(href.trim()) && !/^(j
|
|
|
37116
38593
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
37117
38594
|
|
|
37118
38595
|
"use strict";
|
|
37119
|
-
/* harmony import */ var
|
|
37120
|
-
/* 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);
|
|
37121
38600
|
/*!
|
|
37122
38601
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
37123
38602
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -37126,7 +38605,9 @@ const isSafeHref = (href)=>/^(https?:|mailto:|tel:)/i.test(href.trim()) && !/^(j
|
|
|
37126
38605
|
* @module plugins/inline-popup
|
|
37127
38606
|
*/
|
|
37128
38607
|
|
|
37129
|
-
|
|
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() : '';
|
|
37130
38611
|
/* harmony default export */ __webpack_exports__["default"] = ([
|
|
37131
38612
|
'brushCell',
|
|
37132
38613
|
{
|
|
@@ -37141,7 +38622,7 @@ const cmd = (control)=>control.args && (0,jodit_core_helpers_checker__WEBPACK_IM
|
|
|
37141
38622
|
exec: (editor, table, { control })=>{
|
|
37142
38623
|
const command = cmd(control);
|
|
37143
38624
|
editor.getInstance('Table', editor.o).getAllSelectedCells().forEach((cell)=>{
|
|
37144
|
-
(0,
|
|
38625
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.css)(cell, 'vertical-align', command === 'normal' ? '' : command);
|
|
37145
38626
|
});
|
|
37146
38627
|
},
|
|
37147
38628
|
tooltip: 'Vertical align'
|
|
@@ -37171,7 +38652,7 @@ const cmd = (control)=>control.args && (0,jodit_core_helpers_checker__WEBPACK_IM
|
|
|
37171
38652
|
tableaddcolumnafter: 'Insert column after'
|
|
37172
38653
|
},
|
|
37173
38654
|
exec: (editor, table, { control })=>{
|
|
37174
|
-
if (!(0,
|
|
38655
|
+
if (!(0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_1__.isJoditObject)(editor)) {
|
|
37175
38656
|
return;
|
|
37176
38657
|
}
|
|
37177
38658
|
if (!control.args) {
|
|
@@ -37189,7 +38670,7 @@ const cmd = (control)=>control.args && (0,jodit_core_helpers_checker__WEBPACK_IM
|
|
|
37189
38670
|
tableaddrowafter: 'Insert row below'
|
|
37190
38671
|
},
|
|
37191
38672
|
exec: (editor, table, { control })=>{
|
|
37192
|
-
if (!(0,
|
|
38673
|
+
if (!(0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_1__.isJoditObject)(editor)) {
|
|
37193
38674
|
return;
|
|
37194
38675
|
}
|
|
37195
38676
|
if (!control.args) {
|
|
@@ -37200,6 +38681,25 @@ const cmd = (control)=>control.args && (0,jodit_core_helpers_checker__WEBPACK_IM
|
|
|
37200
38681
|
},
|
|
37201
38682
|
tooltip: 'Add row'
|
|
37202
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
|
+
},
|
|
37203
38703
|
{
|
|
37204
38704
|
name: 'deleteTable',
|
|
37205
38705
|
icon: 'bin',
|
|
@@ -37210,7 +38710,7 @@ const cmd = (control)=>control.args && (0,jodit_core_helpers_checker__WEBPACK_IM
|
|
|
37210
38710
|
tableempty: 'Empty cell'
|
|
37211
38711
|
},
|
|
37212
38712
|
exec: (editor, table, { control })=>{
|
|
37213
|
-
if (!(0,
|
|
38713
|
+
if (!(0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_1__.isJoditObject)(editor)) {
|
|
37214
38714
|
return;
|
|
37215
38715
|
}
|
|
37216
38716
|
if (!control.args) {
|
|
@@ -37274,7 +38774,8 @@ const cmd = (control)=>control.args && (0,jodit_core_helpers_checker__WEBPACK_IM
|
|
|
37274
38774
|
/* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(85932);
|
|
37275
38775
|
/* harmony import */ var jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(16849);
|
|
37276
38776
|
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(80991);
|
|
37277
|
-
/* 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);
|
|
37278
38779
|
/*!
|
|
37279
38780
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
37280
38781
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -37286,6 +38787,7 @@ const cmd = (control)=>control.args && (0,jodit_core_helpers_checker__WEBPACK_IM
|
|
|
37286
38787
|
|
|
37287
38788
|
|
|
37288
38789
|
|
|
38790
|
+
|
|
37289
38791
|
// A Normal image sits where the text of its line is aligned (#1531)
|
|
37290
38792
|
const lineAlign = (editor, elm)=>{
|
|
37291
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;
|
|
@@ -37306,7 +38808,12 @@ const lineAlign = (editor, elm)=>{
|
|
|
37306
38808
|
return 'left';
|
|
37307
38809
|
}
|
|
37308
38810
|
};
|
|
37309
|
-
|
|
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
|
+
};
|
|
37310
38817
|
const align = {
|
|
37311
38818
|
name: 'left',
|
|
37312
38819
|
childTemplate: (_, __, value)=>value,
|
|
@@ -37331,14 +38838,15 @@ const align = {
|
|
|
37331
38838
|
'img',
|
|
37332
38839
|
'jodit',
|
|
37333
38840
|
'jodit-media'
|
|
37334
|
-
])) && (0,
|
|
38841
|
+
])) && (0,jodit_core_helpers_utils_media_wrapper__WEBPACK_IMPORTED_MODULE_5__.getMediaWrapper)(editor, elm) !== elm) {
|
|
37335
38842
|
return;
|
|
37336
38843
|
}
|
|
37337
38844
|
const command = control.args && (0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_1__.isString)(control.args[0]) ? control.args[0].toLowerCase() : '';
|
|
37338
38845
|
if (!command) {
|
|
37339
38846
|
return false;
|
|
37340
38847
|
}
|
|
37341
|
-
|
|
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));
|
|
37342
38850
|
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(elm, new Set([
|
|
37343
38851
|
'jodit',
|
|
37344
38852
|
'jodit-media'
|
|
@@ -37357,7 +38865,7 @@ const align = {
|
|
|
37357
38865
|
icon: 'bin',
|
|
37358
38866
|
tooltip: 'Delete',
|
|
37359
38867
|
exec: (editor, image)=>{
|
|
37360
|
-
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);
|
|
37361
38869
|
}
|
|
37362
38870
|
},
|
|
37363
38871
|
{
|
|
@@ -37370,6 +38878,24 @@ const align = {
|
|
|
37370
38878
|
},
|
|
37371
38879
|
tooltip: 'Edit'
|
|
37372
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
|
+
},
|
|
37373
38899
|
{
|
|
37374
38900
|
name: 'valign',
|
|
37375
38901
|
list: [
|
|
@@ -37379,13 +38905,14 @@ const align = {
|
|
|
37379
38905
|
'Normal'
|
|
37380
38906
|
],
|
|
37381
38907
|
tooltip: 'Vertical align',
|
|
37382
|
-
// `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
|
|
37383
38910
|
isDisabled: (editor, button)=>{
|
|
37384
38911
|
const image = button.target;
|
|
37385
38912
|
return Boolean(image && ([
|
|
37386
38913
|
'left',
|
|
37387
38914
|
'right'
|
|
37388
|
-
].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)));
|
|
37389
38916
|
},
|
|
37390
38917
|
exec: (editor, image, { control })=>{
|
|
37391
38918
|
if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(image, 'img')) {
|
|
@@ -37504,8 +39031,8 @@ const align = {
|
|
|
37504
39031
|
if (target && type && this.canShowPopupForType(type)) {
|
|
37505
39032
|
const isMedia = type === 'jodit-media';
|
|
37506
39033
|
// Beside the media in a wrapper kept in the content, which can fill
|
|
37507
|
-
// the line
|
|
37508
|
-
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;
|
|
37509
39036
|
this.showPopup(()=>this.__bound(bound, isMedia), type, target);
|
|
37510
39037
|
return false;
|
|
37511
39038
|
}
|
|
@@ -40389,6 +41916,11 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.useInputsPlaceholder
|
|
|
40389
41916
|
* Check if root node is empty
|
|
40390
41917
|
* @private
|
|
40391
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) {
|
|
40392
41924
|
if (!root.firstChild) {
|
|
40393
41925
|
return true;
|
|
40394
41926
|
}
|
|
@@ -40917,6 +42449,10 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.tableAllowCellResize
|
|
|
40917
42449
|
|
|
40918
42450
|
|
|
40919
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;
|
|
40920
42456
|
/**
|
|
40921
42457
|
* Process tables in editor
|
|
40922
42458
|
*/ class resizeCells extends jodit_modules__WEBPACK_IMPORTED_MODULE_8__.Plugin {
|
|
@@ -40936,7 +42472,11 @@ const key = 'table_processor_observer-resize';
|
|
|
40936
42472
|
}
|
|
40937
42473
|
hideResizeHandle() {
|
|
40938
42474
|
this.hideTimeout = this.j.async.setTimeout(()=>{
|
|
40939
|
-
|
|
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
|
+
}
|
|
40940
42480
|
}, {
|
|
40941
42481
|
timeout: this.j.defaultTimeout,
|
|
40942
42482
|
label: 'hideResizer'
|
|
@@ -40953,6 +42493,30 @@ const key = 'table_processor_observer-resize';
|
|
|
40953
42493
|
this.startX = event.clientX;
|
|
40954
42494
|
this.j.lock(key);
|
|
40955
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();
|
|
40956
42520
|
let box;
|
|
40957
42521
|
this.minX = 0;
|
|
40958
42522
|
this.maxX = 1000000;
|
|
@@ -40985,6 +42549,14 @@ const key = 'table_processor_observer-resize';
|
|
|
40985
42549
|
this.j.e.fire('closeAllPopups');
|
|
40986
42550
|
let x = event.clientX;
|
|
40987
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
|
+
}
|
|
40988
42560
|
if (x < this.minX) {
|
|
40989
42561
|
x = this.minX;
|
|
40990
42562
|
}
|
|
@@ -40992,7 +42564,14 @@ const key = 'table_processor_observer-resize';
|
|
|
40992
42564
|
x = this.maxX;
|
|
40993
42565
|
}
|
|
40994
42566
|
this.resizeDelta = x - this.startX + (!this.j.o.iframe ? 0 : workplacePosition.left);
|
|
40995
|
-
|
|
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
|
+
});
|
|
40996
42575
|
const sel = this.j.s.sel;
|
|
40997
42576
|
sel && sel.removeAllRanges();
|
|
40998
42577
|
}
|
|
@@ -41009,17 +42588,96 @@ const key = 'table_processor_observer-resize';
|
|
|
41009
42588
|
this.drag = false;
|
|
41010
42589
|
this.j.e.off(this.j.ew, 'mousemove.table touchmove.table', this.onMouseMove);
|
|
41011
42590
|
this.resizeHandler.classList.remove('jodit-table-resizer_moved');
|
|
41012
|
-
if (this.
|
|
41013
|
-
|
|
41014
|
-
|
|
41015
|
-
|
|
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');
|
|
41016
42598
|
} else {
|
|
41017
|
-
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();
|
|
41018
42605
|
}
|
|
41019
42606
|
}
|
|
41020
42607
|
this.j.synchronizeValues();
|
|
41021
42608
|
this.j.s.focus();
|
|
41022
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
|
+
}
|
|
41023
42681
|
/**
|
|
41024
42682
|
* Resize only one column
|
|
41025
42683
|
*/ resizeColumns() {
|
|
@@ -41062,15 +42720,20 @@ const key = 'table_processor_observer-resize';
|
|
|
41062
42720
|
}
|
|
41063
42721
|
/**
|
|
41064
42722
|
* Calc helper resize handle position
|
|
41065
|
-
*/ calcHandlePosition(table, cell, offsetX = 0, delta = 0) {
|
|
42723
|
+
*/ calcHandlePosition(table, cell, offsetX = 0, delta = 0, clientY = NaN) {
|
|
41066
42724
|
const box = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.offset)(cell, this.j, this.j.ed);
|
|
41067
42725
|
if (offsetX > jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.NEARBY && offsetX < box.width - jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.NEARBY) {
|
|
41068
|
-
this.
|
|
42726
|
+
if (!this.calcRowHandlePosition(cell, clientY)) {
|
|
42727
|
+
this.hideResizeHandle();
|
|
42728
|
+
}
|
|
41069
42729
|
return;
|
|
41070
42730
|
}
|
|
42731
|
+
this.workRow = null;
|
|
42732
|
+
this.resizeHandler.classList.remove('jodit-table-resizer_row');
|
|
41071
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);
|
|
41072
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');
|
|
41073
42735
|
Object.assign(this.resizeHandler.style, {
|
|
42736
|
+
width: '',
|
|
41074
42737
|
height: parentBox.height + 'px',
|
|
41075
42738
|
top: parentBox.top - workplacePosition.top + 'px'
|
|
41076
42739
|
});
|
|
@@ -41083,6 +42746,36 @@ const key = 'table_processor_observer-resize';
|
|
|
41083
42746
|
this.setWorkCell(cell, !nextTD ? false : null);
|
|
41084
42747
|
}
|
|
41085
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
|
+
}
|
|
41086
42779
|
/** @override */ afterInit(editor) {
|
|
41087
42780
|
if (!editor.o.tableAllowCellResize) {
|
|
41088
42781
|
return;
|
|
@@ -41090,7 +42783,7 @@ const key = 'table_processor_observer-resize';
|
|
|
41090
42783
|
editor.e.off(this.j.ow, '.resize-cells').off('.resize-cells').on('change.resize-cells afterCommand.resize-cells afterSetMode.resize-cells', ()=>{
|
|
41091
42784
|
;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.$$)('table', editor.editor).forEach(this.observe);
|
|
41092
42785
|
}).on(this.j.ow, 'scroll.resize-cells', ()=>{
|
|
41093
|
-
if (!this.drag) {
|
|
42786
|
+
if (!this.drag || this.workRow) {
|
|
41094
42787
|
return;
|
|
41095
42788
|
}
|
|
41096
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);
|
|
@@ -41114,7 +42807,7 @@ const key = 'table_processor_observer-resize';
|
|
|
41114
42807
|
}
|
|
41115
42808
|
;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.dataBind)(table, key, true);
|
|
41116
42809
|
this.j.e.on(table, 'mouseleave.resize-cells', (e)=>{
|
|
41117
|
-
if (this.resizeHandler && this.resizeHandler !== e.relatedTarget) {
|
|
42810
|
+
if (!this.drag && this.resizeHandler && this.resizeHandler !== e.relatedTarget) {
|
|
41118
42811
|
this.hideResizeHandle();
|
|
41119
42812
|
}
|
|
41120
42813
|
}).on(table, 'mousemove.resize-cells touchmove.resize-cells', this.j.async.throttle((event)=>{
|
|
@@ -41125,7 +42818,7 @@ const key = 'table_processor_observer-resize';
|
|
|
41125
42818
|
if (!cell) {
|
|
41126
42819
|
return;
|
|
41127
42820
|
}
|
|
41128
|
-
this.calcHandlePosition(table, cell, event.offsetX);
|
|
42821
|
+
this.calcHandlePosition(table, cell, event.offsetX, 0, event.clientY);
|
|
41129
42822
|
}, {
|
|
41130
42823
|
timeout: this.j.defaultTimeout
|
|
41131
42824
|
}));
|
|
@@ -41143,9 +42836,21 @@ const key = 'table_processor_observer-resize';
|
|
|
41143
42836
|
this.resizeHandler = this.j.c.div('jodit-table-resizer');
|
|
41144
42837
|
this.j.e.on(this.resizeHandler, 'mousedown.table touchstart.table', this.onHandleMouseDown).on(this.resizeHandler, 'mouseenter.table', ()=>{
|
|
41145
42838
|
this.j.async.clearTimeout(this.hideTimeout);
|
|
42839
|
+
}).on(this.resizeHandler, 'mouseleave.table', ()=>{
|
|
42840
|
+
if (!this.drag) {
|
|
42841
|
+
this.hideResizeHandle();
|
|
42842
|
+
}
|
|
41146
42843
|
});
|
|
41147
42844
|
}
|
|
41148
|
-
}), (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);
|
|
41149
42854
|
}
|
|
41150
42855
|
}
|
|
41151
42856
|
;(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
@@ -41160,6 +42865,44 @@ const key = 'table_processor_observer-resize';
|
|
|
41160
42865
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
41161
42866
|
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.autobind
|
|
41162
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
|
+
}
|
|
41163
42906
|
jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.pluginSystem.add('resizeCells', resizeCells);
|
|
41164
42907
|
|
|
41165
42908
|
|
|
@@ -41641,6 +43384,14 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
|
|
|
41641
43384
|
return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.offset)(this.rect.parentNode || this.j.od.documentElement, this.j, this.j.od, true);
|
|
41642
43385
|
}
|
|
41643
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
|
+
}
|
|
41644
43395
|
const changeAttrs = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isImage(element) && this.j.o.resizer.forImageChangeAttributes;
|
|
41645
43396
|
if (changeAttrs) {
|
|
41646
43397
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(element, key, value);
|
|
@@ -41663,7 +43414,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
|
|
|
41663
43414
|
return;
|
|
41664
43415
|
}
|
|
41665
43416
|
if (this.element.tagName !== 'JODIT') {
|
|
41666
|
-
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);
|
|
41667
43418
|
} else {
|
|
41668
43419
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove(this.element);
|
|
41669
43420
|
this.hide();
|
|
@@ -42871,8 +44622,9 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
|
|
|
42871
44622
|
'touchstartTd',
|
|
42872
44623
|
'touchstartTh'
|
|
42873
44624
|
].map((e)=>e + '.select-cells').join(' '), this.onStartSelection)// For `clickEditor` correct working. Because `mousedown` on first cell
|
|
42874
|
-
// and mouseup on another cell call `click` only for
|
|
42875
|
-
|
|
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', ()=>{
|
|
42876
44628
|
const cellsCount = this.__tableModule.getAllSelectedCells().length;
|
|
42877
44629
|
if (cellsCount) {
|
|
42878
44630
|
if (cellsCount > 1) {
|
|
@@ -43033,14 +44785,6 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
|
|
|
43033
44785
|
}
|
|
43034
44786
|
this.j.e.fire('hidePopup');
|
|
43035
44787
|
e.stopPropagation();
|
|
43036
|
-
// Hack for FireFox for force redraw selection
|
|
43037
|
-
(()=>{
|
|
43038
|
-
const n = this.j.createInside.fromHTML('<div style="color:rgba(0,0,0,0.01);width:0;height:0"> </div>');
|
|
43039
|
-
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.append(cell, n);
|
|
43040
|
-
this.j.async.setTimeout(()=>{
|
|
43041
|
-
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove(n);
|
|
43042
|
-
}, this.j.defaultTimeout / 5);
|
|
43043
|
-
})();
|
|
43044
44788
|
}
|
|
43045
44789
|
/**
|
|
43046
44790
|
* On click in outside - remove selection
|
|
@@ -43137,7 +44881,7 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
|
|
|
43137
44881
|
this.j.synchronizeValues();
|
|
43138
44882
|
return false;
|
|
43139
44883
|
}
|
|
43140
|
-
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)) {
|
|
43141
44885
|
command = command.replace('table', '');
|
|
43142
44886
|
const cells = this.__tableModule.getAllSelectedCells();
|
|
43143
44887
|
if (cells.length) {
|
|
@@ -43204,6 +44948,9 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
|
|
|
43204
44948
|
case 'addrowbefore':
|
|
43205
44949
|
this.__tableModule.appendRow(table, cell.parentNode, command === 'addrowafter');
|
|
43206
44950
|
break;
|
|
44951
|
+
case 'headerrow':
|
|
44952
|
+
this.__toggleHeaderRow(table, cells);
|
|
44953
|
+
break;
|
|
43207
44954
|
}
|
|
43208
44955
|
if (/^bin(row|column)$/.test(command) && !this.__tableModule.getColumnsCount(table)) {
|
|
43209
44956
|
this.__removeTable(table);
|
|
@@ -43212,6 +44959,26 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
|
|
|
43212
44959
|
return false;
|
|
43213
44960
|
}
|
|
43214
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
|
+
}
|
|
43215
44982
|
/**
|
|
43216
44983
|
* The cell that takes the caret when rows or columns are deleted: the next
|
|
43217
44984
|
* one in the same column (or row) that is not deleted, else the previous one
|
|
@@ -45544,9 +47311,13 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_3__.pluginSystem.add('symbols', symbo
|
|
|
45544
47311
|
|
|
45545
47312
|
"use strict";
|
|
45546
47313
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
45547
|
-
/* 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; }
|
|
45548
47318
|
/* harmony export */ });
|
|
45549
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);
|
|
45550
47321
|
/*!
|
|
45551
47322
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
45552
47323
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -45556,6 +47327,7 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_3__.pluginSystem.add('symbols', symbo
|
|
|
45556
47327
|
*/
|
|
45557
47328
|
|
|
45558
47329
|
|
|
47330
|
+
|
|
45559
47331
|
/***/ }),
|
|
45560
47332
|
|
|
45561
47333
|
/***/ 8837:
|
|
@@ -45581,7 +47353,9 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_3__.pluginSystem.add('symbols', symbo
|
|
|
45581
47353
|
* If so then add an internal list
|
|
45582
47354
|
* @private
|
|
45583
47355
|
*/ function onTabInsideLi(jodit, shift = false) {
|
|
45584
|
-
|
|
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) {
|
|
45585
47359
|
return false;
|
|
45586
47360
|
}
|
|
45587
47361
|
const [fake, fake2] = fakeCursors(jodit);
|
|
@@ -45678,6 +47452,281 @@ function removeNestedList(jodit, list, li) {
|
|
|
45678
47452
|
}
|
|
45679
47453
|
|
|
45680
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
|
+
|
|
45681
47730
|
/***/ }),
|
|
45682
47731
|
|
|
45683
47732
|
/***/ 69023:
|
|
@@ -45693,7 +47742,8 @@ function removeNestedList(jodit, list, li) {
|
|
|
45693
47742
|
* @module plugins/tab
|
|
45694
47743
|
*/
|
|
45695
47744
|
jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.tab = {
|
|
45696
|
-
tabInsideLiInsertNewList: true
|
|
47745
|
+
tabInsideLiInsertNewList: true,
|
|
47746
|
+
spaces: 0
|
|
45697
47747
|
};
|
|
45698
47748
|
|
|
45699
47749
|
|
|
@@ -45703,13 +47753,15 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.tab = {
|
|
|
45703
47753
|
/***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
|
|
45704
47754
|
|
|
45705
47755
|
"use strict";
|
|
45706
|
-
/* harmony import */ var
|
|
45707
|
-
/* harmony import */ var
|
|
45708
|
-
/* harmony import */ var
|
|
45709
|
-
/* harmony import */ var
|
|
45710
|
-
/* harmony import */ var
|
|
45711
|
-
/* harmony import */ var
|
|
45712
|
-
/* 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);
|
|
45713
47765
|
/*!
|
|
45714
47766
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
45715
47767
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -45725,34 +47777,97 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.tab = {
|
|
|
45725
47777
|
|
|
45726
47778
|
|
|
45727
47779
|
|
|
45728
|
-
|
|
45729
|
-
|
|
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
|
+
}
|
|
45730
47811
|
__onTab(event) {
|
|
45731
|
-
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))) {
|
|
45732
47813
|
return false;
|
|
45733
47814
|
}
|
|
45734
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
|
+
}
|
|
45735
47826
|
__onCommand(command) {
|
|
45736
47827
|
if ((command === 'indent' || command === 'outdent') && this.__onShift(command === 'outdent')) {
|
|
45737
47828
|
return false;
|
|
45738
47829
|
}
|
|
45739
47830
|
}
|
|
45740
47831
|
__onShift(shift) {
|
|
45741
|
-
const res = (0,
|
|
47832
|
+
const res = (0,_cases__WEBPACK_IMPORTED_MODULE_8__.onTabInsideLi)(this.j, shift);
|
|
45742
47833
|
if (res) {
|
|
45743
47834
|
this.j.e.fire('afterTab', shift);
|
|
45744
47835
|
}
|
|
45745
47836
|
return res;
|
|
45746
47837
|
}
|
|
45747
|
-
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
|
+
}
|
|
45748
47848
|
}
|
|
45749
|
-
;(0,
|
|
45750
|
-
(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')
|
|
45751
47860
|
], tab.prototype, "__onTab", null);
|
|
45752
|
-
(0,
|
|
45753
|
-
(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')
|
|
45754
47869
|
], tab.prototype, "__onCommand", null);
|
|
45755
|
-
|
|
47870
|
+
jodit_core_global__WEBPACK_IMPORTED_MODULE_4__.pluginSystem.add('tab', tab);
|
|
45756
47871
|
|
|
45757
47872
|
|
|
45758
47873
|
/***/ }),
|
|
@@ -47668,7 +49783,7 @@ module.exports["default"] = {"Type something":"Start writing...","pencil":"Edit"
|
|
|
47668
49783
|
/***/ 53414:
|
|
47669
49784
|
/***/ (function(module) {
|
|
47670
49785
|
|
|
47671
|
-
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"]
|
|
47672
49787
|
|
|
47673
49788
|
/***/ }),
|
|
47674
49789
|
|
|
@@ -47889,6 +50004,20 @@ module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=
|
|
|
47889
50004
|
|
|
47890
50005
|
/***/ }),
|
|
47891
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
|
+
|
|
47892
50021
|
/***/ 94190:
|
|
47893
50022
|
/***/ (function(module) {
|
|
47894
50023
|
|