@sprintup-cms/sdk 1.8.29 → 1.8.32

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.
@@ -1,92 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import React from 'react';
3
-
4
- /**
5
- * @sprintup-cms/sdk — Core Client
6
- *
7
- * Zero-dependency, framework-agnostic typed API client for SprintUp Forge CMS.
8
- *
9
- * @example
10
- * import { cmsClient } from '@sprintup-cms/sdk'
11
- * const page = await cmsClient.getPage('about')
12
- *
13
- * @example Custom instance
14
- * import { createCMSClient } from '@sprintup-cms/sdk'
15
- * const cms = createCMSClient({ baseUrl: '...', apiKey: '...', appId: '...' })
16
- */
17
- interface CMSBlock {
18
- id: string;
19
- type: string;
20
- label?: string;
21
- locked?: boolean;
22
- data?: Record<string, any>;
23
- /** Legacy field — blocks created before v1.1 used `content` instead of `data` */
24
- content?: Record<string, any>;
25
- order?: number;
26
- }
27
- interface CMSPageTypeField {
28
- id: string;
29
- name: string;
30
- label: string;
31
- fieldType: 'text' | 'textarea' | 'richtext' | 'image' | 'url' | 'number' | 'boolean' | 'date' | 'select' | 'relation' | 'email' | 'phone' | 'slug' | 'color' | 'embed' | 'multi-select' | 'repeater' | 'file' | 'code';
32
- required?: boolean;
33
- options?: string[];
34
- description?: string;
35
- maxLength?: number;
36
- multiple?: boolean;
37
- targetPageTypeKey?: string;
38
- }
39
- interface CMSPageTypeSection {
40
- id: string;
41
- name: string;
42
- label: string;
43
- order: number;
44
- locked?: boolean;
45
- fields: CMSPageTypeField[];
46
- }
47
- interface CMSPageTypeVariant {
48
- key: string;
49
- label: string;
50
- description?: string;
51
- visibleSections?: string[];
52
- }
53
- interface CMSPageType {
54
- _id: string;
55
- name: string;
56
- key: string;
57
- description?: string;
58
- icon?: string;
59
- /** Used by page-type-renderers to pick a specialised React component */
60
- rendererKey?: string;
61
- /** Active variant key (set per-page) */
62
- variant?: string;
63
- category: 'singleton' | 'collection' | 'global';
64
- contentCategory: 'singleton' | 'collection' | 'global';
65
- allowedRoles?: string[];
66
- variants: CMSPageTypeVariant[];
67
- sections: CMSPageTypeSection[];
68
- }
69
-
70
- interface CMSBlocksProps {
71
- blocks: CMSBlock[];
72
- pageType?: CMSPageType | null;
73
- className?: string;
74
- /**
75
- * Custom block renderers — extend or override built-in blocks.
76
- * @example
77
- * <CMSBlocks blocks={blocks} custom={{ 'my-hero': (block) => <MyHero {...block.data} /> }} />
78
- */
79
- custom?: Record<string, (block: CMSBlock) => React.ReactNode>;
80
- }
81
- declare function CMSBlocks({ blocks, pageType, className, custom }: CMSBlocksProps): react_jsx_runtime.JSX.Element | null;
82
-
83
- interface CMSPreviewBannerProps {
84
- isPreview: boolean;
85
- status?: string;
86
- slug?: string;
87
- /** URL for the exit preview link. Defaults to /api/cms-preview/exit */
88
- exitUrl?: string;
89
- }
90
- declare function CMSPreviewBanner({ isPreview, status, slug, exitUrl }: CMSPreviewBannerProps): react_jsx_runtime.JSX.Element | null;
91
-
92
- export { CMSBlocks, type CMSBlocksProps, CMSPreviewBanner, type CMSPreviewBannerProps };