jodit 4.2.7 → 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.
Files changed (54) hide show
  1. package/CHANGELOG.md +23 -5
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.js +2 -2
  4. package/es2015/jodit.js +46 -37
  5. package/es2015/jodit.min.js +2 -2
  6. package/es2015/plugins/debug/debug.js +1 -1
  7. package/es2015/plugins/debug/debug.min.js +1 -1
  8. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  9. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
  10. package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
  11. package/es2018/jodit.css +1 -1
  12. package/es2018/jodit.fat.min.js +2 -2
  13. package/es2018/jodit.js +46 -37
  14. package/es2018/jodit.min.js +2 -2
  15. package/es2018/plugins/debug/debug.js +1 -1
  16. package/es2018/plugins/debug/debug.min.js +1 -1
  17. package/es2018/plugins/speech-recognize/speech-recognize.css +1 -1
  18. package/es2018/plugins/speech-recognize/speech-recognize.js +1 -1
  19. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  20. package/es2021/jodit.css +1 -1
  21. package/es2021/jodit.fat.min.js +2 -2
  22. package/es2021/jodit.js +43 -37
  23. package/es2021/jodit.min.js +2 -2
  24. package/es2021/plugins/debug/debug.js +1 -1
  25. package/es2021/plugins/debug/debug.min.js +1 -1
  26. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  27. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  28. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  29. package/es2021.en/jodit.css +1 -1
  30. package/es2021.en/jodit.fat.min.js +2 -2
  31. package/es2021.en/jodit.js +43 -37
  32. package/es2021.en/jodit.min.js +2 -2
  33. package/es2021.en/plugins/debug/debug.js +1 -1
  34. package/es2021.en/plugins/debug/debug.min.js +1 -1
  35. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  36. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  37. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  38. package/es5/jodit.css +2 -2
  39. package/es5/jodit.fat.min.js +2 -2
  40. package/es5/jodit.js +46 -39
  41. package/es5/jodit.min.css +2 -2
  42. package/es5/jodit.min.js +2 -2
  43. package/es5/plugins/debug/debug.js +1 -1
  44. package/es5/plugins/debug/debug.min.js +1 -1
  45. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  46. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  47. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  48. package/esm/core/constants.js +1 -1
  49. package/esm/core/ui/group/list.js +2 -1
  50. package/esm/plugins/color/config.js +37 -1
  51. package/esm/plugins/inline-popup/config/items/cells.js +1 -31
  52. package/esm/types/toolbar.d.ts +1 -0
  53. package/package.json +1 -1
  54. package/types/types/toolbar.d.ts +1 -0
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.2.7
4
+ * Version: v4.2.9
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.2.7
4
+ * Version: v4.2.9
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.2.7
4
+ * Version: v4.2.9
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.2.7
4
+ * Version: v4.2.9
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.2.7
4
+ * Version: v4.2.9
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -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.7";
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);
@@ -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'],
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jodit",
3
- "version": "4.2.7",
3
+ "version": "4.2.9",
4
4
  "description": "Jodit is an awesome and useful wysiwyg editor with filebrowser",
5
5
  "main": "esm/index.js",
6
6
  "types": "types/index.d.ts",
@@ -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
  *