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/es2018/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
  */
@@ -1707,7 +1707,7 @@ __webpack_require__.r(__webpack_exports__);
1707
1707
  * Released under MIT see LICENSE.txt in the project root for license information.
1708
1708
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
1709
1709
  */
1710
- const APP_VERSION = "4.1.14";
1710
+ const APP_VERSION = "4.2.5";
1711
1711
  // prettier-ignore
1712
1712
  const ES = "es2018";
1713
1713
  const IS_ES_MODERN = true;
@@ -2110,8 +2110,9 @@ class Create {
2110
2110
 
2111
2111
  "use strict";
2112
2112
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2113
- /* harmony export */ O: function() { return /* binding */ cacheHTML; },
2114
- /* harmony export */ P: function() { return /* binding */ cache; }
2113
+ /* harmony export */ OK: function() { return /* binding */ cacheHTML; },
2114
+ /* harmony export */ PO: function() { return /* binding */ cached; },
2115
+ /* harmony export */ PP: function() { return /* binding */ cache; }
2115
2116
  /* harmony export */ });
2116
2117
  /* harmony import */ var jodit_core_component_statuses__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(64567);
2117
2118
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(55186);
@@ -2126,6 +2127,13 @@ class Create {
2126
2127
 
2127
2128
 
2128
2129
 
2130
+ function cached(object, property) {
2131
+ const descriptor = Object.getOwnPropertyDescriptor(object, property);
2132
+ if (!descriptor || (0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_2__/* .isFunction */ .Tn)(descriptor.get)) {
2133
+ return null;
2134
+ }
2135
+ return descriptor.value;
2136
+ }
2129
2137
  function cache(_, name, descriptor) {
2130
2138
  const getter = descriptor.get;
2131
2139
  if (!getter) {
@@ -2394,8 +2402,9 @@ function idle() {
2394
2402
  __webpack_require__.r(__webpack_exports__);
2395
2403
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2396
2404
  /* harmony export */ autobind: function() { return /* reexport safe */ _autobind_autobind__WEBPACK_IMPORTED_MODULE_0__.d; },
2397
- /* harmony export */ cache: function() { return /* reexport safe */ _cache_cache__WEBPACK_IMPORTED_MODULE_1__.P; },
2398
- /* harmony export */ cacheHTML: function() { return /* reexport safe */ _cache_cache__WEBPACK_IMPORTED_MODULE_1__.O; },
2405
+ /* harmony export */ cache: function() { return /* reexport safe */ _cache_cache__WEBPACK_IMPORTED_MODULE_1__.PP; },
2406
+ /* harmony export */ cacheHTML: function() { return /* reexport safe */ _cache_cache__WEBPACK_IMPORTED_MODULE_1__.OK; },
2407
+ /* harmony export */ cached: function() { return /* reexport safe */ _cache_cache__WEBPACK_IMPORTED_MODULE_1__.PO; },
2399
2408
  /* harmony export */ component: function() { return /* reexport safe */ _component_component__WEBPACK_IMPORTED_MODULE_2__.s; },
2400
2409
  /* harmony export */ debounce: function() { return /* reexport safe */ _debounce_debounce__WEBPACK_IMPORTED_MODULE_3__.s; },
2401
2410
  /* harmony export */ derive: function() { return /* reexport safe */ _derive_derive__WEBPACK_IMPORTED_MODULE_4__.C; },
@@ -6711,6 +6720,7 @@ const offset = (elm, jodit, doc, recurse = false) => {
6711
6720
  * Calculate screen element position
6712
6721
  */
6713
6722
  function position(elm, jodit, recurse = false) {
6723
+ var _a, _b;
6714
6724
  const rect = elm.getBoundingClientRect();
6715
6725
  let xPos = rect.left, yPos = rect.top;
6716
6726
  if ((0,jodit_core_helpers_checker_is_jodit_object__WEBPACK_IMPORTED_MODULE_0__/* .isJoditObject */ .y)(jodit) &&
@@ -6724,8 +6734,8 @@ function position(elm, jodit, recurse = false) {
6724
6734
  return {
6725
6735
  left: Math.round(xPos),
6726
6736
  top: Math.round(yPos),
6727
- width: Math.round(elm.offsetWidth),
6728
- height: Math.round(elm.offsetHeight)
6737
+ width: Math.round((_a = elm.offsetWidth) !== null && _a !== void 0 ? _a : rect.width),
6738
+ height: Math.round((_b = elm.offsetHeight) !== null && _b !== void 0 ? _b : rect.height)
6729
6739
  };
6730
6740
  }
6731
6741
 
@@ -8761,9 +8771,9 @@ const getXPathByElement = (element, root) => {
8761
8771
  * Find all `ref` or `data-ref` elements inside HTMLElement
8762
8772
  */
8763
8773
  const refs = (root) => {
8764
- // if (Component.isInstanceOf<UIElement>(root, UIElement)) {
8765
- // root = root.container;
8766
- // }
8774
+ if ('container' in root) {
8775
+ root = root.container;
8776
+ }
8767
8777
  return $$('[ref],[data-ref]', root).reduce((def, child) => {
8768
8778
  const key = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(child, '-ref');
8769
8779
  if (key && (0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_4__/* .isString */ .K)(key)) {
@@ -13306,7 +13316,8 @@ let UITooltip = UITooltip_1 = class UITooltip extends jodit_core_ui_element__WEB
13306
13316
  view.o.showTooltip &&
13307
13317
  !view.o.useNativeTooltip) {
13308
13318
  view.hookStatus(jodit_core_component__WEBPACK_IMPORTED_MODULE_0__/* .STATUSES */ .f.ready, () => {
13309
- (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_3__/* .getContainer */ .My)(view, UITooltip_1).appendChild(this.container);
13319
+ // TODO Move it inside __open method. Now it is here because testcase failed with capturing
13320
+ (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_3__/* .getContainer */ .My)(this.j, UITooltip_1).appendChild(this.container);
13310
13321
  view.e.on(view.container, 'mouseenter.tooltip', this.__onMouseEnter, {
13311
13322
  capture: true
13312
13323
  });
@@ -13321,6 +13332,7 @@ let UITooltip = UITooltip_1 = class UITooltip extends jodit_core_ui_element__WEB
13321
13332
  const view = this.j;
13322
13333
  view.e
13323
13334
  .on(view.ow, 'scroll.tooltip', this.__hide)
13335
+ .on(view.ow, 'joditCloseDialog', this.__hide)
13324
13336
  .on(view.container, 'mouseleave.tooltip', this.__hide)
13325
13337
  .on([
13326
13338
  'escape.tooltip',
@@ -13435,9 +13447,6 @@ let UITooltip = UITooltip_1 = class UITooltip extends jodit_core_ui_element__WEB
13435
13447
  (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
13436
13448
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.autobind
13437
13449
  ], UITooltip.prototype, "__onMouseEnter", null);
13438
- (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
13439
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.autobind
13440
- ], UITooltip.prototype, "__delayOpen", null);
13441
13450
  (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
13442
13451
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.autobind
13443
13452
  ], UITooltip.prototype, "__hide", null);
@@ -15341,7 +15350,7 @@ class Popup extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_7__/* .UI
15341
15350
  }
15342
15351
  let pe = this.parentElement;
15343
15352
  while (pe) {
15344
- if (checkView(j)) {
15353
+ if (checkView(pe.j)) {
15345
15354
  return;
15346
15355
  }
15347
15356
  if (pe.container.style.zIndex) {
@@ -16072,22 +16081,22 @@ View.version = jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.APP_VERSION;
16072
16081
  View.esNext = jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.IS_ES_NEXT; // from webpack.config.js
16073
16082
  View.esModern = jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.IS_ES_MODERN; // from webpack.config.js
16074
16083
  (0,tslib__WEBPACK_IMPORTED_MODULE_15__/* .__decorate */ .Cg)([
16075
- jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .P
16084
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .PP
16076
16085
  ], View.prototype, "buffer", null);
16077
16086
  (0,tslib__WEBPACK_IMPORTED_MODULE_15__/* .__decorate */ .Cg)([
16078
- jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .P
16087
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .PP
16079
16088
  ], View.prototype, "message", null);
16080
16089
  (0,tslib__WEBPACK_IMPORTED_MODULE_15__/* .__decorate */ .Cg)([
16081
- jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .P
16090
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .PP
16082
16091
  ], View.prototype, "storage", null);
16083
16092
  (0,tslib__WEBPACK_IMPORTED_MODULE_15__/* .__decorate */ .Cg)([
16084
- jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .P
16093
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .PP
16085
16094
  ], View.prototype, "c", null);
16086
16095
  (0,tslib__WEBPACK_IMPORTED_MODULE_15__/* .__decorate */ .Cg)([
16087
- jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .P
16096
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .PP
16088
16097
  ], View.prototype, "e", null);
16089
16098
  (0,tslib__WEBPACK_IMPORTED_MODULE_15__/* .__decorate */ .Cg)([
16090
- jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .P
16099
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .PP
16091
16100
  ], View.prototype, "progressbar", null);
16092
16101
  (0,tslib__WEBPACK_IMPORTED_MODULE_15__/* .__decorate */ .Cg)([
16093
16102
  (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_6__/* .hook */ .A)(jodit_core_component_statuses__WEBPACK_IMPORTED_MODULE_2__/* .STATUSES */ .f.beforeDestruct)
@@ -17837,6 +17846,7 @@ let Dialog = Dialog_1 = class Dialog extends jodit_core_view_view_with_toolbar__
17837
17846
  * Fired when dialog box is started moving
17838
17847
  */
17839
17848
  this.e.fire(this, 'startMove');
17849
+ this.e.fire('closeAllPopups');
17840
17850
  }
17841
17851
  }
17842
17852
  onMouseMove(e) {
@@ -19783,7 +19793,15 @@ let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__W
19783
19793
  this.__updateToolbarButtons();
19784
19794
  this._dialog.open(this.browser, header);
19785
19795
  this.e.fire('sort.filebrowser', this.state.sortBy);
19786
- (0,_fetch_load_tree__WEBPACK_IMPORTED_MODULE_10__/* .loadTree */ .r)(this).then(resolve, reject);
19796
+ (0,_fetch_load_tree__WEBPACK_IMPORTED_MODULE_10__/* .loadTree */ .r)(this)
19797
+ .then(resolve, reject)
19798
+ .finally(() => {
19799
+ var _a;
19800
+ if (this.isInDestruct) {
19801
+ return;
19802
+ }
19803
+ (_a = this === null || this === void 0 ? void 0 : this.e) === null || _a === void 0 ? void 0 : _a.fire('fileBrowserReady.filebrowser');
19804
+ });
19787
19805
  })
19788
19806
  .catch((e) => {
19789
19807
  if (!jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.IS_PROD) {
@@ -21656,11 +21674,12 @@ const act = (el, className = 'jodti-image-editor_active') => el ? className : ''
21656
21674
  const form = (editor, o) => {
21657
21675
  const i = editor.i18n.bind(editor);
21658
21676
  const switcher = (label, ref, active = true) => `<div class="jodit-form__group">
21659
- <label>${i(label)}</label>
21660
-
21661
- <label class='jodit-switcher'>
21662
- <input ${act(active, 'checked')} data-ref="${ref}" type="checkbox"/>
21663
- <span class="jodit-switcher__slider"></span>
21677
+ <label class="jodit-switcher-wrapper">
21678
+ <span class='jodit-switcher'>
21679
+ <input ${act(active, 'checked')} data-ref="${ref}" type="checkbox"/>
21680
+ <span class="jodit-switcher__slider"></span>
21681
+ </span>
21682
+ <span>${i(label)}</span>
21664
21683
  </label>
21665
21684
  </div>`;
21666
21685
  return editor.create.fromHTML(`<form class="${jie} jodit-properties">
@@ -24741,11 +24760,13 @@ const TabsWidget = (jodit, tabs, state) => {
24741
24760
  return;
24742
24761
  }
24743
24762
  buttonList.forEach(b => {
24763
+ b.state.variant = 'initial';
24744
24764
  b.state.activated = false;
24745
24765
  });
24746
24766
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.$$)('.jodit-tab', tabBox).forEach(a => {
24747
24767
  a.classList.remove('jodit-tab_active');
24748
24768
  });
24769
+ nameToTab[tab].button.state.variant = 'outline';
24749
24770
  nameToTab[tab].button.state.activated = true;
24750
24771
  nameToTab[tab].tab.classList.add('jodit-tab_active');
24751
24772
  };
@@ -24774,7 +24795,7 @@ const TabsWidget = (jodit, tabs, state) => {
24774
24795
  content.call(jodit);
24775
24796
  }
24776
24797
  if (state) {
24777
- state.__activeTab = name;
24798
+ state.activeTab = name;
24778
24799
  }
24779
24800
  return false;
24780
24801
  });
@@ -24790,20 +24811,20 @@ const TabsWidget = (jodit, tabs, state) => {
24790
24811
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.$$)('a', buttons).forEach(a => {
24791
24812
  a.style.width = (100 / tabCount).toFixed(10) + '%';
24792
24813
  });
24793
- const tab = !state || !state.__activeTab || !nameToTab[state.__activeTab]
24814
+ const tab = !state || !state.activeTab || !nameToTab[state.activeTab]
24794
24815
  ? firstTab
24795
- : state.__activeTab;
24816
+ : state.activeTab;
24796
24817
  setActive(tab);
24797
24818
  if (state) {
24798
- let __activeTab = state.__activeTab;
24799
- Object.defineProperty(state, '__activeTab', {
24819
+ let activeTab = state.activeTab;
24820
+ Object.defineProperty(state, 'activeTab', {
24800
24821
  configurable: true,
24801
24822
  enumerable: false,
24802
24823
  get() {
24803
- return __activeTab;
24824
+ return activeTab;
24804
24825
  },
24805
24826
  set(value) {
24806
- __activeTab = value;
24827
+ activeTab = value;
24807
24828
  setActive(value);
24808
24829
  }
24809
24830
  });
@@ -25218,7 +25239,7 @@ class aiAssistant extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_3__/
25218
25239
  (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .extendLang */ .JW)(_langs__WEBPACK_IMPORTED_MODULE_6__);
25219
25240
  }
25220
25241
  /** @override */
25221
- afterInit(jodit) { }
25242
+ afterInit() { }
25222
25243
  onGenerateAiAssistantForm(prompt) {
25223
25244
  this.__dialog.open(this.__container, 'AI Assistant');
25224
25245
  this.__container.setPrompt(prompt);
@@ -25251,15 +25272,16 @@ class aiAssistant extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_3__/
25251
25272
  }
25252
25273
  /** @override */
25253
25274
  beforeDestruct(_) {
25254
- this.__container.destruct();
25255
- this.__dialog.destruct();
25275
+ var _a, _b;
25276
+ (_a = (0,jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_0__/* .cached */ .PO)(this, '__container')) === null || _a === void 0 ? void 0 : _a.destruct();
25277
+ (_b = (0,jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_0__/* .cached */ .PO)(this, '__dialog')) === null || _b === void 0 ? void 0 : _b.destruct();
25256
25278
  }
25257
25279
  }
25258
25280
  (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
25259
- jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_0__/* .cache */ .P
25281
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_0__/* .cache */ .PP
25260
25282
  ], aiAssistant.prototype, "__dialog", null);
25261
25283
  (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
25262
- jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_0__/* .cache */ .P
25284
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_0__/* .cache */ .PP
25263
25285
  ], aiAssistant.prototype, "__container", null);
25264
25286
  (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
25265
25287
  (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)(':generateAiAssistantForm.ai-assistant')
@@ -31098,9 +31120,6 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .pluginSystem */ .fg.add('image
31098
31120
  * Released under MIT see LICENSE.txt in the project root for license information.
31099
31121
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31100
31122
  */
31101
- /**
31102
- * @module plugins/image-properties
31103
- */
31104
31123
 
31105
31124
  jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.image = {
31106
31125
  dialogWidth: 600,
@@ -31130,18 +31149,19 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.image = {
31130
31149
 
31131
31150
  "use strict";
31132
31151
  /* unused harmony export imageProperties */
31133
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(31635);
31152
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(31635);
31134
31153
  /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22664);
31135
- /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56298);
31136
- /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65147);
31137
- /* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(35265);
31138
- /* harmony import */ var jodit_modules__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(37435);
31139
- /* harmony import */ var jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(53804);
31140
- /* harmony import */ var jodit_modules_widget__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(16116);
31141
- /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(24654);
31142
- /* harmony import */ var _templates_form__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(22254);
31143
- /* harmony import */ var _templates_main_tab__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(75263);
31144
- /* harmony import */ var _templates_position_tab__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(57837);
31154
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(55186);
31155
+ /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(56298);
31156
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(65147);
31157
+ /* harmony import */ var jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29866);
31158
+ /* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(35265);
31159
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(24654);
31160
+ /* harmony import */ var _ui_ui_image_form__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(31970);
31161
+ /* harmony import */ var _utils_open_image_editor__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(80778);
31162
+ /* harmony import */ var _utils_open_image_popup__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(33733);
31163
+ /* harmony import */ var _readers__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(5549);
31164
+ /* harmony import */ var _writers__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(30393);
31145
31165
  /*!
31146
31166
  * Jodit Editor (https://xdsoft.net/jodit/)
31147
31167
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -31173,55 +31193,93 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.image = {
31173
31193
  * });
31174
31194
  * ```
31175
31195
  */
31176
- const normalSizeToString = (value) => {
31177
- value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.trim)(value);
31178
- return /^[0-9]+$/.test(value) ? value + 'px' : value;
31179
- };
31180
- const normalSizeFromString = (value) => {
31181
- return /^[-+]?[0-9.]+px$/.test(value.toString())
31182
- ? parseFloat(value.toString())
31183
- : value;
31184
- };
31185
31196
  /**
31186
31197
  * Show dialog with image's options
31187
31198
  */
31188
- class imageProperties extends jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin {
31199
+ class imageProperties extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_4__/* .Plugin */ .k {
31189
31200
  constructor() {
31190
31201
  super(...arguments);
31191
31202
  this.state = {
31192
31203
  image: new Image(),
31204
+ sourceImage: new Image(),
31193
31205
  get ratio() {
31194
- return this.image.naturalWidth / this.image.naturalHeight || 1;
31206
+ const { naturalWidth, naturalHeight } = this.image;
31207
+ return naturalWidth / naturalHeight || 1;
31195
31208
  },
31196
31209
  sizeIsLocked: true,
31197
- marginIsLocked: true
31210
+ marginIsLocked: true,
31211
+ values: {
31212
+ style: '',
31213
+ imageSrc: '',
31214
+ borderRadius: 0,
31215
+ imageTitle: '',
31216
+ imageAlt: '',
31217
+ imageLink: '',
31218
+ imageLinkOpenInNewTab: false,
31219
+ imageWidth: 0,
31220
+ imageHeight: 0,
31221
+ marginTop: 0,
31222
+ marginRight: 0,
31223
+ marginBottom: 0,
31224
+ marginLeft: 0,
31225
+ classes: '',
31226
+ id: '',
31227
+ align: ''
31228
+ }
31198
31229
  };
31199
31230
  this.activeTabState = {
31200
- __activeTab: 'Image'
31231
+ activeTab: 'Image'
31201
31232
  };
31202
31233
  }
31203
- onChangeMarginIsLocked() {
31204
- if (!this.form) {
31205
- return;
31206
- }
31207
- const { marginRight, marginBottom, marginLeft, lockMargin } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
31208
- [marginRight, marginBottom, marginLeft].forEach(elm => {
31209
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(elm, 'disabled', this.state.marginIsLocked || null);
31234
+ get form() {
31235
+ return new _ui_ui_image_form__WEBPACK_IMPORTED_MODULE_7__/* .UIImagePropertiesForm */ .l(this.j, this.state, this.activeTabState, {
31236
+ openImageEditor: () => (0,_utils_open_image_editor__WEBPACK_IMPORTED_MODULE_8__/* .openImageEditorDialog */ .v)(this.j, this.state),
31237
+ openImagePopup: target => (0,_utils_open_image_popup__WEBPACK_IMPORTED_MODULE_9__/* .openImagePopup */ .q)(this.j, this.dialog, this.state, target)
31210
31238
  });
31211
- lockMargin.innerHTML = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Icon.get(this.state.marginIsLocked ? 'lock' : 'unlock');
31212
31239
  }
31213
- onChangeSizeIsLocked() {
31214
- if (!this.form) {
31215
- return;
31216
- }
31217
- const { lockSize, imageWidth } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
31218
- lockSize.innerHTML = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Icon.get(this.state.sizeIsLocked ? 'lock' : 'unlock');
31219
- lockSize.classList.remove('jodit-properties__lock');
31220
- lockSize.classList.remove('jodit-properties__unlock');
31221
- lockSize.classList.add(this.state.sizeIsLocked
31222
- ? 'jodit-properties__lock'
31223
- : 'jodit-properties__unlock');
31224
- this.j.e.fire(imageWidth, 'change');
31240
+ /**
31241
+ * Dialog for form
31242
+ */
31243
+ get dialog() {
31244
+ const { j } = this;
31245
+ const dialog = j.dlg({
31246
+ minWidth: Math.min(400, screen.width),
31247
+ minHeight: 590,
31248
+ buttons: ['fullsize', 'dialog.close']
31249
+ });
31250
+ const buttons = this.__buttons;
31251
+ buttons.check.onAction(() => {
31252
+ (0,_writers__WEBPACK_IMPORTED_MODULE_11__/* .applyValuesToImage */ .j)(j, this.state, this.state.sourceImage);
31253
+ j.synchronizeValues();
31254
+ dialog.close();
31255
+ });
31256
+ buttons.remove.onAction(() => {
31257
+ j.s.removeNode(this.state.sourceImage);
31258
+ dialog.close();
31259
+ });
31260
+ buttons.cancel.onAction(() => {
31261
+ dialog.close();
31262
+ });
31263
+ dialog.setHeader(j.i18n('Image properties'));
31264
+ dialog.setContent(this.form);
31265
+ dialog.setFooter([[buttons.cancel, buttons.remove], buttons.check]);
31266
+ j.e.on(dialog, 'afterClose', () => {
31267
+ if (this.state.image.parentNode &&
31268
+ j.o.image.selectImageAfterClose) {
31269
+ j.s.select(this.state.sourceImage);
31270
+ }
31271
+ });
31272
+ dialog.setSize(j.o.image.dialogWidth);
31273
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.markOwner)(j, dialog.container);
31274
+ return dialog;
31275
+ }
31276
+ get __buttons() {
31277
+ const { j } = this;
31278
+ return {
31279
+ check: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__/* .Button */ .$n)(j, 'ok', 'Apply', 'primary'),
31280
+ remove: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__/* .Button */ .$n)(j, 'bin', 'Delete'),
31281
+ cancel: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__/* .Button */ .$n)(j, 'cancel', 'Cancel')
31282
+ };
31225
31283
  }
31226
31284
  /**
31227
31285
  * Open dialog editing image properties
@@ -31238,358 +31296,24 @@ class imageProperties extends jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin
31238
31296
  * ```
31239
31297
  */
31240
31298
  open() {
31241
- this.makeForm();
31242
- this.activeTabState.__activeTab = 'Image';
31243
- this.j.e.fire('hidePopup');
31244
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.markOwner)(this.j, this.dialog.container);
31245
- this.state.marginIsLocked = true;
31246
- this.state.sizeIsLocked = true;
31247
- this.onChangeMarginIsLocked();
31248
- this.onChangeSizeIsLocked();
31249
- this.updateValues();
31299
+ this.activeTabState.activeTab = 'Image';
31300
+ this.__lock();
31250
31301
  this.dialog.open().setModal(true).setPosition();
31302
+ this.async
31303
+ .promise((resolve, reject) => (0,_readers__WEBPACK_IMPORTED_MODULE_10__/* .readValuesFromImage */ .U)(this.j, this.state).then(resolve, reject))
31304
+ .catch((e) => this.dialog.message.error(e.message))
31305
+ .finally(() => this.__unlock());
31251
31306
  return false;
31252
31307
  }
31253
- /**
31254
- * Create form for edit image properties
31255
- */
31256
- makeForm() {
31257
- if (this.dialog) {
31258
- return;
31259
- }
31260
- this.dialog = this.j.dlg({
31261
- minWidth: Math.min(400, screen.width),
31262
- minHeight: 590,
31263
- buttons: ['fullsize', 'dialog.close']
31264
- });
31265
- const editor = this.j, opt = editor.o, i18n = editor.i18n.bind(editor), buttons = {
31266
- check: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_3__/* .Button */ .$n)(editor, 'ok', 'Apply', 'primary'),
31267
- remove: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_3__/* .Button */ .$n)(editor, 'bin', 'Delete')
31268
- };
31269
- editor.e.on(this.dialog, 'afterClose', () => {
31270
- if (this.state.image.parentNode &&
31271
- opt.image.selectImageAfterClose) {
31272
- editor.s.select(this.state.image);
31273
- }
31274
- });
31275
- buttons.remove.onAction(() => {
31276
- editor.s.removeNode(this.state.image);
31277
- this.dialog.close();
31278
- });
31279
- const { dialog } = this;
31280
- dialog.setHeader(i18n('Image properties'));
31281
- const mainForm = (0,_templates_form__WEBPACK_IMPORTED_MODULE_8__/* .form */ .Z)(editor);
31282
- this.form = mainForm;
31283
- dialog.setContent(mainForm);
31284
- const { tabsBox } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
31285
- if (tabsBox) {
31286
- tabsBox.appendChild((0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_6__/* .TabsWidget */ .Zg)(editor, [
31287
- { name: 'Image', content: (0,_templates_main_tab__WEBPACK_IMPORTED_MODULE_9__/* .mainTab */ .J)(editor) },
31288
- { name: 'Advanced', content: (0,_templates_position_tab__WEBPACK_IMPORTED_MODULE_10__/* .positionTab */ .b)(editor) }
31289
- ], this.activeTabState));
31290
- }
31291
- buttons.check.onAction(this.onApply);
31292
- const { changeImage, editImage } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
31293
- editor.e.on(changeImage, 'click', this.openImagePopup);
31294
- if (opt.image.useImageEditor) {
31295
- editor.e.on(editImage, 'click', this.openImageEditor);
31296
- }
31297
- const { lockSize, lockMargin, imageWidth, imageHeight } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(mainForm);
31298
- if (lockSize) {
31299
- editor.e.on(lockSize, 'click', () => {
31300
- this.state.sizeIsLocked = !this.state.sizeIsLocked;
31301
- });
31302
- }
31303
- editor.e.on(lockMargin, 'click', (e) => {
31304
- this.state.marginIsLocked = !this.state.marginIsLocked;
31305
- e.preventDefault();
31306
- });
31307
- const changeSizes = (event) => {
31308
- if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isNumeric)(imageWidth.value) || !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isNumeric)(imageHeight.value)) {
31309
- return;
31310
- }
31311
- const w = parseFloat(imageWidth.value), h = parseFloat(imageHeight.value);
31312
- if (event.target === imageWidth) {
31313
- imageHeight.value = Math.round(w / this.state.ratio).toString();
31314
- }
31315
- else {
31316
- imageWidth.value = Math.round(h * this.state.ratio).toString();
31317
- }
31318
- };
31319
- editor.e.on([imageWidth, imageHeight], 'change keydown mousedown paste', (event) => {
31320
- if (!this.state.sizeIsLocked) {
31321
- return;
31322
- }
31323
- editor.async.setTimeout(changeSizes.bind(this, event), {
31324
- timeout: editor.defaultTimeout,
31325
- label: 'image-properties-changeSize'
31326
- });
31327
- });
31328
- dialog.setFooter([buttons.remove, buttons.check]);
31329
- dialog.setSize(this.j.o.image.dialogWidth);
31330
- }
31331
- /**
31332
- * Set input values from image
31333
- */
31334
- updateValues() {
31335
- const opt = this.j.o;
31336
- const { image } = this.state;
31337
- const { marginTop, marginRight, marginBottom, marginLeft, lockMargin, imageSrc, id, classes, align, style, imageTitle, imageAlt, borderRadius, imageLink, imageWidth, imageHeight, imageLinkOpenInNewTab, imageViewSrc, lockSize } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
31338
- const updateLock = () => {
31339
- lockMargin.checked = this.state.marginIsLocked;
31340
- lockSize.checked = this.state.sizeIsLocked;
31341
- }, updateAlign = () => {
31342
- if (image.style.cssFloat &&
31343
- ['left', 'right'].indexOf(image.style.cssFloat.toLowerCase()) !== -1) {
31344
- align.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'float');
31345
- }
31346
- else {
31347
- if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'display') === 'block' &&
31348
- image.style.marginLeft === 'auto' &&
31349
- image.style.marginRight === 'auto') {
31350
- align.value = 'center';
31351
- }
31352
- }
31353
- }, updateBorderRadius = () => {
31354
- borderRadius.value = (parseInt(image.style.borderRadius || '0', 10) || '0').toString();
31355
- }, updateId = () => {
31356
- id.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'id') || '';
31357
- }, updateStyle = () => {
31358
- style.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'style') || '';
31359
- }, updateClasses = () => {
31360
- classes.value = ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'class') || '').replace(/jodit_focused_image[\s]*/, '');
31361
- }, updateMargins = () => {
31362
- if (!opt.image.editMargins) {
31363
- return;
31364
- }
31365
- let equal = true, wasEmptyField = false;
31366
- [marginTop, marginRight, marginBottom, marginLeft].forEach(elm => {
31367
- const id = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(elm, 'data-ref') || '';
31368
- let value = image.style.getPropertyValue((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.kebabCase)(id));
31369
- if (!value) {
31370
- wasEmptyField = true;
31371
- elm.value = '';
31372
- return;
31373
- }
31374
- if (/^[0-9]+(px)?$/.test(value)) {
31375
- value = parseInt(value, 10);
31376
- }
31377
- elm.value = value.toString() || '';
31378
- if ((wasEmptyField && elm.value) ||
31379
- (equal &&
31380
- id !== 'marginTop' &&
31381
- elm.value !== marginTop.value)) {
31382
- equal = false;
31383
- }
31384
- });
31385
- this.state.marginIsLocked = equal;
31386
- }, updateSizes = () => {
31387
- const width = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'width') ||
31388
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'width', true) ||
31389
- false, height = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'height') ||
31390
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'height', true) ||
31391
- false;
31392
- imageWidth.value =
31393
- width !== false
31394
- ? normalSizeFromString(width).toString()
31395
- : image.offsetWidth.toString();
31396
- imageHeight.value =
31397
- height !== false
31398
- ? normalSizeFromString(height).toString()
31399
- : image.offsetHeight.toString();
31400
- this.state.sizeIsLocked = (() => {
31401
- if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isNumeric)(imageWidth.value) ||
31402
- !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isNumeric)(imageHeight.value)) {
31403
- return false;
31404
- }
31405
- const w = parseFloat(imageWidth.value), h = parseFloat(imageHeight.value);
31406
- return Math.abs(w - h * this.state.ratio) < 1;
31407
- })();
31408
- }, updateText = () => {
31409
- imageTitle.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'title') || '';
31410
- imageAlt.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'alt') || '';
31411
- const a = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(image, 'a', this.j.editor);
31412
- if (a) {
31413
- imageLink.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(a, 'href') || '';
31414
- imageLinkOpenInNewTab.checked =
31415
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(a, 'target') === '_blank';
31416
- }
31417
- else {
31418
- imageLink.value = '';
31419
- imageLinkOpenInNewTab.checked = false;
31420
- }
31421
- }, updateSrc = () => {
31422
- imageSrc.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'src') || '';
31423
- if (imageViewSrc) {
31424
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(imageViewSrc, 'src', (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'src') || '');
31425
- }
31426
- };
31427
- updateLock();
31428
- updateSrc();
31429
- updateText();
31430
- updateSizes();
31431
- updateMargins();
31432
- updateClasses();
31433
- updateId();
31434
- updateBorderRadius();
31435
- updateAlign();
31436
- updateStyle();
31437
- }
31438
- /**
31439
- * Apply form's values to image
31440
- */
31441
- onApply() {
31442
- const { style, imageSrc, borderRadius, imageTitle, imageAlt, imageLink, imageWidth, imageHeight, marginTop, marginRight, marginBottom, marginLeft, imageLinkOpenInNewTab, align, classes, id } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
31443
- const opt = this.j.o;
31444
- const { image } = this.state;
31445
- // styles
31446
- if (opt.image.editStyle) {
31447
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'style', style.value || null);
31448
- }
31449
- // Src
31450
- if (imageSrc.value) {
31451
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'src', imageSrc.value);
31452
- }
31453
- else {
31454
- jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove(image);
31455
- this.dialog.close();
31456
- return;
31457
- }
31458
- // Border radius
31459
- if (borderRadius.value !== '0' && /^[0-9]+$/.test(borderRadius.value)) {
31460
- image.style.borderRadius = borderRadius.value + 'px';
31461
- }
31462
- else {
31463
- image.style.borderRadius = '';
31464
- }
31465
- // Title
31466
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'title', imageTitle.value || null);
31467
- // Alt
31468
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'alt', imageAlt.value || null);
31469
- // Link
31470
- let link = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(image, 'a', this.j.editor);
31471
- if (imageLink.value) {
31472
- if (!link) {
31473
- link = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.wrap(image, 'a', this.j.createInside);
31474
- }
31475
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(link, 'href', imageLink.value);
31476
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(link, 'target', imageLinkOpenInNewTab.checked ? '_blank' : null);
31477
- }
31478
- else {
31479
- if (link && link.parentNode) {
31480
- link.parentNode.replaceChild(image, link);
31481
- }
31482
- }
31483
- // Size
31484
- if (imageWidth.value !== image.offsetWidth.toString() ||
31485
- imageHeight.value !== image.offsetHeight.toString()) {
31486
- const updatedtWidth = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.trim)(imageWidth.value)
31487
- ? normalSizeToString(imageWidth.value)
31488
- : null;
31489
- const updatedHeight = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.trim)(imageHeight.value)
31490
- ? normalSizeToString(imageHeight.value)
31491
- : null;
31492
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, {
31493
- width: updatedtWidth,
31494
- height: updatedHeight
31495
- });
31496
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'width', (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'width') ? updatedtWidth : null);
31497
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'height', (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'height') ? updatedHeight : null);
31498
- }
31499
- const margins = [marginTop, marginRight, marginBottom, marginLeft];
31500
- if (opt.image.editMargins) {
31501
- if (!this.state.marginIsLocked) {
31502
- margins.forEach((margin) => {
31503
- const side = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(margin, 'data-ref') || '';
31504
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, side, normalSizeToString(margin.value));
31505
- });
31506
- }
31507
- else {
31508
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'margin', normalSizeToString(marginTop.value));
31509
- }
31510
- }
31511
- if (opt.image.editClass) {
31512
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'class', classes.value || null);
31513
- }
31514
- if (opt.image.editId) {
31515
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'id', id.value || null);
31516
- }
31517
- if (opt.image.editAlign) {
31518
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.hAlignElement)(image, align.value);
31519
- }
31520
- this.j.synchronizeValues();
31521
- this.dialog.close();
31522
- }
31523
- /**
31524
- * Open image editor dialog
31525
- */
31526
- openImageEditor() {
31527
- const url = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src') || '', a = this.j.c.element('a'), loadExternal = () => {
31528
- if (a.host !== location.host) {
31529
- this.j.confirm('You can only edit your own images. Download this image on the host?', yes => {
31530
- if (yes && this.j.uploader) {
31531
- this.j.uploader.uploadRemoteImage(a.href.toString(), resp => {
31532
- this.j.alert('The image has been successfully uploaded to the host!', () => {
31533
- if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isString)(resp.newfilename)) {
31534
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src', resp.baseurl +
31535
- resp.newfilename);
31536
- this.updateValues();
31537
- }
31538
- });
31539
- }, error => {
31540
- this.j.alert('There was an error loading %s', error.message);
31541
- });
31542
- }
31543
- });
31544
- return;
31545
- }
31546
- };
31547
- a.href = url;
31548
- this.j.filebrowser.dataProvider
31549
- .getPathByUrl(a.href.toString())
31550
- .then(resp => {
31551
- jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_5__/* .openImageEditor */ .B.call(this.j.filebrowser, a.href, resp.name, resp.path, resp.source, () => {
31552
- const timestamp = new Date().getTime();
31553
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src', url +
31554
- (url.indexOf('?') !== -1 ? '' : '?') +
31555
- '&_tmp=' +
31556
- timestamp.toString());
31557
- this.updateValues();
31558
- }, error => {
31559
- this.j.alert(error.message);
31560
- });
31561
- })
31562
- .catch(error => {
31563
- this.j.alert(error.message, loadExternal);
31564
- });
31308
+ __lock() {
31309
+ this.dialog.lock();
31310
+ this.form.setMod('lock', true);
31311
+ Object.values(this.__buttons).forEach(b => (b.state.disabled = true));
31565
31312
  }
