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/es2015/jodit.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.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 = "es2015";
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
 
@@ -8763,9 +8773,9 @@ const getXPathByElement = (element, root) => {
8763
8773
  * Find all `ref` or `data-ref` elements inside HTMLElement
8764
8774
  */
8765
8775
  const refs = (root) => {
8766
- // if (Component.isInstanceOf<UIElement>(root, UIElement)) {
8767
- // root = root.container;
8768
- // }
8776
+ if ('container' in root) {
8777
+ root = root.container;
8778
+ }
8769
8779
  return $$('[ref],[data-ref]', root).reduce((def, child) => {
8770
8780
  const key = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(child, '-ref');
8771
8781
  if (key && (0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_4__/* .isString */ .K)(key)) {
@@ -13281,7 +13291,8 @@ let UITooltip = UITooltip_1 = class UITooltip extends jodit_core_ui_element__WEB
13281
13291
  view.o.showTooltip &&
13282
13292
  !view.o.useNativeTooltip) {
13283
13293
  view.hookStatus(jodit_core_component__WEBPACK_IMPORTED_MODULE_0__/* .STATUSES */ .f.ready, () => {
13284
- (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_3__/* .getContainer */ .My)(view, UITooltip_1).appendChild(this.container);
13294
+ // TODO Move it inside __open method. Now it is here because testcase failed with capturing
13295
+ (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_3__/* .getContainer */ .My)(this.j, UITooltip_1).appendChild(this.container);
13285
13296
  view.e.on(view.container, 'mouseenter.tooltip', this.__onMouseEnter, {
13286
13297
  capture: true
13287
13298
  });
@@ -13296,6 +13307,7 @@ let UITooltip = UITooltip_1 = class UITooltip extends jodit_core_ui_element__WEB
13296
13307
  const view = this.j;
13297
13308
  view.e
13298
13309
  .on(view.ow, 'scroll.tooltip', this.__hide)
13310
+ .on(view.ow, 'joditCloseDialog', this.__hide)
13299
13311
  .on(view.container, 'mouseleave.tooltip', this.__hide)
13300
13312
  .on([
13301
13313
  'escape.tooltip',
@@ -13410,9 +13422,6 @@ let UITooltip = UITooltip_1 = class UITooltip extends jodit_core_ui_element__WEB
13410
13422
  (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
13411
13423
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.autobind
13412
13424
  ], UITooltip.prototype, "__onMouseEnter", null);
13413
- (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
13414
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.autobind
13415
- ], UITooltip.prototype, "__delayOpen", null);
13416
13425
  (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
13417
13426
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.autobind
13418
13427
  ], UITooltip.prototype, "__hide", null);
@@ -15288,7 +15297,7 @@ class Popup extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_7__/* .UI
15288
15297
  }
15289
15298
  let pe = this.parentElement;
15290
15299
  while (pe) {
15291
- if (checkView(j)) {
15300
+ if (checkView(pe.j)) {
15292
15301
  return;
15293
15302
  }
15294
15303
  if (pe.container.style.zIndex) {
@@ -16015,22 +16024,22 @@ View.version = jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.APP_VERSION;
16015
16024
  View.esNext = jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.IS_ES_NEXT; // from webpack.config.js
16016
16025
  View.esModern = jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.IS_ES_MODERN; // from webpack.config.js
16017
16026
  (0,tslib__WEBPACK_IMPORTED_MODULE_15__/* .__decorate */ .Cg)([
16018
- jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .P
16027
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .PP
16019
16028
  ], View.prototype, "buffer", null);
16020
16029
  (0,tslib__WEBPACK_IMPORTED_MODULE_15__/* .__decorate */ .Cg)([
16021
- jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .P
16030
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .PP
16022
16031
  ], View.prototype, "message", null);
16023
16032
  (0,tslib__WEBPACK_IMPORTED_MODULE_15__/* .__decorate */ .Cg)([
16024
- jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .P
16033
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .PP
16025
16034
  ], View.prototype, "storage", null);
16026
16035
  (0,tslib__WEBPACK_IMPORTED_MODULE_15__/* .__decorate */ .Cg)([
16027
- jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .P
16036
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .PP
16028
16037
  ], View.prototype, "c", null);
16029
16038
  (0,tslib__WEBPACK_IMPORTED_MODULE_15__/* .__decorate */ .Cg)([
16030
- jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .P
16039
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .PP
16031
16040
  ], View.prototype, "e", null);
16032
16041
  (0,tslib__WEBPACK_IMPORTED_MODULE_15__/* .__decorate */ .Cg)([
16033
- jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .P
16042
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .PP
16034
16043
  ], View.prototype, "progressbar", null);
16035
16044
  (0,tslib__WEBPACK_IMPORTED_MODULE_15__/* .__decorate */ .Cg)([
16036
16045
  (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_6__/* .hook */ .A)(jodit_core_component_statuses__WEBPACK_IMPORTED_MODULE_2__/* .STATUSES */ .f.beforeDestruct)
@@ -17777,6 +17786,7 @@ let Dialog = Dialog_1 = class Dialog extends jodit_core_view_view_with_toolbar__
17777
17786
  * Fired when dialog box is started moving
17778
17787
  */
17779
17788
  this.e.fire(this, 'startMove');
17789
+ this.e.fire('closeAllPopups');
17780
17790
  }
17781
17791
  }
17782
17792
  onMouseMove(e) {
@@ -19715,7 +19725,15 @@ let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__W
19715
19725
  this.__updateToolbarButtons();
19716
19726
  this._dialog.open(this.browser, header);
19717
19727
  this.e.fire('sort.filebrowser', this.state.sortBy);
19718
- (0,_fetch_load_tree__WEBPACK_IMPORTED_MODULE_10__/* .loadTree */ .r)(this).then(resolve, reject);
19728
+ (0,_fetch_load_tree__WEBPACK_IMPORTED_MODULE_10__/* .loadTree */ .r)(this)
19729
+ .then(resolve, reject)
19730
+ .finally(() => {
19731
+ var _a;
19732
+ if (this.isInDestruct) {
19733
+ return;
19734
+ }
19735
+ (_a = this === null || this === void 0 ? void 0 : this.e) === null || _a === void 0 ? void 0 : _a.fire('fileBrowserReady.filebrowser');
19736
+ });
19719
19737
  })
19720
19738
  .catch((e) => {
19721
19739
  if (!jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.IS_PROD) {
@@ -21588,11 +21606,12 @@ const act = (el, className = 'jodti-image-editor_active') => el ? className : ''
21588
21606
  const form = (editor, o) => {
21589
21607
  const i = editor.i18n.bind(editor);
21590
21608
  const switcher = (label, ref, active = true) => `<div class="jodit-form__group">
21591
- <label>${i(label)}</label>
21592
-
21593
- <label class='jodit-switcher'>
21594
- <input ${act(active, 'checked')} data-ref="${ref}" type="checkbox"/>
21595
- <span class="jodit-switcher__slider"></span>
21609
+ <label class="jodit-switcher-wrapper">
21610
+ <span class='jodit-switcher'>
21611
+ <input ${act(active, 'checked')} data-ref="${ref}" type="checkbox"/>
21612
+ <span class="jodit-switcher__slider"></span>
21613
+ </span>
21614
+ <span>${i(label)}</span>
21596
21615
  </label>
21597
21616
  </div>`;
21598
21617
  return editor.create.fromHTML(`<form class="${jie} jodit-properties">
@@ -24658,11 +24677,13 @@ const TabsWidget = (jodit, tabs, state) => {
24658
24677
  return;
24659
24678
  }
24660
24679
  buttonList.forEach(b => {
24680
+ b.state.variant = 'initial';
24661
24681
  b.state.activated = false;
24662
24682
  });
24663
24683
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.$$)('.jodit-tab', tabBox).forEach(a => {
24664
24684
  a.classList.remove('jodit-tab_active');
24665
24685
  });
24686
+ nameToTab[tab].button.state.variant = 'outline';
24666
24687
  nameToTab[tab].button.state.activated = true;
24667
24688
  nameToTab[tab].tab.classList.add('jodit-tab_active');
24668
24689
  };
@@ -24691,7 +24712,7 @@ const TabsWidget = (jodit, tabs, state) => {
24691
24712
  content.call(jodit);
24692
24713
  }
24693
24714
  if (state) {
24694
- state.__activeTab = name;
24715
+ state.activeTab = name;
24695
24716
  }
24696
24717
  return false;
24697
24718
  });
@@ -24707,20 +24728,20 @@ const TabsWidget = (jodit, tabs, state) => {
24707
24728
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.$$)('a', buttons).forEach(a => {
24708
24729
  a.style.width = (100 / tabCount).toFixed(10) + '%';
24709
24730
  });
24710
- const tab = !state || !state.__activeTab || !nameToTab[state.__activeTab]
24731
+ const tab = !state || !state.activeTab || !nameToTab[state.activeTab]
24711
24732
  ? firstTab
24712
- : state.__activeTab;
24733
+ : state.activeTab;
24713
24734
  setActive(tab);
24714
24735
  if (state) {
24715
- let __activeTab = state.__activeTab;
24716
- Object.defineProperty(state, '__activeTab', {
24736
+ let activeTab = state.activeTab;
24737
+ Object.defineProperty(state, 'activeTab', {
24717
24738
  configurable: true,
24718
24739
  enumerable: false,
24719
24740
  get() {
24720
- return __activeTab;
24741
+ return activeTab;
24721
24742
  },
24722
24743
  set(value) {
24723
- __activeTab = value;
24744
+ activeTab = value;
24724
24745
  setActive(value);
24725
24746
  }
24726
24747
  });
@@ -25135,7 +25156,7 @@ class aiAssistant extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_3__/
25135
25156
  (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .extendLang */ .JW)(_langs__WEBPACK_IMPORTED_MODULE_6__);
25136
25157
  }
25137
25158
  /** @override */
25138
- afterInit(jodit) { }
25159
+ afterInit() { }
25139
25160
  onGenerateAiAssistantForm(prompt) {
25140
25161
  this.__dialog.open(this.__container, 'AI Assistant');
25141
25162
  this.__container.setPrompt(prompt);
@@ -25168,15 +25189,16 @@ class aiAssistant extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_3__/
25168
25189
  }
25169
25190
  /** @override */
25170
25191
  beforeDestruct(_) {
25171
- this.__container.destruct();
25172
- this.__dialog.destruct();
25192
+ var _a, _b;
25193
+ (_a = (0,jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_0__/* .cached */ .PO)(this, '__container')) === null || _a === void 0 ? void 0 : _a.destruct();
25194
+ (_b = (0,jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_0__/* .cached */ .PO)(this, '__dialog')) === null || _b === void 0 ? void 0 : _b.destruct();
25173
25195
  }
25174
25196
  }
25175
25197
  (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
25176
- jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_0__/* .cache */ .P
25198
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_0__/* .cache */ .PP
25177
25199
  ], aiAssistant.prototype, "__dialog", null);
25178
25200
  (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
25179
- jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_0__/* .cache */ .P
25201
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_0__/* .cache */ .PP
25180
25202
  ], aiAssistant.prototype, "__container", null);
25181
25203
  (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
25182
25204
  (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)(':generateAiAssistantForm.ai-assistant')
@@ -31007,9 +31029,6 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .pluginSystem */ .fg.add('image
31007
31029
  * Released under MIT see LICENSE.txt in the project root for license information.
31008
31030
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31009
31031
  */
31010
- /**
31011
- * @module plugins/image-properties
31012
- */
31013
31032
 
31014
31033
  jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.image = {
31015
31034
  dialogWidth: 600,
@@ -31039,18 +31058,19 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.image = {
31039
31058
 
31040
31059
  "use strict";
31041
31060
  /* unused harmony export imageProperties */
31042
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(31635);
31061
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(31635);
31043
31062
  /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22664);
31044
- /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56298);
31045
- /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65147);
31046
- /* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(35265);
31047
- /* harmony import */ var jodit_modules__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(37435);
31048
- /* harmony import */ var jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(53804);
31049
- /* harmony import */ var jodit_modules_widget__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(16116);
31050
- /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(24654);
31051
- /* harmony import */ var _templates_form__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(22254);
31052
- /* harmony import */ var _templates_main_tab__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(75263);
31053
- /* harmony import */ var _templates_position_tab__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(57837);
31063
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(55186);
31064
+ /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(56298);
31065
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(65147);
31066
+ /* harmony import */ var jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29866);
31067
+ /* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(35265);
31068
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(24654);
31069
+ /* harmony import */ var _ui_ui_image_form__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(31970);
31070
+ /* harmony import */ var _utils_open_image_editor__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(80778);
31071
+ /* harmony import */ var _utils_open_image_popup__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(33733);
31072
+ /* harmony import */ var _readers__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(5549);
31073
+ /* harmony import */ var _writers__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(30393);
31054
31074
  /*!
31055
31075
  * Jodit Editor (https://xdsoft.net/jodit/)
31056
31076
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -31082,55 +31102,93 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.image = {
31082
31102
  * });
31083
31103
  * ```
31084
31104
  */
31085
- const normalSizeToString = (value) => {
31086
- value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.trim)(value);
31087
- return /^[0-9]+$/.test(value) ? value + 'px' : value;
31088
- };
31089
- const normalSizeFromString = (value) => {
31090
- return /^[-+]?[0-9.]+px$/.test(value.toString())
31091
- ? parseFloat(value.toString())
31092
- : value;
31093
- };
31094
31105
  /**
31095
31106
  * Show dialog with image's options
31096
31107
  */
31097
- class imageProperties extends jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin {
31108
+ class imageProperties extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_4__/* .Plugin */ .k {
31098
31109
  constructor() {
31099
31110
  super(...arguments);
31100
31111
  this.state = {
31101
31112
  image: new Image(),
31113
+ sourceImage: new Image(),
31102
31114
  get ratio() {
31103
- return this.image.naturalWidth / this.image.naturalHeight || 1;
31115
+ const { naturalWidth, naturalHeight } = this.image;
31116
+ return naturalWidth / naturalHeight || 1;
31104
31117
  },
31105
31118
  sizeIsLocked: true,
31106
- marginIsLocked: true
31119
+ marginIsLocked: true,
31120
+ values: {
31121
+ style: '',
31122
+ imageSrc: '',
31123
+ borderRadius: 0,
31124
+ imageTitle: '',
31125
+ imageAlt: '',
31126
+ imageLink: '',
31127
+ imageLinkOpenInNewTab: false,
31128
+ imageWidth: 0,
31129
+ imageHeight: 0,
31130
+ marginTop: 0,
31131
+ marginRight: 0,
31132
+ marginBottom: 0,
31133
+ marginLeft: 0,
31134
+ classes: '',
31135
+ id: '',
31136
+ align: ''
31137
+ }
31107
31138
  };
31108
31139
  this.activeTabState = {
31109
- __activeTab: 'Image'
31140
+ activeTab: 'Image'
31110
31141
  };
31111
31142
  }
31112
- onChangeMarginIsLocked() {
31113
- if (!this.form) {
31114
- return;
31115
- }
31116
- const { marginRight, marginBottom, marginLeft, lockMargin } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
31117
- [marginRight, marginBottom, marginLeft].forEach(elm => {
31118
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(elm, 'disabled', this.state.marginIsLocked || null);
31143
+ get form() {
31144
+ return new _ui_ui_image_form__WEBPACK_IMPORTED_MODULE_7__/* .UIImagePropertiesForm */ .l(this.j, this.state, this.activeTabState, {
31145
+ openImageEditor: () => (0,_utils_open_image_editor__WEBPACK_IMPORTED_MODULE_8__/* .openImageEditorDialog */ .v)(this.j, this.state),
31146
+ openImagePopup: target => (0,_utils_open_image_popup__WEBPACK_IMPORTED_MODULE_9__/* .openImagePopup */ .q)(this.j, this.dialog, this.state, target)
31119
31147
  });
31120
- lockMargin.innerHTML = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Icon.get(this.state.marginIsLocked ? 'lock' : 'unlock');
31121
31148
  }
31122
- onChangeSizeIsLocked() {
31123
- if (!this.form) {
31124
- return;
31125
- }
31126
- const { lockSize, imageWidth } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
31127
- lockSize.innerHTML = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Icon.get(this.state.sizeIsLocked ? 'lock' : 'unlock');
31128
- lockSize.classList.remove('jodit-properties__lock');
31129
- lockSize.classList.remove('jodit-properties__unlock');
31130
- lockSize.classList.add(this.state.sizeIsLocked
31131
- ? 'jodit-properties__lock'
31132
- : 'jodit-properties__unlock');
31133
- this.j.e.fire(imageWidth, 'change');
31149
+ /**
31150
+ * Dialog for form
31151
+ */
31152
+ get dialog() {
31153
+ const { j } = this;
31154
+ const dialog = j.dlg({
31155
+ minWidth: Math.min(400, screen.width),
31156
+ minHeight: 590,
31157
+ buttons: ['fullsize', 'dialog.close']
31158
+ });
31159
+ const buttons = this.__buttons;
31160
+ buttons.check.onAction(() => {
31161
+ (0,_writers__WEBPACK_IMPORTED_MODULE_11__/* .applyValuesToImage */ .j)(j, this.state, this.state.sourceImage);
31162
+ j.synchronizeValues();
31163
+ dialog.close();
31164
+ });
31165
+ buttons.remove.onAction(() => {
31166
+ j.s.removeNode(this.state.sourceImage);
31167
+ dialog.close();
31168
+ });
31169
+ buttons.cancel.onAction(() => {
31170
+ dialog.close();
31171
+ });
31172
+ dialog.setHeader(j.i18n('Image properties'));
31173
+ dialog.setContent(this.form);
31174
+ dialog.setFooter([[buttons.cancel, buttons.remove], buttons.check]);
31175
+ j.e.on(dialog, 'afterClose', () => {
31176
+ if (this.state.image.parentNode &&
31177
+ j.o.image.selectImageAfterClose) {
31178
+ j.s.select(this.state.sourceImage);
31179
+ }
31180
+ });
31181
+ dialog.setSize(j.o.image.dialogWidth);
31182
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.markOwner)(j, dialog.container);
31183
+ return dialog;
31184
+ }
31185
+ get __buttons() {
31186
+ const { j } = this;
31187
+ return {
31188
+ check: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__/* .Button */ .$n)(j, 'ok', 'Apply', 'primary'),
31189
+ remove: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__/* .Button */ .$n)(j, 'bin', 'Delete'),
31190
+ cancel: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__/* .Button */ .$n)(j, 'cancel', 'Cancel')
31191
+ };
31134
31192
  }
31135
31193
  /**
31136
31194
  * Open dialog editing image properties
@@ -31147,358 +31205,24 @@ class imageProperties extends jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin
31147
31205
  * ```
31148
31206
  */
31149
31207
  open() {
31150
- this.makeForm();
31151
- this.activeTabState.__activeTab = 'Image';
31152
- this.j.e.fire('hidePopup');
31153
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.markOwner)(this.j, this.dialog.container);
31154
- this.state.marginIsLocked = true;
31155
- this.state.sizeIsLocked = true;
31156
- this.onChangeMarginIsLocked();
31157
- this.onChangeSizeIsLocked();
31158
- this.updateValues();
31208
+ this.activeTabState.activeTab = 'Image';
31209
+ this.__lock();
31159
31210
  this.dialog.open().setModal(true).setPosition();
31211
+ this.async
31212
+ .promise((resolve, reject) => (0,_readers__WEBPACK_IMPORTED_MODULE_10__/* .readValuesFromImage */ .U)(this.j, this.state).then(resolve, reject))
31213
+ .catch((e) => this.dialog.message.error(e.message))
31214
+ .finally(() => this.__unlock());
31160
31215
  return false;
31161
31216
  }
31162
- /**
31163
- * Create form for edit image properties
31164
- */
31165
- makeForm() {
31166
- if (this.dialog) {
31167
- return;
31168
- }
31169
- this.dialog = this.j.dlg({
31170
- minWidth: Math.min(400, screen.width),
31171
- minHeight: 590,
31172
- buttons: ['fullsize', 'dialog.close']
31173
- });
31174
- const editor = this.j, opt = editor.o, i18n = editor.i18n.bind(editor), buttons = {
31175
- check: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_3__/* .Button */ .$n)(editor, 'ok', 'Apply', 'primary'),
31176
- remove: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_3__/* .Button */ .$n)(editor, 'bin', 'Delete')
31177
- };
31178
- editor.e.on(this.dialog, 'afterClose', () => {
31179
- if (this.state.image.parentNode &&
31180
- opt.image.selectImageAfterClose) {
31181
- editor.s.select(this.state.image);
31182
- }
31183
- });
31184
- buttons.remove.onAction(() => {
31185
- editor.s.removeNode(this.state.image);
31186
- this.dialog.close();
31187
- });
31188
- const { dialog } = this;
31189
- dialog.setHeader(i18n('Image properties'));
31190
- const mainForm = (0,_templates_form__WEBPACK_IMPORTED_MODULE_8__/* .form */ .Z)(editor);
31191
- this.form = mainForm;
31192
- dialog.setContent(mainForm);
31193
- const { tabsBox } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
31194
- if (tabsBox) {
31195
- tabsBox.appendChild((0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_6__/* .TabsWidget */ .Zg)(editor, [
31196
- { name: 'Image', content: (0,_templates_main_tab__WEBPACK_IMPORTED_MODULE_9__/* .mainTab */ .J)(editor) },
31197
- { name: 'Advanced', content: (0,_templates_position_tab__WEBPACK_IMPORTED_MODULE_10__/* .positionTab */ .b)(editor) }
31198
- ], this.activeTabState));
31199
- }
31200
- buttons.check.onAction(this.onApply);
31201
- const { changeImage, editImage } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
31202
- editor.e.on(changeImage, 'click', this.openImagePopup);
31203
- if (opt.image.useImageEditor) {
31204
- editor.e.on(editImage, 'click', this.openImageEditor);
31205
- }
31206
- const { lockSize, lockMargin, imageWidth, imageHeight } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(mainForm);
31207
- if (lockSize) {
31208
- editor.e.on(lockSize, 'click', () => {
31209
- this.state.sizeIsLocked = !this.state.sizeIsLocked;
31210
- });
31211
- }
31212
- editor.e.on(lockMargin, 'click', (e) => {
31213
- this.state.marginIsLocked = !this.state.marginIsLocked;
31214
- e.preventDefault();
31215
- });
31216
- const changeSizes = (event) => {
31217
- if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isNumeric)(imageWidth.value) || !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isNumeric)(imageHeight.value)) {
31218
- return;
31219
- }
31220
- const w = parseFloat(imageWidth.value), h = parseFloat(imageHeight.value);
31221
- if (event.target === imageWidth) {
31222
- imageHeight.value = Math.round(w / this.state.ratio).toString();
31223
- }
31224
- else {
31225
- imageWidth.value = Math.round(h * this.state.ratio).toString();
31226
- }
31227
- };
31228
- editor.e.on([imageWidth, imageHeight], 'change keydown mousedown paste', (event) => {
31229
- if (!this.state.sizeIsLocked) {
31230
- return;
31231
- }
31232
- editor.async.setTimeout(changeSizes.bind(this, event), {
31233
- timeout: editor.defaultTimeout,
31234
- label: 'image-properties-changeSize'
31235
- });
31236
- });
31237
- dialog.setFooter([buttons.remove, buttons.check]);
31238
- dialog.setSize(this.j.o.image.dialogWidth);
31239
- }
31240
- /**
31241
- * Set input values from image
31242
- */
31243
- updateValues() {
31244
- const opt = this.j.o;
31245
- const { image } = this.state;
31246
- 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);
31247
- const updateLock = () => {
31248
- lockMargin.checked = this.state.marginIsLocked;
31249
- lockSize.checked = this.state.sizeIsLocked;
31250
- }, updateAlign = () => {
31251
- if (image.style.cssFloat &&
31252
- ['left', 'right'].indexOf(image.style.cssFloat.toLowerCase()) !== -1) {
31253
- align.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'float');
31254
- }
31255
- else {
31256
- if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'display') === 'block' &&
31257
- image.style.marginLeft === 'auto' &&
31258
- image.style.marginRight === 'auto') {
31259
- align.value = 'center';
31260
- }
31261
- }
31262
- }, updateBorderRadius = () => {
31263
- borderRadius.value = (parseInt(image.style.borderRadius || '0', 10) || '0').toString();
31264
- }, updateId = () => {
31265
- id.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'id') || '';
31266
- }, updateStyle = () => {
31267
- style.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'style') || '';
31268
- }, updateClasses = () => {
31269
- classes.value = ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'class') || '').replace(/jodit_focused_image[\s]*/, '');
31270
- }, updateMargins = () => {
31271
- if (!opt.image.editMargins) {
31272
- return;
31273
- }
31274
- let equal = true, wasEmptyField = false;
31275
- [marginTop, marginRight, marginBottom, marginLeft].forEach(elm => {
31276
- const id = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(elm, 'data-ref') || '';
31277
- let value = image.style.getPropertyValue((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.kebabCase)(id));
31278
- if (!value) {
31279
- wasEmptyField = true;
31280
- elm.value = '';
31281
- return;
31282
- }
31283
- if (/^[0-9]+(px)?$/.test(value)) {
31284
- value = parseInt(value, 10);
31285
- }
31286
- elm.value = value.toString() || '';
31287
- if ((wasEmptyField && elm.value) ||
31288
- (equal &&
31289
- id !== 'marginTop' &&
31290
- elm.value !== marginTop.value)) {
31291
- equal = false;
31292
- }
31293
- });
31294
- this.state.marginIsLocked = equal;
31295
- }, updateSizes = () => {
31296
- const width = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'width') ||
31297
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'width', true) ||
31298
- false, height = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'height') ||
31299
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'height', true) ||
31300
- false;
31301
- imageWidth.value =
31302
- width !== false
31303
- ? normalSizeFromString(width).toString()
31304
- : image.offsetWidth.toString();
31305
- imageHeight.value =
31306
- height !== false
31307
- ? normalSizeFromString(height).toString()
31308
- : image.offsetHeight.toString();
31309
- this.state.sizeIsLocked = (() => {
31310
- if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isNumeric)(imageWidth.value) ||
31311
- !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isNumeric)(imageHeight.value)) {
31312
- return false;
31313
- }
31314
- const w = parseFloat(imageWidth.value), h = parseFloat(imageHeight.value);
31315
- return Math.abs(w - h * this.state.ratio) < 1;
31316
- })();
31317
- }, updateText = () => {
31318
- imageTitle.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'title') || '';
31319
- imageAlt.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'alt') || '';
31320
- const a = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(image, 'a', this.j.editor);
31321
- if (a) {
31322
- imageLink.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(a, 'href') || '';
31323
- imageLinkOpenInNewTab.checked =
31324
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(a, 'target') === '_blank';
31325
- }
31326
- else {
31327
- imageLink.value = '';
31328
- imageLinkOpenInNewTab.checked = false;
31329
- }
31330
- }, updateSrc = () => {
31331
- imageSrc.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'src') || '';
31332
- if (imageViewSrc) {
31333
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(imageViewSrc, 'src', (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'src') || '');
31334
- }
31335
- };
31336
- updateLock();
31337
- updateSrc();
31338
- updateText();
31339
- updateSizes();
31340
- updateMargins();
31341
- updateClasses();
31342
- updateId();
31343
- updateBorderRadius();
31344
- updateAlign();
31345
- updateStyle();
31346
- }
31347
- /**
31348
- * Apply form's values to image
31349
- */
31350
- onApply() {
31351
- 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);
31352
- const opt = this.j.o;
31353
- const { image } = this.state;
31354
- // styles
31355
- if (opt.image.editStyle) {
31356
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'style', style.value || null);
31357
- }
31358
- // Src
31359
- if (imageSrc.value) {
31360
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'src', imageSrc.value);
31361
- }
31362
- else {
31363
- jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove(image);
31364
- this.dialog.close();
31365
- return;
31366
- }
31367
- // Border radius
31368
- if (borderRadius.value !== '0' && /^[0-9]+$/.test(borderRadius.value)) {
31369
- image.style.borderRadius = borderRadius.value + 'px';
31370
- }
31371
- else {
31372
- image.style.borderRadius = '';
31373
- }
31374
- // Title
31375
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'title', imageTitle.value || null);
31376
- // Alt
31377
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'alt', imageAlt.value || null);
31378
- // Link
31379
- let link = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(image, 'a', this.j.editor);
31380
- if (imageLink.value) {
31381
- if (!link) {
31382
- link = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.wrap(image, 'a', this.j.createInside);
31383
- }
31384
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(link, 'href', imageLink.value);
31385
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(link, 'target', imageLinkOpenInNewTab.checked ? '_blank' : null);
31386
- }
31387
- else {
31388
- if (link && link.parentNode) {
31389
- link.parentNode.replaceChild(image, link);
31390
- }
31391
- }
31392
- // Size
31393
- if (imageWidth.value !== image.offsetWidth.toString() ||
31394
- imageHeight.value !== image.offsetHeight.toString()) {
31395
- const updatedtWidth = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.trim)(imageWidth.value)
31396
- ? normalSizeToString(imageWidth.value)
31397
- : null;
31398
- const updatedHeight = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.trim)(imageHeight.value)
31399
- ? normalSizeToString(imageHeight.value)
31400
- : null;
31401
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, {
31402
- width: updatedtWidth,
31403
- height: updatedHeight
31404
- });
31405
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'width', (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'width') ? updatedtWidth : null);
31406
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'height', (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'height') ? updatedHeight : null);
31407
- }
31408
- const margins = [marginTop, marginRight, marginBottom, marginLeft];
31409
- if (opt.image.editMargins) {
31410
- if (!this.state.marginIsLocked) {
31411
- margins.forEach((margin) => {
31412
- const side = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(margin, 'data-ref') || '';
31413
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, side, normalSizeToString(margin.value));
31414
- });
31415
- }
31416
- else {
31417
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'margin', normalSizeToString(marginTop.value));
31418
- }
31419
- }
31420
- if (opt.image.editClass) {
31421
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'class', classes.value || null);
31422
- }
31423
- if (opt.image.editId) {
31424
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'id', id.value || null);
31425
- }
31426
- if (opt.image.editAlign) {
31427
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.hAlignElement)(image, align.value);
31428
- }
31429
- this.j.synchronizeValues();
31430
- this.dialog.close();
31431
- }
31432
- /**
31433
- * Open image editor dialog
31434
- */
31435
- openImageEditor() {
31436
- const url = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src') || '', a = this.j.c.element('a'), loadExternal = () => {
31437
- if (a.host !== location.host) {
31438
- this.j.confirm('You can only edit your own images. Download this image on the host?', yes => {
31439
- if (yes && this.j.uploader) {
31440
- this.j.uploader.uploadRemoteImage(a.href.toString(), resp => {
31441
- this.j.alert('The image has been successfully uploaded to the host!', () => {
31442
- if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isString)(resp.newfilename)) {
31443
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src', resp.baseurl +
31444
- resp.newfilename);
31445
- this.updateValues();
31446
- }
31447
- });
31448
- }, error => {
31449
- this.j.alert('There was an error loading %s', error.message);
31450
- });
31451
- }
31452
- });
31453
- return;
31454
- }
31455
- };
31456
- a.href = url;
31457
- this.j.filebrowser.dataProvider
31458
- .getPathByUrl(a.href.toString())
31459
- .then(resp => {
31460
- jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_5__/* .openImageEditor */ .B.call(this.j.filebrowser, a.href, resp.name, resp.path, resp.source, () => {
31461
- const timestamp = new Date().getTime();
31462
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src', url +
31463
- (url.indexOf('?') !== -1 ? '' : '?') +
31464
- '&_tmp=' +
31465
- timestamp.toString());
31466
- this.updateValues();
31467
- }, error => {
31468
- this.j.alert(error.message);
31469
- });
31470
- })
31471
- .catch(error => {
31472
- this.j.alert(error.message, loadExternal);
31473
- });
31217
+ __lock() {
31218
+ this.dialog.lock();
31219
+ this.form.setMod('lock', true);
31220
+ Object.values(this.__buttons).forEach(b => (b.state.disabled = true));
31474
31221
  }
