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/es2018/jodit.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.1.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 = "es2018";
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
 
@@ -8770,9 +8800,9 @@ const getXPathByElement = (element, root) => {
8770
8800
  * Find all `ref` or `data-ref` elements inside HTMLElement
8771
8801
  */
8772
8802
  const refs = (root) => {
8773
- // if (Component.isInstanceOf<UIElement>(root, UIElement)) {
8774
- // root = root.container;
8775
- // }
8803
+ if ('container' in root) {
8804
+ root = root.container;
8805
+ }
8776
8806
  return $$('[ref],[data-ref]', root).reduce((def, child) => {
8777
8807
  const key = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(child, '-ref');
8778
8808
  if (key && (0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_4__/* .isString */ .K)(key)) {
@@ -13315,7 +13345,7 @@ let UITooltip = UITooltip_1 = class UITooltip extends jodit_core_ui_element__WEB
13315
13345
  view.o.showTooltip &&
13316
13346
  !view.o.useNativeTooltip) {
13317
13347
  view.hookStatus(jodit_core_component__WEBPACK_IMPORTED_MODULE_0__/* .STATUSES */ .f.ready, () => {
13318
- // TODO Move it inside __open method. Now it is here becous testcase failed with capturing
13348
+ // TODO Move it inside __open method. Now it is here because testcase failed with capturing
13319
13349
  (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_3__/* .getContainer */ .My)(this.j, UITooltip_1).appendChild(this.container);
13320
13350
  view.e.on(view.container, 'mouseenter.tooltip', this.__onMouseEnter, {
13321
13351
  capture: true
@@ -13331,6 +13361,7 @@ let UITooltip = UITooltip_1 = class UITooltip extends jodit_core_ui_element__WEB
13331
13361
  const view = this.j;
13332
13362
  view.e
13333
13363
  .on(view.ow, 'scroll.tooltip', this.__hide)
13364
+ .on(view.ow, 'joditCloseDialog', this.__hide)
13334
13365
  .on(view.container, 'mouseleave.tooltip', this.__hide)
13335
13366
  .on([
13336
13367
  'escape.tooltip',
@@ -15348,7 +15379,7 @@ class Popup extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_7__/* .UI
15348
15379
  }
15349
15380
  let pe = this.parentElement;
15350
15381
  while (pe) {
15351
- if (checkView(j)) {
15382
+ if (checkView(pe.j)) {
15352
15383
  return;
15353
15384
  }
15354
15385
  if (pe.container.style.zIndex) {
@@ -17844,6 +17875,7 @@ let Dialog = Dialog_1 = class Dialog extends jodit_core_view_view_with_toolbar__
17844
17875
  * Fired when dialog box is started moving
17845
17876
  */
17846
17877
  this.e.fire(this, 'startMove');
17878
+ this.e.fire('closeAllPopups');
17847
17879
  }
17848
17880
  }
17849
17881
  onMouseMove(e) {
@@ -19172,6 +19204,9 @@ let DataProvider = class DataProvider {
19172
19204
  this.o.permissions.data.source = source;
19173
19205
  if (this.o.permissions.url) {
19174
19206
  return this.get('permissions').then(resp => {
19207
+ if (this.parent.isInDestruct) {
19208
+ throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.abort)();
19209
+ }
19175
19210
  let process = this.o.permissions.process;
19176
19211
  if (!process) {
19177
19212
  process = this.o.ajax.process;
@@ -19790,10 +19825,18 @@ let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__W
19790
19825
  this.__updateToolbarButtons();
19791
19826
  this._dialog.open(this.browser, header);
19792
19827
  this.e.fire('sort.filebrowser', this.state.sortBy);
19793
- (0,_fetch_load_tree__WEBPACK_IMPORTED_MODULE_10__/* .loadTree */ .r)(this).then(resolve, reject);
19828
+ (0,_fetch_load_tree__WEBPACK_IMPORTED_MODULE_10__/* .loadTree */ .r)(this)
19829
+ .then(resolve, reject)
19830
+ .finally(() => {
19831
+ var _a;
19832
+ if (this.isInDestruct) {
19833
+ return;
19834
+ }
19835
+ (_a = this === null || this === void 0 ? void 0 : this.e) === null || _a === void 0 ? void 0 : _a.fire('fileBrowserReady.filebrowser');
19836
+ });
19794
19837
  })
19795
19838
  .catch((e) => {
19796
- if (!jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.IS_PROD) {
19839
+ if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isAbortError)(e) && !jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.IS_PROD) {
19797
19840
  throw e;
19798
19841
  }
19799
19842
  });
@@ -21663,11 +21706,12 @@ const act = (el, className = 'jodti-image-editor_active') => el ? className : ''
21663
21706
  const form = (editor, o) => {
21664
21707
  const i = editor.i18n.bind(editor);
21665
21708
  const switcher = (label, ref, active = true) => `<div class="jodit-form__group">
21666
- <label>${i(label)}</label>
21667
-
21668
- <label class='jodit-switcher'>
21669
- <input ${act(active, 'checked')} data-ref="${ref}" type="checkbox"/>
21670
- <span class="jodit-switcher__slider"></span>
21709
+ <label class="jodit-switcher-wrapper">
21710
+ <span class='jodit-switcher'>
21711
+ <input ${act(active, 'checked')} data-ref="${ref}" type="checkbox"/>
21712
+ <span class="jodit-switcher__slider"></span>
21713
+ </span>
21714
+ <span>${i(label)}</span>
21671
21715
  </label>
21672
21716
  </div>`;
21673
21717
  return editor.create.fromHTML(`<form class="${jie} jodit-properties">
@@ -24748,11 +24792,13 @@ const TabsWidget = (jodit, tabs, state) => {
24748
24792
  return;
24749
24793
  }
24750
24794
  buttonList.forEach(b => {
24795
+ b.state.variant = 'initial';
24751
24796
  b.state.activated = false;
24752
24797
  });
24753
24798
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.$$)('.jodit-tab', tabBox).forEach(a => {
24754
24799
  a.classList.remove('jodit-tab_active');
24755
24800
  });
24801
+ nameToTab[tab].button.state.variant = 'outline';
24756
24802
  nameToTab[tab].button.state.activated = true;
24757
24803
  nameToTab[tab].tab.classList.add('jodit-tab_active');
24758
24804
  };
@@ -24781,7 +24827,7 @@ const TabsWidget = (jodit, tabs, state) => {
24781
24827
  content.call(jodit);
24782
24828
  }
24783
24829
  if (state) {
24784
- state.__activeTab = name;
24830
+ state.activeTab = name;
24785
24831
  }
24786
24832
  return false;
24787
24833
  });
@@ -24797,20 +24843,20 @@ const TabsWidget = (jodit, tabs, state) => {
24797
24843
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.$$)('a', buttons).forEach(a => {
24798
24844
  a.style.width = (100 / tabCount).toFixed(10) + '%';
24799
24845
  });
24800
- const tab = !state || !state.__activeTab || !nameToTab[state.__activeTab]
24846
+ const tab = !state || !state.activeTab || !nameToTab[state.activeTab]
24801
24847
  ? firstTab
24802
- : state.__activeTab;
24848
+ : state.activeTab;
24803
24849
  setActive(tab);
24804
24850
  if (state) {
24805
- let __activeTab = state.__activeTab;
24806
- Object.defineProperty(state, '__activeTab', {
24851
+ let activeTab = state.activeTab;
24852
+ Object.defineProperty(state, 'activeTab', {
24807
24853
  configurable: true,
24808
24854
  enumerable: false,
24809
24855
  get() {
24810
- return __activeTab;
24856
+ return activeTab;
24811
24857
  },
24812
24858
  set(value) {
24813
- __activeTab = value;
24859
+ activeTab = value;
24814
24860
  setActive(value);
24815
24861
  }
24816
24862
  });
@@ -25225,7 +25271,7 @@ class aiAssistant extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_3__/
25225
25271
  (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .extendLang */ .JW)(_langs__WEBPACK_IMPORTED_MODULE_6__);
25226
25272
  }
25227
25273
  /** @override */
25228
- afterInit(jodit) { }
25274
+ afterInit() { }
25229
25275
  onGenerateAiAssistantForm(prompt) {
25230
25276
  this.__dialog.open(this.__container, 'AI Assistant');
25231
25277
  this.__container.setPrompt(prompt);
@@ -31106,9 +31152,6 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .pluginSystem */ .fg.add('image
31106
31152
  * Released under MIT see LICENSE.txt in the project root for license information.
31107
31153
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31108
31154
  */
31109
- /**
31110
- * @module plugins/image-properties
31111
- */
31112
31155
 
31113
31156
  jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.image = {
31114
31157
  dialogWidth: 600,
@@ -31138,18 +31181,19 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.image = {
31138
31181
 
31139
31182
  "use strict";
31140
31183
  /* unused harmony export imageProperties */
31141
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(31635);
31184
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(31635);
31142
31185
  /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22664);
31143
- /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56298);
31144
- /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65147);
31145
- /* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(35265);
31146
- /* harmony import */ var jodit_modules__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(37435);
31147
- /* harmony import */ var jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(53804);
31148
- /* harmony import */ var jodit_modules_widget__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(16116);
31149
- /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(24654);
31150
- /* harmony import */ var _templates_form__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(22254);
31151
- /* harmony import */ var _templates_main_tab__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(75263);
31152
- /* harmony import */ var _templates_position_tab__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(57837);
31186
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(55186);
31187
+ /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(56298);
31188
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(65147);
31189
+ /* harmony import */ var jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29866);
31190
+ /* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(35265);
31191
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(24654);
31192
+ /* harmony import */ var _ui_ui_image_form__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(31970);
31193
+ /* harmony import */ var _utils_open_image_editor__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(80778);
31194
+ /* harmony import */ var _utils_open_image_popup__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(33733);
31195
+ /* harmony import */ var _readers__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(5549);
31196
+ /* harmony import */ var _writers__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(30393);
31153
31197
  /*!
31154
31198
  * Jodit Editor (https://xdsoft.net/jodit/)
31155
31199
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -31181,55 +31225,93 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.image = {
31181
31225
  * });
31182
31226
  * ```
31183
31227
  */
31184
- const normalSizeToString = (value) => {
31185
- value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.trim)(value);
31186
- return /^[0-9]+$/.test(value) ? value + 'px' : value;
31187
- };
31188
- const normalSizeFromString = (value) => {
31189
- return /^[-+]?[0-9.]+px$/.test(value.toString())
31190
- ? parseFloat(value.toString())
31191
- : value;
31192
- };
31193
31228
  /**
31194
31229
  * Show dialog with image's options
31195
31230
  */
31196
- class imageProperties extends jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin {
31231
+ class imageProperties extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_4__/* .Plugin */ .k {
31197
31232
  constructor() {
31198
31233
  super(...arguments);
31199
31234
  this.state = {
31200
31235
  image: new Image(),
31236
+ sourceImage: new Image(),
31201
31237
  get ratio() {
31202
- return this.image.naturalWidth / this.image.naturalHeight || 1;
31238
+ const { naturalWidth, naturalHeight } = this.image;
31239
+ return naturalWidth / naturalHeight || 1;
31203
31240
  },
31204
31241
  sizeIsLocked: true,
31205
- marginIsLocked: true
31242
+ marginIsLocked: true,
31243
+ values: {
31244
+ style: '',
31245
+ imageSrc: '',
31246
+ borderRadius: 0,
31247
+ imageTitle: '',
31248
+ imageAlt: '',
31249
+ imageLink: '',
31250
+ imageLinkOpenInNewTab: false,
31251
+ imageWidth: 0,
31252
+ imageHeight: 0,
31253
+ marginTop: 0,
31254
+ marginRight: 0,
31255
+ marginBottom: 0,
31256
+ marginLeft: 0,
31257
+ classes: '',
31258
+ id: '',
31259
+ align: ''
31260
+ }
31206
31261
  };
31207
31262
  this.activeTabState = {
31208
- __activeTab: 'Image'
31263
+ activeTab: 'Image'
31209
31264
  };
31210
31265
  }
31211
- onChangeMarginIsLocked() {
31212
- if (!this.form) {
31213
- return;
31214
- }
31215
- const { marginRight, marginBottom, marginLeft, lockMargin } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
31216
- [marginRight, marginBottom, marginLeft].forEach(elm => {
31217
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(elm, 'disabled', this.state.marginIsLocked || null);
31266
+ get form() {
31267
+ return new _ui_ui_image_form__WEBPACK_IMPORTED_MODULE_7__/* .UIImagePropertiesForm */ .l(this.j, this.state, this.activeTabState, {
31268
+ openImageEditor: () => (0,_utils_open_image_editor__WEBPACK_IMPORTED_MODULE_8__/* .openImageEditorDialog */ .v)(this.j, this.state),
31269
+ openImagePopup: target => (0,_utils_open_image_popup__WEBPACK_IMPORTED_MODULE_9__/* .openImagePopup */ .q)(this.j, this.dialog, this.state, target)
31218
31270
  });
31219
- lockMargin.innerHTML = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Icon.get(this.state.marginIsLocked ? 'lock' : 'unlock');
31220
31271
  }
31221
- onChangeSizeIsLocked() {
31222
- if (!this.form) {
31223
- return;
31224
- }
31225
- const { lockSize, imageWidth } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
31226
- lockSize.innerHTML = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Icon.get(this.state.sizeIsLocked ? 'lock' : 'unlock');
31227
- lockSize.classList.remove('jodit-properties__lock');
31228
- lockSize.classList.remove('jodit-properties__unlock');
31229
- lockSize.classList.add(this.state.sizeIsLocked
31230
- ? 'jodit-properties__lock'
31231
- : 'jodit-properties__unlock');
31232
- this.j.e.fire(imageWidth, 'change');
31272
+ /**
31273
+ * Dialog for form
31274
+ */
31275
+ get dialog() {
31276
+ const { j } = this;
31277
+ const dialog = j.dlg({
31278
+ minWidth: Math.min(400, screen.width),
31279
+ minHeight: 590,
31280
+ buttons: ['fullsize', 'dialog.close']
31281
+ });
31282
+ const buttons = this.__buttons;
31283
+ buttons.check.onAction(() => {
31284
+ (0,_writers__WEBPACK_IMPORTED_MODULE_11__/* .applyValuesToImage */ .j)(j, this.state, this.state.sourceImage);
31285
+ j.synchronizeValues();
31286
+ dialog.close();
31287
+ });
31288
+ buttons.remove.onAction(() => {
31289
+ j.s.removeNode(this.state.sourceImage);
31290
+ dialog.close();
31291
+ });
31292
+ buttons.cancel.onAction(() => {
31293
+ dialog.close();
31294
+ });
31295
+ dialog.setHeader(j.i18n('Image properties'));
31296
+ dialog.setContent(this.form);
31297
+ dialog.setFooter([[buttons.cancel, buttons.remove], buttons.check]);
31298
+ j.e.on(dialog, 'afterClose', () => {
31299
+ if (this.state.image.parentNode &&
31300
+ j.o.image.selectImageAfterClose) {
31301
+ j.s.select(this.state.sourceImage);
31302
+ }
31303
+ });
31304
+ dialog.setSize(j.o.image.dialogWidth);
31305
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.markOwner)(j, dialog.container);
31306
+ return dialog;
31307
+ }
31308
+ get __buttons() {
31309
+ const { j } = this;
31310
+ return {
31311
+ check: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__/* .Button */ .$n)(j, 'ok', 'Apply', 'primary'),
31312
+ remove: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__/* .Button */ .$n)(j, 'bin', 'Delete'),
31313
+ cancel: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__/* .Button */ .$n)(j, 'cancel', 'Cancel')
31314
+ };
31233
31315
  }
31234
31316
  /**
31235
31317
  * Open dialog editing image properties
@@ -31246,358 +31328,28 @@ class imageProperties extends jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin
31246
31328
  * ```
31247
31329
  */
31248
31330
  open() {
31249
- this.makeForm();
31250
- this.activeTabState.__activeTab = 'Image';
31251
- this.j.e.fire('hidePopup');
31252
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.markOwner)(this.j, this.dialog.container);
31253
- this.state.marginIsLocked = true;
31254
- this.state.sizeIsLocked = true;
31255
- this.onChangeMarginIsLocked();
31256
- this.onChangeSizeIsLocked();
31257
- this.updateValues();
31331
+ this.activeTabState.activeTab = 'Image';
31332
+ this.__lock();
31258
31333
  this.dialog.open().setModal(true).setPosition();
31259
- return false;
31260
- }
31261
- /**
31262
- * Create form for edit image properties
31263
- */
31264
- makeForm() {
31265
- if (this.dialog) {
31266
- return;
31267
- }
31268
- this.dialog = this.j.dlg({
31269
- minWidth: Math.min(400, screen.width),
31270
- minHeight: 590,
31271
- buttons: ['fullsize', 'dialog.close']
31272
- });
31273
- const editor = this.j, opt = editor.o, i18n = editor.i18n.bind(editor), buttons = {
31274
- check: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_3__/* .Button */ .$n)(editor, 'ok', 'Apply', 'primary'),
31275
- remove: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_3__/* .Button */ .$n)(editor, 'bin', 'Delete')
31276
- };
31277
- editor.e.on(this.dialog, 'afterClose', () => {
31278
- if (this.state.image.parentNode &&
31279
- opt.image.selectImageAfterClose) {
31280
- editor.s.select(this.state.image);
31281
- }
31282
- });
31283
- buttons.remove.onAction(() => {
31284
- editor.s.removeNode(this.state.image);
31285
- this.dialog.close();
31286
- });
31287
- const { dialog } = this;
31288
- dialog.setHeader(i18n('Image properties'));
31289
- const mainForm = (0,_templates_form__WEBPACK_IMPORTED_MODULE_8__/* .form */ .Z)(editor);
31290
- this.form = mainForm;
31291
- dialog.setContent(mainForm);
31292
- const { tabsBox } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
31293
- if (tabsBox) {
31294
- tabsBox.appendChild((0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_6__/* .TabsWidget */ .Zg)(editor, [
31295
- { name: 'Image', content: (0,_templates_main_tab__WEBPACK_IMPORTED_MODULE_9__/* .mainTab */ .J)(editor) },
31296
- { name: 'Advanced', content: (0,_templates_position_tab__WEBPACK_IMPORTED_MODULE_10__/* .positionTab */ .b)(editor) }
31297
- ], this.activeTabState));
31298
- }
31299
- buttons.check.onAction(this.onApply);
31300
- const { changeImage, editImage } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
31301
- editor.e.on(changeImage, 'click', this.openImagePopup);
31302
- if (opt.image.useImageEditor) {
31303
- editor.e.on(editImage, 'click', this.openImageEditor);
31304
- }
31305
- const { lockSize, lockMargin, imageWidth, imageHeight } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(mainForm);
31306
- if (lockSize) {
31307
- editor.e.on(lockSize, 'click', () => {
31308
- this.state.sizeIsLocked = !this.state.sizeIsLocked;
31309
- });
31310
- }
31311
- editor.e.on(lockMargin, 'click', (e) => {
31312
- this.state.marginIsLocked = !this.state.marginIsLocked;
31313
- e.preventDefault();
31314
- });
31315
- const changeSizes = (event) => {
31316
- if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isNumeric)(imageWidth.value) || !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isNumeric)(imageHeight.value)) {
31317
- return;
31318
- }
31319
- const w = parseFloat(imageWidth.value), h = parseFloat(imageHeight.value);
31320
- if (event.target === imageWidth) {
31321
- imageHeight.value = Math.round(w / this.state.ratio).toString();
31322
- }
31323
- else {
31324
- imageWidth.value = Math.round(h * this.state.ratio).toString();
31325
- }
31326
- };
31327
- editor.e.on([imageWidth, imageHeight], 'change keydown mousedown paste', (event) => {
31328
- if (!this.state.sizeIsLocked) {
31329
- return;
31330
- }
31331
- editor.async.setTimeout(changeSizes.bind(this, event), {
31332
- timeout: editor.defaultTimeout,
31333
- label: 'image-properties-changeSize'
31334
- });
31335
- });
31336
- dialog.setFooter([buttons.remove, buttons.check]);
31337
- dialog.setSize(this.j.o.image.dialogWidth);
31338
- }
31339
- /**
31340
- * Set input values from image
31341
- */
31342
- updateValues() {
31343
- const opt = this.j.o;
31344
- const { image } = this.state;
31345
- 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);
31346
- const updateLock = () => {
31347
- lockMargin.checked = this.state.marginIsLocked;
31348
- lockSize.checked = this.state.sizeIsLocked;
31349
- }, updateAlign = () => {
31350
- if (image.style.cssFloat &&
31351
- ['left', 'right'].indexOf(image.style.cssFloat.toLowerCase()) !== -1) {
31352
- align.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'float');
31353
- }
31354
- else {
31355
- if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'display') === 'block' &&
31356
- image.style.marginLeft === 'auto' &&
31357
- image.style.marginRight === 'auto') {
31358
- align.value = 'center';
31359
- }
31360
- }
31361
- }, updateBorderRadius = () => {
31362
- borderRadius.value = (parseInt(image.style.borderRadius || '0', 10) || '0').toString();
31363
- }, updateId = () => {
31364
- id.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'id') || '';
31365
- }, updateStyle = () => {
31366
- style.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'style') || '';
31367
- }, updateClasses = () => {
31368
- classes.value = ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'class') || '').replace(/jodit_focused_image[\s]*/, '');
31369
- }, updateMargins = () => {
31370
- if (!opt.image.editMargins) {
31371
- return;
31372
- }
31373
- let equal = true, wasEmptyField = false;
31374
- [marginTop, marginRight, marginBottom, marginLeft].forEach(elm => {
31375
- const id = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(elm, 'data-ref') || '';
31376
- let value = image.style.getPropertyValue((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.kebabCase)(id));
31377
- if (!value) {
31378
- wasEmptyField = true;
31379
- elm.value = '';
31380
- return;
31381
- }
31382
- if (/^[0-9]+(px)?$/.test(value)) {
31383
- value = parseInt(value, 10);
31384
- }
31385
- elm.value = value.toString() || '';
31386
- if ((wasEmptyField && elm.value) ||
31387
- (equal &&
31388
- id !== 'marginTop' &&
31389
- elm.value !== marginTop.value)) {
31390
- equal = false;
31391
- }
31392
- });
31393
- this.state.marginIsLocked = equal;
31394
- }, updateSizes = () => {
31395
- const width = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'width') ||
31396
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'width', true) ||
31397
- false, height = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'height') ||
31398
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'height', true) ||
31399
- false;
31400
- imageWidth.value =
31401
- width !== false
31402
- ? normalSizeFromString(width).toString()
31403
- : image.offsetWidth.toString();
31404
- imageHeight.value =
31405
- height !== false
31406
- ? normalSizeFromString(height).toString()
31407
- : image.offsetHeight.toString();
31408
- this.state.sizeIsLocked = (() => {
31409
- if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isNumeric)(imageWidth.value) ||
31410
- !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isNumeric)(imageHeight.value)) {
31411
- return false;
31412
- }
31413
- const w = parseFloat(imageWidth.value), h = parseFloat(imageHeight.value);
31414
- return Math.abs(w - h * this.state.ratio) < 1;
31415
- })();
31416
- }, updateText = () => {
31417
- imageTitle.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'title') || '';
31418
- imageAlt.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'alt') || '';
31419
- const a = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(image, 'a', this.j.editor);
31420
- if (a) {
31421
- imageLink.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(a, 'href') || '';
31422
- imageLinkOpenInNewTab.checked =
31423
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(a, 'target') === '_blank';
31424
- }
31425
- else {
31426
- imageLink.value = '';
31427
- imageLinkOpenInNewTab.checked = false;
31428
- }
31429
- }, updateSrc = () => {
31430
- imageSrc.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'src') || '';
31431
- if (imageViewSrc) {
31432
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(imageViewSrc, 'src', (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'src') || '');
31433
- }
31434
- };
31435
- updateLock();
31436
- updateSrc();
31437
- updateText();
31438
- updateSizes();
31439
- updateMargins();
31440
- updateClasses();
31441
- updateId();
31442
- updateBorderRadius();
31443
- updateAlign();
31444
- updateStyle();
31445
- }
31446
- /**
31447
- * Apply form's values to image
31448
- */
31449
- onApply() {
31450
- 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);
31451
- const opt = this.j.o;
31452
- const { image } = this.state;
31453
- // styles
31454
- if (opt.image.editStyle) {
31455
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'style', style.value || null);
31456
- }
31457
- // Src
31458
- if (imageSrc.value) {
31459
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'src', imageSrc.value);
31460
- }
31461
- else {
31462
- jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove(image);
31463
- this.dialog.close();
31464
- return;
31465
- }
31466
- // Border radius
31467
- if (borderRadius.value !== '0' && /^[0-9]+$/.test(borderRadius.value)) {
31468
- image.style.borderRadius = borderRadius.value + 'px';
31469
- }
31470
- else {
31471
- image.style.borderRadius = '';
31472
- }
31473
- // Title
31474
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'title', imageTitle.value || null);
31475
- // Alt
31476
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'alt', imageAlt.value || null);
31477
- // Link
31478
- let link = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(image, 'a', this.j.editor);
31479
- if (imageLink.value) {
31480
- if (!link) {
31481
- link = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.wrap(image, 'a', this.j.createInside);
31482
- }
31483
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(link, 'href', imageLink.value);
31484
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(link, 'target', imageLinkOpenInNewTab.checked ? '_blank' : null);
31485
- }
31486
- else {
31487
- if (link && link.parentNode) {
31488
- link.parentNode.replaceChild(image, link);
31489
- }
31490
- }
31491
- // Size
31492
- if (imageWidth.value !== image.offsetWidth.toString() ||
31493
- imageHeight.value !== image.offsetHeight.toString()) {
31494
- const updatedtWidth = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.trim)(imageWidth.value)
31495
- ? normalSizeToString(imageWidth.value)
31496
- : null;
31497
- const updatedHeight = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.trim)(imageHeight.value)
31498
- ? normalSizeToString(imageHeight.value)
31499
- : null;
31500
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, {
31501
- width: updatedtWidth,
31502
- height: updatedHeight
31503
- });
31504
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'width', (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'width') ? updatedtWidth : null);
31505
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'height', (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'height') ? updatedHeight : null);
31506
- }
31507
- const margins = [marginTop, marginRight, marginBottom, marginLeft];
31508
- if (opt.image.editMargins) {
31509
- if (!this.state.marginIsLocked) {
31510
- margins.forEach((margin) => {
31511
- const side = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(margin, 'data-ref') || '';
31512
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, side, normalSizeToString(margin.value));
31513
- });
31514
- }
31515
- else {
31516
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'margin', normalSizeToString(marginTop.value));
31517
- }
31518
- }
31519
- if (opt.image.editClass) {
31520
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'class', classes.value || null);
31521
- }
31522
- if (opt.image.editId) {
31523
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'id', id.value || null);
31524
- }
31525
- if (opt.image.editAlign) {
31526
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.hAlignElement)(image, align.value);
31527
- }
31528
- this.j.synchronizeValues();
31529
- this.dialog.close();
31530
- }
31531
- /**
31532
- * Open image editor dialog
31533
- */
31534
- openImageEditor() {
31535
- const url = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src') || '', a = this.j.c.element('a'), loadExternal = () => {
31536
- if (a.host !== location.host) {
31537
- this.j.confirm('You can only edit your own images. Download this image on the host?', yes => {
31538
- if (yes && this.j.uploader) {
31539
- this.j.uploader.uploadRemoteImage(a.href.toString(), resp => {
31540
- this.j.alert('The image has been successfully uploaded to the host!', () => {
31541
- if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isString)(resp.newfilename)) {
31542
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src', resp.baseurl +
31543
- resp.newfilename);
31544
- this.updateValues();
31545
- }
31546
- });
31547
- }, error => {
31548
- this.j.alert('There was an error loading %s', error.message);
31549
- });
31550
- }
31551
- });
31552
- return;
31334
+ this.async
31335
+ .promise((resolve, reject) => (0,_readers__WEBPACK_IMPORTED_MODULE_10__/* .readValuesFromImage */ .U)(this.j, this.state).then(resolve, reject))
31336
+ .catch((e) => {
31337
+ if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.isAbortError)(e)) {
31338
+ this.dialog.message.error(e.message);
31553
31339
  }
