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/es2021/jodit.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.1.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
  this.timers = new Map();
@@ -1152,6 +1176,11 @@ class Async {
1152
1176
  ? (...args) => {
1153
1177
  const promise = this.promise(res => {
1154
1178
  promises.push(res);
1179
+ }).catch((e) => {
1180
+ if ((0,jodit_core_helpers_checker_is_abort_error__WEBPACK_IMPORTED_MODULE_9__/* .isAbortError */ .z)(e)) {
1181
+ return null;
1182
+ }
1183
+ throw e;
1155
1184
  });
1156
1185
  onFire(...args);
1157
1186
  return promise;
@@ -1223,7 +1252,7 @@ class Async {
1223
1252
  promise(executor) {
1224
1253
  let rejectCallback = () => { };
1225
1254
  const promise = new Promise((resolve, reject) => {
1226
- rejectCallback = () => reject((0,jodit_core_helpers_utils_error_errors_abort_error__WEBPACK_IMPORTED_MODULE_9__/* .abort */ .h)());
1255
+ rejectCallback = () => reject((0,jodit_core_helpers_utils_error_errors_abort_error__WEBPACK_IMPORTED_MODULE_10__/* .abort */ .h)('Abort async'));
1227
1256
  this.promisesRejections.add(rejectCallback);
1228
1257
  executor(resolve, reject);
1229
1258
  });
@@ -1708,7 +1737,7 @@ __webpack_require__.r(__webpack_exports__);
1708
1737
  * Released under MIT see LICENSE.txt in the project root for license information.
1709
1738
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
1710
1739
  */
1711
- const APP_VERSION = "4.1.16";
1740
+ const APP_VERSION = "4.2.6";
1712
1741
  // prettier-ignore
1713
1742
  const ES = "es2021";
1714
1743
  const IS_ES_MODERN = true;
@@ -6717,8 +6746,8 @@ function position(elm, jodit, recurse = false) {
6717
6746
  return {
6718
6747
  left: Math.round(xPos),
6719
6748
  top: Math.round(yPos),
6720
- width: Math.round(elm.offsetWidth),
6721
- height: Math.round(elm.offsetHeight)
6749
+ width: Math.round(elm.offsetWidth ?? rect.width),
6750
+ height: Math.round(elm.offsetHeight ?? rect.height)
6722
6751
  };
6723
6752
  }
6724
6753
 
@@ -8751,9 +8780,9 @@ const getXPathByElement = (element, root) => {
8751
8780
  * Find all `ref` or `data-ref` elements inside HTMLElement
8752
8781
  */
8753
8782
  const refs = (root) => {
8754
- // if (Component.isInstanceOf<UIElement>(root, UIElement)) {
8755
- // root = root.container;
8756
- // }
8783
+ if ('container' in root) {
8784
+ root = root.container;
8785
+ }
8757
8786
  return $$('[ref],[data-ref]', root).reduce((def, child) => {
8758
8787
  const key = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(child, '-ref');
8759
8788
  if (key && (0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_4__/* .isString */ .K)(key)) {
@@ -13275,7 +13304,7 @@ let UITooltip = UITooltip_1 = class UITooltip extends jodit_core_ui_element__WEB
13275
13304
  view.o.showTooltip &&
13276
13305
  !view.o.useNativeTooltip) {
13277
13306
  view.hookStatus(jodit_core_component__WEBPACK_IMPORTED_MODULE_0__/* .STATUSES */ .f.ready, () => {
13278
- // TODO Move it inside __open method. Now it is here becous testcase failed with capturing
13307
+ // TODO Move it inside __open method. Now it is here because testcase failed with capturing
13279
13308
  (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_3__/* .getContainer */ .My)(this.j, UITooltip_1).appendChild(this.container);
13280
13309
  view.e.on(view.container, 'mouseenter.tooltip', this.__onMouseEnter, {
13281
13310
  capture: true
@@ -13291,6 +13320,7 @@ let UITooltip = UITooltip_1 = class UITooltip extends jodit_core_ui_element__WEB
13291
13320
  const view = this.j;
13292
13321
  view.e
13293
13322
  .on(view.ow, 'scroll.tooltip', this.__hide)
13323
+ .on(view.ow, 'joditCloseDialog', this.__hide)
13294
13324
  .on(view.container, 'mouseleave.tooltip', this.__hide)
13295
13325
  .on([
13296
13326
  'escape.tooltip',
@@ -15300,7 +15330,7 @@ class Popup extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_7__/* .UI
15300
15330
  }
15301
15331
  let pe = this.parentElement;
15302
15332
  while (pe) {
15303
- if (checkView(j)) {
15333
+ if (checkView(pe.j)) {
15304
15334
  return;
15305
15335
  }
15306
15336
  if (pe.container.style.zIndex) {
@@ -17793,6 +17823,7 @@ let Dialog = Dialog_1 = class Dialog extends jodit_core_view_view_with_toolbar__
17793
17823
  * Fired when dialog box is started moving
17794
17824
  */
17795
17825
  this.e.fire(this, 'startMove');
17826
+ this.e.fire('closeAllPopups');
17796
17827
  }
17797
17828
  }
17798
17829
  onMouseMove(e) {
@@ -19120,6 +19151,9 @@ let DataProvider = class DataProvider {
19120
19151
  this.o.permissions.data.source = source;
19121
19152
  if (this.o.permissions.url) {
19122
19153
  return this.get('permissions').then(resp => {
19154
+ if (this.parent.isInDestruct) {
19155
+ throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.abort)();
19156
+ }
19123
19157
  let process = this.o.permissions.process;
19124
19158
  if (!process) {
19125
19159
  process = this.o.ajax.process;
@@ -19733,10 +19767,17 @@ let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__W
19733
19767
  this.__updateToolbarButtons();
19734
19768
  this._dialog.open(this.browser, header);
19735
19769
  this.e.fire('sort.filebrowser', this.state.sortBy);
19736
- (0,_fetch_load_tree__WEBPACK_IMPORTED_MODULE_10__/* .loadTree */ .r)(this).then(resolve, reject);
19770
+ (0,_fetch_load_tree__WEBPACK_IMPORTED_MODULE_10__/* .loadTree */ .r)(this)
19771
+ .then(resolve, reject)
19772
+ .finally(() => {
19773
+ if (this.isInDestruct) {
19774
+ return;
19775
+ }
19776
+ this?.e?.fire('fileBrowserReady.filebrowser');
19777
+ });
19737
19778
  })
19738
19779
  .catch((e) => {
19739
- if (!jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.IS_PROD) {
19780
+ if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isAbortError)(e) && !jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.IS_PROD) {
19740
19781
  throw e;
19741
19782
  }
19742
19783
  });
@@ -21602,11 +21643,12 @@ const act = (el, className = 'jodti-image-editor_active') => el ? className : ''
21602
21643
  const form = (editor, o) => {
21603
21644
  const i = editor.i18n.bind(editor);
21604
21645
  const switcher = (label, ref, active = true) => `<div class="jodit-form__group">
21605
- <label>${i(label)}</label>
21606
-
21607
- <label class='jodit-switcher'>
21608
- <input ${act(active, 'checked')} data-ref="${ref}" type="checkbox"/>
21609
- <span class="jodit-switcher__slider"></span>
21646
+ <label class="jodit-switcher-wrapper">
21647
+ <span class='jodit-switcher'>
21648
+ <input ${act(active, 'checked')} data-ref="${ref}" type="checkbox"/>
21649
+ <span class="jodit-switcher__slider"></span>
21650
+ </span>
21651
+ <span>${i(label)}</span>
21610
21652
  </label>
21611
21653
  </div>`;
21612
21654
  return editor.create.fromHTML(`<form class="${jie} jodit-properties">
@@ -24670,11 +24712,13 @@ const TabsWidget = (jodit, tabs, state) => {
24670
24712
  return;
24671
24713
  }
24672
24714
  buttonList.forEach(b => {
24715
+ b.state.variant = 'initial';
24673
24716
  b.state.activated = false;
24674
24717
  });
24675
24718
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.$$)('.jodit-tab', tabBox).forEach(a => {
24676
24719
  a.classList.remove('jodit-tab_active');
24677
24720
  });
24721
+ nameToTab[tab].button.state.variant = 'outline';
24678
24722
  nameToTab[tab].button.state.activated = true;
24679
24723
  nameToTab[tab].tab.classList.add('jodit-tab_active');
24680
24724
  };
@@ -24703,7 +24747,7 @@ const TabsWidget = (jodit, tabs, state) => {
24703
24747
  content.call(jodit);
24704
24748
  }
24705
24749
  if (state) {
24706
- state.__activeTab = name;
24750
+ state.activeTab = name;
24707
24751
  }
24708
24752
  return false;
24709
24753
  });
@@ -24719,20 +24763,20 @@ const TabsWidget = (jodit, tabs, state) => {
24719
24763
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.$$)('a', buttons).forEach(a => {
24720
24764
  a.style.width = (100 / tabCount).toFixed(10) + '%';
24721
24765
  });
24722
- const tab = !state || !state.__activeTab || !nameToTab[state.__activeTab]
24766
+ const tab = !state || !state.activeTab || !nameToTab[state.activeTab]
24723
24767
  ? firstTab
24724
- : state.__activeTab;
24768
+ : state.activeTab;
24725
24769
  setActive(tab);
24726
24770
  if (state) {
24727
- let __activeTab = state.__activeTab;
24728
- Object.defineProperty(state, '__activeTab', {
24771
+ let activeTab = state.activeTab;
24772
+ Object.defineProperty(state, 'activeTab', {
24729
24773
  configurable: true,
24730
24774
  enumerable: false,
24731
24775
  get() {
24732
- return __activeTab;
24776
+ return activeTab;
24733
24777
  },
24734
24778
  set(value) {
24735
- __activeTab = value;
24779
+ activeTab = value;
24736
24780
  setActive(value);
24737
24781
  }
24738
24782
  });
@@ -25147,7 +25191,7 @@ class aiAssistant extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_3__/
25147
25191
  (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .extendLang */ .JW)(_langs__WEBPACK_IMPORTED_MODULE_6__);
25148
25192
  }
25149
25193
  /** @override */
25150
- afterInit(jodit) { }
25194
+ afterInit() { }
25151
25195
  onGenerateAiAssistantForm(prompt) {
25152
25196
  this.__dialog.open(this.__container, 'AI Assistant');
25153
25197
  this.__container.setPrompt(prompt);
@@ -31009,9 +31053,6 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .pluginSystem */ .fg.add('image
31009
31053
  * Released under MIT see LICENSE.txt in the project root for license information.
31010
31054
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31011
31055
  */
31012
- /**
31013
- * @module plugins/image-properties
31014
- */
31015
31056
 
31016
31057
  jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.image = {
31017
31058
  dialogWidth: 600,
@@ -31041,18 +31082,19 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.image = {
31041
31082
 
31042
31083
  "use strict";
31043
31084
  /* unused harmony export imageProperties */
31044
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(31635);
31085
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(31635);
31045
31086
  /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22664);
31046
- /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56298);
31047
- /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65147);
31048
- /* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(35265);
31049
- /* harmony import */ var jodit_modules__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(37435);
31050
- /* harmony import */ var jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(53804);
31051
- /* harmony import */ var jodit_modules_widget__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(16116);
31052
- /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(24654);
31053
- /* harmony import */ var _templates_form__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(22254);
31054
- /* harmony import */ var _templates_main_tab__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(75263);
31055
- /* harmony import */ var _templates_position_tab__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(57837);
31087
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(55186);
31088
+ /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(56298);
31089
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(65147);
31090
+ /* harmony import */ var jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29866);
31091
+ /* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(35265);
31092
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(24654);
31093
+ /* harmony import */ var _ui_ui_image_form__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(31970);
31094
+ /* harmony import */ var _utils_open_image_editor__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(80778);
31095
+ /* harmony import */ var _utils_open_image_popup__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(33733);
31096
+ /* harmony import */ var _readers__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(5549);
31097
+ /* harmony import */ var _writers__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(30393);
31056
31098
  /*!
31057
31099
  * Jodit Editor (https://xdsoft.net/jodit/)
31058
31100
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -31084,55 +31126,93 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.image = {
31084
31126
  * });
31085
31127
  * ```
31086
31128
  */
31087
- const normalSizeToString = (value) => {
31088
- value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.trim)(value);
31089
- return /^[0-9]+$/.test(value) ? value + 'px' : value;
31090
- };
31091
- const normalSizeFromString = (value) => {
31092
- return /^[-+]?[0-9.]+px$/.test(value.toString())
31093
- ? parseFloat(value.toString())
31094
- : value;
31095
- };
31096
31129
  /**
31097
31130
  * Show dialog with image's options
31098
31131
  */
31099
- class imageProperties extends jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin {
31132
+ class imageProperties extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_4__/* .Plugin */ .k {
31100
31133
  constructor() {
31101
31134
  super(...arguments);
31102
31135
  this.state = {
31103
31136
  image: new Image(),
31137
+ sourceImage: new Image(),
31104
31138
  get ratio() {
31105
- return this.image.naturalWidth / this.image.naturalHeight || 1;
31139
+ const { naturalWidth, naturalHeight } = this.image;
31140
+ return naturalWidth / naturalHeight || 1;
31106
31141
  },
31107
31142
  sizeIsLocked: true,
31108
- marginIsLocked: true
31143
+ marginIsLocked: true,
31144
+ values: {
31145
+ style: '',
31146
+ imageSrc: '',
31147
+ borderRadius: 0,
31148
+ imageTitle: '',
31149
+ imageAlt: '',
31150
+ imageLink: '',
31151
+ imageLinkOpenInNewTab: false,
31152
+ imageWidth: 0,
31153
+ imageHeight: 0,
31154
+ marginTop: 0,
31155
+ marginRight: 0,
31156
+ marginBottom: 0,
31157
+ marginLeft: 0,
31158
+ classes: '',
31159
+ id: '',
31160
+ align: ''
31161
+ }
31109
31162
  };
31110
31163
  this.activeTabState = {
31111
- __activeTab: 'Image'
31164
+ activeTab: 'Image'
31112
31165
  };
31113
31166
  }
31114
- onChangeMarginIsLocked() {
31115
- if (!this.form) {
31116
- return;
31117
- }
31118
- const { marginRight, marginBottom, marginLeft, lockMargin } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
31119
- [marginRight, marginBottom, marginLeft].forEach(elm => {
31120
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(elm, 'disabled', this.state.marginIsLocked || null);
31167
+ get form() {
31168
+ return new _ui_ui_image_form__WEBPACK_IMPORTED_MODULE_7__/* .UIImagePropertiesForm */ .l(this.j, this.state, this.activeTabState, {
31169
+ openImageEditor: () => (0,_utils_open_image_editor__WEBPACK_IMPORTED_MODULE_8__/* .openImageEditorDialog */ .v)(this.j, this.state),
31170
+ openImagePopup: target => (0,_utils_open_image_popup__WEBPACK_IMPORTED_MODULE_9__/* .openImagePopup */ .q)(this.j, this.dialog, this.state, target)
31121
31171
  });
31122
- lockMargin.innerHTML = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Icon.get(this.state.marginIsLocked ? 'lock' : 'unlock');
31123
31172
  }
31124
- onChangeSizeIsLocked() {
31125
- if (!this.form) {
31126
- return;
31127
- }
31128
- const { lockSize, imageWidth } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
31129
- lockSize.innerHTML = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Icon.get(this.state.sizeIsLocked ? 'lock' : 'unlock');
31130
- lockSize.classList.remove('jodit-properties__lock');
31131
- lockSize.classList.remove('jodit-properties__unlock');
31132
- lockSize.classList.add(this.state.sizeIsLocked
31133
- ? 'jodit-properties__lock'
31134
- : 'jodit-properties__unlock');
31135
- this.j.e.fire(imageWidth, 'change');
31173
+ /**
31174
+ * Dialog for form
31175
+ */
31176
+ get dialog() {
31177
+ const { j } = this;
31178
+ const dialog = j.dlg({
31179
+ minWidth: Math.min(400, screen.width),
31180
+ minHeight: 590,
31181
+ buttons: ['fullsize', 'dialog.close']
31182
+ });
31183
+ const buttons = this.__buttons;
31184
+ buttons.check.onAction(() => {
31185
+ (0,_writers__WEBPACK_IMPORTED_MODULE_11__/* .applyValuesToImage */ .j)(j, this.state, this.state.sourceImage);
31186
+ j.synchronizeValues();
31187
+ dialog.close();
31188
+ });
31189
+ buttons.remove.onAction(() => {
31190
+ j.s.removeNode(this.state.sourceImage);
31191
+ dialog.close();
31192
+ });
31193
+ buttons.cancel.onAction(() => {
31194
+ dialog.close();
31195
+ });
31196
+ dialog.setHeader(j.i18n('Image properties'));
31197
+ dialog.setContent(this.form);
31198
+ dialog.setFooter([[buttons.cancel, buttons.remove], buttons.check]);
31199
+ j.e.on(dialog, 'afterClose', () => {
31200
+ if (this.state.image.parentNode &&
31201
+ j.o.image.selectImageAfterClose) {
31202
+ j.s.select(this.state.sourceImage);
31203
+ }
31204
+ });
31205
+ dialog.setSize(j.o.image.dialogWidth);
31206
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.markOwner)(j, dialog.container);
31207
+ return dialog;
31208
+ }
31209
+ get __buttons() {
31210
+ const { j } = this;
31211
+ return {
31212
+ check: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__/* .Button */ .$n)(j, 'ok', 'Apply', 'primary'),
31213
+ remove: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__/* .Button */ .$n)(j, 'bin', 'Delete'),
31214
+ cancel: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__/* .Button */ .$n)(j, 'cancel', 'Cancel')
31215
+ };
31136
31216
  }
31137
31217
  /**
31138
31218
  * Open dialog editing image properties
@@ -31149,358 +31229,28 @@ class imageProperties extends jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin
31149
31229
  * ```
31150
31230
  */
31151
31231
  open() {
31152
- this.makeForm();
31153
- this.activeTabState.__activeTab = 'Image';
31154
- this.j.e.fire('hidePopup');
31155
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.markOwner)(this.j, this.dialog.container);
31156
- this.state.marginIsLocked = true;
31157
- this.state.sizeIsLocked = true;
31158
- this.onChangeMarginIsLocked();
31159
- this.onChangeSizeIsLocked();
31160
- this.updateValues();
31232
+ this.activeTabState.activeTab = 'Image';
31233
+ this.__lock();
31161
31234
  this.dialog.open().setModal(true).setPosition();
31162
- return false;
31163
- }
31164
- /**
31165
- * Create form for edit image properties
31166
- */
31167
- makeForm() {
31168
- if (this.dialog) {
31169
- return;
31170
- }
31171
- this.dialog = this.j.dlg({
31172
- minWidth: Math.min(400, screen.width),
31173
- minHeight: 590,
31174
- buttons: ['fullsize', 'dialog.close']
31175
- });
31176
- const editor = this.j, opt = editor.o, i18n = editor.i18n.bind(editor), buttons = {
31177
- check: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_3__/* .Button */ .$n)(editor, 'ok', 'Apply', 'primary'),
31178
- remove: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_3__/* .Button */ .$n)(editor, 'bin', 'Delete')
31179
- };
31180
- editor.e.on(this.dialog, 'afterClose', () => {
31181
- if (this.state.image.parentNode &&
31182
- opt.image.selectImageAfterClose) {
31183
- editor.s.select(this.state.image);
31184
- }
31185
- });
31186
- buttons.remove.onAction(() => {
31187
- editor.s.removeNode(this.state.image);
31188
- this.dialog.close();
31189
- });
31190
- const { dialog } = this;
31191
- dialog.setHeader(i18n('Image properties'));
31192
- const mainForm = (0,_templates_form__WEBPACK_IMPORTED_MODULE_8__/* .form */ .Z)(editor);
31193
- this.form = mainForm;
31194
- dialog.setContent(mainForm);
31195
- const { tabsBox } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
31196
- if (tabsBox) {
31197
- tabsBox.appendChild((0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_6__/* .TabsWidget */ .Zg)(editor, [
31198
- { name: 'Image', content: (0,_templates_main_tab__WEBPACK_IMPORTED_MODULE_9__/* .mainTab */ .J)(editor) },
31199
- { name: 'Advanced', content: (0,_templates_position_tab__WEBPACK_IMPORTED_MODULE_10__/* .positionTab */ .b)(editor) }
31200
- ], this.activeTabState));
31201
- }
31202
- buttons.check.onAction(this.onApply);
31203
- const { changeImage, editImage } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
31204
- editor.e.on(changeImage, 'click', this.openImagePopup);
31205
- if (opt.image.useImageEditor) {
31206
- editor.e.on(editImage, 'click', this.openImageEditor);
31207
- }
31208
- const { lockSize, lockMargin, imageWidth, imageHeight } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(mainForm);
31209
- if (lockSize) {
31210
- editor.e.on(lockSize, 'click', () => {
31211
- this.state.sizeIsLocked = !this.state.sizeIsLocked;
31212
- });
31213
- }
31214
- editor.e.on(lockMargin, 'click', (e) => {
31215
- this.state.marginIsLocked = !this.state.marginIsLocked;
31216
- e.preventDefault();
31217
- });
31218
- const changeSizes = (event) => {
31219
- if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isNumeric)(imageWidth.value) || !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isNumeric)(imageHeight.value)) {
31220
- return;
31221
- }
31222
- const w = parseFloat(imageWidth.value), h = parseFloat(imageHeight.value);
31223
- if (event.target === imageWidth) {
31224
- imageHeight.value = Math.round(w / this.state.ratio).toString();
31225
- }
31226
- else {
31227
- imageWidth.value = Math.round(h * this.state.ratio).toString();
31228
- }
31229
- };
31230
- editor.e.on([imageWidth, imageHeight], 'change keydown mousedown paste', (event) => {
31231
- if (!this.state.sizeIsLocked) {
31232
- return;
31233
- }
31234
- editor.async.setTimeout(changeSizes.bind(this, event), {
31235
- timeout: editor.defaultTimeout,
31236
- label: 'image-properties-changeSize'
31237
- });
31238
- });
31239
- dialog.setFooter([buttons.remove, buttons.check]);
31240
- dialog.setSize(this.j.o.image.dialogWidth);
31241
- }
31242
- /**
31243
- * Set input values from image
31244
- */
31245
- updateValues() {
31246
- const opt = this.j.o;
31247
- const { image } = this.state;
31248
- 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);
31249
- const updateLock = () => {
31250
- lockMargin.checked = this.state.marginIsLocked;
31251
- lockSize.checked = this.state.sizeIsLocked;
31252
- }, updateAlign = () => {
31253
- if (image.style.cssFloat &&
31254
- ['left', 'right'].indexOf(image.style.cssFloat.toLowerCase()) !== -1) {
31255
- align.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'float');
31256
- }
31257
- else {
31258
- if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'display') === 'block' &&
31259
- image.style.marginLeft === 'auto' &&
31260
- image.style.marginRight === 'auto') {
31261
- align.value = 'center';
31262
- }
31263
- }
31264
- }, updateBorderRadius = () => {
31265
- borderRadius.value = (parseInt(image.style.borderRadius || '0', 10) || '0').toString();
31266
- }, updateId = () => {
31267
- id.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'id') || '';
31268
- }, updateStyle = () => {
31269
- style.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'style') || '';
31270
- }, updateClasses = () => {
31271
- classes.value = ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'class') || '').replace(/jodit_focused_image[\s]*/, '');
31272
- }, updateMargins = () => {
31273
- if (!opt.image.editMargins) {
31274
- return;
31275
- }
31276
- let equal = true, wasEmptyField = false;
31277
- [marginTop, marginRight, marginBottom, marginLeft].forEach(elm => {
31278
- const id = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(elm, 'data-ref') || '';
31279
- let value = image.style.getPropertyValue((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.kebabCase)(id));
31280
- if (!value) {
31281
- wasEmptyField = true;
31282
- elm.value = '';
31283
- return;
31284
- }
31285
- if (/^[0-9]+(px)?$/.test(value)) {
31286
- value = parseInt(value, 10);
31287
- }
31288
- elm.value = value.toString() || '';
31289
- if ((wasEmptyField && elm.value) ||
31290
- (equal &&
31291
- id !== 'marginTop' &&
31292
- elm.value !== marginTop.value)) {
31293
- equal = false;
31294
- }
31295
- });
31296
- this.state.marginIsLocked = equal;
31297
- }, updateSizes = () => {
31298
- const width = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'width') ||
31299
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'width', true) ||
31300
- false, height = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'height') ||
31301
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'height', true) ||
31302
- false;
31303
- imageWidth.value =
31304
- width !== false
31305
- ? normalSizeFromString(width).toString()
31306
- : image.offsetWidth.toString();
31307
- imageHeight.value =
31308
- height !== false
31309
- ? normalSizeFromString(height).toString()
31310
- : image.offsetHeight.toString();
31311
- this.state.sizeIsLocked = (() => {
31312
- if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isNumeric)(imageWidth.value) ||
31313
- !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isNumeric)(imageHeight.value)) {
31314
- return false;
31315
- }
31316
- const w = parseFloat(imageWidth.value), h = parseFloat(imageHeight.value);
31317
- return Math.abs(w - h * this.state.ratio) < 1;
31318
- })();
31319
- }, updateText = () => {
31320
- imageTitle.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'title') || '';
31321
- imageAlt.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'alt') || '';
31322
- const a = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(image, 'a', this.j.editor);
31323
- if (a) {
31324
- imageLink.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(a, 'href') || '';
31325
- imageLinkOpenInNewTab.checked =
31326
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(a, 'target') === '_blank';
31327
- }
31328
- else {
31329
- imageLink.value = '';
31330
- imageLinkOpenInNewTab.checked = false;
31331
- }
31332
- }, updateSrc = () => {
31333
- imageSrc.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'src') || '';
31334
- if (imageViewSrc) {
31335
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(imageViewSrc, 'src', (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'src') || '');
31336
- }
31337
- };
31338
- updateLock();
31339
- updateSrc();
31340
- updateText();
31341
- updateSizes();
31342
- updateMargins();
31343
- updateClasses();
31344
- updateId();
31345
- updateBorderRadius();
31346
- updateAlign();
31347
- updateStyle();
31348
- }
31349
- /**
31350
- * Apply form's values to image
31351
- */
31352
- onApply() {
31353
- 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);
31354
- const opt = this.j.o;
31355
- const { image } = this.state;
31356
- // styles
31357
- if (opt.image.editStyle) {
31358
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'style', style.value || null);
31359
- }
31360
- // Src
31361
- if (imageSrc.value) {
31362
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'src', imageSrc.value);
31363
- }
31364
- else {
31365
- jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove(image);
31366
- this.dialog.close();
31367
- return;
31368
- }
31369
- // Border radius
31370
- if (borderRadius.value !== '0' && /^[0-9]+$/.test(borderRadius.value)) {
31371
- image.style.borderRadius = borderRadius.value + 'px';
31372
- }
31373
- else {
31374
- image.style.borderRadius = '';
31375
- }
31376
- // Title
31377
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'title', imageTitle.value || null);
31378
- // Alt
31379
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'alt', imageAlt.value || null);
31380
- // Link
31381
- let link = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(image, 'a', this.j.editor);
31382
- if (imageLink.value) {
31383
- if (!link) {
31384
- link = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.wrap(image, 'a', this.j.createInside);
31385
- }
31386
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(link, 'href', imageLink.value);
31387
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(link, 'target', imageLinkOpenInNewTab.checked ? '_blank' : null);
31388
- }
31389
- else {
31390
- if (link && link.parentNode) {
31391
- link.parentNode.replaceChild(image, link);
31392
- }
31393
- }
31394
- // Size
31395
- if (imageWidth.value !== image.offsetWidth.toString() ||
31396
- imageHeight.value !== image.offsetHeight.toString()) {
31397
- const updatedtWidth = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.trim)(imageWidth.value)
31398
- ? normalSizeToString(imageWidth.value)
31399
- : null;
31400
- const updatedHeight = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.trim)(imageHeight.value)
31401
- ? normalSizeToString(imageHeight.value)
31402
- : null;
31403
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, {
31404
- width: updatedtWidth,
31405
- height: updatedHeight
31406
- });
31407
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'width', (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'width') ? updatedtWidth : null);
31408
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'height', (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'height') ? updatedHeight : null);
31409
- }
31410
- const margins = [marginTop, marginRight, marginBottom, marginLeft];
31411
- if (opt.image.editMargins) {
31412
- if (!this.state.marginIsLocked) {
31413
- margins.forEach((margin) => {
31414
- const side = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(margin, 'data-ref') || '';
31415
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, side, normalSizeToString(margin.value));
31416
- });
31417
- }
31418
- else {
31419
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'margin', normalSizeToString(marginTop.value));
31420
- }
31421
- }
31422
- if (opt.image.editClass) {
31423
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'class', classes.value || null);
31424
- }
31425
- if (opt.image.editId) {
31426
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'id', id.value || null);
31427
- }
31428
- if (opt.image.editAlign) {
31429
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.hAlignElement)(image, align.value);
31430
- }
31431
- this.j.synchronizeValues();
31432
- this.dialog.close();
31433
- }
31434
- /**
31435
- * Open image editor dialog
31436
- */
31437
- openImageEditor() {
31438
- const url = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src') || '', a = this.j.c.element('a'), loadExternal = () => {
31439
- if (a.host !== location.host) {
31440
- this.j.confirm('You can only edit your own images. Download this image on the host?', yes => {
31441
- if (yes && this.j.uploader) {
31442
- this.j.uploader.uploadRemoteImage(a.href.toString(), resp => {
31443
- this.j.alert('The image has been successfully uploaded to the host!', () => {
31444
- if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isString)(resp.newfilename)) {
31445
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src', resp.baseurl +
31446
- resp.newfilename);
31447
- this.updateValues();
31448
- }
31449
- });
31450
- }, error => {
31451
- this.j.alert('There was an error loading %s', error.message);
31452
- });
31453
- }
31454
- });
31455
- return;
31235
+ this.async
31236
+ .promise((resolve, reject) => (0,_readers__WEBPACK_IMPORTED_MODULE_10__/* .readValuesFromImage */ .U)(this.j, this.state).then(resolve, reject))
31237
+ .catch((e) => {
31238
+ if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.isAbortError)(e)) {
31239
+ this.dialog.message.error(e.message);
31456
31240
  }
