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/es5/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
  */
@@ -3127,7 +3127,7 @@ __webpack_require__.r(__webpack_exports__);
3127
3127
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
3128
3128
  */
3129
3129
 
3130
- var APP_VERSION = "4.2.7";
3130
+ var APP_VERSION = "4.2.10";
3131
3131
  // prettier-ignore
3132
3132
  var ES = "es5";
3133
3133
  var IS_ES_MODERN = false;
@@ -16771,7 +16771,9 @@ var UIList = /** @class */ (function (_super) {
16771
16771
  }
16772
16772
  };
16773
16773
  var isNotRemoved = function (b) {
16774
- return !_this.removeButtons.includes(b.name);
16774
+ var _a;
16775
+ return !_this.removeButtons.includes(b.name) &&
16776
+ (!b.isVisible || ((_a = b.isVisible) === null || _a === void 0 ? void 0 : _a.call(b, _this.j, b)));
16775
16777
  };
16776
16778
  items.forEach(function (item) {
16777
16779
  if ((0,jodit_core_ui_helpers_buttons__WEBPACK_IMPORTED_MODULE_10__/* .isButtonGroup */ .i)(item)) {
@@ -30294,7 +30296,45 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_0__/* .pluginSystem */ .fg.add('color
30294
30296
 
30295
30297
 
30296
30298
  jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_2__/* .Icon */ .I.set('brush', (_brush_svg__WEBPACK_IMPORTED_MODULE_4___default()));
30299
+ jodit_config__WEBPACK_IMPORTED_MODULE_5__/* .Config */ .T.prototype.controls.brushCell = {
30300
+ isVisible: function (editor) {
30301
+ return !editor.o.disablePlugins.includes('color');
30302
+ },
30303
+ icon: 'brush',
30304
+ popup: function (editor, _, close) {
30305
+ if (!(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_1__.isJoditObject)(editor)) {
30306
+ return;
30307
+ }
30308
+ var tableModule = editor.getInstance('Table', editor.o), selected = tableModule.getAllSelectedCells();
30309
+ if (!selected.length) {
30310
+ return false;
30311
+ }
30312
+ var makeColorPicker = function (key) {
30313
+ return (0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_3__/* .ColorPickerWidget */ .Kn)(editor, function (value) {
30314
+ selected.forEach(function (cell) {
30315
+ (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_1__.css)(cell, key, value);
30316
+ });
30317
+ editor.lock();
30318
+ editor.synchronizeValues();
30319
+ close();
30320
+ editor.unlock();
30321
+ }, (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_1__.css)(selected[0], key));
30322
+ };
30323
+ return (0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_3__/* .TabsWidget */ .Zg)(editor, [
30324
+ {
30325
+ name: 'Background',
30326
+ content: makeColorPicker('background-color')
30327
+ },
30328
+ { name: 'Text', content: makeColorPicker('color') },
30329
+ { name: 'Border', content: makeColorPicker('border-color') }
30330
+ ]);
30331
+ },
30332
+ tooltip: 'Background'
30333
+ };
30297
30334
  jodit_config__WEBPACK_IMPORTED_MODULE_5__/* .Config */ .T.prototype.controls.brush = {
30335
+ isVisible: function (editor) {
30336
+ return !editor.o.disablePlugins.includes('color');
30337
+ },
30298
30338
  update: function (editor, button) {
30299
30339
  var color = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_1__.dataBind)(button, 'color');
30300
30340
  var update = function (key, value) {
@@ -34224,16 +34264,21 @@ function readSizes(image, values, state) {
34224
34264
  case 0: return [4 /*yield*/, image.decode()];
34225
34265
  case 1:
34226
34266
  _a.sent();
34227
- 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;
34228
- 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;
34267
+ 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;
34268
+ 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;
34229
34269
  values.imageWidth =
34230
34270
  width !== false
34231
34271
  ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeFromString */ .G)(width)
34232
34272
  : image.offsetWidth || image.naturalWidth;
34233
- values.imageHeight =
34234
- height !== false
34235
- ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeFromString */ .G)(height)
34236
- : image.offsetHeight || image.naturalHeight;
34273
+ if ((0,jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_4__/* .isNumeric */ .k)(values.imageWidth)) {
34274
+ values.imageHeight =
34275
+ height !== false
34276
+ ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeFromString */ .G)(height)
34277
+ : image.offsetHeight || image.naturalHeight;
34278
+ }
34279
+ else {
34280
+ values.imageHeight = height || '';
34281
+ }
34237
34282
  imageWidth = values.imageWidth, imageHeight = values.imageHeight;
34238
34283
  w = parseFloat(imageWidth.toString());
34239
34284
  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)) {
@@ -35169,6 +35214,7 @@ function applyMargin(j, marginTop, marginRight, marginBottom, marginLeft, image,
35169
35214
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
35170
35215
  /* harmony export */ q: function() { return /* binding */ applySize; }
35171
35216
  /* harmony export */ });
35217
+ /* harmony import */ var jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(12461);
35172
35218
  /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26150);
35173
35219
  /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(38322);
35174
35220
  /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9645);
