jodit 4.19.11 → 4.19.14
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 +19 -0
- package/es2015/jodit.css +33 -1
- package/es2015/jodit.fat.min.css +1 -1
- package/es2015/jodit.fat.min.js +11 -11
- package/es2015/jodit.js +219 -117
- package/es2015/jodit.min.css +1 -1
- 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.css +1 -1
- package/es2018/jodit.fat.min.js +9 -9
- package/es2018/jodit.min.css +1 -1
- package/es2018/jodit.min.js +9 -9
- package/es2018/plugins/debug/debug.min.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021/jodit.css +33 -1
- package/es2021/jodit.fat.min.css +1 -1
- package/es2021/jodit.fat.min.js +10 -10
- package/es2021/jodit.js +218 -115
- package/es2021/jodit.min.css +1 -1
- package/es2021/jodit.min.js +10 -10
- 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 +33 -1
- package/es2021.en/jodit.fat.min.css +1 -1
- package/es2021.en/jodit.fat.min.js +10 -10
- package/es2021.en/jodit.js +194 -91
- package/es2021.en/jodit.min.css +1 -1
- package/es2021.en/jodit.min.js +11 -11
- 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 +34 -2
- package/es5/jodit.fat.min.css +1 -1
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +261 -120
- package/es5/jodit.min.css +3 -3
- package/es5/jodit.min.js +2 -2
- package/es5/plugins/debug/debug.css +1 -1
- package/es5/plugins/debug/debug.js +1 -1
- package/es5/plugins/debug/debug.min.js +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es5/polyfills.fat.min.js +1 -1
- package/es5/polyfills.js +1 -1
- package/es5/polyfills.min.js +1 -1
- package/esm/core/constants.js +1 -1
- package/esm/core/global.d.ts +6 -0
- package/esm/core/global.js +21 -4
- package/esm/core/helpers/html/safe-html.js +26 -0
- package/esm/core/ui/button/tooltip/tooltip.d.ts +6 -0
- package/esm/core/ui/button/tooltip/tooltip.js +14 -3
- package/esm/core/view/view-with-toolbar.js +6 -1
- package/esm/jodit.d.ts +4 -0
- package/esm/jodit.js +5 -1
- package/esm/languages.js +7 -1
- package/esm/plugins/add-new-line/add-new-line.d.ts +5 -0
- package/esm/plugins/add-new-line/add-new-line.js +20 -3
- package/esm/plugins/delete/delete.d.ts +7 -0
- package/esm/plugins/delete/delete.js +22 -0
- package/esm/plugins/hr/hr.js +5 -0
- package/esm/plugins/media/media.js +8 -5
- package/esm/plugins/resizer/resizer.js +4 -1
- package/esm/plugins/select-cells/select-cells.d.ts +1 -0
- package/esm/plugins/select-cells/select-cells.js +12 -18
- package/package.json +1 -1
- package/types/core/global.d.ts +6 -0
- package/types/core/ui/button/tooltip/tooltip.d.ts +6 -0
- package/types/jodit.d.ts +4 -0
- package/types/plugins/add-new-line/add-new-line.d.ts +5 -0
- package/types/plugins/delete/delete.d.ts +7 -0
- package/types/plugins/select-cells/select-cells.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.19.
|
|
4
|
+
* Version: v4.19.14
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -1824,7 +1824,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1824
1824
|
* ```
|
|
1825
1825
|
* @packageDocumentation
|
|
1826
1826
|
* @module constants
|
|
1827
|
-
*/ const APP_VERSION = "4.19.
|
|
1827
|
+
*/ const APP_VERSION = "4.19.14";
|
|
1828
1828
|
// prettier-ignore
|
|
1829
1829
|
const ES = "es2021";
|
|
1830
1830
|
const IS_ES_MODERN = true;
|
|
@@ -4780,16 +4780,18 @@ class EventHandlersStore {
|
|
|
4780
4780
|
/* harmony export */ uniqueUid: function() { return /* binding */ uniqueUid; }
|
|
4781
4781
|
/* harmony export */ });
|
|
4782
4782
|
/* harmony import */ var jodit_core_helpers_checker_is_jodit_object__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(24497);
|
|
4783
|
-
/* harmony import */ var
|
|
4784
|
-
/* harmony import */ var
|
|
4785
|
-
/* harmony import */ var
|
|
4786
|
-
/* harmony import */ var
|
|
4787
|
-
/* harmony import */ var
|
|
4788
|
-
/* harmony import */ var
|
|
4789
|
-
/* harmony import */ var
|
|
4790
|
-
/* harmony import */ var
|
|
4791
|
-
/* harmony import */ var
|
|
4792
|
-
/* harmony import */ var
|
|
4783
|
+
/* harmony import */ var jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(62101);
|
|
4784
|
+
/* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85932);
|
|
4785
|
+
/* harmony import */ var jodit_core_helpers_checker_is_view_object__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(31534);
|
|
4786
|
+
/* harmony import */ var jodit_core_helpers_string_kebab_case__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(74264);
|
|
4787
|
+
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7909);
|
|
4788
|
+
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(80991);
|
|
4789
|
+
/* harmony import */ var jodit_core_helpers_utils_get_class_name__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(421);
|
|
4790
|
+
/* harmony import */ var jodit_core_helpers_utils_is_unsafe_proto_key__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(78048);
|
|
4791
|
+
/* harmony import */ var jodit_core_plugin_plugin_system__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(85305);
|
|
4792
|
+
/* harmony import */ var _event_emitter_global__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(42689);
|
|
4793
|
+
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(81937);
|
|
4794
|
+
/* harmony import */ var _dom__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(27795);
|
|
4793
4795
|
/*!
|
|
4794
4796
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
4795
4797
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -4807,6 +4809,8 @@ class EventHandlersStore {
|
|
|
4807
4809
|
|
|
4808
4810
|
|
|
4809
4811
|
|
|
4812
|
+
|
|
4813
|
+
|
|
4810
4814
|
const instances = {};
|
|
4811
4815
|
let counter = 1;
|
|
4812
4816
|
const uuids = new Set();
|
|
@@ -4824,26 +4828,40 @@ const uuids = new Set();
|
|
|
4824
4828
|
uuids.add(uid);
|
|
4825
4829
|
return uid;
|
|
4826
4830
|
}
|
|
4827
|
-
const pluginSystem = new
|
|
4831
|
+
const pluginSystem = new jodit_core_plugin_plugin_system__WEBPACK_IMPORTED_MODULE_9__.PluginSystem({
|
|
4828
4832
|
getContainer
|
|
4829
4833
|
});
|
|
4830
4834
|
const modules = {};
|
|
4831
|
-
|
|
4835
|
+
// A CommonJS pack imported as a namespace carries the dictionary in `default`; a translation of the word is a string
|
|
4836
|
+
const unwrapModule = (pack)=>(0,jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(pack) && (0,jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(pack.default) ? pack.default : pack;
|
|
4837
|
+
/**
|
|
4838
|
+
* Merge language packs into the global `lang` registry
|
|
4839
|
+
*
|
|
4840
|
+
* `__proto__`, `constructor` and `prototype` are skipped on both levels, so a
|
|
4841
|
+
* pack parsed from untrusted JSON cannot reach `Object.prototype` (CWE-1321).
|
|
4842
|
+
*/ const extendLang = (langs)=>{
|
|
4832
4843
|
Object.keys(langs).forEach((key)=>{
|
|
4833
|
-
|
|
4834
|
-
|
|
4835
|
-
|
|
4836
|
-
_constants__WEBPACK_IMPORTED_MODULE_9__.lang[key] = langs[key];
|
|
4844
|
+
const pack = unwrapModule(langs[key]);
|
|
4845
|
+
if ((0,jodit_core_helpers_utils_is_unsafe_proto_key__WEBPACK_IMPORTED_MODULE_8__.isUnsafeProtoKey)(key) || !(0,jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(pack)) {
|
|
4846
|
+
return;
|
|
4837
4847
|
}
|
|
4848
|
+
if (!Object.prototype.hasOwnProperty.call(_constants__WEBPACK_IMPORTED_MODULE_11__.lang, key) || !(0,jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(_constants__WEBPACK_IMPORTED_MODULE_11__.lang[key])) {
|
|
4849
|
+
_constants__WEBPACK_IMPORTED_MODULE_11__.lang[key] = {};
|
|
4850
|
+
}
|
|
4851
|
+
Object.keys(pack).forEach((name)=>{
|
|
4852
|
+
if (!(0,jodit_core_helpers_utils_is_unsafe_proto_key__WEBPACK_IMPORTED_MODULE_8__.isUnsafeProtoKey)(name)) {
|
|
4853
|
+
_constants__WEBPACK_IMPORTED_MODULE_11__.lang[key][name] = pack[name];
|
|
4854
|
+
}
|
|
4855
|
+
});
|
|
4838
4856
|
});
|
|
4839
4857
|
};
|
|
4840
4858
|
const boxes = new WeakMap();
|
|
4841
4859
|
/**
|
|
4842
4860
|
* Create unique box(HTMLCotainer) and remove it after destroy
|
|
4843
4861
|
*/ function getContainer(jodit, classFunc, tag = 'div', createInsideEditor = false) {
|
|
4844
|
-
const name = (0,
|
|
4862
|
+
const name = (0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_2__.isString)(classFunc) ? classFunc : classFunc ? (0,jodit_core_helpers_utils_get_class_name__WEBPACK_IMPORTED_MODULE_7__.getClassName)(classFunc.prototype) : 'jodit-utils';
|
|
4845
4863
|
const data = boxes.get(jodit) || {}, key = name + tag;
|
|
4846
|
-
const view = (0,
|
|
4864
|
+
const view = (0,jodit_core_helpers_checker_is_view_object__WEBPACK_IMPORTED_MODULE_3__.isViewObject)(jodit) ? jodit : jodit.j;
|
|
4847
4865
|
let body;
|
|
4848
4866
|
if (!data[key]) {
|
|
4849
4867
|
let c = view.c;
|
|
@@ -4854,18 +4872,18 @@ const boxes = new WeakMap();
|
|
|
4854
4872
|
body = (0,jodit_core_helpers_checker_is_jodit_object__WEBPACK_IMPORTED_MODULE_0__.isJoditObject)(jodit) && jodit.o.shadowRoot ? jodit.o.shadowRoot : place;
|
|
4855
4873
|
}
|
|
4856
4874
|
const box = c.element(tag, {
|
|
4857
|
-
className: `jodit jodit-${(0,
|
|
4875
|
+
className: `jodit jodit-${(0,jodit_core_helpers_string_kebab_case__WEBPACK_IMPORTED_MODULE_4__.kebabCase)(name)}-container jodit-box`
|
|
4858
4876
|
});
|
|
4859
4877
|
// Let a strict CSP accept the injected <style>/<script> box
|
|
4860
4878
|
if (view.o.nonce && (tag === 'style' || tag === 'script')) {
|
|
4861
|
-
(0,
|
|
4879
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_5__.attr)(box, 'nonce', view.o.nonce);
|
|
4862
4880
|
}
|
|
4863
4881
|
box.classList.add(`jodit_theme_${view.o.theme || 'default'}`);
|
|
4864
|
-
|
|
4882
|
+
_dom__WEBPACK_IMPORTED_MODULE_12__.Dom.append(body, box);
|
|
4865
4883
|
data[key] = box;
|
|
4866
4884
|
jodit.hookStatus('beforeDestruct', ()=>{
|
|
4867
4885
|
view.events.off(box);
|
|
4868
|
-
|
|
4886
|
+
_dom__WEBPACK_IMPORTED_MODULE_12__.Dom.safeRemove(box);
|
|
4869
4887
|
delete data[key];
|
|
4870
4888
|
if (Object.keys(data).length) {
|
|
4871
4889
|
boxes.delete(jodit);
|
|
@@ -4882,15 +4900,15 @@ const boxes = new WeakMap();
|
|
|
4882
4900
|
* Get root element for view
|
|
4883
4901
|
* @internal
|
|
4884
4902
|
*/ function getPopupViewRoot(o, container, defaultRoot) {
|
|
4885
|
-
return o.popupRoot ?? o.shadowRoot ??
|
|
4903
|
+
return o.popupRoot ?? o.shadowRoot ?? _dom__WEBPACK_IMPORTED_MODULE_12__.Dom.closest(container, (parentElement)=>_dom__WEBPACK_IMPORTED_MODULE_12__.Dom.isHTMLElement(parentElement) && (_dom__WEBPACK_IMPORTED_MODULE_12__.Dom.isTag(parentElement, 'dialog') || [
|
|
4886
4904
|
'fixed',
|
|
4887
4905
|
'absolute'
|
|
4888
|
-
].includes((0,
|
|
4906
|
+
].includes((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_6__.css)(parentElement, 'position'))), defaultRoot) ?? defaultRoot;
|
|
4889
4907
|
}
|
|
4890
4908
|
/**
|
|
4891
4909
|
* Global event emitter
|
|
4892
4910
|
* @deprecated use `import { eventEmitter } from 'jodit/core/event-emitter/global';`
|
|
4893
|
-
*/ const eventEmitter =
|
|
4911
|
+
*/ const eventEmitter = _event_emitter_global__WEBPACK_IMPORTED_MODULE_10__.eventEmitter;
|
|
4894
4912
|
|
|
4895
4913
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, [
|
|
4896
4914
|
/* harmony export */ "eventEmitter", 0, /* binding */ eventEmitter,
|
|
@@ -6478,6 +6496,22 @@ function isSmuggledForeignHtml(elm) {
|
|
|
6478
6496
|
'background',
|
|
6479
6497
|
'xlink:href'
|
|
6480
6498
|
];
|
|
6499
|
+
/**
|
|
6500
|
+
* SVG animation elements can write a URL attribute at run time, as
|
|
6501
|
+
* `<animate attributeName="href" values="javascript:…">` does, and the
|
|
6502
|
+
* attributes below carry the values they write.
|
|
6503
|
+
*/ const ANIMATION_TAGS = new Set([
|
|
6504
|
+
'animate',
|
|
6505
|
+
'set',
|
|
6506
|
+
'animatemotion',
|
|
6507
|
+
'animatetransform'
|
|
6508
|
+
]);
|
|
6509
|
+
const ANIMATION_VALUE_ATTRIBUTES = [
|
|
6510
|
+
'values',
|
|
6511
|
+
'from',
|
|
6512
|
+
'to',
|
|
6513
|
+
'by'
|
|
6514
|
+
];
|
|
6481
6515
|
/**
|
|
6482
6516
|
* Tags that load their URL as a *document* (scripts inside run). An SVG data
|
|
6483
6517
|
* URL is only an XSS vector here — as an `<img>` source it renders inertly.
|
|
@@ -6551,6 +6585,19 @@ function sanitizeHTMLElement(elm, { safeJavaScriptLink, removeOnError, removeEve
|
|
|
6551
6585
|
effected = true;
|
|
6552
6586
|
}
|
|
6553
6587
|
}
|
|
6588
|
+
// SMIL sets the attribute on click time, after the static check above:
|
|
6589
|
+
// `<svg><a><animate attributeName="href" values="javascript:…">` ran
|
|
6590
|
+
// in Chromium and Safari. Drop the values that hold a dangerous
|
|
6591
|
+
// scheme; `values` is a `;` list. See GHSA-6wrw-v5gj-6xg7
|
|
6592
|
+
if (ANIMATION_TAGS.has(tagName)) {
|
|
6593
|
+
for (const name of ANIMATION_VALUE_ATTRIBUTES){
|
|
6594
|
+
const value = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attrRaw)(elm, name);
|
|
6595
|
+
if (value && value.split(';').some((part)=>isDangerousUrl(part, 'a'))) {
|
|
6596
|
+
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(elm, name, null);
|
|
6597
|
+
effected = true;
|
|
6598
|
+
}
|
|
6599
|
+
}
|
|
6600
|
+
}
|
|
6554
6601
|
}
|
|
6555
6602
|
return effected;
|
|
6556
6603
|
}
|
|
@@ -16023,6 +16070,18 @@ class UITooltip extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_9__.UIEle
|
|
|
16023
16070
|
render() {
|
|
16024
16071
|
return '<div><div class="&__content"></div></div>';
|
|
16025
16072
|
}
|
|
16073
|
+
get __isEnabled() {
|
|
16074
|
+
const { o } = this.j;
|
|
16075
|
+
return !o.textIcons && Boolean(o.showTooltip) && !o.useNativeTooltip;
|
|
16076
|
+
}
|
|
16077
|
+
/**
|
|
16078
|
+
* Show tooltips for the buttons in an element outside the editor's
|
|
16079
|
+
* container, such as a toolbar placed by the `toolbar` option
|
|
16080
|
+
*/ attach(container) {
|
|
16081
|
+
if (this.__isEnabled) {
|
|
16082
|
+
this.__onAttach(container);
|
|
16083
|
+
}
|
|
16084
|
+
}
|
|
16026
16085
|
__onAttach(container) {
|
|
16027
16086
|
// TODO Move it inside __show method. Now it is here because testcase failed with capturing
|
|
16028
16087
|
jodit_core_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.append((0,jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.getContainer)(this.j, UITooltip), this.container);
|
|
@@ -16157,7 +16216,7 @@ class UITooltip extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_9__.UIEle
|
|
|
16157
16216
|
}
|
|
16158
16217
|
constructor(view){
|
|
16159
16218
|
super(view), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__isOpened", false), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__attachedContainers", new Set()), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__listenClose", false), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__currentTarget", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__delayShowTimeout", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__hideTimeout", 0);
|
|
16160
|
-
if (
|
|
16219
|
+
if (this.__isEnabled) {
|
|
16161
16220
|
this.j.e.on('getContainer', (box)=>{
|
|
16162
16221
|
this.__onAttach(box);
|
|
16163
16222
|
});
|
|
@@ -18476,7 +18535,12 @@ class ViewWithToolbar extends jodit_core_view_view__WEBPACK_IMPORTED_MODULE_11__
|
|
|
18476
18535
|
return;
|
|
18477
18536
|
}
|
|
18478
18537
|
const buttons = this.o.buttons ? (0,jodit_core_helpers_array__WEBPACK_IMPORTED_MODULE_6__.splitArray)(this.o.buttons) : [];
|
|
18479
|
-
|
|
18538
|
+
const container = this.toolbarContainer;
|
|
18539
|
+
this.toolbar?.setRemoveButtons(this.o.removeButtons).build(buttons.concat(this.o.extraButtons || [])).appendTo(container);
|
|
18540
|
+
// The toolbar's own element, as editors can share the one it is placed in
|
|
18541
|
+
if (this.toolbar && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.isOrContains(this.container, container)) {
|
|
18542
|
+
this.__tooltip.attach(this.toolbar.container);
|
|
18543
|
+
}
|
|
18480
18544
|
}
|
|
18481
18545
|
getRegisteredButtonGroups() {
|
|
18482
18546
|
return this.groupToButtons;
|
|
@@ -20180,6 +20244,9 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar
|
|
|
20180
20244
|
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Jodit, "constants", jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__);
|
|
20181
20245
|
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Jodit, "instances", jodit_core_global__WEBPACK_IMPORTED_MODULE_4__.instances);
|
|
20182
20246
|
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Jodit, "lang", jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.lang);
|
|
20247
|
+
/**
|
|
20248
|
+
* Merge language packs into `Jodit.lang`; prototype keys are ignored
|
|
20249
|
+
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Jodit, "extendLang", jodit_core_global__WEBPACK_IMPORTED_MODULE_4__.extendLang);
|
|
20183
20250
|
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Jodit, "core", {
|
|
20184
20251
|
Plugin: jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Plugin
|
|
20185
20252
|
});
|
|
@@ -20224,10 +20291,11 @@ function addClassNames(className, elm) {
|
|
|
20224
20291
|
|
|
20225
20292
|
"use strict";
|
|
20226
20293
|
/* harmony import */ var jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17312);
|
|
20227
|
-
/* harmony import */ var
|
|
20228
|
-
/* harmony import */ var
|
|
20229
|
-
/* harmony import */ var
|
|
20230
|
-
/* harmony import */ var
|
|
20294
|
+
/* harmony import */ var jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(62101);
|
|
20295
|
+
/* harmony import */ var jodit_langs_ar__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(41324);
|
|
20296
|
+
/* harmony import */ var jodit_langs_ar__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(jodit_langs_ar__WEBPACK_IMPORTED_MODULE_2__);
|
|
20297
|
+
/* harmony import */ var jodit_langs_en__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(63837);
|
|
20298
|
+
/* harmony import */ var jodit_langs_keys__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(53414);
|
|
20231
20299
|
/*!
|
|
20232
20300
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
20233
20301
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -20264,41 +20332,43 @@ function addClassNames(className, elm) {
|
|
|
20264
20332
|
|
|
20265
20333
|
|
|
20266
20334
|
|
|
20335
|
+
|
|
20267
20336
|
|
|
20268
20337
|
|
|
20269
20338
|
let exp = {};
|
|
20270
20339
|
exp = {
|
|
20271
|
-
ar: (
|
|
20272
|
-
az: (
|
|
20273
|
-
cs_cz: (
|
|
20274
|
-
de: (
|
|
20275
|
-
en:
|
|
20276
|
-
es: (
|
|
20277
|
-
fa: (
|
|
20278
|
-
fi: (
|
|
20279
|
-
fr: (
|
|
20280
|
-
he: (
|
|
20281
|
-
hu: (
|
|
20282
|
-
id: (
|
|
20283
|
-
it: (
|
|
20284
|
-
ja: (
|
|
20285
|
-
ko: (
|
|
20286
|
-
mn: (
|
|
20287
|
-
nl: (
|
|
20288
|
-
no: (
|
|
20289
|
-
pl: (
|
|
20290
|
-
pt_br: (
|
|
20291
|
-
ru: (
|
|
20292
|
-
sk: (
|
|
20293
|
-
sv: (
|
|
20294
|
-
tr: (
|
|
20295
|
-
ua: (
|
|
20296
|
-
zh_cn: (
|
|
20297
|
-
zh_tw: (
|
|
20340
|
+
ar: (jodit_langs_ar__WEBPACK_IMPORTED_MODULE_2___default()),
|
|
20341
|
+
az: (jodit_langs_ar__WEBPACK_IMPORTED_MODULE_2___default()),
|
|
20342
|
+
cs_cz: (jodit_langs_ar__WEBPACK_IMPORTED_MODULE_2___default()),
|
|
20343
|
+
de: (jodit_langs_ar__WEBPACK_IMPORTED_MODULE_2___default()),
|
|
20344
|
+
en: jodit_langs_en__WEBPACK_IMPORTED_MODULE_3__,
|
|
20345
|
+
es: (jodit_langs_ar__WEBPACK_IMPORTED_MODULE_2___default()),
|
|
20346
|
+
fa: (jodit_langs_ar__WEBPACK_IMPORTED_MODULE_2___default()),
|
|
20347
|
+
fi: (jodit_langs_ar__WEBPACK_IMPORTED_MODULE_2___default()),
|
|
20348
|
+
fr: (jodit_langs_ar__WEBPACK_IMPORTED_MODULE_2___default()),
|
|
20349
|
+
he: (jodit_langs_ar__WEBPACK_IMPORTED_MODULE_2___default()),
|
|
20350
|
+
hu: (jodit_langs_ar__WEBPACK_IMPORTED_MODULE_2___default()),
|
|
20351
|
+
id: (jodit_langs_ar__WEBPACK_IMPORTED_MODULE_2___default()),
|
|
20352
|
+
it: (jodit_langs_ar__WEBPACK_IMPORTED_MODULE_2___default()),
|
|
20353
|
+
ja: (jodit_langs_ar__WEBPACK_IMPORTED_MODULE_2___default()),
|
|
20354
|
+
ko: (jodit_langs_ar__WEBPACK_IMPORTED_MODULE_2___default()),
|
|
20355
|
+
mn: (jodit_langs_ar__WEBPACK_IMPORTED_MODULE_2___default()),
|
|
20356
|
+
nl: (jodit_langs_ar__WEBPACK_IMPORTED_MODULE_2___default()),
|
|
20357
|
+
no: (jodit_langs_ar__WEBPACK_IMPORTED_MODULE_2___default()),
|
|
20358
|
+
pl: (jodit_langs_ar__WEBPACK_IMPORTED_MODULE_2___default()),
|
|
20359
|
+
pt_br: (jodit_langs_ar__WEBPACK_IMPORTED_MODULE_2___default()),
|
|
20360
|
+
ru: (jodit_langs_ar__WEBPACK_IMPORTED_MODULE_2___default()),
|
|
20361
|
+
sk: (jodit_langs_ar__WEBPACK_IMPORTED_MODULE_2___default()),
|
|
20362
|
+
sv: (jodit_langs_ar__WEBPACK_IMPORTED_MODULE_2___default()),
|
|
20363
|
+
tr: (jodit_langs_ar__WEBPACK_IMPORTED_MODULE_2___default()),
|
|
20364
|
+
ua: (jodit_langs_ar__WEBPACK_IMPORTED_MODULE_2___default()),
|
|
20365
|
+
zh_cn: (jodit_langs_ar__WEBPACK_IMPORTED_MODULE_2___default()),
|
|
20366
|
+
zh_tw: (jodit_langs_ar__WEBPACK_IMPORTED_MODULE_2___default())
|
|
20298
20367
|
};
|
|
20299
|
-
/* Unpack array to hash */
|
|
20300
|
-
|
|
20301
|
-
|
|
20368
|
+
/* Unpack array to hash */ // Unwrap a module (`default` is the dictionary or the packed array), but keep a dictionary whose `default` is a translation (`no.js`)
|
|
20369
|
+
const get = (value)=>value ? (0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_0__.isArray)(value.default) || (0,jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(value.default) ? value.default : value : {}, hashLang = {};
|
|
20370
|
+
if ((0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_0__.isArray)(get(jodit_langs_keys__WEBPACK_IMPORTED_MODULE_4__))) {
|
|
20371
|
+
get(jodit_langs_keys__WEBPACK_IMPORTED_MODULE_4__).forEach((key, index)=>{
|
|
20302
20372
|
hashLang[index] = key;
|
|
20303
20373
|
});
|
|
20304
20374
|
}
|
|
@@ -28414,6 +28484,17 @@ const ns = 'addnewline';
|
|
|
28414
28484
|
editor.editor
|
|
28415
28485
|
], 'scroll' + '.' + ns, this.__hideForce).on('finishedCleanHTMLWorker' + '.' + ns, this.__hideForce).on(editor.editor, 'click' + '.' + ns, this.__hide).on(editor.container, 'mouseleave' + '.' + ns, this.__hide).on(editor.editor, 'mousemove' + '.' + ns, this.__onMouseMove);
|
|
28416
28486
|
}
|
|
28487
|
+
/**
|
|
28488
|
+
* An empty line with a `<br>`, as Enter makes, so it keeps its height
|
|
28489
|
+
* without clean-html's fillEmptyParagraph (#1807)
|
|
28490
|
+
*/ __newLine() {
|
|
28491
|
+
const { j } = this;
|
|
28492
|
+
const line = j.createInside.element(j.o.enter);
|
|
28493
|
+
if (!jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.isTag(line, 'br')) {
|
|
28494
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.append(line, j.createInside.element('br'));
|
|
28495
|
+
}
|
|
28496
|
+
return line;
|
|
28497
|
+
}
|
|
28417
28498
|
/**
|
|
28418
28499
|
* A paragraph holding only an embed has no place for the caret, so the
|
|
28419
28500
|
* arrow keys can't get past one that ends the content, or before one that
|
|
@@ -28426,6 +28507,11 @@ const ns = 'addnewline';
|
|
|
28426
28507
|
return;
|
|
28427
28508
|
}
|
|
28428
28509
|
const { startContainer, startOffset } = editor.s.range;
|
|
28510
|
+
// A caret in the editor itself, as beside a horizontal line, is in no
|
|
28511
|
+
// paragraph, and the browsers can leave it there with text beyond (#1803)
|
|
28512
|
+
if (startContainer === editor.editor) {
|
|
28513
|
+
return;
|
|
28514
|
+
}
|
|
28429
28515
|
// Once the browser has moved the caret, if it could. With a 0 timeout
|
|
28430
28516
|
// Jodit would run this at once, before the browser moves it
|
|
28431
28517
|
editor.async.setTimeout(()=>{
|
|
@@ -28434,7 +28520,7 @@ const ns = 'addnewline';
|
|
|
28434
28520
|
if (e.defaultPrevented || !editor.s.isInsideArea || !range.collapsed || range.startContainer !== startContainer || range.startOffset !== startOffset || !block || !jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.findNotEmptyNeighbor(block, !forward, editor.editor)) {
|
|
28435
28521
|
return;
|
|
28436
28522
|
}
|
|
28437
|
-
const p =
|
|
28523
|
+
const p = this.__newLine();
|
|
28438
28524
|
forward ? jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.append(editor.editor, p) : jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.prepend(editor.editor, p);
|
|
28439
28525
|
editor.s.setCursorIn(p);
|
|
28440
28526
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.scrollIntoViewIfNeeded)(p, editor.editor, editor.ed);
|
|
@@ -28446,7 +28532,7 @@ const ns = 'addnewline';
|
|
|
28446
28532
|
if (!editor.o.readonly && editor.o.addNewLineOnDBLClick && e.target === editor.editor && editor.s.isCollapsed()) {
|
|
28447
28533
|
const editorBound = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.offset)(editor.editor, editor, editor.ed);
|
|
28448
28534
|
const top = e.pageY - editor.ew.scrollX;
|
|
28449
|
-
const p =
|
|
28535
|
+
const p = this.__newLine();
|
|
28450
28536
|
if (Math.abs(top - editorBound.top) < Math.abs(top - (editorBound.height + editorBound.top)) && editor.editor.firstChild) {
|
|
28451
28537
|
jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.prepend(editor.editor, p);
|
|
28452
28538
|
} else {
|
|
@@ -28530,7 +28616,7 @@ const ns = 'addnewline';
|
|
|
28530
28616
|
return elm != null && jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.isBlock(elm) && !/^(img|table|iframe|hr)$/i.test(elm.nodeName);
|
|
28531
28617
|
}), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__onClickLine", (e)=>{
|
|
28532
28618
|
const editor = this.j;
|
|
28533
|
-
const p =
|
|
28619
|
+
const p = this.__newLine();
|
|
28534
28620
|
if (this.__isBeforeContent && this.__current && this.__current.parentNode) {
|
|
28535
28621
|
if (this.__current === editor.editor) {
|
|
28536
28622
|
jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.prepend(editor.editor, p);
|
|
@@ -32900,6 +32986,7 @@ class deleteCommand extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__.Plugi
|
|
|
32900
32986
|
}
|
|
32901
32987
|
jodit.s.expandSelection();
|
|
32902
32988
|
const range = jodit.s.range;
|
|
32989
|
+
this.__moveEdgesIntoCells(range);
|
|
32903
32990
|
const caret = this.__clearSelectedCells(range);
|
|
32904
32991
|
if (caret && range.collapsed) {
|
|
32905
32992
|
jodit.s.selectRange(caret);
|
|
@@ -32921,6 +33008,22 @@ class deleteCommand extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__.Plugi
|
|
|
32921
33008
|
jodit.s.selectRange(caret ?? range);
|
|
32922
33009
|
return false;
|
|
32923
33010
|
}
|
|
33011
|
+
/**
|
|
33012
|
+
* Firefox selects cells whole from their row, as after a drag into or out
|
|
33013
|
+
* of a table nested in a cell, and `deleteContents` would remove them. The
|
|
33014
|
+
* edges move into the cells, so their content is cleared instead, as in
|
|
33015
|
+
* Firefox's own delete
|
|
33016
|
+
*/ __moveEdgesIntoCells(range) {
|
|
33017
|
+
const { startContainer, startOffset, endContainer, endOffset } = range;
|
|
33018
|
+
const first = jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isTag(startContainer, 'tr') ? startContainer.childNodes[startOffset] : null;
|
|
33019
|
+
const last = jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isTag(endContainer, 'tr') ? endContainer.childNodes[endOffset - 1] : null;
|
|
33020
|
+
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isCell(first)) {
|
|
33021
|
+
range.setStart(first, 0);
|
|
33022
|
+
}
|
|
33023
|
+
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isCell(last)) {
|
|
33024
|
+
range.setEnd(last, last.childNodes.length);
|
|
33025
|
+
}
|
|
33026
|
+
}
|
|
32924
33027
|
/**
|
|
32925
33028
|
* A selection that starts or ends in a table cell clears the selected part
|
|
32926
33029
|
* of each cell it covers and keeps the cells, as the browsers do.
|
|
@@ -36036,6 +36139,11 @@ function hr(editor) {
|
|
|
36036
36139
|
return false;
|
|
36037
36140
|
}
|
|
36038
36141
|
const p = editor.createInside.element(editor.o.enter);
|
|
36142
|
+
// As Enter's new line has, so it keeps its height without clean-html's
|
|
36143
|
+
// fillEmptyParagraph (#1807)
|
|
36144
|
+
if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(p, 'br')) {
|
|
36145
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.append(p, editor.createInside.element('br'));
|
|
36146
|
+
}
|
|
36039
36147
|
jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.after(elm, p);
|
|
36040
36148
|
editor.s.setCursorIn(p);
|
|
36041
36149
|
return false;
|
|
@@ -41752,11 +41860,15 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
|
|
|
41752
41860
|
});
|
|
41753
41861
|
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.attr)(wrapper, 'style', (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.attr)(element, 'style'));
|
|
41754
41862
|
// The wrapper fits the media, whose size changes as its metadata loads
|
|
41755
|
-
// and as it's resized.
|
|
41863
|
+
// and as it's resized. It's inline, as the media is by default, so the
|
|
41864
|
+
// line's text-align still places it, or a block when the media is one.
|
|
41865
|
+
// A percentage width is of the line, so the wrapper is a block that
|
|
41866
|
+
// takes the line, and the media in it follows the text-align it inherits
|
|
41756
41867
|
const fit = ()=>{
|
|
41868
|
+
const ofLine = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.cssInline)(media, 'width').endsWith('%');
|
|
41757
41869
|
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.css)(wrapper, {
|
|
41758
|
-
display: (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.
|
|
41759
|
-
width:
|
|
41870
|
+
display: !ofLine && /^inline/.test((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.css)(media, 'display').toString()) ? 'inline-block' : 'block',
|
|
41871
|
+
width: ofLine ? '' : 'fit-content',
|
|
41760
41872
|
height: ''
|
|
41761
41873
|
});
|
|
41762
41874
|
};
|
|
@@ -44754,8 +44866,11 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
|
|
|
44754
44866
|
// is nothing measurable at all, let the wrapper size itself.
|
|
44755
44867
|
const width = element.offsetWidth || attrPixelSize(element, 'width');
|
|
44756
44868
|
const height = element.offsetHeight || attrPixelSize(element, 'height');
|
|
44869
|
+
// The wrapper takes the iframe's place in its line: inline, as an
|
|
44870
|
+
// iframe is by default, so the line's text-align still places it,
|
|
44871
|
+
// or a block when the iframe is one
|
|
44757
44872
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(wrapper, {
|
|
44758
|
-
display: (0,
|
|
44873
|
+
display: /^inline/.test((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(element, 'display').toString()) ? 'inline-block' : 'block'
|
|
44759
44874
|
});
|
|
44760
44875
|
if (width) {
|
|
44761
44876
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(wrapper, 'width', width);
|
|
@@ -46065,13 +46180,7 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
|
|
|
46065
46180
|
if (this.j.isLockedNotBy(key)) {
|
|
46066
46181
|
return;
|
|
46067
46182
|
}
|
|
46068
|
-
|
|
46069
|
-
// host, so the lookup must start from the shadow root
|
|
46070
|
-
const node = (this.j.o.shadowRoot ?? this.j.ed).elementFromPoint(e.clientX, e.clientY);
|
|
46071
|
-
const cell = node && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(node, [
|
|
46072
|
-
'td',
|
|
46073
|
-
'th'
|
|
46074
|
-
], table);
|
|
46183
|
+
const cell = this.__cellUnder(e, table);
|
|
46075
46184
|
if (!cell || !this.__selectedCell) {
|
|
46076
46185
|
return;
|
|
46077
46186
|
}
|
|
@@ -46114,6 +46223,13 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
|
|
|
46114
46223
|
this.__isSelectionMode = false;
|
|
46115
46224
|
this.__selectedCell = null;
|
|
46116
46225
|
}
|
|
46226
|
+
// The cell of this table under the pointer; over a table nested in a cell, the mouse is still in that cell
|
|
46227
|
+
__cellUnder(e, table) {
|
|
46228
|
+
// Inside Shadow DOM `document.elementFromPoint` returns the shadow
|
|
46229
|
+
// host, so the lookup must start from the shadow root
|
|
46230
|
+
const node = (this.j.o.shadowRoot ?? this.j.ed).elementFromPoint(e.clientX, e.clientY);
|
|
46231
|
+
return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(node, (elm)=>jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isCell(elm) && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(elm, 'table', table), table);
|
|
46232
|
+
}
|
|
46117
46233
|
/**
|
|
46118
46234
|
* Stop a selection process
|
|
46119
46235
|
*/ __onStopSelection(table, e) {
|
|
@@ -46122,23 +46238,10 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
|
|
|
46122
46238
|
}
|
|
46123
46239
|
this.__isSelectionMode = false;
|
|
46124
46240
|
this.j.unlock();
|
|
46125
|
-
|
|
46126
|
-
// host, so the lookup must start from the shadow root
|
|
46127
|
-
const node = (this.j.o.shadowRoot ?? this.j.ed).elementFromPoint(e.clientX, e.clientY);
|
|
46128
|
-
if (!node) {
|
|
46129
|
-
return;
|
|
46130
|
-
}
|
|
46131
|
-
const cell = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(node, [
|
|
46132
|
-
'td',
|
|
46133
|
-
'th'
|
|
46134
|
-
], table);
|
|
46241
|
+
const cell = this.__cellUnder(e, table);
|
|
46135
46242
|
if (!cell) {
|
|
46136
46243
|
return;
|
|
46137
46244
|
}
|
|
46138
|
-
const ownTable = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(cell, 'table', table);
|
|
46139
|
-
if (ownTable && ownTable !== table) {
|
|
46140
|
-
return; // Nested tables
|
|
46141
|
-
}
|
|
46142
46245
|
this.__showCellsPopup(table, [
|
|
46143
46246
|
cell,
|
|
46144
46247
|
this.__selectedCell
|