jodit 4.1.16 → 4.2.5

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