jodit 4.1.16 → 4.2.6

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 (143) 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 +1378 -546
  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 +1364 -546
  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 +1361 -546
  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 +1361 -546
  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 +1402 -482
  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/config.d.ts +22 -0
  58. package/esm/config.js +22 -0
  59. package/esm/core/async/async.js +7 -1
  60. package/esm/core/constants.js +1 -1
  61. package/esm/core/helpers/size/position.js +2 -2
  62. package/esm/core/helpers/utils/selector.d.ts +3 -1
  63. package/esm/core/helpers/utils/selector.js +3 -3
  64. package/esm/core/ui/button/tooltip/tooltip.js +2 -1
  65. package/esm/core/ui/popup/popup.js +1 -1
  66. package/esm/modules/dialog/dialog.js +1 -0
  67. package/esm/modules/file-browser/data-provider.js +4 -1
  68. package/esm/modules/file-browser/file-browser.js +9 -2
  69. package/esm/modules/image-editor/templates/form.js +6 -5
  70. package/esm/modules/toolbar/button/button.d.ts +1 -1
  71. package/esm/modules/widget/tabs/tabs.d.ts +4 -4
  72. package/esm/modules/widget/tabs/tabs.js +9 -7
  73. package/esm/plugins/ai-assistant/ai-assistant.d.ts +1 -1
  74. package/esm/plugins/ai-assistant/ai-assistant.js +3 -3
  75. package/esm/plugins/image-properties/config.d.ts +5 -83
  76. package/esm/plugins/image-properties/config.js +0 -3
  77. package/esm/plugins/image-properties/image-properties.d.ts +22 -32
  78. package/esm/plugins/image-properties/image-properties.js +133 -402
  79. package/{types/plugins/image-properties/templates/form.d.ts → esm/plugins/image-properties/readers/align.d.ts} +3 -5
  80. package/esm/plugins/image-properties/readers/align.js +24 -0
  81. package/esm/plugins/image-properties/readers/index.d.ts +12 -0
  82. package/esm/plugins/image-properties/readers/index.js +38 -0
  83. package/esm/plugins/image-properties/readers/link.d.ts +9 -0
  84. package/esm/plugins/image-properties/readers/link.js +19 -0
  85. package/esm/plugins/image-properties/readers/margin.d.ts +8 -0
  86. package/esm/plugins/image-properties/readers/margin.js +28 -0
  87. package/esm/plugins/image-properties/readers/size.d.ts +8 -0
  88. package/esm/plugins/image-properties/readers/size.js +36 -0
  89. package/esm/plugins/image-properties/ui/ui-image-form.d.ts +29 -0
  90. package/esm/plugins/image-properties/ui/ui-image-form.js +171 -0
  91. package/esm/plugins/image-properties/ui/ui-image-main-tab.d.ts +36 -0
  92. package/esm/plugins/image-properties/ui/ui-image-main-tab.js +179 -0
  93. package/esm/plugins/image-properties/ui/ui-image-position-tab.d.ts +36 -0
  94. package/esm/plugins/image-properties/ui/ui-image-position-tab.js +261 -0
  95. package/esm/plugins/image-properties/{templates/main-tab.d.ts → utils/open-image-editor.d.ts} +5 -3
  96. package/esm/plugins/image-properties/utils/open-image-editor.js +52 -0
  97. package/esm/plugins/image-properties/utils/open-image-popup.d.ts +9 -0
  98. package/esm/plugins/image-properties/utils/open-image-popup.js +34 -0
  99. package/esm/plugins/image-properties/utils/utils.d.ts +9 -0
  100. package/esm/plugins/image-properties/utils/utils.js +21 -0
  101. package/esm/plugins/image-properties/writers/index.d.ts +12 -0
  102. package/esm/plugins/image-properties/writers/index.js +53 -0
  103. package/esm/plugins/image-properties/{templates/form.d.ts → writers/link.d.ts} +2 -4
  104. package/esm/plugins/image-properties/writers/link.js +24 -0
  105. package/esm/plugins/image-properties/writers/margin.d.ts +8 -0
  106. package/esm/plugins/image-properties/writers/margin.js +33 -0
  107. package/esm/plugins/image-properties/writers/size.d.ts +7 -0
  108. package/esm/plugins/image-properties/writers/size.js +28 -0
  109. package/esm/plugins/select/config.d.ts +7 -0
  110. package/esm/plugins/select/config.js +2 -1
  111. package/esm/plugins/select/select.d.ts +7 -3
  112. package/esm/plugins/select/select.js +21 -4
  113. package/esm/types/ui.d.ts +1 -1
  114. package/package.json +1 -1
  115. package/types/config.d.ts +22 -0
  116. package/types/core/helpers/utils/selector.d.ts +3 -1
  117. package/types/modules/toolbar/button/button.d.ts +1 -1
  118. package/types/modules/widget/tabs/tabs.d.ts +4 -4
  119. package/types/plugins/ai-assistant/ai-assistant.d.ts +1 -1
  120. package/types/plugins/image-properties/config.d.ts +5 -83
  121. package/types/plugins/image-properties/image-properties.d.ts +22 -32
  122. package/types/plugins/image-properties/{templates/main-tab.d.ts → readers/align.d.ts} +3 -5
  123. package/types/plugins/image-properties/readers/index.d.ts +12 -0
  124. package/types/plugins/image-properties/readers/link.d.ts +9 -0
  125. package/types/plugins/image-properties/readers/margin.d.ts +8 -0
  126. package/types/plugins/image-properties/readers/size.d.ts +8 -0
  127. package/types/plugins/image-properties/ui/ui-image-form.d.ts +29 -0
  128. package/types/plugins/image-properties/ui/ui-image-main-tab.d.ts +36 -0
  129. package/types/plugins/image-properties/ui/ui-image-position-tab.d.ts +36 -0
  130. package/types/plugins/image-properties/utils/open-image-editor.d.ts +12 -0
  131. package/types/plugins/image-properties/utils/open-image-popup.d.ts +9 -0
  132. package/types/plugins/image-properties/utils/utils.d.ts +9 -0
  133. package/types/plugins/image-properties/writers/index.d.ts +12 -0
  134. package/{esm/plugins/image-properties/templates/position-tab.d.ts → types/plugins/image-properties/writers/link.d.ts} +2 -4
  135. package/types/plugins/image-properties/writers/margin.d.ts +8 -0
  136. package/types/plugins/image-properties/writers/size.d.ts +7 -0
  137. package/types/plugins/select/config.d.ts +7 -0
  138. package/types/plugins/select/select.d.ts +7 -3
  139. package/types/types/ui.d.ts +1 -1
  140. package/esm/plugins/image-properties/templates/form.js +0 -26
  141. package/esm/plugins/image-properties/templates/main-tab.js +0 -47
  142. package/esm/plugins/image-properties/templates/position-tab.js +0 -66
  143. package/types/plugins/image-properties/templates/position-tab.d.ts +0 -10
package/es2015/jodit.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.1.16
4
+ * Version: v4.2.6
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -259,6 +259,28 @@ class Config {
259
259
  : null);
260
260
  /**
261
261
  * Shadow root if Jodit was created in it
262
+ *
263
+ * ```html
264
+ * <div id="editor"></div>
265
+ * ```
266
+ *
267
+ * ```js
268
+ * const app = document.getElementById('editor');
269
+ * app.attachShadow({ mode: 'open' });
270
+ * const root = app.shadowRoot;
271
+ *
272
+ * root.innerHTML = `
273
+ * <link rel="stylesheet" href="./build/jodit.css"/>
274
+ * <h1>Jodit example in Shadow DOM</h1>
275
+ * <div id="edit"></div>
276
+ * `;
277
+ *
278
+ * const editor = Jodit.make(root.getElementById('edit'), {
279
+ * globalFullSize: false,
280
+ * shadowRoot: root
281
+ * });
282
+ * editor.value = '<p>start</p>';
283
+ * ```
262
284
  */
263
285
  this.shadowRoot = null;
264
286
  /**
@@ -1009,6 +1031,7 @@ Config.prototype.controls = {};
1009
1031
  /* harmony export */ });
1010
1032
  /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17352);
1011
1033
  /* harmony import */ var jodit_core_helpers_async__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(59146);
1034
+ /* harmony import */ var jodit_core_helpers_checker_is_abort_error__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(99951);
1012
1035
  /* harmony import */ var jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(69052);
1013
1036
  /* harmony import */ var jodit_core_helpers_checker_is_number__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2461);
1014
1037
  /* harmony import */ var jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(25376);
@@ -1017,7 +1040,7 @@ Config.prototype.controls = {};
1017
1040
  /* harmony import */ var jodit_core_helpers_checker_is_void__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(35642);
1018
1041
  /* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(28712);
1019
1042
  /* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_1__);
1020
- /* harmony import */ var jodit_core_helpers_utils_error_errors_abort_error__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(21567);
1043
+ /* harmony import */ var jodit_core_helpers_utils_error_errors_abort_error__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(21567);
1021
1044
  /*!
1022
1045
  * Jodit Editor (https://xdsoft.net/jodit/)
1023
1046
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -1033,6 +1056,7 @@ Config.prototype.controls = {};
1033
1056
 
1034
1057
 
1035
1058
 
1059
+
1036
1060
  class Async {
1037
1061
  constructor() {
1038
1062
  var _a, _b, _c, _d, _e;
@@ -1151,6 +1175,11 @@ class Async {
1151
1175
  ? (...args) => {
1152
1176
  const promise = this.promise(res => {
1153
1177
  promises.push(res);
1178
+ }).catch((e) => {
1179
+ if ((0,jodit_core_helpers_checker_is_abort_error__WEBPACK_IMPORTED_MODULE_9__/* .isAbortError */ .z)(e)) {
1180
+ return null;
1181
+ }
1182
+ throw e;
1154
1183
  });
1155
1184
  onFire(...args);
1156
1185
  return promise;