31457
- };
31458
- a.href = url;
31459
- this.j.filebrowser.dataProvider
31460
- .getPathByUrl(a.href.toString())
31461
- .then(resp => {
31462
- jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_5__/* .openImageEditor */ .B.call(this.j.filebrowser, a.href, resp.name, resp.path, resp.source, () => {
31463
- const timestamp = new Date().getTime();
31464
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src', url +
31465
- (url.indexOf('?') !== -1 ? '' : '?') +
31466
- '&_tmp=' +
31467
- timestamp.toString());
31468
- this.updateValues();
31469
- }, error => {
31470
- this.j.alert(error.message);
31471
- });
31472
31241
  })
31473
- .catch(error => {
31474
- this.j.alert(error.message, loadExternal);
31475
- });
31242
+ .finally(() => this.__unlock());
31243
+ return false;
31476
31244
  }
31477
- /**
31478
- * Open popup with filebrowser/uploader buttons for image
31479
- */
31480
- openImagePopup(event) {
31481
- const popup = new jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Popup(this.j), { changeImage } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
31482
- popup.setZIndex(this.dialog.getZIndex() + 1);
31483
- popup
31484
- .setContent((0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_6__/* .FileSelectorWidget */ .kG)(this.j, {
31485
- upload: (data) => {
31486
- if (data.files && data.files.length) {
31487
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src', data.baseurl + data.files[0]);
31488
- }
31489
- this.updateValues();
31490
- popup.close();
31491
- },
31492
- filebrowser: (data) => {
31493
- if (data &&
31494
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isArray)(data.files) &&
31495
- data.files.length) {
31496
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src', data.files[0]);
31497
- popup.close();
31498
- this.updateValues();
31499
- }
31500
- }
31501
- }, this.state.image, popup.close))
31502
- .open(() => (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.position)(changeImage));
31503
- event.stopPropagation();
31245
+ __lock() {
31246
+ this.dialog.lock();
31247
+ this.form.setMod('lock', true);
31248
+ Object.values(this.__buttons).forEach(b => (b.state.disabled = true));
31249
+ }
31250
+ __unlock() {
31251
+ this.dialog.unlock();
31252
+ this.form.setMod('lock', false);
31253
+ Object.values(this.__buttons).forEach(b => (b.state.disabled = false));
31504
31254
  }