31566
- /**
31567
- * Open popup with filebrowser/uploader buttons for image
31568
- */
31569
- openImagePopup(event) {
31570
- const popup = new jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Popup(this.j), { changeImage } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
31571
- popup.setZIndex(this.dialog.getZIndex() + 1);
31572
- popup
31573
- .setContent((0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_6__/* .FileSelectorWidget */ .kG)(this.j, {
31574
- upload: (data) => {
31575
- if (data.files && data.files.length) {
31576
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src', data.baseurl + data.files[0]);
31577
- }
31578
- this.updateValues();
31579
- popup.close();
31580
- },
31581
- filebrowser: (data) => {
31582
- if (data &&
31583
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isArray)(data.files) &&
31584
- data.files.length) {
31585
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src', data.files[0]);
31586
- popup.close();
31587
- this.updateValues();
31588
- }
31589
- }
31590
- }, this.state.image, popup.close))
31591
- .open(() => (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.position)(changeImage));
31592
- event.stopPropagation();
31313
+ __unlock() {
31314
+ this.dialog.unlock();
31315
+ this.form.setMod('lock', false);
31316
+ Object.values(this.__buttons).forEach(b => (b.state.disabled = false));
31593
31317
  }
31594
31318
  /** @override **/
31595
31319
  afterInit(editor) {
@@ -31600,7 +31324,7 @@ class imageProperties extends jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin
31600
31324
  .off(editor.editor, '.imageproperties')
31601
31325
  .on(editor.editor, 'dblclick.imageproperties', (e) => {
31602
31326
  const image = e.target;
31603
- if (!jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(image, 'img')) {
31327
+ if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isTag(image, 'img')) {
31604
31328
  return;
31605
31329
  }
31606
31330
  if (editor.o.image.openOnDblClick) {
@@ -31608,7 +31332,8 @@ class imageProperties extends jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin
31608
31332
  false) {
31609
31333
  return;
31610
31334
  }
31611
- self.state.image = image;
31335
+ self.state.sourceImage = image;
31336
+ self.state.image = image.cloneNode(true);
31612
31337
  if (!editor.o.readonly) {
31613
31338
  e.stopImmediatePropagation();
31614
31339
  e.preventDefault();
@@ -31622,206 +31347,1253 @@ class imageProperties extends jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin
31622
31347
  });
31623
31348
  })
