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
@@ -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)
@@ -17768,6 +17776,7 @@ let Dialog = Dialog_1 = class Dialog extends jodit_core_view_view_with_toolbar__
17768
17776
  * Fired when dialog box is started moving
17769
17777
  */
17770
17778
  this.e.fire(this, 'startMove');
17779
+ this.e.fire('closeAllPopups');
17771
17780
  }
17772
17781
  }
17773
17782
  onMouseMove(e) {
@@ -19708,7 +19717,14 @@ let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__W
19708
19717
  this.__updateToolbarButtons();
19709
19718
  this._dialog.open(this.browser, header);
19710
19719
  this.e.fire('sort.filebrowser', this.state.sortBy);
19711
- (0,_fetch_load_tree__WEBPACK_IMPORTED_MODULE_10__/* .loadTree */ .r)(this).then(resolve, reject);
19720
+ (0,_fetch_load_tree__WEBPACK_IMPORTED_MODULE_10__/* .loadTree */ .r)(this)
19721
+ .then(resolve, reject)
19722
+ .finally(() => {
19723
+ if (this.isInDestruct) {
19724
+ return;
19725
+ }
19726
+ this?.e?.fire('fileBrowserReady.filebrowser');
19727
+ });
19712
19728
  })
19713
19729
  .catch((e) => {
19714
19730
  if (!jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.IS_PROD) {
@@ -21577,11 +21593,12 @@ const act = (el, className = 'jodti-image-editor_active') => el ? className : ''
21577
21593
  const form = (editor, o) => {
21578
21594
  const i = editor.i18n.bind(editor);
21579
21595
  const switcher = (label, ref, active = true) => `<div class="jodit-form__group">
21580
- <label>${i(label)}</label>
21581
-
21582
- <label class='jodit-switcher'>
21583
- <input ${act(active, 'checked')} data-ref="${ref}" type="checkbox"/>
21584
- <span class="jodit-switcher__slider"></span>
21596
+ <label class="jodit-switcher-wrapper">
21597
+ <span class='jodit-switcher'>
21598
+ <input ${act(active, 'checked')} data-ref="${ref}" type="checkbox"/>
21599
+ <span class="jodit-switcher__slider"></span>
21600
+ </span>
21601
+ <span>${i(label)}</span>
21585
21602
  </label>
21586
21603
  </div>`;
21587
21604
  return editor.create.fromHTML(`<form class="${jie} jodit-properties">
@@ -24645,11 +24662,13 @@ const TabsWidget = (jodit, tabs, state) => {
24645
24662
  return;
24646
24663
  }
24647
24664
  buttonList.forEach(b => {
24665
+ b.state.variant = 'initial';
24648
24666
  b.state.activated = false;
24649
24667
  });
24650
24668
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.$$)('.jodit-tab', tabBox).forEach(a => {
24651
24669
  a.classList.remove('jodit-tab_active');
24652
24670
  });
24671
+ nameToTab[tab].button.state.variant = 'outline';
24653
24672
  nameToTab[tab].button.state.activated = true;
24654
24673
  nameToTab[tab].tab.classList.add('jodit-tab_active');
24655
24674
  };
@@ -24678,7 +24697,7 @@ const TabsWidget = (jodit, tabs, state) => {
24678
24697
  content.call(jodit);
24679
24698
  }
24680
24699
  if (state) {
24681
- state.__activeTab = name;
24700
+ state.activeTab = name;
24682
24701
  }
24683
24702
  return false;
24684
24703
  });
@@ -24694,20 +24713,20 @@ const TabsWidget = (jodit, tabs, state) => {
24694
24713
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.$$)('a', buttons).forEach(a => {
24695
24714
  a.style.width = (100 / tabCount).toFixed(10) + '%';
24696
24715
  });
24697
- const tab = !state || !state.__activeTab || !nameToTab[state.__activeTab]
24716
+ const tab = !state || !state.activeTab || !nameToTab[state.activeTab]
24698
24717
  ? firstTab
24699
- : state.__activeTab;
24718
+ : state.activeTab;
24700
24719
  setActive(tab);
24701
24720
  if (state) {
24702
- let __activeTab = state.__activeTab;
24703
- Object.defineProperty(state, '__activeTab', {
24721
+ let activeTab = state.activeTab;
24722
+ Object.defineProperty(state, 'activeTab', {
24704
24723
  configurable: true,
24705
24724
  enumerable: false,
24706
24725
  get() {
24707
- return __activeTab;
24726
+ return activeTab;
24708
24727
  },
24709
24728
  set(value) {
24710
- __activeTab = value;
24729
+ activeTab = value;
24711
24730
  setActive(value);
24712
24731
  }
24713
24732
  });
@@ -25122,7 +25141,7 @@ class aiAssistant extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_3__/
25122
25141
  (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .extendLang */ .JW)(_langs__WEBPACK_IMPORTED_MODULE_6__);
25123
25142
  }
25124
25143
  /** @override */
25125
- afterInit(jodit) { }
25144
+ afterInit() { }
25126
25145
  onGenerateAiAssistantForm(prompt) {
25127
25146
  this.__dialog.open(this.__container, 'AI Assistant');
25128
25147
  this.__container.setPrompt(prompt);
@@ -25155,15 +25174,15 @@ class aiAssistant extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_3__/
25155
25174
  }
25156
25175
  /** @override */
25157
25176
  beforeDestruct(_) {
25158
- this.__container.destruct();
25159
- this.__dialog.destruct();
25177
+ (0,jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_0__/* .cached */ .PO)(this, '__container')?.destruct();
25178
+ (0,jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_0__/* .cached */ .PO)(this, '__dialog')?.destruct();
25160
25179
  }
25161
25180
  }
25162
25181
  (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
25163
- jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_0__/* .cache */ .P
25182
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_0__/* .cache */ .PP
25164
25183
  ], aiAssistant.prototype, "__dialog", null);
25165
25184
  (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
25166
- jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_0__/* .cache */ .P
25185
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_0__/* .cache */ .PP
25167
25186
  ], aiAssistant.prototype, "__container", null);
25168
25187
  (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
25169
25188
  (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)(':generateAiAssistantForm.ai-assistant')
@@ -30534,9 +30553,6 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .pluginSystem */ .fg.add('image
30534
30553
  * Released under MIT see LICENSE.txt in the project root for license information.
30535
30554
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
30536
30555
  */
30537
- /**
30538
- * @module plugins/image-properties
30539
- */
30540
30556
 
30541
30557
  jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.image = {
30542
30558
  dialogWidth: 600,
@@ -30566,18 +30582,19 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.image = {
30566
30582
 
30567
30583
  "use strict";
30568
30584
  /* unused harmony export imageProperties */
30569
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(31635);
30585
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(31635);
30570
30586
  /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22664);
30571
- /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56298);
30572
- /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65147);
30573
- /* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(35265);
30574
- /* harmony import */ var jodit_modules__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(37435);
30575
- /* harmony import */ var jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(53804);
30576
- /* harmony import */ var jodit_modules_widget__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(16116);
30577
- /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(24654);
30578
- /* harmony import */ var _templates_form__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(22254);
30579
- /* harmony import */ var _templates_main_tab__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(75263);
30580
- /* harmony import */ var _templates_position_tab__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(57837);
30587
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(55186);
30588
+ /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(56298);
30589
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(65147);
30590
+ /* harmony import */ var jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29866);
30591
+ /* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(35265);
30592
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(24654);
30593
+ /* harmony import */ var _ui_ui_image_form__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(31970);
30594
+ /* harmony import */ var _utils_open_image_editor__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(80778);
30595
+ /* harmony import */ var _utils_open_image_popup__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(33733);
30596
+ /* harmony import */ var _readers__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(5549);
30597
+ /* harmony import */ var _writers__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(30393);
30581
30598
  /*!
30582
30599
  * Jodit Editor (https://xdsoft.net/jodit/)
30583
30600
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -30609,55 +30626,93 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.image = {
30609
30626
  * });
30610
30627
  * ```
30611
30628
  */
30612
- const normalSizeToString = (value) => {
30613
- value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.trim)(value);
30614
- return /^[0-9]+$/.test(value) ? value + 'px' : value;
30615
- };
30616
- const normalSizeFromString = (value) => {
30617
- return /^[-+]?[0-9.]+px$/.test(value.toString())
30618
- ? parseFloat(value.toString())
30619
- : value;
30620
- };
30621
30629
  /**
30622
30630
  * Show dialog with image's options
30623
30631
  */
30624
- class imageProperties extends jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin {
30632
+ class imageProperties extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_4__/* .Plugin */ .k {
30625
30633
  constructor() {
30626
30634
  super(...arguments);
30627
30635
  this.state = {
30628
30636
  image: new Image(),
30637
+ sourceImage: new Image(),
30629
30638
  get ratio() {
30630
- return this.image.naturalWidth / this.image.naturalHeight || 1;
30639
+ const { naturalWidth, naturalHeight } = this.image;
30640
+ return naturalWidth / naturalHeight || 1;
30631
30641
  },
30632
30642
  sizeIsLocked: true,
30633
- marginIsLocked: true
30643
+ marginIsLocked: true,
30644
+ values: {
30645
+ style: '',
30646
+ imageSrc: '',
30647
+ borderRadius: 0,
30648
+ imageTitle: '',
30649
+ imageAlt: '',
30650
+ imageLink: '',
30651
+ imageLinkOpenInNewTab: false,
30652
+ imageWidth: 0,
30653
+ imageHeight: 0,
30654
+ marginTop: 0,
30655
+ marginRight: 0,
30656
+ marginBottom: 0,
30657
+ marginLeft: 0,
30658
+ classes: '',
30659
+ id: '',
30660
+ align: ''
30661
+ }
30634
30662
  };
30635
30663
  this.activeTabState = {
30636
- __activeTab: 'Image'
30664
+ activeTab: 'Image'
30637
30665
  };
30638
30666
  }
30639
- onChangeMarginIsLocked() {
30640
- if (!this.form) {
30641
- return;
30642
- }
30643
- const { marginRight, marginBottom, marginLeft, lockMargin } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
30644
- [marginRight, marginBottom, marginLeft].forEach(elm => {
30645
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(elm, 'disabled', this.state.marginIsLocked || null);
30667
+ get form() {
30668
+ return new _ui_ui_image_form__WEBPACK_IMPORTED_MODULE_7__/* .UIImagePropertiesForm */ .l(this.j, this.state, this.activeTabState, {
30669
+ openImageEditor: () => (0,_utils_open_image_editor__WEBPACK_IMPORTED_MODULE_8__/* .openImageEditorDialog */ .v)(this.j, this.state),
30670
+ openImagePopup: target => (0,_utils_open_image_popup__WEBPACK_IMPORTED_MODULE_9__/* .openImagePopup */ .q)(this.j, this.dialog, this.state, target)
30646
30671
  });
30647
- lockMargin.innerHTML = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Icon.get(this.state.marginIsLocked ? 'lock' : 'unlock');
30648
30672
  }
30649
- onChangeSizeIsLocked() {
30650
- if (!this.form) {
30651
- return;
30652
- }
30653
- const { lockSize, imageWidth } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
30654
- lockSize.innerHTML = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Icon.get(this.state.sizeIsLocked ? 'lock' : 'unlock');
30655
- lockSize.classList.remove('jodit-properties__lock');
30656
- lockSize.classList.remove('jodit-properties__unlock');
30657
- lockSize.classList.add(this.state.sizeIsLocked
30658
- ? 'jodit-properties__lock'
30659
- : 'jodit-properties__unlock');
30660
- this.j.e.fire(imageWidth, 'change');
30673
+ /**
30674
+ * Dialog for form
30675
+ */
30676
+ get dialog() {
30677
+ const { j } = this;
30678
+ const dialog = j.dlg({
30679
+ minWidth: Math.min(400, screen.width),
30680
+ minHeight: 590,
30681
+ buttons: ['fullsize', 'dialog.close']
30682
+ });
30683
+ const buttons = this.__buttons;
30684
+ buttons.check.onAction(() => {
30685
+ (0,_writers__WEBPACK_IMPORTED_MODULE_11__/* .applyValuesToImage */ .j)(j, this.state, this.state.sourceImage);
30686
+ j.synchronizeValues();
30687
+ dialog.close();
30688
+ });
30689
+ buttons.remove.onAction(() => {
30690
+ j.s.removeNode(this.state.sourceImage);
30691
+ dialog.close();
30692
+ });
30693
+ buttons.cancel.onAction(() => {
30694
+ dialog.close();
30695
+ });
30696
+ dialog.setHeader(j.i18n('Image properties'));
30697
+ dialog.setContent(this.form);
30698
+ dialog.setFooter([[buttons.cancel, buttons.remove], buttons.check]);
30699
+ j.e.on(dialog, 'afterClose', () => {
30700
+ if (this.state.image.parentNode &&
30701
+ j.o.image.selectImageAfterClose) {
30702
+ j.s.select(this.state.sourceImage);
30703
+ }
30704
+ });
30705
+ dialog.setSize(j.o.image.dialogWidth);
30706
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.markOwner)(j, dialog.container);
30707
+ return dialog;
30708
+ }
30709
+ get __buttons() {
30710
+ const { j } = this;
30711
+ return {
30712
+ check: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__/* .Button */ .$n)(j, 'ok', 'Apply', 'primary'),
30713
+ remove: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__/* .Button */ .$n)(j, 'bin', 'Delete'),
30714
+ cancel: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__/* .Button */ .$n)(j, 'cancel', 'Cancel')
30715
+ };
30661
30716
  }
30662
30717
  /**
30663
30718
  * Open dialog editing image properties
@@ -30674,358 +30729,24 @@ class imageProperties extends jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin
30674
30729
  * ```
30675
30730
  */
30676
30731
  open() {
30677
- this.makeForm();
30678
- this.activeTabState.__activeTab = 'Image';
30679
- this.j.e.fire('hidePopup');
30680
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.markOwner)(this.j, this.dialog.container);
30681
- this.state.marginIsLocked = true;
30682
- this.state.sizeIsLocked = true;
30683
- this.onChangeMarginIsLocked();
30684
- this.onChangeSizeIsLocked();
30685
- this.updateValues();
30732
+ this.activeTabState.activeTab = 'Image';
30733
+ this.__lock();
30686
30734
  this.dialog.open().setModal(true).setPosition();
30735
+ this.async
30736
+ .promise((resolve, reject) => (0,_readers__WEBPACK_IMPORTED_MODULE_10__/* .readValuesFromImage */ .U)(this.j, this.state).then(resolve, reject))
30737
+ .catch((e) => this.dialog.message.error(e.message))
30738
+ .finally(() => this.__unlock());
30687
30739
  return false;
30688
30740
  }
30689
- /**
30690
- * Create form for edit image properties
30691
- */
30692
- makeForm() {
30693
- if (this.dialog) {
30694
- return;
30695
- }
30696
- this.dialog = this.j.dlg({
30697
- minWidth: Math.min(400, screen.width),
30698
- minHeight: 590,
30699
- buttons: ['fullsize', 'dialog.close']
30700
- });
30701
- const editor = this.j, opt = editor.o, i18n = editor.i18n.bind(editor), buttons = {
30702
- check: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_3__/* .Button */ .$n)(editor, 'ok', 'Apply', 'primary'),
30703
- remove: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_3__/* .Button */ .$n)(editor, 'bin', 'Delete')
30704
- };
30705
- editor.e.on(this.dialog, 'afterClose', () => {
30706
- if (this.state.image.parentNode &&
30707
- opt.image.selectImageAfterClose) {
30708
- editor.s.select(this.state.image);
30709
- }
30710
- });
30711
- buttons.remove.onAction(() => {
30712
- editor.s.removeNode(this.state.image);
30713
- this.dialog.close();
30714
- });
30715
- const { dialog } = this;
30716
- dialog.setHeader(i18n('Image properties'));
30717
- const mainForm = (0,_templates_form__WEBPACK_IMPORTED_MODULE_8__/* .form */ .Z)(editor);
30718
- this.form = mainForm;
30719
- dialog.setContent(mainForm);
30720
- const { tabsBox } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
30721
- if (tabsBox) {
30722
- tabsBox.appendChild((0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_6__/* .TabsWidget */ .Zg)(editor, [
30723
- { name: 'Image', content: (0,_templates_main_tab__WEBPACK_IMPORTED_MODULE_9__/* .mainTab */ .J)(editor) },
30724
- { name: 'Advanced', content: (0,_templates_position_tab__WEBPACK_IMPORTED_MODULE_10__/* .positionTab */ .b)(editor) }
30725
- ], this.activeTabState));
30726
- }
30727
- buttons.check.onAction(this.onApply);
30728
- const { changeImage, editImage } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
30729
- editor.e.on(changeImage, 'click', this.openImagePopup);
30730
- if (opt.image.useImageEditor) {
30731
- editor.e.on(editImage, 'click', this.openImageEditor);
30732
- }
30733
- const { lockSize, lockMargin, imageWidth, imageHeight } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(mainForm);
30734
- if (lockSize) {
30735
- editor.e.on(lockSize, 'click', () => {
30736
- this.state.sizeIsLocked = !this.state.sizeIsLocked;
30737
- });
30738
- }
30739
- editor.e.on(lockMargin, 'click', (e) => {
30740
- this.state.marginIsLocked = !this.state.marginIsLocked;
30741
- e.preventDefault();
30742
- });
30743
- const changeSizes = (event) => {
30744
- if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isNumeric)(imageWidth.value) || !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isNumeric)(imageHeight.value)) {
30745
- return;
30746
- }
30747
- const w = parseFloat(imageWidth.value), h = parseFloat(imageHeight.value);
30748
- if (event.target === imageWidth) {
30749
- imageHeight.value = Math.round(w / this.state.ratio).toString();
30750
- }
30751
- else {
30752
- imageWidth.value = Math.round(h * this.state.ratio).toString();
30753
- }
30754
- };
30755
- editor.e.on([imageWidth, imageHeight], 'change keydown mousedown paste', (event) => {
30756
- if (!this.state.sizeIsLocked) {
30757
- return;
30758
- }
30759
- editor.async.setTimeout(changeSizes.bind(this, event), {
30760
- timeout: editor.defaultTimeout,
30761
- label: 'image-properties-changeSize'
30762
- });
30763
- });
30764
- dialog.setFooter([buttons.remove, buttons.check]);
30765
- dialog.setSize(this.j.o.image.dialogWidth);
30766
- }
30767
- /**
30768
- * Set input values from image
30769
- */
30770
- updateValues() {
30771
- const opt = this.j.o;
30772
- const { image } = this.state;
30773
- 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);
30774
- const updateLock = () => {
30775
- lockMargin.checked = this.state.marginIsLocked;
30776
- lockSize.checked = this.state.sizeIsLocked;
30777
- }, updateAlign = () => {
30778
- if (image.style.cssFloat &&
30779
- ['left', 'right'].indexOf(image.style.cssFloat.toLowerCase()) !== -1) {
30780
- align.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'float');
30781
- }
30782
- else {
30783
- if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'display') === 'block' &&
30784
- image.style.marginLeft === 'auto' &&
30785
- image.style.marginRight === 'auto') {
30786
- align.value = 'center';
30787
- }
30788
- }
30789
- }, updateBorderRadius = () => {
30790
- borderRadius.value = (parseInt(image.style.borderRadius || '0', 10) || '0').toString();
30791
- }, updateId = () => {
30792
- id.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'id') || '';
30793
- }, updateStyle = () => {
30794
- style.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'style') || '';
30795
- }, updateClasses = () => {
30796
- classes.value = ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'class') || '').replace(/jodit_focused_image[\s]*/, '');
30797
- }, updateMargins = () => {
30798
- if (!opt.image.editMargins) {
30799
- return;
30800
- }
30801
- let equal = true, wasEmptyField = false;
30802
- [marginTop, marginRight, marginBottom, marginLeft].forEach(elm => {
30803
- const id = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(elm, 'data-ref') || '';
30804
- let value = image.style.getPropertyValue((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.kebabCase)(id));
30805
- if (!value) {
30806
- wasEmptyField = true;
30807
- elm.value = '';
30808
- return;
30809
- }
30810
- if (/^[0-9]+(px)?$/.test(value)) {
30811
- value = parseInt(value, 10);
30812
- }
30813
- elm.value = value.toString() || '';
30814
- if ((wasEmptyField && elm.value) ||
30815
- (equal &&
30816
- id !== 'marginTop' &&
30817
- elm.value !== marginTop.value)) {
30818
- equal = false;
30819
- }
30820
- });
30821
- this.state.marginIsLocked = equal;
30822
- }, updateSizes = () => {
30823
- const width = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'width') ||
30824
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'width', true) ||
30825
- false, height = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'height') ||
30826
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'height', true) ||
30827
- false;
30828
- imageWidth.value =
30829
- width !== false
30830
- ? normalSizeFromString(width).toString()
30831
- : image.offsetWidth.toString();
30832
- imageHeight.value =
30833
- height !== false
30834
- ? normalSizeFromString(height).toString()
30835
- : image.offsetHeight.toString();
30836
- this.state.sizeIsLocked = (() => {
30837
- if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isNumeric)(imageWidth.value) ||
30838
- !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isNumeric)(imageHeight.value)) {
30839
- return false;
30840
- }
30841
- const w = parseFloat(imageWidth.value), h = parseFloat(imageHeight.value);
30842
- return Math.abs(w - h * this.state.ratio) < 1;
30843
- })();
30844
- }, updateText = () => {
30845
- imageTitle.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'title') || '';
30846
- imageAlt.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'alt') || '';
30847
- const a = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(image, 'a', this.j.editor);
30848
- if (a) {
30849
- imageLink.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(a, 'href') || '';
30850
- imageLinkOpenInNewTab.checked =
30851
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(a, 'target') === '_blank';
30852
- }
30853
- else {
30854
- imageLink.value = '';
30855
- imageLinkOpenInNewTab.checked = false;
30856
- }
30857
- }, updateSrc = () => {
30858
- imageSrc.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'src') || '';
30859
- if (imageViewSrc) {
30860
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(imageViewSrc, 'src', (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'src') || '');
30861
- }
30862
- };
30863
- updateLock();
30864
- updateSrc();
30865
- updateText();
30866
- updateSizes();
30867
- updateMargins();
30868
- updateClasses();
30869
- updateId();
30870
- updateBorderRadius();
30871
- updateAlign();
30872
- updateStyle();
30873
- }
30874
- /**
30875
- * Apply form's values to image
30876
- */
30877
- onApply() {
30878
- 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);
30879
- const opt = this.j.o;
30880
- const { image } = this.state;
30881
- // styles
30882
- if (opt.image.editStyle) {
30883
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'style', style.value || null);
30884
- }
30885
- // Src
30886
- if (imageSrc.value) {
30887
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'src', imageSrc.value);
30888
- }
30889
- else {
30890
- jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove(image);
30891
- this.dialog.close();
30892
- return;
30893
- }
30894
- // Border radius
30895
- if (borderRadius.value !== '0' && /^[0-9]+$/.test(borderRadius.value)) {
30896
- image.style.borderRadius = borderRadius.value + 'px';
30897
- }
30898
- else {
30899
- image.style.borderRadius = '';
30900
- }
30901
- // Title
30902
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'title', imageTitle.value || null);
30903
- // Alt
30904
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'alt', imageAlt.value || null);
30905
- // Link
30906
- let link = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(image, 'a', this.j.editor);
30907
- if (imageLink.value) {
30908
- if (!link) {
30909
- link = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.wrap(image, 'a', this.j.createInside);
30910
- }
30911
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(link, 'href', imageLink.value);
30912
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(link, 'target', imageLinkOpenInNewTab.checked ? '_blank' : null);
30913
- }
30914
- else {
30915
- if (link && link.parentNode) {
30916
- link.parentNode.replaceChild(image, link);
30917
- }
30918
- }
30919
- // Size
30920
- if (imageWidth.value !== image.offsetWidth.toString() ||
30921
- imageHeight.value !== image.offsetHeight.toString()) {
30922
- const updatedtWidth = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.trim)(imageWidth.value)
30923
- ? normalSizeToString(imageWidth.value)
30924
- : null;
30925
- const updatedHeight = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.trim)(imageHeight.value)
30926
- ? normalSizeToString(imageHeight.value)
30927
- : null;
30928
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, {
30929
- width: updatedtWidth,
30930
- height: updatedHeight
30931
- });
30932
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'width', (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'width') ? updatedtWidth : null);
30933
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'height', (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'height') ? updatedHeight : null);
30934
- }
30935
- const margins = [marginTop, marginRight, marginBottom, marginLeft];
30936
- if (opt.image.editMargins) {
30937
- if (!this.state.marginIsLocked) {
30938
- margins.forEach((margin) => {
30939
- const side = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(margin, 'data-ref') || '';
30940
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, side, normalSizeToString(margin.value));
30941
- });
30942
- }
30943
- else {
30944
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'margin', normalSizeToString(marginTop.value));
30945
- }
30946
- }
30947
- if (opt.image.editClass) {
30948
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'class', classes.value || null);
30949
- }
30950
- if (opt.image.editId) {
30951
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'id', id.value || null);
30952
- }
30953
- if (opt.image.editAlign) {
30954
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.hAlignElement)(image, align.value);
30955
- }
30956
- this.j.synchronizeValues();
30957
- this.dialog.close();
30958
- }
30959
- /**
30960
- * Open image editor dialog
30961
- */
30962
- openImageEditor() {
30963
- const url = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src') || '', a = this.j.c.element('a'), loadExternal = () => {
30964
- if (a.host !== location.host) {
30965
- this.j.confirm('You can only edit your own images. Download this image on the host?', yes => {
30966
- if (yes && this.j.uploader) {
30967
- this.j.uploader.uploadRemoteImage(a.href.toString(), resp => {
30968
- this.j.alert('The image has been successfully uploaded to the host!', () => {
30969
- if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isString)(resp.newfilename)) {
30970
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src', resp.baseurl +
30971
- resp.newfilename);
30972
- this.updateValues();
30973
- }
30974
- });
30975
- }, error => {
30976
- this.j.alert('There was an error loading %s', error.message);
30977
- });
30978
- }
30979
- });
30980
- return;
30981
- }
30982
- };
30983
- a.href = url;
30984
- this.j.filebrowser.dataProvider
30985
- .getPathByUrl(a.href.toString())
30986
- .then(resp => {
30987
- jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_5__/* .openImageEditor */ .B.call(this.j.filebrowser, a.href, resp.name, resp.path, resp.source, () => {
30988
- const timestamp = new Date().getTime();
30989
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src', url +
30990
- (url.indexOf('?') !== -1 ? '' : '?') +
30991
- '&_tmp=' +
30992
- timestamp.toString());
30993
- this.updateValues();
30994
- }, error => {
30995
- this.j.alert(error.message);
30996
- });
30997
- })
30998
- .catch(error => {
30999
- this.j.alert(error.message, loadExternal);
31000
- });
30741
+ __lock() {
30742
+ this.dialog.lock();
30743
+ this.form.setMod('lock', true);
30744
+ Object.values(this.__buttons).forEach(b => (b.state.disabled = true));
31001
30745
  }