31554
- };
31555
- a.href = url;
31556
- this.j.filebrowser.dataProvider
31557
- .getPathByUrl(a.href.toString())
31558
- .then(resp => {
31559
- jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_5__/* .openImageEditor */ .B.call(this.j.filebrowser, a.href, resp.name, resp.path, resp.source, () => {
31560
- const timestamp = new Date().getTime();
31561
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src', url +
31562
- (url.indexOf('?') !== -1 ? '' : '?') +
31563
- '&_tmp=' +
31564
- timestamp.toString());
31565
- this.updateValues();
31566
- }, error => {
31567
- this.j.alert(error.message);
31568
- });
31569
31340
  })
31570
- .catch(error => {
31571
- this.j.alert(error.message, loadExternal);
31572
- });
31341
+ .finally(() => this.__unlock());
31342
+ return false;
31573
31343
  }
31574
- /**
31575
- * Open popup with filebrowser/uploader buttons for image
31576
- */
31577
- openImagePopup(event) {
31578
- const popup = new jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Popup(this.j), { changeImage } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
31579
- popup.setZIndex(this.dialog.getZIndex() + 1);
31580
- popup
31581
- .setContent((0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_6__/* .FileSelectorWidget */ .kG)(this.j, {
31582
- upload: (data) => {
31583
- if (data.files && data.files.length) {
31584
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src', data.baseurl + data.files[0]);
31585
- }
31586
- this.updateValues();
31587
- popup.close();
31588
- },
31589
- filebrowser: (data) => {
31590
- if (data &&
31591
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isArray)(data.files) &&
31592
- data.files.length) {
31593
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src', data.files[0]);
31594
- popup.close();
31595
- this.updateValues();
31596
- }
31597
- }
31598
- }, this.state.image, popup.close))
31599
- .open(() => (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.position)(changeImage));
31600
- event.stopPropagation();
31344
+ __lock() {
31345
+ this.dialog.lock();
31346
+ this.form.setMod('lock', true);
31347
+ Object.values(this.__buttons).forEach(b => (b.state.disabled = true));
31348
+ }
31349
+ __unlock() {
31350
+ this.dialog.unlock();
31351
+ this.form.setMod('lock', false);
31352
+ Object.values(this.__buttons).forEach(b => (b.state.disabled = false));
31601
31353
  }