31505
31255
  /** @override **/
31506
31256
  afterInit(editor) {
@@ -31511,7 +31261,7 @@ class imageProperties extends jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin
31511
31261
  .off(editor.editor, '.imageproperties')
31512
31262
  .on(editor.editor, 'dblclick.imageproperties', (e) => {
31513
31263
  const image = e.target;
31514
- if (!jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(image, 'img')) {
31264
+ if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isTag(image, 'img')) {
31515
31265
  return;
31516
31266
  }
31517
31267
  if (editor.o.image.openOnDblClick) {
@@ -31519,7 +31269,8 @@ class imageProperties extends jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin
31519
31269
  false) {
31520
31270
  return;
31521
31271
  }
31522
- self.state.image = image;
31272
+ self.state.sourceImage = image;
31273
+ self.state.image = image.cloneNode(true);
31523
31274
  if (!editor.o.readonly) {
31524
31275
  e.stopImmediatePropagation();
31525
31276
  e.preventDefault();
@@ -31533,206 +31284,1252 @@ class imageProperties extends jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin
31533
31284
  });
31534
31285
  })
31535
31286
  .on('openImageProperties.imageproperties', (image) => {
31536
- this.state.image = image;
31287
+ self.state.sourceImage = image;
31288
+ this.state.image = image.cloneNode(true);
31537
31289
  this.open();
31538
31290
  });
31539
31291
  }
31292
+ async onStateValuesImageSrcChange() {
31293
+ const { image, values } = this.state;
31294
+ if (!image.src) {
31295
+ return;
31296
+ }
31297
+ try {
31298
+ this.__lock();
31299
+ await image.decode();
31300
+ if (this.state.sizeIsLocked && (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.isNumeric)(values.imageWidth)) {
31301
+ const w = parseFloat(values.imageWidth.toString());
31302
+ values.imageHeight = Math.round(w / this.state.ratio);
31303
+ }
31304
+ this.j.e.fire('updateImageProperties.imageproperties', image);
31305
+ }
31306
+ catch (e) {
31307
+ this.j.alert(e.message);
31308
+ }
31309
+ finally {
31310
+ this.__unlock();
31311
+ }
31312
+ }
31540
31313
  /** @override */
