jodit 4.13.8 → 4.13.10
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/README.md +27 -19
- 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 +5 -1
- package/types/config.d.ts +10 -0
- package/types/plugins/mobile/config.d.ts +10 -0
package/es2021/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.10
|
|
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.10";
|
|
1847
1847
|
// prettier-ignore
|
|
1848
1848
|
const ES = "es2021";
|
|
1849
1849
|
const IS_ES_MODERN = true;
|
|
@@ -36666,6 +36666,69 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.dots = {
|
|
|
36666
36666
|
|
|
36667
36667
|
|
|
36668
36668
|
|
|
36669
|
+
const isButtonSeparator = (item)=>item === '|' || item === '---' || item === '\n';
|
|
36670
|
+
/**
|
|
36671
|
+
* Constrain a responsive breakpoint set (`buttonsMD/SM/XS`) to the buttons the
|
|
36672
|
+
* user actually asked for via `buttons`. Those breakpoint defaults are
|
|
36673
|
+
* group-based supersets, so a custom (smaller) `buttons` list would otherwise
|
|
36674
|
+
* see *extra* buttons appear on resize when the toolbar switched to a breakpoint
|
|
36675
|
+
* set — resizing must only ever drop buttons, never add ones outside `buttons`.
|
|
36676
|
+
*
|
|
36677
|
+
* When the breakpoint set introduces nothing outside `buttons` (the default
|
|
36678
|
+
* case, where `buttons` is the full superset), the list is returned untouched so
|
|
36679
|
+
* the standard grouped mobile layout — groups, separators and `dots` — is
|
|
36680
|
+
* preserved. See #1389.
|
|
36681
|
+
*/ function fitToButtons(list, editor) {
|
|
36682
|
+
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);
|
|
36683
|
+
const groups = editor.getRegisteredButtonGroups();
|
|
36684
|
+
let changed = false;
|
|
36685
|
+
let hadDots = false;
|
|
36686
|
+
const flat = [];
|
|
36687
|
+
for (const item of list){
|
|
36688
|
+
if ((0,jodit_core_ui_helpers_buttons__WEBPACK_IMPORTED_MODULE_2__.isButtonGroup)(item)) {
|
|
36689
|
+
const members = [
|
|
36690
|
+
...item.buttons,
|
|
36691
|
+
...groups[item.group] ?? []
|
|
36692
|
+
];
|
|
36693
|
+
const kept = members.filter((button)=>allowed.has(button));
|
|
36694
|
+
if (kept.length !== members.length) {
|
|
36695
|
+
changed = true;
|
|
36696
|
+
}
|
|
36697
|
+
flat.push(...kept);
|
|
36698
|
+
} else if (isButtonSeparator(item)) {
|
|
36699
|
+
flat.push(item);
|
|
36700
|
+
} else if (item === 'dots') {
|
|
36701
|
+
hadDots = true;
|
|
36702
|
+
} else if (allowed.has(item)) {
|
|
36703
|
+
flat.push(item);
|
|
36704
|
+
} else {
|
|
36705
|
+
changed = true;
|
|
36706
|
+
}
|
|
36707
|
+
}
|
|
36708
|
+
if (!changed) {
|
|
36709
|
+
return list;
|
|
36710
|
+
}
|
|
36711
|
+
// Drop separators left dangling once the buttons around them were removed.
|
|
36712
|
+
const cleaned = [];
|
|
36713
|
+
for (const item of flat){
|
|
36714
|
+
if (isButtonSeparator(item) && (cleaned.length === 0 || isButtonSeparator(cleaned[cleaned.length - 1]))) {
|
|
36715
|
+
continue;
|
|
36716
|
+
}
|
|
36717
|
+
cleaned.push(item);
|
|
36718
|
+
}
|
|
36719
|
+
while(cleaned.length && isButtonSeparator(cleaned[cleaned.length - 1])){
|
|
36720
|
+
cleaned.pop();
|
|
36721
|
+
}
|
|
36722
|
+
// Keep the "show all" overflow button only if some requested button is still
|
|
36723
|
+
// hidden at this breakpoint.
|
|
36724
|
+
if (hadDots) {
|
|
36725
|
+
const shown = (0,jodit_core_ui_helpers_buttons__WEBPACK_IMPORTED_MODULE_2__.flatButtonsSet)(cleaned, editor);
|
|
36726
|
+
if ((0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_1__.toArray)(allowed).some((button)=>!shown.has(button))) {
|
|
36727
|
+
cleaned.push('dots');
|
|
36728
|
+
}
|
|
36729
|
+
}
|
|
36730
|
+
return cleaned;
|
|
36731
|
+
}
|
|
36669
36732
|
/**
|
|
36670
36733
|
* Rebuild toolbar in depends on editor's width
|
|
36671
36734
|
*/ function mobile(editor) {
|
|
@@ -36706,12 +36769,12 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.dots = {
|
|
|
36706
36769
|
return (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_1__.splitArray)(editor.o.buttons);
|
|
36707
36770
|
}
|
|
36708
36771
|
if (width >= editor.o.sizeMD) {
|
|
36709
|
-
return (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_1__.splitArray)(editor.o.buttonsMD);
|
|
36772
|
+
return fitToButtons((0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_1__.splitArray)(editor.o.buttonsMD), editor);
|
|
36710
36773
|
}
|
|
36711
36774
|
if (width >= editor.o.sizeSM) {
|
|
36712
|
-
return (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_1__.splitArray)(editor.o.buttonsSM);
|
|
36775
|
+
return fitToButtons((0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_1__.splitArray)(editor.o.buttonsSM), editor);
|
|
36713
36776
|
}
|
|
36714
|
-
return (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_1__.splitArray)(editor.o.buttonsXS);
|
|
36777
|
+
return fitToButtons((0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_1__.splitArray)(editor.o.buttonsXS), editor);
|
|
36715
36778
|
})();
|
|
36716
36779
|
if (newStore.toString() !== store.toString()) {
|
|
36717
36780
|
store = newStore;
|