jodit 4.13.18 → 4.13.20
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 +18 -0
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.js +5 -5
- package/es2015/jodit.js +205 -115
- package/es2015/jodit.min.js +9 -9
- 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 +9 -9
- package/es2018/jodit.min.js +5 -5
- 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 +15 -15
- package/es2021/jodit.js +201 -111
- package/es2021/jodit.min.js +8 -8
- 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 +8 -8
- package/es2021.en/jodit.js +201 -111
- package/es2021.en/jodit.min.js +8 -8
- 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 +501 -407
- 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 +6 -6
- package/es5/plugins/speech-recognize/speech-recognize.min.js +2 -2
- package/es5/polyfills.fat.min.js +1 -1
- package/es5/polyfills.js +13 -19
- package/es5/polyfills.min.js +1 -1
- package/esm/core/constants.js +1 -1
- package/esm/modules/toolbar/button/button.d.ts +1 -0
- package/esm/modules/toolbar/button/button.js +13 -0
- package/esm/plugins/search/ui/search.js +24 -4
- package/esm/plugins/table/config.js +79 -19
- package/package.json +1 -1
- package/types/modules/toolbar/button/button.d.ts +1 -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.20
|
|
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.20";
|
|
1847
1847
|
// prettier-ignore
|
|
1848
1848
|
const ES = "es2021";
|
|
1849
1849
|
const IS_ES_MODERN = true;
|
|
@@ -23698,27 +23698,28 @@ const instance = (j)=>j.getInstance('Table', j.o);
|
|
|
23698
23698
|
/* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25045);
|
|
23699
23699
|
/* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31635);
|
|
23700
23700
|
/* harmony import */ var jodit_core_component_statuses__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(69364);
|
|
23701
|
-
/* harmony import */ var
|
|
23702
|
-
/* harmony import */ var
|
|
23703
|
-
/* harmony import */ var
|
|
23704
|
-
/* harmony import */ var
|
|
23705
|
-
/* harmony import */ var
|
|
23706
|
-
/* harmony import */ var
|
|
23707
|
-
/* harmony import */ var
|
|
23708
|
-
/* harmony import */ var
|
|
23709
|
-
/* harmony import */ var
|
|
23710
|
-
/* harmony import */ var
|
|
23711
|
-
/* harmony import */ var
|
|
23712
|
-
/* harmony import */ var
|
|
23713
|
-
/* harmony import */ var
|
|
23714
|
-
/* harmony import */ var
|
|
23715
|
-
/* harmony import */ var
|
|
23716
|
-
/* harmony import */ var
|
|
23717
|
-
/* harmony import */ var
|
|
23718
|
-
/* harmony import */ var
|
|
23719
|
-
/* harmony import */ var
|
|
23720
|
-
/* harmony import */ var
|
|
23721
|
-
/* harmony import */ var
|
|
23701
|
+
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(81937);
|
|
23702
|
+
/* harmony import */ var jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(49574);
|
|
23703
|
+
/* harmony import */ var jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(51676);
|
|
23704
|
+
/* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(91672);
|
|
23705
|
+
/* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(68616);
|
|
23706
|
+
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(23211);
|
|
23707
|
+
/* harmony import */ var jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(17312);
|
|
23708
|
+
/* harmony import */ var jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(91565);
|
|
23709
|
+
/* harmony import */ var jodit_core_helpers_checker_is_jodit_object__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(24497);
|
|
23710
|
+
/* harmony import */ var jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(62101);
|
|
23711
|
+
/* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(85932);
|
|
23712
|
+
/* harmony import */ var jodit_core_helpers_size__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(86878);
|
|
23713
|
+
/* harmony import */ var jodit_core_helpers_string_camel_case__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(57821);
|
|
23714
|
+
/* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(28712);
|
|
23715
|
+
/* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_16__);
|
|
23716
|
+
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(7909);
|
|
23717
|
+
/* harmony import */ var jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(71125);
|
|
23718
|
+
/* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(59400);
|
|
23719
|
+
/* harmony import */ var jodit_core_ui_helpers_get_control_type__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(15982);
|
|
23720
|
+
/* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(29434);
|
|
23721
|
+
/* harmony import */ var jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(51116);
|
|
23722
|
+
/* harmony import */ var _factory__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(4274);
|
|
23722
23723
|
/*!
|
|
23723
23724
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
23724
23725
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -23751,7 +23752,8 @@ const instance = (j)=>j.getInstance('Table', j.o);
|
|
|
23751
23752
|
|
|
23752
23753
|
|
|
23753
23754
|
|
|
23754
|
-
|
|
23755
|
+
|
|
23756
|
+
class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__.UIButton {
|
|
23755
23757
|
className() {
|
|
23756
23758
|
return 'ToolbarButton';
|
|
23757
23759
|
}
|
|
@@ -23762,13 +23764,13 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
|
|
|
23762
23764
|
super.updateAriaLabel();
|
|
23763
23765
|
if (this.trigger) {
|
|
23764
23766
|
const i8nTooltip = this.state.tooltip ? this.jodit.i18n(this.state.tooltip) : null;
|
|
23765
|
-
(0,
|
|
23767
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_17__.attr)(this.trigger, 'aria-label', i8nTooltip);
|
|
23766
23768
|
}
|
|
23767
23769
|
}
|
|
23768
23770
|
/**
|
|
23769
23771
|
* Get parent toolbar
|
|
23770
23772
|
*/ get toolbar() {
|
|
23771
|
-
const ToolbarCollection = (0,
|
|
23773
|
+
const ToolbarCollection = (0,jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_6__.getComponentClass)('ToolbarCollection');
|
|
23772
23774
|
return this.closest(ToolbarCollection);
|
|
23773
23775
|
}
|
|
23774
23776
|
update() {
|
|
@@ -23788,7 +23790,7 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
|
|
|
23788
23790
|
/**
|
|
23789
23791
|
* Calculates whether the button is active
|
|
23790
23792
|
*/ __calculateActivatedStatus(tc) {
|
|
23791
|
-
if ((0,
|
|
23793
|
+
if ((0,jodit_core_helpers_checker_is_jodit_object__WEBPACK_IMPORTED_MODULE_11__.isJoditObject)(this.j) && !this.j.editorIsActive) {
|
|
23792
23794
|
return false;
|
|
23793
23795
|
}
|
|
23794
23796
|
if (this.control.isActive?.(this.j, this)) {
|
|
@@ -23811,11 +23813,11 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
|
|
|
23811
23813
|
return Boolean(tc && tc.shouldBeDisabled(this));
|
|
23812
23814
|
}
|
|
23813
23815
|
onChangeActivated() {
|
|
23814
|
-
(0,
|
|
23816
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_17__.attr)(this.button, 'aria-pressed', this.state.activated);
|
|
23815
23817
|
super.onChangeActivated();
|
|
23816
23818
|
}
|
|
23817
23819
|
onChangeText() {
|
|
23818
|
-
if ((0,
|
|
23820
|
+
if ((0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_10__.isFunction)(this.control.template)) {
|
|
23819
23821
|
this.text.innerHTML = this.control.template(this.j, this.control.name, this.j.i18n(this.state.text));
|
|
23820
23822
|
} else {
|
|
23821
23823
|
super.onChangeText();
|
|
@@ -23823,7 +23825,8 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
|
|
|
23823
23825
|
this.setMod('text-icons', Boolean(this.text.innerText.trim().length));
|
|
23824
23826
|
}
|
|
23825
23827
|
onChangeTabIndex() {
|
|
23826
|
-
(0,
|
|
23828
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_17__.attr)(this.button, 'tabindex', this.state.tabIndex);
|
|
23829
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_17__.attr)(this.trigger, 'tabindex', this.state.tabIndex);
|
|
23827
23830
|
}
|
|
23828
23831
|
createContainer() {
|
|
23829
23832
|
const cn = this.componentName;
|
|
@@ -23836,7 +23839,7 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
|
|
|
23836
23839
|
configurable: true
|
|
23837
23840
|
});
|
|
23838
23841
|
container.appendChild(button);
|
|
23839
|
-
const trigger = this.j.c.fromHTML(`<span role="button" aria-haspopup="true" aria-expanded="false" class="${cn}__trigger">${
|
|
23842
|
+
const trigger = this.j.c.fromHTML(`<span role="button" aria-haspopup="true" aria-expanded="false" class="${cn}__trigger">${jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_21__.Icon.get('chevron')}</span>`);
|
|
23840
23843
|
// For caching
|
|
23841
23844
|
button.appendChild(trigger);
|
|
23842
23845
|
return container;
|
|
@@ -23848,15 +23851,15 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
|
|
|
23848
23851
|
if (this.state.hasTrigger) {
|
|
23849
23852
|
this.container.appendChild(this.trigger);
|
|
23850
23853
|
} else {
|
|
23851
|
-
|
|
23854
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.safeRemove(this.trigger);
|
|
23852
23855
|
}
|
|
23853
23856
|
this.setMod('with-trigger', this.state.hasTrigger || null);
|
|
23854
23857
|
}
|
|
23855
23858
|
/** @override */ onChangeDisabled() {
|
|
23856
23859
|
const disabled = this.state.disabled ? 'disabled' : null;
|
|
23857
|
-
(0,
|
|
23858
|
-
(0,
|
|
23859
|
-
(0,
|
|
23860
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_17__.attr)(this.trigger, 'disabled', disabled);
|
|
23861
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_17__.attr)(this.button, 'disabled', disabled);
|
|
23862
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_17__.attr)(this.container, 'disabled', disabled);
|
|
23860
23863
|
}
|
|
23861
23864
|
/**
|
|
23862
23865
|
* Init constant data from control
|
|
@@ -23866,19 +23869,19 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
|
|
|
23866
23869
|
state.name = ctr.name;
|
|
23867
23870
|
this.__initIconFromControl();
|
|
23868
23871
|
if (ctr.tooltip) {
|
|
23869
|
-
state.tooltip = (0,
|
|
23872
|
+
state.tooltip = (0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_10__.isFunction)(ctr.tooltip) ? ctr.tooltip(this.j, ctr, this) : ctr.tooltip;
|
|
23870
23873
|
}
|
|
23871
23874
|
state.hasTrigger = Boolean(ctr.list || ctr.popup && ctr.exec);
|
|
23872
23875
|
}
|
|
23873
23876
|
__initIconFromControl() {
|
|
23874
23877
|
const { control: ctr, state } = this;
|
|
23875
23878
|
const { textIcons } = this.j.o;
|
|
23876
|
-
if (textIcons === true || (0,
|
|
23877
|
-
state.icon = (0,
|
|
23879
|
+
if (textIcons === true || (0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_10__.isFunction)(textIcons) && textIcons(ctr.name) || ctr.template) {
|
|
23880
|
+
state.icon = (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__.UIButtonState)().icon;
|
|
23878
23881
|
state.text = ctr.text || ctr.name;
|
|
23879
23882
|
return;
|
|
23880
23883
|
}
|
|
23881
|
-
if (!(0,
|
|
23884
|
+
if (!(0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_13__.isString)(ctr.icon) && ctr.icon != null) {
|
|
23882
23885
|
state.icon = {
|
|
23883
23886
|
name: ctr.icon.name || ctr.name,
|
|
23884
23887
|
iconURL: ctr.icon.iconURL || '',
|
|
@@ -23891,7 +23894,7 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
|
|
|
23891
23894
|
state.icon.iconURL = ctr.iconURL;
|
|
23892
23895
|
} else {
|
|
23893
23896
|
const name = ctr.icon || ctr.name;
|
|
23894
|
-
state.icon.name =
|
|
23897
|
+
state.icon.name = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_21__.Icon.exists(name) || this.j.o.extraIcons?.[name] ? name : '';
|
|
23895
23898
|
}
|
|
23896
23899
|
if (!ctr.iconURL && !state.icon.name) {
|
|
23897
23900
|
state.text = ctr.text || ctr.name;
|
|
@@ -23905,22 +23908,22 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
|
|
|
23905
23908
|
return;
|
|
23906
23909
|
}
|
|
23907
23910
|
const { control: ctr } = this;
|
|
23908
|
-
(0,
|
|
23911
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_17__.attr)(this.trigger, 'aria-expanded', true);
|
|
23909
23912
|
e.buffer = {
|
|
23910
23913
|
actionTrigger: this
|
|
23911
23914
|
};
|
|
23912
23915
|
if (ctr.list) {
|
|
23913
23916
|
return this.__openControlList(ctr);
|
|
23914
23917
|
}
|
|
23915
|
-
if ((0,
|
|
23918
|
+
if ((0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_10__.isFunction)(ctr.popup)) {
|
|
23916
23919
|
const popup = this.openPopup();
|
|
23917
23920
|
popup.parentElement = this;
|
|
23918
23921
|
try {
|
|
23919
|
-
if (this.j.e.fire((0,
|
|
23922
|
+
if (this.j.e.fire((0,jodit_core_helpers_string_camel_case__WEBPACK_IMPORTED_MODULE_15__.camelCase)(`before-${ctr.name}-open-popup`), this.target, ctr, popup) !== false) {
|
|
23920
23923
|
const target = this.toolbar?.getTarget(this) ?? this.target ?? null;
|
|
23921
23924
|
const elm = ctr.popup(this.j, target, this.__closePopup, this);
|
|
23922
23925
|
if (elm) {
|
|
23923
|
-
popup.setContent((0,
|
|
23926
|
+
popup.setContent((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_13__.isString)(elm) ? this.j.c.fromHTML(elm) : elm).open(()=>(0,jodit_core_helpers_size__WEBPACK_IMPORTED_MODULE_14__.position)(this.container), false, this.j.o.allowTabNavigation ? this.container : undefined);
|
|
23924
23927
|
} else {
|
|
23925
23928
|
this.__closePopup();
|
|
23926
23929
|
}
|
|
@@ -23933,28 +23936,39 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
|
|
|
23933
23936
|
* Fired after the popup was opened for some control button
|
|
23934
23937
|
*/ /**
|
|
23935
23938
|
* Close all opened popups
|
|
23936
|
-
*/ this.j.e.fire((0,
|
|
23939
|
+
*/ this.j.e.fire((0,jodit_core_helpers_string_camel_case__WEBPACK_IMPORTED_MODULE_15__.camelCase)(`after-${ctr.name}-open-popup`), popup.container);
|
|
23940
|
+
}
|
|
23941
|
+
}
|
|
23942
|
+
onTriggerKeyDown(e) {
|
|
23943
|
+
if (this.state.disabled || ![
|
|
23944
|
+
jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.KEY_ENTER,
|
|
23945
|
+
jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.KEY_SPACE,
|
|
23946
|
+
' '
|
|
23947
|
+
].includes(e.key)) {
|
|
23948
|
+
return;
|
|
23937
23949
|
}
|
|
23950
|
+
e.preventDefault();
|
|
23951
|
+
this.trigger.click();
|
|
23938
23952
|
}
|
|
23939
23953
|
/**
|
|
23940
23954
|
* Create an open popup list
|
|
23941
23955
|
*/ __openControlList(control) {
|
|
23942
|
-
const controls = this.jodit.options.controls ?? {}, getControl = (key)=>(0,
|
|
23956
|
+
const controls = this.jodit.options.controls ?? {}, getControl = (key)=>(0,jodit_core_ui_helpers_get_control_type__WEBPACK_IMPORTED_MODULE_20__.findControlType)(key, controls);
|
|
23943
23957
|
const list = control.list;
|
|
23944
23958
|
const menu = this.openPopup();
|
|
23945
|
-
const toolbar = (0,
|
|
23959
|
+
const toolbar = (0,_factory__WEBPACK_IMPORTED_MODULE_23__.makeCollection)(this.j);
|
|
23946
23960
|
menu.parentElement = this;
|
|
23947
23961
|
toolbar.parentElement = menu;
|
|
23948
23962
|
toolbar.mode = 'vertical';
|
|
23949
|
-
const isListItem = (key)=>(0,
|
|
23963
|
+
const isListItem = (key)=>(0,jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_12__.isPlainObject)(key) && 'title' in key && 'value' in key;
|
|
23950
23964
|
const getButton = (key, value)=>{
|
|
23951
|
-
if ((0,
|
|
23965
|
+
if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_13__.isString)(value) && getControl(value)) {
|
|
23952
23966
|
return {
|
|
23953
23967
|
name: value.toString(),
|
|
23954
23968
|
...getControl(value)
|
|
23955
23969
|
};
|
|
23956
23970
|
}
|
|
23957
|
-
if ((0,
|
|
23971
|
+
if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_13__.isString)(key) && getControl(key)) {
|
|
23958
23972
|
return {
|
|
23959
23973
|
name: key.toString(),
|
|
23960
23974
|
...getControl(key),
|
|
@@ -23985,26 +23999,26 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
|
|
|
23985
23999
|
value
|
|
23986
24000
|
]
|
|
23987
24001
|
};
|
|
23988
|
-
if ((0,
|
|
24002
|
+
if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_13__.isString)(value)) {
|
|
23989
24003
|
childControl.text = value;
|
|
23990
24004
|
}
|
|
23991
24005
|
return childControl;
|
|
23992
24006
|
};
|
|
23993
|
-
toolbar.build((0,
|
|
23994
|
-
menu.setContent(toolbar).open(()=>(0,
|
|
24007
|
+
toolbar.build((0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_9__.isArray)(list) ? list.map(getButton) : (0,jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_18__.keys)(list, false).map((key)=>getButton(key, list[key])), this.target);
|
|
24008
|
+
menu.setContent(toolbar).open(()=>(0,jodit_core_helpers_size__WEBPACK_IMPORTED_MODULE_14__.position)(this.container), false, this.j.o.allowTabNavigation ? this.container : undefined);
|
|
23995
24009
|
this.state.activated = true;
|
|
23996
24010
|
}
|
|
23997
24011
|
onOutsideClick(e) {
|
|
23998
24012
|
if (!this.openedPopup) {
|
|
23999
24013
|
return;
|
|
24000
24014
|
}
|
|
24001
|
-
if (!e || !
|
|
24015
|
+
if (!e || !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isNode(e.target) || !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isOrContains(this.container, e.target) && !this.openedPopup.isOwnClick(e)) {
|
|
24002
24016
|
this.__closePopup();
|
|
24003
24017
|
}
|
|
24004
24018
|
}
|
|
24005
24019
|
openPopup() {
|
|
24006
24020
|
this.__closePopup();
|
|
24007
|
-
this.openedPopup = new
|
|
24021
|
+
this.openedPopup = new jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_22__.Popup(this.j, false);
|
|
24008
24022
|
this.j.e.on(this.ow, 'mousedown touchstart', this.onOutsideClick).on('escape closeAllPopups', this.onOutsideClick);
|
|
24009
24023
|
return this.openedPopup;
|
|
24010
24024
|
}
|
|
@@ -24016,7 +24030,7 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
|
|
|
24016
24030
|
this.openedPopup.destruct();
|
|
24017
24031
|
this.openedPopup = null;
|
|
24018
24032
|
if (this.trigger) {
|
|
24019
|
-
(0,
|
|
24033
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_17__.attr)(this.trigger, 'aria-expanded', false);
|
|
24020
24034
|
}
|
|
24021
24035
|
}
|
|
24022
24036
|
}
|
|
@@ -24024,7 +24038,7 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
|
|
|
24024
24038
|
* Click handler
|
|
24025
24039
|
*/ onClick(originalEvent) {
|
|
24026
24040
|
const { control: ctr } = this;
|
|
24027
|
-
if ((0,
|
|
24041
|
+
if ((0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_10__.isFunction)(ctr.exec)) {
|
|
24028
24042
|
const target = this.toolbar?.getTarget(this) ?? this.target ?? null;
|
|
24029
24043
|
const result = ctr.exec(this.j, target, {
|
|
24030
24044
|
control: ctr,
|
|
@@ -24048,11 +24062,11 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
|
|
|
24048
24062
|
if (ctr.list) {
|
|
24049
24063
|
return this.__openControlList(ctr);
|
|
24050
24064
|
}
|
|
24051
|
-
if ((0,
|
|
24065
|
+
if ((0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_10__.isFunction)(ctr.popup)) {
|
|
24052
24066
|
return this.onTriggerClick(originalEvent);
|
|
24053
24067
|
}
|
|
24054
24068
|
if (ctr.command || ctr.name) {
|
|
24055
|
-
(0,
|
|
24069
|
+
(0,jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_18__.call)((0,jodit_core_helpers_checker_is_jodit_object__WEBPACK_IMPORTED_MODULE_11__.isJoditObject)(this.j) ? this.j.execCommand.bind(this.j) : this.j.od.execCommand.bind(this.j.od), ctr.command || ctr.name, false, ctr.args && ctr.args[0]);
|
|
24056
24070
|
this.j.e.fire('closeAllPopups');
|
|
24057
24071
|
}
|
|
24058
24072
|
}
|
|
@@ -24062,20 +24076,20 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
|
|
|
24062
24076
|
}
|
|
24063
24077
|
constructor(jodit, control, target = null){
|
|
24064
24078
|
super(jodit), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "control", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "target", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "state", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "trigger", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "openedPopup", void 0), this.control = control, this.target = target, this.state = {
|
|
24065
|
-
...(0,
|
|
24079
|
+
...(0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__.UIButtonState)(),
|
|
24066
24080
|
theme: 'toolbar',
|
|
24067
24081
|
currentValue: '',
|
|
24068
24082
|
hasTrigger: false
|
|
24069
24083
|
}, this.openedPopup = null;
|
|
24070
24084
|
const button = this.getElm('button');
|
|
24071
|
-
(0,
|
|
24085
|
+
(0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_16__.assert)(button, 'Element button should exists');
|
|
24072
24086
|
this.button = button;
|
|
24073
24087
|
Object.defineProperty(button, 'component', {
|
|
24074
24088
|
value: this,
|
|
24075
24089
|
configurable: true
|
|
24076
24090
|
});
|
|
24077
24091
|
const trigger = this.getElm('trigger');
|
|
24078
|
-
(0,
|
|
24092
|
+
(0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_16__.assert)(trigger, 'Element trigger should exists');
|
|
24079
24093
|
this.trigger = trigger;
|
|
24080
24094
|
trigger.remove();
|
|
24081
24095
|
// Prevent lost focus
|
|
@@ -24096,24 +24110,27 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
|
|
|
24096
24110
|
}
|
|
24097
24111
|
}
|
|
24098
24112
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
24099
|
-
|
|
24113
|
+
jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__.cacheHTML
|
|
24100
24114
|
], ToolbarButton.prototype, "createContainer", null);
|
|
24101
24115
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
24102
|
-
(0,
|
|
24116
|
+
(0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_7__.watch)('state.hasTrigger', {
|
|
24103
24117
|
immediately: false
|
|
24104
24118
|
})
|
|
24105
24119
|
], ToolbarButton.prototype, "onChangeHasTrigger", null);
|
|
24106
24120
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
24107
|
-
(0,
|
|
24121
|
+
(0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_7__.watch)('trigger:click')
|
|
24108
24122
|
], ToolbarButton.prototype, "onTriggerClick", null);
|
|
24109
24123
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
24110
|
-
|
|
24124
|
+
(0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_7__.watch)('trigger:keydown')
|
|
24125
|
+
], ToolbarButton.prototype, "onTriggerKeyDown", null);
|
|
24126
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
24127
|
+
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_4__.autobind
|
|
24111
24128
|
], ToolbarButton.prototype, "onOutsideClick", null);
|
|
24112
24129
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
24113
|
-
|
|
24130
|
+
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_4__.autobind
|
|
24114
24131
|
], ToolbarButton.prototype, "__closePopup", null);
|
|
24115
24132
|
ToolbarButton = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
24116
|
-
|
|
24133
|
+
jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_6__.component
|
|
24117
24134
|
], ToolbarButton);
|
|
24118
24135
|
|
|
24119
24136
|
|
|
@@ -39185,10 +39202,26 @@ class UISearch extends jodit_core_ui__WEBPACK_IMPORTED_MODULE_6__.UIElement {
|
|
|
39185
39202
|
this.replaceButton = replaceBtn;
|
|
39186
39203
|
this.currentBox = current;
|
|
39187
39204
|
this.countBox = count;
|
|
39205
|
+
const closeAction = ()=>this.close();
|
|
39206
|
+
const replaceAction = ()=>void jodit.e.fire(this, 'pressReplaceButton');
|
|
39207
|
+
const nextAction = ()=>void jodit.e.fire('searchNext');
|
|
39208
|
+
const prevAction = ()=>void jodit.e.fire('searchPrevious');
|
|
39209
|
+
// Pointer activation is handled on `pointerdown` (returning `false`
|
|
39210
|
+
// there keeps the focus and selection intact), but activating a
|
|
39211
|
+
// native button from the keyboard (Enter/Space) fires only `click`
|
|
39212
|
+
// with `detail === 0` — handle that path separately. Pointer clicks
|
|
39213
|
+
// arrive with `detail >= 1`, so the action does not run twice.
|
|
39214
|
+
// See https://github.com/xdan/jodit/issues/1440
|
|
39215
|
+
const onKeyboardActivate = (action)=>(e)=>{
|
|
39216
|
+
if (!e.detail) {
|
|
39217
|
+
e.preventDefault();
|
|
39218
|
+
action();
|
|
39219
|
+
}
|
|
39220
|
+
};
|
|
39188
39221
|
jodit.e.on(this.closeButton, 'pointerdown', ()=>{
|
|
39189
|
-
|
|
39222
|
+
closeAction();
|
|
39190
39223
|
return false;
|
|
39191
|
-
}).on(this.queryInput, 'input', ()=>{
|
|
39224
|
+
}).on(this.closeButton, 'click', onKeyboardActivate(closeAction)).on(this.queryInput, 'input', ()=>{
|
|
39192
39225
|
this.currentIndex = 0;
|
|
39193
39226
|
}).on(this.queryInput, 'pointerdown', ()=>{
|
|
39194
39227
|
if (jodit.s.isFocused()) {
|
|
@@ -39196,15 +39229,15 @@ class UISearch extends jodit_core_ui__WEBPACK_IMPORTED_MODULE_6__.UIElement {
|
|
|
39196
39229
|
this.selInfo = jodit.s.save();
|
|
39197
39230
|
}
|
|
39198
39231
|
}).on(this.replaceButton, 'pointerdown', ()=>{
|
|
39199
|
-
|
|
39232
|
+
replaceAction();
|
|
39200
39233
|
return false;
|
|
39201
|
-
}).on(next, 'pointerdown', ()=>{
|
|
39202
|
-
|
|
39234
|
+
}).on(this.replaceButton, 'click', onKeyboardActivate(replaceAction)).on(next, 'pointerdown', ()=>{
|
|
39235
|
+
nextAction();
|
|
39203
39236
|
return false;
|
|
39204
|
-
}).on(prev, 'pointerdown', ()=>{
|
|
39205
|
-
|
|
39237
|
+
}).on(next, 'click', onKeyboardActivate(nextAction)).on(prev, 'pointerdown', ()=>{
|
|
39238
|
+
prevAction();
|
|
39206
39239
|
return false;
|
|
39207
|
-
}).on(this.queryInput, 'input', ()=>{
|
|
39240
|
+
}).on(prev, 'click', onKeyboardActivate(prevAction)).on(this.queryInput, 'input', ()=>{
|
|
39208
39241
|
this.setMod('empty-query', !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.trim)(this.queryInput.value).length);
|
|
39209
39242
|
}).on(this.queryInput, 'keydown', (()=>{
|
|
39210
39243
|
const debounced = this.j.async.debounce(async (e)=>{
|
|
@@ -42118,13 +42151,14 @@ function findCell(editor, key) {
|
|
|
42118
42151
|
/***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
|
|
42119
42152
|
|
|
42120
42153
|
"use strict";
|
|
42121
|
-
/* harmony import */ var
|
|
42122
|
-
/* harmony import */ var
|
|
42123
|
-
/* harmony import */ var
|
|
42124
|
-
/* harmony import */ var
|
|
42125
|
-
/* harmony import */ var
|
|
42126
|
-
/* harmony import */ var
|
|
42127
|
-
/* harmony import */ var
|
|
42154
|
+
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
|
|
42155
|
+
/* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(27795);
|
|
42156
|
+
/* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65946);
|
|
42157
|
+
/* harmony import */ var jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(93640);
|
|
42158
|
+
/* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29434);
|
|
42159
|
+
/* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5266);
|
|
42160
|
+
/* harmony import */ var _table_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(67447);
|
|
42161
|
+
/* harmony import */ var _table_svg__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_table_svg__WEBPACK_IMPORTED_MODULE_6__);
|
|
42128
42162
|
/*!
|
|
42129
42163
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
42130
42164
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -42137,13 +42171,14 @@ function findCell(editor, key) {
|
|
|
42137
42171
|
|
|
42138
42172
|
|
|
42139
42173
|
|
|
42140
|
-
|
|
42174
|
+
|
|
42175
|
+
jodit_config__WEBPACK_IMPORTED_MODULE_5__.Config.prototype.table = {
|
|
42141
42176
|
splitBlockOnInsertTable: true,
|
|
42142
42177
|
selectionCellStyle: 'border: 1px double #1e88e5 !important;',
|
|
42143
42178
|
useExtraClassesOptions: false
|
|
42144
42179
|
};
|
|
42145
|
-
|
|
42146
|
-
|
|
42180
|
+
jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_4__.Icon.set('table', (_table_svg__WEBPACK_IMPORTED_MODULE_6___default()));
|
|
42181
|
+
jodit_config__WEBPACK_IMPORTED_MODULE_5__.Config.prototype.controls.table = {
|
|
42147
42182
|
data: {
|
|
42148
42183
|
cols: 10,
|
|
42149
42184
|
rows: 10,
|
|
@@ -42173,19 +42208,25 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.table = {
|
|
|
42173
42208
|
};
|
|
42174
42209
|
const form = editor.c.fromHTML('<form class="jodit-form jodit-form__inserter">' + '<div class="jodit-form__table-creator-box">' + '<div class="jodit-form__container"></div>' + '<div class="jodit-form__options">' + generateExtraClasses() + '</div>' + '</div>' + '<label class="jodit-form__center">' + '<span>1</span> × <span>1</span>' + '</label>' + '</form>'), rows = form.querySelectorAll('span')[0], cols = form.querySelectorAll('span')[1], blocksContainer = form.querySelector('.jodit-form__container'), options = form.querySelector('.jodit-form__options'), cells = [];
|
|
42175
42210
|
const cnt = default_rows_count * default_cols_count;
|
|
42211
|
+
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(blocksContainer, {
|
|
42212
|
+
role: 'grid',
|
|
42213
|
+
ariaLabel: 'Table size',
|
|
42214
|
+
ariaRowcount: default_rows_count,
|
|
42215
|
+
ariaColcount: default_cols_count
|
|
42216
|
+
});
|
|
42176
42217
|
for(let i = 0; i < cnt; i += 1){
|
|
42177
42218
|
if (!cells[i]) {
|
|
42219
|
+
const row = Math.floor(i / default_cols_count) + 1, col = i % default_cols_count + 1;
|
|
42178
42220
|
cells.push(editor.c.element('span', {
|
|
42179
|
-
dataIndex: i
|
|
42221
|
+
dataIndex: i,
|
|
42222
|
+
role: 'gridcell',
|
|
42223
|
+
tabindex: i === 0 ? 0 : -1,
|
|
42224
|
+
ariaLabel: `${row} by ${col}`
|
|
42180
42225
|
}));
|
|
42181
42226
|
}
|
|
42182
42227
|
}
|
|
42183
|
-
const
|
|
42184
|
-
const
|
|
42185
|
-
if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(dv, 'span')) {
|
|
42186
|
-
return;
|
|
42187
|
-
}
|
|
42188
|
-
const k = index === undefined || isNaN(index) ? parseInt((0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_2__.attr)(dv, '-index') || '0', 10) : index || 0;
|
|
42228
|
+
const highlightCell = (cell)=>{
|
|
42229
|
+
const k = parseInt((0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(cell, '-index') || '0', 10);
|
|
42189
42230
|
const rows_count = Math.ceil((k + 1) / default_cols_count), cols_count = k % default_cols_count + 1;
|
|
42190
42231
|
for(let i = 0; i < cells.length; i += 1){
|
|
42191
42232
|
if (cols_count >= i % default_cols_count + 1 && rows_count >= Math.ceil((i + 1) / default_cols_count)) {
|
|
@@ -42197,14 +42238,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.table = {
|
|
|
42197
42238
|
cols.textContent = cols_count.toString();
|
|
42198
42239
|
rows.textContent = rows_count.toString();
|
|
42199
42240
|
};
|
|
42200
|
-
|
|
42201
|
-
const
|
|
42202
|
-
e.preventDefault();
|
|
42203
|
-
e.stopImmediatePropagation();
|
|
42204
|
-
if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(dv, 'span')) {
|
|
42205
|
-
return;
|
|
42206
|
-
}
|
|
42207
|
-
const k = parseInt((0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_2__.attr)(dv, '-index') || '0', 10);
|
|
42241
|
+
const insertTable = (cell)=>{
|
|
42242
|
+
const k = parseInt((0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(cell, '-index') || '0', 10);
|
|
42208
42243
|
const rows_count = Math.ceil((k + 1) / default_cols_count), cols_count = k % default_cols_count + 1;
|
|
42209
42244
|
const crt = editor.createInside, tbody = crt.element('tbody'), table = crt.element('table');
|
|
42210
42245
|
table.appendChild(tbody);
|
|
@@ -42216,7 +42251,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.table = {
|
|
|
42216
42251
|
if (!first_td) {
|
|
42217
42252
|
first_td = td;
|
|
42218
42253
|
}
|
|
42219
|
-
(0,
|
|
42254
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(td, 'width', (100 / cols_count).toFixed(4) + '%');
|
|
42220
42255
|
td.appendChild(crt.element('br'));
|
|
42221
42256
|
tr.appendChild(crt.text('\n'));
|
|
42222
42257
|
tr.appendChild(crt.text('\t'));
|
|
@@ -42225,7 +42260,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.table = {
|
|
|
42225
42260
|
tbody.appendChild(crt.text('\n'));
|
|
42226
42261
|
tbody.appendChild(tr);
|
|
42227
42262
|
}
|
|
42228
|
-
(0,
|
|
42263
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.$$)('input[type=checkbox]:checked', options).forEach((input)=>{
|
|
42229
42264
|
input.value.split(/[\s]+/).forEach((className)=>{
|
|
42230
42265
|
table.classList.add(className);
|
|
42231
42266
|
});
|
|
@@ -42234,15 +42269,15 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.table = {
|
|
|
42234
42269
|
editor.s.removeMarkers();
|
|
42235
42270
|
editor.editor.normalize();
|
|
42236
42271
|
editor.history.snapshot.restore(snapshot);
|
|
42237
|
-
const block =
|
|
42238
|
-
if (block &&
|
|
42239
|
-
|
|
42272
|
+
const block = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.furthest(editor.s.current(), jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock, editor.editor);
|
|
42273
|
+
if (block && jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(block)) {
|
|
42274
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.replace(block, table, undefined, false, true);
|
|
42240
42275
|
} else {
|
|
42241
42276
|
if (block) {
|
|
42242
42277
|
const fake = crt.text('\n');
|
|
42243
42278
|
if (!editor.o.table.splitBlockOnInsertTable) {
|
|
42244
|
-
|
|
42245
|
-
|
|
42279
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.after(block, fake);
|
|
42280
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.after(fake, table);
|
|
42246
42281
|
} else {
|
|
42247
42282
|
const range = editor.s.range;
|
|
42248
42283
|
range.collapse(false);
|
|
@@ -42251,9 +42286,9 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.table = {
|
|
|
42251
42286
|
editor.s.selectRange(range);
|
|
42252
42287
|
const firstPart = editor.s.splitSelection(block, fake);
|
|
42253
42288
|
if (firstPart) {
|
|
42254
|
-
|
|
42289
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.after(firstPart, table);
|
|
42255
42290
|
} else {
|
|
42256
|
-
|
|
42291
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.after(block, table);
|
|
42257
42292
|
}
|
|
42258
42293
|
}
|
|
42259
42294
|
} else {
|
|
@@ -42262,13 +42297,68 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.table = {
|
|
|
42262
42297
|
}
|
|
42263
42298
|
if (first_td) {
|
|
42264
42299
|
editor.s.setCursorIn(first_td);
|
|
42265
|
-
(0,
|
|
42300
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.scrollIntoViewIfNeeded)(first_td, editor.editor, editor.ed);
|
|
42266
42301
|
}
|
|
42267
42302
|
close();
|
|
42303
|
+
};
|
|
42304
|
+
editor.e.on(blocksContainer, 'mousemove', (e)=>{
|
|
42305
|
+
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(e.target, 'span')) {
|
|
42306
|
+
highlightCell(e.target);
|
|
42307
|
+
}
|
|
42308
|
+
}).on(blocksContainer, 'touchstart mousedown', (e)=>{
|
|
42309
|
+
if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(e.target, 'span')) {
|
|
42310
|
+
return;
|
|
42311
|
+
}
|
|
42312
|
+
e.preventDefault();
|
|
42313
|
+
e.stopImmediatePropagation();
|
|
42314
|
+
insertTable(e.target);
|
|
42315
|
+
}).on(blocksContainer, 'keydown', (e)=>{
|
|
42316
|
+
if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(e.target, 'span')) {
|
|
42317
|
+
return;
|
|
42318
|
+
}
|
|
42319
|
+
if (e.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_ENTER) {
|
|
42320
|
+
e.preventDefault();
|
|
42321
|
+
e.stopImmediatePropagation();
|
|
42322
|
+
insertTable(e.target);
|
|
42323
|
+
return;
|
|
42324
|
+
}
|
|
42325
|
+
if (e.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_ESC) {
|
|
42326
|
+
e.preventDefault();
|
|
42327
|
+
e.stopImmediatePropagation();
|
|
42328
|
+
close();
|
|
42329
|
+
return;
|
|
42330
|
+
}
|
|
42331
|
+
const index = parseInt((0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(e.target, '-index') || '0', 10), row = Math.floor(index / default_cols_count), col = index % default_cols_count;
|
|
42332
|
+
let nextIndex = index;
|
|
42333
|
+
switch(e.key){
|
|
42334
|
+
case jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_LEFT:
|
|
42335
|
+
nextIndex = col > 0 ? index - 1 : index;
|
|
42336
|
+
break;
|
|
42337
|
+
case jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_RIGHT:
|
|
42338
|
+
nextIndex = col < default_cols_count - 1 ? index + 1 : index;
|
|
42339
|
+
break;
|
|
42340
|
+
case jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_UP:
|
|
42341
|
+
nextIndex = row > 0 ? index - default_cols_count : index;
|
|
42342
|
+
break;
|
|
42343
|
+
case jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_DOWN:
|
|
42344
|
+
nextIndex = row < default_rows_count - 1 ? index + default_cols_count : index;
|
|
42345
|
+
break;
|
|
42346
|
+
default:
|
|
42347
|
+
return;
|
|
42348
|
+
}
|
|
42349
|
+
e.preventDefault();
|
|
42350
|
+
e.stopImmediatePropagation();
|
|
42351
|
+
if (nextIndex !== index) {
|
|
42352
|
+
cells[index].tabIndex = -1;
|
|
42353
|
+
cells[nextIndex].tabIndex = 0;
|
|
42354
|
+
cells[nextIndex].focus();
|
|
42355
|
+
highlightCell(cells[nextIndex]);
|
|
42356
|
+
}
|
|
42268
42357
|
});
|
|
42269
42358
|
if (button && button.parentElement) {
|
|
42270
42359
|
for(let i = 0; i < default_rows_count; i += 1){
|
|
42271
42360
|
const row = editor.c.div();
|
|
42361
|
+
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(row, 'role', 'row');
|
|
42272
42362
|
for(let j = 0; j < default_cols_count; j += 1){
|
|
42273
42363
|
row.appendChild(cells[i * default_cols_count + j]);
|
|
42274
42364
|
}
|