jodit 4.1.14 → 4.2.5

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 (141) hide show
  1. package/CHANGELOG.md +22 -5
  2. package/es2015/jodit.css +82 -31
  3. package/es2015/jodit.fat.min.css +1 -1
  4. package/es2015/jodit.fat.min.js +2 -2
  5. package/es2015/jodit.js +1364 -560
  6. package/es2015/jodit.min.css +1 -1
  7. package/es2015/jodit.min.js +2 -2
  8. package/es2015/plugins/debug/debug.js +1 -1
  9. package/es2015/plugins/debug/debug.min.js +1 -1
  10. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  11. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
  12. package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
  13. package/es2018/jodit.css +82 -31
  14. package/es2018/jodit.fat.min.css +1 -1
  15. package/es2018/jodit.fat.min.js +2 -2
  16. package/es2018/jodit.js +1350 -560
  17. package/es2018/jodit.min.css +1 -1
  18. package/es2018/jodit.min.js +2 -2
  19. package/es2018/plugins/debug/debug.js +1 -1
  20. package/es2018/plugins/debug/debug.min.js +1 -1
  21. package/es2018/plugins/speech-recognize/speech-recognize.css +1 -1
  22. package/es2018/plugins/speech-recognize/speech-recognize.js +1 -1
  23. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  24. package/es2021/jodit.css +82 -31
  25. package/es2021/jodit.fat.min.css +1 -1
  26. package/es2021/jodit.fat.min.js +2 -2
  27. package/es2021/jodit.js +1346 -560
  28. package/es2021/jodit.min.css +1 -1
  29. package/es2021/jodit.min.js +2 -2
  30. package/es2021/plugins/debug/debug.js +1 -1
  31. package/es2021/plugins/debug/debug.min.js +1 -1
  32. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  33. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  34. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  35. package/es2021.en/jodit.css +82 -31
  36. package/es2021.en/jodit.fat.min.css +1 -1
  37. package/es2021.en/jodit.fat.min.js +2 -2
  38. package/es2021.en/jodit.js +1346 -560
  39. package/es2021.en/jodit.min.css +1 -1
  40. package/es2021.en/jodit.min.js +2 -2
  41. package/es2021.en/plugins/debug/debug.js +1 -1
  42. package/es2021.en/plugins/debug/debug.min.js +1 -1
  43. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  44. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  45. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  46. package/es5/jodit.css +131 -35
  47. package/es5/jodit.fat.min.css +1 -1
  48. package/es5/jodit.fat.min.js +2 -2
  49. package/es5/jodit.js +1388 -496
  50. package/es5/jodit.min.css +3 -3
  51. package/es5/jodit.min.js +2 -2
  52. package/es5/plugins/debug/debug.js +1 -1
  53. package/es5/plugins/debug/debug.min.js +1 -1
  54. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  55. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  56. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  57. package/esm/core/constants.js +1 -1
  58. package/esm/core/decorators/cache/cache.d.ts +2 -1
  59. package/esm/core/decorators/cache/cache.js +7 -0
  60. package/esm/core/helpers/size/position.js +2 -2
  61. package/esm/core/helpers/utils/selector.d.ts +3 -1
  62. package/esm/core/helpers/utils/selector.js +3 -3
  63. package/esm/core/ui/button/tooltip/tooltip.js +3 -4
  64. package/esm/core/ui/popup/popup.js +1 -1
  65. package/esm/modules/dialog/dialog.js +1 -0
  66. package/esm/modules/file-browser/file-browser.js +8 -1
  67. package/esm/modules/image-editor/templates/form.js +6 -5
  68. package/esm/modules/toolbar/button/button.d.ts +1 -1
  69. package/esm/modules/widget/tabs/tabs.d.ts +4 -4
  70. package/esm/modules/widget/tabs/tabs.js +9 -7
  71. package/esm/plugins/ai-assistant/ai-assistant.d.ts +1 -1
  72. package/esm/plugins/ai-assistant/ai-assistant.js +6 -6
  73. package/esm/plugins/image-properties/config.d.ts +5 -83
  74. package/esm/plugins/image-properties/config.js +0 -3
  75. package/esm/plugins/image-properties/image-properties.d.ts +22 -32
  76. package/esm/plugins/image-properties/image-properties.js +129 -402
  77. package/{types/plugins/image-properties/templates/form.d.ts → esm/plugins/image-properties/readers/align.d.ts} +3 -5
  78. package/esm/plugins/image-properties/readers/align.js +24 -0
  79. package/esm/plugins/image-properties/readers/index.d.ts +12 -0
  80. package/esm/plugins/image-properties/readers/index.js +38 -0
  81. package/esm/plugins/image-properties/readers/link.d.ts +9 -0
  82. package/esm/plugins/image-properties/readers/link.js +19 -0
  83. package/esm/plugins/image-properties/readers/margin.d.ts +8 -0
  84. package/esm/plugins/image-properties/readers/margin.js +28 -0
  85. package/esm/plugins/image-properties/readers/size.d.ts +8 -0
  86. package/esm/plugins/image-properties/readers/size.js +36 -0
  87. package/esm/plugins/image-properties/ui/ui-image-form.d.ts +29 -0
  88. package/esm/plugins/image-properties/ui/ui-image-form.js +171 -0
  89. package/esm/plugins/image-properties/ui/ui-image-main-tab.d.ts +36 -0
  90. package/esm/plugins/image-properties/ui/ui-image-main-tab.js +179 -0
  91. package/esm/plugins/image-properties/ui/ui-image-position-tab.d.ts +36 -0
  92. package/esm/plugins/image-properties/ui/ui-image-position-tab.js +261 -0
  93. package/esm/plugins/image-properties/{templates/main-tab.d.ts → utils/open-image-editor.d.ts} +5 -3
  94. package/esm/plugins/image-properties/utils/open-image-editor.js +52 -0
  95. package/esm/plugins/image-properties/utils/open-image-popup.d.ts +9 -0
  96. package/esm/plugins/image-properties/utils/open-image-popup.js +34 -0
  97. package/esm/plugins/image-properties/utils/utils.d.ts +9 -0
  98. package/esm/plugins/image-properties/utils/utils.js +21 -0
  99. package/esm/plugins/image-properties/writers/index.d.ts +12 -0
  100. package/esm/plugins/image-properties/writers/index.js +53 -0
  101. package/esm/plugins/image-properties/{templates/form.d.ts → writers/link.d.ts} +2 -4
  102. package/esm/plugins/image-properties/writers/link.js +24 -0
  103. package/esm/plugins/image-properties/writers/margin.d.ts +8 -0
  104. package/esm/plugins/image-properties/writers/margin.js +33 -0
  105. package/esm/plugins/image-properties/writers/size.d.ts +7 -0
  106. package/esm/plugins/image-properties/writers/size.js +28 -0
  107. package/esm/plugins/select/config.d.ts +7 -0
  108. package/esm/plugins/select/config.js +2 -1
  109. package/esm/plugins/select/select.d.ts +7 -3
  110. package/esm/plugins/select/select.js +21 -4
  111. package/esm/types/ui.d.ts +1 -1
  112. package/package.json +1 -1
  113. package/types/core/decorators/cache/cache.d.ts +2 -1
  114. package/types/core/helpers/utils/selector.d.ts +3 -1
  115. package/types/modules/toolbar/button/button.d.ts +1 -1
  116. package/types/modules/widget/tabs/tabs.d.ts +4 -4
  117. package/types/plugins/ai-assistant/ai-assistant.d.ts +1 -1
  118. package/types/plugins/image-properties/config.d.ts +5 -83
  119. package/types/plugins/image-properties/image-properties.d.ts +22 -32
  120. package/types/plugins/image-properties/{templates/main-tab.d.ts → readers/align.d.ts} +3 -5
  121. package/types/plugins/image-properties/readers/index.d.ts +12 -0
  122. package/types/plugins/image-properties/readers/link.d.ts +9 -0
  123. package/types/plugins/image-properties/readers/margin.d.ts +8 -0
  124. package/types/plugins/image-properties/readers/size.d.ts +8 -0
  125. package/types/plugins/image-properties/ui/ui-image-form.d.ts +29 -0
  126. package/types/plugins/image-properties/ui/ui-image-main-tab.d.ts +36 -0
  127. package/types/plugins/image-properties/ui/ui-image-position-tab.d.ts +36 -0
  128. package/types/plugins/image-properties/utils/open-image-editor.d.ts +12 -0
  129. package/types/plugins/image-properties/utils/open-image-popup.d.ts +9 -0
  130. package/types/plugins/image-properties/utils/utils.d.ts +9 -0
  131. package/types/plugins/image-properties/writers/index.d.ts +12 -0
  132. package/{esm/plugins/image-properties/templates/position-tab.d.ts → types/plugins/image-properties/writers/link.d.ts} +2 -4
  133. package/types/plugins/image-properties/writers/margin.d.ts +8 -0
  134. package/types/plugins/image-properties/writers/size.d.ts +7 -0
  135. package/types/plugins/select/config.d.ts +7 -0
  136. package/types/plugins/select/select.d.ts +7 -3
  137. package/types/types/ui.d.ts +1 -1
  138. package/esm/plugins/image-properties/templates/form.js +0 -26
  139. package/esm/plugins/image-properties/templates/main-tab.js +0 -47
  140. package/esm/plugins/image-properties/templates/position-tab.js +0 -66
  141. package/types/plugins/image-properties/templates/position-tab.d.ts +0 -10
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.1.14
4
+ * Version: v4.2.5
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -3098,7 +3098,7 @@ __webpack_require__.r(__webpack_exports__);
3098
3098
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
3099
3099
  */
3100
3100
 
3101
- var APP_VERSION = "4.1.14";
3101
+ var APP_VERSION = "4.2.5";
3102
3102
  // prettier-ignore
3103
3103
  var ES = "es5";
3104
3104
  var IS_ES_MODERN = false;
@@ -3509,8 +3509,9 @@ var Create = /** @class */ (function () {
3509
3509
 
3510
3510
  "use strict";
3511
3511
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3512
- /* harmony export */ O: function() { return /* binding */ cacheHTML; },
3513
- /* harmony export */ P: function() { return /* binding */ cache; }
3512
+ /* harmony export */ OK: function() { return /* binding */ cacheHTML; },
3513
+ /* harmony export */ PO: function() { return /* binding */ cached; },
3514
+ /* harmony export */ PP: function() { return /* binding */ cache; }
3514
3515
  /* harmony export */ });
3515
3516
  /* harmony import */ var jodit_core_component_statuses__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(64567);
