jodit 4.1.16 → 4.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/CHANGELOG.md +22 -5
  2. package/es2015/jodit.css +82 -31
  3. package/es2015/jodit.fat.min.css +1 -1
  4. package/es2015/jodit.fat.min.js +2 -2
  5. package/es2015/jodit.js +1378 -546
  6. package/es2015/jodit.min.css +1 -1
  7. package/es2015/jodit.min.js +2 -2
  8. package/es2015/plugins/debug/debug.js +1 -1
  9. package/es2015/plugins/debug/debug.min.js +1 -1
  10. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  11. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
  12. package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
  13. package/es2018/jodit.css +82 -31
  14. package/es2018/jodit.fat.min.css +1 -1
  15. package/es2018/jodit.fat.min.js +2 -2
  16. package/es2018/jodit.js +1364 -546
  17. package/es2018/jodit.min.css +1 -1
  18. package/es2018/jodit.min.js +2 -2
  19. package/es2018/plugins/debug/debug.js +1 -1
  20. package/es2018/plugins/debug/debug.min.js +1 -1
  21. package/es2018/plugins/speech-recognize/speech-recognize.css +1 -1
  22. package/es2018/plugins/speech-recognize/speech-recognize.js +1 -1
  23. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  24. package/es2021/jodit.css +82 -31
  25. package/es2021/jodit.fat.min.css +1 -1
  26. package/es2021/jodit.fat.min.js +2 -2
  27. package/es2021/jodit.js +1361 -546
  28. package/es2021/jodit.min.css +1 -1
  29. package/es2021/jodit.min.js +2 -2
  30. package/es2021/plugins/debug/debug.js +1 -1
  31. package/es2021/plugins/debug/debug.min.js +1 -1
  32. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  33. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  34. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  35. package/es2021.en/jodit.css +82 -31
  36. package/es2021.en/jodit.fat.min.css +1 -1
  37. package/es2021.en/jodit.fat.min.js +2 -2
  38. package/es2021.en/jodit.js +1361 -546
  39. package/es2021.en/jodit.min.css +1 -1
  40. package/es2021.en/jodit.min.js +2 -2
  41. package/es2021.en/plugins/debug/debug.js +1 -1
  42. package/es2021.en/plugins/debug/debug.min.js +1 -1
  43. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  44. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  45. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  46. package/es5/jodit.css +131 -35
  47. package/es5/jodit.fat.min.css +1 -1
  48. package/es5/jodit.fat.min.js +2 -2
  49. package/es5/jodit.js +1402 -482
  50. package/es5/jodit.min.css +3 -3
  51. package/es5/jodit.min.js +2 -2
  52. package/es5/plugins/debug/debug.js +1 -1
  53. package/es5/plugins/debug/debug.min.js +1 -1
  54. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  55. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  56. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  57. package/esm/config.d.ts +22 -0
  58. package/esm/config.js +22 -0
  59. package/esm/core/async/async.js +7 -1
  60. package/esm/core/constants.js +1 -1
  61. package/esm/core/helpers/size/position.js +2 -2
  62. package/esm/core/helpers/utils/selector.d.ts +3 -1
  63. package/esm/core/helpers/utils/selector.js +3 -3
  64. package/esm/core/ui/button/tooltip/tooltip.js +2 -1
  65. package/esm/core/ui/popup/popup.js +1 -1
  66. package/esm/modules/dialog/dialog.js +1 -0
  67. package/esm/modules/file-browser/data-provider.js +4 -1
  68. package/esm/modules/file-browser/file-browser.js +9 -2
  69. package/esm/modules/image-editor/templates/form.js +6 -5
  70. package/esm/modules/toolbar/button/button.d.ts +1 -1
  71. package/esm/modules/widget/tabs/tabs.d.ts +4 -4
  72. package/esm/modules/widget/tabs/tabs.js +9 -7
  73. package/esm/plugins/ai-assistant/ai-assistant.d.ts +1 -1
  74. package/esm/plugins/ai-assistant/ai-assistant.js +3 -3
  75. package/esm/plugins/image-properties/config.d.ts +5 -83
  76. package/esm/plugins/image-properties/config.js +0 -3
  77. package/esm/plugins/image-properties/image-properties.d.ts +22 -32
  78. package/esm/plugins/image-properties/image-properties.js +133 -402
  79. package/{types/plugins/image-properties/templates/form.d.ts → esm/plugins/image-properties/readers/align.d.ts} +3 -5
  80. package/esm/plugins/image-properties/readers/align.js +24 -0
  81. package/esm/plugins/image-properties/readers/index.d.ts +12 -0
  82. package/esm/plugins/image-properties/readers/index.js +38 -0
  83. package/esm/plugins/image-properties/readers/link.d.ts +9 -0
  84. package/esm/plugins/image-properties/readers/link.js +19 -0
  85. package/esm/plugins/image-properties/readers/margin.d.ts +8 -0
  86. package/esm/plugins/image-properties/readers/margin.js +28 -0
  87. package/esm/plugins/image-properties/readers/size.d.ts +8 -0
  88. package/esm/plugins/image-properties/readers/size.js +36 -0
  89. package/esm/plugins/image-properties/ui/ui-image-form.d.ts +29 -0
  90. package/esm/plugins/image-properties/ui/ui-image-form.js +171 -0
  91. package/esm/plugins/image-properties/ui/ui-image-main-tab.d.ts +36 -0
  92. package/esm/plugins/image-properties/ui/ui-image-main-tab.js +179 -0
  93. package/esm/plugins/image-properties/ui/ui-image-position-tab.d.ts +36 -0
  94. package/esm/plugins/image-properties/ui/ui-image-position-tab.js +261 -0
  95. package/esm/plugins/image-properties/{templates/main-tab.d.ts → utils/open-image-editor.d.ts} +5 -3
  96. package/esm/plugins/image-properties/utils/open-image-editor.js +52 -0
  97. package/esm/plugins/image-properties/utils/open-image-popup.d.ts +9 -0
  98. package/esm/plugins/image-properties/utils/open-image-popup.js +34 -0
  99. package/esm/plugins/image-properties/utils/utils.d.ts +9 -0
  100. package/esm/plugins/image-properties/utils/utils.js +21 -0
  101. package/esm/plugins/image-properties/writers/index.d.ts +12 -0
  102. package/esm/plugins/image-properties/writers/index.js +53 -0
  103. package/esm/plugins/image-properties/{templates/form.d.ts → writers/link.d.ts} +2 -4
  104. package/esm/plugins/image-properties/writers/link.js +24 -0
  105. package/esm/plugins/image-properties/writers/margin.d.ts +8 -0
  106. package/esm/plugins/image-properties/writers/margin.js +33 -0
  107. package/esm/plugins/image-properties/writers/size.d.ts +7 -0
  108. package/esm/plugins/image-properties/writers/size.js +28 -0
  109. package/esm/plugins/select/config.d.ts +7 -0
  110. package/esm/plugins/select/config.js +2 -1
  111. package/esm/plugins/select/select.d.ts +7 -3
  112. package/esm/plugins/select/select.js +21 -4
  113. package/esm/types/ui.d.ts +1 -1
  114. package/package.json +1 -1
  115. package/types/config.d.ts +22 -0
  116. package/types/core/helpers/utils/selector.d.ts +3 -1
  117. package/types/modules/toolbar/button/button.d.ts +1 -1
  118. package/types/modules/widget/tabs/tabs.d.ts +4 -4
  119. package/types/plugins/ai-assistant/ai-assistant.d.ts +1 -1
  120. package/types/plugins/image-properties/config.d.ts +5 -83
  121. package/types/plugins/image-properties/image-properties.d.ts +22 -32
  122. package/types/plugins/image-properties/{templates/main-tab.d.ts → readers/align.d.ts} +3 -5
  123. package/types/plugins/image-properties/readers/index.d.ts +12 -0
  124. package/types/plugins/image-properties/readers/link.d.ts +9 -0
  125. package/types/plugins/image-properties/readers/margin.d.ts +8 -0
  126. package/types/plugins/image-properties/readers/size.d.ts +8 -0
  127. package/types/plugins/image-properties/ui/ui-image-form.d.ts +29 -0
  128. package/types/plugins/image-properties/ui/ui-image-main-tab.d.ts +36 -0
  129. package/types/plugins/image-properties/ui/ui-image-position-tab.d.ts +36 -0
  130. package/types/plugins/image-properties/utils/open-image-editor.d.ts +12 -0
  131. package/types/plugins/image-properties/utils/open-image-popup.d.ts +9 -0
  132. package/types/plugins/image-properties/utils/utils.d.ts +9 -0
  133. package/types/plugins/image-properties/writers/index.d.ts +12 -0
  134. package/{esm/plugins/image-properties/templates/position-tab.d.ts → types/plugins/image-properties/writers/link.d.ts} +2 -4
  135. package/types/plugins/image-properties/writers/margin.d.ts +8 -0
  136. package/types/plugins/image-properties/writers/size.d.ts +7 -0
  137. package/types/plugins/select/config.d.ts +7 -0
  138. package/types/plugins/select/select.d.ts +7 -3
  139. package/types/types/ui.d.ts +1 -1
  140. package/esm/plugins/image-properties/templates/form.js +0 -26
  141. package/esm/plugins/image-properties/templates/main-tab.js +0 -47
  142. package/esm/plugins/image-properties/templates/position-tab.js +0 -66
  143. package/types/plugins/image-properties/templates/position-tab.d.ts +0 -10
package/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.6
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1547,6 +1547,28 @@ var Config = /** @class */ (function () {
1547
1547
  : null);
1548
1548
  /**
1549
1549
  * Shadow root if Jodit was created in it
1550
+ *
1551
+ * ```html
1552
+ * <div id="editor"></div>
1553
+ * ```
1554
+ *
1555
+ * ```js
1556
+ * const app = document.getElementById('editor');
1557
+ * app.attachShadow({ mode: 'open' });
1558
+ * const root = app.shadowRoot;
1559
+ *
1560
+ * root.innerHTML = `
1561
+ * <link rel="stylesheet" href="./build/jodit.css"/>
1562
+ * <h1>Jodit example in Shadow DOM</h1>
1563
+ * <div id="edit"></div>
1564
+ * `;
1565
+ *
1566
+ * const editor = Jodit.make(root.getElementById('edit'), {
1567
+ * globalFullSize: false,
1568
+ * shadowRoot: root
1569
+ * });
1570
+ * editor.value = '<p>start</p>';
1571
+ * ```
1550
1572
  */
1551
1573
  this.shadowRoot = null;
1552
1574
  /**
@@ -2303,6 +2325,7 @@ Config.prototype.controls = {};
2303
2325
  /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(31635);
2304
2326
  /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17352);
2305
2327
  /* harmony import */ var jodit_core_helpers_async__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(59146);
2328
+ /* harmony import */ var jodit_core_helpers_checker_is_abort_error__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(99951);
2306
2329
  /* harmony import */ var jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(69052);
2307
2330
  /* harmony import */ var jodit_core_helpers_checker_is_number__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2461);
2308
2331
  /* harmony import */ var jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(25376);
