jodit-pro-react 5.6.12 → 5.6.13

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-RC5ET5YT.mjs";
3
+ } from "./chunk-ZWL2F5RZ.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.15.3";
196
+ APP_VERSION = "4.15.4";
197
197
  ES = "es2020";
198
198
  IS_ES_MODERN = true;
199
199
  IS_ES_NEXT = true;
@@ -14176,7 +14176,9 @@ var elementToItem = (elm, elementsMap2) => {
14176
14176
  // node_modules/jodit/esm/modules/file-browser/data-provider.js
14177
14177
  init_constants();
14178
14178
  init_autobind();
14179
+ init_is_array();
14179
14180
  init_is_function();
14181
+ init_is_plain_object();
14180
14182
  init_normalize_relative_path();
14181
14183
  init_config_proto();
14182
14184
  init_error2();
@@ -14261,6 +14263,31 @@ var possibleRules = /* @__PURE__ */ new Set([
14261
14263
  "allowImageResize",
14262
14264
  "allowImageCrop"
14263
14265
  ]);
14266
+ var DOCS_URL = "https://xdsoft.net/jodit/docs/modules/file_browser.html";
14267
+ function assertSourcesAnswer(resp, action, option) {
14268
+ const fail = (what) => {
14269
+ throw new Error(`File browser: the connector answer for action "${action}" (option "filebrowser.${option}") ${what}. See ${DOCS_URL}`);
14270
+ };
14271
+ if (!isPlainObject(resp) || !isPlainObject(resp.data)) {
14272
+ return fail('has no "data" object');
14273
+ }
14274
+ const { sources } = resp.data;
14275
+ if (!isArray(sources)) {
14276
+ return fail(sources === void 0 ? 'has no "data.sources" array' : `must contain "data.sources" as an array of sources, got ${isPlainObject(sources) ? "an object keyed by source name" : typeof sources}`);
14277
+ }
14278
+ sources.forEach((source2, index) => {
14279
+ if (!isPlainObject(source2)) {
14280
+ return fail(`has a non-object entry at "data.sources[${index}]"`);
14281
+ }
14282
+ if (!isArray(source2.files)) {
14283
+ source2.files = [];
14284
+ }
14285
+ if (!isArray(source2.folders)) {
14286
+ source2.folders = [];
14287
+ }
14288
+ });
14289
+ return resp;
14290
+ }
14264
14291
  var DataProvider = class {
14265
14292
  constructor(parent, options2) {
14266
14293
  this.parent = parent;
@@ -14319,6 +14346,7 @@ var DataProvider = class {
14319
14346
  this.o.permissions.data.source = source2;
14320
14347
  if (this.o.permissions.url) {
14321
14348
  return this.get("permissions").then((resp) => {
14349
+ var _a2;
14322
14350
  if (this.parent.isInDestruct) {
14323
14351
  throw abort();
14324
14352
  }
@@ -14328,7 +14356,7 @@ var DataProvider = class {
14328
14356
  }
14329
14357
  if (process2) {
14330
14358
  const respData = process2.call(self, resp);
14331
- if (respData.data.permissions) {
14359
+ if ((_a2 = respData === null || respData === void 0 ? void 0 : respData.data) === null || _a2 === void 0 ? void 0 : _a2.permissions) {
14332
14360
  this.parent.events.fire(this, "changePermissions", this.__currentPermissions, respData.data.permissions);
14333
14361
  this.__currentPermissions = respData.data.permissions;
14334
14362
  }
@@ -14368,7 +14396,7 @@ var DataProvider = class {
14368
14396
  if (process2) {
14369
14397
  resp = process2.call(self, resp);
14370
14398
  }
14371
- return onResult(resp);
14399
+ return onResult(assertSourcesAnswer(resp, "files", "items"));
14372
14400
  });
14373
14401
  }
14374
14402
  /**
@@ -14429,7 +14457,7 @@ var DataProvider = class {
14429
14457
  if (process2) {
14430
14458
  resp = process2.call(self, resp);
14431
14459
  }
14432
- return resp.data.sources;
14460
+ return assertSourcesAnswer(resp, "folders", "folder").data.sources;
14433
14461
  });
14434
14462
  });
14435
14463
  }
@@ -2,7 +2,7 @@ import {
2
2
  Config,
3
3
  JoditEditor_default,
4
4
  n
5
- } from "./chunk-RC5ET5YT.mjs";
5
+ } from "./chunk-ZWL2F5RZ.mjs";
6
6
 
7
7
  // src/index.ts
8
8
  var index_default = JoditEditor_default;