31602
31354
  /** @override **/
31603
31355
  afterInit(editor) {
@@ -31608,7 +31360,7 @@ class imageProperties extends jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin
31608
31360
  .off(editor.editor, '.imageproperties')
31609
31361
  .on(editor.editor, 'dblclick.imageproperties', (e) => {
31610
31362
  const image = e.target;
31611
- if (!jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(image, 'img')) {
31363
+ if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isTag(image, 'img')) {
31612
31364
  return;
31613
31365
  }
31614
31366
  if (editor.o.image.openOnDblClick) {
@@ -31616,7 +31368,8 @@ class imageProperties extends jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin
31616
31368
  false) {
31617
31369
  return;
31618
31370
  }
31619
- self.state.image = image;
31371
+ self.state.sourceImage = image;
31372
+ self.state.image = image.cloneNode(true);
31620
31373
  if (!editor.o.readonly) {
31621
31374
  e.stopImmediatePropagation();
31622
31375
  e.preventDefault();
@@ -31630,206 +31383,1253 @@ class imageProperties extends jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin
31630
31383
  });
31631
31384
  })
31632
31385
  .on('openImageProperties.imageproperties', (image) => {
31633
- this.state.image = image;
31386
+ self.state.sourceImage = image;
31387
+ this.state.image = image.cloneNode(true);
31634
31388
  this.open();
31635
31389
  });
31636
31390
  }
31391
+ async onStateValuesImageSrcChange() {
31392
+ const { image, values } = this.state;
31393
+ if (!image.src) {
31394
+ return;
31395
+ }
31396
+ try {
31397
+ this.__lock();
31398
+ await image.decode();
31399
+ if (this.state.sizeIsLocked && (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.isNumeric)(values.imageWidth)) {
31400
+ const w = parseFloat(values.imageWidth.toString());
31401
+ values.imageHeight = Math.round(w / this.state.ratio);
31402
+ }
31403
+ this.j.e.fire('updateImageProperties.imageproperties', image);
31404
+ }
31405
+ catch (e) {
31406
+ this.j.alert(e.message);
31407
+ }
31408
+ finally {
31409
+ this.__unlock();
31410
+ }
31411
+ }
31637
31412
  /** @override */
31638
31413
  beforeDestruct(editor) {
31639
- this.dialog && this.dialog.destruct();
31414
+ var _a, _b, _c;
31415
+ Object.values((_a = (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cached)(this, '__buttons')) !== null && _a !== void 0 ? _a : {}).forEach(b => b.destruct());
31416
+ (_b = (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cached)(this, 'dialog')) === null || _b === void 0 ? void 0 : _b.destruct();
31417
+ (_c = (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cached)(this, 'form')) === null || _c === void 0 ? void 0 : _c.destruct();
31640
31418
  editor.e.off(editor.editor, '.imageproperties').off('.imageproperties');
31641
31419
  }
31642
31420
  }
31643
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
31644
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.marginIsLocked')
31645
- ], imageProperties.prototype, "onChangeMarginIsLocked", null);
31646
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
31647
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.sizeIsLocked')
31648
- ], imageProperties.prototype, "onChangeSizeIsLocked", null);
31649
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
31650
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.autobind
31651
- ], imageProperties.prototype, "onApply", null);
31652
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
31653
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.autobind
31654
- ], imageProperties.prototype, "openImageEditor", null);
31655
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
31656
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.autobind
31657
- ], imageProperties.prototype, "openImagePopup", null);
31658
- jodit_core_global__WEBPACK_IMPORTED_MODULE_1__/* .pluginSystem */ .fg.add('imageProperties', imageProperties);
31421
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
31422
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cache
31423
+ ], imageProperties.prototype, "form", null);
31424
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
31425
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cache
31426
+ ], imageProperties.prototype, "dialog", null);
31427
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
31428
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cache
31429
+ ], imageProperties.prototype, "__buttons", null);
31430
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
31431
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.image')
31432
+ ], imageProperties.prototype, "onStateValuesImageSrcChange", null);
31433
+ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .pluginSystem */ .fg.add('imageProperties', imageProperties);
31659
31434
 