31541
31314
  beforeDestruct(editor) {
31542
- this.dialog && this.dialog.destruct();
31315
+ Object.values((0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cached)(this, '__buttons') ?? {}).forEach(b => b.destruct());
31316
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cached)(this, 'dialog')?.destruct();
31317
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cached)(this, 'form')?.destruct();
31543
31318
  editor.e.off(editor.editor, '.imageproperties').off('.imageproperties');
31544
31319
  }
31545
31320
  }
31546
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
31547
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.marginIsLocked')
31548
- ], imageProperties.prototype, "onChangeMarginIsLocked", null);
31549
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
31550
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.sizeIsLocked')
31551
- ], imageProperties.prototype, "onChangeSizeIsLocked", null);
31552
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
31553
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.autobind
31554
- ], imageProperties.prototype, "onApply", null);
31555
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
31556
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.autobind
31557
- ], imageProperties.prototype, "openImageEditor", null);
31558
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
31559
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.autobind
31560
- ], imageProperties.prototype, "openImagePopup", null);
31561
- jodit_core_global__WEBPACK_IMPORTED_MODULE_1__/* .pluginSystem */ .fg.add('imageProperties', imageProperties);
31321
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
31322
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cache
31323
+ ], imageProperties.prototype, "form", null);
31324
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
31325
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cache
31326
+ ], imageProperties.prototype, "dialog", null);
31327
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
31328
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cache
31329
+ ], imageProperties.prototype, "__buttons", null);
31330
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
31331
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.image')
31332
+ ], imageProperties.prototype, "onStateValuesImageSrcChange", null);
31333
+ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .pluginSystem */ .fg.add('imageProperties', imageProperties);
31562
31334
 
31563
31335
 
31564
31336
  /***/ }),
31565
31337
 
31566
- /***/ 22254:
31338
+ /***/ 74260:
31567
31339
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31568
31340
 
31569
31341
  "use strict";
31570
31342
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31571
- /* harmony export */ Z: function() { return /* binding */ form; }
31343
+ /* harmony export */ g: function() { return /* binding */ readAlign; }
31572
31344
  /* harmony export */ });
31573
- /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(931);
31345
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(38322);
31346
+ /*!
31347
+ * Jodit Editor (https://xdsoft.net/jodit/)
31348
+ * Released under MIT see LICENSE.txt in the project root for license information.
31349
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31350
+ */
31351
+
31352
+ /** @private */
31353
+ function readAlign(image, values) {
31354
+ // Align
31355
+ if (image.style.cssFloat &&
31356
+ ['left', 'right'].indexOf(image.style.cssFloat.toLowerCase()) !== -1) {
31357
+ values.align = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_0__/* .css */ .A)(image, 'float');
31358
+ }
31359
+ else {
31360
+ if ((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_0__/* .css */ .A)(image, 'display') === 'block' &&
31361
+ image.style.marginLeft === 'auto' &&
31362
+ image.style.marginRight === 'auto') {
31363
+ values.align = 'center';
31364
+ }
31365
+ else {
31366
+ values.align = '';
31367
+ }
31368
+ }
31369
+ }
31370
+
31371
+
31372
+ /***/ }),
31373
+
31374
+ /***/ 5549:
31375
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31376
+
31377
+ "use strict";
31378
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31379
+ /* harmony export */ U: function() { return /* binding */ readValuesFromImage; }
31380
+ /* harmony export */ });
31381
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26150);
31382
+ /* harmony import */ var _align__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(74260);
31383
+ /* harmony import */ var _link__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(33201);
31384
+ /* harmony import */ var _margin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(85079);
31385
+ /* harmony import */ var _size__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(17880);
31386
+ /*!
31387
+ * Jodit Editor (https://xdsoft.net/jodit/)
31388
+ * Released under MIT see LICENSE.txt in the project root for license information.
31389
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31390
+ */
31391
+
31392
+
31393
+
31394
+
31395
+
31396
+ /**
31397
+ * Read values from image and set it to state
31398
+ * @private
31399
+ */
31400
+ async function readValuesFromImage(j, state) {
31401
+ const { sourceImage: image, values } = state;
31402
+ (0,_align__WEBPACK_IMPORTED_MODULE_3__/* .readAlign */ .g)(image, values);
31403
+ // Border radius
31404
+ values.borderRadius = parseInt(image.style.borderRadius || '0', 10) || 0;
31405
+ // Id
31406
+ values.id = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'id') || '';
31407
+ // Title
31408
+ values.imageTitle = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'title') || '';
31409
+ // Alt
31410
+ values.imageAlt = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'alt') || '';
31411
+ // Style
31412
+ values.style = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'style') || '';
31413
+ // Classes
31414
+ values.classes = ((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'class') || '').replace(/jodit_focused_image[\s]*/, '');
31415
+ // Margins
31416
+ (0,_margin__WEBPACK_IMPORTED_MODULE_4__/* .readMargins */ .E)(image, values, state);
31417
+ // Link
31418
+ (0,_link__WEBPACK_IMPORTED_MODULE_1__/* .readLink */ .X)(state, j, values);
31419
+ // Src
31420
+ values.imageSrc = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'src') || '';
31421
+ // Image size
31422
+ return (0,_size__WEBPACK_IMPORTED_MODULE_2__/* .readSizes */ .P)(image, values, state);
31423
+ }
31424
+
31425
+
31426
+ /***/ }),
31427
+
31428
+ /***/ 33201:
31429
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31430
+
31431
+ "use strict";
31432
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31433
+ /* harmony export */ X: function() { return /* binding */ readLink; }
31434
+ /* harmony export */ });
31435
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55186);
31436
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26150);
31437
+ /*!
31438
+ * Jodit Editor (https://xdsoft.net/jodit/)
31439
+ * Released under MIT see LICENSE.txt in the project root for license information.
31440
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31441
+ */
31442
+
31443
+
31444
+ /** @private */
31445
+ function readLink(state, j, values) {
31446
+ const a = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.closest(state.sourceImage, 'a', j.editor);
31447
+ if (a) {
31448
+ values.imageLink = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(a, 'href') || '';
31449
+ values.imageLinkOpenInNewTab = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(a, 'target') === '_blank';
31450
+ }
31451
+ else {
31452
+ values.imageLink = '';
31453
+ values.imageLinkOpenInNewTab = false;
31454
+ }
31455
+ }
31456
+
31457
+
31458
+ /***/ }),
31459
+
31460
+ /***/ 85079:
31461
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31462
+
31463
+ "use strict";
31464
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31465
+ /* harmony export */ E: function() { return /* binding */ readMargins; }
31466
+ /* harmony export */ });
31467
+ /* harmony import */ var jodit_core_helpers_string_kebab_case__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(449);
31468
+ /*!
31469
+ * Jodit Editor (https://xdsoft.net/jodit/)
31470
+ * Released under MIT see LICENSE.txt in the project root for license information.
31471
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31472
+ */
31473
+
31474
+ /** @private */
31475
+ function readMargins(image, values, state) {
31476
+ // Margins
31477
+ let equal = true, wasEmptyField = false;
31478
+ ['marginTop', 'marginRight', 'marginBottom', 'marginLeft'].forEach(id => {
31479
+ let value = image.style.getPropertyValue((0,jodit_core_helpers_string_kebab_case__WEBPACK_IMPORTED_MODULE_0__/* .kebabCase */ .k)(id));
31480
+ if (!value) {
31481
+ wasEmptyField = true;
31482
+ values[id] = 0;
31483
+ return;
31484
+ }
31485
+ if (/^[0-9]+(px)?$/.test(value)) {
31486
+ value = parseInt(value, 10);
31487
+ }
31488
+ values[id] = value;
31489
+ if ((wasEmptyField && values[id]) ||
31490
+ (equal && id !== 'marginTop' && values[id] !== values.marginTop)) {
31491
+ equal = false;
31492
+ }
31493
+ });
31494
+ state.marginIsLocked = equal;
31495
+ }
31496
+
31497
+
31498
+ /***/ }),
31499
+
31500
+ /***/ 17880:
31501
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31502
+
31503
+ "use strict";
31504
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31505
+ /* harmony export */ P: function() { return /* binding */ readSizes; }
31506
+ /* harmony export */ });
31507
+ /* harmony import */ var jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(12461);
31508
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26150);
31509
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(38322);
31510
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9645);
31574
31511
  /*!
31575
31512
  * Jodit Editor (https://xdsoft.net/jodit/)
31576
31513
  * Released under MIT see LICENSE.txt in the project root for license information.
31577
31514
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31578
31515
  */
31579
31516
 
