@sveltia/cms 0.122.2 → 0.124.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/main.d.ts CHANGED
@@ -4,9 +4,10 @@ declare namespace CMS {
4
4
  export { registerCustomFormat };
5
5
  export { registerEditorComponent };
6
6
  export { registerEventListener };
7
+ export { registerFieldType };
7
8
  export { registerPreviewStyle };
8
9
  export { registerPreviewTemplate };
9
- export { registerWidget };
10
+ export { registerFieldType as registerWidget };
10
11
  }
11
12
  /**
12
13
  * Initialize the CMS, optionally with the given CMS configuration.
@@ -49,6 +50,15 @@ declare function registerEditorComponent(definition: EditorComponentDefinition):
49
50
  * @see https://decapcms.org/docs/registering-events/
50
51
  */
51
52
  declare function registerEventListener(eventListener: AppEventListener): void;
53
+ /**
54
+ * Register a custom field type (widget).
55
+ * @param {string} name Field type name.
56
+ * @param {ComponentType<CustomFieldControlProps> | string} control Component for the edit pane.
57
+ * @param {ComponentType<CustomFieldPreviewProps>} [preview] Component for the preview pane.
58
+ * @param {CustomFieldSchema} [schema] Field schema.
59
+ * @see https://decapcms.org/docs/custom-widgets/
60
+ */
61
+ declare function registerFieldType(name: string, control: ComponentType<CustomFieldControlProps> | string, preview?: ComponentType<CustomFieldPreviewProps>, schema?: CustomFieldSchema): void;
52
62
  /**
53
63
  * Register a custom preview stylesheet.
54
64
  * @param {string} style URL, file path or raw CSS string.
@@ -67,23 +77,14 @@ declare function registerPreviewStyle(style: string, { raw }?: {
67
77
  * @see https://decapcms.org/docs/customization/#registerpreviewtemplate
68
78
  */
69
79
  declare function registerPreviewTemplate(name: string, component: ComponentType<CustomPreviewTemplateProps>): void;
70
- /**
71
- * Register a custom widget.
72
- * @param {string} name Widget name.
73
- * @param {ComponentType<CustomWidgetControlProps> | string} control Component for the edit pane.
74
- * @param {ComponentType<CustomWidgetPreviewProps>} [preview] Component for the preview pane.
75
- * @param {CustomWidgetSchema} [schema] Field schema.
76
- * @see https://decapcms.org/docs/custom-widgets/
77
- */
78
- declare function registerWidget(name: string, control: ComponentType<CustomWidgetControlProps> | string, preview?: ComponentType<CustomWidgetPreviewProps>, schema?: CustomWidgetSchema): void;
79
80
  import type { CmsConfig } from './types/public';
80
81
  import type { FileParser } from './types/public';
81
82
  import type { FileFormatter } from './types/public';
82
83
  import type { EditorComponentDefinition } from './types/public';
83
84
  import type { AppEventListener } from './types/public';
84
- import type { CustomPreviewTemplateProps } from './types/public';
85
+ import type { CustomFieldControlProps } from './types/public';
85
86
  import type { ComponentType } from 'react';
86
- import type { CustomWidgetControlProps } from './types/public';
87
- import type { CustomWidgetPreviewProps } from './types/public';
88
- import type { CustomWidgetSchema } from './types/public';
87
+ import type { CustomFieldPreviewProps } from './types/public';
88
+ import type { CustomFieldSchema } from './types/public';
89
+ import type { CustomPreviewTemplateProps } from './types/public';
89
90
  export type { CmsConfig };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sveltia/cms",
3
- "version": "0.122.2",
3
+ "version": "0.124.0",
4
4
  "description": "Sveltia CMS is a modern, lightweight, Git-based headless content management system.",
5
5
  "keywords": [
6
6
  "cms",