31660
31435
 
31661
31436
  /***/ }),
31662
31437
 
31663
- /***/ 22254:
31438
+ /***/ 74260:
31664
31439
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31665
31440
 
31666
31441
  "use strict";
31667
31442
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31668
- /* harmony export */ Z: function() { return /* binding */ form; }
31443
+ /* harmony export */ g: function() { return /* binding */ readAlign; }
31669
31444
  /* harmony export */ });
31670
- /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(931);
31445
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(38322);
31446
+ /*!
31447
+ * Jodit Editor (https://xdsoft.net/jodit/)
31448
+ * Released under MIT see LICENSE.txt in the project root for license information.
31449
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31450
+ */
31451
+
31452
+ /** @private */
31453
+ function readAlign(image, values) {
31454
+ // Align
31455
+ if (image.style.cssFloat &&
31456
+ ['left', 'right'].indexOf(image.style.cssFloat.toLowerCase()) !== -1) {
31457
+ values.align = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_0__/* .css */ .A)(image, 'float');
31458
+ }
31459
+ else {
31460
+ if ((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_0__/* .css */ .A)(image, 'display') === 'block' &&
31461
+ image.style.marginLeft === 'auto' &&
31462
+ image.style.marginRight === 'auto') {
31463
+ values.align = 'center';
31464
+ }
31465
+ else {
31466
+ values.align = '';
31467
+ }
31468
+ }
31469
+ }
31470
+
31471
+
31472
+ /***/ }),
31473
+
31474
+ /***/ 5549:
31475
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31476
+
31477
+ "use strict";
31478
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31479
+ /* harmony export */ U: function() { return /* binding */ readValuesFromImage; }
31480
+ /* harmony export */ });
31481
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26150);
31482
+ /* harmony import */ var _align__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(74260);
31483
+ /* harmony import */ var _link__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(33201);
31484
+ /* harmony import */ var _margin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(85079);
31485
+ /* harmony import */ var _size__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(17880);
31486
+ /*!
31487
+ * Jodit Editor (https://xdsoft.net/jodit/)
31488
+ * Released under MIT see LICENSE.txt in the project root for license information.
31489
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31490
+ */
31491
+
31492
+
31493
+
31494
+
31495
+
31496
+ /**
31497
+ * Read values from image and set it to state
31498
+ * @private
31499
+ */
31500
+ async function readValuesFromImage(j, state) {
31501
+ const { sourceImage: image, values } = state;
31502
+ (0,_align__WEBPACK_IMPORTED_MODULE_3__/* .readAlign */ .g)(image, values);
31503
+ // Border radius
31504
+ values.borderRadius = parseInt(image.style.borderRadius || '0', 10) || 0;
31505
+ // Id
31506
+ values.id = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'id') || '';
31507
+ // Title
31508
+ values.imageTitle = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'title') || '';
31509
+ // Alt
31510
+ values.imageAlt = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'alt') || '';
31511
+ // Style
31512
+ values.style = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'style') || '';
31513
+ // Classes
31514
+ values.classes = ((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'class') || '').replace(/jodit_focused_image[\s]*/, '');
31515
+ // Margins
31516
+ (0,_margin__WEBPACK_IMPORTED_MODULE_4__/* .readMargins */ .E)(image, values, state);
31517
+ // Link
31518
+ (0,_link__WEBPACK_IMPORTED_MODULE_1__/* .readLink */ .X)(state, j, values);
31519
+ // Src
31520
+ values.imageSrc = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'src') || '';
31521
+ // Image size
31522
+ return (0,_size__WEBPACK_IMPORTED_MODULE_2__/* .readSizes */ .P)(image, values, state);
31523
+ }
31524
+
31525
+
31526
+ /***/ }),
31527
+
31528
+ /***/ 33201:
31529
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31530
+
31531
+ "use strict";
31532
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31533
+ /* harmony export */ X: function() { return /* binding */ readLink; }
31534
+ /* harmony export */ });
31535
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55186);
31536
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26150);
31537
+ /*!
31538
+ * Jodit Editor (https://xdsoft.net/jodit/)
31539
+ * Released under MIT see LICENSE.txt in the project root for license information.
31540
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31541
+ */
31542
+
31543
+
31544
+ /** @private */
31545
+ function readLink(state, j, values) {
31546
+ const a = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.closest(state.sourceImage, 'a', j.editor);
31547
+ if (a) {
31548
+ values.imageLink = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(a, 'href') || '';
31549
+ values.imageLinkOpenInNewTab = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(a, 'target') === '_blank';
31550
+ }
31551
+ else {
31552
+ values.imageLink = '';
31553
+ values.imageLinkOpenInNewTab = false;
31554
+ }
31555
+ }
31556
+
31557
+
31558
+ /***/ }),
31559
+
31560
+ /***/ 85079:
31561
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31562
+
31563
+ "use strict";
31564
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31565
+ /* harmony export */ E: function() { return /* binding */ readMargins; }
31566
+ /* harmony export */ });
31567
+ /* harmony import */ var jodit_core_helpers_string_kebab_case__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(449);
31671
31568
  /*!
31672
31569
  * Jodit Editor (https://xdsoft.net/jodit/)
31673
31570
  * Released under MIT see LICENSE.txt in the project root for license information.
31674
31571
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31675
31572
  */
31676
31573
 
31677
- function form(editor) {
31678
- 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);
31679
- return editor.c.fromHTML(`<form class="jodit-properties">
31574
+ /** @private */
31575
+ function readMargins(image, values, state) {
31576
+ // Margins
31577
+ let equal = true, wasEmptyField = false;
31578
+ ['marginTop', 'marginRight', 'marginBottom', 'marginLeft'].forEach(id => {
31579
+ let value = image.style.getPropertyValue((0,jodit_core_helpers_string_kebab_case__WEBPACK_IMPORTED_MODULE_0__/* .kebabCase */ .k)(id));
31580
+ if (!value) {
31581
+ wasEmptyField = true;
31582
+ values[id] = 0;
31583
+ return;
31584
+ }
31585
+ if (/^[0-9]+(px)?$/.test(value)) {
31586
+ value = parseInt(value, 10);
31587
+ }
31588
+ values[id] = value;
31589
+ if ((wasEmptyField && values[id]) ||
31590
+ (equal && id !== 'marginTop' && values[id] !== values.marginTop)) {
31591
+ equal = false;
31592
+ }
31593
+ });
31594
+ state.marginIsLocked = equal;
31595
+ }
31596
+
31597
+
31598
+ /***/ }),
31599
+
31600
+ /***/ 17880:
31601
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31602
+
31603
+ "use strict";
31604
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31605
+ /* harmony export */ P: function() { return /* binding */ readSizes; }
31606
+ /* harmony export */ });
31607
+ /* harmony import */ var jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(12461);
31608
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26150);
31609
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(38322);
31610
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9645);
31611
+ /*!
31612
+ * Jodit Editor (https://xdsoft.net/jodit/)
31613
+ * Released under MIT see LICENSE.txt in the project root for license information.
31614
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31615
+ */
31616
+
31617
+
31618
+
31619
+
31620
+ /** @private */
31621
+ async function readSizes(image, values, state) {
31622
+ await image.decode();
31623
+ const width = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'width') || (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__/* .css */ .A)(image, 'width', true) || false;
31624
+ const height = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'height') || (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__/* .css */ .A)(image, 'height', true) || false;
31625
+ values.imageWidth =
31626
+ width !== false
31627
+ ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeFromString */ .G)(width)
31628
+ : image.offsetWidth || image.naturalWidth;
31629
+ values.imageHeight =
31630
+ height !== false
31631
+ ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeFromString */ .G)(height)
31632
+ : image.offsetHeight || image.naturalHeight;
31633
+ const { imageWidth, imageHeight } = values;
31634
+ const w = parseFloat(imageWidth.toString());
31635
+ if (!(0,jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_3__/* .isNumeric */ .k)(imageWidth) || !(0,jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_3__/* .isNumeric */ .k)(imageHeight)) {
31636
+ state.sizeIsLocked = false;
31637
+ return;
31638
+ }
31639
+ if (height === false) {
31640
+ values.imageHeight = Math.round(w / state.ratio);
31641
+ state.sizeIsLocked = true;
31642
+ return;
31643
+ }
31644
+ const h = parseFloat(imageHeight.toString());
31645
+ state.sizeIsLocked = Math.abs(w - h * state.ratio) < 1;
31646
+ }
31647
+
31648
+
31649
+ /***/ }),
31650
+
31651
+ /***/ 31970:
31652
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31653
+
31654
+ "use strict";
31655
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31656
+ /* harmony export */ l: function() { return /* binding */ UIImagePropertiesForm; }
31657
+ /* harmony export */ });
31658
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(31635);
31659
+ /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22664);
31660
+ /* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(24767);
31661
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(65147);
31662
+ /* harmony import */ var jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6455);
31663
+ /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(931);
31664
+ /* harmony import */ var jodit_modules_widget__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(16116);
31665
+ /* harmony import */ var _ui_image_main_tab__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(33403);
31666
+ /* harmony import */ var _ui_image_position_tab__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(46681);
31667
+ /*!
31668
+ * Jodit Editor (https://xdsoft.net/jodit/)
31669
+ * Released under MIT see LICENSE.txt in the project root for license information.
31670
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31671
+ */
31672
+
31673
+
31674
+
31675
+
31676
+
31677
+
31678
+
31679
+
31680
+
31681
+
31682
+ /** @private */
31683
+ let UIImagePropertiesForm = class UIImagePropertiesForm extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_2__/* .UIGroup */ .U {
31684
+ className() {
31685
+ return 'UIImagePropertiesForm';
31686
+ }
31687
+ appendChildToContainer() { }
31688
+ getElm(elementName) {
31689
+ const selfElm = super.getElm(elementName);
31690
+ if (selfElm) {
31691
+ return selfElm;
31692
+ }
31693
+ for (const child of this.elements) {
31694
+ const elm = child.getElm(elementName);
31695
+ if (elm) {
31696
+ return elm;
31697
+ }
31698
+ }
31699
+ return null;
31700
+ }
31701
+ constructor(jodit, state, activeTabState, handlers) {
31702
+ super(jodit);
31703
+ this.state = state;
31704
+ this.handlers = handlers;
31705
+ this.__mainTab = new _ui_image_main_tab__WEBPACK_IMPORTED_MODULE_5__/* .UIImageMainTab */ .k(this.jodit, this.state, this.handlers);
31706
+ this.__positionTab = new _ui_image_position_tab__WEBPACK_IMPORTED_MODULE_6__/* .UIImagePositionTab */ ._(this.jodit, this.state, this.handlers);
31707
+ this.getElm('tabsBox').appendChild((0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_4__/* .TabsWidget */ .Zg)(jodit, [
31708
+ { name: 'Image', content: this.__mainTab },
31709
+ { name: 'Advanced', content: this.__positionTab }
31710
+ ], activeTabState));
31711
+ this.setMod('lock-size', this.state.sizeIsLocked);
31712
+ this.append(this.__mainTab).append(this.__positionTab);
31713
+ }
31714
+ render() {
31715
+ return `<form>
31680
31716
  <div class="jodit-grid jodit-grid_xs-column">
31681
31717
  <div class="jodit_col-lg-2-5 jodit_col-xs-5-5">
31682
- <div class="jodit-properties_view_box">
31683
- <div style="${!showPreview ? 'display:none' : ''}" class="jodit-properties_image_view">
31684
- <img data-ref="imageViewSrc" src="" alt=""/>
31718
+ <div class="&__view-box">
31719
+ <div class="&__imageView">
31720
+ <img class="&__imageViewSrc" src="" alt=""/>
31685
31721
  </div>
31686
- <div style="${!editSize ? 'display:none' : ''}" class="jodit-form__group jodit-properties_image_sizes">
31687
- <input data-ref="imageWidth" type="text" class="jodit-input"/>
31688
- <a data-ref="lockSize" class="jodit-properties__lock">${gi('lock')}</a>
31689
- <input data-ref="imageHeight" type="text" class="imageHeight jodit-input"/>
31722
+ <div class="jodit-form__group &__imageSizes">
31723
+ <input type="text" class="jodit-input &__imageWidth"/>
31724
+ <a class="&__lockSize">${jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__/* .Icon */ .I.get('lock')}</a>
31725
+ <input type="text" class="&__imageHeight jodit-input"/>
31690
31726
  </div>
31691
31727
  </div>
31692
31728
  </div>
31693
- <div data-ref="tabsBox" class="jodit_col-lg-3-5 jodit_col-xs-5-5"></div>
31729
+ <div class="jodit_col-lg-3-5 jodit_col-xs-5-5 &__tabsBox"></div>
31694
31730
  </div>
31695
- </form>`);
31696
- }
31731
+ </form>`;
31732
+ }
31733
+ onChangeSizeIsLocked() {
31734
+ const lockSize = this.getElm('lockSize');
31735
+ const imageWidth = this.getElm('imageWidth');
31736
+ lockSize.innerHTML = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__/* .Icon */ .I.get(this.state.sizeIsLocked ? 'lock' : 'unlock');
31737
+ this.setMod('lock-size', this.state.sizeIsLocked);
31738
+ this.j.e.fire(imageWidth, 'change');
31739
+ }
31740
+ onLockSizeClick() {
31741
+ this.state.sizeIsLocked = !this.state.sizeIsLocked;
31742
+ }
31743
+ onStateValuesSizeChange() {
31744
+ const imageWidth = this.getElm('imageWidth');
31745
+ const imageHeight = this.getElm('imageHeight');
31746
+ if (imageWidth !== this.j.od.activeElement) {
31747
+ imageWidth.value = this.state.values.imageWidth.toString();
31748
+ }
31749
+ if (imageHeight !== this.j.od.activeElement) {
31750
+ imageHeight.value = this.state.values.imageHeight.toString();
31751
+ }
31752
+ }
31753
+ onImageWidthChange(e) {
31754
+ const imageWidth = this.getElm('imageWidth');
31755
+ const imageHeight = this.getElm('imageHeight');
31756
+ if (!this.state.sizeIsLocked ||
31757
+ !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.isNumeric)(imageWidth.value) ||
31758
+ !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.isNumeric)(imageHeight.value)) {
31759
+ this.state.values.imageWidth = imageWidth.value;
31760
+ this.state.values.imageHeight = imageHeight.value;
31761
+ return;
31762
+ }
31763
+ const w = parseFloat(imageWidth.value), h = parseFloat(imageHeight.value);
31764
+ if (e.target === imageWidth) {
31765
+ this.state.values.imageWidth = w;
31766
+ this.state.values.imageHeight = Math.round(w / this.state.ratio);
31767
+ }
31768
+ else {
31769
+ this.state.values.imageWidth = Math.round(h * this.state.ratio);
31770
+ this.state.values.imageHeight = h;
31771
+ }
31772
+ }
31773
+ onStateValuesImageSrcChange() {
31774
+ const { imageSrc } = this.state.values;
31775
+ if (!imageSrc) {
31776
+ return;
31777
+ }
31778
+ const imageViewSrc = this.getElm('imageViewSrc');
31779
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.attr)(imageViewSrc, 'src', imageSrc);
31780
+ const image = new Image();
31781
+ image.src = imageSrc;
31782
+ this.state.image = image;
31783
+ }
31784
+ hideFieldByOptions() {
31785
+ const opt = this.j.o.image;
31786
+ [
31787
+ ['editSize', 'imageSizes'],
31788
+ ['showPreview', 'imageView']
31789
+ ].forEach(([optKey, elmKey]) => {
31790
+ const elm = this.getElm(elmKey);
31791
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.css)(elm, 'display', opt[optKey] ? null : 'none');
31792
+ });
31793
+ }
31794
+ };
31795
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31796
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready'),
31797
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.sizeIsLocked')
31798
+ ], UIImagePropertiesForm.prototype, "onChangeSizeIsLocked", null);
31799
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31800
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('lockSize:click')
31801
+ ], UIImagePropertiesForm.prototype, "onLockSizeClick", null);
31802
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31803
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready'),
31804
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)(['state.values.imageWidth', 'state.values.imageHeight'])
31805
+ ], UIImagePropertiesForm.prototype, "onStateValuesSizeChange", null);
31806
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31807
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([
31808
+ 'imageWidth:change',
31809
+ 'imageHeight:change',
31810
+ 'imageWidth:keydown',
31811
+ 'imageHeight:keydown',
31812
+ 'imageWidth:mousedown',
31813
+ 'imageHeight:mousedown',
31814
+ 'imageWidth:paste',
31815
+ 'imageHeight:paste'
31816
+ ]),
31817
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.debounce)()
31818
+ ], UIImagePropertiesForm.prototype, "onImageWidthChange", null);
31819
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31820
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready'),
31821
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.values.imageSrc')
31822
+ ], UIImagePropertiesForm.prototype, "onStateValuesImageSrcChange", null);
31823
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31824
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready')
31825
+ ], UIImagePropertiesForm.prototype, "hideFieldByOptions", null);
31826
+ UIImagePropertiesForm = (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31827
+ jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_8__/* .component */ .s
31828
+ ], UIImagePropertiesForm);
31829
+
31697
31830
 
