@firecms/core 3.0.0-canary.205 → 3.0.0-canary.207
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 +31 -17
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +31 -17
- package/dist/index.umd.js.map +1 -1
- package/package.json +5 -5
- package/src/form/EntityForm.tsx +26 -3
- package/src/hooks/useBuildNavigationController.tsx +1 -1
- package/src/routes/FireCMSRoute.tsx +0 -1
package/dist/index.umd.js
CHANGED
|
@@ -4520,7 +4520,7 @@
|
|
|
4520
4520
|
let shouldUpdateTopLevelNav = false;
|
|
4521
4521
|
if (!areCollectionListsEqual(collectionsRef.current ?? [], resolvedCollections)) {
|
|
4522
4522
|
collectionsRef.current = resolvedCollections;
|
|
4523
|
-
console.
|
|
4523
|
+
console.debug("Collections have changed", resolvedCollections);
|
|
4524
4524
|
shouldUpdateTopLevelNav = true;
|
|
4525
4525
|
}
|
|
4526
4526
|
if (collectionsRef.current === void 0) {
|
|
@@ -16393,6 +16393,21 @@
|
|
|
16393
16393
|
});
|
|
16394
16394
|
}
|
|
16395
16395
|
});
|
|
16396
|
+
React.useEffect(() => {
|
|
16397
|
+
const handleKeyDown = (e_0) => {
|
|
16398
|
+
const isUndo = (e_0.metaKey || e_0.ctrlKey) && !e_0.shiftKey && e_0.key.toLowerCase() === "z";
|
|
16399
|
+
const isRedo = (e_0.metaKey || e_0.ctrlKey) && e_0.shiftKey && e_0.key.toLowerCase() === "z" || (e_0.metaKey || e_0.ctrlKey) && !e_0.shiftKey && e_0.key.toLowerCase() === "y";
|
|
16400
|
+
if (isUndo && formex$1.canUndo) {
|
|
16401
|
+
e_0.preventDefault();
|
|
16402
|
+
formex$1.undo();
|
|
16403
|
+
} else if (isRedo && formex$1.canRedo) {
|
|
16404
|
+
e_0.preventDefault();
|
|
16405
|
+
formex$1.redo();
|
|
16406
|
+
}
|
|
16407
|
+
};
|
|
16408
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
16409
|
+
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
16410
|
+
}, [formex$1]);
|
|
16396
16411
|
const resolvedCollection = React.useMemo(() => resolveCollection({
|
|
16397
16412
|
collection,
|
|
16398
16413
|
path,
|
|
@@ -16401,21 +16416,21 @@
|
|
|
16401
16416
|
previousValues: formex$1.initialValues,
|
|
16402
16417
|
propertyConfigs: customizationController.propertyConfigs
|
|
16403
16418
|
}), [collection, path, entityId, formex$1.values, formex$1.initialValues, customizationController.propertyConfigs]);
|
|
16404
|
-
const onPreSaveHookError = React.useCallback((
|
|
16419
|
+
const onPreSaveHookError = React.useCallback((e_1) => {
|
|
16405
16420
|
setSaving(false);
|
|
16406
16421
|
snackbarController.open({
|
|
16407
16422
|
type: "error",
|
|
16408
|
-
message: "Error before saving: " +
|
|
16423
|
+
message: "Error before saving: " + e_1?.message
|
|
16409
16424
|
});
|
|
16410
|
-
console.error(
|
|
16425
|
+
console.error(e_1);
|
|
16411
16426
|
}, [snackbarController]);
|
|
16412
|
-
const onSaveSuccessHookError = React.useCallback((
|
|
16427
|
+
const onSaveSuccessHookError = React.useCallback((e_2) => {
|
|
16413
16428
|
setSaving(false);
|
|
16414
16429
|
snackbarController.open({
|
|
16415
16430
|
type: "error",
|
|
16416
|
-
message: "Error after saving (entity is saved): " +
|
|
16431
|
+
message: "Error after saving (entity is saved): " + e_2?.message
|
|
16417
16432
|
});
|
|
16418
|
-
console.error(
|
|
16433
|
+
console.error(e_2);
|
|
16419
16434
|
}, [snackbarController]);
|
|
16420
16435
|
function clearDirtyCache() {
|
|
16421
16436
|
if (status === "new" || status === "copy") {
|
|
@@ -16445,14 +16460,14 @@
|
|
|
16445
16460
|
});
|
|
16446
16461
|
}
|
|
16447
16462
|
};
|
|
16448
|
-
const onSaveFailure = React.useCallback((
|
|
16463
|
+
const onSaveFailure = React.useCallback((e_3) => {
|
|
16449
16464
|
setSaving(false);
|
|
16450
16465
|
snackbarController.open({
|
|
16451
16466
|
type: "error",
|
|
16452
|
-
message: "Error saving: " +
|
|
16467
|
+
message: "Error saving: " + e_3?.message
|
|
16453
16468
|
});
|
|
16454
16469
|
console.error("Error saving entity", path, entityId);
|
|
16455
|
-
console.error(
|
|
16470
|
+
console.error(e_3);
|
|
16456
16471
|
}, [entityId, path, snackbarController]);
|
|
16457
16472
|
const saveEntity = ({
|
|
16458
16473
|
values: values_1,
|
|
@@ -16513,9 +16528,9 @@
|
|
|
16513
16528
|
analyticsController.onAnalyticsEvent?.(eventName, {
|
|
16514
16529
|
path
|
|
16515
16530
|
});
|
|
16516
|
-
}).catch((
|
|
16517
|
-
console.error(
|
|
16518
|
-
setSavingError(
|
|
16531
|
+
}).catch((e_4) => {
|
|
16532
|
+
console.error(e_4);
|
|
16533
|
+
setSavingError(e_4);
|
|
16519
16534
|
});
|
|
16520
16535
|
};
|
|
16521
16536
|
const formContext = {
|
|
@@ -16571,9 +16586,9 @@
|
|
|
16571
16586
|
context
|
|
16572
16587
|
});
|
|
16573
16588
|
setEntityId(updatedId);
|
|
16574
|
-
} catch (
|
|
16575
|
-
onIdUpdateError?.(
|
|
16576
|
-
console.error(
|
|
16589
|
+
} catch (e_5) {
|
|
16590
|
+
onIdUpdateError?.(e_5);
|
|
16591
|
+
console.error(e_5);
|
|
16577
16592
|
}
|
|
16578
16593
|
setCustomIdLoading(false);
|
|
16579
16594
|
}
|
|
@@ -23275,7 +23290,6 @@
|
|
|
23275
23290
|
const collectionPath = navigation.resolveIdsFrom(isNew ? lastCollectionEntry.path : lastEntityEntry.path);
|
|
23276
23291
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
23277
23292
|
/* @__PURE__ */ jsxRuntime.jsx(EntityEditView, { entityId: isNew ? void 0 : entityId, collection, layout: "full_screen", path: collectionPath, copy: isCopy, selectedTab: selectedTab ?? void 0, onValuesModified: (modified) => blocked.current = modified, onSaved: (params) => {
|
|
23278
|
-
console.log("Entity saved", params);
|
|
23279
23293
|
const newSelectedTab = params.selectedTab;
|
|
23280
23294
|
const newEntityId = params.entityId;
|
|
23281
23295
|
if (newSelectedTab) {
|