@webiny/app-headless-cms-common 6.0.0-rc.2 → 6.0.0-rc.4

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.
Files changed (59) hide show
  1. package/Fields/FieldRulesProvider.d.ts +9 -0
  2. package/Fields/FieldRulesProvider.js +20 -0
  3. package/Fields/FieldRulesProvider.js.map +1 -0
  4. package/Fields/Fields.js +127 -14
  5. package/Fields/Fields.js.map +1 -1
  6. package/Fields/LayoutDescriptorCell.d.ts +12 -0
  7. package/Fields/LayoutDescriptorCell.js +47 -0
  8. package/Fields/LayoutDescriptorCell.js.map +1 -0
  9. package/Fields/evaluateExpression.d.ts +23 -0
  10. package/Fields/evaluateExpression.js +102 -0
  11. package/Fields/evaluateExpression.js.map +1 -0
  12. package/Fields/fieldOptions.d.ts +36 -0
  13. package/Fields/fieldOptions.js +113 -0
  14. package/Fields/fieldOptions.js.map +1 -0
  15. package/Fields/index.d.ts +5 -0
  16. package/Fields/index.js +5 -0
  17. package/Fields/index.js.map +1 -1
  18. package/Fields/layoutFieldRenderers/AlertFieldRenderer.d.ts +7 -0
  19. package/Fields/layoutFieldRenderers/AlertFieldRenderer.js +13 -0
  20. package/Fields/layoutFieldRenderers/AlertFieldRenderer.js.map +1 -0
  21. package/Fields/layoutFieldRenderers/SeparatorFieldRenderer.d.ts +7 -0
  22. package/Fields/layoutFieldRenderers/SeparatorFieldRenderer.js +18 -0
  23. package/Fields/layoutFieldRenderers/SeparatorFieldRenderer.js.map +1 -0
  24. package/Fields/layoutFieldRenderers/TabsFieldRenderer.d.ts +12 -0
  25. package/Fields/layoutFieldRenderers/TabsFieldRenderer.js +72 -0
  26. package/Fields/layoutFieldRenderers/TabsFieldRenderer.js.map +1 -0
  27. package/Fields/operatorOptions.d.ts +10 -0
  28. package/Fields/operatorOptions.js +92 -0
  29. package/Fields/operatorOptions.js.map +1 -0
  30. package/Fields/useBind.d.ts +1 -0
  31. package/Fields/useBind.js +7 -3
  32. package/Fields/useBind.js.map +1 -1
  33. package/Fields/useFieldRules.d.ts +32 -0
  34. package/Fields/useFieldRules.js +153 -0
  35. package/Fields/useFieldRules.js.map +1 -0
  36. package/ModelFieldProvider/CanEditField.d.ts +5 -0
  37. package/ModelFieldProvider/CanEditField.js +13 -0
  38. package/ModelFieldProvider/CanEditField.js.map +1 -0
  39. package/ModelFieldProvider/ModelFieldContext.d.ts +1 -0
  40. package/ModelFieldProvider/index.d.ts +1 -0
  41. package/ModelFieldProvider/index.js +1 -0
  42. package/ModelFieldProvider/index.js.map +1 -1
  43. package/ModelFieldProvider/useModelField.js +1 -1
  44. package/ModelFieldProvider/useModelField.js.map +1 -1
  45. package/exports/admin/cms/model.d.ts +2 -0
  46. package/exports/admin/cms/model.js +3 -0
  47. package/exports/admin/cms/model.js.map +1 -0
  48. package/exports/admin/cms.d.ts +1 -1
  49. package/exports/admin/cms.js.map +1 -1
  50. package/normalizeIcon.d.ts +3 -0
  51. package/normalizeIcon.js +10 -0
  52. package/normalizeIcon.js.map +1 -0
  53. package/package.json +11 -10
  54. package/types/index.d.ts +59 -3
  55. package/types/index.js +51 -1
  56. package/types/index.js.map +1 -1
  57. package/types/model.d.ts +53 -2
  58. package/types/model.js +27 -1
  59. package/types/model.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./ModelFieldContext.js\";\nexport * from \"./useModelField.js\";\n"],"mappings":"AAAA;AACA","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./ModelFieldContext.js\";\nexport * from \"./useModelField.js\";\nexport * from \"./CanEditField.js\";\n"],"mappings":"AAAA;AACA;AACA","ignoreList":[]}