@@ -1222,7 +1251,7 @@ class Async {
1222
1251
  promise(executor) {
1223
1252
  let rejectCallback = () => { };
1224
1253
  const promise = new Promise((resolve, reject) => {
1225
- rejectCallback = () => reject((0,jodit_core_helpers_utils_error_errors_abort_error__WEBPACK_IMPORTED_MODULE_9__/* .abort */ .h)());
1254
+ rejectCallback = () => reject((0,jodit_core_helpers_utils_error_errors_abort_error__WEBPACK_IMPORTED_MODULE_10__/* .abort */ .h)('Abort async'));
1226
1255
  this.promisesRejections.add(rejectCallback);
1227
1256
  executor(resolve, reject);
1228
1257
  });
@@ -1707,7 +1736,7 @@ __webpack_require__.r(__webpack_exports__);
1707
1736
  * Released under MIT see LICENSE.txt in the project root for license information.
1708
1737
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
1709
1738
  */
1710
- const APP_VERSION = "4.1.16";
1739
+ const APP_VERSION = "4.2.6";
1711
1740
  // prettier-ignore
1712
1741
  const ES = "es2015";
1713
1742
  const IS_ES_MODERN = true;
@@ -6720,6 +6749,7 @@ const offset = (elm, jodit, doc, recurse = false) => {
6720
6749
  * Calculate screen element position
6721
6750
  */
6722
6751
  function position(elm, jodit, recurse = false) {
6752
+ var _a, _b;
6723
6753
  const rect = elm.getBoundingClientRect();
6724
6754
  let xPos = rect.left, yPos = rect.top;
6725
6755
  if ((0,jodit_core_helpers_checker_is_jodit_object__WEBPACK_IMPORTED_MODULE_0__/* .isJoditObject */ .y)(jodit) &&
@@ -6733,8 +6763,8 @@ function position(elm, jodit, recurse = false) {
6733
6763
  return {
6734
6764
  left: Math.round(xPos),
6735
6765
  top: Math.round(yPos),
6736
- width: Math.round(elm.offsetWidth),
6737
- height: Math.round(elm.offsetHeight)
6766
+ width: Math.round((_a = elm.offsetWidth) !== null && _a !== void 0 ? _a : rect.width),
6767
+ height: Math.round((_b = elm.offsetHeight) !== null && _b !== void 0 ? _b : rect.height)
6738
6768
  };
6739
6769
  }
6740
6770
 
@@ -8772,9 +8802,9 @@ const getXPathByElement = (element, root) => {
8772
8802
  * Find all `ref` or `data-ref` elements inside HTMLElement
8773
8803
  */
8774
8804
  const refs = (root) => {
8775
- // if (Component.isInstanceOf<UIElement>(root, UIElement)) {
8776
- // root = root.container;
8777
- // }
8805
+ if ('container' in root) {
8806
+ root = root.container;
8807
+ }
8778
8808
  return $$('[ref],[data-ref]', root).reduce((def, child) => {
8779
8809
  const key = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(child, '-ref');
8780
8810
  if (key && (0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_4__/* .isString */ .K)(key)) {
@@ -13290,7 +13320,7 @@ let UITooltip = UITooltip_1 = class UITooltip extends jodit_core_ui_element__WEB
13290
13320
  view.o.showTooltip &&
13291
13321
  !view.o.useNativeTooltip) {
13292
13322
  view.hookStatus(jodit_core_component__WEBPACK_IMPORTED_MODULE_0__/* .STATUSES */ .f.ready, () => {
13293
- // TODO Move it inside __open method. Now it is here becous testcase failed with capturing
13323
+ // TODO Move it inside __open method. Now it is here because testcase failed with capturing
13294
13324
  (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_3__/* .getContainer */ .My)(this.j, UITooltip_1).appendChild(this.container);
13295
13325
  view.e.on(view.container, 'mouseenter.tooltip', this.__onMouseEnter, {
13296
13326
  capture: true
@@ -13306,6 +13336,7 @@ let UITooltip = UITooltip_1 = class UITooltip extends jodit_core_ui_element__WEB
13306
13336
  const view = this.j;
13307
13337
  view.e
13308
13338
  .on(view.ow, 'scroll.tooltip', this.__hide)
13339
+ .on(view.ow, 'joditCloseDialog', this.__hide)
13309
13340
  .on(view.container, 'mouseleave.tooltip', this.__hide)
13310
13341
  .on([
13311
13342
  'escape.tooltip',
@@ -15295,7 +15326,7 @@ class Popup extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_7__/* .UI
15295
15326
  }
15296
15327
  let pe = this.parentElement;
15297
15328
  while (pe) {
15298
- if (checkView(j)) {
15329
+ if (checkView(pe.j)) {
15299
15330
  return;
15300
15331
  }
15301
15332
  if (pe.container.style.zIndex) {
@@ -17784,6 +17815,7 @@ let Dialog = Dialog_1 = class Dialog extends jodit_core_view_view_with_toolbar__
17784
17815
  * Fired when dialog box is started moving
17785
17816
  */
17786
17817
  this.e.fire(this, 'startMove');
17818
+ this.e.fire('closeAllPopups');
17787
17819
  }
17788
17820
  }
17789
17821
  onMouseMove(e) {
@@ -19101,6 +19133,9 @@ let DataProvider = class DataProvider {
19101
19133
  this.o.permissions.data.source = source;
19102
19134
  if (this.o.permissions.url) {
19103
19135
  return this.get('permissions').then(resp => {
19136
+ if (this.parent.isInDestruct) {
19137
+ throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.abort)();
19138
+ }
19104
19139
  let process = this.o.permissions.process;
19105
19140
  if (!process) {
19106
19141
  process = this.o.ajax.process;
@@ -19722,10 +19757,18 @@ let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__W
19722
19757
  this.__updateToolbarButtons();
19723
19758
  this._dialog.open(this.browser, header);
19724
19759
  this.e.fire('sort.filebrowser', this.state.sortBy);
19725
- (0,_fetch_load_tree__WEBPACK_IMPORTED_MODULE_10__/* .loadTree */ .r)(this).then(resolve, reject);
19760
+ (0,_fetch_load_tree__WEBPACK_IMPORTED_MODULE_10__/* .loadTree */ .r)(this)
19761
+ .then(resolve, reject)
19762
+ .finally(() => {
19763
+ var _a;
19764
+ if (this.isInDestruct) {
19765
+ return;
19766
+ }
19767
+ (_a = this === null || this === void 0 ? void 0 : this.e) === null || _a === void 0 ? void 0 : _a.fire('fileBrowserReady.filebrowser');
19768
+ });
19726
19769
  })
19727
19770
  .catch((e) => {
19728
- if (!jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.IS_PROD) {
19771
+ if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isAbortError)(e) && !jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.IS_PROD) {
19729
19772
  throw e;
19730
19773
  }
19731
19774
  });
@@ -21595,11 +21638,12 @@ const act = (el, className = 'jodti-image-editor_active') => el ? className : ''
21595
21638
  const form = (editor, o) => {
21596
21639
  const i = editor.i18n.bind(editor);
21597
21640
  const switcher = (label, ref, active = true) => `<div class="jodit-form__group">
21598
- <label>${i(label)}</label>
21599
-
21600
- <label class='jodit-switcher'>
21601
- <input ${act(active, 'checked')} data-ref="${ref}" type="checkbox"/>
21602
- <span class="jodit-switcher__slider"></span>
21641
+ <label class="jodit-switcher-wrapper">
21642
+ <span class='jodit-switcher'>
21643
+ <input ${act(active, 'checked')} data-ref="${ref}" type="checkbox"/>
21644
+ <span class="jodit-switcher__slider"></span>
21645
+ </span>
21646
+ <span>${i(label)}</span>
21603
21647
  </label>
21604
21648
  </div>`;
21605
21649
  return editor.create.fromHTML(`<form class="${jie} jodit-properties">
@@ -24665,11 +24709,13 @@ const TabsWidget = (jodit, tabs, state) => {
24665
24709
  return;
24666
24710
  }
24667
24711
  buttonList.forEach(b => {
24712
+ b.state.variant = 'initial';
24668
24713
  b.state.activated = false;
24669
24714
  });
24670
24715
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.$$)('.jodit-tab', tabBox).forEach(a => {
24671
24716
  a.classList.remove('jodit-tab_active');
24672
24717
  });
24718
+ nameToTab[tab].button.state.variant = 'outline';
24673
24719
  nameToTab[tab].button.state.activated = true;
24674
24720
  nameToTab[tab].tab.classList.add('jodit-tab_active');
24675
24721
  };
@@ -24698,7 +24744,7 @@ const TabsWidget = (jodit, tabs, state) => {
24698
24744
  content.call(jodit);
24699
24745
  }
24700
24746
  if (state) {
24701
- state.__activeTab = name;
24747
+ state.activeTab = name;
24702
24748
  }
24703
24749
  return false;
24704
24750
  });
@@ -24714,20 +24760,20 @@ const TabsWidget = (jodit, tabs, state) => {
24714
24760
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.$$)('a', buttons).forEach(a => {
24715
24761
  a.style.width = (100 / tabCount).toFixed(10) + '%';
24716
24762
  });
24717
- const tab = !state || !state.__activeTab || !nameToTab[state.__activeTab]
24763
+ const tab = !state || !state.activeTab || !nameToTab[state.activeTab]
24718
24764
  ? firstTab
24719
- : state.__activeTab;
24765
+ : state.activeTab;
24720
24766
  setActive(tab);
24721
24767
  if (state) {
24722
- let __activeTab = state.__activeTab;
24723
- Object.defineProperty(state, '__activeTab', {
24768
+ let activeTab = state.activeTab;
24769
+ Object.defineProperty(state, 'activeTab', {
24724
24770
  configurable: true,
24725
24771
  enumerable: false,
24726
24772
  get() {
24727
- return __activeTab;
24773
+ return activeTab;
24728
24774
  },
24729
24775
  set(value) {
24730
- __activeTab = value;
24776
+ activeTab = value;
24731
24777
  setActive(value);
24732
24778
  }
24733
24779
  });
@@ -25142,7 +25188,7 @@ class aiAssistant extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_3__/
25142
25188
  (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .extendLang */ .JW)(_langs__WEBPACK_IMPORTED_MODULE_6__);
25143
25189
  }
25144
25190
  /** @override */
25145
- afterInit(jodit) { }
25191
+ afterInit() { }
25146
25192
  onGenerateAiAssistantForm(prompt) {
25147
25193
  this.__dialog.open(this.__container, 'AI Assistant');
25148
25194
  this.__container.setPrompt(prompt);
@@ -31015,9 +31061,6 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .pluginSystem */ .fg.add('image
31015
31061
  * Released under MIT see LICENSE.txt in the project root for license information.
31016
31062
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31017
31063
  */
31018
- /**
31019
- * @module plugins/image-properties
31020
- */
31021
31064
 
31022
31065
  jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.image = {
31023
31066
  dialogWidth: 600,
@@ -31047,18 +31090,19 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.image = {
31047
31090
 
31048
31091
  "use strict";
31049
31092
  /* unused harmony export imageProperties */
31050
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(31635);
31093
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(31635);
31051
31094
  /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22664);
31052
- /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56298);
31053
- /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65147);
31054
- /* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(35265);
31055
- /* harmony import */ var jodit_modules__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(37435);
31056
- /* harmony import */ var jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(53804);
31057
- /* harmony import */ var jodit_modules_widget__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(16116);
31058
- /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(24654);
31059
- /* harmony import */ var _templates_form__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(22254);
31060
- /* harmony import */ var _templates_main_tab__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(75263);
31061
- /* harmony import */ var _templates_position_tab__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(57837);
31095
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(55186);
31096
+ /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(56298);
31097
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(65147);
31098
+ /* harmony import */ var jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29866);
31099
+ /* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(35265);
31100
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(24654);
31101
+ /* harmony import */ var _ui_ui_image_form__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(31970);
31102
+ /* harmony import */ var _utils_open_image_editor__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(80778);
31103
+ /* harmony import */ var _utils_open_image_popup__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(33733);
31104
+ /* harmony import */ var _readers__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(5549);
31105
+ /* harmony import */ var _writers__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(30393);
31062
31106
  /*!
31063
31107
  * Jodit Editor (https://xdsoft.net/jodit/)
31064
31108
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -31090,55 +31134,93 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.image = {
31090
31134
  * });
31091
31135
  * ```
31092
31136
  */
31093
- const normalSizeToString = (value) => {
31094
- value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.trim)(value);
31095
- return /^[0-9]+$/.test(value) ? value + 'px' : value;
31096
- };
31097
- const normalSizeFromString = (value) => {
31098
- return /^[-+]?[0-9.]+px$/.test(value.toString())
31099
- ? parseFloat(value.toString())
31100
- : value;
31101
- };
31102
31137
  /**
31103
31138
  * Show dialog with image's options
31104
31139
  */
31105
- class imageProperties extends jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin {
31140
+ class imageProperties extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_4__/* .Plugin */ .k {
31106
31141
  constructor() {
31107
31142
  super(...arguments);
31108
31143
  this.state = {
31109
31144
  image: new Image(),
31145
+ sourceImage: new Image(),
31110
31146
  get ratio() {
31111
- return this.image.naturalWidth / this.image.naturalHeight || 1;
31147
+ const { naturalWidth, naturalHeight } = this.image;
31148
+ return naturalWidth / naturalHeight || 1;
31112
31149
  },
31113
31150
  sizeIsLocked: true,
31114
- marginIsLocked: true
31151
+ marginIsLocked: true,
31152
+ values: {
31153
+ style: '',
31154
+ imageSrc: '',
31155
+ borderRadius: 0,
31156
+ imageTitle: '',
31157
+ imageAlt: '',
31158
+ imageLink: '',
31159
+ imageLinkOpenInNewTab: false,
31160
+ imageWidth: 0,
31161
+ imageHeight: 0,
31162
+ marginTop: 0,
31163
+ marginRight: 0,
31164
+ marginBottom: 0,
31165
+ marginLeft: 0,
31166
+ classes: '',
31167
+ id: '',
31168
+ align: ''
31169
+ }
31115
31170
  };
31116
31171
  this.activeTabState = {
31117
- __activeTab: 'Image'
31172
+ activeTab: 'Image'
31118
31173
  };
31119
31174
  }
31120
- onChangeMarginIsLocked() {
31121
- if (!this.form) {
31122
- return;
31123
- }
31124
- const { marginRight, marginBottom, marginLeft, lockMargin } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
31125
- [marginRight, marginBottom, marginLeft].forEach(elm => {
31126
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(elm, 'disabled', this.state.marginIsLocked || null);
31175
+ get form() {
31176
+ return new _ui_ui_image_form__WEBPACK_IMPORTED_MODULE_7__/* .UIImagePropertiesForm */ .l(this.j, this.state, this.activeTabState, {
31177
+ openImageEditor: () => (0,_utils_open_image_editor__WEBPACK_IMPORTED_MODULE_8__/* .openImageEditorDialog */ .v)(this.j, this.state),
31178
+ openImagePopup: target => (0,_utils_open_image_popup__WEBPACK_IMPORTED_MODULE_9__/* .openImagePopup */ .q)(this.j, this.dialog, this.state, target)
31127
31179
  });
31128
- lockMargin.innerHTML = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Icon.get(this.state.marginIsLocked ? 'lock' : 'unlock');
31129
31180
  }
31130
- onChangeSizeIsLocked() {
31131
- if (!this.form) {
31132
- return;
31133
- }
31134
- const { lockSize, imageWidth } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
31135
- lockSize.innerHTML = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Icon.get(this.state.sizeIsLocked ? 'lock' : 'unlock');
31136
- lockSize.classList.remove('jodit-properties__lock');
31137
- lockSize.classList.remove('jodit-properties__unlock');
31138
- lockSize.classList.add(this.state.sizeIsLocked
31139
- ? 'jodit-properties__lock'
31140
- : 'jodit-properties__unlock');
31141
- this.j.e.fire(imageWidth, 'change');
31181
+ /**
31182
+ * Dialog for form
31183
+ */
31184
+ get dialog() {
31185
+ const { j } = this;
31186
+ const dialog = j.dlg({
31187
+ minWidth: Math.min(400, screen.width),
31188
+ minHeight: 590,
31189
+ buttons: ['fullsize', 'dialog.close']
31190
+ });
31191
+ const buttons = this.__buttons;
31192
+ buttons.check.onAction(() => {
31193
+ (0,_writers__WEBPACK_IMPORTED_MODULE_11__/* .applyValuesToImage */ .j)(j, this.state, this.state.sourceImage);
31194
+ j.synchronizeValues();
31195
+ dialog.close();
31196
+ });
31197
+ buttons.remove.onAction(() => {
31198
+ j.s.removeNode(this.state.sourceImage);
31199
+ dialog.close();
31200
+ });
31201
+ buttons.cancel.onAction(() => {
31202
+ dialog.close();
31203
+ });
31204
+ dialog.setHeader(j.i18n('Image properties'));
31205
+ dialog.setContent(this.form);
31206
+ dialog.setFooter([[buttons.cancel, buttons.remove], buttons.check]);
31207
+ j.e.on(dialog, 'afterClose', () => {
31208
+ if (this.state.image.parentNode &&
31209
+ j.o.image.selectImageAfterClose) {
31210
+ j.s.select(this.state.sourceImage);
31211
+ }
31212
+ });
31213
+ dialog.setSize(j.o.image.dialogWidth);
31214
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.markOwner)(j, dialog.container);
31215
+ return dialog;
31216
+ }
31217
+ get __buttons() {
31218
+ const { j } = this;
31219
+ return {
31220
+ check: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__/* .Button */ .$n)(j, 'ok', 'Apply', 'primary'),
31221
+ remove: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__/* .Button */ .$n)(j, 'bin', 'Delete'),
31222
+ cancel: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__/* .Button */ .$n)(j, 'cancel', 'Cancel')
31223
+ };
31142
31224
  }
31143
31225
  /**
31144
31226
  * Open dialog editing image properties
@@ -31155,358 +31237,28 @@ class imageProperties extends jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin
31155
31237
  * ```
31156
31238
  */
31157
31239
  open() {
31158
- this.makeForm();
31159
- this.activeTabState.__activeTab = 'Image';
31160
- this.j.e.fire('hidePopup');
31161
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.markOwner)(this.j, this.dialog.container);
31162
- this.state.marginIsLocked = true;
31163
- this.state.sizeIsLocked = true;
31164
- this.onChangeMarginIsLocked();
31165
- this.onChangeSizeIsLocked();
31166
- this.updateValues();
31240
+ this.activeTabState.activeTab = 'Image';
31241
+ this.__lock();
31167
31242
  this.dialog.open().setModal(true).setPosition();
31168
- return false;
31169
- }
31170
- /**
31171
- * Create form for edit image properties
31172
- */
31173
- makeForm() {
31174
- if (this.dialog) {
31175
- return;
31176
- }
31177
- this.dialog = this.j.dlg({
31178
- minWidth: Math.min(400, screen.width),
31179
- minHeight: 590,
31180
- buttons: ['fullsize', 'dialog.close']
31181
- });
31182
- const editor = this.j, opt = editor.o, i18n = editor.i18n.bind(editor), buttons = {
31183
- check: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_3__/* .Button */ .$n)(editor, 'ok', 'Apply', 'primary'),
31184
- remove: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_3__/* .Button */ .$n)(editor, 'bin', 'Delete')
31185
- };
31186
- editor.e.on(this.dialog, 'afterClose', () => {
31187
- if (this.state.image.parentNode &&
31188
- opt.image.selectImageAfterClose) {
31189
- editor.s.select(this.state.image);
31190
- }
31191
- });
31192
- buttons.remove.onAction(() => {
31193
- editor.s.removeNode(this.state.image);
31194
- this.dialog.close();
31195
- });
31196
- const { dialog } = this;
31197
- dialog.setHeader(i18n('Image properties'));
31198
- const mainForm = (0,_templates_form__WEBPACK_IMPORTED_MODULE_8__/* .form */ .Z)(editor);
31199
- this.form = mainForm;
31200
- dialog.setContent(mainForm);
31201
- const { tabsBox } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
31202
- if (tabsBox) {
31203
- tabsBox.appendChild((0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_6__/* .TabsWidget */ .Zg)(editor, [
31204
- { name: 'Image', content: (0,_templates_main_tab__WEBPACK_IMPORTED_MODULE_9__/* .mainTab */ .J)(editor) },
31205
- { name: 'Advanced', content: (0,_templates_position_tab__WEBPACK_IMPORTED_MODULE_10__/* .positionTab */ .b)(editor) }
31206
- ], this.activeTabState));
31207
- }
31208
- buttons.check.onAction(this.onApply);
31209
- const { changeImage, editImage } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
31210
- editor.e.on(changeImage, 'click', this.openImagePopup);
31211
- if (opt.image.useImageEditor) {
31212
- editor.e.on(editImage, 'click', this.openImageEditor);
31213
- }
31214
- const { lockSize, lockMargin, imageWidth, imageHeight } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(mainForm);
31215
- if (lockSize) {
31216
- editor.e.on(lockSize, 'click', () => {
31217
- this.state.sizeIsLocked = !this.state.sizeIsLocked;
31218
- });
31219
- }
31220
- editor.e.on(lockMargin, 'click', (e) => {
31221
- this.state.marginIsLocked = !this.state.marginIsLocked;
31222
- e.preventDefault();
31223
- });
31224
- const changeSizes = (event) => {
31225
- if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isNumeric)(imageWidth.value) || !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isNumeric)(imageHeight.value)) {
31226
- return;
31227
- }
31228
- const w = parseFloat(imageWidth.value), h = parseFloat(imageHeight.value);
31229
- if (event.target === imageWidth) {
31230
- imageHeight.value = Math.round(w / this.state.ratio).toString();
31231
- }
31232
- else {
31233
- imageWidth.value = Math.round(h * this.state.ratio).toString();
31234
- }
31235
- };
31236
- editor.e.on([imageWidth, imageHeight], 'change keydown mousedown paste', (event) => {
31237
- if (!this.state.sizeIsLocked) {
31238
- return;
31239
- }
31240
- editor.async.setTimeout(changeSizes.bind(this, event), {
31241
- timeout: editor.defaultTimeout,
31242
- label: 'image-properties-changeSize'
31243
- });
31244
- });
31245
- dialog.setFooter([buttons.remove, buttons.check]);
31246
- dialog.setSize(this.j.o.image.dialogWidth);
31247
- }
31248
- /**
31249
- * Set input values from image
31250
- */
31251
- updateValues() {
31252
- const opt = this.j.o;
31253
- const { image } = this.state;
31254
- 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);
31255
- const updateLock = () => {
31256
- lockMargin.checked = this.state.marginIsLocked;
31257
- lockSize.checked = this.state.sizeIsLocked;
31258
- }, updateAlign = () => {
31259
- if (image.style.cssFloat &&
31260
- ['left', 'right'].indexOf(image.style.cssFloat.toLowerCase()) !== -1) {
31261
- align.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'float');
31262
- }
31263
- else {
31264
- if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'display') === 'block' &&
31265
- image.style.marginLeft === 'auto' &&
31266
- image.style.marginRight === 'auto') {
31267
- align.value = 'center';
31268
- }
31269
- }
31270
- }, updateBorderRadius = () => {
31271
- borderRadius.value = (parseInt(image.style.borderRadius || '0', 10) || '0').toString();
31272
- }, updateId = () => {
31273
- id.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'id') || '';
31274
- }, updateStyle = () => {
31275
- style.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'style') || '';
31276
- }, updateClasses = () => {
31277
- classes.value = ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'class') || '').replace(/jodit_focused_image[\s]*/, '');
31278
- }, updateMargins = () => {
31279
- if (!opt.image.editMargins) {
31280
- return;
31281
- }
31282
- let equal = true, wasEmptyField = false;
31283
- [marginTop, marginRight, marginBottom, marginLeft].forEach(elm => {
31284
- const id = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(elm, 'data-ref') || '';
31285
- let value = image.style.getPropertyValue((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.kebabCase)(id));
31286
- if (!value) {
31287
- wasEmptyField = true;
31288
- elm.value = '';
31289
- return;
31290
- }
31291
- if (/^[0-9]+(px)?$/.test(value)) {
31292
- value = parseInt(value, 10);
31293
- }
31294
- elm.value = value.toString() || '';
31295
- if ((wasEmptyField && elm.value) ||
31296
- (equal &&
31297
- id !== 'marginTop' &&
31298
- elm.value !== marginTop.value)) {
31299
- equal = false;
31300
- }
31301
- });
31302
- this.state.marginIsLocked = equal;
31303
- }, updateSizes = () => {
31304
- const width = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'width') ||
31305
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'width', true) ||
31306
- false, height = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'height') ||
31307
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'height', true) ||
31308
- false;
31309
- imageWidth.value =
31310
- width !== false
31311
- ? normalSizeFromString(width).toString()
31312
- : image.offsetWidth.toString();
31313
- imageHeight.value =
31314
- height !== false
31315
- ? normalSizeFromString(height).toString()
31316
- : image.offsetHeight.toString();
31317
- this.state.sizeIsLocked = (() => {
31318
- if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isNumeric)(imageWidth.value) ||
31319
- !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isNumeric)(imageHeight.value)) {
31320
- return false;
31321
- }
31322
- const w = parseFloat(imageWidth.value), h = parseFloat(imageHeight.value);
31323
- return Math.abs(w - h * this.state.ratio) < 1;
31324
- })();
31325
- }, updateText = () => {
31326
- imageTitle.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'title') || '';
31327
- imageAlt.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'alt') || '';
31328
- const a = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(image, 'a', this.j.editor);
31329
- if (a) {
31330
- imageLink.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(a, 'href') || '';
31331
- imageLinkOpenInNewTab.checked =
31332
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(a, 'target') === '_blank';
31333
- }
31334
- else {
31335
- imageLink.value = '';
31336
- imageLinkOpenInNewTab.checked = false;
31337
- }
31338
- }, updateSrc = () => {
31339
- imageSrc.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'src') || '';
31340
- if (imageViewSrc) {
31341
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(imageViewSrc, 'src', (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'src') || '');
31342
- }
31343
- };
31344
- updateLock();
31345
- updateSrc();
31346
- updateText();
31347
- updateSizes();
31348
- updateMargins();
31349
- updateClasses();
31350
- updateId();
31351
- updateBorderRadius();
31352
- updateAlign();
31353
- updateStyle();
31354
- }
31355
- /**
31356
- * Apply form's values to image
31357
- */
31358
- onApply() {
31359
- 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);
31360
- const opt = this.j.o;
31361
- const { image } = this.state;
31362
- // styles
31363
- if (opt.image.editStyle) {
31364
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'style', style.value || null);
31365
- }
31366
- // Src
31367
- if (imageSrc.value) {
31368
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'src', imageSrc.value);
31369
- }
31370
- else {
31371
- jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove(image);
31372
- this.dialog.close();
31373
- return;
31374
- }
31375
- // Border radius
31376
- if (borderRadius.value !== '0' && /^[0-9]+$/.test(borderRadius.value)) {
31377
- image.style.borderRadius = borderRadius.value + 'px';
31378
- }
31379
- else {
31380
- image.style.borderRadius = '';
31381
- }
31382
- // Title
31383
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'title', imageTitle.value || null);
31384
- // Alt
31385
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'alt', imageAlt.value || null);
31386
- // Link
31387
- let link = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(image, 'a', this.j.editor);
31388
- if (imageLink.value) {
31389
- if (!link) {
31390
- link = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.wrap(image, 'a', this.j.createInside);
31391
- }
31392
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(link, 'href', imageLink.value);
31393
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(link, 'target', imageLinkOpenInNewTab.checked ? '_blank' : null);
31394
- }
31395
- else {
31396
- if (link && link.parentNode) {
31397
- link.parentNode.replaceChild(image, link);
31398
- }
31399
- }
31400
- // Size
31401
- if (imageWidth.value !== image.offsetWidth.toString() ||
31402
- imageHeight.value !== image.offsetHeight.toString()) {
31403
- const updatedtWidth = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.trim)(imageWidth.value)
31404
- ? normalSizeToString(imageWidth.value)
31405
- : null;
31406
- const updatedHeight = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.trim)(imageHeight.value)
31407
- ? normalSizeToString(imageHeight.value)
31408
- : null;
31409
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, {
31410
- width: updatedtWidth,
31411
- height: updatedHeight
31412
- });
31413
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'width', (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'width') ? updatedtWidth : null);
31414
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'height', (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'height') ? updatedHeight : null);
31415
- }
31416
- const margins = [marginTop, marginRight, marginBottom, marginLeft];
31417
- if (opt.image.editMargins) {
31418
- if (!this.state.marginIsLocked) {
31419
- margins.forEach((margin) => {
31420
- const side = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(margin, 'data-ref') || '';
31421
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, side, normalSizeToString(margin.value));
31422
- });
31423
- }
31424
- else {
31425
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'margin', normalSizeToString(marginTop.value));
31426
- }
31427
- }
31428
- if (opt.image.editClass) {
31429
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'class', classes.value || null);
31430
- }
31431
- if (opt.image.editId) {
31432
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'id', id.value || null);
31433
- }
31434
- if (opt.image.editAlign) {
31435
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.hAlignElement)(image, align.value);
31436
- }
31437
- this.j.synchronizeValues();
31438
- this.dialog.close();
31439
- }
31440
- /**
31441
- * Open image editor dialog
31442
- */
31443
- openImageEditor() {
31444
- const url = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src') || '', a = this.j.c.element('a'), loadExternal = () => {
31445
- if (a.host !== location.host) {
31446
- this.j.confirm('You can only edit your own images. Download this image on the host?', yes => {
31447
- if (yes && this.j.uploader) {
31448
- this.j.uploader.uploadRemoteImage(a.href.toString(), resp => {
31449
- this.j.alert('The image has been successfully uploaded to the host!', () => {
31450
- if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isString)(resp.newfilename)) {
31451
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src', resp.baseurl +
31452
- resp.newfilename);
31453
- this.updateValues();
31454
- }
31455
- });
31456
- }, error => {
31457
- this.j.alert('There was an error loading %s', error.message);
31458
- });
31459
- }
31460
- });
31461
- return;
31243
+ this.async
31244
+ .promise((resolve, reject) => (0,_readers__WEBPACK_IMPORTED_MODULE_10__/* .readValuesFromImage */ .U)(this.j, this.state).then(resolve, reject))
31245
+ .catch((e) => {
31246
+ if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.isAbortError)(e)) {
31247
+ this.dialog.message.error(e.message);
31462
31248
  }
