jodit-pro-react 5.5.22 → 5.5.23

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  JoditEditor_default
3
- } from "./chunk-XL76ZVSM.mjs";
3
+ } from "./chunk-5AVIC5K4.mjs";
4
4
  export {
5
5
  JoditEditor_default as default
6
6
  };
@@ -193,7 +193,7 @@ var APP_VERSION, ES, IS_ES_MODERN, IS_ES_NEXT, IS_PROD, IS_TEST, FAT_MODE, HOMEP
193
193
  var init_constants = __esm({
194
194
  "node_modules/jodit/esm/core/constants.js"() {
195
195
  "use strict";
196
- APP_VERSION = "4.12.2";
196
+ APP_VERSION = "4.12.3";
197
197
  ES = "es2020";
198
198
  IS_ES_MODERN = true;
199
199
  IS_ES_NEXT = true;
@@ -7878,6 +7878,7 @@ init_helpers();
7878
7878
 
7879
7879
  // node_modules/jodit/esm/core/ui/icon.js
7880
7880
  init_constants();
7881
+ init_dom();
7881
7882
  init_helpers();
7882
7883
  init_css();
7883
7884
  var Icon = class _Icon {
@@ -7935,7 +7936,7 @@ var Icon = class _Icon {
7935
7936
  } else {
7936
7937
  const svg = iconFromEvent || _Icon.get(name, "") || ((_d = jodit.o.extraIcons) === null || _d === void 0 ? void 0 : _d[name]);
7937
7938
  if (svg) {
7938
- iconElement = jodit.c.fromHTML(svg.trim());
7939
+ iconElement = _Icon.toIconElement(jodit, svg.trim());
7939
7940
  if (!/^<svg/i.test(name)) {
7940
7941
  iconElement.classList.add("jodit-icon_" + clearName);
7941
7942
  }
@@ -7951,6 +7952,19 @@ var Icon = class _Icon {
7951
7952
  }
7952
7953
  return iconElement;
7953
7954
  }
7955
+ /**
7956
+ * Turn a raw icon string into an element with a `classList`.
7957
+ *
7958
+ * A plain-text icon (e.g. an emoji/text glyph) makes `fromHTML` return a
7959
+ * Text node, which has no `classList`; wrap it in a span so classes/styles
7960
+ * can be applied and `makeIcon` never crashes on `iconElement.classList`.
7961
+ * Note: SVG icons are `SVGElement` (not `HTMLElement`) but are still Element
7962
+ * nodes with a `classList`, so we check `isElement`, not `isHTMLElement`.
7963
+ */
7964
+ static toIconElement(jodit, svg) {
7965
+ const node = jodit.c.fromHTML(svg);
7966
+ return Dom.isElement(node) ? node : jodit.c.span("jodit-icon_text", node);
7967
+ }
7954
7968
  };
7955
7969
  Icon.icons = {};
7956
7970
  Icon.__cache = /* @__PURE__ */ new Map();
@@ -2,7 +2,7 @@ import {
2
2
  Config,
3
3
  JoditEditor_default,
4
4
  n
5
- } from "./chunk-XL76ZVSM.mjs";
5
+ } from "./chunk-5AVIC5K4.mjs";
6
6
 
7
7
  // src/index.ts
8
8
  var index_default = JoditEditor_default;