31580
- function form(editor) {
31581
- 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);
31582
- return editor.c.fromHTML(`<form class="jodit-properties">
31517
+
31518
+
31519
+
31520
+ /** @private */
31521
+ async function readSizes(image, values, state) {
31522
+ await image.decode();
31523
+ 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;
31524
+ 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;
31525
+ values.imageWidth =
31526
+ width !== false
31527
+ ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeFromString */ .G)(width)
31528
+ : image.offsetWidth || image.naturalWidth;
31529
+ values.imageHeight =
31530
+ height !== false
31531
+ ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeFromString */ .G)(height)
31532
+ : image.offsetHeight || image.naturalHeight;
31533
+ const { imageWidth, imageHeight } = values;
31534
+ const w = parseFloat(imageWidth.toString());
31535
+ 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)) {
31536
+ state.sizeIsLocked = false;
31537
+ return;
31538
+ }
31539
+ if (height === false) {
31540
+ values.imageHeight = Math.round(w / state.ratio);
31541
+ state.sizeIsLocked = true;
31542
+ return;
31543
+ }
31544
+ const h = parseFloat(imageHeight.toString());
31545
+ state.sizeIsLocked = Math.abs(w - h * state.ratio) < 1;
31546
+ }
31547
+
31548
+
31549
+ /***/ }),
31550
+
31551
+ /***/ 31970:
31552
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31553
+
31554
+ "use strict";
31555
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31556
+ /* harmony export */ l: function() { return /* binding */ UIImagePropertiesForm; }
31557
+ /* harmony export */ });
31558
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(31635);
31559
+ /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22664);
31560
+ /* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(24767);
31561
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(65147);
31562
+ /* harmony import */ var jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6455);
31563
+ /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(931);
31564
+ /* harmony import */ var jodit_modules_widget__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(16116);
31565
+ /* harmony import */ var _ui_image_main_tab__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(33403);
31566
+ /* harmony import */ var _ui_image_position_tab__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(46681);
31567
+ /*!
31568
+ * Jodit Editor (https://xdsoft.net/jodit/)
31569
+ * Released under MIT see LICENSE.txt in the project root for license information.
31570
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31571
+ */
31572
+
31573
+
31574
+
31575
+
31576
+
31577
+
31578
+
31579
+
31580
+
31581
+
31582
+ /** @private */
31583
+ let UIImagePropertiesForm = class UIImagePropertiesForm extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_2__/* .UIGroup */ .U {
31584
+ className() {
31585
+ return 'UIImagePropertiesForm';
31586
+ }
31587
+ appendChildToContainer() { }
31588
+ getElm(elementName) {
31589
+ const selfElm = super.getElm(elementName);
31590
+ if (selfElm) {
31591
+ return selfElm;
31592
+ }
31593
+ for (const child of this.elements) {
31594
+ const elm = child.getElm(elementName);
31595
+ if (elm) {
31596
+ return elm;
31597
+ }
31598
+ }
31599
+ return null;
31600
+ }
31601
+ constructor(jodit, state, activeTabState, handlers) {
31602
+ super(jodit);
31603
+ this.state = state;
31604
+ this.handlers = handlers;
31605
+ this.__mainTab = new _ui_image_main_tab__WEBPACK_IMPORTED_MODULE_5__/* .UIImageMainTab */ .k(this.jodit, this.state, this.handlers);
31606
+ this.__positionTab = new _ui_image_position_tab__WEBPACK_IMPORTED_MODULE_6__/* .UIImagePositionTab */ ._(this.jodit, this.state, this.handlers);
31607
+ this.getElm('tabsBox').appendChild((0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_4__/* .TabsWidget */ .Zg)(jodit, [
31608
+ { name: 'Image', content: this.__mainTab },
31609
+ { name: 'Advanced', content: this.__positionTab }
31610
+ ], activeTabState));
31611
+ this.setMod('lock-size', this.state.sizeIsLocked);
31612
+ this.append(this.__mainTab).append(this.__positionTab);
31613
+ }
31614
+ render() {
31615
+ return `<form>
31583
31616
  <div class="jodit-grid jodit-grid_xs-column">
31584
31617
  <div class="jodit_col-lg-2-5 jodit_col-xs-5-5">
31585
- <div class="jodit-properties_view_box">
31586
- <div style="${!showPreview ? 'display:none' : ''}" class="jodit-properties_image_view">
31587
- <img data-ref="imageViewSrc" src="" alt=""/>
31618
+ <div class="&__view-box">
31619
+ <div class="&__imageView">
31620
+ <img class="&__imageViewSrc" src="" alt=""/>
31588
31621
  </div>
31589
- <div style="${!editSize ? 'display:none' : ''}" class="jodit-form__group jodit-properties_image_sizes">
31590
- <input data-ref="imageWidth" type="text" class="jodit-input"/>
31591
- <a data-ref="lockSize" class="jodit-properties__lock">${gi('lock')}</a>
31592
- <input data-ref="imageHeight" type="text" class="imageHeight jodit-input"/>
31622
+ <div class="jodit-form__group &__imageSizes">
31623
+ <input type="text" class="jodit-input &__imageWidth"/>
31624
+ <a class="&__lockSize">${jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__/* .Icon */ .I.get('lock')}</a>
31625
+ <input type="text" class="&__imageHeight jodit-input"/>
31593
31626
  </div>
31594
31627
  </div>
31595
31628
  </div>
31596
- <div data-ref="tabsBox" class="jodit_col-lg-3-5 jodit_col-xs-5-5"></div>
31629
+ <div class="jodit_col-lg-3-5 jodit_col-xs-5-5 &__tabsBox"></div>
31597
31630
  </div>
31598
- </form>`);
31599
- }
31631
+ </form>`;
31632
+ }
31633
+ onChangeSizeIsLocked() {
31634
+ const lockSize = this.getElm('lockSize');
31635
+ const imageWidth = this.getElm('imageWidth');
31636
+ lockSize.innerHTML = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__/* .Icon */ .I.get(this.state.sizeIsLocked ? 'lock' : 'unlock');
31637
+ this.setMod('lock-size', this.state.sizeIsLocked);
31638
+ this.j.e.fire(imageWidth, 'change');
31639
+ }
31640
+ onLockSizeClick() {
31641
+ this.state.sizeIsLocked = !this.state.sizeIsLocked;
31642
+ }
31643
+ onStateValuesSizeChange() {
31644
+ const imageWidth = this.getElm('imageWidth');
31645
+ const imageHeight = this.getElm('imageHeight');
31646
+ if (imageWidth !== this.j.od.activeElement) {
31647
+ imageWidth.value = this.state.values.imageWidth.toString();
31648
+ }
31649
+ if (imageHeight !== this.j.od.activeElement) {
31650
+ imageHeight.value = this.state.values.imageHeight.toString();
31651
+ }
31652
+ }
31653
+ onImageWidthChange(e) {
31654
+ const imageWidth = this.getElm('imageWidth');
31655
+ const imageHeight = this.getElm('imageHeight');
31656
+ if (!this.state.sizeIsLocked ||
31657
+ !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.isNumeric)(imageWidth.value) ||
31658
+ !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.isNumeric)(imageHeight.value)) {
31659
+ this.state.values.imageWidth = imageWidth.value;
31660
+ this.state.values.imageHeight = imageHeight.value;
31661
+ return;
31662
+ }
31663
+ const w = parseFloat(imageWidth.value), h = parseFloat(imageHeight.value);
31664
+ if (e.target === imageWidth) {
31665
+ this.state.values.imageWidth = w;
31666
+ this.state.values.imageHeight = Math.round(w / this.state.ratio);
31667
+ }
31668
+ else {
31669
+ this.state.values.imageWidth = Math.round(h * this.state.ratio);
31670
+ this.state.values.imageHeight = h;
31671
+ }
31672
+ }
31673
+ onStateValuesImageSrcChange() {
31674
+ const { imageSrc } = this.state.values;
31675
+ if (!imageSrc) {
31676
+ return;
31677
+ }
31678
+ const imageViewSrc = this.getElm('imageViewSrc');
31679
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.attr)(imageViewSrc, 'src', imageSrc);
31680
+ const image = new Image();
31681
+ image.src = imageSrc;
31682
+ this.state.image = image;
31683
+ }
31684
+ hideFieldByOptions() {
31685
+ const opt = this.j.o.image;
31686
+ [
31687
+ ['editSize', 'imageSizes'],
31688
+ ['showPreview', 'imageView']
31689
+ ].forEach(([optKey, elmKey]) => {
31690
+ const elm = this.getElm(elmKey);
31691
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.css)(elm, 'display', opt[optKey] ? null : 'none');
31692
+ });
31693
+ }
31694
+ };
31695
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31696
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready'),
31697
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.sizeIsLocked')
31698
+ ], UIImagePropertiesForm.prototype, "onChangeSizeIsLocked", null);
31699
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31700
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('lockSize:click')
31701
+ ], UIImagePropertiesForm.prototype, "onLockSizeClick", null);
31702
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31703
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready'),
31704
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)(['state.values.imageWidth', 'state.values.imageHeight'])
31705
+ ], UIImagePropertiesForm.prototype, "onStateValuesSizeChange", null);
31706
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31707
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([
31708
+ 'imageWidth:change',
31709
+ 'imageHeight:change',
31710
+ 'imageWidth:keydown',
31711
+ 'imageHeight:keydown',
31712
+ 'imageWidth:mousedown',
31713
+ 'imageHeight:mousedown',
31714
+ 'imageWidth:paste',
31715
+ 'imageHeight:paste'
31716
+ ]),
31717
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.debounce)()
31718
+ ], UIImagePropertiesForm.prototype, "onImageWidthChange", null);
31719
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31720
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready'),
31721
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.values.imageSrc')
31722
+ ], UIImagePropertiesForm.prototype, "onStateValuesImageSrcChange", null);
31723
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31724
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready')
31725
+ ], UIImagePropertiesForm.prototype, "hideFieldByOptions", null);
31726
+ UIImagePropertiesForm = (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31727
+ jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_8__/* .component */ .s
31728
+ ], UIImagePropertiesForm);
31729
+
31600
31730
 
31601
31731
 
31602
31732
  /***/ }),
31603
31733
 
31604
- /***/ 75263:
31734
+ /***/ 33403:
31605
31735
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31606
31736
 
31607
31737
  "use strict";
31608
31738
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31609
- /* harmony export */ J: function() { return /* binding */ mainTab; }
31739
+ /* harmony export */ k: function() { return /* binding */ UIImageMainTab; }
31610
31740
  /* harmony export */ });
31611
- /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(931);
31741
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(31635);
31742
+ /* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(24767);
31743
+ /* harmony import */ var jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71151);
31744
+ /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(66927);
31745
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65147);
31746
+ /* harmony import */ var jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6455);
31612
31747
  /*!
31613
31748
  * Jodit Editor (https://xdsoft.net/jodit/)
31614
31749
  * Released under MIT see LICENSE.txt in the project root for license information.
31615
31750
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31616
31751
  */
31617
31752
 