31624
31349
  .on('openImageProperties.imageproperties', (image) => {
31625
- this.state.image = image;
31350
+ self.state.sourceImage = image;
31351
+ this.state.image = image.cloneNode(true);
31626
31352
  this.open();
31627
31353
  });
31628
31354
  }
31355
+ async onStateValuesImageSrcChange() {
31356
+ const { image, values } = this.state;
31357
+ if (!image.src) {
31358
+ return;
31359
+ }
31360
+ try {
31361
+ this.__lock();
31362
+ await image.decode();
31363
+ if (this.state.sizeIsLocked && (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.isNumeric)(values.imageWidth)) {
31364
+ const w = parseFloat(values.imageWidth.toString());
31365
+ values.imageHeight = Math.round(w / this.state.ratio);
31366
+ }
31367
+ this.j.e.fire('updateImageProperties.imageproperties', image);
31368
+ }
31369
+ catch (e) {
31370
+ this.j.alert(e.message);
31371
+ }
31372
+ finally {
31373
+ this.__unlock();
31374
+ }
31375
+ }
31629
31376
  /** @override */
31630
31377
  beforeDestruct(editor) {
31631
- this.dialog && this.dialog.destruct();
31378
+ var _a, _b, _c;
31379
+ Object.values((_a = (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cached)(this, '__buttons')) !== null && _a !== void 0 ? _a : {}).forEach(b => b.destruct());
31380
+ (_b = (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cached)(this, 'dialog')) === null || _b === void 0 ? void 0 : _b.destruct();
31381
+ (_c = (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cached)(this, 'form')) === null || _c === void 0 ? void 0 : _c.destruct();
31632
31382
  editor.e.off(editor.editor, '.imageproperties').off('.imageproperties');
31633
31383
  }
