@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.
- package/dist/editor.js +16886 -16613
- package/package.json +1 -1
- package/src/collection-scanner.ts +106 -20
- package/src/dev-middleware.ts +4 -14
- package/src/editor/api.ts +2 -0
- package/src/editor/components/fields.tsx +3 -2
- package/src/editor/components/frontmatter-fields.tsx +31 -20
- package/src/editor/components/markdown-editor-overlay.tsx +20 -3
- package/src/editor/components/prop-editor.tsx +353 -26
- package/src/editor/components/reference-picker.tsx +3 -13
- package/src/editor/components/seo-editor.tsx +0 -2
- package/src/editor/constants.ts +0 -13
- package/src/editor/editor.ts +1 -4
- package/src/editor/hooks/useBlockEditorHandlers.ts +1 -5
- package/src/editor/manifest.ts +10 -0
- package/src/editor/signals.ts +11 -0
- package/src/field-types.ts +42 -0
- package/src/handlers/markdown-ops.ts +13 -1
- package/src/index.ts +11 -0
- package/src/manifest-writer.ts +7 -0
- package/src/prop-types.ts +46 -0
- package/src/types.ts +4 -0
package/src/manifest-writer.ts
CHANGED
|
@@ -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