jodit-pro-react 5.5.3 → 5.5.4

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.
@@ -5062,7 +5062,8 @@ input:focus + .jodit-switcher__slider {
5062
5062
  fill: var(--jd-color-icon);
5063
5063
  height: 14px;
5064
5064
  overflow: visible;
5065
- transform-origin: 0 0 !important;
5065
+ transform: scale(var(--jd-icon-transform-scale,1));
5066
+ transform-origin: var(--jd-icon-transform-origin);
5066
5067
  width: 14px;
5067
5068
  }
5068
5069
  .jodit-icon,
@@ -8738,6 +8739,8 @@ svg.jodit-icon {
8738
8739
  --jd-button-df-size:calc((var(--jd-button-icon-size) - 4px)*2);
8739
8740
  --jd-button-size:calc(var(--jd-button-icon-size) + var(--jd-button-df-size) + var(--jd-margin-v)*2);
8740
8741
  --jd-focus-input-box-shadow:0 0 0 0.05rem rgba(0,123,255,.25);
8742
+ --jd-icon-transform-origin:center;
8743
+ --jd-icon-transform-scale:1;
8741
8744
  }
8742
8745
  .jodit-file-browser-pro {
8743
8746
  border: 0;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  JoditEditor_default
3
- } from "./chunk-OQIN2EOS.mjs";
3
+ } from "./chunk-4MCJROVB.mjs";
4
4
  export {
5
5
  JoditEditor_default as default
6
6
  };
