@nuasite/cms 0.20.5 → 0.21.0

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.
@@ -386,4 +386,11 @@ export class ManifestWriter {
386
386
  getAvailableTextStyles(): AvailableTextStyles | undefined {
387
387
  return this.availableTextStyles
388
388
  }
389
+
390
+ /**
391
+ * Get the list of component names allowed in the MDX component picker
392
+ */
393
+ getMdxComponents(): string[] | undefined {
394
+ return this.mdxComponents
395
+ }
389
396
  }
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Semantic prop types for CMS component editing.
3
+ *
4
+ * Import these in Astro component Props to get the right editor input:
5
+ *
6
+ * ```astro
7
+ * ---
8
+ * import type { Image, Url } from '@nuasite/cms'
9
+ *
10
+ * interface Props {
11
+ * src: Image
12
+ * href: Url
13
+ * }
14
+ * ---
15
+ * ```
16
+ *
17
+ * At runtime these are just `string`, but the CMS editor reads
18
+ * the type name from source and renders the appropriate input widget.
19
+ */
20
+
21
+ /** Opens the media library picker */
22
+ export type Image = string
23
+
24
+ /** Text input with URL validation */
25
+ export type Url = string
26
+
27
+ /** Color picker input */
28
+ export type Color = string
29
+
30
+ /** Date picker input */
31
+ export type Date = string
32
+
33
+ /** Date and time picker input */
34
+ export type DateTime = string
35
+
36
+ /** Time picker input */
37
+ export type Time = string
38
+
39
+ /** Email input with validation */
40
+ export type Email = string
41
+
42
+ /** Multiline text area */
43
+ export type Textarea = string
44
+
45
+ /** Collection entry reference — renders a dropdown of entries from the named collection */
46
+ export type Reference<_Collection extends string = string> = string
package/src/types.ts CHANGED
@@ -229,10 +229,14 @@ export type FieldType =
229
229
  | 'text'
230
230
  | 'textarea'
231
231
  | 'date'
232
+ | 'datetime'
233
+ | 'time'
232
234
  | 'boolean'
233
235
  | 'number'
234
236
  | 'image'
235
237
  | 'url'
238
+ | 'email'
239
+ | 'color'
236
240
  | 'select'
237
241
  | 'array'
238
242
  | 'object'