31002
- /**
31003
- * Open popup with filebrowser/uploader buttons for image
31004
- */
31005
- openImagePopup(event) {
31006
- const popup = new jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Popup(this.j), { changeImage } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
31007
- popup.setZIndex(this.dialog.getZIndex() + 1);
31008
- popup
31009
- .setContent((0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_6__/* .FileSelectorWidget */ .kG)(this.j, {
31010
- upload: (data) => {
31011
- if (data.files && data.files.length) {
31012
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src', data.baseurl + data.files[0]);
31013
- }
31014
- this.updateValues();
31015
- popup.close();
31016
- },
31017
- filebrowser: (data) => {
31018
- if (data &&
31019
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isArray)(data.files) &&
31020
- data.files.length) {
31021
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src', data.files[0]);
31022
- popup.close();
31023
- this.updateValues();
31024
- }
31025
- }
31026
- }, this.state.image, popup.close))
31027
- .open(() => (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.position)(changeImage));
31028
- event.stopPropagation();
30746
+ __unlock() {
30747
+ this.dialog.unlock();
30748
+ this.form.setMod('lock', false);
30749
+ Object.values(this.__buttons).forEach(b => (b.state.disabled = false));
31029
30750
  }
31030
30751
  /** @override **/
31031
30752
  afterInit(editor) {
@@ -31036,7 +30757,7 @@ class imageProperties extends jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin
31036
30757
  .off(editor.editor, '.imageproperties')
31037
30758
  .on(editor.editor, 'dblclick.imageproperties', (e) => {
31038
30759
  const image = e.target;
31039
- if (!jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(image, 'img')) {
30760
+ if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isTag(image, 'img')) {
31040
30761
  return;
31041
30762
  }
31042
30763
  if (editor.o.image.openOnDblClick) {
@@ -31044,7 +30765,8 @@ class imageProperties extends jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin
31044
30765
  false) {
31045
30766
  return;
31046
30767
  }
31047
- self.state.image = image;
30768
+ self.state.sourceImage = image;
30769
+ self.state.image = image.cloneNode(true);
31048
30770
  if (!editor.o.readonly) {
31049
30771
  e.stopImmediatePropagation();
31050
30772
  e.preventDefault();
@@ -31058,206 +30780,1252 @@ class imageProperties extends jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin
31058
30780
  });
31059
30781
  })
