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