@firecms/core 3.0.0-canary.186 → 3.0.0-canary.187
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/core/EntityEditView.d.ts +4 -15
- package/dist/core/EntityForm.d.ts +43 -0
- package/dist/form/components/FormEntry.d.ts +6 -0
- package/dist/form/components/FormLayout.d.ts +5 -0
- package/dist/form/components/index.d.ts +2 -0
- package/dist/form/field_bindings/ArrayCustomShapedFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/MapFieldBinding.d.ts +1 -1
- package/dist/index.es.js +11960 -11691
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +11938 -11669
- package/dist/index.umd.js.map +1 -1
- package/dist/types/fields.d.ts +11 -0
- package/dist/types/navigation.d.ts +1 -0
- package/dist/types/plugins.d.ts +1 -1
- package/dist/types/properties.d.ts +1 -1
- package/package.json +5 -5
- package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +4 -2
- package/src/core/EntityEditView.tsx +210 -1049
- package/src/core/EntityForm.tsx +952 -0
- package/src/core/NavigationRoutes.tsx +16 -12
- package/src/form/components/FormEntry.tsx +22 -0
- package/src/form/components/FormLayout.tsx +16 -0
- package/src/form/components/index.tsx +2 -0
- package/src/form/field_bindings/ArrayCustomShapedFieldBinding.tsx +0 -2
- package/src/form/field_bindings/MapFieldBinding.tsx +0 -2
- package/src/routes/FireCMSRoute.tsx +7 -2
- package/src/types/fields.tsx +16 -0
- package/src/types/navigation.ts +1 -0
- package/src/types/plugins.tsx +1 -1
- package/src/types/properties.ts +1 -1
- package/src/util/entity_cache.ts +10 -1
package/dist/types/fields.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CMSType, Property, PropertyOrBuilder } from "./properties";
|
|
2
2
|
import { ResolvedEntityCollection, ResolvedProperty } from "./resolved_entities";
|
|
3
3
|
import { FormexController } from "@firecms/formex";
|
|
4
|
+
import { Entity } from "./entities";
|
|
4
5
|
/**
|
|
5
6
|
* When building a custom field you need to create a React component that takes
|
|
6
7
|
* this interface as props.
|
|
@@ -132,6 +133,16 @@ export interface FormContext<M extends Record<string, any> = any> {
|
|
|
132
133
|
* Path this entity is located at
|
|
133
134
|
*/
|
|
134
135
|
path?: string;
|
|
136
|
+
status: "new" | "existing" | "copy";
|
|
137
|
+
entity?: Entity<M>;
|
|
138
|
+
savingError?: Error;
|
|
139
|
+
openEntityMode: "side_panel" | "full_screen";
|
|
140
|
+
/**
|
|
141
|
+
* If pending close is set to true, the form will close when the user
|
|
142
|
+
* saves the entity
|
|
143
|
+
* @param pendingClose
|
|
144
|
+
*/
|
|
145
|
+
setPendingClose?: (pendingClose: boolean) => void;
|
|
135
146
|
/**
|
|
136
147
|
* This is the underlying formex controller that powers the form
|
|
137
148
|
*/
|
|
@@ -4,6 +4,7 @@ import { EntityReference } from "./entities";
|
|
|
4
4
|
/**
|
|
5
5
|
* Controller that includes the resolved navigation and utility methods and
|
|
6
6
|
* attributes.
|
|
7
|
+
* This controller holds the state of the navigation including the collections.
|
|
7
8
|
* @group Models
|
|
8
9
|
*/
|
|
9
10
|
export type NavigationController<EC extends EntityCollection = EntityCollection<any>> = {
|
package/dist/types/plugins.d.ts
CHANGED
|
@@ -162,7 +162,7 @@ export interface PluginFormActionProps<USER extends User = User, EC extends Enti
|
|
|
162
162
|
formContext?: FormContext<any>;
|
|
163
163
|
context: FireCMSContext<USER>;
|
|
164
164
|
currentEntityId?: string;
|
|
165
|
-
|
|
165
|
+
openEntityMode: "side_panel" | "full_screen";
|
|
166
166
|
}
|
|
167
167
|
export type PluginFieldBuilderParams<T extends CMSType = CMSType, M extends Record<string, any> = any, EC extends EntityCollection<M> = EntityCollection<M>> = {
|
|
168
168
|
fieldConfigId: string;
|
|
@@ -283,7 +283,7 @@ export interface StringProperty extends BaseProperty<string> {
|
|
|
283
283
|
enumValues?: EnumValues;
|
|
284
284
|
/**
|
|
285
285
|
* You can specify a `Storage` configuration. It is used to
|
|
286
|
-
* indicate that this string refers to a path in
|
|
286
|
+
* indicate that this string refers to a path in your storage provider.
|
|
287
287
|
*/
|
|
288
288
|
storage?: StorageConfig;
|
|
289
289
|
/**
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@firecms/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.0.0-canary.
|
|
4
|
+
"version": "3.0.0-canary.187",
|
|
5
5
|
"description": "Awesome Firebase/Firestore-based headless open-source CMS",
|
|
6
6
|
"funding": {
|
|
7
7
|
"url": "https://github.com/sponsors/firecmsco"
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
"./package.json": "./package.json"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@firecms/editor": "^3.0.0-canary.
|
|
54
|
-
"@firecms/formex": "^3.0.0-canary.
|
|
55
|
-
"@firecms/ui": "^3.0.0-canary.
|
|
53
|
+
"@firecms/editor": "^3.0.0-canary.187",
|
|
54
|
+
"@firecms/formex": "^3.0.0-canary.187",
|
|
55
|
+
"@firecms/ui": "^3.0.0-canary.187",
|
|
56
56
|
"@hello-pangea/dnd": "^17.0.0",
|
|
57
57
|
"@radix-ui/react-portal": "^1.1.3",
|
|
58
58
|
"clsx": "^2.1.1",
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
"dist",
|
|
105
105
|
"src"
|
|
106
106
|
],
|
|
107
|
-
"gitHead": "
|
|
107
|
+
"gitHead": "57a64af52d840cb893f7790ef5857a8f8a4249b4",
|
|
108
108
|
"publishConfig": {
|
|
109
109
|
"access": "public"
|
|
110
110
|
},
|
|
@@ -23,7 +23,7 @@ import { Button, CloseIcon, DialogActions, IconButton, Typography } from "@firec
|
|
|
23
23
|
import { PropertyFieldBinding } from "../../../../form";
|
|
24
24
|
import { useCustomizationController, useDataSource, useFireCMSContext } from "../../../../hooks";
|
|
25
25
|
import { OnCellValueChangeParams } from "../../../common";
|
|
26
|
-
import { yupToFormErrors } from "../../../../core/
|
|
26
|
+
import { yupToFormErrors } from "../../../../core/EntityForm";
|
|
27
27
|
|
|
28
28
|
interface PopupFormFieldProps<M extends Record<string, any>> {
|
|
29
29
|
customFieldValidator?: CustomFieldValidator;
|
|
@@ -278,7 +278,9 @@ export function PopupFormFieldInternal<M extends Record<string, any>>({
|
|
|
278
278
|
path,
|
|
279
279
|
setFieldValue,
|
|
280
280
|
save: saveValue,
|
|
281
|
-
formex
|
|
281
|
+
formex,
|
|
282
|
+
status: "existing",
|
|
283
|
+
openEntityMode: "side_panel",
|
|
282
284
|
};
|
|
283
285
|
|
|
284
286
|
const property: ResolvedProperty<any> | undefined = propertyKey && getPropertyInPath(collection?.properties ?? {} as ResolvedProperties, propertyKey as string);
|