@@ -182,7 +182,7 @@ var APP_VERSION, ES, IS_ES_MODERN, IS_ES_NEXT, IS_PROD, IS_TEST, FAT_MODE, HOMEP
182
182
  var init_constants = __esm({
183
183
  "node_modules/jodit/esm/core/constants.js"() {
184
184
  "use strict";
185
- APP_VERSION = "4.11.3";
185
+ APP_VERSION = "4.11.4";
186
186
  ES = "es2020";
187
187
  IS_ES_MODERN = true;
188
188
  IS_ES_NEXT = true;
@@ -7465,13 +7465,13 @@ var Icon = class _Icon {
7465
7465
  return;
7466
7466
  }
7467
7467
  let iconElement;
7468
- const { name, iconURL, fill } = icon;
7468
+ const { name, iconURL, fill, scale } = icon;
7469
7469
  const clearName = name.replace(/[^a-zA-Z0-9]/g, "_");
7470
7470
  let iconFromEvent;
7471
7471
  if (!/<svg/.test(name)) {
7472
7472
  iconFromEvent = (_b = (_a2 = jodit.o).getIcon) === null || _b === void 0 ? void 0 : _b.call(_a2, name, clearName);
7473
7473
  }
7474
- const cacheKey = `${name}${iconURL}${fill}${iconFromEvent !== null && iconFromEvent !== void 0 ? iconFromEvent : ""}`;
7474
+ const cacheKey = `${name}${iconURL}${fill}${scale !== null && scale !== void 0 ? scale : ""}${iconFromEvent !== null && iconFromEvent !== void 0 ? iconFromEvent : ""}`;
7475
7475
  if (jodit.o.cache && this.__cache.has(cacheKey)) {
7476
7476
  return (_c = this.__cache.get(cacheKey)) === null || _c === void 0 ? void 0 : _c.cloneNode(true);
7477
7477
  }
@@ -7490,6 +7490,9 @@ var Icon = class _Icon {
7490
7490
  if (iconElement) {
7491
7491
  iconElement.classList.add("jodit-icon");
7492
7492
  iconElement.style.fill = fill;
7493
+ if (scale != null) {
7494
+ iconElement.style.transform = `scale(${scale})`;
7495
+ }
7493
7496
  jodit.o.cache && this.__cache.set(cacheKey, iconElement.cloneNode(true));
7494
7497
  }
7495
7498
  return iconElement;
@@ -7853,7 +7856,8 @@ var UIButtonState = () => ({
7853
7856
  icon: {
7854
7857
  name: "empty",
7855
7858
  fill: "",
7856
- iconURL: ""
7859
+ iconURL: "",
7860
+ scale: void 0
7857
7861
  },
7858
7862
  tooltip: "",
7859
7863
  text: "",
@@ -15458,29 +15462,42 @@ var ToolbarButton = class ToolbarButton2 extends UIButton {
15458
15462
  * Init constant data from control
15459
15463
  */
15460
15464
  __initFromControl() {
15461
- var _a2;
15462
15465
  const { control: ctr, state } = this;
15463
15466
  this.updateSize();
15464
15467
  state.name = ctr.name;
15468
+ this.__initIconFromControl();
15469
+ if (ctr.tooltip) {
15470
+ state.tooltip = isFunction(ctr.tooltip) ? ctr.tooltip(this.j, ctr, this) : ctr.tooltip;
15471
+ }
15472
+ state.hasTrigger = Boolean(ctr.list || ctr.popup && ctr.exec);
15473
+ }
15474
+ __initIconFromControl() {
15475
+ var _a2;
15476
+ const { control: ctr, state } = this;
15465
15477
  const { textIcons } = this.j.o;
15466
15478
  if (textIcons === true || isFunction(textIcons) && textIcons(ctr.name) || ctr.template) {
15467
15479
  state.icon = UIButtonState().icon;
15468
15480
  state.text = ctr.text || ctr.name;
15481
+ return;
15482
+ }
15483
+ if (!isString(ctr.icon) && ctr.icon != null) {
15484
+ state.icon = {
15485
+ name: ctr.icon.name || ctr.name,
15486
+ iconURL: ctr.icon.iconURL || "",
15487
+ fill: ctr.icon.fill || "",
15488
+ scale: ctr.icon.scale
15489
+ };
15490
+ return;
15491
+ }
15492
+ if (ctr.iconURL) {
15493
+ state.icon.iconURL = ctr.iconURL;
15469
15494
  } else {
15470
- if (ctr.iconURL) {
15471
- state.icon.iconURL = ctr.iconURL;
15472
- } else {
15473
- const name = ctr.icon || ctr.name;
15474
- state.icon.name = Icon.exists(name) || ((_a2 = this.j.o.extraIcons) === null || _a2 === void 0 ? void 0 : _a2[name]) ? name : "";
15475
- }
15476
- if (!ctr.iconURL && !state.icon.name) {
15477
- state.text = ctr.text || ctr.name;
15478
- }
15495
+ const name = ctr.icon || ctr.name;
15496
+ state.icon.name = Icon.exists(name) || ((_a2 = this.j.o.extraIcons) === null || _a2 === void 0 ? void 0 : _a2[name]) ? name : "";
15479
15497
  }
15480
- if (ctr.tooltip) {
15481
- state.tooltip = isFunction(ctr.tooltip) ? ctr.tooltip(this.j, ctr, this) : ctr.tooltip;
15498
+ if (!ctr.iconURL && !state.icon.name) {
15499
+ state.text = ctr.text || ctr.name;
15482
15500
  }
15483
- state.hasTrigger = Boolean(ctr.list || ctr.popup && ctr.exec);
15484
15501
  }
15485
15502
  /**
15486
15503
  * Click on trigger button
@@ -5062,7 +5062,8 @@ input:focus + .jodit-switcher__slider {
5062
5062
  fill: var(--jd-color-icon);
5063
5063
  height: 14px;
5064
5064
  overflow: visible;
5065
- transform-origin: 0 0 !important;
5065
+ transform: scale(var(--jd-icon-transform-scale,1));
5066
+ transform-origin: var(--jd-icon-transform-origin);
5066
5067
  width: 14px;
5067
5068
  }
5068
5069
  .jodit-icon,
@@ -8738,6 +8739,8 @@ svg.jodit-icon {
8738
8739
  --jd-button-df-size:calc((var(--jd-button-icon-size) - 4px)*2);
8739
8740
  --jd-button-size:calc(var(--jd-button-icon-size) + var(--jd-button-df-size) + var(--jd-margin-v)*2);
8740
8741
  --jd-focus-input-box-shadow:0 0 0 0.05rem rgba(0,123,255,.25);
8742
+ --jd-icon-transform-origin:center;
8743
+ --jd-icon-transform-scale:1;
8741
8744
  }
8742
8745
  .jodit-file-browser-pro {
8743
8746
  border: 0;
@@ -2,7 +2,7 @@ import {
2
2
  Config,
3
3
  JoditEditor_default,
4
4
  n
5
- } from "./chunk-OQIN2EOS.mjs";
5
+ } from "./chunk-4MCJROVB.mjs";
6
6
 
7
7
  // src/index.ts
8
8
  var index_default = JoditEditor_default;