31634
31384
  }
31635
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
31636
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.marginIsLocked')
31637
- ], imageProperties.prototype, "onChangeMarginIsLocked", null);
31638
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
31639
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.sizeIsLocked')
31640
- ], imageProperties.prototype, "onChangeSizeIsLocked", null);
31641
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
31642
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.autobind
31643
- ], imageProperties.prototype, "onApply", null);
31644
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
31645
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.autobind
31646
- ], imageProperties.prototype, "openImageEditor", null);
31647
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
31648
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.autobind
31649
- ], imageProperties.prototype, "openImagePopup", null);
31650
- jodit_core_global__WEBPACK_IMPORTED_MODULE_1__/* .pluginSystem */ .fg.add('imageProperties', imageProperties);
31385
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
31386
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cache
31387
+ ], imageProperties.prototype, "form", null);
31388
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
31389
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cache
31390
+ ], imageProperties.prototype, "dialog", null);
31391
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
31392
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cache
31393
+ ], imageProperties.prototype, "__buttons", null);
31394
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
31395
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.image')
31396
+ ], imageProperties.prototype, "onStateValuesImageSrcChange", null);
31397
+ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .pluginSystem */ .fg.add('imageProperties', imageProperties);
31651
31398
 
31652
31399
 
31653
31400
  /***/ }),
31654
31401
 
31655
- /***/ 22254:
31402
+ /***/ 74260:
31656
31403
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31657
31404
 
31658
31405
  "use strict";
31659
31406
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31660
- /* harmony export */ Z: function() { return /* binding */ form; }
31407
+ /* harmony export */ g: function() { return /* binding */ readAlign; }
31661
31408
  /* harmony export */ });
31662
- /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(931);
31409
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(38322);
31410
+ /*!
31411
+ * Jodit Editor (https://xdsoft.net/jodit/)
31412
+ * Released under MIT see LICENSE.txt in the project root for license information.
31413
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31414
+ */
31415
+
31416
+ /** @private */
31417
+ function readAlign(image, values) {
31418
+ // Align
31419
+ if (image.style.cssFloat &&
31420
+ ['left', 'right'].indexOf(image.style.cssFloat.toLowerCase()) !== -1) {
31421
+ values.align = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_0__/* .css */ .A)(image, 'float');
31422
+ }
31423
+ else {
31424
+ if ((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_0__/* .css */ .A)(image, 'display') === 'block' &&
31425
+ image.style.marginLeft === 'auto' &&
31426
+ image.style.marginRight === 'auto') {
31427
+ values.align = 'center';
31428
+ }
31429
+ else {
31430
+ values.align = '';
31431
+ }
31432
+ }
31433
+ }
31434
+
31435
+
31436
+ /***/ }),
31437
+
31438
+ /***/ 5549:
31439
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31440
+
31441
+ "use strict";
31442
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31443
+ /* harmony export */ U: function() { return /* binding */ readValuesFromImage; }
31444
+ /* harmony export */ });
31445
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26150);
31446
+ /* harmony import */ var _align__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(74260);
31447
+ /* harmony import */ var _link__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(33201);
31448
+ /* harmony import */ var _margin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(85079);
31449
+ /* harmony import */ var _size__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(17880);
31450
+ /*!
31451
+ * Jodit Editor (https://xdsoft.net/jodit/)
31452
+ * Released under MIT see LICENSE.txt in the project root for license information.
31453
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31454
+ */
31455
+
31456
+
31457
+
31458
+
31459
+
31460
+ /**
31461
+ * Read values from image and set it to state
31462
+ * @private
31463
+ */
31464
+ async function readValuesFromImage(j, state) {
31465
+ const { sourceImage: image, values } = state;
31466
+ (0,_align__WEBPACK_IMPORTED_MODULE_3__/* .readAlign */ .g)(image, values);
31467
+ // Border radius
31468
+ values.borderRadius = parseInt(image.style.borderRadius || '0', 10) || 0;
31469
+ // Id
31470
+ values.id = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'id') || '';
31471
+ // Title
31472
+ values.imageTitle = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'title') || '';
31473
+ // Alt
31474
+ values.imageAlt = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'alt') || '';
31475
+ // Style
31476
+ values.style = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'style') || '';
31477
+ // Classes
31478
+ values.classes = ((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'class') || '').replace(/jodit_focused_image[\s]*/, '');
31479
+ // Margins
31480
+ (0,_margin__WEBPACK_IMPORTED_MODULE_4__/* .readMargins */ .E)(image, values, state);
31481
+ // Link
31482
+ (0,_link__WEBPACK_IMPORTED_MODULE_1__/* .readLink */ .X)(state, j, values);
31483
+ // Src
31484
+ values.imageSrc = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'src') || '';
31485
+ // Image size
31486
+ return (0,_size__WEBPACK_IMPORTED_MODULE_2__/* .readSizes */ .P)(image, values, state);
31487
+ }
31488
+
31489
+
31490
+ /***/ }),
31491
+
31492
+ /***/ 33201:
31493
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31494
+
31495
+ "use strict";
31496
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31497
+ /* harmony export */ X: function() { return /* binding */ readLink; }
31498
+ /* harmony export */ });
31499
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55186);
31500
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26150);
31501
+ /*!
31502
+ * Jodit Editor (https://xdsoft.net/jodit/)
31503
+ * Released under MIT see LICENSE.txt in the project root for license information.
31504
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31505
+ */
31506
+
31507
+
31508
+ /** @private */
31509
+ function readLink(state, j, values) {
31510
+ const a = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.closest(state.sourceImage, 'a', j.editor);
31511
+ if (a) {
31512
+ values.imageLink = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(a, 'href') || '';
31513
+ values.imageLinkOpenInNewTab = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(a, 'target') === '_blank';
31514
+ }
31515
+ else {
31516
+ values.imageLink = '';
31517
+ values.imageLinkOpenInNewTab = false;
31518
+ }
31519
+ }
31520
+
31521
+
31522
+ /***/ }),
31523
+
31524
+ /***/ 85079:
31525
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31526
+
31527
+ "use strict";
31528
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31529
+ /* harmony export */ E: function() { return /* binding */ readMargins; }
31530
+ /* harmony export */ });
31531
+ /* harmony import */ var jodit_core_helpers_string_kebab_case__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(449);
31532
+ /*!
31533
+ * Jodit Editor (https://xdsoft.net/jodit/)
31534
+ * Released under MIT see LICENSE.txt in the project root for license information.
31535
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31536
+ */
31537
+
31538
+ /** @private */
31539
+ function readMargins(image, values, state) {
31540
+ // Margins
31541
+ let equal = true, wasEmptyField = false;
31542
+ ['marginTop', 'marginRight', 'marginBottom', 'marginLeft'].forEach(id => {
31543
+ let value = image.style.getPropertyValue((0,jodit_core_helpers_string_kebab_case__WEBPACK_IMPORTED_MODULE_0__/* .kebabCase */ .k)(id));
31544
+ if (!value) {
31545
+ wasEmptyField = true;
31546
+ values[id] = 0;
31547
+ return;
31548
+ }
31549
+ if (/^[0-9]+(px)?$/.test(value)) {
31550
+ value = parseInt(value, 10);
31551
+ }
31552
+ values[id] = value;
31553
+ if ((wasEmptyField && values[id]) ||
31554
+ (equal && id !== 'marginTop' && values[id] !== values.marginTop)) {
31555
+ equal = false;
31556
+ }
31557
+ });
31558
+ state.marginIsLocked = equal;
31559
+ }
31560
+
31561
+
31562
+ /***/ }),
31563
+
31564
+ /***/ 17880:
31565
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31566
+
31567
+ "use strict";
31568
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31569
+ /* harmony export */ P: function() { return /* binding */ readSizes; }
31570
+ /* harmony export */ });
31571
+ /* harmony import */ var jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(12461);
31572
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26150);
31573
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(38322);
31574
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9645);
31575
+ /*!
31576
+ * Jodit Editor (https://xdsoft.net/jodit/)
31577
+ * Released under MIT see LICENSE.txt in the project root for license information.
31578
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31579
+ */
31580
+
31581
+
31582
+
31583
+
31584
+ /** @private */
31585
+ async function readSizes(image, values, state) {
31586
+ await image.decode();
31587
+ const width = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'width') || (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__/* .css */ .A)(image, 'width', true) || false;
31588
+ const height = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'height') || (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__/* .css */ .A)(image, 'height', true) || false;
31589
+ values.imageWidth =
31590
+ width !== false
31591
+ ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeFromString */ .G)(width)
31592
+ : image.offsetWidth || image.naturalWidth;
31593
+ values.imageHeight =
31594
+ height !== false
31595
+ ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeFromString */ .G)(height)
31596
+ : image.offsetHeight || image.naturalHeight;
31597
+ const { imageWidth, imageHeight } = values;
31598
+ const w = parseFloat(imageWidth.toString());
31599
+ if (!(0,jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_3__/* .isNumeric */ .k)(imageWidth) || !(0,jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_3__/* .isNumeric */ .k)(imageHeight)) {
31600
+ state.sizeIsLocked = false;
31601
+ return;
31602
+ }
31603
+ if (height === false) {
31604
+ values.imageHeight = Math.round(w / state.ratio);
31605
+ state.sizeIsLocked = true;
31606
+ return;
31607
+ }
31608
+ const h = parseFloat(imageHeight.toString());
31609
+ state.sizeIsLocked = Math.abs(w - h * state.ratio) < 1;
31610
+ }
31611
+
31612
+
31613
+ /***/ }),
31614
+
31615
+ /***/ 31970:
31616
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31617
+
31618
+ "use strict";
31619
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31620
+ /* harmony export */ l: function() { return /* binding */ UIImagePropertiesForm; }
31621
+ /* harmony export */ });
31622
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(31635);
31623
+ /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22664);
31624
+ /* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(24767);
31625
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(65147);
31626
+ /* harmony import */ var jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6455);
31627
+ /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(931);
31628
+ /* harmony import */ var jodit_modules_widget__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(16116);
31629
+ /* harmony import */ var _ui_image_main_tab__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(33403);
31630
+ /* harmony import */ var _ui_image_position_tab__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(46681);
31663
31631
  /*!
31664
31632
  * Jodit Editor (https://xdsoft.net/jodit/)
31665
31633
  * Released under MIT see LICENSE.txt in the project root for license information.
31666
31634
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31667
31635
  */
