jodit 4.13.7 → 4.13.9
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 +12 -0
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.js +3 -3
- package/es2015/jodit.js +69 -5
- package/es2015/jodit.min.js +3 -3
- 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.js +3 -3
- package/es2018/jodit.min.js +3 -3
- package/es2018/plugins/debug/debug.min.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021/jodit.css +1 -1
- package/es2021/jodit.fat.min.js +4 -3
- package/es2021/jodit.js +68 -5
- package/es2021/jodit.min.js +4 -3
- 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 +1 -1
- package/es2021.en/jodit.fat.min.js +4 -3
- package/es2021.en/jodit.js +68 -5
- package/es2021.en/jodit.min.js +4 -3
- 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 +2 -2
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +118 -14
- package/es5/jodit.min.css +2 -2
- 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 +10 -0
- package/esm/core/constants.js +1 -1
- package/esm/plugins/mobile/config.d.ts +10 -0
- package/esm/plugins/mobile/mobile.js +72 -4
- package/package.json +1 -1
- package/types/config.d.ts +10 -0
- package/types/plugins/mobile/config.d.ts +10 -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.13.
|
|
4
|
+
* Version: v4.13.9
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -1843,7 +1843,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1843
1843
|
* ```
|
|
1844
1844
|
* @packageDocumentation
|
|
1845
1845
|
* @module constants
|
|
1846
|
-
*/ const APP_VERSION = "4.13.
|
|
1846
|
+
*/ const APP_VERSION = "4.13.9";
|
|
1847
1847
|
// prettier-ignore
|
|
1848
1848
|
const ES = "es2021";
|
|
1849
1849
|
const IS_ES_MODERN = true;
|
|
@@ -35912,6 +35912,69 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.dots = {
|
|
|
35912
35912
|
|
|
35913
35913
|
|
|
35914
35914
|
|
|
35915
|
+
const isButtonSeparator = (item)=>item === '|' || item === '---' || item === '\n';
|
|
35916
|
+
/**
|
|
35917
|
+
* Constrain a responsive breakpoint set (`buttonsMD/SM/XS`) to the buttons the
|
|
35918
|
+
* user actually asked for via `buttons`. Those breakpoint defaults are
|
|
35919
|
+
* group-based supersets, so a custom (smaller) `buttons` list would otherwise
|
|
35920
|
+
* see *extra* buttons appear on resize when the toolbar switched to a breakpoint
|
|
35921
|
+
* set — resizing must only ever drop buttons, never add ones outside `buttons`.
|
|
35922
|
+
*
|
|
35923
|
+
* When the breakpoint set introduces nothing outside `buttons` (the default
|
|
35924
|
+
* case, where `buttons` is the full superset), the list is returned untouched so
|
|
35925
|
+
* the standard grouped mobile layout — groups, separators and `dots` — is
|
|
35926
|
+
* preserved. See #1389.
|
|
35927
|
+
*/ function fitToButtons(list, editor) {
|
|
35928
|
+
const allowed = (0,jodit_core_ui_helpers_buttons__WEBPACK_IMPORTED_MODULE_2__.flatButtonsSet)((0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_1__.splitArray)(editor.o.buttons), editor);
|
|
35929
|
+
const groups = editor.getRegisteredButtonGroups();
|
|
35930
|
+
let changed = false;
|
|
35931
|
+
let hadDots = false;
|
|
35932
|
+
const flat = [];
|
|
35933
|
+
for (const item of list){
|
|
35934
|
+
if ((0,jodit_core_ui_helpers_buttons__WEBPACK_IMPORTED_MODULE_2__.isButtonGroup)(item)) {
|
|
35935
|
+
const members = [
|
|
35936
|
+
...item.buttons,
|
|
35937
|
+
...groups[item.group] ?? []
|
|
35938
|
+
];
|
|
35939
|
+
const kept = members.filter((button)=>allowed.has(button));
|
|
35940
|
+
if (kept.length !== members.length) {
|
|
35941
|
+
changed = true;
|
|
35942
|
+
}
|
|
35943
|
+
flat.push(...kept);
|
|
35944
|
+
} else if (isButtonSeparator(item)) {
|
|
35945
|
+
flat.push(item);
|
|
35946
|
+
} else if (item === 'dots') {
|
|
35947
|
+
hadDots = true;
|
|
35948
|
+
} else if (allowed.has(item)) {
|
|
35949
|
+
flat.push(item);
|
|
35950
|
+
} else {
|
|
35951
|
+
changed = true;
|
|
35952
|
+
}
|
|
35953
|
+
}
|
|
35954
|
+
if (!changed) {
|
|
35955
|
+
return list;
|
|
35956
|
+
}
|
|
35957
|
+
// Drop separators left dangling once the buttons around them were removed.
|
|
35958
|
+
const cleaned = [];
|
|
35959
|
+
for (const item of flat){
|
|
35960
|
+
if (isButtonSeparator(item) && (cleaned.length === 0 || isButtonSeparator(cleaned[cleaned.length - 1]))) {
|
|
35961
|
+
continue;
|
|
35962
|
+
}
|
|
35963
|
+
cleaned.push(item);
|
|
35964
|
+
}
|
|
35965
|
+
while(cleaned.length && isButtonSeparator(cleaned[cleaned.length - 1])){
|
|
35966
|
+
cleaned.pop();
|
|
35967
|
+
}
|
|
35968
|
+
// Keep the "show all" overflow button only if some requested button is still
|
|
35969
|
+
// hidden at this breakpoint.
|
|
35970
|
+
if (hadDots) {
|
|
35971
|
+
const shown = (0,jodit_core_ui_helpers_buttons__WEBPACK_IMPORTED_MODULE_2__.flatButtonsSet)(cleaned, editor);
|
|
35972
|
+
if ((0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_1__.toArray)(allowed).some((button)=>!shown.has(button))) {
|
|
35973
|
+
cleaned.push('dots');
|
|
35974
|
+
}
|
|
35975
|
+
}
|
|
35976
|
+
return cleaned;
|
|
35977
|
+
}
|
|
35915
35978
|
/**
|
|
35916
35979
|
* Rebuild toolbar in depends on editor's width
|
|
35917
35980
|
*/ function mobile(editor) {
|
|
@@ -35952,12 +36015,12 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.dots = {
|
|
|
35952
36015
|
return (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_1__.splitArray)(editor.o.buttons);
|
|
35953
36016
|
}
|
|
35954
36017
|
if (width >= editor.o.sizeMD) {
|
|
35955
|
-
return (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_1__.splitArray)(editor.o.buttonsMD);
|
|
36018
|
+
return fitToButtons((0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_1__.splitArray)(editor.o.buttonsMD), editor);
|
|
35956
36019
|
}
|
|
35957
36020
|
if (width >= editor.o.sizeSM) {
|
|
35958
|
-
return (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_1__.splitArray)(editor.o.buttonsSM);
|
|
36021
|
+
return fitToButtons((0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_1__.splitArray)(editor.o.buttonsSM), editor);
|
|
35959
36022
|
}
|
|
35960
|
-
return (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_1__.splitArray)(editor.o.buttonsXS);
|
|
36023
|
+
return fitToButtons((0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_1__.splitArray)(editor.o.buttonsXS), editor);
|
|
35961
36024
|
})();
|
|
35962
36025
|
if (newStore.toString() !== store.toString()) {
|
|
35963
36026
|
store = newStore;
|