31475
- /**
31476
- * Open popup with filebrowser/uploader buttons for image
31477
- */
31478
- openImagePopup(event) {
31479
- const popup = new jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Popup(this.j), { changeImage } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
31480
- popup.setZIndex(this.dialog.getZIndex() + 1);
31481
- popup
31482
- .setContent((0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_6__/* .FileSelectorWidget */ .kG)(this.j, {
31483
- upload: (data) => {
31484
- if (data.files && data.files.length) {
31485
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src', data.baseurl + data.files[0]);
31486
- }
31487
- this.updateValues();
31488
- popup.close();
31489
- },
31490
- filebrowser: (data) => {
31491
- if (data &&
31492
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isArray)(data.files) &&
31493
- data.files.length) {
31494
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src', data.files[0]);
31495
- popup.close();
31496
- this.updateValues();
31497
- }
31498
- }
31499
- }, this.state.image, popup.close))
31500
- .open(() => (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.position)(changeImage));
31501
- event.stopPropagation();
31222
+ __unlock() {
31223
+ this.dialog.unlock();
31224
+ this.form.setMod('lock', false);
31225
+ Object.values(this.__buttons).forEach(b => (b.state.disabled = false));
31502
31226
  }
31503
31227
  /** @override **/
31504
31228
  afterInit(editor) {
@@ -31509,7 +31233,7 @@ class imageProperties extends jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin
31509
31233
  .off(editor.editor, '.imageproperties')
31510
31234
  .on(editor.editor, 'dblclick.imageproperties', (e) => {
31511
31235
  const image = e.target;
31512
- if (!jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(image, 'img')) {
31236
+ if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isTag(image, 'img')) {
31513
31237
  return;
31514
31238
  }
31515
31239
  if (editor.o.image.openOnDblClick) {
@@ -31517,7 +31241,8 @@ class imageProperties extends jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin
31517
31241
  false) {
31518
31242
  return;
31519
31243
  }
31520
- self.state.image = image;
31244
+ self.state.sourceImage = image;
31245
+ self.state.image = image.cloneNode(true);
31521
31246
  if (!editor.o.readonly) {
31522
31247
  e.stopImmediatePropagation();
31523
31248
  e.preventDefault();
@@ -31531,206 +31256,1267 @@ class imageProperties extends jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin
31531
31256
  });
31532
31257
  })
