@firecms/core 3.0.0-canary.296 → 3.0.0-canary.297
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/components/VirtualTable/VirtualTable.performance.test.d.ts +1 -0
- package/dist/form/components/StorageUploadProgress.d.ts +1 -1
- package/dist/index.es.js +56 -24
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +56 -24
- package/dist/index.umd.js.map +1 -1
- package/dist/types/entities.d.ts +1 -0
- package/dist/types/properties.d.ts +9 -0
- package/dist/types/storage.d.ts +8 -0
- package/dist/util/entity_cache.d.ts +0 -1
- package/dist/util/useStorageUploadController.d.ts +1 -1
- package/package.json +6 -5
- package/src/components/EntityPreview.tsx +1 -1
- package/src/components/VirtualTable/VirtualTable.performance.test.tsx +386 -0
- package/src/components/VirtualTable/VirtualTable.tsx +3 -3
- package/src/core/SideDialogs.tsx +2 -1
- package/src/form/components/StorageUploadProgress.tsx +4 -3
- package/src/preview/components/ReferencePreview.tsx +6 -1
- package/src/types/entities.ts +10 -0
- package/src/types/properties.ts +10 -0
- package/src/types/storage.ts +9 -0
- package/src/util/entity_cache.ts +0 -5
- package/src/util/useStorageUploadController.tsx +11 -1
package/dist/index.umd.js
CHANGED
|
@@ -220,6 +220,15 @@
|
|
|
220
220
|
get pathWithId() {
|
|
221
221
|
return `${this.path}/${this.id}`;
|
|
222
222
|
}
|
|
223
|
+
get pathWithIdAndDatabase() {
|
|
224
|
+
if (this.databaseId) {
|
|
225
|
+
if (this.databaseId === "(default)") {
|
|
226
|
+
return this.pathWithId;
|
|
227
|
+
}
|
|
228
|
+
return `${this.databaseId}:::${this.path}/${this.id}`;
|
|
229
|
+
}
|
|
230
|
+
return this.pathWithId;
|
|
231
|
+
}
|
|
223
232
|
isEntityReference() {
|
|
224
233
|
return true;
|
|
225
234
|
}
|
|
@@ -6010,7 +6019,7 @@
|
|
|
6010
6019
|
const t7 = onClick ? "cursor-pointer" : "";
|
|
6011
6020
|
let t8;
|
|
6012
6021
|
if ($[11] !== className || $[12] !== t4 || $[13] !== t5 || $[14] !== t6 || $[15] !== t7) {
|
|
6013
|
-
t8 = ui.cls("bg-white dark:bg-surface-900", "min-h-[
|
|
6022
|
+
t8 = ui.cls("bg-white dark:bg-surface-900", "min-h-[44px]", t4, "items-center", t5, t6, "flex border rounded-lg", t7, ui.defaultBorderMixin, className);
|
|
6014
6023
|
$[11] = className;
|
|
6015
6024
|
$[12] = t4;
|
|
6016
6025
|
$[13] = t5;
|
|
@@ -6095,7 +6104,7 @@
|
|
|
6095
6104
|
return t0;
|
|
6096
6105
|
};
|
|
6097
6106
|
function ReferencePreviewInternal(t0) {
|
|
6098
|
-
const $ = reactCompilerRuntime.c(
|
|
6107
|
+
const $ = reactCompilerRuntime.c(22);
|
|
6099
6108
|
const {
|
|
6100
6109
|
disabled,
|
|
6101
6110
|
reference,
|
|
@@ -6133,24 +6142,43 @@
|
|
|
6133
6142
|
}
|
|
6134
6143
|
return t42;
|
|
6135
6144
|
} else {
|
|
6136
|
-
|
|
6145
|
+
const t42 = size ?? "medium";
|
|
6146
|
+
let t5;
|
|
6147
|
+
if ($[6] !== reference.pathWithId) {
|
|
6148
|
+
t5 = /* @__PURE__ */ jsxRuntime.jsx(ErrorView, { error: "Unexpected reference value. Click to edit", tooltip: reference.pathWithId });
|
|
6149
|
+
$[6] = reference.pathWithId;
|
|
6150
|
+
$[7] = t5;
|
|
6151
|
+
} else {
|
|
6152
|
+
t5 = $[7];
|
|
6153
|
+
}
|
|
6154
|
+
let t6;
|
|
6155
|
+
if ($[8] !== onClick || $[9] !== t42 || $[10] !== t5) {
|
|
6156
|
+
t6 = /* @__PURE__ */ jsxRuntime.jsx(EntityPreviewContainer, { onClick, size: t42, children: t5 });
|
|
6157
|
+
$[8] = onClick;
|
|
6158
|
+
$[9] = t42;
|
|
6159
|
+
$[10] = t5;
|
|
6160
|
+
$[11] = t6;
|
|
6161
|
+
} else {
|
|
6162
|
+
t6 = $[11];
|
|
6163
|
+
}
|
|
6164
|
+
return t6;
|
|
6137
6165
|
}
|
|
6138
6166
|
}
|
|
6139
6167
|
let t4;
|
|
6140
|
-
if ($[
|
|
6168
|
+
if ($[12] !== collection || $[13] !== disabled || $[14] !== hover || $[15] !== includeEntityLink || $[16] !== includeId || $[17] !== onClick || $[18] !== previewProperties || $[19] !== reference || $[20] !== size) {
|
|
6141
6169
|
t4 = /* @__PURE__ */ jsxRuntime.jsx(ReferencePreviewExisting, { reference, collection, previewProperties, size, disabled, includeEntityLink, includeId, onClick, hover });
|
|
6142
|
-
$[
|
|
6143
|
-
$[
|
|
6144
|
-
$[
|
|
6145
|
-
$[
|
|
6146
|
-
$[
|
|
6147
|
-
$[
|
|
6148
|
-
$[
|
|
6149
|
-
$[
|
|
6150
|
-
$[
|
|
6151
|
-
$[
|
|
6170
|
+
$[12] = collection;
|
|
6171
|
+
$[13] = disabled;
|
|
6172
|
+
$[14] = hover;
|
|
6173
|
+
$[15] = includeEntityLink;
|
|
6174
|
+
$[16] = includeId;
|
|
6175
|
+
$[17] = onClick;
|
|
6176
|
+
$[18] = previewProperties;
|
|
6177
|
+
$[19] = reference;
|
|
6178
|
+
$[20] = size;
|
|
6179
|
+
$[21] = t4;
|
|
6152
6180
|
} else {
|
|
6153
|
-
t4 = $[
|
|
6181
|
+
t4 = $[21];
|
|
6154
6182
|
}
|
|
6155
6183
|
return t4;
|
|
6156
6184
|
}
|
|
@@ -8357,9 +8385,16 @@
|
|
|
8357
8385
|
propertyKey
|
|
8358
8386
|
}) ?? "/";
|
|
8359
8387
|
}, [entityId, entityValues, path, resolvedProperty, propertyKey, storage]);
|
|
8360
|
-
const onFileUploadComplete = React.useCallback(async (uploadedPath, entry, metadata_0) => {
|
|
8388
|
+
const onFileUploadComplete = React.useCallback(async (uploadedPath, entry, metadata_0, uploadedUrl) => {
|
|
8361
8389
|
console.debug("onFileUploadComplete", uploadedPath, entry);
|
|
8362
8390
|
let uploadPathOrDownloadUrl = uploadedPath;
|
|
8391
|
+
if (storage.includeBucketUrl) {
|
|
8392
|
+
if (!uploadedUrl) {
|
|
8393
|
+
console.warn("includeBucketUrl is set but no fully-qualified storage URL was returned by the StorageSource. Falling back to the storage path.");
|
|
8394
|
+
} else {
|
|
8395
|
+
uploadPathOrDownloadUrl = uploadedUrl;
|
|
8396
|
+
}
|
|
8397
|
+
}
|
|
8363
8398
|
if (storage.storeUrl) {
|
|
8364
8399
|
uploadPathOrDownloadUrl = (await storageSource.getDownloadURL(uploadedPath)).url;
|
|
8365
8400
|
}
|
|
@@ -8532,10 +8567,11 @@
|
|
|
8532
8567
|
path: storagePath,
|
|
8533
8568
|
metadata
|
|
8534
8569
|
}).then(async ({
|
|
8535
|
-
path
|
|
8570
|
+
path,
|
|
8571
|
+
storageUrl
|
|
8536
8572
|
}) => {
|
|
8537
8573
|
console.debug("Upload successful", path);
|
|
8538
|
-
await onFileUploadComplete(path, entry, metadata);
|
|
8574
|
+
await onFileUploadComplete(path, entry, metadata, storageUrl);
|
|
8539
8575
|
if (mounted.current) setLoading(false);
|
|
8540
8576
|
}).catch((e) => {
|
|
8541
8577
|
console.warn("Upload error", e);
|
|
@@ -10211,10 +10247,6 @@
|
|
|
10211
10247
|
const entityString = localStorage.getItem(key);
|
|
10212
10248
|
if (entityString) {
|
|
10213
10249
|
const entity = JSON.parse(entityString, customReviver);
|
|
10214
|
-
console.log("Loaded entity from localStorage:", {
|
|
10215
|
-
key,
|
|
10216
|
-
entity
|
|
10217
|
-
});
|
|
10218
10250
|
return entity;
|
|
10219
10251
|
}
|
|
10220
10252
|
} catch (error) {
|
|
@@ -11518,7 +11550,7 @@
|
|
|
11518
11550
|
/* @__PURE__ */ jsxRuntime.jsx(ui.AssignmentIcon, {}),
|
|
11519
11551
|
emptyComponent
|
|
11520
11552
|
] }) : void 0;
|
|
11521
|
-
const virtualListController = {
|
|
11553
|
+
const virtualListController = React.useMemo(() => ({
|
|
11522
11554
|
data,
|
|
11523
11555
|
rowHeight,
|
|
11524
11556
|
cellRenderer,
|
|
@@ -11537,7 +11569,7 @@
|
|
|
11537
11569
|
rowClassName,
|
|
11538
11570
|
endAdornment,
|
|
11539
11571
|
AddColumnComponent
|
|
11540
|
-
};
|
|
11572
|
+
}), [data, rowHeight, cellRenderer, columns, currentSort, onRowClick, customView, onColumnResizeInternal, onColumnResizeEndInternal, filterInput, onColumnSort, onFilterUpdateInternal, sortByProperty, hoverRow, createFilterField2, rowClassName, endAdornment, AddColumnComponent]);
|
|
11541
11573
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref: measureRef, style, className: ui.cls("h-full w-full", className), children: /* @__PURE__ */ jsxRuntime.jsx(VirtualListContext.Provider, { value: virtualListController, children: /* @__PURE__ */ jsxRuntime.jsx(MemoizedList, { outerRef: tableRef, width: bounds.width, height: bounds.height, itemCount: (data?.length ?? 0) + (endAdornment ? 1 : 0), onScroll, includeAddColumn: Boolean(AddColumnComponent), itemSize: rowHeight }, rowHeight) }) });
|
|
11542
11574
|
}, equal);
|
|
11543
11575
|
function MemoizedList({
|