@@ -14,10 +14,10 @@ const getFieldPlugin = type => {
14
14
  */
15
15
  export const useModelField = makeDecoratable(() => {
16
16
  const field = useContext(ModelFieldContext);
17
- const parentValueIndex = useParentValueIndex();
18
17
  if (!field) {
19
18
  throw Error(`Missing "ModelFieldProvider" in the component tree. Are you using the "useModelField()" hook in the right place?`);
20
19
  }
20
+ const parentValueIndex = useParentValueIndex();
21
21
  const fieldPlugin = getFieldPlugin(field.type);
22
22
  return {
23
23
  field,
@@ -1 +1 @@
1
- {"version":3,"names":["useContext","plugins","makeDecoratable","ModelFieldContext","useParentValueIndex","getFieldPlugin","type","plugin","byType","find","field","Error","useModelField","parentValueIndex","fieldPlugin"],"sources":["useModelField.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport { plugins } from \"@webiny/plugins\";\nimport { makeDecoratable } from \"@webiny/react-composition\";\nimport { ModelFieldContext, useParentValueIndex } from \"./ModelFieldContext.js\";\nimport type { CmsModelField, CmsModelFieldTypePlugin } from \"~/types/index.js\";\n\ninterface GetFieldPlugin {\n (type: string): CmsModelFieldTypePlugin;\n}\n\nconst getFieldPlugin: GetFieldPlugin = type => {\n const plugin = plugins\n .byType<CmsModelFieldTypePlugin>(\"cms-editor-field-type\")\n .find(plugin => plugin.field.type === type);\n\n if (!plugin) {\n throw Error(`Missing plugin for field type \"${type}\"!`);\n }\n\n return plugin;\n};\n\nexport interface UseModelField {\n field: CmsModelField;\n parentValueIndex: number;\n fieldPlugin: CmsModelFieldTypePlugin;\n}\n\n/**\n * Get model field from the current context.\n */\nexport const useModelField = makeDecoratable((): UseModelField => {\n const field = useContext(ModelFieldContext);\n const parentValueIndex = useParentValueIndex();\n\n if (!field) {\n throw Error(\n `Missing \"ModelFieldProvider\" in the component tree. Are you using the \"useModelField()\" hook in the right place?`\n );\n }\n\n const fieldPlugin = getFieldPlugin(field.type);\n\n return { field, fieldPlugin, parentValueIndex };\n});\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,OAAO;AAClC,SAASC,OAAO,QAAQ,iBAAiB;AACzC,SAASC,eAAe,QAAQ,2BAA2B;AAC3D,SAASC,iBAAiB,EAAEC,mBAAmB;AAO/C,MAAMC,cAA8B,GAAGC,IAAI,IAAI;EAC3C,MAAMC,MAAM,GAAGN,OAAO,CACjBO,MAAM,CAA0B,uBAAuB,CAAC,CACxDC,IAAI,CAACF,MAAM,IAAIA,MAAM,CAACG,KAAK,CAACJ,IAAI,KAAKA,IAAI,CAAC;EAE/C,IAAI,CAACC,MAAM,EAAE;IACT,MAAMI,KAAK,CAAC,kCAAkCL,IAAI,IAAI,CAAC;EAC3D;EAEA,OAAOC,MAAM;AACjB,CAAC;AAQD;AACA;AACA;AACA,OAAO,MAAMK,aAAa,GAAGV,eAAe,CAAC,MAAqB;EAC9D,MAAMQ,KAAK,GAAGV,UAAU,CAACG,iBAAiB,CAAC;EAC3C,MAAMU,gBAAgB,GAAGT,mBAAmB,CAAC,CAAC;EAE9C,IAAI,CAACM,KAAK,EAAE;IACR,MAAMC,KAAK,CACP,kHACJ,CAAC;EACL;EAEA,MAAMG,WAAW,GAAGT,cAAc,CAACK,KAAK,CAACJ,IAAI,CAAC;EAE9C,OAAO;IAAEI,KAAK;IAAEI,WAAW;IAAED;EAAiB,CAAC;AACnD,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["useContext","plugins","makeDecoratable","ModelFieldContext","useParentValueIndex","getFieldPlugin","type","plugin","byType","find","field","Error","useModelField","parentValueIndex","fieldPlugin"],"sources":["useModelField.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport { plugins } from \"@webiny/plugins\";\nimport { makeDecoratable } from \"@webiny/react-composition\";\nimport { ModelFieldContext, useParentValueIndex } from \"./ModelFieldContext.js\";\nimport type { CmsModelField, CmsModelFieldTypePlugin } from \"~/types/index.js\";\n\ninterface GetFieldPlugin {\n (type: string): CmsModelFieldTypePlugin;\n}\n\nconst getFieldPlugin: GetFieldPlugin = type => {\n const plugin = plugins\n .byType<CmsModelFieldTypePlugin>(\"cms-editor-field-type\")\n .find(plugin => plugin.field.type === type);\n\n if (!plugin) {\n throw Error(`Missing plugin for field type \"${type}\"!`);\n }\n\n return plugin;\n};\n\nexport interface UseModelField {\n field: CmsModelField;\n parentValueIndex: number;\n fieldPlugin: CmsModelFieldTypePlugin;\n}\n\n/**\n * Get model field from the current context.\n */\nexport const useModelField = makeDecoratable((): UseModelField => {\n const field = useContext(ModelFieldContext);\n\n if (!field) {\n throw Error(\n `Missing \"ModelFieldProvider\" in the component tree. Are you using the \"useModelField()\" hook in the right place?`\n );\n }\n\n const parentValueIndex = useParentValueIndex();\n\n const fieldPlugin = getFieldPlugin(field.type);\n\n return { field, fieldPlugin, parentValueIndex };\n});\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,OAAO;AAClC,SAASC,OAAO,QAAQ,iBAAiB;AACzC,SAASC,eAAe,QAAQ,2BAA2B;AAC3D,SAASC,iBAAiB,EAAEC,mBAAmB;AAO/C,MAAMC,cAA8B,GAAGC,IAAI,IAAI;EAC3C,MAAMC,MAAM,GAAGN,OAAO,CACjBO,MAAM,CAA0B,uBAAuB,CAAC,CACxDC,IAAI,CAACF,MAAM,IAAIA,MAAM,CAACG,KAAK,CAACJ,IAAI,KAAKA,IAAI,CAAC;EAE/C,IAAI,CAACC,MAAM,EAAE;IACT,MAAMI,KAAK,CAAC,kCAAkCL,IAAI,IAAI,CAAC;EAC3D;EAEA,OAAOC,MAAM;AACjB,CAAC;AAQD;AACA;AACA;AACA,OAAO,MAAMK,aAAa,GAAGV,eAAe,CAAC,MAAqB;EAC9D,MAAMQ,KAAK,GAAGV,UAAU,CAACG,iBAAiB,CAAC;EAE3C,IAAI,CAACO,KAAK,EAAE;IACR,MAAMC,KAAK,CACP,kHACJ,CAAC;EACL;EAEA,MAAME,gBAAgB,GAAGT,mBAAmB,CAAC,CAAC;EAE9C,MAAMU,WAAW,GAAGT,cAAc,CAACK,KAAK,CAACJ,IAAI,CAAC;EAE9C,OAAO;IAAEI,KAAK;IAAEI,WAAW;IAAED;EAAiB,CAAC;AACnD,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export { useFieldAccessControlRules, useEffectiveRules } from "../../../Fields/index.js";
2
+ export type { CmsLayoutFieldTypePlugin, CmsLayoutDescriptorRendererPlugin, CmsBaseLayoutDescriptor, CmsLayoutDescriptor } from "../../../types/index.ts";
@@ -0,0 +1,3 @@
1
+ export { useFieldAccessControlRules, useEffectiveRules } from "../../../Fields/index.js";
2
+
3
+ //# sourceMappingURL=model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useFieldAccessControlRules","useEffectiveRules"],"sources":["model.ts"],"sourcesContent":["export { useFieldAccessControlRules, useEffectiveRules } from \"~/Fields/index.js\";\n\nexport type {\n CmsLayoutFieldTypePlugin,\n CmsLayoutDescriptorRendererPlugin,\n CmsBaseLayoutDescriptor,\n CmsLayoutDescriptor\n} from \"~/types/index.ts\";\n"],"mappings":"AAAA,SAASA,0BAA0B,EAAEC,iBAAiB","ignoreList":[]}
@@ -1 +1 @@
1
- export type { CmsContentEntry, CmsModel, CmsModelField, CmsIdentity } from "../../types/index.ts";
1
+ export type { CmsContentEntry, CmsModel, CmsModelField, CmsIdentity, CmsLayoutFieldTypePlugin, CmsLayoutDescriptorRendererPlugin, CmsBaseLayoutDescriptor, CmsLayoutDescriptor } from "../../types/index.ts";
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["cms.ts"],"sourcesContent":["export type { CmsContentEntry, CmsModel, CmsModelField, CmsIdentity } from \"~/types/index.ts\";\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["cms.ts"],"sourcesContent":["export type {\n CmsContentEntry,\n CmsModel,\n CmsModelField,\n CmsIdentity,\n CmsLayoutFieldTypePlugin,\n CmsLayoutDescriptorRendererPlugin,\n CmsBaseLayoutDescriptor,\n CmsLayoutDescriptor\n} from \"~/types/index.ts\";\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ import type { IconProp } from "@fortawesome/fontawesome-svg-core";
2
+ import type { CmsIcon } from "./types/index.js";
3
+ export declare const normalizeIcon: (icon: string | CmsIcon | undefined) => IconProp | undefined;
@@ -0,0 +1,10 @@
1
+ export const normalizeIcon = icon => {
2
+ let iconName = undefined;
3
+ if (icon) {
4
+ const name = typeof icon === "string" ? icon : icon.name;
5
+ iconName = name.split("/");
6
+ }
7
+ return iconName;
8
+ };
9
+
10
+ //# sourceMappingURL=normalizeIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["normalizeIcon","icon","iconName","undefined","name","split"],"sources":["normalizeIcon.ts"],"sourcesContent":["import type { IconProp } from \"@fortawesome/fontawesome-svg-core\";\nimport type { CmsIcon } from \"~/types/index.js\";\n\nexport const normalizeIcon = (icon: string | CmsIcon | undefined) => {\n let iconName: IconProp | undefined = undefined;\n if (icon) {\n const name = typeof icon === \"string\" ? icon : icon.name;\n iconName = name.split(\"/\") as IconProp;\n }\n return iconName;\n};\n"],"mappings":"AAGA,OAAO,MAAMA,aAAa,GAAIC,IAAkC,IAAK;EACjE,IAAIC,QAA8B,GAAGC,SAAS;EAC9C,IAAIF,IAAI,EAAE;IACN,MAAMG,IAAI,GAAG,OAAOH,IAAI,KAAK,QAAQ,GAAGA,IAAI,GAAGA,IAAI,CAACG,IAAI;IACxDF,QAAQ,GAAGE,IAAI,CAACC,KAAK,CAAC,GAAG,CAAa;EAC1C;EACA,OAAOH,QAAQ;AACnB,CAAC","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/app-headless-cms-common",
3
- "version": "6.0.0-rc.2",
3
+ "version": "6.0.0-rc.4",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -17,13 +17,14 @@
17
17
  "@emotion/react": "11.10.8",
18
18
  "@emotion/styled": "11.10.6",
19
19
  "@fortawesome/fontawesome-svg-core": "1.3.0",
20
- "@webiny/admin-ui": "6.0.0-rc.2",
21
- "@webiny/app": "6.0.0-rc.2",
22
- "@webiny/app-admin": "6.0.0-rc.2",
23
- "@webiny/form": "6.0.0-rc.2",
24
- "@webiny/plugins": "6.0.0-rc.2",
25
- "@webiny/react-composition": "6.0.0-rc.2",
26
- "@webiny/validation": "6.0.0-rc.2",
20
+ "@fortawesome/react-fontawesome": "0.1.19",
21
+ "@webiny/admin-ui": "6.0.0-rc.4",
22
+ "@webiny/app": "6.0.0-rc.4",
23
+ "@webiny/app-admin": "6.0.0-rc.4",
24
+ "@webiny/form": "6.0.0-rc.4",
25
+ "@webiny/plugins": "6.0.0-rc.4",
26
+ "@webiny/react-composition": "6.0.0-rc.4",
27
+ "@webiny/validation": "6.0.0-rc.4",
27
28
  "dnd-core": "16.0.1",
28
29
  "graphql": "16.13.0",
29
30
  "graphql-tag": "2.12.6",
@@ -34,7 +35,7 @@
34
35
  "devDependencies": {
35
36
  "@emotion/babel-plugin": "11.13.5",
36
37
  "@types/react": "18.2.79",
37
- "@webiny/build-tools": "6.0.0-rc.2",
38
+ "@webiny/build-tools": "6.0.0-rc.4",
38
39
  "babel-plugin-module-resolver": "5.0.2",
39
40
  "rimraf": "6.1.3",
40
41
  "typescript": "5.9.3"
@@ -43,5 +44,5 @@
43
44
  "access": "public",
44
45
  "directory": "dist"
45
46
  },
46
- "gitHead": "5facada4cbb8617cc60e3c98be0f1839f44be38e"
47
+ "gitHead": "e2758ee1cfa3b9a7152e9bb995a90ccabd33266f"
47
48
  }
package/types/index.d.ts CHANGED
@@ -4,7 +4,7 @@ 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
6
  import type { CmsModelFieldValidator, CmsModelFieldValidatorsFactory, CmsModelFieldValidatorsGroup } from "./validation.js";
7
- import type { CmsModel, CmsModelField } from "./model.js";
7
+ import type { CmsBaseLayoutDescriptor, CmsEditorFieldsLayout, CmsLayoutDescriptor, CmsModel, CmsModelField } from "./model.js";
8
8
  import type { CmsIdentity } from "../types/shared.js";
9
9
  import type { SourceType } from "dnd-core";
10
10
  import type { IconPickerIconDto } from "@webiny/admin-ui";
@@ -15,6 +15,7 @@ export type DragObjectWithType = {
15
15
  };
16
16
  export type * from "./validation.js";
17
17
  export type * from "./model.js";
18
+ export { isLayoutDescriptor } from "./model.js";
18
19
  export type * from "./shared.js";
19
20
  interface QueryFieldParams {
20
21
  model: CmsModel;
@@ -31,10 +32,12 @@ interface Location {
31
32
  export interface DragSource extends DragObjectWithType {
32
33
  parent?: string;
33
34
  pos?: Partial<Position>;
34
- type: "row" | "field" | "newField";
35
+ type: "row" | "field" | "newField" | "newLayoutField" | "layoutField";
35
36
  fieldType?: string;
37
+ layoutFieldType?: string;
36
38
  field?: CmsModelField | null;
37
39
  fields?: CmsModelField[];
40
+ descriptor?: CmsLayoutDescriptor;
38
41
  }
39
42
  /**
40
43
  * @deprecated Use `CmsModelFieldTypePlugin`.
@@ -219,6 +222,59 @@ export interface CmsModelFieldTypePlugin extends Plugin {
219
222
  }) => React.ReactElement;
220
223
  };
221
224
  }
225
+ export interface CmsLayoutFieldTypePlugin extends Plugin {
226
+ type: "cms-editor-layout-field-type";
227
+ field: {
228
+ type: CmsLayoutDescriptor["type"];
229
+ label: string;
230
+ description: string;
231
+ icon: React.ReactElement;
232
+ createDescriptor(): Omit<CmsLayoutDescriptor, "id">;
233
+ canEditSettings?: boolean;
234
+ renderSettings?(): React.ReactNode;
235
+ /**
236
+ * Collect all model fields embedded inside a layout descriptor's nested layout.
237
+ * Used during drag-and-drop to move embedded fields along with the descriptor
238
+ * across parent boundaries. Return `[]` or omit for descriptors with no nested fields.
239
+ */
240
+ collectFields?(params: {
241
+ descriptor: CmsLayoutDescriptor;
242
+ getField: (id: string) => CmsModelField | undefined;
243
+ }): CmsModelField[];
244
+ /**
245
+ * Return a label prefix for each field ID nested inside this layout descriptor.
246
+ * Used by `buildFieldOptions` to include layout hierarchy in field labels.
247
+ *
248
+ * For example, a tabs descriptor with label "My Tabs" containing a tab "SEO"
249
+ * with field "metaTitle" would return: `{ "metaTitle": "My Tabs › SEO" }`.
250
+ *
251
+ * Omit or return `{}` for descriptors that don't group fields.
252
+ */
253
+ getFieldLabelPrefixes?(params: {
254
+ descriptor: CmsLayoutDescriptor;
255
+ }): Record<string, string>;
256
+ /**
257
+ * Controls how this layout field looks on the model editor canvas.
258
+ * Each plugin fully owns its visual representation.
259
+ */
260
+ render(params: {
261
+ descriptor: CmsLayoutDescriptor;
262
+ onUpdate: (d: CmsLayoutDescriptor) => void;
263
+ onDelete: () => void;
264
+ }): React.ReactElement;
265
+ };
266
+ }
267
+ export interface CmsLayoutDescriptorRendererPlugin extends Plugin {
268
+ type: "cms-layout-descriptor-renderer";
269
+ descriptorType: string;
270
+ render(props: {
271
+ descriptor: CmsBaseLayoutDescriptor;
272
+ Bind: BindComponent;
273
+ fields: CmsModelField[];
274
+ contentModel: CmsModel;
275
+ gridClassName?: string;
276
+ }): React.ReactElement | null;
277
+ }
222
278
  export interface CmsModelFieldRendererSettingsProps {
223
279
  field: CmsModelField;
224
280
  }
@@ -324,7 +380,7 @@ export interface CmsDynamicZoneTemplate {
324
380
  description: string;
325
381
  icon: string;
326
382
  fields: CmsModelField[];
327
- layout: string[][];
383
+ layout: CmsEditorFieldsLayout;
328
384
  validation: CmsModelFieldValidator[];
329
385
  tags?: string[];
330
386
  }
package/types/index.js CHANGED
@@ -1,3 +1,53 @@
1
- export {};
1
+ export { isLayoutDescriptor } from "./model.js";
2
+
3
+ /**
4
+ * @deprecated Use `CmsModelFieldTypePlugin`.
5
+ */
6
+
7
+ /**
8
+ * @deprecated Use `CmsModelFieldRendererProps`.
9
+ */
10
+
11
+ /**
12
+ * @deprecated Use `CmsModelFieldRendererPlugin`.
13
+ */
14
+
15
+ /**
16
+ * @deprecated Use `CmsContentEntry`.
17
+ */
18
+
19
+ // ------------------------------------------------------------------------------------------------------------
20
+
21
+ /**
22
+ * Transform field value when sending data to the API.
23
+ */
24
+
25
+ /**
26
+ * Define a custom form layout renderer for a specific content model.
27
+ */
28
+
29
+ /**
30
+ * #########################
31
+ * Data types
32
+ * #########################
33
+ */
34
+
35
+ /**
36
+ * @category GraphQL
37
+ * @category Error
38
+ */
39
+
40
+ /**
41
+ * @category GraphQL
42
+ * @category Meta
43
+ */
44
+
45
+ /***
46
+ * ###### FORM ########
47
+ */
48
+
49
+ /**
50
+ * After RequestReview and RequestChanges was removed, we need an option to add new status filters
51
+ */
2
52
 
3
53
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["import type * as React from \"react\";\nimport type { ReactElement, ReactNode } from \"react\";\nimport type { Plugin } from \"@webiny/plugins/types.js\";\nimport type {\n BindComponent as BaseBindComponent,\n BindComponentProps as BaseBindComponentProps,\n BindComponentRenderProp as BaseBindComponentRenderProp,\n FormAPI\n} from \"@webiny/form\";\nimport type { IconName, IconPrefix } from \"@fortawesome/fontawesome-svg-core\";\nimport type {\n CmsModelFieldValidator,\n CmsModelFieldValidatorsFactory,\n CmsModelFieldValidatorsGroup\n} from \"./validation.js\";\nimport type { CmsModel, CmsModelField } from \"./model.js\";\nimport type { CmsIdentity } from \"~/types/shared.js\";\nimport type { SourceType } from \"dnd-core\";\nimport type { IconPickerIconDto } from \"@webiny/admin-ui\";\nimport { GenericRecord } from \"@webiny/app/types.js\";\nimport { Identity } from \"@webiny/app-admin/domain/Identity.js\";\n\nexport type DragObjectWithType = {\n type: SourceType;\n};\n\nexport type * from \"./validation.js\";\nexport type * from \"./model.js\";\nexport type * from \"./shared.js\";\n\ninterface QueryFieldParams {\n model: CmsModel;\n field: CmsModelField;\n graphQLTypePrefix: string;\n}\n\ninterface Position {\n row: number;\n index: number;\n}\n\ninterface Location {\n folderId: string;\n}\n\nexport interface DragSource extends DragObjectWithType {\n parent?: string;\n pos?: Partial<Position>;\n type: \"row\" | \"field\" | \"newField\";\n fieldType?: string;\n field?: CmsModelField | null;\n fields?: CmsModelField[];\n}\n\n/**\n * @deprecated Use `CmsModelFieldTypePlugin`.\n */\nexport type CmsEditorFieldTypePlugin = CmsModelFieldTypePlugin;\n\nexport interface CmsModelFieldTypePlugin extends Plugin {\n /**\n * a plugin type\n */\n type: \"cms-editor-field-type\";\n field: {\n /**\n * A unique identifier of the field type (text, number, json, myField, ...).\n *\n * ```ts\n * type: \"myField\"\n * ```\n */\n type: string;\n /**\n * A display name for the field.\n *\n * ```ts\n * label: \"Field name\"\n * ```\n */\n label: string;\n /**\n * A list of available validators for the model field.\n *\n * ```ts\n * validators: [\n * \"required\",\n * \"gte\",\n * \"lte\"\n * ]\n * ```\n */\n validators?: string[] | CmsModelFieldValidatorsGroup | CmsModelFieldValidatorsFactory;\n /**\n * A list of available validators when a model field accepts a list (array) of values.\n *\n * ```ts\n * listValidators: [\n * \"minLength\",\n * \"maxLength\"\n * ]\n * ```\n */\n listValidators?: string[] | CmsModelFieldValidatorsGroup | CmsModelFieldValidatorsFactory;\n /**\n * An explanation of the field displayed beneath the label.\n *\n * ```ts\n * description: \"A short description of the field\"\n * ```\n */\n description: string;\n /**\n * A ReactNode to display the icon for the field.\n *\n * ```tsx\n * icon: <MyIconComponent />\n * ```\n */\n icon: React.ReactNode;\n /**\n * Is it allowed to have multiple values in this field?\n *\n * ```ts\n * allowList: true\n * ```\n */\n allowList?: boolean;\n /**\n * Does this field type have a fixed list of values that can be selected?\n *\n * ```ts\n * allowPredefinedValues: false\n * ```\n */\n allowPredefinedValues?: boolean;\n /**\n * A ReactNode label when multiple values are enabled.\n */\n listLabel?: React.ReactNode;\n /**\n * Determines if this field type should be hidden from the admin UI.\n * If set to `true`, the field type will not be visible or selectable in the admin interface.\n */\n hideInAdmin?: boolean;\n /**\n * These are default values when the field is first created. This is a representation of the field that is stored in the database.\n *\n * ```ts\n * createField: () => ({\n * type: \"fieldType\",\n * validation: [],\n * renderer: {\n * name: \"fieldTypeRenderer\"\n * }\n * })\n * ```\n */\n createField: () => Pick<CmsModelField, \"type\" | \"validation\" | \"renderer\" | \"settings\">;\n /**\n * If `true` (default), this field will be configurable via a settings dialog.\n * If `false`, a user will not be able to open the settings dialog, not will the dialog be opened on field drop.\n */\n canEditSettings?: boolean;\n /**\n * Determine if a `draggable` can be dropped into this field.\n * NOTE: This is only applicable to nested field types.\n */\n canAccept?(field: CmsModelField, draggable: DragSource): boolean;\n /**\n * If `true` (default), will allow fields to be laid out into columns (next to each other).\n * If `false`, horizontal layout will not be allowed.\n * NOTE: This is only applicable to nested field types.\n */\n allowLayout?: boolean;\n /**\n * A ReactNode that you can add in the section below the help text when creating/editing field.\n *\n * ```tsx\n * renderSettings: (params) => {\n * return <FieldSettingsComponent />;\n * }\n * ```\n */\n renderSettings?: (params: {\n afterChangeLabel: (value: string) => void;\n uniqueFieldIdValidator: (fieldId: string) => void;\n contentModel: CmsModel;\n }) => React.ReactNode;\n /**\n * A ReactNode that renders in the Predefined values tab.\n *\n * ```tsx\n * renderPredefinedValues: (params) => {\n * const {form: {Bind}} = params;\n * return (\n * <Bind name=\"fieldProperty\">\n * <InputComponent />\n * </Bind>\n * );\n * }\n * ```\n */\n renderPredefinedValues?: (params: {\n getBind: (index?: number) => any;\n }) => React.ReactElement;\n /**\n * Object wrapper for GraphQL stuff\n */\n graphql?: {\n /**\n * Define field selection.\n *\n * ```ts\n * graphql: {\n * queryField: `\n * {\n * id\n * title\n * createdOn\n * }\n * `,\n * }\n * ```\n */\n queryField?: string | ((params: QueryFieldParams) => string | null);\n };\n render?(params: any): React.ReactElement;\n tags?: string[];\n /**\n * Render additional information in the Admin UI Model edit view\n */\n renderInfo?: (params: { field: CmsModelField; model: CmsModel }) => React.ReactElement;\n };\n}\n\nexport interface CmsModelFieldRendererSettingsProps {\n field: CmsModelField;\n}\n\nexport interface CmsModelFieldRendererProps {\n field: CmsModelField;\n Label: React.ComponentType<React.PropsWithChildren>;\n getBind: <T = any>(index?: number, key?: string) => BindComponent<T>;\n contentModel: CmsModel;\n}\n\n/**\n * @deprecated Use `CmsModelFieldRendererProps`.\n */\nexport type CmsEditorFieldRendererProps = CmsModelFieldRendererProps;\n\n/**\n * @deprecated Use `CmsModelFieldRendererPlugin`.\n */\nexport type CmsEditorFieldRendererPlugin = CmsModelFieldRendererPlugin;\n\nexport interface CmsModelFieldRendererPlugin extends Plugin {\n /**\n * a plugin type\n */\n type: \"cms-editor-field-renderer\";\n renderer: {\n /**\n * Name of the renderer to match the one from `createField()` method in `CmsModelFieldTypePlugin`.\n *\n * ```ts\n * renderName: \"myFieldTypeRenderer\"\n * ```\n */\n rendererName: string;\n /**\n * A display name for the field in the UI. It is a `ReactNode` type, so you can use a JSX element.\n *\n * ```tsx\n * name: <MyFieldNameComponent />\n * ```\n */\n name: React.ReactNode;\n /**\n * A description for the field in the UI. Works exactly like the `name` property.\n *\n * ```tsx\n * name: <MyFieldDescriptionComponent />\n * ```\n */\n description: React.ReactNode;\n /**\n * A method that determines if the field can be rendered by this plugin.\n *\n * ```ts\n * canUse({ field }) {\n * return (\n * field.type === \"myType\" && !field.list\n * );\n * }\n * ```\n */\n canUse(props: {\n field: CmsModelField;\n fieldPlugin: CmsModelFieldTypePlugin;\n model: CmsModel;\n }): boolean;\n /**\n * Renders a field in the UI.\n *\n * ```tsx\n * render({ field, getBind }) {\n * const Bind = getBind();\n *\n * return (\n * <Bind>\n * {bind => {\n * return (\n * <Input\n * value={bind.value}\n * onChange={bind.onChange}\n * />\n * )\n * }}\n * </Bind>\n * );\n * }\n * ```\n */\n render(props: CmsModelFieldRendererProps): React.ReactNode;\n renderSettings?: (props: CmsModelFieldRendererSettingsProps) => React.ReactNode;\n };\n}\n\nexport interface CmsEditorFieldPredefinedValuesEntry {\n label: string;\n value: string;\n selected?: boolean;\n}\n\nexport interface CmsEditorFieldPredefinedValues {\n enabled: boolean;\n values: CmsEditorFieldPredefinedValuesEntry[];\n}\n\nexport interface CmsDynamicZoneTemplate {\n id: string;\n name: string;\n gqlTypeName: string;\n description: string;\n icon: string;\n fields: CmsModelField[];\n layout: string[][];\n validation: CmsModelFieldValidator[];\n tags?: string[];\n}\n\nexport interface CmsDynamicZoneTemplateWithTypename extends CmsDynamicZoneTemplate {\n __typename: string;\n}\n\nexport type CmsContentEntryStatusType = \"draft\" | \"published\" | \"unpublished\";\n\n/**\n * @deprecated Use `CmsContentEntry`.\n */\nexport type CmsEditorContentEntry = CmsContentEntry;\n\nexport interface CmsContentEntryLive {\n version: number;\n}\n\nexport interface CmsContentEntrySystem {\n // to be extended\n}\n\nexport interface CmsContentEntry<TValues extends GenericRecord = GenericRecord> {\n id: string;\n entryId: string;\n modelId: string;\n createdOn: string;\n createdBy: CmsIdentity;\n savedOn: string;\n savedBy: CmsIdentity;\n modifiedOn: string | null;\n modifiedBy: CmsIdentity | null;\n deletedOn: string | null;\n deletedBy: CmsIdentity | null;\n firstPublishedOn: string | null;\n firstPublishedBy: CmsIdentity | null;\n lastPublishedOn: string | null;\n lastPublishedBy: CmsIdentity | null;\n revisionCreatedOn: string;\n revisionCreatedBy: CmsIdentity;\n revisionSavedOn: string;\n revisionSavedBy: CmsIdentity;\n revisionModifiedOn: string | null;\n revisionModifiedBy: CmsIdentity | null;\n revisionDeletedOn: string | null;\n revisionDeletedBy: CmsIdentity | null;\n revisionFirstPublishedOn: string | null;\n revisionFirstPublishedBy: CmsIdentity | null;\n revisionLastPublishedOn: string | null;\n revisionLastPublishedBy: CmsIdentity | null;\n wbyAco_location: Location;\n live: CmsContentEntryLive | null;\n system: CmsContentEntrySystem | null;\n meta: {\n title: string;\n description?: string;\n image?: string;\n locked: boolean;\n status: CmsContentEntryStatusType;\n version: number;\n };\n values?: TValues;\n}\n\nexport interface CmsContentEntryRevision {\n id: string;\n modelId: string;\n savedOn: string;\n deletedOn: string | null;\n firstPublishedOn: string | null;\n lastPublishedOn: string | null;\n createdBy: CmsIdentity;\n deletedBy: CmsIdentity | null;\n revisionCreatedOn: string;\n revisionSavedOn: string;\n revisionModifiedOn: string | null;\n revisionDeletedOn: string | null;\n revisionFirstPublishedOn: string | null;\n revisionLastPublishedOn: string | null;\n revisionCreatedBy: CmsIdentity;\n revisionSavedBy: CmsIdentity;\n revisionModifiedBy: CmsIdentity | null;\n revisionDeletedBy: CmsIdentity | null;\n revisionFirstPublishedBy: CmsIdentity | null;\n revisionLastPublishedBy: CmsIdentity | null;\n wbyAco_location: Location;\n meta: {\n title: string;\n locked: boolean;\n status: CmsContentEntryStatusType;\n version: number;\n };\n}\n\nexport type CmsEditorContentTab = React.ComponentType<{ activeTab: boolean }>;\n\n// ------------------------------------------------------------------------------------------------------------\nexport interface CmsEditorFieldOptionPlugin extends Plugin {\n type: \"cms-editor-field-option\";\n render(): ReactElement;\n}\n\nexport interface CmsContentDetailsPlugin extends Plugin {\n render: (params: any) => ReactNode;\n}\n\nexport interface FieldLayoutPosition {\n row: number;\n index: number | null;\n}\n\nexport interface CmsEditorFormSettingsPlugin<T = GenericRecord> extends Plugin {\n type: \"cms-editor-form-settings\";\n title: string;\n description: string;\n icon: React.ReactElement;\n showSave?: boolean;\n render(props: { Bind: BaseBindComponent; form: FormAPI<T>; formData: T }): React.ReactNode;\n renderHeaderActions?(props: {\n Bind: BaseBindComponent;\n form: FormAPI<T>;\n formData: T;\n }): React.ReactNode;\n}\n\nexport interface CmsIcon {\n /**\n * [ pack, icon ], ex: [\"fab\", \"cog\"]\n */\n id: [IconPrefix, IconName];\n /**\n * Icon name\n */\n name: string;\n /**\n * SVG element\n */\n svg: ReactElement;\n}\n\nexport interface CmsIconsPlugin extends Plugin {\n type: \"cms-icons\";\n getIcons(): IconPickerIconDto[];\n}\n\n/**\n * Transform field value when sending data to the API.\n */\nexport interface CmsFieldValueTransformer<TField extends CmsModelField = CmsModelField>\n extends Plugin {\n /**\n * A plugin type.\n */\n type: \"cms-field-value-transformer\";\n /**\n * A field type for the value transformer. Or a list of field types.\n */\n fieldType: string | string[];\n /**\n * A transformer function that takes a value and returns a new one.\n */\n transform: (value: any, field: TField) => any;\n}\n\n/**\n * Define a custom form layout renderer for a specific content model.\n */\nexport interface CmsContentFormRendererPlugin extends Plugin {\n /**\n * A plugin type.\n */\n type: \"cms-content-form-renderer\";\n /**\n * Content model ID that will use this renderer.\n */\n modelId: string;\n\n /**\n * A function that will render a custom form layout.\n */\n render(props: {\n /**\n * Content model that is being rendered.\n */\n contentModel: CmsModel;\n /**\n * Content entry data handled by the Form element.\n */\n data: Record<string, any>;\n /**\n * A component to bind data to the Form.\n */\n Bind: BindComponent;\n /**\n * Content model fields to render.\n */\n fields: Record<string, React.ReactElement>;\n }): React.ReactNode;\n}\n/**\n * #########################\n * Data types\n * #########################\n */\nexport interface CmsSecurityPermission extends Identity.Permission {\n accessLevel?: \"full\" | \"no\" | \"custom\";\n models?: string[];\n groups?: string[];\n endpoints?: string[];\n rwd?: string;\n own?: boolean;\n pw?: string;\n}\n\n/**\n * @category GraphQL\n * @category Error\n */\nexport interface CmsErrorResponse {\n message: string;\n code: string;\n data?: Record<string, any> | null;\n}\n/**\n * @category GraphQL\n * @category Meta\n */\nexport interface CmsMetaResponse {\n totalCount: number;\n cursor: string | null;\n hasMoreItems: boolean;\n}\n\n/***\n * ###### FORM ########\n */\nexport interface BindComponentRenderProp<T = any> extends BaseBindComponentRenderProp<T> {\n parentName: string;\n appendValue: (value: any, index?: number) => void;\n prependValue: (value: any) => void;\n appendValues: (values: any[]) => void;\n removeValue: (index: number) => void;\n moveValueUp: (index: number) => void;\n moveValueDown: (index: number) => void;\n}\n\ninterface BindComponentProps<T = any> extends Omit<BaseBindComponentProps, \"children\" | \"name\"> {\n name?: string;\n children?: ((props: BindComponentRenderProp<T>) => React.ReactElement) | React.ReactElement;\n}\n\nexport type BindComponent<T = any> = React.ComponentType<BindComponentProps<T>> & {\n parentName: string;\n ValidationContainer: React.ComponentType<{ children: React.ReactNode }>;\n};\n\n/**\n * After RequestReview and RequestChanges was removed, we need an option to add new status filters\n */\nexport interface CmsEntryFilterStatusPlugin extends Plugin {\n type: \"cms.entry.filter.status\";\n label: string;\n value: string;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":["isLayoutDescriptor"],"sources":["index.ts"],"sourcesContent":["import type * as React from \"react\";\nimport type { ReactElement, ReactNode } from \"react\";\nimport type { Plugin } from \"@webiny/plugins/types.js\";\nimport type {\n BindComponent as BaseBindComponent,\n BindComponentProps as BaseBindComponentProps,\n BindComponentRenderProp as BaseBindComponentRenderProp,\n FormAPI\n} from \"@webiny/form\";\nimport type { IconName, IconPrefix } from \"@fortawesome/fontawesome-svg-core\";\nimport type {\n CmsModelFieldValidator,\n CmsModelFieldValidatorsFactory,\n CmsModelFieldValidatorsGroup\n} from \"./validation.js\";\nimport type {\n CmsBaseLayoutDescriptor,\n CmsEditorFieldsLayout,\n CmsLayoutDescriptor,\n CmsModel,\n CmsModelField\n} from \"./model.js\";\nimport type { CmsIdentity } from \"~/types/shared.js\";\nimport type { SourceType } from \"dnd-core\";\nimport type { IconPickerIconDto } from \"@webiny/admin-ui\";\nimport { GenericRecord } from \"@webiny/app/types.js\";\nimport { Identity } from \"@webiny/app-admin/domain/Identity.js\";\n\nexport type DragObjectWithType = {\n type: SourceType;\n};\n\nexport type * from \"./validation.js\";\nexport type * from \"./model.js\";\nexport { isLayoutDescriptor } from \"./model.js\";\nexport type * from \"./shared.js\";\n\ninterface QueryFieldParams {\n model: CmsModel;\n field: CmsModelField;\n graphQLTypePrefix: string;\n}\n\ninterface Position {\n row: number;\n index: number;\n}\n\ninterface Location {\n folderId: string;\n}\n\nexport interface DragSource extends DragObjectWithType {\n parent?: string;\n pos?: Partial<Position>;\n type: \"row\" | \"field\" | \"newField\" | \"newLayoutField\" | \"layoutField\";\n fieldType?: string;\n layoutFieldType?: string;\n field?: CmsModelField | null;\n fields?: CmsModelField[];\n descriptor?: CmsLayoutDescriptor;\n}\n\n/**\n * @deprecated Use `CmsModelFieldTypePlugin`.\n */\nexport type CmsEditorFieldTypePlugin = CmsModelFieldTypePlugin;\n\nexport interface CmsModelFieldTypePlugin extends Plugin {\n /**\n * a plugin type\n */\n type: \"cms-editor-field-type\";\n field: {\n /**\n * A unique identifier of the field type (text, number, json, myField, ...).\n *\n * ```ts\n * type: \"myField\"\n * ```\n */\n type: string;\n /**\n * A display name for the field.\n *\n * ```ts\n * label: \"Field name\"\n * ```\n */\n label: string;\n /**\n * A list of available validators for the model field.\n *\n * ```ts\n * validators: [\n * \"required\",\n * \"gte\",\n * \"lte\"\n * ]\n * ```\n */\n validators?: string[] | CmsModelFieldValidatorsGroup | CmsModelFieldValidatorsFactory;\n /**\n * A list of available validators when a model field accepts a list (array) of values.\n *\n * ```ts\n * listValidators: [\n * \"minLength\",\n * \"maxLength\"\n * ]\n * ```\n */\n listValidators?: string[] | CmsModelFieldValidatorsGroup | CmsModelFieldValidatorsFactory;\n /**\n * An explanation of the field displayed beneath the label.\n *\n * ```ts\n * description: \"A short description of the field\"\n * ```\n */\n description: string;\n /**\n * A ReactNode to display the icon for the field.\n *\n * ```tsx\n * icon: <MyIconComponent />\n * ```\n */\n icon: React.ReactNode;\n /**\n * Is it allowed to have multiple values in this field?\n *\n * ```ts\n * allowList: true\n * ```\n */\n allowList?: boolean;\n /**\n * Does this field type have a fixed list of values that can be selected?\n *\n * ```ts\n * allowPredefinedValues: false\n * ```\n */\n allowPredefinedValues?: boolean;\n /**\n * A ReactNode label when multiple values are enabled.\n */\n listLabel?: React.ReactNode;\n /**\n * Determines if this field type should be hidden from the admin UI.\n * If set to `true`, the field type will not be visible or selectable in the admin interface.\n */\n hideInAdmin?: boolean;\n /**\n * These are default values when the field is first created. This is a representation of the field that is stored in the database.\n *\n * ```ts\n * createField: () => ({\n * type: \"fieldType\",\n * validation: [],\n * renderer: {\n * name: \"fieldTypeRenderer\"\n * }\n * })\n * ```\n */\n createField: () => Pick<CmsModelField, \"type\" | \"validation\" | \"renderer\" | \"settings\">;\n /**\n * If `true` (default), this field will be configurable via a settings dialog.\n * If `false`, a user will not be able to open the settings dialog, not will the dialog be opened on field drop.\n */\n canEditSettings?: boolean;\n /**\n * Determine if a `draggable` can be dropped into this field.\n * NOTE: This is only applicable to nested field types.\n */\n canAccept?(field: CmsModelField, draggable: DragSource): boolean;\n /**\n * If `true` (default), will allow fields to be laid out into columns (next to each other).\n * If `false`, horizontal layout will not be allowed.\n * NOTE: This is only applicable to nested field types.\n */\n allowLayout?: boolean;\n /**\n * A ReactNode that you can add in the section below the help text when creating/editing field.\n *\n * ```tsx\n * renderSettings: (params) => {\n * return <FieldSettingsComponent />;\n * }\n * ```\n */\n renderSettings?: (params: {\n afterChangeLabel: (value: string) => void;\n uniqueFieldIdValidator: (fieldId: string) => void;\n contentModel: CmsModel;\n }) => React.ReactNode;\n /**\n * A ReactNode that renders in the Predefined values tab.\n *\n * ```tsx\n * renderPredefinedValues: (params) => {\n * const {form: {Bind}} = params;\n * return (\n * <Bind name=\"fieldProperty\">\n * <InputComponent />\n * </Bind>\n * );\n * }\n * ```\n */\n renderPredefinedValues?: (params: {\n getBind: (index?: number) => any;\n }) => React.ReactElement;\n /**\n * Object wrapper for GraphQL stuff\n */\n graphql?: {\n /**\n * Define field selection.\n *\n * ```ts\n * graphql: {\n * queryField: `\n * {\n * id\n * title\n * createdOn\n * }\n * `,\n * }\n * ```\n */\n queryField?: string | ((params: QueryFieldParams) => string | null);\n };\n render?(params: any): React.ReactElement;\n tags?: string[];\n /**\n * Render additional information in the Admin UI Model edit view\n */\n renderInfo?: (params: { field: CmsModelField; model: CmsModel }) => React.ReactElement;\n };\n}\n\nexport interface CmsLayoutFieldTypePlugin extends Plugin {\n type: \"cms-editor-layout-field-type\";\n field: {\n type: CmsLayoutDescriptor[\"type\"];\n label: string;\n description: string;\n icon: React.ReactElement;\n createDescriptor(): Omit<CmsLayoutDescriptor, \"id\">;\n canEditSettings?: boolean;\n renderSettings?(): React.ReactNode;\n /**\n * Collect all model fields embedded inside a layout descriptor's nested layout.\n * Used during drag-and-drop to move embedded fields along with the descriptor\n * across parent boundaries. Return `[]` or omit for descriptors with no nested fields.\n */\n collectFields?(params: {\n descriptor: CmsLayoutDescriptor;\n getField: (id: string) => CmsModelField | undefined;\n }): CmsModelField[];\n /**\n * Return a label prefix for each field ID nested inside this layout descriptor.\n * Used by `buildFieldOptions` to include layout hierarchy in field labels.\n *\n * For example, a tabs descriptor with label \"My Tabs\" containing a tab \"SEO\"\n * with field \"metaTitle\" would return: `{ \"metaTitle\": \"My Tabs › SEO\" }`.\n *\n * Omit or return `{}` for descriptors that don't group fields.\n */\n getFieldLabelPrefixes?(params: { descriptor: CmsLayoutDescriptor }): Record<string, string>;\n /**\n * Controls how this layout field looks on the model editor canvas.\n * Each plugin fully owns its visual representation.\n */\n render(params: {\n descriptor: CmsLayoutDescriptor;\n onUpdate: (d: CmsLayoutDescriptor) => void;\n onDelete: () => void;\n }): React.ReactElement;\n };\n}\n\nexport interface CmsLayoutDescriptorRendererPlugin extends Plugin {\n type: \"cms-layout-descriptor-renderer\";\n descriptorType: string;\n render(props: {\n descriptor: CmsBaseLayoutDescriptor;\n Bind: BindComponent;\n fields: CmsModelField[];\n contentModel: CmsModel;\n gridClassName?: string;\n }): React.ReactElement | null;\n}\n\nexport interface CmsModelFieldRendererSettingsProps {\n field: CmsModelField;\n}\n\nexport interface CmsModelFieldRendererProps {\n field: CmsModelField;\n Label: React.ComponentType<React.PropsWithChildren>;\n getBind: <T = any>(index?: number, key?: string) => BindComponent<T>;\n contentModel: CmsModel;\n}\n\n/**\n * @deprecated Use `CmsModelFieldRendererProps`.\n */\nexport type CmsEditorFieldRendererProps = CmsModelFieldRendererProps;\n\n/**\n * @deprecated Use `CmsModelFieldRendererPlugin`.\n */\nexport type CmsEditorFieldRendererPlugin = CmsModelFieldRendererPlugin;\n\nexport interface CmsModelFieldRendererPlugin extends Plugin {\n /**\n * a plugin type\n */\n type: \"cms-editor-field-renderer\";\n renderer: {\n /**\n * Name of the renderer to match the one from `createField()` method in `CmsModelFieldTypePlugin`.\n *\n * ```ts\n * renderName: \"myFieldTypeRenderer\"\n * ```\n */\n rendererName: string;\n /**\n * A display name for the field in the UI. It is a `ReactNode` type, so you can use a JSX element.\n *\n * ```tsx\n * name: <MyFieldNameComponent />\n * ```\n */\n name: React.ReactNode;\n /**\n * A description for the field in the UI. Works exactly like the `name` property.\n *\n * ```tsx\n * name: <MyFieldDescriptionComponent />\n * ```\n */\n description: React.ReactNode;\n /**\n * A method that determines if the field can be rendered by this plugin.\n *\n * ```ts\n * canUse({ field }) {\n * return (\n * field.type === \"myType\" && !field.list\n * );\n * }\n * ```\n */\n canUse(props: {\n field: CmsModelField;\n fieldPlugin: CmsModelFieldTypePlugin;\n model: CmsModel;\n }): boolean;\n /**\n * Renders a field in the UI.\n *\n * ```tsx\n * render({ field, getBind }) {\n * const Bind = getBind();\n *\n * return (\n * <Bind>\n * {bind => {\n * return (\n * <Input\n * value={bind.value}\n * onChange={bind.onChange}\n * />\n * )\n * }}\n * </Bind>\n * );\n * }\n * ```\n */\n render(props: CmsModelFieldRendererProps): React.ReactNode;\n renderSettings?: (props: CmsModelFieldRendererSettingsProps) => React.ReactNode;\n };\n}\n\nexport interface CmsEditorFieldPredefinedValuesEntry {\n label: string;\n value: string;\n selected?: boolean;\n}\n\nexport interface CmsEditorFieldPredefinedValues {\n enabled: boolean;\n values: CmsEditorFieldPredefinedValuesEntry[];\n}\n\nexport interface CmsDynamicZoneTemplate {\n id: string;\n name: string;\n gqlTypeName: string;\n description: string;\n icon: string;\n fields: CmsModelField[];\n layout: CmsEditorFieldsLayout;\n validation: CmsModelFieldValidator[];\n tags?: string[];\n}\n\nexport interface CmsDynamicZoneTemplateWithTypename extends CmsDynamicZoneTemplate {\n __typename: string;\n}\n\nexport type CmsContentEntryStatusType = \"draft\" | \"published\" | \"unpublished\";\n\n/**\n * @deprecated Use `CmsContentEntry`.\n */\nexport type CmsEditorContentEntry = CmsContentEntry;\n\nexport interface CmsContentEntryLive {\n version: number;\n}\n\nexport interface CmsContentEntrySystem {\n // to be extended\n}\n\nexport interface CmsContentEntry<TValues extends GenericRecord = GenericRecord> {\n id: string;\n entryId: string;\n modelId: string;\n createdOn: string;\n createdBy: CmsIdentity;\n savedOn: string;\n savedBy: CmsIdentity;\n modifiedOn: string | null;\n modifiedBy: CmsIdentity | null;\n deletedOn: string | null;\n deletedBy: CmsIdentity | null;\n firstPublishedOn: string | null;\n firstPublishedBy: CmsIdentity | null;\n lastPublishedOn: string | null;\n lastPublishedBy: CmsIdentity | null;\n revisionCreatedOn: string;\n revisionCreatedBy: CmsIdentity;\n revisionSavedOn: string;\n revisionSavedBy: CmsIdentity;\n revisionModifiedOn: string | null;\n revisionModifiedBy: CmsIdentity | null;\n revisionDeletedOn: string | null;\n revisionDeletedBy: CmsIdentity | null;\n revisionFirstPublishedOn: string | null;\n revisionFirstPublishedBy: CmsIdentity | null;\n revisionLastPublishedOn: string | null;\n revisionLastPublishedBy: CmsIdentity | null;\n wbyAco_location: Location;\n live: CmsContentEntryLive | null;\n system: CmsContentEntrySystem | null;\n meta: {\n title: string;\n description?: string;\n image?: string;\n locked: boolean;\n status: CmsContentEntryStatusType;\n version: number;\n };\n values?: TValues;\n}\n\nexport interface CmsContentEntryRevision {\n id: string;\n modelId: string;\n savedOn: string;\n deletedOn: string | null;\n firstPublishedOn: string | null;\n lastPublishedOn: string | null;\n createdBy: CmsIdentity;\n deletedBy: CmsIdentity | null;\n revisionCreatedOn: string;\n revisionSavedOn: string;\n revisionModifiedOn: string | null;\n revisionDeletedOn: string | null;\n revisionFirstPublishedOn: string | null;\n revisionLastPublishedOn: string | null;\n revisionCreatedBy: CmsIdentity;\n revisionSavedBy: CmsIdentity;\n revisionModifiedBy: CmsIdentity | null;\n revisionDeletedBy: CmsIdentity | null;\n revisionFirstPublishedBy: CmsIdentity | null;\n revisionLastPublishedBy: CmsIdentity | null;\n wbyAco_location: Location;\n meta: {\n title: string;\n locked: boolean;\n status: CmsContentEntryStatusType;\n version: number;\n };\n}\n\nexport type CmsEditorContentTab = React.ComponentType<{ activeTab: boolean }>;\n\n// ------------------------------------------------------------------------------------------------------------\nexport interface CmsEditorFieldOptionPlugin extends Plugin {\n type: \"cms-editor-field-option\";\n render(): ReactElement;\n}\n\nexport interface CmsContentDetailsPlugin extends Plugin {\n render: (params: any) => ReactNode;\n}\n\nexport interface FieldLayoutPosition {\n row: number;\n index: number | null;\n}\n\nexport interface CmsEditorFormSettingsPlugin<T = GenericRecord> extends Plugin {\n type: \"cms-editor-form-settings\";\n title: string;\n description: string;\n icon: React.ReactElement;\n showSave?: boolean;\n render(props: { Bind: BaseBindComponent; form: FormAPI<T>; formData: T }): React.ReactNode;\n renderHeaderActions?(props: {\n Bind: BaseBindComponent;\n form: FormAPI<T>;\n formData: T;\n }): React.ReactNode;\n}\n\nexport interface CmsIcon {\n /**\n * [ pack, icon ], ex: [\"fab\", \"cog\"]\n */\n id: [IconPrefix, IconName];\n /**\n * Icon name\n */\n name: string;\n /**\n * SVG element\n */\n svg: ReactElement;\n}\n\nexport interface CmsIconsPlugin extends Plugin {\n type: \"cms-icons\";\n getIcons(): IconPickerIconDto[];\n}\n\n/**\n * Transform field value when sending data to the API.\n */\nexport interface CmsFieldValueTransformer<TField extends CmsModelField = CmsModelField>\n extends Plugin {\n /**\n * A plugin type.\n */\n type: \"cms-field-value-transformer\";\n /**\n * A field type for the value transformer. Or a list of field types.\n */\n fieldType: string | string[];\n /**\n * A transformer function that takes a value and returns a new one.\n */\n transform: (value: any, field: TField) => any;\n}\n\n/**\n * Define a custom form layout renderer for a specific content model.\n */\nexport interface CmsContentFormRendererPlugin extends Plugin {\n /**\n * A plugin type.\n */\n type: \"cms-content-form-renderer\";\n /**\n * Content model ID that will use this renderer.\n */\n modelId: string;\n\n /**\n * A function that will render a custom form layout.\n */\n render(props: {\n /**\n * Content model that is being rendered.\n */\n contentModel: CmsModel;\n /**\n * Content entry data handled by the Form element.\n */\n data: Record<string, any>;\n /**\n * A component to bind data to the Form.\n */\n Bind: BindComponent;\n /**\n * Content model fields to render.\n */\n fields: Record<string, React.ReactElement>;\n }): React.ReactNode;\n}\n/**\n * #########################\n * Data types\n * #########################\n */\nexport interface CmsSecurityPermission extends Identity.Permission {\n accessLevel?: \"full\" | \"no\" | \"custom\";\n models?: string[];\n groups?: string[];\n endpoints?: string[];\n rwd?: string;\n own?: boolean;\n pw?: string;\n}\n\n/**\n * @category GraphQL\n * @category Error\n */\nexport interface CmsErrorResponse {\n message: string;\n code: string;\n data?: Record<string, any> | null;\n}\n/**\n * @category GraphQL\n * @category Meta\n */\nexport interface CmsMetaResponse {\n totalCount: number;\n cursor: string | null;\n hasMoreItems: boolean;\n}\n\n/***\n * ###### FORM ########\n */\nexport interface BindComponentRenderProp<T = any> extends BaseBindComponentRenderProp<T> {\n parentName: string;\n appendValue: (value: any, index?: number) => void;\n prependValue: (value: any) => void;\n appendValues: (values: any[]) => void;\n removeValue: (index: number) => void;\n moveValueUp: (index: number) => void;\n moveValueDown: (index: number) => void;\n}\n\ninterface BindComponentProps<T = any> extends Omit<BaseBindComponentProps, \"children\" | \"name\"> {\n name?: string;\n children?: ((props: BindComponentRenderProp<T>) => React.ReactElement) | React.ReactElement;\n}\n\nexport type BindComponent<T = any> = React.ComponentType<BindComponentProps<T>> & {\n parentName: string;\n ValidationContainer: React.ComponentType<{ children: React.ReactNode }>;\n};\n\n/**\n * After RequestReview and RequestChanges was removed, we need an option to add new status filters\n */\nexport interface CmsEntryFilterStatusPlugin extends Plugin {\n type: \"cms.entry.filter.status\";\n label: string;\n value: string;\n}\n"],"mappings":"AAkCA,SAASA,kBAAkB;;AA6B3B;AACA;AACA;;AAoPA;AACA;AACA;;AAGA;AACA;AACA;;AAyGA;AACA;AACA;;AAqFA;;AAiDA;AACA;AACA;;AAiBA;AACA;AACA;;AAiCA;AACA;AACA;AACA;AACA;;AAWA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;;AAOA;AACA;AACA;;AAqBA;AACA;AACA","ignoreList":[]}
package/types/model.d.ts CHANGED
@@ -12,12 +12,20 @@ export interface CmsModelFieldSettings<T = unknown> {
12
12
  defaultSetValue?: string;
13
13
  type?: string;
14
14
  fields?: CmsModelField<T>[];
15
- layout?: string[][];
15
+ layout?: CmsEditorFieldsLayout;
16
16
  models?: Pick<CmsModel, "modelId">[];
17
17
  templates?: CmsDynamicZoneTemplate[];
18
18
  imagesOnly?: boolean;
19
19
  [key: string]: any;
20
20
  }
21
+ export type FieldRuleAction = "hide" | "disable" | string;
22
+ export interface FieldRule {
23
+ type: "accessControl" | "condition";
24
+ target: string;
25
+ operator: string;
26
+ value: string | number | boolean | null;
27
+ action: FieldRuleAction;
28
+ }
21
29
  export type CmsModelField<T = unknown> = T & {
22
30
  id: string;
23
31
  type: string;
@@ -43,9 +51,52 @@ export type CmsModelField<T = unknown> = T & {
43
51
  */
44
52
  | CmsModelFieldRendererPlugin["renderer"]["render"];
45
53
  tags?: string[];
54
+ rules?: FieldRule[];
46
55
  };
47
56
  export type CmsEditorFieldId = string;
48
- export type CmsEditorFieldsLayout = CmsEditorFieldId[][];
57
+ export interface CmsBaseLayoutDescriptor {
58
+ id: string;
59
+ type: string;
60
+ rules?: FieldRule[];
61
+ }
62
+ export interface CmsSeparatorLayoutDescriptor extends CmsBaseLayoutDescriptor {
63
+ type: "separator";
64
+ label: string;
65
+ description?: string;
66
+ }
67
+ export interface CmsAlertLayoutDescriptor extends CmsBaseLayoutDescriptor {
68
+ type: "alert";
69
+ label: string;
70
+ alertType: "info" | "success" | "warning" | "danger";
71
+ }
72
+ export interface CmsTabLayoutTab {
73
+ id: string;
74
+ label: string;
75
+ icon?: string;
76
+ layout: CmsEditorFieldsLayout;
77
+ rules?: FieldRule[];
78
+ }
79
+ export interface CmsTabLayoutDescriptor extends CmsBaseLayoutDescriptor {
80
+ type: "tabs";
81
+ label: string;
82
+ description?: string | null;
83
+ help?: string | null;
84
+ tabs: CmsTabLayoutTab[];
85
+ }
86
+ export type CmsLayoutDescriptor = CmsSeparatorLayoutDescriptor | CmsAlertLayoutDescriptor | CmsTabLayoutDescriptor | CmsBaseLayoutDescriptor;
87
+ export type CmsEditorLayoutCell = CmsEditorFieldId | CmsLayoutDescriptor;
88
+ export type CmsEditorFieldsLayout = CmsEditorLayoutCell[][];
89
+ /**
90
+ * Distinguish layout descriptors from field IDs (strings) and CmsModelField objects.
91
+ *
92
+ * In raw layout data (`CmsEditorFieldsLayout`), cells are either strings (field IDs)
93
+ * or layout descriptor objects — the `typeof` check handles that.
94
+ *
95
+ * In resolved layout data (after `getFieldsInLayout`), cells are either `CmsModelField`
96
+ * or layout descriptor objects — both have `{ id, type }`, but only `CmsModelField`
97
+ * has `fieldId`, so we use its absence as the discriminator.
98
+ */
99
+ export declare function isLayoutDescriptor(cell: unknown): cell is CmsLayoutDescriptor;
49
100
  /**
50
101
  * @category GraphQL
51
102
  * @category Model
package/types/model.js CHANGED
@@ -1,3 +1,29 @@
1
- export {};
1
+ /**
2
+ * @deprecated Use `CmsModelField` instead.
3
+ */
4
+
5
+ /**
6
+ * Distinguish layout descriptors from field IDs (strings) and CmsModelField objects.
7
+ *
8
+ * In raw layout data (`CmsEditorFieldsLayout`), cells are either strings (field IDs)
9
+ * or layout descriptor objects — the `typeof` check handles that.
10
+ *
11
+ * In resolved layout data (after `getFieldsInLayout`), cells are either `CmsModelField`
12
+ * or layout descriptor objects — both have `{ id, type }`, but only `CmsModelField`
13
+ * has `fieldId`, so we use its absence as the discriminator.
14
+ */
15
+ export function isLayoutDescriptor(cell) {
16
+ return typeof cell === "object" && cell !== null && "type" in cell && typeof cell.type === "string" && !("fieldId" in cell);
17
+ }
18
+
19
+ /**
20
+ * @category GraphQL
21
+ * @category Model
22
+ */
23
+
24
+ /**
25
+ * @category GraphQL
26
+ * @category Group
27
+ */
2
28
 
3
29
  //# sourceMappingURL=model.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["model.ts"],"sourcesContent":["import type { Validator } from \"@webiny/validation/types.js\";\nimport type { CmsModelFieldValidator } from \"~/types/validation.js\";\nimport type {\n CmsDynamicZoneTemplate,\n CmsEditorFieldPredefinedValues,\n CmsModelFieldRendererPlugin\n} from \"~/types/index.js\";\nimport type { CmsIdentity } from \"~/types/shared.js\";\nimport type React from \"react\";\n\n/**\n * @deprecated Use `CmsModelField` instead.\n */\nexport type CmsEditorField<T = unknown> = CmsModelField<T>;\n\nexport interface CmsModelFieldSettings<T = unknown> {\n defaultValue?: string | boolean | number | null | undefined;\n defaultSetValue?: string;\n type?: string;\n fields?: CmsModelField<T>[];\n layout?: string[][];\n models?: Pick<CmsModel, \"modelId\">[];\n templates?: CmsDynamicZoneTemplate[];\n imagesOnly?: boolean;\n [key: string]: any;\n}\n\nexport type CmsModelField<T = unknown> = T & {\n id: string;\n type: string;\n fieldId: CmsEditorFieldId;\n storageId?: string;\n label: string;\n help?: string | React.ReactNode;\n description?: string | React.ReactNode;\n note?: string | React.ReactNode;\n placeholder?: string;\n validation?: (CmsModelFieldValidator | Validator)[];\n listValidation?: CmsModelFieldValidator[];\n list?: boolean;\n predefinedValues?: CmsEditorFieldPredefinedValues;\n settings?: CmsModelFieldSettings<T>;\n renderer:\n | {\n name: string;\n settings?: Record<string, any>;\n }\n /**\n * Use this only for programmatic assignment of renderers.\n * Since functions cannot be serialized, this can only work via code.\n */\n | CmsModelFieldRendererPlugin[\"renderer\"][\"render\"];\n tags?: string[];\n};\n\nexport type CmsEditorFieldId = string;\nexport type CmsEditorFieldsLayout = CmsEditorFieldId[][];\n\n/**\n * @category GraphQL\n * @category Model\n */\nexport type CmsEditorContentModel = CmsModel;\n\n/**\n * @category GraphQL\n * @category Group\n */\nexport interface CmsGroup {\n id: string;\n name: string;\n slug: string;\n icon: string;\n description?: string;\n contentModels: CmsModel[];\n createdBy: CmsIdentity;\n /**\n * Tells if this group is a plugin one (cannot be changed/deleted)\n */\n plugin?: boolean;\n}\n\nexport interface CmsModel {\n id: string;\n group: string;\n description?: string;\n version: number;\n layout?: CmsEditorFieldsLayout;\n fields: CmsModelField[];\n icon: string;\n name: string;\n modelId: string;\n singularApiName: string;\n pluralApiName: string;\n titleFieldId: string | null;\n descriptionFieldId: string | null;\n imageFieldId: string | null;\n status: string;\n savedOn: string;\n meta: any;\n createdBy: CmsIdentity;\n tags: string[];\n /**\n * If model is a plugin one (it cannot be changed/deleted)\n */\n plugin?: boolean;\n /**\n * Is model currently being deleted?\n */\n isBeingDeleted?: boolean;\n settings: {\n [key: string]: any;\n };\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":["isLayoutDescriptor","cell","type"],"sources":["model.ts"],"sourcesContent":["import type { Validator } from \"@webiny/validation/types.js\";\nimport type { CmsModelFieldValidator } from \"~/types/validation.js\";\nimport type {\n CmsDynamicZoneTemplate,\n CmsEditorFieldPredefinedValues,\n CmsModelFieldRendererPlugin\n} from \"~/types/index.js\";\nimport type { CmsIdentity } from \"~/types/shared.js\";\nimport type React from \"react\";\n\n/**\n * @deprecated Use `CmsModelField` instead.\n */\nexport type CmsEditorField<T = unknown> = CmsModelField<T>;\n\nexport interface CmsModelFieldSettings<T = unknown> {\n defaultValue?: string | boolean | number | null | undefined;\n defaultSetValue?: string;\n type?: string;\n fields?: CmsModelField<T>[];\n layout?: CmsEditorFieldsLayout;\n models?: Pick<CmsModel, \"modelId\">[];\n templates?: CmsDynamicZoneTemplate[];\n imagesOnly?: boolean;\n [key: string]: any;\n}\n\nexport type FieldRuleAction = \"hide\" | \"disable\" | string;\n\nexport interface FieldRule {\n type: \"accessControl\" | \"condition\";\n target: string;\n operator: string;\n value: string | number | boolean | null;\n action: FieldRuleAction;\n}\n\nexport type CmsModelField<T = unknown> = T & {\n id: string;\n type: string;\n fieldId: CmsEditorFieldId;\n storageId?: string;\n label: string;\n help?: string | React.ReactNode;\n description?: string | React.ReactNode;\n note?: string | React.ReactNode;\n placeholder?: string;\n validation?: (CmsModelFieldValidator | Validator)[];\n listValidation?: CmsModelFieldValidator[];\n list?: boolean;\n predefinedValues?: CmsEditorFieldPredefinedValues;\n settings?: CmsModelFieldSettings<T>;\n renderer:\n | {\n name: string;\n settings?: Record<string, any>;\n }\n /**\n * Use this only for programmatic assignment of renderers.\n * Since functions cannot be serialized, this can only work via code.\n */\n | CmsModelFieldRendererPlugin[\"renderer\"][\"render\"];\n tags?: string[];\n rules?: FieldRule[];\n};\n\nexport type CmsEditorFieldId = string;\n\nexport interface CmsBaseLayoutDescriptor {\n id: string;\n type: string;\n rules?: FieldRule[];\n}\n\nexport interface CmsSeparatorLayoutDescriptor extends CmsBaseLayoutDescriptor {\n type: \"separator\";\n label: string;\n description?: string;\n}\n\nexport interface CmsAlertLayoutDescriptor extends CmsBaseLayoutDescriptor {\n type: \"alert\";\n label: string;\n alertType: \"info\" | \"success\" | \"warning\" | \"danger\";\n}\n\nexport interface CmsTabLayoutTab {\n id: string;\n label: string;\n icon?: string;\n layout: CmsEditorFieldsLayout;\n rules?: FieldRule[];\n}\n\nexport interface CmsTabLayoutDescriptor extends CmsBaseLayoutDescriptor {\n type: \"tabs\";\n label: string;\n description?: string | null;\n help?: string | null;\n tabs: CmsTabLayoutTab[];\n}\n\nexport type CmsLayoutDescriptor =\n | CmsSeparatorLayoutDescriptor\n | CmsAlertLayoutDescriptor\n | CmsTabLayoutDescriptor\n | CmsBaseLayoutDescriptor;\n\nexport type CmsEditorLayoutCell = CmsEditorFieldId | CmsLayoutDescriptor;\nexport type CmsEditorFieldsLayout = CmsEditorLayoutCell[][];\n\n/**\n * Distinguish layout descriptors from field IDs (strings) and CmsModelField objects.\n *\n * In raw layout data (`CmsEditorFieldsLayout`), cells are either strings (field IDs)\n * or layout descriptor objects — the `typeof` check handles that.\n *\n * In resolved layout data (after `getFieldsInLayout`), cells are either `CmsModelField`\n * or layout descriptor objects — both have `{ id, type }`, but only `CmsModelField`\n * has `fieldId`, so we use its absence as the discriminator.\n */\nexport function isLayoutDescriptor(cell: unknown): cell is CmsLayoutDescriptor {\n return (\n typeof cell === \"object\" &&\n cell !== null &&\n \"type\" in cell &&\n typeof (cell as any).type === \"string\" &&\n !(\"fieldId\" in cell)\n );\n}\n\n/**\n * @category GraphQL\n * @category Model\n */\nexport type CmsEditorContentModel = CmsModel;\n\n/**\n * @category GraphQL\n * @category Group\n */\nexport interface CmsGroup {\n id: string;\n name: string;\n slug: string;\n icon: string;\n description?: string;\n contentModels: CmsModel[];\n createdBy: CmsIdentity;\n /**\n * Tells if this group is a plugin one (cannot be changed/deleted)\n */\n plugin?: boolean;\n}\n\nexport interface CmsModel {\n id: string;\n group: string;\n description?: string;\n version: number;\n layout?: CmsEditorFieldsLayout;\n fields: CmsModelField[];\n icon: string;\n name: string;\n modelId: string;\n singularApiName: string;\n pluralApiName: string;\n titleFieldId: string | null;\n descriptionFieldId: string | null;\n imageFieldId: string | null;\n status: string;\n savedOn: string;\n meta: any;\n createdBy: CmsIdentity;\n tags: string[];\n /**\n * If model is a plugin one (it cannot be changed/deleted)\n */\n plugin?: boolean;\n /**\n * Is model currently being deleted?\n */\n isBeingDeleted?: boolean;\n settings: {\n [key: string]: any;\n };\n}\n"],"mappings":"AAUA;AACA;AACA;;AAmGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,kBAAkBA,CAACC,IAAa,EAA+B;EAC3E,OACI,OAAOA,IAAI,KAAK,QAAQ,IACxBA,IAAI,KAAK,IAAI,IACb,MAAM,IAAIA,IAAI,IACd,OAAQA,IAAI,CAASC,IAAI,KAAK,QAAQ,IACtC,EAAE,SAAS,IAAID,IAAI,CAAC;AAE5B;;AAEA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA","ignoreList":[]}