@firecms/core 3.0.0-tw4.2 → 3.0.0
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/README.md +1 -1
- package/dist/hooks/useProjectLog.d.ts +1 -1
- package/dist/index.es.js +37 -20
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +37 -20
- package/dist/index.umd.js.map +1 -1
- package/dist/util/entity_cache.d.ts +0 -1
- package/dist/util/strings.d.ts +1 -0
- package/dist/util/strings.test.d.ts +1 -0
- package/package.json +5 -5
- package/src/app/Scaffold.tsx +1 -1
- package/src/components/ArrayContainer.tsx +1 -1
- package/src/components/EntityCollectionTable/EntityCollectionRowActions.tsx +1 -1
- package/src/components/EntityCollectionTable/internal/EntityTableCell.tsx +3 -3
- package/src/components/ReferenceWidget.tsx +1 -1
- package/src/components/SelectableTable/SelectableTable.tsx +1 -1
- package/src/components/VirtualTable/VirtualTableHeader.tsx +1 -1
- package/src/components/VirtualTable/VirtualTableRow.tsx +1 -1
- package/src/core/DefaultDrawer.tsx +1 -1
- package/src/core/DrawerNavigationItem.tsx +3 -4
- package/src/core/SideDialogs.tsx +19 -8
- package/src/hooks/useProjectLog.tsx +1 -1
- package/src/preview/components/EmptyValue.tsx +1 -1
- package/src/util/entity_cache.ts +0 -5
- package/src/util/strings.test.ts +101 -0
- package/src/util/strings.ts +21 -0
package/dist/index.umd.js
CHANGED
|
@@ -1125,6 +1125,18 @@
|
|
|
1125
1125
|
return slug.trim();
|
|
1126
1126
|
}
|
|
1127
1127
|
}
|
|
1128
|
+
function prettifyIdentifier(input) {
|
|
1129
|
+
if (!input) return "";
|
|
1130
|
+
let text = input;
|
|
1131
|
+
text = text.replace(/([a-z])([A-Z])|([A-Z])([A-Z][a-z])/g, "$1$3 $2$4");
|
|
1132
|
+
text = text.replace(/[_-]+/g, " ");
|
|
1133
|
+
const s = text.trim().replace(/\b\w/g, (char) => char.toUpperCase());
|
|
1134
|
+
console.log("Prettified identifier:", {
|
|
1135
|
+
input,
|
|
1136
|
+
s
|
|
1137
|
+
});
|
|
1138
|
+
return s;
|
|
1139
|
+
}
|
|
1128
1140
|
const defaultDateFormat = "MMMM dd, yyyy, HH:mm:ss";
|
|
1129
1141
|
const COLLECTION_PATH_SEPARATOR = "::";
|
|
1130
1142
|
function stripCollectionPath(path) {
|
|
@@ -4906,7 +4918,7 @@
|
|
|
4906
4918
|
const $ = reactCompilerRuntime.c(1);
|
|
4907
4919
|
let t0;
|
|
4908
4920
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
4909
|
-
t0 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-full bg-surface-200 bg-opacity-30
|
|
4921
|
+
t0 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-full bg-surface-200 bg-opacity-30 dark:bg-opacity-20 w-5 h-2 inline-block" });
|
|
4910
4922
|
$[0] = t0;
|
|
4911
4923
|
} else {
|
|
4912
4924
|
t0 = $[0];
|
|
@@ -9731,9 +9743,9 @@
|
|
|
9731
9743
|
}
|
|
9732
9744
|
const setOnHoverFalse = t10;
|
|
9733
9745
|
const borderClass = showError ? "border-red-500" : internalSaved ? "border-green-500" : isSelected ? "border-primary" : "border-transparent";
|
|
9734
|
-
const t11 = `flex relative h-full rounded-md p-${p} border border-4
|
|
9746
|
+
const t11 = `flex relative h-full rounded-md p-${p} border border-4 border-opacity-75`;
|
|
9735
9747
|
const t12 = onHover && !disabled ? "bg-surface-50 dark:bg-surface-900" : "";
|
|
9736
|
-
const t13 = saved ? "bg-surface-100
|
|
9748
|
+
const t13 = saved ? "bg-surface-100 bg-opacity-75 dark:bg-surface-800 dark:bg-opacity-75" : "";
|
|
9737
9749
|
const t14 = hideOverflow ? "overflow-hidden" : "";
|
|
9738
9750
|
const t15 = isSelected ? "bg-surface-50 dark:bg-surface-900" : "";
|
|
9739
9751
|
let t16;
|
|
@@ -9801,7 +9813,7 @@
|
|
|
9801
9813
|
}
|
|
9802
9814
|
let t24;
|
|
9803
9815
|
if ($[33] !== disabled || $[34] !== disabledTooltip || $[35] !== onHover) {
|
|
9804
|
-
t24 = disabled && onHover && disabledTooltip && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-1 right-1 text-xs", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: disabledTooltip, children: /* @__PURE__ */ jsxRuntime.jsx(ui.DoNotDisturbOnIcon, { size: "smallest", color: "disabled", className: "text-
|
|
9816
|
+
t24 = disabled && onHover && disabledTooltip && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-1 right-1 text-xs", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: disabledTooltip, children: /* @__PURE__ */ jsxRuntime.jsx(ui.DoNotDisturbOnIcon, { size: "smallest", color: "disabled", className: "text-surface-500" }) }) });
|
|
9805
9817
|
$[33] = disabled;
|
|
9806
9818
|
$[34] = disabledTooltip;
|
|
9807
9819
|
$[35] = onHover;
|
|
@@ -10199,10 +10211,6 @@
|
|
|
10199
10211
|
const entityString = localStorage.getItem(key);
|
|
10200
10212
|
if (entityString) {
|
|
10201
10213
|
const entity = JSON.parse(entityString, customReviver);
|
|
10202
|
-
console.log("Loaded entity from localStorage:", {
|
|
10203
|
-
key,
|
|
10204
|
-
entity
|
|
10205
|
-
});
|
|
10206
10214
|
return entity;
|
|
10207
10215
|
}
|
|
10208
10216
|
} catch (error) {
|
|
@@ -10271,7 +10279,7 @@
|
|
|
10271
10279
|
const enableLocalChangesBackup = collection ? getLocalChangesBackup(collection) : false;
|
|
10272
10280
|
const hasDraft = enableLocalChangesBackup ? getEntityFromCache(fullPath + "/" + entity.id) : false;
|
|
10273
10281
|
const iconSize = largeLayout && (size === "m" || size === "l" || size == "xl") ? "medium" : "small";
|
|
10274
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cls("h-full flex items-center justify-center flex-col bg-surface-50 dark:bg-surface-900 bg-opacity-90
|
|
10282
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cls("h-full flex items-center justify-center flex-col bg-surface-50 dark:bg-surface-900 bg-opacity-90 dark:bg-opacity-90 z-10", frozen ? "sticky left-0" : ""), onClick: React.useCallback((event) => {
|
|
10275
10283
|
event.stopPropagation();
|
|
10276
10284
|
}, []), style: {
|
|
10277
10285
|
width,
|
|
@@ -10785,7 +10793,7 @@
|
|
|
10785
10793
|
const t3 = column.frozen ? "sticky left-0 z-10" : "relative z-0";
|
|
10786
10794
|
let t4;
|
|
10787
10795
|
if ($[4] !== t3) {
|
|
10788
|
-
t4 = ui.cls("flex py-0 px-3 h-full text-xs uppercase font-semibold relative select-none items-center bg-surface-50 dark:bg-surface-900", "text-text-secondary hover:text-text-primary dark:text-text-secondary-dark dark:hover:text-text-primary-dark", "hover:bg-surface-100 dark:hover:bg-surface-800 hover:bg-opacity-50
|
|
10796
|
+
t4 = ui.cls("flex py-0 px-3 h-full text-xs uppercase font-semibold relative select-none items-center bg-surface-50 dark:bg-surface-900", "text-text-secondary hover:text-text-primary dark:text-text-secondary-dark dark:hover:text-text-primary-dark", "hover:bg-surface-100 dark:hover:bg-surface-800 hover:bg-opacity-50 dark:hover:bg-opacity-50", t3);
|
|
10789
10797
|
$[4] = t3;
|
|
10790
10798
|
$[5] = t4;
|
|
10791
10799
|
} else {
|
|
@@ -11221,7 +11229,7 @@
|
|
|
11221
11229
|
const onClick = t1;
|
|
11222
11230
|
let t2;
|
|
11223
11231
|
if ($[4] !== hoverRow || $[5] !== onRowClick || $[6] !== rowClassName || $[7] !== rowData) {
|
|
11224
|
-
t2 = ui.cls("flex min-w-full text-sm border-b border-surface-200 dark:border-surface-800 border-opacity-40
|
|
11232
|
+
t2 = ui.cls("flex min-w-full text-sm border-b border-surface-200 dark:border-surface-800 border-opacity-40 dark:border-opacity-40", rowClassName ? rowClassName(rowData) : "", {
|
|
11225
11233
|
"hover:bg-opacity-95": hoverRow,
|
|
11226
11234
|
"cursor-pointer": onRowClick
|
|
11227
11235
|
});
|
|
@@ -12252,7 +12260,7 @@
|
|
|
12252
12260
|
selectedCell
|
|
12253
12261
|
}), [setPopupCell, select, onValueChange, size, selectedCell]);
|
|
12254
12262
|
return /* @__PURE__ */ jsxRuntime.jsx(SelectableTableContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-full w-full flex flex-col bg-white dark:bg-surface-950", ref, children: /* @__PURE__ */ jsxRuntime.jsx(VirtualTable, { data, columns, cellRenderer, onRowClick: inlineEditing ? void 0 : onEntityClick ? onRowClick : void 0, onEndReached: loadNextPage, onResetPagination: resetPagination, error: dataLoadingError, onColumnResize, rowHeight: getRowHeight(size), loading: dataLoading, filter: filterValues, onFilterUpdate: setFilterValues ? onFilterUpdate : void 0, sortBy, onSortByUpdate: setSortBy, hoverRow, initialScroll, onScroll, checkFilterCombination, createFilterField: filterable ? createFilterField : void 0, rowClassName: React.useCallback((entity) => {
|
|
12255
|
-
return highlightedRow?.(entity) ? "bg-surface-100 bg-opacity-75
|
|
12263
|
+
return highlightedRow?.(entity) ? "bg-surface-100 bg-opacity-75 dark:bg-surface-800 dark:bg-opacity-75" : "";
|
|
12256
12264
|
}, [highlightedRow]), className: "flex-grow", emptyComponent, endAdornment, AddColumnComponent }) }) });
|
|
12257
12265
|
};
|
|
12258
12266
|
function createFilterField({
|
|
@@ -22050,7 +22058,7 @@
|
|
|
22050
22058
|
storedProps,
|
|
22051
22059
|
updateItemCustomProps
|
|
22052
22060
|
} = t0;
|
|
22053
|
-
const t1 = `relative ${!isDragging ? "hover\\:bg-surface-accent-50 dark\\:hover\\:bg-surface-800 dark\\:hover\\:bg-opacity-20
|
|
22061
|
+
const t1 = `relative ${!isDragging ? "hover\\:bg-surface-accent-50 dark\\:hover\\:bg-surface-800 dark\\:hover\\:bg-opacity-20" : ""} rounded-md opacity-100`;
|
|
22054
22062
|
let t2;
|
|
22055
22063
|
if ($[0] !== internalId || $[1] !== updateItemCustomProps) {
|
|
22056
22064
|
t2 = (props) => updateItemCustomProps(internalId, props);
|
|
@@ -22373,7 +22381,7 @@
|
|
|
22373
22381
|
} else if (value?.isEntityReference && value?.isEntityReference()) {
|
|
22374
22382
|
child = /* @__PURE__ */ jsxRuntime.jsx(ReferencePreview, { reference: value, onClick: onEntryClick, disabled, previewProperties, size, includeId, includeEntityLink });
|
|
22375
22383
|
}
|
|
22376
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cls("text-sm font-medium", "min-w-80 flex flex-col gap-4", "relative transition-colors duration-200 ease-in rounded font-medium", disabled ? "bg-opacity-50" : "hover:bg-opacity-75", "text-opacity-50
|
|
22384
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cls("text-sm font-medium", "min-w-80 flex flex-col gap-4", "relative transition-colors duration-200 ease-in rounded font-medium", disabled ? "bg-opacity-50" : "hover:bg-opacity-75", "text-opacity-50 dark:text-white dark:text-opacity-50", className), children: [
|
|
22377
22385
|
child,
|
|
22378
22386
|
!value && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "justify-center text-left", children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { variant: "outlined", color: "primary", disabled, onClick: onEntryClick, children: [
|
|
22379
22387
|
"Edit ",
|
|
@@ -23679,7 +23687,15 @@
|
|
|
23679
23687
|
pendingClose,
|
|
23680
23688
|
setPendingClose
|
|
23681
23689
|
}, children: [
|
|
23682
|
-
/* @__PURE__ */ jsxRuntime.jsxs(ui.Sheet, { open: Boolean(panel), onOpenChange: (open) =>
|
|
23690
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ui.Sheet, { open: Boolean(panel), onOpenChange: (open) => {
|
|
23691
|
+
if (!open) {
|
|
23692
|
+
const suggestionMenu = document.querySelector('[data-suggestion-menu="true"]');
|
|
23693
|
+
if (suggestionMenu && window.getComputedStyle(suggestionMenu).visibility !== "hidden") {
|
|
23694
|
+
return;
|
|
23695
|
+
}
|
|
23696
|
+
onCloseRequest();
|
|
23697
|
+
}
|
|
23698
|
+
}, title: "Side dialog " + panel?.key, children: [
|
|
23683
23699
|
panel && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "transform max-w-[100vw] lg:max-w-[95vw] flex flex-col h-full transition-all duration-250 ease-in-out bg-white dark:bg-surface-900 ", style: {
|
|
23684
23700
|
width: panel.width,
|
|
23685
23701
|
transform: `translateX(-${offsetPosition * 200}px)`
|
|
@@ -25027,7 +25043,7 @@
|
|
|
25027
25043
|
}, [delegate.initTextSearch])
|
|
25028
25044
|
};
|
|
25029
25045
|
}
|
|
25030
|
-
const DEFAULT_SERVER = "https://api
|
|
25046
|
+
const DEFAULT_SERVER = "https://api.firecms.co";
|
|
25031
25047
|
async function makeRequest(authController, dataSourceKey, pluginKeys, apiKey) {
|
|
25032
25048
|
let idToken;
|
|
25033
25049
|
try {
|
|
@@ -25261,7 +25277,7 @@
|
|
|
25261
25277
|
const {
|
|
25262
25278
|
isActive
|
|
25263
25279
|
} = t52;
|
|
25264
|
-
return ui.cls("rounded-lg truncate", "hover:bg-surface-accent-300 hover:bg-opacity-75
|
|
25280
|
+
return ui.cls("rounded-lg truncate", "hover:bg-surface-accent-300 hover:bg-opacity-75 dark:hover:bg-surface-accent-800 dark:hover:bg-opacity-75 text-text-primary dark:text-surface-200 hover:text-surface-900 hover:dark:text-white", "flex flex-row items-center mr-8", drawerOpen ? "pl-4 h-10" : "pl-4 h-9", "font-semibold text-xs", isActive ? "bg-surface-accent-200 bg-opacity-60 dark:bg-surface-800 dark:bg-opacity-50" : "");
|
|
25265
25281
|
};
|
|
25266
25282
|
$[4] = drawerOpen;
|
|
25267
25283
|
$[5] = t4;
|
|
@@ -25271,7 +25287,7 @@
|
|
|
25271
25287
|
const t5 = drawerOpen ? "opacity-100" : "opacity-0 hidden";
|
|
25272
25288
|
let t6;
|
|
25273
25289
|
if ($[6] !== t5) {
|
|
25274
|
-
t6 = ui.cls(
|
|
25290
|
+
t6 = ui.cls(t5, "ml-4 font-inherit text-inherit");
|
|
25275
25291
|
$[6] = t5;
|
|
25276
25292
|
$[7] = t6;
|
|
25277
25293
|
} else {
|
|
@@ -25419,7 +25435,7 @@
|
|
|
25419
25435
|
}
|
|
25420
25436
|
let t10;
|
|
25421
25437
|
if ($[41] !== adminMenuOpen || $[42] !== buildGroupHeader || $[43] !== drawerOpen || $[44] !== navigationEntries || $[45] !== onClick || $[46] !== tooltipsOpen) {
|
|
25422
|
-
t10 = (group_0) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-surface-50 dark:bg-surface-800 dark:bg-opacity-30
|
|
25438
|
+
t10 = (group_0) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-surface-50 dark:bg-surface-800 dark:bg-opacity-30 my-4 rounded-lg ml-3 mr-1", children: [
|
|
25423
25439
|
buildGroupHeader(group_0),
|
|
25424
25440
|
Object.values(navigationEntries).filter((e_0) => e_0.group === group_0).map((view_0) => /* @__PURE__ */ jsxRuntime.jsx(DrawerNavigationItem, { icon: /* @__PURE__ */ jsxRuntime.jsx(IconForView, { collectionOrView: view_0.collection ?? view_0.view, size: "small" }), tooltipsOpen, adminMenuOpen, drawerOpen, onClick: () => onClick(view_0), url: view_0.url, name: view_0.name }, view_0.id))
|
|
25425
25441
|
] }, `drawer_group_${group_0}`);
|
|
@@ -26927,7 +26943,7 @@
|
|
|
26927
26943
|
}
|
|
26928
26944
|
let t12;
|
|
26929
26945
|
if ($[24] !== innerDrawer || $[25] !== props.open || $[26] !== props.setDrawerOpen) {
|
|
26930
|
-
t12 = /* @__PURE__ */ jsxRuntime.jsx(ui.Sheet, { side: "left", transparent: true, open: props.open, onOpenChange: props.setDrawerOpen, title: "Navigation drawer", overlayClassName: "bg-white bg-opacity-80
|
|
26946
|
+
t12 = /* @__PURE__ */ jsxRuntime.jsx(ui.Sheet, { side: "left", transparent: true, open: props.open, onOpenChange: props.setDrawerOpen, title: "Navigation drawer", overlayClassName: "bg-white bg-opacity-80", children: innerDrawer });
|
|
26931
26947
|
$[24] = innerDrawer;
|
|
26932
26948
|
$[25] = props.open;
|
|
26933
26949
|
$[26] = props.setDrawerOpen;
|
|
@@ -27171,6 +27187,7 @@
|
|
|
27171
27187
|
exports2.navigateToEntity = navigateToEntity;
|
|
27172
27188
|
exports2.pick = pick;
|
|
27173
27189
|
exports2.plural = plural;
|
|
27190
|
+
exports2.prettifyIdentifier = prettifyIdentifier;
|
|
27174
27191
|
exports2.printChanged = printChanged;
|
|
27175
27192
|
exports2.propertiesToColumns = propertiesToColumns;
|
|
27176
27193
|
exports2.randomColor = randomColor;
|