@firecms/core 3.0.0-canary.251 → 3.0.0-canary.253
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/EntityCollectionTable/EntityCollectionRowActions.d.ts +2 -1
- package/dist/core/EntityEditView.d.ts +3 -0
- package/dist/form/EntityForm.d.ts +2 -1
- package/dist/form/EntityFormActions.d.ts +3 -1
- package/dist/index.es.js +87 -87
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +87 -87
- package/dist/index.umd.js.map +1 -1
- package/dist/types/entity_actions.d.ts +1 -0
- package/dist/types/side_entity_controller.d.ts +4 -0
- package/dist/util/navigation_from_path.d.ts +4 -0
- package/package.json +5 -5
- package/src/components/EntityCollectionTable/EntityCollectionRowActions.tsx +4 -0
- package/src/components/EntityCollectionView/EntityCollectionView.tsx +2 -2
- package/src/components/FireCMSLogo.tsx +7 -51
- package/src/components/common/default_entity_actions.tsx +7 -4
- package/src/core/EntityEditView.tsx +13 -1
- package/src/core/EntitySidePanel.tsx +4 -1
- package/src/form/EntityForm.tsx +6 -0
- package/src/form/EntityFormActions.tsx +14 -1
- package/src/internal/useBuildSideEntityController.tsx +7 -4
- package/src/routes/FireCMSRoute.tsx +3 -3
- package/src/types/entity_actions.tsx +1 -0
- package/src/types/side_entity_controller.tsx +5 -0
- package/src/util/navigation_from_path.ts +15 -5
- package/src/util/navigation_utils.ts +2 -2
|
@@ -12,10 +12,11 @@ import { CollectionSize, Entity, EntityAction, EntityCollection, SelectionContro
|
|
|
12
12
|
*
|
|
13
13
|
* @group Collection components
|
|
14
14
|
*/
|
|
15
|
-
export declare const EntityCollectionRowActions: ({ entity, collection, fullPath, width, frozen, isSelected, selectionEnabled, size, highlightEntity, onCollectionChange, unhighlightEntity, actions, hideId, selectionController, openEntityMode }: {
|
|
15
|
+
export declare const EntityCollectionRowActions: ({ entity, collection, fullPath, fullIdPath, width, frozen, isSelected, selectionEnabled, size, highlightEntity, onCollectionChange, unhighlightEntity, actions, hideId, selectionController, openEntityMode }: {
|
|
16
16
|
entity: Entity<any>;
|
|
17
17
|
collection?: EntityCollection<any>;
|
|
18
18
|
fullPath?: string;
|
|
19
|
+
fullIdPath?: string;
|
|
19
20
|
width: number;
|
|
20
21
|
frozen?: boolean;
|
|
21
22
|
size: CollectionSize;
|
|
@@ -18,6 +18,9 @@ export type OnTabChangeParams<M extends Record<string, any>> = {
|
|
|
18
18
|
collection: EntityCollection<M>;
|
|
19
19
|
};
|
|
20
20
|
export interface EntityEditViewProps<M extends Record<string, any>> {
|
|
21
|
+
/**
|
|
22
|
+
* The database path of the entity, e.g. "users" or "products".
|
|
23
|
+
*/
|
|
21
24
|
path: string;
|
|
22
25
|
/**
|
|
23
26
|
* The navigation path to the entity.
|
|
@@ -13,6 +13,7 @@ export type OnUpdateParams = {
|
|
|
13
13
|
};
|
|
14
14
|
export type EntityFormProps<M extends Record<string, any>> = {
|
|
15
15
|
path: string;
|
|
16
|
+
fullIdPath?: string;
|
|
16
17
|
collection: EntityCollection<M>;
|
|
17
18
|
entityId?: string;
|
|
18
19
|
entity?: Entity<M>;
|
|
@@ -45,5 +46,5 @@ export type EntityFormProps<M extends Record<string, any>> = {
|
|
|
45
46
|
Builder?: React.ComponentType<EntityCustomViewParams<M>>;
|
|
46
47
|
children?: React.ReactNode;
|
|
47
48
|
};
|
|
48
|
-
export declare function EntityForm<M extends Record<string, any>>({ path, entityId: entityIdProp, collection, onValuesModified, onIdChange, onSaved, entity, initialDirtyValues, onFormContextReady, forceActionsAtTheBottom, initialStatus, className, onStatusChange, onEntityChange, openEntityMode, formex: formexProp, disabled: disabledProp, Builder, EntityFormActionsComponent, showDefaultActions, showEntityPath, children }: EntityFormProps<M>): import("react/jsx-runtime").JSX.Element;
|
|
49
|
+
export declare function EntityForm<M extends Record<string, any>>({ path, fullIdPath, entityId: entityIdProp, collection, onValuesModified, onIdChange, onSaved, entity, initialDirtyValues, onFormContextReady, forceActionsAtTheBottom, initialStatus, className, onStatusChange, onEntityChange, openEntityMode, formex: formexProp, disabled: disabledProp, Builder, EntityFormActionsComponent, showDefaultActions, showEntityPath, children }: EntityFormProps<M>): import("react/jsx-runtime").JSX.Element;
|
|
49
50
|
export declare function yupToFormErrors(yupError: ValidationError): Record<string, any>;
|
|
@@ -2,6 +2,8 @@ import React from "react";
|
|
|
2
2
|
import { Entity, ResolvedEntityCollection } from "../types";
|
|
3
3
|
import { FormexController } from "@firecms/formex";
|
|
4
4
|
export interface EntityFormActionsProps {
|
|
5
|
+
fullPath: string;
|
|
6
|
+
fullIdPath?: string;
|
|
5
7
|
collection: ResolvedEntityCollection;
|
|
6
8
|
path: string;
|
|
7
9
|
entity?: Entity;
|
|
@@ -14,4 +16,4 @@ export interface EntityFormActionsProps {
|
|
|
14
16
|
openEntityMode: "side_panel" | "full_screen";
|
|
15
17
|
showDefaultActions?: boolean;
|
|
16
18
|
}
|
|
17
|
-
export declare function EntityFormActions({ collection, entity, layout, savingError, formex, disabled, status, pluginActions, openEntityMode }: EntityFormActionsProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare function EntityFormActions({ fullPath, fullIdPath, collection, entity, layout, savingError, formex, disabled, status, pluginActions, openEntityMode }: EntityFormActionsProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/index.es.js
CHANGED
|
@@ -178,8 +178,8 @@ function navigateToEntity({
|
|
|
178
178
|
if (openEntityMode === "side_panel") {
|
|
179
179
|
sideEntityController.open({
|
|
180
180
|
entityId,
|
|
181
|
-
path
|
|
182
|
-
|
|
181
|
+
path,
|
|
182
|
+
fullIdPath,
|
|
183
183
|
copy,
|
|
184
184
|
selectedTab,
|
|
185
185
|
collection,
|
|
@@ -922,7 +922,8 @@ function getNavigationEntriesFromPath(props) {
|
|
|
922
922
|
const {
|
|
923
923
|
path,
|
|
924
924
|
collections = [],
|
|
925
|
-
currentFullPath
|
|
925
|
+
currentFullPath,
|
|
926
|
+
currentFullIdPath
|
|
926
927
|
} = props;
|
|
927
928
|
const subpaths = removeInitialAndTrailingSlashes(path).split("/");
|
|
928
929
|
const subpathCombinations = getCollectionPathsCombinations(subpaths);
|
|
@@ -935,13 +936,14 @@ function getNavigationEntriesFromPath(props) {
|
|
|
935
936
|
collection = collections && collections.find((entry) => entry.path === subpathCombination);
|
|
936
937
|
}
|
|
937
938
|
if (collection) {
|
|
938
|
-
const
|
|
939
|
-
const
|
|
939
|
+
const collectionPath = currentFullPath && currentFullPath.length > 0 ? currentFullPath + "/" + collection.path : collection.path;
|
|
940
|
+
const fullIdPath = currentFullIdPath && currentFullIdPath.length > 0 ? currentFullIdPath + "/" + collection.id : collection.id;
|
|
940
941
|
result.push({
|
|
941
942
|
type: "collection",
|
|
942
943
|
id: collection.id,
|
|
943
944
|
path: collectionPath,
|
|
944
945
|
fullPath: collectionPath,
|
|
946
|
+
fullIdPath,
|
|
945
947
|
collection
|
|
946
948
|
});
|
|
947
949
|
const restOfThePath = removeInitialAndTrailingSlashes(removeInitialAndTrailingSlashes(path).replace(subpathCombination, ""));
|
|
@@ -953,6 +955,7 @@ function getNavigationEntriesFromPath(props) {
|
|
|
953
955
|
type: "entity",
|
|
954
956
|
entityId,
|
|
955
957
|
path: collectionPath,
|
|
958
|
+
fullIdPath,
|
|
956
959
|
fullPath,
|
|
957
960
|
parentCollection: collection
|
|
958
961
|
});
|
|
@@ -968,6 +971,7 @@ function getNavigationEntriesFromPath(props) {
|
|
|
968
971
|
type: "custom_view",
|
|
969
972
|
path: collectionPath,
|
|
970
973
|
entityId,
|
|
974
|
+
fullIdPath,
|
|
971
975
|
fullPath: fullPath + "/" + customView.key,
|
|
972
976
|
view: customView
|
|
973
977
|
});
|
|
@@ -976,6 +980,7 @@ function getNavigationEntriesFromPath(props) {
|
|
|
976
980
|
path: newPath,
|
|
977
981
|
collections: collection.subcollections,
|
|
978
982
|
currentFullPath: fullPath,
|
|
983
|
+
currentFullIdPath: fullIdPath,
|
|
979
984
|
contextEntityViews: props.contextEntityViews
|
|
980
985
|
}));
|
|
981
986
|
}
|
|
@@ -9531,6 +9536,7 @@ const EntityCollectionRowActions = function EntityCollectionRowActions2({
|
|
|
9531
9536
|
entity,
|
|
9532
9537
|
collection,
|
|
9533
9538
|
fullPath,
|
|
9539
|
+
fullIdPath,
|
|
9534
9540
|
width,
|
|
9535
9541
|
frozen,
|
|
9536
9542
|
isSelected,
|
|
@@ -9568,6 +9574,7 @@ const EntityCollectionRowActions = function EntityCollectionRowActions2({
|
|
|
9568
9574
|
action.onClick({
|
|
9569
9575
|
entity,
|
|
9570
9576
|
fullPath,
|
|
9577
|
+
fullIdPath,
|
|
9571
9578
|
collection,
|
|
9572
9579
|
context,
|
|
9573
9580
|
selectionController,
|
|
@@ -9582,6 +9589,7 @@ const EntityCollectionRowActions = function EntityCollectionRowActions2({
|
|
|
9582
9589
|
action_0.onClick({
|
|
9583
9590
|
entity,
|
|
9584
9591
|
fullPath,
|
|
9592
|
+
fullIdPath,
|
|
9585
9593
|
collection,
|
|
9586
9594
|
context,
|
|
9587
9595
|
selectionController,
|
|
@@ -12391,6 +12399,7 @@ const editEntityAction = {
|
|
|
12391
12399
|
entity,
|
|
12392
12400
|
collection,
|
|
12393
12401
|
fullPath,
|
|
12402
|
+
fullIdPath,
|
|
12394
12403
|
context,
|
|
12395
12404
|
highlightEntity,
|
|
12396
12405
|
unhighlightEntity,
|
|
@@ -12404,7 +12413,8 @@ const editEntityAction = {
|
|
|
12404
12413
|
if (collection) {
|
|
12405
12414
|
addRecentId(collection.id, entity.id);
|
|
12406
12415
|
}
|
|
12407
|
-
const path = collection?.collectionGroup ? collection.
|
|
12416
|
+
const path = collection?.collectionGroup ? collection.path : fullPath ?? collection?.path ?? entity.path;
|
|
12417
|
+
const newFullIdPath = collection?.collectionGroup ? collection.id : fullIdPath ?? collection?.id ?? entity.path;
|
|
12408
12418
|
const defaultSelectedView = resolveDefaultSelectedView(collection ? collection.defaultSelectedView : void 0, {
|
|
12409
12419
|
status: "existing",
|
|
12410
12420
|
entityId: entity.id
|
|
@@ -12414,7 +12424,7 @@ const editEntityAction = {
|
|
|
12414
12424
|
collection,
|
|
12415
12425
|
entityId: entity.id,
|
|
12416
12426
|
path,
|
|
12417
|
-
fullIdPath:
|
|
12427
|
+
fullIdPath: newFullIdPath,
|
|
12418
12428
|
sideEntityController: context.sideEntityController,
|
|
12419
12429
|
onClose: () => unhighlightEntity?.(entity),
|
|
12420
12430
|
navigation: context.navigation,
|
|
@@ -12441,13 +12451,14 @@ const copyEntityAction = {
|
|
|
12441
12451
|
path: entity.path,
|
|
12442
12452
|
entityId: entity.id
|
|
12443
12453
|
});
|
|
12444
|
-
const path = collection?.collectionGroup ? collection.
|
|
12454
|
+
const path = collection?.collectionGroup ? collection.path : fullPath ?? collection?.path ?? entity.path;
|
|
12455
|
+
const fullIdPath = collection?.collectionGroup ? collection.id : fullPath ?? collection?.id ?? entity.path;
|
|
12445
12456
|
navigateToEntity({
|
|
12446
12457
|
openEntityMode,
|
|
12447
12458
|
collection,
|
|
12448
12459
|
entityId: entity.id,
|
|
12449
12460
|
path,
|
|
12450
|
-
fullIdPath
|
|
12461
|
+
fullIdPath,
|
|
12451
12462
|
copy: true,
|
|
12452
12463
|
sideEntityController: context.sideEntityController,
|
|
12453
12464
|
onClose: () => unhighlightEntity?.(entity),
|
|
@@ -14679,8 +14690,10 @@ const getScrollableParent = (ele) => {
|
|
|
14679
14690
|
return !ele || ele === document.body ? document.body : isScrollable(ele) ? ele : getScrollableParent(ele.parentNode);
|
|
14680
14691
|
};
|
|
14681
14692
|
function EntityFormActions(t0) {
|
|
14682
|
-
const $ = c(
|
|
14693
|
+
const $ = c(14);
|
|
14683
14694
|
const {
|
|
14695
|
+
fullPath,
|
|
14696
|
+
fullIdPath,
|
|
14684
14697
|
collection,
|
|
14685
14698
|
entity,
|
|
14686
14699
|
layout,
|
|
@@ -14694,8 +14707,10 @@ function EntityFormActions(t0) {
|
|
|
14694
14707
|
const context = useFireCMSContext();
|
|
14695
14708
|
const sideEntityController = useSideEntityController();
|
|
14696
14709
|
let t1;
|
|
14697
|
-
if ($[0] !== collection || $[1] !== context || $[2] !== disabled || $[3] !== entity || $[4] !== formex.isSubmitting || $[5] !==
|
|
14710
|
+
if ($[0] !== collection || $[1] !== context || $[2] !== disabled || $[3] !== entity || $[4] !== formex.isSubmitting || $[5] !== fullIdPath || $[6] !== fullPath || $[7] !== layout || $[8] !== openEntityMode || $[9] !== pluginActions || $[10] !== savingError || $[11] !== sideEntityController || $[12] !== status) {
|
|
14698
14711
|
t1 = layout === "bottom" ? buildBottomActions$1({
|
|
14712
|
+
fullPath,
|
|
14713
|
+
fullIdPath,
|
|
14699
14714
|
savingError,
|
|
14700
14715
|
entity,
|
|
14701
14716
|
collection,
|
|
@@ -14707,6 +14722,8 @@ function EntityFormActions(t0) {
|
|
|
14707
14722
|
pluginActions,
|
|
14708
14723
|
openEntityMode
|
|
14709
14724
|
}) : buildSideActions$1({
|
|
14725
|
+
fullPath,
|
|
14726
|
+
fullIdPath,
|
|
14710
14727
|
savingError,
|
|
14711
14728
|
entity,
|
|
14712
14729
|
collection,
|
|
@@ -14723,21 +14740,25 @@ function EntityFormActions(t0) {
|
|
|
14723
14740
|
$[2] = disabled;
|
|
14724
14741
|
$[3] = entity;
|
|
14725
14742
|
$[4] = formex.isSubmitting;
|
|
14726
|
-
$[5] =
|
|
14727
|
-
$[6] =
|
|
14728
|
-
$[7] =
|
|
14729
|
-
$[8] =
|
|
14730
|
-
$[9] =
|
|
14731
|
-
$[10] =
|
|
14732
|
-
$[11] =
|
|
14743
|
+
$[5] = fullIdPath;
|
|
14744
|
+
$[6] = fullPath;
|
|
14745
|
+
$[7] = layout;
|
|
14746
|
+
$[8] = openEntityMode;
|
|
14747
|
+
$[9] = pluginActions;
|
|
14748
|
+
$[10] = savingError;
|
|
14749
|
+
$[11] = sideEntityController;
|
|
14750
|
+
$[12] = status;
|
|
14751
|
+
$[13] = t1;
|
|
14733
14752
|
} else {
|
|
14734
|
-
t1 = $[
|
|
14753
|
+
t1 = $[13];
|
|
14735
14754
|
}
|
|
14736
14755
|
return t1;
|
|
14737
14756
|
}
|
|
14738
14757
|
function buildBottomActions$1({
|
|
14739
14758
|
savingError,
|
|
14740
14759
|
entity,
|
|
14760
|
+
fullPath,
|
|
14761
|
+
fullIdPath,
|
|
14741
14762
|
formActions,
|
|
14742
14763
|
collection,
|
|
14743
14764
|
context,
|
|
@@ -14754,7 +14775,8 @@ function buildBottomActions$1({
|
|
|
14754
14775
|
event.stopPropagation();
|
|
14755
14776
|
if (entity) action.onClick({
|
|
14756
14777
|
entity,
|
|
14757
|
-
fullPath: collection.path,
|
|
14778
|
+
fullPath: fullPath ?? collection.path,
|
|
14779
|
+
fullIdPath: fullIdPath ?? collection.id,
|
|
14758
14780
|
collection,
|
|
14759
14781
|
context,
|
|
14760
14782
|
sideEntityController,
|
|
@@ -14795,6 +14817,7 @@ function buildSideActions$1({
|
|
|
14795
14817
|
}
|
|
14796
14818
|
function EntityForm({
|
|
14797
14819
|
path,
|
|
14820
|
+
fullIdPath,
|
|
14798
14821
|
entityId: entityIdProp,
|
|
14799
14822
|
collection,
|
|
14800
14823
|
onValuesModified,
|
|
@@ -15209,7 +15232,7 @@ function EntityForm({
|
|
|
15209
15232
|
if (!resolvedCollection || !path) {
|
|
15210
15233
|
throw Error("INTERNAL: Collection and path must be defined in form context");
|
|
15211
15234
|
}
|
|
15212
|
-
const dialogActions = /* @__PURE__ */ jsx(EntityFormActionsComponent, { collection: resolvedCollection, path, entity, layout: forceActionsAtTheBottom ? "bottom" : "side", savingError, formex, disabled: actionsDisabled, status, pluginActions, openEntityMode, showDefaultActions });
|
|
15235
|
+
const dialogActions = /* @__PURE__ */ jsx(EntityFormActionsComponent, { collection: resolvedCollection, path, fullPath: path, fullIdPath, entity, layout: forceActionsAtTheBottom ? "bottom" : "side", savingError, formex, disabled: actionsDisabled, status, pluginActions, openEntityMode, showDefaultActions });
|
|
15213
15236
|
return /* @__PURE__ */ jsx(Formex, { value: formex, children: /* @__PURE__ */ jsxs("form", { onSubmit: formex.handleSubmit, onReset: () => formex.resetForm({
|
|
15214
15237
|
values: getInitialEntityValues(authController, collection, path, status, entity, customizationController.propertyConfigs)
|
|
15215
15238
|
}), noValidate: true, className: cls("flex-1 flex flex-row w-full overflow-y-auto justify-center", className), children: [
|
|
@@ -19973,7 +19996,7 @@ const EntityCollectionView = React__default.memo(function EntityCollectionView2(
|
|
|
19973
19996
|
entity: entity_6,
|
|
19974
19997
|
customEntityActions: collection.entityActions
|
|
19975
19998
|
});
|
|
19976
|
-
return /* @__PURE__ */ jsx(EntityCollectionRowActions, { entity: entity_6, width: width_0, frozen, isSelected, selectionEnabled, size: size_0, highlightEntity: setHighlightedEntity, unhighlightEntity: unselectNavigatedEntity, collection, fullPath
|
|
19999
|
+
return /* @__PURE__ */ jsx(EntityCollectionRowActions, { entity: entity_6, width: width_0, frozen, isSelected, selectionEnabled, size: size_0, highlightEntity: setHighlightedEntity, unhighlightEntity: unselectNavigatedEntity, collection, fullPath, fullIdPath, actions: actions_0, hideId: collection?.hideIdFromCollection, onCollectionChange: updateLastDeleteTimestamp, selectionController: usedSelectionController, openEntityMode });
|
|
19977
20000
|
}, [updateLastDeleteTimestamp, usedSelectionController]);
|
|
19978
20001
|
const title = /* @__PURE__ */ jsx(Popover, { open: popOverOpen, onOpenChange: setPopOverOpen, enabled: Boolean(collection.description), trigger: /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-start", children: [
|
|
19979
20002
|
/* @__PURE__ */ jsx(Typography, { variant: "subtitle1", className: `leading-none truncate max-w-[160px] lg:max-w-[240px] ${collection.description ? "cursor-pointer" : "cursor-auto"}`, onClick: collection.description ? (e_2) => {
|
|
@@ -20377,7 +20400,7 @@ function ConfirmationDialog(t0) {
|
|
|
20377
20400
|
return t7;
|
|
20378
20401
|
}
|
|
20379
20402
|
function FireCMSLogo(t0) {
|
|
20380
|
-
const $ = c(
|
|
20403
|
+
const $ = c(8);
|
|
20381
20404
|
const {
|
|
20382
20405
|
width,
|
|
20383
20406
|
height,
|
|
@@ -20387,70 +20410,36 @@ function FireCMSLogo(t0) {
|
|
|
20387
20410
|
const t1 = width ?? "100%";
|
|
20388
20411
|
const t2 = height ?? "100%";
|
|
20389
20412
|
let t3;
|
|
20413
|
+
let t4;
|
|
20414
|
+
let t5;
|
|
20390
20415
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
20391
|
-
t3 = /* @__PURE__ */
|
|
20392
|
-
|
|
20393
|
-
|
|
20394
|
-
/* @__PURE__ */ jsx("stop", { stopColor: "#EC4C51", offset: "44.7242531%" }),
|
|
20395
|
-
/* @__PURE__ */ jsx("stop", { stopColor: "#9543C1", offset: "71.4578165%" }),
|
|
20396
|
-
/* @__PURE__ */ jsx("stop", { stopColor: "#3857B3", offset: "100%" })
|
|
20397
|
-
] });
|
|
20416
|
+
t3 = /* @__PURE__ */ jsx("circle", { cx: "291.5", cy: "291.5", r: "291.5", fill: "#0070F4" });
|
|
20417
|
+
t4 = /* @__PURE__ */ jsx("ellipse", { cx: "292", cy: "291.5", rx: "173", ry: "173.5", fill: "#FF3773" });
|
|
20418
|
+
t5 = /* @__PURE__ */ jsx("path", { d: "M465 291.5C465 268.847 460.525 246.416 451.831 225.487C443.137 204.558 430.394 185.542 414.329 169.524C398.265 153.506 379.194 140.8 358.204 132.131C337.215 123.462 314.719 119 292 119C269.281 119 246.785 123.462 225.796 132.131C204.806 140.8 185.735 153.506 169.671 169.524C153.606 185.542 140.863 204.558 132.169 225.487C123.475 246.416 119 268.847 119 291.5L292 291.5H465Z", fill: "#FFA400" });
|
|
20398
20419
|
$[0] = t3;
|
|
20399
|
-
} else {
|
|
20400
|
-
t3 = $[0];
|
|
20401
|
-
}
|
|
20402
|
-
let t4;
|
|
20403
|
-
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
20404
|
-
t4 = /* @__PURE__ */ jsxs("radialGradient", { cx: "53.6205516%", cy: "47.2473036%", fx: "53.6205516%", fy: "47.2473036%", r: "50.8229649%", gradientTransform: "translate(0.536206,0.472473),rotate(90.000000),scale(1.000000,1.206631),translate(-0.536206,-0.472473)", id: "radialGradient-2", children: [
|
|
20405
|
-
/* @__PURE__ */ jsx("stop", { stopColor: "#68294F", stopOpacity: "0", offset: "0%" }),
|
|
20406
|
-
/* @__PURE__ */ jsx("stop", { stopColor: "#5E2548", stopOpacity: "0.04641108", offset: "75.3503173%" }),
|
|
20407
|
-
/* @__PURE__ */ jsx("stop", { stopColor: "#0D060B", stopOpacity: "0.437431709", offset: "100%" })
|
|
20408
|
-
] });
|
|
20409
20420
|
$[1] = t4;
|
|
20410
|
-
} else {
|
|
20411
|
-
t4 = $[1];
|
|
20412
|
-
}
|
|
20413
|
-
let t5;
|
|
20414
|
-
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
20415
|
-
t5 = /* @__PURE__ */ jsxs("defs", { children: [
|
|
20416
|
-
t3,
|
|
20417
|
-
t4,
|
|
20418
|
-
/* @__PURE__ */ jsxs("radialGradient", { cx: "53.8605015%", cy: "48.1990423%", fx: "53.8605015%", fy: "48.1990423%", r: "59.9151549%", gradientTransform: "translate(0.538605,0.481990),rotate(180.000000),scale(1.000000,0.925027),translate(-0.538605,-0.481990)", id: "radialGradient-3", children: [
|
|
20419
|
-
/* @__PURE__ */ jsx("stop", { stopColor: "#68294F", stopOpacity: "0", offset: "0%" }),
|
|
20420
|
-
/* @__PURE__ */ jsx("stop", { stopColor: "#5E2548", stopOpacity: "0.04641108", offset: "84.0867343%" }),
|
|
20421
|
-
/* @__PURE__ */ jsx("stop", { stopColor: "#FF0000", stopOpacity: "0.567324765", offset: "100%" })
|
|
20422
|
-
] })
|
|
20423
|
-
] });
|
|
20424
20421
|
$[2] = t5;
|
|
20425
20422
|
} else {
|
|
20423
|
+
t3 = $[0];
|
|
20424
|
+
t4 = $[1];
|
|
20426
20425
|
t5 = $[2];
|
|
20427
20426
|
}
|
|
20428
20427
|
let t6;
|
|
20429
|
-
if ($[3]
|
|
20430
|
-
t6 = /* @__PURE__ */
|
|
20431
|
-
|
|
20432
|
-
|
|
20433
|
-
|
|
20434
|
-
] }) });
|
|
20435
|
-
$[3] = t6;
|
|
20436
|
-
} else {
|
|
20437
|
-
t6 = $[3];
|
|
20438
|
-
}
|
|
20439
|
-
let t7;
|
|
20440
|
-
if ($[4] !== className || $[5] !== style || $[6] !== t1 || $[7] !== t2) {
|
|
20441
|
-
t7 = /* @__PURE__ */ jsxs("svg", { width: t1, height: t2, viewBox: "0 0 599 599", version: "1.1", style, className, xmlns: "http://www.w3.org/2000/svg", children: [
|
|
20442
|
-
t5,
|
|
20443
|
-
t6
|
|
20428
|
+
if ($[3] !== className || $[4] !== style || $[5] !== t1 || $[6] !== t2) {
|
|
20429
|
+
t6 = /* @__PURE__ */ jsxs("svg", { width: t1, height: t2, version: "1.1", style, className, viewBox: "0 0 583 583", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
20430
|
+
t3,
|
|
20431
|
+
t4,
|
|
20432
|
+
t5
|
|
20444
20433
|
] });
|
|
20445
|
-
$[
|
|
20446
|
-
$[
|
|
20447
|
-
$[
|
|
20448
|
-
$[
|
|
20449
|
-
$[
|
|
20434
|
+
$[3] = className;
|
|
20435
|
+
$[4] = style;
|
|
20436
|
+
$[5] = t1;
|
|
20437
|
+
$[6] = t2;
|
|
20438
|
+
$[7] = t6;
|
|
20450
20439
|
} else {
|
|
20451
|
-
|
|
20440
|
+
t6 = $[7];
|
|
20452
20441
|
}
|
|
20453
|
-
return
|
|
20442
|
+
return t6;
|
|
20454
20443
|
}
|
|
20455
20444
|
const AppContext = React__default.createContext({
|
|
20456
20445
|
hasDrawer: false,
|
|
@@ -22784,8 +22773,15 @@ function EntityEditViewInner({
|
|
|
22784
22773
|
}), role: "tabpanel", children: /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(EntityJsonPreview, { values: formContext?.values ?? entity?.values ?? {} }) }) }, "json_view");
|
|
22785
22774
|
const subCollectionsViews = subcollections && subcollections.map((subcollection) => {
|
|
22786
22775
|
const subcollectionId = subcollection.id ?? subcollection.path;
|
|
22787
|
-
const newFullPath = usedEntity ? `${path}/${usedEntity?.id}/${removeInitialAndTrailingSlashes(
|
|
22776
|
+
const newFullPath = usedEntity ? `${path}/${usedEntity?.id}/${removeInitialAndTrailingSlashes(subcollection.path)}` : void 0;
|
|
22788
22777
|
const newFullIdPath = fullIdPath ? `${fullIdPath}/${usedEntity?.id}/${removeInitialAndTrailingSlashes(subcollectionId)}` : void 0;
|
|
22778
|
+
console.debug("Rendering subcollection", {
|
|
22779
|
+
subcollectionId,
|
|
22780
|
+
fullIdPath,
|
|
22781
|
+
newFullPath,
|
|
22782
|
+
newFullIdPath,
|
|
22783
|
+
selectedTab
|
|
22784
|
+
});
|
|
22789
22785
|
if (selectedTab !== subcollectionId) return null;
|
|
22790
22786
|
return /* @__PURE__ */ jsxs("div", { className: "relative flex-1 h-full overflow-auto w-full", role: "tabpanel", children: [
|
|
22791
22787
|
globalLoading && /* @__PURE__ */ jsx(CircularProgressCenter, {}),
|
|
@@ -22808,7 +22804,7 @@ function EntityEditViewInner({
|
|
|
22808
22804
|
/* @__PURE__ */ jsx(EntityView, { className: "px-8 h-full overflow-auto", entity, path, collection }),
|
|
22809
22805
|
/* @__PURE__ */ jsx("div", { className: "h-16" })
|
|
22810
22806
|
] }) }) : null;
|
|
22811
|
-
const entityView = /* @__PURE__ */ jsx(EntityForm, { collection, path, entityId: entityId ?? usedEntity?.id, onValuesModified, entity, initialDirtyValues: cachedDirtyValues, openEntityMode: layout, forceActionsAtTheBottom: actionsAtTheBottom, initialStatus: status, className: cls((!mainViewVisible || !canEdit) && !selectedSecondaryForm ? "hidden" : "", formProps?.className), EntityFormActionsComponent: EntityEditViewFormActions, disabled: !canEdit, ...formProps, onEntityChange: (entity_0) => {
|
|
22807
|
+
const entityView = /* @__PURE__ */ jsx(EntityForm, { fullIdPath, collection, path, entityId: entityId ?? usedEntity?.id, onValuesModified, entity, initialDirtyValues: cachedDirtyValues, openEntityMode: layout, forceActionsAtTheBottom: actionsAtTheBottom, initialStatus: status, className: cls((!mainViewVisible || !canEdit) && !selectedSecondaryForm ? "hidden" : "", formProps?.className), EntityFormActionsComponent: EntityEditViewFormActions, disabled: !canEdit, ...formProps, onEntityChange: (entity_0) => {
|
|
22812
22808
|
setUsedEntity(entity_0);
|
|
22813
22809
|
formProps?.onEntityChange?.(entity_0);
|
|
22814
22810
|
}, onStatusChange: (status_0) => {
|
|
@@ -22866,6 +22862,7 @@ function EntitySidePanel(props) {
|
|
|
22866
22862
|
allowFullScreen = true,
|
|
22867
22863
|
path,
|
|
22868
22864
|
entityId,
|
|
22865
|
+
fullIdPath,
|
|
22869
22866
|
formProps
|
|
22870
22867
|
} = props;
|
|
22871
22868
|
const {
|
|
@@ -22894,6 +22891,7 @@ function EntitySidePanel(props) {
|
|
|
22894
22891
|
sideEntityController.replace({
|
|
22895
22892
|
path: params.path,
|
|
22896
22893
|
entityId: params.entityId,
|
|
22894
|
+
fullIdPath: props.fullIdPath,
|
|
22897
22895
|
selectedTab: params.selectedTab,
|
|
22898
22896
|
updateUrl: true,
|
|
22899
22897
|
collection: params.collection
|
|
@@ -22931,21 +22929,21 @@ function EntitySidePanel(props) {
|
|
|
22931
22929
|
if (!props || !collection) {
|
|
22932
22930
|
return /* @__PURE__ */ jsx("div", { className: "w-full" });
|
|
22933
22931
|
}
|
|
22934
|
-
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(EntityEditView, { ...props, layout: "side_panel", collection, parentCollectionIds, onValuesModified, onSaved: onUpdate, barActions: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
22932
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(EntityEditView, { ...props, fullIdPath, layout: "side_panel", collection, parentCollectionIds, onValuesModified, onSaved: onUpdate, barActions: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
22935
22933
|
/* @__PURE__ */ jsx(IconButton, { className: "self-center", onClick: onClose, children: /* @__PURE__ */ jsx(CloseIcon, { size: "small" }) }),
|
|
22936
22934
|
allowFullScreen && /* @__PURE__ */ jsx(IconButton, { className: "self-center", onClick: () => {
|
|
22937
22935
|
if (entityId) navigate(location.pathname);
|
|
22938
22936
|
else navigate(location.pathname + "#new");
|
|
22939
22937
|
}, children: /* @__PURE__ */ jsx(OpenInFullIcon, { size: "small" }) })
|
|
22940
22938
|
] }), onTabChange: ({
|
|
22941
|
-
path: path_0,
|
|
22942
22939
|
entityId: entityId_0,
|
|
22943
22940
|
selectedTab,
|
|
22944
22941
|
collection: collection_0
|
|
22945
22942
|
}) => {
|
|
22946
22943
|
sideEntityController.replace({
|
|
22947
|
-
path
|
|
22944
|
+
path,
|
|
22948
22945
|
entityId: entityId_0,
|
|
22946
|
+
fullIdPath: props.fullIdPath,
|
|
22949
22947
|
selectedTab,
|
|
22950
22948
|
updateUrl: true,
|
|
22951
22949
|
collection: collection_0
|
|
@@ -23102,16 +23100,18 @@ function buildSidePanelsFromUrl(path, collections, newFlag) {
|
|
|
23102
23100
|
});
|
|
23103
23101
|
let sidePanel = void 0;
|
|
23104
23102
|
let lastCollectionPath = "";
|
|
23103
|
+
let lastCollectionId = void 0;
|
|
23105
23104
|
for (let i = 0; i < navigationViewsForPath.length; i++) {
|
|
23106
23105
|
const navigationEntry = navigationViewsForPath[i];
|
|
23107
23106
|
if (navigationEntry.type === "collection") {
|
|
23108
23107
|
lastCollectionPath = navigationEntry.path;
|
|
23108
|
+
lastCollectionId = navigationEntry.collection.id;
|
|
23109
23109
|
}
|
|
23110
23110
|
const previousEntry = navigationViewsForPath[i - 1];
|
|
23111
23111
|
if (navigationEntry.type === "entity") {
|
|
23112
23112
|
sidePanel = {
|
|
23113
23113
|
path: navigationEntry.path,
|
|
23114
|
-
|
|
23114
|
+
fullIdPath: navigationEntry.fullIdPath,
|
|
23115
23115
|
entityId: navigationEntry.entityId,
|
|
23116
23116
|
copy: false,
|
|
23117
23117
|
width: navigationEntry.parentCollection?.sideDialogWidth
|
|
@@ -23129,7 +23129,7 @@ function buildSidePanelsFromUrl(path, collections, newFlag) {
|
|
|
23129
23129
|
if (newFlag) {
|
|
23130
23130
|
sidePanel = {
|
|
23131
23131
|
path: lastCollectionPath,
|
|
23132
|
-
|
|
23132
|
+
fullIdPath: lastCollectionId,
|
|
23133
23133
|
copy: false
|
|
23134
23134
|
};
|
|
23135
23135
|
}
|
|
@@ -23137,7 +23137,7 @@ function buildSidePanelsFromUrl(path, collections, newFlag) {
|
|
|
23137
23137
|
}
|
|
23138
23138
|
const propsToSidePanel = (props, buildUrlCollectionPath, resolveIdsFrom, smallLayout, customizationController, authController) => {
|
|
23139
23139
|
const collectionPath = removeInitialAndTrailingSlashes(props.path);
|
|
23140
|
-
const
|
|
23140
|
+
const urlPath = props.entityId ? buildUrlCollectionPath(`${collectionPath}/${props.entityId}${props.selectedTab ? "/" + props.selectedTab : ""}#${SIDE_URL_HASH}`) : buildUrlCollectionPath(`${collectionPath}#${NEW_URL_HASH}`);
|
|
23141
23141
|
const resolvedPanelProps = {
|
|
23142
23142
|
...props,
|
|
23143
23143
|
formProps: props.formProps
|
|
@@ -23146,7 +23146,7 @@ const propsToSidePanel = (props, buildUrlCollectionPath, resolveIdsFrom, smallLa
|
|
|
23146
23146
|
return {
|
|
23147
23147
|
key: `${props.path}/${props.entityId}`,
|
|
23148
23148
|
component: /* @__PURE__ */ jsx(EntitySidePanel, { ...resolvedPanelProps }),
|
|
23149
|
-
urlPath
|
|
23149
|
+
urlPath,
|
|
23150
23150
|
parentUrlPath: buildUrlCollectionPath(collectionPath),
|
|
23151
23151
|
width: entityViewWidth,
|
|
23152
23152
|
onClose: props.onClose,
|
|
@@ -24618,7 +24618,7 @@ function FireCMSRoute() {
|
|
|
24618
24618
|
} else {
|
|
24619
24619
|
t8 = $[22];
|
|
24620
24620
|
}
|
|
24621
|
-
t62 = /* @__PURE__ */ jsx(EntityCollectionView, { isSubCollection: false, parentCollectionIds: t8, fullPath: collection.id, updateUrl: true, ...collection, Actions: toArray(collection.Actions) }, `collection_view_${collection.id ?? collection.path}`);
|
|
24621
|
+
t62 = /* @__PURE__ */ jsx(EntityCollectionView, { isSubCollection: false, parentCollectionIds: t8, fullPath: collection.path, fullIdPath: collection.id, updateUrl: true, ...collection, Actions: toArray(collection.Actions) }, `collection_view_${collection.id ?? collection.path}`);
|
|
24622
24622
|
}
|
|
24623
24623
|
$[18] = navigation;
|
|
24624
24624
|
$[19] = navigationEntries;
|
|
@@ -24658,7 +24658,7 @@ function FireCMSRoute() {
|
|
|
24658
24658
|
} else {
|
|
24659
24659
|
t8 = $[27];
|
|
24660
24660
|
}
|
|
24661
|
-
t62 = /* @__PURE__ */ jsx(EntityCollectionView, { fullIdPath: collection_0.id, isSubCollection: false, parentCollectionIds: t8, fullPath: collection_0.
|
|
24661
|
+
t62 = /* @__PURE__ */ jsx(EntityCollectionView, { fullIdPath: collection_0.id, isSubCollection: false, parentCollectionIds: t8, fullPath: collection_0.path, updateUrl: true, ...collection_0, Actions: toArray(collection_0.Actions) }, `collection_view_${collection_0.id ?? collection_0.path}`);
|
|
24662
24662
|
}
|
|
24663
24663
|
$[23] = navigation;
|
|
24664
24664
|
$[24] = navigationEntries;
|