jodit-pro-react 5.6.11 → 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.
|
@@ -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.
|
|
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
|
}
|
|
@@ -29192,6 +29220,14 @@ var __decorate59 = function(decorators, target, key3, desc) {
|
|
|
29192
29220
|
return c69 > 3 && r71 && Object.defineProperty(target, key3, r71), r71;
|
|
29193
29221
|
};
|
|
29194
29222
|
var keyBInd = "__jodit-resizer_binded";
|
|
29223
|
+
function attrPixelSize(element, key3) {
|
|
29224
|
+
var _a2;
|
|
29225
|
+
const value = (_a2 = attr(element, key3)) === null || _a2 === void 0 ? void 0 : _a2.trim();
|
|
29226
|
+
if (!value || !/^\d+(\.\d+)?(px)?$/i.test(value)) {
|
|
29227
|
+
return 0;
|
|
29228
|
+
}
|
|
29229
|
+
return parseFloat(value);
|
|
29230
|
+
}
|
|
29195
29231
|
var resizer = class extends Plugin {
|
|
29196
29232
|
constructor() {
|
|
29197
29233
|
super(...arguments);
|
|
@@ -29474,11 +29510,17 @@ var resizer = class extends Plugin {
|
|
|
29474
29510
|
"data-jodit_iframe_wrapper": 1
|
|
29475
29511
|
});
|
|
29476
29512
|
attr(wrapper, "style", attr(element, "style"));
|
|
29513
|
+
const width = element.offsetWidth || attrPixelSize(element, "width");
|
|
29514
|
+
const height = element.offsetHeight || attrPixelSize(element, "height");
|
|
29477
29515
|
css(wrapper, {
|
|
29478
|
-
display: cssInline(element, "display") === "inline-block" ? "inline-block" : "block"
|
|
29479
|
-
width: element.offsetWidth,
|
|
29480
|
-
height: element.offsetHeight
|
|
29516
|
+
display: cssInline(element, "display") === "inline-block" ? "inline-block" : "block"
|
|
29481
29517
|
});
|
|
29518
|
+
if (width) {
|
|
29519
|
+
css(wrapper, "width", width);
|
|
29520
|
+
}
|
|
29521
|
+
if (height) {
|
|
29522
|
+
css(wrapper, "height", height);
|
|
29523
|
+
}
|
|
29482
29524
|
if (element.parentNode) {
|
|
29483
29525
|
Dom.before(element, wrapper);
|
|
29484
29526
|
}
|