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