@webiny/app-headless-cms-common 0.0.0-unstable.a4637c5ce6 → 0.0.0-unstable.a4f3e4ea8b
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 +6 -13
- package/constants.d.ts +1 -1
- package/constants.js +2 -1
- package/constants.js.map +1 -1
- package/exports/admin/cms.d.ts +1 -0
- package/exports/admin/cms.js +0 -0
- package/index.d.ts +1 -10
- package/index.js +1 -12
- package/package.json +23 -32
- package/types/index.d.ts +35 -312
- package/types/index.js +1 -56
- package/types/model.d.ts +74 -27
- package/types/model.js +4 -1
- package/types/model.js.map +1 -1
- package/types/shared.d.ts +6 -0
- package/types/shared.js +0 -3
- package/Fields/ErrorBoundary.d.ts +0 -24
- package/Fields/ErrorBoundary.js +0 -40
- package/Fields/ErrorBoundary.js.map +0 -1
- package/Fields/FieldElement.d.ts +0 -64
- package/Fields/FieldElement.js +0 -71
- package/Fields/FieldElement.js.map +0 -1
- package/Fields/FieldElementError.d.ts +0 -7
- package/Fields/FieldElementError.js +0 -26
- package/Fields/FieldElementError.js.map +0 -1
- package/Fields/Fields.d.ts +0 -11
- package/Fields/Fields.js +0 -35
- package/Fields/Fields.js.map +0 -1
- package/Fields/Label.d.ts +0 -6
- package/Fields/Label.js +0 -10
- package/Fields/Label.js.map +0 -1
- package/Fields/index.d.ts +0 -3
- package/Fields/index.js +0 -5
- package/Fields/index.js.map +0 -1
- package/Fields/useBind.d.ts +0 -9
- package/Fields/useBind.js +0 -113
- package/Fields/useBind.js.map +0 -1
- package/Fields/useRenderPlugins.d.ts +0 -1
- package/Fields/useRenderPlugins.js +0 -7
- package/Fields/useRenderPlugins.js.map +0 -1
- package/ModelFieldProvider/ModelFieldContext.d.ts +0 -36
- package/ModelFieldProvider/ModelFieldContext.js +0 -26
- package/ModelFieldProvider/ModelFieldContext.js.map +0 -1
- package/ModelFieldProvider/index.d.ts +0 -2
- package/ModelFieldProvider/index.js +0 -4
- package/ModelFieldProvider/index.js.map +0 -1
- package/ModelFieldProvider/useModelField.d.ts +0 -16
- package/ModelFieldProvider/useModelField.js +0 -29
- package/ModelFieldProvider/useModelField.js.map +0 -1
- package/ModelProvider/ModelContext.d.ts +0 -9
- package/ModelProvider/ModelContext.js +0 -12
- package/ModelProvider/ModelContext.js.map +0 -1
- package/ModelProvider/index.d.ts +0 -2
- package/ModelProvider/index.js +0 -4
- package/ModelProvider/index.js.map +0 -1
- package/ModelProvider/useModel.d.ts +0 -9
- package/ModelProvider/useModel.js +0 -16
- package/ModelProvider/useModel.js.map +0 -1
- package/createFieldsList.d.ts +0 -8
- package/createFieldsList.js +0 -49
- package/createFieldsList.js.map +0 -1
- package/createValidationContainer.d.ts +0 -18
- package/createValidationContainer.js +0 -26
- package/createValidationContainer.js.map +0 -1
- package/createValidators.d.ts +0 -3
- package/createValidators.js +0 -52
- package/createValidators.js.map +0 -1
- package/entries.graphql.d.ts +0 -218
- package/entries.graphql.js +0 -402
- package/entries.graphql.js.map +0 -1
- package/getModelTitleFieldId.d.ts +0 -2
- package/getModelTitleFieldId.js +0 -8
- package/getModelTitleFieldId.js.map +0 -1
- package/index.js.map +0 -1
- package/prepareFormData.d.ts +0 -2
- package/prepareFormData.js +0 -71
- package/prepareFormData.js.map +0 -1
- package/types/index.js.map +0 -1
- package/types/shared.js.map +0 -1
- package/types/validation.d.ts +0 -79
- package/types/validation.js +0 -3
- package/types/validation.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,18 +1,11 @@
|
|
|
1
1
|
# @webiny/app-headless-cms-common
|
|
2
2
|
|
|
3
|
-
[!
|
|
4
|
-
[
|
|
5
|
-
|
|
6
|
-
[](http://makeapullrequest.com)
|
|
3
|
+
> [!NOTE]
|
|
4
|
+
> This package is part of the [Webiny](https://www.webiny.com) monorepo.
|
|
5
|
+
> It’s **included in every Webiny project by default** and is not meant to be used as a standalone package.
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
📘 **Documentation:** [https://www.webiny.com/docs](https://www.webiny.com/docs)
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
npm install --save @webiny/app-headless-cms-common
|
|
12
|
-
```
|
|
9
|
+
---
|
|
13
10
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
yarn add @webiny/app-headless-cms-common
|
|
18
|
-
```
|
|
11
|
+
_This README file is automatically generated during the publish process._
|
package/constants.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const CMS_MODEL_SINGLETON_TAG = "
|
|
1
|
+
export declare const CMS_MODEL_SINGLETON_TAG = "singleEntry";
|
package/constants.js
CHANGED
package/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../src/constants.ts"],"sourcesContent":["export const CMS_MODEL_SINGLETON_TAG = \"singleEntry\";\n"],"names":["CMS_MODEL_SINGLETON_TAG"],"mappings":"AAAO,MAAMA,0BAA0B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { CmsContentEntry, CmsModel, CmsModelField, CmsModelLayoutField, CmsIdentity } from "../../types/index.js";
|
|
File without changes
|
package/index.d.ts
CHANGED
|
@@ -1,10 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export * from "./ModelFieldProvider";
|
|
3
|
-
export * from "./ModelProvider";
|
|
4
|
-
export * from "./entries.graphql";
|
|
5
|
-
export * from "./getModelTitleFieldId";
|
|
6
|
-
export * from "./createFieldsList";
|
|
7
|
-
export * from "./createValidationContainer";
|
|
8
|
-
export * from "./createValidators";
|
|
9
|
-
export * from "./prepareFormData";
|
|
10
|
-
export * from "./constants";
|
|
1
|
+
export { CMS_MODEL_SINGLETON_TAG } from "./constants.js";
|
package/index.js
CHANGED
|
@@ -1,12 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export * from "./ModelFieldProvider";
|
|
3
|
-
export * from "./ModelProvider";
|
|
4
|
-
export * from "./entries.graphql";
|
|
5
|
-
export * from "./getModelTitleFieldId";
|
|
6
|
-
export * from "./createFieldsList";
|
|
7
|
-
export * from "./createValidationContainer";
|
|
8
|
-
export * from "./createValidators";
|
|
9
|
-
export * from "./prepareFormData";
|
|
10
|
-
export * from "./constants";
|
|
11
|
-
|
|
12
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export { CMS_MODEL_SINGLETON_TAG } from "./constants.js";
|
package/package.json
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/app-headless-cms-common",
|
|
3
|
-
"version": "0.0.0-unstable.
|
|
4
|
-
"
|
|
3
|
+
"version": "0.0.0-unstable.a4f3e4ea8b",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"exports": {
|
|
6
|
+
".": "./index.js",
|
|
7
|
+
"./*": "./*"
|
|
8
|
+
},
|
|
5
9
|
"repository": {
|
|
6
10
|
"type": "git",
|
|
7
11
|
"url": "https://github.com/webiny/webiny-js.git"
|
|
@@ -13,40 +17,27 @@
|
|
|
13
17
|
],
|
|
14
18
|
"license": "MIT",
|
|
15
19
|
"dependencies": {
|
|
16
|
-
"@
|
|
17
|
-
"@
|
|
18
|
-
"@
|
|
19
|
-
"@webiny/admin
|
|
20
|
-
"@webiny/
|
|
21
|
-
"@webiny/
|
|
22
|
-
"@webiny/
|
|
23
|
-
"@webiny/form": "0.0.0-unstable.a4637c5ce6",
|
|
24
|
-
"@webiny/plugins": "0.0.0-unstable.a4637c5ce6",
|
|
25
|
-
"@webiny/react-composition": "0.0.0-unstable.a4637c5ce6",
|
|
26
|
-
"@webiny/validation": "0.0.0-unstable.a4637c5ce6",
|
|
20
|
+
"@fortawesome/fontawesome-svg-core": "7.3.1",
|
|
21
|
+
"@webiny/admin-ui": "0.0.0-unstable.a4f3e4ea8b",
|
|
22
|
+
"@webiny/app": "0.0.0-unstable.a4f3e4ea8b",
|
|
23
|
+
"@webiny/app-admin": "0.0.0-unstable.a4f3e4ea8b",
|
|
24
|
+
"@webiny/form": "0.0.0-unstable.a4f3e4ea8b",
|
|
25
|
+
"@webiny/plugins": "0.0.0-unstable.a4f3e4ea8b",
|
|
26
|
+
"@webiny/validation": "0.0.0-unstable.a4f3e4ea8b",
|
|
27
27
|
"dnd-core": "16.0.1",
|
|
28
|
-
"
|
|
29
|
-
"graphql-tag": "2.12.6",
|
|
30
|
-
"lodash": "4.17.21",
|
|
31
|
-
"prop-types": "15.8.1",
|
|
32
|
-
"react": "18.2.0"
|
|
28
|
+
"react": "18.3.1"
|
|
33
29
|
},
|
|
34
30
|
"devDependencies": {
|
|
35
|
-
"@
|
|
36
|
-
"@
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"babel-plugin-module-resolver": "5.0.2",
|
|
40
|
-
"rimraf": "6.0.1",
|
|
41
|
-
"typescript": "5.3.3"
|
|
31
|
+
"@types/react": "18.3.31",
|
|
32
|
+
"@webiny/build-tools": "0.0.0-unstable.a4f3e4ea8b",
|
|
33
|
+
"rimraf": "6.1.3",
|
|
34
|
+
"typescript": "7.0.2"
|
|
42
35
|
},
|
|
43
36
|
"publishConfig": {
|
|
44
|
-
"access": "public"
|
|
45
|
-
"directory": "dist"
|
|
46
|
-
},
|
|
47
|
-
"scripts": {
|
|
48
|
-
"build": "node ../cli/bin.js run build",
|
|
49
|
-
"watch": "node ../cli/bin.js run watch"
|
|
37
|
+
"access": "public"
|
|
50
38
|
},
|
|
51
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "8476da73b653c89cc1474d968baf55c1b0ae0e5f",
|
|
40
|
+
"webiny": {
|
|
41
|
+
"publishFrom": "dist"
|
|
42
|
+
}
|
|
52
43
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,25 +1,21 @@
|
|
|
1
1
|
import type * as React from "react";
|
|
2
2
|
import type { ReactElement, ReactNode } from "react";
|
|
3
|
-
import type { Plugin } from "@webiny/plugins/types";
|
|
3
|
+
import type { Plugin } from "@webiny/plugins/types.js";
|
|
4
4
|
import type { BindComponent as BaseBindComponent, BindComponentProps as BaseBindComponentProps, BindComponentRenderProp as BaseBindComponentRenderProp, FormAPI } from "@webiny/form";
|
|
5
5
|
import type { IconName, IconPrefix } from "@fortawesome/fontawesome-svg-core";
|
|
6
|
-
import type {
|
|
7
|
-
import type {
|
|
8
|
-
import type { CmsModel, CmsModelField } from "./model";
|
|
9
|
-
import type { CmsIdentity } from "./shared";
|
|
6
|
+
import type { CmsEditorFieldsLayout, CmsLayoutField, CmsModel, CmsModelField } from "./model.js";
|
|
7
|
+
import type { CmsIdentity } from "../types/shared.js";
|
|
10
8
|
import type { SourceType } from "dnd-core";
|
|
11
9
|
import type { IconPickerIconDto } from "@webiny/admin-ui";
|
|
10
|
+
import type { GenericRecord } from "@webiny/app/types.js";
|
|
11
|
+
import type { Identity } from "@webiny/app-admin/domain/Identity.js";
|
|
12
|
+
import type { CmsModelFieldValidator } from "./model.js";
|
|
12
13
|
export type DragObjectWithType = {
|
|
13
14
|
type: SourceType;
|
|
14
15
|
};
|
|
15
|
-
export * from "./
|
|
16
|
-
export
|
|
17
|
-
export * from "./shared";
|
|
18
|
-
interface QueryFieldParams {
|
|
19
|
-
model: CmsModel;
|
|
20
|
-
field: CmsModelField;
|
|
21
|
-
graphQLTypePrefix: string;
|
|
22
|
-
}
|
|
16
|
+
export type * from "./model.js";
|
|
17
|
+
export { isLayoutField } from "./model.js";
|
|
18
|
+
export type * from "./shared.js";
|
|
23
19
|
interface Position {
|
|
24
20
|
row: number;
|
|
25
21
|
index: number;
|
|
@@ -30,282 +26,12 @@ interface Location {
|
|
|
30
26
|
export interface DragSource extends DragObjectWithType {
|
|
31
27
|
parent?: string;
|
|
32
28
|
pos?: Partial<Position>;
|
|
33
|
-
type: "row" | "field" | "newField";
|
|
29
|
+
type: "row" | "field" | "newField" | "newLayoutField" | "layoutField";
|
|
34
30
|
fieldType?: string;
|
|
31
|
+
layoutFieldType?: string;
|
|
35
32
|
field?: CmsModelField | null;
|
|
36
33
|
fields?: CmsModelField[];
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* @deprecated Use `CmsModelFieldTypePlugin`.
|
|
40
|
-
*/
|
|
41
|
-
export type CmsEditorFieldTypePlugin = CmsModelFieldTypePlugin;
|
|
42
|
-
export interface CmsModelFieldTypePlugin extends Plugin {
|
|
43
|
-
/**
|
|
44
|
-
* a plugin type
|
|
45
|
-
*/
|
|
46
|
-
type: "cms-editor-field-type";
|
|
47
|
-
field: {
|
|
48
|
-
/**
|
|
49
|
-
* A unique identifier of the field type (text, number, json, myField, ...).
|
|
50
|
-
*
|
|
51
|
-
* ```ts
|
|
52
|
-
* type: "myField"
|
|
53
|
-
* ```
|
|
54
|
-
*/
|
|
55
|
-
type: string;
|
|
56
|
-
/**
|
|
57
|
-
* A display name for the field.
|
|
58
|
-
*
|
|
59
|
-
* ```ts
|
|
60
|
-
* label: "Field name"
|
|
61
|
-
* ```
|
|
62
|
-
*/
|
|
63
|
-
label: string;
|
|
64
|
-
/**
|
|
65
|
-
* A list of available validators for the model field.
|
|
66
|
-
*
|
|
67
|
-
* ```ts
|
|
68
|
-
* validators: [
|
|
69
|
-
* "required",
|
|
70
|
-
* "gte",
|
|
71
|
-
* "lte"
|
|
72
|
-
* ]
|
|
73
|
-
* ```
|
|
74
|
-
*/
|
|
75
|
-
validators?: string[] | CmsModelFieldValidatorsGroup | CmsModelFieldValidatorsFactory;
|
|
76
|
-
/**
|
|
77
|
-
* A list of available validators when a model field accepts a list (array) of values.
|
|
78
|
-
*
|
|
79
|
-
* ```ts
|
|
80
|
-
* listValidators: [
|
|
81
|
-
* "minLength",
|
|
82
|
-
* "maxLength"
|
|
83
|
-
* ]
|
|
84
|
-
* ```
|
|
85
|
-
*/
|
|
86
|
-
listValidators?: string[] | CmsModelFieldValidatorsGroup | CmsModelFieldValidatorsFactory;
|
|
87
|
-
/**
|
|
88
|
-
* An explanation of the field displayed beneath the label.
|
|
89
|
-
*
|
|
90
|
-
* ```ts
|
|
91
|
-
* description: "A short description of the field"
|
|
92
|
-
* ```
|
|
93
|
-
*/
|
|
94
|
-
description: string;
|
|
95
|
-
/**
|
|
96
|
-
* A ReactNode to display the icon for the field.
|
|
97
|
-
*
|
|
98
|
-
* ```tsx
|
|
99
|
-
* icon: <MyIconComponent />
|
|
100
|
-
* ```
|
|
101
|
-
*/
|
|
102
|
-
icon: React.ReactNode;
|
|
103
|
-
/**
|
|
104
|
-
* Is it allowed to have multiple values in this field?
|
|
105
|
-
*
|
|
106
|
-
* ```ts
|
|
107
|
-
* allowMultipleValues: true
|
|
108
|
-
* ```
|
|
109
|
-
*/
|
|
110
|
-
allowMultipleValues?: boolean;
|
|
111
|
-
/**
|
|
112
|
-
* Does this field type have a fixed list of values that can be selected?
|
|
113
|
-
*
|
|
114
|
-
* ```ts
|
|
115
|
-
* allowPredefinedValues: false
|
|
116
|
-
* ```
|
|
117
|
-
*/
|
|
118
|
-
allowPredefinedValues?: boolean;
|
|
119
|
-
/**
|
|
120
|
-
* A ReactNode label when multiple values are enabled.
|
|
121
|
-
*/
|
|
122
|
-
multipleValuesLabel?: React.ReactNode;
|
|
123
|
-
/**
|
|
124
|
-
* Determines if this field type should be hidden from the admin UI.
|
|
125
|
-
* If set to `true`, the field type will not be visible or selectable in the admin interface.
|
|
126
|
-
*/
|
|
127
|
-
hideInAdmin?: boolean;
|
|
128
|
-
/**
|
|
129
|
-
* These are default values when the field is first created. This is a representation of the field that is stored in the database.
|
|
130
|
-
*
|
|
131
|
-
* ```ts
|
|
132
|
-
* createField: () => ({
|
|
133
|
-
* type: "fieldType",
|
|
134
|
-
* validation: [],
|
|
135
|
-
* renderer: {
|
|
136
|
-
* name: "fieldTypeRenderer"
|
|
137
|
-
* }
|
|
138
|
-
* })
|
|
139
|
-
* ```
|
|
140
|
-
*/
|
|
141
|
-
createField: () => Pick<CmsModelField, "type" | "validation" | "renderer" | "settings">;
|
|
142
|
-
/**
|
|
143
|
-
* If `true` (default), this field will be configurable via a settings dialog.
|
|
144
|
-
* If `false`, a user will not be able to open the settings dialog, not will the dialog be opened on field drop.
|
|
145
|
-
*/
|
|
146
|
-
canEditSettings?: boolean;
|
|
147
|
-
/**
|
|
148
|
-
* Determine if a `draggable` can be dropped into this field.
|
|
149
|
-
* NOTE: This is only applicable to nested field types.
|
|
150
|
-
*/
|
|
151
|
-
canAccept?(field: CmsModelField, draggable: DragSource): boolean;
|
|
152
|
-
/**
|
|
153
|
-
* If `true` (default), will allow fields to be laid out into columns (next to each other).
|
|
154
|
-
* If `false`, horizontal layout will not be allowed.
|
|
155
|
-
* NOTE: This is only applicable to nested field types.
|
|
156
|
-
*/
|
|
157
|
-
allowLayout?: boolean;
|
|
158
|
-
/**
|
|
159
|
-
* A ReactNode that you can add in the section below the help text when creating/editing field.
|
|
160
|
-
*
|
|
161
|
-
* ```tsx
|
|
162
|
-
* renderSettings: (params) => {
|
|
163
|
-
* return <FieldSettingsComponent />;
|
|
164
|
-
* }
|
|
165
|
-
* ```
|
|
166
|
-
*/
|
|
167
|
-
renderSettings?: (params: {
|
|
168
|
-
afterChangeLabel: (value: string) => void;
|
|
169
|
-
uniqueFieldIdValidator: (fieldId: string) => void;
|
|
170
|
-
contentModel: CmsModel;
|
|
171
|
-
}) => React.ReactNode;
|
|
172
|
-
/**
|
|
173
|
-
* A ReactNode that renders in the Predefined values tab.
|
|
174
|
-
*
|
|
175
|
-
* ```tsx
|
|
176
|
-
* renderPredefinedValues: (params) => {
|
|
177
|
-
* const {form: {Bind}} = params;
|
|
178
|
-
* return (
|
|
179
|
-
* <Bind name="fieldProperty">
|
|
180
|
-
* <InputComponent />
|
|
181
|
-
* </Bind>
|
|
182
|
-
* );
|
|
183
|
-
* }
|
|
184
|
-
* ```
|
|
185
|
-
*/
|
|
186
|
-
renderPredefinedValues?: (params: {
|
|
187
|
-
getBind: (index?: number) => any;
|
|
188
|
-
}) => React.ReactElement;
|
|
189
|
-
/**
|
|
190
|
-
* Object wrapper for GraphQL stuff
|
|
191
|
-
*/
|
|
192
|
-
graphql?: {
|
|
193
|
-
/**
|
|
194
|
-
* Define field selection.
|
|
195
|
-
*
|
|
196
|
-
* ```ts
|
|
197
|
-
* graphql: {
|
|
198
|
-
* queryField: `
|
|
199
|
-
* {
|
|
200
|
-
* id
|
|
201
|
-
* title
|
|
202
|
-
* createdOn
|
|
203
|
-
* }
|
|
204
|
-
* `,
|
|
205
|
-
* }
|
|
206
|
-
* ```
|
|
207
|
-
*/
|
|
208
|
-
queryField?: string | ((params: QueryFieldParams) => string | null);
|
|
209
|
-
};
|
|
210
|
-
render?(params: any): React.ReactElement;
|
|
211
|
-
tags?: string[];
|
|
212
|
-
/**
|
|
213
|
-
* Render additional information in the Admin UI Model edit view
|
|
214
|
-
*/
|
|
215
|
-
renderInfo?: (params: {
|
|
216
|
-
field: CmsModelField;
|
|
217
|
-
model: CmsModel;
|
|
218
|
-
}) => React.ReactElement;
|
|
219
|
-
};
|
|
220
|
-
}
|
|
221
|
-
export interface CmsModelFieldRendererSettingsProps {
|
|
222
|
-
field: CmsModelField;
|
|
223
|
-
}
|
|
224
|
-
export interface CmsModelFieldRendererProps {
|
|
225
|
-
field: CmsModelField;
|
|
226
|
-
Label: React.ComponentType<React.PropsWithChildren>;
|
|
227
|
-
getBind: <T = any>(index?: number, key?: string) => BindComponent<T>;
|
|
228
|
-
contentModel: CmsModel;
|
|
229
|
-
}
|
|
230
|
-
/**
|
|
231
|
-
* @deprecated Use `CmsModelFieldRendererProps`.
|
|
232
|
-
*/
|
|
233
|
-
export type CmsEditorFieldRendererProps = CmsModelFieldRendererProps;
|
|
234
|
-
/**
|
|
235
|
-
* @deprecated Use `CmsModelFieldRendererPlugin`.
|
|
236
|
-
*/
|
|
237
|
-
export type CmsEditorFieldRendererPlugin = CmsModelFieldRendererPlugin;
|
|
238
|
-
export interface CmsModelFieldRendererPlugin extends Plugin {
|
|
239
|
-
/**
|
|
240
|
-
* a plugin type
|
|
241
|
-
*/
|
|
242
|
-
type: "cms-editor-field-renderer";
|
|
243
|
-
renderer: {
|
|
244
|
-
/**
|
|
245
|
-
* Name of the renderer to match the one from `createField()` method in `CmsModelFieldTypePlugin`.
|
|
246
|
-
*
|
|
247
|
-
* ```ts
|
|
248
|
-
* renderName: "myFieldTypeRenderer"
|
|
249
|
-
* ```
|
|
250
|
-
*/
|
|
251
|
-
rendererName: string;
|
|
252
|
-
/**
|
|
253
|
-
* A display name for the field in the UI. It is a `ReactNode` type, so you can use a JSX element.
|
|
254
|
-
*
|
|
255
|
-
* ```tsx
|
|
256
|
-
* name: <MyFieldNameComponent />
|
|
257
|
-
* ```
|
|
258
|
-
*/
|
|
259
|
-
name: React.ReactNode;
|
|
260
|
-
/**
|
|
261
|
-
* A description for the field in the UI. Works exactly like the `name` property.
|
|
262
|
-
*
|
|
263
|
-
* ```tsx
|
|
264
|
-
* name: <MyFieldDescriptionComponent />
|
|
265
|
-
* ```
|
|
266
|
-
*/
|
|
267
|
-
description: React.ReactNode;
|
|
268
|
-
/**
|
|
269
|
-
* A method that determines if the field can be rendered by this plugin.
|
|
270
|
-
*
|
|
271
|
-
* ```ts
|
|
272
|
-
* canUse({ field }) {
|
|
273
|
-
* return (
|
|
274
|
-
* field.type === "myType" && !field.multipleValues
|
|
275
|
-
* );
|
|
276
|
-
* }
|
|
277
|
-
* ```
|
|
278
|
-
*/
|
|
279
|
-
canUse(props: {
|
|
280
|
-
field: CmsModelField;
|
|
281
|
-
fieldPlugin: CmsModelFieldTypePlugin;
|
|
282
|
-
model: CmsModel;
|
|
283
|
-
}): boolean;
|
|
284
|
-
/**
|
|
285
|
-
* Renders a field in the UI.
|
|
286
|
-
*
|
|
287
|
-
* ```tsx
|
|
288
|
-
* render({ field, getBind }) {
|
|
289
|
-
* const Bind = getBind();
|
|
290
|
-
*
|
|
291
|
-
* return (
|
|
292
|
-
* <Bind>
|
|
293
|
-
* {bind => {
|
|
294
|
-
* return (
|
|
295
|
-
* <Input
|
|
296
|
-
* value={bind.value}
|
|
297
|
-
* onChange={bind.onChange}
|
|
298
|
-
* />
|
|
299
|
-
* )
|
|
300
|
-
* }}
|
|
301
|
-
* </Bind>
|
|
302
|
-
* );
|
|
303
|
-
* }
|
|
304
|
-
* ```
|
|
305
|
-
*/
|
|
306
|
-
render(props: CmsModelFieldRendererProps): React.ReactNode;
|
|
307
|
-
renderSettings?: (props: CmsModelFieldRendererSettingsProps) => React.ReactNode;
|
|
308
|
-
};
|
|
34
|
+
layoutField?: CmsLayoutField;
|
|
309
35
|
}
|
|
310
36
|
export interface CmsEditorFieldPredefinedValuesEntry {
|
|
311
37
|
label: string;
|
|
@@ -323,19 +49,18 @@ export interface CmsDynamicZoneTemplate {
|
|
|
323
49
|
description: string;
|
|
324
50
|
icon: string;
|
|
325
51
|
fields: CmsModelField[];
|
|
326
|
-
layout:
|
|
52
|
+
layout: CmsEditorFieldsLayout;
|
|
327
53
|
validation: CmsModelFieldValidator[];
|
|
328
54
|
tags?: string[];
|
|
329
|
-
|
|
330
|
-
export interface CmsDynamicZoneTemplateWithTypename extends CmsDynamicZoneTemplate {
|
|
331
|
-
__typename: string;
|
|
55
|
+
componentName?: string;
|
|
332
56
|
}
|
|
333
57
|
export type CmsContentEntryStatusType = "draft" | "published" | "unpublished";
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
export
|
|
338
|
-
|
|
58
|
+
export interface CmsContentEntryLive {
|
|
59
|
+
version: number;
|
|
60
|
+
}
|
|
61
|
+
export interface CmsContentEntrySystem {
|
|
62
|
+
}
|
|
63
|
+
export interface CmsContentEntry<TValues extends GenericRecord = GenericRecord> {
|
|
339
64
|
id: string;
|
|
340
65
|
entryId: string;
|
|
341
66
|
modelId: string;
|
|
@@ -364,6 +89,8 @@ export interface CmsContentEntry {
|
|
|
364
89
|
revisionLastPublishedOn: string | null;
|
|
365
90
|
revisionLastPublishedBy: CmsIdentity | null;
|
|
366
91
|
wbyAco_location: Location;
|
|
92
|
+
live: CmsContentEntryLive | null;
|
|
93
|
+
system: CmsContentEntrySystem | null;
|
|
367
94
|
meta: {
|
|
368
95
|
title: string;
|
|
369
96
|
description?: string;
|
|
@@ -372,7 +99,8 @@ export interface CmsContentEntry {
|
|
|
372
99
|
status: CmsContentEntryStatusType;
|
|
373
100
|
version: number;
|
|
374
101
|
};
|
|
375
|
-
|
|
102
|
+
revisionDescription?: string;
|
|
103
|
+
values: TValues;
|
|
376
104
|
}
|
|
377
105
|
export interface CmsContentEntryRevision {
|
|
378
106
|
id: string;
|
|
@@ -396,6 +124,7 @@ export interface CmsContentEntryRevision {
|
|
|
396
124
|
revisionFirstPublishedBy: CmsIdentity | null;
|
|
397
125
|
revisionLastPublishedBy: CmsIdentity | null;
|
|
398
126
|
wbyAco_location: Location;
|
|
127
|
+
revisionDescription?: string;
|
|
399
128
|
meta: {
|
|
400
129
|
title: string;
|
|
401
130
|
locked: boolean;
|
|
@@ -403,9 +132,6 @@ export interface CmsContentEntryRevision {
|
|
|
403
132
|
version: number;
|
|
404
133
|
};
|
|
405
134
|
}
|
|
406
|
-
export type CmsEditorContentTab = React.ComponentType<{
|
|
407
|
-
activeTab: boolean;
|
|
408
|
-
}>;
|
|
409
135
|
export interface CmsEditorFieldOptionPlugin extends Plugin {
|
|
410
136
|
type: "cms-editor-field-option";
|
|
411
137
|
render(): ReactElement;
|
|
@@ -413,24 +139,21 @@ export interface CmsEditorFieldOptionPlugin extends Plugin {
|
|
|
413
139
|
export interface CmsContentDetailsPlugin extends Plugin {
|
|
414
140
|
render: (params: any) => ReactNode;
|
|
415
141
|
}
|
|
416
|
-
export interface
|
|
417
|
-
row: number;
|
|
418
|
-
index: number | null;
|
|
419
|
-
}
|
|
420
|
-
export interface CmsEditorFormSettingsPlugin extends Plugin {
|
|
142
|
+
export interface CmsEditorFormSettingsPlugin<T = GenericRecord> extends Plugin {
|
|
421
143
|
type: "cms-editor-form-settings";
|
|
422
144
|
title: string;
|
|
423
145
|
description: string;
|
|
424
146
|
icon: React.ReactElement;
|
|
147
|
+
showSave?: boolean;
|
|
425
148
|
render(props: {
|
|
426
149
|
Bind: BaseBindComponent;
|
|
427
|
-
form: FormAPI
|
|
428
|
-
formData:
|
|
150
|
+
form: FormAPI<T>;
|
|
151
|
+
formData: T;
|
|
429
152
|
}): React.ReactNode;
|
|
430
153
|
renderHeaderActions?(props: {
|
|
431
154
|
Bind: BaseBindComponent;
|
|
432
|
-
form: FormAPI
|
|
433
|
-
formData:
|
|
155
|
+
form: FormAPI<T>;
|
|
156
|
+
formData: T;
|
|
434
157
|
}): React.ReactNode;
|
|
435
158
|
}
|
|
436
159
|
export interface CmsIcon {
|
|
@@ -507,15 +230,15 @@ export interface CmsContentFormRendererPlugin extends Plugin {
|
|
|
507
230
|
* Data types
|
|
508
231
|
* #########################
|
|
509
232
|
*/
|
|
510
|
-
export interface CmsSecurityPermission extends
|
|
233
|
+
export interface CmsSecurityPermission extends Identity.Permission {
|
|
511
234
|
accessLevel?: "full" | "no" | "custom";
|
|
512
|
-
models?:
|
|
513
|
-
groups?:
|
|
235
|
+
models?: string[];
|
|
236
|
+
groups?: string[];
|
|
514
237
|
endpoints?: string[];
|
|
515
|
-
locales?: string[];
|
|
516
238
|
rwd?: string;
|
|
517
239
|
own?: boolean;
|
|
518
240
|
pw?: string;
|
|
241
|
+
_src?: string;
|
|
519
242
|
}
|
|
520
243
|
/**
|
|
521
244
|
* @category GraphQL
|
package/types/index.js
CHANGED
|
@@ -1,56 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export * from "./model";
|
|
3
|
-
export * from "./shared";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @deprecated Use `CmsModelFieldTypePlugin`.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @deprecated Use `CmsModelFieldRendererProps`.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* @deprecated Use `CmsModelFieldRendererPlugin`.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* @deprecated Use `CmsContentEntry`.
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
// ------------------------------------------------------------------------------------------------------------
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Transform field value when sending data to the API.
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Define a custom form layout renderer for a specific content model.
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* #########################
|
|
33
|
-
* Data types
|
|
34
|
-
* #########################
|
|
35
|
-
*/
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* @category GraphQL
|
|
39
|
-
* @category Error
|
|
40
|
-
*/
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* @category GraphQL
|
|
44
|
-
* @category Meta
|
|
45
|
-
*/
|
|
46
|
-
|
|
47
|
-
/***
|
|
48
|
-
* ###### FORM ########
|
|
49
|
-
*/
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* After RequestReview and RequestChanges was removed, we need an option to add new status filters
|
|
53
|
-
*/
|
|
54
|
-
export {};
|
|
55
|
-
|
|
56
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export { isLayoutField } from "./model.js";
|