31533
31258
  .on('openImageProperties.imageproperties', (image) => {
31534
- this.state.image = image;
31259
+ self.state.sourceImage = image;
31260
+ this.state.image = image.cloneNode(true);
31535
31261
  this.open();
31536
31262
  });
31537
31263
  }
31264
+ onStateValuesImageSrcChange() {
31265
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__awaiter */ .sH)(this, void 0, void 0, function* () {
31266
+ const { image, values } = this.state;
31267
+ if (!image.src) {
31268
+ return;
31269
+ }
31270
+ try {
31271
+ this.__lock();
31272
+ yield image.decode();
31273
+ if (this.state.sizeIsLocked && (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.isNumeric)(values.imageWidth)) {
31274
+ const w = parseFloat(values.imageWidth.toString());
31275
+ values.imageHeight = Math.round(w / this.state.ratio);
31276
+ }
31277
+ this.j.e.fire('updateImageProperties.imageproperties', image);
31278
+ }
31279
+ catch (e) {
31280
+ this.j.alert(e.message);
31281
+ }
31282
+ finally {
31283
+ this.__unlock();
31284
+ }
31285
+ });
31286
+ }
31538
31287
  /** @override */
31539
31288
  beforeDestruct(editor) {
31540
- this.dialog && this.dialog.destruct();
31289
+ var _a, _b, _c;
31290
+ Object.values((_a = (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cached)(this, '__buttons')) !== null && _a !== void 0 ? _a : {}).forEach(b => b.destruct());
31291
+ (_b = (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cached)(this, 'dialog')) === null || _b === void 0 ? void 0 : _b.destruct();
31292
+ (_c = (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cached)(this, 'form')) === null || _c === void 0 ? void 0 : _c.destruct();
31541
31293
  editor.e.off(editor.editor, '.imageproperties').off('.imageproperties');
31542
31294
  }