31618
- function mainTab(editor) {
31619
- 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;
31620
- return editor.c.fromHTML(`<div style="${!opt.image.editSrc ? 'display:none' : ''}" class="jodit-form__group">
31621
- <label>${i18n('Src')}</label>
31753
+
31754
+
31755
+
31756
+
31757
+
31758
+ /** @private */
31759
+ let UIImageMainTab = class UIImageMainTab extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_3__/* .UIGroup */ .U {
31760
+ className() {
31761
+ return 'UIImageMainTab';
31762
+ }
31763
+ appendChildToContainer() {
31764
+ // Do nothing
31765
+ }
31766
+ constructor(view, state, handlers) {
31767
+ super(view);
31768
+ this.state = state;
31769
+ this.handlers = handlers;
31770
+ }
31771
+ render() {
31772
+ return `<div class="jodit-form__group &__editSrc">
31773
+ <label>~Src~</label>
31622
31774
  <div class="jodit-input_group">
31623
- <input data-ref="imageSrc" class="jodit-input" type="text"/>
31624
- <div
31625
- class="jodit-input_group-buttons"
31626
- style="${hasFbUrl ? '' : 'display: none'}"
31627
- >
31628
- <a
31629
- data-ref="changeImage"
31630
- class="jodit-button"
31631
- >${gi('image')}</a>
31632
- <a
31633
- data-ref="editImage"
31634
- class="jodit-button"
31635
- style="${hasEditor ? '' : 'display: none'}"
31636
- >${gi('crop')}</a>
31775
+ <input class="jodit-input &__imageSrc" type="text"/>
31776
+ <div class="jodit-input_group-buttons &__fixImage">
31777
+ <a class="jodit-button &__changeImage">*image*</a>
31778
+ <a class="jodit-button &__editImage">*crop*</a>
31637
31779
  </div>
31638
31780
  </div>
31639
31781
  </div>
31640
- <div style="${!opt.image.editTitle ? 'display:none' : ''}" class="jodit-form__group">
31641
- <label>${i18n('Title')}</label>
31642
- <input data-ref="imageTitle" type="text" class="jodit-input"/>
31782
+ <div class="jodit-form__group &__editTitle">
31783
+ <label>~Title~</label>
31784
+ <input type="text" class="jodit-input &__imageTitle"/>
31643
31785
  </div>
31644
- <div style="${!opt.image.editAlt ? 'display:none' : ''}" class="jodit-form__group">
31645
- <label>${i18n('Alternative')}</label>
31646
- <input data-ref="imageAlt" type="text" class="jodit-input"/>
31786
+ <div class="jodit-form__group &__editAlt">
31787
+ <label>~Alternative~</label>
31788
+ <input type="text" class="jodit-input &__imageAlt"/>
31647
31789
  </div>
31648
- <div style="${!opt.image.editLink ? 'display:none' : ''}" class="jodit-form__group">
31649
- <label>${i18n('Link')}</label>
31650
- <input data-ref="imageLink" type="text" class="jodit-input"/>
31790
+ <div class="jodit-form__group &__editLink">
31791
+ <label>~Link~</label>
31792
+ <input type="text" class="jodit-input &__imageLink"/>
31651
31793
  </div>
31652
- <div style="${!opt.image.editLink ? 'display:none' : ''}" class="jodit-form__group">
31794
+ <div class="jodit-form__group &__editLinkTarget">
31653
31795
  <label class="jodit_vertical_middle">
31654
- <input data-ref="imageLinkOpenInNewTab" type="checkbox" class="jodit-checkbox"/>
31655
- <span>${i18n('Open link in new tab')}</span>
31796
+ <input type="checkbox" class="jodit-checkbox &__imageLinkOpenInNewTab"/>
31797
+ <span>~Open link in new tab~</span>
31656
31798
  </label>
31657
- </div>`);
31658
- }
31799
+ </div>`;
31800
+ }
31801
+ async onStateImageSrcChange() {
31802
+ const imageSrc = this.getElm('imageSrc');
31803
+ imageSrc.value = this.state.values.imageSrc;
31804
+ }
31805
+ onImageSrcChange() {
31806
+ this.state.values.imageSrc = this.getElm('imageSrc').value;
31807
+ }
31808
+ /**
31809
+ * Open image editor
31810
+ */
31811
+ onEditImageClick(e) {
31812
+ this.handlers.openImageEditor();
31813
+ e.stopPropagation();
31814
+ }
31815
+ /**
31816
+ * Open popup with filebrowser/uploader buttons for image
31817
+ */
31818
+ onChangeImageClick(e) {
31819
+ this.handlers.openImagePopup(this.getElm('changeImage'));
31820
+ e.stopPropagation();
31821
+ }
31822
+ onStateTitleChange() {
31823
+ const title = this.getElm('imageTitle');
31824
+ title.value = this.state.values.imageTitle;
31825
+ }
31826
+ onTitleChange() {
31827
+ this.state.values.imageTitle = this.getElm('imageTitle').value;
31828
+ }
31829
+ onStateAltChange() {
31830
+ const alt = this.getElm('imageAlt');
31831
+ alt.value = this.state.values.imageAlt;
31832
+ }
31833
+ onAltChange() {
31834
+ this.state.values.imageAlt = this.getElm('imageAlt').value;
31835
+ }
31836
+ onStateImageLinkChange() {
31837
+ const imageLink = this.getElm('imageLink');
31838
+ imageLink.value = this.state.values.imageLink;
31839
+ }
31840
+ onImageLinkChange() {
31841
+ this.state.values.imageLink = this.getElm('imageLink').value;
31842
+ }
31843
+ onStateImageLinkOpenInNewTabChange() {
31844
+ const imageLinkOpenInNewTab = this.getElm('imageLinkOpenInNewTab');
31845
+ imageLinkOpenInNewTab.checked = this.state.values.imageLinkOpenInNewTab;
31846
+ }
31847
+ onImageLinkOpenInNewTabChange() {
31848
+ this.state.values.imageLinkOpenInNewTab = this.getElm('imageLinkOpenInNewTab').checked;
31849
+ }
31850
+ hideFieldByOptions() {
31851
+ const o = this.j.o;
31852
+ const opt = o.image;
31853
+ [
31854
+ ['editSrc', 'editSrc'],
31855
+ ['editTitle', 'editTitle'],
31856
+ ['editAlt', 'editAlt'],
31857
+ ['editLink', 'editLink'],
31858
+ ['editLink', 'editLinkTarget'],
31859
+ ['useImageEditor', 'editImage']
31860
+ ].forEach(([optKey, elmKey]) => {
31861
+ const elm = this.getElm(elmKey);
31862
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(elm, 'display', opt[optKey] ? null : 'none');
31863
+ });
31864
+ const changeImage = this.getElm('changeImage');
31865
+ const needShowChangeImage = Boolean(o.filebrowser.ajax.url || o.uploader.url);
31866
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(changeImage, 'display', needShowChangeImage ? null : 'none');
31867
+ const editImage = this.getElm('editImage');
31868
+ const needShowEditImage = Boolean(o.filebrowser.ajax.url) && opt.useImageEditor;
31869
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(editImage, 'display', needShowEditImage ? null : 'none');
31870
+ const fixImage = this.getElm('fixImage');
31871
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(fixImage, 'display', needShowChangeImage || needShowEditImage ? null : 'none');
31872
+ }
31873
+ };
31874
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31875
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageSrc')
31876
+ ], UIImageMainTab.prototype, "onStateImageSrcChange", null);
31877
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31878
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageSrc:change')
31879
+ ], UIImageMainTab.prototype, "onImageSrcChange", null);
31880
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31881
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('editImage:click')
31882
+ ], UIImageMainTab.prototype, "onEditImageClick", null);
31883
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31884
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('changeImage:click')
31885
+ ], UIImageMainTab.prototype, "onChangeImageClick", null);
31886
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31887
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageTitle')
31888
+ ], UIImageMainTab.prototype, "onStateTitleChange", null);
31889
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31890
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageTitle:change')
31891
+ ], UIImageMainTab.prototype, "onTitleChange", null);
31892
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31893
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageAlt')
31894
+ ], UIImageMainTab.prototype, "onStateAltChange", null);
31895
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31896
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageAlt:change')
31897
+ ], UIImageMainTab.prototype, "onAltChange", null);
31898
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31899
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageLink')
31900
+ ], UIImageMainTab.prototype, "onStateImageLinkChange", null);
31901
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31902
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageLink:change')
31903
+ ], UIImageMainTab.prototype, "onImageLinkChange", null);
31904
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31905
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageLinkOpenInNewTab')
31906
+ ], UIImageMainTab.prototype, "onStateImageLinkOpenInNewTabChange", null);
31907
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31908
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageLinkOpenInNewTab:change')
31909
+ ], UIImageMainTab.prototype, "onImageLinkOpenInNewTabChange", null);
31910
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31911
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready')
31912
+ ], UIImageMainTab.prototype, "hideFieldByOptions", null);
31913
+ UIImageMainTab = (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
31914
+ jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_5__/* .component */ .s
31915
+ ], UIImageMainTab);
31916
+
31659
31917
 
31660
31918
 
31661
31919
  /***/ }),
31662
31920
 
31663
- /***/ 57837:
31921
+ /***/ 46681:
31664
31922
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31665
31923
 
31666
31924
  "use strict";
31667
31925
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31668
- /* harmony export */ b: function() { return /* binding */ positionTab; }
31926
+ /* harmony export */ _: function() { return /* binding */ UIImagePositionTab; }
31669
31927
  /* harmony export */ });
31670
- /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(931);
31928
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(31635);
31929
+ /* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(24767);
31930
+ /* harmony import */ var jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71151);
31931
+ /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(66927);
31932
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65147);
31933
+ /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(98253);
31934
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(26150);
31935
+ /* harmony import */ var jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29780);
31936
+ /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(931);
31937
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(9645);
31671
31938
  /*!
31672
31939
  * Jodit Editor (https://xdsoft.net/jodit/)
31673
31940
  * Released under MIT see LICENSE.txt in the project root for license information.
31674
31941
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31675
31942
  */
31676
31943
 