31698
31831
 
31699
31832
  /***/ }),
31700
31833
 
31701
- /***/ 75263:
31834
+ /***/ 33403:
31702
31835
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31703
31836
 
31704
31837
  "use strict";
31705
31838
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31706
- /* harmony export */ J: function() { return /* binding */ mainTab; }
31839
+ /* harmony export */ k: function() { return /* binding */ UIImageMainTab; }
31707
31840
  /* harmony export */ });
31708
- /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(931);
31841
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(31635);
31842
+ /* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(24767);
31843
+ /* harmony import */ var jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71151);
31844
+ /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(66927);
31845
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65147);
31846
+ /* harmony import */ var jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6455);
31709
31847
  /*!
31710
31848
  * Jodit Editor (https://xdsoft.net/jodit/)
31711
31849
  * Released under MIT see LICENSE.txt in the project root for license information.
31712
31850
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31713
31851
  */
31714
31852
 
31715
- function mainTab(editor) {
31716
- 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;
31717
- return editor.c.fromHTML(`<div style="${!opt.image.editSrc ? 'display:none' : ''}" class="jodit-form__group">
31718
- <label>${i18n('Src')}</label>
31853
+
31854
+
31855
+
31856
+
31857
+
31858
+ /** @private */
31859
+ let UIImageMainTab = class UIImageMainTab extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_3__/* .UIGroup */ .U {
31860
+ className() {
31861
+ return 'UIImageMainTab';
31862
+ }
31863
+ appendChildToContainer() {
31864
+ // Do nothing
31865
+ }
31866
+ constructor(view, state, handlers) {
31867
+ super(view);
31868
+ this.state = state;
31869
+ this.handlers = handlers;
31870
+ }
31871
+ render() {
31872
+ return `<div class="jodit-form__group &__editSrc">
31873
+ <label>~Src~</label>
31719
31874
  <div class="jodit-input_group">
31720
- <input data-ref="imageSrc" class="jodit-input" type="text"/>
31721
- <div
31722
- class="jodit-input_group-buttons"
31723
- style="${hasFbUrl ? '' : 'display: none'}"
31724
- >
31725
- <a
31726
- data-ref="changeImage"
31727
- class="jodit-button"
31728
- >${gi('image')}</a>
31729
- <a
31730
- data-ref="editImage"
31731
- class="jodit-button"
31732
- style="${hasEditor ? '' : 'display: none'}"
31733
- >${gi('crop')}</a>
31875
+ <input class="jodit-input &__imageSrc" type="text"/>
31876
+ <div class="jodit-input_group-buttons &__fixImage">
31877
+ <a class="jodit-button &__changeImage">*image*</a>
31878
+ <a class="jodit-button &__editImage">*crop*</a>
31734
31879
  </div>
31735
31880
  </div>
31736
31881
  </div>
31737
- <div style="${!opt.image.editTitle ? 'display:none' : ''}" class="jodit-form__group">
31738
- <label>${i18n('Title')}</label>
31739
- <input data-ref="imageTitle" type="text" class="jodit-input"/>
31882
+ <div class="jodit-form__group &__editTitle">
31883
+ <label>~Title~</label>
31884
+ <input type="text" class="jodit-input &__imageTitle"/>
31740
31885
  </div>
31741
- <div style="${!opt.image.editAlt ? 'display:none' : ''}" class="jodit-form__group">
31742
- <label>${i18n('Alternative')}</label>
31743
- <input data-ref="imageAlt" type="text" class="jodit-input"/>
31886
+ <div class="jodit-form__group &__editAlt">
31887
+ <label>~Alternative~</label>
31888
+ <input type="text" class="jodit-input &__imageAlt"/>
31744
31889
  </div>
31745
- <div style="${!opt.image.editLink ? 'display:none' : ''}" class="jodit-form__group">
31746
- <label>${i18n('Link')}</label>
31747
- <input data-ref="imageLink" type="text" class="jodit-input"/>
31890
+ <div class="jodit-form__group &__editLink">
31891
+ <label>~Link~</label>
31892
+ <input type="text" class="jodit-input &__imageLink"/>
31748
31893
  </div>
31749
- <div style="${!opt.image.editLink ? 'display:none' : ''}" class="jodit-form__group">
31894
+ <div class="jodit-form__group &__editLinkTarget">
31750
31895
  <label class="jodit_vertical_middle">
31751
- <input data-ref="imageLinkOpenInNewTab" type="checkbox" class="jodit-checkbox"/>
31752
- <span>${i18n('Open link in new tab')}</span>
31896
+ <input type="checkbox" class="jodit-checkbox &__imageLinkOpenInNewTab"/>
31897
+ <span>~Open link in new tab~</span>
31753
31898
  </label>
31754
- </div>`);
31755
- }
31899
+ </div>`;
31900
+ }
31901
+ async onStateImageSrcChange() {
31902
+ const imageSrc = this.getElm('imageSrc');
31903
+ imageSrc.value = this.state.values.imageSrc;
31904
+ }
31905
+ onImageSrcChange() {
31906
+ this.state.values.imageSrc = this.getElm('imageSrc').value;
31907
+ }
31908
+ /**
31909
+ * Open image editor
31910
+ */
31911
+ onEditImageClick(e) {
31912
+ this.handlers.openImageEditor();
31913
+ e.stopPropagation();
31914
+ }
31915
+ /**
31916
+ * Open popup with filebrowser/uploader buttons for image
31917
+ */
31918
+ onChangeImageClick(e) {
31919
+ this.handlers.openImagePopup(this.getElm('changeImage'));
31920
+ e.stopPropagation();
31921
+ }
31922
+ onStateTitleChange() {
31923
+ const title = this.getElm('imageTitle');
31924
+ title.value = this.state.values.imageTitle;
31925
+ }
31926
+ onTitleChange() {
31927
+ this.state.values.imageTitle = this.getElm('imageTitle').value;
31928
+ }
31929
+ onStateAltChange() {
31930
+ const alt = this.getElm('imageAlt');
31931
+ alt.value = this.state.values.imageAlt;
31932
+ }
31933
+ onAltChange() {
31934
+ this.state.values.imageAlt = this.getElm('imageAlt').value;
31935
+ }
31936
+ onStateImageLinkChange() {
31937
+ const imageLink = this.getElm('imageLink');
31938
+ imageLink.value = this.state.values.imageLink;
31939
+ }
31940
+ onImageLinkChange() {
31941
+ this.state.values.imageLink = this.getElm('imageLink').value;
31942
+ }
31943
+ onStateImageLinkOpenInNewTabChange() {
31944
+ const imageLinkOpenInNewTab = this.getElm('imageLinkOpenInNewTab');
31945
+ imageLinkOpenInNewTab.checked = this.state.values.imageLinkOpenInNewTab;
31946
+ }
31947
+ onImageLinkOpenInNewTabChange() {
31948
+ this.state.values.imageLinkOpenInNewTab = this.getElm('imageLinkOpenInNewTab').checked;
31949
+ }
31950
+ hideFieldByOptions() {
31951
+ const o = this.j.o;
31952
+ const opt = o.image;
31953
+ [
31954
+ ['editSrc', 'editSrc'],
31955
+ ['editTitle', 'editTitle'],
31956
+ ['editAlt', 'editAlt'],
31957
+ ['editLink', 'editLink'],
31958
+ ['editLink', 'editLinkTarget'],
31959
+ ['useImageEditor', 'editImage']
31960
+ ].forEach(([optKey, elmKey]) => {
31961
+ const elm = this.getElm(elmKey);
31962
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(elm, 'display', opt[optKey] ? null : 'none');
31963
+ });
31964
+ const changeImage = this.getElm('changeImage');
31965
+ const needShowChangeImage = Boolean(o.filebrowser.ajax.url || o.uploader.url);
31966
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(changeImage, 'display', needShowChangeImage ? null : 'none');
31967
+ const editImage = this.getElm('editImage');
31968
+ const needShowEditImage = Boolean(o.filebrowser.ajax.url) && opt.useImageEditor;
31969
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(editImage, 'display', needShowEditImage ? null : 'none');
31970
+ const fixImage = this.getElm('fixImage');
31971
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(fixImage, 'display', needShowChangeImage || needShowEditImage ? null : 'none');
31972
+ }
31973
+ };
31974
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31975
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageSrc')
31976
+ ], UIImageMainTab.prototype, "onStateImageSrcChange", null);
31977
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31978
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageSrc:change')
31979
+ ], UIImageMainTab.prototype, "onImageSrcChange", null);
31980
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31981
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('editImage:click')
31982
+ ], UIImageMainTab.prototype, "onEditImageClick", null);
31983
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31984
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('changeImage:click')
31985
+ ], UIImageMainTab.prototype, "onChangeImageClick", null);
31986
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31987
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageTitle')
31988
+ ], UIImageMainTab.prototype, "onStateTitleChange", null);
31989
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31990
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageTitle:change')
31991
+ ], UIImageMainTab.prototype, "onTitleChange", null);
31992
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31993
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageAlt')
31994
+ ], UIImageMainTab.prototype, "onStateAltChange", null);
31995
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31996
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageAlt:change')
31997
+ ], UIImageMainTab.prototype, "onAltChange", null);
31998
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31999
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageLink')
32000
+ ], UIImageMainTab.prototype, "onStateImageLinkChange", null);
32001
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32002
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageLink:change')
32003
+ ], UIImageMainTab.prototype, "onImageLinkChange", null);
32004
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32005
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageLinkOpenInNewTab')
32006
+ ], UIImageMainTab.prototype, "onStateImageLinkOpenInNewTabChange", null);
32007
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32008
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageLinkOpenInNewTab:change')
32009
+ ], UIImageMainTab.prototype, "onImageLinkOpenInNewTabChange", null);
32010
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32011
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready')
32012
+ ], UIImageMainTab.prototype, "hideFieldByOptions", null);
32013
+ UIImageMainTab = (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32014
+ jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_5__/* .component */ .s
32015
+ ], UIImageMainTab);
32016
+
31756
32017
 