31668
31636
 
31669
- function form(editor) {
31670
- const { showPreview, editSize } = editor.o.image, gi = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__/* .Icon */ .I.get.bind(jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__/* .Icon */ .I);
31671
- return editor.c.fromHTML(`<form class="jodit-properties">
31637
+
31638
+
31639
+
31640
+
31641
+
31642
+
31643
+
31644
+
31645
+
31646
+ /** @private */
31647
+ let UIImagePropertiesForm = class UIImagePropertiesForm extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_2__/* .UIGroup */ .U {
31648
+ className() {
31649
+ return 'UIImagePropertiesForm';
31650
+ }
31651
+ appendChildToContainer() { }
31652
+ getElm(elementName) {
31653
+ const selfElm = super.getElm(elementName);
31654
+ if (selfElm) {
31655
+ return selfElm;
31656
+ }
31657
+ for (const child of this.elements) {
31658
+ const elm = child.getElm(elementName);
31659
+ if (elm) {
31660
+ return elm;
31661
+ }
31662
+ }
31663
+ return null;
31664
+ }
31665
+ constructor(jodit, state, activeTabState, handlers) {
31666
+ super(jodit);
31667
+ this.state = state;
31668
+ this.handlers = handlers;
31669
+ this.__mainTab = new _ui_image_main_tab__WEBPACK_IMPORTED_MODULE_5__/* .UIImageMainTab */ .k(this.jodit, this.state, this.handlers);
31670
+ this.__positionTab = new _ui_image_position_tab__WEBPACK_IMPORTED_MODULE_6__/* .UIImagePositionTab */ ._(this.jodit, this.state, this.handlers);
31671
+ this.getElm('tabsBox').appendChild((0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_4__/* .TabsWidget */ .Zg)(jodit, [
31672
+ { name: 'Image', content: this.__mainTab },
31673
+ { name: 'Advanced', content: this.__positionTab }
31674
+ ], activeTabState));
31675
+ this.setMod('lock-size', this.state.sizeIsLocked);
31676
+ this.append(this.__mainTab).append(this.__positionTab);
31677
+ }
31678
+ render() {
31679
+ return `<form>
31672
31680
  <div class="jodit-grid jodit-grid_xs-column">
31673
31681
  <div class="jodit_col-lg-2-5 jodit_col-xs-5-5">
31674
- <div class="jodit-properties_view_box">
31675
- <div style="${!showPreview ? 'display:none' : ''}" class="jodit-properties_image_view">
31676
- <img data-ref="imageViewSrc" src="" alt=""/>
31682
+ <div class="&__view-box">
31683
+ <div class="&__imageView">
31684
+ <img class="&__imageViewSrc" src="" alt=""/>
31677
31685
  </div>
31678
- <div style="${!editSize ? 'display:none' : ''}" class="jodit-form__group jodit-properties_image_sizes">
31679
- <input data-ref="imageWidth" type="text" class="jodit-input"/>
31680
- <a data-ref="lockSize" class="jodit-properties__lock">${gi('lock')}</a>
31681
- <input data-ref="imageHeight" type="text" class="imageHeight jodit-input"/>
31686
+ <div class="jodit-form__group &__imageSizes">
31687
+ <input type="text" class="jodit-input &__imageWidth"/>
31688
+ <a class="&__lockSize">${jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__/* .Icon */ .I.get('lock')}</a>
31689
+ <input type="text" class="&__imageHeight jodit-input"/>
31682
31690
  </div>
31683
31691
  </div>
31684
31692
  </div>
31685
- <div data-ref="tabsBox" class="jodit_col-lg-3-5 jodit_col-xs-5-5"></div>
31693
+ <div class="jodit_col-lg-3-5 jodit_col-xs-5-5 &__tabsBox"></div>
31686
31694
  </div>
31687
- </form>`);
31688
- }
31695
+ </form>`;
31696
+ }
31697
+ onChangeSizeIsLocked() {
31698
+ const lockSize = this.getElm('lockSize');
31699
+ const imageWidth = this.getElm('imageWidth');
31700
+ lockSize.innerHTML = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__/* .Icon */ .I.get(this.state.sizeIsLocked ? 'lock' : 'unlock');
31701
+ this.setMod('lock-size', this.state.sizeIsLocked);
31702
+ this.j.e.fire(imageWidth, 'change');
31703
+ }
31704
+ onLockSizeClick() {
31705
+ this.state.sizeIsLocked = !this.state.sizeIsLocked;
31706
+ }
31707
+ onStateValuesSizeChange() {
31708
+ const imageWidth = this.getElm('imageWidth');
31709
+ const imageHeight = this.getElm('imageHeight');
31710
+ if (imageWidth !== this.j.od.activeElement) {
31711
+ imageWidth.value = this.state.values.imageWidth.toString();
31712
+ }
31713
+ if (imageHeight !== this.j.od.activeElement) {
31714
+ imageHeight.value = this.state.values.imageHeight.toString();
31715
+ }
31716
+ }
31717
+ onImageWidthChange(e) {
31718
+ const imageWidth = this.getElm('imageWidth');
31719
+ const imageHeight = this.getElm('imageHeight');
31720
+ if (!this.state.sizeIsLocked ||
31721
+ !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.isNumeric)(imageWidth.value) ||
31722
+ !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.isNumeric)(imageHeight.value)) {
31723
+ this.state.values.imageWidth = imageWidth.value;
31724
+ this.state.values.imageHeight = imageHeight.value;
31725
+ return;
31726
+ }
31727
+ const w = parseFloat(imageWidth.value), h = parseFloat(imageHeight.value);
31728
+ if (e.target === imageWidth) {
31729
+ this.state.values.imageWidth = w;
31730
+ this.state.values.imageHeight = Math.round(w / this.state.ratio);
31731
+ }
31732
+ else {
31733
+ this.state.values.imageWidth = Math.round(h * this.state.ratio);
31734
+ this.state.values.imageHeight = h;
31735
+ }
31736
+ }
31737
+ onStateValuesImageSrcChange() {
31738
+ const { imageSrc } = this.state.values;
31739
+ if (!imageSrc) {
31740
+ return;
31741
+ }
31742
+ const imageViewSrc = this.getElm('imageViewSrc');
31743
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.attr)(imageViewSrc, 'src', imageSrc);
31744
+ const image = new Image();
31745
+ image.src = imageSrc;
31746
+ this.state.image = image;
31747
+ }
31748
+ hideFieldByOptions() {
31749
+ const opt = this.j.o.image;
31750
+ [
31751
+ ['editSize', 'imageSizes'],
31752
+ ['showPreview', 'imageView']
31753
+ ].forEach(([optKey, elmKey]) => {
31754
+ const elm = this.getElm(elmKey);
31755
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.css)(elm, 'display', opt[optKey] ? null : 'none');
31756
+ });
31757
+ }
31758
+ };
31759
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31760
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready'),
31761
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.sizeIsLocked')
31762
+ ], UIImagePropertiesForm.prototype, "onChangeSizeIsLocked", null);
31763
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31764
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('lockSize:click')
31765
+ ], UIImagePropertiesForm.prototype, "onLockSizeClick", null);
31766
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31767
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready'),
31768
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)(['state.values.imageWidth', 'state.values.imageHeight'])
31769
+ ], UIImagePropertiesForm.prototype, "onStateValuesSizeChange", null);
31770
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31771
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([
31772
+ 'imageWidth:change',
31773
+ 'imageHeight:change',
31774
+ 'imageWidth:keydown',
31775
+ 'imageHeight:keydown',
31776
+ 'imageWidth:mousedown',
31777
+ 'imageHeight:mousedown',
31778
+ 'imageWidth:paste',
31779
+ 'imageHeight:paste'
31780
+ ]),
31781
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.debounce)()
31782
+ ], UIImagePropertiesForm.prototype, "onImageWidthChange", null);
31783
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31784
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready'),
31785
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.values.imageSrc')
31786
+ ], UIImagePropertiesForm.prototype, "onStateValuesImageSrcChange", null);
31787
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31788
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready')
31789
+ ], UIImagePropertiesForm.prototype, "hideFieldByOptions", null);
31790
+ UIImagePropertiesForm = (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31791
+ jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_8__/* .component */ .s
31792
+ ], UIImagePropertiesForm);
31793
+
31689
31794
 
31690
31795
 
31691
31796
  /***/ }),
31692
31797
 
31693
- /***/ 75263:
31798
+ /***/ 33403:
31694
31799
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31695
31800
 
31696
31801
  "use strict";
31697
31802
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31698
- /* harmony export */ J: function() { return /* binding */ mainTab; }
31803
+ /* harmony export */ k: function() { return /* binding */ UIImageMainTab; }
31699
31804
  /* harmony export */ });
31700
- /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(931);
31805
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(31635);
31806
+ /* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(24767);
31807
+ /* harmony import */ var jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71151);
31808
+ /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(66927);
31809
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65147);
31810
+ /* harmony import */ var jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6455);
31701
31811
  /*!
31702
31812
  * Jodit Editor (https://xdsoft.net/jodit/)
31703
31813
  * Released under MIT see LICENSE.txt in the project root for license information.
31704
31814
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31705
31815
  */
31706
31816
 