31677
- function positionTab(editor) {
31678
- 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);
31679
- const classInput = [];
31680
- if (opt.image.availableClasses.length > 0) {
31681
- classInput.push('<select data-ref="classes" class="jodit-input jodit-select">');
31682
- opt.image.availableClasses.forEach(item => {
31683
- if (typeof item === 'string') {
31684
- classInput.push(`<option value="${item}">${item}</option>`);
31685
- }
31686
- else {
31687
- classInput.push(`<option value="${item[0]}">${item[1]}</option>`);
31688
- }
31689
- });
31690
- classInput.push('</select>');
31944
+
31945
+
31946
+
31947
+
31948
+
31949
+
31950
+
31951
+
31952
+
31953
+ /** @private */
31954
+ let UIImagePositionTab = class UIImagePositionTab extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_4__/* .UIElement */ .D {
31955
+ className() {
31956
+ return 'UIImagePositionTab';
31691
31957
  }
31692
- else {
31693
- classInput.push('<input data-ref="classes" type="text" class="jodit-input"/>');
31958
+ constructor(jodit, state, handlers) {
31959
+ super(jodit, {
31960
+ availableClasses: jodit.o.image.availableClasses
31961
+ });
31962
+ this.state = state;
31963
+ this.handlers = handlers;
31694
31964
  }
31695
- return editor.c.fromHTML(`<div style="${!opt.image.editMargins ? 'display:none' : ''}" class="jodit-form__group">
31696
- <label>${i18n('Margins')}</label>
31965
+ render({ availableClasses }) {
31966
+ return `<div class="jodit-form__group &__editMargins">
31967
+ <label>~Margins~</label>
31697
31968
  <div class="jodit-grid jodit_vertical_middle">
31698
- <input class="jodit_col-lg-1-5 jodit-input" data-ref="marginTop" type="text" placeholder="${i18n('top')}"/>
31699
- <a style="text-align: center;" data-ref="lockMargin" class="jodit-properties__lock jodit_col-lg-1-5">${gi('lock')}</a>
31700
- <input disabled="true" class="jodit_col-lg-1-5 jodit-input" data-ref="marginRight" type="text" placeholder="${i18n('right')}"/>
31701
- <input disabled="true" class="jodit_col-lg-1-5 jodit-input" data-ref="marginBottom" type="text" placeholder="${i18n('bottom')}"/>
31702
- <input disabled="true" class="jodit_col-lg-1-5 jodit-input" data-ref="marginLeft" type="text" placeholder="${i18n('left')}"/>
31969
+ <input class="jodit_col-lg-1-5 jodit-input &__marginTop" type="text" placeholder="~top~"/>
31970
+ <a style="text-align: center;" class="jodit-properties__lock jodit_col-lg-1-5 &__lockMargin">*lock*</a>
31971
+ <input disabled="disabled" class="jodit_col-lg-1-5 jodit-input &__marginRight" type="text" placeholder="~right~"/>
31972
+ <input disabled="disabled" class="jodit_col-lg-1-5 jodit-input &__marginBottom" type="text" placeholder="~bottom~"/>
31973
+ <input disabled="disabled" class="jodit_col-lg-1-5 jodit-input &__marginLeft" type="text" placeholder="~left~"/>
31703
31974
  </div>
31704
31975
  </div>
31705
- <div
31706
- style="${!opt.image.editAlign ? 'display:none' : ''}"
31707
- class="jodit-form__group"
31708
- >
31709
- <label>${i18n('Align')}</label>
31710
- <select data-ref="align" class="jodit-select">
31711
- <option value="">${i18n('--Not Set--')}</option>
31712
- <option value="left">${i18n('Left')}</option>
31713
- <option value="center">${i18n('Center')}</option>
31714
- <option value="right">${i18n('Right')}</option>
31976
+ <div class="jodit-form__group &__editAlign">
31977
+ <label>~Align~</label>
31978
+ <select class="jodit-select &__align">
31979
+ <option value="">~--Not Set--~</option>
31980
+ <option value="left">~Left~</option>
31981
+ <option value="center">~Center~</option>
31982
+ <option value="right">~Right~</option>
31715
31983
  </select>
31716
31984
  </div>
31717
- <div style="${!opt.image.editStyle ? 'display:none' : ''}" class="jodit-form__group">
31718
- <label>${i18n('Styles')}</label>
31719
- <input data-ref="style" type="text" class="jodit-input"/>
31985
+ <div class="jodit-form__group &__editStyle">
31986
+ <label>~Styles~</label>
31987
+ <input type="text" class="jodit-input &__style"/>
31720
31988
  </div>
31721
- <div style="${!opt.image.editClass ? 'display:none' : ''}" class="jodit-form__group">
31722
- <label>${i18n('Classes')}</label>
31723
- ${classInput.join('')}
31989
+ <div class="jodit-form__group &__editClass">
31990
+ <label>~Classes~</label>
31991
+ ${(() => {
31992
+ const classInput = [];
31993
+ if (availableClasses && availableClasses.length > 0) {
31994
+ classInput.push('<select class="jodit-input jodit-select &__classes">');
31995
+ availableClasses.forEach(item => {
31996
+ if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_7__/* .isString */ .K)(item)) {
31997
+ classInput.push(`<option value="${item}">${item}</option>`);
31998
+ }
31999
+ else {
32000
+ classInput.push(`<option value="${item[0]}">${item[1]}</option>`);
32001
+ }
32002
+ });
32003
+ classInput.push('</select>');
32004
+ }
32005
+ else {
32006
+ classInput.push('<input type="text" class="jodit-input &__classes"/>');
32007
+ }
32008
+ return classInput.join('');
32009
+ })()}
31724
32010
  </div>
31725
- <div style="${!opt.image.editId ? 'display:none' : ''}" class="jodit-form__group">
32011
+ <div class="jodit-form__group &__editId">
31726
32012
  <label>Id</label>
31727
- <input data-ref="id" type="text" class="jodit-input"/>
32013
+ <input type="text" class="jodit-input &__id"/>
31728
32014
  </div>
31729
32015
  <div
31730
- style="${!opt.image.editBorderRadius ? 'display:none' : ''}"
31731
- class="jodit-form__group"
32016
+ class="jodit-form__group &__editBorderRadius"
31732
32017
  >
31733
- <label>${i18n('Border radius')}</label>
31734
- <input data-ref="borderRadius" type="number" class="jodit-input"/>
31735
- </div>`);
32018
+ <label>~Border radius~</label>
32019
+ <input type="number" class="jodit-input &__borderRadius"/>
32020
+ </div>`;
32021
+ }
32022
+ onStateAlignChange() {
32023
+ const align = this.getElm('align');
32024
+ align.value = this.state.values.align;
32025
+ }
32026
+ onChangeAlign() {
32027
+ const align = this.getElm('align');
32028
+ this.state.values.align = align.value;
32029
+ }
32030
+ onStateValuesBorderRadiusChange() {
32031
+ const borderRadius = this.getElm('borderRadius');
32032
+ borderRadius.value = this.state.values.borderRadius.toString();
32033
+ }
32034
+ onChangeBorderRadius() {
32035
+ const borderRadius = this.getElm('borderRadius');
32036
+ this.state.values.borderRadius = parseFloat(borderRadius.value);
32037
+ }
32038
+ onStateValuesIdChange() {
32039
+ const id = this.getElm('id');
32040
+ id.value = this.state.values.id;
32041
+ }
32042
+ onChangeId() {
32043
+ const id = this.getElm('id');
32044
+ this.state.values.id = id.value;
32045
+ }
32046
+ onStateValuesStyleChange() {
32047
+ const style = this.getElm('style');
32048
+ style.value = this.state.values.style;
32049
+ }
32050
+ onChangeStyle() {
32051
+ const style = this.getElm('style');
32052
+ this.state.values.style = style.value;
32053
+ }
32054
+ onStateValuesClassesChange() {
32055
+ const classes = this.getElm('classes');
32056
+ classes.value = this.state.values.classes;
32057
+ }
32058
+ onChangClasses() {
32059
+ const classes = this.getElm('classes');
32060
+ this.state.values.classes = classes.value;
32061
+ }
32062
+ onLockMarginClick(e) {
32063
+ this.state.marginIsLocked = !this.state.marginIsLocked;
32064
+ e.preventDefault();
32065
+ }
32066
+ onChangeMarginIsLocked() {
32067
+ const marginBottom = this.getElm('marginBottom');
32068
+ const marginRight = this.getElm('marginRight');
32069
+ const marginLeft = this.getElm('marginLeft');
32070
+ const lockMargin = this.getElm('lockMargin');
32071
+ [marginRight, marginBottom, marginLeft].forEach(elm => {
32072
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_3__/* .attr */ .C)(elm, 'disabled', this.state.marginIsLocked || null);
32073
+ });
32074
+ lockMargin.innerHTML = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_5__/* .Icon */ .I.get(this.state.marginIsLocked ? 'lock' : 'unlock');
32075
+ if (this.state.marginIsLocked) {
32076
+ const marginTop = this.state.values.marginTop;
32077
+ this.state.values.marginRight = marginTop;
32078
+ this.state.values.marginBottom = marginTop;
32079
+ this.state.values.marginLeft = marginTop;
32080
+ }
32081
+ }
32082
+ onStateValuesMarginChange() {
32083
+ const marginTop = this.getElm('marginTop');
32084
+ const marginRight = this.getElm('marginRight');
32085
+ const marginBottom = this.getElm('marginBottom');
32086
+ const marginLeft = this.getElm('marginLeft');
32087
+ marginTop.value = this.state.values.marginTop.toString();
32088
+ marginRight.value = this.state.values.marginRight.toString();
32089
+ marginBottom.value = this.state.values.marginBottom.toString();
32090
+ marginLeft.value = this.state.values.marginLeft.toString();
32091
+ }
32092
+ onChangeMargin() {
32093
+ const marginTop = this.getElm('marginTop');
32094
+ const marginRight = this.getElm('marginRight');
32095
+ const marginBottom = this.getElm('marginBottom');
32096
+ const marginLeft = this.getElm('marginLeft');
32097
+ this.state.values.marginTop = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginTop.value);
32098
+ if (this.state.marginIsLocked) {
32099
+ this.state.values.marginRight = this.state.values.marginTop;
32100
+ this.state.values.marginBottom = this.state.values.marginTop;
32101
+ this.state.values.marginLeft = this.state.values.marginTop;
32102
+ }
32103
+ else {
32104
+ this.state.values.marginRight = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginRight.value);
32105
+ this.state.values.marginBottom = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginBottom.value);
32106
+ this.state.values.marginLeft = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginLeft.value);
32107
+ }
32108
+ }
32109
+ hideFieldByOptions() {
32110
+ const opt = this.j.o.image;
32111
+ [
32112
+ ['editMargins', 'editMargins'],
32113
+ ['editAlign', 'editAlign'],
32114
+ ['editStyle', 'editStyle'],
32115
+ ['editClass', 'editClass'],
32116
+ ['editId', 'editId'],
32117
+ ['editBorderRadius', 'editBorderRadius']
32118
+ ].forEach(([optKey, elmKey]) => {
32119
+ const elm = this.getElm(elmKey);
32120
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(elm, 'display', opt[optKey] ? null : 'none');
32121
+ });
32122
+ }
32123
+ };
32124
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32125
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32126
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.align')
32127
+ ], UIImagePositionTab.prototype, "onStateAlignChange", null);
32128
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32129
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('align:change')
32130
+ ], UIImagePositionTab.prototype, "onChangeAlign", null);
32131
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32132
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32133
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.borderRadius')
32134
+ ], UIImagePositionTab.prototype, "onStateValuesBorderRadiusChange", null);
32135
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32136
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('borderRadius:change')
32137
+ ], UIImagePositionTab.prototype, "onChangeBorderRadius", null);
32138
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32139
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32140
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.id')
32141
+ ], UIImagePositionTab.prototype, "onStateValuesIdChange", null);
32142
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32143
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('id:change')
32144
+ ], UIImagePositionTab.prototype, "onChangeId", null);
32145
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32146
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32147
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.style')
32148
+ ], UIImagePositionTab.prototype, "onStateValuesStyleChange", null);
32149
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32150
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('style:change')
32151
+ ], UIImagePositionTab.prototype, "onChangeStyle", null);
32152
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32153
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32154
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.classes')
32155
+ ], UIImagePositionTab.prototype, "onStateValuesClassesChange", null);
32156
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32157
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('classes:change')
32158
+ ], UIImagePositionTab.prototype, "onChangClasses", null);
32159
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32160
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('lockMargin:click')
32161
+ ], UIImagePositionTab.prototype, "onLockMarginClick", null);
32162
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32163
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32164
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.marginIsLocked')
32165
+ ], UIImagePositionTab.prototype, "onChangeMarginIsLocked", null);
32166
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32167
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32168
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)([
32169
+ 'state.values.marginTop',
32170
+ 'state.values.marginRight',
32171
+ 'state.values.marginBottom',
32172
+ 'state.values.marginLeft'
32173
+ ])
32174
+ ], UIImagePositionTab.prototype, "onStateValuesMarginChange", null);
32175
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32176
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)([
32177
+ 'marginTop:change',
32178
+ 'marginRight:change',
32179
+ 'marginBottom:change',
32180
+ 'marginLeft:change'
32181
+ ])
32182
+ ], UIImagePositionTab.prototype, "onChangeMargin", null);
32183
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32184
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready')
32185
+ ], UIImagePositionTab.prototype, "hideFieldByOptions", null);
32186
+ UIImagePositionTab = (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32187
+ jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_9__/* .component */ .s
32188
+ ], UIImagePositionTab);
32189
+
32190
+
32191
+
32192
+ /***/ }),
32193
+
32194
+ /***/ 80778:
32195
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32196
+
32197
+ "use strict";
32198
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32199
+ /* harmony export */ v: function() { return /* binding */ openImageEditorDialog; }
32200
+ /* harmony export */ });
32201
+ /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(98253);
32202
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26150);
32203
+ /* harmony import */ var jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(53804);
32204
+ /*!
32205
+ * Jodit Editor (https://xdsoft.net/jodit/)
32206
+ * Released under MIT see LICENSE.txt in the project root for license information.
32207
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32208
+ */
32209
+
32210
+
32211
+
32212
+ /**
32213
+ * Open image editor dialog
32214
+ * @private
32215
+ */
32216
+ function openImageEditorDialog(j, state) {
32217
+ const url = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(state.image, 'src') || '', a = j.c.element('a'), loadExternal = () => {
32218
+ if (a.host !== location.host) {
32219
+ j.confirm('You can only edit your own images. Download this image on the host?', yes => {
32220
+ if (yes && j.uploader) {
32221
+ j.uploader.uploadRemoteImage(a.href.toString(), resp => {
32222
+ j.alert('The image has been successfully uploaded to the host!', () => {
32223
+ if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_2__/* .isString */ .K)(resp.newfilename)) {
32224
+ state.values.imageSrc =
32225
+ resp.baseurl +
32226
+ resp.newfilename;
32227
+ }
32228
+ });
32229
+ }, error => {
32230
+ j.alert('There was an error loading %s', error.message);
32231
+ });
32232
+ }
32233
+ });
32234
+ return;
32235
+ }
32236
+ };
32237
+ a.href = url;
32238
+ j.filebrowser.dataProvider
32239
+ .getPathByUrl(a.href.toString())
32240
+ .then(resp => {
32241
+ jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_1__/* .openImageEditor */ .B.call(j.filebrowser, a.href, resp.name, resp.path, resp.source, () => {
32242
+ const timestamp = new Date().getTime();
32243
+ state.values.imageSrc =
32244
+ url +
32245
+ (url.indexOf('?') !== -1 ? '' : '?') +
32246
+ '&_tmp=' +
32247
+ timestamp.toString();
32248
+ }, error => {
32249
+ j.alert(error.message);
32250
+ });
32251
+ })
32252
+ .catch(error => {
32253
+ j.alert(error.message, loadExternal);
32254
+ });
32255
+ }
32256
+
32257
+
32258
+ /***/ }),
32259
+
32260
+ /***/ 33733:
32261
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32262
+
32263
+ "use strict";
32264
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32265
+ /* harmony export */ q: function() { return /* binding */ openImagePopup; }
32266
+ /* harmony export */ });
32267
+ /* harmony import */ var jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(37923);
32268
+ /* harmony import */ var jodit_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(27594);
32269
+ /* harmony import */ var jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(80071);
32270
+ /* harmony import */ var jodit_modules_widget_file_selector_file_selector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10067);
32271
+ /*!
32272
+ * Jodit Editor (https://xdsoft.net/jodit/)
32273
+ * Released under MIT see LICENSE.txt in the project root for license information.
32274
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32275
+ */
32276
+
32277
+
32278
+
32279
+
32280
+ /** @private */
32281
+ function openImagePopup(j, dialog, state, button) {
32282
+ const popup = new jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_0__/* .Popup */ .z(dialog);
32283
+ const closePopup = () => {
32284
+ popup.close();
32285
+ popup.destruct();
32286
+ };
32287
+ popup
32288
+ .setContent((0,jodit_modules_widget_file_selector_file_selector__WEBPACK_IMPORTED_MODULE_1__/* .FileSelectorWidget */ .k)(j, {
32289
+ upload: (data) => {
32290
+ if (data.files && data.files.length) {
32291
+ state.values.imageSrc =
32292
+ data.baseurl + data.files[0];
32293
+ }
32294
+ closePopup();
32295
+ },
32296
+ filebrowser: async (data) => {
32297
+ if (data && (0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_2__/* .isArray */ .c)(data.files) && data.files.length) {
32298
+ state.values.imageSrc = data.files[0];
32299
+ closePopup();
32300
+ }
32301
+ }
32302
+ }, state.image, closePopup))
32303
+ .open(() => (0,jodit_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_3__/* .position */ .G)(button));
32304
+ }
32305
+
32306
+
32307
+ /***/ }),
32308
+
32309
+ /***/ 9645:
32310
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32311
+
32312
+ "use strict";
32313
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32314
+ /* harmony export */ G: function() { return /* binding */ normalSizeFromString; },
32315
+ /* harmony export */ n: function() { return /* binding */ normalSizeToString; }
32316
+ /* harmony export */ });
32317
+ /* harmony import */ var jodit_core_helpers_checker_is_number__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2461);
32318
+ /* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(59101);
32319
+ /*!
32320
+ * Jodit Editor (https://xdsoft.net/jodit/)
32321
+ * Released under MIT see LICENSE.txt in the project root for license information.
32322
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32323
+ */
32324
+
32325
+
32326
+ /** @private */
32327
+ const normalSizeFromString = (value) => {
32328
+ return /^[-+]?[0-9.]+(px)?$/.test(value.toString())
32329
+ ? parseFloat(value.toString())
32330
+ : value;
32331
+ };
32332
+ /** @private */
32333
+ const normalSizeToString = (value) => {
32334
+ if ((0,jodit_core_helpers_checker_is_number__WEBPACK_IMPORTED_MODULE_1__/* .isNumber */ .E)(value)) {
32335
+ return value ? value + 'px' : value.toString();
32336
+ }
32337
+ value = (0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_0__/* .trim */ .Bq)(value);
32338
+ return /^[0-9]+$/.test(value) ? value + 'px' : value;
32339
+ };
32340
+
32341
+
32342
+ /***/ }),
32343
+
32344
+ /***/ 30393:
32345
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32346
+
32347
+ "use strict";
32348
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32349
+ /* harmony export */ j: function() { return /* binding */ applyValuesToImage; }
32350
+ /* harmony export */ });
32351
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55186);
32352
+ /* harmony import */ var jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97369);
32353
+ /* harmony import */ var _link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(88269);
32354
+ /* harmony import */ var _margin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(78139);
32355
+ /* harmony import */ var _size__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(58972);
32356
+ /*!
32357
+ * Jodit Editor (https://xdsoft.net/jodit/)
32358
+ * Released under MIT see LICENSE.txt in the project root for license information.
32359
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32360
+ */
32361
+
32362
+
32363
+
32364
+
32365
+
32366
+ /**
32367
+ * Apply form's values to image
32368
+ * @private
32369
+ */
32370
+ function applyValuesToImage(j, state, image) {
32371
+ const { style, imageSrc, borderRadius, imageTitle, imageAlt, imageLink, imageWidth, imageHeight, marginTop, marginRight, marginBottom, marginLeft, imageLinkOpenInNewTab, align, classes, id } = state.values;
32372
+ const opt = j.o;
32373
+ // styles
32374
+ if (opt.image.editStyle) {
32375
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'style', style || null);
32376
+ }
32377
+ // Src
32378
+ if (imageSrc) {
32379
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'src', imageSrc);
32380
+ }
32381
+ else {
32382
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.safeRemove(image);
32383
+ return;
32384
+ }
32385
+ // Border radius
32386
+ image.style.borderRadius = borderRadius ? borderRadius + 'px' : '';
32387
+ // Title
32388
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'title', imageTitle || null);
32389
+ // Alt
32390
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'alt', imageAlt || null);
32391
+ // Link
32392
+ (0,_link__WEBPACK_IMPORTED_MODULE_2__/* .applyLink */ .j)(j, image, imageLink, imageLinkOpenInNewTab);
32393
+ // Size
32394
+ (0,_size__WEBPACK_IMPORTED_MODULE_4__/* .applySize */ .q)(image, imageWidth, imageHeight, state.sizeIsLocked);
32395
+ // Margin
32396
+ if (j.o.image.editMargins) {
32397
+ (0,_margin__WEBPACK_IMPORTED_MODULE_3__/* .applyMargin */ .N)(j, marginTop, marginRight, marginBottom, marginLeft, image, state.marginIsLocked);
32398
+ }
32399
+ if (opt.image.editClass) {
32400
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'class', classes || null);
32401
+ }
32402
+ if (opt.image.editId) {
32403
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'id', id || null);
32404
+ }
32405
+ if (opt.image.editAlign) {
32406
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.hAlignElement)(image, align);
32407
+ }
32408
+ }
32409
+
32410
+
32411
+ /***/ }),
32412
+
32413
+ /***/ 88269:
32414
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32415
+
32416
+ "use strict";
32417
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32418
+ /* harmony export */ j: function() { return /* binding */ applyLink; }
32419
+ /* harmony export */ });
32420
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55186);
32421
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26150);
32422
+ /*!
32423
+ * Jodit Editor (https://xdsoft.net/jodit/)
32424
+ * Released under MIT see LICENSE.txt in the project root for license information.
32425
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32426
+ */
32427
+
32428
+
32429
+ /** @private */
32430
+ function applyLink(j, image, imageLink, imageLinkOpenInNewTab) {
32431
+ // Link
32432
+ let link = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.closest(image, 'a', j.editor);
32433
+ if (imageLink) {
32434
+ if (!link) {
32435
+ link = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.wrap(image, 'a', j.createInside);
32436
+ }
32437
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(link, 'href', imageLink);
32438
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(link, 'target', imageLinkOpenInNewTab ? '_blank' : null);
32439
+ }
32440
+ else {
32441
+ if (link && link.parentNode) {
32442
+ link.parentNode.replaceChild(image, link);
32443
+ }
32444
+ }
32445
+ }
32446
+
32447
+
32448
+ /***/ }),
32449
+
32450
+ /***/ 78139:
32451
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32452
+
32453
+ "use strict";
32454
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32455
+ /* harmony export */ N: function() { return /* binding */ applyMargin; }
32456
+ /* harmony export */ });
32457
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(38322);
32458
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9645);
32459
+ /*!
32460
+ * Jodit Editor (https://xdsoft.net/jodit/)
32461
+ * Released under MIT see LICENSE.txt in the project root for license information.
32462
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32463
+ */
32464
+
32465
+
32466
+ /** @private */
32467
+ function applyMargin(j, marginTop, marginRight, marginBottom, marginLeft, image, marginIsLocked) {
32468
+ const margins = [marginTop, marginRight, marginBottom, marginLeft];
32469
+ const applyMargin = (key, value) => {
32470
+ const oldValue = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_1__/* .css */ .A)(image, key);
32471
+ const v = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_0__/* .normalSizeToString */ .n)(value);
32472
+ if (oldValue.toString() !== v.toString()) {
32473
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_1__/* .css */ .A)(image, key, v);
32474
+ }
32475
+ };
32476
+ if (!marginIsLocked) {
32477
+ const sides = [
32478
+ 'margin-top',
32479
+ 'margin-right',
32480
+ 'margin-bottom',
32481
+ 'margin-left'
32482
+ ];
32483
+ margins.forEach((margin, index) => {
32484
+ const side = sides[index];
32485
+ applyMargin(side, margin);
32486
+ });
32487
+ }
32488
+ else {
32489
+ applyMargin('margin', marginTop);
32490
+ }
32491
+ }
32492
+
32493
+
32494
+ /***/ }),
32495
+
32496
+ /***/ 58972:
32497
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32498
+
32499
+ "use strict";
32500
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32501
+ /* harmony export */ q: function() { return /* binding */ applySize; }
32502
+ /* harmony export */ });
32503
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26150);
32504
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(38322);
32505
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9645);
32506
+ /*!
32507
+ * Jodit Editor (https://xdsoft.net/jodit/)
32508
+ * Released under MIT see LICENSE.txt in the project root for license information.
32509
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32510
+ */
32511
+
32512
+
32513
+
32514
+ /** @private */
32515
+ function applySize(image, imageWidth, imageHeight, sizeIsLocked) {
32516
+ // Size
32517
+ if (imageWidth !== image.offsetWidth ||
32518
+ imageHeight !== image.offsetHeight) {
32519
+ const updatedWidth = imageWidth ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeToString */ .n)(imageWidth) : null;
32520
+ let updatedHeight = imageHeight
32521
+ ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeToString */ .n)(imageHeight)
32522
+ : null;
32523
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__/* .css */ .A)(image, {
32524
+ width: updatedWidth,
32525
+ height: updatedWidth && sizeIsLocked ? null : updatedHeight
32526
+ });
32527
+ (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);
32528
+ if (!(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'width') || sizeIsLocked) {
32529
+ updatedHeight = null;
32530
+ }
32531
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'height', updatedHeight);
32532
+ }
31736
32533
  }