31463
- };
31464
- a.href = url;
31465
- this.j.filebrowser.dataProvider
31466
- .getPathByUrl(a.href.toString())
31467
- .then(resp => {
31468
- jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_5__/* .openImageEditor */ .B.call(this.j.filebrowser, a.href, resp.name, resp.path, resp.source, () => {
31469
- const timestamp = new Date().getTime();
31470
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src', url +
31471
- (url.indexOf('?') !== -1 ? '' : '?') +
31472
- '&_tmp=' +
31473
- timestamp.toString());
31474
- this.updateValues();
31475
- }, error => {
31476
- this.j.alert(error.message);
31477
- });
31478
31249
  })
31479
- .catch(error => {
31480
- this.j.alert(error.message, loadExternal);
31481
- });
31250
+ .finally(() => this.__unlock());
31251
+ return false;
31482
31252
  }
31483
- /**
31484
- * Open popup with filebrowser/uploader buttons for image
31485
- */
31486
- openImagePopup(event) {
31487
- const popup = new jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Popup(this.j), { changeImage } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
31488
- popup.setZIndex(this.dialog.getZIndex() + 1);
31489
- popup
31490
- .setContent((0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_6__/* .FileSelectorWidget */ .kG)(this.j, {
31491
- upload: (data) => {
31492
- if (data.files && data.files.length) {
31493
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src', data.baseurl + data.files[0]);
31494
- }
31495
- this.updateValues();
31496
- popup.close();
31497
- },
31498
- filebrowser: (data) => {
31499
- if (data &&
31500
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isArray)(data.files) &&
31501
- data.files.length) {
31502
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src', data.files[0]);
31503
- popup.close();
31504
- this.updateValues();
31505
- }
31506
- }
31507
- }, this.state.image, popup.close))
31508
- .open(() => (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.position)(changeImage));
31509
- event.stopPropagation();
31253
+ __lock() {
31254
+ this.dialog.lock();
31255
+ this.form.setMod('lock', true);
31256
+ Object.values(this.__buttons).forEach(b => (b.state.disabled = true));
31257
+ }
31258
+ __unlock() {
31259
+ this.dialog.unlock();
31260
+ this.form.setMod('lock', false);
31261
+ Object.values(this.__buttons).forEach(b => (b.state.disabled = false));
31510
31262
  }