31707
- function mainTab(editor) {
31708
- const 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;
31709
- return editor.c.fromHTML(`<div style="${!opt.image.editSrc ? 'display:none' : ''}" class="jodit-form__group">
31710
- <label>${i18n('Src')}</label>
31817
+
31818
+
31819
+
31820
+
31821
+
31822
+ /** @private */
31823
+ let UIImageMainTab = class UIImageMainTab extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_3__/* .UIGroup */ .U {
31824
+ className() {
31825
+ return 'UIImageMainTab';
31826
+ }
31827
+ appendChildToContainer() {
31828
+ // Do nothing
31829
+ }
31830
+ constructor(view, state, handlers) {
31831
+ super(view);
31832
+ this.state = state;
31833
+ this.handlers = handlers;
31834
+ }
31835
+ render() {
31836
+ return `<div class="jodit-form__group &__editSrc">
31837
+ <label>~Src~</label>
31711
31838
  <div class="jodit-input_group">
31712
- <input data-ref="imageSrc" class="jodit-input" type="text"/>
31713
- <div
31714
- class="jodit-input_group-buttons"
31715
- style="${hasFbUrl ? '' : 'display: none'}"
31716
- >
31717
- <a
31718
- data-ref="changeImage"
31719
- class="jodit-button"
31720
- >${gi('image')}</a>
31721
- <a
31722
- data-ref="editImage"
31723
- class="jodit-button"
31724
- style="${hasEditor ? '' : 'display: none'}"
31725
- >${gi('crop')}</a>
31839
+ <input class="jodit-input &__imageSrc" type="text"/>
31840
+ <div class="jodit-input_group-buttons &__fixImage">
31841
+ <a class="jodit-button &__changeImage">*image*</a>
31842
+ <a class="jodit-button &__editImage">*crop*</a>
31726
31843
  </div>
31727
31844
  </div>
31728
31845
  </div>
31729
- <div style="${!opt.image.editTitle ? 'display:none' : ''}" class="jodit-form__group">
31730
- <label>${i18n('Title')}</label>
31731
- <input data-ref="imageTitle" type="text" class="jodit-input"/>
31846
+ <div class="jodit-form__group &__editTitle">
31847
+ <label>~Title~</label>
31848
+ <input type="text" class="jodit-input &__imageTitle"/>
31732
31849
  </div>
31733
- <div style="${!opt.image.editAlt ? 'display:none' : ''}" class="jodit-form__group">
31734
- <label>${i18n('Alternative')}</label>
31735
- <input data-ref="imageAlt" type="text" class="jodit-input"/>
31850
+ <div class="jodit-form__group &__editAlt">
31851
+ <label>~Alternative~</label>
31852
+ <input type="text" class="jodit-input &__imageAlt"/>
31736
31853
  </div>
31737
- <div style="${!opt.image.editLink ? 'display:none' : ''}" class="jodit-form__group">
31738
- <label>${i18n('Link')}</label>
31739
- <input data-ref="imageLink" type="text" class="jodit-input"/>
31854
+ <div class="jodit-form__group &__editLink">
31855
+ <label>~Link~</label>
31856
+ <input type="text" class="jodit-input &__imageLink"/>
31740
31857
  </div>
31741
- <div style="${!opt.image.editLink ? 'display:none' : ''}" class="jodit-form__group">
31858
+ <div class="jodit-form__group &__editLinkTarget">
31742
31859
  <label class="jodit_vertical_middle">
31743
- <input data-ref="imageLinkOpenInNewTab" type="checkbox" class="jodit-checkbox"/>
31744
- <span>${i18n('Open link in new tab')}</span>
31860
+ <input type="checkbox" class="jodit-checkbox &__imageLinkOpenInNewTab"/>
31861
+ <span>~Open link in new tab~</span>
31745
31862
  </label>
31746
- </div>`);
31747
- }
31863
+ </div>`;
31864
+ }
31865
+ async onStateImageSrcChange() {
31866
+ const imageSrc = this.getElm('imageSrc');
31867
+ imageSrc.value = this.state.values.imageSrc;
31868
+ }
31869
+ onImageSrcChange() {
31870
+ this.state.values.imageSrc = this.getElm('imageSrc').value;
31871
+ }
31872
+ /**
31873
+ * Open image editor
31874
+ */
31875
+ onEditImageClick(e) {
31876
+ this.handlers.openImageEditor();
31877
+ e.stopPropagation();
31878
+ }
31879
+ /**
31880
+ * Open popup with filebrowser/uploader buttons for image
31881
+ */
31882
+ onChangeImageClick(e) {
31883
+ this.handlers.openImagePopup(this.getElm('changeImage'));
31884
+ e.stopPropagation();
31885
+ }
31886
+ onStateTitleChange() {
31887
+ const title = this.getElm('imageTitle');
31888
+ title.value = this.state.values.imageTitle;
31889
+ }
31890
+ onTitleChange() {
31891
+ this.state.values.imageTitle = this.getElm('imageTitle').value;
31892
+ }
31893
+ onStateAltChange() {
31894
+ const alt = this.getElm('imageAlt');
31895
+ alt.value = this.state.values.imageAlt;
31896
+ }
31897
+ onAltChange() {
31898
+ this.state.values.imageAlt = this.getElm('imageAlt').value;
31899
+ }
31900
+ onStateImageLinkChange() {
31901
+ const imageLink = this.getElm('imageLink');
31902
+ imageLink.value = this.state.values.imageLink;
31903
+ }
31904
+ onImageLinkChange() {
31905
+ this.state.values.imageLink = this.getElm('imageLink').value;
31906
+ }
31907
+ onStateImageLinkOpenInNewTabChange() {
31908
+ const imageLinkOpenInNewTab = this.getElm('imageLinkOpenInNewTab');
31909
+ imageLinkOpenInNewTab.checked = this.state.values.imageLinkOpenInNewTab;
31910
+ }
31911
+ onImageLinkOpenInNewTabChange() {
31912
+ this.state.values.imageLinkOpenInNewTab = this.getElm('imageLinkOpenInNewTab').checked;
31913
+ }
31914
+ hideFieldByOptions() {
31915
+ const o = this.j.o;
31916
+ const opt = o.image;
31917
+ [
31918
+ ['editSrc', 'editSrc'],
31919
+ ['editTitle', 'editTitle'],
31920
+ ['editAlt', 'editAlt'],
31921
+ ['editLink', 'editLink'],
31922
+ ['editLink', 'editLinkTarget'],
31923
+ ['useImageEditor', 'editImage']
31924
+ ].forEach(([optKey, elmKey]) => {
31925
+ const elm = this.getElm(elmKey);
31926
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(elm, 'display', opt[optKey] ? null : 'none');
31927
+ });
31928
+ const changeImage = this.getElm('changeImage');
31929
+ const needShowChangeImage = Boolean(o.filebrowser.ajax.url || o.uploader.url);
31930
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(changeImage, 'display', needShowChangeImage ? null : 'none');
31931
+ const editImage = this.getElm('editImage');
31932
+ const needShowEditImage = Boolean(o.filebrowser.ajax.url) && opt.useImageEditor;
31933
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(editImage, 'display', needShowEditImage ? null : 'none');
31934
+ const fixImage = this.getElm('fixImage');
31935
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(fixImage, 'display', needShowChangeImage || needShowEditImage ? null : 'none');
31936
+ }
31937
+ };
31938
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31939
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageSrc')
31940
+ ], UIImageMainTab.prototype, "onStateImageSrcChange", null);
31941
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31942
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageSrc:change')
31943
+ ], UIImageMainTab.prototype, "onImageSrcChange", null);
31944
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31945
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('editImage:click')
31946
+ ], UIImageMainTab.prototype, "onEditImageClick", null);
31947
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31948
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('changeImage:click')
31949
+ ], UIImageMainTab.prototype, "onChangeImageClick", null);
31950
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31951
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageTitle')
31952
+ ], UIImageMainTab.prototype, "onStateTitleChange", null);
31953
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31954
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageTitle:change')
31955
+ ], UIImageMainTab.prototype, "onTitleChange", null);
31956
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31957
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageAlt')
31958
+ ], UIImageMainTab.prototype, "onStateAltChange", null);
31959
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31960
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageAlt:change')
31961
+ ], UIImageMainTab.prototype, "onAltChange", null);
31962
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31963
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageLink')
31964
+ ], UIImageMainTab.prototype, "onStateImageLinkChange", null);
31965
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31966
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageLink:change')
31967
+ ], UIImageMainTab.prototype, "onImageLinkChange", null);
31968
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31969
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageLinkOpenInNewTab')
31970
+ ], UIImageMainTab.prototype, "onStateImageLinkOpenInNewTabChange", null);
31971
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31972
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageLinkOpenInNewTab:change')
31973
+ ], UIImageMainTab.prototype, "onImageLinkOpenInNewTabChange", null);
31974
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31975
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready')
31976
+ ], UIImageMainTab.prototype, "hideFieldByOptions", null);
31977
+ UIImageMainTab = (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31978
+ jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_5__/* .component */ .s
31979
+ ], UIImageMainTab);
31980
+
31748
31981
 
31749
31982
 
31750
31983
  /***/ }),
31751
31984
 
31752
- /***/ 57837:
31985
+ /***/ 46681:
31753
31986
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31754
31987
 
31755
31988
  "use strict";
31756
31989
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31757
- /* harmony export */ b: function() { return /* binding */ positionTab; }
31990
+ /* harmony export */ _: function() { return /* binding */ UIImagePositionTab; }
31758
31991
  /* harmony export */ });
31759
- /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(931);
31992
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(31635);
31993
+ /* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(24767);
31994
+ /* harmony import */ var jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71151);
31995
+ /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(66927);
31996
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65147);
31997
+ /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(98253);
31998
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(26150);
31999
+ /* harmony import */ var jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29780);
32000
+ /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(931);
32001
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(9645);
31760
32002
  /*!
31761
32003
  * Jodit Editor (https://xdsoft.net/jodit/)
31762
32004
  * Released under MIT see LICENSE.txt in the project root for license information.
31763
32005
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31764
32006
  */
31765
32007
 
