jodit 4.2.46 → 4.2.49
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 +33 -0
- package/README.md +1 -0
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.js +2 -2
- package/es2015/jodit.js +24 -11
- 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 +24 -11
- 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 +24 -11
- 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 +24 -11
- 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 +27 -13
- 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/view/view.js +3 -3
- package/esm/jodit.d.ts +3 -3
- package/esm/plugins/size/size.js +10 -3
- package/esm/plugins/source/editor/engines/ace.js +9 -3
- package/esm/types/types.d.ts +3 -0
- package/package.json +1 -1
- package/types/jodit.d.ts +3 -3
- package/types/types/types.d.ts +3 -0
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-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
|
-
export const APP_VERSION = "4.2.
|
|
6
|
+
export const APP_VERSION = "4.2.49";
|
|
7
7
|
// prettier-ignore
|
|
8
8
|
export const ES = "es2020";
|
|
9
9
|
export const IS_ES_MODERN = true;
|
package/esm/core/view/view.js
CHANGED
|
@@ -260,11 +260,11 @@ let View = View_1 = class View extends Component {
|
|
|
260
260
|
super.destruct();
|
|
261
261
|
}
|
|
262
262
|
};
|
|
263
|
-
// from webpack.config.
|
|
263
|
+
// from webpack.config.ts
|
|
264
264
|
View.ES = ES;
|
|
265
265
|
View.version = APP_VERSION;
|
|
266
|
-
View.esNext = IS_ES_NEXT; // from webpack.config.
|
|
267
|
-
View.esModern = IS_ES_MODERN; // from webpack.config.
|
|
266
|
+
View.esNext = IS_ES_NEXT; // from webpack.config.ts
|
|
267
|
+
View.esModern = IS_ES_MODERN; // from webpack.config.ts
|
|
268
268
|
__decorate([
|
|
269
269
|
cache
|
|
270
270
|
], View.prototype, "buffer", null);
|
package/esm/jodit.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @packageDocumentation
|
|
9
9
|
* @module jodit
|
|
10
10
|
*/
|
|
11
|
-
import type { AjaxOptions, CanPromise, CustomCommand, ICreate, IDictionary, IFileBrowser, IHistory, IJodit, IMessages, IPluginSystem, IResponse, IStatusBar, IUploader, IWorkPlace, Modes } from "./types";
|
|
11
|
+
import type { AjaxOptions, CanPromise, CustomCommand, DeepPartial, ICreate, IDictionary, IFileBrowser, IHistory, IJodit, IMessages, IPluginSystem, IResponse, IStatusBar, IUploader, IWorkPlace, Modes } from "./types";
|
|
12
12
|
import type * as Modules from "./modules";
|
|
13
13
|
import * as constants from "./core/constants";
|
|
14
14
|
import { Dlgs } from "./core/traits/dlgs";
|
|
@@ -65,7 +65,7 @@ export declare class Jodit extends ViewWithToolbar implements IJodit, Dlgs {
|
|
|
65
65
|
/**
|
|
66
66
|
* Factory for creating Jodit instance
|
|
67
67
|
*/
|
|
68
|
-
static make(element: HTMLElement | string, options?:
|
|
68
|
+
static make(element: HTMLElement | string, options?: DeepPartial<Config>): Jodit;
|
|
69
69
|
/**
|
|
70
70
|
* Checks if the element has already been initialized when for Jodit
|
|
71
71
|
*/
|
|
@@ -341,7 +341,7 @@ export declare class Jodit extends ViewWithToolbar implements IJodit, Dlgs {
|
|
|
341
341
|
* @param element - Selector or HTMLElement
|
|
342
342
|
* @param options - Editor's options
|
|
343
343
|
*/
|
|
344
|
-
protected constructor(element: HTMLElement | string, options?:
|
|
344
|
+
protected constructor(element: HTMLElement | string, options?: DeepPartial<Config>);
|
|
345
345
|
currentPlace: IWorkPlace;
|
|
346
346
|
places: IWorkPlace[];
|
|
347
347
|
private readonly __elementToPlace;
|
package/esm/plugins/size/size.js
CHANGED
|
@@ -76,6 +76,7 @@ let size = class size extends Plugin {
|
|
|
76
76
|
* Manually change height
|
|
77
77
|
*/
|
|
78
78
|
__setHeight(height) {
|
|
79
|
+
const { clientHeight, clientWidth } = this.j.container;
|
|
79
80
|
if (isNumber(height)) {
|
|
80
81
|
const { minHeight, maxHeight } = this.j.o;
|
|
81
82
|
if (isNumber(minHeight) && minHeight > height) {
|
|
@@ -89,12 +90,13 @@ let size = class size extends Plugin {
|
|
|
89
90
|
if (this.j.o.saveHeightInStorage) {
|
|
90
91
|
this.j.storage.set('height', height);
|
|
91
92
|
}
|
|
92
|
-
this.__resizeWorkspaceImd();
|
|
93
|
+
this.__resizeWorkspaceImd({ clientHeight, clientWidth });
|
|
93
94
|
}
|
|
94
95
|
/**
|
|
95
96
|
* Manually change width
|
|
96
97
|
*/
|
|
97
98
|
__setWidth(width) {
|
|
99
|
+
const { clientHeight, clientWidth } = this.j.container;
|
|
98
100
|
if (isNumber(width)) {
|
|
99
101
|
const { minWidth, maxWidth } = this.j.o;
|
|
100
102
|
if (isNumber(minWidth) && minWidth > width) {
|
|
@@ -105,7 +107,7 @@ let size = class size extends Plugin {
|
|
|
105
107
|
}
|
|
106
108
|
}
|
|
107
109
|
css(this.j.container, 'width', width);
|
|
108
|
-
this.__resizeWorkspaceImd();
|
|
110
|
+
this.__resizeWorkspaceImd({ clientHeight, clientWidth });
|
|
109
111
|
}
|
|
110
112
|
/**
|
|
111
113
|
* Returns service spaces: toolbar + statusbar
|
|
@@ -118,7 +120,7 @@ let size = class size extends Plugin {
|
|
|
118
120
|
/**
|
|
119
121
|
* Calculate workspace height
|
|
120
122
|
*/
|
|
121
|
-
__resizeWorkspaceImd() {
|
|
123
|
+
__resizeWorkspaceImd({ clientHeight, clientWidth } = this.j.container) {
|
|
122
124
|
if (!this.j || this.j.isDestructed || !this.j.o || this.j.o.inline) {
|
|
123
125
|
return;
|
|
124
126
|
}
|
|
@@ -145,6 +147,11 @@ let size = class size extends Plugin {
|
|
|
145
147
|
? this.j.container.offsetHeight - this.__getNotWorkHeight()
|
|
146
148
|
: 'auto');
|
|
147
149
|
}
|
|
150
|
+
const { clientHeight: newClientHeight, clientWidth: newClientWidth } = this.j.container;
|
|
151
|
+
if (clientHeight !== newClientHeight ||
|
|
152
|
+
clientWidth !== newClientWidth) {
|
|
153
|
+
this.j.e.fire(this.j, 'resize');
|
|
154
|
+
}
|
|
148
155
|
}
|
|
149
156
|
/** @override **/
|
|
150
157
|
beforeDestruct(jodit) {
|
|
@@ -99,10 +99,12 @@ export class AceEditor extends SourceEditor {
|
|
|
99
99
|
if (editor.getRealMode() !== constants.MODE_WYSIWYG) {
|
|
100
100
|
this.setValue(this.getValue());
|
|
101
101
|
}
|
|
102
|
-
const onResize = this.j.async.
|
|
103
|
-
if (editor.isInDestruct
|
|
102
|
+
const onResize = this.j.async.throttle(() => {
|
|
103
|
+
if (editor.isInDestruct ||
|
|
104
|
+
editor.getMode() === constants.MODE_WYSIWYG) {
|
|
104
105
|
return;
|
|
105
106
|
}
|
|
107
|
+
const hasFocus = this.instance.isFocused();
|
|
106
108
|
if (editor.o.height !== 'auto') {
|
|
107
109
|
this.instance.setOption('maxLines', editor.workplace.offsetHeight /
|
|
108
110
|
this.instance.renderer.lineHeight);
|
|
@@ -111,8 +113,11 @@ export class AceEditor extends SourceEditor {
|
|
|
111
113
|
this.instance.setOption('maxLines', Infinity);
|
|
112
114
|
}
|
|
113
115
|
this.instance.resize();
|
|
116
|
+
hasFocus && this.focus();
|
|
114
117
|
}, this.j.defaultTimeout * 2);
|
|
115
|
-
editor.e
|
|
118
|
+
editor.e
|
|
119
|
+
.on(editor, 'resize', onResize)
|
|
120
|
+
.on('afterResize afterSetMode', onResize);
|
|
116
121
|
onResize();
|
|
117
122
|
this.onReady();
|
|
118
123
|
};
|
|
@@ -163,6 +168,7 @@ export class AceEditor extends SourceEditor {
|
|
|
163
168
|
return this.instance.isFocused();
|
|
164
169
|
}
|
|
165
170
|
focus() {
|
|
171
|
+
this.instance.container.focus();
|
|
166
172
|
this.instance.focus();
|
|
167
173
|
}
|
|
168
174
|
blur() {
|
package/esm/types/types.d.ts
CHANGED
package/package.json
CHANGED
package/types/jodit.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @packageDocumentation
|
|
9
9
|
* @module jodit
|
|
10
10
|
*/
|
|
11
|
-
import type { AjaxOptions, CanPromise, CustomCommand, ICreate, IDictionary, IFileBrowser, IHistory, IJodit, IMessages, IPluginSystem, IResponse, IStatusBar, IUploader, IWorkPlace, Modes } from "./types";
|
|
11
|
+
import type { AjaxOptions, CanPromise, CustomCommand, DeepPartial, ICreate, IDictionary, IFileBrowser, IHistory, IJodit, IMessages, IPluginSystem, IResponse, IStatusBar, IUploader, IWorkPlace, Modes } from "./types";
|
|
12
12
|
import type * as Modules from "./modules";
|
|
13
13
|
import * as constants from "./core/constants";
|
|
14
14
|
import { Dlgs } from "./core/traits/dlgs";
|
|
@@ -65,7 +65,7 @@ export declare class Jodit extends ViewWithToolbar implements IJodit, Dlgs {
|
|
|
65
65
|
/**
|
|
66
66
|
* Factory for creating Jodit instance
|
|
67
67
|
*/
|
|
68
|
-
static make(element: HTMLElement | string, options?:
|
|
68
|
+
static make(element: HTMLElement | string, options?: DeepPartial<Config>): Jodit;
|
|
69
69
|
/**
|
|
70
70
|
* Checks if the element has already been initialized when for Jodit
|
|
71
71
|
*/
|
|
@@ -341,7 +341,7 @@ export declare class Jodit extends ViewWithToolbar implements IJodit, Dlgs {
|
|
|
341
341
|
* @param element - Selector or HTMLElement
|
|
342
342
|
* @param options - Editor's options
|
|
343
343
|
*/
|
|
344
|
-
protected constructor(element: HTMLElement | string, options?:
|
|
344
|
+
protected constructor(element: HTMLElement | string, options?: DeepPartial<Config>);
|
|
345
345
|
currentPlace: IWorkPlace;
|
|
346
346
|
places: IWorkPlace[];
|
|
347
347
|
private readonly __elementToPlace;
|