31511
31263
  /** @override **/
31512
31264
  afterInit(editor) {
@@ -31517,7 +31269,7 @@ class imageProperties extends jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin
31517
31269
  .off(editor.editor, '.imageproperties')
31518
31270
  .on(editor.editor, 'dblclick.imageproperties', (e) => {
31519
31271
  const image = e.target;
31520
- if (!jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(image, 'img')) {
31272
+ if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isTag(image, 'img')) {
31521
31273
  return;
31522
31274
  }
31523
31275
  if (editor.o.image.openOnDblClick) {
@@ -31525,7 +31277,8 @@ class imageProperties extends jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin
31525
31277
  false) {
31526
31278
  return;
31527
31279
  }
31528
- self.state.image = image;
31280
+ self.state.sourceImage = image;
31281
+ self.state.image = image.cloneNode(true);
31529
31282
  if (!editor.o.readonly) {
31530
31283
  e.stopImmediatePropagation();
31531
31284
  e.preventDefault();
@@ -31539,206 +31292,1267 @@ class imageProperties extends jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin
31539
31292
  });
31540
31293
  })
31541
31294
  .on('openImageProperties.imageproperties', (image) => {
31542
- this.state.image = image;
31295
+ self.state.sourceImage = image;
31296
+ this.state.image = image.cloneNode(true);
31543
31297
  this.open();
31544
31298
  });
31545
31299
  }
31300
+ onStateValuesImageSrcChange() {
31301
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__awaiter */ .sH)(this, void 0, void 0, function* () {
31302
+ const { image, values } = this.state;
31303
+ if (!image.src) {
31304
+ return;
31305
+ }
31306
+ try {
31307
+ this.__lock();
31308
+ yield image.decode();
31309
+ if (this.state.sizeIsLocked && (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.isNumeric)(values.imageWidth)) {
31310
+ const w = parseFloat(values.imageWidth.toString());
31311
+ values.imageHeight = Math.round(w / this.state.ratio);
31312
+ }
31313
+ this.j.e.fire('updateImageProperties.imageproperties', image);
31314
+ }
31315
+ catch (e) {
31316
+ this.j.alert(e.message);
31317
+ }
31318
+ finally {
31319
+ this.__unlock();
31320
+ }
31321
+ });
31322
+ }
31546
31323
  /** @override */
31547
31324
  beforeDestruct(editor) {
31548
- this.dialog && this.dialog.destruct();
31325
+ var _a, _b, _c;
31326
+ Object.values((_a = (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cached)(this, '__buttons')) !== null && _a !== void 0 ? _a : {}).forEach(b => b.destruct());
31327
+ (_b = (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cached)(this, 'dialog')) === null || _b === void 0 ? void 0 : _b.destruct();
31328
+ (_c = (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cached)(this, 'form')) === null || _c === void 0 ? void 0 : _c.destruct();
31549
31329
  editor.e.off(editor.editor, '.imageproperties').off('.imageproperties');
31550
31330
  }
31551
31331
  }
31552
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
31553
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.marginIsLocked')
31554
- ], imageProperties.prototype, "onChangeMarginIsLocked", null);
31555
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
31556
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.sizeIsLocked')
31557
- ], imageProperties.prototype, "onChangeSizeIsLocked", null);
31558
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
31559
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.autobind
31560
- ], imageProperties.prototype, "onApply", null);
31561
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
31562
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.autobind
31563
- ], imageProperties.prototype, "openImageEditor", null);
31564
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
31565
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.autobind
31566
- ], imageProperties.prototype, "openImagePopup", null);
31567
- jodit_core_global__WEBPACK_IMPORTED_MODULE_1__/* .pluginSystem */ .fg.add('imageProperties', imageProperties);
31332
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
31333
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cache
31334
+ ], imageProperties.prototype, "form", null);
31335
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
31336
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cache
31337
+ ], imageProperties.prototype, "dialog", null);
31338
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
31339
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cache
31340
+ ], imageProperties.prototype, "__buttons", null);
31341
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
31342
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.image')
31343
+ ], imageProperties.prototype, "onStateValuesImageSrcChange", null);
31344
+ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .pluginSystem */ .fg.add('imageProperties', imageProperties);
31568
31345
 
31569
31346
 
31570
31347
  /***/ }),
31571
31348
 
31572
- /***/ 22254:
31349
+ /***/ 74260:
31573
31350
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31574
31351
 
31575
31352
  "use strict";
31576
31353
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31577
- /* harmony export */ Z: function() { return /* binding */ form; }
31354
+ /* harmony export */ g: function() { return /* binding */ readAlign; }
31578
31355
  /* harmony export */ });
31579
- /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(931);
31356
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(38322);
31357
+ /*!
31358
+ * Jodit Editor (https://xdsoft.net/jodit/)
31359
+ * Released under MIT see LICENSE.txt in the project root for license information.
31360
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31361
+ */
31362
+
31363
+ /** @private */
31364
+ function readAlign(image, values) {
31365
+ // Align
31366
+ if (image.style.cssFloat &&
31367
+ ['left', 'right'].indexOf(image.style.cssFloat.toLowerCase()) !== -1) {
31368
+ values.align = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_0__/* .css */ .A)(image, 'float');
31369
+ }
31370
+ else {
31371
+ if ((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_0__/* .css */ .A)(image, 'display') === 'block' &&
31372
+ image.style.marginLeft === 'auto' &&
31373
+ image.style.marginRight === 'auto') {
31374
+ values.align = 'center';
31375
+ }
31376
+ else {
31377
+ values.align = '';
31378
+ }
31379
+ }
31380
+ }
31381
+
31382
+
31383
+ /***/ }),
31384
+
31385
+ /***/ 5549:
31386
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31387
+
31388
+ "use strict";
31389
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31390
+ /* harmony export */ U: function() { return /* binding */ readValuesFromImage; }
31391
+ /* harmony export */ });
31392
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(31635);
31393
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26150);
31394
+ /* harmony import */ var _align__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(74260);
31395
+ /* harmony import */ var _link__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(33201);
31396
+ /* harmony import */ var _margin__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(85079);
31397
+ /* harmony import */ var _size__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(17880);
31398
+ /*!
31399
+ * Jodit Editor (https://xdsoft.net/jodit/)
31400
+ * Released under MIT see LICENSE.txt in the project root for license information.
31401
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31402
+ */
31403
+
31404
+
31405
+
31406
+
31407
+
31408
+
31409
+ /**
31410
+ * Read values from image and set it to state
31411
+ * @private
31412
+ */
31413
+ function readValuesFromImage(j, state) {
31414
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__awaiter */ .sH)(this, void 0, void 0, function* () {
31415
+ const { sourceImage: image, values } = state;
31416
+ (0,_align__WEBPACK_IMPORTED_MODULE_4__/* .readAlign */ .g)(image, values);
31417
+ // Border radius
31418
+ values.borderRadius = parseInt(image.style.borderRadius || '0', 10) || 0;
31419
+ // Id
31420
+ values.id = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'id') || '';
31421
+ // Title
31422
+ values.imageTitle = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'title') || '';
31423
+ // Alt
31424
+ values.imageAlt = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'alt') || '';
31425
+ // Style
31426
+ values.style = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'style') || '';
31427
+ // Classes
31428
+ values.classes = ((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'class') || '').replace(/jodit_focused_image[\s]*/, '');
31429
+ // Margins
31430
+ (0,_margin__WEBPACK_IMPORTED_MODULE_5__/* .readMargins */ .E)(image, values, state);
31431
+ // Link
31432
+ (0,_link__WEBPACK_IMPORTED_MODULE_1__/* .readLink */ .X)(state, j, values);
31433
+ // Src
31434
+ values.imageSrc = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'src') || '';
31435
+ // Image size
31436
+ return (0,_size__WEBPACK_IMPORTED_MODULE_2__/* .readSizes */ .P)(image, values, state);
31437
+ });
31438
+ }
31439
+
31440
+
31441
+ /***/ }),
31442
+
31443
+ /***/ 33201:
31444
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31445
+
31446
+ "use strict";
31447
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31448
+ /* harmony export */ X: function() { return /* binding */ readLink; }
31449
+ /* harmony export */ });
31450
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55186);
31451
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26150);
31452
+ /*!
31453
+ * Jodit Editor (https://xdsoft.net/jodit/)
31454
+ * Released under MIT see LICENSE.txt in the project root for license information.
31455
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31456
+ */
31457
+
31458
+
31459
+ /** @private */
31460
+ function readLink(state, j, values) {
31461
+ const a = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.closest(state.sourceImage, 'a', j.editor);
31462
+ if (a) {
31463
+ values.imageLink = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(a, 'href') || '';
31464
+ values.imageLinkOpenInNewTab = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(a, 'target') === '_blank';
31465
+ }
31466
+ else {
31467
+ values.imageLink = '';
31468
+ values.imageLinkOpenInNewTab = false;
31469
+ }
31470
+ }
31471
+
31472
+
31473
+ /***/ }),
31474
+
31475
+ /***/ 85079:
31476
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31477
+
31478
+ "use strict";
31479
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31480
+ /* harmony export */ E: function() { return /* binding */ readMargins; }
31481
+ /* harmony export */ });
31482
+ /* harmony import */ var jodit_core_helpers_string_kebab_case__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(449);
31483
+ /*!
31484
+ * Jodit Editor (https://xdsoft.net/jodit/)
31485
+ * Released under MIT see LICENSE.txt in the project root for license information.
31486
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31487
+ */
31488
+
31489
+ /** @private */
31490
+ function readMargins(image, values, state) {
31491
+ // Margins
31492
+ let equal = true, wasEmptyField = false;
31493
+ ['marginTop', 'marginRight', 'marginBottom', 'marginLeft'].forEach(id => {
31494
+ let value = image.style.getPropertyValue((0,jodit_core_helpers_string_kebab_case__WEBPACK_IMPORTED_MODULE_0__/* .kebabCase */ .k)(id));
31495
+ if (!value) {
31496
+ wasEmptyField = true;
31497
+ values[id] = 0;
31498
+ return;
31499
+ }
31500
+ if (/^[0-9]+(px)?$/.test(value)) {
31501
+ value = parseInt(value, 10);
31502
+ }
31503
+ values[id] = value;
31504
+ if ((wasEmptyField && values[id]) ||
31505
+ (equal && id !== 'marginTop' && values[id] !== values.marginTop)) {
31506
+ equal = false;
31507
+ }
31508
+ });
31509
+ state.marginIsLocked = equal;
31510
+ }
31511
+
31512
+
31513
+ /***/ }),
31514
+
31515
+ /***/ 17880:
31516
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31517
+
31518
+ "use strict";
31519
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31520
+ /* harmony export */ P: function() { return /* binding */ readSizes; }
31521
+ /* harmony export */ });
31522
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(31635);
31523
+ /* harmony import */ var jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(12461);
31524
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26150);
31525
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(38322);
31526
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9645);
31527
+ /*!
31528
+ * Jodit Editor (https://xdsoft.net/jodit/)
31529
+ * Released under MIT see LICENSE.txt in the project root for license information.
31530
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31531
+ */
31532
+
31533
+
31534
+
31535
+
31536
+
31537
+ /** @private */
31538
+ function readSizes(image, values, state) {
31539
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_2__/* .__awaiter */ .sH)(this, void 0, void 0, function* () {
31540
+ yield image.decode();
31541
+ const width = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'width') || (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__/* .css */ .A)(image, 'width', true) || false;
31542
+ const height = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'height') || (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__/* .css */ .A)(image, 'height', true) || false;
31543
+ values.imageWidth =
31544
+ width !== false
31545
+ ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeFromString */ .G)(width)
31546
+ : image.offsetWidth || image.naturalWidth;
31547
+ values.imageHeight =
31548
+ height !== false
31549
+ ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeFromString */ .G)(height)
31550
+ : image.offsetHeight || image.naturalHeight;
31551
+ const { imageWidth, imageHeight } = values;
31552
+ const w = parseFloat(imageWidth.toString());
31553
+ if (!(0,jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_4__/* .isNumeric */ .k)(imageWidth) || !(0,jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_4__/* .isNumeric */ .k)(imageHeight)) {
31554
+ state.sizeIsLocked = false;
31555
+ return;
31556
+ }
31557
+ if (height === false) {
31558
+ values.imageHeight = Math.round(w / state.ratio);
31559
+ state.sizeIsLocked = true;
31560
+ return;
31561
+ }
31562
+ const h = parseFloat(imageHeight.toString());
31563
+ state.sizeIsLocked = Math.abs(w - h * state.ratio) < 1;
31564
+ });
31565
+ }
31566
+
31567
+
31568
+ /***/ }),
31569
+
31570
+ /***/ 31970:
31571
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31572
+
31573
+ "use strict";
31574
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31575
+ /* harmony export */ l: function() { return /* binding */ UIImagePropertiesForm; }
31576
+ /* harmony export */ });
31577
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(31635);
31578
+ /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22664);
31579
+ /* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(24767);
31580
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(65147);
31581
+ /* harmony import */ var jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6455);
31582
+ /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(931);
31583
+ /* harmony import */ var jodit_modules_widget__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(16116);
31584
+ /* harmony import */ var _ui_image_main_tab__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(33403);
31585
+ /* harmony import */ var _ui_image_position_tab__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(46681);
31580
31586
  /*!
31581
31587
  * Jodit Editor (https://xdsoft.net/jodit/)
31582
31588
  * Released under MIT see LICENSE.txt in the project root for license information.
31583
31589
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31584
31590
  */