3516
3517
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(55186);
@@ -3525,6 +3526,13 @@ var Create = /** @class */ (function () {
3525
3526
 
3526
3527
 
3527
3528
 
3529
+ function cached(object, property) {
3530
+ var descriptor = Object.getOwnPropertyDescriptor(object, property);
3531
+ if (!descriptor || (0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_2__/* .isFunction */ .Tn)(descriptor.get)) {
3532
+ return null;
3533
+ }
3534
+ return descriptor.value;
3535
+ }
3528
3536
  function cache(_, name, descriptor) {
3529
3537
  var getter = descriptor.get;
3530
3538
  if (!getter) {
@@ -3831,8 +3839,9 @@ function idle() {
3831
3839
  __webpack_require__.r(__webpack_exports__);
3832
3840
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3833
3841
  /* harmony export */ autobind: function() { return /* reexport safe */ _autobind_autobind__WEBPACK_IMPORTED_MODULE_0__.d; },
3834
- /* harmony export */ cache: function() { return /* reexport safe */ _cache_cache__WEBPACK_IMPORTED_MODULE_1__.P; },
3835
- /* harmony export */ cacheHTML: function() { return /* reexport safe */ _cache_cache__WEBPACK_IMPORTED_MODULE_1__.O; },
3842
+ /* harmony export */ cache: function() { return /* reexport safe */ _cache_cache__WEBPACK_IMPORTED_MODULE_1__.PP; },
3843
+ /* harmony export */ cacheHTML: function() { return /* reexport safe */ _cache_cache__WEBPACK_IMPORTED_MODULE_1__.OK; },
3844
+ /* harmony export */ cached: function() { return /* reexport safe */ _cache_cache__WEBPACK_IMPORTED_MODULE_1__.PO; },
3836
3845
  /* harmony export */ component: function() { return /* reexport safe */ _component_component__WEBPACK_IMPORTED_MODULE_2__.s; },
3837
3846
  /* harmony export */ debounce: function() { return /* reexport safe */ _debounce_debounce__WEBPACK_IMPORTED_MODULE_3__.s; },
3838
3847
  /* harmony export */ derive: function() { return /* reexport safe */ _derive_derive__WEBPACK_IMPORTED_MODULE_4__.C; },
@@ -8318,6 +8327,7 @@ var offset = function (elm, jodit, doc, recurse) {
8318
8327
  * Calculate screen element position
8319
8328
  */
8320
8329
  function position(elm, jodit, recurse) {
8330
+ var _a, _b;
8321
8331
  if (recurse === void 0) { recurse = false; }
8322
8332
  var rect = elm.getBoundingClientRect();
8323
8333
  var xPos = rect.left, yPos = rect.top;
@@ -8325,15 +8335,15 @@ function position(elm, jodit, recurse) {
8325
8335
  jodit.iframe &&
8326
8336
  jodit.ed.body.contains(elm) &&
8327
8337
  !recurse) {
8328
- var _a = position(jodit.iframe, jodit, true), left = _a.left, top = _a.top;
8338
+ var _c = position(jodit.iframe, jodit, true), left = _c.left, top = _c.top;
8329
8339
  xPos += left;
8330
8340
  yPos += top;
8331
8341
  }
8332
8342
  return {
8333
8343
  left: Math.round(xPos),
8334
8344
  top: Math.round(yPos),
8335
- width: Math.round(elm.offsetWidth),
8336
- height: Math.round(elm.offsetHeight)
8345
+ width: Math.round((_a = elm.offsetWidth) !== null && _a !== void 0 ? _a : rect.width),
8346
+ height: Math.round((_b = elm.offsetHeight) !== null && _b !== void 0 ? _b : rect.height)
8337
8347
  };
8338
8348
  }
8339
8349
 
@@ -10428,9 +10438,9 @@ var getXPathByElement = function (element, root) {
10428
10438
  * Find all `ref` or `data-ref` elements inside HTMLElement
10429
10439
  */
10430
10440
  var refs = function (root) {
10431
- // if (Component.isInstanceOf<UIElement>(root, UIElement)) {
10432
- // root = root.container;
10433
- // }
10441
+ if ('container' in root) {
10442
+ root = root.container;
10443
+ }
10434
10444
  return $$('[ref],[data-ref]', root).reduce(function (def, child) {
10435
10445
  var key = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(child, '-ref');
10436
10446
  if (key && (0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_4__/* .isString */ .K)(key)) {
@@ -15194,7 +15204,8 @@ var UITooltip = /** @class */ (function (_super) {
15194
15204
  view.o.showTooltip &&
15195
15205
  !view.o.useNativeTooltip) {
15196
15206
  view.hookStatus(jodit_core_component__WEBPACK_IMPORTED_MODULE_0__/* .STATUSES */ .f.ready, function () {
15197
- (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_3__/* .getContainer */ .My)(view, UITooltip_1).appendChild(_this.container);
15207
+ // TODO Move it inside __open method. Now it is here because testcase failed with capturing
15208
+ (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_3__/* .getContainer */ .My)(_this.j, UITooltip_1).appendChild(_this.container);
15198
15209
  view.e.on(view.container, 'mouseenter.tooltip', _this.__onMouseEnter, {
15199
15210
  capture: true
15200
15211
  });
@@ -15217,6 +15228,7 @@ var UITooltip = /** @class */ (function (_super) {
15217
15228
  var view = this.j;
15218
15229
  view.e
15219
15230
  .on(view.ow, 'scroll.tooltip', this.__hide)
15231
+ .on(view.ow, 'joditCloseDialog', this.__hide)
15220
15232
  .on(view.container, 'mouseleave.tooltip', this.__hide)
15221
15233
  .on([
15222
15234
  'escape.tooltip',
@@ -15332,9 +15344,6 @@ var UITooltip = /** @class */ (function (_super) {
15332
15344
  (0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__decorate */ .Cg)([
15333
15345
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.autobind
15334
15346
  ], UITooltip.prototype, "__onMouseEnter", null);
15335
- (0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__decorate */ .Cg)([
15336
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.autobind
15337
- ], UITooltip.prototype, "__delayOpen", null);
15338
15347
  (0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__decorate */ .Cg)([
15339
15348
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.autobind
15340
15349
  ], UITooltip.prototype, "__hide", null);
@@ -17346,7 +17355,7 @@ var Popup = /** @class */ (function (_super) {
17346
17355
  }
17347
17356
  var pe = this.parentElement;
17348
17357
  while (pe) {
17349
- if (checkView(j)) {
17358
+ if (checkView(pe.j)) {
17350
17359
  return;
17351
17360
  }
17352
17361
  if (pe.container.style.zIndex) {
@@ -18143,22 +18152,22 @@ var View = /** @class */ (function (_super) {
18143
18152
  View.esNext = jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.IS_ES_NEXT; // from webpack.config.js
18144
18153
  View.esModern = jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.IS_ES_MODERN; // from webpack.config.js
18145
18154
  (0,tslib__WEBPACK_IMPORTED_MODULE_16__/* .__decorate */ .Cg)([
18146
- jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .P
18155
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .PP
18147
18156
  ], View.prototype, "buffer", null);
18148
18157
  (0,tslib__WEBPACK_IMPORTED_MODULE_16__/* .__decorate */ .Cg)([
18149
- jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .P
18158
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .PP
18150
18159
  ], View.prototype, "message", null);
18151
18160
  (0,tslib__WEBPACK_IMPORTED_MODULE_16__/* .__decorate */ .Cg)([
18152
- jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .P
18161
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .PP
18153
18162
  ], View.prototype, "storage", null);
18154
18163
  (0,tslib__WEBPACK_IMPORTED_MODULE_16__/* .__decorate */ .Cg)([
18155
- jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .P
18164
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .PP
18156
18165
  ], View.prototype, "c", null);
18157
18166
  (0,tslib__WEBPACK_IMPORTED_MODULE_16__/* .__decorate */ .Cg)([
18158
- jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .P
18167
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .PP
18159
18168
  ], View.prototype, "e", null);
18160
18169
  (0,tslib__WEBPACK_IMPORTED_MODULE_16__/* .__decorate */ .Cg)([
18161
- jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .P
18170
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .PP
18162
18171
  ], View.prototype, "progressbar", null);
18163
18172
  (0,tslib__WEBPACK_IMPORTED_MODULE_16__/* .__decorate */ .Cg)([
18164
18173
  (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_6__/* .hook */ .A)(jodit_core_component_statuses__WEBPACK_IMPORTED_MODULE_2__/* .STATUSES */ .f.beforeDestruct)
@@ -20138,6 +20147,7 @@ var Dialog = /** @class */ (function (_super) {
20138
20147
  * Fired when dialog box is started moving
20139
20148
  */
20140
20149
  this.e.fire(this, 'startMove');
20150
+ this.e.fire('closeAllPopups');
20141
20151
  }
20142
20152
  };
20143
20153
  Dialog.prototype.onMouseMove = function (e) {
@@ -22177,7 +22187,15 @@ var FileBrowser = /** @class */ (function (_super) {
22177
22187
  _this.__updateToolbarButtons();
22178
22188
  _this._dialog.open(_this.browser, header);
22179
22189
  _this.e.fire('sort.filebrowser', _this.state.sortBy);
22180
- (0,_fetch_load_tree__WEBPACK_IMPORTED_MODULE_10__/* .loadTree */ .r)(_this).then(resolve, reject);
22190
+ (0,_fetch_load_tree__WEBPACK_IMPORTED_MODULE_10__/* .loadTree */ .r)(_this)
22191
+ .then(resolve, reject)
22192
+ .finally(function () {
22193
+ var _a;
22194
+ if (_this.isInDestruct) {
22195
+ return;
22196
+ }
22197
+ (_a = _this === null || _this === void 0 ? void 0 : _this.e) === null || _a === void 0 ? void 0 : _a.fire('fileBrowserReady.filebrowser');
22198
+ });
22181
22199
  })
22182
22200
  .catch(function (e) {
22183
22201
  if (!jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.IS_PROD) {
@@ -24029,7 +24047,7 @@ var form = function (editor, o) {
24029
24047
  var i = editor.i18n.bind(editor);
24030
24048
  var switcher = function (label, ref, active) {
24031
24049
  if (active === void 0) { active = true; }
24032
- return "<div class=\"jodit-form__group\">\n\t\t\t<label>".concat(i(label), "</label>\n\n\t\t\t<label class='jodit-switcher'>\n\t\t\t\t<input ").concat(act(active, 'checked'), " data-ref=\"").concat(ref, "\" type=\"checkbox\"/>\n\t\t\t\t<span class=\"jodit-switcher__slider\"></span>\n\t\t\t</label>\n\t</div>");
24050
+ return "<div class=\"jodit-form__group\">\n\t\t\t<label class=\"jodit-switcher-wrapper\">\n\t\t\t\t<span class='jodit-switcher'>\n\t\t\t\t\t<input ".concat(act(active, 'checked'), " data-ref=\"").concat(ref, "\" type=\"checkbox\"/>\n\t\t\t\t\t<span class=\"jodit-switcher__slider\"></span>\n\t\t\t\t</span>\n\t\t\t\t<span>").concat(i(label), "</span>\n\t\t\t</label>\n\t</div>");
24033
24051
  };
24034
24052
  return editor.create.fromHTML("<form class=\"".concat(jie, " jodit-properties\">\n\t\t<div class=\"jodit-grid jodit-grid_xs-column\">\n\t\t\t<div class=\"jodit_col-lg-3-4 jodit_col-sm-5-5\">\n\t\t\t").concat(o.resize
24035
24053
  ? "<div class=\"".concat(jie, "__area ").concat(jie, "__area_resize ").concat(jie, "_active\">\n\t\t\t\t\t\t\t<div data-ref=\"resizeBox\" class=\"").concat(jie, "__box\"></div>\n\t\t\t\t\t\t\t<div class=\"").concat(jie, "__resizer\">\n\t\t\t\t\t\t\t\t<i class=\"jodit_bottomright\"></i>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>")
@@ -27134,11 +27152,13 @@ var TabsWidget = function (jodit, tabs, state) {
27134
27152
  return;
27135
27153
  }
27136
27154
  buttonList.forEach(function (b) {
27155
+ b.state.variant = 'initial';
27137
27156
  b.state.activated = false;
27138
27157
  });
27139
27158
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.$$)('.jodit-tab', tabBox).forEach(function (a) {
27140
27159
  a.classList.remove('jodit-tab_active');
27141
27160
  });
27161
+ nameToTab[tab].button.state.variant = 'outline';
27142
27162
  nameToTab[tab].button.state.activated = true;
27143
27163
  nameToTab[tab].tab.classList.add('jodit-tab_active');
27144
27164
  };
@@ -27170,7 +27190,7 @@ var TabsWidget = function (jodit, tabs, state) {
27170
27190
  content.call(jodit);
27171
27191
  }
27172
27192
  if (state) {
27173
- state.__activeTab = name;
27193
+ state.activeTab = name;
27174
27194
  }
27175
27195
  return false;
27176
27196
  });
@@ -27186,20 +27206,20 @@ var TabsWidget = function (jodit, tabs, state) {
27186
27206
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.$$)('a', buttons).forEach(function (a) {
27187
27207
  a.style.width = (100 / tabCount).toFixed(10) + '%';
27188
27208
  });
27189
- var tab = !state || !state.__activeTab || !nameToTab[state.__activeTab]
27209
+ var tab = !state || !state.activeTab || !nameToTab[state.activeTab]
27190
27210
  ? firstTab
27191
- : state.__activeTab;
27211
+ : state.activeTab;
27192
27212
  setActive(tab);
27193
27213
  if (state) {
27194
- var __activeTab_1 = state.__activeTab;
27195
- Object.defineProperty(state, '__activeTab', {
27214
+ var activeTab_1 = state.activeTab;
27215
+ Object.defineProperty(state, 'activeTab', {
27196
27216
  configurable: true,
27197
27217
  enumerable: false,
27198
27218
  get: function () {
27199
- return __activeTab_1;
27219
+ return activeTab_1;
27200
27220
  },
27201
27221
  set: function (value) {
27202
- __activeTab_1 = value;
27222
+ activeTab_1 = value;
27203
27223
  setActive(value);
27204
27224
  }
27205
27225
  });
@@ -27620,7 +27640,7 @@ var aiAssistant = /** @class */ (function (_super) {
27620
27640
  configurable: true
27621
27641
  });
27622
27642
  /** @override */
27623
- aiAssistant.prototype.afterInit = function (jodit) { };
27643
+ aiAssistant.prototype.afterInit = function () { };
27624
27644
  aiAssistant.prototype.onGenerateAiAssistantForm = function (prompt) {
27625
27645
  this.__dialog.open(this.__container, 'AI Assistant');
27626
27646
  this.__container.setPrompt(prompt);
@@ -27664,14 +27684,15 @@ var aiAssistant = /** @class */ (function (_super) {
27664
27684
  };
27665
27685
  /** @override */
27666
27686
  aiAssistant.prototype.beforeDestruct = function (_) {
27667
- this.__container.destruct();
27668
- this.__dialog.destruct();
27687
+ var _a, _b;
27688
+ (_a = (0,jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_0__/* .cached */ .PO)(this, '__container')) === null || _a === void 0 ? void 0 : _a.destruct();
27689
+ (_b = (0,jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_0__/* .cached */ .PO)(this, '__dialog')) === null || _b === void 0 ? void 0 : _b.destruct();
27669
27690
  };
27670
27691
  (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
27671
- jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_0__/* .cache */ .P
27692
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_0__/* .cache */ .PP
27672
27693
  ], aiAssistant.prototype, "__dialog", null);
27673
27694
  (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
27674
- jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_0__/* .cache */ .P
27695
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_0__/* .cache */ .PP
27675
27696
  ], aiAssistant.prototype, "__container", null);
27676
27697
  (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
27677
27698
  (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)(':generateAiAssistantForm.ai-assistant')
@@ -33648,9 +33669,6 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .pluginSystem */ .fg.add('image
33648
33669
  * Released under MIT see LICENSE.txt in the project root for license information.
33649
33670
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
33650
33671
  */
33651
- /**
33652
- * @module plugins/image-properties
33653
- */
33654
33672
 
33655
33673
  jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.image = {
33656
33674
  dialogWidth: 600,
@@ -33680,18 +33698,19 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.image = {
33680
33698
 
33681
33699
  "use strict";
33682
33700
  /* unused harmony export imageProperties */
33683
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(31635);
33701
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(31635);
33684
33702
  /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22664);
33685
- /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56298);
33686
- /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65147);
33687
- /* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(35265);
33688
- /* harmony import */ var jodit_modules__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(37435);
33689
- /* harmony import */ var jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(53804);
33690
- /* harmony import */ var jodit_modules_widget__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(16116);
33691
- /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(24654);
33692
- /* harmony import */ var _templates_form__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(22254);
33693
- /* harmony import */ var _templates_main_tab__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(75263);
33694
- /* harmony import */ var _templates_position_tab__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(57837);
33703
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(55186);
33704
+ /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(56298);
33705
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(65147);
33706
+ /* harmony import */ var jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29866);
33707
+ /* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(35265);
33708
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(24654);
33709
+ /* harmony import */ var _ui_ui_image_form__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(31970);
33710
+ /* harmony import */ var _utils_open_image_editor__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(80778);
33711
+ /* harmony import */ var _utils_open_image_popup__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(33733);
33712
+ /* harmony import */ var _readers__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(5549);
33713
+ /* harmony import */ var _writers__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(30393);
33695
33714
  /*!
33696
33715
  * Jodit Editor (https://xdsoft.net/jodit/)
33697
33716
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -33723,59 +33742,114 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.image = {
33723
33742
  * });
33724
33743
  * ```
33725
33744
  */
33726
- var normalSizeToString = function (value) {
33727
- value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.trim)(value);
33728
- return /^[0-9]+$/.test(value) ? value + 'px' : value;
33729
- };
33730
- var normalSizeFromString = function (value) {
33731
- return /^[-+]?[0-9.]+px$/.test(value.toString())
33732
- ? parseFloat(value.toString())
33733
- : value;
33734
- };
33735
33745
  /**
33736
33746
  * Show dialog with image's options
33737
33747
  */
33738
33748
  var imageProperties = /** @class */ (function (_super) {
33739
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__extends */ .C6)(imageProperties, _super);
33749
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__extends */ .C6)(imageProperties, _super);
33740
33750
  function imageProperties() {
33741
- var _this = _super.apply(this, (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__spreadArray */ .fX)([], (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__read */ .zs)(arguments), false)) || this;
33751
+ var _this = _super.apply(this, (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__spreadArray */ .fX)([], (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__read */ .zs)(arguments), false)) || this;
33742
33752
  _this.state = {
33743
33753
  image: new Image(),
33754
+ sourceImage: new Image(),
33744
33755
  get ratio() {
33745
- return this.image.naturalWidth / this.image.naturalHeight || 1;
33756
+ var _a = this.image, naturalWidth = _a.naturalWidth, naturalHeight = _a.naturalHeight;
33757
+ return naturalWidth / naturalHeight || 1;
33746
33758
  },
33747
33759
  sizeIsLocked: true,
33748
- marginIsLocked: true
33760
+ marginIsLocked: true,
33761
+ values: {
33762
+ style: '',
33763
+ imageSrc: '',
33764
+ borderRadius: 0,
33765
+ imageTitle: '',
33766
+ imageAlt: '',
33767
+ imageLink: '',
33768
+ imageLinkOpenInNewTab: false,
33769
+ imageWidth: 0,
33770
+ imageHeight: 0,
33771
+ marginTop: 0,
33772
+ marginRight: 0,
33773
+ marginBottom: 0,
33774
+ marginLeft: 0,
33775
+ classes: '',
33776
+ id: '',
33777
+ align: ''
33778
+ }
33749
33779
  };
33750
33780
  _this.activeTabState = {
33751
- __activeTab: 'Image'
33781
+ activeTab: 'Image'
33752
33782
  };
33753
33783
  return _this;
33754
33784
  }
33755
- imageProperties.prototype.onChangeMarginIsLocked = function () {
33756
- var _this = this;
33757
- if (!this.form) {
33758
- return;
33759
- }
33760
- var _a = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form), marginRight = _a.marginRight, marginBottom = _a.marginBottom, marginLeft = _a.marginLeft, lockMargin = _a.lockMargin;
33761
- [marginRight, marginBottom, marginLeft].forEach(function (elm) {
33762
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(elm, 'disabled', _this.state.marginIsLocked || null);
33763
- });
33764
- lockMargin.innerHTML = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Icon.get(this.state.marginIsLocked ? 'lock' : 'unlock');
33765
- };
33766
- imageProperties.prototype.onChangeSizeIsLocked = function () {
33767
- if (!this.form) {
33768
- return;
33769
- }
33770
- var _a = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form), lockSize = _a.lockSize, imageWidth = _a.imageWidth;
33771
- lockSize.innerHTML = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Icon.get(this.state.sizeIsLocked ? 'lock' : 'unlock');
33772
- lockSize.classList.remove('jodit-properties__lock');
33773
- lockSize.classList.remove('jodit-properties__unlock');
33774
- lockSize.classList.add(this.state.sizeIsLocked
33775
- ? 'jodit-properties__lock'
33776
- : 'jodit-properties__unlock');
33777
- this.j.e.fire(imageWidth, 'change');
33778
- };
33785
+ Object.defineProperty(imageProperties.prototype, "form", {
33786
+ get: function () {
33787
+ var _this = this;
33788
+ return new _ui_ui_image_form__WEBPACK_IMPORTED_MODULE_7__/* .UIImagePropertiesForm */ .l(this.j, this.state, this.activeTabState, {
33789
+ openImageEditor: function () {
33790
+ return (0,_utils_open_image_editor__WEBPACK_IMPORTED_MODULE_8__/* .openImageEditorDialog */ .v)(_this.j, _this.state);
33791
+ },
33792
+ openImagePopup: function (target) {
33793
+ return (0,_utils_open_image_popup__WEBPACK_IMPORTED_MODULE_9__/* .openImagePopup */ .q)(_this.j, _this.dialog, _this.state, target);
33794
+ }
33795
+ });
33796
+ },
33797
+ enumerable: false,
33798
+ configurable: true
33799
+ });
33800
+ Object.defineProperty(imageProperties.prototype, "dialog", {
33801
+ /**
33802
+ * Dialog for form
33803
+ */
33804
+ get: function () {
33805
+ var _this = this;
33806
+ var j = this.j;
33807
+ var dialog = j.dlg({
33808
+ minWidth: Math.min(400, screen.width),
33809
+ minHeight: 590,
33810
+ buttons: ['fullsize', 'dialog.close']
33811
+ });
33812
+ var buttons = this.__buttons;
33813
+ buttons.check.onAction(function () {
33814
+ (0,_writers__WEBPACK_IMPORTED_MODULE_11__/* .applyValuesToImage */ .j)(j, _this.state, _this.state.sourceImage);
33815
+ j.synchronizeValues();
33816
+ dialog.close();
33817
+ });
33818
+ buttons.remove.onAction(function () {
33819
+ j.s.removeNode(_this.state.sourceImage);
33820
+ dialog.close();
33821
+ });
33822
+ buttons.cancel.onAction(function () {
33823
+ dialog.close();
33824
+ });
33825
+ dialog.setHeader(j.i18n('Image properties'));
33826
+ dialog.setContent(this.form);
33827
+ dialog.setFooter([[buttons.cancel, buttons.remove], buttons.check]);
33828
+ j.e.on(dialog, 'afterClose', function () {
33829
+ if (_this.state.image.parentNode &&
33830
+ j.o.image.selectImageAfterClose) {
33831
+ j.s.select(_this.state.sourceImage);
33832
+ }
33833
+ });
33834
+ dialog.setSize(j.o.image.dialogWidth);
33835
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.markOwner)(j, dialog.container);
33836
+ return dialog;
33837
+ },
33838
+ enumerable: false,
33839
+ configurable: true
33840
+ });
33841
+ Object.defineProperty(imageProperties.prototype, "__buttons", {
33842
+ get: function () {
33843
+ var j = this.j;
33844
+ return {
33845
+ check: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__/* .Button */ .$n)(j, 'ok', 'Apply', 'primary'),
33846
+ remove: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__/* .Button */ .$n)(j, 'bin', 'Delete'),
33847
+ cancel: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__/* .Button */ .$n)(j, 'cancel', 'Cancel')
33848
+ };
33849
+ },
33850
+ enumerable: false,
33851
+ configurable: true
33852
+ });
33779
33853
  /**
33780
33854
  * Open dialog editing image properties
33781
33855
  *
@@ -33791,362 +33865,27 @@ var imageProperties = /** @class */ (function (_super) {
33791
33865
  * ```
33792
33866
  */
33793
33867
  imageProperties.prototype.open = function () {
33794
- this.makeForm();
33795
- this.activeTabState.__activeTab = 'Image';
33796
- this.j.e.fire('hidePopup');
33797
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.markOwner)(this.j, this.dialog.container);
33798
- this.state.marginIsLocked = true;
33799
- this.state.sizeIsLocked = true;
33800
- this.onChangeMarginIsLocked();
33801
- this.onChangeSizeIsLocked();
33802
- this.updateValues();
33868
+ var _this = this;
33869
+ this.activeTabState.activeTab = 'Image';
33870
+ this.__lock();
33803
33871
  this.dialog.open().setModal(true).setPosition();
33872
+ this.async
33873
+ .promise(function (resolve, reject) {
33874
+ return (0,_readers__WEBPACK_IMPORTED_MODULE_10__/* .readValuesFromImage */ .U)(_this.j, _this.state).then(resolve, reject);
33875
+ })
33876
+ .catch(function (e) { return _this.dialog.message.error(e.message); })
33877
+ .finally(function () { return _this.__unlock(); });
33804
33878
  return false;
33805
33879
  };
33806
- /**
33807
- * Create form for edit image properties
33808
- */
33809
- imageProperties.prototype.makeForm = function () {
33810
- var _this = this;
33811
- if (this.dialog) {
33812
- return;
33813
- }
33814
- this.dialog = this.j.dlg({
33815
- minWidth: Math.min(400, screen.width),
33816
- minHeight: 590,
33817
- buttons: ['fullsize', 'dialog.close']
33818
- });
33819
- var editor = this.j, opt = editor.o, i18n = editor.i18n.bind(editor), buttons = {
33820
- check: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_3__/* .Button */ .$n)(editor, 'ok', 'Apply', 'primary'),
33821
- remove: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_3__/* .Button */ .$n)(editor, 'bin', 'Delete')
33822
- };
33823
- editor.e.on(this.dialog, 'afterClose', function () {
33824
- if (_this.state.image.parentNode &&
33825
- opt.image.selectImageAfterClose) {
33826
- editor.s.select(_this.state.image);
33827
- }
33828
- });
33829
- buttons.remove.onAction(function () {
33830
- editor.s.removeNode(_this.state.image);
33831
- _this.dialog.close();
33832
- });
33833
- var dialog = this.dialog;
33834
- dialog.setHeader(i18n('Image properties'));
33835
- var mainForm = (0,_templates_form__WEBPACK_IMPORTED_MODULE_8__/* .form */ .Z)(editor);
33836
- this.form = mainForm;
33837
- dialog.setContent(mainForm);
33838
- var tabsBox = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form).tabsBox;
33839
- if (tabsBox) {
33840
- tabsBox.appendChild((0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_6__/* .TabsWidget */ .Zg)(editor, [
33841
- { name: 'Image', content: (0,_templates_main_tab__WEBPACK_IMPORTED_MODULE_9__/* .mainTab */ .J)(editor) },
33842
- { name: 'Advanced', content: (0,_templates_position_tab__WEBPACK_IMPORTED_MODULE_10__/* .positionTab */ .b)(editor) }
33843
- ], this.activeTabState));
33844
- }
33845
- buttons.check.onAction(this.onApply);
33846
- var _a = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form), changeImage = _a.changeImage, editImage = _a.editImage;
33847
- editor.e.on(changeImage, 'click', this.openImagePopup);
33848
- if (opt.image.useImageEditor) {
33849
- editor.e.on(editImage, 'click', this.openImageEditor);
33850
- }
33851
- var _b = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(mainForm), lockSize = _b.lockSize, lockMargin = _b.lockMargin, imageWidth = _b.imageWidth, imageHeight = _b.imageHeight;
33852
- if (lockSize) {
33853
- editor.e.on(lockSize, 'click', function () {
33854
- _this.state.sizeIsLocked = !_this.state.sizeIsLocked;
33855
- });
33856
- }
33857
- editor.e.on(lockMargin, 'click', function (e) {
33858
- _this.state.marginIsLocked = !_this.state.marginIsLocked;
33859
- e.preventDefault();
33860
- });
33861
- var changeSizes = function (event) {
33862
- if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isNumeric)(imageWidth.value) || !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isNumeric)(imageHeight.value)) {
33863
- return;
33864
- }
33865
- var w = parseFloat(imageWidth.value), h = parseFloat(imageHeight.value);
33866
- if (event.target === imageWidth) {
33867
- imageHeight.value = Math.round(w / _this.state.ratio).toString();
33868
- }
33869
- else {
33870
- imageWidth.value = Math.round(h * _this.state.ratio).toString();
33871
- }
33872
- };
33873
- editor.e.on([imageWidth, imageHeight], 'change keydown mousedown paste', function (event) {
33874
- if (!_this.state.sizeIsLocked) {
33875
- return;
33876
- }
33877
- editor.async.setTimeout(changeSizes.bind(_this, event), {
33878
- timeout: editor.defaultTimeout,
33879
- label: 'image-properties-changeSize'
33880
- });
33881
- });
33882
- dialog.setFooter([buttons.remove, buttons.check]);
33883
- dialog.setSize(this.j.o.image.dialogWidth);
33884
- };
33885
- /**
33886
- * Set input values from image
33887
- */
33888
- imageProperties.prototype.updateValues = function () {
33889
- var _this = this;
33890
- var opt = this.j.o;
33891
- var image = this.state.image;
33892
- var _a = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form), marginTop = _a.marginTop, marginRight = _a.marginRight, marginBottom = _a.marginBottom, marginLeft = _a.marginLeft, lockMargin = _a.lockMargin, imageSrc = _a.imageSrc, id = _a.id, classes = _a.classes, align = _a.align, style = _a.style, imageTitle = _a.imageTitle, imageAlt = _a.imageAlt, borderRadius = _a.borderRadius, imageLink = _a.imageLink, imageWidth = _a.imageWidth, imageHeight = _a.imageHeight, imageLinkOpenInNewTab = _a.imageLinkOpenInNewTab, imageViewSrc = _a.imageViewSrc, lockSize = _a.lockSize;
33893
- var updateLock = function () {
33894
- lockMargin.checked = _this.state.marginIsLocked;
33895
- lockSize.checked = _this.state.sizeIsLocked;
33896
- }, updateAlign = function () {
33897
- if (image.style.cssFloat &&
33898
- ['left', 'right'].indexOf(image.style.cssFloat.toLowerCase()) !== -1) {
33899
- align.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'float');
33900
- }
33901
- else {
33902
- if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'display') === 'block' &&
33903
- image.style.marginLeft === 'auto' &&
33904
- image.style.marginRight === 'auto') {
33905
- align.value = 'center';
33906
- }
33907
- }
33908
- }, updateBorderRadius = function () {
33909
- borderRadius.value = (parseInt(image.style.borderRadius || '0', 10) || '0').toString();
33910
- }, updateId = function () {
33911
- id.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'id') || '';
33912
- }, updateStyle = function () {
33913
- style.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'style') || '';
33914
- }, updateClasses = function () {
33915
- classes.value = ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'class') || '').replace(/jodit_focused_image[\s]*/, '');
33916
- }, updateMargins = function () {
33917
- if (!opt.image.editMargins) {
33918
- return;
33919
- }
33920
- var equal = true, wasEmptyField = false;
33921
- [marginTop, marginRight, marginBottom, marginLeft].forEach(function (elm) {
33922
- var id = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(elm, 'data-ref') || '';
33923
- var value = image.style.getPropertyValue((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.kebabCase)(id));
33924
- if (!value) {
33925
- wasEmptyField = true;
33926
- elm.value = '';
33927
- return;
33928
- }
33929
- if (/^[0-9]+(px)?$/.test(value)) {
33930
- value = parseInt(value, 10);
33931
- }
33932
- elm.value = value.toString() || '';
33933
- if ((wasEmptyField && elm.value) ||
33934
- (equal &&
33935
- id !== 'marginTop' &&
33936
- elm.value !== marginTop.value)) {
33937
- equal = false;
33938
- }
33939
- });
33940
- _this.state.marginIsLocked = equal;
33941
- }, updateSizes = function () {
33942
- var width = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'width') ||
33943
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'width', true) ||
33944
- false, height = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'height') ||
33945
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'height', true) ||
33946
- false;
33947
- imageWidth.value =
33948
- width !== false
33949
- ? normalSizeFromString(width).toString()
33950
- : image.offsetWidth.toString();
33951
- imageHeight.value =
33952
- height !== false
33953
- ? normalSizeFromString(height).toString()
33954
- : image.offsetHeight.toString();
33955
- _this.state.sizeIsLocked = (function () {
33956
- if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isNumeric)(imageWidth.value) ||
33957
- !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isNumeric)(imageHeight.value)) {
33958
- return false;
33959
- }
33960
- var w = parseFloat(imageWidth.value), h = parseFloat(imageHeight.value);
33961
- return Math.abs(w - h * _this.state.ratio) < 1;
33962
- })();
33963
- }, updateText = function () {
33964
- imageTitle.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'title') || '';
33965
- imageAlt.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'alt') || '';
33966
- var a = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(image, 'a', _this.j.editor);
33967
- if (a) {
33968
- imageLink.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(a, 'href') || '';
33969
- imageLinkOpenInNewTab.checked =
33970
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(a, 'target') === '_blank';
33971
- }
33972
- else {
33973
- imageLink.value = '';
33974
- imageLinkOpenInNewTab.checked = false;
33975
- }
33976
- }, updateSrc = function () {
33977
- imageSrc.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'src') || '';
33978
- if (imageViewSrc) {
33979
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(imageViewSrc, 'src', (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'src') || '');
33980
- }
33981
- };
33982
- updateLock();
33983
- updateSrc();
33984
- updateText();
33985
- updateSizes();
33986
- updateMargins();
33987
- updateClasses();
33988
- updateId();
33989
- updateBorderRadius();
33990
- updateAlign();
33991
- updateStyle();
33992
- };
33993
- /**
33994
- * Apply form's values to image
33995
- */
33996
- imageProperties.prototype.onApply = function () {
33997
- var _a = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form), style = _a.style, imageSrc = _a.imageSrc, borderRadius = _a.borderRadius, imageTitle = _a.imageTitle, imageAlt = _a.imageAlt, imageLink = _a.imageLink, imageWidth = _a.imageWidth, imageHeight = _a.imageHeight, marginTop = _a.marginTop, marginRight = _a.marginRight, marginBottom = _a.marginBottom, marginLeft = _a.marginLeft, imageLinkOpenInNewTab = _a.imageLinkOpenInNewTab, align = _a.align, classes = _a.classes, id = _a.id;
33998
- var opt = this.j.o;
33999
- var image = this.state.image;
34000
- // styles
34001
- if (opt.image.editStyle) {
34002
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'style', style.value || null);
34003
- }
34004
- // Src
34005
- if (imageSrc.value) {
34006
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'src', imageSrc.value);
34007
- }
34008
- else {
34009
- jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove(image);
34010
- this.dialog.close();
34011
- return;
34012
- }
34013
- // Border radius
34014
- if (borderRadius.value !== '0' && /^[0-9]+$/.test(borderRadius.value)) {
34015
- image.style.borderRadius = borderRadius.value + 'px';
34016
- }
34017
- else {
34018
- image.style.borderRadius = '';
34019
- }
34020
- // Title
34021
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'title', imageTitle.value || null);
34022
- // Alt
34023
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'alt', imageAlt.value || null);
34024
- // Link
34025
- var link = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(image, 'a', this.j.editor);
34026
- if (imageLink.value) {
34027
- if (!link) {
34028
- link = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.wrap(image, 'a', this.j.createInside);
34029
- }
34030
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(link, 'href', imageLink.value);
34031
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(link, 'target', imageLinkOpenInNewTab.checked ? '_blank' : null);
34032
- }
34033
- else {
34034
- if (link && link.parentNode) {
34035
- link.parentNode.replaceChild(image, link);
34036
- }
34037
- }
34038
- // Size
34039
- if (imageWidth.value !== image.offsetWidth.toString() ||
34040
- imageHeight.value !== image.offsetHeight.toString()) {
34041
- var updatedtWidth = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.trim)(imageWidth.value)
34042
- ? normalSizeToString(imageWidth.value)
34043
- : null;
34044
- var updatedHeight = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.trim)(imageHeight.value)
34045
- ? normalSizeToString(imageHeight.value)
34046
- : null;
34047
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, {
34048
- width: updatedtWidth,
34049
- height: updatedHeight
34050
- });
34051
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'width', (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'width') ? updatedtWidth : null);
34052
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'height', (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'height') ? updatedHeight : null);
34053
- }
34054
- var margins = [marginTop, marginRight, marginBottom, marginLeft];
34055
- if (opt.image.editMargins) {
34056
- if (!this.state.marginIsLocked) {
34057
- margins.forEach(function (margin) {
34058
- var side = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(margin, 'data-ref') || '';
34059
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, side, normalSizeToString(margin.value));
34060
- });
34061
- }
34062
- else {
34063
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'margin', normalSizeToString(marginTop.value));
34064
- }
34065
- }
34066
- if (opt.image.editClass) {
34067
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'class', classes.value || null);
34068
- }
34069
- if (opt.image.editId) {
34070
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'id', id.value || null);
34071
- }
34072
- if (opt.image.editAlign) {
34073
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.hAlignElement)(image, align.value);
34074
- }
34075
- this.j.synchronizeValues();
34076
- this.dialog.close();
34077
- };
34078
- /**
34079
- * Open image editor dialog
34080
- */
34081
- imageProperties.prototype.openImageEditor = function () {
34082
- var _this = this;
34083
- var url = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src') || '', a = this.j.c.element('a'), loadExternal = function () {
34084
- if (a.host !== location.host) {
34085
- _this.j.confirm('You can only edit your own images. Download this image on the host?', function (yes) {
34086
- if (yes && _this.j.uploader) {
34087
- _this.j.uploader.uploadRemoteImage(a.href.toString(), function (resp) {
34088
- _this.j.alert('The image has been successfully uploaded to the host!', function () {
34089
- if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isString)(resp.newfilename)) {
34090
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(_this.state.image, 'src', resp.baseurl +
34091
- resp.newfilename);
34092
- _this.updateValues();
34093
- }
34094
- });
34095
- }, function (error) {
34096
- _this.j.alert('There was an error loading %s', error.message);
34097
- });
34098
- }
34099
- });
34100
- return;
34101
- }
34102
- };
34103
- a.href = url;
34104
- this.j.filebrowser.dataProvider
34105
- .getPathByUrl(a.href.toString())
34106
- .then(function (resp) {
34107
- jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_5__/* .openImageEditor */ .B.call(_this.j.filebrowser, a.href, resp.name, resp.path, resp.source, function () {
34108
- var timestamp = new Date().getTime();
34109
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(_this.state.image, 'src', url +
34110
- (url.indexOf('?') !== -1 ? '' : '?') +
34111
- '&_tmp=' +
34112
- timestamp.toString());
34113
- _this.updateValues();
34114
- }, function (error) {
34115
- _this.j.alert(error.message);
34116
- });
34117
- })
34118
- .catch(function (error) {
34119
- _this.j.alert(error.message, loadExternal);
34120
- });
33880
+ imageProperties.prototype.__lock = function () {
33881
+ this.dialog.lock();
33882
+ this.form.setMod('lock', true);
33883
+ Object.values(this.__buttons).forEach(function (b) { return (b.state.disabled = true); });
34121
33884
  };
34122
- /**
34123
- * Open popup with filebrowser/uploader buttons for image
34124
- */
34125
- imageProperties.prototype.openImagePopup = function (event) {
34126
- var _this = this;
34127
- var popup = new jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Popup(this.j), changeImage = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form).changeImage;
34128
- popup.setZIndex(this.dialog.getZIndex() + 1);
34129
- popup
34130
- .setContent((0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_6__/* .FileSelectorWidget */ .kG)(this.j, {
34131
- upload: function (data) {
34132
- if (data.files && data.files.length) {
34133
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(_this.state.image, 'src', data.baseurl + data.files[0]);
34134
- }
34135
- _this.updateValues();
34136
- popup.close();
34137
- },
34138
- filebrowser: function (data) {
34139
- if (data &&
34140
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isArray)(data.files) &&
34141
- data.files.length) {
34142
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(_this.state.image, 'src', data.files[0]);
34143
- popup.close();
34144
- _this.updateValues();
34145
- }
34146
- }
34147
- }, this.state.image, popup.close))
34148
- .open(function () { return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.position)(changeImage); });
34149
- event.stopPropagation();
33885
+ imageProperties.prototype.__unlock = function () {
33886
+ this.dialog.unlock();
33887
+ this.form.setMod('lock', false);
33888
+ Object.values(this.__buttons).forEach(function (b) { return (b.state.disabled = false); });
34150
33889
  };
34151
33890
  /** @override **/
34152
33891
  imageProperties.prototype.afterInit = function (editor) {
@@ -34158,7 +33897,7 @@ var imageProperties = /** @class */ (function (_super) {
34158
33897
  .off(editor.editor, '.imageproperties')
34159
33898
  .on(editor.editor, 'dblclick.imageproperties', function (e) {
34160
33899
  var image = e.target;
34161
- if (!jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(image, 'img')) {
33900
+ if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isTag(image, 'img')) {
34162
33901
  return;
34163
33902
  }
34164
33903
  if (editor.o.image.openOnDblClick) {
@@ -34166,7 +33905,8 @@ var imageProperties = /** @class */ (function (_super) {
34166
33905
  false) {
34167
33906
  return;
34168
33907
  }
34169
- self.state.image = image;
33908
+ self.state.sourceImage = image;
33909
+ self.state.image = image.cloneNode(true);
34170
33910
  if (!editor.o.readonly) {
34171
33911
  e.stopImmediatePropagation();
34172
33912
  e.preventDefault();
@@ -34180,115 +33920,1249 @@ var imageProperties = /** @class */ (function (_super) {
34180
33920
  });
34181
33921
  })
34182
33922
  .on('openImageProperties.imageproperties', function (image) {
34183
- _this.state.image = image;
33923
+ self.state.sourceImage = image;
33924
+ _this.state.image = image.cloneNode(true);
34184
33925
  _this.open();
34185
33926
  });
34186
33927
  };
33928
+ imageProperties.prototype.onStateValuesImageSrcChange = function () {
33929
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__awaiter */ .sH)(this, void 0, Promise, function () {
33930
+ var _a, image, values, w, e_1;
33931
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__generator */ .YH)(this, function (_b) {
33932
+ switch (_b.label) {
33933
+ case 0:
33934
+ _a = this.state, image = _a.image, values = _a.values;
33935
+ if (!image.src) {
33936
+ return [2 /*return*/];
33937
+ }
33938
+ _b.label = 1;
33939
+ case 1:
33940
+ _b.trys.push([1, 3, 4, 5]);
33941
+ this.__lock();
33942
+ return [4 /*yield*/, image.decode()];
33943
+ case 2:
33944
+ _b.sent();
33945
+ if (this.state.sizeIsLocked && (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.isNumeric)(values.imageWidth)) {
33946
+ w = parseFloat(values.imageWidth.toString());
33947
+ values.imageHeight = Math.round(w / this.state.ratio);
33948
+ }
33949
+ this.j.e.fire('updateImageProperties.imageproperties', image);
33950
+ return [3 /*break*/, 5];
33951
+ case 3:
33952
+ e_1 = _b.sent();
33953
+ this.j.alert(e_1.message);
33954
+ return [3 /*break*/, 5];
33955
+ case 4:
33956
+ this.__unlock();
33957
+ return [7 /*endfinally*/];
33958
+ case 5: return [2 /*return*/];
33959
+ }
33960
+ });
33961
+ });
33962
+ };
34187
33963
  /** @override */
34188
33964
  imageProperties.prototype.beforeDestruct = function (editor) {
34189
- this.dialog && this.dialog.destruct();
33965
+ var _a, _b, _c;
33966
+ Object.values((_a = (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cached)(this, '__buttons')) !== null && _a !== void 0 ? _a : {}).forEach(function (b) { return b.destruct(); });
33967
+ (_b = (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cached)(this, 'dialog')) === null || _b === void 0 ? void 0 : _b.destruct();
33968
+ (_c = (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cached)(this, 'form')) === null || _c === void 0 ? void 0 : _c.destruct();
34190
33969
  editor.e.off(editor.editor, '.imageproperties').off('.imageproperties');
34191
33970
  };
34192
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
34193
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.marginIsLocked')
34194
- ], imageProperties.prototype, "onChangeMarginIsLocked", null);
34195
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
34196
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.sizeIsLocked')
34197
- ], imageProperties.prototype, "onChangeSizeIsLocked", null);
34198
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
34199
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.autobind
34200
- ], imageProperties.prototype, "onApply", null);
34201
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
34202
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.autobind
34203
- ], imageProperties.prototype, "openImageEditor", null);
34204
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
34205
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.autobind
34206
- ], imageProperties.prototype, "openImagePopup", null);
33971
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
33972
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cache
33973
+ ], imageProperties.prototype, "form", null);
33974
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
33975
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cache
33976
+ ], imageProperties.prototype, "dialog", null);
33977
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
33978
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cache
33979
+ ], imageProperties.prototype, "__buttons", null);
33980
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
33981
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.image')
33982
+ ], imageProperties.prototype, "onStateValuesImageSrcChange", null);
34207
33983
  return imageProperties;
34208
- }(jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin));
33984
+ }(jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_4__/* .Plugin */ .k));
34209
33985
 
34210
- jodit_core_global__WEBPACK_IMPORTED_MODULE_1__/* .pluginSystem */ .fg.add('imageProperties', imageProperties);
33986
+ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .pluginSystem */ .fg.add('imageProperties', imageProperties);
34211
33987
 
34212
33988
 
34213
33989
  /***/ }),
34214
33990
 
34215
- /***/ 22254:
33991
+ /***/ 74260:
34216
33992
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
34217
33993
 
34218
33994
  "use strict";
34219
33995
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
34220
- /* harmony export */ Z: function() { return /* binding */ form; }
33996
+ /* harmony export */ g: function() { return /* binding */ readAlign; }
34221
33997
  /* harmony export */ });
34222
- /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(931);
33998
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(38322);
34223
33999
  /*!
34224
34000
  * Jodit Editor (https://xdsoft.net/jodit/)
34225
34001
  * Released under MIT see LICENSE.txt in the project root for license information.
34226
34002
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
34227
34003
  */
34228
34004
 
34229
- function form(editor) {
34230
- var _a = editor.o.image, showPreview = _a.showPreview, editSize = _a.editSize, gi = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__/* .Icon */ .I.get.bind(jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__/* .Icon */ .I);
34231
- return editor.c.fromHTML("<form class=\"jodit-properties\">\n\t\t<div class=\"jodit-grid jodit-grid_xs-column\">\n\t\t\t<div class=\"jodit_col-lg-2-5 jodit_col-xs-5-5\">\n\t\t\t\t<div class=\"jodit-properties_view_box\">\n\t\t\t\t\t<div style=\"".concat(!showPreview ? 'display:none' : '', "\" class=\"jodit-properties_image_view\">\n\t\t\t\t\t\t<img data-ref=\"imageViewSrc\" src=\"\" alt=\"\"/>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style=\"").concat(!editSize ? 'display:none' : '', "\" class=\"jodit-form__group jodit-properties_image_sizes\">\n\t\t\t\t\t\t<input data-ref=\"imageWidth\" type=\"text\" class=\"jodit-input\"/>\n\t\t\t\t\t\t<a data-ref=\"lockSize\" class=\"jodit-properties__lock\">").concat(gi('lock'), "</a>\n\t\t\t\t\t\t<input data-ref=\"imageHeight\" type=\"text\" class=\"imageHeight jodit-input\"/>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div data-ref=\"tabsBox\" class=\"jodit_col-lg-3-5 jodit_col-xs-5-5\"></div>\n\t\t</div>\n\t</form>"));
34005
+ /** @private */
34006
+ function readAlign(image, values) {
34007
+ // Align
34008
+ if (image.style.cssFloat &&
34009
+ ['left', 'right'].indexOf(image.style.cssFloat.toLowerCase()) !== -1) {
34010
+ values.align = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_0__/* .css */ .A)(image, 'float');
34011
+ }
34012
+ else {
34013
+ if ((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_0__/* .css */ .A)(image, 'display') === 'block' &&
34014
+ image.style.marginLeft === 'auto' &&
34015
+ image.style.marginRight === 'auto') {
34016
+ values.align = 'center';
34017
+ }
34018
+ else {
34019
+ values.align = '';
34020
+ }
34021
+ }
34232
34022
  }
34233
34023
 
34234
34024
 
34235
34025
  /***/ }),
34236
34026
 
34237
- /***/ 75263:
34027
+ /***/ 5549:
34238
34028
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
34239
34029
 
34240
34030
  "use strict";
34241
34031
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
34242
- /* harmony export */ J: function() { return /* binding */ mainTab; }
34032
+ /* harmony export */ U: function() { return /* binding */ readValuesFromImage; }
34243
34033
  /* harmony export */ });
34244
- /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(931);
34034
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(31635);
34035
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26150);
34036
+ /* harmony import */ var _align__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(74260);
34037
+ /* harmony import */ var _link__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(33201);
34038
+ /* harmony import */ var _margin__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(85079);
34039
+ /* harmony import */ var _size__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(17880);
34245
34040
  /*!
34246
34041
  * Jodit Editor (https://xdsoft.net/jodit/)
34247
34042
  * Released under MIT see LICENSE.txt in the project root for license information.
34248
34043
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
34249
34044
  */
34250
34045
 
34251
- function mainTab(editor) {
34252
- var opt = editor.o, i18n = editor.i18n.bind(editor), gi = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__/* .Icon */ .I.get.bind(jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__/* .Icon */ .I), hasFbUrl = opt.filebrowser.ajax.url || opt.uploader.url, hasEditor = opt.image.useImageEditor;
34253
- return editor.c.fromHTML("<div style=\"".concat(!opt.image.editSrc ? 'display:none' : '', "\" class=\"jodit-form__group\">\n\t\t\t<label>").concat(i18n('Src'), "</label>\n\t\t\t<div class=\"jodit-input_group\">\n\t\t\t\t<input data-ref=\"imageSrc\" class=\"jodit-input\" type=\"text\"/>\n\t\t\t\t<div\n\t\t\t\t\tclass=\"jodit-input_group-buttons\"\n\t\t\t\t\tstyle=\"").concat(hasFbUrl ? '' : 'display: none', "\"\n\t\t\t\t>\n\t\t\t\t\t\t<a\n\t\t\t\t\t\t\tdata-ref=\"changeImage\"\n\t\t\t\t\t\t\tclass=\"jodit-button\"\n\t\t\t\t\t\t>").concat(gi('image'), "</a>\n\t\t\t\t\t\t<a\n\t\t\t\t\t\t\tdata-ref=\"editImage\"\n\t\t\t\t\t\t\tclass=\"jodit-button\"\n\t\t\t\t\t\t\tstyle=\"").concat(hasEditor ? '' : 'display: none', "\"\n\t\t\t\t\t\t>").concat(gi('crop'), "</a>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div style=\"").concat(!opt.image.editTitle ? 'display:none' : '', "\" class=\"jodit-form__group\">\n\t\t\t<label>").concat(i18n('Title'), "</label>\n\t\t\t<input data-ref=\"imageTitle\" type=\"text\" class=\"jodit-input\"/>\n\t\t</div>\n\t\t<div style=\"").concat(!opt.image.editAlt ? 'display:none' : '', "\" class=\"jodit-form__group\">\n\t\t\t<label>").concat(i18n('Alternative'), "</label>\n\t\t\t<input data-ref=\"imageAlt\" type=\"text\" class=\"jodit-input\"/>\n\t\t</div>\n\t\t<div style=\"").concat(!opt.image.editLink ? 'display:none' : '', "\" class=\"jodit-form__group\">\n\t\t\t<label>").concat(i18n('Link'), "</label>\n\t\t\t<input data-ref=\"imageLink\" type=\"text\" class=\"jodit-input\"/>\n\t\t</div>\n\t\t<div style=\"").concat(!opt.image.editLink ? 'display:none' : '', "\" class=\"jodit-form__group\">\n\t\t\t<label class=\"jodit_vertical_middle\">\n\t\t\t\t<input data-ref=\"imageLinkOpenInNewTab\" type=\"checkbox\" class=\"jodit-checkbox\"/>\n\t\t\t\t<span>").concat(i18n('Open link in new tab'), "</span>\n\t\t\t</label>\n\t\t</div>"));
34046
+
34047
+
34048
+
34049
+
34050
+
34051
+ /**
34052
+ * Read values from image and set it to state
34053
+ * @private
34054
+ */
34055
+ function readValuesFromImage(j, state) {
34056
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__awaiter */ .sH)(this, void 0, Promise, function () {
34057
+ var image, values;
34058
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__generator */ .YH)(this, function (_a) {
34059
+ image = state.sourceImage, values = state.values;
34060
+ (0,_align__WEBPACK_IMPORTED_MODULE_4__/* .readAlign */ .g)(image, values);
34061
+ // Border radius
34062
+ values.borderRadius = parseInt(image.style.borderRadius || '0', 10) || 0;
34063
+ // Id
34064
+ values.id = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'id') || '';
34065
+ // Title
34066
+ values.imageTitle = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'title') || '';
34067
+ // Alt
34068
+ values.imageAlt = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'alt') || '';
34069
+ // Style
34070
+ values.style = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'style') || '';
34071
+ // Classes
34072
+ values.classes = ((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'class') || '').replace(/jodit_focused_image[\s]*/, '');
34073
+ // Margins
34074
+ (0,_margin__WEBPACK_IMPORTED_MODULE_5__/* .readMargins */ .E)(image, values, state);
34075
+ // Link
34076
+ (0,_link__WEBPACK_IMPORTED_MODULE_1__/* .readLink */ .X)(state, j, values);
34077
+ // Src
34078
+ values.imageSrc = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'src') || '';
34079
+ // Image size
34080
+ return [2 /*return*/, (0,_size__WEBPACK_IMPORTED_MODULE_2__/* .readSizes */ .P)(image, values, state)];
34081
+ });
34082
+ });
34254
34083
  }
34255
34084
 
34256
34085
 
34257
34086
  /***/ }),
34258
34087
 
34259
- /***/ 57837:
34088
+ /***/ 33201:
34260
34089
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
34261
34090
 
34262
34091
  "use strict";
34263
34092
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
34264
- /* harmony export */ b: function() { return /* binding */ positionTab; }
34093
+ /* harmony export */ X: function() { return /* binding */ readLink; }
34265
34094
  /* harmony export */ });
34266
- /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(931);
34095
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55186);
34096
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26150);
34097
+ /*!
34098
+ * Jodit Editor (https://xdsoft.net/jodit/)
34099
+ * Released under MIT see LICENSE.txt in the project root for license information.
34100
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
34101
+ */
34102
+
34103
+
34104
+ /** @private */
34105
+ function readLink(state, j, values) {
34106
+ var a = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.closest(state.sourceImage, 'a', j.editor);
34107
+ if (a) {
34108
+ values.imageLink = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(a, 'href') || '';
34109
+ values.imageLinkOpenInNewTab = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(a, 'target') === '_blank';
34110
+ }
34111
+ else {
34112
+ values.imageLink = '';
34113
+ values.imageLinkOpenInNewTab = false;
34114
+ }
34115
+ }
34116
+
34117
+
34118
+ /***/ }),
34119
+
34120
+ /***/ 85079:
34121
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
34122
+
34123
+ "use strict";
34124
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
34125
+ /* harmony export */ E: function() { return /* binding */ readMargins; }
34126
+ /* harmony export */ });
34127
+ /* harmony import */ var jodit_core_helpers_string_kebab_case__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(449);
34128
+ /*!
34129
+ * Jodit Editor (https://xdsoft.net/jodit/)
34130
+ * Released under MIT see LICENSE.txt in the project root for license information.
34131
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
34132
+ */
34133
+
34134
+ /** @private */
34135
+ function readMargins(image, values, state) {
34136
+ // Margins
34137
+ var equal = true, wasEmptyField = false;
34138
+ ['marginTop', 'marginRight', 'marginBottom', 'marginLeft'].forEach(function (id) {
34139
+ var value = image.style.getPropertyValue((0,jodit_core_helpers_string_kebab_case__WEBPACK_IMPORTED_MODULE_0__/* .kebabCase */ .k)(id));
34140
+ if (!value) {
34141
+ wasEmptyField = true;
34142
+ values[id] = 0;
34143
+ return;
34144
+ }
34145
+ if (/^[0-9]+(px)?$/.test(value)) {
34146
+ value = parseInt(value, 10);
34147
+ }
34148
+ values[id] = value;
34149
+ if ((wasEmptyField && values[id]) ||
34150
+ (equal && id !== 'marginTop' && values[id] !== values.marginTop)) {
34151
+ equal = false;
34152
+ }
34153
+ });
34154
+ state.marginIsLocked = equal;
34155
+ }
34156
+
34157
+
34158
+ /***/ }),
34159
+
34160
+ /***/ 17880:
34161
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
34162
+
34163
+ "use strict";
34164
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
34165
+ /* harmony export */ P: function() { return /* binding */ readSizes; }
34166
+ /* harmony export */ });
34167
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(31635);
34168
+ /* harmony import */ var jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(12461);
34169
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26150);
34170
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(38322);
34171
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9645);
34172
+ /*!
34173
+ * Jodit Editor (https://xdsoft.net/jodit/)
34174
+ * Released under MIT see LICENSE.txt in the project root for license information.
34175
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
34176
+ */
34177
+
34178
+
34179
+
34180
+
34181
+
34182
+ /** @private */
34183
+ function readSizes(image, values, state) {
34184
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_2__/* .__awaiter */ .sH)(this, void 0, Promise, function () {
34185
+ var width, height, imageWidth, imageHeight, w, h;
34186
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_2__/* .__generator */ .YH)(this, function (_a) {
34187
+ switch (_a.label) {
34188
+ case 0: return [4 /*yield*/, image.decode()];
34189
+ case 1:
34190
+ _a.sent();
34191
+ 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;
34192
+ 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;
34193
+ values.imageWidth =
34194
+ width !== false
34195
+ ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeFromString */ .G)(width)
34196
+ : image.offsetWidth || image.naturalWidth;
34197
+ values.imageHeight =
34198
+ height !== false
34199
+ ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeFromString */ .G)(height)
34200
+ : image.offsetHeight || image.naturalHeight;
34201
+ imageWidth = values.imageWidth, imageHeight = values.imageHeight;
34202
+ w = parseFloat(imageWidth.toString());
34203
+ 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)) {
34204
+ state.sizeIsLocked = false;
34205
+ return [2 /*return*/];
34206
+ }
34207
+ if (height === false) {
34208
+ values.imageHeight = Math.round(w / state.ratio);
34209
+ state.sizeIsLocked = true;
34210
+ return [2 /*return*/];
34211
+ }
34212
+ h = parseFloat(imageHeight.toString());
34213
+ state.sizeIsLocked = Math.abs(w - h * state.ratio) < 1;
34214
+ return [2 /*return*/];
34215
+ }
34216
+ });
34217
+ });
34218
+ }
34219
+
34220
+
34221
+ /***/ }),
34222
+
34223
+ /***/ 31970:
34224
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
34225
+
34226
+ "use strict";
34227
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
34228
+ /* harmony export */ l: function() { return /* binding */ UIImagePropertiesForm; }
34229
+ /* harmony export */ });
34230
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(31635);
34231
+ /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22664);
34232
+ /* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(24767);
34233
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(65147);
34234
+ /* harmony import */ var jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6455);
34235
+ /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(931);
34236
+ /* harmony import */ var jodit_modules_widget__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(16116);
34237
+ /* harmony import */ var _ui_image_main_tab__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(33403);
34238
+ /* harmony import */ var _ui_image_position_tab__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(46681);
34239
+ /*!
34240
+ * Jodit Editor (https://xdsoft.net/jodit/)
34241
+ * Released under MIT see LICENSE.txt in the project root for license information.
34242
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
34243
+ */
34244
+
34245
+
34246
+
34247
+
34248
+
34249
+
34250
+
34251
+
34252
+
34253
+
34254
+ /** @private */
34255
+ var UIImagePropertiesForm = /** @class */ (function (_super) {
34256
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__extends */ .C6)(UIImagePropertiesForm, _super);
34257
+ function UIImagePropertiesForm(jodit, state, activeTabState, handlers) {
34258
+ var _this = _super.call(this, jodit) || this;
34259
+ _this.state = state;
34260
+ _this.handlers = handlers;
34261
+ _this.__mainTab = new _ui_image_main_tab__WEBPACK_IMPORTED_MODULE_5__/* .UIImageMainTab */ .k(_this.jodit, _this.state, _this.handlers);
34262
+ _this.__positionTab = new _ui_image_position_tab__WEBPACK_IMPORTED_MODULE_6__/* .UIImagePositionTab */ ._(_this.jodit, _this.state, _this.handlers);
34263
+ _this.getElm('tabsBox').appendChild((0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_4__/* .TabsWidget */ .Zg)(jodit, [
34264
+ { name: 'Image', content: _this.__mainTab },
34265
+ { name: 'Advanced', content: _this.__positionTab }
34266
+ ], activeTabState));
34267
+ _this.setMod('lock-size', _this.state.sizeIsLocked);
34268
+ _this.append(_this.__mainTab).append(_this.__positionTab);
34269
+ return _this;
34270
+ }
34271
+ UIImagePropertiesForm.prototype.className = function () {
34272
+ return 'UIImagePropertiesForm';
34273
+ };
34274
+ UIImagePropertiesForm.prototype.appendChildToContainer = function () { };
34275
+ UIImagePropertiesForm.prototype.getElm = function (elementName) {
34276
+ var e_1, _a;
34277
+ var selfElm = _super.prototype.getElm.call(this, elementName);
34278
+ if (selfElm) {
34279
+ return selfElm;
34280
+ }
34281
+ try {
34282
+ for (var _b = (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__values */ .Ju)(this.elements), _c = _b.next(); !_c.done; _c = _b.next()) {
34283
+ var child = _c.value;
34284
+ var elm = child.getElm(elementName);
34285
+ if (elm) {
34286
+ return elm;
34287
+ }
34288
+ }
34289
+ }
34290
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
34291
+ finally {
34292
+ try {
34293
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
34294
+ }
34295
+ finally { if (e_1) throw e_1.error; }
34296
+ }
34297
+ return null;
34298
+ };
34299
+ UIImagePropertiesForm.prototype.render = function () {
34300
+ return "<form>\n\t\t<div class=\"jodit-grid jodit-grid_xs-column\">\n\t\t\t<div class=\"jodit_col-lg-2-5 jodit_col-xs-5-5\">\n\t\t\t\t<div class=\"&__view-box\">\n\t\t\t\t\t<div class=\"&__imageView\">\n\t\t\t\t\t\t<img class=\"&__imageViewSrc\" src=\"\" alt=\"\"/>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"jodit-form__group &__imageSizes\">\n\t\t\t\t\t\t<input type=\"text\" class=\"jodit-input &__imageWidth\"/>\n\t\t\t\t\t\t<a class=\"&__lockSize\">".concat(jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__/* .Icon */ .I.get('lock'), "</a>\n\t\t\t\t\t\t<input type=\"text\" class=\"&__imageHeight jodit-input\"/>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class=\"jodit_col-lg-3-5 jodit_col-xs-5-5 &__tabsBox\"></div>\n\t\t</div>\n\t</form>");
34301
+ };
34302
+ UIImagePropertiesForm.prototype.onChangeSizeIsLocked = function () {
34303
+ var lockSize = this.getElm('lockSize');
34304
+ var imageWidth = this.getElm('imageWidth');
34305
+ lockSize.innerHTML = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__/* .Icon */ .I.get(this.state.sizeIsLocked ? 'lock' : 'unlock');
34306
+ this.setMod('lock-size', this.state.sizeIsLocked);
34307
+ this.j.e.fire(imageWidth, 'change');
34308
+ };
34309
+ UIImagePropertiesForm.prototype.onLockSizeClick = function () {
34310
+ this.state.sizeIsLocked = !this.state.sizeIsLocked;
34311
+ };
34312
+ UIImagePropertiesForm.prototype.onStateValuesSizeChange = function () {
34313
+ var imageWidth = this.getElm('imageWidth');
34314
+ var imageHeight = this.getElm('imageHeight');
34315
+ if (imageWidth !== this.j.od.activeElement) {
34316
+ imageWidth.value = this.state.values.imageWidth.toString();
34317
+ }
34318
+ if (imageHeight !== this.j.od.activeElement) {
34319
+ imageHeight.value = this.state.values.imageHeight.toString();
34320
+ }
34321
+ };
34322
+ UIImagePropertiesForm.prototype.onImageWidthChange = function (e) {
34323
+ var imageWidth = this.getElm('imageWidth');
34324
+ var imageHeight = this.getElm('imageHeight');
34325
+ if (!this.state.sizeIsLocked ||
34326
+ !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.isNumeric)(imageWidth.value) ||
34327
+ !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.isNumeric)(imageHeight.value)) {
34328
+ this.state.values.imageWidth = imageWidth.value;
34329
+ this.state.values.imageHeight = imageHeight.value;
34330
+ return;
34331
+ }
34332
+ var w = parseFloat(imageWidth.value), h = parseFloat(imageHeight.value);
34333
+ if (e.target === imageWidth) {
34334
+ this.state.values.imageWidth = w;
34335
+ this.state.values.imageHeight = Math.round(w / this.state.ratio);
34336
+ }
34337
+ else {
34338
+ this.state.values.imageWidth = Math.round(h * this.state.ratio);
34339
+ this.state.values.imageHeight = h;
34340
+ }
34341
+ };
34342
+ UIImagePropertiesForm.prototype.onStateValuesImageSrcChange = function () {
34343
+ var imageSrc = this.state.values.imageSrc;
34344
+ if (!imageSrc) {
34345
+ return;
34346
+ }
34347
+ var imageViewSrc = this.getElm('imageViewSrc');
34348
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.attr)(imageViewSrc, 'src', imageSrc);
34349
+ var image = new Image();
34350
+ image.src = imageSrc;
34351
+ this.state.image = image;
34352
+ };
34353
+ UIImagePropertiesForm.prototype.hideFieldByOptions = function () {
34354
+ var _this = this;
34355
+ var opt = this.j.o.image;
34356
+ [
34357
+ ['editSize', 'imageSizes'],
34358
+ ['showPreview', 'imageView']
34359
+ ].forEach(function (_a) {
34360
+ var _b = (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__read */ .zs)(_a, 2), optKey = _b[0], elmKey = _b[1];
34361
+ var elm = _this.getElm(elmKey);
34362
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.css)(elm, 'display', opt[optKey] ? null : 'none');
34363
+ });
34364
+ };
34365
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34366
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready'),
34367
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.sizeIsLocked')
34368
+ ], UIImagePropertiesForm.prototype, "onChangeSizeIsLocked", null);
34369
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34370
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('lockSize:click')
34371
+ ], UIImagePropertiesForm.prototype, "onLockSizeClick", null);
34372
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34373
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready'),
34374
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)(['state.values.imageWidth', 'state.values.imageHeight'])
34375
+ ], UIImagePropertiesForm.prototype, "onStateValuesSizeChange", null);
34376
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34377
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([
34378
+ 'imageWidth:change',
34379
+ 'imageHeight:change',
34380
+ 'imageWidth:keydown',
34381
+ 'imageHeight:keydown',
34382
+ 'imageWidth:mousedown',
34383
+ 'imageHeight:mousedown',
34384
+ 'imageWidth:paste',
34385
+ 'imageHeight:paste'
34386
+ ]),
34387
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.debounce)()
34388
+ ], UIImagePropertiesForm.prototype, "onImageWidthChange", null);
34389
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34390
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready'),
34391
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.values.imageSrc')
34392
+ ], UIImagePropertiesForm.prototype, "onStateValuesImageSrcChange", null);
34393
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34394
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready')
34395
+ ], UIImagePropertiesForm.prototype, "hideFieldByOptions", null);
34396
+ UIImagePropertiesForm = (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34397
+ jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_8__/* .component */ .s
34398
+ ], UIImagePropertiesForm);
34399
+ return UIImagePropertiesForm;
34400
+ }(jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_2__/* .UIGroup */ .U));
34401
+
34402
+
34403
+
34404
+ /***/ }),
34405
+
34406
+ /***/ 33403:
34407
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
34408
+
34409
+ "use strict";
34410
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
34411
+ /* harmony export */ k: function() { return /* binding */ UIImageMainTab; }
34412
+ /* harmony export */ });
34413
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(31635);
34414
+ /* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(24767);
34415
+ /* harmony import */ var jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71151);
34416
+ /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(66927);
34417
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65147);
34418
+ /* harmony import */ var jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6455);
34267
34419
  /*!
34268
34420
  * Jodit Editor (https://xdsoft.net/jodit/)
34269
34421
  * Released under MIT see LICENSE.txt in the project root for license information.
34270
34422
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
34271
34423
  */
34272
34424
 
34273
- function positionTab(editor) {
34274
- var opt = editor.o, i18n = editor.i18n.bind(editor), gi = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__/* .Icon */ .I.get.bind(jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__/* .Icon */ .I);
34275
- var classInput = [];
34276
- if (opt.image.availableClasses.length > 0) {
34277
- classInput.push('<select data-ref="classes" class="jodit-input jodit-select">');
34278
- opt.image.availableClasses.forEach(function (item) {
34279
- if (typeof item === 'string') {
34280
- classInput.push("<option value=\"".concat(item, "\">").concat(item, "</option>"));
34425
+
34426
+
34427
+
34428
+
34429
+
34430
+ /** @private */
34431
+ var UIImageMainTab = /** @class */ (function (_super) {
34432
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__extends */ .C6)(UIImageMainTab, _super);
34433
+ function UIImageMainTab(view, state, handlers) {
34434
+ var _this = _super.call(this, view) || this;
34435
+ _this.state = state;
34436
+ _this.handlers = handlers;
34437
+ return _this;
34438
+ }
34439
+ UIImageMainTab.prototype.className = function () {
34440
+ return 'UIImageMainTab';
34441
+ };
34442
+ UIImageMainTab.prototype.appendChildToContainer = function () {
34443
+ // Do nothing
34444
+ };
34445
+ UIImageMainTab.prototype.render = function () {
34446
+ return "<div class=\"jodit-form__group &__editSrc\">\n\t\t\t<label>~Src~</label>\n\t\t\t<div class=\"jodit-input_group\">\n\t\t\t\t<input class=\"jodit-input &__imageSrc\" type=\"text\"/>\n\t\t\t\t<div class=\"jodit-input_group-buttons &__fixImage\">\n\t\t\t\t\t\t<a class=\"jodit-button &__changeImage\">*image*</a>\n\t\t\t\t\t\t<a class=\"jodit-button &__editImage\">*crop*</a>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"jodit-form__group &__editTitle\">\n\t\t\t<label>~Title~</label>\n\t\t\t<input type=\"text\" class=\"jodit-input &__imageTitle\"/>\n\t\t</div>\n\t\t<div class=\"jodit-form__group &__editAlt\">\n\t\t\t<label>~Alternative~</label>\n\t\t\t<input type=\"text\" class=\"jodit-input &__imageAlt\"/>\n\t\t</div>\n\t\t<div class=\"jodit-form__group &__editLink\">\n\t\t\t<label>~Link~</label>\n\t\t\t<input type=\"text\" class=\"jodit-input &__imageLink\"/>\n\t\t</div>\n\t\t<div class=\"jodit-form__group &__editLinkTarget\">\n\t\t\t<label class=\"jodit_vertical_middle\">\n\t\t\t\t<input type=\"checkbox\" class=\"jodit-checkbox &__imageLinkOpenInNewTab\"/>\n\t\t\t\t<span>~Open link in new tab~</span>\n\t\t\t</label>\n\t\t</div>";
34447
+ };
34448
+ UIImageMainTab.prototype.onStateImageSrcChange = function () {
34449
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__awaiter */ .sH)(this, void 0, Promise, function () {
34450
+ var imageSrc;
34451
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__generator */ .YH)(this, function (_a) {
34452
+ imageSrc = this.getElm('imageSrc');
34453
+ imageSrc.value = this.state.values.imageSrc;
34454
+ return [2 /*return*/];
34455
+ });
34456
+ });
34457
+ };
34458
+ UIImageMainTab.prototype.onImageSrcChange = function () {
34459
+ this.state.values.imageSrc = this.getElm('imageSrc').value;
34460
+ };
34461
+ /**
34462
+ * Open image editor
34463
+ */
34464
+ UIImageMainTab.prototype.onEditImageClick = function (e) {
34465
+ this.handlers.openImageEditor();
34466
+ e.stopPropagation();
34467
+ };
34468
+ /**
34469
+ * Open popup with filebrowser/uploader buttons for image
34470
+ */
34471
+ UIImageMainTab.prototype.onChangeImageClick = function (e) {
34472
+ this.handlers.openImagePopup(this.getElm('changeImage'));
34473
+ e.stopPropagation();
34474
+ };
34475
+ UIImageMainTab.prototype.onStateTitleChange = function () {
34476
+ var title = this.getElm('imageTitle');
34477
+ title.value = this.state.values.imageTitle;
34478
+ };
34479
+ UIImageMainTab.prototype.onTitleChange = function () {
34480
+ this.state.values.imageTitle = this.getElm('imageTitle').value;
34481
+ };
34482
+ UIImageMainTab.prototype.onStateAltChange = function () {
34483
+ var alt = this.getElm('imageAlt');
34484
+ alt.value = this.state.values.imageAlt;
34485
+ };
34486
+ UIImageMainTab.prototype.onAltChange = function () {
34487
+ this.state.values.imageAlt = this.getElm('imageAlt').value;
34488
+ };
34489
+ UIImageMainTab.prototype.onStateImageLinkChange = function () {
34490
+ var imageLink = this.getElm('imageLink');
34491
+ imageLink.value = this.state.values.imageLink;
34492
+ };
34493
+ UIImageMainTab.prototype.onImageLinkChange = function () {
34494
+ this.state.values.imageLink = this.getElm('imageLink').value;
34495
+ };
34496
+ UIImageMainTab.prototype.onStateImageLinkOpenInNewTabChange = function () {
34497
+ var imageLinkOpenInNewTab = this.getElm('imageLinkOpenInNewTab');
34498
+ imageLinkOpenInNewTab.checked = this.state.values.imageLinkOpenInNewTab;
34499
+ };
34500
+ UIImageMainTab.prototype.onImageLinkOpenInNewTabChange = function () {
34501
+ this.state.values.imageLinkOpenInNewTab = this.getElm('imageLinkOpenInNewTab').checked;
34502
+ };
34503
+ UIImageMainTab.prototype.hideFieldByOptions = function () {
34504
+ var _this = this;
34505
+ var o = this.j.o;
34506
+ var opt = o.image;
34507
+ [
34508
+ ['editSrc', 'editSrc'],
34509
+ ['editTitle', 'editTitle'],
34510
+ ['editAlt', 'editAlt'],
34511
+ ['editLink', 'editLink'],
34512
+ ['editLink', 'editLinkTarget'],
34513
+ ['useImageEditor', 'editImage']
34514
+ ].forEach(function (_a) {
34515
+ var _b = (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__read */ .zs)(_a, 2), optKey = _b[0], elmKey = _b[1];
34516
+ var elm = _this.getElm(elmKey);
34517
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(elm, 'display', opt[optKey] ? null : 'none');
34518
+ });
34519
+ var changeImage = this.getElm('changeImage');
34520
+ var needShowChangeImage = Boolean(o.filebrowser.ajax.url || o.uploader.url);
34521
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(changeImage, 'display', needShowChangeImage ? null : 'none');
34522
+ var editImage = this.getElm('editImage');
34523
+ var needShowEditImage = Boolean(o.filebrowser.ajax.url) && opt.useImageEditor;
34524
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(editImage, 'display', needShowEditImage ? null : 'none');
34525
+ var fixImage = this.getElm('fixImage');
34526
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(fixImage, 'display', needShowChangeImage || needShowEditImage ? null : 'none');
34527
+ };
34528
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
34529
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageSrc')
34530
+ ], UIImageMainTab.prototype, "onStateImageSrcChange", null);
34531
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
34532
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageSrc:change')
34533
+ ], UIImageMainTab.prototype, "onImageSrcChange", null);
34534
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
34535
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('editImage:click')
34536
+ ], UIImageMainTab.prototype, "onEditImageClick", null);
34537
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
34538
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('changeImage:click')
34539
+ ], UIImageMainTab.prototype, "onChangeImageClick", null);
34540
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
34541
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageTitle')
34542
+ ], UIImageMainTab.prototype, "onStateTitleChange", null);
34543
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
34544
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageTitle:change')
34545
+ ], UIImageMainTab.prototype, "onTitleChange", null);
34546
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
34547
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageAlt')
34548
+ ], UIImageMainTab.prototype, "onStateAltChange", null);
34549
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
34550
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageAlt:change')
34551
+ ], UIImageMainTab.prototype, "onAltChange", null);
34552
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
34553
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageLink')
34554
+ ], UIImageMainTab.prototype, "onStateImageLinkChange", null);
34555
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
34556
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageLink:change')
34557
+ ], UIImageMainTab.prototype, "onImageLinkChange", null);
34558
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
34559
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageLinkOpenInNewTab')
34560
+ ], UIImageMainTab.prototype, "onStateImageLinkOpenInNewTabChange", null);
34561
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
34562
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageLinkOpenInNewTab:change')
34563
+ ], UIImageMainTab.prototype, "onImageLinkOpenInNewTabChange", null);
34564
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
34565
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready')
34566
+ ], UIImageMainTab.prototype, "hideFieldByOptions", null);
34567
+ UIImageMainTab = (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
34568
+ jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_5__/* .component */ .s
34569
+ ], UIImageMainTab);
34570
+ return UIImageMainTab;
34571
+ }(jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_3__/* .UIGroup */ .U));
34572
+
34573
+
34574
+
34575
+ /***/ }),
34576
+
34577
+ /***/ 46681:
34578
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
34579
+
34580
+ "use strict";
34581
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
34582
+ /* harmony export */ _: function() { return /* binding */ UIImagePositionTab; }
34583
+ /* harmony export */ });
34584
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(31635);
34585
+ /* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(24767);
34586
+ /* harmony import */ var jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71151);
34587
+ /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(66927);
34588
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65147);
34589
+ /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(98253);
34590
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(26150);
34591
+ /* harmony import */ var jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29780);
34592
+ /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(931);
34593
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(9645);
34594
+ /*!
34595
+ * Jodit Editor (https://xdsoft.net/jodit/)
34596
+ * Released under MIT see LICENSE.txt in the project root for license information.
34597
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
34598
+ */
34599
+
34600
+
34601
+
34602
+
34603
+
34604
+
34605
+
34606
+
34607
+
34608
+
34609
+ /** @private */
34610
+ var UIImagePositionTab = /** @class */ (function (_super) {
34611
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__extends */ .C6)(UIImagePositionTab, _super);
34612
+ function UIImagePositionTab(jodit, state, handlers) {
34613
+ var _this = _super.call(this, jodit, {
34614
+ availableClasses: jodit.o.image.availableClasses
34615
+ }) || this;
34616
+ _this.state = state;
34617
+ _this.handlers = handlers;
34618
+ return _this;
34619
+ }
34620
+ UIImagePositionTab.prototype.className = function () {
34621
+ return 'UIImagePositionTab';
34622
+ };
34623
+ UIImagePositionTab.prototype.render = function (_a) {
34624
+ var availableClasses = _a.availableClasses;
34625
+ return "<div class=\"jodit-form__group &__editMargins\">\n\t\t\t<label>~Margins~</label>\n\t\t\t<div class=\"jodit-grid jodit_vertical_middle\">\n\t\t\t\t<input class=\"jodit_col-lg-1-5 jodit-input &__marginTop\" type=\"text\" placeholder=\"~top~\"/>\n\t\t\t\t<a style=\"text-align: center;\" class=\"jodit-properties__lock jodit_col-lg-1-5 &__lockMargin\">*lock*</a>\n\t\t\t\t<input disabled=\"disabled\" class=\"jodit_col-lg-1-5 jodit-input &__marginRight\" type=\"text\" placeholder=\"~right~\"/>\n\t\t\t\t<input disabled=\"disabled\" class=\"jodit_col-lg-1-5 jodit-input &__marginBottom\" type=\"text\" placeholder=\"~bottom~\"/>\n\t\t\t\t<input disabled=\"disabled\" class=\"jodit_col-lg-1-5 jodit-input &__marginLeft\" type=\"text\" placeholder=\"~left~\"/>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"jodit-form__group &__editAlign\">\n\t\t\t<label>~Align~</label>\n\t\t\t<select class=\"jodit-select &__align\">\n\t\t\t\t<option value=\"\">~--Not Set--~</option>\n\t\t\t\t<option value=\"left\">~Left~</option>\n\t\t\t\t<option value=\"center\">~Center~</option>\n\t\t\t\t<option value=\"right\">~Right~</option>\n\t\t\t</select>\n\t\t</div>\n\t\t<div class=\"jodit-form__group &__editStyle\">\n\t\t\t<label>~Styles~</label>\n\t\t\t<input type=\"text\" class=\"jodit-input &__style\"/>\n\t\t</div>\n\t\t<div class=\"jodit-form__group &__editClass\">\n\t\t\t<label>~Classes~</label>\n\t\t\t".concat((function () {
34626
+ var classInput = [];
34627
+ if (availableClasses && availableClasses.length > 0) {
34628
+ classInput.push('<select class="jodit-input jodit-select &__classes">');
34629
+ availableClasses.forEach(function (item) {
34630
+ if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_8__/* .isString */ .K)(item)) {
34631
+ classInput.push("<option value=\"".concat(item, "\">").concat(item, "</option>"));
34632
+ }
34633
+ else {
34634
+ classInput.push("<option value=\"".concat(item[0], "\">").concat(item[1], "</option>"));
34635
+ }
34636
+ });
34637
+ classInput.push('</select>');
34281
34638
  }
34282
34639
  else {
34283
- classInput.push("<option value=\"".concat(item[0], "\">").concat(item[1], "</option>"));
34640
+ classInput.push('<input type="text" class="jodit-input &__classes"/>');
34284
34641
  }
34642
+ return classInput.join('');
34643
+ })(), "\n\t\t</div>\n\t\t<div class=\"jodit-form__group &__editId\">\n\t\t\t<label>Id</label>\n\t\t\t<input type=\"text\" class=\"jodit-input &__id\"/>\n\t\t</div>\n\t\t<div\n\t\t\tclass=\"jodit-form__group &__editBorderRadius\"\n\t\t>\n\t\t\t<label>~Border radius~</label>\n\t\t\t<input type=\"number\" class=\"jodit-input &__borderRadius\"/>\n\t\t</div>");
34644
+ };
34645
+ UIImagePositionTab.prototype.onStateAlignChange = function () {
34646
+ var align = this.getElm('align');
34647
+ align.value = this.state.values.align;
34648
+ };
34649
+ UIImagePositionTab.prototype.onChangeAlign = function () {
34650
+ var align = this.getElm('align');
34651
+ this.state.values.align = align.value;
34652
+ };
34653
+ UIImagePositionTab.prototype.onStateValuesBorderRadiusChange = function () {
34654
+ var borderRadius = this.getElm('borderRadius');
34655
+ borderRadius.value = this.state.values.borderRadius.toString();
34656
+ };
34657
+ UIImagePositionTab.prototype.onChangeBorderRadius = function () {
34658
+ var borderRadius = this.getElm('borderRadius');
34659
+ this.state.values.borderRadius = parseFloat(borderRadius.value);
34660
+ };
34661
+ UIImagePositionTab.prototype.onStateValuesIdChange = function () {
34662
+ var id = this.getElm('id');
34663
+ id.value = this.state.values.id;
34664
+ };
34665
+ UIImagePositionTab.prototype.onChangeId = function () {
34666
+ var id = this.getElm('id');
34667
+ this.state.values.id = id.value;
34668
+ };
34669
+ UIImagePositionTab.prototype.onStateValuesStyleChange = function () {
34670
+ var style = this.getElm('style');
34671
+ style.value = this.state.values.style;
34672
+ };
34673
+ UIImagePositionTab.prototype.onChangeStyle = function () {
34674
+ var style = this.getElm('style');
34675
+ this.state.values.style = style.value;
34676
+ };
34677
+ UIImagePositionTab.prototype.onStateValuesClassesChange = function () {
34678
+ var classes = this.getElm('classes');
34679
+ classes.value = this.state.values.classes;
34680
+ };
34681
+ UIImagePositionTab.prototype.onChangClasses = function () {
34682
+ var classes = this.getElm('classes');
34683
+ this.state.values.classes = classes.value;
34684
+ };
34685
+ UIImagePositionTab.prototype.onLockMarginClick = function (e) {
34686
+ this.state.marginIsLocked = !this.state.marginIsLocked;
34687
+ e.preventDefault();
34688
+ };
34689
+ UIImagePositionTab.prototype.onChangeMarginIsLocked = function () {
34690
+ var _this = this;
34691
+ var marginBottom = this.getElm('marginBottom');
34692
+ var marginRight = this.getElm('marginRight');
34693
+ var marginLeft = this.getElm('marginLeft');
34694
+ var lockMargin = this.getElm('lockMargin');
34695
+ [marginRight, marginBottom, marginLeft].forEach(function (elm) {
34696
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_3__/* .attr */ .C)(elm, 'disabled', _this.state.marginIsLocked || null);
34697
+ });
34698
+ lockMargin.innerHTML = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_5__/* .Icon */ .I.get(this.state.marginIsLocked ? 'lock' : 'unlock');
34699
+ if (this.state.marginIsLocked) {
34700
+ var marginTop = this.state.values.marginTop;
34701
+ this.state.values.marginRight = marginTop;
34702
+ this.state.values.marginBottom = marginTop;
34703
+ this.state.values.marginLeft = marginTop;
34704
+ }
34705
+ };
34706
+ UIImagePositionTab.prototype.onStateValuesMarginChange = function () {
34707
+ var marginTop = this.getElm('marginTop');
34708
+ var marginRight = this.getElm('marginRight');
34709
+ var marginBottom = this.getElm('marginBottom');
34710
+ var marginLeft = this.getElm('marginLeft');
34711
+ marginTop.value = this.state.values.marginTop.toString();
34712
+ marginRight.value = this.state.values.marginRight.toString();
34713
+ marginBottom.value = this.state.values.marginBottom.toString();
34714
+ marginLeft.value = this.state.values.marginLeft.toString();
34715
+ };
34716
+ UIImagePositionTab.prototype.onChangeMargin = function () {
34717
+ var marginTop = this.getElm('marginTop');
34718
+ var marginRight = this.getElm('marginRight');
34719
+ var marginBottom = this.getElm('marginBottom');
34720
+ var marginLeft = this.getElm('marginLeft');
34721
+ this.state.values.marginTop = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginTop.value);
34722
+ if (this.state.marginIsLocked) {
34723
+ this.state.values.marginRight = this.state.values.marginTop;
34724
+ this.state.values.marginBottom = this.state.values.marginTop;
34725
+ this.state.values.marginLeft = this.state.values.marginTop;
34726
+ }
34727
+ else {
34728
+ this.state.values.marginRight = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginRight.value);
34729
+ this.state.values.marginBottom = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginBottom.value);
34730
+ this.state.values.marginLeft = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginLeft.value);
34731
+ }
34732
+ };
34733
+ UIImagePositionTab.prototype.hideFieldByOptions = function () {
34734
+ var _this = this;
34735
+ var opt = this.j.o.image;
34736
+ [
34737
+ ['editMargins', 'editMargins'],
34738
+ ['editAlign', 'editAlign'],
34739
+ ['editStyle', 'editStyle'],
34740
+ ['editClass', 'editClass'],
34741
+ ['editId', 'editId'],
34742
+ ['editBorderRadius', 'editBorderRadius']
34743
+ ].forEach(function (_a) {
34744
+ var _b = (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__read */ .zs)(_a, 2), optKey = _b[0], elmKey = _b[1];
34745
+ var elm = _this.getElm(elmKey);
34746
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(elm, 'display', opt[optKey] ? null : 'none');
34747
+ });
34748
+ };
34749
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34750
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
34751
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.align')
34752
+ ], UIImagePositionTab.prototype, "onStateAlignChange", null);
34753
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34754
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('align:change')
34755
+ ], UIImagePositionTab.prototype, "onChangeAlign", null);
34756
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34757
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
34758
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.borderRadius')
34759
+ ], UIImagePositionTab.prototype, "onStateValuesBorderRadiusChange", null);
34760
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34761
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('borderRadius:change')
34762
+ ], UIImagePositionTab.prototype, "onChangeBorderRadius", null);
34763
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34764
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
34765
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.id')
34766
+ ], UIImagePositionTab.prototype, "onStateValuesIdChange", null);
34767
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34768
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('id:change')
34769
+ ], UIImagePositionTab.prototype, "onChangeId", null);
34770
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34771
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
34772
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.style')
34773
+ ], UIImagePositionTab.prototype, "onStateValuesStyleChange", null);
34774
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34775
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('style:change')
34776
+ ], UIImagePositionTab.prototype, "onChangeStyle", null);
34777
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34778
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
34779
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.classes')
34780
+ ], UIImagePositionTab.prototype, "onStateValuesClassesChange", null);
34781
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34782
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('classes:change')
34783
+ ], UIImagePositionTab.prototype, "onChangClasses", null);
34784
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34785
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('lockMargin:click')
34786
+ ], UIImagePositionTab.prototype, "onLockMarginClick", null);
34787
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34788
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
34789
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.marginIsLocked')
34790
+ ], UIImagePositionTab.prototype, "onChangeMarginIsLocked", null);
34791
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34792
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
34793
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)([
34794
+ 'state.values.marginTop',
34795
+ 'state.values.marginRight',
34796
+ 'state.values.marginBottom',
34797
+ 'state.values.marginLeft'
34798
+ ])
34799
+ ], UIImagePositionTab.prototype, "onStateValuesMarginChange", null);
34800
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34801
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)([
34802
+ 'marginTop:change',
34803
+ 'marginRight:change',
34804
+ 'marginBottom:change',
34805
+ 'marginLeft:change'
34806
+ ])
34807
+ ], UIImagePositionTab.prototype, "onChangeMargin", null);
34808
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34809
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready')
34810
+ ], UIImagePositionTab.prototype, "hideFieldByOptions", null);
34811
+ UIImagePositionTab = (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34812
+ jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_9__/* .component */ .s
34813
+ ], UIImagePositionTab);
34814
+ return UIImagePositionTab;
34815
+ }(jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_4__/* .UIElement */ .D));
34816
+
34817
+
34818
+
34819
+ /***/ }),
34820
+
34821
+ /***/ 80778:
34822
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
34823
+
34824
+ "use strict";
34825
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
34826
+ /* harmony export */ v: function() { return /* binding */ openImageEditorDialog; }
34827
+ /* harmony export */ });
34828
+ /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(98253);
34829
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26150);
34830
+ /* harmony import */ var jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(53804);
34831
+ /*!
34832
+ * Jodit Editor (https://xdsoft.net/jodit/)
34833
+ * Released under MIT see LICENSE.txt in the project root for license information.
34834
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
34835
+ */
34836
+
34837
+
34838
+
34839
+ /**
34840
+ * Open image editor dialog
34841
+ * @private
34842
+ */
34843
+ function openImageEditorDialog(j, state) {
34844
+ var url = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(state.image, 'src') || '', a = j.c.element('a'), loadExternal = function () {
34845
+ if (a.host !== location.host) {
34846
+ j.confirm('You can only edit your own images. Download this image on the host?', function (yes) {
34847
+ if (yes && j.uploader) {
34848
+ j.uploader.uploadRemoteImage(a.href.toString(), function (resp) {
34849
+ j.alert('The image has been successfully uploaded to the host!', function () {
34850
+ if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_2__/* .isString */ .K)(resp.newfilename)) {
34851
+ state.values.imageSrc =
34852
+ resp.baseurl +
34853
+ resp.newfilename;
34854
+ }
34855
+ });
34856
+ }, function (error) {
34857
+ j.alert('There was an error loading %s', error.message);
34858
+ });
34859
+ }
34860
+ });
34861
+ return;
34862
+ }
34863
+ };
34864
+ a.href = url;
34865
+ j.filebrowser.dataProvider
34866
+ .getPathByUrl(a.href.toString())
34867
+ .then(function (resp) {
34868
+ jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_1__/* .openImageEditor */ .B.call(j.filebrowser, a.href, resp.name, resp.path, resp.source, function () {
34869
+ var timestamp = new Date().getTime();
34870
+ state.values.imageSrc =
34871
+ url +
34872
+ (url.indexOf('?') !== -1 ? '' : '?') +
34873
+ '&_tmp=' +
34874
+ timestamp.toString();
34875
+ }, function (error) {
34876
+ j.alert(error.message);
34877
+ });
34878
+ })
34879
+ .catch(function (error) {
34880
+ j.alert(error.message, loadExternal);
34881
+ });
34882
+ }
34883
+
34884
+
34885
+ /***/ }),
34886
+
34887
+ /***/ 33733:
34888
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
34889
+
34890
+ "use strict";
34891
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
34892
+ /* harmony export */ q: function() { return /* binding */ openImagePopup; }
34893
+ /* harmony export */ });
34894
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(31635);
34895
+ /* harmony import */ var jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37923);
34896
+ /* harmony import */ var jodit_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(27594);
34897
+ /* harmony import */ var jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(80071);
34898
+ /* harmony import */ var jodit_modules_widget_file_selector_file_selector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10067);
34899
+ /*!
34900
+ * Jodit Editor (https://xdsoft.net/jodit/)
34901
+ * Released under MIT see LICENSE.txt in the project root for license information.
34902
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
34903
+ */
34904
+
34905
+
34906
+
34907
+
34908
+
34909
+ /** @private */
34910
+ function openImagePopup(j, dialog, state, button) {
34911
+ var _this = this;
34912
+ var popup = new jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_0__/* .Popup */ .z(dialog);
34913
+ var closePopup = function () {
34914
+ popup.close();
34915
+ popup.destruct();
34916
+ };
34917
+ popup
34918
+ .setContent((0,jodit_modules_widget_file_selector_file_selector__WEBPACK_IMPORTED_MODULE_1__/* .FileSelectorWidget */ .k)(j, {
34919
+ upload: function (data) {
34920
+ if (data.files && data.files.length) {
34921
+ state.values.imageSrc =
34922
+ data.baseurl + data.files[0];
34923
+ }
34924
+ closePopup();
34925
+ },
34926
+ filebrowser: function (data) { return (0,tslib__WEBPACK_IMPORTED_MODULE_2__/* .__awaiter */ .sH)(_this, void 0, void 0, function () {
34927
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_2__/* .__generator */ .YH)(this, function (_a) {
34928
+ if (data && (0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_3__/* .isArray */ .c)(data.files) && data.files.length) {
34929
+ state.values.imageSrc = data.files[0];
34930
+ closePopup();
34931
+ }
34932
+ return [2 /*return*/];
34933
+ });
34934
+ }); }
34935
+ }, state.image, closePopup))
34936
+ .open(function () { return (0,jodit_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_4__/* .position */ .G)(button); });
34937
+ }
34938
+
34939
+
34940
+ /***/ }),
34941
+
34942
+ /***/ 9645:
34943
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
34944
+
34945
+ "use strict";
34946
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
34947
+ /* harmony export */ G: function() { return /* binding */ normalSizeFromString; },
34948
+ /* harmony export */ n: function() { return /* binding */ normalSizeToString; }
34949
+ /* harmony export */ });
34950
+ /* harmony import */ var jodit_core_helpers_checker_is_number__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2461);
34951
+ /* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(59101);
34952
+ /*!
34953
+ * Jodit Editor (https://xdsoft.net/jodit/)
34954
+ * Released under MIT see LICENSE.txt in the project root for license information.
34955
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
34956
+ */
34957
+
34958
+
34959
+ /** @private */
34960
+ var normalSizeFromString = function (value) {
34961
+ return /^[-+]?[0-9.]+(px)?$/.test(value.toString())
34962
+ ? parseFloat(value.toString())
34963
+ : value;
34964
+ };
34965
+ /** @private */
34966
+ var normalSizeToString = function (value) {
34967
+ if ((0,jodit_core_helpers_checker_is_number__WEBPACK_IMPORTED_MODULE_1__/* .isNumber */ .E)(value)) {
34968
+ return value ? value + 'px' : value.toString();
34969
+ }
34970
+ value = (0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_0__/* .trim */ .Bq)(value);
34971
+ return /^[0-9]+$/.test(value) ? value + 'px' : value;
34972
+ };
34973
+
34974
+
34975
+ /***/ }),
34976
+
34977
+ /***/ 30393:
34978
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
34979
+
34980
+ "use strict";
34981
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
34982
+ /* harmony export */ j: function() { return /* binding */ applyValuesToImage; }
34983
+ /* harmony export */ });
34984
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55186);
34985
+ /* harmony import */ var jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97369);
34986
+ /* harmony import */ var _link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(88269);
34987
+ /* harmony import */ var _margin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(78139);
34988
+ /* harmony import */ var _size__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(58972);
34989
+ /*!
34990
+ * Jodit Editor (https://xdsoft.net/jodit/)
34991
+ * Released under MIT see LICENSE.txt in the project root for license information.
34992
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
34993
+ */
34994
+
34995
+
34996
+
34997
+
34998
+
34999
+ /**
35000
+ * Apply form's values to image
35001
+ * @private
35002
+ */
35003
+ function applyValuesToImage(j, state, image) {
35004
+ var _a = state.values, style = _a.style, imageSrc = _a.imageSrc, borderRadius = _a.borderRadius, imageTitle = _a.imageTitle, imageAlt = _a.imageAlt, imageLink = _a.imageLink, imageWidth = _a.imageWidth, imageHeight = _a.imageHeight, marginTop = _a.marginTop, marginRight = _a.marginRight, marginBottom = _a.marginBottom, marginLeft = _a.marginLeft, imageLinkOpenInNewTab = _a.imageLinkOpenInNewTab, align = _a.align, classes = _a.classes, id = _a.id;
35005
+ var opt = j.o;
35006
+ // styles
35007
+ if (opt.image.editStyle) {
35008
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'style', style || null);
35009
+ }
35010
+ // Src
35011
+ if (imageSrc) {
35012
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'src', imageSrc);
35013
+ }
35014
+ else {
35015
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.safeRemove(image);
35016
+ return;
35017
+ }
35018
+ // Border radius
35019
+ image.style.borderRadius = borderRadius ? borderRadius + 'px' : '';
35020
+ // Title
35021
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'title', imageTitle || null);
35022
+ // Alt
35023
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'alt', imageAlt || null);
35024
+ // Link
35025
+ (0,_link__WEBPACK_IMPORTED_MODULE_2__/* .applyLink */ .j)(j, image, imageLink, imageLinkOpenInNewTab);
35026
+ // Size
35027
+ (0,_size__WEBPACK_IMPORTED_MODULE_4__/* .applySize */ .q)(image, imageWidth, imageHeight, state.sizeIsLocked);
35028
+ // Margin
35029
+ if (j.o.image.editMargins) {
35030
+ (0,_margin__WEBPACK_IMPORTED_MODULE_3__/* .applyMargin */ .N)(j, marginTop, marginRight, marginBottom, marginLeft, image, state.marginIsLocked);
35031
+ }
35032
+ if (opt.image.editClass) {
35033
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'class', classes || null);
35034
+ }
35035
+ if (opt.image.editId) {
35036
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'id', id || null);
35037
+ }
35038
+ if (opt.image.editAlign) {
35039
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.hAlignElement)(image, align);
35040
+ }
35041
+ }
35042
+
35043
+
35044
+ /***/ }),
35045
+
35046
+ /***/ 88269:
35047
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
35048
+
35049
+ "use strict";
35050
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
35051
+ /* harmony export */ j: function() { return /* binding */ applyLink; }
35052
+ /* harmony export */ });
35053
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55186);
35054
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26150);
35055
+ /*!
35056
+ * Jodit Editor (https://xdsoft.net/jodit/)
35057
+ * Released under MIT see LICENSE.txt in the project root for license information.
35058
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
35059
+ */
35060
+
35061
+
35062
+ /** @private */
35063
+ function applyLink(j, image, imageLink, imageLinkOpenInNewTab) {
35064
+ // Link
35065
+ var link = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.closest(image, 'a', j.editor);
35066
+ if (imageLink) {
35067
+ if (!link) {
35068
+ link = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.wrap(image, 'a', j.createInside);
35069
+ }
35070
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(link, 'href', imageLink);
35071
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(link, 'target', imageLinkOpenInNewTab ? '_blank' : null);
35072
+ }
35073
+ else {
35074
+ if (link && link.parentNode) {
35075
+ link.parentNode.replaceChild(image, link);
35076
+ }
35077
+ }
35078
+ }
35079
+
35080
+
35081
+ /***/ }),
35082
+
35083
+ /***/ 78139:
35084
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
35085
+
35086
+ "use strict";
35087
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
35088
+ /* harmony export */ N: function() { return /* binding */ applyMargin; }
35089
+ /* harmony export */ });
35090
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(38322);
35091
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9645);
35092
+ /*!
35093
+ * Jodit Editor (https://xdsoft.net/jodit/)
35094
+ * Released under MIT see LICENSE.txt in the project root for license information.
35095
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
35096
+ */
35097
+
35098
+
35099
+ /** @private */
35100
+ function applyMargin(j, marginTop, marginRight, marginBottom, marginLeft, image, marginIsLocked) {
35101
+ var margins = [marginTop, marginRight, marginBottom, marginLeft];
35102
+ var applyMargin = function (key, value) {
35103
+ var oldValue = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_1__/* .css */ .A)(image, key);
35104
+ var v = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_0__/* .normalSizeToString */ .n)(value);
35105
+ if (oldValue.toString() !== v.toString()) {
35106
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_1__/* .css */ .A)(image, key, v);
35107
+ }
35108
+ };
35109
+ if (!marginIsLocked) {
35110
+ var sides_1 = [
35111
+ 'margin-top',
35112
+ 'margin-right',
35113
+ 'margin-bottom',
35114
+ 'margin-left'
35115
+ ];
35116
+ margins.forEach(function (margin, index) {
35117
+ var side = sides_1[index];
35118
+ applyMargin(side, margin);
34285
35119
  });
34286
- classInput.push('</select>');
34287
35120
  }
34288
35121
  else {
34289
- classInput.push('<input data-ref="classes" type="text" class="jodit-input"/>');
35122
+ applyMargin('margin', marginTop);
35123
+ }
35124
+ }
35125
+
35126
+
35127
+ /***/ }),
35128
+
35129
+ /***/ 58972:
35130
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
35131
+
35132
+ "use strict";
35133
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
35134
+ /* harmony export */ q: function() { return /* binding */ applySize; }
35135
+ /* harmony export */ });
35136
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26150);
35137
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(38322);
35138
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9645);
35139
+ /*!
35140
+ * Jodit Editor (https://xdsoft.net/jodit/)
35141
+ * Released under MIT see LICENSE.txt in the project root for license information.
35142
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
35143
+ */
35144
+
35145
+
35146
+
35147
+ /** @private */
35148
+ function applySize(image, imageWidth, imageHeight, sizeIsLocked) {
35149
+ // Size
35150
+ if (imageWidth !== image.offsetWidth ||
35151
+ imageHeight !== image.offsetHeight) {
35152
+ var updatedWidth = imageWidth ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeToString */ .n)(imageWidth) : null;
35153
+ var updatedHeight = imageHeight
35154
+ ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeToString */ .n)(imageHeight)
35155
+ : null;
35156
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__/* .css */ .A)(image, {
35157
+ width: updatedWidth,
35158
+ height: updatedWidth && sizeIsLocked ? null : updatedHeight
35159
+ });
35160
+ (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);
35161
+ if (!(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'width') || sizeIsLocked) {
35162
+ updatedHeight = null;
35163
+ }
35164
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'height', updatedHeight);
34290
35165
  }
34291
- return editor.c.fromHTML("<div style=\"".concat(!opt.image.editMargins ? 'display:none' : '', "\" class=\"jodit-form__group\">\n\t\t\t<label>").concat(i18n('Margins'), "</label>\n\t\t\t<div class=\"jodit-grid jodit_vertical_middle\">\n\t\t\t\t<input class=\"jodit_col-lg-1-5 jodit-input\" data-ref=\"marginTop\" type=\"text\" placeholder=\"").concat(i18n('top'), "\"/>\n\t\t\t\t<a style=\"text-align: center;\" data-ref=\"lockMargin\" class=\"jodit-properties__lock jodit_col-lg-1-5\">").concat(gi('lock'), "</a>\n\t\t\t\t<input disabled=\"true\" class=\"jodit_col-lg-1-5 jodit-input\" data-ref=\"marginRight\" type=\"text\" placeholder=\"").concat(i18n('right'), "\"/>\n\t\t\t\t<input disabled=\"true\" class=\"jodit_col-lg-1-5 jodit-input\" data-ref=\"marginBottom\" type=\"text\" placeholder=\"").concat(i18n('bottom'), "\"/>\n\t\t\t\t<input disabled=\"true\" class=\"jodit_col-lg-1-5 jodit-input\" data-ref=\"marginLeft\" type=\"text\" placeholder=\"").concat(i18n('left'), "\"/>\n\t\t\t</div>\n\t\t</div>\n\t\t<div\n\t\t\tstyle=\"").concat(!opt.image.editAlign ? 'display:none' : '', "\"\n\t\t\tclass=\"jodit-form__group\"\n\t\t>\n\t\t\t<label>").concat(i18n('Align'), "</label>\n\t\t\t<select data-ref=\"align\" class=\"jodit-select\">\n\t\t\t\t<option value=\"\">").concat(i18n('--Not Set--'), "</option>\n\t\t\t\t<option value=\"left\">").concat(i18n('Left'), "</option>\n\t\t\t\t<option value=\"center\">").concat(i18n('Center'), "</option>\n\t\t\t\t<option value=\"right\">").concat(i18n('Right'), "</option>\n\t\t\t</select>\n\t\t</div>\n\t\t<div style=\"").concat(!opt.image.editStyle ? 'display:none' : '', "\" class=\"jodit-form__group\">\n\t\t\t<label>").concat(i18n('Styles'), "</label>\n\t\t\t<input data-ref=\"style\" type=\"text\" class=\"jodit-input\"/>\n\t\t</div>\n\t\t<div style=\"").concat(!opt.image.editClass ? 'display:none' : '', "\" class=\"jodit-form__group\">\n\t\t\t<label>").concat(i18n('Classes'), "</label>\n\t\t\t").concat(classInput.join(''), "\n\t\t</div>\n\t\t<div style=\"").concat(!opt.image.editId ? 'display:none' : '', "\" class=\"jodit-form__group\">\n\t\t\t<label>Id</label>\n\t\t\t<input data-ref=\"id\" type=\"text\" class=\"jodit-input\"/>\n\t\t</div>\n\t\t<div\n\t\t\tstyle=\"").concat(!opt.image.editBorderRadius ? 'display:none' : '', "\"\n\t\t\tclass=\"jodit-form__group\"\n\t\t>\n\t\t\t<label>").concat(i18n('Border radius'), "</label>\n\t\t\t\t<input data-ref=\"borderRadius\" type=\"number\" class=\"jodit-input\"/>\n\t\t</div>"));
34292
35166
  }
34293
35167
 
34294
35168
 
@@ -40967,7 +41841,8 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_3__/* .pluginSystem */ .fg.add('selec
40967
41841
  */
40968
41842
 
40969
41843
  jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.select = {
40970
- normalizeSelectionBeforeCutAndCopy: false
41844
+ normalizeSelectionBeforeCutAndCopy: false,
41845
+ normalizeTripleClick: true
40971
41846
  };
40972
41847
 
40973
41848
 
@@ -41047,7 +41922,7 @@ var select = /** @class */ (function (_super) {
41047
41922
  }
41048
41923
  };
41049
41924
  /**
41050
- * @event outsideClick(e) - when user clicked in the outside of editor
41925
+ * @event outsideClick(e) - when user clicked on the outside of editor
41051
41926
  */
41052
41927
  select.prototype.onOutsideClick = function (e) {
41053
41928
  var _this = this;
@@ -41060,7 +41935,7 @@ var select = /** @class */ (function (_super) {
41060
41935
  this.j.e.fire('outsideClick', e);
41061
41936
  }
41062
41937
  };
41063
- select.prototype.beforeCommandCut = function (command) {
41938
+ select.prototype.beforeCommandCut = function () {
41064
41939
  var s = this.j.s;
41065
41940
  if (!s.isCollapsed()) {
41066
41941
  var current = s.current();
@@ -41069,13 +41944,27 @@ var select = /** @class */ (function (_super) {
41069
41944
  }
41070
41945
  }
41071
41946
  };
41072
- select.prototype.beforeCommandSelectall = function (command) {
41947
+ select.prototype.beforeCommandSelectAll = function () {
41073
41948
  var s = this.j.s;
41074
41949
  s.focus();
41075
41950
  s.select(this.j.editor, true);
41076
41951
  s.expandSelection();
41077
41952
  return false;
41078
41953
  };
41954
+ /**
41955
+ * Normalize selection after triple click
41956
+ */
41957
+ select.prototype.onTripleClickNormalizeSelection = function (e) {
41958
+ if (e.detail !== 3 || !this.j.o.select.normalizeTripleClick) {
41959
+ return;
41960
+ }
41961
+ var s = this.j.s;
41962
+ var _a = s.range, startContainer = _a.startContainer, startOffset = _a.startOffset;
41963
+ if (startOffset === 0 && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isText(startContainer)) {
41964
+ s.select(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.closest(startContainer, jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isBlock, this.j.editor) ||
41965
+ startContainer, true);
41966
+ }
41967
+ };
41079
41968
  select.prototype.onCopyNormalizeSelectionBound = function (e) {
41080
41969
  var _a = this.j, s = _a.s, editor = _a.editor, o = _a.o;
41081
41970
  if (!o.select.normalizeSelectionBeforeCutAndCopy || s.isCollapsed()) {
@@ -41100,7 +41989,10 @@ var select = /** @class */ (function (_super) {
41100
41989
  ], select.prototype, "beforeCommandCut", null);
41101
41990
  (0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__decorate */ .Cg)([
41102
41991
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([':beforeCommandSelectall'])
41103
- ], select.prototype, "beforeCommandSelectall", null);
41992
+ ], select.prototype, "beforeCommandSelectAll", null);
41993
+ (0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__decorate */ .Cg)([
41994
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([':click'])
41995
+ ], select.prototype, "onTripleClickNormalizeSelection", null);
41104
41996
  (0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__decorate */ .Cg)([
41105
41997
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([':copy', ':cut'])
41106
41998
  ], select.prototype, "onCopyNormalizeSelectionBound", null);
@@ -48305,10 +49197,10 @@ var defineGlobalProperty = __webpack_require__(61486);
48305
49197
  var SHARED = '__core-js_shared__';
48306
49198
  var store = module.exports = globalThis[SHARED] || defineGlobalProperty(SHARED, {});
48307
49199
  (store.versions || (store.versions = [])).push({
48308
- version: '3.36.1',
49200
+ version: '3.37.0',
48309
49201
  mode: IS_PURE ? 'pure' : 'global',
48310
49202
  copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)',
48311
- license: 'https://github.com/zloirock/core-js/blob/v3.36.1/LICENSE',
49203
+ license: 'https://github.com/zloirock/core-js/blob/v3.37.0/LICENSE',
48312
49204
  source: 'https://github.com/zloirock/core-js'
48313
49205
  });
48314
49206