31060
30782
  .on('openImageProperties.imageproperties', (image) => {
31061
- this.state.image = image;
30783
+ self.state.sourceImage = image;
30784
+ this.state.image = image.cloneNode(true);
31062
30785
  this.open();
31063
30786
  });
31064
30787
  }
30788
+ async onStateValuesImageSrcChange() {
30789
+ const { image, values } = this.state;
30790
+ if (!image.src) {
30791
+ return;
30792
+ }
30793
+ try {
30794
+ this.__lock();
30795
+ await image.decode();
30796
+ if (this.state.sizeIsLocked && (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.isNumeric)(values.imageWidth)) {
30797
+ const w = parseFloat(values.imageWidth.toString());
30798
+ values.imageHeight = Math.round(w / this.state.ratio);
30799
+ }
30800
+ this.j.e.fire('updateImageProperties.imageproperties', image);
30801
+ }
30802
+ catch (e) {
30803
+ this.j.alert(e.message);
30804
+ }
30805
+ finally {
30806
+ this.__unlock();
30807
+ }
30808
+ }
31065
30809
  /** @override */
31066
30810
  beforeDestruct(editor) {
31067
- this.dialog && this.dialog.destruct();
30811
+ Object.values((0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cached)(this, '__buttons') ?? {}).forEach(b => b.destruct());
30812
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cached)(this, 'dialog')?.destruct();
30813
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cached)(this, 'form')?.destruct();
31068
30814
  editor.e.off(editor.editor, '.imageproperties').off('.imageproperties');
31069
30815
  }
31070
30816
  }
31071
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
31072
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.marginIsLocked')
31073
- ], imageProperties.prototype, "onChangeMarginIsLocked", null);
31074
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
31075
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.sizeIsLocked')
31076
- ], imageProperties.prototype, "onChangeSizeIsLocked", null);
31077
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
31078
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.autobind
31079
- ], imageProperties.prototype, "onApply", null);
31080
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
31081
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.autobind
31082
- ], imageProperties.prototype, "openImageEditor", null);
31083
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
31084
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.autobind
31085
- ], imageProperties.prototype, "openImagePopup", null);
31086
- jodit_core_global__WEBPACK_IMPORTED_MODULE_1__/* .pluginSystem */ .fg.add('imageProperties', imageProperties);
30817
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
30818
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cache
30819
+ ], imageProperties.prototype, "form", null);
30820
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
30821
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cache
30822
+ ], imageProperties.prototype, "dialog", null);
30823
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
30824
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cache
30825
+ ], imageProperties.prototype, "__buttons", null);
30826
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
30827
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.image')
30828
+ ], imageProperties.prototype, "onStateValuesImageSrcChange", null);
30829
+ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .pluginSystem */ .fg.add('imageProperties', imageProperties);
31087
30830
 
31088
30831
 
31089
30832
  /***/ }),
31090
30833
 
31091
- /***/ 22254:
30834
+ /***/ 74260:
31092
30835
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31093
30836
 
31094
30837
  "use strict";
31095
30838
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31096
- /* harmony export */ Z: function() { return /* binding */ form; }
30839
+ /* harmony export */ g: function() { return /* binding */ readAlign; }
31097
30840
  /* harmony export */ });
