@vexcms/core 0.0.8 → 0.0.10
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.d.ts +528 -33
- package/dist/index.js +643 -81
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,115 @@ import { VObject, GenericValidator, ObjectType, PropertyValidators, v } from 'co
|
|
|
5
5
|
import { ColumnDef } from '@tanstack/react-table';
|
|
6
6
|
import { ZodTypeAny, z } from 'zod';
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* The style tier identifiers that a block can declare in admin.blockStyles.
|
|
10
|
+
* Each tier corresponds to a section in the style popover and a set of CSS properties.
|
|
11
|
+
*/
|
|
12
|
+
type StyleTier = "container" | "text" | "layout" | "media";
|
|
13
|
+
/**
|
|
14
|
+
* Container styles — universal layout/visual properties applied to the block's outer wrapper.
|
|
15
|
+
* All values are Tailwind scale keys (e.g., "4" → 1rem/16px) or color strings.
|
|
16
|
+
*/
|
|
17
|
+
interface ContainerStyleConfig {
|
|
18
|
+
/** Tailwind margin scale value. Shorthand: applies to all sides. */
|
|
19
|
+
margin?: string;
|
|
20
|
+
marginTop?: string;
|
|
21
|
+
marginRight?: string;
|
|
22
|
+
marginBottom?: string;
|
|
23
|
+
marginLeft?: string;
|
|
24
|
+
/** Tailwind padding scale value. */
|
|
25
|
+
padding?: string;
|
|
26
|
+
paddingTop?: string;
|
|
27
|
+
paddingRight?: string;
|
|
28
|
+
paddingBottom?: string;
|
|
29
|
+
paddingLeft?: string;
|
|
30
|
+
/** Tailwind width class key (e.g., "full", "1/2", "screen"). */
|
|
31
|
+
width?: string;
|
|
32
|
+
/** Tailwind max-width class key. */
|
|
33
|
+
maxWidth?: string;
|
|
34
|
+
/** Background color — CSS color string or CSS variable reference. */
|
|
35
|
+
backgroundColor?: string;
|
|
36
|
+
/** Border width — Tailwind border width key (e.g., "", "2", "4"). */
|
|
37
|
+
borderWidth?: string;
|
|
38
|
+
/** Border color — CSS color string or CSS variable reference. */
|
|
39
|
+
borderColor?: string;
|
|
40
|
+
/** Border style. */
|
|
41
|
+
borderStyle?: "solid" | "dashed" | "dotted" | "none";
|
|
42
|
+
/** Tailwind border radius key (e.g., "sm", "md", "lg", "full"). */
|
|
43
|
+
borderRadius?: string;
|
|
44
|
+
/** Tailwind box shadow key (e.g., "sm", "md", "lg", "xl", "2xl", "none"). */
|
|
45
|
+
boxShadow?: string;
|
|
46
|
+
/** Tailwind opacity value (e.g., "0", "25", "50", "75", "100"). */
|
|
47
|
+
opacity?: string;
|
|
48
|
+
/** Display value. */
|
|
49
|
+
display?: "block" | "flex" | "grid" | "none" | "inline-flex";
|
|
50
|
+
/** Overflow value. */
|
|
51
|
+
overflow?: "hidden" | "scroll" | "auto" | "visible";
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Text styles — typography properties for text-heavy blocks.
|
|
55
|
+
*/
|
|
56
|
+
interface TextStyleConfig {
|
|
57
|
+
/** Text alignment. */
|
|
58
|
+
textAlign?: "left" | "center" | "right" | "justify";
|
|
59
|
+
/** Tailwind font size key (e.g., "sm", "base", "lg", "xl", "2xl"). */
|
|
60
|
+
fontSize?: string;
|
|
61
|
+
/** Tailwind font weight key (e.g., "normal", "medium", "semibold", "bold"). */
|
|
62
|
+
fontWeight?: string;
|
|
63
|
+
/** Text color — CSS color string or CSS variable reference. */
|
|
64
|
+
color?: string;
|
|
65
|
+
/** Tailwind line height key (e.g., "tight", "snug", "normal", "relaxed"). */
|
|
66
|
+
lineHeight?: string;
|
|
67
|
+
/** Tailwind letter spacing key (e.g., "tighter", "tight", "normal", "wide"). */
|
|
68
|
+
letterSpacing?: string;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Layout styles — for blocks that contain child elements in flex/grid layouts.
|
|
72
|
+
*/
|
|
73
|
+
interface LayoutStyleConfig {
|
|
74
|
+
/** Tailwind gap scale value. */
|
|
75
|
+
gap?: string;
|
|
76
|
+
/** Flex direction. */
|
|
77
|
+
flexDirection?: "row" | "column" | "row-reverse" | "column-reverse";
|
|
78
|
+
/** Align items. */
|
|
79
|
+
alignItems?: "start" | "center" | "end" | "stretch" | "baseline";
|
|
80
|
+
/** Justify content. */
|
|
81
|
+
justifyContent?: "start" | "center" | "end" | "between" | "around" | "evenly";
|
|
82
|
+
/** Flex wrap. */
|
|
83
|
+
flexWrap?: "wrap" | "nowrap" | "wrap-reverse";
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Media styles — for blocks with background images or media elements.
|
|
87
|
+
*/
|
|
88
|
+
interface MediaStyleConfig {
|
|
89
|
+
/** Object fit for background/media elements. */
|
|
90
|
+
objectFit?: "cover" | "contain" | "fill" | "none" | "scale-down";
|
|
91
|
+
/** Aspect ratio (e.g., "video", "square", "auto", or custom like "4/3"). */
|
|
92
|
+
aspectRatio?: string;
|
|
93
|
+
/** Object position (e.g., "center", "top", "bottom"). */
|
|
94
|
+
objectPosition?: string;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Combined style config for a single breakpoint.
|
|
98
|
+
* Which properties are present depends on the block's declared style tiers.
|
|
99
|
+
*/
|
|
100
|
+
interface BlockStyleValues extends ContainerStyleConfig, TextStyleConfig, LayoutStyleConfig, MediaStyleConfig {
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* The full blockStyles structure stored as JSON string.
|
|
104
|
+
* Keys are breakpoint names ("base" is always present, others come from config).
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* ```json
|
|
108
|
+
* {
|
|
109
|
+
* "base": { "margin": "4", "padding": "2", "backgroundColor": "#fff" },
|
|
110
|
+
* "sm": { "margin": "6" },
|
|
111
|
+
* "lg": { "margin": "8", "padding": "4" }
|
|
112
|
+
* }
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
115
|
+
type BlockStylesData = Record<string, BlockStyleValues>;
|
|
116
|
+
|
|
8
117
|
/**
|
|
9
118
|
* A rich text document is an array of Slate/Plate element nodes.
|
|
10
119
|
* This is the canonical type for all rich text content stored in VEX.
|
|
@@ -458,13 +567,21 @@ type UploadFieldDef = UploadFieldSingle | UploadFieldMany;
|
|
|
458
567
|
interface JsonFieldDef extends BaseField {
|
|
459
568
|
readonly type: "json";
|
|
460
569
|
}
|
|
570
|
+
/** Object field definition. Stores a named group of sub-fields as `v.object()`. */
|
|
571
|
+
interface ObjectFieldDef extends BaseField {
|
|
572
|
+
readonly type: "object";
|
|
573
|
+
/** Named sub-fields that make up this object. */
|
|
574
|
+
fields: Record<string, VexField>;
|
|
575
|
+
}
|
|
461
576
|
/** Array field definition. Wraps an inner field in `v.array()`. */
|
|
462
577
|
interface ArrayFieldDef extends BaseField {
|
|
463
578
|
readonly type: "array";
|
|
464
579
|
/** Display labels for the field (singular/plural). */
|
|
465
580
|
labels?: Labels;
|
|
466
|
-
/** The
|
|
467
|
-
|
|
581
|
+
/** The field type for each item in the array. */
|
|
582
|
+
items: VexField;
|
|
583
|
+
/** Default value for the array (used when creating new documents/blocks). */
|
|
584
|
+
defaultValue?: unknown[];
|
|
468
585
|
/** Minimum number of items. */
|
|
469
586
|
min?: number;
|
|
470
587
|
/** Maximum number of items. */
|
|
@@ -487,6 +604,88 @@ interface RichTextFieldDef extends BaseField {
|
|
|
487
604
|
*/
|
|
488
605
|
mediaCollection?: string;
|
|
489
606
|
}
|
|
607
|
+
/**
|
|
608
|
+
* Color picker field. Stores a color string in the configured format.
|
|
609
|
+
*
|
|
610
|
+
* @example
|
|
611
|
+
* ```ts
|
|
612
|
+
* accentColor: color({ label: "Accent Color", format: "hex" })
|
|
613
|
+
* primaryColor: color({ label: "Primary", format: "oklch", themeColors: true })
|
|
614
|
+
* ```
|
|
615
|
+
*/
|
|
616
|
+
interface ColorFieldDef extends BaseField {
|
|
617
|
+
readonly type: "color";
|
|
618
|
+
/**
|
|
619
|
+
* Default color value.
|
|
620
|
+
* Should be in the configured format (hex, hsl, or oklch).
|
|
621
|
+
*/
|
|
622
|
+
defaultValue?: string;
|
|
623
|
+
/**
|
|
624
|
+
* Output format for the color value.
|
|
625
|
+
* - "hex" — e.g., "#3b82f6" (default)
|
|
626
|
+
* - "hsl" — e.g., "hsl(217, 91%, 60%)"
|
|
627
|
+
* - "oklch" — e.g., "oklch(0.623 0.214 259.1)"
|
|
628
|
+
*/
|
|
629
|
+
format?: "hex" | "hsl" | "oklch";
|
|
630
|
+
/**
|
|
631
|
+
* When true, shows a "Theme Colors" tab in the color picker
|
|
632
|
+
* that displays CSS variables from the current page's computed styles.
|
|
633
|
+
* Users can select a theme color variable instead of picking a custom color.
|
|
634
|
+
*
|
|
635
|
+
* Default: false
|
|
636
|
+
*/
|
|
637
|
+
themeColors?: boolean;
|
|
638
|
+
}
|
|
639
|
+
/**
|
|
640
|
+
* A single tab definition within a tabs field.
|
|
641
|
+
*/
|
|
642
|
+
interface TabDef<TSlug extends string = string, TFields extends Record<string, VexField> = Record<string, VexField>> {
|
|
643
|
+
/** Display label for the tab in the admin panel. */
|
|
644
|
+
label: string;
|
|
645
|
+
/**
|
|
646
|
+
* All fields in this tab are nested under this key as an object.
|
|
647
|
+
* e.g., `slug: "light"` → `{ light: { background: "#fff", ... } }`
|
|
648
|
+
*/
|
|
649
|
+
slug: TSlug;
|
|
650
|
+
/** Fields within this tab. */
|
|
651
|
+
fields: TFields;
|
|
652
|
+
}
|
|
653
|
+
/**
|
|
654
|
+
* Tabs field definition. Groups fields into tabbed UI sections in the admin panel.
|
|
655
|
+
*
|
|
656
|
+
* - Tabs with `slug` create nested objects in the document
|
|
657
|
+
* - Tabs without `slug` flatten their fields onto the parent
|
|
658
|
+
*
|
|
659
|
+
* @example
|
|
660
|
+
* ```ts
|
|
661
|
+
* themeColors: tabs({
|
|
662
|
+
* label: "Theme Colors",
|
|
663
|
+
* tabs: [
|
|
664
|
+
* {
|
|
665
|
+
* label: "Light",
|
|
666
|
+
* slug: "light",
|
|
667
|
+
* fields: {
|
|
668
|
+
* background: color({ label: "Background" }),
|
|
669
|
+
* foreground: color({ label: "Foreground" }),
|
|
670
|
+
* },
|
|
671
|
+
* },
|
|
672
|
+
* {
|
|
673
|
+
* label: "Dark",
|
|
674
|
+
* slug: "dark",
|
|
675
|
+
* fields: {
|
|
676
|
+
* background: color({ label: "Background" }),
|
|
677
|
+
* foreground: color({ label: "Foreground" }),
|
|
678
|
+
* },
|
|
679
|
+
* },
|
|
680
|
+
* ],
|
|
681
|
+
* })
|
|
682
|
+
* ```
|
|
683
|
+
*/
|
|
684
|
+
interface TabsFieldDef<TTabs extends TabDef[] = TabDef[]> extends BaseField {
|
|
685
|
+
readonly type: "tabs";
|
|
686
|
+
/** The tab definitions. */
|
|
687
|
+
tabs: TTabs;
|
|
688
|
+
}
|
|
490
689
|
/**
|
|
491
690
|
* UI field definition. Non-persisted — renders a custom component only.
|
|
492
691
|
* Skipped during schema generation, form validation, and column generation.
|
|
@@ -513,6 +712,16 @@ interface BlockAdminConfig {
|
|
|
513
712
|
components?: {
|
|
514
713
|
Editor?: ComponentType<any>;
|
|
515
714
|
};
|
|
715
|
+
/**
|
|
716
|
+
* Enable block style controls in the admin panel.
|
|
717
|
+
*
|
|
718
|
+
* - `true` — enables container styles only (equivalent to `["container"]`)
|
|
719
|
+
* - `StyleTier[]` — enables specific style tiers (e.g., `["container", "text", "media"]`)
|
|
720
|
+
* - `undefined` / omitted — no style controls shown
|
|
721
|
+
*
|
|
722
|
+
* Available tiers: "container", "text", "layout", "media"
|
|
723
|
+
*/
|
|
724
|
+
blockStyles?: true | StyleTier[];
|
|
516
725
|
}
|
|
517
726
|
/**
|
|
518
727
|
* A block definition created by `defineBlock()`.
|
|
@@ -577,7 +786,7 @@ type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K>
|
|
|
577
786
|
* }
|
|
578
787
|
* ```
|
|
579
788
|
*/
|
|
580
|
-
type VexField = TextFieldDef | NumberFieldDef | CheckboxFieldDef | SelectFieldDef<string> | DateFieldDef | ImageUrlFieldDef | RelationshipFieldDef | UploadFieldDef | JsonFieldDef | ArrayFieldDef | RichTextFieldDef | UIFieldDef | BlocksFieldDef;
|
|
789
|
+
type VexField = TextFieldDef | NumberFieldDef | CheckboxFieldDef | SelectFieldDef<string> | DateFieldDef | ImageUrlFieldDef | RelationshipFieldDef | UploadFieldDef | JsonFieldDef | ObjectFieldDef | ArrayFieldDef | RichTextFieldDef | UIFieldDef | BlocksFieldDef | ColorFieldDef | TabsFieldDef;
|
|
581
790
|
/**
|
|
582
791
|
* Infer the TypeScript value type from a VexField.
|
|
583
792
|
* Uses the `type` discriminant and field options to determine the type.
|
|
@@ -610,6 +819,8 @@ type InferFieldType<F extends VexField> = F extends {
|
|
|
610
819
|
} ? string : F extends {
|
|
611
820
|
type: "json";
|
|
612
821
|
} ? unknown : F extends {
|
|
822
|
+
type: "object";
|
|
823
|
+
} ? Record<string, unknown> : F extends {
|
|
613
824
|
type: "richtext";
|
|
614
825
|
} ? RichTextDocument : F extends {
|
|
615
826
|
type: "blocks";
|
|
@@ -617,7 +828,11 @@ type InferFieldType<F extends VexField> = F extends {
|
|
|
617
828
|
type: "array";
|
|
618
829
|
} ? unknown[] : F extends {
|
|
619
830
|
type: "ui";
|
|
620
|
-
} ? never :
|
|
831
|
+
} ? never : F extends {
|
|
832
|
+
type: "color";
|
|
833
|
+
} ? string : F extends {
|
|
834
|
+
type: "tabs";
|
|
835
|
+
} ? Record<string, unknown> : never;
|
|
621
836
|
/**
|
|
622
837
|
* Infer the discriminated union type for a blocks field.
|
|
623
838
|
* Each block becomes an object type with `blockType` literal + `_key` + its field types.
|
|
@@ -629,8 +844,40 @@ type InferBlockUnion<F extends VexField> = F extends BlocksFieldDef ? F["blocks"
|
|
|
629
844
|
} & {
|
|
630
845
|
[K in keyof TFields]: InferFieldType<TFields[K] & VexField>;
|
|
631
846
|
} : never : never : never;
|
|
847
|
+
/**
|
|
848
|
+
* Infer the expanded tab fields from a tabs field definition.
|
|
849
|
+
* Each tab becomes a property keyed by its slug with an object of its inferred fields.
|
|
850
|
+
*/
|
|
851
|
+
type InferTabsExpansion<F extends TabsFieldDef> = F["tabs"][number] extends infer T ? T extends TabDef<infer TSlug, infer TFields> ? {
|
|
852
|
+
[K in TSlug]?: {
|
|
853
|
+
[FK in keyof TFields]: InferFieldType<TFields[FK] & VexField>;
|
|
854
|
+
};
|
|
855
|
+
} : {} : {};
|
|
856
|
+
/**
|
|
857
|
+
* Extract keys of fields that are tabs fields.
|
|
858
|
+
*/
|
|
859
|
+
type TabsFieldKeys<F extends Record<string, any>> = {
|
|
860
|
+
[K in keyof F]: (F[K] & VexField) extends {
|
|
861
|
+
type: "tabs";
|
|
862
|
+
} ? K : never;
|
|
863
|
+
}[keyof F];
|
|
864
|
+
/**
|
|
865
|
+
* Extract keys of fields that are NOT tabs fields.
|
|
866
|
+
*/
|
|
867
|
+
type NonTabsFieldKeys<F extends Record<string, any>> = {
|
|
868
|
+
[K in keyof F]: (F[K] & VexField) extends {
|
|
869
|
+
type: "tabs";
|
|
870
|
+
} ? never : K;
|
|
871
|
+
}[keyof F];
|
|
872
|
+
/**
|
|
873
|
+
* Expand all tabs fields in a record into their tab slug entries.
|
|
874
|
+
* Produces a union of objects (one per tabs field) which gets intersected.
|
|
875
|
+
*/
|
|
876
|
+
type ExpandTabsFields<F extends Record<string, any>> = TabsFieldKeys<F> extends infer TK ? TK extends keyof F ? InferTabsExpansion<F[TK] & TabsFieldDef> : {} : {};
|
|
632
877
|
/**
|
|
633
878
|
* Infer the document type from a record of fields.
|
|
879
|
+
* Tabs fields are expanded: instead of `colors: Record<string, unknown>`,
|
|
880
|
+
* produces `light?: { ... }; dark?: { ... }` based on the tab definitions.
|
|
634
881
|
*
|
|
635
882
|
* @example
|
|
636
883
|
* ```ts
|
|
@@ -641,9 +888,16 @@ type InferBlockUnion<F extends VexField> = F extends BlocksFieldDef ? F["blocks"
|
|
|
641
888
|
* // { title: string; count: number }
|
|
642
889
|
* ```
|
|
643
890
|
*/
|
|
644
|
-
type InferFieldsType<F extends Record<string, VexField>> = {
|
|
645
|
-
[
|
|
646
|
-
}
|
|
891
|
+
type InferFieldsType<F extends Record<string, VexField>> = 0 extends (1 & F) ? {
|
|
892
|
+
[x: string]: unknown;
|
|
893
|
+
} : {
|
|
894
|
+
[K in NonTabsFieldKeys<F> & keyof F]: InferFieldType<F[K] & VexField>;
|
|
895
|
+
} & UnionToIntersection<ExpandTabsFields<F>>;
|
|
896
|
+
/**
|
|
897
|
+
* Convert a union to an intersection.
|
|
898
|
+
* Used to merge expanded tab objects into a single type.
|
|
899
|
+
*/
|
|
900
|
+
type UnionToIntersection<U> = (U extends any ? (x: U) => void : never) extends (x: infer I) => void ? I : never;
|
|
647
901
|
|
|
648
902
|
/**
|
|
649
903
|
* Responsive breakpoint for the live preview iframe.
|
|
@@ -940,41 +1194,33 @@ interface GlobalAdminConfig<TFields extends Record<string, VexField> = Record<st
|
|
|
940
1194
|
*/
|
|
941
1195
|
useAsTitle?: keyof TFields;
|
|
942
1196
|
/**
|
|
943
|
-
*
|
|
944
|
-
*
|
|
945
|
-
|
|
946
|
-
defaultColumns?: (keyof TFields)[];
|
|
947
|
-
/**
|
|
948
|
-
* Disable the "Create New" button in the admin panel.
|
|
949
|
-
*
|
|
950
|
-
* Default: `false`
|
|
951
|
-
*/
|
|
952
|
-
disableCreate?: boolean;
|
|
953
|
-
/**
|
|
954
|
-
* Disable the delete action in the admin panel.
|
|
955
|
-
*
|
|
956
|
-
* Default: `false`
|
|
1197
|
+
* Live preview configuration.
|
|
1198
|
+
* When set, the admin edit view shows a toggleable side-by-side preview panel
|
|
1199
|
+
* with an iframe loading the configured URL.
|
|
957
1200
|
*/
|
|
958
|
-
|
|
1201
|
+
livePreview?: LivePreviewConfig<TFields>;
|
|
959
1202
|
}
|
|
960
1203
|
/**
|
|
961
|
-
* A global definition.
|
|
962
|
-
*
|
|
1204
|
+
* A global definition. Globals are singleton documents — only one
|
|
1205
|
+
* document exists per global. The admin panel shows them as a single
|
|
1206
|
+
* editable form, not a list view.
|
|
963
1207
|
*
|
|
964
1208
|
* @example
|
|
965
1209
|
* ```ts
|
|
966
|
-
* const siteSettings = {
|
|
1210
|
+
* const siteSettings = defineGlobal({
|
|
967
1211
|
* slug: "site_settings",
|
|
968
1212
|
* label: "Site Settings",
|
|
969
1213
|
* fields: {
|
|
970
|
-
* siteName: {
|
|
1214
|
+
* siteName: text({ label: "Site Name", required: true }),
|
|
1215
|
+
* description: text({ label: "Description" }),
|
|
971
1216
|
* },
|
|
972
|
-
*
|
|
1217
|
+
* admin: { useAsTitle: "siteName" },
|
|
1218
|
+
* });
|
|
973
1219
|
* ```
|
|
974
1220
|
*/
|
|
975
|
-
interface VexGlobal<TFields extends Record<string, VexField> = Record<string, VexField
|
|
1221
|
+
interface VexGlobal<TFields extends Record<string, VexField> = Record<string, VexField>, TSlug extends string = string> {
|
|
976
1222
|
/** The global identifier, used in URLs and the database. */
|
|
977
|
-
readonly slug:
|
|
1223
|
+
readonly slug: TSlug;
|
|
978
1224
|
/**
|
|
979
1225
|
* The fields that make up this global document.
|
|
980
1226
|
*/
|
|
@@ -991,9 +1237,15 @@ interface VexGlobal<TFields extends Record<string, VexField> = Record<string, Ve
|
|
|
991
1237
|
tableName?: string;
|
|
992
1238
|
/**
|
|
993
1239
|
* Admin UI configuration for this global.
|
|
994
|
-
* Controls sidebar grouping, icons, and
|
|
1240
|
+
* Controls sidebar grouping, icons, and live preview.
|
|
995
1241
|
*/
|
|
996
1242
|
admin?: GlobalAdminConfig<TFields>;
|
|
1243
|
+
/**
|
|
1244
|
+
* Versioning and draft/publish workflow configuration.
|
|
1245
|
+
* When `drafts` is enabled, the admin panel shows Save Draft + Publish
|
|
1246
|
+
* and version history, same as versioned collections.
|
|
1247
|
+
*/
|
|
1248
|
+
versions?: VersionsConfig;
|
|
997
1249
|
/**
|
|
998
1250
|
* TypeScript interface name used in generated `vex.types.ts`.
|
|
999
1251
|
* If not set, auto-generated from slug via PascalCase conversion.
|
|
@@ -1383,15 +1635,24 @@ interface MediaConfigInput {
|
|
|
1383
1635
|
type ExtractSlug<T> = T extends {
|
|
1384
1636
|
slug: infer S extends string;
|
|
1385
1637
|
} ? S : never;
|
|
1638
|
+
/**
|
|
1639
|
+
* Expand field keys from a fields record, replacing tabs field keys with their tab slugs.
|
|
1640
|
+
*/
|
|
1641
|
+
type ExpandedFieldKeys<TFields extends Record<string, any>> = {
|
|
1642
|
+
[K in keyof TFields & string]: (TFields[K] & VexField) extends {
|
|
1643
|
+
type: "tabs";
|
|
1644
|
+
} ? (TFields[K] & TabsFieldDef)["tabs"][number] extends TabDef<infer TSlug> ? TSlug : never : K;
|
|
1645
|
+
}[keyof TFields & string];
|
|
1386
1646
|
/**
|
|
1387
1647
|
* Extract field keys from a VexCollection (including auth extra keys) or VexGlobal.
|
|
1648
|
+
* Tabs fields are expanded: instead of the tabs field name, the tab slugs are returned.
|
|
1388
1649
|
*
|
|
1389
1650
|
* @example
|
|
1390
1651
|
* type K = ExtractFieldKeys<typeof posts>; // "title" | "slug" | "status" | "featured"
|
|
1391
1652
|
*/
|
|
1392
1653
|
type ExtractFieldKeys<T> = T extends VexCollection<infer TFields, infer TExtraKeys> ? T extends {
|
|
1393
1654
|
_isMedia: true;
|
|
1394
|
-
} ?
|
|
1655
|
+
} ? ExpandedFieldKeys<TFields> | (TExtraKeys & string) | DefaultMediaFieldKeys : ExpandedFieldKeys<TFields> | (TExtraKeys & string) : T extends VexMediaCollection<infer TFields> ? ExpandedFieldKeys<TFields> | DefaultMediaFieldKeys : T extends VexGlobal<infer TFields> ? ExpandedFieldKeys<TFields> : never;
|
|
1395
1656
|
/**
|
|
1396
1657
|
* Extract the inferred document type from a VexCollection or VexGlobal.
|
|
1397
1658
|
* Includes `_id` (system field) and auth extra keys (typed as `string`).
|
|
@@ -1480,8 +1741,24 @@ type SingleResourceEntry<R, TUser, TOrg> = R extends {
|
|
|
1480
1741
|
* TS eagerly resolves intersection members for LSP autocomplete.
|
|
1481
1742
|
*/
|
|
1482
1743
|
type ResourcePermissionMap<TResources extends readonly any[], TUser, TOrg> = TResources extends readonly [infer Head, ...infer Tail] ? SingleResourceEntry<Head, TUser, TOrg> & ResourcePermissionMap<Tail, TUser, TOrg> : {};
|
|
1744
|
+
/**
|
|
1745
|
+
* Permission check for admin panel access.
|
|
1746
|
+
* - `boolean` — static allow/deny
|
|
1747
|
+
* - `(props) => boolean` — dynamic check based on user (and org if configured)
|
|
1748
|
+
*
|
|
1749
|
+
* Defaults to `false` if not specified for a role.
|
|
1750
|
+
*/
|
|
1751
|
+
type AdminPermissionCheck<TUser = Record<string, any>, TOrg = never> = boolean | (([TOrg] extends [never] ? (props: {
|
|
1752
|
+
user: TUser;
|
|
1753
|
+
}) => boolean : (props: {
|
|
1754
|
+
user: TUser;
|
|
1755
|
+
organization: TOrg;
|
|
1756
|
+
}) => boolean));
|
|
1483
1757
|
type RolesWithPermissions<TRoles extends string, TResources extends readonly any[], TUser = Record<string, any>, TOrg = never> = {
|
|
1484
|
-
[Role in TRoles]: ResourcePermissionMap<TResources, TUser, TOrg
|
|
1758
|
+
[Role in TRoles]: ResourcePermissionMap<TResources, TUser, TOrg> & {
|
|
1759
|
+
/** Whether this role can access the admin panel. Defaults to false if not specified. */
|
|
1760
|
+
admin?: AdminPermissionCheck<TUser, TOrg>;
|
|
1761
|
+
};
|
|
1485
1762
|
};
|
|
1486
1763
|
/**
|
|
1487
1764
|
* Input shape for `defineAccess()` WITHOUT organization support.
|
|
@@ -1583,6 +1860,21 @@ interface VexAccessConfig {
|
|
|
1583
1860
|
boolean | Partial<Record<AccessAction, PermissionCheck<string, any, any, any>>>> | undefined>;
|
|
1584
1861
|
}
|
|
1585
1862
|
|
|
1863
|
+
/**
|
|
1864
|
+
* Responsive breakpoint configuration for block style controls.
|
|
1865
|
+
* Keys are breakpoint names (used as Tailwind prefixes), values are min-width in pixels.
|
|
1866
|
+
*
|
|
1867
|
+
* @example
|
|
1868
|
+
* ```ts
|
|
1869
|
+
* breakpoints: {
|
|
1870
|
+
* sm: 640,
|
|
1871
|
+
* md: 768,
|
|
1872
|
+
* lg: 1024,
|
|
1873
|
+
* xl: 1280,
|
|
1874
|
+
* }
|
|
1875
|
+
* ```
|
|
1876
|
+
*/
|
|
1877
|
+
type BreakpointConfig = Record<string, number>;
|
|
1586
1878
|
/** Resolved Vex CMS configuration */
|
|
1587
1879
|
interface VexConfig {
|
|
1588
1880
|
/** Base URL path for the admin panel */
|
|
@@ -1603,6 +1895,8 @@ interface VexConfig {
|
|
|
1603
1895
|
access?: VexAccessConfig;
|
|
1604
1896
|
/** Global rich text editor adapter. Used by all richtext fields unless overridden. */
|
|
1605
1897
|
editor?: VexEditorAdapter;
|
|
1898
|
+
/** Responsive breakpoints for block style controls. If not set, styles apply to all viewports. */
|
|
1899
|
+
breakpoints?: BreakpointConfig;
|
|
1606
1900
|
}
|
|
1607
1901
|
/**
|
|
1608
1902
|
* Client-safe version of VexConfig with all non-serializable values stripped.
|
|
@@ -1621,6 +1915,8 @@ interface ClientVexConfig {
|
|
|
1621
1915
|
media?: ClientMediaConfig;
|
|
1622
1916
|
/** Global rich text editor adapter. */
|
|
1623
1917
|
editor?: VexEditorAdapter;
|
|
1918
|
+
/** Responsive breakpoints for block style controls. If not set, styles apply to all viewports. */
|
|
1919
|
+
breakpoints?: BreakpointConfig;
|
|
1624
1920
|
}
|
|
1625
1921
|
/**
|
|
1626
1922
|
* Input configuration for `defineConfig`. All fields are optional
|
|
@@ -1676,7 +1972,44 @@ interface VexConfigInput {
|
|
|
1676
1972
|
* Pass `plateEditor()` from `@vexcms/richtext/editor`.
|
|
1677
1973
|
*/
|
|
1678
1974
|
editor?: VexEditorAdapter;
|
|
1975
|
+
/**
|
|
1976
|
+
* Responsive breakpoints for block style controls.
|
|
1977
|
+
* Keys are Tailwind prefix names, values are min-width in pixels.
|
|
1978
|
+
* If not set, block styles apply to all viewports (no breakpoint tabs).
|
|
1979
|
+
*/
|
|
1980
|
+
breakpoints?: BreakpointConfig;
|
|
1981
|
+
/**
|
|
1982
|
+
* Plugins to apply to the config. Each plugin is a function that receives
|
|
1983
|
+
* the config input and returns a modified config input. Plugins run
|
|
1984
|
+
* sequentially before the config is resolved.
|
|
1985
|
+
*
|
|
1986
|
+
* @example
|
|
1987
|
+
* ```ts
|
|
1988
|
+
* export default defineConfig({
|
|
1989
|
+
* plugins: [
|
|
1990
|
+
* seoPlugin({ collections: ["pages"] }),
|
|
1991
|
+
* ],
|
|
1992
|
+
* collections: [pages],
|
|
1993
|
+
* })
|
|
1994
|
+
* ```
|
|
1995
|
+
*/
|
|
1996
|
+
plugins?: VexPlugin[];
|
|
1679
1997
|
}
|
|
1998
|
+
/**
|
|
1999
|
+
* A Vex plugin is a function that transforms the config input.
|
|
2000
|
+
* Plugins receive the config (with all previous plugins applied)
|
|
2001
|
+
* and return a modified config. Use a curried function for options:
|
|
2002
|
+
*
|
|
2003
|
+
* @example
|
|
2004
|
+
* ```ts
|
|
2005
|
+
* export const myPlugin = (opts: MyOpts): VexPlugin =>
|
|
2006
|
+
* (config) => ({
|
|
2007
|
+
* ...config,
|
|
2008
|
+
* collections: [...(config.collections ?? []), myCollection],
|
|
2009
|
+
* })
|
|
2010
|
+
* ```
|
|
2011
|
+
*/
|
|
2012
|
+
type VexPlugin = (config: VexConfigInput) => VexConfigInput;
|
|
1680
2013
|
|
|
1681
2014
|
declare function defineConfig(vexConfig: VexConfigInput): VexConfig;
|
|
1682
2015
|
|
|
@@ -1759,6 +2092,37 @@ declare function defineMediaCollection<TFields extends Record<string, VexField>
|
|
|
1759
2092
|
admin?: CollectionAdminConfig<TFields, DefaultMediaFieldKeys>;
|
|
1760
2093
|
}): VexMediaCollection<TFields, TSlug>;
|
|
1761
2094
|
|
|
2095
|
+
/**
|
|
2096
|
+
* Creates a VexGlobal with full LSP autocomplete on field names
|
|
2097
|
+
* and `admin.useAsTitle`, etc.
|
|
2098
|
+
*
|
|
2099
|
+
* A global is a singleton document — only one document exists per global.
|
|
2100
|
+
* The admin panel shows it as a single editable form, not a list.
|
|
2101
|
+
*
|
|
2102
|
+
* @example
|
|
2103
|
+
* ```ts
|
|
2104
|
+
* export const siteSettings = defineGlobal({
|
|
2105
|
+
* slug: "site_settings",
|
|
2106
|
+
* label: "Site Settings",
|
|
2107
|
+
* fields: {
|
|
2108
|
+
* siteName: text({ label: "Site Name", required: true }),
|
|
2109
|
+
* description: text({ label: "Description" }),
|
|
2110
|
+
* },
|
|
2111
|
+
* admin: { useAsTitle: "siteName" },
|
|
2112
|
+
* versions: { drafts: true },
|
|
2113
|
+
* });
|
|
2114
|
+
* ```
|
|
2115
|
+
*/
|
|
2116
|
+
declare function defineGlobal<TFields extends Record<string, VexField>, TSlug extends string = string>(props: {
|
|
2117
|
+
readonly slug: TSlug;
|
|
2118
|
+
fields: TFields;
|
|
2119
|
+
label?: string;
|
|
2120
|
+
tableName?: string;
|
|
2121
|
+
admin?: GlobalAdminConfig<TFields>;
|
|
2122
|
+
versions?: VersionsConfig;
|
|
2123
|
+
interfaceName?: string;
|
|
2124
|
+
}): VexGlobal<TFields, TSlug>;
|
|
2125
|
+
|
|
1762
2126
|
/**
|
|
1763
2127
|
* Define access permissions for the Vex CMS admin panel.
|
|
1764
2128
|
*
|
|
@@ -1813,6 +2177,69 @@ declare function hasPermission(props: {
|
|
|
1813
2177
|
throwOnDenied?: boolean;
|
|
1814
2178
|
}): ResolvedFieldPermissions | boolean;
|
|
1815
2179
|
|
|
2180
|
+
/**
|
|
2181
|
+
* Check whether a user has access to the admin panel.
|
|
2182
|
+
*
|
|
2183
|
+
* Evaluates the `admin` permission on each of the user's roles.
|
|
2184
|
+
* If any role has `admin: true` (or a callback that returns true),
|
|
2185
|
+
* the user is granted access. Returns false if no role grants access
|
|
2186
|
+
* or if the access config is not defined.
|
|
2187
|
+
*
|
|
2188
|
+
* @param props.access - The VexAccessConfig from defineAccess
|
|
2189
|
+
* @param props.user - The user object (passed to dynamic permission callbacks)
|
|
2190
|
+
* @param props.userRoles - The user's role(s) as a string array
|
|
2191
|
+
* @param props.organization - Optional organization object (passed to callbacks if org support is configured)
|
|
2192
|
+
* @returns Whether the user can access the admin panel
|
|
2193
|
+
*/
|
|
2194
|
+
declare function checkAdminAccess(props: {
|
|
2195
|
+
access: VexAccessConfig | undefined;
|
|
2196
|
+
user: Record<string, any>;
|
|
2197
|
+
userRoles: string[];
|
|
2198
|
+
organization?: Record<string, any>;
|
|
2199
|
+
}): boolean;
|
|
2200
|
+
|
|
2201
|
+
/**
|
|
2202
|
+
* Framework-agnostic site metadata object.
|
|
2203
|
+
* Consumers (Next.js, TanStack Start, etc.) map this to their framework's metadata format.
|
|
2204
|
+
*/
|
|
2205
|
+
interface SiteMetadata {
|
|
2206
|
+
title: string;
|
|
2207
|
+
description: string;
|
|
2208
|
+
ogImage?: string;
|
|
2209
|
+
twitterHandle?: string;
|
|
2210
|
+
}
|
|
2211
|
+
/**
|
|
2212
|
+
* Build site metadata by merging site-wide defaults with per-page overrides.
|
|
2213
|
+
*
|
|
2214
|
+
* Resolution order (per-page wins over site-wide):
|
|
2215
|
+
* - title: page.metaTitle → page.title → site.metaTitle → site.name → "Untitled"
|
|
2216
|
+
* - description: page.metaDescription → site.metaDescription → site.description → ""
|
|
2217
|
+
* - ogImage: page.ogImage → site.ogImage → undefined
|
|
2218
|
+
* - twitterHandle: site.twitterHandle → undefined
|
|
2219
|
+
*
|
|
2220
|
+
* @param props.site - Site settings fields (from globals)
|
|
2221
|
+
* @param props.page - Optional per-page overrides
|
|
2222
|
+
* @param props.titleSuffix - Optional suffix appended to title (e.g. " | My Site")
|
|
2223
|
+
* @returns Framework-agnostic metadata object
|
|
2224
|
+
*/
|
|
2225
|
+
declare function buildSiteMetadata(props: {
|
|
2226
|
+
site: {
|
|
2227
|
+
name?: string;
|
|
2228
|
+
metaTitle?: string;
|
|
2229
|
+
metaDescription?: string;
|
|
2230
|
+
description?: string;
|
|
2231
|
+
ogImage?: string;
|
|
2232
|
+
twitterHandle?: string;
|
|
2233
|
+
};
|
|
2234
|
+
page?: {
|
|
2235
|
+
title?: string;
|
|
2236
|
+
metaTitle?: string;
|
|
2237
|
+
metaDescription?: string;
|
|
2238
|
+
ogImage?: string;
|
|
2239
|
+
};
|
|
2240
|
+
titleSuffix?: string;
|
|
2241
|
+
}): SiteMetadata;
|
|
2242
|
+
|
|
1816
2243
|
/**
|
|
1817
2244
|
* Strip non-serializable values from VexConfig for safe passage across
|
|
1818
2245
|
* RSC / JSON serialization boundaries (e.g., server layout → client component).
|
|
@@ -2079,6 +2506,8 @@ declare function upload(options: Omit<UploadFieldSingle, "type">): UploadFieldDe
|
|
|
2079
2506
|
|
|
2080
2507
|
declare function json(options?: Omit<JsonFieldDef, "type">): JsonFieldDef;
|
|
2081
2508
|
|
|
2509
|
+
declare function object(options: Omit<ObjectFieldDef, "type">): ObjectFieldDef;
|
|
2510
|
+
|
|
2082
2511
|
declare function array(options: Omit<ArrayFieldDef, "type">): ArrayFieldDef;
|
|
2083
2512
|
|
|
2084
2513
|
/**
|
|
@@ -2165,6 +2594,30 @@ declare function blocks(props: {
|
|
|
2165
2594
|
admin?: BlocksFieldDef["admin"];
|
|
2166
2595
|
}): BlocksFieldDef;
|
|
2167
2596
|
|
|
2597
|
+
/**
|
|
2598
|
+
* Creates a color field definition.
|
|
2599
|
+
*
|
|
2600
|
+
* @param props - Color field configuration
|
|
2601
|
+
* @param props.label - Display label in admin panel
|
|
2602
|
+
* @param props.format - Output format: "hex" (default), "hsl", or "oklch"
|
|
2603
|
+
* @param props.themeColors - When true, shows theme CSS variable picker tab
|
|
2604
|
+
* @returns ColorFieldDef
|
|
2605
|
+
*/
|
|
2606
|
+
declare function color(props?: Omit<ColorFieldDef, "type">): ColorFieldDef;
|
|
2607
|
+
|
|
2608
|
+
/**
|
|
2609
|
+
* Creates a tabs field definition.
|
|
2610
|
+
* Groups fields into tabbed UI sections in the admin panel.
|
|
2611
|
+
*
|
|
2612
|
+
* Tabs with `slug` create nested objects in the document.
|
|
2613
|
+
* Tabs without `slug` flatten their fields onto the parent.
|
|
2614
|
+
*
|
|
2615
|
+
* @param props - Tabs field configuration
|
|
2616
|
+
* @param props.tabs - Array of tab definitions with label, optional slug, and fields
|
|
2617
|
+
* @returns TabsFieldDef with preserved tab slug and field type information
|
|
2618
|
+
*/
|
|
2619
|
+
declare function tabs<const TTabs extends TabDef[]>(props: Omit<TabsFieldDef<TTabs>, "type">): TabsFieldDef<TTabs>;
|
|
2620
|
+
|
|
2168
2621
|
/**
|
|
2169
2622
|
* Define a block type for use with the `blocks()` field.
|
|
2170
2623
|
*
|
|
@@ -2197,6 +2650,48 @@ declare function defineBlock<TFields extends Record<string, VexField>>(props: {
|
|
|
2197
2650
|
interfaceName?: string;
|
|
2198
2651
|
}): BlockDef<TFields>;
|
|
2199
2652
|
|
|
2653
|
+
interface StylePreset {
|
|
2654
|
+
/** Tailwind scale value (stored in blockStyles JSON). */
|
|
2655
|
+
value: string;
|
|
2656
|
+
/** Display label in the popover. */
|
|
2657
|
+
label: string;
|
|
2658
|
+
/** Size hint shown next to the label (e.g., "16px / 1rem"). */
|
|
2659
|
+
hint: string;
|
|
2660
|
+
}
|
|
2661
|
+
declare const SPACING_PRESETS: StylePreset[];
|
|
2662
|
+
declare const FONT_SIZE_PRESETS: StylePreset[];
|
|
2663
|
+
declare const FONT_WEIGHT_PRESETS: StylePreset[];
|
|
2664
|
+
declare const BORDER_RADIUS_PRESETS: StylePreset[];
|
|
2665
|
+
declare const BOX_SHADOW_PRESETS: StylePreset[];
|
|
2666
|
+
declare const OPACITY_PRESETS: StylePreset[];
|
|
2667
|
+
declare const WIDTH_PRESETS: StylePreset[];
|
|
2668
|
+
declare const MAX_WIDTH_PRESETS: StylePreset[];
|
|
2669
|
+
declare const LINE_HEIGHT_PRESETS: StylePreset[];
|
|
2670
|
+
declare const LETTER_SPACING_PRESETS: StylePreset[];
|
|
2671
|
+
declare const BORDER_WIDTH_PRESETS: StylePreset[];
|
|
2672
|
+
declare const ASPECT_RATIO_PRESETS: StylePreset[];
|
|
2673
|
+
|
|
2674
|
+
/**
|
|
2675
|
+
* Convert a blockStyles JSON string into a Tailwind class string.
|
|
2676
|
+
*
|
|
2677
|
+
* Handles responsive breakpoint prefixes. The "base" breakpoint has no prefix,
|
|
2678
|
+
* all other breakpoints use their key as prefix (e.g., "sm:", "md:", "lg:").
|
|
2679
|
+
*
|
|
2680
|
+
* @param props.blockStylesJson - The raw JSON string from the block instance's blockStyles field
|
|
2681
|
+
* @returns Tailwind class string ready to use in className, or empty string if input is empty/invalid
|
|
2682
|
+
*
|
|
2683
|
+
* @example
|
|
2684
|
+
* ```ts
|
|
2685
|
+
* blockStylesToTailwind({
|
|
2686
|
+
* blockStylesJson: '{"base":{"margin":"4","padding":"2"},"sm":{"margin":"6"}}'
|
|
2687
|
+
* })
|
|
2688
|
+
* // → "m-4 p-2 sm:m-6"
|
|
2689
|
+
* ```
|
|
2690
|
+
*/
|
|
2691
|
+
declare function blockStylesToTailwind(props: {
|
|
2692
|
+
blockStylesJson: string | undefined;
|
|
2693
|
+
}): string;
|
|
2694
|
+
|
|
2200
2695
|
/**
|
|
2201
2696
|
* Generate the complete TypeScript source for `vex.types.ts`.
|
|
2202
2697
|
*
|
|
@@ -2667,4 +3162,4 @@ declare function planMigration(props: {
|
|
|
2667
3162
|
config: VexConfig;
|
|
2668
3163
|
}): MigrationOp[];
|
|
2669
3164
|
|
|
2670
|
-
export { ALL_SYSTEM_FIELDS, type AccessAction, type AdminConfig, type AdminConfigInput, type AdminLivePreviewConfig, type AdminMetaInput, type AdminSidebarInput, type AnyVexCollection, type ArrayFieldDef, type AuthCollectionFieldKeys, type AuthTableFieldKeys, type BlockAdminConfig, type BlockDef, type BlocksFieldDef, type CellComponentProps, type CheckboxFieldDef, type ClientMediaConfig, type ClientVexConfig, type CollectionAdminConfig, type CollectionKind, type CollectionQueryImports, DEFAULT_AUTOSAVE_INTERVAL, DEFAULT_BREAKPOINTS, DEFAULT_MAX_VERSIONS_PER_DOC, type DateFieldDef, type DefaultMediaFieldKeys, type DistributiveOmit, type ExtractDocType, type ExtractFieldKeys, type ExtractSlug, type ExtractSlugs, type FieldAdminConfig, type FieldComponentProps, type FieldPermissionResult, type FileStorageAdapter, GENERATED_HEADER, type GeneratedFiles, type GlobalAdminConfig, type ImageUrlFieldDef, type IndexConfig, type InferBlockUnion, type InferFieldType, type InferFieldsType, type JsonFieldDef, LOCKED_MEDIA_FIELDS, type LivePreviewBreakpoint, type LivePreviewConfig, type LockedMediaField, type LookupBySlug, type MediaConfig, type MediaConfigInput, type MergedCollectionResult, type MigrationOp, type NumberFieldDef, OVERRIDABLE_MEDIA_FIELDS, type OverridableMediaField, PREVIEW_SNAPSHOT_DEBOUNCE_MS, type PermissionCallbackProps, type PermissionCheck, type RelationshipFieldDef, type RemovedFieldInfo, type ResolvedCollectionMatch, type ResolvedFieldPermissions, type ResolvedIndex, type ResolvedSearchIndex, type ResourcePermissions, type RichTextDocument, type RichTextElement, type RichTextFieldDef, type RichTextText, type RolesWithPermissions, type SchemaDiff, type SchemaFieldInfo, type SearchIndexConfig, type SelectFieldDef, type SelectOption, type TextFieldDef, type UIFieldDef, type UploadFieldDef, VERSION_SYSTEM_FIELDS, type VersioningFieldKeys, type VersionsConfig, type VexAccessConfig, VexAccessConfigError, VexAccessError, type VexAccessInput, type VexAccessInputBase, type VexAccessInputWithOrg, type VexAuthAdapter, VexAuthConfigError, VexBlockValidationError, type VexCollection, type VexConfig, type VexConfigInput, type VexDraftsMode, type VexEditorAdapter, type VexEditorComponentProps, VexError, type VexField, VexFieldValidationError, type VexGlobal, type VexMediaCollection, VexMediaConfigError, type VexQueryCtx, type VexRenderComponentProps, VexSlugConflictError, addRemovedFieldsAsOptional, array, blocks, checkbox, createDocument, createVexQuery, date, defineAccess, defineBlock, defineCollection, defineConfig, defineMediaCollection, deleteDocument, deletePreviewSnapshot, diffSchema, extendTable, extractLivePreviewConfigs, extractUserFields, fieldMetaToZod, findCollectionBySlug, generateCollectionQueries, generateColumns, generateFormDefaultValues, generateFormSchema, generateIndexFile, generateVexSchema, generateVexTypes, getAllCollections, getDocument, getPreviewSnapshot, hasPermission, imageUrl, isMediaCollection, json, listDocuments, makeFieldsOptional, mergeAuthCollectionWithUserCollection, number, planMigration, relationship, resolvePreviewURL, richtext, sanitizeConfigForClient, searchDocuments, select, shouldReloadURL, slugToInterfaceName, text, toTitleCase, ui, updateDocument, upload, upsertPreviewSnapshot, vexQuery };
|
|
3165
|
+
export { ALL_SYSTEM_FIELDS, ASPECT_RATIO_PRESETS, type AccessAction, type AdminConfig, type AdminConfigInput, type AdminLivePreviewConfig, type AdminMetaInput, type AdminSidebarInput, type AnyVexCollection, type ArrayFieldDef, type AuthCollectionFieldKeys, type AuthTableFieldKeys, BORDER_RADIUS_PRESETS, BORDER_WIDTH_PRESETS, BOX_SHADOW_PRESETS, type BlockAdminConfig, type BlockDef, type BlockStyleValues, type BlockStylesData, type BlocksFieldDef, type BreakpointConfig, type CellComponentProps, type CheckboxFieldDef, type ClientMediaConfig, type ClientVexConfig, type CollectionAdminConfig, type CollectionKind, type CollectionQueryImports, type ColorFieldDef, type ContainerStyleConfig, DEFAULT_AUTOSAVE_INTERVAL, DEFAULT_BREAKPOINTS, DEFAULT_MAX_VERSIONS_PER_DOC, type DateFieldDef, type DefaultMediaFieldKeys, type DistributiveOmit, type ExtractDocType, type ExtractFieldKeys, type ExtractSlug, type ExtractSlugs, FONT_SIZE_PRESETS, FONT_WEIGHT_PRESETS, type FieldAdminConfig, type FieldComponentProps, type FieldPermissionResult, type FileStorageAdapter, GENERATED_HEADER, type GeneratedFiles, type GlobalAdminConfig, type ImageUrlFieldDef, type IndexConfig, type InferBlockUnion, type InferFieldType, type InferFieldsType, type JsonFieldDef, LETTER_SPACING_PRESETS, LINE_HEIGHT_PRESETS, LOCKED_MEDIA_FIELDS, type LayoutStyleConfig, type LivePreviewBreakpoint, type LivePreviewConfig, type LockedMediaField, type LookupBySlug, MAX_WIDTH_PRESETS, type MediaConfig, type MediaConfigInput, type MediaStyleConfig, type MergedCollectionResult, type MigrationOp, type NumberFieldDef, OPACITY_PRESETS, OVERRIDABLE_MEDIA_FIELDS, type ObjectFieldDef, type OverridableMediaField, PREVIEW_SNAPSHOT_DEBOUNCE_MS, type PermissionCallbackProps, type PermissionCheck, type RelationshipFieldDef, type RemovedFieldInfo, type ResolvedCollectionMatch, type ResolvedFieldPermissions, type ResolvedIndex, type ResolvedSearchIndex, type ResourcePermissions, type RichTextDocument, type RichTextElement, type RichTextFieldDef, type RichTextText, type RolesWithPermissions, SPACING_PRESETS, type SchemaDiff, type SchemaFieldInfo, type SearchIndexConfig, type SelectFieldDef, type SelectOption, type SiteMetadata, type StylePreset, type StyleTier, type TabDef, type TabsFieldDef, type TextFieldDef, type TextStyleConfig, type UIFieldDef, type UploadFieldDef, VERSION_SYSTEM_FIELDS, type VersioningFieldKeys, type VersionsConfig, type VexAccessConfig, VexAccessConfigError, VexAccessError, type VexAccessInput, type VexAccessInputBase, type VexAccessInputWithOrg, type VexAuthAdapter, VexAuthConfigError, VexBlockValidationError, type VexCollection, type VexConfig, type VexConfigInput, type VexDraftsMode, type VexEditorAdapter, type VexEditorComponentProps, VexError, type VexField, VexFieldValidationError, type VexGlobal, type VexMediaCollection, VexMediaConfigError, type VexPlugin, type VexQueryCtx, type VexRenderComponentProps, VexSlugConflictError, WIDTH_PRESETS, addRemovedFieldsAsOptional, array, blockStylesToTailwind, blocks, buildSiteMetadata, checkAdminAccess, checkbox, color, createDocument, createVexQuery, date, defineAccess, defineBlock, defineCollection, defineConfig, defineGlobal, defineMediaCollection, deleteDocument, deletePreviewSnapshot, diffSchema, extendTable, extractLivePreviewConfigs, extractUserFields, fieldMetaToZod, findCollectionBySlug, generateCollectionQueries, generateColumns, generateFormDefaultValues, generateFormSchema, generateIndexFile, generateVexSchema, generateVexTypes, getAllCollections, getDocument, getPreviewSnapshot, hasPermission, imageUrl, isMediaCollection, json, listDocuments, makeFieldsOptional, mergeAuthCollectionWithUserCollection, number, object, planMigration, relationship, resolvePreviewURL, richtext, sanitizeConfigForClient, searchDocuments, select, shouldReloadURL, slugToInterfaceName, tabs, text, toTitleCase, ui, updateDocument, upload, upsertPreviewSnapshot, vexQuery };
|