31543
31295
  }
31544
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
31545
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.marginIsLocked')
31546
- ], imageProperties.prototype, "onChangeMarginIsLocked", null);
31547
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
31548
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.sizeIsLocked')
31549
- ], imageProperties.prototype, "onChangeSizeIsLocked", null);
31550
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
31551
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.autobind
31552
- ], imageProperties.prototype, "onApply", null);
31553
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
31554
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.autobind
31555
- ], imageProperties.prototype, "openImageEditor", null);
31556
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
31557
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.autobind
31558
- ], imageProperties.prototype, "openImagePopup", null);
31559
- jodit_core_global__WEBPACK_IMPORTED_MODULE_1__/* .pluginSystem */ .fg.add('imageProperties', imageProperties);
31296
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
31297
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cache
31298
+ ], imageProperties.prototype, "form", null);
31299
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
31300
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cache
31301
+ ], imageProperties.prototype, "dialog", null);
31302
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
31303
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cache
31304
+ ], imageProperties.prototype, "__buttons", null);
31305
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
31306
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.image')
31307
+ ], imageProperties.prototype, "onStateValuesImageSrcChange", null);
31308
+ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .pluginSystem */ .fg.add('imageProperties', imageProperties);
31560
31309
 
31561
31310
 
31562
31311
  /***/ }),
31563
31312
 
31564
- /***/ 22254:
31313
+ /***/ 74260:
31565
31314
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31566
31315
 
31567
31316
  "use strict";
31568
31317
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31569
- /* harmony export */ Z: function() { return /* binding */ form; }
31318
+ /* harmony export */ g: function() { return /* binding */ readAlign; }
31570
31319
  /* harmony export */ });
31571
- /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(931);
31320
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(38322);
31321
+ /*!
31322
+ * Jodit Editor (https://xdsoft.net/jodit/)
31323
+ * Released under MIT see LICENSE.txt in the project root for license information.
31324
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31325
+ */
31326
+
31327
+ /** @private */
31328
+ function readAlign(image, values) {
31329
+ // Align
31330
+ if (image.style.cssFloat &&
31331
+ ['left', 'right'].indexOf(image.style.cssFloat.toLowerCase()) !== -1) {
31332
+ values.align = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_0__/* .css */ .A)(image, 'float');
31333
+ }
31334
+ else {
31335
+ if ((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_0__/* .css */ .A)(image, 'display') === 'block' &&
31336
+ image.style.marginLeft === 'auto' &&
31337
+ image.style.marginRight === 'auto') {
31338
+ values.align = 'center';
31339
+ }
31340
+ else {
31341
+ values.align = '';
31342
+ }
31343
+ }
31344
+ }
31345
+
31346
+
31347
+ /***/ }),
31348
+
31349
+ /***/ 5549:
31350
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31351
+
31352
+ "use strict";
31353
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31354
+ /* harmony export */ U: function() { return /* binding */ readValuesFromImage; }
31355
+ /* harmony export */ });
31356
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(31635);
31357
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26150);
31358
+ /* harmony import */ var _align__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(74260);
31359
+ /* harmony import */ var _link__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(33201);
31360
+ /* harmony import */ var _margin__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(85079);
31361
+ /* harmony import */ var _size__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(17880);
31572
31362
  /*!
31573
31363
  * Jodit Editor (https://xdsoft.net/jodit/)
31574
31364
  * Released under MIT see LICENSE.txt in the project root for license information.
31575
31365
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31576
31366
  */
31577
31367
 
31578
- function form(editor) {
31579
- 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);
31580
- return editor.c.fromHTML(`<form class="jodit-properties">
31368
+
31369
+
31370
+
31371
+
31372
+
31373
+ /**
31374
+ * Read values from image and set it to state
31375
+ * @private
31376
+ */
31377
+ function readValuesFromImage(j, state) {
31378
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__awaiter */ .sH)(this, void 0, void 0, function* () {
31379
+ const { sourceImage: image, values } = state;
31380
+ (0,_align__WEBPACK_IMPORTED_MODULE_4__/* .readAlign */ .g)(image, values);
31381
+ // Border radius
31382
+ values.borderRadius = parseInt(image.style.borderRadius || '0', 10) || 0;
31383
+ // Id
31384
+ values.id = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'id') || '';
31385
+ // Title
31386
+ values.imageTitle = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'title') || '';
31387
+ // Alt
31388
+ values.imageAlt = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'alt') || '';
31389
+ // Style
31390
+ values.style = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'style') || '';
31391
+ // Classes
31392
+ values.classes = ((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'class') || '').replace(/jodit_focused_image[\s]*/, '');
31393
+ // Margins
31394
+ (0,_margin__WEBPACK_IMPORTED_MODULE_5__/* .readMargins */ .E)(image, values, state);
31395
+ // Link
31396
+ (0,_link__WEBPACK_IMPORTED_MODULE_1__/* .readLink */ .X)(state, j, values);
31397
+ // Src
31398
+ values.imageSrc = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'src') || '';
31399
+ // Image size
31400
+ return (0,_size__WEBPACK_IMPORTED_MODULE_2__/* .readSizes */ .P)(image, values, state);
31401
+ });
31402
+ }
31403
+
31404
+
31405
+ /***/ }),
31406
+
31407
+ /***/ 33201:
31408
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31409
+
31410
+ "use strict";
31411
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31412
+ /* harmony export */ X: function() { return /* binding */ readLink; }
31413
+ /* harmony export */ });
31414
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55186);
31415
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26150);
31416
+ /*!
31417
+ * Jodit Editor (https://xdsoft.net/jodit/)
31418
+ * Released under MIT see LICENSE.txt in the project root for license information.
31419
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31420
+ */
31421
+
31422
+
31423
+ /** @private */
31424
+ function readLink(state, j, values) {
31425
+ const a = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.closest(state.sourceImage, 'a', j.editor);
31426
+ if (a) {
31427
+ values.imageLink = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(a, 'href') || '';
31428
+ values.imageLinkOpenInNewTab = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(a, 'target') === '_blank';
31429
+ }
31430
+ else {
31431
+ values.imageLink = '';
31432
+ values.imageLinkOpenInNewTab = false;
31433
+ }
31434
+ }
31435
+
31436
+
31437
+ /***/ }),
31438
+
31439
+ /***/ 85079:
31440
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31441
+
31442
+ "use strict";
31443
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31444
+ /* harmony export */ E: function() { return /* binding */ readMargins; }
31445
+ /* harmony export */ });
31446
+ /* harmony import */ var jodit_core_helpers_string_kebab_case__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(449);
31447
+ /*!
31448
+ * Jodit Editor (https://xdsoft.net/jodit/)
31449
+ * Released under MIT see LICENSE.txt in the project root for license information.
31450
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31451
+ */
31452
+
31453
+ /** @private */
31454
+ function readMargins(image, values, state) {
31455
+ // Margins
31456
+ let equal = true, wasEmptyField = false;
31457
+ ['marginTop', 'marginRight', 'marginBottom', 'marginLeft'].forEach(id => {
31458
+ let value = image.style.getPropertyValue((0,jodit_core_helpers_string_kebab_case__WEBPACK_IMPORTED_MODULE_0__/* .kebabCase */ .k)(id));
31459
+ if (!value) {
31460
+ wasEmptyField = true;
31461
+ values[id] = 0;
31462
+ return;
31463
+ }
31464
+ if (/^[0-9]+(px)?$/.test(value)) {
31465
+ value = parseInt(value, 10);
31466
+ }
31467
+ values[id] = value;
31468
+ if ((wasEmptyField && values[id]) ||
31469
+ (equal && id !== 'marginTop' && values[id] !== values.marginTop)) {
31470
+ equal = false;
31471
+ }
31472
+ });
31473
+ state.marginIsLocked = equal;
31474
+ }
31475
+
31476
+
31477
+ /***/ }),
31478
+
31479
+ /***/ 17880:
31480
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31481
+
31482
+ "use strict";
31483
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31484
+ /* harmony export */ P: function() { return /* binding */ readSizes; }
31485
+ /* harmony export */ });
31486
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(31635);
31487
+ /* harmony import */ var jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(12461);
31488
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26150);
31489
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(38322);
31490
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9645);
31491
+ /*!
31492
+ * Jodit Editor (https://xdsoft.net/jodit/)
31493
+ * Released under MIT see LICENSE.txt in the project root for license information.
31494
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31495
+ */
31496
+
31497
+
31498
+
31499
+
31500
+
31501
+ /** @private */
31502
+ function readSizes(image, values, state) {
31503
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_2__/* .__awaiter */ .sH)(this, void 0, void 0, function* () {
31504
+ yield image.decode();
31505
+ const width = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'width') || (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__/* .css */ .A)(image, 'width', true) || false;
31506
+ const height = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'height') || (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__/* .css */ .A)(image, 'height', true) || false;
31507
+ values.imageWidth =
31508
+ width !== false
31509
+ ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeFromString */ .G)(width)
31510
+ : image.offsetWidth || image.naturalWidth;
31511
+ values.imageHeight =
31512
+ height !== false
31513
+ ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeFromString */ .G)(height)
31514
+ : image.offsetHeight || image.naturalHeight;
31515
+ const { imageWidth, imageHeight } = values;
31516
+ const w = parseFloat(imageWidth.toString());
31517
+ if (!(0,jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_4__/* .isNumeric */ .k)(imageWidth) || !(0,jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_4__/* .isNumeric */ .k)(imageHeight)) {
31518
+ state.sizeIsLocked = false;
31519
+ return;
31520
+ }
31521
+ if (height === false) {
31522
+ values.imageHeight = Math.round(w / state.ratio);
31523
+ state.sizeIsLocked = true;
31524
+ return;
31525
+ }
31526
+ const h = parseFloat(imageHeight.toString());
31527
+ state.sizeIsLocked = Math.abs(w - h * state.ratio) < 1;
31528
+ });
31529
+ }
31530
+
31531
+
31532
+ /***/ }),
31533
+
31534
+ /***/ 31970:
31535
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31536
+
31537
+ "use strict";
31538
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31539
+ /* harmony export */ l: function() { return /* binding */ UIImagePropertiesForm; }
31540
+ /* harmony export */ });
31541
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(31635);
31542
+ /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22664);
31543
+ /* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(24767);
31544
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(65147);
31545
+ /* harmony import */ var jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6455);
31546
+ /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(931);
31547
+ /* harmony import */ var jodit_modules_widget__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(16116);
31548
+ /* harmony import */ var _ui_image_main_tab__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(33403);
31549
+ /* harmony import */ var _ui_image_position_tab__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(46681);
31550
+ /*!
31551
+ * Jodit Editor (https://xdsoft.net/jodit/)
31552
+ * Released under MIT see LICENSE.txt in the project root for license information.
31553
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31554
+ */
31555
+
31556
+
31557
+
31558
+
31559
+
31560
+
31561
+
31562
+
31563
+
31564
+
31565
+ /** @private */
31566
+ let UIImagePropertiesForm = class UIImagePropertiesForm extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_2__/* .UIGroup */ .U {
31567
+ className() {
31568
+ return 'UIImagePropertiesForm';
31569
+ }
31570
+ appendChildToContainer() { }
31571
+ getElm(elementName) {
31572
+ const selfElm = super.getElm(elementName);
31573
+ if (selfElm) {
31574
+ return selfElm;
31575
+ }
31576
+ for (const child of this.elements) {
31577
+ const elm = child.getElm(elementName);
31578
+ if (elm) {
31579
+ return elm;
31580
+ }
31581
+ }
31582
+ return null;
31583
+ }
31584
+ constructor(jodit, state, activeTabState, handlers) {
31585
+ super(jodit);
31586
+ this.state = state;
31587
+ this.handlers = handlers;
31588
+ this.__mainTab = new _ui_image_main_tab__WEBPACK_IMPORTED_MODULE_5__/* .UIImageMainTab */ .k(this.jodit, this.state, this.handlers);
31589
+ this.__positionTab = new _ui_image_position_tab__WEBPACK_IMPORTED_MODULE_6__/* .UIImagePositionTab */ ._(this.jodit, this.state, this.handlers);
31590
+ this.getElm('tabsBox').appendChild((0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_4__/* .TabsWidget */ .Zg)(jodit, [
31591
+ { name: 'Image', content: this.__mainTab },
31592
+ { name: 'Advanced', content: this.__positionTab }
31593
+ ], activeTabState));
31594
+ this.setMod('lock-size', this.state.sizeIsLocked);
31595
+ this.append(this.__mainTab).append(this.__positionTab);
31596
+ }
31597
+ render() {
31598
+ return `<form>
31581
31599
  <div class="jodit-grid jodit-grid_xs-column">
31582
31600
  <div class="jodit_col-lg-2-5 jodit_col-xs-5-5">
31583
- <div class="jodit-properties_view_box">
31584
- <div style="${!showPreview ? 'display:none' : ''}" class="jodit-properties_image_view">
31585
- <img data-ref="imageViewSrc" src="" alt=""/>
31601
+ <div class="&__view-box">
31602
+ <div class="&__imageView">
31603
+ <img class="&__imageViewSrc" src="" alt=""/>
31586
31604
  </div>
31587
- <div style="${!editSize ? 'display:none' : ''}" class="jodit-form__group jodit-properties_image_sizes">
31588
- <input data-ref="imageWidth" type="text" class="jodit-input"/>
31589
- <a data-ref="lockSize" class="jodit-properties__lock">${gi('lock')}</a>
31590
- <input data-ref="imageHeight" type="text" class="imageHeight jodit-input"/>
31605
+ <div class="jodit-form__group &__imageSizes">
31606
+ <input type="text" class="jodit-input &__imageWidth"/>
31607
+ <a class="&__lockSize">${jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__/* .Icon */ .I.get('lock')}</a>
31608
+ <input type="text" class="&__imageHeight jodit-input"/>
31591
31609
  </div>
31592
31610
  </div>
31593
31611
  </div>
31594
- <div data-ref="tabsBox" class="jodit_col-lg-3-5 jodit_col-xs-5-5"></div>
31612
+ <div class="jodit_col-lg-3-5 jodit_col-xs-5-5 &__tabsBox"></div>
31595
31613
  </div>
31596
- </form>`);
31597
- }
31614
+ </form>`;
31615
+ }
31616
+ onChangeSizeIsLocked() {
31617
+ const lockSize = this.getElm('lockSize');
31618
+ const imageWidth = this.getElm('imageWidth');
31619
+ lockSize.innerHTML = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__/* .Icon */ .I.get(this.state.sizeIsLocked ? 'lock' : 'unlock');
31620
+ this.setMod('lock-size', this.state.sizeIsLocked);
31621
+ this.j.e.fire(imageWidth, 'change');
31622
+ }
31623
+ onLockSizeClick() {
31624
+ this.state.sizeIsLocked = !this.state.sizeIsLocked;
31625
+ }
31626
+ onStateValuesSizeChange() {
31627
+ const imageWidth = this.getElm('imageWidth');
31628
+ const imageHeight = this.getElm('imageHeight');
31629
+ if (imageWidth !== this.j.od.activeElement) {
31630
+ imageWidth.value = this.state.values.imageWidth.toString();
31631
+ }
31632
+ if (imageHeight !== this.j.od.activeElement) {
31633
+ imageHeight.value = this.state.values.imageHeight.toString();
31634
+ }
31635
+ }
31636
+ onImageWidthChange(e) {
31637
+ const imageWidth = this.getElm('imageWidth');
31638
+ const imageHeight = this.getElm('imageHeight');
31639
+ if (!this.state.sizeIsLocked ||
31640
+ !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.isNumeric)(imageWidth.value) ||
31641
+ !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.isNumeric)(imageHeight.value)) {
31642
+ this.state.values.imageWidth = imageWidth.value;
31643
+ this.state.values.imageHeight = imageHeight.value;
31644
+ return;
31645
+ }
31646
+ const w = parseFloat(imageWidth.value), h = parseFloat(imageHeight.value);
31647
+ if (e.target === imageWidth) {
31648
+ this.state.values.imageWidth = w;
31649
+ this.state.values.imageHeight = Math.round(w / this.state.ratio);
31650
+ }
31651
+ else {
31652
+ this.state.values.imageWidth = Math.round(h * this.state.ratio);
31653
+ this.state.values.imageHeight = h;
31654
+ }
31655
+ }
31656
+ onStateValuesImageSrcChange() {
31657
+ const { imageSrc } = this.state.values;
31658
+ if (!imageSrc) {
31659
+ return;
31660
+ }
31661
+ const imageViewSrc = this.getElm('imageViewSrc');
31662
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.attr)(imageViewSrc, 'src', imageSrc);
31663
+ const image = new Image();
31664
+ image.src = imageSrc;
31665
+ this.state.image = image;
31666
+ }
31667
+ hideFieldByOptions() {
31668
+ const opt = this.j.o.image;
31669
+ [
31670
+ ['editSize', 'imageSizes'],
31671
+ ['showPreview', 'imageView']
31672
+ ].forEach(([optKey, elmKey]) => {
31673
+ const elm = this.getElm(elmKey);
31674
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.css)(elm, 'display', opt[optKey] ? null : 'none');
31675
+ });
31676
+ }
31677
+ };
31678
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31679
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready'),
31680
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.sizeIsLocked')
31681
+ ], UIImagePropertiesForm.prototype, "onChangeSizeIsLocked", null);
31682
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31683
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('lockSize:click')
31684
+ ], UIImagePropertiesForm.prototype, "onLockSizeClick", null);
31685
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31686
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready'),
31687
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)(['state.values.imageWidth', 'state.values.imageHeight'])
31688
+ ], UIImagePropertiesForm.prototype, "onStateValuesSizeChange", null);
31689
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31690
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([
31691
+ 'imageWidth:change',
31692
+ 'imageHeight:change',
31693
+ 'imageWidth:keydown',
31694
+ 'imageHeight:keydown',
31695
+ 'imageWidth:mousedown',
31696
+ 'imageHeight:mousedown',
31697
+ 'imageWidth:paste',
31698
+ 'imageHeight:paste'
31699
+ ]),
31700
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.debounce)()
31701
+ ], UIImagePropertiesForm.prototype, "onImageWidthChange", null);
31702
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31703
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready'),
31704
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.values.imageSrc')
31705
+ ], UIImagePropertiesForm.prototype, "onStateValuesImageSrcChange", null);
31706
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31707
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready')
31708
+ ], UIImagePropertiesForm.prototype, "hideFieldByOptions", null);
31709
+ UIImagePropertiesForm = (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31710
+ jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_8__/* .component */ .s
31711
+ ], UIImagePropertiesForm);
31712
+
31598
31713
 
