jodit 4.1.4 → 4.1.7
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 +9 -5
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.js +2 -2
- package/es2015/jodit.js +350 -5510
- 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 +349 -5509
- 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 +349 -5509
- 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 +348 -5508
- 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 +21 -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/index.js +0 -7
- package/esm/plugins/ai-assistant/ai-assistant.d.ts +2 -2
- package/esm/plugins/ai-assistant/ui/ui-ai-assistant.d.ts +5 -1
- package/esm/plugins/ai-assistant/ui/ui-ai-assistant.js +18 -7
- package/package.json +1 -1
- package/types/plugins/ai-assistant/ai-assistant.d.ts +2 -2
- package/types/plugins/ai-assistant/ui/ui-ai-assistant.d.ts +5 -1
- package/esm/polyfills.d.ts +0 -10
- package/types/polyfills.d.ts +0 -10
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.1.
|
|
6
|
+
export const APP_VERSION = "4.1.7";
|
|
7
7
|
// prettier-ignore
|
|
8
8
|
export const ES = "es2020";
|
|
9
9
|
export const IS_ES_MODERN = true;
|
package/esm/index.js
CHANGED
|
@@ -14,15 +14,8 @@ import * as constants from "./core/constants";
|
|
|
14
14
|
import * as decorators from "./core/decorators";
|
|
15
15
|
import * as Modules from "./modules/";
|
|
16
16
|
import * as Icons from "./styles/icons/";
|
|
17
|
-
// JODIT-SECTION-END:POLYFILLS
|
|
18
17
|
import { Jodit as DefaultJodit } from "./jodit";
|
|
19
18
|
import Languages from "./languages";
|
|
20
|
-
// JODIT-SECTION-START:POLYFILLS
|
|
21
|
-
if (typeof process !== 'undefined' &&
|
|
22
|
-
constants.ES === 'es5' &&
|
|
23
|
-
typeof window !== 'undefined') {
|
|
24
|
-
require("./polyfills");
|
|
25
|
-
}
|
|
26
19
|
// copy constants in Jodit
|
|
27
20
|
Object.keys(constants).forEach((key) => {
|
|
28
21
|
DefaultJodit[key] = constants[key];
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
|
-
* [[include:plugins/
|
|
7
|
+
* [[include:plugins/ai-assistant/README.md]]
|
|
8
8
|
* @packageDocumentation
|
|
9
|
-
* @module plugins/
|
|
9
|
+
* @module plugins/ai-assistant
|
|
10
10
|
*/
|
|
11
11
|
import type { IJodit } from "jodit/esm/types";
|
|
12
12
|
import { Plugin } from "jodit/esm/core/plugin/plugin";
|
|
@@ -3,6 +3,9 @@
|
|
|
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
|
+
/**
|
|
7
|
+
* @module plugins/ai-assistant
|
|
8
|
+
*/
|
|
6
9
|
import type { IJodit } from "jodit/esm/types";
|
|
7
10
|
import { UITextArea } from "jodit/esm/core/ui";
|
|
8
11
|
import { UIElement } from "jodit/esm/core/ui/element";
|
|
@@ -30,5 +33,6 @@ export declare class UiAiAssistant extends UIElement<IJodit> {
|
|
|
30
33
|
protected onAiAssistentResponse(result: string): void;
|
|
31
34
|
protected onAiAssistentError(error: string): void;
|
|
32
35
|
protected onChangePromptValue(): void;
|
|
33
|
-
private
|
|
36
|
+
private __toggleSubmitButton;
|
|
37
|
+
private __toggleInsertButton;
|
|
34
38
|
}
|
|
@@ -36,11 +36,12 @@ let UiAiAssistant = class UiAiAssistant extends UIElement {
|
|
|
36
36
|
const onSubmit = () => {
|
|
37
37
|
if (this.__formAiAssistant.validate()) {
|
|
38
38
|
this.__formAiAssistant.submit();
|
|
39
|
-
this.
|
|
39
|
+
this.__toggleInsertButton(true);
|
|
40
|
+
this.__toggleSubmitButton(true);
|
|
40
41
|
}
|
|
41
42
|
};
|
|
42
43
|
this.__submitButton = Button(jodit, 'ai-assistant', '').onAction(onSubmit);
|
|
43
|
-
this.__tryAgainButton = Button(jodit, '', '
|
|
44
|
+
this.__tryAgainButton = Button(jodit, 'update', '', 'initial').onAction(onSubmit);
|
|
44
45
|
this.promptInput = new UITextArea(jodit, {
|
|
45
46
|
name: 'prompt',
|
|
46
47
|
required: true,
|
|
@@ -98,9 +99,10 @@ let UiAiAssistant = class UiAiAssistant extends UIElement {
|
|
|
98
99
|
]
|
|
99
100
|
.filter(Boolean)
|
|
100
101
|
.join(' ');
|
|
102
|
+
this.__toggleInsertButton(true);
|
|
101
103
|
if (this.promptInput.value) {
|
|
102
104
|
this.__formAiAssistant.submit();
|
|
103
|
-
this.
|
|
105
|
+
this.__toggleSubmitButton(true);
|
|
104
106
|
}
|
|
105
107
|
}
|
|
106
108
|
this.promptInput.focus();
|
|
@@ -110,21 +112,30 @@ let UiAiAssistant = class UiAiAssistant extends UIElement {
|
|
|
110
112
|
Dom.detach(this.__results);
|
|
111
113
|
this.__aiResult = result;
|
|
112
114
|
this.__results.appendChild(this.jodit.c.fromHTML(result));
|
|
113
|
-
this.
|
|
115
|
+
this.__toggleSubmitButton(false);
|
|
116
|
+
this.__toggleInsertButton(false);
|
|
114
117
|
}
|
|
115
118
|
onAiAssistentError(error) {
|
|
116
119
|
this.__aiResult = '';
|
|
117
120
|
this.setMod('loading', false);
|
|
118
121
|
this.__error.textContent = error;
|
|
119
|
-
this.
|
|
122
|
+
Dom.detach(this.__results);
|
|
123
|
+
this.__toggleSubmitButton(false);
|
|
124
|
+
const hideMod = this.getFullElName('', 'hide', 'true');
|
|
125
|
+
this.__results.classList.add(hideMod);
|
|
126
|
+
this.__toggleInsertButton(true);
|
|
120
127
|
}
|
|
121
128
|
onChangePromptValue() {
|
|
122
|
-
this.
|
|
129
|
+
this.__toggleSubmitButton(!this.promptInput.value);
|
|
123
130
|
}
|
|
124
|
-
|
|
131
|
+
__toggleSubmitButton(value) {
|
|
125
132
|
this.__submitButton.state.disabled = value;
|
|
126
133
|
this.__tryAgainButton.state.disabled = value;
|
|
127
134
|
}
|
|
135
|
+
__toggleInsertButton(value) {
|
|
136
|
+
this.__insertButton.state.disabled = value;
|
|
137
|
+
this.__insertAfterButton.state.disabled = value;
|
|
138
|
+
}
|
|
128
139
|
};
|
|
129
140
|
__decorate([
|
|
130
141
|
watch(':ai-assistant-response')
|
package/package.json
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
|
-
* [[include:plugins/
|
|
7
|
+
* [[include:plugins/ai-assistant/README.md]]
|
|
8
8
|
* @packageDocumentation
|
|
9
|
-
* @module plugins/
|
|
9
|
+
* @module plugins/ai-assistant
|
|
10
10
|
*/
|
|
11
11
|
import type { IJodit } from "jodit/esm/types";
|
|
12
12
|
import { Plugin } from "jodit/esm/core/plugin/plugin";
|
|
@@ -3,6 +3,9 @@
|
|
|
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
|
+
/**
|
|
7
|
+
* @module plugins/ai-assistant
|
|
8
|
+
*/
|
|
6
9
|
import type { IJodit } from "jodit/esm/types";
|
|
7
10
|
import { UITextArea } from "jodit/esm/core/ui";
|
|
8
11
|
import { UIElement } from "jodit/esm/core/ui/element";
|
|
@@ -30,5 +33,6 @@ export declare class UiAiAssistant extends UIElement<IJodit> {
|
|
|
30
33
|
protected onAiAssistentResponse(result: string): void;
|
|
31
34
|
protected onAiAssistentError(error: string): void;
|
|
32
35
|
protected onChangePromptValue(): void;
|
|
33
|
-
private
|
|
36
|
+
private __toggleSubmitButton;
|
|
37
|
+
private __toggleInsertButton;
|
|
34
38
|
}
|
package/esm/polyfills.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
3
|
-
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
|
-
* Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
|
-
*/
|
|
6
|
-
import "classlist-polyfill";
|
|
7
|
-
import "es6-promise/auto";
|
|
8
|
-
import "core-js/es/symbol";
|
|
9
|
-
import "core-js/es/array/find-index";
|
|
10
|
-
import "core-js/es/array/from";
|
package/types/polyfills.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
3
|
-
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
|
-
* Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
|
-
*/
|
|
6
|
-
import "classlist-polyfill";
|
|
7
|
-
import "es6-promise/auto";
|
|
8
|
-
import "core-js/es/symbol";
|
|
9
|
-
import "core-js/es/array/find-index";
|
|
10
|
-
import "core-js/es/array/from";
|