@caiquecamargo/vite-plugin-netlify-cms 0.0.7 → 0.0.9
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/index.es.js +35 -30
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +11 -11
- package/dist/index.umd.js.map +1 -1
- package/dist/src/plugin.d.ts +3 -1
- package/dist/src/types.d.ts +18 -4
- package/package.json +1 -1
package/dist/src/plugin.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Plugin } from "vite";
|
|
2
|
-
import { BooleanWidget, CodeWidget, ColorWidget, DateTimeWidget, FileCollection, FileWidget, FolderCollection, HiddenWidget, ImageWidget, ListWidget, MapWidget, NetlifyCMSConfig, NumberWidget, ObjectWidget, RelationWidget, SelectWidget, StringWidget, TextWidget } from "./types";
|
|
2
|
+
import { BooleanWidget, CodeWidget, ColorWidget, DateTimeWidget, FileCollection, FileCollectionEntry, FileWidget, FolderCollection, HiddenWidget, ImageWidget, ListWidget, MapWidget, MarkdownWidget, NetlifyCMSConfig, NumberWidget, ObjectWidget, RelationWidget, SelectWidget, StringWidget, TextWidget } from "./types";
|
|
3
3
|
export declare const defineConfig: (config: NetlifyCMSConfig) => NetlifyCMSConfig;
|
|
4
4
|
export declare const defineFolderCollection: (collection: FolderCollection) => FolderCollection;
|
|
5
5
|
export declare const defineFileCollection: (collection: FileCollection) => FileCollection;
|
|
6
|
+
export declare const defineFileCollectionEntry: (collection: FileCollectionEntry) => FileCollectionEntry;
|
|
6
7
|
export declare const defineBooleanWidget: (widget: Omit<BooleanWidget, "widget">) => BooleanWidget;
|
|
7
8
|
export declare const defineCodeWidget: (widget: Omit<CodeWidget, "widget">) => CodeWidget;
|
|
8
9
|
export declare const defineColorWidget: (widget: Omit<ColorWidget, "widget">) => ColorWidget;
|
|
@@ -30,6 +31,7 @@ export declare const defineRelationWidget: (widget: Omit<RelationWidget, "widget
|
|
|
30
31
|
export declare const defineSelectWidget: (widget: Omit<SelectWidget, "widget">) => SelectWidget;
|
|
31
32
|
export declare const defineStringWidget: (widget: Omit<StringWidget, "widget">) => StringWidget;
|
|
32
33
|
export declare const defineTextWidget: (widget: Omit<TextWidget, "widget">) => TextWidget;
|
|
34
|
+
export declare const defineMarkdownWidget: (widget: Omit<MarkdownWidget, "widget">) => MarkdownWidget;
|
|
33
35
|
export type NetlifyCMSEntry = {
|
|
34
36
|
configFile?: string;
|
|
35
37
|
config?: NetlifyCMSConfig;
|
package/dist/src/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type Widgets = "boolean" | "code" | "color" | "datetime" | "hidden" | "file" | "image" | "list" | "map" | "number" | "object" | "relation" | "select" | "string" | "text";
|
|
1
|
+
type Widgets = "boolean" | "code" | "color" | "datetime" | "hidden" | "file" | "image" | "list" | "map" | "number" | "object" | "relation" | "select" | "string" | "text" | "markdown";
|
|
2
2
|
interface BaseCollectionField {
|
|
3
3
|
name: string;
|
|
4
4
|
label?: string;
|
|
@@ -124,7 +124,16 @@ export interface TextWidget extends BaseCollectionField {
|
|
|
124
124
|
widget: "text";
|
|
125
125
|
default?: string;
|
|
126
126
|
}
|
|
127
|
-
|
|
127
|
+
type MarkdownButtons = "bold" | "italic" | "code" | "link" | "heading-one" | "heading-two" | "heading-three | heading-four" | "heading-five" | "heading-six" | "quote" | "bulleted-list" | "numbered-list";
|
|
128
|
+
export interface MarkdownWidget extends BaseCollectionField {
|
|
129
|
+
widget: "markdown";
|
|
130
|
+
default?: string;
|
|
131
|
+
buttons?: MarkdownButtons[];
|
|
132
|
+
editor_components?: ("image" | "code-block")[];
|
|
133
|
+
modes?: ("raw" | "rich_text")[];
|
|
134
|
+
sanitize_preview?: boolean;
|
|
135
|
+
}
|
|
136
|
+
export type CollectionField = BooleanWidget | CodeWidget | ColorWidget | DateTimeWidget | HiddenWidget | FileWidget | ImageWidget | ListWidget | MapWidget | NumberWidget | ObjectWidget | RelationWidget | SelectWidget | StringWidget | TextWidget | MarkdownWidget;
|
|
128
137
|
export interface Collection {
|
|
129
138
|
/**
|
|
130
139
|
* unique identifier for the collection, used as the key
|
|
@@ -217,12 +226,17 @@ export interface Collection {
|
|
|
217
226
|
*/
|
|
218
227
|
view_groups?: string;
|
|
219
228
|
}
|
|
220
|
-
export interface FileCollection
|
|
229
|
+
export interface FileCollection {
|
|
230
|
+
name: string;
|
|
231
|
+
label?: string;
|
|
232
|
+
files: FileCollectionEntry[];
|
|
233
|
+
}
|
|
234
|
+
export interface FileCollectionEntry extends Collection {
|
|
221
235
|
/**
|
|
222
236
|
* specifies the collection type and location;
|
|
223
237
|
* details in Collection Types
|
|
224
238
|
*/
|
|
225
|
-
|
|
239
|
+
file: string;
|
|
226
240
|
}
|
|
227
241
|
export interface FolderCollection extends Collection {
|
|
228
242
|
/**
|
package/package.json
CHANGED