@nuasite/cms 0.40.0 → 0.42.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 +13711 -13225
- package/package.json +1 -1
- package/src/collection-scanner.ts +247 -59
- package/src/content-config-ast.ts +172 -27
- package/src/editor/components/collections-browser.tsx +20 -4
- package/src/editor/components/fields.tsx +313 -52
- package/src/editor/components/frontmatter-fields.tsx +83 -3
- package/src/editor/components/frontmatter-sidebar.tsx +1 -0
- package/src/editor/components/markdown-editor-overlay.tsx +1 -1
- package/src/editor/components/markdown-inline-editor.tsx +50 -0
- package/src/editor/components/toolbar.tsx +17 -2
- package/src/editor/milkdown-utils.ts +9 -2
- package/src/editor/styled-list-plugin.ts +233 -0
- package/src/editor/types.ts +3 -0
- package/src/field-types.ts +15 -0
- package/src/handlers/markdown-ops.ts +75 -1
- package/src/html-processor.ts +22 -7
- package/src/index.ts +9 -2
- package/src/rehype-cms-marker.ts +2 -2
- package/src/types.ts +9 -0
package/src/rehype-cms-marker.ts
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
* relying on heuristics.
|
|
6
6
|
*/
|
|
7
7
|
export function rehypeCmsMarker() {
|
|
8
|
-
return (tree: any) => {
|
|
8
|
+
return (tree: any, file: any) => {
|
|
9
9
|
const firstElement = tree.children?.find((n: any) => n.type === 'element')
|
|
10
10
|
if (firstElement) {
|
|
11
11
|
firstElement.properties ??= {}
|
|
12
|
-
firstElement.properties['dataCmsMarkdownContent'] = ''
|
|
12
|
+
firstElement.properties['dataCmsMarkdownContent'] = file?.path ?? (Array.isArray(file?.history) ? file.history[0] : '') ?? ''
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
}
|
package/src/types.ts
CHANGED
|
@@ -244,9 +244,12 @@ export type FieldType =
|
|
|
244
244
|
| 'date'
|
|
245
245
|
| 'datetime'
|
|
246
246
|
| 'time'
|
|
247
|
+
| 'year'
|
|
248
|
+
| 'month'
|
|
247
249
|
| 'boolean'
|
|
248
250
|
| 'number'
|
|
249
251
|
| 'image'
|
|
252
|
+
| 'file'
|
|
250
253
|
| 'url'
|
|
251
254
|
| 'email'
|
|
252
255
|
| 'tel'
|
|
@@ -342,6 +345,12 @@ export interface CollectionDefinition {
|
|
|
342
345
|
orderBy?: string
|
|
343
346
|
/** Sort direction for orderBy field */
|
|
344
347
|
orderDirection?: 'asc' | 'desc'
|
|
348
|
+
/**
|
|
349
|
+
* Name of the collection this one is nested under in the CMS browser, when it shares a base
|
|
350
|
+
* directory with another collection (e.g. a nested `*/otazky/*` collection grouped under the
|
|
351
|
+
* `*/index.md` collection at the same base). Purely presentational grouping.
|
|
352
|
+
*/
|
|
353
|
+
parentCollection?: string
|
|
345
354
|
}
|
|
346
355
|
|
|
347
356
|
/** Manifest metadata for versioning and conflict detection */
|