31737
32534
 
31738
32535
 
@@ -38091,7 +38888,8 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_3__/* .pluginSystem */ .fg.add('selec
38091
38888
  */
38092
38889
 
38093
38890
  jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.select = {
38094
- normalizeSelectionBeforeCutAndCopy: false
38891
+ normalizeSelectionBeforeCutAndCopy: false,
38892
+ normalizeTripleClick: true
38095
38893
  };
38096
38894
 
38097
38895
 
@@ -38167,7 +38965,7 @@ class select extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_3__/* .Plugin */
38167
38965
  }
38168
38966
  }
38169
38967
  /**
38170
- * @event outsideClick(e) - when user clicked in the outside of editor
38968
+ * @event outsideClick(e) - when user clicked on the outside of editor
38171
38969
  */
38172
38970
  onOutsideClick(e) {
38173
38971
  const node = e.target;
@@ -38179,7 +38977,7 @@ class select extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_3__/* .Plugin */
38179
38977
  this.j.e.fire('outsideClick', e);
38180
38978
  }
38181
38979
  }
38182
- beforeCommandCut(command) {
38980
+ beforeCommandCut() {
38183
38981
  const { s } = this.j;
38184
38982
  if (!s.isCollapsed()) {
38185
38983
  const current = s.current();
@@ -38188,13 +38986,27 @@ class select extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_3__/* .Plugin */
38188
38986
  }
38189
38987
  }
38190
38988
  }
38191
- beforeCommandSelectall(command) {
38989
+ beforeCommandSelectAll() {
38192
38990
  const { s } = this.j;
38193
38991
  s.focus();
38194
38992
  s.select(this.j.editor, true);
38195
38993
  s.expandSelection();
38196
38994
  return false;
38197
38995
  }
38996
+ /**
38997
+ * Normalize selection after triple click
38998
+ */
38999
+ onTripleClickNormalizeSelection(e) {
39000
+ if (e.detail !== 3 || !this.j.o.select.normalizeTripleClick) {
39001
+ return;
39002
+ }
39003
+ const { s } = this.j;
39004
+ const { startContainer, startOffset } = s.range;
39005
+ if (startOffset === 0 && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isText(startContainer)) {
39006
+ 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) ||
39007
+ startContainer, true);
39008
+ }
39009
+ }
38198
39010
  onCopyNormalizeSelectionBound(e) {
38199
39011
  const { s, editor, o } = this.j;
38200
39012
  if (!o.select.normalizeSelectionBeforeCutAndCopy || s.isCollapsed()) {
@@ -38220,7 +39032,10 @@ class select extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_3__/* .Plugin */
38220
39032
  ], select.prototype, "beforeCommandCut", null);
38221
39033
  (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
38222
39034
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([':beforeCommandSelectall'])
38223
- ], select.prototype, "beforeCommandSelectall", null);
39035
+ ], select.prototype, "beforeCommandSelectAll", null);
39036
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
39037
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([':click'])
39038
+ ], select.prototype, "onTripleClickNormalizeSelection", null);
38224
39039
  (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
38225
39040
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([':copy', ':cut'])
38226
39041
  ], select.prototype, "onCopyNormalizeSelectionBound", null);