@webiny/app-headless-cms-common 0.0.0-unstable.085ff6572f β 0.0.0-unstable.0d717d18dd
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 -0
- package/constants.js +4 -0
- package/constants.js.map +1 -0
- package/exports/admin/cms.d.ts +1 -0
- package/exports/admin/cms.js +0 -0
- package/index.d.ts +1 -3
- package/index.js +1 -38
- package/package.json +24 -33
- package/types/index.d.ts +102 -315
- package/types/index.js +1 -38
- package/types/model.d.ts +83 -25
- package/types/model.js +5 -4
- package/types/model.js.map +1 -1
- package/types/shared.d.ts +6 -0
- package/types/shared.js +0 -5
- package/createFieldsList.d.ts +0 -7
- package/createFieldsList.js +0 -35
- package/createFieldsList.js.map +0 -1
- package/entries.graphql.d.ts +0 -146
- package/entries.graphql.js +0 -115
- package/entries.graphql.js.map +0 -1
- package/getModelTitleFieldId.d.ts +0 -2
- package/getModelTitleFieldId.js +0 -13
- package/getModelTitleFieldId.js.map +0 -1
- package/index.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 -5
- 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
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CMS_MODEL_SINGLETON_TAG = "singleEntry";
|
package/constants.js
ADDED
package/constants.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
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
package/index.js
CHANGED
|
@@ -1,38 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _entries = require("./entries.graphql");
|
|
7
|
-
Object.keys(_entries).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _entries[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function get() {
|
|
13
|
-
return _entries[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
var _getModelTitleFieldId = require("./getModelTitleFieldId");
|
|
18
|
-
Object.keys(_getModelTitleFieldId).forEach(function (key) {
|
|
19
|
-
if (key === "default" || key === "__esModule") return;
|
|
20
|
-
if (key in exports && exports[key] === _getModelTitleFieldId[key]) return;
|
|
21
|
-
Object.defineProperty(exports, key, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function get() {
|
|
24
|
-
return _getModelTitleFieldId[key];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
var _createFieldsList = require("./createFieldsList");
|
|
29
|
-
Object.keys(_createFieldsList).forEach(function (key) {
|
|
30
|
-
if (key === "default" || key === "__esModule") return;
|
|
31
|
-
if (key in exports && exports[key] === _createFieldsList[key]) return;
|
|
32
|
-
Object.defineProperty(exports, key, {
|
|
33
|
-
enumerable: true,
|
|
34
|
-
get: function get() {
|
|
35
|
-
return _createFieldsList[key];
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
});
|
|
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.0d717d18dd",
|
|
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/app-
|
|
20
|
-
"@webiny/form": "0.0.0-unstable.
|
|
21
|
-
"@webiny/plugins": "0.0.0-unstable.
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"react": "17.0.2",
|
|
26
|
-
"react-dnd": "11.1.3"
|
|
20
|
+
"@fortawesome/fontawesome-svg-core": "7.3.1",
|
|
21
|
+
"@webiny/admin-ui": "0.0.0-unstable.0d717d18dd",
|
|
22
|
+
"@webiny/app": "0.0.0-unstable.0d717d18dd",
|
|
23
|
+
"@webiny/app-admin": "0.0.0-unstable.0d717d18dd",
|
|
24
|
+
"@webiny/form": "0.0.0-unstable.0d717d18dd",
|
|
25
|
+
"@webiny/plugins": "0.0.0-unstable.0d717d18dd",
|
|
26
|
+
"@webiny/validation": "0.0.0-unstable.0d717d18dd",
|
|
27
|
+
"dnd-core": "16.0.1",
|
|
28
|
+
"react": "18.3.1"
|
|
27
29
|
},
|
|
28
30
|
"devDependencies": {
|
|
29
|
-
"@
|
|
30
|
-
"@
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"@babel/preset-typescript": "7.18.6",
|
|
34
|
-
"@webiny/cli": "0.0.0-unstable.085ff6572f",
|
|
35
|
-
"@webiny/project-utils": "0.0.0-unstable.085ff6572f",
|
|
36
|
-
"babel-plugin-emotion": "9.2.11",
|
|
37
|
-
"babel-plugin-lodash": "3.3.4",
|
|
38
|
-
"babel-plugin-module-resolver": "4.1.0",
|
|
39
|
-
"rimraf": "3.0.2",
|
|
40
|
-
"ttypescript": "1.5.15",
|
|
41
|
-
"typescript": "4.7.4"
|
|
31
|
+
"@types/react": "18.3.31",
|
|
32
|
+
"@webiny/build-tools": "0.0.0-unstable.0d717d18dd",
|
|
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": "yarn webiny run build",
|
|
49
|
-
"watch": "yarn webiny 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,293 +1,37 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { ReactElement, ReactNode } from "react";
|
|
3
|
-
import { Plugin } from "@webiny/plugins/types";
|
|
4
|
-
import { BindComponent as BaseBindComponent, BindComponentProps as BaseBindComponentProps, BindComponentRenderProp as BaseBindComponentRenderProp, FormAPI } from "@webiny/form";
|
|
5
|
-
import { IconName, IconPrefix } from "@fortawesome/fontawesome-svg-core";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
import type { ReactElement, ReactNode } from "react";
|
|
3
|
+
import type { Plugin } from "@webiny/plugins/types.js";
|
|
4
|
+
import type { BindComponent as BaseBindComponent, BindComponentProps as BaseBindComponentProps, BindComponentRenderProp as BaseBindComponentRenderProp, FormAPI } from "@webiny/form";
|
|
5
|
+
import type { IconName, IconPrefix } from "@fortawesome/fontawesome-svg-core";
|
|
6
|
+
import type { CmsEditorFieldsLayout, CmsLayoutField, CmsModel, CmsModelField } from "./model.js";
|
|
7
|
+
import type { CmsIdentity } from "../types/shared.js";
|
|
8
|
+
import type { SourceType } from "dnd-core";
|
|
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";
|
|
13
|
+
export type DragObjectWithType = {
|
|
14
|
+
type: SourceType;
|
|
15
|
+
};
|
|
16
|
+
export type * from "./model.js";
|
|
17
|
+
export { isLayoutField } from "./model.js";
|
|
18
|
+
export type * from "./shared.js";
|
|
18
19
|
interface Position {
|
|
19
20
|
row: number;
|
|
20
21
|
index: number;
|
|
21
22
|
}
|
|
23
|
+
interface Location {
|
|
24
|
+
folderId: string;
|
|
25
|
+
}
|
|
22
26
|
export interface DragSource extends DragObjectWithType {
|
|
23
27
|
parent?: string;
|
|
24
28
|
pos?: Partial<Position>;
|
|
25
|
-
type: "row" | "field" | "newField";
|
|
29
|
+
type: "row" | "field" | "newField" | "newLayoutField" | "layoutField";
|
|
26
30
|
fieldType?: string;
|
|
31
|
+
layoutFieldType?: string;
|
|
27
32
|
field?: CmsModelField | null;
|
|
28
33
|
fields?: CmsModelField[];
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* @deprecated Use `CmsModelFieldTypePlugin`.
|
|
32
|
-
*/
|
|
33
|
-
export declare type CmsEditorFieldTypePlugin = CmsModelFieldTypePlugin;
|
|
34
|
-
export interface CmsModelFieldTypePlugin extends Plugin {
|
|
35
|
-
/**
|
|
36
|
-
* a plugin type
|
|
37
|
-
*/
|
|
38
|
-
type: "cms-editor-field-type";
|
|
39
|
-
field: {
|
|
40
|
-
/**
|
|
41
|
-
* A unique identifier of the field type (text, number, json, myField, ...).
|
|
42
|
-
*
|
|
43
|
-
* ```ts
|
|
44
|
-
* type: "myField"
|
|
45
|
-
* ```
|
|
46
|
-
*/
|
|
47
|
-
type: string;
|
|
48
|
-
/**
|
|
49
|
-
* A display name for the field.
|
|
50
|
-
*
|
|
51
|
-
* ```ts
|
|
52
|
-
* label: "Field name"
|
|
53
|
-
* ```
|
|
54
|
-
*/
|
|
55
|
-
label: string;
|
|
56
|
-
/**
|
|
57
|
-
* A list of available validators for the model field.
|
|
58
|
-
*
|
|
59
|
-
* ```ts
|
|
60
|
-
* validators: [
|
|
61
|
-
* "required",
|
|
62
|
-
* "gte",
|
|
63
|
-
* "lte"
|
|
64
|
-
* ]
|
|
65
|
-
* ```
|
|
66
|
-
*/
|
|
67
|
-
validators?: string[] | CmsModelFieldValidatorsGroup | CmsModelFieldValidatorsFactory;
|
|
68
|
-
/**
|
|
69
|
-
* A list of available validators when a model field accepts a list (array) of values.
|
|
70
|
-
*
|
|
71
|
-
* ```ts
|
|
72
|
-
* listValidators: [
|
|
73
|
-
* "minLength",
|
|
74
|
-
* "maxLength"
|
|
75
|
-
* ]
|
|
76
|
-
* ```
|
|
77
|
-
*/
|
|
78
|
-
listValidators?: string[] | CmsModelFieldValidatorsGroup | CmsModelFieldValidatorsFactory;
|
|
79
|
-
/**
|
|
80
|
-
* An explanation of the field displayed beneath the label.
|
|
81
|
-
*
|
|
82
|
-
* ```ts
|
|
83
|
-
* description: "A short description of the field"
|
|
84
|
-
* ```
|
|
85
|
-
*/
|
|
86
|
-
description: string;
|
|
87
|
-
/**
|
|
88
|
-
* A ReactNode to display the icon for the field.
|
|
89
|
-
*
|
|
90
|
-
* ```tsx
|
|
91
|
-
* icon: <MyIconComponent />
|
|
92
|
-
* ```
|
|
93
|
-
*/
|
|
94
|
-
icon: React.ReactNode;
|
|
95
|
-
/**
|
|
96
|
-
* Is it allowed to have multiple values in this field?
|
|
97
|
-
*
|
|
98
|
-
* ```ts
|
|
99
|
-
* allowMultipleValues: true
|
|
100
|
-
* ```
|
|
101
|
-
*/
|
|
102
|
-
allowMultipleValues?: boolean;
|
|
103
|
-
/**
|
|
104
|
-
* Does this field type have a fixed list of values that can be selected?
|
|
105
|
-
*
|
|
106
|
-
* ```ts
|
|
107
|
-
* allowPredefinedValues: false
|
|
108
|
-
* ```
|
|
109
|
-
*/
|
|
110
|
-
allowPredefinedValues?: boolean;
|
|
111
|
-
/**
|
|
112
|
-
* A ReactNode label when multiple values are enabled.
|
|
113
|
-
*/
|
|
114
|
-
multipleValuesLabel?: React.ReactNode;
|
|
115
|
-
/**
|
|
116
|
-
* These are default values when the field is first created. This is a representation of the field that is stored in the database.
|
|
117
|
-
*
|
|
118
|
-
* ```ts
|
|
119
|
-
* createField: () => ({
|
|
120
|
-
* type: "fieldType",
|
|
121
|
-
* validation: [],
|
|
122
|
-
* renderer: {
|
|
123
|
-
* name: "fieldTypeRenderer"
|
|
124
|
-
* }
|
|
125
|
-
* })
|
|
126
|
-
* ```
|
|
127
|
-
*/
|
|
128
|
-
createField: () => Pick<CmsModelField, "type" | "validation" | "renderer" | "settings">;
|
|
129
|
-
/**
|
|
130
|
-
* If `true` (default), this field will be configurable via a settings dialog.
|
|
131
|
-
* If `false`, a user will not be able to open the settings dialog, not will the dialog be opened on field drop.
|
|
132
|
-
*/
|
|
133
|
-
canEditSettings?: boolean;
|
|
134
|
-
/**
|
|
135
|
-
* Determine if a `draggable` can be dropped into this field.
|
|
136
|
-
* NOTE: This is only applicable to nested field types.
|
|
137
|
-
*/
|
|
138
|
-
canAccept?(field: CmsModelField, draggable: DragSource): boolean;
|
|
139
|
-
/**
|
|
140
|
-
* If `true` (default), will allow fields to be laid out into columns (next to each other).
|
|
141
|
-
* If `false`, horizontal layout will not be allowed.
|
|
142
|
-
* NOTE: This is only applicable to nested field types.
|
|
143
|
-
*/
|
|
144
|
-
allowLayout?: boolean;
|
|
145
|
-
/**
|
|
146
|
-
* A ReactNode that you can add in the section below the help text when creating/editing field.
|
|
147
|
-
*
|
|
148
|
-
* ```tsx
|
|
149
|
-
* renderSettings: (params) => {
|
|
150
|
-
* return <FieldSettingsComponent />;
|
|
151
|
-
* }
|
|
152
|
-
* ```
|
|
153
|
-
*/
|
|
154
|
-
renderSettings?: (params: {
|
|
155
|
-
afterChangeLabel: (value: string) => void;
|
|
156
|
-
uniqueFieldIdValidator: (fieldId: string) => void;
|
|
157
|
-
contentModel: CmsModel;
|
|
158
|
-
}) => React.ReactNode;
|
|
159
|
-
/**
|
|
160
|
-
* A ReactNode that renders in the Predefined values tab.
|
|
161
|
-
*
|
|
162
|
-
* ```tsx
|
|
163
|
-
* renderPredefinedValues: (params) => {
|
|
164
|
-
* const {form: {Bind}} = params;
|
|
165
|
-
* return (
|
|
166
|
-
* <Bind name="fieldProperty">
|
|
167
|
-
* <InputComponent />
|
|
168
|
-
* </Bind>
|
|
169
|
-
* );
|
|
170
|
-
* }
|
|
171
|
-
* ```
|
|
172
|
-
*/
|
|
173
|
-
renderPredefinedValues?: (params: {
|
|
174
|
-
getBind: (index?: number) => any;
|
|
175
|
-
}) => React.ReactElement;
|
|
176
|
-
/**
|
|
177
|
-
* Object wrapper for GraphQL stuff
|
|
178
|
-
*/
|
|
179
|
-
graphql?: {
|
|
180
|
-
/**
|
|
181
|
-
* Define field selection.
|
|
182
|
-
*
|
|
183
|
-
* ```ts
|
|
184
|
-
* graphql: {
|
|
185
|
-
* queryField: `
|
|
186
|
-
* {
|
|
187
|
-
* id
|
|
188
|
-
* title
|
|
189
|
-
* createdOn
|
|
190
|
-
* }
|
|
191
|
-
* `,
|
|
192
|
-
* }
|
|
193
|
-
* ```
|
|
194
|
-
*/
|
|
195
|
-
queryField?: string | ((params: QueryFieldParams) => string);
|
|
196
|
-
};
|
|
197
|
-
render?(params: any): React.ReactElement;
|
|
198
|
-
tags?: string[];
|
|
199
|
-
/**
|
|
200
|
-
* Render additional information in the Admin UI Model edit view
|
|
201
|
-
*/
|
|
202
|
-
renderInfo?: (params: {
|
|
203
|
-
field: CmsModelField;
|
|
204
|
-
model: CmsModel;
|
|
205
|
-
}) => React.ReactElement;
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
|
-
export interface CmsModelFieldRendererProps {
|
|
209
|
-
field: CmsModelField;
|
|
210
|
-
Label: React.FC;
|
|
211
|
-
getBind: (index?: number, key?: string) => BindComponent;
|
|
212
|
-
contentModel: CmsModel;
|
|
213
|
-
}
|
|
214
|
-
/**
|
|
215
|
-
* @deprecated Use `CmsModelFieldRendererProps`.
|
|
216
|
-
*/
|
|
217
|
-
export declare type CmsEditorFieldRendererProps = CmsModelFieldRendererProps;
|
|
218
|
-
/**
|
|
219
|
-
* @deprecated Use `CmsModelFieldRendererPlugin`.
|
|
220
|
-
*/
|
|
221
|
-
export declare type CmsEditorFieldRendererPlugin = CmsModelFieldRendererPlugin;
|
|
222
|
-
export interface CmsModelFieldRendererPlugin extends Plugin {
|
|
223
|
-
/**
|
|
224
|
-
* a plugin type
|
|
225
|
-
*/
|
|
226
|
-
type: "cms-editor-field-renderer";
|
|
227
|
-
renderer: {
|
|
228
|
-
/**
|
|
229
|
-
* Name of the renderer to match the one from `createField()` method in `CmsModelFieldTypePlugin`.
|
|
230
|
-
*
|
|
231
|
-
* ```ts
|
|
232
|
-
* renderName: "myFieldTypeRenderer"
|
|
233
|
-
* ```
|
|
234
|
-
*/
|
|
235
|
-
rendererName: string;
|
|
236
|
-
/**
|
|
237
|
-
* A display name for the field in the UI. It is a `ReactNode` type, so you can use a JSX element.
|
|
238
|
-
*
|
|
239
|
-
* ```tsx
|
|
240
|
-
* name: <MyFieldNameComponent />
|
|
241
|
-
* ```
|
|
242
|
-
*/
|
|
243
|
-
name: React.ReactNode;
|
|
244
|
-
/**
|
|
245
|
-
* A description for the field in the UI. Works exactly like the `name` property.
|
|
246
|
-
*
|
|
247
|
-
* ```tsx
|
|
248
|
-
* name: <MyFieldDescriptionComponent />
|
|
249
|
-
* ```
|
|
250
|
-
*/
|
|
251
|
-
description: React.ReactNode;
|
|
252
|
-
/**
|
|
253
|
-
* A method that determines if the field can be rendered by this plugin.
|
|
254
|
-
*
|
|
255
|
-
* ```ts
|
|
256
|
-
* canUse({ field }) {
|
|
257
|
-
* return (
|
|
258
|
-
* field.type === "myType" && !field.multipleValues
|
|
259
|
-
* );
|
|
260
|
-
* }
|
|
261
|
-
* ```
|
|
262
|
-
*/
|
|
263
|
-
canUse(props: {
|
|
264
|
-
field: CmsModelField;
|
|
265
|
-
fieldPlugin: CmsModelFieldTypePlugin;
|
|
266
|
-
}): boolean;
|
|
267
|
-
/**
|
|
268
|
-
* Renders a field in the UI.
|
|
269
|
-
*
|
|
270
|
-
* ```tsx
|
|
271
|
-
* render({ field, getBind }) {
|
|
272
|
-
* const Bind = getBind();
|
|
273
|
-
*
|
|
274
|
-
* return (
|
|
275
|
-
* <Bind>
|
|
276
|
-
* {bind => {
|
|
277
|
-
* return (
|
|
278
|
-
* <Input
|
|
279
|
-
* value={bind.value}
|
|
280
|
-
* onChange={bind.onChange}
|
|
281
|
-
* />
|
|
282
|
-
* )
|
|
283
|
-
* }}
|
|
284
|
-
* </Bind>
|
|
285
|
-
* );
|
|
286
|
-
* }
|
|
287
|
-
* ```
|
|
288
|
-
*/
|
|
289
|
-
render(props: CmsModelFieldRendererProps): React.ReactNode;
|
|
290
|
-
};
|
|
34
|
+
layoutField?: CmsLayoutField;
|
|
291
35
|
}
|
|
292
36
|
export interface CmsEditorFieldPredefinedValuesEntry {
|
|
293
37
|
label: string;
|
|
@@ -305,46 +49,89 @@ export interface CmsDynamicZoneTemplate {
|
|
|
305
49
|
description: string;
|
|
306
50
|
icon: string;
|
|
307
51
|
fields: CmsModelField[];
|
|
308
|
-
layout:
|
|
52
|
+
layout: CmsEditorFieldsLayout;
|
|
309
53
|
validation: CmsModelFieldValidator[];
|
|
54
|
+
tags?: string[];
|
|
55
|
+
componentName?: string;
|
|
310
56
|
}
|
|
311
|
-
export
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
export
|
|
316
|
-
|
|
57
|
+
export type CmsContentEntryStatusType = "draft" | "published" | "unpublished";
|
|
58
|
+
export interface CmsContentEntryLive {
|
|
59
|
+
version: number;
|
|
60
|
+
}
|
|
61
|
+
export interface CmsContentEntrySystem {
|
|
62
|
+
}
|
|
63
|
+
export interface CmsContentEntry<TValues extends GenericRecord = GenericRecord> {
|
|
317
64
|
id: string;
|
|
318
|
-
|
|
65
|
+
entryId: string;
|
|
319
66
|
modelId: string;
|
|
67
|
+
createdOn: string;
|
|
320
68
|
createdBy: CmsIdentity;
|
|
69
|
+
savedOn: string;
|
|
70
|
+
savedBy: CmsIdentity;
|
|
71
|
+
modifiedOn: string | null;
|
|
72
|
+
modifiedBy: CmsIdentity | null;
|
|
73
|
+
deletedOn: string | null;
|
|
74
|
+
deletedBy: CmsIdentity | null;
|
|
75
|
+
firstPublishedOn: string | null;
|
|
76
|
+
firstPublishedBy: CmsIdentity | null;
|
|
77
|
+
lastPublishedOn: string | null;
|
|
78
|
+
lastPublishedBy: CmsIdentity | null;
|
|
79
|
+
revisionCreatedOn: string;
|
|
80
|
+
revisionCreatedBy: CmsIdentity;
|
|
81
|
+
revisionSavedOn: string;
|
|
82
|
+
revisionSavedBy: CmsIdentity;
|
|
83
|
+
revisionModifiedOn: string | null;
|
|
84
|
+
revisionModifiedBy: CmsIdentity | null;
|
|
85
|
+
revisionDeletedOn: string | null;
|
|
86
|
+
revisionDeletedBy: CmsIdentity | null;
|
|
87
|
+
revisionFirstPublishedOn: string | null;
|
|
88
|
+
revisionFirstPublishedBy: CmsIdentity | null;
|
|
89
|
+
revisionLastPublishedOn: string | null;
|
|
90
|
+
revisionLastPublishedBy: CmsIdentity | null;
|
|
91
|
+
wbyAco_location: Location;
|
|
92
|
+
live: CmsContentEntryLive | null;
|
|
93
|
+
system: CmsContentEntrySystem | null;
|
|
321
94
|
meta: {
|
|
322
95
|
title: string;
|
|
323
96
|
description?: string;
|
|
324
97
|
image?: string;
|
|
325
|
-
publishedOn: string;
|
|
326
98
|
locked: boolean;
|
|
327
99
|
status: CmsContentEntryStatusType;
|
|
328
100
|
version: number;
|
|
329
101
|
};
|
|
330
|
-
|
|
102
|
+
revisionDescription?: string;
|
|
103
|
+
values: TValues;
|
|
331
104
|
}
|
|
332
105
|
export interface CmsContentEntryRevision {
|
|
333
106
|
id: string;
|
|
334
|
-
savedOn: string;
|
|
335
107
|
modelId: string;
|
|
108
|
+
savedOn: string;
|
|
109
|
+
deletedOn: string | null;
|
|
110
|
+
firstPublishedOn: string | null;
|
|
111
|
+
lastPublishedOn: string | null;
|
|
336
112
|
createdBy: CmsIdentity;
|
|
113
|
+
deletedBy: CmsIdentity | null;
|
|
114
|
+
revisionCreatedOn: string;
|
|
115
|
+
revisionSavedOn: string;
|
|
116
|
+
revisionModifiedOn: string | null;
|
|
117
|
+
revisionDeletedOn: string | null;
|
|
118
|
+
revisionFirstPublishedOn: string | null;
|
|
119
|
+
revisionLastPublishedOn: string | null;
|
|
120
|
+
revisionCreatedBy: CmsIdentity;
|
|
121
|
+
revisionSavedBy: CmsIdentity;
|
|
122
|
+
revisionModifiedBy: CmsIdentity | null;
|
|
123
|
+
revisionDeletedBy: CmsIdentity | null;
|
|
124
|
+
revisionFirstPublishedBy: CmsIdentity | null;
|
|
125
|
+
revisionLastPublishedBy: CmsIdentity | null;
|
|
126
|
+
wbyAco_location: Location;
|
|
127
|
+
revisionDescription?: string;
|
|
337
128
|
meta: {
|
|
338
129
|
title: string;
|
|
339
|
-
publishedOn: string;
|
|
340
130
|
locked: boolean;
|
|
341
131
|
status: CmsContentEntryStatusType;
|
|
342
132
|
version: number;
|
|
343
133
|
};
|
|
344
134
|
}
|
|
345
|
-
export declare type CmsEditorContentTab = React.FC<{
|
|
346
|
-
activeTab: boolean;
|
|
347
|
-
}>;
|
|
348
135
|
export interface CmsEditorFieldOptionPlugin extends Plugin {
|
|
349
136
|
type: "cms-editor-field-option";
|
|
350
137
|
render(): ReactElement;
|
|
@@ -352,24 +139,21 @@ export interface CmsEditorFieldOptionPlugin extends Plugin {
|
|
|
352
139
|
export interface CmsContentDetailsPlugin extends Plugin {
|
|
353
140
|
render: (params: any) => ReactNode;
|
|
354
141
|
}
|
|
355
|
-
export interface
|
|
356
|
-
row: number;
|
|
357
|
-
index: number | null;
|
|
358
|
-
}
|
|
359
|
-
export interface CmsEditorFormSettingsPlugin extends Plugin {
|
|
142
|
+
export interface CmsEditorFormSettingsPlugin<T = GenericRecord> extends Plugin {
|
|
360
143
|
type: "cms-editor-form-settings";
|
|
361
144
|
title: string;
|
|
362
145
|
description: string;
|
|
363
146
|
icon: React.ReactElement;
|
|
147
|
+
showSave?: boolean;
|
|
364
148
|
render(props: {
|
|
365
149
|
Bind: BaseBindComponent;
|
|
366
|
-
form: FormAPI
|
|
367
|
-
formData:
|
|
150
|
+
form: FormAPI<T>;
|
|
151
|
+
formData: T;
|
|
368
152
|
}): React.ReactNode;
|
|
369
153
|
renderHeaderActions?(props: {
|
|
370
154
|
Bind: BaseBindComponent;
|
|
371
|
-
form: FormAPI
|
|
372
|
-
formData:
|
|
155
|
+
form: FormAPI<T>;
|
|
156
|
+
formData: T;
|
|
373
157
|
}): React.ReactNode;
|
|
374
158
|
}
|
|
375
159
|
export interface CmsIcon {
|
|
@@ -388,7 +172,7 @@ export interface CmsIcon {
|
|
|
388
172
|
}
|
|
389
173
|
export interface CmsIconsPlugin extends Plugin {
|
|
390
174
|
type: "cms-icons";
|
|
391
|
-
getIcons():
|
|
175
|
+
getIcons(): IconPickerIconDto[];
|
|
392
176
|
}
|
|
393
177
|
/**
|
|
394
178
|
* Transform field value when sending data to the API.
|
|
@@ -446,15 +230,15 @@ export interface CmsContentFormRendererPlugin extends Plugin {
|
|
|
446
230
|
* Data types
|
|
447
231
|
* #########################
|
|
448
232
|
*/
|
|
449
|
-
export interface CmsSecurityPermission extends
|
|
233
|
+
export interface CmsSecurityPermission extends Identity.Permission {
|
|
450
234
|
accessLevel?: "full" | "no" | "custom";
|
|
451
|
-
models?:
|
|
452
|
-
groups?:
|
|
235
|
+
models?: string[];
|
|
236
|
+
groups?: string[];
|
|
453
237
|
endpoints?: string[];
|
|
454
|
-
locales?: string[];
|
|
455
238
|
rwd?: string;
|
|
456
239
|
own?: boolean;
|
|
457
240
|
pw?: string;
|
|
241
|
+
_src?: string;
|
|
458
242
|
}
|
|
459
243
|
/**
|
|
460
244
|
* @category GraphQL
|
|
@@ -463,7 +247,7 @@ export interface CmsSecurityPermission extends SecurityPermission {
|
|
|
463
247
|
export interface CmsErrorResponse {
|
|
464
248
|
message: string;
|
|
465
249
|
code: string;
|
|
466
|
-
data
|
|
250
|
+
data?: Record<string, any> | null;
|
|
467
251
|
}
|
|
468
252
|
/**
|
|
469
253
|
* @category GraphQL
|
|
@@ -477,7 +261,7 @@ export interface CmsMetaResponse {
|
|
|
477
261
|
/***
|
|
478
262
|
* ###### FORM ########
|
|
479
263
|
*/
|
|
480
|
-
export interface BindComponentRenderProp<T = any
|
|
264
|
+
export interface BindComponentRenderProp<T = any> extends BaseBindComponentRenderProp<T> {
|
|
481
265
|
parentName: string;
|
|
482
266
|
appendValue: (value: any, index?: number) => void;
|
|
483
267
|
prependValue: (value: any) => void;
|
|
@@ -486,12 +270,15 @@ export interface BindComponentRenderProp<T = any, F = Record<string, any>> exten
|
|
|
486
270
|
moveValueUp: (index: number) => void;
|
|
487
271
|
moveValueDown: (index: number) => void;
|
|
488
272
|
}
|
|
489
|
-
interface BindComponentProps extends Omit<BaseBindComponentProps, "children" | "name"> {
|
|
273
|
+
interface BindComponentProps<T = any> extends Omit<BaseBindComponentProps, "children" | "name"> {
|
|
490
274
|
name?: string;
|
|
491
|
-
children?: ((props: BindComponentRenderProp) => React.ReactElement) | React.ReactElement;
|
|
275
|
+
children?: ((props: BindComponentRenderProp<T>) => React.ReactElement) | React.ReactElement;
|
|
492
276
|
}
|
|
493
|
-
export
|
|
494
|
-
parentName
|
|
277
|
+
export type BindComponent<T = any> = React.ComponentType<BindComponentProps<T>> & {
|
|
278
|
+
parentName: string;
|
|
279
|
+
ValidationContainer: React.ComponentType<{
|
|
280
|
+
children: React.ReactNode;
|
|
281
|
+
}>;
|
|
495
282
|
};
|
|
496
283
|
/**
|
|
497
284
|
* After RequestReview and RequestChanges was removed, we need an option to add new status filters
|