31098
- /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(931);
30841
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(38322);
30842
+ /*!
30843
+ * Jodit Editor (https://xdsoft.net/jodit/)
30844
+ * Released under MIT see LICENSE.txt in the project root for license information.
30845
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
30846
+ */
30847
+
30848
+ /** @private */
30849
+ function readAlign(image, values) {
30850
+ // Align
30851
+ if (image.style.cssFloat &&
30852
+ ['left', 'right'].indexOf(image.style.cssFloat.toLowerCase()) !== -1) {
30853
+ values.align = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_0__/* .css */ .A)(image, 'float');
30854
+ }
30855
+ else {
30856
+ if ((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_0__/* .css */ .A)(image, 'display') === 'block' &&
30857
+ image.style.marginLeft === 'auto' &&
30858
+ image.style.marginRight === 'auto') {
30859
+ values.align = 'center';
30860
+ }
30861
+ else {
30862
+ values.align = '';
30863
+ }
30864
+ }
30865
+ }
30866
+
30867
+
30868
+ /***/ }),
30869
+
30870
+ /***/ 5549:
30871
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
30872
+
30873
+ "use strict";
30874
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
30875
+ /* harmony export */ U: function() { return /* binding */ readValuesFromImage; }
30876
+ /* harmony export */ });
30877
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26150);
30878
+ /* harmony import */ var _align__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(74260);
30879
+ /* harmony import */ var _link__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(33201);
30880
+ /* harmony import */ var _margin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(85079);
30881
+ /* harmony import */ var _size__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(17880);
30882
+ /*!
30883
+ * Jodit Editor (https://xdsoft.net/jodit/)
30884
+ * Released under MIT see LICENSE.txt in the project root for license information.
30885
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
30886
+ */
30887
+
30888
+
30889
+
30890
+
30891
+
30892
+ /**
30893
+ * Read values from image and set it to state
30894
+ * @private
30895
+ */
30896
+ async function readValuesFromImage(j, state) {
30897
+ const { sourceImage: image, values } = state;
30898
+ (0,_align__WEBPACK_IMPORTED_MODULE_3__/* .readAlign */ .g)(image, values);
30899
+ // Border radius
30900
+ values.borderRadius = parseInt(image.style.borderRadius || '0', 10) || 0;
30901
+ // Id
30902
+ values.id = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'id') || '';
30903
+ // Title
30904
+ values.imageTitle = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'title') || '';
30905
+ // Alt
30906
+ values.imageAlt = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'alt') || '';
30907
+ // Style
30908
+ values.style = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'style') || '';
30909
+ // Classes
30910
+ values.classes = ((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'class') || '').replace(/jodit_focused_image[\s]*/, '');
30911
+ // Margins
30912
+ (0,_margin__WEBPACK_IMPORTED_MODULE_4__/* .readMargins */ .E)(image, values, state);
30913
+ // Link
30914
+ (0,_link__WEBPACK_IMPORTED_MODULE_1__/* .readLink */ .X)(state, j, values);
30915
+ // Src
30916
+ values.imageSrc = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'src') || '';
30917
+ // Image size
30918
+ return (0,_size__WEBPACK_IMPORTED_MODULE_2__/* .readSizes */ .P)(image, values, state);
30919
+ }
30920
+
30921
+
30922
+ /***/ }),
30923
+
30924
+ /***/ 33201:
30925
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
30926
+
30927
+ "use strict";
30928
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
30929
+ /* harmony export */ X: function() { return /* binding */ readLink; }
30930
+ /* harmony export */ });
30931
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55186);
30932
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26150);
30933
+ /*!
30934
+ * Jodit Editor (https://xdsoft.net/jodit/)
30935
+ * Released under MIT see LICENSE.txt in the project root for license information.
30936
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
30937
+ */
30938
+
30939
+
30940
+ /** @private */
30941
+ function readLink(state, j, values) {
30942
+ const a = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.closest(state.sourceImage, 'a', j.editor);
30943
+ if (a) {
30944
+ values.imageLink = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(a, 'href') || '';
30945
+ values.imageLinkOpenInNewTab = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(a, 'target') === '_blank';
30946
+ }
30947
+ else {
30948
+ values.imageLink = '';
30949
+ values.imageLinkOpenInNewTab = false;
30950
+ }
30951
+ }
30952
+
30953
+
30954
+ /***/ }),
30955
+
30956
+ /***/ 85079:
30957
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
30958
+
30959
+ "use strict";
30960
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
30961
+ /* harmony export */ E: function() { return /* binding */ readMargins; }
30962
+ /* harmony export */ });
30963
+ /* harmony import */ var jodit_core_helpers_string_kebab_case__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(449);
31099
30964
  /*!
31100
30965
  * Jodit Editor (https://xdsoft.net/jodit/)
31101
30966
  * Released under MIT see LICENSE.txt in the project root for license information.
31102
30967
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31103
30968
  */
31104
30969
 
31105
- function form(editor) {
31106
- 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);
31107
- return editor.c.fromHTML(`<form class="jodit-properties">
30970
+ /** @private */
30971
+ function readMargins(image, values, state) {
30972
+ // Margins
30973
+ let equal = true, wasEmptyField = false;
30974
+ ['marginTop', 'marginRight', 'marginBottom', 'marginLeft'].forEach(id => {
30975
+ let value = image.style.getPropertyValue((0,jodit_core_helpers_string_kebab_case__WEBPACK_IMPORTED_MODULE_0__/* .kebabCase */ .k)(id));
30976
+ if (!value) {
30977
+ wasEmptyField = true;
30978
+ values[id] = 0;
30979
+ return;
30980
+ }
30981
+ if (/^[0-9]+(px)?$/.test(value)) {
30982
+ value = parseInt(value, 10);
30983
+ }
30984
+ values[id] = value;
30985
+ if ((wasEmptyField && values[id]) ||
30986
+ (equal && id !== 'marginTop' && values[id] !== values.marginTop)) {
30987
+ equal = false;
30988
+ }
30989
+ });
30990
+ state.marginIsLocked = equal;
30991
+ }
30992
+
30993
+
30994
+ /***/ }),
30995
+
30996
+ /***/ 17880:
30997
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
30998
+
30999
+ "use strict";
31000
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31001
+ /* harmony export */ P: function() { return /* binding */ readSizes; }
31002
+ /* harmony export */ });
31003
+ /* harmony import */ var jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(12461);
31004
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26150);
31005
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(38322);
31006
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9645);
31007
+ /*!
31008
+ * Jodit Editor (https://xdsoft.net/jodit/)
31009
+ * Released under MIT see LICENSE.txt in the project root for license information.
31010
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31011
+ */
31012
+
31013
+
31014
+
31015
+
31016
+ /** @private */
31017
+ async function readSizes(image, values, state) {
31018
+ await image.decode();
31019
+ 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;
31020
+ 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;
31021
+ values.imageWidth =
31022
+ width !== false
31023
+ ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeFromString */ .G)(width)
31024
+ : image.offsetWidth || image.naturalWidth;
31025
+ values.imageHeight =
31026
+ height !== false
31027
+ ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeFromString */ .G)(height)
31028
+ : image.offsetHeight || image.naturalHeight;
31029
+ const { imageWidth, imageHeight } = values;
31030
+ const w = parseFloat(imageWidth.toString());
31031
+ 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)) {
31032
+ state.sizeIsLocked = false;
31033
+ return;
31034
+ }
31035
+ if (height === false) {
31036
+ values.imageHeight = Math.round(w / state.ratio);
31037
+ state.sizeIsLocked = true;
31038
+ return;
31039
+ }
31040
+ const h = parseFloat(imageHeight.toString());
31041
+ state.sizeIsLocked = Math.abs(w - h * state.ratio) < 1;
31042
+ }
31043
+
31044
+
31045
+ /***/ }),
31046
+
31047
+ /***/ 31970:
31048
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31049
+
31050
+ "use strict";
31051
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31052
+ /* harmony export */ l: function() { return /* binding */ UIImagePropertiesForm; }
31053
+ /* harmony export */ });
31054
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(31635);
31055
+ /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22664);
31056
+ /* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(24767);
31057
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(65147);
31058
+ /* harmony import */ var jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6455);
31059
+ /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(931);
31060
+ /* harmony import */ var jodit_modules_widget__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(16116);
31061
+ /* harmony import */ var _ui_image_main_tab__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(33403);
31062
+ /* harmony import */ var _ui_image_position_tab__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(46681);
31063
+ /*!
31064
+ * Jodit Editor (https://xdsoft.net/jodit/)
31065
+ * Released under MIT see LICENSE.txt in the project root for license information.
31066
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31067
+ */
31068
+
31069
+
31070
+
31071
+
31072
+
31073
+
31074
+
31075
+
31076
+
31077
+
31078
+ /** @private */
31079
+ let UIImagePropertiesForm = class UIImagePropertiesForm extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_2__/* .UIGroup */ .U {
31080
+ className() {
31081
+ return 'UIImagePropertiesForm';
31082
+ }
31083
+ appendChildToContainer() { }
31084
+ getElm(elementName) {
31085
+ const selfElm = super.getElm(elementName);
31086
+ if (selfElm) {
31087
+ return selfElm;
31088
+ }
31089
+ for (const child of this.elements) {
31090
+ const elm = child.getElm(elementName);
31091
+ if (elm) {
31092
+ return elm;
31093
+ }
31094
+ }
31095
+ return null;
31096
+ }
31097
+ constructor(jodit, state, activeTabState, handlers) {
31098
+ super(jodit);
31099
+ this.state = state;
31100
+ this.handlers = handlers;
31101
+ this.__mainTab = new _ui_image_main_tab__WEBPACK_IMPORTED_MODULE_5__/* .UIImageMainTab */ .k(this.jodit, this.state, this.handlers);
31102
+ this.__positionTab = new _ui_image_position_tab__WEBPACK_IMPORTED_MODULE_6__/* .UIImagePositionTab */ ._(this.jodit, this.state, this.handlers);
31103
+ this.getElm('tabsBox').appendChild((0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_4__/* .TabsWidget */ .Zg)(jodit, [
31104
+ { name: 'Image', content: this.__mainTab },
31105
+ { name: 'Advanced', content: this.__positionTab }
31106
+ ], activeTabState));
31107
+ this.setMod('lock-size', this.state.sizeIsLocked);
31108
+ this.append(this.__mainTab).append(this.__positionTab);
31109
+ }
31110
+ render() {
31111
+ return `<form>
31108
31112
  <div class="jodit-grid jodit-grid_xs-column">
31109
31113
  <div class="jodit_col-lg-2-5 jodit_col-xs-5-5">
31110
- <div class="jodit-properties_view_box">
31111
- <div style="${!showPreview ? 'display:none' : ''}" class="jodit-properties_image_view">
31112
- <img data-ref="imageViewSrc" src="" alt=""/>
31114
+ <div class="&__view-box">
31115
+ <div class="&__imageView">
31116
+ <img class="&__imageViewSrc" src="" alt=""/>
31113
31117
  </div>
31114
- <div style="${!editSize ? 'display:none' : ''}" class="jodit-form__group jodit-properties_image_sizes">
31115
- <input data-ref="imageWidth" type="text" class="jodit-input"/>
31116
- <a data-ref="lockSize" class="jodit-properties__lock">${gi('lock')}</a>
31117
- <input data-ref="imageHeight" type="text" class="imageHeight jodit-input"/>
31118
+ <div class="jodit-form__group &__imageSizes">
31119
+ <input type="text" class="jodit-input &__imageWidth"/>
31120
+ <a class="&__lockSize">${jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__/* .Icon */ .I.get('lock')}</a>
31121
+ <input type="text" class="&__imageHeight jodit-input"/>
31118
31122
  </div>
31119
31123
  </div>
31120
31124
  </div>
31121
- <div data-ref="tabsBox" class="jodit_col-lg-3-5 jodit_col-xs-5-5"></div>
31125
+ <div class="jodit_col-lg-3-5 jodit_col-xs-5-5 &__tabsBox"></div>
31122
31126
  </div>
31123
- </form>`);
31124
- }
31127
+ </form>`;
31128
+ }
31129
+ onChangeSizeIsLocked() {
31130
+ const lockSize = this.getElm('lockSize');
31131
+ const imageWidth = this.getElm('imageWidth');
31132
+ lockSize.innerHTML = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__/* .Icon */ .I.get(this.state.sizeIsLocked ? 'lock' : 'unlock');
31133
+ this.setMod('lock-size', this.state.sizeIsLocked);
31134
+ this.j.e.fire(imageWidth, 'change');
31135
+ }
31136
+ onLockSizeClick() {
31137
+ this.state.sizeIsLocked = !this.state.sizeIsLocked;
31138
+ }
31139
+ onStateValuesSizeChange() {
31140
+ const imageWidth = this.getElm('imageWidth');
31141
+ const imageHeight = this.getElm('imageHeight');
31142
+ if (imageWidth !== this.j.od.activeElement) {
31143
+ imageWidth.value = this.state.values.imageWidth.toString();
31144
+ }
31145
+ if (imageHeight !== this.j.od.activeElement) {
31146
+ imageHeight.value = this.state.values.imageHeight.toString();
31147
+ }
31148
+ }
31149
+ onImageWidthChange(e) {
31150
+ const imageWidth = this.getElm('imageWidth');
31151
+ const imageHeight = this.getElm('imageHeight');
31152
+ if (!this.state.sizeIsLocked ||
31153
+ !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.isNumeric)(imageWidth.value) ||
31154
+ !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.isNumeric)(imageHeight.value)) {
31155
+ this.state.values.imageWidth = imageWidth.value;
31156
+ this.state.values.imageHeight = imageHeight.value;
31157
+ return;
31158
+ }
31159
+ const w = parseFloat(imageWidth.value), h = parseFloat(imageHeight.value);
31160
+ if (e.target === imageWidth) {
31161
+ this.state.values.imageWidth = w;
31162
+ this.state.values.imageHeight = Math.round(w / this.state.ratio);
31163
+ }
31164
+ else {
31165
+ this.state.values.imageWidth = Math.round(h * this.state.ratio);
31166
+ this.state.values.imageHeight = h;
31167
+ }
31168
+ }
31169
+ onStateValuesImageSrcChange() {
31170
+ const { imageSrc } = this.state.values;
31171
+ if (!imageSrc) {
31172
+ return;
31173
+ }
31174
+ const imageViewSrc = this.getElm('imageViewSrc');
31175
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.attr)(imageViewSrc, 'src', imageSrc);
31176
+ const image = new Image();
31177
+ image.src = imageSrc;
31178
+ this.state.image = image;
31179
+ }
31180
+ hideFieldByOptions() {
31181
+ const opt = this.j.o.image;
31182
+ [
31183
+ ['editSize', 'imageSizes'],
31184
+ ['showPreview', 'imageView']
31185
+ ].forEach(([optKey, elmKey]) => {
31186
+ const elm = this.getElm(elmKey);
31187
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.css)(elm, 'display', opt[optKey] ? null : 'none');
31188
+ });
31189
+ }
31190
+ };
31191
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31192
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready'),
31193
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.sizeIsLocked')
31194
+ ], UIImagePropertiesForm.prototype, "onChangeSizeIsLocked", null);
31195
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31196
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('lockSize:click')
31197
+ ], UIImagePropertiesForm.prototype, "onLockSizeClick", null);
31198
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31199
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready'),
31200
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)(['state.values.imageWidth', 'state.values.imageHeight'])
31201
+ ], UIImagePropertiesForm.prototype, "onStateValuesSizeChange", null);
31202
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31203
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([
31204
+ 'imageWidth:change',
31205
+ 'imageHeight:change',
31206
+ 'imageWidth:keydown',
31207
+ 'imageHeight:keydown',
31208
+ 'imageWidth:mousedown',
31209
+ 'imageHeight:mousedown',
31210
+ 'imageWidth:paste',
31211
+ 'imageHeight:paste'
31212
+ ]),
31213
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.debounce)()
31214
+ ], UIImagePropertiesForm.prototype, "onImageWidthChange", null);
31215
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31216
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready'),
31217
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.values.imageSrc')
31218
+ ], UIImagePropertiesForm.prototype, "onStateValuesImageSrcChange", null);
31219
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31220
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready')
31221
+ ], UIImagePropertiesForm.prototype, "hideFieldByOptions", null);
31222
+ UIImagePropertiesForm = (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31223
+ jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_8__/* .component */ .s
31224
+ ], UIImagePropertiesForm);
31225
+
31125
31226
 