31585
31591
 
31586
- function form(editor) {
31587
- 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);
31588
- return editor.c.fromHTML(`<form class="jodit-properties">
31592
+
31593
+
31594
+
31595
+
31596
+
31597
+
31598
+
31599
+
31600
+
31601
+ /** @private */
31602
+ let UIImagePropertiesForm = class UIImagePropertiesForm extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_2__/* .UIGroup */ .U {
31603
+ className() {
31604
+ return 'UIImagePropertiesForm';
31605
+ }
31606
+ appendChildToContainer() { }
31607
+ getElm(elementName) {
31608
+ const selfElm = super.getElm(elementName);
31609
+ if (selfElm) {
31610
+ return selfElm;
31611
+ }
31612
+ for (const child of this.elements) {
31613
+ const elm = child.getElm(elementName);
31614
+ if (elm) {
31615
+ return elm;
31616
+ }
31617
+ }
31618
+ return null;
31619
+ }
31620
+ constructor(jodit, state, activeTabState, handlers) {
31621
+ super(jodit);
31622
+ this.state = state;
31623
+ this.handlers = handlers;
31624
+ this.__mainTab = new _ui_image_main_tab__WEBPACK_IMPORTED_MODULE_5__/* .UIImageMainTab */ .k(this.jodit, this.state, this.handlers);
31625
+ this.__positionTab = new _ui_image_position_tab__WEBPACK_IMPORTED_MODULE_6__/* .UIImagePositionTab */ ._(this.jodit, this.state, this.handlers);
31626
+ this.getElm('tabsBox').appendChild((0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_4__/* .TabsWidget */ .Zg)(jodit, [
31627
+ { name: 'Image', content: this.__mainTab },
31628
+ { name: 'Advanced', content: this.__positionTab }
31629
+ ], activeTabState));
31630
+ this.setMod('lock-size', this.state.sizeIsLocked);
31631
+ this.append(this.__mainTab).append(this.__positionTab);
31632
+ }
31633
+ render() {
31634
+ return `<form>
31589
31635
  <div class="jodit-grid jodit-grid_xs-column">
31590
31636
  <div class="jodit_col-lg-2-5 jodit_col-xs-5-5">
31591
- <div class="jodit-properties_view_box">
31592
- <div style="${!showPreview ? 'display:none' : ''}" class="jodit-properties_image_view">
31593
- <img data-ref="imageViewSrc" src="" alt=""/>
31637
+ <div class="&__view-box">
31638
+ <div class="&__imageView">
31639
+ <img class="&__imageViewSrc" src="" alt=""/>
31594
31640
  </div>
31595
- <div style="${!editSize ? 'display:none' : ''}" class="jodit-form__group jodit-properties_image_sizes">
31596
- <input data-ref="imageWidth" type="text" class="jodit-input"/>
31597
- <a data-ref="lockSize" class="jodit-properties__lock">${gi('lock')}</a>
31598
- <input data-ref="imageHeight" type="text" class="imageHeight jodit-input"/>
31641
+ <div class="jodit-form__group &__imageSizes">
31642
+ <input type="text" class="jodit-input &__imageWidth"/>
31643
+ <a class="&__lockSize">${jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__/* .Icon */ .I.get('lock')}</a>
31644
+ <input type="text" class="&__imageHeight jodit-input"/>
31599
31645
  </div>
31600
31646
  </div>
31601
31647
  </div>
31602
- <div data-ref="tabsBox" class="jodit_col-lg-3-5 jodit_col-xs-5-5"></div>
31648
+ <div class="jodit_col-lg-3-5 jodit_col-xs-5-5 &__tabsBox"></div>
31603
31649
  </div>
31604
- </form>`);
31605
- }
31650
+ </form>`;
31651
+ }
31652
+ onChangeSizeIsLocked() {
31653
+ const lockSize = this.getElm('lockSize');
31654
+ const imageWidth = this.getElm('imageWidth');
31655
+ lockSize.innerHTML = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__/* .Icon */ .I.get(this.state.sizeIsLocked ? 'lock' : 'unlock');
31656
+ this.setMod('lock-size', this.state.sizeIsLocked);
31657
+ this.j.e.fire(imageWidth, 'change');
31658
+ }
31659
+ onLockSizeClick() {
31660
+ this.state.sizeIsLocked = !this.state.sizeIsLocked;
31661
+ }
31662
+ onStateValuesSizeChange() {
31663
+ const imageWidth = this.getElm('imageWidth');
31664
+ const imageHeight = this.getElm('imageHeight');
31665
+ if (imageWidth !== this.j.od.activeElement) {
31666
+ imageWidth.value = this.state.values.imageWidth.toString();
31667
+ }
31668
+ if (imageHeight !== this.j.od.activeElement) {
31669
+ imageHeight.value = this.state.values.imageHeight.toString();
31670
+ }
31671
+ }
31672
+ onImageWidthChange(e) {
31673
+ const imageWidth = this.getElm('imageWidth');
31674
+ const imageHeight = this.getElm('imageHeight');
31675
+ if (!this.state.sizeIsLocked ||
31676
+ !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.isNumeric)(imageWidth.value) ||
31677
+ !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.isNumeric)(imageHeight.value)) {
31678
+ this.state.values.imageWidth = imageWidth.value;
31679
+ this.state.values.imageHeight = imageHeight.value;
31680
+ return;
31681
+ }
31682
+ const w = parseFloat(imageWidth.value), h = parseFloat(imageHeight.value);
31683
+ if (e.target === imageWidth) {
31684
+ this.state.values.imageWidth = w;
31685
+ this.state.values.imageHeight = Math.round(w / this.state.ratio);
31686
+ }
31687
+ else {
31688
+ this.state.values.imageWidth = Math.round(h * this.state.ratio);
31689
+ this.state.values.imageHeight = h;
31690
+ }
31691
+ }
31692
+ onStateValuesImageSrcChange() {
31693
+ const { imageSrc } = this.state.values;
31694
+ if (!imageSrc) {
31695
+ return;
31696
+ }
31697
+ const imageViewSrc = this.getElm('imageViewSrc');
31698
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.attr)(imageViewSrc, 'src', imageSrc);
31699
+ const image = new Image();
31700
+ image.src = imageSrc;
31701
+ this.state.image = image;
31702
+ }
31703
+ hideFieldByOptions() {
31704
+ const opt = this.j.o.image;
31705
+ [
31706
+ ['editSize', 'imageSizes'],
31707
+ ['showPreview', 'imageView']
31708
+ ].forEach(([optKey, elmKey]) => {
31709
+ const elm = this.getElm(elmKey);
31710
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.css)(elm, 'display', opt[optKey] ? null : 'none');
31711
+ });
31712
+ }
31713
+ };
31714
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31715
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready'),
31716
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.sizeIsLocked')
31717
+ ], UIImagePropertiesForm.prototype, "onChangeSizeIsLocked", null);
31718
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31719
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('lockSize:click')
31720
+ ], UIImagePropertiesForm.prototype, "onLockSizeClick", null);
31721
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31722
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready'),
31723
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)(['state.values.imageWidth', 'state.values.imageHeight'])
31724
+ ], UIImagePropertiesForm.prototype, "onStateValuesSizeChange", null);
31725
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31726
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([
31727
+ 'imageWidth:change',
31728
+ 'imageHeight:change',
31729
+ 'imageWidth:keydown',
31730
+ 'imageHeight:keydown',
31731
+ 'imageWidth:mousedown',
31732
+ 'imageHeight:mousedown',
31733
+ 'imageWidth:paste',
31734
+ 'imageHeight:paste'
31735
+ ]),
31736
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.debounce)()
31737
+ ], UIImagePropertiesForm.prototype, "onImageWidthChange", null);
31738
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31739
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready'),
31740
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.values.imageSrc')
31741
+ ], UIImagePropertiesForm.prototype, "onStateValuesImageSrcChange", null);
31742
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31743
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready')
31744
+ ], UIImagePropertiesForm.prototype, "hideFieldByOptions", null);
31745
+ UIImagePropertiesForm = (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31746
+ jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_8__/* .component */ .s
31747
+ ], UIImagePropertiesForm);
31748
+
31606
31749
 
31607
31750
 
31608
31751
  /***/ }),
31609
31752
 
31610
- /***/ 75263:
31753
+ /***/ 33403:
31611
31754
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31612
31755
 
31613
31756
  "use strict";
31614
31757
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31615
- /* harmony export */ J: function() { return /* binding */ mainTab; }
31758
+ /* harmony export */ k: function() { return /* binding */ UIImageMainTab; }
31616
31759
  /* harmony export */ });
31617
- /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(931);
31760
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(31635);
31761
+ /* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(24767);
31762
+ /* harmony import */ var jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71151);
31763
+ /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(66927);
31764
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65147);
31765
+ /* harmony import */ var jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6455);
31618
31766
  /*!
31619
31767
  * Jodit Editor (https://xdsoft.net/jodit/)
31620
31768
  * Released under MIT see LICENSE.txt in the project root for license information.
31621
31769
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31622
31770
  */
31623
31771
 
