jodit 4.2.6 → 4.2.9
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 +23 -5
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.js +2 -2
- package/es2015/jodit.js +47 -38
- 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 +47 -38
- 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 +44 -38
- 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 +44 -38
- 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 +47 -40
- 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/ui/group/list.js +2 -1
- package/esm/core/ui/popup/popup.js +1 -1
- package/esm/plugins/color/config.js +37 -1
- package/esm/plugins/inline-popup/config/items/cells.js +1 -31
- package/esm/types/toolbar.d.ts +1 -0
- package/package.json +1 -1
- package/types/types/toolbar.d.ts +1 -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.9";
|
|
7
7
|
// prettier-ignore
|
|
8
8
|
export const ES = "es2020";
|
|
9
9
|
export const IS_ES_MODERN = true;
|
|
@@ -112,7 +112,8 @@ let UIList = class UIList extends UIGroup {
|
|
|
112
112
|
group.append(elm);
|
|
113
113
|
}
|
|
114
114
|
};
|
|
115
|
-
const isNotRemoved = (b) => !this.removeButtons.includes(b.name)
|
|
115
|
+
const isNotRemoved = (b) => !this.removeButtons.includes(b.name) &&
|
|
116
|
+
(!b.isVisible || b.isVisible?.(this.j, b));
|
|
116
117
|
items.forEach(item => {
|
|
117
118
|
if (isButtonGroup(item)) {
|
|
118
119
|
const buttons = item.buttons.filter(b => b);
|
|
@@ -212,7 +212,7 @@ export class Popup extends UIGroup {
|
|
|
212
212
|
}
|
|
213
213
|
return strategy;
|
|
214
214
|
};
|
|
215
|
-
// Try find match position inside Jodit.container
|
|
215
|
+
// Try to find match position inside Jodit.container
|
|
216
216
|
let strategy = getMatchStrategy(position(this.j.container, this.j));
|
|
217
217
|
// If not found or is not inside window view
|
|
218
218
|
if (!strategy || !Popup.boxInView(getPointByStrategy(strategy), view)) {
|
|
@@ -4,13 +4,49 @@
|
|
|
4
4
|
* Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
6
|
import { Dom } from "jodit/esm/core/dom/dom.js";
|
|
7
|
-
import { css, dataBind } from "jodit/esm/core/helpers/index.js";
|
|
7
|
+
import { css, dataBind, isJoditObject } from "jodit/esm/core/helpers/index.js";
|
|
8
8
|
import { Icon } from "jodit/esm/core/ui/icon.js";
|
|
9
9
|
import { ColorPickerWidget, TabsWidget } from "jodit/esm/modules/widget/index.js";
|
|
10
10
|
import brushIcon from "./brush.svg.js";
|
|
11
11
|
import { Config } from "jodit/esm/config.js";
|
|
12
12
|
Icon.set('brush', brushIcon);
|
|
13
|
+
Config.prototype.controls.brushCell = {
|
|
14
|
+
isVisible: (editor) => {
|
|
15
|
+
return !editor.o.disablePlugins.includes('color');
|
|
16
|
+
},
|
|
17
|
+
icon: 'brush',
|
|
18
|
+
popup: (editor, _, close) => {
|
|
19
|
+
if (!isJoditObject(editor)) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const tableModule = editor.getInstance('Table', editor.o), selected = tableModule.getAllSelectedCells();
|
|
23
|
+
if (!selected.length) {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
const makeColorPicker = (key) => ColorPickerWidget(editor, (value) => {
|
|
27
|
+
selected.forEach(cell => {
|
|
28
|
+
css(cell, key, value);
|
|
29
|
+
});
|
|
30
|
+
editor.lock();
|
|
31
|
+
editor.synchronizeValues();
|
|
32
|
+
close();
|
|
33
|
+
editor.unlock();
|
|
34
|
+
}, css(selected[0], key));
|
|
35
|
+
return TabsWidget(editor, [
|
|
36
|
+
{
|
|
37
|
+
name: 'Background',
|
|
38
|
+
content: makeColorPicker('background-color')
|
|
39
|
+
},
|
|
40
|
+
{ name: 'Text', content: makeColorPicker('color') },
|
|
41
|
+
{ name: 'Border', content: makeColorPicker('border-color') }
|
|
42
|
+
]);
|
|
43
|
+
},
|
|
44
|
+
tooltip: 'Background'
|
|
45
|
+
};
|
|
13
46
|
Config.prototype.controls.brush = {
|
|
47
|
+
isVisible: (editor) => {
|
|
48
|
+
return !editor.o.disablePlugins.includes('color');
|
|
49
|
+
},
|
|
14
50
|
update(editor, button) {
|
|
15
51
|
const color = dataBind(button, 'color');
|
|
16
52
|
const update = (key, value) => {
|
|
@@ -5,41 +5,11 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { isJoditObject, isString } from "jodit/esm/core/helpers/checker/index.js";
|
|
7
7
|
import { css } from "jodit/esm/core/helpers/utils/css.js";
|
|
8
|
-
import { ColorPickerWidget, TabsWidget } from "jodit/esm/modules/widget/index.js";
|
|
9
8
|
const cmd = (control) => control.args && isString(control.args[0])
|
|
10
9
|
? control.args[0].toLowerCase()
|
|
11
10
|
: '';
|
|
12
11
|
export default [
|
|
13
|
-
|
|
14
|
-
name: 'brush',
|
|
15
|
-
popup: (editor, _, close) => {
|
|
16
|
-
if (!isJoditObject(editor)) {
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
const tableModule = editor.getInstance('Table', editor.o), selected = tableModule.getAllSelectedCells();
|
|
20
|
-
if (!selected.length) {
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
const makeColorPicker = (key) => ColorPickerWidget(editor, (value) => {
|
|
24
|
-
selected.forEach(cell => {
|
|
25
|
-
css(cell, key, value);
|
|
26
|
-
});
|
|
27
|
-
editor.lock();
|
|
28
|
-
editor.synchronizeValues();
|
|
29
|
-
close();
|
|
30
|
-
editor.unlock();
|
|
31
|
-
}, css(selected[0], key));
|
|
32
|
-
return TabsWidget(editor, [
|
|
33
|
-
{
|
|
34
|
-
name: 'Background',
|
|
35
|
-
content: makeColorPicker('background-color')
|
|
36
|
-
},
|
|
37
|
-
{ name: 'Text', content: makeColorPicker('color') },
|
|
38
|
-
{ name: 'Border', content: makeColorPicker('border-color') }
|
|
39
|
-
]);
|
|
40
|
-
},
|
|
41
|
-
tooltip: 'Background'
|
|
42
|
-
},
|
|
12
|
+
'brushCell',
|
|
43
13
|
{
|
|
44
14
|
name: 'valign',
|
|
45
15
|
list: ['Top', 'Middle', 'Bottom', 'Normal'],
|
package/esm/types/toolbar.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ interface IControlType<T extends IViewBased = IJodit | IViewBased | IFileBrowser
|
|
|
21
21
|
data?: IDictionary;
|
|
22
22
|
isInput?: boolean;
|
|
23
23
|
component?: 'button' | 'select';
|
|
24
|
+
isVisible?: (editor: T, control: IControlType) => boolean;
|
|
24
25
|
/**
|
|
25
26
|
* You can use it function for control - active/not active button
|
|
26
27
|
*
|
package/package.json
CHANGED
package/types/types/toolbar.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ interface IControlType<T extends IViewBased = IJodit | IViewBased | IFileBrowser
|
|
|
21
21
|
data?: IDictionary;
|
|
22
22
|
isInput?: boolean;
|
|
23
23
|
component?: 'button' | 'select';
|
|
24
|
+
isVisible?: (editor: T, control: IControlType) => boolean;
|
|
24
25
|
/**
|
|
25
26
|
* You can use it function for control - active/not active button
|
|
26
27
|
*
|