31126
31227
 
31127
31228
  /***/ }),
31128
31229
 
31129
- /***/ 75263:
31230
+ /***/ 33403:
31130
31231
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31131
31232
 
31132
31233
  "use strict";
31133
31234
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31134
- /* harmony export */ J: function() { return /* binding */ mainTab; }
31235
+ /* harmony export */ k: function() { return /* binding */ UIImageMainTab; }
31135
31236
  /* harmony export */ });
31136
- /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(931);
31237
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(31635);
31238
+ /* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(24767);
31239
+ /* harmony import */ var jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71151);
31240
+ /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(66927);
31241
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65147);
31242
+ /* harmony import */ var jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6455);
31137
31243
  /*!
31138
31244
  * Jodit Editor (https://xdsoft.net/jodit/)
31139
31245
  * Released under MIT see LICENSE.txt in the project root for license information.
31140
31246
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31141
31247
  */
31142
31248
 
31143
- function mainTab(editor) {
31144
- 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;
31145
- return editor.c.fromHTML(`<div style="${!opt.image.editSrc ? 'display:none' : ''}" class="jodit-form__group">
31146
- <label>${i18n('Src')}</label>
31249
+
31250
+
31251
+
31252
+
31253
+
31254
+ /** @private */
31255
+ let UIImageMainTab = class UIImageMainTab extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_3__/* .UIGroup */ .U {
31256
+ className() {
31257
+ return 'UIImageMainTab';
31258
+ }
31259
+ appendChildToContainer() {
31260
+ // Do nothing
31261
+ }
31262
+ constructor(view, state, handlers) {
31263
+ super(view);
31264
+ this.state = state;
31265
+ this.handlers = handlers;
31266
+ }
31267
+ render() {
31268
+ return `<div class="jodit-form__group &__editSrc">
31269
+ <label>~Src~</label>
31147
31270
  <div class="jodit-input_group">
31148
- <input data-ref="imageSrc" class="jodit-input" type="text"/>
31149
- <div
31150
- class="jodit-input_group-buttons"
31151
- style="${hasFbUrl ? '' : 'display: none'}"
31152
- >
31153
- <a
31154
- data-ref="changeImage"
31155
- class="jodit-button"
31156
- >${gi('image')}</a>
31157
- <a
31158
- data-ref="editImage"
31159
- class="jodit-button"
31160
- style="${hasEditor ? '' : 'display: none'}"
31161
- >${gi('crop')}</a>
31271
+ <input class="jodit-input &__imageSrc" type="text"/>
31272
+ <div class="jodit-input_group-buttons &__fixImage">
31273
+ <a class="jodit-button &__changeImage">*image*</a>
31274
+ <a class="jodit-button &__editImage">*crop*</a>
31162
31275
  </div>
31163
31276
  </div>
31164
31277
  </div>
31165
- <div style="${!opt.image.editTitle ? 'display:none' : ''}" class="jodit-form__group">
31166
- <label>${i18n('Title')}</label>
31167
- <input data-ref="imageTitle" type="text" class="jodit-input"/>
31278
+ <div class="jodit-form__group &__editTitle">
31279
+ <label>~Title~</label>
31280
+ <input type="text" class="jodit-input &__imageTitle"/>
31168
31281
  </div>
31169
- <div style="${!opt.image.editAlt ? 'display:none' : ''}" class="jodit-form__group">
31170
- <label>${i18n('Alternative')}</label>
31171
- <input data-ref="imageAlt" type="text" class="jodit-input"/>
31282
+ <div class="jodit-form__group &__editAlt">
31283
+ <label>~Alternative~</label>
31284
+ <input type="text" class="jodit-input &__imageAlt"/>
31172
31285
  </div>
31173
- <div style="${!opt.image.editLink ? 'display:none' : ''}" class="jodit-form__group">
31174
- <label>${i18n('Link')}</label>
31175
- <input data-ref="imageLink" type="text" class="jodit-input"/>
31286
+ <div class="jodit-form__group &__editLink">
31287
+ <label>~Link~</label>
31288
+ <input type="text" class="jodit-input &__imageLink"/>
31176
31289
  </div>
31177
- <div style="${!opt.image.editLink ? 'display:none' : ''}" class="jodit-form__group">
31290
+ <div class="jodit-form__group &__editLinkTarget">
31178
31291
  <label class="jodit_vertical_middle">
31179
- <input data-ref="imageLinkOpenInNewTab" type="checkbox" class="jodit-checkbox"/>
31180
- <span>${i18n('Open link in new tab')}</span>
31292
+ <input type="checkbox" class="jodit-checkbox &__imageLinkOpenInNewTab"/>
31293
+ <span>~Open link in new tab~</span>
31181
31294
  </label>
31182
- </div>`);
31183
- }
31295
+ </div>`;
31296
+ }
31297
+ async onStateImageSrcChange() {
31298
+ const imageSrc = this.getElm('imageSrc');
31299
+ imageSrc.value = this.state.values.imageSrc;
31300
+ }
31301
+ onImageSrcChange() {
31302
+ this.state.values.imageSrc = this.getElm('imageSrc').value;
31303
+ }
31304
+ /**
31305
+ * Open image editor
31306
+ */
31307
+ onEditImageClick(e) {
31308
+ this.handlers.openImageEditor();
31309
+ e.stopPropagation();
31310
+ }
31311
+ /**
31312
+ * Open popup with filebrowser/uploader buttons for image
31313
+ */
31314
+ onChangeImageClick(e) {
31315
+ this.handlers.openImagePopup(this.getElm('changeImage'));
31316
+ e.stopPropagation();
31317
+ }
31318
+ onStateTitleChange() {
31319
+ const title = this.getElm('imageTitle');
31320
+ title.value = this.state.values.imageTitle;
31321
+ }
31322
+ onTitleChange() {
31323
+ this.state.values.imageTitle = this.getElm('imageTitle').value;
31324
+ }
31325
+ onStateAltChange() {
31326
+ const alt = this.getElm('imageAlt');
31327
+ alt.value = this.state.values.imageAlt;
31328
+ }
31329
+ onAltChange() {
31330
+ this.state.values.imageAlt = this.getElm('imageAlt').value;
31331
+ }
31332
+ onStateImageLinkChange() {
31333
+ const imageLink = this.getElm('imageLink');
31334
+ imageLink.value = this.state.values.imageLink;
31335
+ }
31336
+ onImageLinkChange() {
31337
+ this.state.values.imageLink = this.getElm('imageLink').value;
31338
+ }
31339
+ onStateImageLinkOpenInNewTabChange() {
31340
+ const imageLinkOpenInNewTab = this.getElm('imageLinkOpenInNewTab');
31341
+ imageLinkOpenInNewTab.checked = this.state.values.imageLinkOpenInNewTab;
31342
+ }
31343
+ onImageLinkOpenInNewTabChange() {
31344
+ this.state.values.imageLinkOpenInNewTab = this.getElm('imageLinkOpenInNewTab').checked;
31345
+ }
31346
+ hideFieldByOptions() {
31347
+ const o = this.j.o;
31348
+ const opt = o.image;
31349
+ [
31350
+ ['editSrc', 'editSrc'],
31351
+ ['editTitle', 'editTitle'],
31352
+ ['editAlt', 'editAlt'],
31353
+ ['editLink', 'editLink'],
31354
+ ['editLink', 'editLinkTarget'],
31355
+ ['useImageEditor', 'editImage']
31356
+ ].forEach(([optKey, elmKey]) => {
31357
+ const elm = this.getElm(elmKey);
31358
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(elm, 'display', opt[optKey] ? null : 'none');
31359
+ });
31360
+ const changeImage = this.getElm('changeImage');
31361
+ const needShowChangeImage = Boolean(o.filebrowser.ajax.url || o.uploader.url);
31362
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(changeImage, 'display', needShowChangeImage ? null : 'none');
31363
+ const editImage = this.getElm('editImage');
31364
+ const needShowEditImage = Boolean(o.filebrowser.ajax.url) && opt.useImageEditor;
31365
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(editImage, 'display', needShowEditImage ? null : 'none');
31366
+ const fixImage = this.getElm('fixImage');
31367
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(fixImage, 'display', needShowChangeImage || needShowEditImage ? null : 'none');
31368
+ }
31369
+ };
31370
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31371
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageSrc')
31372
+ ], UIImageMainTab.prototype, "onStateImageSrcChange", null);
31373
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31374
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageSrc:change')
31375
+ ], UIImageMainTab.prototype, "onImageSrcChange", null);
31376
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31377
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('editImage:click')
31378
+ ], UIImageMainTab.prototype, "onEditImageClick", null);
31379
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31380
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('changeImage:click')
31381
+ ], UIImageMainTab.prototype, "onChangeImageClick", null);
31382
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31383
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageTitle')
31384
+ ], UIImageMainTab.prototype, "onStateTitleChange", null);
31385
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31386
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageTitle:change')
31387
+ ], UIImageMainTab.prototype, "onTitleChange", null);
31388
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31389
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageAlt')
31390
+ ], UIImageMainTab.prototype, "onStateAltChange", null);
31391
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31392
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageAlt:change')
31393
+ ], UIImageMainTab.prototype, "onAltChange", null);
31394
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31395
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageLink')
31396
+ ], UIImageMainTab.prototype, "onStateImageLinkChange", null);
31397
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31398
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageLink:change')
31399
+ ], UIImageMainTab.prototype, "onImageLinkChange", null);
31400
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31401
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageLinkOpenInNewTab')
31402
+ ], UIImageMainTab.prototype, "onStateImageLinkOpenInNewTabChange", null);
31403
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31404
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageLinkOpenInNewTab:change')
31405
+ ], UIImageMainTab.prototype, "onImageLinkOpenInNewTabChange", null);
31406
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31407
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready')
31408
+ ], UIImageMainTab.prototype, "hideFieldByOptions", null);
31409
+ UIImageMainTab = (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31410
+ jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_5__/* .component */ .s
31411
+ ], UIImageMainTab);
31412
+
31184
31413
 