31757
32018
 
31758
32019
  /***/ }),
31759
32020
 
31760
- /***/ 57837:
32021
+ /***/ 46681:
31761
32022
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31762
32023
 
31763
32024
  "use strict";
31764
32025
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31765
- /* harmony export */ b: function() { return /* binding */ positionTab; }
32026
+ /* harmony export */ _: function() { return /* binding */ UIImagePositionTab; }
31766
32027
  /* harmony export */ });
31767
- /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(931);
32028
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(31635);
32029
+ /* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(24767);
32030
+ /* harmony import */ var jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71151);
32031
+ /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(66927);
32032
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65147);
32033
+ /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(98253);
32034
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(26150);
32035
+ /* harmony import */ var jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29780);
32036
+ /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(931);
32037
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(9645);
31768
32038
  /*!
31769
32039
  * Jodit Editor (https://xdsoft.net/jodit/)
31770
32040
  * Released under MIT see LICENSE.txt in the project root for license information.
31771
32041
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31772
32042
  */
31773
32043
 
31774
- function positionTab(editor) {
31775
- 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);
31776
- const classInput = [];
31777
- if (opt.image.availableClasses.length > 0) {
31778
- classInput.push('<select data-ref="classes" class="jodit-input jodit-select">');
31779
- opt.image.availableClasses.forEach(item => {
31780
- if (typeof item === 'string') {
31781
- classInput.push(`<option value="${item}">${item}</option>`);
31782
- }
31783
- else {
31784
- classInput.push(`<option value="${item[0]}">${item[1]}</option>`);
31785
- }
31786
- });
31787
- classInput.push('</select>');
32044
+
32045
+
32046
+
32047
+
32048
+
32049
+
32050
+
32051
+
32052
+
32053
+ /** @private */
32054
+ let UIImagePositionTab = class UIImagePositionTab extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_4__/* .UIElement */ .D {
32055
+ className() {
32056
+ return 'UIImagePositionTab';
31788
32057
  }
31789
- else {
31790
- classInput.push('<input data-ref="classes" type="text" class="jodit-input"/>');
32058
+ constructor(jodit, state, handlers) {
32059
+ super(jodit, {
32060
+ availableClasses: jodit.o.image.availableClasses
32061
+ });
32062
+ this.state = state;
32063
+ this.handlers = handlers;
31791
32064
  }
31792
- return editor.c.fromHTML(`<div style="${!opt.image.editMargins ? 'display:none' : ''}" class="jodit-form__group">
31793
- <label>${i18n('Margins')}</label>
32065
+ render({ availableClasses }) {
32066
+ return `<div class="jodit-form__group &__editMargins">
32067
+ <label>~Margins~</label>
31794
32068
  <div class="jodit-grid jodit_vertical_middle">
31795
- <input class="jodit_col-lg-1-5 jodit-input" data-ref="marginTop" type="text" placeholder="${i18n('top')}"/>
31796
- <a style="text-align: center;" data-ref="lockMargin" class="jodit-properties__lock jodit_col-lg-1-5">${gi('lock')}</a>
31797
- <input disabled="true" class="jodit_col-lg-1-5 jodit-input" data-ref="marginRight" type="text" placeholder="${i18n('right')}"/>
31798
- <input disabled="true" class="jodit_col-lg-1-5 jodit-input" data-ref="marginBottom" type="text" placeholder="${i18n('bottom')}"/>
31799
- <input disabled="true" class="jodit_col-lg-1-5 jodit-input" data-ref="marginLeft" type="text" placeholder="${i18n('left')}"/>
32069
+ <input class="jodit_col-lg-1-5 jodit-input &__marginTop" type="text" placeholder="~top~"/>
32070
+ <a style="text-align: center;" class="jodit-properties__lock jodit_col-lg-1-5 &__lockMargin">*lock*</a>
32071
+ <input disabled="disabled" class="jodit_col-lg-1-5 jodit-input &__marginRight" type="text" placeholder="~right~"/>
32072
+ <input disabled="disabled" class="jodit_col-lg-1-5 jodit-input &__marginBottom" type="text" placeholder="~bottom~"/>
32073
+ <input disabled="disabled" class="jodit_col-lg-1-5 jodit-input &__marginLeft" type="text" placeholder="~left~"/>
31800
32074
  </div>
31801
32075
  </div>
31802
- <div
31803
- style="${!opt.image.editAlign ? 'display:none' : ''}"
31804
- class="jodit-form__group"
31805
- >
31806
- <label>${i18n('Align')}</label>
31807
- <select data-ref="align" class="jodit-select">
31808
- <option value="">${i18n('--Not Set--')}</option>
31809
- <option value="left">${i18n('Left')}</option>
31810
- <option value="center">${i18n('Center')}</option>
31811
- <option value="right">${i18n('Right')}</option>
32076
+ <div class="jodit-form__group &__editAlign">
32077
+ <label>~Align~</label>
32078
+ <select class="jodit-select &__align">
32079
+ <option value="">~--Not Set--~</option>
32080
+ <option value="left">~Left~</option>
32081
+ <option value="center">~Center~</option>
32082
+ <option value="right">~Right~</option>
31812
32083
  </select>
31813
32084
  </div>
31814
- <div style="${!opt.image.editStyle ? 'display:none' : ''}" class="jodit-form__group">
31815
- <label>${i18n('Styles')}</label>
31816
- <input data-ref="style" type="text" class="jodit-input"/>
32085
+ <div class="jodit-form__group &__editStyle">
32086
+ <label>~Styles~</label>
32087
+ <input type="text" class="jodit-input &__style"/>
31817
32088
  </div>
31818
- <div style="${!opt.image.editClass ? 'display:none' : ''}" class="jodit-form__group">
31819
- <label>${i18n('Classes')}</label>
31820
- ${classInput.join('')}
32089
+ <div class="jodit-form__group &__editClass">
32090
+ <label>~Classes~</label>
32091
+ ${(() => {
32092
+ const classInput = [];
32093
+ if (availableClasses && availableClasses.length > 0) {
32094
+ classInput.push('<select class="jodit-input jodit-select &__classes">');
32095
+ availableClasses.forEach(item => {
32096
+ if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_7__/* .isString */ .K)(item)) {
32097
+ classInput.push(`<option value="${item}">${item}</option>`);
32098
+ }
32099
+ else {
32100
+ classInput.push(`<option value="${item[0]}">${item[1]}</option>`);
32101
+ }
32102
+ });
32103
+ classInput.push('</select>');
32104
+ }
32105
+ else {
32106
+ classInput.push('<input type="text" class="jodit-input &__classes"/>');
32107
+ }
32108
+ return classInput.join('');
32109
+ })()}
31821
32110
  </div>
31822
- <div style="${!opt.image.editId ? 'display:none' : ''}" class="jodit-form__group">
32111
+ <div class="jodit-form__group &__editId">
31823
32112
  <label>Id</label>
31824
- <input data-ref="id" type="text" class="jodit-input"/>
32113
+ <input type="text" class="jodit-input &__id"/>
31825
32114
  </div>
31826
32115
  <div
31827
- style="${!opt.image.editBorderRadius ? 'display:none' : ''}"
31828
- class="jodit-form__group"
32116
+ class="jodit-form__group &__editBorderRadius"
31829
32117
  >
31830
- <label>${i18n('Border radius')}</label>
31831
- <input data-ref="borderRadius" type="number" class="jodit-input"/>
31832
- </div>`);
32118
+ <label>~Border radius~</label>
32119
+ <input type="number" class="jodit-input &__borderRadius"/>
32120
+ </div>`;
32121
+ }
32122
+ onStateAlignChange() {
32123
+ const align = this.getElm('align');
32124
+ align.value = this.state.values.align;
32125
+ }
32126
+ onChangeAlign() {
32127
+ const align = this.getElm('align');
32128
+ this.state.values.align = align.value;
32129
+ }
32130
+ onStateValuesBorderRadiusChange() {
32131
+ const borderRadius = this.getElm('borderRadius');
32132
+ borderRadius.value = this.state.values.borderRadius.toString();
32133
+ }
32134
+ onChangeBorderRadius() {
32135
+ const borderRadius = this.getElm('borderRadius');
32136
+ this.state.values.borderRadius = parseFloat(borderRadius.value);
32137
+ }
32138
+ onStateValuesIdChange() {
32139
+ const id = this.getElm('id');
32140
+ id.value = this.state.values.id;
32141
+ }
32142
+ onChangeId() {
32143
+ const id = this.getElm('id');
32144
+ this.state.values.id = id.value;
32145
+ }
32146
+ onStateValuesStyleChange() {
32147
+ const style = this.getElm('style');
32148
+ style.value = this.state.values.style;
32149
+ }
32150
+ onChangeStyle() {
32151
+ const style = this.getElm('style');
32152
+ this.state.values.style = style.value;
32153
+ }
32154
+ onStateValuesClassesChange() {
32155
+ const classes = this.getElm('classes');
32156
+ classes.value = this.state.values.classes;
32157
+ }
32158
+ onChangClasses() {
32159
+ const classes = this.getElm('classes');
32160
+ this.state.values.classes = classes.value;
32161
+ }
32162
+ onLockMarginClick(e) {
32163
+ this.state.marginIsLocked = !this.state.marginIsLocked;
32164
+ e.preventDefault();
32165
+ }
32166
+ onChangeMarginIsLocked() {
32167
+ const marginBottom = this.getElm('marginBottom');
32168
+ const marginRight = this.getElm('marginRight');
32169
+ const marginLeft = this.getElm('marginLeft');
32170
+ const lockMargin = this.getElm('lockMargin');
32171
+ [marginRight, marginBottom, marginLeft].forEach(elm => {
32172
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_3__/* .attr */ .C)(elm, 'disabled', this.state.marginIsLocked || null);
32173
+ });
32174
+ lockMargin.innerHTML = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_5__/* .Icon */ .I.get(this.state.marginIsLocked ? 'lock' : 'unlock');
32175
+ if (this.state.marginIsLocked) {
32176
+ const marginTop = this.state.values.marginTop;
32177
+ this.state.values.marginRight = marginTop;
32178
+ this.state.values.marginBottom = marginTop;
32179
+ this.state.values.marginLeft = marginTop;
32180
+ }
32181
+ }
32182
+ onStateValuesMarginChange() {
32183
+ const marginTop = this.getElm('marginTop');
32184
+ const marginRight = this.getElm('marginRight');
32185
+ const marginBottom = this.getElm('marginBottom');
32186
+ const marginLeft = this.getElm('marginLeft');
32187
+ marginTop.value = this.state.values.marginTop.toString();
32188
+ marginRight.value = this.state.values.marginRight.toString();
32189
+ marginBottom.value = this.state.values.marginBottom.toString();
32190
+ marginLeft.value = this.state.values.marginLeft.toString();
32191
+ }
32192
+ onChangeMargin() {
32193
+ const marginTop = this.getElm('marginTop');
32194
+ const marginRight = this.getElm('marginRight');
32195
+ const marginBottom = this.getElm('marginBottom');
32196
+ const marginLeft = this.getElm('marginLeft');
32197
+ this.state.values.marginTop = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginTop.value);
32198
+ if (this.state.marginIsLocked) {
32199
+ this.state.values.marginRight = this.state.values.marginTop;
32200
+ this.state.values.marginBottom = this.state.values.marginTop;
32201
+ this.state.values.marginLeft = this.state.values.marginTop;
32202
+ }
32203
+ else {
32204
+ this.state.values.marginRight = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginRight.value);
32205
+ this.state.values.marginBottom = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginBottom.value);
32206
+ this.state.values.marginLeft = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginLeft.value);
32207
+ }
32208
+ }
32209
+ hideFieldByOptions() {
32210
+ const opt = this.j.o.image;
32211
+ [
32212
+ ['editMargins', 'editMargins'],
32213
+ ['editAlign', 'editAlign'],
32214
+ ['editStyle', 'editStyle'],
32215
+ ['editClass', 'editClass'],
32216
+ ['editId', 'editId'],
32217
+ ['editBorderRadius', 'editBorderRadius']
32218
+ ].forEach(([optKey, elmKey]) => {
32219
+ const elm = this.getElm(elmKey);
32220
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(elm, 'display', opt[optKey] ? null : 'none');
32221
+ });
32222
+ }
32223
+ };
32224
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32225
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32226
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.align')
32227
+ ], UIImagePositionTab.prototype, "onStateAlignChange", null);
32228
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32229
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('align:change')
32230
+ ], UIImagePositionTab.prototype, "onChangeAlign", null);
32231
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32232
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32233
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.borderRadius')
32234
+ ], UIImagePositionTab.prototype, "onStateValuesBorderRadiusChange", null);
32235
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32236
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('borderRadius:change')
32237
+ ], UIImagePositionTab.prototype, "onChangeBorderRadius", null);
32238
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32239
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32240
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.id')
32241
+ ], UIImagePositionTab.prototype, "onStateValuesIdChange", null);
32242
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32243
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('id:change')
32244
+ ], UIImagePositionTab.prototype, "onChangeId", null);
32245
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32246
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32247
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.style')
32248
+ ], UIImagePositionTab.prototype, "onStateValuesStyleChange", null);
32249
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32250
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('style:change')
32251
+ ], UIImagePositionTab.prototype, "onChangeStyle", null);
32252
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32253
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32254
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.classes')
32255
+ ], UIImagePositionTab.prototype, "onStateValuesClassesChange", null);
32256
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32257
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('classes:change')
32258
+ ], UIImagePositionTab.prototype, "onChangClasses", null);
32259
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32260
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('lockMargin:click')
32261
+ ], UIImagePositionTab.prototype, "onLockMarginClick", null);
32262
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32263
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32264
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.marginIsLocked')
32265
+ ], UIImagePositionTab.prototype, "onChangeMarginIsLocked", null);
32266
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32267
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32268
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)([
32269
+ 'state.values.marginTop',
32270
+ 'state.values.marginRight',
32271
+ 'state.values.marginBottom',
32272
+ 'state.values.marginLeft'
32273
+ ])
32274
+ ], UIImagePositionTab.prototype, "onStateValuesMarginChange", null);
32275
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32276
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)([
32277
+ 'marginTop:change',
32278
+ 'marginRight:change',
32279
+ 'marginBottom:change',
32280
+ 'marginLeft:change'
32281
+ ])
32282
+ ], UIImagePositionTab.prototype, "onChangeMargin", null);
32283
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32284
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready')
32285
+ ], UIImagePositionTab.prototype, "hideFieldByOptions", null);
32286
+ UIImagePositionTab = (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32287
+ jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_9__/* .component */ .s
32288
+ ], UIImagePositionTab);
32289
+
32290
+
32291
+
32292
+ /***/ }),
32293
+
32294
+ /***/ 80778:
32295
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32296
+
32297
+ "use strict";
32298
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32299
+ /* harmony export */ v: function() { return /* binding */ openImageEditorDialog; }
32300
+ /* harmony export */ });
32301
+ /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(98253);
32302
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26150);
32303
+ /* harmony import */ var jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(53804);
32304
+ /*!
32305
+ * Jodit Editor (https://xdsoft.net/jodit/)
32306
+ * Released under MIT see LICENSE.txt in the project root for license information.
32307
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32308
+ */
32309
+
32310
+
32311
+
32312
+ /**
32313
+ * Open image editor dialog
32314
+ * @private
32315
+ */
32316
+ function openImageEditorDialog(j, state) {
32317
+ const url = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(state.image, 'src') || '', a = j.c.element('a'), loadExternal = () => {
32318
+ if (a.host !== location.host) {
32319
+ j.confirm('You can only edit your own images. Download this image on the host?', yes => {
32320
+ if (yes && j.uploader) {
32321
+ j.uploader.uploadRemoteImage(a.href.toString(), resp => {
32322
+ j.alert('The image has been successfully uploaded to the host!', () => {
32323
+ if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_2__/* .isString */ .K)(resp.newfilename)) {
32324
+ state.values.imageSrc =
32325
+ resp.baseurl +
32326
+ resp.newfilename;
32327
+ }
32328
+ });
32329
+ }, error => {
32330
+ j.alert('There was an error loading %s', error.message);
32331
+ });
32332
+ }
32333
+ });
32334
+ return;
32335
+ }
32336
+ };
32337
+ a.href = url;
32338
+ j.filebrowser.dataProvider
32339
+ .getPathByUrl(a.href.toString())
32340
+ .then(resp => {
32341
+ jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_1__/* .openImageEditor */ .B.call(j.filebrowser, a.href, resp.name, resp.path, resp.source, () => {
32342
+ const timestamp = new Date().getTime();
32343
+ state.values.imageSrc =
32344
+ url +
32345
+ (url.indexOf('?') !== -1 ? '' : '?') +
32346
+ '&_tmp=' +
32347
+ timestamp.toString();
32348
+ }, error => {
32349
+ j.alert(error.message);
32350
+ });
32351
+ })
32352
+ .catch(error => {
32353
+ j.alert(error.message, loadExternal);
32354
+ });
32355
+ }
32356
+
32357
+
32358
+ /***/ }),
32359
+
32360
+ /***/ 33733:
32361
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32362
+
32363
+ "use strict";
32364
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32365
+ /* harmony export */ q: function() { return /* binding */ openImagePopup; }
32366
+ /* harmony export */ });
32367
+ /* harmony import */ var jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(37923);
32368
+ /* harmony import */ var jodit_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(27594);
32369
+ /* harmony import */ var jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(80071);
32370
+ /* harmony import */ var jodit_modules_widget_file_selector_file_selector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10067);
32371
+ /*!
32372
+ * Jodit Editor (https://xdsoft.net/jodit/)
32373
+ * Released under MIT see LICENSE.txt in the project root for license information.
32374
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32375
+ */
32376
+
32377
+
32378
+
32379
+
32380
+ /** @private */
32381
+ function openImagePopup(j, dialog, state, button) {
32382
+ const popup = new jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_0__/* .Popup */ .z(dialog);
32383
+ const closePopup = () => {
32384
+ popup.close();
32385
+ popup.destruct();
32386
+ };
32387
+ popup
32388
+ .setContent((0,jodit_modules_widget_file_selector_file_selector__WEBPACK_IMPORTED_MODULE_1__/* .FileSelectorWidget */ .k)(j, {
32389
+ upload: (data) => {
32390
+ if (data.files && data.files.length) {
32391
+ state.values.imageSrc =
32392
+ data.baseurl + data.files[0];
32393
+ }
32394
+ closePopup();
32395
+ },
32396
+ filebrowser: async (data) => {
32397
+ if (data && (0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_2__/* .isArray */ .c)(data.files) && data.files.length) {
32398
+ state.values.imageSrc = data.files[0];
32399
+ closePopup();
32400
+ }
32401
+ }
32402
+ }, state.image, closePopup))
32403
+ .open(() => (0,jodit_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_3__/* .position */ .G)(button));
32404
+ }
32405
+
32406
+
32407
+ /***/ }),
32408
+
32409
+ /***/ 9645:
32410
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32411
+
32412
+ "use strict";
32413
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32414
+ /* harmony export */ G: function() { return /* binding */ normalSizeFromString; },
32415
+ /* harmony export */ n: function() { return /* binding */ normalSizeToString; }
32416
+ /* harmony export */ });
32417
+ /* harmony import */ var jodit_core_helpers_checker_is_number__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2461);
32418
+ /* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(59101);
32419
+ /*!
32420
+ * Jodit Editor (https://xdsoft.net/jodit/)
32421
+ * Released under MIT see LICENSE.txt in the project root for license information.
32422
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32423
+ */
32424
+
32425
+
32426
+ /** @private */
32427
+ const normalSizeFromString = (value) => {
32428
+ return /^[-+]?[0-9.]+(px)?$/.test(value.toString())
32429
+ ? parseFloat(value.toString())
32430
+ : value;
32431
+ };
32432
+ /** @private */
32433
+ const normalSizeToString = (value) => {
32434
+ if ((0,jodit_core_helpers_checker_is_number__WEBPACK_IMPORTED_MODULE_1__/* .isNumber */ .E)(value)) {
32435
+ return value ? value + 'px' : value.toString();
32436
+ }
32437
+ value = (0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_0__/* .trim */ .Bq)(value);
32438
+ return /^[0-9]+$/.test(value) ? value + 'px' : value;
32439
+ };
32440
+
32441
+
32442
+ /***/ }),
32443
+
32444
+ /***/ 30393:
32445
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32446
+
32447
+ "use strict";
32448
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32449
+ /* harmony export */ j: function() { return /* binding */ applyValuesToImage; }
32450
+ /* harmony export */ });
32451
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55186);
32452
+ /* harmony import */ var jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97369);
32453
+ /* harmony import */ var _link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(88269);
32454
+ /* harmony import */ var _margin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(78139);
32455
+ /* harmony import */ var _size__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(58972);
32456
+ /*!
32457
+ * Jodit Editor (https://xdsoft.net/jodit/)
32458
+ * Released under MIT see LICENSE.txt in the project root for license information.
32459
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32460
+ */
32461
+
32462
+
32463
+
32464
+
32465
+
32466
+ /**
32467
+ * Apply form's values to image
32468
+ * @private
32469
+ */
32470
+ function applyValuesToImage(j, state, image) {
32471
+ const { style, imageSrc, borderRadius, imageTitle, imageAlt, imageLink, imageWidth, imageHeight, marginTop, marginRight, marginBottom, marginLeft, imageLinkOpenInNewTab, align, classes, id } = state.values;
32472
+ const opt = j.o;
32473
+ // styles
32474
+ if (opt.image.editStyle) {
32475
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'style', style || null);
32476
+ }
32477
+ // Src
32478
+ if (imageSrc) {
32479
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'src', imageSrc);
32480
+ }
32481
+ else {
32482
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.safeRemove(image);
32483
+ return;
32484
+ }
32485
+ // Border radius
32486
+ image.style.borderRadius = borderRadius ? borderRadius + 'px' : '';
32487
+ // Title
32488
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'title', imageTitle || null);
32489
+ // Alt
32490
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'alt', imageAlt || null);
32491
+ // Link
32492
+ (0,_link__WEBPACK_IMPORTED_MODULE_2__/* .applyLink */ .j)(j, image, imageLink, imageLinkOpenInNewTab);
32493
+ // Size
32494
+ (0,_size__WEBPACK_IMPORTED_MODULE_4__/* .applySize */ .q)(image, imageWidth, imageHeight, state.sizeIsLocked);
32495
+ // Margin
32496
+ if (j.o.image.editMargins) {
32497
+ (0,_margin__WEBPACK_IMPORTED_MODULE_3__/* .applyMargin */ .N)(j, marginTop, marginRight, marginBottom, marginLeft, image, state.marginIsLocked);
32498
+ }
32499
+ if (opt.image.editClass) {
32500
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'class', classes || null);
32501
+ }
32502
+ if (opt.image.editId) {
32503
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'id', id || null);
32504
+ }
32505
+ if (opt.image.editAlign) {
32506
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.hAlignElement)(image, align);
32507
+ }
32508
+ }
32509
+
32510
+
32511
+ /***/ }),
32512
+
32513
+ /***/ 88269:
32514
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32515
+
32516
+ "use strict";
32517
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32518
+ /* harmony export */ j: function() { return /* binding */ applyLink; }
32519
+ /* harmony export */ });
32520
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55186);
32521
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26150);
32522
+ /*!
32523
+ * Jodit Editor (https://xdsoft.net/jodit/)
32524
+ * Released under MIT see LICENSE.txt in the project root for license information.
32525
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32526
+ */
32527
+
32528
+
32529
+ /** @private */
32530
+ function applyLink(j, image, imageLink, imageLinkOpenInNewTab) {
32531
+ // Link
32532
+ let link = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.closest(image, 'a', j.editor);
32533
+ if (imageLink) {
32534
+ if (!link) {
32535
+ link = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.wrap(image, 'a', j.createInside);
32536
+ }
32537
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(link, 'href', imageLink);
32538
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(link, 'target', imageLinkOpenInNewTab ? '_blank' : null);
32539
+ }
32540
+ else {
32541
+ if (link && link.parentNode) {
32542
+ link.parentNode.replaceChild(image, link);
32543
+ }
32544
+ }
32545
+ }
32546
+
32547
+
32548
+ /***/ }),
32549
+
32550
+ /***/ 78139:
32551
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32552
+
32553
+ "use strict";
32554
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32555
+ /* harmony export */ N: function() { return /* binding */ applyMargin; }
32556
+ /* harmony export */ });
32557
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(38322);
32558
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9645);
32559
+ /*!
32560
+ * Jodit Editor (https://xdsoft.net/jodit/)
32561
+ * Released under MIT see LICENSE.txt in the project root for license information.
32562
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32563
+ */
32564
+
32565
+
32566
+ /** @private */
32567
+ function applyMargin(j, marginTop, marginRight, marginBottom, marginLeft, image, marginIsLocked) {
32568
+ const margins = [marginTop, marginRight, marginBottom, marginLeft];
32569
+ const applyMargin = (key, value) => {
32570
+ const oldValue = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_1__/* .css */ .A)(image, key);
32571
+ const v = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_0__/* .normalSizeToString */ .n)(value);
32572
+ if (oldValue.toString() !== v.toString()) {
32573
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_1__/* .css */ .A)(image, key, v);
32574
+ }
32575
+ };
32576
+ if (!marginIsLocked) {
32577
+ const sides = [
32578
+ 'margin-top',
32579
+ 'margin-right',
32580
+ 'margin-bottom',
32581
+ 'margin-left'
32582
+ ];
32583
+ margins.forEach((margin, index) => {
32584
+ const side = sides[index];
32585
+ applyMargin(side, margin);
32586
+ });
32587
+ }
32588
+ else {
32589
+ applyMargin('margin', marginTop);
32590
+ }
32591
+ }
32592
+
32593
+
32594
+ /***/ }),
32595
+
32596
+ /***/ 58972:
32597
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32598
+
32599
+ "use strict";
32600
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32601
+ /* harmony export */ q: function() { return /* binding */ applySize; }
32602
+ /* harmony export */ });
32603
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26150);
32604
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(38322);
32605
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9645);
32606
+ /*!
32607
+ * Jodit Editor (https://xdsoft.net/jodit/)
32608
+ * Released under MIT see LICENSE.txt in the project root for license information.
32609
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32610
+ */
32611
+
32612
+
32613
+
32614
+ /** @private */
32615
+ function applySize(image, imageWidth, imageHeight, sizeIsLocked) {
32616
+ // Size
32617
+ if (imageWidth !== image.offsetWidth ||
32618
+ imageHeight !== image.offsetHeight) {
32619
+ const updatedWidth = imageWidth ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeToString */ .n)(imageWidth) : null;
32620
+ let updatedHeight = imageHeight
32621
+ ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeToString */ .n)(imageHeight)
32622
+ : null;
32623
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__/* .css */ .A)(image, {
32624
+ width: updatedWidth,
32625
+ height: updatedWidth && sizeIsLocked ? null : updatedHeight
32626
+ });
32627
+ (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);
32628
+ if (!(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'width') || sizeIsLocked) {
32629
+ updatedHeight = null;
32630
+ }
32631
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'height', updatedHeight);
32632
+ }
31833
32633
  }