31599
31714
 
31600
31715
  /***/ }),
31601
31716
 
31602
- /***/ 75263:
31717
+ /***/ 33403:
31603
31718
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31604
31719
 
31605
31720
  "use strict";
31606
31721
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31607
- /* harmony export */ J: function() { return /* binding */ mainTab; }
31722
+ /* harmony export */ k: function() { return /* binding */ UIImageMainTab; }
31608
31723
  /* harmony export */ });
31609
- /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(931);
31724
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(31635);
31725
+ /* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(24767);
31726
+ /* harmony import */ var jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71151);
31727
+ /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(66927);
31728
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65147);
31729
+ /* harmony import */ var jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6455);
31610
31730
  /*!
31611
31731
  * Jodit Editor (https://xdsoft.net/jodit/)
31612
31732
  * Released under MIT see LICENSE.txt in the project root for license information.
31613
31733
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31614
31734
  */
31615
31735
 
31616
- function mainTab(editor) {
31617
- 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;
31618
- return editor.c.fromHTML(`<div style="${!opt.image.editSrc ? 'display:none' : ''}" class="jodit-form__group">
31619
- <label>${i18n('Src')}</label>
31736
+
31737
+
31738
+
31739
+
31740
+
31741
+ /** @private */
31742
+ let UIImageMainTab = class UIImageMainTab extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_3__/* .UIGroup */ .U {
31743
+ className() {
31744
+ return 'UIImageMainTab';
31745
+ }
31746
+ appendChildToContainer() {
31747
+ // Do nothing
31748
+ }
31749
+ constructor(view, state, handlers) {
31750
+ super(view);
31751
+ this.state = state;
31752
+ this.handlers = handlers;
31753
+ }
31754
+ render() {
31755
+ return `<div class="jodit-form__group &__editSrc">
31756
+ <label>~Src~</label>
31620
31757
  <div class="jodit-input_group">
31621
- <input data-ref="imageSrc" class="jodit-input" type="text"/>
31622
- <div
31623
- class="jodit-input_group-buttons"
31624
- style="${hasFbUrl ? '' : 'display: none'}"
31625
- >
31626
- <a
31627
- data-ref="changeImage"
31628
- class="jodit-button"
31629
- >${gi('image')}</a>
31630
- <a
31631
- data-ref="editImage"
31632
- class="jodit-button"
31633
- style="${hasEditor ? '' : 'display: none'}"
31634
- >${gi('crop')}</a>
31758
+ <input class="jodit-input &__imageSrc" type="text"/>
31759
+ <div class="jodit-input_group-buttons &__fixImage">
31760
+ <a class="jodit-button &__changeImage">*image*</a>
31761
+ <a class="jodit-button &__editImage">*crop*</a>
31635
31762
  </div>
31636
31763
  </div>
31637
31764
  </div>
31638
- <div style="${!opt.image.editTitle ? 'display:none' : ''}" class="jodit-form__group">
31639
- <label>${i18n('Title')}</label>
31640
- <input data-ref="imageTitle" type="text" class="jodit-input"/>
31765
+ <div class="jodit-form__group &__editTitle">
31766
+ <label>~Title~</label>
31767
+ <input type="text" class="jodit-input &__imageTitle"/>
31641
31768
  </div>
31642
- <div style="${!opt.image.editAlt ? 'display:none' : ''}" class="jodit-form__group">
31643
- <label>${i18n('Alternative')}</label>
31644
- <input data-ref="imageAlt" type="text" class="jodit-input"/>
31769
+ <div class="jodit-form__group &__editAlt">
31770
+ <label>~Alternative~</label>
31771
+ <input type="text" class="jodit-input &__imageAlt"/>
31645
31772
  </div>
31646
- <div style="${!opt.image.editLink ? 'display:none' : ''}" class="jodit-form__group">
31647
- <label>${i18n('Link')}</label>
31648
- <input data-ref="imageLink" type="text" class="jodit-input"/>
31773
+ <div class="jodit-form__group &__editLink">
31774
+ <label>~Link~</label>
31775
+ <input type="text" class="jodit-input &__imageLink"/>
31649
31776
  </div>
31650
- <div style="${!opt.image.editLink ? 'display:none' : ''}" class="jodit-form__group">
31777
+ <div class="jodit-form__group &__editLinkTarget">
31651
31778
  <label class="jodit_vertical_middle">
31652
- <input data-ref="imageLinkOpenInNewTab" type="checkbox" class="jodit-checkbox"/>
31653
- <span>${i18n('Open link in new tab')}</span>
31779
+ <input type="checkbox" class="jodit-checkbox &__imageLinkOpenInNewTab"/>
31780
+ <span>~Open link in new tab~</span>
31654
31781
  </label>
31655
- </div>`);
31656
- }
31782
+ </div>`;
31783
+ }
31784
+ onStateImageSrcChange() {
31785
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__awaiter */ .sH)(this, void 0, void 0, function* () {
31786
+ const imageSrc = this.getElm('imageSrc');
31787
+ imageSrc.value = this.state.values.imageSrc;
31788
+ });
31789
+ }
31790
+ onImageSrcChange() {
31791
+ this.state.values.imageSrc = this.getElm('imageSrc').value;
31792
+ }
31793
+ /**
31794
+ * Open image editor
31795
+ */
31796
+ onEditImageClick(e) {
31797
+ this.handlers.openImageEditor();
31798
+ e.stopPropagation();
31799
+ }
31800
+ /**
31801
+ * Open popup with filebrowser/uploader buttons for image
31802
+ */
31803
+ onChangeImageClick(e) {
31804
+ this.handlers.openImagePopup(this.getElm('changeImage'));
31805
+ e.stopPropagation();
31806
+ }
31807
+ onStateTitleChange() {
31808
+ const title = this.getElm('imageTitle');
31809
+ title.value = this.state.values.imageTitle;
31810
+ }
31811
+ onTitleChange() {
31812
+ this.state.values.imageTitle = this.getElm('imageTitle').value;
31813
+ }
31814
+ onStateAltChange() {
31815
+ const alt = this.getElm('imageAlt');
31816
+ alt.value = this.state.values.imageAlt;
31817
+ }
31818
+ onAltChange() {
31819
+ this.state.values.imageAlt = this.getElm('imageAlt').value;
31820
+ }
31821
+ onStateImageLinkChange() {
31822
+ const imageLink = this.getElm('imageLink');
31823
+ imageLink.value = this.state.values.imageLink;
31824
+ }
31825
+ onImageLinkChange() {
31826
+ this.state.values.imageLink = this.getElm('imageLink').value;
31827
+ }
31828
+ onStateImageLinkOpenInNewTabChange() {
31829
+ const imageLinkOpenInNewTab = this.getElm('imageLinkOpenInNewTab');
31830
+ imageLinkOpenInNewTab.checked = this.state.values.imageLinkOpenInNewTab;
31831
+ }
31832
+ onImageLinkOpenInNewTabChange() {
31833
+ this.state.values.imageLinkOpenInNewTab = this.getElm('imageLinkOpenInNewTab').checked;
31834
+ }
31835
+ hideFieldByOptions() {
31836
+ const o = this.j.o;
31837
+ const opt = o.image;
31838
+ [
31839
+ ['editSrc', 'editSrc'],
31840
+ ['editTitle', 'editTitle'],
31841
+ ['editAlt', 'editAlt'],
31842
+ ['editLink', 'editLink'],
31843
+ ['editLink', 'editLinkTarget'],
31844
+ ['useImageEditor', 'editImage']
31845
+ ].forEach(([optKey, elmKey]) => {
31846
+ const elm = this.getElm(elmKey);
31847
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(elm, 'display', opt[optKey] ? null : 'none');
31848
+ });
31849
+ const changeImage = this.getElm('changeImage');
31850
+ const needShowChangeImage = Boolean(o.filebrowser.ajax.url || o.uploader.url);
31851
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(changeImage, 'display', needShowChangeImage ? null : 'none');
31852
+ const editImage = this.getElm('editImage');
31853
+ const needShowEditImage = Boolean(o.filebrowser.ajax.url) && opt.useImageEditor;
31854
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(editImage, 'display', needShowEditImage ? null : 'none');
31855
+ const fixImage = this.getElm('fixImage');
31856
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(fixImage, 'display', needShowChangeImage || needShowEditImage ? null : 'none');
31857
+ }
31858
+ };
31859
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31860
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageSrc')
31861
+ ], UIImageMainTab.prototype, "onStateImageSrcChange", null);
31862
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31863
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageSrc:change')
31864
+ ], UIImageMainTab.prototype, "onImageSrcChange", null);
31865
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31866
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('editImage:click')
31867
+ ], UIImageMainTab.prototype, "onEditImageClick", null);
31868
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31869
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('changeImage:click')
31870
+ ], UIImageMainTab.prototype, "onChangeImageClick", null);
31871
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31872
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageTitle')
31873
+ ], UIImageMainTab.prototype, "onStateTitleChange", null);
31874
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31875
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageTitle:change')
31876
+ ], UIImageMainTab.prototype, "onTitleChange", null);
31877
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31878
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageAlt')
31879
+ ], UIImageMainTab.prototype, "onStateAltChange", null);
31880
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31881
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageAlt:change')
31882
+ ], UIImageMainTab.prototype, "onAltChange", null);
31883
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31884
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageLink')
31885
+ ], UIImageMainTab.prototype, "onStateImageLinkChange", null);
31886
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31887
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageLink:change')
31888
+ ], UIImageMainTab.prototype, "onImageLinkChange", null);
31889
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31890
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageLinkOpenInNewTab')
31891
+ ], UIImageMainTab.prototype, "onStateImageLinkOpenInNewTabChange", null);
31892
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31893
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageLinkOpenInNewTab:change')
31894
+ ], UIImageMainTab.prototype, "onImageLinkOpenInNewTabChange", null);
31895
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31896
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready')
31897
+ ], UIImageMainTab.prototype, "hideFieldByOptions", null);
31898
+ UIImageMainTab = (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31899
+ jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_5__/* .component */ .s
31900
+ ], UIImageMainTab);
31901
+
31657
31902
 