31185
31414
 
31186
31415
  /***/ }),
31187
31416
 
31188
- /***/ 57837:
31417
+ /***/ 46681:
31189
31418
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31190
31419
 
31191
31420
  "use strict";
31192
31421
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31193
- /* harmony export */ b: function() { return /* binding */ positionTab; }
31422
+ /* harmony export */ _: function() { return /* binding */ UIImagePositionTab; }
31194
31423
  /* harmony export */ });
31195
- /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(931);
31424
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(31635);
31425
+ /* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(24767);
31426
+ /* harmony import */ var jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71151);
31427
+ /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(66927);
31428
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65147);
31429
+ /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(98253);
31430
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(26150);
31431
+ /* harmony import */ var jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29780);
31432
+ /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(931);
31433
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(9645);
31196
31434
  /*!
31197
31435
  * Jodit Editor (https://xdsoft.net/jodit/)
31198
31436
  * Released under MIT see LICENSE.txt in the project root for license information.
31199
31437
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31200
31438
  */
31201
31439
 
31202
- function positionTab(editor) {
31203
- 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);
31204
- const classInput = [];
31205
- if (opt.image.availableClasses.length > 0) {
31206
- classInput.push('<select data-ref="classes" class="jodit-input jodit-select">');
31207
- opt.image.availableClasses.forEach(item => {
31208
- if (typeof item === 'string') {
31209
- classInput.push(`<option value="${item}">${item}</option>`);
31210
- }
31211
- else {
31212
- classInput.push(`<option value="${item[0]}">${item[1]}</option>`);
31213
- }
31214
- });
31215
- classInput.push('</select>');
31440
+
31441
+
31442
+
31443
+
31444
+
31445
+
31446
+
31447
+
31448
+
31449
+ /** @private */
31450
+ let UIImagePositionTab = class UIImagePositionTab extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_4__/* .UIElement */ .D {
31451
+ className() {
31452
+ return 'UIImagePositionTab';
31216
31453
  }
31217
- else {
31218
- classInput.push('<input data-ref="classes" type="text" class="jodit-input"/>');
31454
+ constructor(jodit, state, handlers) {
31455
+ super(jodit, {
31456
+ availableClasses: jodit.o.image.availableClasses
31457
+ });
31458
+ this.state = state;
31459
+ this.handlers = handlers;
31219
31460
  }
31220
- return editor.c.fromHTML(`<div style="${!opt.image.editMargins ? 'display:none' : ''}" class="jodit-form__group">
31221
- <label>${i18n('Margins')}</label>
31461
+ render({ availableClasses }) {
31462
+ return `<div class="jodit-form__group &__editMargins">
31463
+ <label>~Margins~</label>
31222
31464
  <div class="jodit-grid jodit_vertical_middle">
31223
- <input class="jodit_col-lg-1-5 jodit-input" data-ref="marginTop" type="text" placeholder="${i18n('top')}"/>
31224
- <a style="text-align: center;" data-ref="lockMargin" class="jodit-properties__lock jodit_col-lg-1-5">${gi('lock')}</a>
31225
- <input disabled="true" class="jodit_col-lg-1-5 jodit-input" data-ref="marginRight" type="text" placeholder="${i18n('right')}"/>
31226
- <input disabled="true" class="jodit_col-lg-1-5 jodit-input" data-ref="marginBottom" type="text" placeholder="${i18n('bottom')}"/>
31227
- <input disabled="true" class="jodit_col-lg-1-5 jodit-input" data-ref="marginLeft" type="text" placeholder="${i18n('left')}"/>
31465
+ <input class="jodit_col-lg-1-5 jodit-input &__marginTop" type="text" placeholder="~top~"/>
31466
+ <a style="text-align: center;" class="jodit-properties__lock jodit_col-lg-1-5 &__lockMargin">*lock*</a>
31467
+ <input disabled="disabled" class="jodit_col-lg-1-5 jodit-input &__marginRight" type="text" placeholder="~right~"/>
31468
+ <input disabled="disabled" class="jodit_col-lg-1-5 jodit-input &__marginBottom" type="text" placeholder="~bottom~"/>
31469
+ <input disabled="disabled" class="jodit_col-lg-1-5 jodit-input &__marginLeft" type="text" placeholder="~left~"/>
31228
31470
  </div>
31229
31471
  </div>
31230
- <div
31231
- style="${!opt.image.editAlign ? 'display:none' : ''}"
31232
- class="jodit-form__group"
31233
- >
31234
- <label>${i18n('Align')}</label>
31235
- <select data-ref="align" class="jodit-select">
31236
- <option value="">${i18n('--Not Set--')}</option>
31237
- <option value="left">${i18n('Left')}</option>
31238
- <option value="center">${i18n('Center')}</option>
31239
- <option value="right">${i18n('Right')}</option>
31472
+ <div class="jodit-form__group &__editAlign">
31473
+ <label>~Align~</label>
31474
+ <select class="jodit-select &__align">
31475
+ <option value="">~--Not Set--~</option>
31476
+ <option value="left">~Left~</option>
31477
+ <option value="center">~Center~</option>
31478
+ <option value="right">~Right~</option>
31240
31479
  </select>
31241
31480
  </div>
31242
- <div style="${!opt.image.editStyle ? 'display:none' : ''}" class="jodit-form__group">
31243
- <label>${i18n('Styles')}</label>
31244
- <input data-ref="style" type="text" class="jodit-input"/>
31481
+ <div class="jodit-form__group &__editStyle">
31482
+ <label>~Styles~</label>
31483
+ <input type="text" class="jodit-input &__style"/>
31245
31484
  </div>
31246
- <div style="${!opt.image.editClass ? 'display:none' : ''}" class="jodit-form__group">
31247
- <label>${i18n('Classes')}</label>
31248
- ${classInput.join('')}
31485
+ <div class="jodit-form__group &__editClass">
31486
+ <label>~Classes~</label>
31487
+ ${(() => {
31488
+ const classInput = [];
31489
+ if (availableClasses && availableClasses.length > 0) {
31490
+ classInput.push('<select class="jodit-input jodit-select &__classes">');
31491
+ availableClasses.forEach(item => {
31492
+ if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_7__/* .isString */ .K)(item)) {
31493
+ classInput.push(`<option value="${item}">${item}</option>`);
31494
+ }
31495
+ else {
31496
+ classInput.push(`<option value="${item[0]}">${item[1]}</option>`);
31497
+ }
31498
+ });
31499
+ classInput.push('</select>');
31500
+ }
31501
+ else {
31502
+ classInput.push('<input type="text" class="jodit-input &__classes"/>');
31503
+ }
31504
+ return classInput.join('');
31505
+ })()}
31249
31506
  </div>
31250
- <div style="${!opt.image.editId ? 'display:none' : ''}" class="jodit-form__group">
31507
+ <div class="jodit-form__group &__editId">
31251
31508
  <label>Id</label>
31252
- <input data-ref="id" type="text" class="jodit-input"/>
31509
+ <input type="text" class="jodit-input &__id"/>
31253
31510
  </div>
31254
31511
  <div
31255
- style="${!opt.image.editBorderRadius ? 'display:none' : ''}"
31256
- class="jodit-form__group"
31512
+ class="jodit-form__group &__editBorderRadius"
31257
31513
  >
31258
- <label>${i18n('Border radius')}</label>
31259
- <input data-ref="borderRadius" type="number" class="jodit-input"/>
31260
- </div>`);
31514
+ <label>~Border radius~</label>
31515
+ <input type="number" class="jodit-input &__borderRadius"/>
31516
+ </div>`;
31517
+ }
31518
+ onStateAlignChange() {
31519
+ const align = this.getElm('align');
31520
+ align.value = this.state.values.align;
31521
+ }
31522
+ onChangeAlign() {
31523
+ const align = this.getElm('align');
31524
+ this.state.values.align = align.value;
31525
+ }
31526
+ onStateValuesBorderRadiusChange() {
31527
+ const borderRadius = this.getElm('borderRadius');
31528
+ borderRadius.value = this.state.values.borderRadius.toString();
31529
+ }
31530
+ onChangeBorderRadius() {
31531
+ const borderRadius = this.getElm('borderRadius');
31532
+ this.state.values.borderRadius = parseFloat(borderRadius.value);
31533
+ }
31534
+ onStateValuesIdChange() {
31535
+ const id = this.getElm('id');
31536
+ id.value = this.state.values.id;
31537
+ }
31538
+ onChangeId() {
31539
+ const id = this.getElm('id');
31540
+ this.state.values.id = id.value;
31541
+ }
31542
+ onStateValuesStyleChange() {
31543
+ const style = this.getElm('style');
31544
+ style.value = this.state.values.style;
31545
+ }
31546
+ onChangeStyle() {
31547
+ const style = this.getElm('style');
31548
+ this.state.values.style = style.value;
31549
+ }
31550
+ onStateValuesClassesChange() {
31551
+ const classes = this.getElm('classes');
31552
+ classes.value = this.state.values.classes;
31553
+ }
31554
+ onChangClasses() {
31555
+ const classes = this.getElm('classes');
31556
+ this.state.values.classes = classes.value;
31557
+ }
31558
+ onLockMarginClick(e) {
31559
+ this.state.marginIsLocked = !this.state.marginIsLocked;
31560
+ e.preventDefault();
31561
+ }
31562
+ onChangeMarginIsLocked() {
31563
+ const marginBottom = this.getElm('marginBottom');
31564
+ const marginRight = this.getElm('marginRight');
31565
+ const marginLeft = this.getElm('marginLeft');
31566
+ const lockMargin = this.getElm('lockMargin');
31567
+ [marginRight, marginBottom, marginLeft].forEach(elm => {
31568
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_3__/* .attr */ .C)(elm, 'disabled', this.state.marginIsLocked || null);
31569
+ });
31570
+ lockMargin.innerHTML = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_5__/* .Icon */ .I.get(this.state.marginIsLocked ? 'lock' : 'unlock');
31571
+ if (this.state.marginIsLocked) {
31572
+ const marginTop = this.state.values.marginTop;
31573
+ this.state.values.marginRight = marginTop;
31574
+ this.state.values.marginBottom = marginTop;
31575
+ this.state.values.marginLeft = marginTop;
31576
+ }
31577
+ }
31578
+ onStateValuesMarginChange() {
31579
+ const marginTop = this.getElm('marginTop');
31580
+ const marginRight = this.getElm('marginRight');
31581
+ const marginBottom = this.getElm('marginBottom');
31582
+ const marginLeft = this.getElm('marginLeft');
31583
+ marginTop.value = this.state.values.marginTop.toString();
31584
+ marginRight.value = this.state.values.marginRight.toString();
31585
+ marginBottom.value = this.state.values.marginBottom.toString();
31586
+ marginLeft.value = this.state.values.marginLeft.toString();
31587
+ }
31588
+ onChangeMargin() {
31589
+ const marginTop = this.getElm('marginTop');
31590
+ const marginRight = this.getElm('marginRight');
31591
+ const marginBottom = this.getElm('marginBottom');
31592
+ const marginLeft = this.getElm('marginLeft');
31593
+ this.state.values.marginTop = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginTop.value);
31594
+ if (this.state.marginIsLocked) {
31595
+ this.state.values.marginRight = this.state.values.marginTop;
31596
+ this.state.values.marginBottom = this.state.values.marginTop;
31597
+ this.state.values.marginLeft = this.state.values.marginTop;
31598
+ }
31599
+ else {
31600
+ this.state.values.marginRight = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginRight.value);
31601
+ this.state.values.marginBottom = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginBottom.value);
31602
+ this.state.values.marginLeft = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginLeft.value);
31603
+ }
31604
+ }
31605
+ hideFieldByOptions() {
31606
+ const opt = this.j.o.image;
31607
+ [
31608
+ ['editMargins', 'editMargins'],
31609
+ ['editAlign', 'editAlign'],
31610
+ ['editStyle', 'editStyle'],
31611
+ ['editClass', 'editClass'],
31612
+ ['editId', 'editId'],
31613
+ ['editBorderRadius', 'editBorderRadius']
31614
+ ].forEach(([optKey, elmKey]) => {
31615
+ const elm = this.getElm(elmKey);
31616
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(elm, 'display', opt[optKey] ? null : 'none');
31617
+ });
31618
+ }
31619
+ };
31620
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
31621
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
31622
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.align')
31623
+ ], UIImagePositionTab.prototype, "onStateAlignChange", null);
31624
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
31625
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('align:change')
31626
+ ], UIImagePositionTab.prototype, "onChangeAlign", null);
31627
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
31628
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
31629
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.borderRadius')
31630
+ ], UIImagePositionTab.prototype, "onStateValuesBorderRadiusChange", null);
31631
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
31632
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('borderRadius:change')
31633
+ ], UIImagePositionTab.prototype, "onChangeBorderRadius", null);
31634
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
31635
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
31636
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.id')
31637
+ ], UIImagePositionTab.prototype, "onStateValuesIdChange", null);
31638
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
31639
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('id:change')
31640
+ ], UIImagePositionTab.prototype, "onChangeId", null);
31641
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
31642
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
31643
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.style')
31644
+ ], UIImagePositionTab.prototype, "onStateValuesStyleChange", null);
31645
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
31646
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('style:change')
31647
+ ], UIImagePositionTab.prototype, "onChangeStyle", null);
31648
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
31649
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
31650
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.classes')
31651
+ ], UIImagePositionTab.prototype, "onStateValuesClassesChange", null);
31652
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
31653
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('classes:change')
31654
+ ], UIImagePositionTab.prototype, "onChangClasses", null);
31655
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
31656
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('lockMargin:click')
31657
+ ], UIImagePositionTab.prototype, "onLockMarginClick", null);
31658
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
31659
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
31660
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.marginIsLocked')
31661
+ ], UIImagePositionTab.prototype, "onChangeMarginIsLocked", null);
31662
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
31663
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
31664
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)([
31665
+ 'state.values.marginTop',
31666
+ 'state.values.marginRight',
31667
+ 'state.values.marginBottom',
31668
+ 'state.values.marginLeft'
31669
+ ])
31670
+ ], UIImagePositionTab.prototype, "onStateValuesMarginChange", null);
31671
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
31672
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)([
31673
+ 'marginTop:change',
31674
+ 'marginRight:change',
31675
+ 'marginBottom:change',
31676
+ 'marginLeft:change'
31677
+ ])
31678
+ ], UIImagePositionTab.prototype, "onChangeMargin", null);
31679
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
31680
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready')
31681
+ ], UIImagePositionTab.prototype, "hideFieldByOptions", null);
31682
+ UIImagePositionTab = (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
31683
+ jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_9__/* .component */ .s
31684
+ ], UIImagePositionTab);
31685
+
31686
+
31687
+
31688
+ /***/ }),
31689
+
31690
+ /***/ 80778:
31691
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31692
+
31693
+ "use strict";
31694
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31695
+ /* harmony export */ v: function() { return /* binding */ openImageEditorDialog; }
31696
+ /* harmony export */ });
31697
+ /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(98253);
31698
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26150);
31699
+ /* harmony import */ var jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(53804);
31700
+ /*!
31701
+ * Jodit Editor (https://xdsoft.net/jodit/)
31702
+ * Released under MIT see LICENSE.txt in the project root for license information.
31703
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31704
+ */
31705
+
31706
+
31707
+
31708
+ /**
31709
+ * Open image editor dialog
31710
+ * @private
31711
+ */
31712
+ function openImageEditorDialog(j, state) {
31713
+ const url = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(state.image, 'src') || '', a = j.c.element('a'), loadExternal = () => {
31714
+ if (a.host !== location.host) {
31715
+ j.confirm('You can only edit your own images. Download this image on the host?', yes => {
31716
+ if (yes && j.uploader) {
31717
+ j.uploader.uploadRemoteImage(a.href.toString(), resp => {
31718
+ j.alert('The image has been successfully uploaded to the host!', () => {
31719
+ if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_2__/* .isString */ .K)(resp.newfilename)) {
31720
+ state.values.imageSrc =
31721
+ resp.baseurl +
31722
+ resp.newfilename;
31723
+ }
31724
+ });
31725
+ }, error => {
31726
+ j.alert('There was an error loading %s', error.message);
31727
+ });
31728
+ }
31729
+ });
31730
+ return;
31731
+ }
31732
+ };
31733
+ a.href = url;
31734
+ j.filebrowser.dataProvider
31735
+ .getPathByUrl(a.href.toString())
31736
+ .then(resp => {
31737
+ jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_1__/* .openImageEditor */ .B.call(j.filebrowser, a.href, resp.name, resp.path, resp.source, () => {
31738
+ const timestamp = new Date().getTime();
31739
+ state.values.imageSrc =
31740
+ url +
31741
+ (url.indexOf('?') !== -1 ? '' : '?') +
31742
+ '&_tmp=' +
31743
+ timestamp.toString();
31744
+ }, error => {
31745
+ j.alert(error.message);
31746
+ });
31747
+ })
31748
+ .catch(error => {
31749
+ j.alert(error.message, loadExternal);
31750
+ });
31751
+ }
31752
+
31753
+
31754
+ /***/ }),
31755
+
31756
+ /***/ 33733:
31757
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31758
+
31759
+ "use strict";
31760
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31761
+ /* harmony export */ q: function() { return /* binding */ openImagePopup; }
31762
+ /* harmony export */ });
31763
+ /* harmony import */ var jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(37923);
31764
+ /* harmony import */ var jodit_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(27594);
31765
+ /* harmony import */ var jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(80071);
31766
+ /* harmony import */ var jodit_modules_widget_file_selector_file_selector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10067);
31767
+ /*!
31768
+ * Jodit Editor (https://xdsoft.net/jodit/)
31769
+ * Released under MIT see LICENSE.txt in the project root for license information.
31770
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31771
+ */
31772
+
31773
+
31774
+
31775
+
31776
+ /** @private */
31777
+ function openImagePopup(j, dialog, state, button) {
31778
+ const popup = new jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_0__/* .Popup */ .z(dialog);
31779
+ const closePopup = () => {
31780
+ popup.close();
31781
+ popup.destruct();
31782
+ };
31783
+ popup
31784
+ .setContent((0,jodit_modules_widget_file_selector_file_selector__WEBPACK_IMPORTED_MODULE_1__/* .FileSelectorWidget */ .k)(j, {
31785
+ upload: (data) => {
31786
+ if (data.files && data.files.length) {
31787
+ state.values.imageSrc =
31788
+ data.baseurl + data.files[0];
31789
+ }
31790
+ closePopup();
31791
+ },
31792
+ filebrowser: async (data) => {
31793
+ if (data && (0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_2__/* .isArray */ .c)(data.files) && data.files.length) {
31794
+ state.values.imageSrc = data.files[0];
31795
+ closePopup();
31796
+ }
31797
+ }
31798
+ }, state.image, closePopup))
31799
+ .open(() => (0,jodit_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_3__/* .position */ .G)(button));
31800
+ }
31801
+
31802
+
31803
+ /***/ }),
31804
+
31805
+ /***/ 9645:
31806
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31807
+
31808
+ "use strict";
31809
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31810
+ /* harmony export */ G: function() { return /* binding */ normalSizeFromString; },
31811
+ /* harmony export */ n: function() { return /* binding */ normalSizeToString; }
31812
+ /* harmony export */ });
31813
+ /* harmony import */ var jodit_core_helpers_checker_is_number__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2461);
31814
+ /* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(59101);
31815
+ /*!
31816
+ * Jodit Editor (https://xdsoft.net/jodit/)
31817
+ * Released under MIT see LICENSE.txt in the project root for license information.
31818
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31819
+ */
31820
+
31821
+
31822
+ /** @private */
31823
+ const normalSizeFromString = (value) => {
31824
+ return /^[-+]?[0-9.]+(px)?$/.test(value.toString())
31825
+ ? parseFloat(value.toString())
31826
+ : value;
31827
+ };
31828
+ /** @private */
31829
+ const normalSizeToString = (value) => {
31830
+ if ((0,jodit_core_helpers_checker_is_number__WEBPACK_IMPORTED_MODULE_1__/* .isNumber */ .E)(value)) {
31831
+ return value ? value + 'px' : value.toString();
31832
+ }
31833
+ value = (0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_0__/* .trim */ .Bq)(value);
31834
+ return /^[0-9]+$/.test(value) ? value + 'px' : value;
31835
+ };
31836
+
31837
+
31838
+ /***/ }),
31839
+
31840
+ /***/ 30393:
31841
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31842
+
31843
+ "use strict";
31844
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31845
+ /* harmony export */ j: function() { return /* binding */ applyValuesToImage; }
31846
+ /* harmony export */ });
31847
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55186);
31848
+ /* harmony import */ var jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97369);
31849
+ /* harmony import */ var _link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(88269);
31850
+ /* harmony import */ var _margin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(78139);
31851
+ /* harmony import */ var _size__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(58972);
31852
+ /*!
31853
+ * Jodit Editor (https://xdsoft.net/jodit/)
31854
+ * Released under MIT see LICENSE.txt in the project root for license information.
31855
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31856
+ */
31857
+
31858
+
31859
+
31860
+
31861
+
31862
+ /**
31863
+ * Apply form's values to image
31864
+ * @private
31865
+ */
31866
+ function applyValuesToImage(j, state, image) {
31867
+ const { style, imageSrc, borderRadius, imageTitle, imageAlt, imageLink, imageWidth, imageHeight, marginTop, marginRight, marginBottom, marginLeft, imageLinkOpenInNewTab, align, classes, id } = state.values;
31868
+ const opt = j.o;
31869
+ // styles
31870
+ if (opt.image.editStyle) {
31871
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'style', style || null);
31872
+ }
31873
+ // Src
31874
+ if (imageSrc) {
31875
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'src', imageSrc);
31876
+ }
31877
+ else {
31878
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.safeRemove(image);
31879
+ return;
31880
+ }
31881
+ // Border radius
31882
+ image.style.borderRadius = borderRadius ? borderRadius + 'px' : '';
31883
+ // Title
31884
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'title', imageTitle || null);
31885
+ // Alt
31886
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'alt', imageAlt || null);
31887
+ // Link
31888
+ (0,_link__WEBPACK_IMPORTED_MODULE_2__/* .applyLink */ .j)(j, image, imageLink, imageLinkOpenInNewTab);
31889
+ // Size
31890
+ (0,_size__WEBPACK_IMPORTED_MODULE_4__/* .applySize */ .q)(image, imageWidth, imageHeight, state.sizeIsLocked);
31891
+ // Margin
31892
+ if (j.o.image.editMargins) {
31893
+ (0,_margin__WEBPACK_IMPORTED_MODULE_3__/* .applyMargin */ .N)(j, marginTop, marginRight, marginBottom, marginLeft, image, state.marginIsLocked);
31894
+ }
31895
+ if (opt.image.editClass) {
31896
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'class', classes || null);
31897
+ }
31898
+ if (opt.image.editId) {
31899
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'id', id || null);
31900
+ }
31901
+ if (opt.image.editAlign) {
31902
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.hAlignElement)(image, align);
31903
+ }
31904
+ }
31905
+
31906
+
31907
+ /***/ }),
31908
+
31909
+ /***/ 88269:
31910
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31911
+
31912
+ "use strict";
31913
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31914
+ /* harmony export */ j: function() { return /* binding */ applyLink; }
31915
+ /* harmony export */ });
31916
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55186);
31917
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26150);
31918
+ /*!
31919
+ * Jodit Editor (https://xdsoft.net/jodit/)
31920
+ * Released under MIT see LICENSE.txt in the project root for license information.
31921
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31922
+ */
31923
+
31924
+
31925
+ /** @private */
31926
+ function applyLink(j, image, imageLink, imageLinkOpenInNewTab) {
31927
+ // Link
31928
+ let link = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.closest(image, 'a', j.editor);
31929
+ if (imageLink) {
31930
+ if (!link) {
31931
+ link = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.wrap(image, 'a', j.createInside);
31932
+ }
31933
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(link, 'href', imageLink);
31934
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(link, 'target', imageLinkOpenInNewTab ? '_blank' : null);
31935
+ }
31936
+ else {
31937
+ if (link && link.parentNode) {
31938
+ link.parentNode.replaceChild(image, link);
31939
+ }
31940
+ }
31941
+ }
31942
+
31943
+
31944
+ /***/ }),
31945
+
31946
+ /***/ 78139:
31947
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31948
+
31949
+ "use strict";
31950
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31951
+ /* harmony export */ N: function() { return /* binding */ applyMargin; }
31952
+ /* harmony export */ });
31953
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(38322);
31954
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9645);
31955
+ /*!
31956
+ * Jodit Editor (https://xdsoft.net/jodit/)
31957
+ * Released under MIT see LICENSE.txt in the project root for license information.
31958
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31959
+ */
31960
+
31961
+
31962
+ /** @private */
31963
+ function applyMargin(j, marginTop, marginRight, marginBottom, marginLeft, image, marginIsLocked) {
31964
+ const margins = [marginTop, marginRight, marginBottom, marginLeft];
31965
+ const applyMargin = (key, value) => {
31966
+ const oldValue = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_1__/* .css */ .A)(image, key);
31967
+ const v = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_0__/* .normalSizeToString */ .n)(value);
31968
+ if (oldValue.toString() !== v.toString()) {
31969
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_1__/* .css */ .A)(image, key, v);
31970
+ }
31971
+ };
31972
+ if (!marginIsLocked) {
31973
+ const sides = [
31974
+ 'margin-top',
31975
+ 'margin-right',
31976
+ 'margin-bottom',
31977
+ 'margin-left'
31978
+ ];
31979
+ margins.forEach((margin, index) => {
31980
+ const side = sides[index];
31981
+ applyMargin(side, margin);
31982
+ });
31983
+ }
31984
+ else {
31985
+ applyMargin('margin', marginTop);
31986
+ }
31987
+ }
31988
+
31989
+
31990
+ /***/ }),
31991
+
31992
+ /***/ 58972:
31993
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31994
+
31995
+ "use strict";
31996
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31997
+ /* harmony export */ q: function() { return /* binding */ applySize; }
31998
+ /* harmony export */ });
31999
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26150);
32000
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(38322);
32001
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9645);
32002
+ /*!
32003
+ * Jodit Editor (https://xdsoft.net/jodit/)
32004
+ * Released under MIT see LICENSE.txt in the project root for license information.
32005
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32006
+ */
32007
+
32008
+
32009
+
32010
+ /** @private */
32011
+ function applySize(image, imageWidth, imageHeight, sizeIsLocked) {
32012
+ // Size
32013
+ if (imageWidth !== image.offsetWidth ||
32014
+ imageHeight !== image.offsetHeight) {
32015
+ const updatedWidth = imageWidth ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeToString */ .n)(imageWidth) : null;
32016
+ let updatedHeight = imageHeight
32017
+ ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeToString */ .n)(imageHeight)
32018
+ : null;
32019
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__/* .css */ .A)(image, {
32020
+ width: updatedWidth,
32021
+ height: updatedWidth && sizeIsLocked ? null : updatedHeight
32022
+ });
32023
+ (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);
32024
+ if (!(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'width') || sizeIsLocked) {
32025
+ updatedHeight = null;
32026
+ }
32027
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'height', updatedHeight);
32028
+ }
31261
32029
  }