31834
32634
 
31835
32635
 
@@ -38202,7 +39002,8 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_3__/* .pluginSystem */ .fg.add('selec
38202
39002
  */
38203
39003
 
38204
39004
  jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.select = {
38205
- normalizeSelectionBeforeCutAndCopy: false
39005
+ normalizeSelectionBeforeCutAndCopy: false,
39006
+ normalizeTripleClick: true
38206
39007
  };
38207
39008
 
38208
39009
 
@@ -38278,7 +39079,7 @@ class select extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_3__/* .Plugin */
38278
39079
  }
38279
39080
  }
38280
39081
  /**
38281
- * @event outsideClick(e) - when user clicked in the outside of editor
39082
+ * @event outsideClick(e) - when user clicked on the outside of editor
38282
39083
  */
38283
39084
  onOutsideClick(e) {
38284
39085
  const node = e.target;
@@ -38290,7 +39091,7 @@ class select extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_3__/* .Plugin */
38290
39091
  this.j.e.fire('outsideClick', e);
38291
39092
  }
38292
39093
  }
38293
- beforeCommandCut(command) {
39094
+ beforeCommandCut() {
38294
39095
  const { s } = this.j;
38295
39096
  if (!s.isCollapsed()) {
38296
39097
  const current = s.current();
@@ -38299,13 +39100,27 @@ class select extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_3__/* .Plugin */
38299
39100
  }
38300
39101
  }
38301
39102
  }
