@firecms/collection_editor 3.0.0-alpha.73 → 3.0.0-alpha.74

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/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@firecms/collection_editor",
3
3
  "type": "module",
4
- "version": "3.0.0-alpha.73",
4
+ "version": "3.0.0-alpha.74",
5
5
  "main": "./dist/index.umd.js",
6
6
  "module": "./dist/index.es.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "source": "src/index.ts",
9
9
  "dependencies": {
10
- "@firecms/data_import_export": "^3.0.0-alpha.73",
11
- "@firecms/schema_inference": "^3.0.0-alpha.73",
12
- "@firecms/ui": "^3.0.0-alpha.73",
10
+ "@firecms/data_import_export": "^3.0.0-alpha.74",
11
+ "@firecms/schema_inference": "^3.0.0-alpha.74",
12
+ "@firecms/ui": "^3.0.0-alpha.74",
13
13
  "json5": "^2.2.3",
14
14
  "prism-react-renderer": "^2.3.0"
15
15
  },
@@ -72,5 +72,5 @@
72
72
  "publishConfig": {
73
73
  "access": "public"
74
74
  },
75
- "gitHead": "df625cc7bd6af087b7012d1c9ae77d3a6c17a320"
75
+ "gitHead": "52ebcaf1e5c019f0f5e03cc63a3ea7663c356d23"
76
76
  }
@@ -19,6 +19,7 @@ import { productsCollectionTemplate } from "./templates/products_template";
19
19
  import { blogCollectionTemplate } from "./templates/blog_template";
20
20
  import { usersCollectionTemplate } from "./templates/users_template";
21
21
  import { ImportFileUpload } from "@firecms/data_import_export";
22
+ import { pagesCollectionTemplate } from "./templates/pages_template";
22
23
 
23
24
  export function CollectionEditorWelcomeView({
24
25
  path,
@@ -125,6 +126,13 @@ export function CollectionEditorWelcomeView({
125
126
  setValues(productsCollectionTemplate);
126
127
  onContinue();
127
128
  }}/>
129
+ <TemplateButton title={"Users"}
130
+ subtitle={"A collection of users with emails, names and roles"}
131
+ icon={<Icon size={"small"} iconKey={usersCollectionTemplate.icon!}/>}
132
+ onClick={() => {
133
+ setValues(usersCollectionTemplate);
134
+ onContinue();
135
+ }}/>
128
136
  <TemplateButton title={"Blog posts"}
129
137
  subtitle={"A collection of blog posts with images, authors and complex content"}
130
138
  icon={<Icon size={"small"} iconKey={blogCollectionTemplate.icon!}/>}
@@ -132,11 +140,11 @@ export function CollectionEditorWelcomeView({
132
140
  setValues(blogCollectionTemplate);
133
141
  onContinue();
134
142
  }}/>
135
- <TemplateButton title={"Users"}
136
- subtitle={"A collection of users with emails, names and roles"}
137
- icon={<Icon size={"small"} iconKey={usersCollectionTemplate.icon!}/>}
143
+ <TemplateButton title={"Pages"}
144
+ subtitle={"A collection of pages with images, authors and complex content"}
145
+ icon={<Icon size={"small"} iconKey={pagesCollectionTemplate.icon!}/>}
138
146
  onClick={() => {
139
- setValues(usersCollectionTemplate);
147
+ setValues(pagesCollectionTemplate);
140
148
  onContinue();
141
149
  }}/>
142
150
  </div>
@@ -19,7 +19,8 @@ export const pagesCollectionTemplate: EntityCollection = {
19
19
  validation: {
20
20
  required: true,
21
21
  unique: true,
22
- matches: /^[a-z0-9]+(?:-[a-z0-9]+)*$/
22
+ matches: /^[a-z0-9]+(?:-[a-z0-9]+)*$/,
23
+ matchesMessage: "Must be lowercase, alphanumeric, and hyphenated"
23
24
  }
24
25
  },
25
26
  hero_section: {
@@ -54,35 +55,69 @@ export const pagesCollectionTemplate: EntityCollection = {
54
55
  }
55
56
  }
56
57
  },
57
- sections: {
58
+ content: {
58
59
  dataType: "array",
59
- name: "Content Sections",
60
- of: {
61
- dataType: "map",
60
+ name: "Content",
61
+ oneOf: {
62
62
  properties: {
63
- title: {
64
- dataType: "string",
65
- name: "Section Title",
66
- validation: { required: true }
67
- },
68
- content: {
69
- dataType: "string",
70
- name: "Section Content",
71
- markdown: true
63
+ section: {
64
+ dataType: "map",
65
+ name: "Section",
66
+ properties: {
67
+ title: {
68
+ dataType: "string",
69
+ name: "Section Title",
70
+ validation: { required: true }
71
+ },
72
+ content: {
73
+ dataType: "string",
74
+ name: "Section Content",
75
+ markdown: true
76
+ },
77
+ image: {
78
+ dataType: "string",
79
+ name: "Section Image",
80
+ storage: {
81
+ storagePath: "page_sections/images",
82
+ acceptedFiles: ["image/*"]
83
+ }
84
+ },
85
+ link: {
86
+ dataType: "string",
87
+ name: "Section Link",
88
+ url: true
89
+ }
90
+ }
72
91
  },
73
92
  image: {
74
93
  dataType: "string",
75
- name: "Section Image",
94
+ name: "Image",
76
95
  storage: {
77
96
  storagePath: "page_sections/images",
78
- acceptedFiles: ["image/*"],
97
+ acceptedFiles: ["image/*"]
98
+ }
99
+ },
100
+ slider: {
101
+ dataType: "array",
102
+ name: "Slider",
103
+ of: {
104
+ dataType: "map",
105
+ properties: {
106
+ title: {
107
+ dataType: "string",
108
+ name: "Title",
109
+ validation: { required: true }
110
+ },
111
+ image: {
112
+ dataType: "string",
113
+ storage: {
114
+ storagePath: "page_sections/images",
115
+ acceptedFiles: ["image/*"]
116
+ }
117
+ }
118
+ }
79
119
  }
80
120
  },
81
- link: {
82
- dataType: "string",
83
- name: "Section Link",
84
- url: true
85
- }
86
121
  }
87
122
  }
88
123
  },
@@ -25,6 +25,14 @@ export const usersCollectionTemplate: EntityCollection = {
25
25
  name: "Phone",
26
26
  dataType: "string"
27
27
  },
28
+ favourite_products: {
29
+ name: "Favourite products",
30
+ dataType: "array",
31
+ of: {
32
+ dataType: "reference",
33
+ path: "products"
34
+ }
35
+ },
28
36
  photoURL: {
29
37
  name: "Photo URL",
30
38
  dataType: "string",