jodit 4.2.41 → 4.2.43
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 -5
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.js +2 -2
- package/es2015/jodit.js +81 -33
- package/es2015/jodit.min.js +2 -2
- 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.css +1 -1
- package/es2018/jodit.fat.min.js +2 -2
- package/es2018/jodit.js +81 -33
- package/es2018/jodit.min.js +2 -2
- package/es2018/plugins/debug/debug.css +1 -1
- package/es2018/plugins/debug/debug.js +1 -1
- package/es2018/plugins/debug/debug.min.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.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 +2 -2
- package/es2021/jodit.js +81 -33
- package/es2021/jodit.min.js +2 -2
- 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 +2 -2
- package/es2021.en/jodit.js +81 -33
- package/es2021.en/jodit.min.js +2 -2
- 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/164.fat.min.js +1 -1
- package/es5/164.min.js +1 -1
- package/es5/5.fat.min.js +1 -1
- package/es5/5.min.js +1 -1
- package/es5/jodit.css +2 -2
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +81 -33
- package/es5/jodit.min.css +2 -2
- package/es5/jodit.min.js +2 -2
- package/es5/plugins/debug/debug.css +1 -1
- package/es5/plugins/debug/debug.js +1 -1
- package/es5/plugins/debug/debug.min.js +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/esm/core/constants.js +1 -1
- package/esm/core/helpers/utils/complete-url.d.ts +0 -3
- package/esm/core/helpers/utils/complete-url.js +1 -1
- package/esm/core/selection/style/api/extract.js +1 -0
- package/esm/jodit.d.ts +11 -1
- package/esm/jodit.js +11 -1
- package/esm/modules/history/snapshot.d.ts +1 -0
- package/esm/modules/history/snapshot.js +8 -1
- package/esm/modules/toolbar/button/button.js +18 -9
- package/esm/plugins/ai-assistant/langs/index.d.ts +3 -0
- package/esm/plugins/ai-assistant/langs/index.js +3 -0
- package/esm/plugins/image-properties/readers/align.d.ts +3 -1
- package/esm/plugins/image-properties/readers/align.js +3 -1
- package/esm/plugins/image-properties/readers/index.d.ts +3 -0
- package/esm/plugins/image-properties/readers/link.d.ts +3 -0
- package/esm/plugins/image-properties/readers/margin.js +3 -0
- package/esm/plugins/image-properties/readers/size.js +3 -0
- package/esm/plugins/image-properties/ui/ui-image-form.d.ts +3 -0
- package/esm/plugins/image-properties/ui/ui-image-main-tab.d.ts +3 -0
- package/esm/plugins/image-properties/ui/ui-image-position-tab.d.ts +3 -0
- package/esm/plugins/image-properties/utils/open-image-editor.d.ts +3 -0
- package/esm/plugins/image-properties/utils/open-image-popup.d.ts +3 -0
- package/esm/plugins/image-properties/utils/utils.js +3 -0
- package/esm/plugins/image-properties/writers/index.d.ts +3 -0
- package/esm/plugins/image-properties/writers/link.d.ts +3 -0
- package/esm/plugins/image-properties/writers/margin.d.ts +3 -0
- package/esm/plugins/image-properties/writers/size.js +3 -0
- package/esm/plugins/symbols/config.js +6 -7
- package/esm/plugins/symbols/symbols.d.ts +1 -3
- package/esm/plugins/symbols/symbols.js +16 -11
- package/esm/types/history.d.ts +3 -0
- package/package.json +1 -1
- package/types/core/helpers/utils/complete-url.d.ts +0 -3
- package/types/jodit.d.ts +11 -1
- package/types/modules/history/snapshot.d.ts +1 -0
- package/types/plugins/ai-assistant/langs/index.d.ts +3 -0
- package/types/plugins/image-properties/readers/align.d.ts +3 -1
- package/types/plugins/image-properties/readers/index.d.ts +3 -0
- package/types/plugins/image-properties/readers/link.d.ts +3 -0
- package/types/plugins/image-properties/ui/ui-image-form.d.ts +3 -0
- package/types/plugins/image-properties/ui/ui-image-main-tab.d.ts +3 -0
- package/types/plugins/image-properties/ui/ui-image-position-tab.d.ts +3 -0
- package/types/plugins/image-properties/utils/open-image-editor.d.ts +3 -0
- package/types/plugins/image-properties/utils/open-image-popup.d.ts +3 -0
- package/types/plugins/image-properties/writers/index.d.ts +3 -0
- package/types/plugins/image-properties/writers/link.d.ts +3 -0
- package/types/plugins/image-properties/writers/margin.d.ts +3 -0
- package/types/plugins/symbols/symbols.d.ts +1 -3
- package/types/types/history.d.ts +3 -0
package/es2021/jodit.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
|
|
3
3
|
* Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
|
|
4
|
-
* Version: v4.2.
|
|
4
|
+
* Version: v4.2.43
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -1736,7 +1736,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1736
1736
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
1737
1737
|
* Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
1738
1738
|
*/
|
|
1739
|
-
const APP_VERSION = "4.2.
|
|
1739
|
+
const APP_VERSION = "4.2.43";
|
|
1740
1740
|
// prettier-ignore
|
|
1741
1741
|
const ES = "es2021";
|
|
1742
1742
|
const IS_ES_MODERN = true;
|
|
@@ -7533,10 +7533,10 @@ const buildQuery = (data, prefix) => {
|
|
|
7533
7533
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
7534
7534
|
* Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
7535
7535
|
*/
|
|
7536
|
-
|
|
7537
7536
|
/**
|
|
7538
7537
|
* @module helpers/utils
|
|
7539
7538
|
*/
|
|
7539
|
+
|
|
7540
7540
|
const completeUrl = (url) => {
|
|
7541
7541
|
if (jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalWindow.location.protocol === 'file:' && /^\/\//.test(url)) {
|
|
7542
7542
|
url = 'https:' + url;
|
|
@@ -11251,6 +11251,7 @@ function extractSelectedPart(wrapper, font, jodit) {
|
|
|
11251
11251
|
}
|
|
11252
11252
|
/**
|
|
11253
11253
|
* Retrieves content before after the selected area, clears it if it is empty, and inserts before after the framed selection
|
|
11254
|
+
* @private
|
|
11254
11255
|
*/
|
|
11255
11256
|
function extractAndMove(wrapper, range, left) {
|
|
11256
11257
|
const fragment = range.extractContents();
|
|
@@ -16346,7 +16347,17 @@ let Jodit = Jodit_1 = class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE
|
|
|
16346
16347
|
: jodit_config__WEBPACK_IMPORTED_MODULE_6__/* .Config */ .T.defaultOptions.defaultTimeout;
|
|
16347
16348
|
}
|
|
16348
16349
|
/**
|
|
16349
|
-
* Method wrap usual
|
|
16350
|
+
* Method wrap usual object in Object helper for prevent deep object merging in options*
|
|
16351
|
+
* ```js
|
|
16352
|
+
* const editor = Jodit.make('#editor', {
|
|
16353
|
+
* controls: {
|
|
16354
|
+
* fontsize: {
|
|
16355
|
+
* list: Jodit.atom([8, 9, 10])
|
|
16356
|
+
* }
|
|
16357
|
+
* }
|
|
16358
|
+
* });
|
|
16359
|
+
* ```
|
|
16360
|
+
* In this case, the array [8, 9, 10] will not be combined with other arrays, but will replace them
|
|
16350
16361
|
*/
|
|
16351
16362
|
static atom(object) {
|
|
16352
16363
|
return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.markAsAtomic)(object);
|
|
@@ -20898,6 +20909,7 @@ class Snapshot extends jodit_core_component__WEBPACK_IMPORTED_MODULE_0__/* .View
|
|
|
20898
20909
|
constructor() {
|
|
20899
20910
|
super(...arguments);
|
|
20900
20911
|
this.__isBlocked = false;
|
|
20912
|
+
this.__levelOfTransaction = 0;
|
|
20901
20913
|
}
|
|
20902
20914
|
/** @override */
|
|
20903
20915
|
className() {
|
|
@@ -20978,6 +20990,7 @@ class Snapshot extends jodit_core_component__WEBPACK_IMPORTED_MODULE_0__/* .View
|
|
|
20978
20990
|
}
|
|
20979
20991
|
transaction(changes) {
|
|
20980
20992
|
this.__block(true);
|
|
20993
|
+
this.__levelOfTransaction += 1;
|
|
20981
20994
|
try {
|
|
20982
20995
|
changes();
|
|
20983
20996
|
}
|
|
@@ -20986,7 +20999,12 @@ class Snapshot extends jodit_core_component__WEBPACK_IMPORTED_MODULE_0__/* .View
|
|
|
20986
20999
|
throw e;
|
|
20987
21000
|
}
|
|
20988
21001
|
}
|
|
20989
|
-
|
|
21002
|
+
finally {
|
|
21003
|
+
this.__levelOfTransaction -= 1;
|
|
21004
|
+
if (this.__levelOfTransaction === 0) {
|
|
21005
|
+
this.__block(false);
|
|
21006
|
+
}
|
|
21007
|
+
}
|
|
20990
21008
|
}
|
|
20991
21009
|
/**
|
|
20992
21010
|
* Creates object a snapshot of editor: html and the current selection. Current selection calculate by
|
|
@@ -23223,17 +23241,26 @@ let ToolbarButton = class ToolbarButton extends jodit_core_ui_button__WEBPACK_IM
|
|
|
23223
23241
|
if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.isFunction)(ctr.popup)) {
|
|
23224
23242
|
const popup = this.openPopup();
|
|
23225
23243
|
popup.parentElement = this;
|
|
23226
|
-
|
|
23227
|
-
|
|
23228
|
-
|
|
23229
|
-
|
|
23230
|
-
|
|
23231
|
-
|
|
23232
|
-
|
|
23233
|
-
|
|
23234
|
-
|
|
23244
|
+
try {
|
|
23245
|
+
if (this.j.e.fire((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.camelCase)(`before-${ctr.name}-open-popup`), this.target, ctr, popup) !== false) {
|
|
23246
|
+
const target = this.toolbar?.getTarget(this) ?? this.target ?? null;
|
|
23247
|
+
const elm = ctr.popup(this.j, target, this.__closePopup, this);
|
|
23248
|
+
if (elm) {
|
|
23249
|
+
popup
|
|
23250
|
+
.setContent((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.isString)(elm) ? this.j.c.fromHTML(elm) : elm)
|
|
23251
|
+
.open(() => (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.position)(this.container), false, this.j.o.allowTabNavigation
|
|
23252
|
+
? this.container
|
|
23253
|
+
: undefined);
|
|
23254
|
+
}
|
|
23255
|
+
else {
|
|
23256
|
+
this.__closePopup();
|
|
23257
|
+
}
|
|
23235
23258
|
}
|
|
23236
23259
|
}
|
|
23260
|
+
catch (e) {
|
|
23261
|
+
this.__closePopup();
|
|
23262
|
+
throw e;
|
|
23263
|
+
}
|
|
23237
23264
|
/**
|
|
23238
23265
|
* Fired after the popup was opened for some control button
|
|
23239
23266
|
*/
|
|
@@ -25625,6 +25652,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
25625
25652
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
25626
25653
|
* Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
25627
25654
|
*/
|
|
25655
|
+
/**
|
|
25656
|
+
* @module plugins/ai-assistant
|
|
25657
|
+
*/
|
|
25628
25658
|
|
|
25629
25659
|
|
|
25630
25660
|
|
|
@@ -31598,7 +31628,9 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .pluginSystem */ .fg.add('image
|
|
|
31598
31628
|
* Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
31599
31629
|
*/
|
|
31600
31630
|
|
|
31601
|
-
/**
|
|
31631
|
+
/**
|
|
31632
|
+
* @private
|
|
31633
|
+
*/
|
|
31602
31634
|
function readAlign(image, values) {
|
|
31603
31635
|
// Align
|
|
31604
31636
|
if (image.style.cssFloat &&
|
|
@@ -31719,6 +31751,9 @@ function readLink(state, j, values) {
|
|
|
31719
31751
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
31720
31752
|
* Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
31721
31753
|
*/
|
|
31754
|
+
/**
|
|
31755
|
+
* @module plugins/image-properties
|
|
31756
|
+
*/
|
|
31722
31757
|
|
|
31723
31758
|
/** @private */
|
|
31724
31759
|
function readMargins(image, values, state) {
|
|
@@ -31762,6 +31797,9 @@ function readMargins(image, values, state) {
|
|
|
31762
31797
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
31763
31798
|
* Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
31764
31799
|
*/
|
|
31800
|
+
/**
|
|
31801
|
+
* @module plugins/image-properties
|
|
31802
|
+
*/
|
|
31765
31803
|
|
|
31766
31804
|
|
|
31767
31805
|
|
|
@@ -32575,6 +32613,9 @@ function openImagePopup(j, dialog, state, button) {
|
|
|
32575
32613
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
32576
32614
|
* Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
32577
32615
|
*/
|
|
32616
|
+
/**
|
|
32617
|
+
* @module plugins/image-properties
|
|
32618
|
+
*/
|
|
32578
32619
|
|
|
32579
32620
|
|
|
32580
32621
|
/** @private */
|
|
@@ -32763,6 +32804,9 @@ function applyMargin(j, marginTop, marginRight, marginBottom, marginLeft, image,
|
|
|
32763
32804
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
32764
32805
|
* Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
32765
32806
|
*/
|
|
32807
|
+
/**
|
|
32808
|
+
* @module plugins/image-properties
|
|
32809
|
+
*/
|
|
32766
32810
|
|
|
32767
32811
|
|
|
32768
32812
|
|
|
@@ -41484,14 +41528,13 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__/* .Config */ .T.prototype.controls.sym
|
|
|
41484
41528
|
editor.e.on(container, 'close_dialog', close);
|
|
41485
41529
|
return box;
|
|
41486
41530
|
}
|
|
41487
|
-
|
|
41488
|
-
|
|
41489
|
-
|
|
41490
|
-
|
|
41491
|
-
|
|
41492
|
-
a && a.focus();
|
|
41493
|
-
}
|
|
41531
|
+
editor
|
|
41532
|
+
.alert(container, 'Select Special Character', undefined, 'jodit-symbols')
|
|
41533
|
+
.bindDestruct(editor);
|
|
41534
|
+
const a = container.querySelector('a');
|
|
41535
|
+
a && a.focus();
|
|
41494
41536
|
}
|
|
41537
|
+
return;
|
|
41495
41538
|
}
|
|
41496
41539
|
};
|
|
41497
41540
|
|
|
@@ -42008,17 +42051,15 @@ module.exports = {
|
|
|
42008
42051
|
class symbols extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_4__/* .Plugin */ .k {
|
|
42009
42052
|
constructor(jodit) {
|
|
42010
42053
|
super(jodit);
|
|
42011
|
-
/** @override */
|
|
42012
42054
|
this.buttons = [
|
|
42013
42055
|
{
|
|
42014
42056
|
name: 'symbols',
|
|
42015
42057
|
group: 'insert'
|
|
42016
42058
|
}
|
|
42017
42059
|
];
|
|
42018
|
-
this.
|
|
42060
|
+
this.__countInRow = 17;
|
|
42019
42061
|
(0,jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .extendLang */ .JW)(_langs__WEBPACK_IMPORTED_MODULE_6__);
|
|
42020
42062
|
}
|
|
42021
|
-
/** @override */
|
|
42022
42063
|
afterInit(jodit) {
|
|
42023
42064
|
jodit.e.on('generateSpecialCharactersTable.symbols', () => {
|
|
42024
42065
|
const container = jodit.c.fromHTML(`<div class="jodit-symbols__container">
|
|
@@ -42028,10 +42069,15 @@ class symbols extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_4__/* .P
|
|
|
42028
42069
|
<div class="jodit-symbols__container_preview">
|
|
42029
42070
|
<div class="jodit-symbols__preview"></div>
|
|
42030
42071
|
</div>
|
|
42031
|
-
</div>`)
|
|
42072
|
+
</div>`);
|
|
42073
|
+
const preview = container.querySelector('.jodit-symbols__preview');
|
|
42074
|
+
const table = container.querySelector('table');
|
|
42075
|
+
const body = table.tBodies[0];
|
|
42076
|
+
const chars = [];
|
|
42032
42077
|
for (let i = 0; i < jodit.o.specialCharacters.length;) {
|
|
42033
42078
|
const tr = jodit.c.element('tr');
|
|
42034
|
-
for (let j = 0; j < this.
|
|
42079
|
+
for (let j = 0; j < this.__countInRow &&
|
|
42080
|
+
i < jodit.o.specialCharacters.length; j += 1, i += 1) {
|
|
42035
42081
|
const td = jodit.c.element('td'), a = jodit.c.fromHTML(`<a
|
|
42036
42082
|
data-index="${i}"
|
|
42037
42083
|
data-index-j="${j}"
|
|
@@ -42053,7 +42099,9 @@ class symbols extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_4__/* .P
|
|
|
42053
42099
|
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isTag(this, 'a')) {
|
|
42054
42100
|
jodit.s.focus();
|
|
42055
42101
|
jodit.s.insertHTML(this.innerHTML);
|
|
42056
|
-
|
|
42102
|
+
if (!e?.shiftKey) {
|
|
42103
|
+
jodit.e.fire(this, 'close_dialog');
|
|
42104
|
+
}
|
|
42057
42105
|
e && e.preventDefault();
|
|
42058
42106
|
e && e.stopImmediatePropagation();
|
|
42059
42107
|
}
|
|
@@ -42073,18 +42121,18 @@ class symbols extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_4__/* .P
|
|
|
42073
42121
|
case jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_DOWN:
|
|
42074
42122
|
newIndex =
|
|
42075
42123
|
e.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_UP
|
|
42076
|
-
? index - self.
|
|
42077
|
-
: index + self.
|
|
42124
|
+
? index - self.__countInRow
|
|
42125
|
+
: index + self.__countInRow;
|
|
42078
42126
|
if (chars[newIndex] === undefined) {
|
|
42079
42127
|
newIndex =
|
|
42080
42128
|
e.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_UP
|
|
42081
42129
|
? Math.floor(chars.length /
|
|
42082
|
-
self.
|
|
42083
|
-
self.
|
|
42130
|
+
self.__countInRow) *
|
|
42131
|
+
self.__countInRow +
|
|
42084
42132
|
jIndex
|
|
42085
42133
|
: jIndex;
|
|
42086
42134
|
if (newIndex > chars.length - 1) {
|
|
42087
|
-
newIndex -= self.
|
|
42135
|
+
newIndex -= self.__countInRow;
|
|
42088
42136
|
}
|
|
42089
42137
|
}
|
|
42090
42138
|
chars[newIndex] && chars[newIndex].focus();
|