jodit 4.6.1 → 4.6.2
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 +22 -0
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.js +2 -2
- package/es2015/jodit.js +46 -13
- 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 +46 -13
- 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 +46 -13
- 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 +46 -13
- 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/415.fat.min.js +1 -1
- package/es5/415.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 +51 -14
- 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.d.ts +7 -0
- package/esm/core/constants.js +31 -11
- package/esm/core/helpers/utils/append-script.js +1 -1
- package/esm/core/plugin/helpers/load.js +2 -0
- package/esm/core/view/view.d.ts +4 -0
- package/esm/core/view/view.js +10 -1
- package/esm/types/view.d.ts +6 -1
- package/package.json +1 -1
- package/types/core/constants.d.ts +7 -0
- package/types/core/view/view.d.ts +4 -0
- package/types/types/view.d.ts +6 -1
package/esm/core/constants.d.ts
CHANGED
|
@@ -130,7 +130,14 @@ export declare const INSERT_ONLY_TEXT = "insert_only_text";
|
|
|
130
130
|
export declare const SAFE_COUNT_CHANGE_CALL = 10;
|
|
131
131
|
export declare const IS_MAC: boolean;
|
|
132
132
|
export declare const KEY_ALIASES: IDictionary<string>;
|
|
133
|
+
/**
|
|
134
|
+
* Path to the current script
|
|
135
|
+
*/
|
|
133
136
|
export declare const BASE_PATH: string;
|
|
137
|
+
/**
|
|
138
|
+
* Current script is minified
|
|
139
|
+
*/
|
|
140
|
+
export declare const BASE_PATH_IS_MIN: boolean;
|
|
134
141
|
export declare const TEMP_ATTR = "data-jodit-temp";
|
|
135
142
|
export declare const lang: IDictionary<IDictionary<string>>;
|
|
136
143
|
export declare const CLIPBOARD_ID = "clipboard";
|
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-2025 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
|
-
export const APP_VERSION = "4.6.
|
|
6
|
+
export const APP_VERSION = "4.6.2";
|
|
7
7
|
// prettier-ignore
|
|
8
8
|
export const ES = "es2020";
|
|
9
9
|
export const IS_ES_MODERN = true;
|
|
@@ -175,17 +175,29 @@ export const KEY_ALIASES = {
|
|
|
175
175
|
win: 'meta',
|
|
176
176
|
windows: 'meta'
|
|
177
177
|
};
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
178
|
+
const removeScriptName = (src) => {
|
|
179
|
+
const parts = src.split('/');
|
|
180
|
+
const isMin = typeof false === 'boolean'
|
|
181
|
+
? false : /\.min\.js/.test(src);
|
|
182
|
+
if (/\.js/.test(parts[parts.length - 1])) {
|
|
183
|
+
return {
|
|
184
|
+
basePath: parts.slice(0, parts.length - 1).join('/') + '/',
|
|
185
|
+
isMin
|
|
186
|
+
};
|
|
181
187
|
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
return parts.slice(0, parts.length - 1).join('/') + '/';
|
|
186
|
-
}
|
|
187
|
-
return s;
|
|
188
|
+
return {
|
|
189
|
+
basePath: src,
|
|
190
|
+
isMin
|
|
188
191
|
};
|
|
192
|
+
};
|
|
193
|
+
const { basePath, isMin } = (() => {
|
|
194
|
+
if (typeof document === 'undefined') {
|
|
195
|
+
return {
|
|
196
|
+
basePath: '',
|
|
197
|
+
isMin: Boolean(false)
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
const script = globalDocument.currentScript;
|
|
189
201
|
if (script) {
|
|
190
202
|
return removeScriptName(script.src);
|
|
191
203
|
}
|
|
@@ -193,8 +205,16 @@ export const BASE_PATH = (() => {
|
|
|
193
205
|
if (scripts && scripts.length) {
|
|
194
206
|
return removeScriptName(scripts[scripts.length - 1].src);
|
|
195
207
|
}
|
|
196
|
-
return globalWindow.location.href;
|
|
208
|
+
return removeScriptName(globalWindow.location.href);
|
|
197
209
|
})();
|
|
210
|
+
/**
|
|
211
|
+
* Path to the current script
|
|
212
|
+
*/
|
|
213
|
+
export const BASE_PATH = basePath;
|
|
214
|
+
/**
|
|
215
|
+
* Current script is minified
|
|
216
|
+
*/
|
|
217
|
+
export const BASE_PATH_IS_MIN = isMin;
|
|
198
218
|
export const TEMP_ATTR = 'data-jodit-temp';
|
|
199
219
|
export const lang = {};
|
|
200
220
|
export const CLIPBOARD_ID = 'clipboard';
|
|
@@ -31,8 +31,8 @@ export const appendScriptAsync = cacheLoaders((jodit, url) => {
|
|
|
31
31
|
async: true,
|
|
32
32
|
src: completeUrl(url)
|
|
33
33
|
});
|
|
34
|
+
jodit.e.one(script, 'error', reject).one(script, 'load', resolve);
|
|
34
35
|
jodit.od.body.appendChild(script);
|
|
35
|
-
jodit.e.on(script, 'error', reject).on(script, 'load', resolve);
|
|
36
36
|
});
|
|
37
37
|
});
|
|
38
38
|
/**
|
|
@@ -25,11 +25,13 @@ export async function loadStyle(jodit, pluginName) {
|
|
|
25
25
|
*/
|
|
26
26
|
function getFullUrl(jodit, name, js) {
|
|
27
27
|
name = kebabCase(name);
|
|
28
|
+
const min = jodit.minified ? '.min' : '';
|
|
28
29
|
return (jodit.basePath +
|
|
29
30
|
'plugins/' +
|
|
30
31
|
name +
|
|
31
32
|
'/' +
|
|
32
33
|
name +
|
|
34
|
+
min +
|
|
33
35
|
'.' +
|
|
34
36
|
(js ? 'js' : 'css'));
|
|
35
37
|
}
|
package/esm/core/view/view.d.ts
CHANGED
|
@@ -31,6 +31,10 @@ export declare abstract class View extends Component implements IViewBased, Mods
|
|
|
31
31
|
* Get a path for loading extra staff
|
|
32
32
|
*/
|
|
33
33
|
get basePath(): string;
|
|
34
|
+
/**
|
|
35
|
+
* Plugin autoloader should load minified version of the file
|
|
36
|
+
*/
|
|
37
|
+
get minified(): boolean;
|
|
34
38
|
static readonly ES: 'es5' | 'es2015' | 'es2018' | 'es2021';
|
|
35
39
|
static readonly version: string;
|
|
36
40
|
static readonly esNext: boolean;
|
package/esm/core/view/view.js
CHANGED
|
@@ -17,7 +17,7 @@ var View_1;
|
|
|
17
17
|
import { ViewComponent } from "../component/index.js";
|
|
18
18
|
import { Component } from "../component/component.js";
|
|
19
19
|
import { STATUSES } from "../component/statuses.js";
|
|
20
|
-
import { APP_VERSION, BASE_PATH, ES, IS_ES_MODERN, IS_ES_NEXT } from "../constants.js";
|
|
20
|
+
import { APP_VERSION, BASE_PATH, BASE_PATH_IS_MIN, ES, IS_ES_MODERN, IS_ES_NEXT } from "../constants.js";
|
|
21
21
|
import { Create } from "../create/create.js";
|
|
22
22
|
import { cache, cached } from "../decorators/cache/cache.js";
|
|
23
23
|
import { derive } from "../decorators/derive/derive.js";
|
|
@@ -41,6 +41,15 @@ let View = View_1 = class View extends Component {
|
|
|
41
41
|
}
|
|
42
42
|
return BASE_PATH;
|
|
43
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Plugin autoloader should load minified version of the file
|
|
46
|
+
*/
|
|
47
|
+
get minified() {
|
|
48
|
+
if (this.o.minified !== undefined) {
|
|
49
|
+
return this.o.minified;
|
|
50
|
+
}
|
|
51
|
+
return BASE_PATH_IS_MIN;
|
|
52
|
+
}
|
|
44
53
|
/**
|
|
45
54
|
* Return a default timeout period in milliseconds for some debounce or throttle functions.
|
|
46
55
|
* By default, `{history.timeout}` options
|
package/esm/types/view.d.ts
CHANGED
|
@@ -42,7 +42,11 @@ interface IViewOptions extends ILanguageOptions, IToolbarOptions {
|
|
|
42
42
|
cache?: boolean;
|
|
43
43
|
getIcon?: (name: string, clearName: string) => CanUndef<string>;
|
|
44
44
|
headerButtons?: string | Array<IControlType | string | ButtonsGroup>;
|
|
45
|
-
basePath?: string;
|
|
45
|
+
readonly basePath?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Plugin autoloader should load minified version of the file
|
|
48
|
+
*/
|
|
49
|
+
readonly minified?: boolean;
|
|
46
50
|
theme?: string;
|
|
47
51
|
defaultTimeout?: number;
|
|
48
52
|
disabled?: boolean;
|
|
@@ -71,6 +75,7 @@ interface IViewBased<T = IViewOptions> extends IContainer, IComponent, IMods, IE
|
|
|
71
75
|
*/
|
|
72
76
|
readonly id: string;
|
|
73
77
|
readonly basePath: string;
|
|
78
|
+
readonly minified: boolean;
|
|
74
79
|
readonly isLocked: boolean;
|
|
75
80
|
isLockedNotBy(name: string): boolean;
|
|
76
81
|
lock(name?: string): boolean;
|
package/package.json
CHANGED
|
@@ -130,7 +130,14 @@ export declare const INSERT_ONLY_TEXT = "insert_only_text";
|
|
|
130
130
|
export declare const SAFE_COUNT_CHANGE_CALL = 10;
|
|
131
131
|
export declare const IS_MAC: boolean;
|
|
132
132
|
export declare const KEY_ALIASES: IDictionary<string>;
|
|
133
|
+
/**
|
|
134
|
+
* Path to the current script
|
|
135
|
+
*/
|
|
133
136
|
export declare const BASE_PATH: string;
|
|
137
|
+
/**
|
|
138
|
+
* Current script is minified
|
|
139
|
+
*/
|
|
140
|
+
export declare const BASE_PATH_IS_MIN: boolean;
|
|
134
141
|
export declare const TEMP_ATTR = "data-jodit-temp";
|
|
135
142
|
export declare const lang: IDictionary<IDictionary<string>>;
|
|
136
143
|
export declare const CLIPBOARD_ID = "clipboard";
|
|
@@ -31,6 +31,10 @@ export declare abstract class View extends Component implements IViewBased, Mods
|
|
|
31
31
|
* Get a path for loading extra staff
|
|
32
32
|
*/
|
|
33
33
|
get basePath(): string;
|
|
34
|
+
/**
|
|
35
|
+
* Plugin autoloader should load minified version of the file
|
|
36
|
+
*/
|
|
37
|
+
get minified(): boolean;
|
|
34
38
|
static readonly ES: 'es5' | 'es2015' | 'es2018' | 'es2021';
|
|
35
39
|
static readonly version: string;
|
|
36
40
|
static readonly esNext: boolean;
|
package/types/types/view.d.ts
CHANGED
|
@@ -42,7 +42,11 @@ interface IViewOptions extends ILanguageOptions, IToolbarOptions {
|
|
|
42
42
|
cache?: boolean;
|
|
43
43
|
getIcon?: (name: string, clearName: string) => CanUndef<string>;
|
|
44
44
|
headerButtons?: string | Array<IControlType | string | ButtonsGroup>;
|
|
45
|
-
basePath?: string;
|
|
45
|
+
readonly basePath?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Plugin autoloader should load minified version of the file
|
|
48
|
+
*/
|
|
49
|
+
readonly minified?: boolean;
|
|
46
50
|
theme?: string;
|
|
47
51
|
defaultTimeout?: number;
|
|
48
52
|
disabled?: boolean;
|
|
@@ -71,6 +75,7 @@ interface IViewBased<T = IViewOptions> extends IContainer, IComponent, IMods, IE
|
|
|
71
75
|
*/
|
|
72
76
|
readonly id: string;
|
|
73
77
|
readonly basePath: string;
|
|
78
|
+
readonly minified: boolean;
|
|
74
79
|
readonly isLocked: boolean;
|
|
75
80
|
isLockedNotBy(name: string): boolean;
|
|
76
81
|
lock(name?: string): boolean;
|