31624
- function mainTab(editor) {
31625
- 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;
31626
- return editor.c.fromHTML(`<div style="${!opt.image.editSrc ? 'display:none' : ''}" class="jodit-form__group">
31627
- <label>${i18n('Src')}</label>
31772
+
31773
+
31774
+
31775
+
31776
+
31777
+ /** @private */
31778
+ let UIImageMainTab = class UIImageMainTab extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_3__/* .UIGroup */ .U {
31779
+ className() {
31780
+ return 'UIImageMainTab';
31781
+ }
31782
+ appendChildToContainer() {
31783
+ // Do nothing
31784
+ }
31785
+ constructor(view, state, handlers) {
31786
+ super(view);
31787
+ this.state = state;
31788
+ this.handlers = handlers;
31789
+ }
31790
+ render() {
31791
+ return `<div class="jodit-form__group &__editSrc">
31792
+ <label>~Src~</label>
31628
31793
  <div class="jodit-input_group">
31629
- <input data-ref="imageSrc" class="jodit-input" type="text"/>
31630
- <div
31631
- class="jodit-input_group-buttons"
31632
- style="${hasFbUrl ? '' : 'display: none'}"
31633
- >
31634
- <a
31635
- data-ref="changeImage"
31636
- class="jodit-button"
31637
- >${gi('image')}</a>
31638
- <a
31639
- data-ref="editImage"
31640
- class="jodit-button"
31641
- style="${hasEditor ? '' : 'display: none'}"
31642
- >${gi('crop')}</a>
31794
+ <input class="jodit-input &__imageSrc" type="text"/>
31795
+ <div class="jodit-input_group-buttons &__fixImage">
31796
+ <a class="jodit-button &__changeImage">*image*</a>
31797
+ <a class="jodit-button &__editImage">*crop*</a>
31643
31798
  </div>
31644
31799
  </div>
31645
31800
  </div>
31646
- <div style="${!opt.image.editTitle ? 'display:none' : ''}" class="jodit-form__group">
31647
- <label>${i18n('Title')}</label>
31648
- <input data-ref="imageTitle" type="text" class="jodit-input"/>
31801
+ <div class="jodit-form__group &__editTitle">
31802
+ <label>~Title~</label>
31803
+ <input type="text" class="jodit-input &__imageTitle"/>
31649
31804
  </div>
31650
- <div style="${!opt.image.editAlt ? 'display:none' : ''}" class="jodit-form__group">
31651
- <label>${i18n('Alternative')}</label>
31652
- <input data-ref="imageAlt" type="text" class="jodit-input"/>
31805
+ <div class="jodit-form__group &__editAlt">
31806
+ <label>~Alternative~</label>
31807
+ <input type="text" class="jodit-input &__imageAlt"/>
31653
31808
  </div>
31654
- <div style="${!opt.image.editLink ? 'display:none' : ''}" class="jodit-form__group">
31655
- <label>${i18n('Link')}</label>
31656
- <input data-ref="imageLink" type="text" class="jodit-input"/>
31809
+ <div class="jodit-form__group &__editLink">
31810
+ <label>~Link~</label>
31811
+ <input type="text" class="jodit-input &__imageLink"/>
31657
31812
  </div>
31658
- <div style="${!opt.image.editLink ? 'display:none' : ''}" class="jodit-form__group">
31813
+ <div class="jodit-form__group &__editLinkTarget">
31659
31814
  <label class="jodit_vertical_middle">
31660
- <input data-ref="imageLinkOpenInNewTab" type="checkbox" class="jodit-checkbox"/>
31661
- <span>${i18n('Open link in new tab')}</span>
31815
+ <input type="checkbox" class="jodit-checkbox &__imageLinkOpenInNewTab"/>
31816
+ <span>~Open link in new tab~</span>
31662
31817
  </label>
31663
- </div>`);
31664
- }
31818
+ </div>`;
31819
+ }
31820
+ onStateImageSrcChange() {
31821
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__awaiter */ .sH)(this, void 0, void 0, function* () {
31822
+ const imageSrc = this.getElm('imageSrc');
31823
+ imageSrc.value = this.state.values.imageSrc;
31824
+ });
31825
+ }
31826
+ onImageSrcChange() {
31827
+ this.state.values.imageSrc = this.getElm('imageSrc').value;
31828
+ }
31829
+ /**
31830
+ * Open image editor
31831
+ */
31832
+ onEditImageClick(e) {
31833
+ this.handlers.openImageEditor();
31834
+ e.stopPropagation();
31835
+ }
31836
+ /**
31837
+ * Open popup with filebrowser/uploader buttons for image
31838
+ */
31839
+ onChangeImageClick(e) {
31840
+ this.handlers.openImagePopup(this.getElm('changeImage'));
31841
+ e.stopPropagation();
31842
+ }
31843
+ onStateTitleChange() {
31844
+ const title = this.getElm('imageTitle');
31845
+ title.value = this.state.values.imageTitle;
31846
+ }
31847
+ onTitleChange() {
31848
+ this.state.values.imageTitle = this.getElm('imageTitle').value;
31849
+ }
31850
+ onStateAltChange() {
31851
+ const alt = this.getElm('imageAlt');
31852
+ alt.value = this.state.values.imageAlt;
31853
+ }
31854
+ onAltChange() {
31855
+ this.state.values.imageAlt = this.getElm('imageAlt').value;
31856
+ }
31857
+ onStateImageLinkChange() {
31858
+ const imageLink = this.getElm('imageLink');
31859
+ imageLink.value = this.state.values.imageLink;
31860
+ }
31861
+ onImageLinkChange() {
31862
+ this.state.values.imageLink = this.getElm('imageLink').value;
31863
+ }
31864
+ onStateImageLinkOpenInNewTabChange() {
31865
+ const imageLinkOpenInNewTab = this.getElm('imageLinkOpenInNewTab');
31866
+ imageLinkOpenInNewTab.checked = this.state.values.imageLinkOpenInNewTab;
31867
+ }
31868
+ onImageLinkOpenInNewTabChange() {
31869
+ this.state.values.imageLinkOpenInNewTab = this.getElm('imageLinkOpenInNewTab').checked;
31870
+ }
31871
+ hideFieldByOptions() {
31872
+ const o = this.j.o;
31873
+ const opt = o.image;
31874
+ [
31875
+ ['editSrc', 'editSrc'],
31876
+ ['editTitle', 'editTitle'],
31877
+ ['editAlt', 'editAlt'],
31878
+ ['editLink', 'editLink'],
31879
+ ['editLink', 'editLinkTarget'],
31880
+ ['useImageEditor', 'editImage']
31881
+ ].forEach(([optKey, elmKey]) => {
31882
+ const elm = this.getElm(elmKey);
31883
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(elm, 'display', opt[optKey] ? null : 'none');
31884
+ });
31885
+ const changeImage = this.getElm('changeImage');
31886
+ const needShowChangeImage = Boolean(o.filebrowser.ajax.url || o.uploader.url);
31887
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(changeImage, 'display', needShowChangeImage ? null : 'none');
31888
+ const editImage = this.getElm('editImage');
31889
+ const needShowEditImage = Boolean(o.filebrowser.ajax.url) && opt.useImageEditor;
31890
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(editImage, 'display', needShowEditImage ? null : 'none');
31891
+ const fixImage = this.getElm('fixImage');
31892
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(fixImage, 'display', needShowChangeImage || needShowEditImage ? null : 'none');
31893
+ }
31894
+ };
31895
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31896
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageSrc')
31897
+ ], UIImageMainTab.prototype, "onStateImageSrcChange", null);
31898
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31899
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageSrc:change')
31900
+ ], UIImageMainTab.prototype, "onImageSrcChange", null);
31901
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31902
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('editImage:click')
31903
+ ], UIImageMainTab.prototype, "onEditImageClick", null);
31904
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31905
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('changeImage:click')
31906
+ ], UIImageMainTab.prototype, "onChangeImageClick", null);
31907
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31908
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageTitle')
31909
+ ], UIImageMainTab.prototype, "onStateTitleChange", null);
31910
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31911
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageTitle:change')
31912
+ ], UIImageMainTab.prototype, "onTitleChange", null);
31913
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31914
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageAlt')
31915
+ ], UIImageMainTab.prototype, "onStateAltChange", null);
31916
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31917
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageAlt:change')
31918
+ ], UIImageMainTab.prototype, "onAltChange", null);
31919
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31920
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageLink')
31921
+ ], UIImageMainTab.prototype, "onStateImageLinkChange", null);
31922
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31923
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageLink:change')
31924
+ ], UIImageMainTab.prototype, "onImageLinkChange", null);
31925
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31926
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageLinkOpenInNewTab')
31927
+ ], UIImageMainTab.prototype, "onStateImageLinkOpenInNewTabChange", null);
31928
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31929
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageLinkOpenInNewTab:change')
31930
+ ], UIImageMainTab.prototype, "onImageLinkOpenInNewTabChange", null);
31931
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31932
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready')
31933
+ ], UIImageMainTab.prototype, "hideFieldByOptions", null);
31934
+ UIImageMainTab = (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31935
+ jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_5__/* .component */ .s
31936
+ ], UIImageMainTab);
31937
+
31665
31938
 
31666
31939
 
31667
31940
  /***/ }),
31668
31941
 
31669
- /***/ 57837:
31942
+ /***/ 46681:
31670
31943
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31671
31944
 
31672
31945
  "use strict";
31673
31946
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31674
- /* harmony export */ b: function() { return /* binding */ positionTab; }
31947
+ /* harmony export */ _: function() { return /* binding */ UIImagePositionTab; }
31675
31948
  /* harmony export */ });
31676
- /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(931);
31949
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(31635);
31950
+ /* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(24767);
31951
+ /* harmony import */ var jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71151);
31952
+ /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(66927);
31953
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65147);
31954
+ /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(98253);
31955
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(26150);
31956
+ /* harmony import */ var jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29780);
31957
+ /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(931);
31958
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(9645);
31677
31959
  /*!
31678
31960
  * Jodit Editor (https://xdsoft.net/jodit/)
31679
31961
  * Released under MIT see LICENSE.txt in the project root for license information.
31680
31962
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31681
31963
  */
31682
31964
 