31658
31903
 
31659
31904
  /***/ }),
31660
31905
 
31661
- /***/ 57837:
31906
+ /***/ 46681:
31662
31907
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31663
31908
 
31664
31909
  "use strict";
31665
31910
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31666
- /* harmony export */ b: function() { return /* binding */ positionTab; }
31911
+ /* harmony export */ _: function() { return /* binding */ UIImagePositionTab; }
31667
31912
  /* harmony export */ });
31668
- /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(931);
31913
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(31635);
31914
+ /* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(24767);
31915
+ /* harmony import */ var jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71151);
31916
+ /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(66927);
31917
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65147);
31918
+ /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(98253);
31919
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(26150);
31920
+ /* harmony import */ var jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29780);
31921
+ /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(931);
31922
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(9645);
31669
31923
  /*!
31670
31924
  * Jodit Editor (https://xdsoft.net/jodit/)
31671
31925
  * Released under MIT see LICENSE.txt in the project root for license information.
31672
31926
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31673
31927
  */
31674
31928
 
31675
- function positionTab(editor) {
31676
- 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);
31677
- const classInput = [];
31678
- if (opt.image.availableClasses.length > 0) {
31679
- classInput.push('<select data-ref="classes" class="jodit-input jodit-select">');
31680
- opt.image.availableClasses.forEach(item => {
31681
- if (typeof item === 'string') {
31682
- classInput.push(`<option value="${item}">${item}</option>`);
31683
- }
31684
- else {
31685
- classInput.push(`<option value="${item[0]}">${item[1]}</option>`);
31686
- }
31687
- });
31688
- classInput.push('</select>');
31929
+
31930
+
31931
+
31932
+
31933
+
31934
+
31935
+
31936
+
31937
+
31938
+ /** @private */
31939
+ let UIImagePositionTab = class UIImagePositionTab extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_4__/* .UIElement */ .D {
31940
+ className() {
31941
+ return 'UIImagePositionTab';
31689
31942
  }
31690
- else {
31691
- classInput.push('<input data-ref="classes" type="text" class="jodit-input"/>');
31943
+ constructor(jodit, state, handlers) {
31944
+ super(jodit, {
31945
+ availableClasses: jodit.o.image.availableClasses
31946
+ });
31947
+ this.state = state;
31948
+ this.handlers = handlers;
31692
31949
  }
31693
- return editor.c.fromHTML(`<div style="${!opt.image.editMargins ? 'display:none' : ''}" class="jodit-form__group">
31694
- <label>${i18n('Margins')}</label>
31950
+ render({ availableClasses }) {
31951
+ return `<div class="jodit-form__group &__editMargins">
31952
+ <label>~Margins~</label>
31695
31953
  <div class="jodit-grid jodit_vertical_middle">
31696
- <input class="jodit_col-lg-1-5 jodit-input" data-ref="marginTop" type="text" placeholder="${i18n('top')}"/>
31697
- <a style="text-align: center;" data-ref="lockMargin" class="jodit-properties__lock jodit_col-lg-1-5">${gi('lock')}</a>
31698
- <input disabled="true" class="jodit_col-lg-1-5 jodit-input" data-ref="marginRight" type="text" placeholder="${i18n('right')}"/>
31699
- <input disabled="true" class="jodit_col-lg-1-5 jodit-input" data-ref="marginBottom" type="text" placeholder="${i18n('bottom')}"/>
31700
- <input disabled="true" class="jodit_col-lg-1-5 jodit-input" data-ref="marginLeft" type="text" placeholder="${i18n('left')}"/>
31954
+ <input class="jodit_col-lg-1-5 jodit-input &__marginTop" type="text" placeholder="~top~"/>
31955
+ <a style="text-align: center;" class="jodit-properties__lock jodit_col-lg-1-5 &__lockMargin">*lock*</a>
31956
+ <input disabled="disabled" class="jodit_col-lg-1-5 jodit-input &__marginRight" type="text" placeholder="~right~"/>
31957
+ <input disabled="disabled" class="jodit_col-lg-1-5 jodit-input &__marginBottom" type="text" placeholder="~bottom~"/>
31958
+ <input disabled="disabled" class="jodit_col-lg-1-5 jodit-input &__marginLeft" type="text" placeholder="~left~"/>
31701
31959
  </div>
31702
31960
  </div>
31703
- <div
31704
- style="${!opt.image.editAlign ? 'display:none' : ''}"
31705
- class="jodit-form__group"
31706
- >
31707
- <label>${i18n('Align')}</label>
31708
- <select data-ref="align" class="jodit-select">
31709
- <option value="">${i18n('--Not Set--')}</option>
31710
- <option value="left">${i18n('Left')}</option>
31711
- <option value="center">${i18n('Center')}</option>
31712
- <option value="right">${i18n('Right')}</option>
31961
+ <div class="jodit-form__group &__editAlign">
31962
+ <label>~Align~</label>
31963
+ <select class="jodit-select &__align">
31964
+ <option value="">~--Not Set--~</option>
31965
+ <option value="left">~Left~</option>
31966
+ <option value="center">~Center~</option>
31967
+ <option value="right">~Right~</option>
31713
31968
  </select>
31714
31969
  </div>
31715
- <div style="${!opt.image.editStyle ? 'display:none' : ''}" class="jodit-form__group">
31716
- <label>${i18n('Styles')}</label>
31717
- <input data-ref="style" type="text" class="jodit-input"/>
31970
+ <div class="jodit-form__group &__editStyle">
31971
+ <label>~Styles~</label>
31972
+ <input type="text" class="jodit-input &__style"/>
31718
31973
  </div>
31719
- <div style="${!opt.image.editClass ? 'display:none' : ''}" class="jodit-form__group">
31720
- <label>${i18n('Classes')}</label>
31721
- ${classInput.join('')}
31974
+ <div class="jodit-form__group &__editClass">
31975
+ <label>~Classes~</label>
31976
+ ${(() => {
31977
+ const classInput = [];
31978
+ if (availableClasses && availableClasses.length > 0) {
31979
+ classInput.push('<select class="jodit-input jodit-select &__classes">');
31980
+ availableClasses.forEach(item => {
31981
+ if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_7__/* .isString */ .K)(item)) {
31982
+ classInput.push(`<option value="${item}">${item}</option>`);
31983
+ }
31984
+ else {
31985
+ classInput.push(`<option value="${item[0]}">${item[1]}</option>`);
31986
+ }
31987
+ });
31988
+ classInput.push('</select>');
31989
+ }
31990
+ else {
31991
+ classInput.push('<input type="text" class="jodit-input &__classes"/>');
31992
+ }
31993
+ return classInput.join('');
31994
+ })()}
31722
31995
  </div>
31723
- <div style="${!opt.image.editId ? 'display:none' : ''}" class="jodit-form__group">
31996
+ <div class="jodit-form__group &__editId">
31724
31997
  <label>Id</label>
31725
- <input data-ref="id" type="text" class="jodit-input"/>
31998
+ <input type="text" class="jodit-input &__id"/>
31726
31999
  </div>
31727
32000
  <div
31728
- style="${!opt.image.editBorderRadius ? 'display:none' : ''}"
31729
- class="jodit-form__group"
32001
+ class="jodit-form__group &__editBorderRadius"
31730
32002
  >
31731
- <label>${i18n('Border radius')}</label>
31732
- <input data-ref="borderRadius" type="number" class="jodit-input"/>
31733
- </div>`);
32003
+ <label>~Border radius~</label>
32004
+ <input type="number" class="jodit-input &__borderRadius"/>
32005
+ </div>`;
32006
+ }
32007
+ onStateAlignChange() {
32008
+ const align = this.getElm('align');
32009
+ align.value = this.state.values.align;
32010
+ }
32011
+ onChangeAlign() {
32012
+ const align = this.getElm('align');
32013
+ this.state.values.align = align.value;
32014
+ }
32015
+ onStateValuesBorderRadiusChange() {
32016
+ const borderRadius = this.getElm('borderRadius');
32017
+ borderRadius.value = this.state.values.borderRadius.toString();
32018
+ }
32019
+ onChangeBorderRadius() {
32020
+ const borderRadius = this.getElm('borderRadius');
32021
+ this.state.values.borderRadius = parseFloat(borderRadius.value);
32022
+ }
32023
+ onStateValuesIdChange() {
32024
+ const id = this.getElm('id');
32025
+ id.value = this.state.values.id;
32026
+ }
32027
+ onChangeId() {
32028
+ const id = this.getElm('id');
32029
+ this.state.values.id = id.value;
32030
+ }
32031
+ onStateValuesStyleChange() {
32032
+ const style = this.getElm('style');
32033
+ style.value = this.state.values.style;
32034
+ }
32035
+ onChangeStyle() {
32036
+ const style = this.getElm('style');
32037
+ this.state.values.style = style.value;
32038
+ }
32039
+ onStateValuesClassesChange() {
32040
+ const classes = this.getElm('classes');
32041
+ classes.value = this.state.values.classes;
32042
+ }
32043
+ onChangClasses() {
32044
+ const classes = this.getElm('classes');
32045
+ this.state.values.classes = classes.value;
32046
+ }
32047
+ onLockMarginClick(e) {
32048
+ this.state.marginIsLocked = !this.state.marginIsLocked;
32049
+ e.preventDefault();
32050
+ }
32051
+ onChangeMarginIsLocked() {
32052
+ const marginBottom = this.getElm('marginBottom');
32053
+ const marginRight = this.getElm('marginRight');
32054
+ const marginLeft = this.getElm('marginLeft');
32055
+ const lockMargin = this.getElm('lockMargin');
32056
+ [marginRight, marginBottom, marginLeft].forEach(elm => {
32057
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_3__/* .attr */ .C)(elm, 'disabled', this.state.marginIsLocked || null);
32058
+ });
32059
+ lockMargin.innerHTML = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_5__/* .Icon */ .I.get(this.state.marginIsLocked ? 'lock' : 'unlock');
32060
+ if (this.state.marginIsLocked) {
32061
+ const marginTop = this.state.values.marginTop;
32062
+ this.state.values.marginRight = marginTop;
32063
+ this.state.values.marginBottom = marginTop;
32064
+ this.state.values.marginLeft = marginTop;
32065
+ }
32066
+ }
32067
+ onStateValuesMarginChange() {
32068
+ const marginTop = this.getElm('marginTop');
32069
+ const marginRight = this.getElm('marginRight');
32070
+ const marginBottom = this.getElm('marginBottom');
32071
+ const marginLeft = this.getElm('marginLeft');
32072
+ marginTop.value = this.state.values.marginTop.toString();
32073
+ marginRight.value = this.state.values.marginRight.toString();
32074
+ marginBottom.value = this.state.values.marginBottom.toString();
32075
+ marginLeft.value = this.state.values.marginLeft.toString();
32076
+ }
32077
+ onChangeMargin() {
32078
+ const marginTop = this.getElm('marginTop');
32079
+ const marginRight = this.getElm('marginRight');
32080
+ const marginBottom = this.getElm('marginBottom');
32081
+ const marginLeft = this.getElm('marginLeft');
32082
+ this.state.values.marginTop = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginTop.value);
32083
+ if (this.state.marginIsLocked) {
32084
+ this.state.values.marginRight = this.state.values.marginTop;
32085
+ this.state.values.marginBottom = this.state.values.marginTop;
32086
+ this.state.values.marginLeft = this.state.values.marginTop;
32087
+ }
32088
+ else {
32089
+ this.state.values.marginRight = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginRight.value);
32090
+ this.state.values.marginBottom = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginBottom.value);
32091
+ this.state.values.marginLeft = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginLeft.value);
32092
+ }
32093
+ }
32094
+ hideFieldByOptions() {
32095
+ const opt = this.j.o.image;
32096
+ [
32097
+ ['editMargins', 'editMargins'],
32098
+ ['editAlign', 'editAlign'],
32099
+ ['editStyle', 'editStyle'],
32100
+ ['editClass', 'editClass'],
32101
+ ['editId', 'editId'],
32102
+ ['editBorderRadius', 'editBorderRadius']
32103
+ ].forEach(([optKey, elmKey]) => {
32104
+ const elm = this.getElm(elmKey);
32105
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(elm, 'display', opt[optKey] ? null : 'none');
32106
+ });
32107
+ }
32108
+ };
32109
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32110
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32111
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.align')
32112
+ ], UIImagePositionTab.prototype, "onStateAlignChange", null);
32113
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32114
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('align:change')
32115
+ ], UIImagePositionTab.prototype, "onChangeAlign", null);
32116
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32117
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32118
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.borderRadius')
32119
+ ], UIImagePositionTab.prototype, "onStateValuesBorderRadiusChange", null);
32120
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32121
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('borderRadius:change')
32122
+ ], UIImagePositionTab.prototype, "onChangeBorderRadius", null);
32123
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32124
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32125
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.id')
32126
+ ], UIImagePositionTab.prototype, "onStateValuesIdChange", null);
32127
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32128
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('id:change')
32129
+ ], UIImagePositionTab.prototype, "onChangeId", null);
32130
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32131
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32132
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.style')
32133
+ ], UIImagePositionTab.prototype, "onStateValuesStyleChange", null);
32134
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32135
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('style:change')
32136
+ ], UIImagePositionTab.prototype, "onChangeStyle", null);
32137
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32138
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32139
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.classes')
32140
+ ], UIImagePositionTab.prototype, "onStateValuesClassesChange", null);
32141
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32142
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('classes:change')
32143
+ ], UIImagePositionTab.prototype, "onChangClasses", null);
32144
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32145
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('lockMargin:click')
32146
+ ], UIImagePositionTab.prototype, "onLockMarginClick", null);
32147
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32148
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32149
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.marginIsLocked')
32150
+ ], UIImagePositionTab.prototype, "onChangeMarginIsLocked", null);
32151
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32152
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32153
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)([
32154
+ 'state.values.marginTop',
32155
+ 'state.values.marginRight',
32156
+ 'state.values.marginBottom',
32157
+ 'state.values.marginLeft'
32158
+ ])
32159
+ ], UIImagePositionTab.prototype, "onStateValuesMarginChange", null);
32160
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32161
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)([
32162
+ 'marginTop:change',
32163
+ 'marginRight:change',
32164
+ 'marginBottom:change',
32165
+ 'marginLeft:change'
32166
+ ])
32167
+ ], UIImagePositionTab.prototype, "onChangeMargin", null);
32168
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32169
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready')
32170
+ ], UIImagePositionTab.prototype, "hideFieldByOptions", null);
32171
+ UIImagePositionTab = (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32172
+ jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_9__/* .component */ .s
32173
+ ], UIImagePositionTab);
32174
+
32175
+
32176
+
32177
+ /***/ }),
32178
+
32179
+ /***/ 80778:
32180
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32181
+
32182
+ "use strict";
32183
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32184
+ /* harmony export */ v: function() { return /* binding */ openImageEditorDialog; }
32185
+ /* harmony export */ });
32186
+ /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(98253);
32187
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26150);
32188
+ /* harmony import */ var jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(53804);
32189
+ /*!
32190
+ * Jodit Editor (https://xdsoft.net/jodit/)
32191
+ * Released under MIT see LICENSE.txt in the project root for license information.
32192
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32193
+ */
32194
+
32195
+
32196
+
32197
+ /**
32198
+ * Open image editor dialog
32199
+ * @private
32200
+ */
32201
+ function openImageEditorDialog(j, state) {
32202
+ const url = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(state.image, 'src') || '', a = j.c.element('a'), loadExternal = () => {
32203
+ if (a.host !== location.host) {
32204
+ j.confirm('You can only edit your own images. Download this image on the host?', yes => {
32205
+ if (yes && j.uploader) {
32206
+ j.uploader.uploadRemoteImage(a.href.toString(), resp => {
32207
+ j.alert('The image has been successfully uploaded to the host!', () => {
32208
+ if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_2__/* .isString */ .K)(resp.newfilename)) {
32209
+ state.values.imageSrc =
32210
+ resp.baseurl +
32211
+ resp.newfilename;
32212
+ }
32213
+ });
32214
+ }, error => {
32215
+ j.alert('There was an error loading %s', error.message);
32216
+ });
32217
+ }
32218
+ });
32219
+ return;
32220
+ }
32221
+ };
32222
+ a.href = url;
32223
+ j.filebrowser.dataProvider
32224
+ .getPathByUrl(a.href.toString())
32225
+ .then(resp => {
32226
+ jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_1__/* .openImageEditor */ .B.call(j.filebrowser, a.href, resp.name, resp.path, resp.source, () => {
32227
+ const timestamp = new Date().getTime();
32228
+ state.values.imageSrc =
32229
+ url +
32230
+ (url.indexOf('?') !== -1 ? '' : '?') +
32231
+ '&_tmp=' +
32232
+ timestamp.toString();
32233
+ }, error => {
32234
+ j.alert(error.message);
32235
+ });
32236
+ })
32237
+ .catch(error => {
32238
+ j.alert(error.message, loadExternal);
32239
+ });
32240
+ }
32241
+
32242
+
32243
+ /***/ }),
32244
+
32245
+ /***/ 33733:
32246
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32247
+
32248
+ "use strict";
32249
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32250
+ /* harmony export */ q: function() { return /* binding */ openImagePopup; }
32251
+ /* harmony export */ });
32252
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(31635);
32253
+ /* harmony import */ var jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37923);
32254
+ /* harmony import */ var jodit_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(27594);
32255
+ /* harmony import */ var jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(80071);
32256
+ /* harmony import */ var jodit_modules_widget_file_selector_file_selector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10067);
32257
+ /*!
32258
+ * Jodit Editor (https://xdsoft.net/jodit/)
32259
+ * Released under MIT see LICENSE.txt in the project root for license information.
32260
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32261
+ */
32262
+
32263
+
32264
+
32265
+
32266
+
32267
+ /** @private */
32268
+ function openImagePopup(j, dialog, state, button) {
32269
+ const popup = new jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_0__/* .Popup */ .z(dialog);
32270
+ const closePopup = () => {
32271
+ popup.close();
32272
+ popup.destruct();
32273
+ };
32274
+ popup
32275
+ .setContent((0,jodit_modules_widget_file_selector_file_selector__WEBPACK_IMPORTED_MODULE_1__/* .FileSelectorWidget */ .k)(j, {
32276
+ upload: (data) => {
32277
+ if (data.files && data.files.length) {
32278
+ state.values.imageSrc =
32279
+ data.baseurl + data.files[0];
32280
+ }
32281
+ closePopup();
32282
+ },
32283
+ filebrowser: (data) => (0,tslib__WEBPACK_IMPORTED_MODULE_2__/* .__awaiter */ .sH)(this, void 0, void 0, function* () {
32284
+ if (data && (0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_3__/* .isArray */ .c)(data.files) && data.files.length) {
32285
+ state.values.imageSrc = data.files[0];
32286
+ closePopup();
32287
+ }
32288
+ })
32289
+ }, state.image, closePopup))
32290
+ .open(() => (0,jodit_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_4__/* .position */ .G)(button));
32291
+ }
32292
+
32293
+
32294
+ /***/ }),
32295
+
32296
+ /***/ 9645:
32297
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32298
+
32299
+ "use strict";
32300
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32301
+ /* harmony export */ G: function() { return /* binding */ normalSizeFromString; },
32302
+ /* harmony export */ n: function() { return /* binding */ normalSizeToString; }
32303
+ /* harmony export */ });
32304
+ /* harmony import */ var jodit_core_helpers_checker_is_number__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2461);
32305
+ /* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(59101);
32306
+ /*!
32307
+ * Jodit Editor (https://xdsoft.net/jodit/)
32308
+ * Released under MIT see LICENSE.txt in the project root for license information.
32309
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32310
+ */
32311
+
32312
+
32313
+ /** @private */
32314
+ const normalSizeFromString = (value) => {
32315
+ return /^[-+]?[0-9.]+(px)?$/.test(value.toString())
32316
+ ? parseFloat(value.toString())
32317
+ : value;
32318
+ };
32319
+ /** @private */
32320
+ const normalSizeToString = (value) => {
32321
+ if ((0,jodit_core_helpers_checker_is_number__WEBPACK_IMPORTED_MODULE_1__/* .isNumber */ .E)(value)) {
32322
+ return value ? value + 'px' : value.toString();
32323
+ }
32324
+ value = (0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_0__/* .trim */ .Bq)(value);
32325
+ return /^[0-9]+$/.test(value) ? value + 'px' : value;
32326
+ };
32327
+
32328
+
32329
+ /***/ }),
32330
+
32331
+ /***/ 30393:
32332
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32333
+
32334
+ "use strict";
32335
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32336
+ /* harmony export */ j: function() { return /* binding */ applyValuesToImage; }
32337
+ /* harmony export */ });
32338
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55186);
32339
+ /* harmony import */ var jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97369);
32340
+ /* harmony import */ var _link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(88269);
32341
+ /* harmony import */ var _margin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(78139);
32342
+ /* harmony import */ var _size__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(58972);
32343
+ /*!
32344
+ * Jodit Editor (https://xdsoft.net/jodit/)
32345
+ * Released under MIT see LICENSE.txt in the project root for license information.
32346
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32347
+ */
32348
+
32349
+
32350
+
32351
+
32352
+
32353
+ /**
32354
+ * Apply form's values to image
32355
+ * @private
32356
+ */
32357
+ function applyValuesToImage(j, state, image) {
32358
+ const { style, imageSrc, borderRadius, imageTitle, imageAlt, imageLink, imageWidth, imageHeight, marginTop, marginRight, marginBottom, marginLeft, imageLinkOpenInNewTab, align, classes, id } = state.values;
32359
+ const opt = j.o;
32360
+ // styles
32361
+ if (opt.image.editStyle) {
32362
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'style', style || null);
32363
+ }
32364
+ // Src
32365
+ if (imageSrc) {
32366
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'src', imageSrc);
32367
+ }
32368
+ else {
32369
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.safeRemove(image);
32370
+ return;
32371
+ }
32372
+ // Border radius
32373
+ image.style.borderRadius = borderRadius ? borderRadius + 'px' : '';
32374
+ // Title
32375
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'title', imageTitle || null);
32376
+ // Alt
32377
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'alt', imageAlt || null);
32378
+ // Link
32379
+ (0,_link__WEBPACK_IMPORTED_MODULE_2__/* .applyLink */ .j)(j, image, imageLink, imageLinkOpenInNewTab);
32380
+ // Size
32381
+ (0,_size__WEBPACK_IMPORTED_MODULE_4__/* .applySize */ .q)(image, imageWidth, imageHeight, state.sizeIsLocked);
32382
+ // Margin
32383
+ if (j.o.image.editMargins) {
32384
+ (0,_margin__WEBPACK_IMPORTED_MODULE_3__/* .applyMargin */ .N)(j, marginTop, marginRight, marginBottom, marginLeft, image, state.marginIsLocked);
32385
+ }
32386
+ if (opt.image.editClass) {
32387
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'class', classes || null);
32388
+ }
32389
+ if (opt.image.editId) {
32390
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'id', id || null);
32391
+ }
32392
+ if (opt.image.editAlign) {
32393
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.hAlignElement)(image, align);
32394
+ }
32395
+ }
32396
+
32397
+
32398
+ /***/ }),
32399
+
32400
+ /***/ 88269:
32401
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32402
+
32403
+ "use strict";
32404
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32405
+ /* harmony export */ j: function() { return /* binding */ applyLink; }
32406
+ /* harmony export */ });
32407
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55186);
32408
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26150);
32409
+ /*!
32410
+ * Jodit Editor (https://xdsoft.net/jodit/)
32411
+ * Released under MIT see LICENSE.txt in the project root for license information.
32412
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32413
+ */
32414
+
32415
+
32416
+ /** @private */
32417
+ function applyLink(j, image, imageLink, imageLinkOpenInNewTab) {
32418
+ // Link
32419
+ let link = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.closest(image, 'a', j.editor);
32420
+ if (imageLink) {
32421
+ if (!link) {
32422
+ link = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.wrap(image, 'a', j.createInside);
32423
+ }
32424
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(link, 'href', imageLink);
32425
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(link, 'target', imageLinkOpenInNewTab ? '_blank' : null);
32426
+ }
32427
+ else {
32428
+ if (link && link.parentNode) {
32429
+ link.parentNode.replaceChild(image, link);
32430
+ }
32431
+ }
32432
+ }
32433
+
32434
+
32435
+ /***/ }),
32436
+
32437
+ /***/ 78139:
32438
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32439
+
32440
+ "use strict";
32441
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32442
+ /* harmony export */ N: function() { return /* binding */ applyMargin; }
32443
+ /* harmony export */ });
32444
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(38322);
32445
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9645);
32446
+ /*!
32447
+ * Jodit Editor (https://xdsoft.net/jodit/)
32448
+ * Released under MIT see LICENSE.txt in the project root for license information.
32449
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32450
+ */
32451
+
32452
+
32453
+ /** @private */
32454
+ function applyMargin(j, marginTop, marginRight, marginBottom, marginLeft, image, marginIsLocked) {
32455
+ const margins = [marginTop, marginRight, marginBottom, marginLeft];
32456
+ const applyMargin = (key, value) => {
32457
+ const oldValue = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_1__/* .css */ .A)(image, key);
32458
+ const v = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_0__/* .normalSizeToString */ .n)(value);
32459
+ if (oldValue.toString() !== v.toString()) {
32460
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_1__/* .css */ .A)(image, key, v);
32461
+ }
32462
+ };
32463
+ if (!marginIsLocked) {
32464
+ const sides = [
32465
+ 'margin-top',
32466
+ 'margin-right',
32467
+ 'margin-bottom',
32468
+ 'margin-left'
32469
+ ];
32470
+ margins.forEach((margin, index) => {
32471
+ const side = sides[index];
32472
+ applyMargin(side, margin);
32473
+ });
32474
+ }
32475
+ else {
32476
+ applyMargin('margin', marginTop);
32477
+ }
32478
+ }
32479
+
32480
+
32481
+ /***/ }),
32482
+
32483
+ /***/ 58972:
32484
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32485
+
32486
+ "use strict";
32487
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32488
+ /* harmony export */ q: function() { return /* binding */ applySize; }
32489
+ /* harmony export */ });
32490
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26150);
32491
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(38322);
32492
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9645);
32493
+ /*!
32494
+ * Jodit Editor (https://xdsoft.net/jodit/)
32495
+ * Released under MIT see LICENSE.txt in the project root for license information.
32496
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32497
+ */
32498
+
32499
+
32500
+
32501
+ /** @private */
32502
+ function applySize(image, imageWidth, imageHeight, sizeIsLocked) {
32503
+ // Size
32504
+ if (imageWidth !== image.offsetWidth ||
32505
+ imageHeight !== image.offsetHeight) {
32506
+ const updatedWidth = imageWidth ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeToString */ .n)(imageWidth) : null;
32507
+ let updatedHeight = imageHeight
32508
+ ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeToString */ .n)(imageHeight)
32509
+ : null;
32510
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__/* .css */ .A)(image, {
32511
+ width: updatedWidth,
32512
+ height: updatedWidth && sizeIsLocked ? null : updatedHeight
32513
+ });
32514
+ (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);
32515
+ if (!(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'width') || sizeIsLocked) {
32516
+ updatedHeight = null;
32517
+ }
32518
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'height', updatedHeight);
32519
+ }
31734
32520
  }
