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