jodit 4.0.0-beta.92 → 4.0.0-beta.95
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 +13 -5
- package/README.md +5 -5
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.js +2 -2
- package/es2015/jodit.js +33 -10
- package/es2015/jodit.min.js +2 -2
- 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 +33 -10
- package/es2018/jodit.min.js +2 -2
- 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 +33 -10
- package/es2021/jodit.min.js +2 -2
- 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 +33 -10
- package/es2021.en/jodit.min.js +2 -2
- 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 +37 -10
- package/es5/jodit.min.css +2 -2
- package/es5/jodit.min.js +2 -2
- 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/selection/selection.js +14 -5
- package/esm/core/view/view.d.ts +1 -0
- package/esm/core/view/view.js +4 -1
- package/esm/jodit.d.ts +2 -1
- package/esm/jodit.js +6 -0
- package/esm/modules/uploader/helpers/send.js +6 -1
- package/esm/plugins/wrap-nodes/wrap-nodes.js +2 -2
- package/package.json +1 -1
- package/types/core/view/view.d.ts +1 -0
- package/types/jodit.d.ts +2 -1
package/esm/core/constants.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
4
|
* Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
|
-
export const APP_VERSION = "4.0.0-beta.
|
|
6
|
+
export const APP_VERSION = "4.0.0-beta.95";
|
|
7
7
|
// prettier-ignore
|
|
8
8
|
export const ES = "es2020";
|
|
9
9
|
export const IS_ES_MODERN = true;
|
|
@@ -14,7 +14,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
14
14
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
15
15
|
};
|
|
16
16
|
import * as consts from "jodit/esm/core/constants.js";
|
|
17
|
-
import { INVISIBLE_SPACE, INVISIBLE_SPACE_REG_EXP_END as INV_END, INVISIBLE_SPACE_REG_EXP_START as INV_START, IS_PROD } from "jodit/esm/core/constants.js";
|
|
17
|
+
import { INSEPARABLE_TAGS, INVISIBLE_SPACE, INVISIBLE_SPACE_REG_EXP_END as INV_END, INVISIBLE_SPACE_REG_EXP_START as INV_START, IS_PROD } from "jodit/esm/core/constants.js";
|
|
18
18
|
import { Dom } from "jodit/esm/core/dom/dom.js";
|
|
19
19
|
import { size, attr, error, $$, css, call, toArray, getScrollParent, scrollIntoViewIfNeeded } from "jodit/esm/core/helpers/index.js";
|
|
20
20
|
import { autobind } from "jodit/esm/core/decorators/index.js";
|
|
@@ -817,7 +817,7 @@ export class Selection {
|
|
|
817
817
|
const range = this.createRange();
|
|
818
818
|
let start = node, last = node;
|
|
819
819
|
do {
|
|
820
|
-
if (Dom.isText(start)) {
|
|
820
|
+
if (Dom.isText(start) || Dom.isTag(start, INSEPARABLE_TAGS)) {
|
|
821
821
|
break;
|
|
822
822
|
}
|
|
823
823
|
last = start;
|
|
@@ -825,7 +825,7 @@ export class Selection {
|
|
|
825
825
|
} while (start);
|
|
826
826
|
if (!start) {
|
|
827
827
|
const fakeNode = this.j.createInside.text(consts.INVISIBLE_SPACE);
|
|
828
|
-
if (
|
|
828
|
+
if (!Dom.isTag(last, INSEPARABLE_TAGS)) {
|
|
829
829
|
last.appendChild(fakeNode);
|
|
830
830
|
last = fakeNode;
|
|
831
831
|
}
|
|
@@ -833,8 +833,17 @@ export class Selection {
|
|
|
833
833
|
start = last;
|
|
834
834
|
}
|
|
835
835
|
}
|
|
836
|
-
|
|
837
|
-
|
|
836
|
+
const workElm = start || last;
|
|
837
|
+
if (!Dom.isTag(workElm, INSEPARABLE_TAGS)) {
|
|
838
|
+
range.selectNodeContents(workElm);
|
|
839
|
+
range.collapse(inStart);
|
|
840
|
+
}
|
|
841
|
+
else {
|
|
842
|
+
inStart || Dom.isTag(workElm, 'br')
|
|
843
|
+
? range.setStartBefore(workElm)
|
|
844
|
+
: range.setEndAfter(workElm);
|
|
845
|
+
range.collapse(inStart);
|
|
846
|
+
}
|
|
838
847
|
this.selectRange(range);
|
|
839
848
|
return last;
|
|
840
849
|
}
|
package/esm/core/view/view.d.ts
CHANGED
|
@@ -46,6 +46,7 @@ export declare abstract class View extends Component implements IViewBased, Mods
|
|
|
46
46
|
*/
|
|
47
47
|
get buffer(): IStorage;
|
|
48
48
|
get message(): IMessages;
|
|
49
|
+
protected getMessageModule(container: HTMLElement): IMessages;
|
|
49
50
|
/**
|
|
50
51
|
* Container for persistent set/get value
|
|
51
52
|
*/
|
package/esm/core/view/view.js
CHANGED
|
@@ -49,7 +49,10 @@ let View = View_1 = class View extends Component {
|
|
|
49
49
|
return Storage.makeStorage();
|
|
50
50
|
}
|
|
51
51
|
get message() {
|
|
52
|
-
return
|
|
52
|
+
return this.getMessageModule(this.container);
|
|
53
|
+
}
|
|
54
|
+
getMessageModule(container) {
|
|
55
|
+
return new UIMessages(this, container);
|
|
53
56
|
}
|
|
54
57
|
/**
|
|
55
58
|
* Container for persistent set/get value
|
package/esm/jodit.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @packageDocumentation
|
|
9
9
|
* @module jodit
|
|
10
10
|
*/
|
|
11
|
-
import type { CustomCommand, IDictionary, IPluginSystem, IStatusBar, IWorkPlace, Modes, IFileBrowser, IJodit, IUploader, ICreate, CanPromise, IHistory, AjaxOptions, IResponse } from "jodit/esm/types";
|
|
11
|
+
import type { CustomCommand, IDictionary, IPluginSystem, IStatusBar, IWorkPlace, Modes, IFileBrowser, IJodit, IUploader, ICreate, CanPromise, IHistory, AjaxOptions, IResponse, IMessages } from "jodit/esm/types";
|
|
12
12
|
import type * as Modules from "jodit/esm/modules";
|
|
13
13
|
import { Config } from "jodit/esm/config";
|
|
14
14
|
import * as constants from "jodit/esm/core/constants";
|
|
@@ -104,6 +104,7 @@ export declare class Jodit extends ViewWithToolbar implements IJodit, Dlgs {
|
|
|
104
104
|
* workplace It contains source and wysiwyg editors
|
|
105
105
|
*/
|
|
106
106
|
get workplace(): HTMLDivElement;
|
|
107
|
+
get message(): IMessages;
|
|
107
108
|
/**
|
|
108
109
|
* Statusbar module
|
|
109
110
|
*/
|
package/esm/jodit.js
CHANGED
|
@@ -140,6 +140,9 @@ let Jodit = Jodit_1 = class Jodit extends ViewWithToolbar {
|
|
|
140
140
|
get workplace() {
|
|
141
141
|
return this.currentPlace.workplace;
|
|
142
142
|
}
|
|
143
|
+
get message() {
|
|
144
|
+
return this.getMessageModule(this.workplace);
|
|
145
|
+
}
|
|
143
146
|
/**
|
|
144
147
|
* Statusbar module
|
|
145
148
|
*/
|
|
@@ -1227,6 +1230,9 @@ Jodit.core = {
|
|
|
1227
1230
|
__decorate([
|
|
1228
1231
|
cache
|
|
1229
1232
|
], Jodit.prototype, "createInside", null);
|
|
1233
|
+
__decorate([
|
|
1234
|
+
cache
|
|
1235
|
+
], Jodit.prototype, "message", null);
|
|
1230
1236
|
__decorate([
|
|
1231
1237
|
cache
|
|
1232
1238
|
], Jodit.prototype, "s", null);
|
|
@@ -56,7 +56,12 @@ export function send(uploader, data) {
|
|
|
56
56
|
.send()
|
|
57
57
|
.then(resp => resp.json())
|
|
58
58
|
.catch(error => {
|
|
59
|
-
|
|
59
|
+
return {
|
|
60
|
+
success: false,
|
|
61
|
+
data: {
|
|
62
|
+
messages: [error]
|
|
63
|
+
}
|
|
64
|
+
};
|
|
60
65
|
})
|
|
61
66
|
.finally(() => {
|
|
62
67
|
ajax.destruct();
|
|
@@ -50,10 +50,10 @@ class wrapNodes extends Plugin {
|
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
52
52
|
jodit.e
|
|
53
|
-
.on('drop.wtn focus.wtn keydown.wtn mousedown.wtn afterInit.wtn', this.preprocessInput, {
|
|
53
|
+
.on('drop.wtn focus.wtn keydown.wtn mousedown.wtn afterInit.wtn backSpaceAfterDelete.wtn', this.preprocessInput, {
|
|
54
54
|
top: true
|
|
55
55
|
})
|
|
56
|
-
.on('afterInit.wtn postProcessSetEditorValue.wtn afterCommitStyle.wtn', this.postProcessSetEditorValue);
|
|
56
|
+
.on('afterInit.wtn postProcessSetEditorValue.wtn afterCommitStyle.wtn backSpaceAfterDelete.wtn', this.postProcessSetEditorValue);
|
|
57
57
|
}
|
|
58
58
|
/** @override **/
|
|
59
59
|
beforeDestruct(jodit) {
|
package/package.json
CHANGED
|
@@ -46,6 +46,7 @@ export declare abstract class View extends Component implements IViewBased, Mods
|
|
|
46
46
|
*/
|
|
47
47
|
get buffer(): IStorage;
|
|
48
48
|
get message(): IMessages;
|
|
49
|
+
protected getMessageModule(container: HTMLElement): IMessages;
|
|
49
50
|
/**
|
|
50
51
|
* Container for persistent set/get value
|
|
51
52
|
*/
|
package/types/jodit.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @packageDocumentation
|
|
9
9
|
* @module jodit
|
|
10
10
|
*/
|
|
11
|
-
import type { CustomCommand, IDictionary, IPluginSystem, IStatusBar, IWorkPlace, Modes, IFileBrowser, IJodit, IUploader, ICreate, CanPromise, IHistory, AjaxOptions, IResponse } from "jodit/esm/types";
|
|
11
|
+
import type { CustomCommand, IDictionary, IPluginSystem, IStatusBar, IWorkPlace, Modes, IFileBrowser, IJodit, IUploader, ICreate, CanPromise, IHistory, AjaxOptions, IResponse, IMessages } from "jodit/esm/types";
|
|
12
12
|
import type * as Modules from "jodit/esm/modules";
|
|
13
13
|
import { Config } from "jodit/esm/config";
|
|
14
14
|
import * as constants from "jodit/esm/core/constants";
|
|
@@ -104,6 +104,7 @@ export declare class Jodit extends ViewWithToolbar implements IJodit, Dlgs {
|
|
|
104
104
|
* workplace It contains source and wysiwyg editors
|
|
105
105
|
*/
|
|
106
106
|
get workplace(): HTMLDivElement;
|
|
107
|
+
get message(): IMessages;
|
|
107
108
|
/**
|
|
108
109
|
* Statusbar module
|
|
109
110
|
*/
|