31735
32521
 
31736
32522
 
@@ -38123,7 +38909,8 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_3__/* .pluginSystem */ .fg.add('selec
38123
38909
  */
38124
38910
 
38125
38911
  jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.select = {
38126
- normalizeSelectionBeforeCutAndCopy: false
38912
+ normalizeSelectionBeforeCutAndCopy: false,
38913
+ normalizeTripleClick: true
38127
38914
  };
38128
38915
 
38129
38916
 
@@ -38199,7 +38986,7 @@ class select extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_3__/* .Plugin */
38199
38986
  }
38200
38987
  }
38201
38988
  /**
38202
- * @event outsideClick(e) - when user clicked in the outside of editor
38989
+ * @event outsideClick(e) - when user clicked on the outside of editor
38203
38990
  */
38204
38991
  onOutsideClick(e) {
38205
38992
  const node = e.target;
@@ -38211,7 +38998,7 @@ class select extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_3__/* .Plugin */
38211
38998
  this.j.e.fire('outsideClick', e);
38212
38999
  }
38213
39000
  }
38214
- beforeCommandCut(command) {
39001
+ beforeCommandCut() {
38215
39002
  const { s } = this.j;
38216
39003
  if (!s.isCollapsed()) {
38217
39004
  const current = s.current();
@@ -38220,13 +39007,27 @@ class select extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_3__/* .Plugin */
38220
39007
  }
38221
39008
  }
38222
39009
  }
