jodit 4.18.4 → 4.18.7
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 +45 -0
- package/es2015/jodit.css +13 -34
- package/es2015/jodit.fat.min.css +1 -1
- package/es2015/jodit.fat.min.js +12 -12
- package/es2015/jodit.js +1130 -225
- package/es2015/jodit.min.css +1 -1
- package/es2015/jodit.min.js +12 -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 +12 -12
- package/es2018/jodit.min.css +1 -1
- package/es2018/jodit.min.js +12 -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 +13 -34
- package/es2021/jodit.fat.min.css +1 -1
- package/es2021/jodit.fat.min.js +16 -16
- package/es2021/jodit.js +1121 -223
- package/es2021/jodit.min.css +1 -1
- package/es2021/jodit.min.js +16 -16
- 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 +13 -34
- package/es2021.en/jodit.fat.min.css +1 -1
- package/es2021.en/jodit.fat.min.js +16 -16
- package/es2021.en/jodit.js +1095 -197
- package/es2021.en/jodit.min.css +1 -1
- package/es2021.en/jodit.min.js +16 -16
- 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 +14 -41
- package/es5/jodit.fat.min.css +1 -1
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +1260 -273
- 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 +5 -0
- package/esm/core/constants.js +1 -1
- package/esm/core/decorators/component/component.js +12 -0
- package/esm/core/helpers/html/apply-styles.js +3 -0
- package/esm/core/helpers/html/clean-from-word.js +3 -0
- package/esm/core/helpers/html/strip-tags.js +24 -6
- package/esm/core/helpers/html/word-lists.d.ts +29 -0
- package/esm/core/helpers/html/word-lists.js +158 -0
- package/esm/core/selection/helpers/index.d.ts +1 -0
- package/esm/core/selection/helpers/index.js +1 -0
- package/esm/core/selection/helpers/is-moved.d.ts +15 -0
- package/esm/core/selection/helpers/is-moved.js +22 -0
- package/esm/core/selection/style/api/list/toggle-ordered-list.js +40 -3
- package/esm/core/selection/style/transactions.js +5 -2
- package/esm/core/ui/popup/popup.js +14 -9
- package/esm/jodit.js +5 -1
- package/esm/langs/ar.d.ts +3 -0
- package/esm/langs/ar.js +4 -1
- package/esm/langs/az.d.ts +3 -0
- package/esm/langs/az.js +4 -1
- package/esm/langs/cs_cz.d.ts +3 -0
- package/esm/langs/cs_cz.js +4 -1
- package/esm/langs/de.d.ts +3 -0
- package/esm/langs/de.js +4 -1
- package/esm/langs/es.d.ts +3 -0
- package/esm/langs/es.js +4 -1
- package/esm/langs/fa.d.ts +3 -0
- package/esm/langs/fa.js +4 -1
- package/esm/langs/fi.d.ts +3 -0
- package/esm/langs/fi.js +4 -1
- package/esm/langs/fr.d.ts +3 -0
- package/esm/langs/fr.js +4 -1
- package/esm/langs/he.d.ts +3 -0
- package/esm/langs/he.js +4 -1
- package/esm/langs/hu.d.ts +3 -0
- package/esm/langs/hu.js +4 -1
- package/esm/langs/id.d.ts +3 -0
- package/esm/langs/id.js +4 -1
- package/esm/langs/it.d.ts +3 -0
- package/esm/langs/it.js +4 -1
- package/esm/langs/ja.d.ts +3 -0
- package/esm/langs/ja.js +4 -1
- package/esm/langs/ko.d.ts +3 -0
- package/esm/langs/ko.js +4 -1
- package/esm/langs/mn.d.ts +3 -0
- package/esm/langs/mn.js +4 -1
- package/esm/langs/nl.d.ts +3 -0
- package/esm/langs/nl.js +4 -1
- package/esm/langs/no.d.ts +3 -0
- package/esm/langs/no.js +4 -1
- package/esm/langs/pl.d.ts +3 -0
- package/esm/langs/pl.js +4 -1
- package/esm/langs/pt_br.d.ts +3 -0
- package/esm/langs/pt_br.js +4 -1
- package/esm/langs/ru.d.ts +3 -0
- package/esm/langs/ru.js +4 -1
- package/esm/langs/sk.d.ts +3 -0
- package/esm/langs/sk.js +4 -1
- package/esm/langs/sv.d.ts +3 -0
- package/esm/langs/sv.js +4 -1
- package/esm/langs/tr.d.ts +3 -0
- package/esm/langs/tr.js +4 -1
- package/esm/langs/ua.d.ts +3 -0
- package/esm/langs/ua.js +4 -1
- package/esm/langs/zh_cn.d.ts +3 -0
- package/esm/langs/zh_cn.js +4 -1
- package/esm/langs/zh_tw.d.ts +3 -0
- package/esm/langs/zh_tw.js +4 -1
- package/esm/modules/dialog/dialog.d.ts +7 -0
- package/esm/modules/dialog/dialog.js +24 -6
- package/esm/modules/file-browser/ui/files/files.js +17 -2
- package/esm/modules/file-browser/ui/tree/tree.js +17 -2
- package/esm/modules/table/table.d.ts +6 -0
- package/esm/modules/table/table.js +18 -26
- package/esm/plugins/backspace/cases/check-join-neighbors.js +90 -3
- package/esm/plugins/backspace/cases/check-remove-char.d.ts +2 -1
- package/esm/plugins/backspace/cases/check-remove-char.js +25 -4
- package/esm/plugins/backspace/config.d.ts +2 -0
- package/esm/plugins/backspace/config.js +6 -3
- package/esm/plugins/clean-html/clean-html.d.ts +8 -0
- package/esm/plugins/clean-html/clean-html.js +21 -1
- package/esm/plugins/clean-html/helpers/index.d.ts +1 -0
- package/esm/plugins/clean-html/helpers/index.js +1 -0
- package/esm/plugins/clean-html/helpers/remove-placeholder-br.d.ts +16 -0
- package/esm/plugins/clean-html/helpers/remove-placeholder-br.js +51 -0
- package/esm/plugins/delete/delete.d.ts +11 -1
- package/esm/plugins/delete/delete.js +92 -16
- package/esm/plugins/focus/focus.js +12 -1
- package/esm/plugins/iframe/config.d.ts +3 -0
- package/esm/plugins/iframe/config.js +0 -27
- package/esm/plugins/iframe/iframe.js +8 -1
- package/esm/plugins/image-processor/image-processor.js +6 -1
- package/esm/plugins/image-properties/image-properties.d.ts +5 -0
- package/esm/plugins/image-properties/image-properties.js +30 -5
- package/esm/plugins/inline-popup/inline-popup.d.ts +19 -0
- package/esm/plugins/inline-popup/inline-popup.js +70 -1
- package/esm/plugins/mobile/mobile.js +7 -4
- package/esm/plugins/ordered-list/config.js +13 -2
- package/esm/plugins/ordered-list/start-dialog.d.ts +19 -0
- package/esm/plugins/ordered-list/start-dialog.js +58 -0
- package/esm/plugins/placeholder/placeholder.js +7 -1
- package/esm/plugins/resizer/resizer.d.ts +10 -0
- package/esm/plugins/resizer/resizer.js +76 -2
- package/esm/plugins/select-cells/select-cells.d.ts +23 -0
- package/esm/plugins/select-cells/select-cells.js +75 -1
- package/esm/plugins/table-keyboard-navigation/table-keyboard-navigation.js +3 -2
- package/package.json +1 -1
- package/types/config.d.ts +5 -0
- package/types/core/helpers/html/word-lists.d.ts +29 -0
- package/types/core/selection/helpers/index.d.ts +1 -0
- package/types/core/selection/helpers/is-moved.d.ts +15 -0
- package/types/langs/ar.d.ts +3 -0
- package/types/langs/az.d.ts +3 -0
- package/types/langs/cs_cz.d.ts +3 -0
- package/types/langs/de.d.ts +3 -0
- package/types/langs/es.d.ts +3 -0
- package/types/langs/fa.d.ts +3 -0
- package/types/langs/fi.d.ts +3 -0
- package/types/langs/fr.d.ts +3 -0
- package/types/langs/he.d.ts +3 -0
- package/types/langs/hu.d.ts +3 -0
- package/types/langs/id.d.ts +3 -0
- package/types/langs/it.d.ts +3 -0
- package/types/langs/ja.d.ts +3 -0
- package/types/langs/ko.d.ts +3 -0
- package/types/langs/mn.d.ts +3 -0
- package/types/langs/nl.d.ts +3 -0
- package/types/langs/no.d.ts +3 -0
- package/types/langs/pl.d.ts +3 -0
- package/types/langs/pt_br.d.ts +3 -0
- package/types/langs/ru.d.ts +3 -0
- package/types/langs/sk.d.ts +3 -0
- package/types/langs/sv.d.ts +3 -0
- package/types/langs/tr.d.ts +3 -0
- package/types/langs/ua.d.ts +3 -0
- package/types/langs/zh_cn.d.ts +3 -0
- package/types/langs/zh_tw.d.ts +3 -0
- package/types/modules/dialog/dialog.d.ts +7 -0
- package/types/modules/table/table.d.ts +6 -0
- package/types/plugins/backspace/cases/check-remove-char.d.ts +2 -1
- package/types/plugins/backspace/config.d.ts +2 -0
- package/types/plugins/clean-html/clean-html.d.ts +8 -0
- package/types/plugins/clean-html/helpers/index.d.ts +1 -0
- package/types/plugins/clean-html/helpers/remove-placeholder-br.d.ts +16 -0
- package/types/plugins/delete/delete.d.ts +11 -1
- package/types/plugins/iframe/config.d.ts +3 -0
- package/types/plugins/image-properties/image-properties.d.ts +5 -0
- package/types/plugins/inline-popup/inline-popup.d.ts +19 -0
- package/types/plugins/ordered-list/start-dialog.d.ts +19 -0
- package/types/plugins/resizer/resizer.d.ts +10 -0
- package/types/plugins/select-cells/select-cells.d.ts +23 -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.18.
|
|
4
|
+
* Version: v4.18.7
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -1822,7 +1822,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1822
1822
|
* ```
|
|
1823
1823
|
* @packageDocumentation
|
|
1824
1824
|
* @module constants
|
|
1825
|
-
*/ const APP_VERSION = "4.18.
|
|
1825
|
+
*/ const APP_VERSION = "4.18.7";
|
|
1826
1826
|
// prettier-ignore
|
|
1827
1827
|
const ES = "es2021";
|
|
1828
1828
|
const IS_ES_MODERN = true;
|
|
@@ -2560,6 +2560,8 @@ function cacheHTML(target, _, descriptor) {
|
|
|
2560
2560
|
*/
|
|
2561
2561
|
|
|
2562
2562
|
const componentRegistry = new Map();
|
|
2563
|
+
const decoratedClasses = new WeakSet();
|
|
2564
|
+
const warnedClasses = new WeakSet();
|
|
2563
2565
|
/**
|
|
2564
2566
|
* Decorate components and set status isReady after constructor
|
|
2565
2567
|
* @param constructorFunction - Component constructor class
|
|
@@ -2576,9 +2578,16 @@ const componentRegistry = new Map();
|
|
|
2576
2578
|
Object.setPrototypeOf(this, newConstructorFunction.prototype);
|
|
2577
2579
|
}
|
|
2578
2580
|
this.setStatus('ready');
|
|
2581
|
+
} else if (!jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.IS_PROD && !decoratedClasses.has(this.constructor) && !warnedClasses.has(this.constructor)) {
|
|
2582
|
+
// Only the outermost class's decorator sets `ready`, so a subclass
|
|
2583
|
+
// without its own decorator stays in `beforeInit`. See #1685
|
|
2584
|
+
warnedClasses.add(this.constructor);
|
|
2585
|
+
console.warn(`Component "${this.constructor.name || (0,jodit_core_helpers_utils_get_class_name__WEBPACK_IMPORTED_MODULE_1__.getClassName)(this)}" extends a @component class without being decorated itself, so it never becomes ready and its @watch, @debounce, @throttle and @hook handlers never run`);
|
|
2579
2586
|
}
|
|
2580
2587
|
}
|
|
2581
2588
|
}
|
|
2589
|
+
decoratedClasses.add(constructorFunction);
|
|
2590
|
+
decoratedClasses.add(newConstructorFunction);
|
|
2582
2591
|
const name = (0,jodit_core_helpers_utils_get_class_name__WEBPACK_IMPORTED_MODULE_1__.getClassName)(constructorFunction.prototype);
|
|
2583
2592
|
if (componentRegistry.has(name) && !jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.IS_PROD) {
|
|
2584
2593
|
throw new Error(`Component with name "${name}" is already registered`);
|
|
@@ -5855,10 +5864,11 @@ const isLicense = (license)=>(0,_is_string__WEBPACK_IMPORTED_MODULE_0__.isString
|
|
|
5855
5864
|
/* harmony export */ });
|
|
5856
5865
|
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
|
|
5857
5866
|
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
|
|
5858
|
-
/* harmony import */ var
|
|
5859
|
-
/* harmony import */ var
|
|
5860
|
-
/* harmony import */ var
|
|
5861
|
-
/* harmony import */ var
|
|
5867
|
+
/* harmony import */ var jodit_core_helpers_html_word_lists__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(75480);
|
|
5868
|
+
/* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4040);
|
|
5869
|
+
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7909);
|
|
5870
|
+
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(80991);
|
|
5871
|
+
/* harmony import */ var jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(28723);
|
|
5862
5872
|
/*!
|
|
5863
5873
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
5864
5874
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -5871,6 +5881,7 @@ const isLicense = (license)=>(0,_is_string__WEBPACK_IMPORTED_MODULE_0__.isString
|
|
|
5871
5881
|
|
|
5872
5882
|
|
|
5873
5883
|
|
|
5884
|
+
|
|
5874
5885
|
function normalizeCSS(s) {
|
|
5875
5886
|
return s.replace(/mso-[a-z-]+:[\s]*[^;]+;/gi, '').replace(/mso-[a-z-]+:[\s]*[^";']+$/gi, '').replace(/border[a-z-]*:[\s]*[^;]+;/gi, '').replace(/([0-9.]+)(pt|cm)/gi, (match, units, metrics)=>{
|
|
5876
5887
|
switch(metrics.toLowerCase()){
|
|
@@ -5904,7 +5915,7 @@ function normalizeCSS(s) {
|
|
|
5904
5915
|
html = html.substring(0, closeIndex + '</html>'.length);
|
|
5905
5916
|
}
|
|
5906
5917
|
const iframe = jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalDocument.createElement('iframe');
|
|
5907
|
-
(0,
|
|
5918
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.css)(iframe, 'display', 'none');
|
|
5908
5919
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalDocument.body, iframe);
|
|
5909
5920
|
let convertedString = '', collection;
|
|
5910
5921
|
try {
|
|
@@ -5913,13 +5924,14 @@ function normalizeCSS(s) {
|
|
|
5913
5924
|
iframeDoc.open();
|
|
5914
5925
|
iframeDoc.write(html);
|
|
5915
5926
|
iframeDoc.close();
|
|
5927
|
+
const listItems = (0,jodit_core_helpers_html_word_lists__WEBPACK_IMPORTED_MODULE_2__.readWordListItems)(iframeDoc.body);
|
|
5916
5928
|
// Word marks its auto-generated list markers (the literal
|
|
5917
5929
|
// bullet/number, e.g. `1.` or `·`) with `mso-list:Ignore`.
|
|
5918
5930
|
// They are display-only and must not be imported, otherwise
|
|
5919
5931
|
// the marker text leaks into the content. Drop them before any
|
|
5920
5932
|
// style normalization strips the `mso-list` hint. See #948
|
|
5921
5933
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.each(iframeDoc.body, (node)=>{
|
|
5922
|
-
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(node) && /mso-list:\s*ignore/i.test((0,
|
|
5934
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(node) && /mso-list:\s*ignore/i.test((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_4__.attr)(node, 'style') || '')) {
|
|
5923
5935
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(node);
|
|
5924
5936
|
}
|
|
5925
5937
|
});
|
|
@@ -5930,7 +5942,7 @@ function normalizeCSS(s) {
|
|
|
5930
5942
|
if (rules[idx].selectorText === '') {
|
|
5931
5943
|
continue;
|
|
5932
5944
|
}
|
|
5933
|
-
collection = (0,
|
|
5945
|
+
collection = (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_6__.$$)(rules[idx].selectorText, iframeDoc.body);
|
|
5934
5946
|
// `style.cssText` on purpose: the CSSOM parses the text,
|
|
5935
5947
|
// drops invalid declarations and re-serializes it. The raw
|
|
5936
5948
|
// `style` attribute would keep Word-only junk verbatim
|
|
@@ -5944,18 +5956,19 @@ function normalizeCSS(s) {
|
|
|
5944
5956
|
throw e;
|
|
5945
5957
|
}
|
|
5946
5958
|
}
|
|
5959
|
+
;(0,jodit_core_helpers_html_word_lists__WEBPACK_IMPORTED_MODULE_2__.wrapWordListItems)(listItems);
|
|
5947
5960
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.each(iframeDoc.body, (node)=>{
|
|
5948
5961
|
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(node)) {
|
|
5949
|
-
const cssText = (0,
|
|
5962
|
+
const cssText = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_4__.attr)(node, 'style');
|
|
5950
5963
|
if (cssText) {
|
|
5951
5964
|
node.style.cssText = normalizeCSS(cssText);
|
|
5952
5965
|
}
|
|
5953
|
-
if (!(0,
|
|
5954
|
-
(0,
|
|
5966
|
+
if (!(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_4__.attr)(node, 'style')) {
|
|
5967
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_4__.attr)(node, 'style', null);
|
|
5955
5968
|
}
|
|
5956
5969
|
}
|
|
5957
5970
|
});
|
|
5958
|
-
convertedString = iframeDoc.firstChild ? (0,
|
|
5971
|
+
convertedString = iframeDoc.firstChild ? (0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_3__.trim)(iframeDoc.body.innerHTML) : '';
|
|
5959
5972
|
}
|
|
5960
5973
|
} catch {} finally{
|
|
5961
5974
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(iframe);
|
|
@@ -5963,7 +5976,7 @@ function normalizeCSS(s) {
|
|
|
5963
5976
|
if (convertedString) {
|
|
5964
5977
|
html = convertedString;
|
|
5965
5978
|
}
|
|
5966
|
-
return (0,
|
|
5979
|
+
return (0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_3__.trim)(html.replace(/<(\/)?(html|colgroup|col|o:p)[^>]*>/g, '').replace(/<!--[^>]*>/g, ''));
|
|
5967
5980
|
}
|
|
5968
5981
|
|
|
5969
5982
|
|
|
@@ -5979,8 +5992,9 @@ function normalizeCSS(s) {
|
|
|
5979
5992
|
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
|
|
5980
5993
|
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
|
|
5981
5994
|
/* harmony import */ var jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(88475);
|
|
5982
|
-
/* harmony import */ var
|
|
5983
|
-
/* harmony import */ var
|
|
5995
|
+
/* harmony import */ var jodit_core_helpers_html_word_lists__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(75480);
|
|
5996
|
+
/* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4040);
|
|
5997
|
+
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7909);
|
|
5984
5998
|
/*!
|
|
5985
5999
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
5986
6000
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -5992,6 +6006,7 @@ function normalizeCSS(s) {
|
|
|
5992
6006
|
|
|
5993
6007
|
|
|
5994
6008
|
|
|
6009
|
+
|
|
5995
6010
|
/**
|
|
5996
6011
|
* The method automatically cleans up content from Microsoft Word and other HTML sources to ensure clean, compliant
|
|
5997
6012
|
* content that matches the look and feel of the site.
|
|
@@ -6005,6 +6020,7 @@ function normalizeCSS(s) {
|
|
|
6005
6020
|
const div = jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalDocument.createElement('div');
|
|
6006
6021
|
div.innerHTML = html;
|
|
6007
6022
|
const marks = [];
|
|
6023
|
+
const listItems = (0,jodit_core_helpers_html_word_lists__WEBPACK_IMPORTED_MODULE_3__.readWordListItems)(div);
|
|
6008
6024
|
if (div.firstChild) {
|
|
6009
6025
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.each(div, (node)=>{
|
|
6010
6026
|
if (!node) {
|
|
@@ -6029,7 +6045,7 @@ function normalizeCSS(s) {
|
|
|
6029
6045
|
// with `mso-list:Ignore`. They are display-only
|
|
6030
6046
|
// and must not be imported, otherwise the marker
|
|
6031
6047
|
// text leaks into the content. See #948
|
|
6032
|
-
if (/mso-list:\s*ignore/i.test((0,
|
|
6048
|
+
if (/mso-list:\s*ignore/i.test((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_5__.attr)(node, 'style') || '')) {
|
|
6033
6049
|
marks.push(node);
|
|
6034
6050
|
break;
|
|
6035
6051
|
}
|
|
@@ -6043,7 +6059,7 @@ function normalizeCSS(s) {
|
|
|
6043
6059
|
// `attrRaw`: SVG keeps camelCase names
|
|
6044
6060
|
// (`viewBox`), `attr()` would kebab-case
|
|
6045
6061
|
// them and silently skip the removal
|
|
6046
|
-
(0,
|
|
6062
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_5__.attrRaw)(node, attribute.name, null);
|
|
6047
6063
|
}
|
|
6048
6064
|
});
|
|
6049
6065
|
}
|
|
@@ -6056,12 +6072,13 @@ function normalizeCSS(s) {
|
|
|
6056
6072
|
});
|
|
6057
6073
|
}
|
|
6058
6074
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove.apply(null, marks);
|
|
6075
|
+
(0,jodit_core_helpers_html_word_lists__WEBPACK_IMPORTED_MODULE_3__.wrapWordListItems)(listItems);
|
|
6059
6076
|
convertedString = div.innerHTML;
|
|
6060
6077
|
} catch (e) {}
|
|
6061
6078
|
if (convertedString) {
|
|
6062
6079
|
html = convertedString;
|
|
6063
6080
|
}
|
|
6064
|
-
html = html.split(/(\n)/).filter(
|
|
6081
|
+
html = html.split(/(\n)/).filter(jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_4__.trim).join('\n');
|
|
6065
6082
|
return html.replace(/<(\/)?(html|colgroup|col|o:p)[^>]*>/g, '').replace(/<!--[^>]*>/g, '');
|
|
6066
6083
|
}
|
|
6067
6084
|
|
|
@@ -6404,7 +6421,14 @@ const NEW_LINE_TAGS = new Set([
|
|
|
6404
6421
|
'h4',
|
|
6405
6422
|
'h5',
|
|
6406
6423
|
'h6',
|
|
6407
|
-
'hr'
|
|
6424
|
+
'hr',
|
|
6425
|
+
'ul',
|
|
6426
|
+
'ol',
|
|
6427
|
+
'li'
|
|
6428
|
+
]);
|
|
6429
|
+
const LIST_TAGS = new Set([
|
|
6430
|
+
'ul',
|
|
6431
|
+
'ol'
|
|
6408
6432
|
]);
|
|
6409
6433
|
const INVISIBLE_TAGS = new Set([
|
|
6410
6434
|
'script',
|
|
@@ -6430,6 +6454,16 @@ const ALONE_TAGS = new Set([
|
|
|
6430
6454
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.each(tmp, (node)=>{
|
|
6431
6455
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isElement(node) && all.push(node);
|
|
6432
6456
|
});
|
|
6457
|
+
// By default blocks are joined with a single space (single-line
|
|
6458
|
+
// plain text). When `blockBr` is set, separate them with a line
|
|
6459
|
+
// break instead, so paragraph structure survives — e.g. the
|
|
6460
|
+
// "Insert only Text" paste option. See #1232
|
|
6461
|
+
const separators = new Set();
|
|
6462
|
+
const separator = ()=>{
|
|
6463
|
+
const text = doc.createTextNode(blockBr ? '%%%jodit-single-br%%%' : ' ');
|
|
6464
|
+
separators.add(text);
|
|
6465
|
+
return text;
|
|
6466
|
+
};
|
|
6433
6467
|
all.forEach((p)=>{
|
|
6434
6468
|
const pr = p.parentNode;
|
|
6435
6469
|
if (!pr) {
|
|
@@ -6449,16 +6483,17 @@ const ALONE_TAGS = new Set([
|
|
|
6449
6483
|
if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(p, NEW_LINE_TAGS)) {
|
|
6450
6484
|
return;
|
|
6451
6485
|
}
|
|
6486
|
+
const pv = p.previousSibling;
|
|
6487
|
+
// A nested list starts on a new line after its item's own text
|
|
6488
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(p, LIST_TAGS) && pv && !separators.has(pv) && !(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isText(pv) && /\s$/.test(pv.nodeValue || ''))) {
|
|
6489
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.before(p, separator());
|
|
6490
|
+
}
|
|
6452
6491
|
const nx = p.nextSibling;
|
|
6453
6492
|
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isText(nx) && /^\s/.test(nx.nodeValue || '')) {
|
|
6454
6493
|
return;
|
|
6455
6494
|
}
|
|
6456
6495
|
if (nx) {
|
|
6457
|
-
|
|
6458
|
-
// plain text). When `blockBr` is set, separate them with a line
|
|
6459
|
-
// break instead, so paragraph structure survives — e.g. the
|
|
6460
|
-
// "Insert only Text" paste option. See #1232
|
|
6461
|
-
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.before(nx, doc.createTextNode(blockBr ? '%%%jodit-single-br%%%' : ' '));
|
|
6496
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.before(nx, separator());
|
|
6462
6497
|
}
|
|
6463
6498
|
});
|
|
6464
6499
|
return restoreTags((0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_2__.trim)(tmp.innerText));
|
|
@@ -6468,6 +6503,181 @@ function restoreTags(content) {
|
|
|
6468
6503
|
}
|
|
6469
6504
|
|
|
6470
6505
|
|
|
6506
|
+
/***/ }),
|
|
6507
|
+
|
|
6508
|
+
/***/ 75480:
|
|
6509
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6510
|
+
|
|
6511
|
+
"use strict";
|
|
6512
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6513
|
+
/* harmony export */ readWordListItems: function() { return /* binding */ readWordListItems; },
|
|
6514
|
+
/* harmony export */ wrapWordListItems: function() { return /* binding */ wrapWordListItems; }
|
|
6515
|
+
/* harmony export */ });
|
|
6516
|
+
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
|
|
6517
|
+
/* harmony import */ var jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(88475);
|
|
6518
|
+
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7909);
|
|
6519
|
+
/*!
|
|
6520
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
6521
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
6522
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
6523
|
+
*/ /**
|
|
6524
|
+
* @module helpers/html
|
|
6525
|
+
*/
|
|
6526
|
+
|
|
6527
|
+
|
|
6528
|
+
const ROMAN = {
|
|
6529
|
+
i: 1,
|
|
6530
|
+
v: 5,
|
|
6531
|
+
x: 10,
|
|
6532
|
+
l: 50,
|
|
6533
|
+
c: 100,
|
|
6534
|
+
d: 500,
|
|
6535
|
+
m: 1000
|
|
6536
|
+
};
|
|
6537
|
+
function romanValue(roman) {
|
|
6538
|
+
let value = 0;
|
|
6539
|
+
for(let i = 0; i < roman.length; i += 1){
|
|
6540
|
+
const current = ROMAN[roman[i]], next = ROMAN[roman[i + 1]] || 0;
|
|
6541
|
+
value += current < next ? -current : current;
|
|
6542
|
+
}
|
|
6543
|
+
return value;
|
|
6544
|
+
}
|
|
6545
|
+
/**
|
|
6546
|
+
* Word's marker text (`1.`, `b)`, `iv.`, `·`, `o`, `§`) decides the list type
|
|
6547
|
+
*/ function parseMarker(marker) {
|
|
6548
|
+
const text = marker.replace(/\s+/g, '');
|
|
6549
|
+
const decimal = /^\(?(?:\d+\.)*(\d+)[.)]?$/.exec(text);
|
|
6550
|
+
if (decimal) {
|
|
6551
|
+
return {
|
|
6552
|
+
tag: 'ol',
|
|
6553
|
+
listStyleType: null,
|
|
6554
|
+
start: Number(decimal[1])
|
|
6555
|
+
};
|
|
6556
|
+
}
|
|
6557
|
+
const letters = /^\(?([a-z]+|[A-Z]+)[.)]$/.exec(text);
|
|
6558
|
+
if (letters) {
|
|
6559
|
+
const value = letters[1], lower = value.toLowerCase(), upper = value !== lower;
|
|
6560
|
+
if (/^[ivxlcdm]+$/.test(lower) && (lower.length > 1 || lower === 'i')) {
|
|
6561
|
+
return {
|
|
6562
|
+
tag: 'ol',
|
|
6563
|
+
listStyleType: upper ? 'upper-roman' : 'lower-roman',
|
|
6564
|
+
start: romanValue(lower)
|
|
6565
|
+
};
|
|
6566
|
+
}
|
|
6567
|
+
// Word continues a lettered list with aa, bb, ...
|
|
6568
|
+
if (/^([a-z])\1*$/.test(lower)) {
|
|
6569
|
+
return {
|
|
6570
|
+
tag: 'ol',
|
|
6571
|
+
listStyleType: upper ? 'upper-alpha' : 'lower-alpha',
|
|
6572
|
+
start: (lower.length - 1) * 26 + lower.charCodeAt(0) - 96
|
|
6573
|
+
};
|
|
6574
|
+
}
|
|
6575
|
+
}
|
|
6576
|
+
return {
|
|
6577
|
+
tag: 'ul',
|
|
6578
|
+
listStyleType: null,
|
|
6579
|
+
start: 1
|
|
6580
|
+
};
|
|
6581
|
+
}
|
|
6582
|
+
/**
|
|
6583
|
+
* Removes the marker and the wrappers it leaves empty
|
|
6584
|
+
*/ function removeMarker(marker, paragraph) {
|
|
6585
|
+
let parent = marker.parentNode;
|
|
6586
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(marker);
|
|
6587
|
+
while(parent && parent !== paragraph && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isElement(parent) && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(parent)){
|
|
6588
|
+
const next = parent.parentNode;
|
|
6589
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(parent);
|
|
6590
|
+
parent = next;
|
|
6591
|
+
}
|
|
6592
|
+
}
|
|
6593
|
+
/**
|
|
6594
|
+
* Finds Word's list paragraphs (`<p style="mso-list:l0 level1 lfo1">`), reads
|
|
6595
|
+
* their list, level and type from the `mso-list:Ignore` marker, and removes the
|
|
6596
|
+
* marker. Call it before anything strips the `mso-list` styles, then pass the
|
|
6597
|
+
* result to {@link wrapWordListItems}
|
|
6598
|
+
*/ function readWordListItems(root) {
|
|
6599
|
+
const items = [];
|
|
6600
|
+
(0,jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_1__.toArray)(root.querySelectorAll('p')).forEach((paragraph)=>{
|
|
6601
|
+
const match = /mso-list:\s*l(\d+)\s+level(\d+)(?:\s+lfo(\d+))?/i.exec((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(paragraph, 'style') || '');
|
|
6602
|
+
if (!match) {
|
|
6603
|
+
return;
|
|
6604
|
+
}
|
|
6605
|
+
const marker = (0,jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_1__.toArray)(paragraph.querySelectorAll('[style]')).find((elm)=>/mso-list:\s*ignore/i.test((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(elm, 'style') || ''));
|
|
6606
|
+
items.push({
|
|
6607
|
+
paragraph,
|
|
6608
|
+
list: `${match[1]}:${match[3] || ''}`,
|
|
6609
|
+
level: Number(match[2]),
|
|
6610
|
+
...parseMarker(marker?.textContent || '')
|
|
6611
|
+
});
|
|
6612
|
+
if (marker) {
|
|
6613
|
+
removeMarker(marker, paragraph);
|
|
6614
|
+
}
|
|
6615
|
+
});
|
|
6616
|
+
return items;
|
|
6617
|
+
}
|
|
6618
|
+
function isAdjacent(prev, item) {
|
|
6619
|
+
return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.findSibling(item.paragraph, true, (n)=>!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmptyTextNode(n) && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isComment(n)) === prev.paragraph;
|
|
6620
|
+
}
|
|
6621
|
+
/**
|
|
6622
|
+
* Turns the paragraphs found by {@link readWordListItems} into `<ul>`/`<ol>`
|
|
6623
|
+
* lists, nesting them by level. Each paragraph becomes an `<li>` without Word's
|
|
6624
|
+
* hanging indent
|
|
6625
|
+
*/ function wrapWordListItems(items) {
|
|
6626
|
+
let stack = [];
|
|
6627
|
+
const continues = items.map((item, index)=>index > 0 && isAdjacent(items[index - 1], item));
|
|
6628
|
+
items.forEach((item, index)=>{
|
|
6629
|
+
const { paragraph } = item;
|
|
6630
|
+
if (!continues[index]) {
|
|
6631
|
+
stack = [];
|
|
6632
|
+
}
|
|
6633
|
+
while(stack.length && stack[stack.length - 1].level > item.level){
|
|
6634
|
+
stack.pop();
|
|
6635
|
+
}
|
|
6636
|
+
let top = stack[stack.length - 1];
|
|
6637
|
+
if (top && top.level === item.level && top.list !== item.list) {
|
|
6638
|
+
stack.pop();
|
|
6639
|
+
top = stack[stack.length - 1];
|
|
6640
|
+
}
|
|
6641
|
+
const doc = paragraph.ownerDocument;
|
|
6642
|
+
if (!top || top.level < item.level) {
|
|
6643
|
+
const element = doc.createElement(item.tag);
|
|
6644
|
+
if (item.listStyleType) {
|
|
6645
|
+
element.style.listStyleType = item.listStyleType;
|
|
6646
|
+
}
|
|
6647
|
+
if (item.tag === 'ol' && item.start !== 1) {
|
|
6648
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(element, 'start', item.start);
|
|
6649
|
+
}
|
|
6650
|
+
if (top && top.li) {
|
|
6651
|
+
top.li.appendChild(element);
|
|
6652
|
+
} else {
|
|
6653
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.before(paragraph, element);
|
|
6654
|
+
}
|
|
6655
|
+
top = {
|
|
6656
|
+
level: item.level,
|
|
6657
|
+
list: item.list,
|
|
6658
|
+
element
|
|
6659
|
+
};
|
|
6660
|
+
stack.push(top);
|
|
6661
|
+
}
|
|
6662
|
+
const li = doc.createElement('li');
|
|
6663
|
+
(0,jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_1__.toArray)(paragraph.attributes).forEach((attribute)=>{
|
|
6664
|
+
if (attribute.name !== 'class') {
|
|
6665
|
+
li.setAttribute(attribute.name, attribute.value);
|
|
6666
|
+
}
|
|
6667
|
+
});
|
|
6668
|
+
li.style.removeProperty('margin-left');
|
|
6669
|
+
li.style.removeProperty('text-indent');
|
|
6670
|
+
if (!(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(li, 'style')) {
|
|
6671
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(li, 'style', null);
|
|
6672
|
+
}
|
|
6673
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.moveContent(paragraph, li);
|
|
6674
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(paragraph);
|
|
6675
|
+
top.element.appendChild(li);
|
|
6676
|
+
top.li = li;
|
|
6677
|
+
});
|
|
6678
|
+
}
|
|
6679
|
+
|
|
6680
|
+
|
|
6471
6681
|
/***/ }),
|
|
6472
6682
|
|
|
6473
6683
|
/***/ 65946:
|
|
@@ -10798,13 +11008,15 @@ function usable(ranges, shadowRoot) {
|
|
|
10798
11008
|
/* harmony export */ composedRanges: function() { return /* reexport safe */ _composed_ranges__WEBPACK_IMPORTED_MODULE_2__.composedRanges; },
|
|
10799
11009
|
/* harmony export */ cursorInTheEdgeOfString: function() { return /* binding */ cursorInTheEdgeOfString; },
|
|
10800
11010
|
/* harmony export */ findCorrectCurrentNode: function() { return /* binding */ findCorrectCurrentNode; },
|
|
10801
|
-
/* harmony export */
|
|
11011
|
+
/* harmony export */ isMoved: function() { return /* reexport safe */ _is_moved__WEBPACK_IMPORTED_MODULE_3__.isMoved; },
|
|
11012
|
+
/* harmony export */ moveNodeInsideStart: function() { return /* reexport safe */ _move_node_inside_start__WEBPACK_IMPORTED_MODULE_4__.moveNodeInsideStart; }
|
|
10802
11013
|
/* harmony export */ });
|
|
10803
11014
|
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
|
|
10804
11015
|
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
|
|
10805
11016
|
/* harmony import */ var _composed_ranges__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(43134);
|
|
10806
|
-
/* harmony import */ var
|
|
10807
|
-
/* harmony import */ var
|
|
11017
|
+
/* harmony import */ var _is_moved__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(90657);
|
|
11018
|
+
/* harmony import */ var _move_node_inside_start__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(89817);
|
|
11019
|
+
/* harmony import */ var _move_the_node_along_the_edge_outward__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7470);
|
|
10808
11020
|
/*!
|
|
10809
11021
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
10810
11022
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -10816,6 +11028,7 @@ function usable(ranges, shadowRoot) {
|
|
|
10816
11028
|
|
|
10817
11029
|
|
|
10818
11030
|
|
|
11031
|
+
|
|
10819
11032
|
/**
|
|
10820
11033
|
* Despite the name, returns `true` when the cursor is NOT at the checked edge
|
|
10821
11034
|
* of the text node: there is significant (non invisible-space) text between
|
|
@@ -10870,6 +11083,36 @@ function findCorrectCurrentNode(node, range, rightMode, isCollapsed, checkChild,
|
|
|
10870
11083
|
}
|
|
10871
11084
|
|
|
10872
11085
|
|
|
11086
|
+
/***/ }),
|
|
11087
|
+
|
|
11088
|
+
/***/ 90657:
|
|
11089
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
11090
|
+
|
|
11091
|
+
"use strict";
|
|
11092
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
11093
|
+
/* harmony export */ isMoved: function() { return /* binding */ isMoved; }
|
|
11094
|
+
/* harmony export */ });
|
|
11095
|
+
/*!
|
|
11096
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
11097
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
11098
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
11099
|
+
*/ /**
|
|
11100
|
+
* @module selection
|
|
11101
|
+
*/ /**
|
|
11102
|
+
* Whether the selection, `before` as it was when a key went down, has since
|
|
11103
|
+
* moved to somewhere else in the editor
|
|
11104
|
+
* @private
|
|
11105
|
+
*/ function isMoved(jodit, before) {
|
|
11106
|
+
const { s } = jodit;
|
|
11107
|
+
// Selecting table cells, for one, removes the selection altogether
|
|
11108
|
+
if (!before || !s.isInsideArea) {
|
|
11109
|
+
return false;
|
|
11110
|
+
}
|
|
11111
|
+
const { range } = s;
|
|
11112
|
+
return range.startContainer !== before.startContainer || range.startOffset !== before.startOffset || range.endContainer !== before.endContainer || range.endOffset !== before.endOffset;
|
|
11113
|
+
}
|
|
11114
|
+
|
|
11115
|
+
|
|
10873
11116
|
/***/ }),
|
|
10874
11117
|
|
|
10875
11118
|
/***/ 89817:
|
|
@@ -12925,12 +13168,14 @@ function elementsEqualAttributes(elm1, elm2) {
|
|
|
12925
13168
|
/* harmony export */ toggleOrderedList: function() { return /* binding */ toggleOrderedList; }
|
|
12926
13169
|
/* harmony export */ });
|
|
12927
13170
|
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
|
|
12928
|
-
/* harmony import */ var
|
|
12929
|
-
/* harmony import */ var
|
|
12930
|
-
/* harmony import */ var
|
|
12931
|
-
/* harmony import */ var
|
|
12932
|
-
/* harmony import */ var
|
|
12933
|
-
/* harmony import */ var
|
|
13171
|
+
/* harmony import */ var jodit_core_helpers_size_object_size__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(18073);
|
|
13172
|
+
/* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(28712);
|
|
13173
|
+
/* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_2__);
|
|
13174
|
+
/* harmony import */ var jodit_core_selection_style_api_extract__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(17481);
|
|
13175
|
+
/* harmony import */ var jodit_core_selection_style_api_is_same_attributes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(95971);
|
|
13176
|
+
/* harmony import */ var jodit_core_selection_style_api_toggle_attributes__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(82794);
|
|
13177
|
+
/* harmony import */ var jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(98394);
|
|
13178
|
+
/* harmony import */ var _wrap_list__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(97110);
|
|
12934
13179
|
/*!
|
|
12935
13180
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
12936
13181
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -12941,6 +13186,8 @@ function elementsEqualAttributes(elm1, elm2) {
|
|
|
12941
13186
|
|
|
12942
13187
|
|
|
12943
13188
|
|
|
13189
|
+
|
|
13190
|
+
|
|
12944
13191
|
/**
|
|
12945
13192
|
* Replaces `ul->ol` or `ol->ul`, apply styles to the list, or remove a list item from it
|
|
12946
13193
|
* @private
|
|
@@ -12952,39 +13199,69 @@ function elementsEqualAttributes(elm1, elm2) {
|
|
|
12952
13199
|
if (!list) {
|
|
12953
13200
|
return mode;
|
|
12954
13201
|
}
|
|
12955
|
-
const result = jodit.e.fire(`${
|
|
13202
|
+
const result = jodit.e.fire(`${jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__._PREFIX}BeforeToggleList`, mode, commitStyle, list);
|
|
12956
13203
|
if (result !== undefined) {
|
|
12957
13204
|
return result;
|
|
12958
13205
|
}
|
|
12959
|
-
const hook = jodit.e.fire.bind(jodit.e, `${
|
|
13206
|
+
const hook = jodit.e.fire.bind(jodit.e, `${jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__._PREFIX}AfterToggleList`);
|
|
12960
13207
|
if (mode !== (/* inlined export .UNWRAP */"unwrap")) {
|
|
12961
|
-
const isChangeMode = (0,
|
|
13208
|
+
const isChangeMode = (0,jodit_core_selection_style_api_toggle_attributes__WEBPACK_IMPORTED_MODULE_5__.toggleAttributes)(commitStyle, li.parentElement, jodit, jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.INITIAL, true) === (/* inlined export .CHANGE */"change");
|
|
13209
|
+
const isSameList = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(list, commitStyle.element);
|
|
13210
|
+
// ol => ol[style="list-style-type: lower-roman"]: a list's style
|
|
13211
|
+
// belongs to the whole list, so it is changed without splitting it
|
|
13212
|
+
if (isSameList && isChangeMode && mode !== jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.REPLACE && changesStyleOnly(commitStyle)) {
|
|
13213
|
+
(0,jodit_core_selection_style_api_toggle_attributes__WEBPACK_IMPORTED_MODULE_5__.toggleAttributes)(commitStyle, list, jodit, (/* inlined export .CHANGE */"change"));
|
|
13214
|
+
hook((/* inlined export .CHANGE */"change"), joinPrevious(commitStyle, list, mode), commitStyle);
|
|
13215
|
+
return (/* inlined export .CHANGE */"change");
|
|
13216
|
+
}
|
|
13217
|
+
// Restyled already, for an earlier part of the selection
|
|
13218
|
+
if (isSameList && mode === (/* inlined export .CHANGE */"change")) {
|
|
13219
|
+
return (/* inlined export .CHANGE */"change");
|
|
13220
|
+
}
|
|
12962
13221
|
// ul => ol, ol => ul or ul => ul.class1
|
|
12963
|
-
if (mode ===
|
|
12964
|
-
const wrapper = unwrapList(
|
|
12965
|
-
const newList = (0,
|
|
12966
|
-
hook(
|
|
12967
|
-
return
|
|
13222
|
+
if (mode === jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.REPLACE || isChangeMode || !isSameList) {
|
|
13223
|
+
const wrapper = unwrapList(jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.REPLACE, list, li, jodit, commitStyle);
|
|
13224
|
+
const newList = (0,_wrap_list__WEBPACK_IMPORTED_MODULE_7__.wrapList)(commitStyle, wrapper, jodit);
|
|
13225
|
+
hook(jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.REPLACE, newList, commitStyle);
|
|
13226
|
+
return jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.REPLACE;
|
|
12968
13227
|
}
|
|
12969
13228
|
}
|
|
12970
13229
|
const wrapper = unwrapList((/* inlined export .UNWRAP */"unwrap"), list, li, jodit, commitStyle);
|
|
12971
13230
|
hook((/* inlined export .UNWRAP */"unwrap"), wrapper, commitStyle);
|
|
12972
13231
|
return (/* inlined export .UNWRAP */"unwrap");
|
|
12973
13232
|
}
|
|
13233
|
+
/**
|
|
13234
|
+
* Other attributes, such as a class, still move the items into a new list,
|
|
13235
|
+
* where the `beforeWrapList` hook can add markup to each of them
|
|
13236
|
+
*/ function changesStyleOnly({ options: { attributes } }) {
|
|
13237
|
+
return Boolean(attributes?.style) && (0,jodit_core_helpers_size_object_size__WEBPACK_IMPORTED_MODULE_1__.size)(attributes) === 1;
|
|
13238
|
+
}
|
|
13239
|
+
/**
|
|
13240
|
+
* Joins a restyled list to the list before it, when the selection runs on
|
|
13241
|
+
* from that list and the two now match
|
|
13242
|
+
*/ function joinPrevious(commitStyle, list, mode) {
|
|
13243
|
+
const prev = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.findSibling(list, true);
|
|
13244
|
+
if (mode !== (/* inlined export .CHANGE */"change") || !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(prev, commitStyle.element) || !(0,jodit_core_selection_style_api_is_same_attributes__WEBPACK_IMPORTED_MODULE_4__.elementsEqualAttributes)(prev, list)) {
|
|
13245
|
+
return list;
|
|
13246
|
+
}
|
|
13247
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.append(prev, Array.from(list.childNodes));
|
|
13248
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(list);
|
|
13249
|
+
return prev;
|
|
13250
|
+
}
|
|
12974
13251
|
function unwrapList(mode, list, li, jodit, cs) {
|
|
12975
|
-
const result = jodit.e.fire(`${
|
|
13252
|
+
const result = jodit.e.fire(`${jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__._PREFIX}BeforeUnwrapList`, mode, list, cs);
|
|
12976
13253
|
if (result) {
|
|
12977
|
-
(0,
|
|
13254
|
+
(0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_2__.assert)(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isHTMLElement(result), `${jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__._PREFIX}BeforeUnwrapList hook must return HTMLElement`);
|
|
12978
13255
|
return result;
|
|
12979
13256
|
}
|
|
12980
|
-
;(0,
|
|
12981
|
-
(0,
|
|
13257
|
+
;(0,jodit_core_selection_style_api_extract__WEBPACK_IMPORTED_MODULE_3__.extractSelectedPart)(list, li, jodit);
|
|
13258
|
+
(0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_2__.assert)(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isHTMLElement(li.parentElement), 'Element should be inside the list');
|
|
12982
13259
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.unwrap(li.parentElement);
|
|
12983
13260
|
// In the REPLACE mode the content will be immediately wrapped in a `li`
|
|
12984
13261
|
// of the new list inside `wrapList`, so it should stay in the document.
|
|
12985
13262
|
// Replacing it with a fragment here would dissolve the content
|
|
12986
13263
|
// (with `enter: 'br'`) and the new list would never be inserted.
|
|
12987
|
-
if (mode ===
|
|
13264
|
+
if (mode === jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.REPLACE) {
|
|
12988
13265
|
return li;
|
|
12989
13266
|
}
|
|
12990
13267
|
return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.replace(li, jodit.o.enter.toLowerCase() !== 'br' ? jodit.o.enter : jodit.createInside.fragment(), jodit.createInside);
|
|
@@ -13697,7 +13974,7 @@ const transactions = {
|
|
|
13697
13974
|
[states.LIST]: {
|
|
13698
13975
|
exec (value) {
|
|
13699
13976
|
const { element, jodit, mode } = value;
|
|
13700
|
-
if (mode !== jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_4__.INITIAL && mode !== (/* inlined export .UNWRAP */"unwrap") && mode !== jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_4__.REPLACE) {
|
|
13977
|
+
if (mode !== jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_4__.INITIAL && mode !== (/* inlined export .UNWRAP */"unwrap") && mode !== jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_4__.REPLACE && mode !== (/* inlined export .CHANGE */"change")) {
|
|
13701
13978
|
return {
|
|
13702
13979
|
...value,
|
|
13703
13980
|
next: states.END
|
|
@@ -17292,6 +17569,9 @@ class Popup extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_10__.UIGr
|
|
|
17292
17569
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
17293
17570
|
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.autobind
|
|
17294
17571
|
], Popup.prototype, "__closeOnOutsideClick", null);
|
|
17572
|
+
Popup = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
17573
|
+
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.component
|
|
17574
|
+
], Popup);
|
|
17295
17575
|
|
|
17296
17576
|
|
|
17297
17577
|
/***/ }),
|
|
@@ -18403,7 +18683,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
18403
18683
|
commands.push(command);
|
|
18404
18684
|
if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isFunction)(command)) {
|
|
18405
18685
|
const hotkeys = this.o.commandToHotkeys[commandName] || this.o.commandToHotkeys[commandNameOriginal] || command.hotkeys;
|
|
18406
|
-
if (hotkeys) {
|
|
18686
|
+
if (hotkeys && hotkeys.length) {
|
|
18407
18687
|
this.registerHotkeyToCommand(hotkeys, commandName, options?.stopPropagation);
|
|
18408
18688
|
}
|
|
18409
18689
|
}
|
|
@@ -18412,6 +18692,10 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
18412
18692
|
/**
|
|
18413
18693
|
* Register hotkey for command
|
|
18414
18694
|
*/ registerHotkeyToCommand(hotkeys, commandName, shouldStop = true) {
|
|
18695
|
+
// An empty list (e.g. `commandToHotkeys: { cmd: [] }`) turns the key off
|
|
18696
|
+
if (!hotkeys || !hotkeys.length) {
|
|
18697
|
+
return;
|
|
18698
|
+
}
|
|
18415
18699
|
const shortcuts = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.asArray)(hotkeys).map(jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.normalizeKeyAliases).map((hotkey)=>hotkey + '.hotkey').join(' ');
|
|
18416
18700
|
this.e.off(shortcuts).on(shortcuts, (type, stop)=>{
|
|
18417
18701
|
if (stop) {
|
|
@@ -19675,6 +19959,11 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
|
|
|
19675
19959
|
}
|
|
19676
19960
|
}
|
|
19677
19961
|
__onResizerMouseDown(e) {
|
|
19962
|
+
// As for the header: otherwise Safari selects the dialog's text as
|
|
19963
|
+
// the pointer moves
|
|
19964
|
+
if (e.cancelable) {
|
|
19965
|
+
e.preventDefault();
|
|
19966
|
+
}
|
|
19678
19967
|
this.resizable = true;
|
|
19679
19968
|
this.startX = e.clientX;
|
|
19680
19969
|
this.startY = e.clientY;
|
|
@@ -19686,7 +19975,7 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
|
|
|
19686
19975
|
// the content area does not shrink below its CSS `min-height`,
|
|
19687
19976
|
// so it is part of the smallest height the panel can take
|
|
19688
19977
|
const contentMinHeight = content ? parseFloat(this.ow.getComputedStyle(content).minHeight) || 0 : 0;
|
|
19689
|
-
this.minSize.w = (0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_8__.isNumber)(this.o.minWidth) ? this.o.minWidth : Math.max(100, footer
|
|
19978
|
+
this.minSize.w = (0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_8__.isNumber)(this.o.minWidth) ? this.o.minWidth : Math.max(100, header ? this.__contentWidth(header) : 0, footer ? this.__contentWidth(footer) : 0);
|
|
19690
19979
|
this.minSize.h = (0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_8__.isNumber)(this.o.minHeight) ? this.o.minHeight : (header?.offsetHeight ?? 0) + (footer?.offsetHeight ?? 0) + contentMinHeight + this.resizer.offsetHeight;
|
|
19691
19980
|
this.lockSelect();
|
|
19692
19981
|
this.__addGlobalResizeListeners();
|
|
@@ -19696,13 +19985,25 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
|
|
|
19696
19985
|
*/ this.e.fire(this, 'startResize');
|
|
19697
19986
|
}
|
|
19698
19987
|
}
|
|
19988
|
+
/**
|
|
19989
|
+
* The width `box` takes with its content on one line. The header and
|
|
19990
|
+
* footer are flex rows as wide as the dialog, so the footer's
|
|
19991
|
+
* `scrollWidth` was the dialog's width and kept it from getting any
|
|
19992
|
+
* narrower
|
|
19993
|
+
*/ __contentWidth(box) {
|
|
19994
|
+
const { width } = box.style;
|
|
19995
|
+
box.style.width = 'max-content';
|
|
19996
|
+
const contentWidth = box.offsetWidth;
|
|
19997
|
+
box.style.width = width;
|
|
19998
|
+
return contentWidth;
|
|
19999
|
+
}
|
|
19699
20000
|
__addGlobalResizeListeners() {
|
|
19700
20001
|
const self1 = this;
|
|
19701
20002
|
self1.e.on(self1.ow, 'pointermove touchmove', self1.__onMouseMove).on(self1.ow, 'pointerup touchend', self1.__onMouseUp);
|
|
19702
20003
|
}
|
|
19703
20004
|
__removeGlobalResizeListeners() {
|
|
19704
20005
|
const self1 = this;
|
|
19705
|
-
self1.e.off(self1.ow, '
|
|
20006
|
+
self1.e.off(self1.ow, 'pointermove touchmove', self1.__onMouseMove).off(self1.ow, 'pointerup touchend', self1.__onMouseUp);
|
|
19706
20007
|
}
|
|
19707
20008
|
/**
|
|
19708
20009
|
* Specifies the size of the window
|
|
@@ -22295,18 +22596,25 @@ const DEFAULT_SOURCE_NAME = 'default';
|
|
|
22295
22596
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
22296
22597
|
/* harmony export */ FileBrowserFiles: function() { return /* binding */ FileBrowserFiles; }
|
|
22297
22598
|
/* harmony export */ });
|
|
22298
|
-
/* harmony import */ var
|
|
22599
|
+
/* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(31635);
|
|
22600
|
+
/* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(84839);
|
|
22601
|
+
/* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4099);
|
|
22602
|
+
|
|
22299
22603
|
/*!
|
|
22300
22604
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
22301
22605
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
22302
22606
|
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
22303
22607
|
*/
|
|
22304
22608
|
|
|
22305
|
-
|
|
22609
|
+
|
|
22610
|
+
class FileBrowserFiles extends jodit_core_ui__WEBPACK_IMPORTED_MODULE_2__.UIGroup {
|
|
22306
22611
|
className() {
|
|
22307
22612
|
return 'FileBrowserFiles';
|
|
22308
22613
|
}
|
|
22309
22614
|
}
|
|
22615
|
+
FileBrowserFiles = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
|
|
22616
|
+
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.component
|
|
22617
|
+
], FileBrowserFiles);
|
|
22310
22618
|
|
|
22311
22619
|
|
|
22312
22620
|
/***/ }),
|
|
@@ -22340,18 +22648,25 @@ class FileBrowserFiles extends jodit_core_ui__WEBPACK_IMPORTED_MODULE_0__.UIGrou
|
|
|
22340
22648
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
22341
22649
|
/* harmony export */ FileBrowserTree: function() { return /* binding */ FileBrowserTree; }
|
|
22342
22650
|
/* harmony export */ });
|
|
22343
|
-
/* harmony import */ var
|
|
22651
|
+
/* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(31635);
|
|
22652
|
+
/* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(84839);
|
|
22653
|
+
/* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4099);
|
|
22654
|
+
|
|
22344
22655
|
/*!
|
|
22345
22656
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
22346
22657
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
22347
22658
|
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
22348
22659
|
*/
|
|
22349
22660
|
|
|
22350
|
-
|
|
22661
|
+
|
|
22662
|
+
class FileBrowserTree extends jodit_core_ui__WEBPACK_IMPORTED_MODULE_2__.UIGroup {
|
|
22351
22663
|
className() {
|
|
22352
22664
|
return 'FileBrowserTree';
|
|
22353
22665
|
}
|
|
22354
22666
|
}
|
|
22667
|
+
FileBrowserTree = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
|
|
22668
|
+
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.component
|
|
22669
|
+
], FileBrowserTree);
|
|
22355
22670
|
|
|
22356
22671
|
|
|
22357
22672
|
/***/ }),
|
|
@@ -24015,14 +24330,12 @@ StatusBar = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)
|
|
|
24015
24330
|
/* harmony export */ Table: function() { return /* binding */ Table; }
|
|
24016
24331
|
/* harmony export */ });
|
|
24017
24332
|
/* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25045);
|
|
24018
|
-
/* harmony import */ var
|
|
24019
|
-
/* harmony import */ var
|
|
24020
|
-
/* harmony import */ var
|
|
24021
|
-
/* harmony import */ var
|
|
24022
|
-
/* harmony import */ var
|
|
24023
|
-
/* harmony import */ var
|
|
24024
|
-
/* harmony import */ var jodit_core_helpers___WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(65946);
|
|
24025
|
-
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(80991);
|
|
24333
|
+
/* harmony import */ var jodit_core_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16964);
|
|
24334
|
+
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(81937);
|
|
24335
|
+
/* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(27795);
|
|
24336
|
+
/* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(28077);
|
|
24337
|
+
/* harmony import */ var jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(65946);
|
|
24338
|
+
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(80991);
|
|
24026
24339
|
/*!
|
|
24027
24340
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
24028
24341
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -24038,26 +24351,15 @@ StatusBar = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)
|
|
|
24038
24351
|
|
|
24039
24352
|
|
|
24040
24353
|
|
|
24041
|
-
|
|
24042
|
-
|
|
24043
24354
|
const markedValue = new WeakMap();
|
|
24044
|
-
class Table extends
|
|
24355
|
+
class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_1__.ViewComponent {
|
|
24045
24356
|
/** @override */ className() {
|
|
24046
24357
|
return 'Table';
|
|
24047
24358
|
}
|
|
24048
|
-
__recalculateStyles() {
|
|
24049
|
-
const style = (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_6__.getContainer)(this.j, Table, 'style', true);
|
|
24050
|
-
const selectors = [];
|
|
24051
|
-
this.selected.forEach((td)=>{
|
|
24052
|
-
const selector = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_7__.cssPath)(td);
|
|
24053
|
-
selector && selectors.push(selector);
|
|
24054
|
-
});
|
|
24055
|
-
style.innerHTML = selectors.length ? selectors.join(',') + `{${this.jodit.options.table.selectionCellStyle}}` : '';
|
|
24056
|
-
}
|
|
24057
24359
|
addSelection(td) {
|
|
24058
24360
|
this.selected.add(td);
|
|
24059
24361
|
this.__recalculateStyles();
|
|
24060
|
-
const table =
|
|
24362
|
+
const table = jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.closest(td, 'table', this.j.editor);
|
|
24061
24363
|
if (table) {
|
|
24062
24364
|
const cells = Table.__selectedByTable.get(table) || new Set();
|
|
24063
24365
|
cells.add(td);
|
|
@@ -24067,7 +24369,7 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
|
|
|
24067
24369
|
removeSelection(td) {
|
|
24068
24370
|
this.selected.delete(td);
|
|
24069
24371
|
this.__recalculateStyles();
|
|
24070
|
-
const table =
|
|
24372
|
+
const table = jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.closest(td, 'table', this.j.editor);
|
|
24071
24373
|
if (table) {
|
|
24072
24374
|
const cells = Table.__selectedByTable.get(table);
|
|
24073
24375
|
if (cells) {
|
|
@@ -24081,11 +24383,11 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
|
|
|
24081
24383
|
/**
|
|
24082
24384
|
* Returns array of selected cells
|
|
24083
24385
|
*/ getAllSelectedCells() {
|
|
24084
|
-
return (0,
|
|
24386
|
+
return (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.toArray)(this.selected);
|
|
24085
24387
|
}
|
|
24086
24388
|
static __getSelectedCellsByTable(table) {
|
|
24087
24389
|
const cells = Table.__selectedByTable.get(table);
|
|
24088
|
-
return cells ? (0,
|
|
24390
|
+
return cells ? (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.toArray)(cells) : [];
|
|
24089
24391
|
}
|
|
24090
24392
|
/** @override **/ destruct() {
|
|
24091
24393
|
this.selected.clear();
|
|
@@ -24112,7 +24414,7 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
|
|
|
24112
24414
|
const matrix = [
|
|
24113
24415
|
[]
|
|
24114
24416
|
];
|
|
24115
|
-
const rows = (0,
|
|
24417
|
+
const rows = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.toArray)(table.rows);
|
|
24116
24418
|
const setCell = (cell, i)=>{
|
|
24117
24419
|
if (matrix[i] === undefined) {
|
|
24118
24420
|
matrix[i] = [];
|
|
@@ -24135,7 +24437,7 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
|
|
|
24135
24437
|
}
|
|
24136
24438
|
};
|
|
24137
24439
|
for(let i = 0; i < rows.length; i += 1){
|
|
24138
|
-
const cells = (0,
|
|
24440
|
+
const cells = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.toArray)(rows[i].cells);
|
|
24139
24441
|
for(let j = 0; j < cells.length; j += 1){
|
|
24140
24442
|
if (setCell(cells[j], i) === false) {
|
|
24141
24443
|
return matrix;
|
|
@@ -24185,34 +24487,34 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
|
|
|
24185
24487
|
row = create.element('tr');
|
|
24186
24488
|
for(let j = 0; j < columnsCount; j += 1){
|
|
24187
24489
|
const cell = create.element('td');
|
|
24188
|
-
|
|
24189
|
-
|
|
24490
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.append(cell, create.element('br'));
|
|
24491
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.append(row, cell);
|
|
24190
24492
|
}
|
|
24191
24493
|
} else {
|
|
24192
24494
|
row = line.cloneNode(true);
|
|
24193
|
-
|
|
24194
|
-
if (!
|
|
24495
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.each(line, (cell)=>{
|
|
24496
|
+
if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isCell(cell)) {
|
|
24195
24497
|
return;
|
|
24196
24498
|
}
|
|
24197
|
-
const rowspan = (0,
|
|
24499
|
+
const rowspan = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(cell, 'rowspan');
|
|
24198
24500
|
if (rowspan && parseInt(rowspan, 10) > 1) {
|
|
24199
24501
|
const newRowSpan = parseInt(rowspan, 10) - 1;
|
|
24200
|
-
(0,
|
|
24502
|
+
(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(cell, 'rowspan', newRowSpan > 1 ? newRowSpan : null);
|
|
24201
24503
|
}
|
|
24202
24504
|
});
|
|
24203
|
-
|
|
24204
|
-
if (
|
|
24205
|
-
|
|
24206
|
-
|
|
24505
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.each(row, (cell)=>{
|
|
24506
|
+
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isCell(cell)) {
|
|
24507
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.detach(cell);
|
|
24508
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.append(cell, create.element('br'));
|
|
24207
24509
|
}
|
|
24208
24510
|
});
|
|
24209
24511
|
}
|
|
24210
24512
|
if (after && line && line.nextSibling) {
|
|
24211
|
-
|
|
24513
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.after(line, row);
|
|
24212
24514
|
} else if (!after && line) {
|
|
24213
|
-
|
|
24515
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.before(line, row);
|
|
24214
24516
|
} else {
|
|
24215
|
-
|
|
24517
|
+
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);
|
|
24216
24518
|
}
|
|
24217
24519
|
}
|
|
24218
24520
|
/**
|
|
@@ -24240,7 +24542,7 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
|
|
|
24240
24542
|
while(box[rowIndex + 1][nextCell] === cell){
|
|
24241
24543
|
nextCell += 1;
|
|
24242
24544
|
}
|
|
24243
|
-
const nextRow =
|
|
24545
|
+
const nextRow = jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.next(cell.parentNode, (elm)=>jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isTag(elm, 'tr'), table);
|
|
24244
24546
|
if (nextRow) {
|
|
24245
24547
|
// `box[rowIndex + 1][nextCell]` is the cell that
|
|
24246
24548
|
// logically follows the moved cell in the next row, but
|
|
@@ -24257,21 +24559,21 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
|
|
|
24257
24559
|
}
|
|
24258
24560
|
}
|
|
24259
24561
|
if (referenceCell) {
|
|
24260
|
-
|
|
24562
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.before(referenceCell, cell);
|
|
24261
24563
|
} else {
|
|
24262
|
-
|
|
24564
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.append(nextRow, cell);
|
|
24263
24565
|
}
|
|
24264
24566
|
}
|
|
24265
24567
|
}
|
|
24266
24568
|
} else {
|
|
24267
|
-
|
|
24569
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.safeRemove(cell);
|
|
24268
24570
|
}
|
|
24269
24571
|
if (dec && (cell.parentNode === row || cell !== box[rowIndex][j - 1])) {
|
|
24270
24572
|
const rowSpan = cell.rowSpan;
|
|
24271
|
-
(0,
|
|
24573
|
+
(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(cell, 'rowspan', rowSpan - 1 > 1 ? rowSpan - 1 : null);
|
|
24272
24574
|
}
|
|
24273
24575
|
});
|
|
24274
|
-
|
|
24576
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.safeRemove(row);
|
|
24275
24577
|
}
|
|
24276
24578
|
/**
|
|
24277
24579
|
* Remove row
|
|
@@ -24282,7 +24584,7 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
|
|
|
24282
24584
|
* Insert column before / after all the columns containing the selected cells
|
|
24283
24585
|
*/ appendColumn(table, selectedCell, insertAfter = true) {
|
|
24284
24586
|
const box = Table.__formalMatrix(table);
|
|
24285
|
-
if (!insertAfter &&
|
|
24587
|
+
if (!insertAfter && jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isCell(selectedCell.previousElementSibling)) {
|
|
24286
24588
|
return this.appendColumn(table, selectedCell.previousElementSibling, true);
|
|
24287
24589
|
}
|
|
24288
24590
|
const [, formalCol] = Table.__formalCoordinate(table, selectedCell, insertAfter);
|
|
@@ -24292,11 +24594,11 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
|
|
|
24292
24594
|
const cells = box[i];
|
|
24293
24595
|
if (cells[columnIndex] !== cells[newColumnIndex] || columnIndex === newColumnIndex) {
|
|
24294
24596
|
const cell = this.j.createInside.element('td');
|
|
24295
|
-
|
|
24597
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.append(cell, this.j.createInside.element('br'));
|
|
24296
24598
|
if (insertAfter) {
|
|
24297
|
-
|
|
24599
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.after(cells[columnIndex], cell);
|
|
24298
24600
|
} else {
|
|
24299
|
-
|
|
24601
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.before(cells[columnIndex], cell);
|
|
24300
24602
|
}
|
|
24301
24603
|
if (cells[columnIndex].rowSpan > 1) {
|
|
24302
24604
|
cell.rowSpan = cells[columnIndex].rowSpan;
|
|
@@ -24318,11 +24620,11 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
|
|
|
24318
24620
|
} else if (j + 1 < cells.length && box[i][j + 1] === td) {
|
|
24319
24621
|
dec = true;
|
|
24320
24622
|
} else {
|
|
24321
|
-
|
|
24623
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.safeRemove(td);
|
|
24322
24624
|
}
|
|
24323
24625
|
if (dec && (i - 1 < 0 || td !== box[i - 1][j])) {
|
|
24324
24626
|
const colSpan = td.colSpan;
|
|
24325
|
-
(0,
|
|
24627
|
+
(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(td, 'colspan', colSpan - 1 > 1 ? (colSpan - 1).toString() : null);
|
|
24326
24628
|
}
|
|
24327
24629
|
});
|
|
24328
24630
|
}
|
|
@@ -24399,13 +24701,13 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
|
|
|
24399
24701
|
continue; // broken table
|
|
24400
24702
|
}
|
|
24401
24703
|
if (box[i][j].hasAttribute('rowspan') && box[i][j].rowSpan === 1) {
|
|
24402
|
-
(0,
|
|
24704
|
+
(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(box[i][j], 'rowspan', null);
|
|
24403
24705
|
}
|
|
24404
24706
|
if (box[i][j].hasAttribute('colspan') && box[i][j].colSpan === 1) {
|
|
24405
|
-
(0,
|
|
24707
|
+
(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(box[i][j], 'colspan', null);
|
|
24406
24708
|
}
|
|
24407
|
-
if (box[i][j].hasAttribute('class') && !(0,
|
|
24408
|
-
(0,
|
|
24709
|
+
if (box[i][j].hasAttribute('class') && !(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(box[i][j], 'class')) {
|
|
24710
|
+
(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(box[i][j], 'class', null);
|
|
24409
24711
|
}
|
|
24410
24712
|
}
|
|
24411
24713
|
}
|
|
@@ -24479,10 +24781,10 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
|
|
|
24479
24781
|
return;
|
|
24480
24782
|
}
|
|
24481
24783
|
alreadyMerged.add(td);
|
|
24482
|
-
if (i === bound[0][0] && (0,
|
|
24784
|
+
if (i === bound[0][0] && (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_6__.cssInline)(td, 'width')) {
|
|
24483
24785
|
w += td.offsetWidth;
|
|
24484
24786
|
}
|
|
24485
|
-
if ((0,
|
|
24787
|
+
if ((0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.trim)(cell.innerHTML.replace(/<br(\/)?>/g, '')) !== '') {
|
|
24486
24788
|
html.push(cell.innerHTML);
|
|
24487
24789
|
}
|
|
24488
24790
|
if (cs > 1) {
|
|
@@ -24511,7 +24813,7 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
|
|
|
24511
24813
|
Table.__mark(first, 'rowspan', rows, __marked);
|
|
24512
24814
|
}
|
|
24513
24815
|
if (w) {
|
|
24514
|
-
Table.__mark(first, 'width', (w / table.offsetWidth * 100).toFixed(
|
|
24816
|
+
Table.__mark(first, 'width', (w / table.offsetWidth * 100).toFixed(jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.ACCURACY) + '%', __marked);
|
|
24515
24817
|
if (first_j) {
|
|
24516
24818
|
Table.__setColumnWidthByDelta(table, first_j, 0, true, __marked);
|
|
24517
24819
|
}
|
|
@@ -24521,9 +24823,9 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
|
|
|
24521
24823
|
alreadyMerged.delete(first);
|
|
24522
24824
|
Table.__unmark(__marked);
|
|
24523
24825
|
Table.__normalizeTable(table);
|
|
24524
|
-
(0,
|
|
24826
|
+
(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.toArray)(table.rows).forEach((tr)=>{
|
|
24525
24827
|
if (!tr.cells.length) {
|
|
24526
|
-
|
|
24828
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.safeRemove(tr);
|
|
24527
24829
|
}
|
|
24528
24830
|
});
|
|
24529
24831
|
}
|
|
@@ -24539,7 +24841,7 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
|
|
|
24539
24841
|
const __marked = [];
|
|
24540
24842
|
Table.__getSelectedCellsByTable(table).forEach((cell)=>{
|
|
24541
24843
|
td = jodit.createInside.element('td');
|
|
24542
|
-
|
|
24844
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.append(td, jodit.createInside.element('br'));
|
|
24543
24845
|
tr = jodit.createInside.element('tr');
|
|
24544
24846
|
coord = Table.__formalCoordinate(table, cell);
|
|
24545
24847
|
if (cell.rowSpan < 2) {
|
|
@@ -24548,8 +24850,8 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
|
|
|
24548
24850
|
Table.__mark(tdElm, 'rowspan', tdElm.rowSpan + 1, __marked);
|
|
24549
24851
|
}
|
|
24550
24852
|
});
|
|
24551
|
-
|
|
24552
|
-
|
|
24853
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.after(jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.closest(cell, 'tr', table), tr);
|
|
24854
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.append(tr, td);
|
|
24553
24855
|
} else {
|
|
24554
24856
|
Table.__mark(cell, 'rowspan', cell.rowSpan - 1, __marked);
|
|
24555
24857
|
Table.__formalMatrix(table, (tdElm, i, j)=>{
|
|
@@ -24561,9 +24863,9 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
|
|
|
24561
24863
|
}
|
|
24562
24864
|
});
|
|
24563
24865
|
if (after) {
|
|
24564
|
-
|
|
24866
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.after(after, td);
|
|
24565
24867
|
} else {
|
|
24566
|
-
|
|
24868
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.prepend(parent, td);
|
|
24567
24869
|
}
|
|
24568
24870
|
}
|
|
24569
24871
|
if (cell.colSpan > 1) {
|
|
@@ -24594,15 +24896,15 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
|
|
|
24594
24896
|
Table.__mark(cell, 'colspan', cell.colSpan - 1, __marked);
|
|
24595
24897
|
}
|
|
24596
24898
|
td = jodit.createInside.element('td');
|
|
24597
|
-
|
|
24899
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.append(td, jodit.createInside.element('br'));
|
|
24598
24900
|
if (cell.rowSpan > 1) {
|
|
24599
24901
|
Table.__mark(td, 'rowspan', cell.rowSpan, __marked);
|
|
24600
24902
|
}
|
|
24601
24903
|
const oldWidth = cell.offsetWidth; // get old width
|
|
24602
|
-
|
|
24904
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.after(cell, td);
|
|
24603
24905
|
percentage = oldWidth / table.offsetWidth / 2;
|
|
24604
|
-
Table.__mark(cell, 'width', (percentage * 100).toFixed(
|
|
24605
|
-
Table.__mark(td, 'width', (percentage * 100).toFixed(
|
|
24906
|
+
Table.__mark(cell, 'width', (percentage * 100).toFixed(jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.ACCURACY) + '%', __marked);
|
|
24907
|
+
Table.__mark(td, 'width', (percentage * 100).toFixed(jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.ACCURACY) + '%', __marked);
|
|
24606
24908
|
Table.__unmark(__marked);
|
|
24607
24909
|
instance(jodit).removeSelection(cell);
|
|
24608
24910
|
});
|
|
@@ -24623,7 +24925,7 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
|
|
|
24623
24925
|
}
|
|
24624
24926
|
const w = cell.offsetWidth;
|
|
24625
24927
|
const percent = (w + delta) / table.offsetWidth * 100;
|
|
24626
|
-
Table.__mark(cell, 'width', percent.toFixed(
|
|
24928
|
+
Table.__mark(cell, 'width', percent.toFixed(jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.ACCURACY) + '%', marked);
|
|
24627
24929
|
clearWidthIndex = i;
|
|
24628
24930
|
break;
|
|
24629
24931
|
}
|
|
@@ -24654,22 +24956,22 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
|
|
|
24654
24956
|
const value = dict[key];
|
|
24655
24957
|
switch(key){
|
|
24656
24958
|
case 'remove':
|
|
24657
|
-
|
|
24959
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.safeRemove(cell);
|
|
24658
24960
|
break;
|
|
24659
24961
|
case 'rowspan':
|
|
24660
|
-
(0,
|
|
24962
|
+
(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(cell, 'rowspan', (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.isNumber)(value) && value > 1 ? value : null);
|
|
24661
24963
|
break;
|
|
24662
24964
|
case 'colspan':
|
|
24663
|
-
(0,
|
|
24965
|
+
(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(cell, 'colspan', (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.isNumber)(value) && value > 1 ? value : null);
|
|
24664
24966
|
break;
|
|
24665
24967
|
case 'width':
|
|
24666
24968
|
if (value == null) {
|
|
24667
24969
|
cell.style.removeProperty('width');
|
|
24668
|
-
if (!(0,
|
|
24669
|
-
(0,
|
|
24970
|
+
if (!(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(cell, 'style')) {
|
|
24971
|
+
(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(cell, 'style', null);
|
|
24670
24972
|
}
|
|
24671
24973
|
} else {
|
|
24672
|
-
(0,
|
|
24974
|
+
(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.css)(cell, 'width', value.toString());
|
|
24673
24975
|
}
|
|
24674
24976
|
break;
|
|
24675
24977
|
}
|
|
@@ -24680,13 +24982,23 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
|
|
|
24680
24982
|
});
|
|
24681
24983
|
}
|
|
24682
24984
|
constructor(...args){
|
|
24683
|
-
super(...args), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "selected", new Set())
|
|
24985
|
+
super(...args), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "selected", new Set()), /**
|
|
24986
|
+
* Rewrite the `<style>` that marks the selected cells once for all the
|
|
24987
|
+
* cells (un)selected in one go: a drag over a block of cells unmarks and
|
|
24988
|
+
* marks every one of them on each move. `@debounce()` was never applied,
|
|
24989
|
+
* as a Table never reaches `ready`
|
|
24990
|
+
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__recalculateStyles", this.async.microDebounce(()=>{
|
|
24991
|
+
const style = (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_4__.getContainer)(this.j, Table, 'style', true);
|
|
24992
|
+
const selectors = [];
|
|
24993
|
+
this.selected.forEach((td)=>{
|
|
24994
|
+
const selector = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.cssPath)(td);
|
|
24995
|
+
selector && selectors.push(selector);
|
|
24996
|
+
});
|
|
24997
|
+
style.innerHTML = selectors.length ? selectors.join(',') + `{${this.jodit.options.table.selectionCellStyle}}` : '';
|
|
24998
|
+
}));
|
|
24684
24999
|
}
|
|
24685
25000
|
}
|
|
24686
25001
|
;(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Table, "__selectedByTable", new WeakMap());
|
|
24687
|
-
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
24688
|
-
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_4__.debounce)()
|
|
24689
|
-
], Table.prototype, "__recalculateStyles", null);
|
|
24690
25002
|
const instance = (j)=>j.getInstance('Table', j.o);
|
|
24691
25003
|
|
|
24692
25004
|
|
|
@@ -27886,6 +28198,10 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_3__.pluginSystem.add('backspace', bac
|
|
|
27886
28198
|
mainClosestBox = nextBox;
|
|
27887
28199
|
}
|
|
27888
28200
|
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(mainClosestBox) && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isContentEditable(mainClosestBox, jodit.editor)) {
|
|
28201
|
+
// A table cell is never joined with its neighbour
|
|
28202
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.up(fakeNode, jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isCell, mainClosestBox, true)) {
|
|
28203
|
+
return false;
|
|
28204
|
+
}
|
|
27889
28205
|
const sibling = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.findNotEmptySibling(mainClosestBox, backspace);
|
|
27890
28206
|
// A line break before the cursor is a single unit: remove it instead of
|
|
27891
28207
|
// merging the current element into the (void) `<br>`, which used to move
|
|
@@ -27895,13 +28211,48 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_3__.pluginSystem.add('backspace', bac
|
|
|
27895
28211
|
jodit.s.setCursorBefore(fakeNode);
|
|
27896
28212
|
return true;
|
|
27897
28213
|
}
|
|
27898
|
-
|
|
28214
|
+
// Backspace leaves a block after a table alone, as Word does, rather
|
|
28215
|
+
// than moving its text into the last cell
|
|
28216
|
+
if (backspace && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(sibling, 'table')) {
|
|
28217
|
+
jodit.s.setCursorBefore(fakeNode);
|
|
28218
|
+
return true;
|
|
28219
|
+
}
|
|
28220
|
+
const box = findCaretBox(fakeNode, mainClosestBox);
|
|
28221
|
+
if (sibling && (checkPullNextLine(jodit, fakeNode, box, sibling, backspace) || checkMoveListContent(jodit, box, sibling, backspace) || moveContentAndRemoveEmpty(jodit, box, findEdgeBlock(resolveTableSibling(sibling, backspace), backspace, jodit.editor), backspace))) {
|
|
27899
28222
|
jodit.s.setCursorBefore(fakeNode);
|
|
27900
28223
|
return true;
|
|
27901
28224
|
}
|
|
27902
28225
|
}
|
|
27903
28226
|
return false;
|
|
27904
28227
|
}
|
|
28228
|
+
/**
|
|
28229
|
+
* The block holding the caret inside the box that has the sibling, so
|
|
28230
|
+
* `<p>one</p><div><p>|two</p></div>` joins the two paragraphs instead of
|
|
28231
|
+
* moving the whole `<div>` into the first one. For a list item that is its
|
|
28232
|
+
* list, which the list cases handle.
|
|
28233
|
+
*/ function findCaretBox(fakeNode, mainClosestBox) {
|
|
28234
|
+
const block = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.up(fakeNode, jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock, mainClosestBox);
|
|
28235
|
+
if (!block) {
|
|
28236
|
+
return mainClosestBox;
|
|
28237
|
+
}
|
|
28238
|
+
return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isLeaf(block) && block.parentElement ? block.parentElement : block;
|
|
28239
|
+
}
|
|
28240
|
+
/**
|
|
28241
|
+
* The innermost block on the sibling's edge facing the caret, so the
|
|
28242
|
+
* content is joined to text: `<div><p>one</p></div><p>|two</p>` gives
|
|
28243
|
+
* `<div><p>one|two</p></div>`
|
|
28244
|
+
*/ function findEdgeBlock(sibling, backspace, root) {
|
|
28245
|
+
let block = sibling;
|
|
28246
|
+
while(block){
|
|
28247
|
+
const edge = backspace ? block.lastChild : block.firstChild;
|
|
28248
|
+
const child = edge && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmptyTextNode(edge) ? jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.findNotEmptySibling(edge, backspace) : edge;
|
|
28249
|
+
if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(child) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(child, jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INSEPARABLE_TAGS) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(child, 'table') || !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isContentEditable(child, root)) {
|
|
28250
|
+
return block;
|
|
28251
|
+
}
|
|
28252
|
+
block = child;
|
|
28253
|
+
}
|
|
28254
|
+
return block;
|
|
28255
|
+
}
|
|
27905
28256
|
/**
|
|
27906
28257
|
* Content cannot be merged into the `<table>` element itself — it would land
|
|
27907
28258
|
* between the table sections (after `</tbody>`), which is invalid HTML and
|
|
@@ -27918,6 +28269,40 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_3__.pluginSystem.add('backspace', bac
|
|
|
27918
28269
|
});
|
|
27919
28270
|
return cells.length ? cells[backspace ? cells.length - 1 : 0] : null;
|
|
27920
28271
|
}
|
|
28272
|
+
/**
|
|
28273
|
+
* Delete at the edge of a list pulls the next line up to the caret, as the
|
|
28274
|
+
* browsers do, instead of moving the caret's line into the next block:
|
|
28275
|
+
* `<ul><li>one|</li></ul><p>two</p>` gives `<ul><li>one|two</li></ul>`, and
|
|
28276
|
+
* `<p>one|</p><ul><li>two</li></ul>` gives `<p>one|two</p>`
|
|
28277
|
+
* @private
|
|
28278
|
+
*/ function checkPullNextLine(jodit, fakeNode, box, sibling, backspace) {
|
|
28279
|
+
if (backspace || !(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isList(box) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isList(sibling))) {
|
|
28280
|
+
return false;
|
|
28281
|
+
}
|
|
28282
|
+
const target = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.up(fakeNode, jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock, box, true);
|
|
28283
|
+
const source = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isList(sibling) ? sibling.firstElementChild : sibling;
|
|
28284
|
+
if (!target || !source || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(source, jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INSEPARABLE_TAGS) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(source, 'table')) {
|
|
28285
|
+
return false;
|
|
28286
|
+
}
|
|
28287
|
+
if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(source)) {
|
|
28288
|
+
const line = [];
|
|
28289
|
+
for(let node = source.firstChild; node && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(node); node = node.nextSibling){
|
|
28290
|
+
line.push(node);
|
|
28291
|
+
}
|
|
28292
|
+
if (!line.length) {
|
|
28293
|
+
return false;
|
|
28294
|
+
}
|
|
28295
|
+
const filter = (0,jodit_plugins_backspace_helpers__WEBPACK_IMPORTED_MODULE_2__.getMoveFilter)(jodit);
|
|
28296
|
+
line.forEach((node)=>filter(node) ? jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(target, node) : jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(node));
|
|
28297
|
+
}
|
|
28298
|
+
let remove = source;
|
|
28299
|
+
while(remove && remove !== jodit.editor && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(remove)){
|
|
28300
|
+
const parent = remove.parentElement;
|
|
28301
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(remove);
|
|
28302
|
+
remove = parent;
|
|
28303
|
+
}
|
|
28304
|
+
return true;
|
|
28305
|
+
}
|
|
27921
28306
|
function checkMoveListContent(jodit, mainClosestBox, sibling, backspace) {
|
|
27922
28307
|
// Process UL/LI/OL cases
|
|
27923
28308
|
const siblingIsList = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(sibling, jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.LIST_TAGS);
|
|
@@ -28068,9 +28453,10 @@ function moveContentAndRemoveEmpty(jodit, mainClosestBox, sibling, backspace) {
|
|
|
28068
28453
|
* ```html
|
|
28069
28454
|
* t|st
|
|
28070
28455
|
* ```
|
|
28456
|
+
* With `stopBeforeSpace`, nothing is removed when the next char is a space.
|
|
28071
28457
|
* @private
|
|
28072
28458
|
*/ // eslint-disable-next-line complexity
|
|
28073
|
-
function checkRemoveChar(jodit, fakeNode, backspace, mode) {
|
|
28459
|
+
function checkRemoveChar(jodit, fakeNode, backspace, mode, stopBeforeSpace = false) {
|
|
28074
28460
|
const step = backspace ? -1 : 1;
|
|
28075
28461
|
const anotherSibling = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.sibling(fakeNode, !backspace);
|
|
28076
28462
|
let sibling = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.sibling(fakeNode, backspace);
|
|
@@ -28088,6 +28474,9 @@ function checkRemoveChar(jodit, fakeNode, backspace, mode) {
|
|
|
28088
28474
|
break;
|
|
28089
28475
|
}
|
|
28090
28476
|
if (sibling.nodeValue?.length) {
|
|
28477
|
+
if (stopBeforeSpace && isSpace(nextChar(sibling.nodeValue, backspace))) {
|
|
28478
|
+
break;
|
|
28479
|
+
}
|
|
28091
28480
|
removed = tryRemoveChar(sibling, backspace, step, anotherSibling);
|
|
28092
28481
|
if (!sibling.nodeValue.length && jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isInlineBlock(sibling.parentNode)) {
|
|
28093
28482
|
sibling.nodeValue = jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE;
|
|
@@ -28194,9 +28583,25 @@ function replaceSpaceOnNBSP(anotherSibling, backspace, value) {
|
|
|
28194
28583
|
}
|
|
28195
28584
|
function checkRepeatRemoveCharAction(backspace, sibling, fakeNode, mode, removed, jodit) {
|
|
28196
28585
|
;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.call)(backspace ? jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.after : jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.before, sibling, fakeNode);
|
|
28197
|
-
|
|
28198
|
-
|
|
28586
|
+
const wordChar = mode === 'word' && !isSpace(removed);
|
|
28587
|
+
// Backspace by word removes the spaces before the caret, then the word, and keeps the space in front of it
|
|
28588
|
+
if (mode === 'sentence' || wordChar || mode === 'word' && backspace) {
|
|
28589
|
+
checkRemoveChar(jodit, fakeNode, backspace, mode, wordChar && backspace);
|
|
28590
|
+
}
|
|
28591
|
+
}
|
|
28592
|
+
/**
|
|
28593
|
+
* The char tryRemoveChar would remove next
|
|
28594
|
+
*/ function nextChar(value, backspace) {
|
|
28595
|
+
const chars = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.toArray)(value);
|
|
28596
|
+
const step = backspace ? -1 : 1;
|
|
28597
|
+
let index = backspace ? chars.length - 1 : 0;
|
|
28598
|
+
while(chars[index] === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE){
|
|
28599
|
+
index += step;
|
|
28199
28600
|
}
|
|
28601
|
+
return chars[index];
|
|
28602
|
+
}
|
|
28603
|
+
function isSpace(char) {
|
|
28604
|
+
return char === ' ' || char === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.NBSP_SPACE;
|
|
28200
28605
|
}
|
|
28201
28606
|
|
|
28202
28607
|
|
|
@@ -28580,7 +28985,8 @@ function checkRepeatRemoveCharAction(backspace, sibling, fakeNode, mode, removed
|
|
|
28580
28985
|
/***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
|
|
28581
28986
|
|
|
28582
28987
|
"use strict";
|
|
28583
|
-
/* harmony import */ var
|
|
28988
|
+
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
|
|
28989
|
+
/* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5266);
|
|
28584
28990
|
/*!
|
|
28585
28991
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
28586
28992
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -28588,13 +28994,18 @@ function checkRepeatRemoveCharAction(backspace, sibling, fakeNode, mode, removed
|
|
|
28588
28994
|
*/ /**
|
|
28589
28995
|
* @module plugins/backspace
|
|
28590
28996
|
*/
|
|
28591
|
-
|
|
28997
|
+
|
|
28998
|
+
jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.delete = {
|
|
28592
28999
|
hotkeys: {
|
|
28593
|
-
delete: [
|
|
29000
|
+
delete: jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.IS_MAC ? [
|
|
29001
|
+
'delete'
|
|
29002
|
+
] : [
|
|
28594
29003
|
'delete',
|
|
28595
29004
|
'cmd+backspace'
|
|
28596
29005
|
],
|
|
28597
|
-
deleteWord: [
|
|
29006
|
+
deleteWord: jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.IS_MAC ? [
|
|
29007
|
+
'ctrl+delete'
|
|
29008
|
+
] : [
|
|
28598
29009
|
'ctrl+delete',
|
|
28599
29010
|
'cmd+alt+backspace',
|
|
28600
29011
|
'ctrl+alt+backspace'
|
|
@@ -28606,7 +29017,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.delete = {
|
|
|
28606
29017
|
backspace: [
|
|
28607
29018
|
'backspace'
|
|
28608
29019
|
],
|
|
28609
|
-
backspaceWord: [
|
|
29020
|
+
backspaceWord: jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.IS_MAC ? [] : [
|
|
28610
29021
|
'ctrl+backspace'
|
|
28611
29022
|
],
|
|
28612
29023
|
backspaceSentence: [
|
|
@@ -29022,6 +29433,18 @@ class cleanHtml extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_7__.Pl
|
|
|
29022
29433
|
this.walker.setWork(editor.editor);
|
|
29023
29434
|
this.currentSelectionNode = editor.s.current();
|
|
29024
29435
|
}
|
|
29436
|
+
/**
|
|
29437
|
+
* Typing into an empty block (`<p><br></p>`) replaces its `<br>`, but the
|
|
29438
|
+
* browser keeps the `<br>` when the caret is in an invisible-space text
|
|
29439
|
+
* node in front of it, as Jodit leaves the caret in many of the empty
|
|
29440
|
+
* blocks it makes (a cleared editor, a heading in an empty table cell).
|
|
29441
|
+
* See #1632
|
|
29442
|
+
*/ onInputRemovePlaceholderBr(event) {
|
|
29443
|
+
if (!this.isEditMode || event.type === 'input' && (event.isComposing || !event.inputType?.startsWith('insert'))) {
|
|
29444
|
+
return;
|
|
29445
|
+
}
|
|
29446
|
+
;(0,_helpers__WEBPACK_IMPORTED_MODULE_10__.removePlaceholderBr)(this.j);
|
|
29447
|
+
}
|
|
29025
29448
|
startWalker() {
|
|
29026
29449
|
const { jodit } = this;
|
|
29027
29450
|
const allow = (0,_helpers__WEBPACK_IMPORTED_MODULE_10__.getHash)(this.j.o.cleanHTML.allowTags);
|
|
@@ -29190,6 +29613,12 @@ class cleanHtml extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_7__.Pl
|
|
|
29190
29613
|
':keydown'
|
|
29191
29614
|
])
|
|
29192
29615
|
], cleanHtml.prototype, "onChangeCleanHTML", null);
|
|
29616
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
29617
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.watch)([
|
|
29618
|
+
':input',
|
|
29619
|
+
'jodit.editor:compositionend'
|
|
29620
|
+
])
|
|
29621
|
+
], cleanHtml.prototype, "onInputRemovePlaceholderBr", null);
|
|
29193
29622
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
29194
29623
|
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.hook)('ready')
|
|
29195
29624
|
], cleanHtml.prototype, "startWalker", null);
|
|
@@ -29328,12 +29757,14 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.controls.eraser = {
|
|
|
29328
29757
|
/* harmony export */ getHash: function() { return /* reexport safe */ _get_hash__WEBPACK_IMPORTED_MODULE_0__.getHash; },
|
|
29329
29758
|
/* harmony export */ removeFormatForCollapsedSelection: function() { return /* reexport safe */ _remove_format_remove_format_for_collapsed_selection__WEBPACK_IMPORTED_MODULE_1__.removeFormatForCollapsedSelection; },
|
|
29330
29759
|
/* harmony export */ removeFormatForSelection: function() { return /* reexport safe */ _remove_format_remove_format_for_selection__WEBPACK_IMPORTED_MODULE_2__.removeFormatForSelection; },
|
|
29331
|
-
/* harmony export */
|
|
29760
|
+
/* harmony export */ removePlaceholderBr: function() { return /* reexport safe */ _remove_placeholder_br__WEBPACK_IMPORTED_MODULE_3__.removePlaceholderBr; },
|
|
29761
|
+
/* harmony export */ visitNodeWalker: function() { return /* reexport safe */ _visitor_visit_node_walker__WEBPACK_IMPORTED_MODULE_4__.visitNodeWalker; }
|
|
29332
29762
|
/* harmony export */ });
|
|
29333
29763
|
/* harmony import */ var _get_hash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5650);
|
|
29334
29764
|
/* harmony import */ var _remove_format_remove_format_for_collapsed_selection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(37431);
|
|
29335
29765
|
/* harmony import */ var _remove_format_remove_format_for_selection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(70195);
|
|
29336
|
-
/* harmony import */ var
|
|
29766
|
+
/* harmony import */ var _remove_placeholder_br__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(53626);
|
|
29767
|
+
/* harmony import */ var _visitor_visit_node_walker__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(45219);
|
|
29337
29768
|
/*!
|
|
29338
29769
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
29339
29770
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -29347,6 +29778,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.controls.eraser = {
|
|
|
29347
29778
|
|
|
29348
29779
|
|
|
29349
29780
|
|
|
29781
|
+
|
|
29350
29782
|
/***/ }),
|
|
29351
29783
|
|
|
29352
29784
|
/***/ 28665:
|
|
@@ -29506,6 +29938,64 @@ const VIMEO_EMBED = /^(https?:)?\/\/player\.vimeo\.com\/video\//i;
|
|
|
29506
29938
|
}
|
|
29507
29939
|
|
|
29508
29940
|
|
|
29941
|
+
/***/ }),
|
|
29942
|
+
|
|
29943
|
+
/***/ 53626:
|
|
29944
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
29945
|
+
|
|
29946
|
+
"use strict";
|
|
29947
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
29948
|
+
/* harmony export */ removePlaceholderBr: function() { return /* binding */ removePlaceholderBr; }
|
|
29949
|
+
/* harmony export */ });
|
|
29950
|
+
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
|
|
29951
|
+
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
|
|
29952
|
+
/* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4040);
|
|
29953
|
+
/*!
|
|
29954
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
29955
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
29956
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
29957
|
+
*/ /**
|
|
29958
|
+
* @module plugins/clean-html
|
|
29959
|
+
*/
|
|
29960
|
+
|
|
29961
|
+
|
|
29962
|
+
function lastNode(node) {
|
|
29963
|
+
let last = node.lastChild;
|
|
29964
|
+
while(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isText(last) && !last.nodeValue){
|
|
29965
|
+
last = last.previousSibling;
|
|
29966
|
+
}
|
|
29967
|
+
return last;
|
|
29968
|
+
}
|
|
29969
|
+
/**
|
|
29970
|
+
* Remove the `<br>` that kept the block with the caret open while it was
|
|
29971
|
+
* empty, once text has gone into the block: when the block is one line of
|
|
29972
|
+
* text that ends in that `<br>`, the `<br>` adds nothing to it
|
|
29973
|
+
* @private
|
|
29974
|
+
*/ function removePlaceholderBr(jodit) {
|
|
29975
|
+
const block = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(jodit.s.current(), jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock, jodit.editor);
|
|
29976
|
+
if (!block || !(0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_2__.trim)(block.textContent ?? '')) {
|
|
29977
|
+
return;
|
|
29978
|
+
}
|
|
29979
|
+
let br = lastNode(block);
|
|
29980
|
+
while(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(br) && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(br, jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INSEPARABLE_TAGS) && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(br)){
|
|
29981
|
+
br = lastNode(br);
|
|
29982
|
+
}
|
|
29983
|
+
if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(br, 'br')) {
|
|
29984
|
+
return;
|
|
29985
|
+
}
|
|
29986
|
+
// Another line break, a block, an image or an embed means the `<br>` may
|
|
29987
|
+
// end an empty line, or give the caret a place after the embed
|
|
29988
|
+
const isOneLineOfText = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.each(block, (node)=>{
|
|
29989
|
+
if (node !== br && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(node) && (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(node, jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INSEPARABLE_TAGS) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(node) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isHTMLElement(node) && !node.isContentEditable)) {
|
|
29990
|
+
return false;
|
|
29991
|
+
}
|
|
29992
|
+
});
|
|
29993
|
+
if (isOneLineOfText) {
|
|
29994
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(br);
|
|
29995
|
+
}
|
|
29996
|
+
}
|
|
29997
|
+
|
|
29998
|
+
|
|
29509
29999
|
/***/ }),
|
|
29510
30000
|
|
|
29511
30001
|
/***/ 95559:
|
|
@@ -30836,6 +31326,11 @@ class deleteCommand extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__.Plugi
|
|
|
30836
31326
|
}
|
|
30837
31327
|
jodit.s.expandSelection();
|
|
30838
31328
|
const range = jodit.s.range;
|
|
31329
|
+
const caret = this.__clearSelectedCells(range);
|
|
31330
|
+
if (caret && range.collapsed) {
|
|
31331
|
+
jodit.s.selectRange(caret);
|
|
31332
|
+
return false;
|
|
31333
|
+
}
|
|
30839
31334
|
range.deleteContents();
|
|
30840
31335
|
const fake = jodit.createInside.fake();
|
|
30841
31336
|
range.insertNode(fake);
|
|
@@ -30845,21 +31340,98 @@ class deleteCommand extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__.Plugi
|
|
|
30845
31340
|
range.setStartBefore(fake);
|
|
30846
31341
|
range.collapse(true);
|
|
30847
31342
|
this.__moveCursorInEditableSibling(jodit, leftSibling, fake, range);
|
|
30848
|
-
this.__addBrInEmptyBlock(fake,
|
|
31343
|
+
this.__addBrInEmptyBlock(fake, range);
|
|
30849
31344
|
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(fake);
|
|
30850
|
-
jodit.s.selectRange(range);
|
|
31345
|
+
jodit.s.selectRange(caret ?? range);
|
|
30851
31346
|
return false;
|
|
30852
31347
|
}
|
|
31348
|
+
/**
|
|
31349
|
+
* A selection that starts or ends in a table cell clears the selected part
|
|
31350
|
+
* of each cell it covers and keeps the cells, as the browsers do.
|
|
31351
|
+
* `deleteContents` would remove the cells it fully covers, and the cells
|
|
31352
|
+
* it cuts would then be merged as blocks. The range is moved out of those
|
|
31353
|
+
* tables, so only the content between them is left to delete.
|
|
31354
|
+
*
|
|
31355
|
+
* Returns where the caret goes, or null when no table is involved
|
|
31356
|
+
*/ __clearSelectedCells(range) {
|
|
31357
|
+
const { editor, createInside } = this.j;
|
|
31358
|
+
const startCell = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(range.startContainer, jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isCell, editor);
|
|
31359
|
+
const endCell = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(range.endContainer, jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isCell, editor);
|
|
31360
|
+
if (startCell === endCell) {
|
|
31361
|
+
return null;
|
|
31362
|
+
}
|
|
31363
|
+
const startTable = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(startCell, 'table', editor);
|
|
31364
|
+
const endTable = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(endCell, 'table', editor);
|
|
31365
|
+
const caret = range.cloneRange();
|
|
31366
|
+
caret.collapse(true);
|
|
31367
|
+
const parts = [];
|
|
31368
|
+
const addParts = (table)=>{
|
|
31369
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.toArray)(table.rows).flatMap((row)=>(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.toArray)(row.cells)).filter((cell)=>range.intersectsNode(cell)).forEach((cell)=>{
|
|
31370
|
+
const part = range.cloneRange();
|
|
31371
|
+
if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isOrContains(cell, range.startContainer)) {
|
|
31372
|
+
part.setStart(cell, 0);
|
|
31373
|
+
}
|
|
31374
|
+
if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isOrContains(cell, range.endContainer)) {
|
|
31375
|
+
part.setEnd(cell, cell.childNodes.length);
|
|
31376
|
+
}
|
|
31377
|
+
parts.push([
|
|
31378
|
+
cell,
|
|
31379
|
+
part
|
|
31380
|
+
]);
|
|
31381
|
+
});
|
|
31382
|
+
};
|
|
31383
|
+
if (startTable) {
|
|
31384
|
+
addParts(startTable);
|
|
31385
|
+
if (startTable === endTable) {
|
|
31386
|
+
range.collapse(true);
|
|
31387
|
+
} else {
|
|
31388
|
+
range.setStartAfter(startTable);
|
|
31389
|
+
}
|
|
31390
|
+
}
|
|
31391
|
+
if (endTable && endTable !== startTable) {
|
|
31392
|
+
addParts(endTable);
|
|
31393
|
+
range.setEndBefore(endTable);
|
|
31394
|
+
}
|
|
31395
|
+
parts.forEach(([cell, part])=>{
|
|
31396
|
+
part.deleteContents();
|
|
31397
|
+
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(cell)) {
|
|
31398
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.detach(cell);
|
|
31399
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(cell, createInside.element('br'));
|
|
31400
|
+
}
|
|
31401
|
+
});
|
|
31402
|
+
return startTable ? caret : null;
|
|
31403
|
+
}
|
|
30853
31404
|
__moveContentInLeftSibling(fake, leftSibling, rightSibling) {
|
|
30854
31405
|
leftSibling = this.__defineRightLeftBox(leftSibling);
|
|
31406
|
+
// Nothing is moved into a table, and a block left empty after it goes
|
|
31407
|
+
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(leftSibling, 'table')) {
|
|
31408
|
+
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(rightSibling) && jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(rightSibling)) {
|
|
31409
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(rightSibling);
|
|
31410
|
+
}
|
|
31411
|
+
return;
|
|
31412
|
+
}
|
|
30855
31413
|
if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isList(rightSibling) && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(rightSibling, 'table') && jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(rightSibling) && jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(leftSibling)) {
|
|
30856
31414
|
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(leftSibling, fake);
|
|
30857
31415
|
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.moveContent(rightSibling, leftSibling);
|
|
30858
31416
|
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(rightSibling);
|
|
30859
31417
|
}
|
|
30860
|
-
|
|
30861
|
-
|
|
30862
|
-
|
|
31418
|
+
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isList(rightSibling) && jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isLeaf(rightSibling.firstElementChild)) {
|
|
31419
|
+
const item = rightSibling.firstElementChild;
|
|
31420
|
+
// What's left of the right list's first item joins the left block,
|
|
31421
|
+
// up to a list nested in the item
|
|
31422
|
+
if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(item) && jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(leftSibling)) {
|
|
31423
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(leftSibling, fake);
|
|
31424
|
+
while(item.firstChild && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(item.firstChild)){
|
|
31425
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(leftSibling, item.firstChild);
|
|
31426
|
+
}
|
|
31427
|
+
}
|
|
31428
|
+
// Remove empty right LI
|
|
31429
|
+
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(item)) {
|
|
31430
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(item);
|
|
31431
|
+
}
|
|
31432
|
+
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(rightSibling)) {
|
|
31433
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(rightSibling);
|
|
31434
|
+
}
|
|
30863
31435
|
}
|
|
30864
31436
|
}
|
|
30865
31437
|
/**
|
|
@@ -30876,8 +31448,8 @@ class deleteCommand extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__.Plugi
|
|
|
30876
31448
|
return lastLeaf;
|
|
30877
31449
|
}
|
|
30878
31450
|
/**
|
|
30879
|
-
* Add BR in empty
|
|
30880
|
-
*/ __addBrInEmptyBlock(fake,
|
|
31451
|
+
* Add BR in the empty block left at the caret
|
|
31452
|
+
*/ __addBrInEmptyBlock(fake, range) {
|
|
30881
31453
|
const jodit = this.j;
|
|
30882
31454
|
if (fake.isConnected && jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(fake.parentNode) && !fake.nextSibling && !fake.previousSibling) {
|
|
30883
31455
|
const br = jodit.createInside.element('br');
|
|
@@ -30885,13 +31457,6 @@ class deleteCommand extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__.Plugi
|
|
|
30885
31457
|
range.setStartBefore(br);
|
|
30886
31458
|
range.collapse(true);
|
|
30887
31459
|
}
|
|
30888
|
-
// Add BR in the right empty table cell
|
|
30889
|
-
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(rightSibling, 'table')) {
|
|
30890
|
-
const firstCell = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.$$)('td,th', rightSibling).shift();
|
|
30891
|
-
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isCell(firstCell) && jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(firstCell)) {
|
|
30892
|
-
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(firstCell, jodit.createInside.element('br'));
|
|
30893
|
-
}
|
|
30894
|
-
}
|
|
30895
31460
|
}
|
|
30896
31461
|
__moveCursorInEditableSibling(jodit, leftSibling, fake, range) {
|
|
30897
31462
|
if (!leftSibling || !jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isText(leftSibling)) {
|
|
@@ -32382,7 +32947,18 @@ function focus(editor) {
|
|
|
32382
32947
|
editor.e.on('afterInit', ()=>{
|
|
32383
32948
|
if (editor.o.autofocus) {
|
|
32384
32949
|
if (editor.defaultTimeout) {
|
|
32385
|
-
editor
|
|
32950
|
+
// A click or key in the editor during the delay has put the
|
|
32951
|
+
// caret where the user wants it, so autofocus leaves it there
|
|
32952
|
+
const userInput = 'mousedown touchstart keydown';
|
|
32953
|
+
const cancel = ()=>{
|
|
32954
|
+
editor.async.clearTimeout(timeout);
|
|
32955
|
+
editor.e.off(userInput, cancel);
|
|
32956
|
+
};
|
|
32957
|
+
const timeout = editor.async.setTimeout(()=>{
|
|
32958
|
+
editor.e.off(userInput, cancel);
|
|
32959
|
+
focus();
|
|
32960
|
+
}, 300);
|
|
32961
|
+
editor.e.on(userInput, cancel);
|
|
32386
32962
|
} else {
|
|
32387
32963
|
focus();
|
|
32388
32964
|
}
|
|
@@ -33606,7 +34182,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeBaseUrl = '';
|
|
|
33606
34182
|
jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeTitle = 'Jodit Editor';
|
|
33607
34183
|
jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeDoctype = '<!DOCTYPE html>';
|
|
33608
34184
|
jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeDefaultSrc = 'about:blank';
|
|
33609
|
-
jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeStyle = 'html{' + 'margin:0;' + 'padding:0;' + 'min-height: 100%;' + '}' + 'body{' + 'box-sizing:border-box;' + 'font-size:13px;' + 'line-height:1.6;' + 'padding:10px;' + 'margin:0;' + 'background:transparent;' + 'color:#000;' + 'position:' + 'relative;' + 'z-index:2;' + 'user-select:auto;' + 'margin:0px;' + 'overflow:auto;' + 'outline:none;' + '}' + 'table{' + 'width:100%;' + 'border:none;' + 'border-collapse:collapse;' + 'empty-cells: show;' + 'max-width: 100%;' + '}' + 'th,td{' + 'padding: 2px 5px;' + 'border:1px solid #ccc;' + '-webkit-user-select:text;' + '-moz-user-select:text;' + '-ms-user-select:text;' + 'user-select:text' + '}' + 'p{' + 'margin-top:0;' + '}' + '
|
|
34185
|
+
jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeStyle = 'html{' + 'margin:0;' + 'padding:0;' + 'min-height: 100%;' + '}' + 'body{' + 'box-sizing:border-box;' + 'font-size:13px;' + 'line-height:1.6;' + 'padding:10px;' + 'margin:0;' + 'background:transparent;' + 'color:#000;' + 'position:' + 'relative;' + 'z-index:2;' + 'user-select:auto;' + 'margin:0px;' + 'overflow:auto;' + 'outline:none;' + '}' + 'table{' + 'width:100%;' + 'border:none;' + 'border-collapse:collapse;' + 'empty-cells: show;' + 'max-width: 100%;' + '}' + 'th,td{' + 'padding: 2px 5px;' + 'border:1px solid #ccc;' + '-webkit-user-select:text;' + '-moz-user-select:text;' + '-ms-user-select:text;' + 'user-select:text' + '}' + 'p{' + 'margin-top:0;' + '}' + '.jodit_disabled{' + 'user-select: none;' + '-o-user-select: none;' + '-moz-user-select: none;' + '-khtml-user-select: none;' + '-webkit-user-select: none;' + '-ms-user-select: none' + '}';
|
|
33610
34186
|
jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeCSSLinks = [];
|
|
33611
34187
|
jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeSandbox = null;
|
|
33612
34188
|
|
|
@@ -33657,6 +34233,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeSandbox = null;
|
|
|
33657
34233
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.attr)(link, 'rel', 'stylesheet');
|
|
33658
34234
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.attr)(link, 'href', href);
|
|
33659
34235
|
doc.head && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(doc.head, link);
|
|
34236
|
+
// What plugins measured in the editing document changes once it's styled
|
|
34237
|
+
jodit.e.on(link, 'load', ()=>jodit.e.fire('resize'));
|
|
33660
34238
|
});
|
|
33661
34239
|
}
|
|
33662
34240
|
if (opt.iframeStyle) {
|
|
@@ -33694,6 +34272,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeSandbox = null;
|
|
|
33694
34272
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.attr)(doc.body, 'contenteditable', editor.getMode() !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.MODE_SOURCE && !editor.getReadOnly() || null);
|
|
33695
34273
|
};
|
|
33696
34274
|
const clearMarkers = (html)=>{
|
|
34275
|
+
// The plugins' own styles, from `getContainer`, aren't part of the value
|
|
34276
|
+
html = html.replace(/<style[^>]+jodit-box[^>]*>[\s\S]*?<\/style>/gi, '');
|
|
33697
34277
|
const bodyReg = /<body.*<\/body>/im, bodyMarker = '{%%BODY%%}', body = bodyReg.exec(html);
|
|
33698
34278
|
if (body) {
|
|
33699
34279
|
// remove markers
|
|
@@ -33718,7 +34298,10 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeSandbox = null;
|
|
|
33718
34298
|
*/ const replaceDocument = (html)=>{
|
|
33719
34299
|
const inert = new DOMParser().parseFromString(html, 'text/html');
|
|
33720
34300
|
editor.e.fire('safeHTML', inert.documentElement);
|
|
34301
|
+
// The plugins' own styles stay, as the value leaves them out
|
|
34302
|
+
const styles = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.$$)('style.jodit-box', doc.head);
|
|
33721
34303
|
doc.replaceChild(doc.adoptNode(inert.documentElement), doc.documentElement);
|
|
34304
|
+
styles.forEach((style)=>jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(doc.head, style));
|
|
33722
34305
|
};
|
|
33723
34306
|
if (docMode) {
|
|
33724
34307
|
const tag = editor.element.tagName;
|
|
@@ -33848,7 +34431,6 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.imageProcessor = {
|
|
|
33848
34431
|
|
|
33849
34432
|
|
|
33850
34433
|
|
|
33851
|
-
|
|
33852
34434
|
const JODIT_IMAGE_PROCESSOR_BINDED = '__jodit_imageprocessor_binded';
|
|
33853
34435
|
const JODIT_IMAGE_BLOB_ID = JODIT_IMAGE_PROCESSOR_BINDED + 'blob-id';
|
|
33854
34436
|
const IMAGE_SELECTED = 'jodit-wysiwyg_image-selected';
|
|
@@ -33862,6 +34444,9 @@ const SELECTED_TAGS = new Set([
|
|
|
33862
34444
|
*/ class imageProcessor extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__.Plugin {
|
|
33863
34445
|
afterInit(jodit) {
|
|
33864
34446
|
jodit.e.on(jodit.ed, 'selectionchange', this.onSelectionChange);
|
|
34447
|
+
// Over the highlight in `styles/reset.less`; the image keeps its own. It goes
|
|
34448
|
+
// in the editing document, so iframe mode has it whatever `iframeStyle` holds
|
|
34449
|
+
(0,jodit_core_global__WEBPACK_IMPORTED_MODULE_4__.getContainer)(jodit, 'image-processor', 'style', true).textContent = `.jodit-wysiwyg.${IMAGE_SELECTED}::selection,` + `.jodit-wysiwyg.${IMAGE_SELECTED} *:not(img)::selection{background:transparent}`;
|
|
33865
34450
|
}
|
|
33866
34451
|
beforeDestruct(jodit) {
|
|
33867
34452
|
jodit.e.off(jodit.ed, 'selectionchange', this.onSelectionChange);
|
|
@@ -34118,8 +34703,12 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.image = {
|
|
|
34118
34703
|
dialog.close();
|
|
34119
34704
|
});
|
|
34120
34705
|
buttons.remove.onAction(()=>{
|
|
34706
|
+
const caret = j.s.createRange();
|
|
34707
|
+
caret.setStartBefore(this.state.sourceImage);
|
|
34708
|
+
caret.collapse(true);
|
|
34121
34709
|
j.s.removeNode(this.state.sourceImage);
|
|
34122
34710
|
dialog.close();
|
|
34711
|
+
j.s.selectRange(caret);
|
|
34123
34712
|
});
|
|
34124
34713
|
buttons.cancel.onAction(()=>{
|
|
34125
34714
|
dialog.close();
|
|
@@ -34133,10 +34722,20 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.image = {
|
|
|
34133
34722
|
],
|
|
34134
34723
|
buttons.check
|
|
34135
34724
|
]);
|
|
34136
|
-
|
|
34137
|
-
|
|
34138
|
-
|
|
34725
|
+
// The dialog fires `afterClose` on its own emitter, not the editor's
|
|
34726
|
+
dialog.e.on(dialog, 'afterClose', ()=>{
|
|
34727
|
+
const { sourceImage } = this.state;
|
|
34728
|
+
if (j.isInDestruct || !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isOrContains(j.editor, sourceImage)) {
|
|
34729
|
+
return;
|
|
34139
34730
|
}
|
|
34731
|
+
if (j.o.image.selectImageAfterClose) {
|
|
34732
|
+
j.s.select(sourceImage);
|
|
34733
|
+
return;
|
|
34734
|
+
}
|
|
34735
|
+
const caret = j.s.createRange();
|
|
34736
|
+
caret.setStartAfter(sourceImage);
|
|
34737
|
+
caret.collapse(true);
|
|
34738
|
+
j.s.selectRange(caret);
|
|
34140
34739
|
});
|
|
34141
34740
|
dialog.setSize(j.o.image.dialogWidth);
|
|
34142
34741
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.markOwner)(j, dialog.container);
|
|
@@ -34167,6 +34766,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.image = {
|
|
|
34167
34766
|
this.activeTabState.activeTab = 'Image';
|
|
34168
34767
|
this.__lock();
|
|
34169
34768
|
this.dialog.open().setModal(true).setPosition();
|
|
34769
|
+
this.__focusFirstField();
|
|
34170
34770
|
this.async.promise((resolve, reject)=>(0,_readers__WEBPACK_IMPORTED_MODULE_12__.readValuesFromImage)(this.j, this.state).then(resolve, reject)).catch((e)=>{
|
|
34171
34771
|
if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isAbortError)(e)) {
|
|
34172
34772
|
this.dialog.message.error(e.message);
|
|
@@ -34174,6 +34774,13 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.image = {
|
|
|
34174
34774
|
}).finally(()=>this.__unlock());
|
|
34175
34775
|
return false;
|
|
34176
34776
|
}
|
|
34777
|
+
/**
|
|
34778
|
+
* Keys typed while the dialog is open must not reach the editor behind it,
|
|
34779
|
+
* so focus the active tab's first field, or else the first field shown
|
|
34780
|
+
*/ __focusFirstField() {
|
|
34781
|
+
const fields = (box)=>(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.toArray)(box.querySelectorAll('input, select, textarea'));
|
|
34782
|
+
fields(this.form.getElm('tabsBox')).concat(fields(this.form.container)).find((field)=>field.offsetParent != null)?.focus();
|
|
34783
|
+
}
|
|
34177
34784
|
__lock() {
|
|
34178
34785
|
this.dialog.lock();
|
|
34179
34786
|
this.form.setMod('lock', true);
|
|
@@ -36424,10 +37031,11 @@ const align = {
|
|
|
36424
37031
|
/* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(28077);
|
|
36425
37032
|
/* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(65946);
|
|
36426
37033
|
/* harmony import */ var jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(91206);
|
|
36427
|
-
/* harmony import */ var
|
|
36428
|
-
/* harmony import */ var
|
|
36429
|
-
/* harmony import */ var
|
|
36430
|
-
/* harmony import */ var
|
|
37034
|
+
/* harmony import */ var jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(42259);
|
|
37035
|
+
/* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(4099);
|
|
37036
|
+
/* harmony import */ var jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(56490);
|
|
37037
|
+
/* harmony import */ var jodit_modules_toolbar_factory__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(4274);
|
|
37038
|
+
/* harmony import */ var _config_config__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(89873);
|
|
36431
37039
|
/*!
|
|
36432
37040
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
36433
37041
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -36448,14 +37056,15 @@ const align = {
|
|
|
36448
37056
|
|
|
36449
37057
|
|
|
36450
37058
|
|
|
37059
|
+
|
|
36451
37060
|
/**
|
|
36452
37061
|
* Plugin for show inline popup dialog
|
|
36453
37062
|
*/ class inlinePopup extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__.Plugin {
|
|
36454
37063
|
get popup() {
|
|
36455
|
-
return new
|
|
37064
|
+
return new jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_9__.Popup(this.jodit, false);
|
|
36456
37065
|
}
|
|
36457
37066
|
get toolbar() {
|
|
36458
|
-
return (0,
|
|
37067
|
+
return (0,jodit_modules_toolbar_factory__WEBPACK_IMPORTED_MODULE_10__.makeCollection)(this.jodit, this.popup);
|
|
36459
37068
|
}
|
|
36460
37069
|
onClick(node) {
|
|
36461
37070
|
const elements = this.elmsList, mediaWrapper = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.getMediaWrapper)(this.j, node), target = mediaWrapper ?? (jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isTag(node, 'img') ? node : jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.closest(node, elements, this.j.editor));
|
|
@@ -36529,6 +37138,33 @@ const align = {
|
|
|
36529
37138
|
onOutsideClick() {
|
|
36530
37139
|
this.popup.close();
|
|
36531
37140
|
}
|
|
37141
|
+
/**
|
|
37142
|
+
* A key that moves the caret off an element closes its popup, and one
|
|
37143
|
+
* that moves the caret into an element with a popup (a link) opens it,
|
|
37144
|
+
* as clicks do
|
|
37145
|
+
*/ onKeyUp() {
|
|
37146
|
+
this.__followCaret();
|
|
37147
|
+
}
|
|
37148
|
+
__followCaret() {
|
|
37149
|
+
if (!(0,jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_7__.isMoved)(this.j, this.snapRange)) {
|
|
37150
|
+
return;
|
|
37151
|
+
}
|
|
37152
|
+
const { range } = this.j.s;
|
|
37153
|
+
const target = this.previousTarget;
|
|
37154
|
+
if (this.popup.isOpened && this.type !== 'selection' && target && !range.intersectsNode(target)) {
|
|
37155
|
+
this.popup.close();
|
|
37156
|
+
}
|
|
37157
|
+
const node = range.startContainer;
|
|
37158
|
+
const element = this.__elementAt(node);
|
|
37159
|
+
if (range.collapsed && element && element !== this.__keyDownElement) {
|
|
37160
|
+
this.onClick(node);
|
|
37161
|
+
}
|
|
37162
|
+
}
|
|
37163
|
+
/**
|
|
37164
|
+
* The element with a popup that holds `node`
|
|
37165
|
+
*/ __elementAt(node) {
|
|
37166
|
+
return jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.closest(node, this.elmsList, this.j.editor);
|
|
37167
|
+
}
|
|
36532
37168
|
/**
|
|
36533
37169
|
* Can show popup for this type
|
|
36534
37170
|
*/ canShowPopupForType(type) {
|
|
@@ -36568,12 +37204,28 @@ const align = {
|
|
|
36568
37204
|
], 'mousedown touchstart', this.__onDocumentMouseDown).on('closeAllPopups', this.__onCloseAllPopups);
|
|
36569
37205
|
this.addListenersForElements();
|
|
36570
37206
|
}
|
|
37207
|
+
onRecalcPositionPopup() {
|
|
37208
|
+
if (this.popup.isOpened && this.type !== 'selection' && this.previousTarget) {
|
|
37209
|
+
this.__reopenFor = this.previousTarget;
|
|
37210
|
+
}
|
|
37211
|
+
}
|
|
36571
37212
|
__onDocumentMouseDown(e) {
|
|
36572
|
-
|
|
37213
|
+
this.__reopenFor = null;
|
|
37214
|
+
if (this.popup.isOpened && this.type === 'selection' && e.target && jodit_core_ui__WEBPACK_IMPORTED_MODULE_8__.UIElement.closestElement(e.target, jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_9__.Popup)) {
|
|
36573
37215
|
this.__reopenSelectionPopup = true;
|
|
36574
37216
|
}
|
|
36575
37217
|
}
|
|
36576
37218
|
__onCloseAllPopups() {
|
|
37219
|
+
const target = this.__reopenFor;
|
|
37220
|
+
if (target) {
|
|
37221
|
+
this.__reopenFor = null;
|
|
37222
|
+
// After the popup's own `closeAllPopups` handler, as below
|
|
37223
|
+
this.j.async.setTimeout(()=>{
|
|
37224
|
+
if (this.j.editor.contains(target)) {
|
|
37225
|
+
this.onClick(target);
|
|
37226
|
+
}
|
|
37227
|
+
}, 1);
|
|
37228
|
+
}
|
|
36577
37229
|
if (!this.__reopenSelectionPopup) {
|
|
36578
37230
|
return;
|
|
36579
37231
|
}
|
|
@@ -36610,11 +37262,16 @@ const align = {
|
|
|
36610
37262
|
height: rect.height
|
|
36611
37263
|
};
|
|
36612
37264
|
}
|
|
36613
|
-
onSelectionStart() {
|
|
37265
|
+
onSelectionStart(event) {
|
|
37266
|
+
// A key held down moves the caret on every repeat, with one keyup
|
|
37267
|
+
if (event?.repeat) {
|
|
37268
|
+
this.__followCaret();
|
|
37269
|
+
}
|
|
36614
37270
|
this.snapRange = this.j.s.range.cloneRange();
|
|
37271
|
+
this.__keyDownElement = this.__elementAt(this.snapRange.startContainer);
|
|
36615
37272
|
}
|
|
36616
37273
|
onSelectionEnd(e) {
|
|
36617
|
-
if (e && e.target &&
|
|
37274
|
+
if (e && e.target && jodit_core_ui__WEBPACK_IMPORTED_MODULE_8__.UIElement.closestElement(e.target, jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_9__.Popup)) {
|
|
36618
37275
|
return;
|
|
36619
37276
|
}
|
|
36620
37277
|
const { snapRange } = this, { range } = this.j.s;
|
|
@@ -36694,7 +37351,11 @@ const align = {
|
|
|
36694
37351
|
* The user pressed a button inside the selection toolbar — after the
|
|
36695
37352
|
* command fires `closeAllPopups`, the toolbar should be shown again
|
|
36696
37353
|
* while the selection is still there. See #1238
|
|
36697
|
-
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__reopenSelectionPopup", false),
|
|
37354
|
+
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__reopenSelectionPopup", false), /**
|
|
37355
|
+
* The alignment controls fire `recalcPositionPopup` once they have moved
|
|
37356
|
+
* the element, and their button then fires `closeAllPopups`. The popup
|
|
37357
|
+
* opens again beside the element, as the selection toolbar does
|
|
37358
|
+
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__reopenFor", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "snapRange", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__keyDownElement", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "elmsList", (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.keys)(this.j.o.popup, false).filter((s)=>!this.isExcludedTarget(s)));
|
|
36698
37359
|
}
|
|
36699
37360
|
}
|
|
36700
37361
|
;(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(inlinePopup, "requires", [
|
|
@@ -36723,6 +37384,12 @@ const align = {
|
|
|
36723
37384
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
36724
37385
|
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.watch)(':outsideClick')
|
|
36725
37386
|
], inlinePopup.prototype, "onOutsideClick", null);
|
|
37387
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
37388
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.watch)(':keyup')
|
|
37389
|
+
], inlinePopup.prototype, "onKeyUp", null);
|
|
37390
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
37391
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.watch)(':recalcPositionPopup')
|
|
37392
|
+
], inlinePopup.prototype, "onRecalcPositionPopup", null);
|
|
36726
37393
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
36727
37394
|
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.autobind
|
|
36728
37395
|
], inlinePopup.prototype, "__onDocumentMouseDown", null);
|
|
@@ -38199,9 +38866,11 @@ const isButtonSeparator = (item)=>item === '|' || item === '---' || item === '\n
|
|
|
38199
38866
|
return cleaned;
|
|
38200
38867
|
}
|
|
38201
38868
|
/**
|
|
38202
|
-
* The width that decides which breakpoint set the toolbar uses
|
|
38203
|
-
*
|
|
38204
|
-
*
|
|
38869
|
+
* The width that decides which breakpoint set the toolbar uses: the editor's
|
|
38870
|
+
* own width, or its parent's while the editor has none yet (for example
|
|
38871
|
+
* while hidden at init). A toolbar rendered into an external container
|
|
38872
|
+
* (`toolbar` set to an element or a selector) lays out in that container, so
|
|
38873
|
+
* its width is what matters there.
|
|
38205
38874
|
*/ function adaptiveWidth(editor) {
|
|
38206
38875
|
const { toolbar } = editor.o;
|
|
38207
38876
|
if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_3__.isString)(toolbar) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isHTMLElement(toolbar)) {
|
|
@@ -38210,7 +38879,7 @@ const isButtonSeparator = (item)=>item === '|' || item === '---' || item === '\n
|
|
|
38210
38879
|
return width;
|
|
38211
38880
|
}
|
|
38212
38881
|
}
|
|
38213
|
-
return (editor.container.parentElement ?? editor.container).offsetWidth;
|
|
38882
|
+
return editor.container.offsetWidth || (editor.container.parentElement ?? editor.container).offsetWidth;
|
|
38214
38883
|
}
|
|
38215
38884
|
/**
|
|
38216
38885
|
* Rebuild toolbar in depends on editor's width
|
|
@@ -38286,6 +38955,7 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_1__.pluginSystem.add('mobile', mobile
|
|
|
38286
38955
|
/* harmony import */ var _icons_ol_svg__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_icons_ol_svg__WEBPACK_IMPORTED_MODULE_3__);
|
|
38287
38956
|
/* harmony import */ var _icons_ul_svg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(83207);
|
|
38288
38957
|
/* harmony import */ var _icons_ul_svg__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_icons_ul_svg__WEBPACK_IMPORTED_MODULE_4__);
|
|
38958
|
+
/* harmony import */ var _start_dialog__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(97547);
|
|
38289
38959
|
/*!
|
|
38290
38960
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
38291
38961
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -38297,10 +38967,18 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_1__.pluginSystem.add('mobile', mobile
|
|
|
38297
38967
|
|
|
38298
38968
|
|
|
38299
38969
|
|
|
38970
|
+
|
|
38971
|
+
/**
|
|
38972
|
+
* The `ol` dropdown item that asks for the list's start number
|
|
38973
|
+
*/ const START = 'start';
|
|
38300
38974
|
const memoExec = (jodit, _, { control })=>{
|
|
38301
38975
|
const key = `button${control.command}`;
|
|
38302
38976
|
const value = (control.args && control.args[0]) ?? (0,jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_0__.dataBind)(jodit, key);
|
|
38303
|
-
(
|
|
38977
|
+
if (value === START) {
|
|
38978
|
+
(0,_start_dialog__WEBPACK_IMPORTED_MODULE_5__.openStartDialog)(jodit);
|
|
38979
|
+
return;
|
|
38980
|
+
}
|
|
38981
|
+
;(0,jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_0__.dataBind)(jodit, key, value);
|
|
38304
38982
|
jodit.execCommand(control.command, false, value === 'default' ? null : value);
|
|
38305
38983
|
};
|
|
38306
38984
|
jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_1__.Icon.set('ol', (_icons_ol_svg__WEBPACK_IMPORTED_MODULE_3___default())).set('ul', (_icons_ul_svg__WEBPACK_IMPORTED_MODULE_4___default()));
|
|
@@ -38330,9 +39008,11 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.ol = {
|
|
|
38330
39008
|
'lower-greek': 'Lower Greek',
|
|
38331
39009
|
'lower-roman': 'Lower Roman',
|
|
38332
39010
|
'upper-alpha': 'Upper Alpha',
|
|
38333
|
-
'upper-roman': 'Upper Roman'
|
|
39011
|
+
'upper-roman': 'Upper Roman',
|
|
39012
|
+
[START]: 'Start at...'
|
|
38334
39013
|
},
|
|
38335
|
-
exec: memoExec
|
|
39014
|
+
exec: memoExec,
|
|
39015
|
+
isChildDisabled: (jodit, button)=>button.control.args?.[0] === START && !(0,_start_dialog__WEBPACK_IMPORTED_MODULE_5__.closestOrderedList)(jodit)
|
|
38336
39016
|
};
|
|
38337
39017
|
|
|
38338
39018
|
|
|
@@ -38363,6 +39043,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.ol = {
|
|
|
38363
39043
|
|
|
38364
39044
|
|
|
38365
39045
|
|
|
39046
|
+
|
|
38366
39047
|
/**
|
|
38367
39048
|
* Process commands insertOrderedList and insertUnOrderedList
|
|
38368
39049
|
*/ class orderedList extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_4__.Plugin {
|
|
@@ -38401,6 +39082,86 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.ol = {
|
|
|
38401
39082
|
jodit_core_global__WEBPACK_IMPORTED_MODULE_3__.pluginSystem.add('orderedList', orderedList);
|
|
38402
39083
|
|
|
38403
39084
|
|
|
39085
|
+
/***/ }),
|
|
39086
|
+
|
|
39087
|
+
/***/ 97547:
|
|
39088
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
39089
|
+
|
|
39090
|
+
"use strict";
|
|
39091
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
39092
|
+
/* harmony export */ closestOrderedList: function() { return /* binding */ closestOrderedList; },
|
|
39093
|
+
/* harmony export */ openStartDialog: function() { return /* binding */ openStartDialog; }
|
|
39094
|
+
/* harmony export */ });
|
|
39095
|
+
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
|
|
39096
|
+
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7909);
|
|
39097
|
+
/* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(59400);
|
|
39098
|
+
/* harmony import */ var jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5658);
|
|
39099
|
+
/*!
|
|
39100
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
39101
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
39102
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
39103
|
+
*/ /**
|
|
39104
|
+
* @module plugins/ordered-list
|
|
39105
|
+
*/
|
|
39106
|
+
|
|
39107
|
+
|
|
39108
|
+
|
|
39109
|
+
/**
|
|
39110
|
+
* The numbered list the selection is in
|
|
39111
|
+
*/ function closestOrderedList(jodit) {
|
|
39112
|
+
const current = jodit.s.current();
|
|
39113
|
+
return current ? jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.closest(current, 'ol', jodit.editor) : null;
|
|
39114
|
+
}
|
|
39115
|
+
/**
|
|
39116
|
+
* Asks for the number of the first item of the list the selection is in,
|
|
39117
|
+
* and sets the list's `start`. The selection is put back when the dialog
|
|
39118
|
+
* closes, however it closes.
|
|
39119
|
+
*/ function openStartDialog(jodit) {
|
|
39120
|
+
const list = closestOrderedList(jodit);
|
|
39121
|
+
if (!list) {
|
|
39122
|
+
return;
|
|
39123
|
+
}
|
|
39124
|
+
const dialog = jodit.dlg({
|
|
39125
|
+
resizable: false,
|
|
39126
|
+
closeOnClickOverlay: true
|
|
39127
|
+
});
|
|
39128
|
+
const input = new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_3__.UIInput(jodit, {
|
|
39129
|
+
name: 'start',
|
|
39130
|
+
type: 'number',
|
|
39131
|
+
label: 'Number for the first item',
|
|
39132
|
+
value: list.start
|
|
39133
|
+
});
|
|
39134
|
+
const form = new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_3__.UIForm(jodit, [
|
|
39135
|
+
new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_3__.UIBlock(jodit, [
|
|
39136
|
+
input
|
|
39137
|
+
])
|
|
39138
|
+
]);
|
|
39139
|
+
form.container.classList.add('jodit-dialog_alert');
|
|
39140
|
+
form.onSubmit(({ start })=>{
|
|
39141
|
+
const value = start === '' ? 1 : parseInt(start, 10);
|
|
39142
|
+
if (isNaN(value)) {
|
|
39143
|
+
input.focus();
|
|
39144
|
+
return false;
|
|
39145
|
+
}
|
|
39146
|
+
dialog.close();
|
|
39147
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(list, 'start', value === 1 ? null : value);
|
|
39148
|
+
jodit.synchronizeValues();
|
|
39149
|
+
});
|
|
39150
|
+
jodit.s.save();
|
|
39151
|
+
dialog.e.on(dialog, 'afterClose', ()=>{
|
|
39152
|
+
jodit.s.focus();
|
|
39153
|
+
jodit.s.restore();
|
|
39154
|
+
});
|
|
39155
|
+
dialog.setFooter([
|
|
39156
|
+
(0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_2__.Button)(jodit, 'cancel', 'Cancel').onAction(()=>dialog.close()),
|
|
39157
|
+
(0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_2__.Button)(jodit, 'ok', 'Apply', 'primary').onAction(()=>form.submit())
|
|
39158
|
+
]);
|
|
39159
|
+
dialog.open(form, jodit.i18n('Start numbering at'), true, true);
|
|
39160
|
+
input.focus();
|
|
39161
|
+
input.nativeInput.select();
|
|
39162
|
+
}
|
|
39163
|
+
|
|
39164
|
+
|
|
38404
39165
|
/***/ }),
|
|
38405
39166
|
|
|
38406
39167
|
/***/ 71693:
|
|
@@ -39201,6 +39962,10 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.useInputsPlaceholder
|
|
|
39201
39962
|
return true;
|
|
39202
39963
|
}
|
|
39203
39964
|
const first = root.firstChild;
|
|
39965
|
+
// Firefox pads an empty editable body with a bare <br>
|
|
39966
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(first, 'br') && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.next(first, Boolean, root)) {
|
|
39967
|
+
return true;
|
|
39968
|
+
}
|
|
39204
39969
|
if (jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.INSEPARABLE_TAGS.has(first.nodeName?.toLowerCase()) || /^(TABLE)$/i.test(first.nodeName)) {
|
|
39205
39970
|
return false;
|
|
39206
39971
|
}
|
|
@@ -39249,11 +40014,13 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.useInputsPlaceholder
|
|
|
39249
40014
|
marginTop = parseInt(style2.getPropertyValue('margin-top'), 10);
|
|
39250
40015
|
marginLeft = parseInt(style2.getPropertyValue('margin-left'), 10);
|
|
39251
40016
|
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(this.placeholderElm, {
|
|
40017
|
+
fontFamily: style2.getPropertyValue('font-family'),
|
|
39252
40018
|
fontSize: parseInt(style2.getPropertyValue('font-size'), 10),
|
|
39253
40019
|
lineHeight: style2.getPropertyValue('line-height')
|
|
39254
40020
|
});
|
|
39255
40021
|
} else {
|
|
39256
40022
|
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(this.placeholderElm, {
|
|
40023
|
+
fontFamily: style.getPropertyValue('font-family'),
|
|
39257
40024
|
fontSize: parseInt(style.getPropertyValue('font-size'), 10),
|
|
39258
40025
|
lineHeight: style.getPropertyValue('line-height')
|
|
39259
40026
|
});
|
|
@@ -39299,7 +40066,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.useInputsPlaceholder
|
|
|
39299
40066
|
this.placeholderElm.innerHTML = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_7__.attr)(editor.element, 'placeholder') || '';
|
|
39300
40067
|
}
|
|
39301
40068
|
editor.e.fire('placeholder', this.placeholderElm.innerHTML);
|
|
39302
|
-
editor.e.off('.placeholder').on('changePlace.placeholder', this.addNativeListeners).on('change.placeholder focus.placeholder keyup.placeholder mouseup.placeholder keydown.placeholder ' + 'mousedown.placeholder afterSetMode.placeholder changePlace.placeholder ' + 'internalChange.placeholder afterCommand.placeholder', this.toggle).on(window, 'load', this.toggle);
|
|
40069
|
+
editor.e.off('.placeholder').on('changePlace.placeholder', this.addNativeListeners).on('change.placeholder focus.placeholder keyup.placeholder mouseup.placeholder keydown.placeholder ' + 'mousedown.placeholder afterSetMode.placeholder changePlace.placeholder ' + 'internalChange.placeholder afterCommand.placeholder resize.placeholder', this.toggle).on(window, 'load', this.toggle);
|
|
39303
40070
|
this.addNativeListeners();
|
|
39304
40071
|
this.toggle();
|
|
39305
40072
|
});
|
|
@@ -40163,7 +40930,10 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.resizer = {
|
|
|
40163
40930
|
/* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(65946);
|
|
40164
40931
|
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(80991);
|
|
40165
40932
|
/* harmony import */ var jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(18855);
|
|
40166
|
-
/* harmony import */ var
|
|
40933
|
+
/* harmony import */ var jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(42259);
|
|
40934
|
+
/* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(4099);
|
|
40935
|
+
/* harmony import */ var jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(56490);
|
|
40936
|
+
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(96608);
|
|
40167
40937
|
/*!
|
|
40168
40938
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
40169
40939
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -40184,6 +40954,9 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.resizer = {
|
|
|
40184
40954
|
|
|
40185
40955
|
|
|
40186
40956
|
|
|
40957
|
+
|
|
40958
|
+
|
|
40959
|
+
|
|
40187
40960
|
const keyBInd = '__jodit-resizer_binded';
|
|
40188
40961
|
/**
|
|
40189
40962
|
* Reads a plain pixel value out of a `width`/`height` attribute.
|
|
@@ -40202,11 +40975,19 @@ const keyBInd = '__jodit-resizer_binded';
|
|
|
40202
40975
|
*/ function heightFollowsWidth(element) {
|
|
40203
40976
|
return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(element, 'video') && !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(element, 'height') && !(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_7__.cssInline)(element, 'height');
|
|
40204
40977
|
}
|
|
40978
|
+
const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
|
|
40979
|
+
/**
|
|
40980
|
+
* A click on an embed lands on its wrapper, so it selects the embed, until the
|
|
40981
|
+
* wrapper is active. While the editor is locked, as during resizing, the
|
|
40982
|
+
* wrapper takes the mouse again.
|
|
40983
|
+
*/ const EMBED_WRAPPER_STYLE = `${IFRAME_WRAPPER}{position:relative;display:block;user-select:none}` + `${IFRAME_WRAPPER} iframe{position:relative}` + `${IFRAME_WRAPPER}::after{position:absolute;z-index:1;display:block;background:transparent;content:'';cursor:pointer;inset:0}` + `${IFRAME_WRAPPER}[data-jodit-wrapper_active=true] iframe{z-index:2}` + `.jodit_lock ${IFRAME_WRAPPER}[data-jodit-wrapper_active=true] iframe{z-index:1}`;
|
|
40205
40984
|
/**
|
|
40206
40985
|
* The module creates a supporting frame for resizing of the elements img and table
|
|
40207
40986
|
*/ class resizer extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_8__.Plugin {
|
|
40208
40987
|
/** @override */ afterInit(editor) {
|
|
40209
|
-
|
|
40988
|
+
// It goes in the editing document, so iframe mode has it whatever `iframeStyle` holds
|
|
40989
|
+
(0,jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.getContainer)(editor, 'resizer', 'style', true).textContent = EMBED_WRAPPER_STYLE;
|
|
40990
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.$$)('div', this.rect).forEach((resizeHandle)=>{
|
|
40210
40991
|
editor.e.on(resizeHandle, 'mousedown.resizer touchstart.resizer', this.onStartResizing.bind(this, resizeHandle));
|
|
40211
40992
|
});
|
|
40212
40993
|
jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.eventEmitter.on('hideHelpers', this.hide);
|
|
@@ -40214,7 +40995,11 @@ const keyBInd = '__jodit-resizer_binded';
|
|
|
40214
40995
|
if (isReadOnly) {
|
|
40215
40996
|
this.hide();
|
|
40216
40997
|
}
|
|
40217
|
-
}).on('afterInit changePlace', this.addEventListeners.bind(this))
|
|
40998
|
+
}).on('afterInit changePlace', this.addEventListeners.bind(this))// Handlers without a namespace run first, ahead of those that
|
|
40999
|
+
// move the caret, as table-keyboard-navigation's do
|
|
41000
|
+
.on('keydown', this.onEditorKeyDown, {
|
|
41001
|
+
top: true
|
|
41002
|
+
}).on('afterGetValueFromEditor.resizer', (data)=>{
|
|
40218
41003
|
const rgx = /<jodit[^>]+data-jodit_iframe_wrapper[^>]+>(.*?<iframe[^>]*>.*?<\/iframe>.*?)<\/jodit>/gi;
|
|
40219
41004
|
if (rgx.test(data.value)) {
|
|
40220
41005
|
data.value = data.value.replace(rgx, '$1');
|
|
@@ -40358,6 +41143,38 @@ const keyBInd = '__jodit-resizer_binded';
|
|
|
40358
41143
|
e.stopImmediatePropagation();
|
|
40359
41144
|
}
|
|
40360
41145
|
}
|
|
41146
|
+
onEditorKeyDown(event) {
|
|
41147
|
+
// A key held down moves the caret on every repeat, with one keyup
|
|
41148
|
+
if (event?.repeat) {
|
|
41149
|
+
this.__followCaret();
|
|
41150
|
+
}
|
|
41151
|
+
this.__keyDownRange = this.j.s.range.cloneRange();
|
|
41152
|
+
this.__keyDownTable = this.__caretTable();
|
|
41153
|
+
}
|
|
41154
|
+
__caretTable() {
|
|
41155
|
+
return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(this.j.s.range.startContainer, 'table', this.j.editor);
|
|
41156
|
+
}
|
|
41157
|
+
/**
|
|
41158
|
+
* Hide the frame once a key has moved the caret off its element, and
|
|
41159
|
+
* frame a table the caret has moved into, as clicks do
|
|
41160
|
+
*/ onEditorKeyUp() {
|
|
41161
|
+
this.__followCaret();
|
|
41162
|
+
}
|
|
41163
|
+
__followCaret() {
|
|
41164
|
+
const before = this.__keyDownRange;
|
|
41165
|
+
this.__keyDownRange = null;
|
|
41166
|
+
if (!(0,jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_9__.isMoved)(this.j, before)) {
|
|
41167
|
+
return;
|
|
41168
|
+
}
|
|
41169
|
+
if (this.isShown && this.element && !this.j.s.range.intersectsNode(this.element)) {
|
|
41170
|
+
this.hide();
|
|
41171
|
+
}
|
|
41172
|
+
const table = this.__caretTable();
|
|
41173
|
+
if (table && table !== this.__keyDownTable && this.j.o.allowResizeTags.has('table')) {
|
|
41174
|
+
this.__bind(table);
|
|
41175
|
+
this.onClickElement(table);
|
|
41176
|
+
}
|
|
41177
|
+
}
|
|
40361
41178
|
onKeyDown(e) {
|
|
40362
41179
|
this.isAltMode = e.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.KEY_ALT;
|
|
40363
41180
|
if (!this.isAltMode && this.isResizeMode) {
|
|
@@ -40379,6 +41196,11 @@ const keyBInd = '__jodit-resizer_binded';
|
|
|
40379
41196
|
return;
|
|
40380
41197
|
}
|
|
40381
41198
|
if (!this.isResizeMode) {
|
|
41199
|
+
// A click in the element's popup, or in a list it opens, works on
|
|
41200
|
+
// the element, so it keeps its frame
|
|
41201
|
+
if (e?.target && jodit_core_ui__WEBPACK_IMPORTED_MODULE_10__.UIElement.closestElement(e.target, jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_11__.Popup)) {
|
|
41202
|
+
return;
|
|
41203
|
+
}
|
|
40382
41204
|
return this.hide();
|
|
40383
41205
|
}
|
|
40384
41206
|
e.stopImmediatePropagation();
|
|
@@ -40545,7 +41367,7 @@ const keyBInd = '__jodit-resizer_binded';
|
|
|
40545
41367
|
this.hide();
|
|
40546
41368
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove(this.layer);
|
|
40547
41369
|
jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.eventEmitter.off('hideHelpers', this.hide);
|
|
40548
|
-
jodit.e.off(this.j.ow, '.resizer').off('.resizer');
|
|
41370
|
+
jodit.e.off(this.j.ow, '.resizer').off('.resizer').off('keydown', this.onEditorKeyDown);
|
|
40549
41371
|
}
|
|
40550
41372
|
constructor(...args){
|
|
40551
41373
|
super(...args), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "LOCK_KEY", 'resizer'), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "handle", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "element", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "isResizeMode", false), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "isShown", false), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "startX", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "startY", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "width", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "height", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "ratio", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "rect", this.j.c.fromHTML(`<div title="${this.j.i18n('Press Alt for custom resizing')}" class="jodit-resizer">
|
|
@@ -40555,7 +41377,7 @@ const keyBInd = '__jodit-resizer_binded';
|
|
|
40555
41377
|
<div class="jodit-resizer__bottom-left"></div>
|
|
40556
41378
|
<span>100x100</span>
|
|
40557
41379
|
</div>`)), // Clips the frame to the workplace, without the frame making it scroll
|
|
40558
|
-
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "layer", this.j.c.div('jodit-resizer-layer')), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "sizeViewer", this.rect.getElementsByTagName('span')[0]), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "pointerX", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "pointerY", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "isAltMode", false), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "onClickElement", (element)=>{
|
|
41380
|
+
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "layer", this.j.c.div('jodit-resizer-layer')), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "sizeViewer", this.rect.getElementsByTagName('span')[0]), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "pointerX", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "pointerY", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__keyDownRange", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__keyDownTable", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "isAltMode", false), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "onClickElement", (element)=>{
|
|
40559
41381
|
if (this.isResizeMode) {
|
|
40560
41382
|
return;
|
|
40561
41383
|
}
|
|
@@ -40613,6 +41435,12 @@ const keyBInd = '__jodit-resizer_binded';
|
|
|
40613
41435
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
40614
41436
|
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.autobind
|
|
40615
41437
|
], resizer.prototype, "onResize", null);
|
|
41438
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
41439
|
+
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.autobind
|
|
41440
|
+
], resizer.prototype, "onEditorKeyDown", null);
|
|
41441
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
41442
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.watch)(':keyup')
|
|
41443
|
+
], resizer.prototype, "onEditorKeyUp", null);
|
|
40616
41444
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
40617
41445
|
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.autobind
|
|
40618
41446
|
], resizer.prototype, "onKeyDown", null);
|
|
@@ -41562,8 +42390,9 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.tableAllowCellSelecti
|
|
|
41562
42390
|
/* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(28077);
|
|
41563
42391
|
/* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(65946);
|
|
41564
42392
|
/* harmony import */ var jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(91206);
|
|
41565
|
-
/* harmony import */ var
|
|
41566
|
-
/* harmony import */ var
|
|
42393
|
+
/* harmony import */ var jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(42259);
|
|
42394
|
+
/* harmony import */ var jodit_modules_table_table__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(98803);
|
|
42395
|
+
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(69070);
|
|
41567
42396
|
/*!
|
|
41568
42397
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
41569
42398
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -41582,19 +42411,24 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.tableAllowCellSelecti
|
|
|
41582
42411
|
|
|
41583
42412
|
|
|
41584
42413
|
|
|
42414
|
+
|
|
41585
42415
|
const key = 'table_processor_observer';
|
|
41586
42416
|
const MOUSE_MOVE_LABEL = 'onMoveTableSelectCell';
|
|
41587
42417
|
class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin {
|
|
41588
42418
|
/**
|
|
41589
42419
|
* Shortcut for Jodit.modules.Table
|
|
41590
42420
|
*/ get __tableModule() {
|
|
41591
|
-
return this.j.getInstance(
|
|
42421
|
+
return this.j.getInstance(jodit_modules_table_table__WEBPACK_IMPORTED_MODULE_9__.Table, this.j.o);
|
|
41592
42422
|
}
|
|
41593
42423
|
afterInit(jodit) {
|
|
41594
42424
|
if (!jodit.o.tableAllowCellSelection) {
|
|
41595
42425
|
return;
|
|
41596
42426
|
}
|
|
41597
|
-
jodit.e
|
|
42427
|
+
jodit.e// Handlers without a namespace run first, ahead of those that
|
|
42428
|
+
// move the caret, as table-keyboard-navigation's do
|
|
42429
|
+
.on('keydown', this.__onKeyDown, {
|
|
42430
|
+
top: true
|
|
42431
|
+
}).on('keydown.select-cells', (event)=>{
|
|
41598
42432
|
if (event.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.KEY_TAB) {
|
|
41599
42433
|
this.unselectCells();
|
|
41600
42434
|
}
|
|
@@ -41617,6 +42451,59 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
|
|
|
41617
42451
|
}
|
|
41618
42452
|
});
|
|
41619
42453
|
}
|
|
42454
|
+
__onKeyDown(event) {
|
|
42455
|
+
// A key held down moves the caret on every repeat, with one keyup
|
|
42456
|
+
if (event?.repeat) {
|
|
42457
|
+
this.__followCaret();
|
|
42458
|
+
}
|
|
42459
|
+
this.__keyDownCell = this.__caretCell();
|
|
42460
|
+
this.__keyDownRange = this.j.s.range.cloneRange();
|
|
42461
|
+
this.__keyDownInLink = this.__isInLink();
|
|
42462
|
+
}
|
|
42463
|
+
__isInLink() {
|
|
42464
|
+
return Boolean(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(this.j.s.range.startContainer, 'a', this.j.editor));
|
|
42465
|
+
}
|
|
42466
|
+
/**
|
|
42467
|
+
* Where the selection starts rather than `s.current()`, which finds the
|
|
42468
|
+
* first cell when the caret is just before the table
|
|
42469
|
+
*/ __caretCell() {
|
|
42470
|
+
return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(this.j.s.range.startContainer, jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isCell, this.j.editor);
|
|
42471
|
+
}
|
|
42472
|
+
/**
|
|
42473
|
+
* A key that moves the caret into a cell, from another cell or from
|
|
42474
|
+
* outside the table, marks that cell and opens its popup, as a click on
|
|
42475
|
+
* it does. One that moves the caret out of the table unmarks the cells
|
|
42476
|
+
*/ onKeyUp() {
|
|
42477
|
+
this.__followCaret();
|
|
42478
|
+
}
|
|
42479
|
+
__followCaret() {
|
|
42480
|
+
const before = this.__keyDownRange;
|
|
42481
|
+
this.__keyDownRange = null;
|
|
42482
|
+
if (this.j.o.readonly || !(0,jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_8__.isMoved)(this.j, before)) {
|
|
42483
|
+
return;
|
|
42484
|
+
}
|
|
42485
|
+
const cell = this.__caretCell();
|
|
42486
|
+
const hasLeftLink = this.__keyDownInLink && !this.__isInLink();
|
|
42487
|
+
if (cell === this.__keyDownCell && !(cell && hasLeftLink)) {
|
|
42488
|
+
return;
|
|
42489
|
+
}
|
|
42490
|
+
const hadMarked = this.__tableModule.getAllSelectedCells().length > 0;
|
|
42491
|
+
this.unselectCells();
|
|
42492
|
+
if (!cell) {
|
|
42493
|
+
if (hadMarked) {
|
|
42494
|
+
this.j.e.fire('hidePopup', 'cells');
|
|
42495
|
+
}
|
|
42496
|
+
return;
|
|
42497
|
+
}
|
|
42498
|
+
const table = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(cell, 'table', this.j.editor);
|
|
42499
|
+
if (!table) {
|
|
42500
|
+
return;
|
|
42501
|
+
}
|
|
42502
|
+
// As after a click, the first change to the cell keeps the mark
|
|
42503
|
+
this.__selectedCell = cell;
|
|
42504
|
+
this.__tableModule.addSelection(cell);
|
|
42505
|
+
this.j.e.fire('showPopup', table, ()=>(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.position)(cell, this.j), 'cells');
|
|
42506
|
+
}
|
|
41620
42507
|
/**
|
|
41621
42508
|
* Mouse click inside the table
|
|
41622
42509
|
*/ onStartSelection(cell, event) {
|
|
@@ -41934,10 +42821,14 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
|
|
|
41934
42821
|
}
|
|
41935
42822
|
/** @override */ beforeDestruct(jodit) {
|
|
41936
42823
|
this.__onRemoveSelection();
|
|
41937
|
-
jodit.e.off('.select-cells');
|
|
42824
|
+
jodit.e.off('.select-cells').off('keydown', this.__onKeyDown);
|
|
41938
42825
|
}
|
|
41939
42826
|
constructor(...args){
|
|
41940
42827
|
super(...args), /**
|
|
42828
|
+
* The cell with the caret, and the selection, when a key went down
|
|
42829
|
+
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__keyDownCell", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__keyDownRange", null), /**
|
|
42830
|
+
* A link's popup replaces the cell's while the caret is in the link
|
|
42831
|
+
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__keyDownInLink", false), /**
|
|
41941
42832
|
* First selected cell
|
|
41942
42833
|
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__selectedCell", null), /**
|
|
41943
42834
|
* User is selecting cells now
|
|
@@ -41947,6 +42838,12 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
|
|
|
41947
42838
|
;(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(selectCells, "requires", [
|
|
41948
42839
|
'select'
|
|
41949
42840
|
]);
|
|
42841
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
42842
|
+
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.autobind
|
|
42843
|
+
], selectCells.prototype, "__onKeyDown", null);
|
|
42844
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
42845
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.watch)(':keyup')
|
|
42846
|
+
], selectCells.prototype, "onKeyUp", null);
|
|
41950
42847
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
41951
42848
|
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.autobind
|
|
41952
42849
|
], selectCells.prototype, "onStartSelection", null);
|
|
@@ -44478,7 +45375,9 @@ const WORK_KEYS = new Set([
|
|
|
44478
45375
|
case jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_LEFT:
|
|
44479
45376
|
{
|
|
44480
45377
|
next = getNextCell();
|
|
44481
|
-
|
|
45378
|
+
// Left in the first cell leaves the table, as Up in the
|
|
45379
|
+
// top row does
|
|
45380
|
+
if (!next && key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_TAB) {
|
|
44482
45381
|
tableModule.appendRow(table, !isPrev ? false : jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.first(table, (node)=>jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(node, 'tr')), !isPrev);
|
|
44483
45382
|
next = getNextCell();
|
|
44484
45383
|
}
|
|
@@ -44504,7 +45403,6 @@ const WORK_KEYS = new Set([
|
|
|
44504
45403
|
if (!next) {
|
|
44505
45404
|
return;
|
|
44506
45405
|
}
|
|
44507
|
-
editor.e.fire('hidePopup hideResizer');
|
|
44508
45406
|
if (!next.firstChild) {
|
|
44509
45407
|
const first = editor.createInside.element('br');
|
|
44510
45408
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(next, first);
|
|
@@ -46325,7 +47223,7 @@ module.exports["default"] = {"Type something":"Start writing...","pencil":"Edit"
|
|
|
46325
47223
|
/***/ 53414:
|
|
46326
47224
|
/***/ (function(module) {
|
|
46327
47225
|
|
|
46328
|
-
module.exports["default"] = [" URL","--Not Set--","About Jodit","Add column","Add folder","Add row","Advanced","Align","Align Center","Align Justify","Align Left","Align Right","All","Alternative","Alternative text","Anchor","Apply","Are you sure?","Audio properties","Autoplay","Background","Bold","Border","Border radius","Bottom","Break","Browse","Buy full version","Cancel","Center","Change mode","Chars: %d","Choose Content to Paste","Circle","Class name","Classes","Clean","Clear Formatting","Code","Controls","Copy selection","Copyright © XDSoft.net - Chupurnov Valeriy. All rights reserved.","Create directory","Crop","Cut selection","Decrease Indent","Default","Delete","Delete column","Delete row","Delete table","Dot","Drop file","Drop image","Edit","Edit image","Edit link","Embed code","Empty cell","Enter Directory name","Enter new name","Error on load folders","Error on load list","Eye","File Browser","Fill color or set the text color","Filter","Find","Find Next","Find Previous","Font family","Font size","For information about the license, please go to our website:","Free Non-commercial Version","Heading 1","Heading 2","Heading 3","Heading 4","Height","Horizontal align","Image","Image properties","Increase Indent","Insert","Insert Horizontal Line","Insert Image","Insert Ordered List","Insert Special Character","Insert Unordered List","Insert as Text","Insert className","Insert column after","Insert column before","Insert file","Insert format block","Insert link","Insert only Text","Insert row above","Insert row below","Insert table","Insert youtube/vimeo video","Interim Results","Italic","Jodit Editor","Jodit User's Guide","Keep","Keep Aspect Ratio","Left","License: %s","Line height","Link","List view","Loop","Lower Alpha","Lower Greek","Lower Roman","Margins","Merge","Middle","Muted","No","No follow","Normal","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","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"]
|
|
47226
|
+
module.exports["default"] = [" URL","--Not Set--","About Jodit","Add column","Add folder","Add row","Advanced","Align","Align Center","Align Justify","Align Left","Align Right","All","Alternative","Alternative text","Anchor","Apply","Are you sure?","Audio properties","Autoplay","Background","Bold","Border","Border radius","Bottom","Break","Browse","Buy full version","Cancel","Center","Change mode","Chars: %d","Choose Content to Paste","Circle","Class name","Classes","Clean","Clear Formatting","Code","Controls","Copy selection","Copyright © XDSoft.net - Chupurnov Valeriy. All rights reserved.","Create directory","Crop","Cut selection","Decrease Indent","Default","Delete","Delete column","Delete row","Delete table","Dot","Drop file","Drop image","Edit","Edit image","Edit link","Embed code","Empty cell","Enter Directory name","Enter new name","Error on load folders","Error on load list","Eye","File Browser","Fill color or set the text color","Filter","Find","Find Next","Find Previous","Font family","Font size","For information about the license, please go to our website:","Free Non-commercial Version","Heading 1","Heading 2","Heading 3","Heading 4","Height","Horizontal align","Image","Image properties","Increase Indent","Insert","Insert Horizontal Line","Insert Image","Insert Ordered List","Insert Special Character","Insert Unordered List","Insert as Text","Insert className","Insert column after","Insert column before","Insert file","Insert format block","Insert link","Insert only Text","Insert row above","Insert row below","Insert table","Insert youtube/vimeo video","Interim Results","Italic","Jodit Editor","Jodit User's Guide","Keep","Keep Aspect Ratio","Left","License: %s","Line height","Link","List view","Loop","Lower Alpha","Lower Greek","Lower Roman","Margins","Merge","Middle","Muted","No","No follow","Normal","Number for the first item","Ok","Open in fullsize","Open in new tab","Open link","Open link in new tab","Paint format","Paste","Paste as HTML","Paste from clipboard","Please enter a web address","Please fill out this field","Poster","Press Alt for custom resizing","Print","Quadrate","Quote","Redo","Remove","Remove file","Rename","Replace","Replace with","Reset","Resize","Right","Save","Save as ...","Search for","Select","Select %s","Select Special Character","Select all","Select file","Show all","Sort by changed","Sort by name","Sort by size","Sound","Speech Recognize","Spellcheck","Split","Split horizontal","Split vertical","Src","Start at...","Start numbering at","Strike through","Styles","Text","The image has been successfully uploaded to the host!","The pasted content is coming from a Microsoft Word/Excel document. Do you want to keep the format or clean it up?","There are no files","Tiles view","Title","Top","Type something","Underline","Undo","Unlink","Update","Update file list","Upload","Upload file","Upper Alpha","Upper Roman","Vertical align","Video properties","Width","Word Paste Detected","Words: %d","Yes","You can only edit your own images. Download this image on the host?","Your browser doesn't support direct access to the clipboard.","Your code is similar to HTML. Keep as HTML?","about","apply","bold","bottom","brush","circle","contains detailed help for using","copy","cut","default","delete","dot","download","edit","eraser","file","font","fontsize","fullsize","hr","image","indent","italic","left","link","newline","ol","or click","outdent","palette","paragraph","pencil","preview","print","redo","right","selectall","shrink","sound","source","space","spellcheck","square","strikethrough","subscript","superscript","table","top","type dir name","type name","ul","underline","undo","video"]
|
|
46329
47227
|
|
|
46330
47228
|
/***/ }),
|
|
46331
47229
|
|