jodit-pro-react 5.5.67 → 5.5.68

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-WGMHQM6B.mjs";
3
+ } from "./chunk-HYYMHNED.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.13.8";
196
+ APP_VERSION = "4.13.9";
197
197
  ES = "es2020";
198
198
  IS_ES_MODERN = true;
199
199
  IS_ES_NEXT = true;
@@ -26251,6 +26251,53 @@ Config.prototype.controls.dots = {
26251
26251
  };
26252
26252
 
26253
26253
  // node_modules/jodit/esm/plugins/mobile/mobile.js
26254
+ var isButtonSeparator = (item) => item === "|" || item === "---" || item === "\n";
26255
+ function fitToButtons(list, editor) {
26256
+ var _a2;
26257
+ const allowed = flatButtonsSet(splitArray(editor.o.buttons), editor);
26258
+ const groups = editor.getRegisteredButtonGroups();
26259
+ let changed = false;
26260
+ let hadDots = false;
26261
+ const flat = [];
26262
+ for (const item of list) {
26263
+ if (isButtonGroup(item)) {
26264
+ const members = [...item.buttons, ...(_a2 = groups[item.group]) !== null && _a2 !== void 0 ? _a2 : []];
26265
+ const kept = members.filter((button2) => allowed.has(button2));
26266
+ if (kept.length !== members.length) {
26267
+ changed = true;
26268
+ }
26269
+ flat.push(...kept);
26270
+ } else if (isButtonSeparator(item)) {
26271
+ flat.push(item);
26272
+ } else if (item === "dots") {
26273
+ hadDots = true;
26274
+ } else if (allowed.has(item)) {
26275
+ flat.push(item);
26276
+ } else {
26277
+ changed = true;
26278
+ }
26279
+ }
26280
+ if (!changed) {
26281
+ return list;
26282
+ }
26283
+ const cleaned = [];
26284
+ for (const item of flat) {
26285
+ if (isButtonSeparator(item) && (cleaned.length === 0 || isButtonSeparator(cleaned[cleaned.length - 1]))) {
26286
+ continue;
26287
+ }
26288
+ cleaned.push(item);
26289
+ }
26290
+ while (cleaned.length && isButtonSeparator(cleaned[cleaned.length - 1])) {
26291
+ cleaned.pop();
26292
+ }
26293
+ if (hadDots) {
26294
+ const shown = flatButtonsSet(cleaned, editor);
26295
+ if (toArray(allowed).some((button2) => !shown.has(button2))) {
26296
+ cleaned.push("dots");
26297
+ }
26298
+ }
26299
+ return cleaned;
26300
+ }
26254
26301
  function mobile(editor) {
26255
26302
  let timeout = 0, store2 = splitArray(editor.o.buttons);
26256
26303
  if (editor.o.mobileTapTimeout) {
@@ -26289,12 +26336,12 @@ function mobile(editor) {
26289
26336
  return splitArray(editor.o.buttons);
26290
26337
  }
26291
26338
  if (width >= editor.o.sizeMD) {
26292
- return splitArray(editor.o.buttonsMD);
26339
+ return fitToButtons(splitArray(editor.o.buttonsMD), editor);
26293
26340
  }
26294
26341
  if (width >= editor.o.sizeSM) {
26295
- return splitArray(editor.o.buttonsSM);
26342
+ return fitToButtons(splitArray(editor.o.buttonsSM), editor);
26296
26343
  }
26297
- return splitArray(editor.o.buttonsXS);
26344
+ return fitToButtons(splitArray(editor.o.buttonsXS), editor);
26298
26345
  })();
26299
26346
  if (newStore.toString() !== store2.toString()) {
26300
26347
  store2 = newStore;
@@ -2,7 +2,7 @@ import {
2
2
  Config,
3
3
  JoditEditor_default,
4
4
  n
5
- } from "./chunk-WGMHQM6B.mjs";
5
+ } from "./chunk-HYYMHNED.mjs";
6
6
 
7
7
  // src/index.ts
8
8
  var index_default = JoditEditor_default;