31262
32030
 
31263
32031
 
@@ -37219,7 +37987,8 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_3__/* .pluginSystem */ .fg.add('selec
37219
37987
  */
37220
37988
 
37221
37989
  jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.select = {
37222
- normalizeSelectionBeforeCutAndCopy: false
37990
+ normalizeSelectionBeforeCutAndCopy: false,
37991
+ normalizeTripleClick: true
37223
37992
  };
37224
37993
 
37225
37994
 
@@ -37295,7 +38064,7 @@ class select extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_3__/* .Plugin */
37295
38064
  }
37296
38065
  }
37297
38066
  /**
37298
- * @event outsideClick(e) - when user clicked in the outside of editor
38067
+ * @event outsideClick(e) - when user clicked on the outside of editor
37299
38068
  */
37300
38069
  onOutsideClick(e) {
37301
38070
  const node = e.target;
@@ -37307,7 +38076,7 @@ class select extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_3__/* .Plugin */
37307
38076
  this.j.e.fire('outsideClick', e);
37308
38077
  }
37309
38078
  }
37310
- beforeCommandCut(command) {
38079
+ beforeCommandCut() {
37311
38080
  const { s } = this.j;
37312
38081
  if (!s.isCollapsed()) {
37313
38082
  const current = s.current();
@@ -37316,13 +38085,27 @@ class select extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_3__/* .Plugin */
37316
38085
  }
37317
38086
  }
37318
38087
  }
