jodit 4.13.17 → 4.13.19
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 +4 -4
- package/es2015/jodit.js +191 -109
- package/es2015/jodit.min.js +4 -4
- 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 +4 -4
- 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 +187 -105
- 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 +187 -105
- 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 +477 -401
- 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/core/helpers/utils/scroll-into-view.d.ts +0 -3
- package/esm/core/helpers/utils/scroll-into-view.js +12 -2
- package/esm/modules/toolbar/button/button.d.ts +1 -0
- package/esm/modules/toolbar/button/button.js +13 -0
- package/esm/plugins/table/config.js +79 -19
- package/package.json +1 -1
- package/types/core/helpers/utils/scroll-into-view.d.ts +0 -3
- package/types/modules/toolbar/button/button.d.ts +1 -0
package/es2015/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.19
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -1849,7 +1849,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1849
1849
|
* ```
|
|
1850
1850
|
* @packageDocumentation
|
|
1851
1851
|
* @module constants
|
|
1852
|
-
*/ const APP_VERSION = "4.13.
|
|
1852
|
+
*/ const APP_VERSION = "4.13.19";
|
|
1853
1853
|
// prettier-ignore
|
|
1854
1854
|
const ES = "es2015";
|
|
1855
1855
|
const IS_ES_MODERN = true;
|
|
@@ -9089,6 +9089,14 @@ const map = {};
|
|
|
9089
9089
|
/**
|
|
9090
9090
|
* @module helpers/utils
|
|
9091
9091
|
*/ /**
|
|
9092
|
+
* `getBoundingClientRect` returns fractional values while `scrollTop`,
|
|
9093
|
+
* `offsetTop` and `clientHeight` are rounded to integers, so a container
|
|
9094
|
+
* scrolled right up to its limit can still appear to clip the element by a
|
|
9095
|
+
* fraction of a pixel. Treat anything clipped by less than a pixel as
|
|
9096
|
+
* visible — otherwise `scrollIntoViewIfNeeded` falls through to
|
|
9097
|
+
* `elm.scrollIntoView()` and needlessly scrolls the whole page.
|
|
9098
|
+
*/ const SUBPIXEL_TOLERANCE = 1;
|
|
9099
|
+
/**
|
|
9092
9100
|
* Check if element is in view
|
|
9093
9101
|
*/ function inView(elm, root, doc) {
|
|
9094
9102
|
let rect = elm.getBoundingClientRect(), el = elm;
|
|
@@ -9101,7 +9109,7 @@ const map = {};
|
|
|
9101
9109
|
// view even though its top still fits. The `top > rect.top` guard keeps
|
|
9102
9110
|
// elements taller than the container (which can never fully fit) from
|
|
9103
9111
|
// being treated as always out of view. See #1300
|
|
9104
|
-
if (top + height > rect.bottom && top > rect.top) {
|
|
9112
|
+
if (top + height > rect.bottom + SUBPIXEL_TOLERANCE && top > rect.top) {
|
|
9105
9113
|
return false;
|
|
9106
9114
|
}
|
|
9107
9115
|
// Check if the element is out of view due to a container scrolling
|
|
@@ -9115,7 +9123,7 @@ const map = {};
|
|
|
9115
9123
|
// element scrolled above the top was wrongly reported as visible and never
|
|
9116
9124
|
// scrolled to. See #1279
|
|
9117
9125
|
const clientHeight = doc.documentElement && doc.documentElement.clientHeight || 0;
|
|
9118
|
-
return (top + height <= clientHeight || top <= 0) && top + height >= 0;
|
|
9126
|
+
return (top + height <= clientHeight + SUBPIXEL_TOLERANCE || top <= 0) && top + height >= 0;
|
|
9119
9127
|
}
|
|
9120
9128
|
/**
|
|
9121
9129
|
* Scroll element into view if it is not in view
|
|
@@ -9996,8 +10004,8 @@ class Plugin extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompo
|
|
|
9996
10004
|
/* harmony import */ var _swc_helpers_await_async_generator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6311);
|
|
9997
10005
|
/* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25045);
|
|
9998
10006
|
/* harmony import */ var _swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(41411);
|
|
9999
|
-
/* harmony import */ var
|
|
10000
|
-
/* harmony import */ var
|
|
10007
|
+
/* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(31635);
|
|
10008
|
+
/* harmony import */ var _swc_helpers_wrap_async_generator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(86367);
|
|
10001
10009
|
/* harmony import */ var jodit_core_async__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(91231);
|
|
10002
10010
|
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(81937);
|
|
10003
10011
|
/* harmony import */ var jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(49574);
|
|
@@ -10123,7 +10131,7 @@ class Ajax {
|
|
|
10123
10131
|
}).call(this));
|
|
10124
10132
|
}
|
|
10125
10133
|
stream() {
|
|
10126
|
-
return (0,
|
|
10134
|
+
return (0,_swc_helpers_wrap_async_generator__WEBPACK_IMPORTED_MODULE_5__._)(function*() {
|
|
10127
10135
|
var _o_withCredentials;
|
|
10128
10136
|
this.__activated = true;
|
|
10129
10137
|
const { xhr, o } = this;
|
|
@@ -10271,7 +10279,7 @@ class Ajax {
|
|
|
10271
10279
|
}
|
|
10272
10280
|
}
|
|
10273
10281
|
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_2__._)(Ajax, "log", []);
|
|
10274
|
-
(0,
|
|
10282
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_4__.__decorate)([
|
|
10275
10283
|
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_8__.autobind
|
|
10276
10284
|
], Ajax.prototype, "destruct", null);
|
|
10277
10285
|
|
|
@@ -23895,27 +23903,28 @@ const instance = (j)=>j.getInstance('Table', j.o);
|
|
|
23895
23903
|
/* harmony import */ var _swc_helpers_object_spread_props__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(15366);
|
|
23896
23904
|
/* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(31635);
|
|
23897
23905
|
/* harmony import */ var jodit_core_component_statuses__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(69364);
|
|
23898
|
-
/* harmony import */ var
|
|
23899
|
-
/* harmony import */ var
|
|
23900
|
-
/* harmony import */ var
|
|
23901
|
-
/* harmony import */ var
|
|
23902
|
-
/* harmony import */ var
|
|
23903
|
-
/* harmony import */ var
|
|
23904
|
-
/* harmony import */ var
|
|
23905
|
-
/* harmony import */ var
|
|
23906
|
-
/* harmony import */ var
|
|
23907
|
-
/* harmony import */ var
|
|
23908
|
-
/* harmony import */ var
|
|
23909
|
-
/* harmony import */ var
|
|
23910
|
-
/* harmony import */ var
|
|
23911
|
-
/* harmony import */ var
|
|
23912
|
-
/* harmony import */ var
|
|
23913
|
-
/* harmony import */ var
|
|
23914
|
-
/* harmony import */ var
|
|
23915
|
-
/* harmony import */ var
|
|
23916
|
-
/* harmony import */ var
|
|
23917
|
-
/* harmony import */ var
|
|
23918
|
-
/* harmony import */ var
|
|
23906
|
+
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(81937);
|
|
23907
|
+
/* harmony import */ var jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(49574);
|
|
23908
|
+
/* harmony import */ var jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(51676);
|
|
23909
|
+
/* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(91672);
|
|
23910
|
+
/* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(68616);
|
|
23911
|
+
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(23211);
|
|
23912
|
+
/* harmony import */ var jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(17312);
|
|
23913
|
+
/* harmony import */ var jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(91565);
|
|
23914
|
+
/* harmony import */ var jodit_core_helpers_checker_is_jodit_object__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(24497);
|
|
23915
|
+
/* harmony import */ var jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(62101);
|
|
23916
|
+
/* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(85932);
|
|
23917
|
+
/* harmony import */ var jodit_core_helpers_size__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(86878);
|
|
23918
|
+
/* harmony import */ var jodit_core_helpers_string_camel_case__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(57821);
|
|
23919
|
+
/* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(28712);
|
|
23920
|
+
/* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_18__);
|
|
23921
|
+
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(7909);
|
|
23922
|
+
/* harmony import */ var jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(71125);
|
|
23923
|
+
/* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(59400);
|
|
23924
|
+
/* harmony import */ var jodit_core_ui_helpers_get_control_type__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(15982);
|
|
23925
|
+
/* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(29434);
|
|
23926
|
+
/* harmony import */ var jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(51116);
|
|
23927
|
+
/* harmony import */ var _factory__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(4274);
|
|
23919
23928
|
/*!
|
|
23920
23929
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
23921
23930
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -23950,7 +23959,8 @@ const instance = (j)=>j.getInstance('Table', j.o);
|
|
|
23950
23959
|
|
|
23951
23960
|
|
|
23952
23961
|
|
|
23953
|
-
|
|
23962
|
+
|
|
23963
|
+
class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_21__.UIButton {
|
|
23954
23964
|
className() {
|
|
23955
23965
|
return 'ToolbarButton';
|
|
23956
23966
|
}
|
|
@@ -23961,13 +23971,13 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_20__.U
|
|
|
23961
23971
|
super.updateAriaLabel();
|
|
23962
23972
|
if (this.trigger) {
|
|
23963
23973
|
const i8nTooltip = this.state.tooltip ? this.jodit.i18n(this.state.tooltip) : null;
|
|
23964
|
-
(0,
|
|
23974
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_19__.attr)(this.trigger, 'aria-label', i8nTooltip);
|
|
23965
23975
|
}
|
|
23966
23976
|
}
|
|
23967
23977
|
/**
|
|
23968
23978
|
* Get parent toolbar
|
|
23969
23979
|
*/ get toolbar() {
|
|
23970
|
-
const ToolbarCollection = (0,
|
|
23980
|
+
const ToolbarCollection = (0,jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_8__.getComponentClass)('ToolbarCollection');
|
|
23971
23981
|
return this.closest(ToolbarCollection);
|
|
23972
23982
|
}
|
|
23973
23983
|
update() {
|
|
@@ -23989,7 +23999,7 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_20__.U
|
|
|
23989
23999
|
* Calculates whether the button is active
|
|
23990
24000
|
*/ __calculateActivatedStatus(tc) {
|
|
23991
24001
|
var _this_control_isActive, _this_control;
|
|
23992
|
-
if ((0,
|
|
24002
|
+
if ((0,jodit_core_helpers_checker_is_jodit_object__WEBPACK_IMPORTED_MODULE_13__.isJoditObject)(this.j) && !this.j.editorIsActive) {
|
|
23993
24003
|
return false;
|
|
23994
24004
|
}
|
|
23995
24005
|
if ((_this_control_isActive = (_this_control = this.control).isActive) === null || _this_control_isActive === void 0 ? void 0 : _this_control_isActive.call(_this_control, this.j, this)) {
|
|
@@ -24013,11 +24023,11 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_20__.U
|
|
|
24013
24023
|
return Boolean(tc && tc.shouldBeDisabled(this));
|
|
24014
24024
|
}
|
|
24015
24025
|
onChangeActivated() {
|
|
24016
|
-
(0,
|
|
24026
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_19__.attr)(this.button, 'aria-pressed', this.state.activated);
|
|
24017
24027
|
super.onChangeActivated();
|
|
24018
24028
|
}
|
|
24019
24029
|
onChangeText() {
|
|
24020
|
-
if ((0,
|
|
24030
|
+
if ((0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_12__.isFunction)(this.control.template)) {
|
|
24021
24031
|
this.text.innerHTML = this.control.template(this.j, this.control.name, this.j.i18n(this.state.text));
|
|
24022
24032
|
} else {
|
|
24023
24033
|
super.onChangeText();
|
|
@@ -24025,7 +24035,8 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_20__.U
|
|
|
24025
24035
|
this.setMod('text-icons', Boolean(this.text.innerText.trim().length));
|
|
24026
24036
|
}
|
|
24027
24037
|
onChangeTabIndex() {
|
|
24028
|
-
(0,
|
|
24038
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_19__.attr)(this.button, 'tabindex', this.state.tabIndex);
|
|
24039
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_19__.attr)(this.trigger, 'tabindex', this.state.tabIndex);
|
|
24029
24040
|
}
|
|
24030
24041
|
createContainer() {
|
|
24031
24042
|
const cn = this.componentName;
|
|
@@ -24038,7 +24049,7 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_20__.U
|
|
|
24038
24049
|
configurable: true
|
|
24039
24050
|
});
|
|
24040
24051
|
container.appendChild(button);
|
|
24041
|
-
const trigger = this.j.c.fromHTML(`<span role="button" aria-haspopup="true" aria-expanded="false" class="${cn}__trigger">${
|
|
24052
|
+
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_23__.Icon.get('chevron')}</span>`);
|
|
24042
24053
|
// For caching
|
|
24043
24054
|
button.appendChild(trigger);
|
|
24044
24055
|
return container;
|
|
@@ -24051,15 +24062,15 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_20__.U
|
|
|
24051
24062
|
if (this.state.hasTrigger) {
|
|
24052
24063
|
this.container.appendChild(this.trigger);
|
|
24053
24064
|
} else {
|
|
24054
|
-
|
|
24065
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_10__.Dom.safeRemove(this.trigger);
|
|
24055
24066
|
}
|
|
24056
24067
|
this.setMod('with-trigger', this.state.hasTrigger || null);
|
|
24057
24068
|
}
|
|
24058
24069
|
/** @override */ onChangeDisabled() {
|
|
24059
24070
|
const disabled = this.state.disabled ? 'disabled' : null;
|
|
24060
|
-
(0,
|
|
24061
|
-
(0,
|
|
24062
|
-
(0,
|
|
24071
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_19__.attr)(this.trigger, 'disabled', disabled);
|
|
24072
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_19__.attr)(this.button, 'disabled', disabled);
|
|
24073
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_19__.attr)(this.container, 'disabled', disabled);
|
|
24063
24074
|
}
|
|
24064
24075
|
/**
|
|
24065
24076
|
* Init constant data from control
|
|
@@ -24069,19 +24080,19 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_20__.U
|
|
|
24069
24080
|
state.name = ctr.name;
|
|
24070
24081
|
this.__initIconFromControl();
|
|
24071
24082
|
if (ctr.tooltip) {
|
|
24072
|
-
state.tooltip = (0,
|
|
24083
|
+
state.tooltip = (0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_12__.isFunction)(ctr.tooltip) ? ctr.tooltip(this.j, ctr, this) : ctr.tooltip;
|
|
24073
24084
|
}
|
|
24074
24085
|
state.hasTrigger = Boolean(ctr.list || ctr.popup && ctr.exec);
|
|
24075
24086
|
}
|
|
24076
24087
|
__initIconFromControl() {
|
|
24077
24088
|
const { control: ctr, state } = this;
|
|
24078
24089
|
const { textIcons } = this.j.o;
|
|
24079
|
-
if (textIcons === true || (0,
|
|
24080
|
-
state.icon = (0,
|
|
24090
|
+
if (textIcons === true || (0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_12__.isFunction)(textIcons) && textIcons(ctr.name) || ctr.template) {
|
|
24091
|
+
state.icon = (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_21__.UIButtonState)().icon;
|
|
24081
24092
|
state.text = ctr.text || ctr.name;
|
|
24082
24093
|
return;
|
|
24083
24094
|
}
|
|
24084
|
-
if (!(0,
|
|
24095
|
+
if (!(0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_15__.isString)(ctr.icon) && ctr.icon != null) {
|
|
24085
24096
|
state.icon = {
|
|
24086
24097
|
name: ctr.icon.name || ctr.name,
|
|
24087
24098
|
iconURL: ctr.icon.iconURL || '',
|
|
@@ -24095,7 +24106,7 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_20__.U
|
|
|
24095
24106
|
} else {
|
|
24096
24107
|
var _this_j_o_extraIcons;
|
|
24097
24108
|
const name = ctr.icon || ctr.name;
|
|
24098
|
-
state.icon.name =
|
|
24109
|
+
state.icon.name = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_23__.Icon.exists(name) || ((_this_j_o_extraIcons = this.j.o.extraIcons) === null || _this_j_o_extraIcons === void 0 ? void 0 : _this_j_o_extraIcons[name]) ? name : '';
|
|
24099
24110
|
}
|
|
24100
24111
|
if (!ctr.iconURL && !state.icon.name) {
|
|
24101
24112
|
state.text = ctr.text || ctr.name;
|
|
@@ -24109,24 +24120,24 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_20__.U
|
|
|
24109
24120
|
return;
|
|
24110
24121
|
}
|
|
24111
24122
|
const { control: ctr } = this;
|
|
24112
|
-
(0,
|
|
24123
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_19__.attr)(this.trigger, 'aria-expanded', true);
|
|
24113
24124
|
e.buffer = {
|
|
24114
24125
|
actionTrigger: this
|
|
24115
24126
|
};
|
|
24116
24127
|
if (ctr.list) {
|
|
24117
24128
|
return this.__openControlList(ctr);
|
|
24118
24129
|
}
|
|
24119
|
-
if ((0,
|
|
24130
|
+
if ((0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_12__.isFunction)(ctr.popup)) {
|
|
24120
24131
|
const popup = this.openPopup();
|
|
24121
24132
|
popup.parentElement = this;
|
|
24122
24133
|
try {
|
|
24123
|
-
if (this.j.e.fire((0,
|
|
24134
|
+
if (this.j.e.fire((0,jodit_core_helpers_string_camel_case__WEBPACK_IMPORTED_MODULE_17__.camelCase)(`before-${ctr.name}-open-popup`), this.target, ctr, popup) !== false) {
|
|
24124
24135
|
var _ref, _ref1;
|
|
24125
24136
|
var _this_toolbar;
|
|
24126
24137
|
const target = (_ref = (_ref1 = (_this_toolbar = this.toolbar) === null || _this_toolbar === void 0 ? void 0 : _this_toolbar.getTarget(this)) !== null && _ref1 !== void 0 ? _ref1 : this.target) !== null && _ref !== void 0 ? _ref : null;
|
|
24127
24138
|
const elm = ctr.popup(this.j, target, this.__closePopup, this);
|
|
24128
24139
|
if (elm) {
|
|
24129
|
-
popup.setContent((0,
|
|
24140
|
+
popup.setContent((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_15__.isString)(elm) ? this.j.c.fromHTML(elm) : elm).open(()=>(0,jodit_core_helpers_size__WEBPACK_IMPORTED_MODULE_16__.position)(this.container), false, this.j.o.allowTabNavigation ? this.container : undefined);
|
|
24130
24141
|
} else {
|
|
24131
24142
|
this.__closePopup();
|
|
24132
24143
|
}
|
|
@@ -24139,28 +24150,39 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_20__.U
|
|
|
24139
24150
|
* Fired after the popup was opened for some control button
|
|
24140
24151
|
*/ /**
|
|
24141
24152
|
* Close all opened popups
|
|
24142
|
-
*/ this.j.e.fire((0,
|
|
24153
|
+
*/ this.j.e.fire((0,jodit_core_helpers_string_camel_case__WEBPACK_IMPORTED_MODULE_17__.camelCase)(`after-${ctr.name}-open-popup`), popup.container);
|
|
24143
24154
|
}
|
|
24144
24155
|
}
|
|
24156
|
+
onTriggerKeyDown(e) {
|
|
24157
|
+
if (this.state.disabled || ![
|
|
24158
|
+
jodit_core_constants__WEBPACK_IMPORTED_MODULE_5__.KEY_ENTER,
|
|
24159
|
+
jodit_core_constants__WEBPACK_IMPORTED_MODULE_5__.KEY_SPACE,
|
|
24160
|
+
' '
|
|
24161
|
+
].includes(e.key)) {
|
|
24162
|
+
return;
|
|
24163
|
+
}
|
|
24164
|
+
e.preventDefault();
|
|
24165
|
+
this.trigger.click();
|
|
24166
|
+
}
|
|
24145
24167
|
/**
|
|
24146
24168
|
* Create an open popup list
|
|
24147
24169
|
*/ __openControlList(control) {
|
|
24148
24170
|
var _this_jodit_options_controls;
|
|
24149
|
-
const controls = (_this_jodit_options_controls = this.jodit.options.controls) !== null && _this_jodit_options_controls !== void 0 ? _this_jodit_options_controls : {}, getControl = (key)=>(0,
|
|
24171
|
+
const controls = (_this_jodit_options_controls = this.jodit.options.controls) !== null && _this_jodit_options_controls !== void 0 ? _this_jodit_options_controls : {}, getControl = (key)=>(0,jodit_core_ui_helpers_get_control_type__WEBPACK_IMPORTED_MODULE_22__.findControlType)(key, controls);
|
|
24150
24172
|
const list = control.list;
|
|
24151
24173
|
const menu = this.openPopup();
|
|
24152
|
-
const toolbar = (0,
|
|
24174
|
+
const toolbar = (0,_factory__WEBPACK_IMPORTED_MODULE_25__.makeCollection)(this.j);
|
|
24153
24175
|
menu.parentElement = this;
|
|
24154
24176
|
toolbar.parentElement = menu;
|
|
24155
24177
|
toolbar.mode = 'vertical';
|
|
24156
|
-
const isListItem = (key)=>(0,
|
|
24178
|
+
const isListItem = (key)=>(0,jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_14__.isPlainObject)(key) && 'title' in key && 'value' in key;
|
|
24157
24179
|
const getButton = (key, value)=>{
|
|
24158
|
-
if ((0,
|
|
24180
|
+
if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_15__.isString)(value) && getControl(value)) {
|
|
24159
24181
|
return (0,_swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_1__._)({
|
|
24160
24182
|
name: value.toString()
|
|
24161
24183
|
}, getControl(value));
|
|
24162
24184
|
}
|
|
24163
|
-
if ((0,
|
|
24185
|
+
if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_15__.isString)(key) && getControl(key)) {
|
|
24164
24186
|
return (0,_swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_1__._)({
|
|
24165
24187
|
name: key.toString()
|
|
24166
24188
|
}, getControl(key), typeof value === 'object' ? value : {});
|
|
@@ -24191,26 +24213,26 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_20__.U
|
|
|
24191
24213
|
value
|
|
24192
24214
|
]
|
|
24193
24215
|
};
|
|
24194
|
-
if ((0,
|
|
24216
|
+
if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_15__.isString)(value)) {
|
|
24195
24217
|
childControl.text = value;
|
|
24196
24218
|
}
|
|
24197
24219
|
return childControl;
|
|
24198
24220
|
};
|
|
24199
|
-
toolbar.build((0,
|
|
24200
|
-
menu.setContent(toolbar).open(()=>(0,
|
|
24221
|
+
toolbar.build((0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_11__.isArray)(list) ? list.map(getButton) : (0,jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_20__.keys)(list, false).map((key)=>getButton(key, list[key])), this.target);
|
|
24222
|
+
menu.setContent(toolbar).open(()=>(0,jodit_core_helpers_size__WEBPACK_IMPORTED_MODULE_16__.position)(this.container), false, this.j.o.allowTabNavigation ? this.container : undefined);
|
|
24201
24223
|
this.state.activated = true;
|
|
24202
24224
|
}
|
|
24203
24225
|
onOutsideClick(e) {
|
|
24204
24226
|
if (!this.openedPopup) {
|
|
24205
24227
|
return;
|
|
24206
24228
|
}
|
|
24207
|
-
if (!e || !
|
|
24229
|
+
if (!e || !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_10__.Dom.isNode(e.target) || !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_10__.Dom.isOrContains(this.container, e.target) && !this.openedPopup.isOwnClick(e)) {
|
|
24208
24230
|
this.__closePopup();
|
|
24209
24231
|
}
|
|
24210
24232
|
}
|
|
24211
24233
|
openPopup() {
|
|
24212
24234
|
this.__closePopup();
|
|
24213
|
-
this.openedPopup = new
|
|
24235
|
+
this.openedPopup = new jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_24__.Popup(this.j, false);
|
|
24214
24236
|
this.j.e.on(this.ow, 'mousedown touchstart', this.onOutsideClick).on('escape closeAllPopups', this.onOutsideClick);
|
|
24215
24237
|
return this.openedPopup;
|
|
24216
24238
|
}
|
|
@@ -24222,7 +24244,7 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_20__.U
|
|
|
24222
24244
|
this.openedPopup.destruct();
|
|
24223
24245
|
this.openedPopup = null;
|
|
24224
24246
|
if (this.trigger) {
|
|
24225
|
-
(0,
|
|
24247
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_19__.attr)(this.trigger, 'aria-expanded', false);
|
|
24226
24248
|
}
|
|
24227
24249
|
}
|
|
24228
24250
|
}
|
|
@@ -24230,7 +24252,7 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_20__.U
|
|
|
24230
24252
|
* Click handler
|
|
24231
24253
|
*/ onClick(originalEvent) {
|
|
24232
24254
|
const { control: ctr } = this;
|
|
24233
|
-
if ((0,
|
|
24255
|
+
if ((0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_12__.isFunction)(ctr.exec)) {
|
|
24234
24256
|
var _ref, _ref1;
|
|
24235
24257
|
var _this_toolbar;
|
|
24236
24258
|
const target = (_ref = (_ref1 = (_this_toolbar = this.toolbar) === null || _this_toolbar === void 0 ? void 0 : _this_toolbar.getTarget(this)) !== null && _ref1 !== void 0 ? _ref1 : this.target) !== null && _ref !== void 0 ? _ref : null;
|
|
@@ -24257,11 +24279,11 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_20__.U
|
|
|
24257
24279
|
if (ctr.list) {
|
|
24258
24280
|
return this.__openControlList(ctr);
|
|
24259
24281
|
}
|
|
24260
|
-
if ((0,
|
|
24282
|
+
if ((0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_12__.isFunction)(ctr.popup)) {
|
|
24261
24283
|
return this.onTriggerClick(originalEvent);
|
|
24262
24284
|
}
|
|
24263
24285
|
if (ctr.command || ctr.name) {
|
|
24264
|
-
(0,
|
|
24286
|
+
(0,jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_20__.call)((0,jodit_core_helpers_checker_is_jodit_object__WEBPACK_IMPORTED_MODULE_13__.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]);
|
|
24265
24287
|
this.j.e.fire('closeAllPopups');
|
|
24266
24288
|
}
|
|
24267
24289
|
}
|
|
@@ -24270,20 +24292,20 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_20__.U
|
|
|
24270
24292
|
return super.destruct();
|
|
24271
24293
|
}
|
|
24272
24294
|
constructor(jodit, control, target = null){
|
|
24273
|
-
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 = (0,_swc_helpers_object_spread_props__WEBPACK_IMPORTED_MODULE_2__._)((0,_swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_1__._)({}, (0,
|
|
24295
|
+
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 = (0,_swc_helpers_object_spread_props__WEBPACK_IMPORTED_MODULE_2__._)((0,_swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_1__._)({}, (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_21__.UIButtonState)()), {
|
|
24274
24296
|
theme: 'toolbar',
|
|
24275
24297
|
currentValue: '',
|
|
24276
24298
|
hasTrigger: false
|
|
24277
24299
|
}), this.openedPopup = null;
|
|
24278
24300
|
const button = this.getElm('button');
|
|
24279
|
-
(0,
|
|
24301
|
+
(0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_18__.assert)(button, 'Element button should exists');
|
|
24280
24302
|
this.button = button;
|
|
24281
24303
|
Object.defineProperty(button, 'component', {
|
|
24282
24304
|
value: this,
|
|
24283
24305
|
configurable: true
|
|
24284
24306
|
});
|
|
24285
24307
|
const trigger = this.getElm('trigger');
|
|
24286
|
-
(0,
|
|
24308
|
+
(0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_18__.assert)(trigger, 'Element trigger should exists');
|
|
24287
24309
|
this.trigger = trigger;
|
|
24288
24310
|
trigger.remove();
|
|
24289
24311
|
// Prevent lost focus
|
|
@@ -24304,24 +24326,27 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_20__.U
|
|
|
24304
24326
|
}
|
|
24305
24327
|
}
|
|
24306
24328
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_3__.__decorate)([
|
|
24307
|
-
|
|
24329
|
+
jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_7__.cacheHTML
|
|
24308
24330
|
], ToolbarButton.prototype, "createContainer", null);
|
|
24309
24331
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_3__.__decorate)([
|
|
24310
|
-
(0,
|
|
24332
|
+
(0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_9__.watch)('state.hasTrigger', {
|
|
24311
24333
|
immediately: false
|
|
24312
24334
|
})
|
|
24313
24335
|
], ToolbarButton.prototype, "onChangeHasTrigger", null);
|
|
24314
24336
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_3__.__decorate)([
|
|
24315
|
-
(0,
|
|
24337
|
+
(0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_9__.watch)('trigger:click')
|
|
24316
24338
|
], ToolbarButton.prototype, "onTriggerClick", null);
|
|
24317
24339
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_3__.__decorate)([
|
|
24318
|
-
|
|
24340
|
+
(0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_9__.watch)('trigger:keydown')
|
|
24341
|
+
], ToolbarButton.prototype, "onTriggerKeyDown", null);
|
|
24342
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_3__.__decorate)([
|
|
24343
|
+
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_6__.autobind
|
|
24319
24344
|
], ToolbarButton.prototype, "onOutsideClick", null);
|
|
24320
24345
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_3__.__decorate)([
|
|
24321
|
-
|
|
24346
|
+
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_6__.autobind
|
|
24322
24347
|
], ToolbarButton.prototype, "__closePopup", null);
|
|
24323
24348
|
ToolbarButton = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_3__.__decorate)([
|
|
24324
|
-
|
|
24349
|
+
jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_8__.component
|
|
24325
24350
|
], ToolbarButton);
|
|
24326
24351
|
|
|
24327
24352
|
|
|
@@ -43943,13 +43968,14 @@ function findCell(editor, key) {
|
|
|
43943
43968
|
/***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
|
|
43944
43969
|
|
|
43945
43970
|
"use strict";
|
|
43946
|
-
/* harmony import */ var
|
|
43947
|
-
/* harmony import */ var
|
|
43948
|
-
/* harmony import */ var
|
|
43949
|
-
/* harmony import */ var
|
|
43950
|
-
/* harmony import */ var
|
|
43951
|
-
/* harmony import */ var
|
|
43952
|
-
/* harmony import */ var
|
|
43971
|
+
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
|
|
43972
|
+
/* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(27795);
|
|
43973
|
+
/* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65946);
|
|
43974
|
+
/* harmony import */ var jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(93640);
|
|
43975
|
+
/* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29434);
|
|
43976
|
+
/* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5266);
|
|
43977
|
+
/* harmony import */ var _table_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(67447);
|
|
43978
|
+
/* harmony import */ var _table_svg__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_table_svg__WEBPACK_IMPORTED_MODULE_6__);
|
|
43953
43979
|
/*!
|
|
43954
43980
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
43955
43981
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -43962,13 +43988,14 @@ function findCell(editor, key) {
|
|
|
43962
43988
|
|
|
43963
43989
|
|
|
43964
43990
|
|
|
43965
|
-
|
|
43991
|
+
|
|
43992
|
+
jodit_config__WEBPACK_IMPORTED_MODULE_5__.Config.prototype.table = {
|
|
43966
43993
|
splitBlockOnInsertTable: true,
|
|
43967
43994
|
selectionCellStyle: 'border: 1px double #1e88e5 !important;',
|
|
43968
43995
|
useExtraClassesOptions: false
|
|
43969
43996
|
};
|
|
43970
|
-
|
|
43971
|
-
|
|
43997
|
+
jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_4__.Icon.set('table', (_table_svg__WEBPACK_IMPORTED_MODULE_6___default()));
|
|
43998
|
+
jodit_config__WEBPACK_IMPORTED_MODULE_5__.Config.prototype.controls.table = {
|
|
43972
43999
|
data: {
|
|
43973
44000
|
cols: 10,
|
|
43974
44001
|
rows: 10,
|
|
@@ -43998,19 +44025,25 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.table = {
|
|
|
43998
44025
|
};
|
|
43999
44026
|
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 = [];
|
|
44000
44027
|
const cnt = default_rows_count * default_cols_count;
|
|
44028
|
+
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(blocksContainer, {
|
|
44029
|
+
role: 'grid',
|
|
44030
|
+
ariaLabel: 'Table size',
|
|
44031
|
+
ariaRowcount: default_rows_count,
|
|
44032
|
+
ariaColcount: default_cols_count
|
|
44033
|
+
});
|
|
44001
44034
|
for(let i = 0; i < cnt; i += 1){
|
|
44002
44035
|
if (!cells[i]) {
|
|
44036
|
+
const row = Math.floor(i / default_cols_count) + 1, col = i % default_cols_count + 1;
|
|
44003
44037
|
cells.push(editor.c.element('span', {
|
|
44004
|
-
dataIndex: i
|
|
44038
|
+
dataIndex: i,
|
|
44039
|
+
role: 'gridcell',
|
|
44040
|
+
tabindex: i === 0 ? 0 : -1,
|
|
44041
|
+
ariaLabel: `${row} by ${col}`
|
|
44005
44042
|
}));
|
|
44006
44043
|
}
|
|
44007
44044
|
}
|
|
44008
|
-
const
|
|
44009
|
-
const
|
|
44010
|
-
if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(dv, 'span')) {
|
|
44011
|
-
return;
|
|
44012
|
-
}
|
|
44013
|
-
const k = index === undefined || isNaN(index) ? parseInt((0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_2__.attr)(dv, '-index') || '0', 10) : index || 0;
|
|
44045
|
+
const highlightCell = (cell)=>{
|
|
44046
|
+
const k = parseInt((0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(cell, '-index') || '0', 10);
|
|
44014
44047
|
const rows_count = Math.ceil((k + 1) / default_cols_count), cols_count = k % default_cols_count + 1;
|
|
44015
44048
|
for(let i = 0; i < cells.length; i += 1){
|
|
44016
44049
|
if (cols_count >= i % default_cols_count + 1 && rows_count >= Math.ceil((i + 1) / default_cols_count)) {
|
|
@@ -44022,14 +44055,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.table = {
|
|
|
44022
44055
|
cols.textContent = cols_count.toString();
|
|
44023
44056
|
rows.textContent = rows_count.toString();
|
|
44024
44057
|
};
|
|
44025
|
-
|
|
44026
|
-
const
|
|
44027
|
-
e.preventDefault();
|
|
44028
|
-
e.stopImmediatePropagation();
|
|
44029
|
-
if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(dv, 'span')) {
|
|
44030
|
-
return;
|
|
44031
|
-
}
|
|
44032
|
-
const k = parseInt((0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_2__.attr)(dv, '-index') || '0', 10);
|
|
44058
|
+
const insertTable = (cell)=>{
|
|
44059
|
+
const k = parseInt((0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(cell, '-index') || '0', 10);
|
|
44033
44060
|
const rows_count = Math.ceil((k + 1) / default_cols_count), cols_count = k % default_cols_count + 1;
|
|
44034
44061
|
const crt = editor.createInside, tbody = crt.element('tbody'), table = crt.element('table');
|
|
44035
44062
|
table.appendChild(tbody);
|
|
@@ -44041,7 +44068,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.table = {
|
|
|
44041
44068
|
if (!first_td) {
|
|
44042
44069
|
first_td = td;
|
|
44043
44070
|
}
|
|
44044
|
-
(0,
|
|
44071
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(td, 'width', (100 / cols_count).toFixed(4) + '%');
|
|
44045
44072
|
td.appendChild(crt.element('br'));
|
|
44046
44073
|
tr.appendChild(crt.text('\n'));
|
|
44047
44074
|
tr.appendChild(crt.text('\t'));
|
|
@@ -44050,7 +44077,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.table = {
|
|
|
44050
44077
|
tbody.appendChild(crt.text('\n'));
|
|
44051
44078
|
tbody.appendChild(tr);
|
|
44052
44079
|
}
|
|
44053
|
-
(0,
|
|
44080
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.$$)('input[type=checkbox]:checked', options).forEach((input)=>{
|
|
44054
44081
|
input.value.split(/[\s]+/).forEach((className)=>{
|
|
44055
44082
|
table.classList.add(className);
|
|
44056
44083
|
});
|
|
@@ -44059,15 +44086,15 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.table = {
|
|
|
44059
44086
|
editor.s.removeMarkers();
|
|
44060
44087
|
editor.editor.normalize();
|
|
44061
44088
|
editor.history.snapshot.restore(snapshot);
|
|
44062
|
-
const block =
|
|
44063
|
-
if (block &&
|
|
44064
|
-
|
|
44089
|
+
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);
|
|
44090
|
+
if (block && jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(block)) {
|
|
44091
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.replace(block, table, undefined, false, true);
|
|
44065
44092
|
} else {
|
|
44066
44093
|
if (block) {
|
|
44067
44094
|
const fake = crt.text('\n');
|
|
44068
44095
|
if (!editor.o.table.splitBlockOnInsertTable) {
|
|
44069
|
-
|
|
44070
|
-
|
|
44096
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.after(block, fake);
|
|
44097
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.after(fake, table);
|
|
44071
44098
|
} else {
|
|
44072
44099
|
const range = editor.s.range;
|
|
44073
44100
|
range.collapse(false);
|
|
@@ -44076,9 +44103,9 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.table = {
|
|
|
44076
44103
|
editor.s.selectRange(range);
|
|
44077
44104
|
const firstPart = editor.s.splitSelection(block, fake);
|
|
44078
44105
|
if (firstPart) {
|
|
44079
|
-
|
|
44106
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.after(firstPart, table);
|
|
44080
44107
|
} else {
|
|
44081
|
-
|
|
44108
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.after(block, table);
|
|
44082
44109
|
}
|
|
44083
44110
|
}
|
|
44084
44111
|
} else {
|
|
@@ -44087,13 +44114,68 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.table = {
|
|
|
44087
44114
|
}
|
|
44088
44115
|
if (first_td) {
|
|
44089
44116
|
editor.s.setCursorIn(first_td);
|
|
44090
|
-
(0,
|
|
44117
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.scrollIntoViewIfNeeded)(first_td, editor.editor, editor.ed);
|
|
44091
44118
|
}
|
|
44092
44119
|
close();
|
|
44120
|
+
};
|
|
44121
|
+
editor.e.on(blocksContainer, 'mousemove', (e)=>{
|
|
44122
|
+
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(e.target, 'span')) {
|
|
44123
|
+
highlightCell(e.target);
|
|
44124
|
+
}
|
|
44125
|
+
}).on(blocksContainer, 'touchstart mousedown', (e)=>{
|
|
44126
|
+
if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(e.target, 'span')) {
|
|
44127
|
+
return;
|
|
44128
|
+
}
|
|
44129
|
+
e.preventDefault();
|
|
44130
|
+
e.stopImmediatePropagation();
|
|
44131
|
+
insertTable(e.target);
|
|
44132
|
+
}).on(blocksContainer, 'keydown', (e)=>{
|
|
44133
|
+
if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(e.target, 'span')) {
|
|
44134
|
+
return;
|
|
44135
|
+
}
|
|
44136
|
+
if (e.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_ENTER) {
|
|
44137
|
+
e.preventDefault();
|
|
44138
|
+
e.stopImmediatePropagation();
|
|
44139
|
+
insertTable(e.target);
|
|
44140
|
+
return;
|
|
44141
|
+
}
|
|
44142
|
+
if (e.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_ESC) {
|
|
44143
|
+
e.preventDefault();
|
|
44144
|
+
e.stopImmediatePropagation();
|
|
44145
|
+
close();
|
|
44146
|
+
return;
|
|
44147
|
+
}
|
|
44148
|
+
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;
|
|
44149
|
+
let nextIndex = index;
|
|
44150
|
+
switch(e.key){
|
|
44151
|
+
case jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_LEFT:
|
|
44152
|
+
nextIndex = col > 0 ? index - 1 : index;
|
|
44153
|
+
break;
|
|
44154
|
+
case jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_RIGHT:
|
|
44155
|
+
nextIndex = col < default_cols_count - 1 ? index + 1 : index;
|
|
44156
|
+
break;
|
|
44157
|
+
case jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_UP:
|
|
44158
|
+
nextIndex = row > 0 ? index - default_cols_count : index;
|
|
44159
|
+
break;
|
|
44160
|
+
case jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_DOWN:
|
|
44161
|
+
nextIndex = row < default_rows_count - 1 ? index + default_cols_count : index;
|
|
44162
|
+
break;
|
|
44163
|
+
default:
|
|
44164
|
+
return;
|
|
44165
|
+
}
|
|
44166
|
+
e.preventDefault();
|
|
44167
|
+
e.stopImmediatePropagation();
|
|
44168
|
+
if (nextIndex !== index) {
|
|
44169
|
+
cells[index].tabIndex = -1;
|
|
44170
|
+
cells[nextIndex].tabIndex = 0;
|
|
44171
|
+
cells[nextIndex].focus();
|
|
44172
|
+
highlightCell(cells[nextIndex]);
|
|
44173
|
+
}
|
|
44093
44174
|
});
|
|
44094
44175
|
if (button && button.parentElement) {
|
|
44095
44176
|
for(let i = 0; i < default_rows_count; i += 1){
|
|
44096
44177
|
const row = editor.c.div();
|
|
44178
|
+
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(row, 'role', 'row');
|
|
44097
44179
|
for(let j = 0; j < default_cols_count; j += 1){
|
|
44098
44180
|
row.appendChild(cells[i * default_cols_count + j]);
|
|
44099
44181
|
}
|