@@ -35180,6 +35226,7 @@ function applyMargin(j, marginTop, marginRight, marginBottom, marginLeft, image,
35180
35226
 
35181
35227
 
35182
35228
 
35229
+
35183
35230
  /** @private */
35184
35231
  function applySize(image, imageWidth, imageHeight, sizeIsLocked) {
35185
35232
  // Size
@@ -35193,7 +35240,9 @@ function applySize(image, imageWidth, imageHeight, sizeIsLocked) {
35193
35240
  width: updatedWidth,
35194
35241
  height: updatedWidth && sizeIsLocked ? null : updatedHeight
35195
35242
  });
35196
- (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);
35243
+ (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')
35244
+ ? updatedWidth
35245
+ : null);
35197
35246
  if (!(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'width') || sizeIsLocked) {
35198
35247
  updatedHeight = null;
35199
35248
  }
@@ -35719,8 +35768,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_5__/* .Config */ .T.prototype.popup = {
35719
35768
 
35720
35769
  "use strict";
35721
35770
  /* harmony import */ var jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9823);
35722
- /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(38322);
35723
- /* harmony import */ var jodit_modules_widget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16116);
35771
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(38322);
35724
35772
  /*!
35725
35773
  * Jodit Editor (https://xdsoft.net/jodit/)
35726
35774
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -35728,45 +35776,13 @@ jodit_config__WEBPACK_IMPORTED_MODULE_5__/* .Config */ .T.prototype.popup = {
35728
35776
  */
35729
35777
 
35730
35778
 
35731
-
35732
35779
  var cmd = function (control) {
35733
35780
  return control.args && (0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_0__/* .isString */ .Kg)(control.args[0])
35734
35781
  ? control.args[0].toLowerCase()
35735
35782
  : '';
35736
35783
  };
35737
35784
  /* harmony default export */ __webpack_exports__.A = ([
35738
- {
35739
- name: 'brush',
35740
- popup: function (editor, _, close) {
35741
- if (!(0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_0__/* .isJoditObject */ .y0)(editor)) {
35742
- return;
35743
- }
35744
- var tableModule = editor.getInstance('Table', editor.o), selected = tableModule.getAllSelectedCells();
35745
- if (!selected.length) {
35746
- return false;
35747
- }
35748
- var makeColorPicker = function (key) {
35749
- return (0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_1__/* .ColorPickerWidget */ .Kn)(editor, function (value) {
35750
- selected.forEach(function (cell) {
35751
- (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__/* .css */ .A)(cell, key, value);
35752
- });
35753
- editor.lock();
35754
- editor.synchronizeValues();
35755
- close();
35756
- editor.unlock();
35757
- }, (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__/* .css */ .A)(selected[0], key));
35758
- };
35759
- return (0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_1__/* .TabsWidget */ .Zg)(editor, [
35760
- {
35761
- name: 'Background',
35762
- content: makeColorPicker('background-color')
35763
- },
35764
- { name: 'Text', content: makeColorPicker('color') },
35765
- { name: 'Border', content: makeColorPicker('border-color') }
35766
- ]);
35767
- },
35768
- tooltip: 'Background'
35769
- },
35785
+ 'brushCell',
35770
35786
  {
35771
35787
  name: 'valign',
35772
35788
  list: ['Top', 'Middle', 'Bottom', 'Normal'],
@@ -35778,7 +35794,7 @@ var cmd = function (control) {
35778
35794
  .getInstance('Table', editor.o)
35779
35795
  .getAllSelectedCells()
35780
35796
  .forEach(function (cell) {
35781
- (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__/* .css */ .A)(cell, 'vertical-align', command === 'normal' ? '' : command);
35797
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_1__/* .css */ .A)(cell, 'vertical-align', command === 'normal' ? '' : command);
35782
35798
  });
35783
35799
  },
35784
35800
  tooltip: 'Vertical align'
package/es5/jodit.min.css CHANGED
@@ -1,14 +1,14 @@
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
  */
8
8
  /*!
9
9
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
10
10
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
11
- * Version: v4.2.7
11
+ * Version: v4.2.10
12
12
  * Url: https://xdsoft.net/jodit/
13
13
  * License(s): MIT
14
14
  */