38302
- beforeCommandSelectall(command) {
39103
+ beforeCommandSelectAll() {
38303
39104
  const { s } = this.j;
38304
39105
  s.focus();
38305
39106
  s.select(this.j.editor, true);
38306
39107
  s.expandSelection();
38307
39108
  return false;
38308
39109
  }
39110
+ /**
39111
+ * Normalize selection after triple click
39112
+ */
39113
+ onTripleClickNormalizeSelection(e) {
39114
+ if (e.detail !== 3 || !this.j.o.select.normalizeTripleClick) {
39115
+ return;
39116
+ }
39117
+ const { s } = this.j;
39118
+ const { startContainer, startOffset } = s.range;
39119
+ if (startOffset === 0 && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isText(startContainer)) {
39120
+ 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) ||
39121
+ startContainer, true);
39122
+ }
39123
+ }
38309
39124
  onCopyNormalizeSelectionBound(e) {
38310
39125
  const { s, editor, o } = this.j;
38311
39126
  if (!o.select.normalizeSelectionBeforeCutAndCopy || s.isCollapsed()) {
@@ -38331,7 +39146,10 @@ class select extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_3__/* .Plugin */
38331
39146
  ], select.prototype, "beforeCommandCut", null);
38332
39147
  (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
38333
39148
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([':beforeCommandSelectall'])
38334
- ], select.prototype, "beforeCommandSelectall", null);
39149
+ ], select.prototype, "beforeCommandSelectAll", null);
39150
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
39151
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([':click'])
39152
+ ], select.prototype, "onTripleClickNormalizeSelection", null);
38335
39153
  (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
38336
39154
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([':copy', ':cut'])
38337
39155
  ], select.prototype, "onCopyNormalizeSelectionBound", null);