@firecms/core 3.0.0-canary.250 → 3.0.0-canary.251
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.
- package/dist/index.es.js +156 -156
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +156 -156
- package/dist/index.umd.js.map +1 -1
- package/dist/types/collections.d.ts +1 -1
- package/dist/types/navigation.d.ts +1 -1
- package/dist/util/icons.d.ts +2 -2
- package/package.json +5 -5
- package/src/components/HomePage/NavigationCardBinding.tsx +2 -2
- package/src/form/components/StorageItemPreview.tsx +1 -1
- package/src/form/components/StorageUploadProgress.tsx +3 -3
- package/src/form/field_bindings/StorageUploadFieldBinding.tsx +11 -16
- package/src/types/collections.ts +1 -1
- package/src/types/navigation.ts +1 -1
- package/src/util/icons.tsx +18 -7
package/dist/index.es.js
CHANGED
|
@@ -3186,12 +3186,19 @@ function hashString(str) {
|
|
|
3186
3186
|
return Math.abs(hash2);
|
|
3187
3187
|
}
|
|
3188
3188
|
function getIcon(iconKey, className, color, size) {
|
|
3189
|
+
if (React__default.isValidElement(iconKey)) {
|
|
3190
|
+
return iconKey;
|
|
3191
|
+
}
|
|
3189
3192
|
if (!iconKey) return void 0;
|
|
3190
|
-
iconKey
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
+
if (typeof iconKey === "string") {
|
|
3194
|
+
const usedIconKey = slugify(iconKey);
|
|
3195
|
+
if (!(usedIconKey in iconKeysMap)) {
|
|
3196
|
+
return void 0;
|
|
3197
|
+
}
|
|
3198
|
+
return usedIconKey in iconKeysMap ? /* @__PURE__ */ jsx(Icon, { iconKey: usedIconKey, size, className, color }) : void 0;
|
|
3193
3199
|
}
|
|
3194
|
-
|
|
3200
|
+
console.warn("Invalid icon key provided:", iconKey);
|
|
3201
|
+
return void 0;
|
|
3195
3202
|
}
|
|
3196
3203
|
const IconForView = React__default.memo(function IconForView2(t0) {
|
|
3197
3204
|
const $ = c(15);
|
|
@@ -7836,10 +7843,10 @@ function StorageUploadProgress({
|
|
|
7836
7843
|
};
|
|
7837
7844
|
}, [entry.file, entry.fileName, upload]);
|
|
7838
7845
|
if (simple) {
|
|
7839
|
-
return /* @__PURE__ */ jsx("div", { className: `
|
|
7846
|
+
return /* @__PURE__ */ jsx("div", { className: `w-${imageSize} h-${imageSize}`, children: loading && /* @__PURE__ */ jsx(Skeleton, { className: `w-${imageSize} h-${imageSize}` }) });
|
|
7840
7847
|
}
|
|
7841
|
-
return /* @__PURE__ */ jsxs("div", { className: cls(paperMixin, "
|
|
7842
|
-
loading && /* @__PURE__ */ jsx(Skeleton, { className: "
|
|
7848
|
+
return /* @__PURE__ */ jsxs("div", { className: cls(paperMixin, "p-4 relative border-box flex items-center justify-center", `min-w-[${imageSize}px] min-h-[${imageSize}px]`), children: [
|
|
7849
|
+
loading && /* @__PURE__ */ jsx(Skeleton, { className: "w-full h-full" }),
|
|
7843
7850
|
error && /* @__PURE__ */ jsx(ErrorView, { title: "Error uploading file", error })
|
|
7844
7851
|
] });
|
|
7845
7852
|
}
|
|
@@ -15892,7 +15899,7 @@ function StorageItemPreview(t0) {
|
|
|
15892
15899
|
const t1 = size === "large" ? "min-w-[220px] min-h-[220px] max-w-[220px]" : "min-w-[118px] min-h-[118px] max-w-[118px]";
|
|
15893
15900
|
let t2;
|
|
15894
15901
|
if ($[0] !== className || $[1] !== t1) {
|
|
15895
|
-
t2 = cls(paperMixin, "relative
|
|
15902
|
+
t2 = cls(paperMixin, "relative border-box flex items-center justify-center", t1, className);
|
|
15896
15903
|
$[0] = className;
|
|
15897
15904
|
$[1] = t1;
|
|
15898
15905
|
$[2] = t2;
|
|
@@ -16115,7 +16122,7 @@ function StorageUploadFieldBinding(t0) {
|
|
|
16115
16122
|
return t12;
|
|
16116
16123
|
}
|
|
16117
16124
|
function SortableStorageItem(t0) {
|
|
16118
|
-
const $ = c(
|
|
16125
|
+
const $ = c(34);
|
|
16119
16126
|
const {
|
|
16120
16127
|
id,
|
|
16121
16128
|
entry,
|
|
@@ -16153,98 +16160,95 @@ function SortableStorageItem(t0) {
|
|
|
16153
16160
|
t2 = $[3];
|
|
16154
16161
|
}
|
|
16155
16162
|
const t3 = isDragging ? 100 : void 0;
|
|
16156
|
-
|
|
16157
|
-
|
|
16158
|
-
|
|
16159
|
-
t5 = {
|
|
16163
|
+
let t4;
|
|
16164
|
+
if ($[4] !== t2 || $[5] !== t3 || $[6] !== transition) {
|
|
16165
|
+
t4 = {
|
|
16160
16166
|
transform: t2,
|
|
16161
16167
|
transition,
|
|
16162
|
-
zIndex: t3
|
|
16163
|
-
opacity: t4
|
|
16168
|
+
zIndex: t3
|
|
16164
16169
|
};
|
|
16165
16170
|
$[4] = t2;
|
|
16166
16171
|
$[5] = t3;
|
|
16167
|
-
$[6] =
|
|
16168
|
-
$[7] =
|
|
16169
|
-
$[8] = t5;
|
|
16172
|
+
$[6] = transition;
|
|
16173
|
+
$[7] = t4;
|
|
16170
16174
|
} else {
|
|
16171
|
-
|
|
16175
|
+
t4 = $[7];
|
|
16172
16176
|
}
|
|
16173
|
-
const style =
|
|
16177
|
+
const style = t4;
|
|
16174
16178
|
const getImageSizeNumber = _temp$a;
|
|
16175
16179
|
let child;
|
|
16176
16180
|
if (entry.storagePathOrDownloadUrl) {
|
|
16177
|
-
const
|
|
16178
|
-
let
|
|
16179
|
-
if ($[
|
|
16180
|
-
|
|
16181
|
-
$[
|
|
16182
|
-
$[
|
|
16183
|
-
$[
|
|
16181
|
+
const t52 = `storage_preview_${entry.storagePathOrDownloadUrl}`;
|
|
16182
|
+
let t62;
|
|
16183
|
+
if ($[8] !== entry.storagePathOrDownloadUrl || $[9] !== onClear) {
|
|
16184
|
+
t62 = () => onClear(entry.storagePathOrDownloadUrl);
|
|
16185
|
+
$[8] = entry.storagePathOrDownloadUrl;
|
|
16186
|
+
$[9] = onClear;
|
|
16187
|
+
$[10] = t62;
|
|
16184
16188
|
} else {
|
|
16185
|
-
|
|
16189
|
+
t62 = $[10];
|
|
16186
16190
|
}
|
|
16187
|
-
let
|
|
16188
|
-
if ($[
|
|
16189
|
-
|
|
16190
|
-
$[
|
|
16191
|
-
$[
|
|
16192
|
-
$[
|
|
16193
|
-
$[
|
|
16191
|
+
let t7;
|
|
16192
|
+
if ($[11] !== disabled || $[12] !== entry.size || $[13] !== entry.storagePathOrDownloadUrl || $[14] !== property || $[15] !== t52 || $[16] !== t62) {
|
|
16193
|
+
t7 = /* @__PURE__ */ jsx(StorageItemPreview, { name: t52, property, disabled, value: entry.storagePathOrDownloadUrl, onRemove: t62, size: entry.size });
|
|
16194
|
+
$[11] = disabled;
|
|
16195
|
+
$[12] = entry.size;
|
|
16196
|
+
$[13] = entry.storagePathOrDownloadUrl;
|
|
16197
|
+
$[14] = property;
|
|
16198
|
+
$[15] = t52;
|
|
16194
16199
|
$[16] = t62;
|
|
16195
|
-
$[17] =
|
|
16196
|
-
$[18] = t8;
|
|
16200
|
+
$[17] = t7;
|
|
16197
16201
|
} else {
|
|
16198
|
-
|
|
16202
|
+
t7 = $[17];
|
|
16199
16203
|
}
|
|
16200
|
-
child =
|
|
16204
|
+
child = t7;
|
|
16201
16205
|
} else {
|
|
16202
16206
|
if (entry.file) {
|
|
16203
|
-
let
|
|
16204
|
-
if ($[
|
|
16205
|
-
|
|
16206
|
-
$[
|
|
16207
|
-
$[
|
|
16208
|
-
$[
|
|
16207
|
+
let t52;
|
|
16208
|
+
if ($[18] !== entry.file || $[19] !== storagePathBuilder) {
|
|
16209
|
+
t52 = storagePathBuilder(entry.file);
|
|
16210
|
+
$[18] = entry.file;
|
|
16211
|
+
$[19] = storagePathBuilder;
|
|
16212
|
+
$[20] = t52;
|
|
16209
16213
|
} else {
|
|
16210
|
-
|
|
16214
|
+
t52 = $[20];
|
|
16211
16215
|
}
|
|
16212
|
-
const
|
|
16213
|
-
let
|
|
16214
|
-
if ($[
|
|
16215
|
-
|
|
16216
|
-
$[
|
|
16217
|
-
$[
|
|
16218
|
-
$[
|
|
16216
|
+
const t62 = getImageSizeNumber(entry.size);
|
|
16217
|
+
let t7;
|
|
16218
|
+
if ($[21] !== entry || $[22] !== metadata || $[23] !== onFileUploadComplete || $[24] !== t52 || $[25] !== t62) {
|
|
16219
|
+
t7 = /* @__PURE__ */ jsx(StorageUploadProgress, { entry, metadata, storagePath: t52, onFileUploadComplete, imageSize: t62, simple: false });
|
|
16220
|
+
$[21] = entry;
|
|
16221
|
+
$[22] = metadata;
|
|
16222
|
+
$[23] = onFileUploadComplete;
|
|
16223
|
+
$[24] = t52;
|
|
16219
16224
|
$[25] = t62;
|
|
16220
|
-
$[26] =
|
|
16221
|
-
$[27] = t8;
|
|
16225
|
+
$[26] = t7;
|
|
16222
16226
|
} else {
|
|
16223
|
-
|
|
16227
|
+
t7 = $[26];
|
|
16224
16228
|
}
|
|
16225
|
-
child =
|
|
16229
|
+
child = t7;
|
|
16226
16230
|
}
|
|
16227
16231
|
}
|
|
16228
|
-
let
|
|
16229
|
-
if ($[
|
|
16230
|
-
|
|
16231
|
-
$[
|
|
16232
|
+
let t5;
|
|
16233
|
+
if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
|
|
16234
|
+
t5 = cls("rounded-md m-1");
|
|
16235
|
+
$[27] = t5;
|
|
16232
16236
|
} else {
|
|
16233
|
-
|
|
16237
|
+
t5 = $[27];
|
|
16234
16238
|
}
|
|
16235
|
-
let
|
|
16236
|
-
if ($[
|
|
16237
|
-
|
|
16238
|
-
$[
|
|
16239
|
-
$[
|
|
16240
|
-
$[
|
|
16241
|
-
$[
|
|
16242
|
-
$[
|
|
16243
|
-
$[
|
|
16239
|
+
let t6;
|
|
16240
|
+
if ($[28] !== attributes || $[29] !== child || $[30] !== listeners2 || $[31] !== setNodeRef || $[32] !== style) {
|
|
16241
|
+
t6 = /* @__PURE__ */ jsx("div", { ref: setNodeRef, style, ...attributes, ...listeners2, className: t5, tabIndex: -1, children: child });
|
|
16242
|
+
$[28] = attributes;
|
|
16243
|
+
$[29] = child;
|
|
16244
|
+
$[30] = listeners2;
|
|
16245
|
+
$[31] = setNodeRef;
|
|
16246
|
+
$[32] = style;
|
|
16247
|
+
$[33] = t6;
|
|
16244
16248
|
} else {
|
|
16245
|
-
|
|
16249
|
+
t6 = $[33];
|
|
16246
16250
|
}
|
|
16247
|
-
return
|
|
16251
|
+
return t6;
|
|
16248
16252
|
}
|
|
16249
16253
|
function _temp$a(previewSize) {
|
|
16250
16254
|
switch (previewSize) {
|
|
@@ -16263,7 +16267,7 @@ function _temp$a(previewSize) {
|
|
|
16263
16267
|
}
|
|
16264
16268
|
}
|
|
16265
16269
|
function FileDropComponent(t0) {
|
|
16266
|
-
const $ = c(
|
|
16270
|
+
const $ = c(61);
|
|
16267
16271
|
const {
|
|
16268
16272
|
storage,
|
|
16269
16273
|
disabled,
|
|
@@ -16354,7 +16358,7 @@ function FileDropComponent(t0) {
|
|
|
16354
16358
|
}
|
|
16355
16359
|
const t6 = disabled ? fieldBackgroundDisabledMixin : fieldBackgroundHoverMixin;
|
|
16356
16360
|
const t7 = disabled ? "text-surface-accent-600 dark:text-surface-accent-500" : "";
|
|
16357
|
-
const t8 = multipleFilesSupported && internalValue.length
|
|
16361
|
+
const t8 = multipleFilesSupported && internalValue.length ? "" : "flex";
|
|
16358
16362
|
const t9 = !isDragActive;
|
|
16359
16363
|
const t10 = disabled || isDndItemDragging;
|
|
16360
16364
|
let t11;
|
|
@@ -16378,107 +16382,103 @@ function FileDropComponent(t0) {
|
|
|
16378
16382
|
} else {
|
|
16379
16383
|
t11 = $[21];
|
|
16380
16384
|
}
|
|
16381
|
-
const t12 = multipleFilesSupported && internalValue.length ? "
|
|
16382
|
-
const t13 = internalValue.length
|
|
16383
|
-
|
|
16384
|
-
|
|
16385
|
-
|
|
16386
|
-
if ($[22] !== t12 || $[23] !== t13 || $[24] !== t14 || $[25] !== t15) {
|
|
16387
|
-
t16 = cls("flex items-center p-1 no-scrollbar", t12, t13, t14, t15);
|
|
16385
|
+
const t12 = multipleFilesSupported && internalValue.length ? "overflow-auto" : "";
|
|
16386
|
+
const t13 = multipleFilesSupported && internalValue.length ? "min-h-[180px]" : "min-h-[250px]";
|
|
16387
|
+
let t14;
|
|
16388
|
+
if ($[22] !== t12 || $[23] !== t13) {
|
|
16389
|
+
t14 = cls("flex items-center p-1 px-4 no-scrollbar", t12, t13);
|
|
16388
16390
|
$[22] = t12;
|
|
16389
16391
|
$[23] = t13;
|
|
16390
16392
|
$[24] = t14;
|
|
16391
|
-
$[25] = t15;
|
|
16392
|
-
$[26] = t16;
|
|
16393
16393
|
} else {
|
|
16394
|
-
|
|
16394
|
+
t14 = $[24];
|
|
16395
16395
|
}
|
|
16396
|
-
let
|
|
16397
|
-
if ($[
|
|
16398
|
-
|
|
16399
|
-
$[
|
|
16400
|
-
$[
|
|
16396
|
+
let t15;
|
|
16397
|
+
if ($[25] !== getInputProps) {
|
|
16398
|
+
t15 = getInputProps();
|
|
16399
|
+
$[25] = getInputProps;
|
|
16400
|
+
$[26] = t15;
|
|
16401
16401
|
} else {
|
|
16402
|
-
|
|
16402
|
+
t15 = $[26];
|
|
16403
16403
|
}
|
|
16404
|
-
let
|
|
16405
|
-
if ($[
|
|
16406
|
-
|
|
16407
|
-
$[
|
|
16408
|
-
$[
|
|
16409
|
-
$[
|
|
16404
|
+
let t16;
|
|
16405
|
+
if ($[27] !== autoFocus || $[28] !== t15) {
|
|
16406
|
+
t16 = /* @__PURE__ */ jsx("input", { autoFocus, ...t15 });
|
|
16407
|
+
$[27] = autoFocus;
|
|
16408
|
+
$[28] = t15;
|
|
16409
|
+
$[29] = t16;
|
|
16410
16410
|
} else {
|
|
16411
|
-
|
|
16411
|
+
t16 = $[29];
|
|
16412
16412
|
}
|
|
16413
|
-
let
|
|
16414
|
-
if ($[
|
|
16415
|
-
let
|
|
16416
|
-
if ($[
|
|
16417
|
-
|
|
16418
|
-
$[
|
|
16419
|
-
$[
|
|
16420
|
-
$[
|
|
16421
|
-
$[
|
|
16422
|
-
$[
|
|
16423
|
-
$[
|
|
16424
|
-
$[
|
|
16425
|
-
$[
|
|
16426
|
-
$[
|
|
16413
|
+
let t17;
|
|
16414
|
+
if ($[30] !== disabled || $[31] !== internalValue || $[32] !== metadata || $[33] !== multipleFilesSupported || $[34] !== name || $[35] !== onClear || $[36] !== onFileUploadComplete || $[37] !== property || $[38] !== storagePathBuilder) {
|
|
16415
|
+
let t182;
|
|
16416
|
+
if ($[40] !== disabled || $[41] !== metadata || $[42] !== multipleFilesSupported || $[43] !== name || $[44] !== onClear || $[45] !== onFileUploadComplete || $[46] !== property || $[47] !== storagePathBuilder) {
|
|
16417
|
+
t182 = (entry) => /* @__PURE__ */ jsx(SortableStorageItem, { id: entry.id, entry, property, name, metadata, storagePathBuilder, onFileUploadComplete, onClear, disabled, isSortable: multipleFilesSupported }, entry.id);
|
|
16418
|
+
$[40] = disabled;
|
|
16419
|
+
$[41] = metadata;
|
|
16420
|
+
$[42] = multipleFilesSupported;
|
|
16421
|
+
$[43] = name;
|
|
16422
|
+
$[44] = onClear;
|
|
16423
|
+
$[45] = onFileUploadComplete;
|
|
16424
|
+
$[46] = property;
|
|
16425
|
+
$[47] = storagePathBuilder;
|
|
16426
|
+
$[48] = t182;
|
|
16427
16427
|
} else {
|
|
16428
|
-
|
|
16429
|
-
}
|
|
16430
|
-
|
|
16431
|
-
$[
|
|
16432
|
-
$[
|
|
16433
|
-
$[
|
|
16434
|
-
$[
|
|
16435
|
-
$[
|
|
16436
|
-
$[
|
|
16437
|
-
$[
|
|
16438
|
-
$[
|
|
16439
|
-
$[
|
|
16440
|
-
$[
|
|
16441
|
-
} else {
|
|
16442
|
-
|
|
16428
|
+
t182 = $[48];
|
|
16429
|
+
}
|
|
16430
|
+
t17 = internalValue.map(t182);
|
|
16431
|
+
$[30] = disabled;
|
|
16432
|
+
$[31] = internalValue;
|
|
16433
|
+
$[32] = metadata;
|
|
16434
|
+
$[33] = multipleFilesSupported;
|
|
16435
|
+
$[34] = name;
|
|
16436
|
+
$[35] = onClear;
|
|
16437
|
+
$[36] = onFileUploadComplete;
|
|
16438
|
+
$[37] = property;
|
|
16439
|
+
$[38] = storagePathBuilder;
|
|
16440
|
+
$[39] = t17;
|
|
16441
|
+
} else {
|
|
16442
|
+
t17 = $[39];
|
|
16443
16443
|
}
|
|
16444
|
-
let
|
|
16445
|
-
if ($[
|
|
16446
|
-
|
|
16447
|
-
|
|
16448
|
-
|
|
16444
|
+
let t18;
|
|
16445
|
+
if ($[49] !== t14 || $[50] !== t16 || $[51] !== t17) {
|
|
16446
|
+
t18 = /* @__PURE__ */ jsxs("div", { className: t14, children: [
|
|
16447
|
+
t16,
|
|
16448
|
+
t17
|
|
16449
16449
|
] });
|
|
16450
|
-
$[
|
|
16450
|
+
$[49] = t14;
|
|
16451
|
+
$[50] = t16;
|
|
16452
|
+
$[51] = t17;
|
|
16451
16453
|
$[52] = t18;
|
|
16452
|
-
$[53] = t19;
|
|
16453
|
-
$[54] = t20;
|
|
16454
16454
|
} else {
|
|
16455
|
-
|
|
16455
|
+
t18 = $[52];
|
|
16456
16456
|
}
|
|
16457
|
-
const
|
|
16458
|
-
let
|
|
16459
|
-
if ($[
|
|
16460
|
-
|
|
16461
|
-
$[
|
|
16462
|
-
$[
|
|
16463
|
-
$[
|
|
16457
|
+
const t19 = disabled ? "text-surface-accent-600 dark:text-surface-accent-500" : "";
|
|
16458
|
+
let t20;
|
|
16459
|
+
if ($[53] !== helpText || $[54] !== t19) {
|
|
16460
|
+
t20 = /* @__PURE__ */ jsx("div", { className: "flex-grow min-h-[38px] box-border m-2 text-center", children: /* @__PURE__ */ jsx(Typography, { align: "center", variant: "label", className: t19, children: helpText }) });
|
|
16461
|
+
$[53] = helpText;
|
|
16462
|
+
$[54] = t19;
|
|
16463
|
+
$[55] = t20;
|
|
16464
16464
|
} else {
|
|
16465
|
-
|
|
16465
|
+
t20 = $[55];
|
|
16466
16466
|
}
|
|
16467
|
-
let
|
|
16468
|
-
if ($[
|
|
16469
|
-
|
|
16470
|
-
|
|
16471
|
-
|
|
16467
|
+
let t21;
|
|
16468
|
+
if ($[56] !== t11 || $[57] !== t18 || $[58] !== t20 || $[59] !== t5) {
|
|
16469
|
+
t21 = /* @__PURE__ */ jsxs("div", { ...t5, className: t11, children: [
|
|
16470
|
+
t18,
|
|
16471
|
+
t20
|
|
16472
16472
|
] });
|
|
16473
|
-
$[
|
|
16474
|
-
$[
|
|
16475
|
-
$[
|
|
16476
|
-
$[
|
|
16477
|
-
$[
|
|
16473
|
+
$[56] = t11;
|
|
16474
|
+
$[57] = t18;
|
|
16475
|
+
$[58] = t20;
|
|
16476
|
+
$[59] = t5;
|
|
16477
|
+
$[60] = t21;
|
|
16478
16478
|
} else {
|
|
16479
|
-
|
|
16479
|
+
t21 = $[60];
|
|
16480
16480
|
}
|
|
16481
|
-
return
|
|
16481
|
+
return t21;
|
|
16482
16482
|
}
|
|
16483
16483
|
function _temp2$4(acc, ext) {
|
|
16484
16484
|
return {
|