38223
- beforeCommandSelectall(command) {
39010
+ beforeCommandSelectAll() {
38224
39011
  const { s } = this.j;
38225
39012
  s.focus();
38226
39013
  s.select(this.j.editor, true);
38227
39014
  s.expandSelection();
38228
39015
  return false;
38229
39016
  }
39017
+ /**
39018
+ * Normalize selection after triple click
39019
+ */
39020
+ onTripleClickNormalizeSelection(e) {
39021
+ if (e.detail !== 3 || !this.j.o.select.normalizeTripleClick) {
39022
+ return;
39023
+ }
39024
+ const { s } = this.j;
39025
+ const { startContainer, startOffset } = s.range;
39026
+ if (startOffset === 0 && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isText(startContainer)) {
39027
+ 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) ||
39028
+ startContainer, true);
39029
+ }
39030
+ }
38230
39031
  onCopyNormalizeSelectionBound(e) {
38231
39032
  const { s, editor, o } = this.j;
38232
39033
  if (!o.select.normalizeSelectionBeforeCutAndCopy || s.isCollapsed()) {
@@ -38252,7 +39053,10 @@ class select extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_3__/* .Plugin */
38252
39053
  ], select.prototype, "beforeCommandCut", null);
38253
39054
  (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
38254
39055
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([':beforeCommandSelectall'])
38255
- ], select.prototype, "beforeCommandSelectall", null);
39056
+ ], select.prototype, "beforeCommandSelectAll", null);
39057
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
39058
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([':click'])
39059
+ ], select.prototype, "onTripleClickNormalizeSelection", null);
38256
39060
  (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
38257
39061
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([':copy', ':cut'])
38258
39062
  ], select.prototype, "onCopyNormalizeSelectionBound", null);