jodit 4.2.7 → 4.2.10

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 (56) 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 +62 -44
  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 +62 -44
  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 +59 -44
  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 +59 -44
  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 +62 -46
  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/image-properties/readers/size.js +11 -6
  52. package/esm/plugins/image-properties/writers/size.js +4 -1
  53. package/esm/plugins/inline-popup/config/items/cells.js +1 -31
  54. package/esm/types/toolbar.d.ts +1 -0
  55. package/package.json +1 -1
  56. package/types/types/toolbar.d.ts +1 -0
package/es2015/jodit.js CHANGED
@@ -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.10
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1736,7 +1736,7 @@ __webpack_require__.r(__webpack_exports__);
1736
1736
  * Released under MIT see LICENSE.txt in the project root for license information.
1737
1737
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
1738
1738
  */
1739
- const APP_VERSION = "4.2.7";
1739
+ const APP_VERSION = "4.2.10";
1740
1740
  // prettier-ignore
1741
1741
  const ES = "es2015";
1742
1742
  const IS_ES_MODERN = true;
@@ -14753,7 +14753,11 @@ let UIList = class UIList extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MO
14753
14753
  group.append(elm);
14754
14754
  }
14755
14755
  };
14756
- const isNotRemoved = (b) => !this.removeButtons.includes(b.name);
14756
+ const isNotRemoved = (b) => {
14757
+ var _a;
14758
+ return !this.removeButtons.includes(b.name) &&
14759
+ (!b.isVisible || ((_a = b.isVisible) === null || _a === void 0 ? void 0 : _a.call(b, this.j, b)));
14760
+ };
14757
14761
  items.forEach(item => {
14758
14762
  if ((0,jodit_core_ui_helpers_buttons__WEBPACK_IMPORTED_MODULE_9__/* .isButtonGroup */ .i)(item)) {
14759
14763
  const buttons = item.buttons.filter(b => b);
@@ -27747,7 +27751,43 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_0__/* .pluginSystem */ .fg.add('color
27747
27751
 
27748
27752
 
27749
27753
  jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_2__/* .Icon */ .I.set('brush', (_brush_svg__WEBPACK_IMPORTED_MODULE_4___default()));
27754
+ jodit_config__WEBPACK_IMPORTED_MODULE_5__/* .Config */ .T.prototype.controls.brushCell = {
27755
+ isVisible: (editor) => {
27756
+ return !editor.o.disablePlugins.includes('color');
27757
+ },
27758
+ icon: 'brush',
27759
+ popup: (editor, _, close) => {
27760
+ if (!(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_1__.isJoditObject)(editor)) {
27761
+ return;
27762
+ }
27763
+ const tableModule = editor.getInstance('Table', editor.o), selected = tableModule.getAllSelectedCells();
27764
+ if (!selected.length) {
27765
+ return false;
27766
+ }
27767
+ const makeColorPicker = (key) => (0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_3__/* .ColorPickerWidget */ .Kn)(editor, (value) => {
27768
+ selected.forEach(cell => {
27769
+ (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_1__.css)(cell, key, value);
27770
+ });
27771
+ editor.lock();
27772
+ editor.synchronizeValues();
27773
+ close();
27774
+ editor.unlock();
27775
+ }, (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_1__.css)(selected[0], key));
27776
+ return (0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_3__/* .TabsWidget */ .Zg)(editor, [
27777
+ {
27778
+ name: 'Background',
27779
+ content: makeColorPicker('background-color')
27780
+ },
27781
+ { name: 'Text', content: makeColorPicker('color') },
27782
+ { name: 'Border', content: makeColorPicker('border-color') }
27783
+ ]);
27784
+ },
27785
+ tooltip: 'Background'
27786
+ };
27750
27787
  jodit_config__WEBPACK_IMPORTED_MODULE_5__/* .Config */ .T.prototype.controls.brush = {
27788
+ isVisible: (editor) => {
27789
+ return !editor.o.disablePlugins.includes('color');
27790
+ },
27751
27791
  update(editor, button) {
27752
27792
  const color = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_1__.dataBind)(button, 'color');
27753
27793
  const update = (key, value) => {
@@ -31538,16 +31578,21 @@ function readMargins(image, values, state) {
31538
31578
  function readSizes(image, values, state) {
31539
31579
  return (0,tslib__WEBPACK_IMPORTED_MODULE_2__/* .__awaiter */ .sH)(this, void 0, void 0, function* () {
31540
31580
  yield image.decode();
31541
- const width = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'width') || (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__/* .css */ .A)(image, 'width', true) || false;
31542
- const height = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'height') || (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__/* .css */ .A)(image, 'height', true) || false;
31581
+ const width = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__/* .css */ .A)(image, 'width', true) || (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'width') || false;
31582
+ const height = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__/* .css */ .A)(image, 'height', true) || (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'height') || false;
31543
31583
  values.imageWidth =
31544
31584
  width !== false
31545
31585
  ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeFromString */ .G)(width)
31546
31586
  : image.offsetWidth || image.naturalWidth;
31547
- values.imageHeight =
31548
- height !== false
31549
- ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeFromString */ .G)(height)
31550
- : image.offsetHeight || image.naturalHeight;
31587
+ if ((0,jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_4__/* .isNumeric */ .k)(values.imageWidth)) {
31588
+ values.imageHeight =
31589
+ height !== false
31590
+ ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeFromString */ .G)(height)
31591
+ : image.offsetHeight || image.naturalHeight;
31592
+ }
31593
+ else {
31594
+ values.imageHeight = height || '';
31595
+ }
31551
31596
  const { imageWidth, imageHeight } = values;
31552
31597
  const w = parseFloat(imageWidth.toString());
31553
31598
  if (!(0,jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_4__/* .isNumeric */ .k)(imageWidth) || !(0,jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_4__/* .isNumeric */ .k)(imageHeight)) {
@@ -32523,6 +32568,7 @@ function applyMargin(j, marginTop, marginRight, marginBottom, marginLeft, image,
32523
32568
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32524
32569
  /* harmony export */ q: function() { return /* binding */ applySize; }
32525
32570
  /* harmony export */ });
32571
+ /* harmony import */ var jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(12461);
32526
32572
  /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26150);
32527
32573
  /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(38322);
32528
32574
  /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9645);
@@ -32534,6 +32580,7 @@ function applyMargin(j, marginTop, marginRight, marginBottom, marginLeft, image,
32534
32580
 
32535
32581
 
32536
32582
 
32583
+
32537
32584
  /** @private */
32538
32585
  function applySize(image, imageWidth, imageHeight, sizeIsLocked) {
32539
32586
  // Size
@@ -32547,7 +32594,9 @@ function applySize(image, imageWidth, imageHeight, sizeIsLocked) {
32547
32594
  width: updatedWidth,
32548
32595
  height: updatedWidth && sizeIsLocked ? null : updatedHeight
32549
32596
  });
32550
- (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'width', (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'width') ? updatedWidth : null);
32597
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'width', updatedWidth && (0,jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_3__/* .isNumeric */ .k)(imageWidth) && (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'width')
32598
+ ? updatedWidth
32599
+ : null);
32551
32600
  if (!(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'width') || sizeIsLocked) {
32552
32601
  updatedHeight = null;
32553
32602
  }
@@ -33059,8 +33108,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_5__/* .Config */ .T.prototype.popup = {
33059
33108
 
33060
33109
  "use strict";
33061
33110
  /* harmony import */ var jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9823);
33062
- /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(38322);
33063
- /* harmony import */ var jodit_modules_widget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16116);
33111
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(38322);
33064
33112
  /*!
33065
33113
  * Jodit Editor (https://xdsoft.net/jodit/)
33066
33114
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -33068,41 +33116,11 @@ jodit_config__WEBPACK_IMPORTED_MODULE_5__/* .Config */ .T.prototype.popup = {
33068
33116
  */
33069
33117
 
33070
33118
 
33071
-
33072
33119
  const cmd = (control) => control.args && (0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_0__/* .isString */ .Kg)(control.args[0])
33073
33120
  ? control.args[0].toLowerCase()
33074
33121
  : '';
33075
33122
  /* harmony default export */ __webpack_exports__.A = ([
33076
- {
33077
- name: 'brush',
33078
- popup: (editor, _, close) => {
33079
- if (!(0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_0__/* .isJoditObject */ .y0)(editor)) {
33080
- return;
33081
- }
33082
- const tableModule = editor.getInstance('Table', editor.o), selected = tableModule.getAllSelectedCells();
33083
- if (!selected.length) {
33084
- return false;
33085
- }
33086
- const makeColorPicker = (key) => (0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_1__/* .ColorPickerWidget */ .Kn)(editor, (value) => {
33087
- selected.forEach(cell => {
33088
- (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__/* .css */ .A)(cell, key, value);
33089
- });
33090
- editor.lock();
33091
- editor.synchronizeValues();
33092
- close();
33093
- editor.unlock();
33094
- }, (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__/* .css */ .A)(selected[0], key));
33095
- return (0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_1__/* .TabsWidget */ .Zg)(editor, [
33096
- {
33097
- name: 'Background',
33098
- content: makeColorPicker('background-color')
33099
- },
33100
- { name: 'Text', content: makeColorPicker('color') },
33101
- { name: 'Border', content: makeColorPicker('border-color') }
33102
- ]);
33103
- },
33104
- tooltip: 'Background'
33105
- },
33123
+ 'brushCell',
33106
33124
  {
33107
33125
  name: 'valign',
33108
33126
  list: ['Top', 'Middle', 'Bottom', 'Normal'],
@@ -33113,7 +33131,7 @@ const cmd = (control) => control.args && (0,jodit_core_helpers_checker__WEBPACK_
33113
33131
  .getInstance('Table', editor.o)
33114
33132
  .getAllSelectedCells()
33115
33133
  .forEach((cell) => {
33116
- (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__/* .css */ .A)(cell, 'vertical-align', command === 'normal' ? '' : command);
33134
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_1__/* .css */ .A)(cell, 'vertical-align', command === 'normal' ? '' : command);
33117
33135
  });
33118
33136
  },
33119
33137
  tooltip: 'Vertical align'