31683
- function positionTab(editor) {
31684
- 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);
31685
- const classInput = [];
31686
- if (opt.image.availableClasses.length > 0) {
31687
- classInput.push('<select data-ref="classes" class="jodit-input jodit-select">');
31688
- opt.image.availableClasses.forEach(item => {
31689
- if (typeof item === 'string') {
31690
- classInput.push(`<option value="${item}">${item}</option>`);
31691
- }
31692
- else {
31693
- classInput.push(`<option value="${item[0]}">${item[1]}</option>`);
31694
- }
31695
- });
31696
- classInput.push('</select>');
31965
+
31966
+
31967
+
31968
+
31969
+
31970
+
31971
+
31972
+
31973
+
31974
+ /** @private */
31975
+ let UIImagePositionTab = class UIImagePositionTab extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_4__/* .UIElement */ .D {
31976
+ className() {
31977
+ return 'UIImagePositionTab';
31697
31978
  }
31698
- else {
31699
- classInput.push('<input data-ref="classes" type="text" class="jodit-input"/>');
31979
+ constructor(jodit, state, handlers) {
31980
+ super(jodit, {
31981
+ availableClasses: jodit.o.image.availableClasses
31982
+ });
31983
+ this.state = state;
31984
+ this.handlers = handlers;
31700
31985
  }
31701
- return editor.c.fromHTML(`<div style="${!opt.image.editMargins ? 'display:none' : ''}" class="jodit-form__group">
31702
- <label>${i18n('Margins')}</label>
31986
+ render({ availableClasses }) {
31987
+ return `<div class="jodit-form__group &__editMargins">
31988
+ <label>~Margins~</label>
31703
31989
  <div class="jodit-grid jodit_vertical_middle">
31704
- <input class="jodit_col-lg-1-5 jodit-input" data-ref="marginTop" type="text" placeholder="${i18n('top')}"/>
31705
- <a style="text-align: center;" data-ref="lockMargin" class="jodit-properties__lock jodit_col-lg-1-5">${gi('lock')}</a>
31706
- <input disabled="true" class="jodit_col-lg-1-5 jodit-input" data-ref="marginRight" type="text" placeholder="${i18n('right')}"/>
31707
- <input disabled="true" class="jodit_col-lg-1-5 jodit-input" data-ref="marginBottom" type="text" placeholder="${i18n('bottom')}"/>
31708
- <input disabled="true" class="jodit_col-lg-1-5 jodit-input" data-ref="marginLeft" type="text" placeholder="${i18n('left')}"/>
31990
+ <input class="jodit_col-lg-1-5 jodit-input &__marginTop" type="text" placeholder="~top~"/>
31991
+ <a style="text-align: center;" class="jodit-properties__lock jodit_col-lg-1-5 &__lockMargin">*lock*</a>
31992
+ <input disabled="disabled" class="jodit_col-lg-1-5 jodit-input &__marginRight" type="text" placeholder="~right~"/>
31993
+ <input disabled="disabled" class="jodit_col-lg-1-5 jodit-input &__marginBottom" type="text" placeholder="~bottom~"/>
31994
+ <input disabled="disabled" class="jodit_col-lg-1-5 jodit-input &__marginLeft" type="text" placeholder="~left~"/>
31709
31995
  </div>
31710
31996
  </div>
31711
- <div
31712
- style="${!opt.image.editAlign ? 'display:none' : ''}"
31713
- class="jodit-form__group"
31714
- >
31715
- <label>${i18n('Align')}</label>
31716
- <select data-ref="align" class="jodit-select">
31717
- <option value="">${i18n('--Not Set--')}</option>
31718
- <option value="left">${i18n('Left')}</option>
31719
- <option value="center">${i18n('Center')}</option>
31720
- <option value="right">${i18n('Right')}</option>
31997
+ <div class="jodit-form__group &__editAlign">
31998
+ <label>~Align~</label>
31999
+ <select class="jodit-select &__align">
32000
+ <option value="">~--Not Set--~</option>
32001
+ <option value="left">~Left~</option>
32002
+ <option value="center">~Center~</option>
32003
+ <option value="right">~Right~</option>
31721
32004
  </select>
31722
32005
  </div>
31723
- <div style="${!opt.image.editStyle ? 'display:none' : ''}" class="jodit-form__group">
31724
- <label>${i18n('Styles')}</label>
31725
- <input data-ref="style" type="text" class="jodit-input"/>
32006
+ <div class="jodit-form__group &__editStyle">
32007
+ <label>~Styles~</label>
32008
+ <input type="text" class="jodit-input &__style"/>
31726
32009
  </div>
31727
- <div style="${!opt.image.editClass ? 'display:none' : ''}" class="jodit-form__group">
31728
- <label>${i18n('Classes')}</label>
31729
- ${classInput.join('')}
32010
+ <div class="jodit-form__group &__editClass">
32011
+ <label>~Classes~</label>
32012
+ ${(() => {
32013
+ const classInput = [];
32014
+ if (availableClasses && availableClasses.length > 0) {
32015
+ classInput.push('<select class="jodit-input jodit-select &__classes">');
32016
+ availableClasses.forEach(item => {
32017
+ if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_7__/* .isString */ .K)(item)) {
32018
+ classInput.push(`<option value="${item}">${item}</option>`);
32019
+ }
32020
+ else {
32021
+ classInput.push(`<option value="${item[0]}">${item[1]}</option>`);
32022
+ }
32023
+ });
32024
+ classInput.push('</select>');
32025
+ }
32026
+ else {
32027
+ classInput.push('<input type="text" class="jodit-input &__classes"/>');
32028
+ }
32029
+ return classInput.join('');
32030
+ })()}
31730
32031
  </div>
31731
- <div style="${!opt.image.editId ? 'display:none' : ''}" class="jodit-form__group">
32032
+ <div class="jodit-form__group &__editId">
31732
32033
  <label>Id</label>
31733
- <input data-ref="id" type="text" class="jodit-input"/>
32034
+ <input type="text" class="jodit-input &__id"/>
31734
32035
  </div>
31735
32036
  <div
31736
- style="${!opt.image.editBorderRadius ? 'display:none' : ''}"
31737
- class="jodit-form__group"
32037
+ class="jodit-form__group &__editBorderRadius"
31738
32038
  >
31739
- <label>${i18n('Border radius')}</label>
31740
- <input data-ref="borderRadius" type="number" class="jodit-input"/>
31741
- </div>`);
32039
+ <label>~Border radius~</label>
32040
+ <input type="number" class="jodit-input &__borderRadius"/>
32041
+ </div>`;
32042
+ }
32043
+ onStateAlignChange() {
32044
+ const align = this.getElm('align');
32045
+ align.value = this.state.values.align;
32046
+ }
32047
+ onChangeAlign() {
32048
+ const align = this.getElm('align');
32049
+ this.state.values.align = align.value;
32050
+ }
32051
+ onStateValuesBorderRadiusChange() {
32052
+ const borderRadius = this.getElm('borderRadius');
32053
+ borderRadius.value = this.state.values.borderRadius.toString();
32054
+ }
32055
+ onChangeBorderRadius() {
32056
+ const borderRadius = this.getElm('borderRadius');
32057
+ this.state.values.borderRadius = parseFloat(borderRadius.value);
32058
+ }
32059
+ onStateValuesIdChange() {
32060
+ const id = this.getElm('id');
32061
+ id.value = this.state.values.id;
32062
+ }
32063
+ onChangeId() {
32064
+ const id = this.getElm('id');
32065
+ this.state.values.id = id.value;
32066
+ }
32067
+ onStateValuesStyleChange() {
32068
+ const style = this.getElm('style');
32069
+ style.value = this.state.values.style;
32070
+ }
32071
+ onChangeStyle() {
32072
+ const style = this.getElm('style');
32073
+ this.state.values.style = style.value;
32074
+ }
32075
+ onStateValuesClassesChange() {
32076
+ const classes = this.getElm('classes');
32077
+ classes.value = this.state.values.classes;
32078
+ }
32079
+ onChangClasses() {
32080
+ const classes = this.getElm('classes');
32081
+ this.state.values.classes = classes.value;
32082
+ }
32083
+ onLockMarginClick(e) {
32084
+ this.state.marginIsLocked = !this.state.marginIsLocked;
32085
+ e.preventDefault();
32086
+ }
32087
+ onChangeMarginIsLocked() {
32088
+ const marginBottom = this.getElm('marginBottom');
32089
+ const marginRight = this.getElm('marginRight');
32090
+ const marginLeft = this.getElm('marginLeft');
32091
+ const lockMargin = this.getElm('lockMargin');
32092
+ [marginRight, marginBottom, marginLeft].forEach(elm => {
32093
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_3__/* .attr */ .C)(elm, 'disabled', this.state.marginIsLocked || null);
32094
+ });
32095
+ lockMargin.innerHTML = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_5__/* .Icon */ .I.get(this.state.marginIsLocked ? 'lock' : 'unlock');
32096
+ if (this.state.marginIsLocked) {
32097
+ const marginTop = this.state.values.marginTop;
32098
+ this.state.values.marginRight = marginTop;
32099
+ this.state.values.marginBottom = marginTop;
32100
+ this.state.values.marginLeft = marginTop;
32101
+ }
32102
+ }
32103
+ onStateValuesMarginChange() {
32104
+ const marginTop = this.getElm('marginTop');
32105
+ const marginRight = this.getElm('marginRight');
32106
+ const marginBottom = this.getElm('marginBottom');
32107
+ const marginLeft = this.getElm('marginLeft');
32108
+ marginTop.value = this.state.values.marginTop.toString();
32109
+ marginRight.value = this.state.values.marginRight.toString();
32110
+ marginBottom.value = this.state.values.marginBottom.toString();
32111
+ marginLeft.value = this.state.values.marginLeft.toString();
32112
+ }
32113
+ onChangeMargin() {
32114
+ const marginTop = this.getElm('marginTop');
32115
+ const marginRight = this.getElm('marginRight');
32116
+ const marginBottom = this.getElm('marginBottom');
32117
+ const marginLeft = this.getElm('marginLeft');
32118
+ this.state.values.marginTop = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginTop.value);
32119
+ if (this.state.marginIsLocked) {
32120
+ this.state.values.marginRight = this.state.values.marginTop;
32121
+ this.state.values.marginBottom = this.state.values.marginTop;
32122
+ this.state.values.marginLeft = this.state.values.marginTop;
32123
+ }
32124
+ else {
32125
+ this.state.values.marginRight = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginRight.value);
32126
+ this.state.values.marginBottom = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginBottom.value);
32127
+ this.state.values.marginLeft = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginLeft.value);
32128
+ }
32129
+ }
32130
+ hideFieldByOptions() {
32131
+ const opt = this.j.o.image;
32132
+ [
32133
+ ['editMargins', 'editMargins'],
32134
+ ['editAlign', 'editAlign'],
32135
+ ['editStyle', 'editStyle'],
32136
+ ['editClass', 'editClass'],
32137
+ ['editId', 'editId'],
32138
+ ['editBorderRadius', 'editBorderRadius']
32139
+ ].forEach(([optKey, elmKey]) => {
32140
+ const elm = this.getElm(elmKey);
32141
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(elm, 'display', opt[optKey] ? null : 'none');
32142
+ });
32143
+ }
32144
+ };
32145
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32146
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32147
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.align')
32148
+ ], UIImagePositionTab.prototype, "onStateAlignChange", null);
32149
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32150
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('align:change')
32151
+ ], UIImagePositionTab.prototype, "onChangeAlign", null);
32152
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32153
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32154
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.borderRadius')
32155
+ ], UIImagePositionTab.prototype, "onStateValuesBorderRadiusChange", null);
32156
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32157
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('borderRadius:change')
32158
+ ], UIImagePositionTab.prototype, "onChangeBorderRadius", null);
32159
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32160
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32161
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.id')
32162
+ ], UIImagePositionTab.prototype, "onStateValuesIdChange", null);
32163
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32164
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('id:change')
32165
+ ], UIImagePositionTab.prototype, "onChangeId", null);
32166
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32167
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32168
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.style')
32169
+ ], UIImagePositionTab.prototype, "onStateValuesStyleChange", null);
32170
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32171
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('style:change')
32172
+ ], UIImagePositionTab.prototype, "onChangeStyle", null);
32173
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32174
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32175
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.classes')
32176
+ ], UIImagePositionTab.prototype, "onStateValuesClassesChange", null);
32177
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32178
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('classes:change')
32179
+ ], UIImagePositionTab.prototype, "onChangClasses", null);
32180
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32181
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('lockMargin:click')
32182
+ ], UIImagePositionTab.prototype, "onLockMarginClick", null);
32183
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32184
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32185
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.marginIsLocked')
32186
+ ], UIImagePositionTab.prototype, "onChangeMarginIsLocked", null);
32187
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32188
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32189
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)([
32190
+ 'state.values.marginTop',
32191
+ 'state.values.marginRight',
32192
+ 'state.values.marginBottom',
32193
+ 'state.values.marginLeft'
32194
+ ])
32195
+ ], UIImagePositionTab.prototype, "onStateValuesMarginChange", null);
32196
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32197
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)([
32198
+ 'marginTop:change',
32199
+ 'marginRight:change',
32200
+ 'marginBottom:change',
32201
+ 'marginLeft:change'
32202
+ ])
32203
+ ], UIImagePositionTab.prototype, "onChangeMargin", null);
32204
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32205
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready')
32206
+ ], UIImagePositionTab.prototype, "hideFieldByOptions", null);
32207
+ UIImagePositionTab = (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32208
+ jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_9__/* .component */ .s
32209
+ ], UIImagePositionTab);
32210
+
32211
+
32212
+
32213
+ /***/ }),
32214
+
32215
+ /***/ 80778:
32216
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32217
+
32218
+ "use strict";
32219
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32220
+ /* harmony export */ v: function() { return /* binding */ openImageEditorDialog; }
32221
+ /* harmony export */ });
32222
+ /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(98253);
32223
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26150);
32224
+ /* harmony import */ var jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(53804);
32225
+ /*!
32226
+ * Jodit Editor (https://xdsoft.net/jodit/)
32227
+ * Released under MIT see LICENSE.txt in the project root for license information.
32228
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32229
+ */
32230
+
32231
+
32232
+
32233
+ /**
32234
+ * Open image editor dialog
32235
+ * @private
32236
+ */
32237
+ function openImageEditorDialog(j, state) {
32238
+ const url = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(state.image, 'src') || '', a = j.c.element('a'), loadExternal = () => {
32239
+ if (a.host !== location.host) {
32240
+ j.confirm('You can only edit your own images. Download this image on the host?', yes => {
32241
+ if (yes && j.uploader) {
32242
+ j.uploader.uploadRemoteImage(a.href.toString(), resp => {
32243
+ j.alert('The image has been successfully uploaded to the host!', () => {
32244
+ if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_2__/* .isString */ .K)(resp.newfilename)) {
32245
+ state.values.imageSrc =
32246
+ resp.baseurl +
32247
+ resp.newfilename;
32248
+ }
32249
+ });
32250
+ }, error => {
32251
+ j.alert('There was an error loading %s', error.message);
32252
+ });
32253
+ }
32254
+ });
32255
+ return;
32256
+ }
32257
+ };
32258
+ a.href = url;
32259
+ j.filebrowser.dataProvider
32260
+ .getPathByUrl(a.href.toString())
32261
+ .then(resp => {
32262
+ jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_1__/* .openImageEditor */ .B.call(j.filebrowser, a.href, resp.name, resp.path, resp.source, () => {
32263
+ const timestamp = new Date().getTime();
32264
+ state.values.imageSrc =
32265
+ url +
32266
+ (url.indexOf('?') !== -1 ? '' : '?') +
32267
+ '&_tmp=' +
32268
+ timestamp.toString();
32269
+ }, error => {
32270
+ j.alert(error.message);
32271
+ });
32272
+ })
32273
+ .catch(error => {
32274
+ j.alert(error.message, loadExternal);
32275
+ });
32276
+ }
32277
+
32278
+
32279
+ /***/ }),
32280
+
32281
+ /***/ 33733:
32282
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32283
+
32284
+ "use strict";
32285
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32286
+ /* harmony export */ q: function() { return /* binding */ openImagePopup; }
32287
+ /* harmony export */ });
32288
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(31635);
32289
+ /* harmony import */ var jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37923);
32290
+ /* harmony import */ var jodit_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(27594);
32291
+ /* harmony import */ var jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(80071);
32292
+ /* harmony import */ var jodit_modules_widget_file_selector_file_selector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10067);
32293
+ /*!
32294
+ * Jodit Editor (https://xdsoft.net/jodit/)
32295
+ * Released under MIT see LICENSE.txt in the project root for license information.
32296
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32297
+ */
32298
+
32299
+
32300
+
32301
+
32302
+
32303
+ /** @private */
32304
+ function openImagePopup(j, dialog, state, button) {
32305
+ const popup = new jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_0__/* .Popup */ .z(dialog);
32306
+ const closePopup = () => {
32307
+ popup.close();
32308
+ popup.destruct();
32309
+ };
32310
+ popup
32311
+ .setContent((0,jodit_modules_widget_file_selector_file_selector__WEBPACK_IMPORTED_MODULE_1__/* .FileSelectorWidget */ .k)(j, {
32312
+ upload: (data) => {
32313
+ if (data.files && data.files.length) {
32314
+ state.values.imageSrc =
32315
+ data.baseurl + data.files[0];
32316
+ }
32317
+ closePopup();
32318
+ },
32319
+ filebrowser: (data) => (0,tslib__WEBPACK_IMPORTED_MODULE_2__/* .__awaiter */ .sH)(this, void 0, void 0, function* () {
32320
+ if (data && (0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_3__/* .isArray */ .c)(data.files) && data.files.length) {
32321
+ state.values.imageSrc = data.files[0];
32322
+ closePopup();
32323
+ }
32324
+ })
32325
+ }, state.image, closePopup))
32326
+ .open(() => (0,jodit_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_4__/* .position */ .G)(button));
32327
+ }
32328
+
32329
+
32330
+ /***/ }),
32331
+
32332
+ /***/ 9645:
32333
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32334
+
32335
+ "use strict";
32336
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32337
+ /* harmony export */ G: function() { return /* binding */ normalSizeFromString; },
32338
+ /* harmony export */ n: function() { return /* binding */ normalSizeToString; }
32339
+ /* harmony export */ });
32340
+ /* harmony import */ var jodit_core_helpers_checker_is_number__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2461);
32341
+ /* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(59101);
32342
+ /*!
32343
+ * Jodit Editor (https://xdsoft.net/jodit/)
32344
+ * Released under MIT see LICENSE.txt in the project root for license information.
32345
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32346
+ */
32347
+
32348
+
32349
+ /** @private */
32350
+ const normalSizeFromString = (value) => {
32351
+ return /^[-+]?[0-9.]+(px)?$/.test(value.toString())
32352
+ ? parseFloat(value.toString())
32353
+ : value;
32354
+ };
32355
+ /** @private */
32356
+ const normalSizeToString = (value) => {
32357
+ if ((0,jodit_core_helpers_checker_is_number__WEBPACK_IMPORTED_MODULE_1__/* .isNumber */ .E)(value)) {
32358
+ return value ? value + 'px' : value.toString();
32359
+ }
32360
+ value = (0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_0__/* .trim */ .Bq)(value);
32361
+ return /^[0-9]+$/.test(value) ? value + 'px' : value;
32362
+ };
32363
+
32364
+
32365
+ /***/ }),
32366
+
32367
+ /***/ 30393:
32368
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32369
+
32370
+ "use strict";
32371
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32372
+ /* harmony export */ j: function() { return /* binding */ applyValuesToImage; }
32373
+ /* harmony export */ });
32374
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55186);
32375
+ /* harmony import */ var jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97369);
32376
+ /* harmony import */ var _link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(88269);
32377
+ /* harmony import */ var _margin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(78139);
32378
+ /* harmony import */ var _size__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(58972);
32379
+ /*!
32380
+ * Jodit Editor (https://xdsoft.net/jodit/)
32381
+ * Released under MIT see LICENSE.txt in the project root for license information.
32382
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32383
+ */
32384
+
32385
+
32386
+
32387
+
32388
+
32389
+ /**
32390
+ * Apply form's values to image
32391
+ * @private
32392
+ */
32393
+ function applyValuesToImage(j, state, image) {
32394
+ const { style, imageSrc, borderRadius, imageTitle, imageAlt, imageLink, imageWidth, imageHeight, marginTop, marginRight, marginBottom, marginLeft, imageLinkOpenInNewTab, align, classes, id } = state.values;
32395
+ const opt = j.o;
32396
+ // styles
32397
+ if (opt.image.editStyle) {
32398
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'style', style || null);
32399
+ }
32400
+ // Src
32401
+ if (imageSrc) {
32402
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'src', imageSrc);
32403
+ }
32404
+ else {
32405
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.safeRemove(image);
32406
+ return;
32407
+ }
32408
+ // Border radius
32409
+ image.style.borderRadius = borderRadius ? borderRadius + 'px' : '';
32410
+ // Title
32411
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'title', imageTitle || null);
32412
+ // Alt
32413
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'alt', imageAlt || null);
32414
+ // Link
32415
+ (0,_link__WEBPACK_IMPORTED_MODULE_2__/* .applyLink */ .j)(j, image, imageLink, imageLinkOpenInNewTab);
32416
+ // Size
32417
+ (0,_size__WEBPACK_IMPORTED_MODULE_4__/* .applySize */ .q)(image, imageWidth, imageHeight, state.sizeIsLocked);
32418
+ // Margin
32419
+ if (j.o.image.editMargins) {
32420
+ (0,_margin__WEBPACK_IMPORTED_MODULE_3__/* .applyMargin */ .N)(j, marginTop, marginRight, marginBottom, marginLeft, image, state.marginIsLocked);
32421
+ }
32422
+ if (opt.image.editClass) {
32423
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'class', classes || null);
32424
+ }
32425
+ if (opt.image.editId) {
32426
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'id', id || null);
32427
+ }
32428
+ if (opt.image.editAlign) {
32429
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.hAlignElement)(image, align);
32430
+ }
32431
+ }
32432
+
32433
+
32434
+ /***/ }),
32435
+
32436
+ /***/ 88269:
32437
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32438
+
32439
+ "use strict";
32440
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32441
+ /* harmony export */ j: function() { return /* binding */ applyLink; }
32442
+ /* harmony export */ });
32443
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55186);
32444
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26150);
32445
+ /*!
32446
+ * Jodit Editor (https://xdsoft.net/jodit/)
32447
+ * Released under MIT see LICENSE.txt in the project root for license information.
32448
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32449
+ */
32450
+
32451
+
32452
+ /** @private */
32453
+ function applyLink(j, image, imageLink, imageLinkOpenInNewTab) {
32454
+ // Link
32455
+ let link = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.closest(image, 'a', j.editor);
32456
+ if (imageLink) {
32457
+ if (!link) {
32458
+ link = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.wrap(image, 'a', j.createInside);
32459
+ }
32460
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(link, 'href', imageLink);
32461
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(link, 'target', imageLinkOpenInNewTab ? '_blank' : null);
32462
+ }
32463
+ else {
32464
+ if (link && link.parentNode) {
32465
+ link.parentNode.replaceChild(image, link);
32466
+ }
32467
+ }
32468
+ }
32469
+
32470
+
32471
+ /***/ }),
32472
+
32473
+ /***/ 78139:
32474
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32475
+
32476
+ "use strict";
32477
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32478
+ /* harmony export */ N: function() { return /* binding */ applyMargin; }
32479
+ /* harmony export */ });
32480
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(38322);
32481
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9645);
32482
+ /*!
32483
+ * Jodit Editor (https://xdsoft.net/jodit/)
32484
+ * Released under MIT see LICENSE.txt in the project root for license information.
32485
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32486
+ */
32487
+
32488
+
32489
+ /** @private */
32490
+ function applyMargin(j, marginTop, marginRight, marginBottom, marginLeft, image, marginIsLocked) {
32491
+ const margins = [marginTop, marginRight, marginBottom, marginLeft];
32492
+ const applyMargin = (key, value) => {
32493
+ const oldValue = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_1__/* .css */ .A)(image, key);
32494
+ const v = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_0__/* .normalSizeToString */ .n)(value);
32495
+ if (oldValue.toString() !== v.toString()) {
32496
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_1__/* .css */ .A)(image, key, v);
32497
+ }
32498
+ };
32499
+ if (!marginIsLocked) {
32500
+ const sides = [
32501
+ 'margin-top',
32502
+ 'margin-right',
32503
+ 'margin-bottom',
32504
+ 'margin-left'
32505
+ ];
32506
+ margins.forEach((margin, index) => {
32507
+ const side = sides[index];
32508
+ applyMargin(side, margin);
32509
+ });
32510
+ }
32511
+ else {
32512
+ applyMargin('margin', marginTop);
32513
+ }
32514
+ }
32515
+
32516
+
32517
+ /***/ }),
32518
+
32519
+ /***/ 58972:
32520
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32521
+
32522
+ "use strict";
32523
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32524
+ /* harmony export */ q: function() { return /* binding */ applySize; }
32525
+ /* harmony export */ });
32526
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26150);
32527
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(38322);
32528
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9645);
32529
+ /*!
32530
+ * Jodit Editor (https://xdsoft.net/jodit/)
32531
+ * Released under MIT see LICENSE.txt in the project root for license information.
32532
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32533
+ */
32534
+
32535
+
32536
+
32537
+ /** @private */
32538
+ function applySize(image, imageWidth, imageHeight, sizeIsLocked) {
32539
+ // Size
32540
+ if (imageWidth !== image.offsetWidth ||
32541
+ imageHeight !== image.offsetHeight) {
32542
+ const updatedWidth = imageWidth ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeToString */ .n)(imageWidth) : null;
32543
+ let updatedHeight = imageHeight
32544
+ ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeToString */ .n)(imageHeight)
32545
+ : null;
32546
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__/* .css */ .A)(image, {
32547
+ width: updatedWidth,
32548
+ height: updatedWidth && sizeIsLocked ? null : updatedHeight
32549
+ });
32550
+ (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);
32551
+ if (!(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'width') || sizeIsLocked) {
32552
+ updatedHeight = null;
32553
+ }
32554
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'height', updatedHeight);
32555
+ }
31742
32556
  }