31766
- function positionTab(editor) {
31767
- const 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);
31768
- const classInput = [];
31769
- if (opt.image.availableClasses.length > 0) {
31770
- classInput.push('<select data-ref="classes" class="jodit-input jodit-select">');
31771
- opt.image.availableClasses.forEach(item => {
31772
- if (typeof item === 'string') {
31773
- classInput.push(`<option value="${item}">${item}</option>`);
31774
- }
31775
- else {
31776
- classInput.push(`<option value="${item[0]}">${item[1]}</option>`);
31777
- }
31778
- });
31779
- classInput.push('</select>');
32008
+
32009
+
32010
+
32011
+
32012
+
32013
+
32014
+
32015
+
32016
+
32017
+ /** @private */
32018
+ let UIImagePositionTab = class UIImagePositionTab extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_4__/* .UIElement */ .D {
32019
+ className() {
32020
+ return 'UIImagePositionTab';
31780
32021
  }
31781
- else {
31782
- classInput.push('<input data-ref="classes" type="text" class="jodit-input"/>');
32022
+ constructor(jodit, state, handlers) {
32023
+ super(jodit, {
32024
+ availableClasses: jodit.o.image.availableClasses
32025
+ });
32026
+ this.state = state;
32027
+ this.handlers = handlers;
31783
32028
  }
31784
- return editor.c.fromHTML(`<div style="${!opt.image.editMargins ? 'display:none' : ''}" class="jodit-form__group">
31785
- <label>${i18n('Margins')}</label>
32029
+ render({ availableClasses }) {
32030
+ return `<div class="jodit-form__group &__editMargins">
32031
+ <label>~Margins~</label>
31786
32032
  <div class="jodit-grid jodit_vertical_middle">
31787
- <input class="jodit_col-lg-1-5 jodit-input" data-ref="marginTop" type="text" placeholder="${i18n('top')}"/>
31788
- <a style="text-align: center;" data-ref="lockMargin" class="jodit-properties__lock jodit_col-lg-1-5">${gi('lock')}</a>
31789
- <input disabled="true" class="jodit_col-lg-1-5 jodit-input" data-ref="marginRight" type="text" placeholder="${i18n('right')}"/>
31790
- <input disabled="true" class="jodit_col-lg-1-5 jodit-input" data-ref="marginBottom" type="text" placeholder="${i18n('bottom')}"/>
31791
- <input disabled="true" class="jodit_col-lg-1-5 jodit-input" data-ref="marginLeft" type="text" placeholder="${i18n('left')}"/>
32033
+ <input class="jodit_col-lg-1-5 jodit-input &__marginTop" type="text" placeholder="~top~"/>
32034
+ <a style="text-align: center;" class="jodit-properties__lock jodit_col-lg-1-5 &__lockMargin">*lock*</a>
32035
+ <input disabled="disabled" class="jodit_col-lg-1-5 jodit-input &__marginRight" type="text" placeholder="~right~"/>
32036
+ <input disabled="disabled" class="jodit_col-lg-1-5 jodit-input &__marginBottom" type="text" placeholder="~bottom~"/>
32037
+ <input disabled="disabled" class="jodit_col-lg-1-5 jodit-input &__marginLeft" type="text" placeholder="~left~"/>
31792
32038
  </div>
31793
32039
  </div>
31794
- <div
31795
- style="${!opt.image.editAlign ? 'display:none' : ''}"
31796
- class="jodit-form__group"
31797
- >
31798
- <label>${i18n('Align')}</label>
31799
- <select data-ref="align" class="jodit-select">
31800
- <option value="">${i18n('--Not Set--')}</option>
31801
- <option value="left">${i18n('Left')}</option>
31802
- <option value="center">${i18n('Center')}</option>
31803
- <option value="right">${i18n('Right')}</option>
32040
+ <div class="jodit-form__group &__editAlign">
32041
+ <label>~Align~</label>
32042
+ <select class="jodit-select &__align">
32043
+ <option value="">~--Not Set--~</option>
32044
+ <option value="left">~Left~</option>
32045
+ <option value="center">~Center~</option>
32046
+ <option value="right">~Right~</option>
31804
32047
  </select>
31805
32048
  </div>
31806
- <div style="${!opt.image.editStyle ? 'display:none' : ''}" class="jodit-form__group">
31807
- <label>${i18n('Styles')}</label>
31808
- <input data-ref="style" type="text" class="jodit-input"/>
32049
+ <div class="jodit-form__group &__editStyle">
32050
+ <label>~Styles~</label>
32051
+ <input type="text" class="jodit-input &__style"/>
31809
32052
  </div>
31810
- <div style="${!opt.image.editClass ? 'display:none' : ''}" class="jodit-form__group">
31811
- <label>${i18n('Classes')}</label>
31812
- ${classInput.join('')}
32053
+ <div class="jodit-form__group &__editClass">
32054
+ <label>~Classes~</label>
32055
+ ${(() => {
32056
+ const classInput = [];
32057
+ if (availableClasses && availableClasses.length > 0) {
32058
+ classInput.push('<select class="jodit-input jodit-select &__classes">');
32059
+ availableClasses.forEach(item => {
32060
+ if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_7__/* .isString */ .K)(item)) {
32061
+ classInput.push(`<option value="${item}">${item}</option>`);
32062
+ }
32063
+ else {
32064
+ classInput.push(`<option value="${item[0]}">${item[1]}</option>`);
32065
+ }
32066
+ });
32067
+ classInput.push('</select>');
32068
+ }
32069
+ else {
32070
+ classInput.push('<input type="text" class="jodit-input &__classes"/>');
32071
+ }
32072
+ return classInput.join('');
32073
+ })()}
31813
32074
  </div>
31814
- <div style="${!opt.image.editId ? 'display:none' : ''}" class="jodit-form__group">
32075
+ <div class="jodit-form__group &__editId">
31815
32076
  <label>Id</label>
31816
- <input data-ref="id" type="text" class="jodit-input"/>
32077
+ <input type="text" class="jodit-input &__id"/>
31817
32078
  </div>
31818
32079
  <div
31819
- style="${!opt.image.editBorderRadius ? 'display:none' : ''}"
31820
- class="jodit-form__group"
32080
+ class="jodit-form__group &__editBorderRadius"
31821
32081
  >
31822
- <label>${i18n('Border radius')}</label>
31823
- <input data-ref="borderRadius" type="number" class="jodit-input"/>
31824
- </div>`);
32082
+ <label>~Border radius~</label>
32083
+ <input type="number" class="jodit-input &__borderRadius"/>
32084
+ </div>`;
32085
+ }
32086
+ onStateAlignChange() {
32087
+ const align = this.getElm('align');
32088
+ align.value = this.state.values.align;
32089
+ }
32090
+ onChangeAlign() {
32091
+ const align = this.getElm('align');
32092
+ this.state.values.align = align.value;
32093
+ }
32094
+ onStateValuesBorderRadiusChange() {
32095
+ const borderRadius = this.getElm('borderRadius');
32096
+ borderRadius.value = this.state.values.borderRadius.toString();
32097
+ }
32098
+ onChangeBorderRadius() {
32099
+ const borderRadius = this.getElm('borderRadius');
32100
+ this.state.values.borderRadius = parseFloat(borderRadius.value);
32101
+ }
32102
+ onStateValuesIdChange() {
32103
+ const id = this.getElm('id');
32104
+ id.value = this.state.values.id;
32105
+ }
32106
+ onChangeId() {
32107
+ const id = this.getElm('id');
32108
+ this.state.values.id = id.value;
32109
+ }
32110
+ onStateValuesStyleChange() {
32111
+ const style = this.getElm('style');
32112
+ style.value = this.state.values.style;
32113
+ }
32114
+ onChangeStyle() {
32115
+ const style = this.getElm('style');
32116
+ this.state.values.style = style.value;
32117
+ }
32118
+ onStateValuesClassesChange() {
32119
+ const classes = this.getElm('classes');
32120
+ classes.value = this.state.values.classes;
32121
+ }
32122
+ onChangClasses() {
32123
+ const classes = this.getElm('classes');
32124
+ this.state.values.classes = classes.value;
32125
+ }
32126
+ onLockMarginClick(e) {
32127
+ this.state.marginIsLocked = !this.state.marginIsLocked;
32128
+ e.preventDefault();
32129
+ }
32130
+ onChangeMarginIsLocked() {
32131
+ const marginBottom = this.getElm('marginBottom');
32132
+ const marginRight = this.getElm('marginRight');
32133
+ const marginLeft = this.getElm('marginLeft');
32134
+ const lockMargin = this.getElm('lockMargin');
32135
+ [marginRight, marginBottom, marginLeft].forEach(elm => {
32136
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_3__/* .attr */ .C)(elm, 'disabled', this.state.marginIsLocked || null);
32137
+ });
32138
+ lockMargin.innerHTML = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_5__/* .Icon */ .I.get(this.state.marginIsLocked ? 'lock' : 'unlock');
32139
+ if (this.state.marginIsLocked) {
32140
+ const marginTop = this.state.values.marginTop;
32141
+ this.state.values.marginRight = marginTop;
32142
+ this.state.values.marginBottom = marginTop;
32143
+ this.state.values.marginLeft = marginTop;
32144
+ }
32145
+ }
32146
+ onStateValuesMarginChange() {
32147
+ const marginTop = this.getElm('marginTop');
32148
+ const marginRight = this.getElm('marginRight');
32149
+ const marginBottom = this.getElm('marginBottom');
32150
+ const marginLeft = this.getElm('marginLeft');
32151
+ marginTop.value = this.state.values.marginTop.toString();
32152
+ marginRight.value = this.state.values.marginRight.toString();
32153
+ marginBottom.value = this.state.values.marginBottom.toString();
32154
+ marginLeft.value = this.state.values.marginLeft.toString();
32155
+ }
32156
+ onChangeMargin() {
32157
+ const marginTop = this.getElm('marginTop');
32158
+ const marginRight = this.getElm('marginRight');
32159
+ const marginBottom = this.getElm('marginBottom');
32160
+ const marginLeft = this.getElm('marginLeft');
32161
+ this.state.values.marginTop = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginTop.value);
32162
+ if (this.state.marginIsLocked) {
32163
+ this.state.values.marginRight = this.state.values.marginTop;
32164
+ this.state.values.marginBottom = this.state.values.marginTop;
32165
+ this.state.values.marginLeft = this.state.values.marginTop;
32166
+ }
32167
+ else {
32168
+ this.state.values.marginRight = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginRight.value);
32169
+ this.state.values.marginBottom = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginBottom.value);
32170
+ this.state.values.marginLeft = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginLeft.value);
32171
+ }
32172
+ }
32173
+ hideFieldByOptions() {
32174
+ const opt = this.j.o.image;
32175
+ [
32176
+ ['editMargins', 'editMargins'],
32177
+ ['editAlign', 'editAlign'],
32178
+ ['editStyle', 'editStyle'],
32179
+ ['editClass', 'editClass'],
32180
+ ['editId', 'editId'],
32181
+ ['editBorderRadius', 'editBorderRadius']
32182
+ ].forEach(([optKey, elmKey]) => {
32183
+ const elm = this.getElm(elmKey);
32184
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(elm, 'display', opt[optKey] ? null : 'none');
32185
+ });
32186
+ }
32187
+ };
32188
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32189
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32190
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.align')
32191
+ ], UIImagePositionTab.prototype, "onStateAlignChange", null);
32192
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32193
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('align:change')
32194
+ ], UIImagePositionTab.prototype, "onChangeAlign", null);
32195
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32196
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32197
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.borderRadius')
32198
+ ], UIImagePositionTab.prototype, "onStateValuesBorderRadiusChange", null);
32199
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32200
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('borderRadius:change')
32201
+ ], UIImagePositionTab.prototype, "onChangeBorderRadius", null);
32202
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32203
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32204
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.id')
32205
+ ], UIImagePositionTab.prototype, "onStateValuesIdChange", null);
32206
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32207
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('id:change')
32208
+ ], UIImagePositionTab.prototype, "onChangeId", null);
32209
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32210
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32211
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.style')
32212
+ ], UIImagePositionTab.prototype, "onStateValuesStyleChange", null);
32213
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32214
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('style:change')
32215
+ ], UIImagePositionTab.prototype, "onChangeStyle", null);
32216
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32217
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32218
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.classes')
32219
+ ], UIImagePositionTab.prototype, "onStateValuesClassesChange", null);
32220
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32221
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('classes:change')
32222
+ ], UIImagePositionTab.prototype, "onChangClasses", null);
32223
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32224
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('lockMargin:click')
32225
+ ], UIImagePositionTab.prototype, "onLockMarginClick", null);
32226
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32227
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32228
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.marginIsLocked')
32229
+ ], UIImagePositionTab.prototype, "onChangeMarginIsLocked", null);
32230
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32231
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32232
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)([
32233
+ 'state.values.marginTop',
32234
+ 'state.values.marginRight',
32235
+ 'state.values.marginBottom',
32236
+ 'state.values.marginLeft'
32237
+ ])
32238
+ ], UIImagePositionTab.prototype, "onStateValuesMarginChange", null);
32239
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32240
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)([
32241
+ 'marginTop:change',
32242
+ 'marginRight:change',
32243
+ 'marginBottom:change',
32244
+ 'marginLeft:change'
32245
+ ])
32246
+ ], UIImagePositionTab.prototype, "onChangeMargin", null);
32247
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32248
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready')
32249
+ ], UIImagePositionTab.prototype, "hideFieldByOptions", null);
32250
+ UIImagePositionTab = (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32251
+ jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_9__/* .component */ .s
32252
+ ], UIImagePositionTab);
32253
+
32254
+
32255
+
32256
+ /***/ }),
32257
+
32258
+ /***/ 80778:
32259
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32260
+
32261
+ "use strict";
32262
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32263
+ /* harmony export */ v: function() { return /* binding */ openImageEditorDialog; }
32264
+ /* harmony export */ });
32265
+ /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(98253);
32266
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26150);
32267
+ /* harmony import */ var jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(53804);
32268
+ /*!
32269
+ * Jodit Editor (https://xdsoft.net/jodit/)
32270
+ * Released under MIT see LICENSE.txt in the project root for license information.
32271
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32272
+ */
32273
+
32274
+
32275
+
32276
+ /**
32277
+ * Open image editor dialog
32278
+ * @private
32279
+ */
32280
+ function openImageEditorDialog(j, state) {
32281
+ const url = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(state.image, 'src') || '', a = j.c.element('a'), loadExternal = () => {
32282
+ if (a.host !== location.host) {
32283
+ j.confirm('You can only edit your own images. Download this image on the host?', yes => {
32284
+ if (yes && j.uploader) {
32285
+ j.uploader.uploadRemoteImage(a.href.toString(), resp => {
32286
+ j.alert('The image has been successfully uploaded to the host!', () => {
32287
+ if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_2__/* .isString */ .K)(resp.newfilename)) {
32288
+ state.values.imageSrc =
32289
+ resp.baseurl +
32290
+ resp.newfilename;
32291
+ }
32292
+ });
32293
+ }, error => {
32294
+ j.alert('There was an error loading %s', error.message);
32295
+ });
32296
+ }
32297
+ });
32298
+ return;
32299
+ }
32300
+ };
32301
+ a.href = url;
32302
+ j.filebrowser.dataProvider
32303
+ .getPathByUrl(a.href.toString())
32304
+ .then(resp => {
32305
+ jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_1__/* .openImageEditor */ .B.call(j.filebrowser, a.href, resp.name, resp.path, resp.source, () => {
32306
+ const timestamp = new Date().getTime();
32307
+ state.values.imageSrc =
32308
+ url +
32309
+ (url.indexOf('?') !== -1 ? '' : '?') +
32310
+ '&_tmp=' +
32311
+ timestamp.toString();
32312
+ }, error => {
32313
+ j.alert(error.message);
32314
+ });
32315
+ })
32316
+ .catch(error => {
32317
+ j.alert(error.message, loadExternal);
32318
+ });
32319
+ }
32320
+
32321
+
32322
+ /***/ }),
32323
+
32324
+ /***/ 33733:
32325
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32326
+
32327
+ "use strict";
32328
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32329
+ /* harmony export */ q: function() { return /* binding */ openImagePopup; }
32330
+ /* harmony export */ });
32331
+ /* harmony import */ var jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(37923);
32332
+ /* harmony import */ var jodit_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(27594);
32333
+ /* harmony import */ var jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(80071);
32334
+ /* harmony import */ var jodit_modules_widget_file_selector_file_selector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10067);
32335
+ /*!
32336
+ * Jodit Editor (https://xdsoft.net/jodit/)
32337
+ * Released under MIT see LICENSE.txt in the project root for license information.
32338
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32339
+ */
32340
+
32341
+
32342
+
32343
+
32344
+ /** @private */
32345
+ function openImagePopup(j, dialog, state, button) {
32346
+ const popup = new jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_0__/* .Popup */ .z(dialog);
32347
+ const closePopup = () => {
32348
+ popup.close();
32349
+ popup.destruct();
32350
+ };
32351
+ popup
32352
+ .setContent((0,jodit_modules_widget_file_selector_file_selector__WEBPACK_IMPORTED_MODULE_1__/* .FileSelectorWidget */ .k)(j, {
32353
+ upload: (data) => {
32354
+ if (data.files && data.files.length) {
32355
+ state.values.imageSrc =
32356
+ data.baseurl + data.files[0];
32357
+ }
32358
+ closePopup();
32359
+ },
32360
+ filebrowser: async (data) => {
32361
+ if (data && (0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_2__/* .isArray */ .c)(data.files) && data.files.length) {
32362
+ state.values.imageSrc = data.files[0];
32363
+ closePopup();
32364
+ }
32365
+ }
32366
+ }, state.image, closePopup))
32367
+ .open(() => (0,jodit_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_3__/* .position */ .G)(button));
32368
+ }
32369
+
32370
+
32371
+ /***/ }),
32372
+
32373
+ /***/ 9645:
32374
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32375
+
32376
+ "use strict";
32377
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32378
+ /* harmony export */ G: function() { return /* binding */ normalSizeFromString; },
32379
+ /* harmony export */ n: function() { return /* binding */ normalSizeToString; }
32380
+ /* harmony export */ });
32381
+ /* harmony import */ var jodit_core_helpers_checker_is_number__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2461);
32382
+ /* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(59101);
32383
+ /*!
32384
+ * Jodit Editor (https://xdsoft.net/jodit/)
32385
+ * Released under MIT see LICENSE.txt in the project root for license information.
32386
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32387
+ */
32388
+
32389
+
32390
+ /** @private */
32391
+ const normalSizeFromString = (value) => {
32392
+ return /^[-+]?[0-9.]+(px)?$/.test(value.toString())
32393
+ ? parseFloat(value.toString())
32394
+ : value;
32395
+ };
32396
+ /** @private */
32397
+ const normalSizeToString = (value) => {
32398
+ if ((0,jodit_core_helpers_checker_is_number__WEBPACK_IMPORTED_MODULE_1__/* .isNumber */ .E)(value)) {
32399
+ return value ? value + 'px' : value.toString();
32400
+ }
32401
+ value = (0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_0__/* .trim */ .Bq)(value);
32402
+ return /^[0-9]+$/.test(value) ? value + 'px' : value;
32403
+ };
32404
+
32405
+
32406
+ /***/ }),
32407
+
32408
+ /***/ 30393:
32409
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32410
+
32411
+ "use strict";
32412
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32413
+ /* harmony export */ j: function() { return /* binding */ applyValuesToImage; }
32414
+ /* harmony export */ });
32415
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55186);
32416
+ /* harmony import */ var jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97369);
32417
+ /* harmony import */ var _link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(88269);
32418
+ /* harmony import */ var _margin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(78139);
32419
+ /* harmony import */ var _size__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(58972);
32420
+ /*!
32421
+ * Jodit Editor (https://xdsoft.net/jodit/)
32422
+ * Released under MIT see LICENSE.txt in the project root for license information.
32423
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32424
+ */
32425
+
32426
+
32427
+
32428
+
32429
+
32430
+ /**
32431
+ * Apply form's values to image
32432
+ * @private
32433
+ */
32434
+ function applyValuesToImage(j, state, image) {
32435
+ const { style, imageSrc, borderRadius, imageTitle, imageAlt, imageLink, imageWidth, imageHeight, marginTop, marginRight, marginBottom, marginLeft, imageLinkOpenInNewTab, align, classes, id } = state.values;
32436
+ const opt = j.o;
32437
+ // styles
32438
+ if (opt.image.editStyle) {
32439
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'style', style || null);
32440
+ }
32441
+ // Src
32442
+ if (imageSrc) {
32443
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'src', imageSrc);
32444
+ }
32445
+ else {
32446
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.safeRemove(image);
32447
+ return;
32448
+ }
32449
+ // Border radius
32450
+ image.style.borderRadius = borderRadius ? borderRadius + 'px' : '';
32451
+ // Title
32452
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'title', imageTitle || null);
32453
+ // Alt
32454
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'alt', imageAlt || null);
32455
+ // Link
32456
+ (0,_link__WEBPACK_IMPORTED_MODULE_2__/* .applyLink */ .j)(j, image, imageLink, imageLinkOpenInNewTab);
32457
+ // Size
32458
+ (0,_size__WEBPACK_IMPORTED_MODULE_4__/* .applySize */ .q)(image, imageWidth, imageHeight, state.sizeIsLocked);
32459
+ // Margin
32460
+ if (j.o.image.editMargins) {
32461
+ (0,_margin__WEBPACK_IMPORTED_MODULE_3__/* .applyMargin */ .N)(j, marginTop, marginRight, marginBottom, marginLeft, image, state.marginIsLocked);
32462
+ }
32463
+ if (opt.image.editClass) {
32464
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'class', classes || null);
32465
+ }
32466
+ if (opt.image.editId) {
32467
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'id', id || null);
32468
+ }
32469
+ if (opt.image.editAlign) {
32470
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.hAlignElement)(image, align);
32471
+ }
32472
+ }
32473
+
32474
+
32475
+ /***/ }),
32476
+
32477
+ /***/ 88269:
32478
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32479
+
32480
+ "use strict";
32481
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32482
+ /* harmony export */ j: function() { return /* binding */ applyLink; }
32483
+ /* harmony export */ });
32484
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55186);
32485
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26150);
32486
+ /*!
32487
+ * Jodit Editor (https://xdsoft.net/jodit/)
32488
+ * Released under MIT see LICENSE.txt in the project root for license information.
32489
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32490
+ */
32491
+
32492
+
32493
+ /** @private */
32494
+ function applyLink(j, image, imageLink, imageLinkOpenInNewTab) {
32495
+ // Link
32496
+ let link = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.closest(image, 'a', j.editor);
32497
+ if (imageLink) {
32498
+ if (!link) {
32499
+ link = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.wrap(image, 'a', j.createInside);
32500
+ }
32501
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(link, 'href', imageLink);
32502
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(link, 'target', imageLinkOpenInNewTab ? '_blank' : null);
32503
+ }
32504
+ else {
32505
+ if (link && link.parentNode) {
32506
+ link.parentNode.replaceChild(image, link);
32507
+ }
32508
+ }
32509
+ }
32510
+
32511
+
32512
+ /***/ }),
32513
+
32514
+ /***/ 78139:
32515
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32516
+
32517
+ "use strict";
32518
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32519
+ /* harmony export */ N: function() { return /* binding */ applyMargin; }
32520
+ /* harmony export */ });
32521
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(38322);
32522
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9645);
32523
+ /*!
32524
+ * Jodit Editor (https://xdsoft.net/jodit/)
32525
+ * Released under MIT see LICENSE.txt in the project root for license information.
32526
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32527
+ */
32528
+
32529
+
32530
+ /** @private */
32531
+ function applyMargin(j, marginTop, marginRight, marginBottom, marginLeft, image, marginIsLocked) {
32532
+ const margins = [marginTop, marginRight, marginBottom, marginLeft];
32533
+ const applyMargin = (key, value) => {
32534
+ const oldValue = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_1__/* .css */ .A)(image, key);
32535
+ const v = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_0__/* .normalSizeToString */ .n)(value);
32536
+ if (oldValue.toString() !== v.toString()) {
32537
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_1__/* .css */ .A)(image, key, v);
32538
+ }
32539
+ };
32540
+ if (!marginIsLocked) {
32541
+ const sides = [
32542
+ 'margin-top',
32543
+ 'margin-right',
32544
+ 'margin-bottom',
32545
+ 'margin-left'
32546
+ ];
32547
+ margins.forEach((margin, index) => {
32548
+ const side = sides[index];
32549
+ applyMargin(side, margin);
32550
+ });
32551
+ }
32552
+ else {
32553
+ applyMargin('margin', marginTop);
32554
+ }
32555
+ }
32556
+
32557
+
32558
+ /***/ }),
32559
+
32560
+ /***/ 58972:
32561
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32562
+
32563
+ "use strict";
32564
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32565
+ /* harmony export */ q: function() { return /* binding */ applySize; }
32566
+ /* harmony export */ });
32567
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26150);
32568
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(38322);
32569
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9645);
32570
+ /*!
32571
+ * Jodit Editor (https://xdsoft.net/jodit/)
32572
+ * Released under MIT see LICENSE.txt in the project root for license information.
32573
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32574
+ */
32575
+
32576
+
32577
+
32578
+ /** @private */
32579
+ function applySize(image, imageWidth, imageHeight, sizeIsLocked) {
32580
+ // Size
32581
+ if (imageWidth !== image.offsetWidth ||
32582
+ imageHeight !== image.offsetHeight) {
32583
+ const updatedWidth = imageWidth ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeToString */ .n)(imageWidth) : null;
32584
+ let updatedHeight = imageHeight
32585
+ ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeToString */ .n)(imageHeight)
32586
+ : null;
32587
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__/* .css */ .A)(image, {
32588
+ width: updatedWidth,
32589
+ height: updatedWidth && sizeIsLocked ? null : updatedHeight
32590
+ });
32591
+ (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);
32592
+ if (!(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'width') || sizeIsLocked) {
32593
+ updatedHeight = null;
32594
+ }
32595
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'height', updatedHeight);
32596
+ }
31825
32597
  }
