jodit-pro-react 5.4.24 → 5.4.25

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-NABDPBCJ.mjs";
3
+ } from "./chunk-7HYY6YHS.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.9.11";
185
+ APP_VERSION = "4.9.13";
186
186
  ES = "es2020";
187
187
  IS_ES_MODERN = true;
188
188
  IS_ES_NEXT = true;
@@ -2269,7 +2269,7 @@ var init_dom = __esm({
2269
2269
  }
2270
2270
  /**
2271
2271
  * Get temporary list
2272
- * @deprecated
2272
+ * @deprecated Just do not use it, it is not needed anymore
2273
2273
  */
2274
2274
  static temporaryList(root) {
2275
2275
  return toArray(root.querySelectorAll(`[${TEMP_ATTR}]`));
@@ -7666,7 +7666,8 @@ var __decorate2 = function(decorators, target, key3, desc) {
7666
7666
  var UIElement_1;
7667
7667
  var UIElement = UIElement_1 = class UIElement2 extends ViewComponent {
7668
7668
  getRole() {
7669
- return "";
7669
+ var _a2;
7670
+ return ((_a2 = this.options) === null || _a2 === void 0 ? void 0 : _a2.role) || "";
7670
7671
  }
7671
7672
  get parentElement() {
7672
7673
  return this.__parentElement;
@@ -7765,12 +7766,12 @@ var UIElement = UIElement_1 = class UIElement2 extends ViewComponent {
7765
7766
  parseTemplate(result) {
7766
7767
  return this.j.c.fromHTML(result.replace(/\*([^*]+?)\*/g, (_12, name) => Icon.get(name) || "").replace(/&_/g, this.componentName + "_").replace(/~([^~]+?)~/g, (_12, s50) => this.i18n(s50)));
7767
7768
  }
7768
- /** @override */
7769
7769
  constructor(jodit, options2) {
7770
7770
  super(jodit);
7771
7771
  this.name = "";
7772
7772
  this.__parentElement = null;
7773
7773
  this.mods = {};
7774
+ this.options = options2;
7774
7775
  this.container = this.createContainer(options2);
7775
7776
  const role = this.getRole();
7776
7777
  role && attr(this.container, "role", role);
@@ -7872,7 +7873,7 @@ var UIButton = class UIButton2 extends UIElement {
7872
7873
  }
7873
7874
  onChangeText() {
7874
7875
  this.text.textContent = this.jodit.i18n(this.state.text);
7875
- this.__updateAriaLabel();
7876
+ this.updateAriaLabel();
7876
7877
  }
7877
7878
  onChangeTextSetMode() {
7878
7879
  this.setMod("text-icons", Boolean(this.state.text.trim().length));
@@ -7895,9 +7896,9 @@ var UIButton = class UIButton2 extends UIElement {
7895
7896
  attr(this.container, "title", i8nTooltip);
7896
7897
  }
7897
7898
  attr(this.container, "aria-label", i8nTooltip);
7898
- this.__updateAriaLabel();
7899
+ this.updateAriaLabel();
7899
7900
  }
7900
- __updateAriaLabel() {
7901
+ updateAriaLabel() {
7901
7902
  const hasText = this.state.text.trim().length > 0;
7902
7903
  const i8nTooltip = this.state.tooltip ? this.jodit.i18n(this.state.tooltip) : null;
7903
7904
  attr(this.container, "aria-label", i8nTooltip);
@@ -8082,7 +8083,8 @@ var UIGroup = UIGroup_1 = class UIGroup2 extends UIElement {
8082
8083
  return "UIGroup";
8083
8084
  }
8084
8085
  getRole() {
8085
- return "list";
8086
+ var _a2;
8087
+ return ((_a2 = this.options) === null || _a2 === void 0 ? void 0 : _a2.role) || "list";
8086
8088
  }
8087
8089
  /**
8088
8090
  * All group children
@@ -9594,18 +9596,20 @@ var UIList = class UIList2 extends UIGroup {
9594
9596
  this.mode = "horizontal";
9595
9597
  this.removeButtons = [];
9596
9598
  }
9597
- /** @override */
9598
9599
  className() {
9599
9600
  return "UIList";
9600
9601
  }
9602
+ getRole() {
9603
+ return "list";
9604
+ }
9601
9605
  __onChangeMode() {
9602
9606
  this.setMod("mode", this.mode);
9603
9607
  }
9604
9608
  /**
9605
9609
  * Make new group and append it in list of elements
9606
9610
  */
9607
- makeGroup() {
9608
- return new UIGroup(this.jodit);
9611
+ makeGroup(role) {
9612
+ return new UIGroup(this.jodit, [], role ? { role } : void 0);
9609
9613
  }
9610
9614
  /**
9611
9615
  * All buttons from list
@@ -9627,7 +9631,7 @@ var UIList = class UIList2 extends UIGroup {
9627
9631
  items = splitArray(items);
9628
9632
  this.clear();
9629
9633
  let lastBtnSeparator = false;
9630
- let line = this.makeGroup();
9634
+ let line = this.makeGroup("group");
9631
9635
  this.append(line);
9632
9636
  line.setMod("line", true);
9633
9637
  let group;
@@ -9635,7 +9639,7 @@ var UIList = class UIList2 extends UIGroup {
9635
9639
  let elm = null;
9636
9640
  switch (control.name) {
9637
9641
  case "\n":
9638
- line = this.makeGroup();
9642
+ line = this.makeGroup("group");
9639
9643
  line.setMod("line", true);
9640
9644
  group = this.makeGroup();
9641
9645
  line.append(group);
@@ -15190,6 +15194,13 @@ var ToolbarButton = class ToolbarButton2 extends UIButton {
15190
15194
  getRole() {
15191
15195
  return "listitem";
15192
15196
  }
15197
+ updateAriaLabel() {
15198
+ super.updateAriaLabel();
15199
+ if (this.trigger) {
15200
+ const i8nTooltip = this.state.tooltip ? this.jodit.i18n(this.state.tooltip) : null;
15201
+ attr(this.trigger, "aria-label", i8nTooltip);
15202
+ }
15203
+ }
15193
15204
  /**
15194
15205
  * Get parent toolbar
15195
15206
  */
@@ -15266,7 +15277,7 @@ var ToolbarButton = class ToolbarButton2 extends UIButton {
15266
15277
  value: this
15267
15278
  });
15268
15279
  container.appendChild(button);
15269
- const trigger = this.j.c.fromHTML(`<span role="trigger" class="${cn}__trigger">${Icon.get("chevron")}</span>`);
15280
+ const trigger = this.j.c.fromHTML(`<span role="button" aria-haspopup="true" aria-expanded="false" class="${cn}__trigger">${Icon.get("chevron")}</span>`);
15270
15281
  button.appendChild(trigger);
15271
15282
  return container;
15272
15283
  }
@@ -15361,6 +15372,7 @@ var ToolbarButton = class ToolbarButton2 extends UIButton {
15361
15372
  return;
15362
15373
  }
15363
15374
  const { control: ctr } = this;
15375
+ attr(this.trigger, "aria-expanded", true);
15364
15376
  e40.buffer = {
15365
15377
  actionTrigger: this
15366
15378
  };
@@ -15463,6 +15475,9 @@ var ToolbarButton = class ToolbarButton2 extends UIButton {
15463
15475
  this.openedPopup.close();
15464
15476
  this.openedPopup.destruct();
15465
15477
  this.openedPopup = null;
15478
+ if (this.trigger) {
15479
+ attr(this.trigger, "aria-expanded", false);
15480
+ }
15466
15481
  }
15467
15482
  }
15468
15483
  /**
@@ -15627,6 +15642,9 @@ var ToolbarCollection = class ToolbarCollection2 extends UIList {
15627
15642
  className() {
15628
15643
  return "ToolbarCollection";
15629
15644
  }
15645
+ getRole() {
15646
+ return "toolbar";
15647
+ }
15630
15648
  /**
15631
15649
  * First button in a list
15632
15650
  */
@@ -15821,6 +15839,7 @@ var ToolbarEditorCollection = class ToolbarEditorCollection2 extends ToolbarColl
15821
15839
  */
15822
15840
  prependInvisibleInput(container) {
15823
15841
  const input = this.j.create.element("input", {
15842
+ name: "jodit-toolbar-focus-helper_" + this.j.id,
15824
15843
  tabIndex: -1,
15825
15844
  disabled: true,
15826
15845
  // Because <label> can trigger click
@@ -30677,7 +30696,9 @@ var import_dtd = __toESM(require_dtd());
30677
30696
  init_constants();
30678
30697
  init_dom2();
30679
30698
  init_global2();
30680
- init_helpers();
30699
+ init_trim();
30700
+ init_attr();
30701
+ init_selector();
30681
30702
  init_plugin2();
30682
30703
 
30683
30704
  // node_modules/jodit/esm/plugins/xpath/config.js
@@ -30779,6 +30800,7 @@ var xpath = class extends Plugin {
30779
30800
  afterInit() {
30780
30801
  if (this.j.o.showXPathInStatusbar) {
30781
30802
  this.container = this.j.c.div("jodit-xpath");
30803
+ attr(this.container, "role", "list");
30782
30804
  const init2 = () => {
30783
30805
  if (!this.j.o.showXPathInStatusbar || !this.container) {
30784
30806
  return;
@@ -30793,7 +30815,7 @@ var xpath = class extends Plugin {
30793
30815
  this.appendSelectAll();
30794
30816
  }
30795
30817
  };
30796
- this.j.e.off(".xpath").on("mouseup.xpath change.xpath keydown.xpath changeSelection.xpath", this.calcPath).on("afterSetMode.xpath afterInit.xpath changePlace.xpath", init2);
30818
+ this.j.e.off(".xpath").on("pointerup.xpath change.xpath keydown.xpath changeSelection.xpath", this.calcPath).on("afterSetMode.xpath afterInit.xpath changePlace.xpath", init2);
30797
30819
  init2();
30798
30820
  this.calcPath();
30799
30821
  }
@@ -2,7 +2,7 @@ import {
2
2
  Config,
3
3
  JoditEditor_default,
4
4
  n
5
- } from "./chunk-NABDPBCJ.mjs";
5
+ } from "./chunk-7HYY6YHS.mjs";
6
6
 
7
7
  // src/index.ts
8
8
  var index_default = JoditEditor_default;