@@ -2311,7 +2334,7 @@ Config.prototype.controls = {};
2311
2334
  /* harmony import */ var jodit_core_helpers_checker_is_void__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(35642);
2312
2335
  /* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(28712);
2313
2336
  /* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_1__);
2314
- /* harmony import */ var jodit_core_helpers_utils_error_errors_abort_error__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(21567);
2337
+ /* harmony import */ var jodit_core_helpers_utils_error_errors_abort_error__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(21567);
2315
2338
  /*!
2316
2339
  * Jodit Editor (https://xdsoft.net/jodit/)
2317
2340
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -2328,6 +2351,7 @@ Config.prototype.controls = {};
2328
2351
 
2329
2352
 
2330
2353
 
2354
+
2331
2355
  var Async = /** @class */ (function () {
2332
2356
  function Async() {
2333
2357
  var _this = this;
@@ -2466,6 +2490,11 @@ var Async = /** @class */ (function () {
2466
2490
  }
2467
2491
  var promise = _this.promise(function (res) {
2468
2492
  promises.push(res);
2493
+ }).catch(function (e) {
2494
+ if ((0,jodit_core_helpers_checker_is_abort_error__WEBPACK_IMPORTED_MODULE_10__/* .isAbortError */ .z)(e)) {
2495
+ return null;
2496
+ }
2497
+ throw e;
2469
2498
  });
2470
2499
  onFire.apply(void 0, (0,tslib__WEBPACK_IMPORTED_MODULE_5__/* .__spreadArray */ .fX)([], (0,tslib__WEBPACK_IMPORTED_MODULE_5__/* .__read */ .zs)(args), false));
2471
2500
  return promise;
@@ -2550,7 +2579,7 @@ var Async = /** @class */ (function () {
2550
2579
  var _this = this;
2551
2580
  var rejectCallback = function () { };
2552
2581
  var promise = new Promise(function (resolve, reject) {
2553
- rejectCallback = function () { return reject((0,jodit_core_helpers_utils_error_errors_abort_error__WEBPACK_IMPORTED_MODULE_10__/* .abort */ .h)()); };
2582
+ rejectCallback = function () { return reject((0,jodit_core_helpers_utils_error_errors_abort_error__WEBPACK_IMPORTED_MODULE_11__/* .abort */ .h)('Abort async')); };
2554
2583
  _this.promisesRejections.add(rejectCallback);
2555
2584
  executor(resolve, reject);
2556
2585
  });
@@ -3098,7 +3127,7 @@ __webpack_require__.r(__webpack_exports__);
3098
3127
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
3099
3128
  */
3100
3129
 
3101
- var APP_VERSION = "4.1.16";
3130
+ var APP_VERSION = "4.2.6";
3102
3131
  // prettier-ignore
3103
3132
  var ES = "es5";
3104
3133
  var IS_ES_MODERN = false;
@@ -8327,6 +8356,7 @@ var offset = function (elm, jodit, doc, recurse) {
8327
8356
  * Calculate screen element position
8328
8357
  */
8329
8358
  function position(elm, jodit, recurse) {
8359
+ var _a, _b;
8330
8360
  if (recurse === void 0) { recurse = false; }
8331
8361
  var rect = elm.getBoundingClientRect();
8332
8362
  var xPos = rect.left, yPos = rect.top;
@@ -8334,15 +8364,15 @@ function position(elm, jodit, recurse) {
8334
8364
  jodit.iframe &&
8335
8365
  jodit.ed.body.contains(elm) &&
8336
8366
  !recurse) {
8337
- var _a = position(jodit.iframe, jodit, true), left = _a.left, top = _a.top;
8367
+ var _c = position(jodit.iframe, jodit, true), left = _c.left, top = _c.top;
8338
8368
  xPos += left;
8339
8369
  yPos += top;
8340
8370
  }
8341
8371
  return {
8342
8372
  left: Math.round(xPos),
8343
8373
  top: Math.round(yPos),
8344
- width: Math.round(elm.offsetWidth),
8345
- height: Math.round(elm.offsetHeight)
8374
+ width: Math.round((_a = elm.offsetWidth) !== null && _a !== void 0 ? _a : rect.width),
8375
+ height: Math.round((_b = elm.offsetHeight) !== null && _b !== void 0 ? _b : rect.height)
8346
8376
  };
8347
8377
  }
8348
8378
 
@@ -10437,9 +10467,9 @@ var getXPathByElement = function (element, root) {
10437
10467
  * Find all `ref` or `data-ref` elements inside HTMLElement
10438
10468
  */
10439
10469
  var refs = function (root) {
10440
- // if (Component.isInstanceOf<UIElement>(root, UIElement)) {
10441
- // root = root.container;
10442
- // }
10470
+ if ('container' in root) {
10471
+ root = root.container;
10472
+ }
10443
10473
  return $$('[ref],[data-ref]', root).reduce(function (def, child) {
10444
10474
  var key = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(child, '-ref');
10445
10475
  if (key && (0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_4__/* .isString */ .K)(key)) {
@@ -15203,7 +15233,7 @@ var UITooltip = /** @class */ (function (_super) {
15203
15233
  view.o.showTooltip &&
15204
15234
  !view.o.useNativeTooltip) {
15205
15235
  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
15236
+ // TODO Move it inside __open method. Now it is here because testcase failed with capturing
15207
15237
  (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_3__/* .getContainer */ .My)(_this.j, UITooltip_1).appendChild(_this.container);
15208
15238
  view.e.on(view.container, 'mouseenter.tooltip', _this.__onMouseEnter, {
15209
15239
  capture: true
@@ -15227,6 +15257,7 @@ var UITooltip = /** @class */ (function (_super) {
15227
15257
  var view = this.j;
15228
15258
  view.e
15229
15259
  .on(view.ow, 'scroll.tooltip', this.__hide)
15260
+ .on(view.ow, 'joditCloseDialog', this.__hide)
15230
15261
  .on(view.container, 'mouseleave.tooltip', this.__hide)
15231
15262
  .on([
15232
15263
  'escape.tooltip',
@@ -17353,7 +17384,7 @@ var Popup = /** @class */ (function (_super) {
17353
17384
  }
17354
17385
  var pe = this.parentElement;
17355
17386
  while (pe) {
17356
- if (checkView(j)) {
17387
+ if (checkView(pe.j)) {
17357
17388
  return;
17358
17389
  }
17359
17390
  if (pe.container.style.zIndex) {
@@ -20145,6 +20176,7 @@ var Dialog = /** @class */ (function (_super) {
20145
20176
  * Fired when dialog box is started moving
20146
20177
  */
20147
20178
  this.e.fire(this, 'startMove');
20179
+ this.e.fire('closeAllPopups');
20148
20180
  }
20149
20181
  };
20150
20182
  Dialog.prototype.onMouseMove = function (e) {
@@ -21406,6 +21438,9 @@ var DataProvider = /** @class */ (function () {
21406
21438
  this.o.permissions.data.source = source;
21407
21439
  if (this.o.permissions.url) {
21408
21440
  return [2 /*return*/, this.get('permissions').then(function (resp) {
21441
+ if (_this.parent.isInDestruct) {
21442
+ throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.abort)();
21443
+ }
21409
21444
  var process = _this.o.permissions.process;
21410
21445
  if (!process) {
21411
21446
  process = _this.o.ajax.process;
@@ -22184,10 +22219,18 @@ var FileBrowser = /** @class */ (function (_super) {
22184
22219
  _this.__updateToolbarButtons();
22185
22220
  _this._dialog.open(_this.browser, header);
22186
22221
  _this.e.fire('sort.filebrowser', _this.state.sortBy);
22187
- (0,_fetch_load_tree__WEBPACK_IMPORTED_MODULE_10__/* .loadTree */ .r)(_this).then(resolve, reject);
22222
+ (0,_fetch_load_tree__WEBPACK_IMPORTED_MODULE_10__/* .loadTree */ .r)(_this)
22223
+ .then(resolve, reject)
22224
+ .finally(function () {
22225
+ var _a;
22226
+ if (_this.isInDestruct) {
22227
+ return;
22228
+ }
22229
+ (_a = _this === null || _this === void 0 ? void 0 : _this.e) === null || _a === void 0 ? void 0 : _a.fire('fileBrowserReady.filebrowser');
22230
+ });
22188
22231
  })
22189
22232
  .catch(function (e) {
22190
- if (!jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.IS_PROD) {
22233
+ if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isAbortError)(e) && !jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.IS_PROD) {
22191
22234
  throw e;
22192
22235
  }
22193
22236
  });
@@ -24036,7 +24079,7 @@ var form = function (editor, o) {
24036
24079
  var i = editor.i18n.bind(editor);
24037
24080
  var switcher = function (label, ref, active) {
24038
24081
  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>");
24082
+ 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
24083
  };
24041
24084
  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
24085
  ? "<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 +27184,13 @@ var TabsWidget = function (jodit, tabs, state) {
27141
27184
  return;
27142
27185
  }
27143
27186
  buttonList.forEach(function (b) {
27187
+ b.state.variant = 'initial';
27144
27188
  b.state.activated = false;
27145
27189
  });
27146
27190
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.$$)('.jodit-tab', tabBox).forEach(function (a) {
27147
27191
  a.classList.remove('jodit-tab_active');
27148
27192
  });
27193
+ nameToTab[tab].button.state.variant = 'outline';
27149
27194
  nameToTab[tab].button.state.activated = true;
27150
27195
  nameToTab[tab].tab.classList.add('jodit-tab_active');
27151
27196
  };
@@ -27177,7 +27222,7 @@ var TabsWidget = function (jodit, tabs, state) {
27177
27222
  content.call(jodit);
27178
27223
  }
27179
27224
  if (state) {
27180
- state.__activeTab = name;
27225
+ state.activeTab = name;
27181
27226
  }
27182
27227
  return false;
27183
27228
  });
@@ -27193,20 +27238,20 @@ var TabsWidget = function (jodit, tabs, state) {
27193
27238
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.$$)('a', buttons).forEach(function (a) {
27194
27239
  a.style.width = (100 / tabCount).toFixed(10) + '%';
27195
27240
  });
27196
- var tab = !state || !state.__activeTab || !nameToTab[state.__activeTab]
27241
+ var tab = !state || !state.activeTab || !nameToTab[state.activeTab]
27197
27242
  ? firstTab
27198
- : state.__activeTab;
27243
+ : state.activeTab;
27199
27244
  setActive(tab);
27200
27245
  if (state) {
27201
- var __activeTab_1 = state.__activeTab;
27202
- Object.defineProperty(state, '__activeTab', {
27246
+ var activeTab_1 = state.activeTab;
27247
+ Object.defineProperty(state, 'activeTab', {
27203
27248
  configurable: true,
27204
27249
  enumerable: false,
27205
27250
  get: function () {
27206
- return __activeTab_1;
27251
+ return activeTab_1;
27207
27252
  },
27208
27253
  set: function (value) {
27209
- __activeTab_1 = value;
27254
+ activeTab_1 = value;
27210
27255
  setActive(value);
27211
27256
  }
27212
27257
  });
@@ -27627,7 +27672,7 @@ var aiAssistant = /** @class */ (function (_super) {
27627
27672
  configurable: true
27628
27673
  });
27629
27674
  /** @override */
27630
- aiAssistant.prototype.afterInit = function (jodit) { };
27675
+ aiAssistant.prototype.afterInit = function () { };
27631
27676
  aiAssistant.prototype.onGenerateAiAssistantForm = function (prompt) {
27632
27677
  this.__dialog.open(this.__container, 'AI Assistant');
27633
27678
  this.__container.setPrompt(prompt);
@@ -33656,9 +33701,6 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .pluginSystem */ .fg.add('image
33656
33701
  * Released under MIT see LICENSE.txt in the project root for license information.
33657
33702
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
33658
33703
  */
33659
- /**
33660
- * @module plugins/image-properties
33661
- */
33662
33704
 
33663
33705
  jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.image = {
33664
33706
  dialogWidth: 600,
@@ -33688,18 +33730,19 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.image = {
33688
33730
 
33689
33731
  "use strict";
33690
33732
  /* unused harmony export imageProperties */
33691
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(31635);
33733
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(31635);
33692
33734
  /* 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);
33735
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(55186);
33736
+ /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(56298);
33737
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(65147);
33738
+ /* harmony import */ var jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29866);
33739
+ /* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(35265);
33740
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(24654);
33741
+ /* harmony import */ var _ui_ui_image_form__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(31970);
33742
+ /* harmony import */ var _utils_open_image_editor__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(80778);
33743
+ /* harmony import */ var _utils_open_image_popup__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(33733);
33744
+ /* harmony import */ var _readers__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(5549);
33745
+ /* harmony import */ var _writers__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(30393);
33703
33746
  /*!
33704
33747
  * Jodit Editor (https://xdsoft.net/jodit/)
33705
33748
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -33731,59 +33774,114 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.image = {
33731
33774
  * });
33732
33775
  * ```
33733
33776
  */
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
33777
  /**
33744
33778
  * Show dialog with image's options
33745
33779
  */
33746
33780
  var imageProperties = /** @class */ (function (_super) {
33747
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__extends */ .C6)(imageProperties, _super);
33781
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__extends */ .C6)(imageProperties, _super);
33748
33782
  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;
33783
+ 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
33784
  _this.state = {
33751
33785
  image: new Image(),
33786
+ sourceImage: new Image(),
33752
33787
  get ratio() {
33753
- return this.image.naturalWidth / this.image.naturalHeight || 1;
33788
+ var _a = this.image, naturalWidth = _a.naturalWidth, naturalHeight = _a.naturalHeight;
33789
+ return naturalWidth / naturalHeight || 1;
33754
33790
  },
33755
33791
  sizeIsLocked: true,
33756
- marginIsLocked: true
33792
+ marginIsLocked: true,
33793
+ values: {
33794
+ style: '',
33795
+ imageSrc: '',
33796
+ borderRadius: 0,
33797
+ imageTitle: '',
33798
+ imageAlt: '',
33799
+ imageLink: '',
33800
+ imageLinkOpenInNewTab: false,
33801
+ imageWidth: 0,
33802
+ imageHeight: 0,
33803
+ marginTop: 0,
33804
+ marginRight: 0,
33805
+ marginBottom: 0,
33806
+ marginLeft: 0,
33807
+ classes: '',
33808
+ id: '',
33809
+ align: ''
33810
+ }
33757
33811
  };
33758
33812
  _this.activeTabState = {
33759
- __activeTab: 'Image'
33813
+ activeTab: 'Image'
33760
33814
  };
33761
33815
  return _this;
33762
33816
  }
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
- };
33817
+ Object.defineProperty(imageProperties.prototype, "form", {
33818
+ get: function () {
33819
+ var _this = this;
33820
+ return new _ui_ui_image_form__WEBPACK_IMPORTED_MODULE_7__/* .UIImagePropertiesForm */ .l(this.j, this.state, this.activeTabState, {
33821
+ openImageEditor: function () {
33822
+ return (0,_utils_open_image_editor__WEBPACK_IMPORTED_MODULE_8__/* .openImageEditorDialog */ .v)(_this.j, _this.state);
33823
+ },
33824
+ openImagePopup: function (target) {
33825
+ return (0,_utils_open_image_popup__WEBPACK_IMPORTED_MODULE_9__/* .openImagePopup */ .q)(_this.j, _this.dialog, _this.state, target);
33826
+ }
33827
+ });
33828
+ },
33829
+ enumerable: false,
33830
+ configurable: true
33831
+ });
33832
+ Object.defineProperty(imageProperties.prototype, "dialog", {
33833
+ /**
33834
+ * Dialog for form
33835
+ */
33836
+ get: function () {
33837
+ var _this = this;
33838
+ var j = this.j;
33839
+ var dialog = j.dlg({
33840
+ minWidth: Math.min(400, screen.width),
33841
+ minHeight: 590,
33842
+ buttons: ['fullsize', 'dialog.close']
33843
+ });
33844
+ var buttons = this.__buttons;
33845
+ buttons.check.onAction(function () {
33846
+ (0,_writers__WEBPACK_IMPORTED_MODULE_11__/* .applyValuesToImage */ .j)(j, _this.state, _this.state.sourceImage);
33847
+ j.synchronizeValues();
33848
+ dialog.close();
33849
+ });
33850
+ buttons.remove.onAction(function () {
33851
+ j.s.removeNode(_this.state.sourceImage);
33852
+ dialog.close();
33853
+ });
33854
+ buttons.cancel.onAction(function () {
33855
+ dialog.close();
33856
+ });
33857
+ dialog.setHeader(j.i18n('Image properties'));
33858
+ dialog.setContent(this.form);
33859
+ dialog.setFooter([[buttons.cancel, buttons.remove], buttons.check]);
33860
+ j.e.on(dialog, 'afterClose', function () {
33861
+ if (_this.state.image.parentNode &&
33862
+ j.o.image.selectImageAfterClose) {
33863
+ j.s.select(_this.state.sourceImage);
33864
+ }
33865
+ });
33866
+ dialog.setSize(j.o.image.dialogWidth);
33867
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.markOwner)(j, dialog.container);
33868
+ return dialog;
33869
+ },
33870
+ enumerable: false,
33871
+ configurable: true
33872
+ });
33873
+ Object.defineProperty(imageProperties.prototype, "__buttons", {
33874
+ get: function () {
33875
+ var j = this.j;
33876
+ return {
33877
+ check: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__/* .Button */ .$n)(j, 'ok', 'Apply', 'primary'),
33878
+ remove: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__/* .Button */ .$n)(j, 'bin', 'Delete'),
33879
+ cancel: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__/* .Button */ .$n)(j, 'cancel', 'Cancel')
33880
+ };
33881
+ },
33882
+ enumerable: false,
33883
+ configurable: true
33884
+ });
33787
33885
  /**
33788
33886
  * Open dialog editing image properties
33789
33887
  *
@@ -33799,362 +33897,31 @@ var imageProperties = /** @class */ (function (_super) {
33799
33897
  * ```
33800
33898
  */
33801
33899
  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();
33811
- this.dialog.open().setModal(true).setPosition();
33812
- return false;
33813
- };
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
33900
  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;
33901
+ this.activeTabState.activeTab = 'Image';
33902
+ this.__lock();
33903
+ this.dialog.open().setModal(true).setPosition();
33904
+ this.async
33905
+ .promise(function (resolve, reject) {
33906
+ return (0,_readers__WEBPACK_IMPORTED_MODULE_10__/* .readValuesFromImage */ .U)(_this.j, _this.state).then(resolve, reject);
33907
+ })
33908
+ .catch(function (e) {
33909
+ if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.isAbortError)(e)) {
33910
+ _this.dialog.message.error(e.message);
34109
33911
  }
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
33912
  })
34126
- .catch(function (error) {
34127
- _this.j.alert(error.message, loadExternal);
34128
- });
33913
+ .finally(function () { return _this.__unlock(); });
33914
+ return false;
34129
33915
  };
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();
33916
+ imageProperties.prototype.__lock = function () {
33917
+ this.dialog.lock();
33918
+ this.form.setMod('lock', true);
33919
+ Object.values(this.__buttons).forEach(function (b) { return (b.state.disabled = true); });
33920
+ };
33921
+ imageProperties.prototype.__unlock = function () {
33922
+ this.dialog.unlock();
33923
+ this.form.setMod('lock', false);
33924
+ Object.values(this.__buttons).forEach(function (b) { return (b.state.disabled = false); });
34158
33925
  };
34159
33926
  /** @override **/
34160
33927
  imageProperties.prototype.afterInit = function (editor) {
@@ -34166,7 +33933,7 @@ var imageProperties = /** @class */ (function (_super) {
34166
33933
  .off(editor.editor, '.imageproperties')
34167
33934
  .on(editor.editor, 'dblclick.imageproperties', function (e) {
34168
33935
  var image = e.target;
34169
- if (!jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(image, 'img')) {
33936
+ if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isTag(image, 'img')) {
34170
33937
  return;
34171
33938
  }
34172
33939
  if (editor.o.image.openOnDblClick) {
@@ -34174,7 +33941,8 @@ var imageProperties = /** @class */ (function (_super) {
34174
33941
  false) {
34175
33942
  return;
34176
33943
  }
34177
- self.state.image = image;
33944
+ self.state.sourceImage = image;
33945
+ self.state.image = image.cloneNode(true);
34178
33946
  if (!editor.o.readonly) {
34179
33947
  e.stopImmediatePropagation();
34180
33948
  e.preventDefault();
@@ -34188,115 +33956,1249 @@ var imageProperties = /** @class */ (function (_super) {
34188
33956
  });
34189
33957
  })
34190
33958
  .on('openImageProperties.imageproperties', function (image) {
34191
- _this.state.image = image;
33959
+ self.state.sourceImage = image;
33960
+ _this.state.image = image.cloneNode(true);
34192
33961
  _this.open();
34193
33962
  });
34194
33963
  };
33964
+ imageProperties.prototype.onStateValuesImageSrcChange = function () {
33965
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__awaiter */ .sH)(this, void 0, Promise, function () {
33966
+ var _a, image, values, w, e_1;
33967
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__generator */ .YH)(this, function (_b) {
33968
+ switch (_b.label) {
33969
+ case 0:
33970
+ _a = this.state, image = _a.image, values = _a.values;
33971
+ if (!image.src) {
33972
+ return [2 /*return*/];
33973
+ }
33974
+ _b.label = 1;
33975
+ case 1:
33976
+ _b.trys.push([1, 3, 4, 5]);
33977
+ this.__lock();
33978
+ return [4 /*yield*/, image.decode()];
33979
+ case 2:
33980
+ _b.sent();
33981
+ if (this.state.sizeIsLocked && (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.isNumeric)(values.imageWidth)) {
33982
+ w = parseFloat(values.imageWidth.toString());
33983
+ values.imageHeight = Math.round(w / this.state.ratio);
33984
+ }
33985
+ this.j.e.fire('updateImageProperties.imageproperties', image);
33986
+ return [3 /*break*/, 5];
33987
+ case 3:
33988
+ e_1 = _b.sent();
33989
+ this.j.alert(e_1.message);
33990
+ return [3 /*break*/, 5];
33991
+ case 4:
33992
+ this.__unlock();
33993
+ return [7 /*endfinally*/];
33994
+ case 5: return [2 /*return*/];
33995
+ }
33996
+ });
33997
+ });
33998
+ };
34195
33999
  /** @override */
34196
34000
  imageProperties.prototype.beforeDestruct = function (editor) {
34197
- this.dialog && this.dialog.destruct();
34001
+ var _a, _b, _c;
34002
+ 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(); });
34003
+ (_b = (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cached)(this, 'dialog')) === null || _b === void 0 ? void 0 : _b.destruct();
34004
+ (_c = (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cached)(this, 'form')) === null || _c === void 0 ? void 0 : _c.destruct();
34198
34005
  editor.e.off(editor.editor, '.imageproperties').off('.imageproperties');
34199
34006
  };
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);
34007
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
34008
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cache
34009
+ ], imageProperties.prototype, "form", null);
34010
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
34011
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cache
34012
+ ], imageProperties.prototype, "dialog", null);
34013
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
34014
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cache
34015
+ ], imageProperties.prototype, "__buttons", null);
34016
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
34017
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.image')
34018
+ ], imageProperties.prototype, "onStateValuesImageSrcChange", null);
34215
34019
  return imageProperties;
34216
- }(jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin));
34020
+ }(jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_4__/* .Plugin */ .k));
34217
34021
 
34218
- jodit_core_global__WEBPACK_IMPORTED_MODULE_1__/* .pluginSystem */ .fg.add('imageProperties', imageProperties);
34022
+ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .pluginSystem */ .fg.add('imageProperties', imageProperties);
34219
34023
 
34220
34024
 
34221
34025
  /***/ }),
34222
34026
 
34223
- /***/ 22254:
34027
+ /***/ 74260:
34224
34028
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
34225
34029
 
34226
34030
  "use strict";
34227
34031
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
34228
- /* harmony export */ Z: function() { return /* binding */ form; }
34032
+ /* harmony export */ g: function() { return /* binding */ readAlign; }
34229
34033
  /* harmony export */ });
34230
- /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(931);
34034
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(38322);
34231
34035
  /*!
34232
34036
  * Jodit Editor (https://xdsoft.net/jodit/)
34233
34037
  * Released under MIT see LICENSE.txt in the project root for license information.
34234
34038
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
34235
34039
  */
34236
34040
 
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>"));
34041
+ /** @private */
34042
+ function readAlign(image, values) {
34043
+ // Align
34044
+ if (image.style.cssFloat &&
34045
+ ['left', 'right'].indexOf(image.style.cssFloat.toLowerCase()) !== -1) {
34046
+ values.align = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_0__/* .css */ .A)(image, 'float');
34047
+ }
34048
+ else {
34049
+ if ((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_0__/* .css */ .A)(image, 'display') === 'block' &&
34050
+ image.style.marginLeft === 'auto' &&
34051
+ image.style.marginRight === 'auto') {
34052
+ values.align = 'center';
34053
+ }
34054
+ else {
34055
+ values.align = '';
34056
+ }
34057
+ }
34240
34058
  }
34241
34059
 
34242
34060
 
34243
34061
  /***/ }),
34244
34062
 
34245
- /***/ 75263:
34063
+ /***/ 5549:
34246
34064
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
34247
34065
 
34248
34066
  "use strict";
34249
34067
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
34250
- /* harmony export */ J: function() { return /* binding */ mainTab; }
34068
+ /* harmony export */ U: function() { return /* binding */ readValuesFromImage; }
34251
34069
  /* harmony export */ });
34252
- /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(931);
34070
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(31635);
34071
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26150);
34072
+ /* harmony import */ var _align__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(74260);
34073
+ /* harmony import */ var _link__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(33201);
34074
+ /* harmony import */ var _margin__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(85079);
34075
+ /* harmony import */ var _size__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(17880);
34076
+ /*!
34077
+ * Jodit Editor (https://xdsoft.net/jodit/)
34078
+ * Released under MIT see LICENSE.txt in the project root for license information.
34079
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
34080
+ */
34081
+
34082
+
34083
+
34084
+
34085
+
34086
+
34087
+ /**
34088
+ * Read values from image and set it to state
34089
+ * @private
34090
+ */
34091
+ function readValuesFromImage(j, state) {
34092
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__awaiter */ .sH)(this, void 0, Promise, function () {
34093
+ var image, values;
34094
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__generator */ .YH)(this, function (_a) {
34095
+ image = state.sourceImage, values = state.values;
34096
+ (0,_align__WEBPACK_IMPORTED_MODULE_4__/* .readAlign */ .g)(image, values);
34097
+ // Border radius
34098
+ values.borderRadius = parseInt(image.style.borderRadius || '0', 10) || 0;
34099
+ // Id
34100
+ values.id = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'id') || '';
34101
+ // Title
34102
+ values.imageTitle = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'title') || '';
34103
+ // Alt
34104
+ values.imageAlt = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'alt') || '';
34105
+ // Style
34106
+ values.style = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'style') || '';
34107
+ // Classes
34108
+ values.classes = ((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'class') || '').replace(/jodit_focused_image[\s]*/, '');
34109
+ // Margins
34110
+ (0,_margin__WEBPACK_IMPORTED_MODULE_5__/* .readMargins */ .E)(image, values, state);
34111
+ // Link
34112
+ (0,_link__WEBPACK_IMPORTED_MODULE_1__/* .readLink */ .X)(state, j, values);
34113
+ // Src
34114
+ values.imageSrc = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'src') || '';
34115
+ // Image size
34116
+ return [2 /*return*/, (0,_size__WEBPACK_IMPORTED_MODULE_2__/* .readSizes */ .P)(image, values, state)];
34117
+ });
34118
+ });
34119
+ }
34120
+
34121
+
34122
+ /***/ }),
34123
+
34124
+ /***/ 33201:
34125
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
34126
+
34127
+ "use strict";
34128
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
34129
+ /* harmony export */ X: function() { return /* binding */ readLink; }
34130
+ /* harmony export */ });
34131
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55186);
34132
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26150);
34253
34133
  /*!
34254
34134
  * Jodit Editor (https://xdsoft.net/jodit/)
34255
34135
  * Released under MIT see LICENSE.txt in the project root for license information.
34256
34136
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
34257
34137
  */
34258
34138
 
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>"));
34139
+
34140
+ /** @private */
34141
+ function readLink(state, j, values) {
34142
+ var a = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.closest(state.sourceImage, 'a', j.editor);
34143
+ if (a) {
34144
+ values.imageLink = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(a, 'href') || '';
34145
+ values.imageLinkOpenInNewTab = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(a, 'target') === '_blank';
34146
+ }
34147
+ else {
34148
+ values.imageLink = '';
34149
+ values.imageLinkOpenInNewTab = false;
34150
+ }
34262
34151
  }
34263
34152
 
34264
34153
 
34265
34154
  /***/ }),
34266
34155
 
34267
- /***/ 57837:
34156
+ /***/ 85079:
34268
34157
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
34269
34158
 
34270
34159
  "use strict";
34271
34160
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
34272
- /* harmony export */ b: function() { return /* binding */ positionTab; }
34161
+ /* harmony export */ E: function() { return /* binding */ readMargins; }
34273
34162
  /* harmony export */ });
34274
- /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(931);
34163
+ /* harmony import */ var jodit_core_helpers_string_kebab_case__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(449);
34164
+ /*!
34165
+ * Jodit Editor (https://xdsoft.net/jodit/)
34166
+ * Released under MIT see LICENSE.txt in the project root for license information.
34167
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
34168
+ */
34169
+
34170
+ /** @private */
34171
+ function readMargins(image, values, state) {
34172
+ // Margins
34173
+ var equal = true, wasEmptyField = false;
34174
+ ['marginTop', 'marginRight', 'marginBottom', 'marginLeft'].forEach(function (id) {
34175
+ var value = image.style.getPropertyValue((0,jodit_core_helpers_string_kebab_case__WEBPACK_IMPORTED_MODULE_0__/* .kebabCase */ .k)(id));
34176
+ if (!value) {
34177
+ wasEmptyField = true;
34178
+ values[id] = 0;
34179
+ return;
34180
+ }
34181
+ if (/^[0-9]+(px)?$/.test(value)) {
34182
+ value = parseInt(value, 10);
34183
+ }
34184
+ values[id] = value;
34185
+ if ((wasEmptyField && values[id]) ||
34186
+ (equal && id !== 'marginTop' && values[id] !== values.marginTop)) {
34187
+ equal = false;
34188
+ }
34189
+ });
34190
+ state.marginIsLocked = equal;
34191
+ }
34192
+
34193
+
34194
+ /***/ }),
34195
+
34196
+ /***/ 17880:
34197
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
34198
+
34199
+ "use strict";
34200
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
34201
+ /* harmony export */ P: function() { return /* binding */ readSizes; }
34202
+ /* harmony export */ });
34203
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(31635);
34204
+ /* harmony import */ var jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(12461);
34205
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26150);
34206
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(38322);
34207
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9645);
34275
34208
  /*!
34276
34209
  * Jodit Editor (https://xdsoft.net/jodit/)
34277
34210
  * Released under MIT see LICENSE.txt in the project root for license information.
34278
34211
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
34279
34212
  */
34280
34213
 
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>"));
34214
+
34215
+
34216
+
34217
+
34218
+ /** @private */
34219
+ function readSizes(image, values, state) {
34220
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_2__/* .__awaiter */ .sH)(this, void 0, Promise, function () {
34221
+ var width, height, imageWidth, imageHeight, w, h;
34222
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_2__/* .__generator */ .YH)(this, function (_a) {
34223
+ switch (_a.label) {
34224
+ case 0: return [4 /*yield*/, image.decode()];
34225
+ case 1:
34226
+ _a.sent();
34227
+ 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;
34228
+ 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;
34229
+ values.imageWidth =
34230
+ width !== false
34231
+ ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeFromString */ .G)(width)
34232
+ : image.offsetWidth || image.naturalWidth;
34233
+ values.imageHeight =
34234
+ height !== false
34235
+ ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeFromString */ .G)(height)
34236
+ : image.offsetHeight || image.naturalHeight;
34237
+ imageWidth = values.imageWidth, imageHeight = values.imageHeight;
34238
+ w = parseFloat(imageWidth.toString());
34239
+ 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)) {
34240
+ state.sizeIsLocked = false;
34241
+ return [2 /*return*/];
34242
+ }
34243
+ if (height === false) {
34244
+ values.imageHeight = Math.round(w / state.ratio);
34245
+ state.sizeIsLocked = true;
34246
+ return [2 /*return*/];
34247
+ }
34248
+ h = parseFloat(imageHeight.toString());
34249
+ state.sizeIsLocked = Math.abs(w - h * state.ratio) < 1;
34250
+ return [2 /*return*/];
34251
+ }
34252
+ });
34253
+ });
34254
+ }
34255
+
34256
+
34257
+ /***/ }),
34258
+
34259
+ /***/ 31970:
34260
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
34261
+
34262
+ "use strict";
34263
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
34264
+ /* harmony export */ l: function() { return /* binding */ UIImagePropertiesForm; }
34265
+ /* harmony export */ });
34266
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(31635);
34267
+ /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22664);
34268
+ /* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(24767);
34269
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(65147);
34270
+ /* harmony import */ var jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6455);
34271
+ /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(931);
34272
+ /* harmony import */ var jodit_modules_widget__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(16116);
34273
+ /* harmony import */ var _ui_image_main_tab__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(33403);
34274
+ /* harmony import */ var _ui_image_position_tab__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(46681);
34275
+ /*!
34276
+ * Jodit Editor (https://xdsoft.net/jodit/)
34277
+ * Released under MIT see LICENSE.txt in the project root for license information.
34278
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
34279
+ */
34280
+
34281
+
34282
+
34283
+
34284
+
34285
+
34286
+
34287
+
34288
+
34289
+
34290
+ /** @private */
34291
+ var UIImagePropertiesForm = /** @class */ (function (_super) {
34292
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__extends */ .C6)(UIImagePropertiesForm, _super);
34293
+ function UIImagePropertiesForm(jodit, state, activeTabState, handlers) {
34294
+ var _this = _super.call(this, jodit) || this;
34295
+ _this.state = state;
34296
+ _this.handlers = handlers;
34297
+ _this.__mainTab = new _ui_image_main_tab__WEBPACK_IMPORTED_MODULE_5__/* .UIImageMainTab */ .k(_this.jodit, _this.state, _this.handlers);
34298
+ _this.__positionTab = new _ui_image_position_tab__WEBPACK_IMPORTED_MODULE_6__/* .UIImagePositionTab */ ._(_this.jodit, _this.state, _this.handlers);
34299
+ _this.getElm('tabsBox').appendChild((0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_4__/* .TabsWidget */ .Zg)(jodit, [
34300
+ { name: 'Image', content: _this.__mainTab },
34301
+ { name: 'Advanced', content: _this.__positionTab }
34302
+ ], activeTabState));
34303
+ _this.setMod('lock-size', _this.state.sizeIsLocked);
34304
+ _this.append(_this.__mainTab).append(_this.__positionTab);
34305
+ return _this;
34306
+ }
34307
+ UIImagePropertiesForm.prototype.className = function () {
34308
+ return 'UIImagePropertiesForm';
34309
+ };
34310
+ UIImagePropertiesForm.prototype.appendChildToContainer = function () { };
34311
+ UIImagePropertiesForm.prototype.getElm = function (elementName) {
34312
+ var e_1, _a;
34313
+ var selfElm = _super.prototype.getElm.call(this, elementName);
34314
+ if (selfElm) {
34315
+ return selfElm;
34316
+ }
34317
+ try {
34318
+ for (var _b = (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__values */ .Ju)(this.elements), _c = _b.next(); !_c.done; _c = _b.next()) {
34319
+ var child = _c.value;
34320
+ var elm = child.getElm(elementName);
34321
+ if (elm) {
34322
+ return elm;
34323
+ }
34324
+ }
34325
+ }
34326
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
34327
+ finally {
34328
+ try {
34329
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
34330
+ }
34331
+ finally { if (e_1) throw e_1.error; }
34332
+ }
34333
+ return null;
34334
+ };
34335
+ UIImagePropertiesForm.prototype.render = function () {
34336
+ 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>");
34337
+ };
34338
+ UIImagePropertiesForm.prototype.onChangeSizeIsLocked = function () {
34339
+ var lockSize = this.getElm('lockSize');
34340
+ var imageWidth = this.getElm('imageWidth');
34341
+ lockSize.innerHTML = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__/* .Icon */ .I.get(this.state.sizeIsLocked ? 'lock' : 'unlock');
34342
+ this.setMod('lock-size', this.state.sizeIsLocked);
34343
+ this.j.e.fire(imageWidth, 'change');
34344
+ };
34345
+ UIImagePropertiesForm.prototype.onLockSizeClick = function () {
34346
+ this.state.sizeIsLocked = !this.state.sizeIsLocked;
34347
+ };
34348
+ UIImagePropertiesForm.prototype.onStateValuesSizeChange = function () {
34349
+ var imageWidth = this.getElm('imageWidth');
34350
+ var imageHeight = this.getElm('imageHeight');
34351
+ if (imageWidth !== this.j.od.activeElement) {
34352
+ imageWidth.value = this.state.values.imageWidth.toString();
34353
+ }
34354
+ if (imageHeight !== this.j.od.activeElement) {
34355
+ imageHeight.value = this.state.values.imageHeight.toString();
34356
+ }
34357
+ };
34358
+ UIImagePropertiesForm.prototype.onImageWidthChange = function (e) {
34359
+ var imageWidth = this.getElm('imageWidth');
34360
+ var imageHeight = this.getElm('imageHeight');
34361
+ if (!this.state.sizeIsLocked ||
34362
+ !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.isNumeric)(imageWidth.value) ||
34363
+ !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.isNumeric)(imageHeight.value)) {
34364
+ this.state.values.imageWidth = imageWidth.value;
34365
+ this.state.values.imageHeight = imageHeight.value;
34366
+ return;
34367
+ }
34368
+ var w = parseFloat(imageWidth.value), h = parseFloat(imageHeight.value);
34369
+ if (e.target === imageWidth) {
34370
+ this.state.values.imageWidth = w;
34371
+ this.state.values.imageHeight = Math.round(w / this.state.ratio);
34372
+ }
34373
+ else {
34374
+ this.state.values.imageWidth = Math.round(h * this.state.ratio);
34375
+ this.state.values.imageHeight = h;
34376
+ }
34377
+ };
34378
+ UIImagePropertiesForm.prototype.onStateValuesImageSrcChange = function () {
34379
+ var imageSrc = this.state.values.imageSrc;
34380
+ if (!imageSrc) {
34381
+ return;
34382
+ }
34383
+ var imageViewSrc = this.getElm('imageViewSrc');
34384
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.attr)(imageViewSrc, 'src', imageSrc);
34385
+ var image = new Image();
34386
+ image.src = imageSrc;
34387
+ this.state.image = image;
34388
+ };
34389
+ UIImagePropertiesForm.prototype.hideFieldByOptions = function () {
34390
+ var _this = this;
34391
+ var opt = this.j.o.image;
34392
+ [
34393
+ ['editSize', 'imageSizes'],
34394
+ ['showPreview', 'imageView']
34395
+ ].forEach(function (_a) {
34396
+ var _b = (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__read */ .zs)(_a, 2), optKey = _b[0], elmKey = _b[1];
34397
+ var elm = _this.getElm(elmKey);
34398
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.css)(elm, 'display', opt[optKey] ? null : 'none');
34399
+ });
34400
+ };
34401
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34402
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready'),
34403
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.sizeIsLocked')
34404
+ ], UIImagePropertiesForm.prototype, "onChangeSizeIsLocked", null);
34405
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34406
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('lockSize:click')
34407
+ ], UIImagePropertiesForm.prototype, "onLockSizeClick", null);
34408
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34409
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready'),
34410
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)(['state.values.imageWidth', 'state.values.imageHeight'])
34411
+ ], UIImagePropertiesForm.prototype, "onStateValuesSizeChange", null);
34412
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34413
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([
34414
+ 'imageWidth:change',
34415
+ 'imageHeight:change',
34416
+ 'imageWidth:keydown',
34417
+ 'imageHeight:keydown',
34418
+ 'imageWidth:mousedown',
34419
+ 'imageHeight:mousedown',
34420
+ 'imageWidth:paste',
34421
+ 'imageHeight:paste'
34422
+ ]),
34423
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.debounce)()
34424
+ ], UIImagePropertiesForm.prototype, "onImageWidthChange", null);
34425
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34426
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready'),
34427
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.values.imageSrc')
34428
+ ], UIImagePropertiesForm.prototype, "onStateValuesImageSrcChange", null);
34429
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34430
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready')
34431
+ ], UIImagePropertiesForm.prototype, "hideFieldByOptions", null);
34432
+ UIImagePropertiesForm = (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34433
+ jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_8__/* .component */ .s
34434
+ ], UIImagePropertiesForm);
34435
+ return UIImagePropertiesForm;
34436
+ }(jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_2__/* .UIGroup */ .U));
34437
+
34438
+
34439
+
34440
+ /***/ }),
34441
+
34442
+ /***/ 33403:
34443
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
34444
+
34445
+ "use strict";
34446
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
34447
+ /* harmony export */ k: function() { return /* binding */ UIImageMainTab; }
34448
+ /* harmony export */ });
34449
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(31635);
34450
+ /* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(24767);
34451
+ /* harmony import */ var jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71151);
34452
+ /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(66927);
34453
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65147);
34454
+ /* harmony import */ var jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6455);
34455
+ /*!
34456
+ * Jodit Editor (https://xdsoft.net/jodit/)
34457
+ * Released under MIT see LICENSE.txt in the project root for license information.
34458
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
34459
+ */
34460
+
34461
+
34462
+
34463
+
34464
+
34465
+
34466
+ /** @private */
34467
+ var UIImageMainTab = /** @class */ (function (_super) {
34468
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__extends */ .C6)(UIImageMainTab, _super);
34469
+ function UIImageMainTab(view, state, handlers) {
34470
+ var _this = _super.call(this, view) || this;
34471
+ _this.state = state;
34472
+ _this.handlers = handlers;
34473
+ return _this;
34474
+ }
34475
+ UIImageMainTab.prototype.className = function () {
34476
+ return 'UIImageMainTab';
34477
+ };
34478
+ UIImageMainTab.prototype.appendChildToContainer = function () {
34479
+ // Do nothing
34480
+ };
34481
+ UIImageMainTab.prototype.render = function () {
34482
+ 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>";
34483
+ };
34484
+ UIImageMainTab.prototype.onStateImageSrcChange = function () {
34485
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__awaiter */ .sH)(this, void 0, Promise, function () {
34486
+ var imageSrc;
34487
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__generator */ .YH)(this, function (_a) {
34488
+ imageSrc = this.getElm('imageSrc');
34489
+ imageSrc.value = this.state.values.imageSrc;
34490
+ return [2 /*return*/];
34491
+ });
34492
+ });
34493
+ };
34494
+ UIImageMainTab.prototype.onImageSrcChange = function () {
34495
+ this.state.values.imageSrc = this.getElm('imageSrc').value;
34496
+ };
34497
+ /**
34498
+ * Open image editor
34499
+ */
34500
+ UIImageMainTab.prototype.onEditImageClick = function (e) {
34501
+ this.handlers.openImageEditor();
34502
+ e.stopPropagation();
34503
+ };
34504
+ /**
34505
+ * Open popup with filebrowser/uploader buttons for image
34506
+ */
34507
+ UIImageMainTab.prototype.onChangeImageClick = function (e) {
34508
+ this.handlers.openImagePopup(this.getElm('changeImage'));
34509
+ e.stopPropagation();
34510
+ };
34511
+ UIImageMainTab.prototype.onStateTitleChange = function () {
34512
+ var title = this.getElm('imageTitle');
34513
+ title.value = this.state.values.imageTitle;
34514
+ };
34515
+ UIImageMainTab.prototype.onTitleChange = function () {
34516
+ this.state.values.imageTitle = this.getElm('imageTitle').value;
34517
+ };
34518
+ UIImageMainTab.prototype.onStateAltChange = function () {
34519
+ var alt = this.getElm('imageAlt');
34520
+ alt.value = this.state.values.imageAlt;
34521
+ };
34522
+ UIImageMainTab.prototype.onAltChange = function () {
34523
+ this.state.values.imageAlt = this.getElm('imageAlt').value;
34524
+ };
34525
+ UIImageMainTab.prototype.onStateImageLinkChange = function () {
34526
+ var imageLink = this.getElm('imageLink');
34527
+ imageLink.value = this.state.values.imageLink;
34528
+ };
34529
+ UIImageMainTab.prototype.onImageLinkChange = function () {
34530
+ this.state.values.imageLink = this.getElm('imageLink').value;
34531
+ };
34532
+ UIImageMainTab.prototype.onStateImageLinkOpenInNewTabChange = function () {
34533
+ var imageLinkOpenInNewTab = this.getElm('imageLinkOpenInNewTab');
34534
+ imageLinkOpenInNewTab.checked = this.state.values.imageLinkOpenInNewTab;
34535
+ };
34536
+ UIImageMainTab.prototype.onImageLinkOpenInNewTabChange = function () {
34537
+ this.state.values.imageLinkOpenInNewTab = this.getElm('imageLinkOpenInNewTab').checked;
34538
+ };
34539
+ UIImageMainTab.prototype.hideFieldByOptions = function () {
34540
+ var _this = this;
34541
+ var o = this.j.o;
34542
+ var opt = o.image;
34543
+ [
34544
+ ['editSrc', 'editSrc'],
34545
+ ['editTitle', 'editTitle'],
34546
+ ['editAlt', 'editAlt'],
34547
+ ['editLink', 'editLink'],
34548
+ ['editLink', 'editLinkTarget'],
34549
+ ['useImageEditor', 'editImage']
34550
+ ].forEach(function (_a) {
34551
+ var _b = (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__read */ .zs)(_a, 2), optKey = _b[0], elmKey = _b[1];
34552
+ var elm = _this.getElm(elmKey);
34553
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(elm, 'display', opt[optKey] ? null : 'none');
34554
+ });
34555
+ var changeImage = this.getElm('changeImage');
34556
+ var needShowChangeImage = Boolean(o.filebrowser.ajax.url || o.uploader.url);
34557
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(changeImage, 'display', needShowChangeImage ? null : 'none');
34558
+ var editImage = this.getElm('editImage');
34559
+ var needShowEditImage = Boolean(o.filebrowser.ajax.url) && opt.useImageEditor;
34560
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(editImage, 'display', needShowEditImage ? null : 'none');
34561
+ var fixImage = this.getElm('fixImage');
34562
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(fixImage, 'display', needShowChangeImage || needShowEditImage ? null : 'none');
34563
+ };
34564
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
34565
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageSrc')
34566
+ ], UIImageMainTab.prototype, "onStateImageSrcChange", null);
34567
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
34568
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageSrc:change')
34569
+ ], UIImageMainTab.prototype, "onImageSrcChange", null);
34570
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
34571
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('editImage:click')
34572
+ ], UIImageMainTab.prototype, "onEditImageClick", null);
34573
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
34574
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('changeImage:click')
34575
+ ], UIImageMainTab.prototype, "onChangeImageClick", null);
34576
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
34577
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageTitle')
34578
+ ], UIImageMainTab.prototype, "onStateTitleChange", null);
34579
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
34580
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageTitle:change')
34581
+ ], UIImageMainTab.prototype, "onTitleChange", null);
34582
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
34583
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageAlt')
34584
+ ], UIImageMainTab.prototype, "onStateAltChange", null);
34585
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
34586
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageAlt:change')
34587
+ ], UIImageMainTab.prototype, "onAltChange", null);
34588
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
34589
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageLink')
34590
+ ], UIImageMainTab.prototype, "onStateImageLinkChange", null);
34591
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
34592
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageLink:change')
34593
+ ], UIImageMainTab.prototype, "onImageLinkChange", null);
34594
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
34595
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageLinkOpenInNewTab')
34596
+ ], UIImageMainTab.prototype, "onStateImageLinkOpenInNewTabChange", null);
34597
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
34598
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageLinkOpenInNewTab:change')
34599
+ ], UIImageMainTab.prototype, "onImageLinkOpenInNewTabChange", null);
34600
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
34601
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready')
34602
+ ], UIImageMainTab.prototype, "hideFieldByOptions", null);
34603
+ UIImageMainTab = (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
34604
+ jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_5__/* .component */ .s
34605
+ ], UIImageMainTab);
34606
+ return UIImageMainTab;
34607
+ }(jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_3__/* .UIGroup */ .U));
34608
+
34609
+
34610
+
34611
+ /***/ }),
34612
+
34613
+ /***/ 46681:
34614
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
34615
+
34616
+ "use strict";
34617
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
34618
+ /* harmony export */ _: function() { return /* binding */ UIImagePositionTab; }
34619
+ /* harmony export */ });
34620
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(31635);
34621
+ /* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(24767);
34622
+ /* harmony import */ var jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71151);
34623
+ /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(66927);
34624
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65147);
34625
+ /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(98253);
34626
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(26150);
34627
+ /* harmony import */ var jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29780);
34628
+ /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(931);
34629
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(9645);
34630
+ /*!
34631
+ * Jodit Editor (https://xdsoft.net/jodit/)
34632
+ * Released under MIT see LICENSE.txt in the project root for license information.
34633
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
34634
+ */
34635
+
34636
+
34637
+
34638
+
34639
+
34640
+
34641
+
34642
+
34643
+
34644
+
34645
+ /** @private */
34646
+ var UIImagePositionTab = /** @class */ (function (_super) {
34647
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__extends */ .C6)(UIImagePositionTab, _super);
34648
+ function UIImagePositionTab(jodit, state, handlers) {
34649
+ var _this = _super.call(this, jodit, {
34650
+ availableClasses: jodit.o.image.availableClasses
34651
+ }) || this;
34652
+ _this.state = state;
34653
+ _this.handlers = handlers;
34654
+ return _this;
34655
+ }
34656
+ UIImagePositionTab.prototype.className = function () {
34657
+ return 'UIImagePositionTab';
34658
+ };
34659
+ UIImagePositionTab.prototype.render = function (_a) {
34660
+ var availableClasses = _a.availableClasses;
34661
+ 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 () {
34662
+ var classInput = [];
34663
+ if (availableClasses && availableClasses.length > 0) {
34664
+ classInput.push('<select class="jodit-input jodit-select &__classes">');
34665
+ availableClasses.forEach(function (item) {
34666
+ if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_8__/* .isString */ .K)(item)) {
34667
+ classInput.push("<option value=\"".concat(item, "\">").concat(item, "</option>"));
34668
+ }
34669
+ else {
34670
+ classInput.push("<option value=\"".concat(item[0], "\">").concat(item[1], "</option>"));
34671
+ }
34672
+ });
34673
+ classInput.push('</select>');
34289
34674
  }
34290
34675
  else {
34291
- classInput.push("<option value=\"".concat(item[0], "\">").concat(item[1], "</option>"));
34676
+ classInput.push('<input type="text" class="jodit-input &__classes"/>');
34292
34677
  }
34678
+ return classInput.join('');
34679
+ })(), "\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>");
34680
+ };
34681
+ UIImagePositionTab.prototype.onStateAlignChange = function () {
34682
+ var align = this.getElm('align');
34683
+ align.value = this.state.values.align;
34684
+ };
34685
+ UIImagePositionTab.prototype.onChangeAlign = function () {
34686
+ var align = this.getElm('align');
34687
+ this.state.values.align = align.value;
34688
+ };
34689
+ UIImagePositionTab.prototype.onStateValuesBorderRadiusChange = function () {
34690
+ var borderRadius = this.getElm('borderRadius');
34691
+ borderRadius.value = this.state.values.borderRadius.toString();
34692
+ };
34693
+ UIImagePositionTab.prototype.onChangeBorderRadius = function () {
34694
+ var borderRadius = this.getElm('borderRadius');
34695
+ this.state.values.borderRadius = parseFloat(borderRadius.value);
34696
+ };
34697
+ UIImagePositionTab.prototype.onStateValuesIdChange = function () {
34698
+ var id = this.getElm('id');
34699
+ id.value = this.state.values.id;
34700
+ };
34701
+ UIImagePositionTab.prototype.onChangeId = function () {
34702
+ var id = this.getElm('id');
34703
+ this.state.values.id = id.value;
34704
+ };
34705
+ UIImagePositionTab.prototype.onStateValuesStyleChange = function () {
34706
+ var style = this.getElm('style');
34707
+ style.value = this.state.values.style;
34708
+ };
34709
+ UIImagePositionTab.prototype.onChangeStyle = function () {
34710
+ var style = this.getElm('style');
34711
+ this.state.values.style = style.value;
34712
+ };
34713
+ UIImagePositionTab.prototype.onStateValuesClassesChange = function () {
34714
+ var classes = this.getElm('classes');
34715
+ classes.value = this.state.values.classes;
34716
+ };
34717
+ UIImagePositionTab.prototype.onChangClasses = function () {
34718
+ var classes = this.getElm('classes');
34719
+ this.state.values.classes = classes.value;
34720
+ };
34721
+ UIImagePositionTab.prototype.onLockMarginClick = function (e) {
34722
+ this.state.marginIsLocked = !this.state.marginIsLocked;
34723
+ e.preventDefault();
34724
+ };
34725
+ UIImagePositionTab.prototype.onChangeMarginIsLocked = function () {
34726
+ var _this = this;
34727
+ var marginBottom = this.getElm('marginBottom');
34728
+ var marginRight = this.getElm('marginRight');
34729
+ var marginLeft = this.getElm('marginLeft');
34730
+ var lockMargin = this.getElm('lockMargin');
34731
+ [marginRight, marginBottom, marginLeft].forEach(function (elm) {
34732
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_3__/* .attr */ .C)(elm, 'disabled', _this.state.marginIsLocked || null);
34733
+ });
34734
+ lockMargin.innerHTML = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_5__/* .Icon */ .I.get(this.state.marginIsLocked ? 'lock' : 'unlock');
34735
+ if (this.state.marginIsLocked) {
34736
+ var marginTop = this.state.values.marginTop;
34737
+ this.state.values.marginRight = marginTop;
34738
+ this.state.values.marginBottom = marginTop;
34739
+ this.state.values.marginLeft = marginTop;
34740
+ }
34741
+ };
34742
+ UIImagePositionTab.prototype.onStateValuesMarginChange = function () {
34743
+ var marginTop = this.getElm('marginTop');
34744
+ var marginRight = this.getElm('marginRight');
34745
+ var marginBottom = this.getElm('marginBottom');
34746
+ var marginLeft = this.getElm('marginLeft');
34747
+ marginTop.value = this.state.values.marginTop.toString();
34748
+ marginRight.value = this.state.values.marginRight.toString();
34749
+ marginBottom.value = this.state.values.marginBottom.toString();
34750
+ marginLeft.value = this.state.values.marginLeft.toString();
34751
+ };
34752
+ UIImagePositionTab.prototype.onChangeMargin = function () {
34753
+ var marginTop = this.getElm('marginTop');
34754
+ var marginRight = this.getElm('marginRight');
34755
+ var marginBottom = this.getElm('marginBottom');
34756
+ var marginLeft = this.getElm('marginLeft');
34757
+ this.state.values.marginTop = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginTop.value);
34758
+ if (this.state.marginIsLocked) {
34759
+ this.state.values.marginRight = this.state.values.marginTop;
34760
+ this.state.values.marginBottom = this.state.values.marginTop;
34761
+ this.state.values.marginLeft = this.state.values.marginTop;
34762
+ }
34763
+ else {
34764
+ this.state.values.marginRight = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginRight.value);
34765
+ this.state.values.marginBottom = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginBottom.value);
34766
+ this.state.values.marginLeft = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginLeft.value);
34767
+ }
34768
+ };
34769
+ UIImagePositionTab.prototype.hideFieldByOptions = function () {
34770
+ var _this = this;
34771
+ var opt = this.j.o.image;
34772
+ [
34773
+ ['editMargins', 'editMargins'],
34774
+ ['editAlign', 'editAlign'],
34775
+ ['editStyle', 'editStyle'],
34776
+ ['editClass', 'editClass'],
34777
+ ['editId', 'editId'],
34778
+ ['editBorderRadius', 'editBorderRadius']
34779
+ ].forEach(function (_a) {
34780
+ var _b = (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__read */ .zs)(_a, 2), optKey = _b[0], elmKey = _b[1];
34781
+ var elm = _this.getElm(elmKey);
34782
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(elm, 'display', opt[optKey] ? null : 'none');
34293
34783
  });
34294
- classInput.push('</select>');
34784
+ };
34785
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34786
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
34787
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.align')
34788
+ ], UIImagePositionTab.prototype, "onStateAlignChange", null);
34789
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34790
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('align:change')
34791
+ ], UIImagePositionTab.prototype, "onChangeAlign", null);
34792
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34793
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
34794
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.borderRadius')
34795
+ ], UIImagePositionTab.prototype, "onStateValuesBorderRadiusChange", null);
34796
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34797
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('borderRadius:change')
34798
+ ], UIImagePositionTab.prototype, "onChangeBorderRadius", null);
34799
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34800
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
34801
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.id')
34802
+ ], UIImagePositionTab.prototype, "onStateValuesIdChange", null);
34803
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34804
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('id:change')
34805
+ ], UIImagePositionTab.prototype, "onChangeId", null);
34806
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34807
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
34808
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.style')
34809
+ ], UIImagePositionTab.prototype, "onStateValuesStyleChange", null);
34810
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34811
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('style:change')
34812
+ ], UIImagePositionTab.prototype, "onChangeStyle", null);
34813
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34814
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
34815
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.classes')
34816
+ ], UIImagePositionTab.prototype, "onStateValuesClassesChange", null);
34817
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34818
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('classes:change')
34819
+ ], UIImagePositionTab.prototype, "onChangClasses", null);
34820
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34821
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('lockMargin:click')
34822
+ ], UIImagePositionTab.prototype, "onLockMarginClick", null);
34823
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34824
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
34825
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.marginIsLocked')
34826
+ ], UIImagePositionTab.prototype, "onChangeMarginIsLocked", null);
34827
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34828
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
34829
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)([
34830
+ 'state.values.marginTop',
34831
+ 'state.values.marginRight',
34832
+ 'state.values.marginBottom',
34833
+ 'state.values.marginLeft'
34834
+ ])
34835
+ ], UIImagePositionTab.prototype, "onStateValuesMarginChange", null);
34836
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34837
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)([
34838
+ 'marginTop:change',
34839
+ 'marginRight:change',
34840
+ 'marginBottom:change',
34841
+ 'marginLeft:change'
34842
+ ])
34843
+ ], UIImagePositionTab.prototype, "onChangeMargin", null);
34844
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34845
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready')
34846
+ ], UIImagePositionTab.prototype, "hideFieldByOptions", null);
34847
+ UIImagePositionTab = (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
34848
+ jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_9__/* .component */ .s
34849
+ ], UIImagePositionTab);
34850
+ return UIImagePositionTab;
34851
+ }(jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_4__/* .UIElement */ .D));
34852
+
34853
+
34854
+
34855
+ /***/ }),
34856
+
34857
+ /***/ 80778:
34858
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
34859
+
34860
+ "use strict";
34861
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
34862
+ /* harmony export */ v: function() { return /* binding */ openImageEditorDialog; }
34863
+ /* harmony export */ });
34864
+ /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(98253);
34865
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26150);
34866
+ /* harmony import */ var jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(53804);
34867
+ /*!
34868
+ * Jodit Editor (https://xdsoft.net/jodit/)
34869
+ * Released under MIT see LICENSE.txt in the project root for license information.
34870
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
34871
+ */
34872
+
34873
+
34874
+
34875
+ /**
34876
+ * Open image editor dialog
34877
+ * @private
34878
+ */
34879
+ function openImageEditorDialog(j, state) {
34880
+ var url = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(state.image, 'src') || '', a = j.c.element('a'), loadExternal = function () {
34881
+ if (a.host !== location.host) {
34882
+ j.confirm('You can only edit your own images. Download this image on the host?', function (yes) {
34883
+ if (yes && j.uploader) {
34884
+ j.uploader.uploadRemoteImage(a.href.toString(), function (resp) {
34885
+ j.alert('The image has been successfully uploaded to the host!', function () {
34886
+ if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_2__/* .isString */ .K)(resp.newfilename)) {
34887
+ state.values.imageSrc =
34888
+ resp.baseurl +
34889
+ resp.newfilename;
34890
+ }
34891
+ });
34892
+ }, function (error) {
34893
+ j.alert('There was an error loading %s', error.message);
34894
+ });
34895
+ }
34896
+ });
34897
+ return;
34898
+ }
34899
+ };
34900
+ a.href = url;
34901
+ j.filebrowser.dataProvider
34902
+ .getPathByUrl(a.href.toString())
34903
+ .then(function (resp) {
34904
+ jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_1__/* .openImageEditor */ .B.call(j.filebrowser, a.href, resp.name, resp.path, resp.source, function () {
34905
+ var timestamp = new Date().getTime();
34906
+ state.values.imageSrc =
34907
+ url +
34908
+ (url.indexOf('?') !== -1 ? '' : '?') +
34909
+ '&_tmp=' +
34910
+ timestamp.toString();
34911
+ }, function (error) {
34912
+ j.alert(error.message);
34913
+ });
34914
+ })
34915
+ .catch(function (error) {
34916
+ j.alert(error.message, loadExternal);
34917
+ });
34918
+ }
34919
+
34920
+
34921
+ /***/ }),
34922
+
34923
+ /***/ 33733:
34924
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
34925
+
34926
+ "use strict";
34927
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
34928
+ /* harmony export */ q: function() { return /* binding */ openImagePopup; }
34929
+ /* harmony export */ });
34930
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(31635);
34931
+ /* harmony import */ var jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37923);
34932
+ /* harmony import */ var jodit_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(27594);
34933
+ /* harmony import */ var jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(80071);
34934
+ /* harmony import */ var jodit_modules_widget_file_selector_file_selector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10067);
34935
+ /*!
34936
+ * Jodit Editor (https://xdsoft.net/jodit/)
34937
+ * Released under MIT see LICENSE.txt in the project root for license information.
34938
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
34939
+ */
34940
+
34941
+
34942
+
34943
+
34944
+
34945
+ /** @private */
34946
+ function openImagePopup(j, dialog, state, button) {
34947
+ var _this = this;
34948
+ var popup = new jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_0__/* .Popup */ .z(dialog);
34949
+ var closePopup = function () {
34950
+ popup.close();
34951
+ popup.destruct();
34952
+ };
34953
+ popup
34954
+ .setContent((0,jodit_modules_widget_file_selector_file_selector__WEBPACK_IMPORTED_MODULE_1__/* .FileSelectorWidget */ .k)(j, {
34955
+ upload: function (data) {
34956
+ if (data.files && data.files.length) {
34957
+ state.values.imageSrc =
34958
+ data.baseurl + data.files[0];
34959
+ }
34960
+ closePopup();
34961
+ },
34962
+ filebrowser: function (data) { return (0,tslib__WEBPACK_IMPORTED_MODULE_2__/* .__awaiter */ .sH)(_this, void 0, void 0, function () {
34963
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_2__/* .__generator */ .YH)(this, function (_a) {
34964
+ if (data && (0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_3__/* .isArray */ .c)(data.files) && data.files.length) {
34965
+ state.values.imageSrc = data.files[0];
34966
+ closePopup();
34967
+ }
34968
+ return [2 /*return*/];
34969
+ });
34970
+ }); }
34971
+ }, state.image, closePopup))
34972
+ .open(function () { return (0,jodit_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_4__/* .position */ .G)(button); });
34973
+ }
34974
+
34975
+
34976
+ /***/ }),
34977
+
34978
+ /***/ 9645:
34979
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
34980
+
34981
+ "use strict";
34982
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
34983
+ /* harmony export */ G: function() { return /* binding */ normalSizeFromString; },
34984
+ /* harmony export */ n: function() { return /* binding */ normalSizeToString; }
34985
+ /* harmony export */ });
34986
+ /* harmony import */ var jodit_core_helpers_checker_is_number__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2461);
34987
+ /* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(59101);
34988
+ /*!
34989
+ * Jodit Editor (https://xdsoft.net/jodit/)
34990
+ * Released under MIT see LICENSE.txt in the project root for license information.
34991
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
34992
+ */
34993
+
34994
+
34995
+ /** @private */
34996
+ var normalSizeFromString = function (value) {
34997
+ return /^[-+]?[0-9.]+(px)?$/.test(value.toString())
34998
+ ? parseFloat(value.toString())
34999
+ : value;
35000
+ };
35001
+ /** @private */
35002
+ var normalSizeToString = function (value) {
35003
+ if ((0,jodit_core_helpers_checker_is_number__WEBPACK_IMPORTED_MODULE_1__/* .isNumber */ .E)(value)) {
35004
+ return value ? value + 'px' : value.toString();
35005
+ }
35006
+ value = (0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_0__/* .trim */ .Bq)(value);
35007
+ return /^[0-9]+$/.test(value) ? value + 'px' : value;
35008
+ };
35009
+
35010
+
35011
+ /***/ }),
35012
+
35013
+ /***/ 30393:
35014
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
35015
+
35016
+ "use strict";
35017
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
35018
+ /* harmony export */ j: function() { return /* binding */ applyValuesToImage; }
35019
+ /* harmony export */ });
35020
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55186);
35021
+ /* harmony import */ var jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97369);
35022
+ /* harmony import */ var _link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(88269);
35023
+ /* harmony import */ var _margin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(78139);
35024
+ /* harmony import */ var _size__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(58972);
35025
+ /*!
35026
+ * Jodit Editor (https://xdsoft.net/jodit/)
35027
+ * Released under MIT see LICENSE.txt in the project root for license information.
35028
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
35029
+ */
35030
+
35031
+
35032
+
35033
+
35034
+
35035
+ /**
35036
+ * Apply form's values to image
35037
+ * @private
35038
+ */
35039
+ function applyValuesToImage(j, state, image) {
35040
+ 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;
35041
+ var opt = j.o;
35042
+ // styles
35043
+ if (opt.image.editStyle) {
35044
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'style', style || null);
35045
+ }
35046
+ // Src
35047
+ if (imageSrc) {
35048
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'src', imageSrc);
34295
35049
  }
34296
35050
  else {
34297
- classInput.push('<input data-ref="classes" type="text" class="jodit-input"/>');
35051
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.safeRemove(image);
35052
+ return;
35053
+ }
35054
+ // Border radius
35055
+ image.style.borderRadius = borderRadius ? borderRadius + 'px' : '';
35056
+ // Title
35057
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'title', imageTitle || null);
35058
+ // Alt
35059
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'alt', imageAlt || null);
35060
+ // Link
35061
+ (0,_link__WEBPACK_IMPORTED_MODULE_2__/* .applyLink */ .j)(j, image, imageLink, imageLinkOpenInNewTab);
35062
+ // Size
35063
+ (0,_size__WEBPACK_IMPORTED_MODULE_4__/* .applySize */ .q)(image, imageWidth, imageHeight, state.sizeIsLocked);
35064
+ // Margin
35065
+ if (j.o.image.editMargins) {
35066
+ (0,_margin__WEBPACK_IMPORTED_MODULE_3__/* .applyMargin */ .N)(j, marginTop, marginRight, marginBottom, marginLeft, image, state.marginIsLocked);
35067
+ }
35068
+ if (opt.image.editClass) {
35069
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'class', classes || null);
35070
+ }
35071
+ if (opt.image.editId) {
35072
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'id', id || null);
35073
+ }
35074
+ if (opt.image.editAlign) {
35075
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.hAlignElement)(image, align);
35076
+ }
35077
+ }
35078
+
35079
+
35080
+ /***/ }),
35081
+
35082
+ /***/ 88269:
35083
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
35084
+
35085
+ "use strict";
35086
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
35087
+ /* harmony export */ j: function() { return /* binding */ applyLink; }
35088
+ /* harmony export */ });
35089
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55186);
35090
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26150);
35091
+ /*!
35092
+ * Jodit Editor (https://xdsoft.net/jodit/)
35093
+ * Released under MIT see LICENSE.txt in the project root for license information.
35094
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
35095
+ */
35096
+
35097
+
35098
+ /** @private */
35099
+ function applyLink(j, image, imageLink, imageLinkOpenInNewTab) {
35100
+ // Link
35101
+ var link = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.closest(image, 'a', j.editor);
35102
+ if (imageLink) {
35103
+ if (!link) {
35104
+ link = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.wrap(image, 'a', j.createInside);
35105
+ }
35106
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(link, 'href', imageLink);
35107
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(link, 'target', imageLinkOpenInNewTab ? '_blank' : null);
35108
+ }
35109
+ else {
35110
+ if (link && link.parentNode) {
35111
+ link.parentNode.replaceChild(image, link);
35112
+ }
35113
+ }
35114
+ }
35115
+
35116
+
35117
+ /***/ }),
35118
+
35119
+ /***/ 78139:
35120
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
35121
+
35122
+ "use strict";
35123
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
35124
+ /* harmony export */ N: function() { return /* binding */ applyMargin; }
35125
+ /* harmony export */ });
35126
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(38322);
35127
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9645);
35128
+ /*!
35129
+ * Jodit Editor (https://xdsoft.net/jodit/)
35130
+ * Released under MIT see LICENSE.txt in the project root for license information.
35131
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
35132
+ */
35133
+
35134
+
35135
+ /** @private */
35136
+ function applyMargin(j, marginTop, marginRight, marginBottom, marginLeft, image, marginIsLocked) {
35137
+ var margins = [marginTop, marginRight, marginBottom, marginLeft];
35138
+ var applyMargin = function (key, value) {
35139
+ var oldValue = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_1__/* .css */ .A)(image, key);
35140
+ var v = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_0__/* .normalSizeToString */ .n)(value);
35141
+ if (oldValue.toString() !== v.toString()) {
35142
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_1__/* .css */ .A)(image, key, v);
35143
+ }
35144
+ };
35145
+ if (!marginIsLocked) {
35146
+ var sides_1 = [
35147
+ 'margin-top',
35148
+ 'margin-right',
35149
+ 'margin-bottom',
35150
+ 'margin-left'
35151
+ ];
35152
+ margins.forEach(function (margin, index) {
35153
+ var side = sides_1[index];
35154
+ applyMargin(side, margin);
35155
+ });
35156
+ }
35157
+ else {
35158
+ applyMargin('margin', marginTop);
35159
+ }
35160
+ }
35161
+
35162
+
35163
+ /***/ }),
35164
+
35165
+ /***/ 58972:
35166
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
35167
+
35168
+ "use strict";
35169
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
35170
+ /* harmony export */ q: function() { return /* binding */ applySize; }
35171
+ /* harmony export */ });
35172
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26150);
35173
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(38322);
35174
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9645);
35175
+ /*!
35176
+ * Jodit Editor (https://xdsoft.net/jodit/)
35177
+ * Released under MIT see LICENSE.txt in the project root for license information.
35178
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
35179
+ */
35180
+
35181
+
35182
+
35183
+ /** @private */
35184
+ function applySize(image, imageWidth, imageHeight, sizeIsLocked) {
35185
+ // Size
35186
+ if (imageWidth !== image.offsetWidth ||
35187
+ imageHeight !== image.offsetHeight) {
35188
+ var updatedWidth = imageWidth ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeToString */ .n)(imageWidth) : null;
35189
+ var updatedHeight = imageHeight
35190
+ ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeToString */ .n)(imageHeight)
35191
+ : null;
35192
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__/* .css */ .A)(image, {
35193
+ width: updatedWidth,
35194
+ height: updatedWidth && sizeIsLocked ? null : updatedHeight
35195
+ });
35196
+ (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);
35197
+ if (!(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'width') || sizeIsLocked) {
35198
+ updatedHeight = null;
35199
+ }
35200
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'height', updatedHeight);
34298
35201
  }
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
35202
  }
34301
35203
 
34302
35204
 
@@ -40975,7 +41877,8 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_3__/* .pluginSystem */ .fg.add('selec
40975
41877
  */
40976
41878
 
40977
41879
  jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.select = {
40978
- normalizeSelectionBeforeCutAndCopy: false
41880
+ normalizeSelectionBeforeCutAndCopy: false,
41881
+ normalizeTripleClick: true
40979
41882
  };
40980
41883
 
40981
41884
 
@@ -41055,7 +41958,7 @@ var select = /** @class */ (function (_super) {
41055
41958
  }
41056
41959
  };
41057
41960
  /**
41058
- * @event outsideClick(e) - when user clicked in the outside of editor
41961
+ * @event outsideClick(e) - when user clicked on the outside of editor
41059
41962
  */
41060
41963
  select.prototype.onOutsideClick = function (e) {
41061
41964
  var _this = this;
@@ -41068,7 +41971,7 @@ var select = /** @class */ (function (_super) {
41068
41971
  this.j.e.fire('outsideClick', e);
41069
41972
  }
41070
41973
  };
41071
- select.prototype.beforeCommandCut = function (command) {
41974
+ select.prototype.beforeCommandCut = function () {
41072
41975
  var s = this.j.s;
41073
41976
  if (!s.isCollapsed()) {
41074
41977
  var current = s.current();
@@ -41077,13 +41980,27 @@ var select = /** @class */ (function (_super) {
41077
41980
  }
41078
41981
  }
41079
41982
  };
41080
- select.prototype.beforeCommandSelectall = function (command) {
41983
+ select.prototype.beforeCommandSelectAll = function () {
41081
41984
  var s = this.j.s;
41082
41985
  s.focus();
41083
41986
  s.select(this.j.editor, true);
41084
41987
  s.expandSelection();
41085
41988
  return false;
41086
41989
  };
41990
+ /**
41991
+ * Normalize selection after triple click
41992
+ */
41993
+ select.prototype.onTripleClickNormalizeSelection = function (e) {
41994
+ if (e.detail !== 3 || !this.j.o.select.normalizeTripleClick) {
41995
+ return;
41996
+ }
41997
+ var s = this.j.s;
41998
+ var _a = s.range, startContainer = _a.startContainer, startOffset = _a.startOffset;
41999
+ if (startOffset === 0 && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isText(startContainer)) {
42000
+ 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) ||
42001
+ startContainer, true);
42002
+ }
42003
+ };
41087
42004
  select.prototype.onCopyNormalizeSelectionBound = function (e) {
41088
42005
  var _a = this.j, s = _a.s, editor = _a.editor, o = _a.o;
41089
42006
  if (!o.select.normalizeSelectionBeforeCutAndCopy || s.isCollapsed()) {
@@ -41108,7 +42025,10 @@ var select = /** @class */ (function (_super) {
41108
42025
  ], select.prototype, "beforeCommandCut", null);
41109
42026
  (0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__decorate */ .Cg)([
41110
42027
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([':beforeCommandSelectall'])
41111
- ], select.prototype, "beforeCommandSelectall", null);
42028
+ ], select.prototype, "beforeCommandSelectAll", null);
42029
+ (0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__decorate */ .Cg)([
42030
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([':click'])
42031
+ ], select.prototype, "onTripleClickNormalizeSelection", null);
41112
42032
  (0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__decorate */ .Cg)([
41113
42033
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([':copy', ':cut'])
41114
42034
  ], select.prototype, "onCopyNormalizeSelectionBound", null);
@@ -48313,10 +49233,10 @@ var defineGlobalProperty = __webpack_require__(61486);
48313
49233
  var SHARED = '__core-js_shared__';
48314
49234
  var store = module.exports = globalThis[SHARED] || defineGlobalProperty(SHARED, {});
48315
49235
  (store.versions || (store.versions = [])).push({
48316
- version: '3.36.1',
49236
+ version: '3.37.0',
48317
49237
  mode: IS_PURE ? 'pure' : 'global',
48318
49238
  copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)',
48319
- license: 'https://github.com/zloirock/core-js/blob/v3.36.1/LICENSE',
49239
+ license: 'https://github.com/zloirock/core-js/blob/v3.37.0/LICENSE',
48320
49240
  source: 'https://github.com/zloirock/core-js'
48321
49241
  });
48322
49242