31743
32557
 
31744
32558
 
@@ -38131,7 +38945,8 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_3__/* .pluginSystem */ .fg.add('selec
38131
38945
  */
38132
38946
 
38133
38947
  jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.select = {
38134
- normalizeSelectionBeforeCutAndCopy: false
38948
+ normalizeSelectionBeforeCutAndCopy: false,
38949
+ normalizeTripleClick: true
38135
38950
  };
38136
38951
 
38137
38952
 
@@ -38207,7 +39022,7 @@ class select extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_3__/* .Plugin */
38207
39022
  }
38208
39023
  }
38209
39024
  /**
38210
- * @event outsideClick(e) - when user clicked in the outside of editor
39025
+ * @event outsideClick(e) - when user clicked on the outside of editor
38211
39026
  */
38212
39027
  onOutsideClick(e) {
38213
39028
  const node = e.target;
@@ -38219,7 +39034,7 @@ class select extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_3__/* .Plugin */
38219
39034
  this.j.e.fire('outsideClick', e);
38220
39035
  }
38221
39036
  }
38222
- beforeCommandCut(command) {
39037
+ beforeCommandCut() {
38223
39038
  const { s } = this.j;
38224
39039
  if (!s.isCollapsed()) {
38225
39040
  const current = s.current();
@@ -38228,13 +39043,27 @@ class select extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_3__/* .Plugin */
38228
39043
  }
38229
39044
  }
38230
39045
  }
38231
- beforeCommandSelectall(command) {
39046
+ beforeCommandSelectAll() {
38232
39047
  const { s } = this.j;
38233
39048
  s.focus();
38234
39049
  s.select(this.j.editor, true);
38235
39050
  s.expandSelection();
38236
39051
  return false;
38237
39052
  }
39053
+ /**
39054
+ * Normalize selection after triple click
39055
+ */
39056
+ onTripleClickNormalizeSelection(e) {
39057
+ if (e.detail !== 3 || !this.j.o.select.normalizeTripleClick) {
39058
+ return;
39059
+ }
39060
+ const { s } = this.j;
39061
+ const { startContainer, startOffset } = s.range;
39062
+ if (startOffset === 0 && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isText(startContainer)) {
39063
+ 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) ||
39064
+ startContainer, true);
39065
+ }
39066
+ }
38238
39067
  onCopyNormalizeSelectionBound(e) {
38239
39068
  const { s, editor, o } = this.j;
38240
39069
  if (!o.select.normalizeSelectionBeforeCutAndCopy || s.isCollapsed()) {
@@ -38260,7 +39089,10 @@ class select extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_3__/* .Plugin */
38260
39089
  ], select.prototype, "beforeCommandCut", null);
38261
39090
  (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
38262
39091
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([':beforeCommandSelectall'])
38263
- ], select.prototype, "beforeCommandSelectall", null);
39092
+ ], select.prototype, "beforeCommandSelectAll", null);
39093
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
39094
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([':click'])
39095
+ ], select.prototype, "onTripleClickNormalizeSelection", null);
38264
39096
  (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
38265
39097
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([':copy', ':cut'])
38266
39098
  ], select.prototype, "onCopyNormalizeSelectionBound", null);