@firecms/core 3.0.0-canary.9 → 3.0.0-canary.90
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/app/AppBar.d.ts +12 -0
- package/dist/app/Drawer.d.ts +17 -0
- package/dist/app/Scaffold.d.ts +30 -0
- package/dist/app/index.d.ts +4 -0
- package/dist/app/useApp.d.ts +16 -0
- package/dist/components/CircularProgressCenter.d.ts +1 -1
- package/dist/components/ClearFilterSortButton.d.ts +5 -0
- package/dist/components/EntityCollectionTable/EntityCollectionRowActions.d.ts +11 -12
- package/dist/components/EntityCollectionTable/EntityCollectionTable.d.ts +1 -1
- package/dist/components/EntityCollectionTable/EntityCollectionTableProps.d.ts +5 -3
- package/dist/components/EntityCollectionTable/PropertyTableCell.d.ts +1 -0
- package/dist/components/EntityCollectionTable/column_utils.d.ts +1 -2
- package/dist/components/EntityCollectionTable/fields/TableReferenceField.d.ts +2 -0
- package/dist/components/EntityCollectionTable/internal/CollectionTableToolbar.d.ts +1 -4
- package/dist/components/EntityCollectionTable/internal/EntityTableCell.d.ts +2 -2
- package/dist/components/EntityCollectionTable/internal/popup_field/PopupFormField.d.ts +1 -1
- package/dist/components/EntityCollectionView/EntityCollectionView.d.ts +12 -2
- package/dist/components/EntityCollectionView/EntityCollectionViewStartActions.d.ts +11 -0
- package/dist/components/EntityPreview.d.ts +5 -4
- package/dist/components/ErrorView.d.ts +1 -1
- package/dist/components/HomePage/DefaultHomePage.d.ts +1 -1
- package/dist/components/HomePage/NavigationCardBinding.d.ts +1 -1
- package/dist/components/ReferenceWidget.d.ts +3 -1
- package/dist/components/SelectableTable/SelectableTable.d.ts +1 -1
- package/dist/components/SelectableTable/filters/ReferenceFilterField.d.ts +2 -1
- package/dist/components/VirtualTable/VirtualTableProps.d.ts +15 -12
- package/dist/components/VirtualTable/types.d.ts +3 -3
- package/dist/components/{EntityCollectionTable/internal → common}/default_entity_actions.d.ts +1 -1
- package/dist/components/common/index.d.ts +1 -0
- package/dist/components/common/table_height.d.ts +5 -0
- package/dist/components/common/types.d.ts +4 -6
- package/dist/components/common/useDataSourceEntityCollectionTableController.d.ts +3 -0
- package/dist/components/index.d.ts +2 -1
- package/dist/contexts/AuthControllerContext.d.ts +1 -1
- package/dist/{components/FireCMSAppBar.d.ts → core/DefaultAppBar.d.ts} +6 -9
- package/dist/core/DefaultDrawer.d.ts +19 -0
- package/dist/core/DrawerNavigationItem.d.ts +9 -0
- package/dist/core/EntityEditView.d.ts +17 -3
- package/dist/core/FireCMS.d.ts +1 -1
- package/dist/core/NavigationRoutes.d.ts +3 -3
- package/dist/core/index.d.ts +3 -4
- package/dist/form/PropertiesForm.d.ts +8 -0
- package/dist/form/components/ErrorFocus.d.ts +1 -1
- package/dist/form/components/FieldHelperText.d.ts +3 -3
- package/dist/form/components/StorageItemPreview.d.ts +4 -4
- package/dist/form/field_bindings/MapFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/StorageUploadFieldBinding.d.ts +2 -4
- package/dist/form/index.d.ts +0 -2
- package/dist/hooks/data/delete.d.ts +2 -2
- package/dist/hooks/data/save.d.ts +2 -3
- package/dist/hooks/data/useDataSource.d.ts +1 -1
- package/dist/hooks/data/useEntityFetch.d.ts +3 -3
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/useBuildNavigationController.d.ts +1 -2
- package/dist/hooks/useProjectLog.d.ts +2 -2
- package/dist/hooks/useValidateAuthenticator.d.ts +21 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +15552 -11933
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +19643 -7
- package/dist/index.umd.js.map +1 -1
- package/dist/internal/useBuildDataSource.d.ts +1 -16
- package/dist/internal/useRestoreScroll.d.ts +1 -1
- package/dist/preview/PropertyPreviewProps.d.ts +6 -4
- package/dist/preview/components/ReferencePreview.d.ts +2 -1
- package/dist/preview/components/StorageThumbnail.d.ts +2 -1
- package/dist/preview/components/UrlComponentPreview.d.ts +2 -1
- package/dist/types/auth.d.ts +26 -2
- package/dist/types/collections.d.ts +31 -7
- package/dist/types/datasource.d.ts +34 -20
- package/dist/types/entities.d.ts +5 -1
- package/dist/types/entity_actions.d.ts +14 -0
- package/dist/types/entity_callbacks.d.ts +2 -2
- package/dist/types/fields.d.ts +31 -30
- package/dist/types/index.d.ts +0 -1
- package/dist/types/navigation.d.ts +5 -5
- package/dist/types/plugins.d.ts +16 -6
- package/dist/types/properties.d.ts +17 -4
- package/dist/types/storage.d.ts +11 -3
- package/dist/util/collections.d.ts +1 -1
- package/dist/util/entities.d.ts +1 -1
- package/dist/util/icon_synonyms.d.ts +1 -97
- package/dist/util/icons.d.ts +2 -2
- package/dist/util/navigation_utils.d.ts +2 -2
- package/dist/util/objects.d.ts +1 -1
- package/dist/util/plurals.d.ts +0 -2
- package/dist/util/resolutions.d.ts +13 -13
- package/dist/util/storage.d.ts +23 -2
- package/dist/util/useStorageUploadController.d.ts +1 -1
- package/dist/util/useTraceUpdate.d.ts +1 -0
- package/package.json +130 -119
- package/src/app/AppBar.tsx +18 -0
- package/src/app/Drawer.tsx +25 -0
- package/src/app/Scaffold.tsx +249 -0
- package/src/app/index.ts +4 -0
- package/src/app/useApp.tsx +32 -0
- package/src/components/CircularProgressCenter.tsx +1 -1
- package/src/components/ClearFilterSortButton.tsx +41 -0
- package/src/components/EntityCollectionTable/EntityCollectionRowActions.tsx +9 -18
- package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +21 -20
- package/src/components/EntityCollectionTable/EntityCollectionTableProps.tsx +10 -6
- package/src/components/EntityCollectionTable/PropertyTableCell.tsx +38 -34
- package/src/components/EntityCollectionTable/column_utils.tsx +3 -3
- package/src/components/EntityCollectionTable/fields/TableReferenceField.tsx +11 -2
- package/src/components/EntityCollectionTable/fields/TableStorageUpload.tsx +14 -6
- package/src/components/EntityCollectionTable/internal/CollectionTableToolbar.tsx +29 -34
- package/src/components/EntityCollectionTable/internal/EntityTableCell.tsx +16 -12
- package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +4 -5
- package/src/components/EntityCollectionView/EntityCollectionView.tsx +69 -45
- package/src/components/EntityCollectionView/EntityCollectionViewStartActions.tsx +68 -0
- package/src/components/EntityCollectionView/useSelectionController.tsx +19 -7
- package/src/components/EntityPreview.tsx +15 -9
- package/src/components/EntityView.tsx +5 -5
- package/src/components/ErrorView.tsx +1 -1
- package/src/components/HomePage/DefaultHomePage.tsx +3 -3
- package/src/components/HomePage/NavigationCard.tsx +3 -3
- package/src/components/HomePage/NavigationCardBinding.tsx +1 -1
- package/src/components/HomePage/SmallNavigationCard.tsx +5 -5
- package/src/components/PropertyIdCopyTooltipContent.tsx +2 -3
- package/src/components/ReferenceTable/ReferenceSelectionTable.tsx +1 -0
- package/src/components/ReferenceWidget.tsx +22 -12
- package/src/components/SearchIconsView.tsx +5 -5
- package/src/components/SelectableTable/SelectableTable.tsx +7 -7
- package/src/components/SelectableTable/filters/BooleanFilterField.tsx +2 -3
- package/src/components/SelectableTable/filters/DateTimeFilterField.tsx +22 -7
- package/src/components/SelectableTable/filters/ReferenceFilterField.tsx +28 -6
- package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +35 -15
- package/src/components/VirtualTable/VirtualTable.tsx +70 -37
- package/src/components/VirtualTable/VirtualTableCell.tsx +1 -1
- package/src/components/VirtualTable/VirtualTableHeader.tsx +4 -4
- package/src/components/VirtualTable/VirtualTableHeaderRow.tsx +2 -2
- package/src/components/VirtualTable/VirtualTableProps.tsx +18 -14
- package/src/components/VirtualTable/VirtualTableRow.tsx +4 -5
- package/src/components/VirtualTable/fields/VirtualTableDateField.tsx +1 -1
- package/src/components/VirtualTable/types.tsx +2 -3
- package/src/components/{EntityCollectionTable/internal → common}/default_entity_actions.tsx +2 -2
- package/src/components/common/index.ts +1 -0
- package/src/components/{VirtualTable/common.tsx → common/table_height.tsx} +5 -2
- package/src/components/common/types.tsx +4 -6
- package/src/components/common/useColumnsIds.tsx +10 -2
- package/src/components/common/useDataSourceEntityCollectionTableController.tsx +11 -0
- package/src/components/common/useTableSearchHelper.ts +52 -12
- package/src/components/index.tsx +2 -1
- package/src/contexts/AuthControllerContext.tsx +1 -1
- package/src/contexts/DialogsProvider.tsx +2 -2
- package/src/{components/FireCMSAppBar.tsx → core/DefaultAppBar.tsx} +52 -37
- package/src/core/DefaultDrawer.tsx +177 -0
- package/src/core/DrawerNavigationItem.tsx +62 -0
- package/src/core/EntityEditView.tsx +676 -133
- package/src/core/EntitySidePanel.tsx +1 -2
- package/src/core/FireCMS.tsx +39 -44
- package/src/core/NavigationRoutes.tsx +7 -8
- package/src/core/field_configs.tsx +2 -3
- package/src/core/index.tsx +3 -4
- package/src/form/PropertiesForm.tsx +81 -0
- package/src/form/PropertyFieldBinding.tsx +29 -7
- package/src/form/components/FieldHelperText.tsx +3 -3
- package/src/form/components/StorageItemPreview.tsx +20 -11
- package/src/form/components/StorageUploadProgress.tsx +3 -3
- package/src/form/field_bindings/ArrayCustomShapedFieldBinding.tsx +8 -5
- package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +8 -5
- package/src/form/field_bindings/BlockFieldBinding.tsx +2 -2
- package/src/form/field_bindings/KeyValueFieldBinding.tsx +44 -39
- package/src/form/field_bindings/MapFieldBinding.tsx +11 -3
- package/src/form/field_bindings/MarkdownFieldBinding.tsx +2 -2
- package/src/form/field_bindings/ReadOnlyFieldBinding.tsx +2 -9
- package/src/form/field_bindings/ReferenceFieldBinding.tsx +15 -13
- package/src/form/field_bindings/RepeatFieldBinding.tsx +10 -7
- package/src/form/field_bindings/SelectFieldBinding.tsx +3 -3
- package/src/form/field_bindings/StorageUploadFieldBinding.tsx +22 -43
- package/src/form/field_bindings/SwitchFieldBinding.tsx +1 -1
- package/src/form/index.tsx +4 -4
- package/src/form/validation.ts +1 -17
- package/src/hooks/data/delete.ts +3 -3
- package/src/hooks/data/save.ts +4 -2
- package/src/hooks/data/useDataSource.tsx +2 -2
- package/src/hooks/data/useEntityFetch.tsx +3 -3
- package/src/hooks/index.tsx +3 -0
- package/src/hooks/useBuildLocalConfigurationPersistence.tsx +8 -10
- package/src/hooks/useBuildModeController.tsx +11 -5
- package/src/hooks/useBuildNavigationController.tsx +137 -61
- package/src/hooks/useProjectLog.tsx +21 -8
- package/src/hooks/useResolvedNavigationFrom.tsx +1 -1
- package/src/hooks/useValidateAuthenticator.tsx +115 -0
- package/src/index.ts +1 -0
- package/src/internal/useBuildDataSource.ts +56 -49
- package/src/internal/useBuildSideEntityController.tsx +88 -21
- package/src/preview/PropertyPreview.tsx +9 -16
- package/src/preview/PropertyPreviewProps.tsx +4 -8
- package/src/preview/components/BooleanPreview.tsx +4 -2
- package/src/preview/components/EnumValuesChip.tsx +1 -1
- package/src/preview/components/ImagePreview.tsx +21 -33
- package/src/preview/components/ReferencePreview.tsx +23 -23
- package/src/preview/components/StorageThumbnail.tsx +5 -1
- package/src/preview/components/UrlComponentPreview.tsx +44 -11
- package/src/preview/property_previews/ArrayOfMapsPreview.tsx +0 -1
- package/src/preview/property_previews/ArrayOfReferencesPreview.tsx +2 -1
- package/src/preview/property_previews/ArrayOfStorageComponentsPreview.tsx +0 -1
- package/src/preview/property_previews/ArrayOfStringsPreview.tsx +0 -1
- package/src/preview/property_previews/ArrayOneOfPreview.tsx +2 -3
- package/src/preview/property_previews/ArrayPropertyPreview.tsx +2 -3
- package/src/preview/property_previews/MapPropertyPreview.tsx +5 -5
- package/src/preview/property_previews/StringPropertyPreview.tsx +2 -2
- package/src/types/auth.tsx +35 -2
- package/src/types/collections.ts +37 -8
- package/src/types/customization_controller.tsx +0 -1
- package/src/types/datasource.ts +41 -24
- package/src/types/entities.ts +9 -1
- package/src/types/entity_actions.tsx +16 -3
- package/src/types/entity_callbacks.ts +2 -2
- package/src/types/fields.tsx +33 -33
- package/src/types/index.ts +0 -1
- package/src/types/navigation.ts +6 -7
- package/src/types/plugins.tsx +18 -8
- package/src/types/properties.ts +22 -6
- package/src/types/storage.ts +12 -3
- package/src/util/collections.ts +1 -1
- package/src/util/entities.ts +5 -4
- package/src/util/enums.ts +1 -1
- package/src/util/icon_list.ts +2 -2
- package/src/util/icon_synonyms.ts +3 -99
- package/src/util/navigation_utils.ts +6 -6
- package/src/util/objects.ts +25 -28
- package/src/util/permissions.ts +1 -0
- package/src/util/plurals.ts +0 -2
- package/src/util/resolutions.ts +32 -31
- package/src/util/storage.ts +75 -21
- package/src/util/strings.ts +2 -2
- package/src/util/useStorageUploadController.tsx +21 -3
- package/src/util/useTraceUpdate.tsx +2 -1
- package/dist/components/VirtualTable/common.d.ts +0 -2
- package/dist/core/Drawer.d.ts +0 -23
- package/dist/core/Scaffold.d.ts +0 -55
- package/dist/core/SideEntityView.d.ts +0 -7
- package/dist/form/EntityForm.d.ts +0 -77
- package/dist/internal/useBuildCustomizationController.d.ts +0 -2
- package/dist/internal/useLocaleConfig.d.ts +0 -1
- package/dist/types/appcheck.d.ts +0 -26
- package/src/core/Drawer.tsx +0 -191
- package/src/core/Scaffold.tsx +0 -281
- package/src/core/SideEntityView.tsx +0 -38
- package/src/form/EntityForm.tsx +0 -728
- package/src/internal/useBuildCustomizationController.tsx +0 -5
- package/src/internal/useLocaleConfig.tsx +0 -18
- package/src/types/appcheck.ts +0 -29
package/src/util/resolutions.ts
CHANGED
|
@@ -26,7 +26,7 @@ import { getDefaultValuesFor, isPropertyBuilder } from "./entities";
|
|
|
26
26
|
import { DEFAULT_ONE_OF_TYPE } from "./common";
|
|
27
27
|
import { getIn } from "@firecms/formex";
|
|
28
28
|
import { enumToObjectEntries } from "./enums";
|
|
29
|
-
import { isDefaultFieldConfigId } from "../core";
|
|
29
|
+
import { isDefaultFieldConfigId } from "../core/field_configs";
|
|
30
30
|
|
|
31
31
|
// import util from "util";
|
|
32
32
|
|
|
@@ -38,7 +38,8 @@ export const resolveCollection = <M extends Record<string, any>, >
|
|
|
38
38
|
values,
|
|
39
39
|
previousValues,
|
|
40
40
|
userConfigPersistence,
|
|
41
|
-
fields
|
|
41
|
+
fields,
|
|
42
|
+
ignoreMissingFields = false
|
|
42
43
|
}: {
|
|
43
44
|
collection: EntityCollection<M> | ResolvedEntityCollection<M>;
|
|
44
45
|
path: string,
|
|
@@ -47,6 +48,7 @@ export const resolveCollection = <M extends Record<string, any>, >
|
|
|
47
48
|
previousValues?: Partial<EntityValues<M>>,
|
|
48
49
|
userConfigPersistence?: UserConfigurationPersistence;
|
|
49
50
|
fields?: Record<string, PropertyConfig>;
|
|
51
|
+
ignoreMissingFields?: boolean;
|
|
50
52
|
}): ResolvedEntityCollection<M> => {
|
|
51
53
|
|
|
52
54
|
const collectionOverride = userConfigPersistence?.getCollectionConfig<M>(path);
|
|
@@ -58,16 +60,15 @@ export const resolveCollection = <M extends Record<string, any>, >
|
|
|
58
60
|
|
|
59
61
|
const resolvedProperties = Object.entries(collection.properties)
|
|
60
62
|
.map(([key, propertyOrBuilder]) => {
|
|
61
|
-
const propertyValue = usedValues ? getIn(usedValues, key) : undefined;
|
|
62
63
|
const childResolvedProperty = resolveProperty({
|
|
63
64
|
propertyKey: key,
|
|
64
65
|
propertyOrBuilder: propertyOrBuilder as PropertyOrBuilder | ResolvedProperty,
|
|
65
66
|
values: usedValues,
|
|
66
67
|
previousValues: usedPreviousValues,
|
|
67
68
|
path,
|
|
68
|
-
propertyValue,
|
|
69
69
|
entityId,
|
|
70
|
-
fields
|
|
70
|
+
fields,
|
|
71
|
+
ignoreMissingFields
|
|
71
72
|
});
|
|
72
73
|
if (!childResolvedProperty) return {};
|
|
73
74
|
return ({
|
|
@@ -95,17 +96,15 @@ export const resolveCollection = <M extends Record<string, any>, >
|
|
|
95
96
|
* Resolve property builders, enums and arrays.
|
|
96
97
|
* @param propertyOrBuilder
|
|
97
98
|
* @param propertyValue
|
|
98
|
-
* @param values
|
|
99
99
|
*/
|
|
100
100
|
export function resolveProperty<T extends CMSType = CMSType, M extends Record<string, any> = any>({
|
|
101
101
|
propertyOrBuilder,
|
|
102
|
-
propertyValue,
|
|
103
102
|
fromBuilder = false,
|
|
103
|
+
ignoreMissingFields = false,
|
|
104
104
|
...props
|
|
105
105
|
}: {
|
|
106
106
|
propertyKey?: string,
|
|
107
107
|
propertyOrBuilder: PropertyOrBuilder<T, M> | ResolvedProperty<T>,
|
|
108
|
-
propertyValue?: unknown,
|
|
109
108
|
values?: Partial<M>,
|
|
110
109
|
previousValues?: Partial<M>,
|
|
111
110
|
path?: string,
|
|
@@ -113,6 +112,7 @@ export function resolveProperty<T extends CMSType = CMSType, M extends Record<st
|
|
|
113
112
|
index?: number,
|
|
114
113
|
fromBuilder?: boolean;
|
|
115
114
|
fields?: Record<string, PropertyConfig<any>>;
|
|
115
|
+
ignoreMissingFields?: boolean;
|
|
116
116
|
}): ResolvedProperty<T> | null {
|
|
117
117
|
|
|
118
118
|
if (typeof propertyOrBuilder === "object" && "resolved" in propertyOrBuilder) {
|
|
@@ -128,10 +128,11 @@ export function resolveProperty<T extends CMSType = CMSType, M extends Record<st
|
|
|
128
128
|
if (!path)
|
|
129
129
|
throw Error("Trying to resolve a property builder without specifying the entity path");
|
|
130
130
|
|
|
131
|
+
const usedPropertyValue = props.propertyKey ? getIn(props.values, props.propertyKey) : undefined;
|
|
131
132
|
const result: Property<T> | null = propertyOrBuilder({
|
|
132
133
|
...props,
|
|
133
134
|
path,
|
|
134
|
-
propertyValue,
|
|
135
|
+
propertyValue: usedPropertyValue,
|
|
135
136
|
values: props.values ?? {},
|
|
136
137
|
previousValues: props.previousValues ?? props.values ?? {}
|
|
137
138
|
});
|
|
@@ -142,17 +143,17 @@ export function resolveProperty<T extends CMSType = CMSType, M extends Record<st
|
|
|
142
143
|
|
|
143
144
|
resolvedProperty = resolveProperty({
|
|
144
145
|
...props,
|
|
145
|
-
propertyValue,
|
|
146
146
|
propertyOrBuilder: result,
|
|
147
|
-
fromBuilder: true
|
|
147
|
+
fromBuilder: true,
|
|
148
|
+
ignoreMissingFields
|
|
148
149
|
});
|
|
149
150
|
} else {
|
|
150
151
|
const property = propertyOrBuilder as Property<T>;
|
|
151
152
|
if (property.dataType === "map" && property.properties) {
|
|
152
153
|
const properties = resolveProperties({
|
|
154
|
+
ignoreMissingFields,
|
|
153
155
|
...props,
|
|
154
156
|
properties: property.properties,
|
|
155
|
-
propertyValue
|
|
156
157
|
});
|
|
157
158
|
resolvedProperty = {
|
|
158
159
|
...property,
|
|
@@ -163,8 +164,8 @@ export function resolveProperty<T extends CMSType = CMSType, M extends Record<st
|
|
|
163
164
|
} else if (property.dataType === "array") {
|
|
164
165
|
resolvedProperty = resolveArrayProperty({
|
|
165
166
|
property,
|
|
166
|
-
propertyValue,
|
|
167
167
|
fromBuilder,
|
|
168
|
+
ignoreMissingFields,
|
|
168
169
|
...props
|
|
169
170
|
}) as ResolvedProperty<any>;
|
|
170
171
|
} else if ((property.dataType === "string" || property.dataType === "number") && property.enumValues) {
|
|
@@ -182,12 +183,12 @@ export function resolveProperty<T extends CMSType = CMSType, M extends Record<st
|
|
|
182
183
|
|
|
183
184
|
if (resolvedProperty.propertyConfig && !isDefaultFieldConfigId(resolvedProperty.propertyConfig)) {
|
|
184
185
|
const cmsFields = props.fields;
|
|
185
|
-
if (!cmsFields) {
|
|
186
|
-
throw Error(`Trying to resolve a property with key ${resolvedProperty.propertyConfig} that inherits from a custom property config but no custom property configs were provided. Use the property
|
|
186
|
+
if (!cmsFields && !ignoreMissingFields) {
|
|
187
|
+
throw Error(`Trying to resolve a property with key '${resolvedProperty.propertyConfig}' that inherits from a custom property config but no custom property configs were provided. Use the property 'propertyConfigs' in your app config to provide them`);
|
|
187
188
|
}
|
|
188
|
-
const customField: PropertyConfig
|
|
189
|
+
const customField: PropertyConfig | undefined = cmsFields?.[resolvedProperty.propertyConfig];
|
|
189
190
|
if (!customField) {
|
|
190
|
-
console.warn(`Trying to resolve a property with key ${resolvedProperty.propertyConfig} that inherits from a custom property config but no custom property config with that key was found. Check the
|
|
191
|
+
console.warn(`Trying to resolve a property with key '${resolvedProperty.propertyConfig}' that inherits from a custom property config but no custom property config with that key was found. Check the 'propertyConfigs' in your app config`)
|
|
191
192
|
console.warn("Available property configs", cmsFields);
|
|
192
193
|
return null;
|
|
193
194
|
}
|
|
@@ -198,7 +199,7 @@ export function resolveProperty<T extends CMSType = CMSType, M extends Record<st
|
|
|
198
199
|
}
|
|
199
200
|
const customFieldProperty = resolveProperty<any>({
|
|
200
201
|
propertyOrBuilder: configPropertyOrBuilder,
|
|
201
|
-
|
|
202
|
+
ignoreMissingFields,
|
|
202
203
|
...props
|
|
203
204
|
});
|
|
204
205
|
if (customFieldProperty) {
|
|
@@ -219,12 +220,11 @@ export function resolveProperty<T extends CMSType = CMSType, M extends Record<st
|
|
|
219
220
|
export function resolveArrayProperty<T extends any[], M>({
|
|
220
221
|
propertyKey,
|
|
221
222
|
property,
|
|
222
|
-
|
|
223
|
+
ignoreMissingFields = false,
|
|
223
224
|
...props
|
|
224
225
|
}: {
|
|
225
226
|
propertyKey?: string,
|
|
226
227
|
property: ArrayProperty<T> | ResolvedArrayProperty<T>,
|
|
227
|
-
propertyValue: any,
|
|
228
228
|
values?: Partial<M>,
|
|
229
229
|
previousValues?: Partial<M>,
|
|
230
230
|
path?: string,
|
|
@@ -232,7 +232,9 @@ export function resolveArrayProperty<T extends any[], M>({
|
|
|
232
232
|
index?: number,
|
|
233
233
|
fromBuilder?: boolean;
|
|
234
234
|
fields?: Record<string, PropertyConfig>;
|
|
235
|
+
ignoreMissingFields?: boolean;
|
|
235
236
|
}): ResolvedArrayProperty {
|
|
237
|
+
const propertyValue = propertyKey ? getIn(props.values, propertyKey) : undefined;
|
|
236
238
|
|
|
237
239
|
if (property.of) {
|
|
238
240
|
if (Array.isArray(property.of)) {
|
|
@@ -244,7 +246,7 @@ export function resolveArrayProperty<T extends any[], M>({
|
|
|
244
246
|
return resolveProperty({
|
|
245
247
|
propertyKey: `${propertyKey}.${index}`,
|
|
246
248
|
propertyOrBuilder: p as Property<any>,
|
|
247
|
-
|
|
249
|
+
ignoreMissingFields,
|
|
248
250
|
...props,
|
|
249
251
|
index
|
|
250
252
|
});
|
|
@@ -256,7 +258,7 @@ export function resolveArrayProperty<T extends any[], M>({
|
|
|
256
258
|
? propertyValue.map((v: any, index: number) => resolveProperty({
|
|
257
259
|
propertyKey: `${propertyKey}.${index}`,
|
|
258
260
|
propertyOrBuilder: of,
|
|
259
|
-
|
|
261
|
+
ignoreMissingFields,
|
|
260
262
|
...props,
|
|
261
263
|
index
|
|
262
264
|
})).filter(e => Boolean(e)) as ResolvedProperty[]
|
|
@@ -264,10 +266,10 @@ export function resolveArrayProperty<T extends any[], M>({
|
|
|
264
266
|
const ofProperty = resolveProperty({
|
|
265
267
|
propertyKey: `${propertyKey}`,
|
|
266
268
|
propertyOrBuilder: of,
|
|
267
|
-
|
|
269
|
+
ignoreMissingFields,
|
|
268
270
|
...props
|
|
269
271
|
});
|
|
270
|
-
if (!ofProperty)
|
|
272
|
+
if (!ofProperty && !ignoreMissingFields)
|
|
271
273
|
throw Error("When using a property builder as the 'of' prop of an ArrayProperty, you must return a valid child property")
|
|
272
274
|
return {
|
|
273
275
|
...property,
|
|
@@ -287,14 +289,14 @@ export function resolveArrayProperty<T extends any[], M>({
|
|
|
287
289
|
return resolveProperty({
|
|
288
290
|
propertyKey: `${propertyKey}.${index}`,
|
|
289
291
|
propertyOrBuilder: childProperty,
|
|
290
|
-
|
|
292
|
+
ignoreMissingFields,
|
|
291
293
|
...props
|
|
292
294
|
});
|
|
293
295
|
}).filter(e => Boolean(e)) as ResolvedProperty[]
|
|
294
296
|
: [];
|
|
295
297
|
const properties = resolveProperties<any>({
|
|
296
298
|
properties: property.oneOf.properties,
|
|
297
|
-
|
|
299
|
+
ignoreMissingFields,
|
|
298
300
|
...props
|
|
299
301
|
});
|
|
300
302
|
return {
|
|
@@ -326,11 +328,10 @@ export function resolveArrayProperty<T extends any[], M>({
|
|
|
326
328
|
*/
|
|
327
329
|
export function resolveProperties<M extends Record<string, any>>({
|
|
328
330
|
properties,
|
|
329
|
-
|
|
331
|
+
ignoreMissingFields,
|
|
330
332
|
...props
|
|
331
333
|
}: {
|
|
332
334
|
properties: PropertiesOrBuilders<M>,
|
|
333
|
-
propertyValue: unknown,
|
|
334
335
|
values?: Partial<M>,
|
|
335
336
|
previousValues?: Partial<M>,
|
|
336
337
|
path?: string,
|
|
@@ -338,14 +339,14 @@ export function resolveProperties<M extends Record<string, any>>({
|
|
|
338
339
|
index?: number,
|
|
339
340
|
fromBuilder?: boolean;
|
|
340
341
|
fields?: Record<string, PropertyConfig>;
|
|
342
|
+
ignoreMissingFields?: boolean;
|
|
341
343
|
}): ResolvedProperties<M> {
|
|
342
344
|
return Object.entries<PropertyOrBuilder>(properties as Record<string, PropertyOrBuilder>)
|
|
343
345
|
.map(([key, property]) => {
|
|
344
|
-
const thisPropertyValue = propertyValue && typeof propertyValue === "object" ? getValueInPath(propertyValue, key) : undefined;
|
|
345
346
|
const childResolvedProperty = resolveProperty({
|
|
346
347
|
propertyKey: key,
|
|
347
348
|
propertyOrBuilder: property,
|
|
348
|
-
|
|
349
|
+
ignoreMissingFields,
|
|
349
350
|
...props
|
|
350
351
|
});
|
|
351
352
|
if (!childResolvedProperty) return {};
|
|
@@ -367,7 +368,7 @@ export function resolvePropertyEnum(property: StringProperty | NumberProperty, f
|
|
|
367
368
|
return {
|
|
368
369
|
...property,
|
|
369
370
|
resolved: true,
|
|
370
|
-
enumValues: enumToObjectEntries(property.enumValues)?.filter((value) => value && value.id && value.label) ?? [],
|
|
371
|
+
enumValues: enumToObjectEntries(property.enumValues)?.filter((value) => value && (value.id || value.id === 0) && value.label) ?? [],
|
|
371
372
|
fromBuilder: fromBuilder ?? false
|
|
372
373
|
}
|
|
373
374
|
}
|
package/src/util/storage.ts
CHANGED
|
@@ -7,15 +7,28 @@ import {
|
|
|
7
7
|
} from "../types";
|
|
8
8
|
import { randomString } from "./strings";
|
|
9
9
|
|
|
10
|
+
interface ResolveFilenameStringParams<M extends object> {
|
|
11
|
+
input: string | ((context: UploadedFileContext) => (Promise<string> | string));
|
|
12
|
+
storage: StorageConfig;
|
|
13
|
+
values: EntityValues<M>;
|
|
14
|
+
entityId: string;
|
|
15
|
+
path?: string;
|
|
16
|
+
property: ResolvedStringProperty | ResolvedArrayProperty<string[]>;
|
|
17
|
+
file: File;
|
|
18
|
+
propertyKey: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
10
21
|
export async function resolveFilenameString<M extends object>(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
22
|
+
{
|
|
23
|
+
input,
|
|
24
|
+
storage,
|
|
25
|
+
values,
|
|
26
|
+
entityId,
|
|
27
|
+
path,
|
|
28
|
+
property,
|
|
29
|
+
file,
|
|
30
|
+
propertyKey
|
|
31
|
+
}: ResolveFilenameStringParams<M>): Promise<string> {
|
|
19
32
|
let result;
|
|
20
33
|
if (typeof input === "function") {
|
|
21
34
|
result = await input({
|
|
@@ -30,7 +43,13 @@ export async function resolveFilenameString<M extends object>(
|
|
|
30
43
|
if (!result)
|
|
31
44
|
console.warn("Storage callback returned empty result. Using default name value")
|
|
32
45
|
} else {
|
|
33
|
-
result = replacePlaceholders(
|
|
46
|
+
result = replacePlaceholders({
|
|
47
|
+
file,
|
|
48
|
+
input,
|
|
49
|
+
entityId,
|
|
50
|
+
propertyKey,
|
|
51
|
+
path
|
|
52
|
+
});
|
|
34
53
|
}
|
|
35
54
|
|
|
36
55
|
if (!result)
|
|
@@ -39,15 +58,28 @@ export async function resolveFilenameString<M extends object>(
|
|
|
39
58
|
return result;
|
|
40
59
|
}
|
|
41
60
|
|
|
61
|
+
interface ResolveStoragePathStringParams<M extends object> {
|
|
62
|
+
input: string | ((context: UploadedFileContext) => string);
|
|
63
|
+
storage: StorageConfig;
|
|
64
|
+
values: EntityValues<M>;
|
|
65
|
+
entityId: string;
|
|
66
|
+
path?: string;
|
|
67
|
+
property: ResolvedStringProperty | ResolvedArrayProperty<string[]>;
|
|
68
|
+
file: File;
|
|
69
|
+
propertyKey: string;
|
|
70
|
+
}
|
|
71
|
+
|
|
42
72
|
export function resolveStoragePathString<M extends object>(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
73
|
+
{
|
|
74
|
+
input,
|
|
75
|
+
storage,
|
|
76
|
+
values,
|
|
77
|
+
entityId,
|
|
78
|
+
path,
|
|
79
|
+
property,
|
|
80
|
+
file,
|
|
81
|
+
propertyKey
|
|
82
|
+
}: ResolveStoragePathStringParams<M>): string {
|
|
51
83
|
let result;
|
|
52
84
|
if (typeof input === "function") {
|
|
53
85
|
result = input({
|
|
@@ -62,7 +94,13 @@ export function resolveStoragePathString<M extends object>(
|
|
|
62
94
|
if (!result)
|
|
63
95
|
console.warn("Storage callback returned empty result. Using default name value")
|
|
64
96
|
} else {
|
|
65
|
-
result = replacePlaceholders(
|
|
97
|
+
result = replacePlaceholders({
|
|
98
|
+
file,
|
|
99
|
+
input,
|
|
100
|
+
entityId,
|
|
101
|
+
propertyKey,
|
|
102
|
+
path
|
|
103
|
+
});
|
|
66
104
|
}
|
|
67
105
|
|
|
68
106
|
if (!result)
|
|
@@ -71,14 +109,30 @@ export function resolveStoragePathString<M extends object>(
|
|
|
71
109
|
return result;
|
|
72
110
|
}
|
|
73
111
|
|
|
74
|
-
|
|
112
|
+
interface Placeholders {
|
|
113
|
+
file: File;
|
|
114
|
+
input: string;
|
|
115
|
+
entityId: string;
|
|
116
|
+
propertyKey: string;
|
|
117
|
+
path?: string;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function replacePlaceholders({
|
|
121
|
+
file,
|
|
122
|
+
input,
|
|
123
|
+
entityId,
|
|
124
|
+
propertyKey,
|
|
125
|
+
path
|
|
126
|
+
}: Placeholders) {
|
|
75
127
|
const ext = file.name.split(".").pop();
|
|
76
128
|
let result = input.replace("{entityId}", entityId)
|
|
77
129
|
.replace("{propertyKey}", propertyKey)
|
|
78
130
|
.replace("{rand}", randomString())
|
|
79
131
|
.replace("{file}", file.name)
|
|
80
|
-
.replace("{file.type}", file.type)
|
|
81
|
-
|
|
132
|
+
.replace("{file.type}", file.type);
|
|
133
|
+
if (path) {
|
|
134
|
+
result = result.replace("{path}", path);
|
|
135
|
+
}
|
|
82
136
|
if (ext) {
|
|
83
137
|
result = result.replace("{file.ext}", ext);
|
|
84
138
|
const name = file.name.replace(`.${ext}`, "");
|
package/src/util/strings.ts
CHANGED
|
@@ -56,8 +56,8 @@ export function unslugify(slug?: string): string {
|
|
|
56
56
|
const result = slug.replace(/[-_]/g, " ");
|
|
57
57
|
return result.replace(/\w\S*/g, function (txt) {
|
|
58
58
|
return txt.charAt(0).toUpperCase() + txt.substr(1);
|
|
59
|
-
});
|
|
59
|
+
}).trim();
|
|
60
60
|
} else {
|
|
61
|
-
return slug;
|
|
61
|
+
return slug.trim();
|
|
62
62
|
}
|
|
63
63
|
}
|
|
@@ -46,7 +46,7 @@ export function useStorageUploadController<M extends object>({
|
|
|
46
46
|
entityId: string,
|
|
47
47
|
entityValues: EntityValues<M>,
|
|
48
48
|
value: string | string[] | null;
|
|
49
|
-
path
|
|
49
|
+
path?: string,
|
|
50
50
|
propertyKey: string,
|
|
51
51
|
property: ResolvedStringProperty | ResolvedArrayProperty<string[]>,
|
|
52
52
|
storageSource: StorageSource,
|
|
@@ -95,7 +95,16 @@ export function useStorageUploadController<M extends object>({
|
|
|
95
95
|
|
|
96
96
|
const fileNameBuilder = useCallback(async (file: File) => {
|
|
97
97
|
if (storage.fileName) {
|
|
98
|
-
const fileName = await resolveFilenameString(
|
|
98
|
+
const fileName = await resolveFilenameString({
|
|
99
|
+
input: storage.fileName,
|
|
100
|
+
storage,
|
|
101
|
+
values: entityValues,
|
|
102
|
+
entityId,
|
|
103
|
+
path,
|
|
104
|
+
property,
|
|
105
|
+
file,
|
|
106
|
+
propertyKey
|
|
107
|
+
});
|
|
99
108
|
if (!fileName || fileName.length === 0) {
|
|
100
109
|
throw Error("You need to return a valid filename");
|
|
101
110
|
}
|
|
@@ -105,7 +114,16 @@ export function useStorageUploadController<M extends object>({
|
|
|
105
114
|
}, [entityId, entityValues, path, property, propertyKey, storage]);
|
|
106
115
|
|
|
107
116
|
const storagePathBuilder = useCallback((file: File) => {
|
|
108
|
-
return resolveStoragePathString(
|
|
117
|
+
return resolveStoragePathString({
|
|
118
|
+
input: storage.storagePath,
|
|
119
|
+
storage,
|
|
120
|
+
values: entityValues,
|
|
121
|
+
entityId,
|
|
122
|
+
path,
|
|
123
|
+
property,
|
|
124
|
+
file,
|
|
125
|
+
propertyKey
|
|
126
|
+
}) ?? "/";
|
|
109
127
|
}, [entityId, entityValues, path, property, propertyKey, storage]);
|
|
110
128
|
|
|
111
129
|
const onFileUploadComplete = useCallback(async (uploadedPath: string,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useEffect, useRef } from "react";
|
|
2
2
|
|
|
3
|
-
function printChanged(props: any, prev: any, path = "", depth = 0, maxDepth: number) {
|
|
3
|
+
export function printChanged(props: any, prev: any, path: string | undefined = "", depth: number | undefined = 0, maxDepth: number | undefined = 10) {
|
|
4
4
|
if (depth > maxDepth) {
|
|
5
5
|
return;
|
|
6
6
|
}
|
|
@@ -17,6 +17,7 @@ function printChanged(props: any, prev: any, path = "", depth = 0, maxDepth: num
|
|
|
17
17
|
export function useTraceUpdate(props: any, maxDepth = 3) {
|
|
18
18
|
const prev = useRef(props);
|
|
19
19
|
useEffect(() => {
|
|
20
|
+
console.log("Changed props:");
|
|
20
21
|
printChanged(props, prev.current, "", 0, maxDepth);
|
|
21
22
|
prev.current = props;
|
|
22
23
|
});
|
package/dist/core/Drawer.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
/**
|
|
3
|
-
* Props used in case you need to override the default drawer
|
|
4
|
-
* @group Core
|
|
5
|
-
*/
|
|
6
|
-
export type DrawerProps<T = {}> = T & {
|
|
7
|
-
hovered: boolean;
|
|
8
|
-
drawerOpen: boolean;
|
|
9
|
-
closeDrawer: () => any;
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* Default drawer used in the CMS
|
|
13
|
-
* @group Core
|
|
14
|
-
*/
|
|
15
|
-
export declare function Drawer({ hovered, drawerOpen, closeDrawer }: DrawerProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
export declare function DrawerNavigationItem({ name, icon, drawerOpen, tooltipsOpen, url, onClick }: {
|
|
17
|
-
icon: React.ReactElement;
|
|
18
|
-
name: string;
|
|
19
|
-
tooltipsOpen: boolean;
|
|
20
|
-
drawerOpen: boolean;
|
|
21
|
-
url: string;
|
|
22
|
-
onClick?: () => void;
|
|
23
|
-
}): import("react/jsx-runtime").JSX.Element;
|
package/dist/core/Scaffold.d.ts
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { DrawerProps } from "./Drawer";
|
|
3
|
-
import { FireCMSAppBarProps } from "../components";
|
|
4
|
-
export declare const DRAWER_WIDTH = 280;
|
|
5
|
-
/**
|
|
6
|
-
* @group Core
|
|
7
|
-
*/
|
|
8
|
-
export interface ScaffoldProps<ExtraDrawerProps = object, ExtraAppbarProps = object> {
|
|
9
|
-
/**
|
|
10
|
-
* Name of the app, displayed as the main title and in the tab title
|
|
11
|
-
*/
|
|
12
|
-
name: string;
|
|
13
|
-
/**
|
|
14
|
-
* Logo to be displayed in the drawer of the CMS
|
|
15
|
-
*/
|
|
16
|
-
logo?: string;
|
|
17
|
-
/**
|
|
18
|
-
* Whether to include the drawer in the scaffold
|
|
19
|
-
*/
|
|
20
|
-
includeDrawer?: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* In case you need to override the view that gets rendered as a drawer
|
|
23
|
-
* @see DefaultDrawer
|
|
24
|
-
*/
|
|
25
|
-
Drawer?: React.ComponentType<DrawerProps<ExtraDrawerProps>>;
|
|
26
|
-
/**
|
|
27
|
-
* Additional props passed to the custom Drawer
|
|
28
|
-
*/
|
|
29
|
-
drawerProps?: Partial<DrawerProps> & ExtraDrawerProps;
|
|
30
|
-
/**
|
|
31
|
-
* Open the drawer on hover
|
|
32
|
-
*/
|
|
33
|
-
autoOpenDrawer?: boolean;
|
|
34
|
-
/**
|
|
35
|
-
* A component that gets rendered on the upper side of the main toolbar.
|
|
36
|
-
* `toolbarExtraWidget` has no effect if this is set.
|
|
37
|
-
*/
|
|
38
|
-
FireCMSAppBar?: React.ComponentType<FireCMSAppBarProps<ExtraAppbarProps>>;
|
|
39
|
-
/**
|
|
40
|
-
* Additional props passed to the custom AppBar
|
|
41
|
-
*/
|
|
42
|
-
fireCMSAppBarProps?: Partial<FireCMSAppBarProps> & ExtraAppbarProps;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* This view acts as a scaffold for FireCMS.
|
|
46
|
-
*
|
|
47
|
-
* It is in charge of displaying the navigation drawer, top bar and main
|
|
48
|
-
* collection views.
|
|
49
|
-
* This component needs a parent {@link FireCMS}
|
|
50
|
-
*
|
|
51
|
-
* @param props
|
|
52
|
-
* @constructor
|
|
53
|
-
* @group Core
|
|
54
|
-
*/
|
|
55
|
-
export declare const Scaffold: React.NamedExoticComponent<React.PropsWithChildren<ScaffoldProps<object, object>>>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { User } from "../types";
|
|
2
|
-
import { EntityEditViewProps } from "./EntityEditView";
|
|
3
|
-
export type SideEntityViewProps<M extends Record<string, any>> = EntityEditViewProps<M> & {
|
|
4
|
-
formWidth?: number | string;
|
|
5
|
-
onClose?: () => void;
|
|
6
|
-
};
|
|
7
|
-
export declare function SideEntityView<M extends Record<string, any>, UserType extends User>({ path, entityId, selectedSubPath, copy, collection, parentCollectionIds, onValuesAreModified, formWidth, onUpdate, onClose }: SideEntityViewProps<M>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { Entity, EntityCollection, EntityStatus, EntityValues, FormContext, ResolvedEntityCollection } from "../types";
|
|
2
|
-
import { ValidationError } from "yup";
|
|
3
|
-
/**
|
|
4
|
-
* @group Components
|
|
5
|
-
*/
|
|
6
|
-
export interface EntityFormProps<M extends Record<string, any>> {
|
|
7
|
-
/**
|
|
8
|
-
* New or existing status
|
|
9
|
-
*/
|
|
10
|
-
status: EntityStatus;
|
|
11
|
-
/**
|
|
12
|
-
* Path of the collection this entity is located
|
|
13
|
-
*/
|
|
14
|
-
path: string;
|
|
15
|
-
/**
|
|
16
|
-
* The collection is used to build the fields of the form
|
|
17
|
-
*/
|
|
18
|
-
collection: EntityCollection<M>;
|
|
19
|
-
/**
|
|
20
|
-
* The updated entity is passed from the parent component when the underlying data
|
|
21
|
-
* has changed in the datasource
|
|
22
|
-
*/
|
|
23
|
-
entity?: Entity<M>;
|
|
24
|
-
/**
|
|
25
|
-
* The callback function called when Save is clicked and validation is correct
|
|
26
|
-
*/
|
|
27
|
-
onEntitySaveRequested: (props: EntityFormSaveParams<M>) => Promise<void>;
|
|
28
|
-
/**
|
|
29
|
-
* The callback function called when discard is clicked
|
|
30
|
-
*/
|
|
31
|
-
onDiscard?: () => void;
|
|
32
|
-
/**
|
|
33
|
-
* The callback function when the form is dirty, so the values are different
|
|
34
|
-
* from the original ones
|
|
35
|
-
*/
|
|
36
|
-
onModified?: (dirty: boolean) => void;
|
|
37
|
-
/**
|
|
38
|
-
* The callback function when the form original values have been modified
|
|
39
|
-
*/
|
|
40
|
-
onValuesChanged?: (values?: EntityValues<M>) => void;
|
|
41
|
-
/**
|
|
42
|
-
*
|
|
43
|
-
* @param id
|
|
44
|
-
*/
|
|
45
|
-
onIdChange?: (id: string) => void;
|
|
46
|
-
currentEntityId?: string;
|
|
47
|
-
onFormContextChange?: (formContext: FormContext<M>) => void;
|
|
48
|
-
hideId?: boolean;
|
|
49
|
-
autoSave?: boolean;
|
|
50
|
-
onIdUpdateError?: (error: any) => void;
|
|
51
|
-
}
|
|
52
|
-
export type EntityFormSaveParams<M extends Record<string, any>> = {
|
|
53
|
-
collection: ResolvedEntityCollection<M>;
|
|
54
|
-
path: string;
|
|
55
|
-
entityId: string | undefined;
|
|
56
|
-
values: EntityValues<M>;
|
|
57
|
-
previousValues?: EntityValues<M>;
|
|
58
|
-
closeAfterSave: boolean;
|
|
59
|
-
autoSave: boolean;
|
|
60
|
-
};
|
|
61
|
-
/**
|
|
62
|
-
* This is the form used internally by the CMS
|
|
63
|
-
* @param status
|
|
64
|
-
* @param path
|
|
65
|
-
* @param collection
|
|
66
|
-
* @param entity
|
|
67
|
-
* @param onEntitySave
|
|
68
|
-
* @param onDiscard
|
|
69
|
-
* @param onModified
|
|
70
|
-
* @param onValuesChanged
|
|
71
|
-
* @constructor
|
|
72
|
-
* @group Components
|
|
73
|
-
*/
|
|
74
|
-
export declare const EntityForm: typeof EntityFormInternal;
|
|
75
|
-
declare function EntityFormInternal<M extends Record<string, any>>({ status, path, collection: inputCollection, entity, onEntitySaveRequested, onDiscard, onModified, onValuesChanged, onIdChange, onFormContextChange, hideId, autoSave, onIdUpdateError, }: EntityFormProps<M>): import("react/jsx-runtime").JSX.Element;
|
|
76
|
-
export declare function yupToFormErrors(yupError: ValidationError): Record<string, any>;
|
|
77
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function useLocaleConfig(locale?: string): void;
|
package/dist/types/appcheck.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { FirebaseApp } from "firebase/app";
|
|
2
|
-
/**
|
|
3
|
-
* @group Firebase
|
|
4
|
-
*/
|
|
5
|
-
export interface AppCheck {
|
|
6
|
-
firebaseApp?: FirebaseApp;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* @group Firebase
|
|
10
|
-
*/
|
|
11
|
-
export interface AppCheckOptions {
|
|
12
|
-
providerKey: string;
|
|
13
|
-
useEnterpriseRecaptcha: boolean;
|
|
14
|
-
isTokenAutoRefreshEnabled?: boolean;
|
|
15
|
-
debugToken?: string;
|
|
16
|
-
forceRefresh?: boolean;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* @group Firebase
|
|
20
|
-
*/
|
|
21
|
-
export declare interface AppCheckTokenResult {
|
|
22
|
-
/**
|
|
23
|
-
* The token string in JWT format.
|
|
24
|
-
*/
|
|
25
|
-
readonly token: string;
|
|
26
|
-
}
|