31826
32598
 
31827
32599
 
@@ -38194,7 +38966,8 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_3__/* .pluginSystem */ .fg.add('selec
38194
38966
  */
38195
38967
 
38196
38968
  jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.select = {
38197
- normalizeSelectionBeforeCutAndCopy: false
38969
+ normalizeSelectionBeforeCutAndCopy: false,
38970
+ normalizeTripleClick: true
38198
38971
  };
38199
38972
 
38200
38973
 
@@ -38270,7 +39043,7 @@ class select extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_3__/* .Plugin */
38270
39043
  }
38271
39044
  }
38272
39045
  /**
38273
- * @event outsideClick(e) - when user clicked in the outside of editor
39046
+ * @event outsideClick(e) - when user clicked on the outside of editor
38274
39047
  */
38275
39048
  onOutsideClick(e) {
38276
39049
  const node = e.target;
@@ -38282,7 +39055,7 @@ class select extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_3__/* .Plugin */
38282
39055
  this.j.e.fire('outsideClick', e);
38283
39056
  }
38284
39057
  }
38285
- beforeCommandCut(command) {
39058
+ beforeCommandCut() {
38286
39059
  const { s } = this.j;
38287
39060
  if (!s.isCollapsed()) {
38288
39061
  const current = s.current();
@@ -38291,13 +39064,27 @@ class select extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_3__/* .Plugin */
38291
39064
  }
38292
39065
  }
38293
39066
  }
38294
- beforeCommandSelectall(command) {
39067
+ beforeCommandSelectAll() {
38295
39068
  const { s } = this.j;
38296
39069
  s.focus();
38297
39070
  s.select(this.j.editor, true);
38298
39071
  s.expandSelection();
38299
39072
  return false;
38300
39073
  }
39074
+ /**
39075
+ * Normalize selection after triple click
39076
+ */
39077
+ onTripleClickNormalizeSelection(e) {
39078
+ if (e.detail !== 3 || !this.j.o.select.normalizeTripleClick) {
39079
+ return;
39080
+ }
39081
+ const { s } = this.j;
39082
+ const { startContainer, startOffset } = s.range;
39083
+ if (startOffset === 0 && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isText(startContainer)) {
39084
+ 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) ||
39085
+ startContainer, true);
39086
+ }
39087
+ }
38301
39088
  onCopyNormalizeSelectionBound(e) {
38302
39089
  const { s, editor, o } = this.j;
38303
39090
  if (!o.select.normalizeSelectionBeforeCutAndCopy || s.isCollapsed()) {
@@ -38323,7 +39110,10 @@ class select extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_3__/* .Plugin */
38323
39110
  ], select.prototype, "beforeCommandCut", null);
38324
39111
  (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
38325
39112
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([':beforeCommandSelectall'])
38326
- ], select.prototype, "beforeCommandSelectall", null);
39113
+ ], select.prototype, "beforeCommandSelectAll", null);
39114
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
39115
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([':click'])
39116
+ ], select.prototype, "onTripleClickNormalizeSelection", null);
38327
39117
  (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
38328
39118
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([':copy', ':cut'])
38329
39119
  ], select.prototype, "onCopyNormalizeSelectionBound", null);