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/es5/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
  */
@@ -3098,7 +3098,7 @@ __webpack_require__.r(__webpack_exports__);
3098
3098
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
3099
3099
  */
3100
3100
 
3101
- var APP_VERSION = "4.1.16";
3101
+ var APP_VERSION = "4.2.5";
3102
3102
  // prettier-ignore
3103
3103
  var ES = "es5";
3104
3104
  var IS_ES_MODERN = false;
@@ -8327,6 +8327,7 @@ var offset = function (elm, jodit, doc, recurse) {
8327
8327
  * Calculate screen element position
8328
8328
  */
8329
8329
  function position(elm, jodit, recurse) {
8330
+ var _a, _b;
8330
8331
  if (recurse === void 0) { recurse = false; }
8331
8332
  var rect = elm.getBoundingClientRect();
8332
8333
  var xPos = rect.left, yPos = rect.top;
@@ -8334,15 +8335,15 @@ function position(elm, jodit, recurse) {
8334
8335
  jodit.iframe &&
8335
8336
  jodit.ed.body.contains(elm) &&
8336
8337
  !recurse) {
8337
- var _a = position(jodit.iframe, jodit, true), left = _a.left, top = _a.top;
8338
+ var _c = position(jodit.iframe, jodit, true), left = _c.left, top = _c.top;
8338
8339
  xPos += left;
8339
8340
  yPos += top;
8340
8341
  }
8341
8342
  return {
8342
8343
  left: Math.round(xPos),
8343
8344
  top: Math.round(yPos),
8344
- width: Math.round(elm.offsetWidth),
8345
- height: Math.round(elm.offsetHeight)
8345
+ width: Math.round((_a = elm.offsetWidth) !== null && _a !== void 0 ? _a : rect.width),
8346
+ height: Math.round((_b = elm.offsetHeight) !== null && _b !== void 0 ? _b : rect.height)
8346
8347
  };
8347
8348
  }
8348
8349
 
@@ -10437,9 +10438,9 @@ var getXPathByElement = function (element, root) {
10437
10438
  * Find all `ref` or `data-ref` elements inside HTMLElement
10438
10439
  */
10439
10440
  var refs = function (root) {
10440
- // if (Component.isInstanceOf<UIElement>(root, UIElement)) {
10441
- // root = root.container;
10442
- // }
10441
+ if ('container' in root) {
10442
+ root = root.container;
10443
+ }
10443
10444
  return $$('[ref],[data-ref]', root).reduce(function (def, child) {
10444
10445
  var key = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(child, '-ref');
10445
10446
  if (key && (0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_4__/* .isString */ .K)(key)) {
@@ -15203,7 +15204,7 @@ var UITooltip = /** @class */ (function (_super) {
15203
15204
  view.o.showTooltip &&
15204
15205
  !view.o.useNativeTooltip) {
15205
15206
  view.hookStatus(jodit_core_component__WEBPACK_IMPORTED_MODULE_0__/* .STATUSES */ .f.ready, function () {
15206
- // TODO Move it inside __open method. Now it is here becous testcase failed with capturing
15207
+ // TODO Move it inside __open method. Now it is here because testcase failed with capturing
15207
15208
  (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_3__/* .getContainer */ .My)(_this.j, UITooltip_1).appendChild(_this.container);
15208
15209
  view.e.on(view.container, 'mouseenter.tooltip', _this.__onMouseEnter, {
15209
15210
  capture: true
@@ -15227,6 +15228,7 @@ var UITooltip = /** @class */ (function (_super) {
15227
15228
  var view = this.j;
15228
15229
  view.e
15229
15230
  .on(view.ow, 'scroll.tooltip', this.__hide)
15231
+ .on(view.ow, 'joditCloseDialog', this.__hide)
15230
15232
  .on(view.container, 'mouseleave.tooltip', this.__hide)
15231
15233
  .on([
15232
15234
  'escape.tooltip',
@@ -17353,7 +17355,7 @@ var Popup = /** @class */ (function (_super) {
17353
17355
  }
17354
17356
  var pe = this.parentElement;
17355
17357
  while (pe) {
17356
- if (checkView(j)) {
17358
+ if (checkView(pe.j)) {
17357
17359
  return;
17358
17360
  }
17359
17361
  if (pe.container.style.zIndex) {
@@ -20145,6 +20147,7 @@ var Dialog = /** @class */ (function (_super) {
20145
20147
  * Fired when dialog box is started moving
20146
20148
  */
20147
20149
  this.e.fire(this, 'startMove');
20150
+ this.e.fire('closeAllPopups');
20148
20151
  }
20149
20152
  };
20150
20153
  Dialog.prototype.onMouseMove = function (e) {
@@ -22184,7 +22187,15 @@ var FileBrowser = /** @class */ (function (_super) {
22184
22187
  _this.__updateToolbarButtons();
22185
22188
  _this._dialog.open(_this.browser, header);
22186
22189
  _this.e.fire('sort.filebrowser', _this.state.sortBy);
22187
- (0,_fetch_load_tree__WEBPACK_IMPORTED_MODULE_10__/* .loadTree */ .r)(_this).then(resolve, reject);
22190
+ (0,_fetch_load_tree__WEBPACK_IMPORTED_MODULE_10__/* .loadTree */ .r)(_this)
22191
+ .then(resolve, reject)
22192
+ .finally(function () {
22193
+ var _a;
22194
+ if (_this.isInDestruct) {
22195
+ return;
22196
+ }
22197
+ (_a = _this === null || _this === void 0 ? void 0 : _this.e) === null || _a === void 0 ? void 0 : _a.fire('fileBrowserReady.filebrowser');
22198
+ });
22188
22199
  })
22189
22200
  .catch(function (e) {
22190
22201
  if (!jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.IS_PROD) {
@@ -24036,7 +24047,7 @@ var form = function (editor, o) {
24036
24047
  var i = editor.i18n.bind(editor);
24037
24048
  var switcher = function (label, ref, active) {
24038
24049
  if (active === void 0) { active = true; }
24039
- return "<div class=\"jodit-form__group\">\n\t\t\t<label>".concat(i(label), "</label>\n\n\t\t\t<label class='jodit-switcher'>\n\t\t\t\t<input ").concat(act(active, 'checked'), " data-ref=\"").concat(ref, "\" type=\"checkbox\"/>\n\t\t\t\t<span class=\"jodit-switcher__slider\"></span>\n\t\t\t</label>\n\t</div>");
24050
+ return "<div class=\"jodit-form__group\">\n\t\t\t<label class=\"jodit-switcher-wrapper\">\n\t\t\t\t<span class='jodit-switcher'>\n\t\t\t\t\t<input ".concat(act(active, 'checked'), " data-ref=\"").concat(ref, "\" type=\"checkbox\"/>\n\t\t\t\t\t<span class=\"jodit-switcher__slider\"></span>\n\t\t\t\t</span>\n\t\t\t\t<span>").concat(i(label), "</span>\n\t\t\t</label>\n\t</div>");
24040
24051
  };
24041
24052
  return editor.create.fromHTML("<form class=\"".concat(jie, " jodit-properties\">\n\t\t<div class=\"jodit-grid jodit-grid_xs-column\">\n\t\t\t<div class=\"jodit_col-lg-3-4 jodit_col-sm-5-5\">\n\t\t\t").concat(o.resize
24042
24053
  ? "<div class=\"".concat(jie, "__area ").concat(jie, "__area_resize ").concat(jie, "_active\">\n\t\t\t\t\t\t\t<div data-ref=\"resizeBox\" class=\"").concat(jie, "__box\"></div>\n\t\t\t\t\t\t\t<div class=\"").concat(jie, "__resizer\">\n\t\t\t\t\t\t\t\t<i class=\"jodit_bottomright\"></i>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>")
@@ -27141,11 +27152,13 @@ var TabsWidget = function (jodit, tabs, state) {
27141
27152
  return;
27142
27153
  }
27143
27154
  buttonList.forEach(function (b) {
27155
+ b.state.variant = 'initial';
27144
27156
  b.state.activated = false;
27145
27157
  });
27146
27158
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.$$)('.jodit-tab', tabBox).forEach(function (a) {
27147
27159
  a.classList.remove('jodit-tab_active');
27148
27160
  });
27161
+ nameToTab[tab].button.state.variant = 'outline';
27149
27162
  nameToTab[tab].button.state.activated = true;
27150
27163
  nameToTab[tab].tab.classList.add('jodit-tab_active');
27151
27164
  };
@@ -27177,7 +27190,7 @@ var TabsWidget = function (jodit, tabs, state) {
27177
27190
  content.call(jodit);
27178
27191
  }
27179
27192
  if (state) {
27180
- state.__activeTab = name;
27193
+ state.activeTab = name;
27181
27194
  }
27182
27195
  return false;
27183
27196
  });
@@ -27193,20 +27206,20 @@ var TabsWidget = function (jodit, tabs, state) {
27193
27206
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.$$)('a', buttons).forEach(function (a) {
27194
27207
  a.style.width = (100 / tabCount).toFixed(10) + '%';
27195
27208
  });
27196
- var tab = !state || !state.__activeTab || !nameToTab[state.__activeTab]
27209
+ var tab = !state || !state.activeTab || !nameToTab[state.activeTab]
27197
27210
  ? firstTab
27198
- : state.__activeTab;
27211
+ : state.activeTab;
27199
27212
  setActive(tab);
27200
27213
  if (state) {
27201
- var __activeTab_1 = state.__activeTab;
27202
- Object.defineProperty(state, '__activeTab', {
27214
+ var activeTab_1 = state.activeTab;
27215
+ Object.defineProperty(state, 'activeTab', {
27203
27216
  configurable: true,
27204
27217
  enumerable: false,
27205
27218
  get: function () {
27206
- return __activeTab_1;
27219
+ return activeTab_1;
27207
27220
  },
27208
27221
  set: function (value) {
27209
- __activeTab_1 = value;
27222
+ activeTab_1 = value;
27210
27223
  setActive(value);
27211
27224
  }
27212
27225
  });
@@ -27627,7 +27640,7 @@ var aiAssistant = /** @class */ (function (_super) {
27627
27640
  configurable: true
27628
27641
  });
27629
27642
  /** @override */
27630
- aiAssistant.prototype.afterInit = function (jodit) { };
27643
+ aiAssistant.prototype.afterInit = function () { };
27631
27644
  aiAssistant.prototype.onGenerateAiAssistantForm = function (prompt) {
27632
27645
  this.__dialog.open(this.__container, 'AI Assistant');
27633
27646
  this.__container.setPrompt(prompt);
@@ -33656,9 +33669,6 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .pluginSystem */ .fg.add('image
33656
33669
  * Released under MIT see LICENSE.txt in the project root for license information.
33657
33670
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
33658
33671
  */
33659
- /**
33660
- * @module plugins/image-properties
33661
- */
33662
33672
 
33663
33673
  jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.image = {
33664
33674
  dialogWidth: 600,
@@ -33688,18 +33698,19 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.image = {
33688
33698
 
33689
33699
  "use strict";
33690
33700
  /* unused harmony export imageProperties */
33691
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(31635);
33701
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(31635);
33692
33702
  /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22664);
33693
- /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56298);
33694
- /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65147);
33695
- /* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(35265);
33696
- /* harmony import */ var jodit_modules__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(37435);
33697
- /* harmony import */ var jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(53804);
33698
- /* harmony import */ var jodit_modules_widget__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(16116);
33699
- /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(24654);
33700
- /* harmony import */ var _templates_form__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(22254);
33701
- /* harmony import */ var _templates_main_tab__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(75263);
33702
- /* harmony import */ var _templates_position_tab__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(57837);
33703
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(55186);
33704
+ /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(56298);
33705
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(65147);
33706
+ /* harmony import */ var jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29866);
33707
+ /* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(35265);
33708
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(24654);
33709
+ /* harmony import */ var _ui_ui_image_form__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(31970);
33710
+ /* harmony import */ var _utils_open_image_editor__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(80778);
33711
+ /* harmony import */ var _utils_open_image_popup__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(33733);
33712
+ /* harmony import */ var _readers__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(5549);
33713
+ /* harmony import */ var _writers__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(30393);
33703
33714
  /*!
33704
33715
  * Jodit Editor (https://xdsoft.net/jodit/)
33705
33716
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -33731,59 +33742,114 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.image = {
33731
33742
  * });
33732
33743
  * ```
33733
33744
  */
33734
- var normalSizeToString = function (value) {
33735
- value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.trim)(value);
33736
- return /^[0-9]+$/.test(value) ? value + 'px' : value;
33737
- };
33738
- var normalSizeFromString = function (value) {
33739
- return /^[-+]?[0-9.]+px$/.test(value.toString())
33740
- ? parseFloat(value.toString())
33741
- : value;
33742
- };
33743
33745
  /**
33744
33746
  * Show dialog with image's options
33745
33747
  */
33746
33748
  var imageProperties = /** @class */ (function (_super) {
33747
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__extends */ .C6)(imageProperties, _super);
33749
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__extends */ .C6)(imageProperties, _super);
33748
33750
  function imageProperties() {
33749
- var _this = _super.apply(this, (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__spreadArray */ .fX)([], (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__read */ .zs)(arguments), false)) || this;
33751
+ var _this = _super.apply(this, (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__spreadArray */ .fX)([], (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__read */ .zs)(arguments), false)) || this;
33750
33752
  _this.state = {
33751
33753
  image: new Image(),
33754
+ sourceImage: new Image(),
33752
33755
  get ratio() {
33753
- return this.image.naturalWidth / this.image.naturalHeight || 1;
33756
+ var _a = this.image, naturalWidth = _a.naturalWidth, naturalHeight = _a.naturalHeight;
33757
+ return naturalWidth / naturalHeight || 1;
33754
33758
  },
33755
33759
  sizeIsLocked: true,
33756
- marginIsLocked: true
33760
+ marginIsLocked: true,
33761
+ values: {
33762
+ style: '',
33763
+ imageSrc: '',
33764
+ borderRadius: 0,
33765
+ imageTitle: '',
33766
+ imageAlt: '',
33767
+ imageLink: '',
33768
+ imageLinkOpenInNewTab: false,
33769
+ imageWidth: 0,
33770
+ imageHeight: 0,
33771
+ marginTop: 0,
33772
+ marginRight: 0,
33773
+ marginBottom: 0,
33774
+ marginLeft: 0,
33775
+ classes: '',
33776
+ id: '',
33777
+ align: ''
33778
+ }
33757
33779
  };
33758
33780
  _this.activeTabState = {
33759
- __activeTab: 'Image'
33781
+ activeTab: 'Image'
33760
33782
  };
33761
33783
  return _this;
33762
33784
  }
33763
- imageProperties.prototype.onChangeMarginIsLocked = function () {
33764
- var _this = this;
33765
- if (!this.form) {
33766
- return;
33767
- }
33768
- var _a = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form), marginRight = _a.marginRight, marginBottom = _a.marginBottom, marginLeft = _a.marginLeft, lockMargin = _a.lockMargin;
33769
- [marginRight, marginBottom, marginLeft].forEach(function (elm) {
33770
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(elm, 'disabled', _this.state.marginIsLocked || null);
33771
- });
33772
- lockMargin.innerHTML = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Icon.get(this.state.marginIsLocked ? 'lock' : 'unlock');
33773
- };
33774
- imageProperties.prototype.onChangeSizeIsLocked = function () {
33775
- if (!this.form) {
33776
- return;
33777
- }
33778
- var _a = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form), lockSize = _a.lockSize, imageWidth = _a.imageWidth;
33779
- lockSize.innerHTML = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Icon.get(this.state.sizeIsLocked ? 'lock' : 'unlock');
33780
- lockSize.classList.remove('jodit-properties__lock');
33781
- lockSize.classList.remove('jodit-properties__unlock');
33782
- lockSize.classList.add(this.state.sizeIsLocked
33783
- ? 'jodit-properties__lock'
33784
- : 'jodit-properties__unlock');
33785
- this.j.e.fire(imageWidth, 'change');
33786
- };
33785
+ Object.defineProperty(imageProperties.prototype, "form", {
33786
+ get: function () {
33787
+ var _this = this;
33788
+ return new _ui_ui_image_form__WEBPACK_IMPORTED_MODULE_7__/* .UIImagePropertiesForm */ .l(this.j, this.state, this.activeTabState, {
33789
+ openImageEditor: function () {
33790
+ return (0,_utils_open_image_editor__WEBPACK_IMPORTED_MODULE_8__/* .openImageEditorDialog */ .v)(_this.j, _this.state);
33791
+ },
33792
+ openImagePopup: function (target) {
33793
+ return (0,_utils_open_image_popup__WEBPACK_IMPORTED_MODULE_9__/* .openImagePopup */ .q)(_this.j, _this.dialog, _this.state, target);
33794
+ }
33795
+ });
33796
+ },
33797
+ enumerable: false,
33798
+ configurable: true
33799
+ });
33800
+ Object.defineProperty(imageProperties.prototype, "dialog", {
33801
+ /**
33802
+ * Dialog for form
33803
+ */
33804
+ get: function () {
33805
+ var _this = this;
33806
+ var j = this.j;
33807
+ var dialog = j.dlg({
33808
+ minWidth: Math.min(400, screen.width),
33809
+ minHeight: 590,
33810
+ buttons: ['fullsize', 'dialog.close']
33811
+ });
33812
+ var buttons = this.__buttons;
33813
+ buttons.check.onAction(function () {
33814
+ (0,_writers__WEBPACK_IMPORTED_MODULE_11__/* .applyValuesToImage */ .j)(j, _this.state, _this.state.sourceImage);
33815
+ j.synchronizeValues();
33816
+ dialog.close();
33817
+ });
33818
+ buttons.remove.onAction(function () {
33819
+ j.s.removeNode(_this.state.sourceImage);
33820
+ dialog.close();
33821
+ });
33822
+ buttons.cancel.onAction(function () {
33823
+ dialog.close();
33824
+ });
33825
+ dialog.setHeader(j.i18n('Image properties'));
33826
+ dialog.setContent(this.form);
33827
+ dialog.setFooter([[buttons.cancel, buttons.remove], buttons.check]);
33828
+ j.e.on(dialog, 'afterClose', function () {
33829
+ if (_this.state.image.parentNode &&
33830
+ j.o.image.selectImageAfterClose) {
33831
+ j.s.select(_this.state.sourceImage);
33832
+ }
33833
+ });
33834
+ dialog.setSize(j.o.image.dialogWidth);
33835
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.markOwner)(j, dialog.container);
33836
+ return dialog;
33837
+ },
33838
+ enumerable: false,
33839
+ configurable: true
33840
+ });
33841
+ Object.defineProperty(imageProperties.prototype, "__buttons", {
33842
+ get: function () {
33843
+ var j = this.j;
33844
+ return {
33845
+ check: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__/* .Button */ .$n)(j, 'ok', 'Apply', 'primary'),
33846
+ remove: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__/* .Button */ .$n)(j, 'bin', 'Delete'),
33847
+ cancel: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__/* .Button */ .$n)(j, 'cancel', 'Cancel')
33848
+ };
33849
+ },
33850
+ enumerable: false,
33851
+ configurable: true
33852
+ });
33787
33853
  /**
33788
33854
  * Open dialog editing image properties
33789
33855
  *
@@ -33799,362 +33865,27 @@ var imageProperties = /** @class */ (function (_super) {
33799
33865
  * ```
33800
33866
  */
33801
33867
  imageProperties.prototype.open = function () {
33802
- this.makeForm();
33803
- this.activeTabState.__activeTab = 'Image';
33804
- this.j.e.fire('hidePopup');
33805
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.markOwner)(this.j, this.dialog.container);
33806
- this.state.marginIsLocked = true;
33807
- this.state.sizeIsLocked = true;
33808
- this.onChangeMarginIsLocked();
33809
- this.onChangeSizeIsLocked();
33810
- this.updateValues();
33868
+ var _this = this;
33869
+ this.activeTabState.activeTab = 'Image';
33870
+ this.__lock();
33811
33871
  this.dialog.open().setModal(true).setPosition();
33872
+ this.async
33873
+ .promise(function (resolve, reject) {
33874
+ return (0,_readers__WEBPACK_IMPORTED_MODULE_10__/* .readValuesFromImage */ .U)(_this.j, _this.state).then(resolve, reject);
33875
+ })
33876
+ .catch(function (e) { return _this.dialog.message.error(e.message); })
33877
+ .finally(function () { return _this.__unlock(); });
33812
33878
  return false;
33813
33879
  };
33814
- /**
33815
- * Create form for edit image properties
33816
- */
33817
- imageProperties.prototype.makeForm = function () {
33818
- var _this = this;
33819
- if (this.dialog) {
33820
- return;
33821
- }
33822
- this.dialog = this.j.dlg({
33823
- minWidth: Math.min(400, screen.width),
33824
- minHeight: 590,
33825
- buttons: ['fullsize', 'dialog.close']
33826
- });
33827
- var editor = this.j, opt = editor.o, i18n = editor.i18n.bind(editor), buttons = {
33828
- check: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_3__/* .Button */ .$n)(editor, 'ok', 'Apply', 'primary'),
33829
- remove: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_3__/* .Button */ .$n)(editor, 'bin', 'Delete')
33830
- };
33831
- editor.e.on(this.dialog, 'afterClose', function () {
33832
- if (_this.state.image.parentNode &&
33833
- opt.image.selectImageAfterClose) {
33834
- editor.s.select(_this.state.image);
33835
- }
33836
- });
33837
- buttons.remove.onAction(function () {
33838
- editor.s.removeNode(_this.state.image);
33839
- _this.dialog.close();
33840
- });
33841
- var dialog = this.dialog;
33842
- dialog.setHeader(i18n('Image properties'));
33843
- var mainForm = (0,_templates_form__WEBPACK_IMPORTED_MODULE_8__/* .form */ .Z)(editor);
33844
- this.form = mainForm;
33845
- dialog.setContent(mainForm);
33846
- var tabsBox = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form).tabsBox;
33847
- if (tabsBox) {
33848
- tabsBox.appendChild((0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_6__/* .TabsWidget */ .Zg)(editor, [
33849
- { name: 'Image', content: (0,_templates_main_tab__WEBPACK_IMPORTED_MODULE_9__/* .mainTab */ .J)(editor) },
33850
- { name: 'Advanced', content: (0,_templates_position_tab__WEBPACK_IMPORTED_MODULE_10__/* .positionTab */ .b)(editor) }
33851
- ], this.activeTabState));
33852
- }
33853
- buttons.check.onAction(this.onApply);
33854
- var _a = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form), changeImage = _a.changeImage, editImage = _a.editImage;
33855
- editor.e.on(changeImage, 'click', this.openImagePopup);
33856
- if (opt.image.useImageEditor) {
33857
- editor.e.on(editImage, 'click', this.openImageEditor);
33858
- }
33859
- var _b = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(mainForm), lockSize = _b.lockSize, lockMargin = _b.lockMargin, imageWidth = _b.imageWidth, imageHeight = _b.imageHeight;
33860
- if (lockSize) {
33861
- editor.e.on(lockSize, 'click', function () {
33862
- _this.state.sizeIsLocked = !_this.state.sizeIsLocked;
33863
- });
33864
- }
33865
- editor.e.on(lockMargin, 'click', function (e) {
33866
- _this.state.marginIsLocked = !_this.state.marginIsLocked;
33867
- e.preventDefault();
33868
- });
33869
- var changeSizes = function (event) {
33870
- if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isNumeric)(imageWidth.value) || !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isNumeric)(imageHeight.value)) {
33871
- return;
33872
- }
33873
- var w = parseFloat(imageWidth.value), h = parseFloat(imageHeight.value);
33874
- if (event.target === imageWidth) {
33875
- imageHeight.value = Math.round(w / _this.state.ratio).toString();
33876
- }
33877
- else {
33878
- imageWidth.value = Math.round(h * _this.state.ratio).toString();
33879
- }
33880
- };
33881
- editor.e.on([imageWidth, imageHeight], 'change keydown mousedown paste', function (event) {
33882
- if (!_this.state.sizeIsLocked) {
33883
- return;
33884
- }
33885
- editor.async.setTimeout(changeSizes.bind(_this, event), {
33886
- timeout: editor.defaultTimeout,
33887
- label: 'image-properties-changeSize'
33888
- });
33889
- });
33890
- dialog.setFooter([buttons.remove, buttons.check]);
33891
- dialog.setSize(this.j.o.image.dialogWidth);
33892
- };
33893
- /**
33894
- * Set input values from image
33895
- */
33896
- imageProperties.prototype.updateValues = function () {
33897
- var _this = this;
33898
- var opt = this.j.o;
33899
- var image = this.state.image;
33900
- var _a = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form), marginTop = _a.marginTop, marginRight = _a.marginRight, marginBottom = _a.marginBottom, marginLeft = _a.marginLeft, lockMargin = _a.lockMargin, imageSrc = _a.imageSrc, id = _a.id, classes = _a.classes, align = _a.align, style = _a.style, imageTitle = _a.imageTitle, imageAlt = _a.imageAlt, borderRadius = _a.borderRadius, imageLink = _a.imageLink, imageWidth = _a.imageWidth, imageHeight = _a.imageHeight, imageLinkOpenInNewTab = _a.imageLinkOpenInNewTab, imageViewSrc = _a.imageViewSrc, lockSize = _a.lockSize;
33901
- var updateLock = function () {
33902
- lockMargin.checked = _this.state.marginIsLocked;
33903
- lockSize.checked = _this.state.sizeIsLocked;
33904
- }, updateAlign = function () {
33905
- if (image.style.cssFloat &&
33906
- ['left', 'right'].indexOf(image.style.cssFloat.toLowerCase()) !== -1) {
33907
- align.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'float');
33908
- }
33909
- else {
33910
- if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'display') === 'block' &&
33911
- image.style.marginLeft === 'auto' &&
33912
- image.style.marginRight === 'auto') {
33913
- align.value = 'center';
33914
- }
33915
- }
33916
- }, updateBorderRadius = function () {
33917
- borderRadius.value = (parseInt(image.style.borderRadius || '0', 10) || '0').toString();
33918
- }, updateId = function () {
33919
- id.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'id') || '';
33920
- }, updateStyle = function () {
33921
- style.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'style') || '';
33922
- }, updateClasses = function () {
33923
- classes.value = ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'class') || '').replace(/jodit_focused_image[\s]*/, '');
33924
- }, updateMargins = function () {
33925
- if (!opt.image.editMargins) {
33926
- return;
33927
- }
33928
- var equal = true, wasEmptyField = false;
33929
- [marginTop, marginRight, marginBottom, marginLeft].forEach(function (elm) {
33930
- var id = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(elm, 'data-ref') || '';
33931
- var value = image.style.getPropertyValue((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.kebabCase)(id));
33932
- if (!value) {
33933
- wasEmptyField = true;
33934
- elm.value = '';
33935
- return;
33936
- }
33937
- if (/^[0-9]+(px)?$/.test(value)) {
33938
- value = parseInt(value, 10);
33939
- }
33940
- elm.value = value.toString() || '';
33941
- if ((wasEmptyField && elm.value) ||
33942
- (equal &&
33943
- id !== 'marginTop' &&
33944
- elm.value !== marginTop.value)) {
33945
- equal = false;
33946
- }
33947
- });
33948
- _this.state.marginIsLocked = equal;
33949
- }, updateSizes = function () {
33950
- var width = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'width') ||
33951
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'width', true) ||
33952
- false, height = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'height') ||
33953
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'height', true) ||
33954
- false;
33955
- imageWidth.value =
33956
- width !== false
33957
- ? normalSizeFromString(width).toString()
33958
- : image.offsetWidth.toString();
33959
- imageHeight.value =
33960
- height !== false
33961
- ? normalSizeFromString(height).toString()
33962
- : image.offsetHeight.toString();
33963
- _this.state.sizeIsLocked = (function () {
33964
- if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isNumeric)(imageWidth.value) ||
33965
- !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isNumeric)(imageHeight.value)) {
33966
- return false;
33967
- }
33968
- var w = parseFloat(imageWidth.value), h = parseFloat(imageHeight.value);
33969
- return Math.abs(w - h * _this.state.ratio) < 1;
33970
- })();
33971
- }, updateText = function () {
33972
- imageTitle.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'title') || '';
33973
- imageAlt.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'alt') || '';
33974
- var a = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(image, 'a', _this.j.editor);
33975
- if (a) {
33976
- imageLink.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(a, 'href') || '';
33977
- imageLinkOpenInNewTab.checked =
33978
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(a, 'target') === '_blank';
33979
- }
33980
- else {
33981
- imageLink.value = '';
33982
- imageLinkOpenInNewTab.checked = false;
33983
- }
33984
- }, updateSrc = function () {
33985
- imageSrc.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'src') || '';
33986
- if (imageViewSrc) {
33987
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(imageViewSrc, 'src', (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'src') || '');
33988
- }
33989
- };
33990
- updateLock();
33991
- updateSrc();
33992
- updateText();
33993
- updateSizes();
33994
- updateMargins();
33995
- updateClasses();
33996
- updateId();
33997
- updateBorderRadius();
33998
- updateAlign();
33999
- updateStyle();
34000
- };
34001
- /**
34002
- * Apply form's values to image
34003
- */
34004
- imageProperties.prototype.onApply = function () {
34005
- var _a = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form), style = _a.style, imageSrc = _a.imageSrc, borderRadius = _a.borderRadius, imageTitle = _a.imageTitle, imageAlt = _a.imageAlt, imageLink = _a.imageLink, imageWidth = _a.imageWidth, imageHeight = _a.imageHeight, marginTop = _a.marginTop, marginRight = _a.marginRight, marginBottom = _a.marginBottom, marginLeft = _a.marginLeft, imageLinkOpenInNewTab = _a.imageLinkOpenInNewTab, align = _a.align, classes = _a.classes, id = _a.id;
34006
- var opt = this.j.o;
34007
- var image = this.state.image;
34008
- // styles
34009
- if (opt.image.editStyle) {
34010
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'style', style.value || null);
34011
- }
34012
- // Src
34013
- if (imageSrc.value) {
34014
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'src', imageSrc.value);
34015
- }
34016
- else {
34017
- jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove(image);
34018
- this.dialog.close();
34019
- return;
34020
- }
34021
- // Border radius
34022
- if (borderRadius.value !== '0' && /^[0-9]+$/.test(borderRadius.value)) {
34023
- image.style.borderRadius = borderRadius.value + 'px';
34024
- }
34025
- else {
34026
- image.style.borderRadius = '';
34027
- }
34028
- // Title
34029
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'title', imageTitle.value || null);
34030
- // Alt
34031
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'alt', imageAlt.value || null);
34032
- // Link
34033
- var link = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(image, 'a', this.j.editor);
34034
- if (imageLink.value) {
34035
- if (!link) {
34036
- link = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.wrap(image, 'a', this.j.createInside);
34037
- }
34038
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(link, 'href', imageLink.value);
34039
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(link, 'target', imageLinkOpenInNewTab.checked ? '_blank' : null);
34040
- }
34041
- else {
34042
- if (link && link.parentNode) {
34043
- link.parentNode.replaceChild(image, link);
34044
- }
34045
- }
34046
- // Size
34047
- if (imageWidth.value !== image.offsetWidth.toString() ||
34048
- imageHeight.value !== image.offsetHeight.toString()) {
34049
- var updatedtWidth = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.trim)(imageWidth.value)
34050
- ? normalSizeToString(imageWidth.value)
34051
- : null;
34052
- var updatedHeight = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.trim)(imageHeight.value)
34053
- ? normalSizeToString(imageHeight.value)
34054
- : null;
34055
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, {
34056
- width: updatedtWidth,
34057
- height: updatedHeight
34058
- });
34059
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'width', (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'width') ? updatedtWidth : null);
34060
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'height', (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'height') ? updatedHeight : null);
34061
- }
34062
- var margins = [marginTop, marginRight, marginBottom, marginLeft];
34063
- if (opt.image.editMargins) {
34064
- if (!this.state.marginIsLocked) {
34065
- margins.forEach(function (margin) {
34066
- var side = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(margin, 'data-ref') || '';
34067
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, side, normalSizeToString(margin.value));
34068
- });
34069
- }
34070
- else {
34071
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'margin', normalSizeToString(marginTop.value));
34072
- }
34073
- }
34074
- if (opt.image.editClass) {
34075
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'class', classes.value || null);
34076
- }
34077
- if (opt.image.editId) {
34078
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'id', id.value || null);
34079
- }
34080
- if (opt.image.editAlign) {
34081
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.hAlignElement)(image, align.value);
34082
- }
34083
- this.j.synchronizeValues();
34084
- this.dialog.close();
34085
- };
34086
- /**
34087
- * Open image editor dialog
34088
- */
34089
- imageProperties.prototype.openImageEditor = function () {
34090
- var _this = this;
34091
- var url = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src') || '', a = this.j.c.element('a'), loadExternal = function () {
34092
- if (a.host !== location.host) {
34093
- _this.j.confirm('You can only edit your own images. Download this image on the host?', function (yes) {
34094
- if (yes && _this.j.uploader) {
34095
- _this.j.uploader.uploadRemoteImage(a.href.toString(), function (resp) {
34096
- _this.j.alert('The image has been successfully uploaded to the host!', function () {
34097
- if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isString)(resp.newfilename)) {
34098
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(_this.state.image, 'src', resp.baseurl +
34099
- resp.newfilename);
34100
- _this.updateValues();
34101
- }
34102
- });
34103
- }, function (error) {
34104
- _this.j.alert('There was an error loading %s', error.message);
34105
- });
34106
- }
34107
- });
34108
- return;
34109
- }
34110
- };
34111
- a.href = url;
34112
- this.j.filebrowser.dataProvider
34113
- .getPathByUrl(a.href.toString())
34114
- .then(function (resp) {
34115
- jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_5__/* .openImageEditor */ .B.call(_this.j.filebrowser, a.href, resp.name, resp.path, resp.source, function () {
34116
- var timestamp = new Date().getTime();
34117
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(_this.state.image, 'src', url +
34118
- (url.indexOf('?') !== -1 ? '' : '?') +
34119
- '&_tmp=' +
34120
- timestamp.toString());
34121
- _this.updateValues();
34122
- }, function (error) {
34123
- _this.j.alert(error.message);
34124
- });
34125
- })
34126
- .catch(function (error) {
34127
- _this.j.alert(error.message, loadExternal);
34128
- });
33880
+ imageProperties.prototype.__lock = function () {
33881
+ this.dialog.lock();
33882
+ this.form.setMod('lock', true);
33883
+ Object.values(this.__buttons).forEach(function (b) { return (b.state.disabled = true); });
34129
33884
  };
34130
- /**
34131
- * Open popup with filebrowser/uploader buttons for image
34132
- */
34133
- imageProperties.prototype.openImagePopup = function (event) {
34134
- var _this = this;
34135
- var popup = new jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Popup(this.j), changeImage = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form).changeImage;
34136
- popup.setZIndex(this.dialog.getZIndex() + 1);
34137
- popup
34138
- .setContent((0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_6__/* .FileSelectorWidget */ .kG)(this.j, {
34139
- upload: function (data) {
34140
- if (data.files && data.files.length) {
34141
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(_this.state.image, 'src', data.baseurl + data.files[0]);
34142
- }
34143
- _this.updateValues();
34144
- popup.close();
34145
- },
34146
- filebrowser: function (data) {
34147
- if (data &&
34148
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isArray)(data.files) &&
34149
- data.files.length) {
34150
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(_this.state.image, 'src', data.files[0]);
34151
- popup.close();
34152
- _this.updateValues();
34153
- }
34154
- }
34155
- }, this.state.image, popup.close))
34156
- .open(function () { return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.position)(changeImage); });
34157
- event.stopPropagation();
33885
+ imageProperties.prototype.__unlock = function () {
33886
+ this.dialog.unlock();
33887
+ this.form.setMod('lock', false);
33888
+ Object.values(this.__buttons).forEach(function (b) { return (b.state.disabled = false); });
34158
33889
  };
34159
33890
  /** @override **/
34160
33891
  imageProperties.prototype.afterInit = function (editor) {
@@ -34166,7 +33897,7 @@ var imageProperties = /** @class */ (function (_super) {
34166
33897
  .off(editor.editor, '.imageproperties')
34167
33898
  .on(editor.editor, 'dblclick.imageproperties', function (e) {
34168
33899
  var image = e.target;
34169
- if (!jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(image, 'img')) {
33900
+ if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isTag(image, 'img')) {
34170
33901
  return;
34171
33902
  }
34172
33903
  if (editor.o.image.openOnDblClick) {
@@ -34174,7 +33905,8 @@ var imageProperties = /** @class */ (function (_super) {
34174
33905
  false) {
34175
33906
  return;
34176
33907
  }
34177
- self.state.image = image;
33908
+ self.state.sourceImage = image;
33909
+ self.state.image = image.cloneNode(true);
34178
33910
  if (!editor.o.readonly) {
34179
33911
  e.stopImmediatePropagation();
34180
33912
  e.preventDefault();
@@ -34188,115 +33920,1249 @@ var imageProperties = /** @class */ (function (_super) {
34188
33920
  });
34189
33921
  })
34190
33922
  .on('openImageProperties.imageproperties', function (image) {
34191
- _this.state.image = image;
33923
+ self.state.sourceImage = image;
33924
+ _this.state.image = image.cloneNode(true);
34192
33925
  _this.open();
34193
33926
  });
34194
33927
  };
33928
+ imageProperties.prototype.onStateValuesImageSrcChange = function () {
33929
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__awaiter */ .sH)(this, void 0, Promise, function () {
33930
+ var _a, image, values, w, e_1;
33931
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__generator */ .YH)(this, function (_b) {
33932
+ switch (_b.label) {
33933
+ case 0:
33934
+ _a = this.state, image = _a.image, values = _a.values;
33935
+ if (!image.src) {
33936
+ return [2 /*return*/];
33937
+ }
33938
+ _b.label = 1;
33939
+ case 1:
33940
+ _b.trys.push([1, 3, 4, 5]);
33941
+ this.__lock();
33942
+ return [4 /*yield*/, image.decode()];
33943
+ case 2:
33944
+ _b.sent();
33945
+ if (this.state.sizeIsLocked && (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.isNumeric)(values.imageWidth)) {
33946
+ w = parseFloat(values.imageWidth.toString());
33947
+ values.imageHeight = Math.round(w / this.state.ratio);
33948
+ }
33949
+ this.j.e.fire('updateImageProperties.imageproperties', image);
33950
+ return [3 /*break*/, 5];
33951
+ case 3:
33952
+ e_1 = _b.sent();
33953
+ this.j.alert(e_1.message);
33954
+ return [3 /*break*/, 5];
33955
+ case 4:
33956
+ this.__unlock();
33957
+ return [7 /*endfinally*/];
33958
+ case 5: return [2 /*return*/];
33959
+ }
33960
+ });
33961
+ });
33962
+ };
34195
33963
  /** @override */
34196
33964
  imageProperties.prototype.beforeDestruct = function (editor) {
34197
- this.dialog && this.dialog.destruct();
33965
+ var _a, _b, _c;
33966
+ Object.values((_a = (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cached)(this, '__buttons')) !== null && _a !== void 0 ? _a : {}).forEach(function (b) { return b.destruct(); });
33967
+ (_b = (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cached)(this, 'dialog')) === null || _b === void 0 ? void 0 : _b.destruct();
33968
+ (_c = (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cached)(this, 'form')) === null || _c === void 0 ? void 0 : _c.destruct();
34198
33969
  editor.e.off(editor.editor, '.imageproperties').off('.imageproperties');
34199
33970
  };
34200
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
34201
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.marginIsLocked')
34202
- ], imageProperties.prototype, "onChangeMarginIsLocked", null);
34203
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
34204
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.sizeIsLocked')
34205
- ], imageProperties.prototype, "onChangeSizeIsLocked", null);
34206
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
34207
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.autobind
34208
- ], imageProperties.prototype, "onApply", null);
34209
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
34210
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.autobind
34211
- ], imageProperties.prototype, "openImageEditor", null);
34212
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
34213
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.autobind
34214
- ], imageProperties.prototype, "openImagePopup", null);
33971
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
33972
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cache
33973
+ ], imageProperties.prototype, "form", null);
33974
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
33975
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cache
33976
+ ], imageProperties.prototype, "dialog", null);
33977
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
33978
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cache
33979
+ ], imageProperties.prototype, "__buttons", null);
33980
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
33981
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.image')
33982
+ ], imageProperties.prototype, "onStateValuesImageSrcChange", null);
34215
33983
  return imageProperties;
34216
- }(jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin));
33984
+ }(jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_4__/* .Plugin */ .k));
34217
33985
 
34218
- jodit_core_global__WEBPACK_IMPORTED_MODULE_1__/* .pluginSystem */ .fg.add('imageProperties', imageProperties);
33986
+ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .pluginSystem */ .fg.add('imageProperties', imageProperties);
34219
33987
 
34220
33988
 
34221
33989
  /***/ }),
34222
33990
 
34223
- /***/ 22254:
33991
+ /***/ 74260:
34224
33992
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
34225
33993
 
34226
33994
  "use strict";
34227
33995
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
34228
- /* harmony export */ Z: function() { return /* binding */ form; }
33996
+ /* harmony export */ g: function() { return /* binding */ readAlign; }
34229
33997
  /* harmony export */ });
34230
- /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(931);
33998
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(38322);
34231
33999
  /*!
34232
34000
  * Jodit Editor (https://xdsoft.net/jodit/)
34233
34001
  * Released under MIT see LICENSE.txt in the project root for license information.
34234
34002
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
34235
34003
  */
34236
34004
 
34237
- function form(editor) {
34238
- var _a = editor.o.image, showPreview = _a.showPreview, editSize = _a.editSize, gi = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__/* .Icon */ .I.get.bind(jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__/* .Icon */ .I);
34239
- return editor.c.fromHTML("<form class=\"jodit-properties\">\n\t\t<div class=\"jodit-grid jodit-grid_xs-column\">\n\t\t\t<div class=\"jodit_col-lg-2-5 jodit_col-xs-5-5\">\n\t\t\t\t<div class=\"jodit-properties_view_box\">\n\t\t\t\t\t<div style=\"".concat(!showPreview ? 'display:none' : '', "\" class=\"jodit-properties_image_view\">\n\t\t\t\t\t\t<img data-ref=\"imageViewSrc\" src=\"\" alt=\"\"/>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style=\"").concat(!editSize ? 'display:none' : '', "\" class=\"jodit-form__group jodit-properties_image_sizes\">\n\t\t\t\t\t\t<input data-ref=\"imageWidth\" type=\"text\" class=\"jodit-input\"/>\n\t\t\t\t\t\t<a data-ref=\"lockSize\" class=\"jodit-properties__lock\">").concat(gi('lock'), "</a>\n\t\t\t\t\t\t<input data-ref=\"imageHeight\" type=\"text\" class=\"imageHeight jodit-input\"/>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div data-ref=\"tabsBox\" class=\"jodit_col-lg-3-5 jodit_col-xs-5-5\"></div>\n\t\t</div>\n\t</form>"));
34005
+ /** @private */
34006
+ function readAlign(image, values) {
34007
+ // Align
34008
+ if (image.style.cssFloat &&
34009
+ ['left', 'right'].indexOf(image.style.cssFloat.toLowerCase()) !== -1) {
34010
+ values.align = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_0__/* .css */ .A)(image, 'float');
34011
+ }
34012
+ else {
34013
+ if ((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_0__/* .css */ .A)(image, 'display') === 'block' &&
34014
+ image.style.marginLeft === 'auto' &&
34015
+ image.style.marginRight === 'auto') {
34016
+ values.align = 'center';
34017
+ }
34018
+ else {
34019
+ values.align = '';
34020
+ }
34021
+ }
34240
34022
  }
34241
34023
 
34242
34024
 
34243
34025
  /***/ }),
34244
34026
 
34245
- /***/ 75263:
34027
+ /***/ 5549:
34246
34028
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
34247
34029
 
34248
34030
  "use strict";
34249
34031
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
34250
- /* harmony export */ J: function() { return /* binding */ mainTab; }
34032
+ /* harmony export */ U: function() { return /* binding */ readValuesFromImage; }
34251
34033
  /* harmony export */ });
34252
- /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(931);
34034
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(31635);
34035
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26150);
34036
+ /* harmony import */ var _align__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(74260);
34037
+ /* harmony import */ var _link__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(33201);
34038
+ /* harmony import */ var _margin__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(85079);
34039
+ /* harmony import */ var _size__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(17880);
34253
34040
  /*!
34254
34041
  * Jodit Editor (https://xdsoft.net/jodit/)
34255
34042
  * Released under MIT see LICENSE.txt in the project root for license information.
34256
34043
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
34257
34044
  */
34258
34045
 
34259
- function mainTab(editor) {
34260
- var 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;
34261
- return editor.c.fromHTML("<div style=\"".concat(!opt.image.editSrc ? 'display:none' : '', "\" class=\"jodit-form__group\">\n\t\t\t<label>").concat(i18n('Src'), "</label>\n\t\t\t<div class=\"jodit-input_group\">\n\t\t\t\t<input data-ref=\"imageSrc\" class=\"jodit-input\" type=\"text\"/>\n\t\t\t\t<div\n\t\t\t\t\tclass=\"jodit-input_group-buttons\"\n\t\t\t\t\tstyle=\"").concat(hasFbUrl ? '' : 'display: none', "\"\n\t\t\t\t>\n\t\t\t\t\t\t<a\n\t\t\t\t\t\t\tdata-ref=\"changeImage\"\n\t\t\t\t\t\t\tclass=\"jodit-button\"\n\t\t\t\t\t\t>").concat(gi('image'), "</a>\n\t\t\t\t\t\t<a\n\t\t\t\t\t\t\tdata-ref=\"editImage\"\n\t\t\t\t\t\t\tclass=\"jodit-button\"\n\t\t\t\t\t\t\tstyle=\"").concat(hasEditor ? '' : 'display: none', "\"\n\t\t\t\t\t\t>").concat(gi('crop'), "</a>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div style=\"").concat(!opt.image.editTitle ? 'display:none' : '', "\" class=\"jodit-form__group\">\n\t\t\t<label>").concat(i18n('Title'), "</label>\n\t\t\t<input data-ref=\"imageTitle\" type=\"text\" class=\"jodit-input\"/>\n\t\t</div>\n\t\t<div style=\"").concat(!opt.image.editAlt ? 'display:none' : '', "\" class=\"jodit-form__group\">\n\t\t\t<label>").concat(i18n('Alternative'), "</label>\n\t\t\t<input data-ref=\"imageAlt\" type=\"text\" class=\"jodit-input\"/>\n\t\t</div>\n\t\t<div style=\"").concat(!opt.image.editLink ? 'display:none' : '', "\" class=\"jodit-form__group\">\n\t\t\t<label>").concat(i18n('Link'), "</label>\n\t\t\t<input data-ref=\"imageLink\" type=\"text\" class=\"jodit-input\"/>\n\t\t</div>\n\t\t<div style=\"").concat(!opt.image.editLink ? 'display:none' : '', "\" class=\"jodit-form__group\">\n\t\t\t<label class=\"jodit_vertical_middle\">\n\t\t\t\t<input data-ref=\"imageLinkOpenInNewTab\" type=\"checkbox\" class=\"jodit-checkbox\"/>\n\t\t\t\t<span>").concat(i18n('Open link in new tab'), "</span>\n\t\t\t</label>\n\t\t</div>"));
34046
+
34047
+
34048
+
34049
+
34050
+
34051
+ /**
34052
+ * Read values from image and set it to state
34053
+ * @private
34054
+ */
34055
+ function readValuesFromImage(j, state) {
34056
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__awaiter */ .sH)(this, void 0, Promise, function () {
34057
+ var image, values;
34058
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__generator */ .YH)(this, function (_a) {
34059
+ image = state.sourceImage, values = state.values;
34060
+ (0,_align__WEBPACK_IMPORTED_MODULE_4__/* .readAlign */ .g)(image, values);
34061
+ // Border radius
34062
+ values.borderRadius = parseInt(image.style.borderRadius || '0', 10) || 0;
34063
+ // Id
34064
+ values.id = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'id') || '';
34065
+ // Title
34066
+ values.imageTitle = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'title') || '';
34067
+ // Alt
34068
+ values.imageAlt = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'alt') || '';
34069
+ // Style
34070
+ values.style = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'style') || '';
34071
+ // Classes
34072
+ values.classes = ((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'class') || '').replace(/jodit_focused_image[\s]*/, '');
34073
+ // Margins
34074
+ (0,_margin__WEBPACK_IMPORTED_MODULE_5__/* .readMargins */ .E)(image, values, state);
34075
+ // Link
34076
+ (0,_link__WEBPACK_IMPORTED_MODULE_1__/* .readLink */ .X)(state, j, values);
34077
+ // Src
34078
+ values.imageSrc = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'src') || '';
34079
+ // Image size
34080
+ return [2 /*return*/, (0,_size__WEBPACK_IMPORTED_MODULE_2__/* .readSizes */ .P)(image, values, state)];
34081
+ });
34082
+ });
34262
34083
  }
34263
34084
 
34264
34085
 
34265
34086
  /***/ }),
34266
34087
 
34267
- /***/ 57837:
34088
+ /***/ 33201:
34268
34089
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
34269
34090
 
34270
34091
  "use strict";
34271
34092
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
34272
- /* harmony export */ b: function() { return /* binding */ positionTab; }
34093
+ /* harmony export */ X: function() { return /* binding */ readLink; }
34273
34094
  /* harmony export */ });
34274
- /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(931);
34095
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55186);
34096
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26150);
34097
+ /*!
34098
+ * Jodit Editor (https://xdsoft.net/jodit/)
34099
+ * Released under MIT see LICENSE.txt in the project root for license information.
34100
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
34101
+ */
34102
+
34103
+
34104
+ /** @private */
34105
+ function readLink(state, j, values) {
34106
+ var a = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.closest(state.sourceImage, 'a', j.editor);
34107
+ if (a) {
34108
+ values.imageLink = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(a, 'href') || '';
34109
+ values.imageLinkOpenInNewTab = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(a, 'target') === '_blank';
34110
+ }
34111
+ else {
34112
+ values.imageLink = '';
34113
+ values.imageLinkOpenInNewTab = false;
34114
+ }
34115
+ }
34116
+
34117
+
34118
+ /***/ }),
34119
+
34120
+ /***/ 85079:
34121
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
34122
+
34123
+ "use strict";
34124
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
34125
+ /* harmony export */ E: function() { return /* binding */ readMargins; }
34126
+ /* harmony export */ });
34127
+ /* harmony import */ var jodit_core_helpers_string_kebab_case__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(449);
34128
+ /*!
34129
+ * Jodit Editor (https://xdsoft.net/jodit/)
34130
+ * Released under MIT see LICENSE.txt in the project root for license information.
34131
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
34132
+ */
34133
+
34134
+ /** @private */
34135
+ function readMargins(image, values, state) {
34136
+ // Margins
34137
+ var equal = true, wasEmptyField = false;
34138
+ ['marginTop', 'marginRight', 'marginBottom', 'marginLeft'].forEach(function (id) {
34139
+ var value = image.style.getPropertyValue((0,jodit_core_helpers_string_kebab_case__WEBPACK_IMPORTED_MODULE_0__/* .kebabCase */ .k)(id));
34140
+ if (!value) {
34141
+ wasEmptyField = true;
34142
+ values[id] = 0;
34143
+ return;
34144
+ }
34145
+ if (/^[0-9]+(px)?$/.test(value)) {
34146
+ value = parseInt(value, 10);
34147
+ }
34148
+ values[id] = value;
34149
+ if ((wasEmptyField && values[id]) ||
34150
+ (equal && id !== 'marginTop' && values[id] !== values.marginTop)) {
34151
+ equal = false;
34152
+ }
34153
+ });
34154
+ state.marginIsLocked = equal;
34155
+ }
34156
+
34157
+
34158
+ /***/ }),
34159
+
34160
+ /***/ 17880:
34161
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
34162
+
34163
+ "use strict";
34164
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
34165
+ /* harmony export */ P: function() { return /* binding */ readSizes; }
34166
+ /* harmony export */ });
34167
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(31635);
34168
+ /* harmony import */ var jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(12461);
34169
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26150);
34170
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(38322);
34171
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9645);
34172
+ /*!
34173
+ * Jodit Editor (https://xdsoft.net/jodit/)
34174
+ * Released under MIT see LICENSE.txt in the project root for license information.
34175
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
34176
+ */
34177
+
34178
+
34179
+
34180
+
34181
+
34182
+ /** @private */
34183
+ function readSizes(image, values, state) {
34184
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_2__/* .__awaiter */ .sH)(this, void 0, Promise, function () {
34185
+ var width, height, imageWidth, imageHeight, w, h;
34186
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_2__/* .__generator */ .YH)(this, function (_a) {
34187
+ switch (_a.label) {
34188
+ case 0: return [4 /*yield*/, image.decode()];
34189
+ case 1:
34190
+ _a.sent();
34191
+ 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;
34192
+ 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;
34193
+ values.imageWidth =
34194
+ width !== false
34195
+ ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeFromString */ .G)(width)
34196
+ : image.offsetWidth || image.naturalWidth;
34197
+ values.imageHeight =
34198
+ height !== false
34199
+ ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeFromString */ .G)(height)
34200
+ : image.offsetHeight || image.naturalHeight;
34201
+ imageWidth = values.imageWidth, imageHeight = values.imageHeight;
34202
+ w = parseFloat(imageWidth.toString());
34203
+ 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)) {
34204
+ state.sizeIsLocked = false;
34205
+ return [2 /*return*/];
34206
+ }
34207
+ if (height === false) {
34208
+ values.imageHeight = Math.round(w / state.ratio);
34209
+ state.sizeIsLocked = true;
34210
+ return [2 /*return*/];
34211
+ }
34212
+ h = parseFloat(imageHeight.toString());
34213
+ state.sizeIsLocked = Math.abs(w - h * state.ratio) < 1;
34214
+ return [2 /*return*/];
34215
+ }
34216
+ });
34217
+ });
34218
+ }
34219
+
34220
+
34221
+ /***/ }),
34222
+
34223
+ /***/ 31970:
34224
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
34225
+
34226
+ "use strict";
34227
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
34228
+ /* harmony export */ l: function() { return /* binding */ UIImagePropertiesForm; }
34229
+ /* harmony export */ });
34230
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(31635);
34231
+ /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22664);
34232
+ /* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(24767);
34233
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(65147);
34234
+ /* harmony import */ var jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6455);
34235
+ /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(931);
34236
+ /* harmony import */ var jodit_modules_widget__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(16116);
34237
+ /* harmony import */ var _ui_image_main_tab__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(33403);
34238
+ /* harmony import */ var _ui_image_position_tab__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(46681);
34239
+ /*!
34240
+ * Jodit Editor (https://xdsoft.net/jodit/)
34241
+ * Released under MIT see LICENSE.txt in the project root for license information.
34242
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
34243
+ */
34244
+
34245
+
34246
+
34247
+
34248
+
34249
+
34250
+
34251
+
34252
+
34253
+
34254
+ /** @private */
34255
+ var UIImagePropertiesForm = /** @class */ (function (_super) {
34256
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__extends */ .C6)(UIImagePropertiesForm, _super);
34257
+ function UIImagePropertiesForm(jodit, state, activeTabState, handlers) {
34258
+ var _this = _super.call(this, jodit) || this;
34259
+ _this.state = state;
34260
+ _this.handlers = handlers;
34261
+ _this.__mainTab = new _ui_image_main_tab__WEBPACK_IMPORTED_MODULE_5__/* .UIImageMainTab */ .k(_this.jodit, _this.state, _this.handlers);
34262
+ _this.__positionTab = new _ui_image_position_tab__WEBPACK_IMPORTED_MODULE_6__/* .UIImagePositionTab */ ._(_this.jodit, _this.state, _this.handlers);
34263
+ _this.getElm('tabsBox').appendChild((0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_4__/* .TabsWidget */ .Zg)(jodit, [
34264
+ { name: 'Image', content: _this.__mainTab },
34265
+ { name: 'Advanced', content: _this.__positionTab }
34266
+ ], activeTabState));
34267
+ _this.setMod('lock-size', _this.state.sizeIsLocked);
34268
+ _this.append(_this.__mainTab).append(_this.__positionTab);
34269
+ return _this;
34270
+ }
34271
+ UIImagePropertiesForm.prototype.className = function () {
34272
+ return 'UIImagePropertiesForm';
34273
+ };
34274
+ UIImagePropertiesForm.prototype.appendChildToContainer = function () { };
34275
+ UIImagePropertiesForm.prototype.getElm = function (elementName) {
34276
+ var e_1, _a;
34277
+ var selfElm = _super.prototype.getElm.call(this, elementName);
34278
+ if (selfElm) {
34279
+ return selfElm;
34280
+ }
34281
+ try {
34282
+ for (var _b = (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__values */ .Ju)(this.elements), _c = _b.next(); !_c.done; _c = _b.next()) {
34283
+ var child = _c.value;
34284
+ var elm = child.getElm(elementName);
34285
+ if (elm) {
34286
+ return elm;
34287
+ }
34288
+ }
34289
+ }
34290
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
34291
+ finally {
34292
+ try {
34293
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
34294
+ }
34295
+ finally { if (e_1) throw e_1.error; }
34296
+ }
34297
+ return null;
34298
+ };
34299
+ UIImagePropertiesForm.prototype.render = function () {
34300
+ return "<form>\n\t\t<div class=\"jodit-grid jodit-grid_xs-column\">\n\t\t\t<div class=\"jodit_col-lg-2-5 jodit_col-xs-5-5\">\n\t\t\t\t<div class=\"&__view-box\">\n\t\t\t\t\t<div class=\"&__imageView\">\n\t\t\t\t\t\t<img class=\"&__imageViewSrc\" src=\"\" alt=\"\"/>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"jodit-form__group &__imageSizes\">\n\t\t\t\t\t\t<input type=\"text\" class=\"jodit-input &__imageWidth\"/>\n\t\t\t\t\t\t<a class=\"&__lockSize\">".concat(jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__/* .Icon */ .I.get('lock'), "</a>\n\t\t\t\t\t\t<input type=\"text\" class=\"&__imageHeight jodit-input\"/>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class=\"jodit_col-lg-3-5 jodit_col-xs-5-5 &__tabsBox\"></div>\n\t\t</div>\n\t</form>");
34301
+ };
34302
+ UIImagePropertiesForm.prototype.onChangeSizeIsLocked = function () {
34303
+ var lockSize = this.getElm('lockSize');
34304
+ var imageWidth = this.getElm('imageWidth');
34305
+ lockSize.innerHTML = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__/* .Icon */ .I.get(this.state.sizeIsLocked ? 'lock' : 'unlock');
34306
+ this.setMod('lock-size', this.state.sizeIsLocked);
34307
+ this.j.e.fire(imageWidth, 'change');
34308
+ };
34309
+ UIImagePropertiesForm.prototype.onLockSizeClick = function () {
34310
+ this.state.sizeIsLocked = !this.state.sizeIsLocked;
34311
+ };
34312
+ UIImagePropertiesForm.prototype.onStateValuesSizeChange = function () {
34313
+ var imageWidth = this.getElm('imageWidth');
34314
+ var imageHeight = this.getElm('imageHeight');
34315
+ if (imageWidth !== this.j.od.activeElement) {
34316
+ imageWidth.value = this.state.values.imageWidth.toString();
34317
+ }
34318
+ if (imageHeight !== this.j.od.activeElement) {
34319
+ imageHeight.value = this.state.values.imageHeight.toString();
34320
+ }
34321
+ };
34322
+ UIImagePropertiesForm.prototype.onImageWidthChange = function (e) {
34323
+ var imageWidth = this.getElm('imageWidth');
34324
+ var imageHeight = this.getElm('imageHeight');
34325
+ if (!this.state.sizeIsLocked ||
34326
+ !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.isNumeric)(imageWidth.value) ||
34327
+ !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.isNumeric)(imageHeight.value)) {
34328
+ this.state.values.imageWidth = imageWidth.value;
34329
+ this.state.values.imageHeight = imageHeight.value;
34330
+ return;
34331
+ }
34332
+ var w = parseFloat(imageWidth.value), h = parseFloat(imageHeight.value);
34333
+ if (e.target === imageWidth) {
34334
+ this.state.values.imageWidth = w;
34335
+ this.state.values.imageHeight = Math.round(w / this.state.ratio);
34336
+ }
34337
+ else {
34338
+ this.state.values.imageWidth = Math.round(h * this.state.ratio);
34339
+ this.state.values.imageHeight = h;
34340
+ }
34341
+ };
34342
+ UIImagePropertiesForm.prototype.onStateValuesImageSrcChange = function () {
34343
+ var imageSrc = this.state.values.imageSrc;
34344
+ if (!imageSrc) {
34345
+ return;
34346
+ }
34347
+ var imageViewSrc = this.getElm('imageViewSrc');
34348
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.attr)(imageViewSrc, 'src', imageSrc);
34349
+ var image = new Image();
34350
+ image.src = imageSrc;
34351
+ this.state.image = image;
34352
+ };
34353
+ UIImagePropertiesForm.prototype.hideFieldByOptions = function () {
34354
+ var _this = this;
34355
+ var opt = this.j.o.image;
34356
+ [
34357
+ ['editSize', 'imageSizes'],
34358
+ ['showPreview', 'imageView']
34359
+ ].forEach(function (_a) {
34360
+ var _b = (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__read */ .zs)(_a, 2), optKey = _b[0], elmKey = _b[1];
34361
+ var elm = _this.getElm(elmKey);
34362
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.css)(elm, 'display', opt[optKey] ? null : 'none');
34363
+ });
34364
+ };
34365
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34366
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready'),
34367
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.sizeIsLocked')
34368
+ ], UIImagePropertiesForm.prototype, "onChangeSizeIsLocked", null);
34369
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34370
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('lockSize:click')
34371
+ ], UIImagePropertiesForm.prototype, "onLockSizeClick", null);
34372
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34373
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready'),
34374
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)(['state.values.imageWidth', 'state.values.imageHeight'])
34375
+ ], UIImagePropertiesForm.prototype, "onStateValuesSizeChange", null);
34376
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34377
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([
34378
+ 'imageWidth:change',
34379
+ 'imageHeight:change',
34380
+ 'imageWidth:keydown',
34381
+ 'imageHeight:keydown',
34382
+ 'imageWidth:mousedown',
34383
+ 'imageHeight:mousedown',
34384
+ 'imageWidth:paste',
34385
+ 'imageHeight:paste'
34386
+ ]),
34387
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.debounce)()
34388
+ ], UIImagePropertiesForm.prototype, "onImageWidthChange", null);
34389
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34390
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready'),
34391
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.values.imageSrc')
34392
+ ], UIImagePropertiesForm.prototype, "onStateValuesImageSrcChange", null);
34393
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34394
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready')
34395
+ ], UIImagePropertiesForm.prototype, "hideFieldByOptions", null);
34396
+ UIImagePropertiesForm = (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34397
+ jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_8__/* .component */ .s
34398
+ ], UIImagePropertiesForm);
34399
+ return UIImagePropertiesForm;
34400
+ }(jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_2__/* .UIGroup */ .U));
34401
+
34402
+
34403
+
34404
+ /***/ }),
34405
+
34406
+ /***/ 33403:
34407
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
34408
+
34409
+ "use strict";
34410
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
34411
+ /* harmony export */ k: function() { return /* binding */ UIImageMainTab; }
34412
+ /* harmony export */ });
34413
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(31635);
34414
+ /* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(24767);
34415
+ /* harmony import */ var jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71151);
34416
+ /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(66927);
34417
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65147);
34418
+ /* harmony import */ var jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6455);
34419
+ /*!
34420
+ * Jodit Editor (https://xdsoft.net/jodit/)
34421
+ * Released under MIT see LICENSE.txt in the project root for license information.
34422
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
34423
+ */
34424
+
34425
+
34426
+
34427
+
34428
+
34429
+
34430
+ /** @private */
34431
+ var UIImageMainTab = /** @class */ (function (_super) {
34432
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__extends */ .C6)(UIImageMainTab, _super);
34433
+ function UIImageMainTab(view, state, handlers) {
34434
+ var _this = _super.call(this, view) || this;
34435
+ _this.state = state;
34436
+ _this.handlers = handlers;
34437
+ return _this;
34438
+ }
34439
+ UIImageMainTab.prototype.className = function () {
34440
+ return 'UIImageMainTab';
34441
+ };
34442
+ UIImageMainTab.prototype.appendChildToContainer = function () {
34443
+ // Do nothing
34444
+ };
34445
+ UIImageMainTab.prototype.render = function () {
34446
+ return "<div class=\"jodit-form__group &__editSrc\">\n\t\t\t<label>~Src~</label>\n\t\t\t<div class=\"jodit-input_group\">\n\t\t\t\t<input class=\"jodit-input &__imageSrc\" type=\"text\"/>\n\t\t\t\t<div class=\"jodit-input_group-buttons &__fixImage\">\n\t\t\t\t\t\t<a class=\"jodit-button &__changeImage\">*image*</a>\n\t\t\t\t\t\t<a class=\"jodit-button &__editImage\">*crop*</a>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"jodit-form__group &__editTitle\">\n\t\t\t<label>~Title~</label>\n\t\t\t<input type=\"text\" class=\"jodit-input &__imageTitle\"/>\n\t\t</div>\n\t\t<div class=\"jodit-form__group &__editAlt\">\n\t\t\t<label>~Alternative~</label>\n\t\t\t<input type=\"text\" class=\"jodit-input &__imageAlt\"/>\n\t\t</div>\n\t\t<div class=\"jodit-form__group &__editLink\">\n\t\t\t<label>~Link~</label>\n\t\t\t<input type=\"text\" class=\"jodit-input &__imageLink\"/>\n\t\t</div>\n\t\t<div class=\"jodit-form__group &__editLinkTarget\">\n\t\t\t<label class=\"jodit_vertical_middle\">\n\t\t\t\t<input type=\"checkbox\" class=\"jodit-checkbox &__imageLinkOpenInNewTab\"/>\n\t\t\t\t<span>~Open link in new tab~</span>\n\t\t\t</label>\n\t\t</div>";
34447
+ };
34448
+ UIImageMainTab.prototype.onStateImageSrcChange = function () {
34449
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__awaiter */ .sH)(this, void 0, Promise, function () {
34450
+ var imageSrc;
34451
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__generator */ .YH)(this, function (_a) {
34452
+ imageSrc = this.getElm('imageSrc');
34453
+ imageSrc.value = this.state.values.imageSrc;
34454
+ return [2 /*return*/];
34455
+ });
34456
+ });
34457
+ };
34458
+ UIImageMainTab.prototype.onImageSrcChange = function () {
34459
+ this.state.values.imageSrc = this.getElm('imageSrc').value;
34460
+ };
34461
+ /**
34462
+ * Open image editor
34463
+ */
34464
+ UIImageMainTab.prototype.onEditImageClick = function (e) {
34465
+ this.handlers.openImageEditor();
34466
+ e.stopPropagation();
34467
+ };
34468
+ /**
34469
+ * Open popup with filebrowser/uploader buttons for image
34470
+ */
34471
+ UIImageMainTab.prototype.onChangeImageClick = function (e) {
34472
+ this.handlers.openImagePopup(this.getElm('changeImage'));
34473
+ e.stopPropagation();
34474
+ };
34475
+ UIImageMainTab.prototype.onStateTitleChange = function () {
34476
+ var title = this.getElm('imageTitle');
34477
+ title.value = this.state.values.imageTitle;
34478
+ };
34479
+ UIImageMainTab.prototype.onTitleChange = function () {
34480
+ this.state.values.imageTitle = this.getElm('imageTitle').value;
34481
+ };
34482
+ UIImageMainTab.prototype.onStateAltChange = function () {
34483
+ var alt = this.getElm('imageAlt');
34484
+ alt.value = this.state.values.imageAlt;
34485
+ };
34486
+ UIImageMainTab.prototype.onAltChange = function () {
34487
+ this.state.values.imageAlt = this.getElm('imageAlt').value;
34488
+ };
34489
+ UIImageMainTab.prototype.onStateImageLinkChange = function () {
34490
+ var imageLink = this.getElm('imageLink');
34491
+ imageLink.value = this.state.values.imageLink;
34492
+ };
34493
+ UIImageMainTab.prototype.onImageLinkChange = function () {
34494
+ this.state.values.imageLink = this.getElm('imageLink').value;
34495
+ };
34496
+ UIImageMainTab.prototype.onStateImageLinkOpenInNewTabChange = function () {
34497
+ var imageLinkOpenInNewTab = this.getElm('imageLinkOpenInNewTab');
34498
+ imageLinkOpenInNewTab.checked = this.state.values.imageLinkOpenInNewTab;
34499
+ };
34500
+ UIImageMainTab.prototype.onImageLinkOpenInNewTabChange = function () {
34501
+ this.state.values.imageLinkOpenInNewTab = this.getElm('imageLinkOpenInNewTab').checked;
34502
+ };
34503
+ UIImageMainTab.prototype.hideFieldByOptions = function () {
34504
+ var _this = this;
34505
+ var o = this.j.o;
34506
+ var opt = o.image;
34507
+ [
34508
+ ['editSrc', 'editSrc'],
34509
+ ['editTitle', 'editTitle'],
34510
+ ['editAlt', 'editAlt'],
34511
+ ['editLink', 'editLink'],
34512
+ ['editLink', 'editLinkTarget'],
34513
+ ['useImageEditor', 'editImage']
34514
+ ].forEach(function (_a) {
34515
+ var _b = (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__read */ .zs)(_a, 2), optKey = _b[0], elmKey = _b[1];
34516
+ var elm = _this.getElm(elmKey);
34517
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(elm, 'display', opt[optKey] ? null : 'none');
34518
+ });
34519
+ var changeImage = this.getElm('changeImage');
34520
+ var needShowChangeImage = Boolean(o.filebrowser.ajax.url || o.uploader.url);
34521
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(changeImage, 'display', needShowChangeImage ? null : 'none');
34522
+ var editImage = this.getElm('editImage');
34523
+ var needShowEditImage = Boolean(o.filebrowser.ajax.url) && opt.useImageEditor;
34524
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(editImage, 'display', needShowEditImage ? null : 'none');
34525
+ var fixImage = this.getElm('fixImage');
34526
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(fixImage, 'display', needShowChangeImage || needShowEditImage ? null : 'none');
34527
+ };
34528
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
34529
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageSrc')
34530
+ ], UIImageMainTab.prototype, "onStateImageSrcChange", null);
34531
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
34532
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageSrc:change')
34533
+ ], UIImageMainTab.prototype, "onImageSrcChange", null);
34534
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
34535
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('editImage:click')
34536
+ ], UIImageMainTab.prototype, "onEditImageClick", null);
34537
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
34538
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('changeImage:click')
34539
+ ], UIImageMainTab.prototype, "onChangeImageClick", null);
34540
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
34541
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageTitle')
34542
+ ], UIImageMainTab.prototype, "onStateTitleChange", null);
34543
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
34544
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageTitle:change')
34545
+ ], UIImageMainTab.prototype, "onTitleChange", null);
34546
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
34547
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageAlt')
34548
+ ], UIImageMainTab.prototype, "onStateAltChange", null);
34549
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
34550
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageAlt:change')
34551
+ ], UIImageMainTab.prototype, "onAltChange", null);
34552
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
34553
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageLink')
34554
+ ], UIImageMainTab.prototype, "onStateImageLinkChange", null);
34555
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
34556
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageLink:change')
34557
+ ], UIImageMainTab.prototype, "onImageLinkChange", null);
34558
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
34559
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageLinkOpenInNewTab')
34560
+ ], UIImageMainTab.prototype, "onStateImageLinkOpenInNewTabChange", null);
34561
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
34562
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageLinkOpenInNewTab:change')
34563
+ ], UIImageMainTab.prototype, "onImageLinkOpenInNewTabChange", null);
34564
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
34565
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready')
34566
+ ], UIImageMainTab.prototype, "hideFieldByOptions", null);
34567
+ UIImageMainTab = (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
34568
+ jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_5__/* .component */ .s
34569
+ ], UIImageMainTab);
34570
+ return UIImageMainTab;
34571
+ }(jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_3__/* .UIGroup */ .U));
34572
+
34573
+
34574
+
34575
+ /***/ }),
34576
+
34577
+ /***/ 46681:
34578
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
34579
+
34580
+ "use strict";
34581
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
34582
+ /* harmony export */ _: function() { return /* binding */ UIImagePositionTab; }
34583
+ /* harmony export */ });
34584
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(31635);
34585
+ /* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(24767);
34586
+ /* harmony import */ var jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71151);
34587
+ /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(66927);
34588
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65147);
34589
+ /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(98253);
34590
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(26150);
34591
+ /* harmony import */ var jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29780);
34592
+ /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(931);
34593
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(9645);
34275
34594
  /*!
34276
34595
  * Jodit Editor (https://xdsoft.net/jodit/)
34277
34596
  * Released under MIT see LICENSE.txt in the project root for license information.
34278
34597
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
34279
34598
  */
34280
34599
 
34281
- function positionTab(editor) {
34282
- var 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);
34283
- var classInput = [];
34284
- if (opt.image.availableClasses.length > 0) {
34285
- classInput.push('<select data-ref="classes" class="jodit-input jodit-select">');
34286
- opt.image.availableClasses.forEach(function (item) {
34287
- if (typeof item === 'string') {
34288
- classInput.push("<option value=\"".concat(item, "\">").concat(item, "</option>"));
34600
+
34601
+
34602
+
34603
+
34604
+
34605
+
34606
+
34607
+
34608
+
34609
+ /** @private */
34610
+ var UIImagePositionTab = /** @class */ (function (_super) {
34611
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__extends */ .C6)(UIImagePositionTab, _super);
34612
+ function UIImagePositionTab(jodit, state, handlers) {
34613
+ var _this = _super.call(this, jodit, {
34614
+ availableClasses: jodit.o.image.availableClasses
34615
+ }) || this;
34616
+ _this.state = state;
34617
+ _this.handlers = handlers;
34618
+ return _this;
34619
+ }
34620
+ UIImagePositionTab.prototype.className = function () {
34621
+ return 'UIImagePositionTab';
34622
+ };
34623
+ UIImagePositionTab.prototype.render = function (_a) {
34624
+ var availableClasses = _a.availableClasses;
34625
+ return "<div class=\"jodit-form__group &__editMargins\">\n\t\t\t<label>~Margins~</label>\n\t\t\t<div class=\"jodit-grid jodit_vertical_middle\">\n\t\t\t\t<input class=\"jodit_col-lg-1-5 jodit-input &__marginTop\" type=\"text\" placeholder=\"~top~\"/>\n\t\t\t\t<a style=\"text-align: center;\" class=\"jodit-properties__lock jodit_col-lg-1-5 &__lockMargin\">*lock*</a>\n\t\t\t\t<input disabled=\"disabled\" class=\"jodit_col-lg-1-5 jodit-input &__marginRight\" type=\"text\" placeholder=\"~right~\"/>\n\t\t\t\t<input disabled=\"disabled\" class=\"jodit_col-lg-1-5 jodit-input &__marginBottom\" type=\"text\" placeholder=\"~bottom~\"/>\n\t\t\t\t<input disabled=\"disabled\" class=\"jodit_col-lg-1-5 jodit-input &__marginLeft\" type=\"text\" placeholder=\"~left~\"/>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"jodit-form__group &__editAlign\">\n\t\t\t<label>~Align~</label>\n\t\t\t<select class=\"jodit-select &__align\">\n\t\t\t\t<option value=\"\">~--Not Set--~</option>\n\t\t\t\t<option value=\"left\">~Left~</option>\n\t\t\t\t<option value=\"center\">~Center~</option>\n\t\t\t\t<option value=\"right\">~Right~</option>\n\t\t\t</select>\n\t\t</div>\n\t\t<div class=\"jodit-form__group &__editStyle\">\n\t\t\t<label>~Styles~</label>\n\t\t\t<input type=\"text\" class=\"jodit-input &__style\"/>\n\t\t</div>\n\t\t<div class=\"jodit-form__group &__editClass\">\n\t\t\t<label>~Classes~</label>\n\t\t\t".concat((function () {
34626
+ var classInput = [];
34627
+ if (availableClasses && availableClasses.length > 0) {
34628
+ classInput.push('<select class="jodit-input jodit-select &__classes">');
34629
+ availableClasses.forEach(function (item) {
34630
+ if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_8__/* .isString */ .K)(item)) {
34631
+ classInput.push("<option value=\"".concat(item, "\">").concat(item, "</option>"));
34632
+ }
34633
+ else {
34634
+ classInput.push("<option value=\"".concat(item[0], "\">").concat(item[1], "</option>"));
34635
+ }
34636
+ });
34637
+ classInput.push('</select>');
34289
34638
  }
34290
34639
  else {
34291
- classInput.push("<option value=\"".concat(item[0], "\">").concat(item[1], "</option>"));
34640
+ classInput.push('<input type="text" class="jodit-input &__classes"/>');
34292
34641
  }
34642
+ return classInput.join('');
34643
+ })(), "\n\t\t</div>\n\t\t<div class=\"jodit-form__group &__editId\">\n\t\t\t<label>Id</label>\n\t\t\t<input type=\"text\" class=\"jodit-input &__id\"/>\n\t\t</div>\n\t\t<div\n\t\t\tclass=\"jodit-form__group &__editBorderRadius\"\n\t\t>\n\t\t\t<label>~Border radius~</label>\n\t\t\t<input type=\"number\" class=\"jodit-input &__borderRadius\"/>\n\t\t</div>");
34644
+ };
34645
+ UIImagePositionTab.prototype.onStateAlignChange = function () {
34646
+ var align = this.getElm('align');
34647
+ align.value = this.state.values.align;
34648
+ };
34649
+ UIImagePositionTab.prototype.onChangeAlign = function () {
34650
+ var align = this.getElm('align');
34651
+ this.state.values.align = align.value;
34652
+ };
34653
+ UIImagePositionTab.prototype.onStateValuesBorderRadiusChange = function () {
34654
+ var borderRadius = this.getElm('borderRadius');
34655
+ borderRadius.value = this.state.values.borderRadius.toString();
34656
+ };
34657
+ UIImagePositionTab.prototype.onChangeBorderRadius = function () {
34658
+ var borderRadius = this.getElm('borderRadius');
34659
+ this.state.values.borderRadius = parseFloat(borderRadius.value);
34660
+ };
34661
+ UIImagePositionTab.prototype.onStateValuesIdChange = function () {
34662
+ var id = this.getElm('id');
34663
+ id.value = this.state.values.id;
34664
+ };
34665
+ UIImagePositionTab.prototype.onChangeId = function () {
34666
+ var id = this.getElm('id');
34667
+ this.state.values.id = id.value;
34668
+ };
34669
+ UIImagePositionTab.prototype.onStateValuesStyleChange = function () {
34670
+ var style = this.getElm('style');
34671
+ style.value = this.state.values.style;
34672
+ };
34673
+ UIImagePositionTab.prototype.onChangeStyle = function () {
34674
+ var style = this.getElm('style');
34675
+ this.state.values.style = style.value;
34676
+ };
34677
+ UIImagePositionTab.prototype.onStateValuesClassesChange = function () {
34678
+ var classes = this.getElm('classes');
34679
+ classes.value = this.state.values.classes;
34680
+ };
34681
+ UIImagePositionTab.prototype.onChangClasses = function () {
34682
+ var classes = this.getElm('classes');
34683
+ this.state.values.classes = classes.value;
34684
+ };
34685
+ UIImagePositionTab.prototype.onLockMarginClick = function (e) {
34686
+ this.state.marginIsLocked = !this.state.marginIsLocked;
34687
+ e.preventDefault();
34688
+ };
34689
+ UIImagePositionTab.prototype.onChangeMarginIsLocked = function () {
34690
+ var _this = this;
34691
+ var marginBottom = this.getElm('marginBottom');
34692
+ var marginRight = this.getElm('marginRight');
34693
+ var marginLeft = this.getElm('marginLeft');
34694
+ var lockMargin = this.getElm('lockMargin');
34695
+ [marginRight, marginBottom, marginLeft].forEach(function (elm) {
34696
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_3__/* .attr */ .C)(elm, 'disabled', _this.state.marginIsLocked || null);
34697
+ });
34698
+ lockMargin.innerHTML = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_5__/* .Icon */ .I.get(this.state.marginIsLocked ? 'lock' : 'unlock');
34699
+ if (this.state.marginIsLocked) {
34700
+ var marginTop = this.state.values.marginTop;
34701
+ this.state.values.marginRight = marginTop;
34702
+ this.state.values.marginBottom = marginTop;
34703
+ this.state.values.marginLeft = marginTop;
34704
+ }
34705
+ };
34706
+ UIImagePositionTab.prototype.onStateValuesMarginChange = function () {
34707
+ var marginTop = this.getElm('marginTop');
34708
+ var marginRight = this.getElm('marginRight');
34709
+ var marginBottom = this.getElm('marginBottom');
34710
+ var marginLeft = this.getElm('marginLeft');
34711
+ marginTop.value = this.state.values.marginTop.toString();
34712
+ marginRight.value = this.state.values.marginRight.toString();
34713
+ marginBottom.value = this.state.values.marginBottom.toString();
34714
+ marginLeft.value = this.state.values.marginLeft.toString();
34715
+ };
34716
+ UIImagePositionTab.prototype.onChangeMargin = function () {
34717
+ var marginTop = this.getElm('marginTop');
34718
+ var marginRight = this.getElm('marginRight');
34719
+ var marginBottom = this.getElm('marginBottom');
34720
+ var marginLeft = this.getElm('marginLeft');
34721
+ this.state.values.marginTop = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginTop.value);
34722
+ if (this.state.marginIsLocked) {
34723
+ this.state.values.marginRight = this.state.values.marginTop;
34724
+ this.state.values.marginBottom = this.state.values.marginTop;
34725
+ this.state.values.marginLeft = this.state.values.marginTop;
34726
+ }
34727
+ else {
34728
+ this.state.values.marginRight = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginRight.value);
34729
+ this.state.values.marginBottom = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginBottom.value);
34730
+ this.state.values.marginLeft = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginLeft.value);
34731
+ }
34732
+ };
34733
+ UIImagePositionTab.prototype.hideFieldByOptions = function () {
34734
+ var _this = this;
34735
+ var opt = this.j.o.image;
34736
+ [
34737
+ ['editMargins', 'editMargins'],
34738
+ ['editAlign', 'editAlign'],
34739
+ ['editStyle', 'editStyle'],
34740
+ ['editClass', 'editClass'],
34741
+ ['editId', 'editId'],
34742
+ ['editBorderRadius', 'editBorderRadius']
34743
+ ].forEach(function (_a) {
34744
+ var _b = (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__read */ .zs)(_a, 2), optKey = _b[0], elmKey = _b[1];
34745
+ var elm = _this.getElm(elmKey);
34746
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(elm, 'display', opt[optKey] ? null : 'none');
34293
34747
  });
34294
- classInput.push('</select>');
34748
+ };
34749
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34750
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
34751
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.align')
34752
+ ], UIImagePositionTab.prototype, "onStateAlignChange", null);
34753
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34754
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('align:change')
34755
+ ], UIImagePositionTab.prototype, "onChangeAlign", null);
34756
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34757
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
34758
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.borderRadius')
34759
+ ], UIImagePositionTab.prototype, "onStateValuesBorderRadiusChange", null);
34760
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34761
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('borderRadius:change')
34762
+ ], UIImagePositionTab.prototype, "onChangeBorderRadius", null);
34763
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34764
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
34765
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.id')
34766
+ ], UIImagePositionTab.prototype, "onStateValuesIdChange", null);
34767
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34768
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('id:change')
34769
+ ], UIImagePositionTab.prototype, "onChangeId", null);
34770
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34771
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
34772
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.style')
34773
+ ], UIImagePositionTab.prototype, "onStateValuesStyleChange", null);
34774
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34775
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('style:change')
34776
+ ], UIImagePositionTab.prototype, "onChangeStyle", null);
34777
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34778
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
34779
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.classes')
34780
+ ], UIImagePositionTab.prototype, "onStateValuesClassesChange", null);
34781
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34782
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('classes:change')
34783
+ ], UIImagePositionTab.prototype, "onChangClasses", null);
34784
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34785
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('lockMargin:click')
34786
+ ], UIImagePositionTab.prototype, "onLockMarginClick", null);
34787
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34788
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
34789
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.marginIsLocked')
34790
+ ], UIImagePositionTab.prototype, "onChangeMarginIsLocked", null);
34791
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34792
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
34793
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)([
34794
+ 'state.values.marginTop',
34795
+ 'state.values.marginRight',
34796
+ 'state.values.marginBottom',
34797
+ 'state.values.marginLeft'
34798
+ ])
34799
+ ], UIImagePositionTab.prototype, "onStateValuesMarginChange", null);
34800
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34801
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)([
34802
+ 'marginTop:change',
34803
+ 'marginRight:change',
34804
+ 'marginBottom:change',
34805
+ 'marginLeft:change'
34806
+ ])
34807
+ ], UIImagePositionTab.prototype, "onChangeMargin", null);
34808
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34809
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready')
34810
+ ], UIImagePositionTab.prototype, "hideFieldByOptions", null);
34811
+ UIImagePositionTab = (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34812
+ jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_9__/* .component */ .s
34813
+ ], UIImagePositionTab);
34814
+ return UIImagePositionTab;
34815
+ }(jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_4__/* .UIElement */ .D));
34816
+
34817
+
34818
+
34819
+ /***/ }),
34820
+
34821
+ /***/ 80778:
34822
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
34823
+
34824
+ "use strict";
34825
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
34826
+ /* harmony export */ v: function() { return /* binding */ openImageEditorDialog; }
34827
+ /* harmony export */ });
34828
+ /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(98253);
34829
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26150);
34830
+ /* harmony import */ var jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(53804);
34831
+ /*!
34832
+ * Jodit Editor (https://xdsoft.net/jodit/)
34833
+ * Released under MIT see LICENSE.txt in the project root for license information.
34834
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
34835
+ */
34836
+
34837
+
34838
+
34839
+ /**
34840
+ * Open image editor dialog
34841
+ * @private
34842
+ */
34843
+ function openImageEditorDialog(j, state) {
34844
+ var url = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(state.image, 'src') || '', a = j.c.element('a'), loadExternal = function () {
34845
+ if (a.host !== location.host) {
34846
+ j.confirm('You can only edit your own images. Download this image on the host?', function (yes) {
34847
+ if (yes && j.uploader) {
34848
+ j.uploader.uploadRemoteImage(a.href.toString(), function (resp) {
34849
+ j.alert('The image has been successfully uploaded to the host!', function () {
34850
+ if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_2__/* .isString */ .K)(resp.newfilename)) {
34851
+ state.values.imageSrc =
34852
+ resp.baseurl +
34853
+ resp.newfilename;
34854
+ }
34855
+ });
34856
+ }, function (error) {
34857
+ j.alert('There was an error loading %s', error.message);
34858
+ });
34859
+ }
34860
+ });
34861
+ return;
34862
+ }
34863
+ };
34864
+ a.href = url;
34865
+ j.filebrowser.dataProvider
34866
+ .getPathByUrl(a.href.toString())
34867
+ .then(function (resp) {
34868
+ jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_1__/* .openImageEditor */ .B.call(j.filebrowser, a.href, resp.name, resp.path, resp.source, function () {
34869
+ var timestamp = new Date().getTime();
34870
+ state.values.imageSrc =
34871
+ url +
34872
+ (url.indexOf('?') !== -1 ? '' : '?') +
34873
+ '&_tmp=' +
34874
+ timestamp.toString();
34875
+ }, function (error) {
34876
+ j.alert(error.message);
34877
+ });
34878
+ })
34879
+ .catch(function (error) {
34880
+ j.alert(error.message, loadExternal);
34881
+ });
34882
+ }
34883
+
34884
+
34885
+ /***/ }),
34886
+
34887
+ /***/ 33733:
34888
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
34889
+
34890
+ "use strict";
34891
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
34892
+ /* harmony export */ q: function() { return /* binding */ openImagePopup; }
34893
+ /* harmony export */ });
34894
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(31635);
34895
+ /* harmony import */ var jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37923);
34896
+ /* harmony import */ var jodit_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(27594);
34897
+ /* harmony import */ var jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(80071);
34898
+ /* harmony import */ var jodit_modules_widget_file_selector_file_selector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10067);
34899
+ /*!
34900
+ * Jodit Editor (https://xdsoft.net/jodit/)
34901
+ * Released under MIT see LICENSE.txt in the project root for license information.
34902
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
34903
+ */
34904
+
34905
+
34906
+
34907
+
34908
+
34909
+ /** @private */
34910
+ function openImagePopup(j, dialog, state, button) {
34911
+ var _this = this;
34912
+ var popup = new jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_0__/* .Popup */ .z(dialog);
34913
+ var closePopup = function () {
34914
+ popup.close();
34915
+ popup.destruct();
34916
+ };
34917
+ popup
34918
+ .setContent((0,jodit_modules_widget_file_selector_file_selector__WEBPACK_IMPORTED_MODULE_1__/* .FileSelectorWidget */ .k)(j, {
34919
+ upload: function (data) {
34920
+ if (data.files && data.files.length) {
34921
+ state.values.imageSrc =
34922
+ data.baseurl + data.files[0];
34923
+ }
34924
+ closePopup();
34925
+ },
34926
+ filebrowser: function (data) { return (0,tslib__WEBPACK_IMPORTED_MODULE_2__/* .__awaiter */ .sH)(_this, void 0, void 0, function () {
34927
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_2__/* .__generator */ .YH)(this, function (_a) {
34928
+ if (data && (0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_3__/* .isArray */ .c)(data.files) && data.files.length) {
34929
+ state.values.imageSrc = data.files[0];
34930
+ closePopup();
34931
+ }
34932
+ return [2 /*return*/];
34933
+ });
34934
+ }); }
34935
+ }, state.image, closePopup))
34936
+ .open(function () { return (0,jodit_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_4__/* .position */ .G)(button); });
34937
+ }
34938
+
34939
+
34940
+ /***/ }),
34941
+
34942
+ /***/ 9645:
34943
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
34944
+
34945
+ "use strict";
34946
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
34947
+ /* harmony export */ G: function() { return /* binding */ normalSizeFromString; },
34948
+ /* harmony export */ n: function() { return /* binding */ normalSizeToString; }
34949
+ /* harmony export */ });
34950
+ /* harmony import */ var jodit_core_helpers_checker_is_number__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2461);
34951
+ /* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(59101);
34952
+ /*!
34953
+ * Jodit Editor (https://xdsoft.net/jodit/)
34954
+ * Released under MIT see LICENSE.txt in the project root for license information.
34955
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
34956
+ */
34957
+
34958
+
34959
+ /** @private */
34960
+ var normalSizeFromString = function (value) {
34961
+ return /^[-+]?[0-9.]+(px)?$/.test(value.toString())
34962
+ ? parseFloat(value.toString())
34963
+ : value;
34964
+ };
34965
+ /** @private */
34966
+ var normalSizeToString = function (value) {
34967
+ if ((0,jodit_core_helpers_checker_is_number__WEBPACK_IMPORTED_MODULE_1__/* .isNumber */ .E)(value)) {
34968
+ return value ? value + 'px' : value.toString();
34969
+ }
34970
+ value = (0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_0__/* .trim */ .Bq)(value);
34971
+ return /^[0-9]+$/.test(value) ? value + 'px' : value;
34972
+ };
34973
+
34974
+
34975
+ /***/ }),
34976
+
34977
+ /***/ 30393:
34978
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
34979
+
34980
+ "use strict";
34981
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
34982
+ /* harmony export */ j: function() { return /* binding */ applyValuesToImage; }
34983
+ /* harmony export */ });
34984
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55186);
34985
+ /* harmony import */ var jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97369);
34986
+ /* harmony import */ var _link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(88269);
34987
+ /* harmony import */ var _margin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(78139);
34988
+ /* harmony import */ var _size__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(58972);
34989
+ /*!
34990
+ * Jodit Editor (https://xdsoft.net/jodit/)
34991
+ * Released under MIT see LICENSE.txt in the project root for license information.
34992
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
34993
+ */
34994
+
34995
+
34996
+
34997
+
34998
+
34999
+ /**
35000
+ * Apply form's values to image
35001
+ * @private
35002
+ */
35003
+ function applyValuesToImage(j, state, image) {
35004
+ var _a = state.values, style = _a.style, imageSrc = _a.imageSrc, borderRadius = _a.borderRadius, imageTitle = _a.imageTitle, imageAlt = _a.imageAlt, imageLink = _a.imageLink, imageWidth = _a.imageWidth, imageHeight = _a.imageHeight, marginTop = _a.marginTop, marginRight = _a.marginRight, marginBottom = _a.marginBottom, marginLeft = _a.marginLeft, imageLinkOpenInNewTab = _a.imageLinkOpenInNewTab, align = _a.align, classes = _a.classes, id = _a.id;
35005
+ var opt = j.o;
35006
+ // styles
35007
+ if (opt.image.editStyle) {
35008
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'style', style || null);
35009
+ }
35010
+ // Src
35011
+ if (imageSrc) {
35012
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'src', imageSrc);
35013
+ }
35014
+ else {
35015
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.safeRemove(image);
35016
+ return;
35017
+ }
35018
+ // Border radius
35019
+ image.style.borderRadius = borderRadius ? borderRadius + 'px' : '';
35020
+ // Title
35021
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'title', imageTitle || null);
35022
+ // Alt
35023
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'alt', imageAlt || null);
35024
+ // Link
35025
+ (0,_link__WEBPACK_IMPORTED_MODULE_2__/* .applyLink */ .j)(j, image, imageLink, imageLinkOpenInNewTab);
35026
+ // Size
35027
+ (0,_size__WEBPACK_IMPORTED_MODULE_4__/* .applySize */ .q)(image, imageWidth, imageHeight, state.sizeIsLocked);
35028
+ // Margin
35029
+ if (j.o.image.editMargins) {
35030
+ (0,_margin__WEBPACK_IMPORTED_MODULE_3__/* .applyMargin */ .N)(j, marginTop, marginRight, marginBottom, marginLeft, image, state.marginIsLocked);
35031
+ }
35032
+ if (opt.image.editClass) {
35033
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'class', classes || null);
35034
+ }
35035
+ if (opt.image.editId) {
35036
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'id', id || null);
35037
+ }
35038
+ if (opt.image.editAlign) {
35039
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.hAlignElement)(image, align);
35040
+ }
35041
+ }
35042
+
35043
+
35044
+ /***/ }),
35045
+
35046
+ /***/ 88269:
35047
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
35048
+
35049
+ "use strict";
35050
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
35051
+ /* harmony export */ j: function() { return /* binding */ applyLink; }
35052
+ /* harmony export */ });
35053
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55186);
35054
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26150);
35055
+ /*!
35056
+ * Jodit Editor (https://xdsoft.net/jodit/)
35057
+ * Released under MIT see LICENSE.txt in the project root for license information.
35058
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
35059
+ */
35060
+
35061
+
35062
+ /** @private */
35063
+ function applyLink(j, image, imageLink, imageLinkOpenInNewTab) {
35064
+ // Link
35065
+ var link = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.closest(image, 'a', j.editor);
35066
+ if (imageLink) {
35067
+ if (!link) {
35068
+ link = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.wrap(image, 'a', j.createInside);
35069
+ }
35070
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(link, 'href', imageLink);
35071
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(link, 'target', imageLinkOpenInNewTab ? '_blank' : null);
34295
35072
  }
34296
35073
  else {
34297
- classInput.push('<input data-ref="classes" type="text" class="jodit-input"/>');
35074
+ if (link && link.parentNode) {
35075
+ link.parentNode.replaceChild(image, link);
35076
+ }
35077
+ }
35078
+ }
35079
+
35080
+
35081
+ /***/ }),
35082
+
35083
+ /***/ 78139:
35084
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
35085
+
35086
+ "use strict";
35087
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
35088
+ /* harmony export */ N: function() { return /* binding */ applyMargin; }
35089
+ /* harmony export */ });
35090
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(38322);
35091
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9645);
35092
+ /*!
35093
+ * Jodit Editor (https://xdsoft.net/jodit/)
35094
+ * Released under MIT see LICENSE.txt in the project root for license information.
35095
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
35096
+ */
35097
+
35098
+
35099
+ /** @private */
35100
+ function applyMargin(j, marginTop, marginRight, marginBottom, marginLeft, image, marginIsLocked) {
35101
+ var margins = [marginTop, marginRight, marginBottom, marginLeft];
35102
+ var applyMargin = function (key, value) {
35103
+ var oldValue = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_1__/* .css */ .A)(image, key);
35104
+ var v = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_0__/* .normalSizeToString */ .n)(value);
35105
+ if (oldValue.toString() !== v.toString()) {
35106
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_1__/* .css */ .A)(image, key, v);
35107
+ }
35108
+ };
35109
+ if (!marginIsLocked) {
35110
+ var sides_1 = [
35111
+ 'margin-top',
35112
+ 'margin-right',
35113
+ 'margin-bottom',
35114
+ 'margin-left'
35115
+ ];
35116
+ margins.forEach(function (margin, index) {
35117
+ var side = sides_1[index];
35118
+ applyMargin(side, margin);
35119
+ });
35120
+ }
35121
+ else {
35122
+ applyMargin('margin', marginTop);
35123
+ }
35124
+ }
35125
+
35126
+
35127
+ /***/ }),
35128
+
35129
+ /***/ 58972:
35130
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
35131
+
35132
+ "use strict";
35133
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
35134
+ /* harmony export */ q: function() { return /* binding */ applySize; }
35135
+ /* harmony export */ });
35136
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26150);
35137
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(38322);
35138
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9645);
35139
+ /*!
35140
+ * Jodit Editor (https://xdsoft.net/jodit/)
35141
+ * Released under MIT see LICENSE.txt in the project root for license information.
35142
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
35143
+ */
35144
+
35145
+
35146
+
35147
+ /** @private */
35148
+ function applySize(image, imageWidth, imageHeight, sizeIsLocked) {
35149
+ // Size
35150
+ if (imageWidth !== image.offsetWidth ||
35151
+ imageHeight !== image.offsetHeight) {
35152
+ var updatedWidth = imageWidth ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeToString */ .n)(imageWidth) : null;
35153
+ var updatedHeight = imageHeight
35154
+ ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeToString */ .n)(imageHeight)
35155
+ : null;
35156
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__/* .css */ .A)(image, {
35157
+ width: updatedWidth,
35158
+ height: updatedWidth && sizeIsLocked ? null : updatedHeight
35159
+ });
35160
+ (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);
35161
+ if (!(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'width') || sizeIsLocked) {
35162
+ updatedHeight = null;
35163
+ }
35164
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'height', updatedHeight);
34298
35165
  }
34299
- return editor.c.fromHTML("<div style=\"".concat(!opt.image.editMargins ? 'display:none' : '', "\" class=\"jodit-form__group\">\n\t\t\t<label>").concat(i18n('Margins'), "</label>\n\t\t\t<div class=\"jodit-grid jodit_vertical_middle\">\n\t\t\t\t<input class=\"jodit_col-lg-1-5 jodit-input\" data-ref=\"marginTop\" type=\"text\" placeholder=\"").concat(i18n('top'), "\"/>\n\t\t\t\t<a style=\"text-align: center;\" data-ref=\"lockMargin\" class=\"jodit-properties__lock jodit_col-lg-1-5\">").concat(gi('lock'), "</a>\n\t\t\t\t<input disabled=\"true\" class=\"jodit_col-lg-1-5 jodit-input\" data-ref=\"marginRight\" type=\"text\" placeholder=\"").concat(i18n('right'), "\"/>\n\t\t\t\t<input disabled=\"true\" class=\"jodit_col-lg-1-5 jodit-input\" data-ref=\"marginBottom\" type=\"text\" placeholder=\"").concat(i18n('bottom'), "\"/>\n\t\t\t\t<input disabled=\"true\" class=\"jodit_col-lg-1-5 jodit-input\" data-ref=\"marginLeft\" type=\"text\" placeholder=\"").concat(i18n('left'), "\"/>\n\t\t\t</div>\n\t\t</div>\n\t\t<div\n\t\t\tstyle=\"").concat(!opt.image.editAlign ? 'display:none' : '', "\"\n\t\t\tclass=\"jodit-form__group\"\n\t\t>\n\t\t\t<label>").concat(i18n('Align'), "</label>\n\t\t\t<select data-ref=\"align\" class=\"jodit-select\">\n\t\t\t\t<option value=\"\">").concat(i18n('--Not Set--'), "</option>\n\t\t\t\t<option value=\"left\">").concat(i18n('Left'), "</option>\n\t\t\t\t<option value=\"center\">").concat(i18n('Center'), "</option>\n\t\t\t\t<option value=\"right\">").concat(i18n('Right'), "</option>\n\t\t\t</select>\n\t\t</div>\n\t\t<div style=\"").concat(!opt.image.editStyle ? 'display:none' : '', "\" class=\"jodit-form__group\">\n\t\t\t<label>").concat(i18n('Styles'), "</label>\n\t\t\t<input data-ref=\"style\" type=\"text\" class=\"jodit-input\"/>\n\t\t</div>\n\t\t<div style=\"").concat(!opt.image.editClass ? 'display:none' : '', "\" class=\"jodit-form__group\">\n\t\t\t<label>").concat(i18n('Classes'), "</label>\n\t\t\t").concat(classInput.join(''), "\n\t\t</div>\n\t\t<div style=\"").concat(!opt.image.editId ? 'display:none' : '', "\" class=\"jodit-form__group\">\n\t\t\t<label>Id</label>\n\t\t\t<input data-ref=\"id\" type=\"text\" class=\"jodit-input\"/>\n\t\t</div>\n\t\t<div\n\t\t\tstyle=\"").concat(!opt.image.editBorderRadius ? 'display:none' : '', "\"\n\t\t\tclass=\"jodit-form__group\"\n\t\t>\n\t\t\t<label>").concat(i18n('Border radius'), "</label>\n\t\t\t\t<input data-ref=\"borderRadius\" type=\"number\" class=\"jodit-input\"/>\n\t\t</div>"));
34300
35166
  }
34301
35167
 
34302
35168
 
@@ -40975,7 +41841,8 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_3__/* .pluginSystem */ .fg.add('selec
40975
41841
  */
40976
41842
 
40977
41843
  jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.select = {
40978
- normalizeSelectionBeforeCutAndCopy: false
41844
+ normalizeSelectionBeforeCutAndCopy: false,
41845
+ normalizeTripleClick: true
40979
41846
  };
40980
41847
 
40981
41848
 
@@ -41055,7 +41922,7 @@ var select = /** @class */ (function (_super) {
41055
41922
  }
41056
41923
  };
41057
41924
  /**
41058
- * @event outsideClick(e) - when user clicked in the outside of editor
41925
+ * @event outsideClick(e) - when user clicked on the outside of editor
41059
41926
  */
41060
41927
  select.prototype.onOutsideClick = function (e) {
41061
41928
  var _this = this;
@@ -41068,7 +41935,7 @@ var select = /** @class */ (function (_super) {
41068
41935
  this.j.e.fire('outsideClick', e);
41069
41936
  }
41070
41937
  };
41071
- select.prototype.beforeCommandCut = function (command) {
41938
+ select.prototype.beforeCommandCut = function () {
41072
41939
  var s = this.j.s;
41073
41940
  if (!s.isCollapsed()) {
41074
41941
  var current = s.current();
@@ -41077,13 +41944,27 @@ var select = /** @class */ (function (_super) {
41077
41944
  }
41078
41945
  }
41079
41946
  };
41080
- select.prototype.beforeCommandSelectall = function (command) {
41947
+ select.prototype.beforeCommandSelectAll = function () {
41081
41948
  var s = this.j.s;
41082
41949
  s.focus();
41083
41950
  s.select(this.j.editor, true);
41084
41951
  s.expandSelection();
41085
41952
  return false;
41086
41953
  };
41954
+ /**
41955
+ * Normalize selection after triple click
41956
+ */
41957
+ select.prototype.onTripleClickNormalizeSelection = function (e) {
41958
+ if (e.detail !== 3 || !this.j.o.select.normalizeTripleClick) {
41959
+ return;
41960
+ }
41961
+ var s = this.j.s;
41962
+ var _a = s.range, startContainer = _a.startContainer, startOffset = _a.startOffset;
41963
+ if (startOffset === 0 && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isText(startContainer)) {
41964
+ 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) ||
41965
+ startContainer, true);
41966
+ }
41967
+ };
41087
41968
  select.prototype.onCopyNormalizeSelectionBound = function (e) {
41088
41969
  var _a = this.j, s = _a.s, editor = _a.editor, o = _a.o;
41089
41970
  if (!o.select.normalizeSelectionBeforeCutAndCopy || s.isCollapsed()) {
@@ -41108,7 +41989,10 @@ var select = /** @class */ (function (_super) {
41108
41989
  ], select.prototype, "beforeCommandCut", null);
41109
41990
  (0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__decorate */ .Cg)([
41110
41991
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([':beforeCommandSelectall'])
41111
- ], select.prototype, "beforeCommandSelectall", null);
41992
+ ], select.prototype, "beforeCommandSelectAll", null);
41993
+ (0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__decorate */ .Cg)([
41994
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([':click'])
41995
+ ], select.prototype, "onTripleClickNormalizeSelection", null);
41112
41996
  (0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__decorate */ .Cg)([
41113
41997
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([':copy', ':cut'])
41114
41998
  ], select.prototype, "onCopyNormalizeSelectionBound", null);
@@ -48313,10 +49197,10 @@ var defineGlobalProperty = __webpack_require__(61486);
48313
49197
  var SHARED = '__core-js_shared__';
48314
49198
  var store = module.exports = globalThis[SHARED] || defineGlobalProperty(SHARED, {});
48315
49199
  (store.versions || (store.versions = [])).push({
48316
- version: '3.36.1',
49200
+ version: '3.37.0',
48317
49201
  mode: IS_PURE ? 'pure' : 'global',
48318
49202
  copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)',
48319
- license: 'https://github.com/zloirock/core-js/blob/v3.36.1/LICENSE',
49203
+ license: 'https://github.com/zloirock/core-js/blob/v3.37.0/LICENSE',
48320
49204
  source: 'https://github.com/zloirock/core-js'
48321
49205
  });
48322
49206