@firecms/collection_editor 3.0.0-alpha.10
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/LICENSE +21 -0
- package/README.md +1 -0
- package/dist/ConfigControllerProvider.d.ts +36 -0
- package/dist/components/EditorCollectionAction.d.ts +2 -0
- package/dist/components/HomePageEditorCollectionAction.d.ts +2 -0
- package/dist/components/NewCollectionCard.d.ts +2 -0
- package/dist/components/collection_editor/CollectionDetailsForm.d.ts +9 -0
- package/dist/components/collection_editor/CollectionEditorDialog.d.ts +33 -0
- package/dist/components/collection_editor/CollectionEditorWelcomeView.d.ts +15 -0
- package/dist/components/collection_editor/CollectionPropertiesEditorForm.d.ts +17 -0
- package/dist/components/collection_editor/CollectionYupValidation.d.ts +11 -0
- package/dist/components/collection_editor/EnumForm.d.ts +13 -0
- package/dist/components/collection_editor/PropertyEditView.d.ts +38 -0
- package/dist/components/collection_editor/PropertyFieldPreview.d.ts +14 -0
- package/dist/components/collection_editor/PropertySelectItem.d.ts +8 -0
- package/dist/components/collection_editor/PropertyTree.d.ts +29 -0
- package/dist/components/collection_editor/SelectIcons.d.ts +6 -0
- package/dist/components/collection_editor/SubcollectionsEditTab.d.ts +12 -0
- package/dist/components/collection_editor/UnsavedChangesDialog.d.ts +9 -0
- package/dist/components/collection_editor/import/CollectionEditorImportDataPreview.d.ts +7 -0
- package/dist/components/collection_editor/import/CollectionEditorImportMapping.d.ts +4 -0
- package/dist/components/collection_editor/import/clean_import_data.d.ts +7 -0
- package/dist/components/collection_editor/properties/BlockPropertyField.d.ts +5 -0
- package/dist/components/collection_editor/properties/BooleanPropertyField.d.ts +3 -0
- package/dist/components/collection_editor/properties/CommonPropertyFields.d.ts +10 -0
- package/dist/components/collection_editor/properties/DateTimePropertyField.d.ts +3 -0
- package/dist/components/collection_editor/properties/EnumPropertyField.d.ts +8 -0
- package/dist/components/collection_editor/properties/FieldHelperView.d.ts +4 -0
- package/dist/components/collection_editor/properties/KeyValuePropertyField.d.ts +3 -0
- package/dist/components/collection_editor/properties/MapPropertyField.d.ts +5 -0
- package/dist/components/collection_editor/properties/NumberPropertyField.d.ts +3 -0
- package/dist/components/collection_editor/properties/ReferencePropertyField.d.ts +13 -0
- package/dist/components/collection_editor/properties/RepeatPropertyField.d.ts +7 -0
- package/dist/components/collection_editor/properties/StoragePropertyField.d.ts +5 -0
- package/dist/components/collection_editor/properties/StringPropertyField.d.ts +5 -0
- package/dist/components/collection_editor/properties/advanced/AdvancedPropertyValidation.d.ts +3 -0
- package/dist/components/collection_editor/properties/validation/ArrayPropertyValidation.d.ts +5 -0
- package/dist/components/collection_editor/properties/validation/GeneralPropertyValidation.d.ts +4 -0
- package/dist/components/collection_editor/properties/validation/NumberPropertyValidation.d.ts +3 -0
- package/dist/components/collection_editor/properties/validation/StringPropertyValidation.d.ts +11 -0
- package/dist/components/collection_editor/properties/validation/ValidationPanel.d.ts +2 -0
- package/dist/components/collection_editor/templates/blog_template.d.ts +10 -0
- package/dist/components/collection_editor/templates/products_template.d.ts +12 -0
- package/dist/components/collection_editor/templates/users_template.d.ts +7 -0
- package/dist/components/collection_editor/util.d.ts +4 -0
- package/dist/components/collection_editor/utils/supported_fields.d.ts +3 -0
- package/dist/components/collection_editor/utils/update_property_for_widget.d.ts +3 -0
- package/dist/components/collection_editor/utils/useTraceUpdate.d.ts +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.es.js +6211 -0
- package/dist/index.es.js.map +1 -0
- package/dist/index.umd.js +2 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/types/collection_editor_controller.d.ts +20 -0
- package/dist/types/collection_inference.d.ts +2 -0
- package/dist/types/config_controller.d.ts +24 -0
- package/dist/types/config_permissions.d.ts +19 -0
- package/dist/types/editable_properties.d.ts +10 -0
- package/dist/types/persisted_collection.d.ts +4 -0
- package/dist/useCollectionEditorController.d.ts +6 -0
- package/dist/useCollectionEditorPlugin.d.ts +44 -0
- package/dist/useCollectionsConfigController.d.ts +6 -0
- package/dist/utils/arrays.d.ts +1 -0
- package/dist/utils/entities.d.ts +4 -0
- package/dist/utils/icons.d.ts +2 -0
- package/dist/utils/synonyms.d.ts +1951 -0
- package/package.json +73 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 FireCMS
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
## Collection editor plugin
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CollectionsConfigController } from "./types/config_controller";
|
|
3
|
+
import { User } from "@firecms/core";
|
|
4
|
+
import { CollectionEditorController } from "./types/collection_editor_controller";
|
|
5
|
+
import { CollectionEditorPermissionsBuilder } from "./types/config_permissions";
|
|
6
|
+
import { CollectionInference } from "./types/collection_inference";
|
|
7
|
+
export declare const ConfigControllerContext: React.Context<CollectionsConfigController>;
|
|
8
|
+
export declare const CollectionEditorContext: React.Context<CollectionEditorController>;
|
|
9
|
+
export interface ConfigControllerProviderProps {
|
|
10
|
+
/**
|
|
11
|
+
* Controller for managing the collections' config.
|
|
12
|
+
*/
|
|
13
|
+
collectionConfigController: CollectionsConfigController;
|
|
14
|
+
/**
|
|
15
|
+
* Callback used to infer the schema from the data.
|
|
16
|
+
*/
|
|
17
|
+
collectionInference?: CollectionInference;
|
|
18
|
+
/**
|
|
19
|
+
* Use this builder to define the permissions for the configuration per user.
|
|
20
|
+
*/
|
|
21
|
+
configPermissions?: CollectionEditorPermissionsBuilder;
|
|
22
|
+
/**
|
|
23
|
+
* Groups that cannot be used to create new collections.
|
|
24
|
+
*/
|
|
25
|
+
reservedGroups?: string[];
|
|
26
|
+
extraView?: {
|
|
27
|
+
View: React.ComponentType<{
|
|
28
|
+
path: string;
|
|
29
|
+
}>;
|
|
30
|
+
icon: React.ReactNode;
|
|
31
|
+
};
|
|
32
|
+
pathSuggestions?: (path: string) => Promise<string[]>;
|
|
33
|
+
getUser: (uid: string) => User | null;
|
|
34
|
+
getData?: (path: string) => Promise<object[]>;
|
|
35
|
+
}
|
|
36
|
+
export declare const ConfigControllerProvider: React.NamedExoticComponent<React.PropsWithChildren<ConfigControllerProviderProps>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { EntityCollection } from "@firecms/core";
|
|
2
|
+
export declare function CollectionDetailsForm({ isNewCollection, reservedGroups, existingPaths, existingAliases, groups, parentCollection }: {
|
|
3
|
+
isNewCollection: boolean;
|
|
4
|
+
reservedGroups?: string[];
|
|
5
|
+
existingPaths?: string[];
|
|
6
|
+
existingAliases?: string[];
|
|
7
|
+
groups: string[] | null;
|
|
8
|
+
parentCollection?: EntityCollection;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { CMSType, EntityCollection, User } from "@firecms/core";
|
|
3
|
+
import { CollectionsConfigController } from "../../types/config_controller";
|
|
4
|
+
import { CollectionInference } from "../../types/collection_inference";
|
|
5
|
+
export interface CollectionEditorDialogProps {
|
|
6
|
+
open: boolean;
|
|
7
|
+
isNewCollection: boolean;
|
|
8
|
+
group?: string;
|
|
9
|
+
editedCollectionPath?: string;
|
|
10
|
+
fullPath?: string;
|
|
11
|
+
parentPathSegments?: string[];
|
|
12
|
+
handleClose: (collection?: EntityCollection) => void;
|
|
13
|
+
configController: CollectionsConfigController;
|
|
14
|
+
reservedGroups?: string[];
|
|
15
|
+
collectionInference?: CollectionInference;
|
|
16
|
+
extraView?: {
|
|
17
|
+
View: React.ComponentType<{
|
|
18
|
+
path: string;
|
|
19
|
+
}>;
|
|
20
|
+
icon: React.ReactNode;
|
|
21
|
+
};
|
|
22
|
+
pathSuggestions?: (path: string) => Promise<string[]>;
|
|
23
|
+
getUser: (uid: string) => User | null;
|
|
24
|
+
getData?: (path: string) => Promise<object[]>;
|
|
25
|
+
parentCollection?: EntityCollection;
|
|
26
|
+
}
|
|
27
|
+
export declare function CollectionEditorDialog(props: CollectionEditorDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export declare function CollectionEditorDialogInternal<M extends {
|
|
29
|
+
[Key: string]: CMSType;
|
|
30
|
+
}>({ isNewCollection, group, configController, editedCollectionPath, parentPathSegments, fullPath, collectionInference, handleClose, reservedGroups, extraView, handleCancel, setFormDirty, pathSuggestions, getUser, parentCollection, getData }: CollectionEditorDialogProps & {
|
|
31
|
+
handleCancel: () => void;
|
|
32
|
+
setFormDirty: (dirty: boolean) => void;
|
|
33
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { EntityCollection } from "@firecms/core";
|
|
3
|
+
export declare function CollectionEditorWelcomeView({ path, pathSuggestions, parentCollection, onContinue, collections }: {
|
|
4
|
+
path: string;
|
|
5
|
+
pathSuggestions?: (path: string) => Promise<string[]>;
|
|
6
|
+
parentCollection?: EntityCollection;
|
|
7
|
+
onContinue: (importData?: object[]) => void;
|
|
8
|
+
collections?: EntityCollection[];
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function TemplateButton({ title, subtitle, icon, onClick }: {
|
|
11
|
+
title: string;
|
|
12
|
+
icon: React.ReactNode;
|
|
13
|
+
subtitle: string;
|
|
14
|
+
onClick?: () => void;
|
|
15
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { FormikErrors } from "formik";
|
|
3
|
+
import { EntityCollection, User } from "@firecms/core";
|
|
4
|
+
type CollectionEditorFormProps = {
|
|
5
|
+
showErrors: boolean;
|
|
6
|
+
isNewCollection: boolean;
|
|
7
|
+
propertyErrorsRef?: React.MutableRefObject<any>;
|
|
8
|
+
onPropertyError: (propertyKey: string, namespace: string | undefined, error?: FormikErrors<any>) => void;
|
|
9
|
+
setDirty?: (dirty: boolean) => void;
|
|
10
|
+
reservedGroups?: string[];
|
|
11
|
+
extraIcon: React.ReactNode;
|
|
12
|
+
getUser: (uid: string) => User | null;
|
|
13
|
+
getData?: () => Promise<object[]>;
|
|
14
|
+
doCollectionInference: (collection: EntityCollection<any, string>) => Promise<EntityCollection | null> | undefined;
|
|
15
|
+
};
|
|
16
|
+
export declare function CollectionPropertiesEditorForm({ showErrors, isNewCollection, propertyErrorsRef, onPropertyError, setDirty, reservedGroups, extraIcon, getUser, getData, doCollectionInference }: CollectionEditorFormProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as Yup from "yup";
|
|
2
|
+
export declare const YupSchema: Yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
3
|
+
name: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
4
|
+
path: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
5
|
+
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
6
|
+
name: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
7
|
+
path: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
8
|
+
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
9
|
+
name: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
10
|
+
path: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
11
|
+
}>>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { EnumValueConfig } from "@firecms/core";
|
|
3
|
+
type EnumFormProps = {
|
|
4
|
+
enumValues: EnumValueConfig[];
|
|
5
|
+
onValuesChanged?: (enumValues: EnumValueConfig[]) => void;
|
|
6
|
+
onError?: (error: boolean) => void;
|
|
7
|
+
updateIds: boolean;
|
|
8
|
+
disabled: boolean;
|
|
9
|
+
allowDataInference?: boolean;
|
|
10
|
+
getData?: () => Promise<string[]>;
|
|
11
|
+
};
|
|
12
|
+
export declare const EnumForm: React.NamedExoticComponent<EnumFormProps>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { FormikErrors, FormikProps } from "formik";
|
|
3
|
+
import { EditableProperty } from "../../types/editable_properties";
|
|
4
|
+
export type PropertyWithId = EditableProperty & {
|
|
5
|
+
id?: string;
|
|
6
|
+
};
|
|
7
|
+
export type OnPropertyChangedParams = {
|
|
8
|
+
id?: string;
|
|
9
|
+
property: EditableProperty;
|
|
10
|
+
namespace?: string;
|
|
11
|
+
previousId?: string;
|
|
12
|
+
};
|
|
13
|
+
export type PropertyFormProps = {
|
|
14
|
+
includeIdAndName?: boolean;
|
|
15
|
+
existing: boolean;
|
|
16
|
+
autoUpdateId?: boolean;
|
|
17
|
+
autoOpenTypeSelect: boolean;
|
|
18
|
+
inArray: boolean;
|
|
19
|
+
propertyKey?: string;
|
|
20
|
+
propertyNamespace?: string;
|
|
21
|
+
property?: EditableProperty;
|
|
22
|
+
onPropertyChanged?: (params: OnPropertyChangedParams) => void;
|
|
23
|
+
onPropertyChangedImmediate?: boolean;
|
|
24
|
+
onDelete?: (id?: string, namespace?: string) => void;
|
|
25
|
+
onError?: (id: string, namespace?: string, error?: FormikErrors<any>) => void;
|
|
26
|
+
initialErrors?: FormikErrors<any>;
|
|
27
|
+
forceShowErrors?: boolean;
|
|
28
|
+
existingPropertyKeys?: string[];
|
|
29
|
+
allowDataInference: boolean;
|
|
30
|
+
getData?: () => Promise<object[]>;
|
|
31
|
+
getHelpers?: (formikProps: FormikProps<PropertyWithId>) => void;
|
|
32
|
+
};
|
|
33
|
+
export declare const PropertyForm: React.NamedExoticComponent<PropertyFormProps>;
|
|
34
|
+
export declare function PropertyFormDialog({ open, onCancel, onOkClicked, onPropertyChanged, getData, ...formProps }: PropertyFormProps & {
|
|
35
|
+
open?: boolean;
|
|
36
|
+
onOkClicked?: () => void;
|
|
37
|
+
onCancel?: () => void;
|
|
38
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { EditableProperty } from "../../types/editable_properties";
|
|
2
|
+
export declare function PropertyFieldPreview({ property, onClick, hasError, includeName, includeEditButton, selected }: {
|
|
3
|
+
property: EditableProperty;
|
|
4
|
+
hasError?: boolean;
|
|
5
|
+
selected?: boolean;
|
|
6
|
+
includeName?: boolean;
|
|
7
|
+
includeEditButton?: boolean;
|
|
8
|
+
onClick?: () => void;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function PropertyBuilderPreview({ name, selected, onClick }: {
|
|
11
|
+
name: string;
|
|
12
|
+
selected: boolean;
|
|
13
|
+
onClick?: () => void;
|
|
14
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FieldConfig } from "@firecms/core";
|
|
2
|
+
export interface PropertySelectItemProps {
|
|
3
|
+
value: string;
|
|
4
|
+
optionDisabled: boolean;
|
|
5
|
+
widget: FieldConfig;
|
|
6
|
+
existing: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function PropertySelectItem({ value, optionDisabled, widget, existing }: PropertySelectItemProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { CMSType, PropertiesOrBuilders } from "@firecms/core";
|
|
2
|
+
import { DraggableProvided } from "@hello-pangea/dnd";
|
|
3
|
+
import { EditablePropertyOrBuilder } from "../../types/editable_properties";
|
|
4
|
+
export declare function PropertyTree<M extends {
|
|
5
|
+
[Key: string]: CMSType;
|
|
6
|
+
}>({ namespace, selectedPropertyKey, onPropertyClick, properties, propertiesOrder: propertiesOrderProp, errors, onPropertyMove, onPropertyRemove, className, inferredPropertyKeys }: {
|
|
7
|
+
namespace?: string;
|
|
8
|
+
selectedPropertyKey?: string;
|
|
9
|
+
onPropertyClick?: (propertyKey: string, namespace?: string) => void;
|
|
10
|
+
properties: PropertiesOrBuilders<M>;
|
|
11
|
+
propertiesOrder?: string[];
|
|
12
|
+
errors: Record<string, any>;
|
|
13
|
+
onPropertyMove?: (propertiesOrder: string[], namespace?: string) => void;
|
|
14
|
+
onPropertyRemove?: (propertyKey: string, namespace?: string) => void;
|
|
15
|
+
className?: string;
|
|
16
|
+
inferredPropertyKeys?: string[];
|
|
17
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare function PropertyTreeEntry({ propertyKey, namespace, propertyOrBuilder, provided, selectedPropertyKey, errors, onPropertyClick, onPropertyMove, onPropertyRemove, inferredPropertyKeys }: {
|
|
19
|
+
propertyKey: string;
|
|
20
|
+
namespace?: string;
|
|
21
|
+
propertyOrBuilder: EditablePropertyOrBuilder;
|
|
22
|
+
selectedPropertyKey?: string;
|
|
23
|
+
provided: DraggableProvided;
|
|
24
|
+
errors: Record<string, any>;
|
|
25
|
+
onPropertyClick?: (propertyKey: string, namespace?: string) => void;
|
|
26
|
+
onPropertyMove?: (propertiesOrder: string[], namespace?: string) => void;
|
|
27
|
+
onPropertyRemove?: (propertyKey: string, namespace?: string) => void;
|
|
28
|
+
inferredPropertyKeys?: string[];
|
|
29
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { EntityCollection, User } from "@firecms/core";
|
|
2
|
+
import { CollectionsConfigController } from "../../types/config_controller";
|
|
3
|
+
import { PersistedCollection } from "../../types/persisted_collection";
|
|
4
|
+
import { CollectionInference } from "../../types/collection_inference";
|
|
5
|
+
export declare function SubcollectionsEditTab({ collection, parentCollection, configController, collectionInference, getUser, parentPathSegments }: {
|
|
6
|
+
collection: PersistedCollection;
|
|
7
|
+
parentCollection?: EntityCollection;
|
|
8
|
+
configController: CollectionsConfigController;
|
|
9
|
+
collectionInference?: CollectionInference;
|
|
10
|
+
getUser: (uid: string) => User | null;
|
|
11
|
+
parentPathSegments?: string[];
|
|
12
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface UnsavedChangesDialogProps {
|
|
3
|
+
open: boolean;
|
|
4
|
+
body?: React.ReactNode;
|
|
5
|
+
title?: string;
|
|
6
|
+
handleOk: () => void;
|
|
7
|
+
handleCancel: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function UnsavedChangesDialog({ open, handleOk, handleCancel, body, title }: UnsavedChangesDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ImportConfig } from "@firecms/data_import";
|
|
2
|
+
import { Properties } from "@firecms/core";
|
|
3
|
+
export declare function CollectionEditorImportDataPreview({ importConfig, properties, propertiesOrder }: {
|
|
4
|
+
importConfig: ImportConfig;
|
|
5
|
+
properties: Properties;
|
|
6
|
+
propertiesOrder: string[];
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Properties } from "@firecms/core";
|
|
2
|
+
import { ImportConfig } from "@firecms/data_import";
|
|
3
|
+
export declare function cleanPropertiesFromImport(properties: Properties, parentSlug?: string): {
|
|
4
|
+
headersMapping: ImportConfig["headersMapping"];
|
|
5
|
+
properties: Properties;
|
|
6
|
+
idColumn?: ImportConfig["idColumn"];
|
|
7
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type CommonPropertyFieldsProps = {
|
|
3
|
+
showErrors: boolean;
|
|
4
|
+
disabledId: boolean;
|
|
5
|
+
existingPropertyKeys?: string[];
|
|
6
|
+
disabled: boolean;
|
|
7
|
+
isNewProperty: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const CommonPropertyFields: React.ForwardRefExoticComponent<CommonPropertyFieldsProps & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function EnumPropertyField({ multiselect, updateIds, disabled, showErrors, allowDataInference, getData }: {
|
|
2
|
+
multiselect: boolean;
|
|
3
|
+
updateIds: boolean;
|
|
4
|
+
disabled: boolean;
|
|
5
|
+
showErrors: boolean;
|
|
6
|
+
allowDataInference?: boolean;
|
|
7
|
+
getData?: () => Promise<object[]>;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare function ReferencePropertyField({ existing, multiple, disabled, showErrors }: {
|
|
2
|
+
existing: boolean;
|
|
3
|
+
multiple: boolean;
|
|
4
|
+
disabled: boolean;
|
|
5
|
+
showErrors: boolean;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function CollectionsSelect({ disabled, pathPath, value, handleChange, error, ...props }: {
|
|
8
|
+
disabled: boolean;
|
|
9
|
+
pathPath: string;
|
|
10
|
+
value?: string;
|
|
11
|
+
handleChange: (event: any) => void;
|
|
12
|
+
error?: string;
|
|
13
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function RepeatPropertyField({ showErrors, existing, disabled, getData, allowDataInference }: {
|
|
2
|
+
showErrors: boolean;
|
|
3
|
+
existing: boolean;
|
|
4
|
+
disabled: boolean;
|
|
5
|
+
getData?: () => Promise<object[]>;
|
|
6
|
+
allowDataInference: boolean;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare function StringPropertyValidation({ length, lowercase, matches, max, min, trim, uppercase, disabled, showErrors }: {
|
|
2
|
+
length?: boolean;
|
|
3
|
+
min?: boolean;
|
|
4
|
+
max?: boolean;
|
|
5
|
+
trim?: boolean;
|
|
6
|
+
matches?: boolean;
|
|
7
|
+
lowercase?: boolean;
|
|
8
|
+
uppercase?: boolean;
|
|
9
|
+
disabled: boolean;
|
|
10
|
+
showErrors: boolean;
|
|
11
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const blogCollectionTemplate: import("@firecms/core").EntityCollection<{
|
|
2
|
+
name: string;
|
|
3
|
+
header_image: string;
|
|
4
|
+
content: any[];
|
|
5
|
+
created_on: unknown;
|
|
6
|
+
status: unknown;
|
|
7
|
+
publish_date: unknown;
|
|
8
|
+
reviewed: unknown;
|
|
9
|
+
tags: unknown;
|
|
10
|
+
}, string, import("@firecms/core").User>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const productsCollectionTemplate: import("@firecms/core").EntityCollection<{
|
|
2
|
+
name: unknown;
|
|
3
|
+
brand: unknown;
|
|
4
|
+
description: unknown;
|
|
5
|
+
main_image: unknown;
|
|
6
|
+
available: unknown;
|
|
7
|
+
price: unknown;
|
|
8
|
+
images: unknown;
|
|
9
|
+
related_products: unknown;
|
|
10
|
+
metadata: unknown;
|
|
11
|
+
added_on: unknown;
|
|
12
|
+
}, string, import("@firecms/core").User>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function idToPropertiesPath(id: string): string;
|
|
2
|
+
export declare function namespaceToPropertiesPath(namespace?: string): string;
|
|
3
|
+
export declare function namespaceToPropertiesOrderPath(namespace?: string): string;
|
|
4
|
+
export declare function getFullId(propertyKey: string, propertyNamespace?: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useTraceUpdate(props: any): void;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { useCollectionEditorPlugin } from "./useCollectionEditorPlugin";
|
|
2
|
+
export { useCollectionEditorController } from "./useCollectionEditorController";
|
|
3
|
+
export { useCollectionsConfigController } from "./useCollectionsConfigController";
|
|
4
|
+
export { editableProperty, removeNonEditableProperties } from "./utils/entities";
|
|
5
|
+
export type { CollectionsConfigController, DeleteCollectionParams, SaveCollectionParams } from "./types/config_controller";
|
|
6
|
+
export type { CollectionEditorController } from "./types/collection_editor_controller";
|
|
7
|
+
export type { CollectionEditorPermissions, CollectionEditorPermissionsBuilder } from "./types/config_permissions";
|
|
8
|
+
export type { PersistedCollection } from "./types/persisted_collection";
|
|
9
|
+
export type { CollectionInference } from "./types/collection_inference";
|
|
10
|
+
export type { EditablePropertiesOrBuilders } from "./types/editable_properties";
|