37319
- beforeCommandSelectall(command) {
38088
+ beforeCommandSelectAll() {
37320
38089
  const { s } = this.j;
37321
38090
  s.focus();
37322
38091
  s.select(this.j.editor, true);
37323
38092
  s.expandSelection();
37324
38093
  return false;
37325
38094
  }
38095
+ /**
38096
+ * Normalize selection after triple click
38097
+ */
38098
+ onTripleClickNormalizeSelection(e) {
38099
+ if (e.detail !== 3 || !this.j.o.select.normalizeTripleClick) {
38100
+ return;
38101
+ }
38102
+ const { s } = this.j;
38103
+ const { startContainer, startOffset } = s.range;
38104
+ if (startOffset === 0 && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isText(startContainer)) {
38105
+ 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) ||
38106
+ startContainer, true);
38107
+ }
38108
+ }
37326
38109
  onCopyNormalizeSelectionBound(e) {
37327
38110
  const { s, editor, o } = this.j;
37328
38111
  if (!o.select.normalizeSelectionBeforeCutAndCopy || s.isCollapsed()) {
@@ -37348,7 +38131,10 @@ class select extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_3__/* .Plugin */
37348
38131
  ], select.prototype, "beforeCommandCut", null);
37349
38132
  (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
37350
38133
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([':beforeCommandSelectall'])
37351
- ], select.prototype, "beforeCommandSelectall", null);
38134
+ ], select.prototype, "beforeCommandSelectAll", null);
38135
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
38136
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([':click'])
38137
+ ], select.prototype, "onTripleClickNormalizeSelection", null);
37352
38138
  (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
37353
38139
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([':copy', ':cut'])
37354
38140
  ], select.prototype, "onCopyNormalizeSelectionBound", null);