@orion-studios/payload-studio 0.6.0-beta.7 → 0.6.0-beta.70
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/admin/client.js +2076 -618
- package/dist/admin/client.mjs +2037 -590
- package/dist/admin/index.d.mts +2 -2
- package/dist/admin/index.d.ts +2 -2
- package/dist/admin/index.js +140 -17
- package/dist/admin/index.mjs +1 -1
- package/dist/admin-app/client.js +11 -4
- package/dist/admin-app/client.mjs +1 -1
- package/dist/admin-app/index.d.mts +2 -2
- package/dist/admin-app/index.d.ts +2 -2
- package/dist/admin-app/styles.css +343 -41
- package/dist/admin.css +18 -2
- package/dist/builder-v2/client.d.mts +18 -0
- package/dist/builder-v2/client.d.ts +18 -0
- package/dist/builder-v2/client.js +1662 -0
- package/dist/builder-v2/client.mjs +1537 -0
- package/dist/builder-v2/index.d.mts +237 -0
- package/dist/builder-v2/index.d.ts +237 -0
- package/dist/builder-v2/index.js +735 -0
- package/dist/builder-v2/index.mjs +685 -0
- package/dist/builder-v2/styles.css +1524 -0
- package/dist/{chunk-KPIX7OSV.mjs → chunk-2XH7X34N.mjs} +11 -4
- package/dist/{chunk-PF3EBZXF.mjs → chunk-7ZMXZRBP.mjs} +39 -3
- package/dist/{chunk-5FNTVRCR.mjs → chunk-JC3UV74N.mjs} +140 -17
- package/dist/{chunk-XKUTZ7IU.mjs → chunk-NGLIA2OE.mjs} +53 -2
- package/dist/{chunk-OTHERBGX.mjs → chunk-ZADL33R6.mjs} +1 -1
- package/dist/{index-QPDAedIX.d.ts → index-BV0vEGl6.d.ts} +4 -2
- package/dist/{index-Cv-6qnrw.d.mts → index-D5zrOdyv.d.mts} +3 -1
- package/dist/{index-52HdVLQq.d.ts → index-DAdN56fM.d.ts} +1 -1
- package/dist/{index-DyMmaRfI.d.mts → index-DLfPOqYA.d.mts} +4 -2
- package/dist/{index-Crx_MtPw.d.ts → index-Dv-Alx4h.d.ts} +3 -1
- package/dist/{index-DEQC3Dwj.d.mts → index-G_uTNffQ.d.mts} +1 -1
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +231 -21
- package/dist/index.mjs +4 -4
- package/dist/nextjs/index.js +39 -3
- package/dist/nextjs/index.mjs +2 -2
- package/dist/{sitePreviewTypes-BkHCWxNW.d.mts → sitePreviewTypes-BrJwGzJj.d.mts} +1 -1
- package/dist/{sitePreviewTypes-BkHCWxNW.d.ts → sitePreviewTypes-BrJwGzJj.d.ts} +1 -1
- package/dist/studio-pages/builder.css +24 -5
- package/dist/studio-pages/client.js +574 -64
- package/dist/studio-pages/client.mjs +574 -64
- package/dist/studio-pages/index.d.mts +1 -1
- package/dist/studio-pages/index.d.ts +1 -1
- package/dist/studio-pages/index.js +91 -4
- package/dist/studio-pages/index.mjs +2 -2
- package/package.json +22 -3
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import { Field, Payload } from 'payload';
|
|
2
|
+
import { ComponentType, ReactNode } from 'react';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
type BuilderV2FieldOptions = {
|
|
6
|
+
hidden?: boolean;
|
|
7
|
+
};
|
|
8
|
+
declare const createBuilderV2PageFields: (options?: BuilderV2FieldOptions) => Field[];
|
|
9
|
+
declare const appendBuilderV2PageFields: (fields: Field[], options?: BuilderV2FieldOptions) => Field[];
|
|
10
|
+
|
|
11
|
+
type BuilderV2Mode = 'grapes-v2';
|
|
12
|
+
type BuilderV2ValidationIssue = {
|
|
13
|
+
code: string;
|
|
14
|
+
message: string;
|
|
15
|
+
path: string;
|
|
16
|
+
severity: 'error' | 'warning';
|
|
17
|
+
};
|
|
18
|
+
type BuilderV2Role = 'admin' | 'client' | 'developer' | 'editor';
|
|
19
|
+
type BuilderV2PermissionSet = {
|
|
20
|
+
canEditCustomCode?: boolean;
|
|
21
|
+
canManageGlobalStyles?: boolean;
|
|
22
|
+
canManageReusableSections?: boolean;
|
|
23
|
+
canPublish?: boolean;
|
|
24
|
+
canUseEmbeds?: boolean;
|
|
25
|
+
role?: BuilderV2Role;
|
|
26
|
+
};
|
|
27
|
+
type BuilderV2CompiledOutput = {
|
|
28
|
+
css: string;
|
|
29
|
+
dynamicComponents: BuilderV2DynamicComponentInstance[];
|
|
30
|
+
html: string;
|
|
31
|
+
validationIssues?: BuilderV2ValidationIssue[];
|
|
32
|
+
};
|
|
33
|
+
type BuilderV2ProjectData = Record<string, unknown>;
|
|
34
|
+
type BuilderV2ThemeTokens = {
|
|
35
|
+
buttons?: Record<string, unknown>;
|
|
36
|
+
colors?: Record<string, string>;
|
|
37
|
+
fonts?: Record<string, string>;
|
|
38
|
+
radii?: Record<string, string>;
|
|
39
|
+
shadows?: Record<string, string>;
|
|
40
|
+
spacing?: Record<string, string>;
|
|
41
|
+
typography?: Record<string, unknown>;
|
|
42
|
+
};
|
|
43
|
+
type BuilderV2PageTreeNode = {
|
|
44
|
+
children?: BuilderV2PageTreeNode[];
|
|
45
|
+
id: number | string;
|
|
46
|
+
parentId?: number | string | null;
|
|
47
|
+
path: string;
|
|
48
|
+
slug: string;
|
|
49
|
+
status?: 'draft' | 'published';
|
|
50
|
+
title: string;
|
|
51
|
+
};
|
|
52
|
+
type BuilderV2VersionSnapshot = {
|
|
53
|
+
compiledCss?: string;
|
|
54
|
+
compiledHtml?: string;
|
|
55
|
+
createdAt: string;
|
|
56
|
+
id: string;
|
|
57
|
+
label: string;
|
|
58
|
+
projectData?: BuilderV2ProjectData | null;
|
|
59
|
+
published?: boolean;
|
|
60
|
+
};
|
|
61
|
+
type BuilderV2ReusableSection = {
|
|
62
|
+
category?: string;
|
|
63
|
+
id: string;
|
|
64
|
+
name: string;
|
|
65
|
+
projectData: BuilderV2ProjectData;
|
|
66
|
+
thumbnail?: string;
|
|
67
|
+
};
|
|
68
|
+
type BuilderV2EditorMeta = {
|
|
69
|
+
editorPageBasePath?: string;
|
|
70
|
+
pageTree?: BuilderV2PageTreeNode[];
|
|
71
|
+
permissions?: BuilderV2PermissionSet;
|
|
72
|
+
themeTokens?: BuilderV2ThemeTokens;
|
|
73
|
+
};
|
|
74
|
+
type BuilderV2PageData = {
|
|
75
|
+
builderAutosaveProjectData?: BuilderV2ProjectData | null;
|
|
76
|
+
builderDynamicComponents?: BuilderV2DynamicComponentInstance[];
|
|
77
|
+
builderLastPublishedAt?: string;
|
|
78
|
+
builderLastSavedAt?: string;
|
|
79
|
+
builderLockedAreas?: string[];
|
|
80
|
+
builderMode?: string;
|
|
81
|
+
builderProjectData?: BuilderV2ProjectData | null;
|
|
82
|
+
builderPublishedProjectData?: BuilderV2ProjectData | null;
|
|
83
|
+
builderPublishedSnapshot?: BuilderV2VersionSnapshot | null;
|
|
84
|
+
builderReusableSections?: BuilderV2ReusableSection[];
|
|
85
|
+
builderSeo?: Record<string, unknown> | null;
|
|
86
|
+
builderThemeTokens?: BuilderV2ThemeTokens | null;
|
|
87
|
+
builderValidationIssues?: BuilderV2ValidationIssue[];
|
|
88
|
+
builderVersions?: BuilderV2VersionSnapshot[];
|
|
89
|
+
compiledCss?: string;
|
|
90
|
+
compiledHtml?: string;
|
|
91
|
+
id?: number | string;
|
|
92
|
+
slug?: string;
|
|
93
|
+
title?: string;
|
|
94
|
+
};
|
|
95
|
+
type BuilderV2Asset = {
|
|
96
|
+
alt?: string;
|
|
97
|
+
filename?: string;
|
|
98
|
+
id: number | string;
|
|
99
|
+
src: string;
|
|
100
|
+
type?: string;
|
|
101
|
+
};
|
|
102
|
+
type BuilderV2DynamicComponentInstance = {
|
|
103
|
+
component: string;
|
|
104
|
+
id: string;
|
|
105
|
+
props: Record<string, unknown>;
|
|
106
|
+
};
|
|
107
|
+
type BuilderV2RuntimeComponentProps = {
|
|
108
|
+
instance: BuilderV2DynamicComponentInstance;
|
|
109
|
+
page?: BuilderV2PageData;
|
|
110
|
+
};
|
|
111
|
+
type BuilderV2RuntimeComponent = ComponentType<BuilderV2RuntimeComponentProps>;
|
|
112
|
+
type BuilderV2ProjectComponentDefinition = {
|
|
113
|
+
editorPreview?: (props: Record<string, unknown>) => string;
|
|
114
|
+
label: string;
|
|
115
|
+
render: BuilderV2RuntimeComponent;
|
|
116
|
+
traits?: BuilderV2TraitDefinition[];
|
|
117
|
+
type: string;
|
|
118
|
+
};
|
|
119
|
+
type BuilderV2TraitDefinition = {
|
|
120
|
+
label: string;
|
|
121
|
+
name: string;
|
|
122
|
+
options?: Array<{
|
|
123
|
+
label: string;
|
|
124
|
+
value: string;
|
|
125
|
+
}>;
|
|
126
|
+
placeholder?: string;
|
|
127
|
+
type: 'checkbox' | 'number' | 'select' | 'text' | 'textarea';
|
|
128
|
+
};
|
|
129
|
+
type BuilderV2ProjectAdapter = {
|
|
130
|
+
components?: Record<string, BuilderV2ProjectComponentDefinition | BuilderV2RuntimeComponent>;
|
|
131
|
+
dataProviders?: Record<string, unknown>;
|
|
132
|
+
defaultThemeTokens?: BuilderV2ThemeTokens;
|
|
133
|
+
id: string;
|
|
134
|
+
label?: string;
|
|
135
|
+
themeTokens?: Record<string, unknown>;
|
|
136
|
+
};
|
|
137
|
+
type BuilderV2EditorInitialData = {
|
|
138
|
+
meta?: BuilderV2EditorMeta;
|
|
139
|
+
projectData?: BuilderV2ProjectData | null;
|
|
140
|
+
title?: string;
|
|
141
|
+
};
|
|
142
|
+
type BuilderV2RuntimeProps = {
|
|
143
|
+
adapter?: BuilderV2ProjectAdapter;
|
|
144
|
+
className?: string;
|
|
145
|
+
page: BuilderV2PageData;
|
|
146
|
+
};
|
|
147
|
+
type BuilderV2RenderableChunk = {
|
|
148
|
+
html: string;
|
|
149
|
+
kind: 'html';
|
|
150
|
+
} | {
|
|
151
|
+
instance: BuilderV2DynamicComponentInstance;
|
|
152
|
+
kind: 'component';
|
|
153
|
+
};
|
|
154
|
+
type BuilderV2RenderResult = {
|
|
155
|
+
css: string;
|
|
156
|
+
nodes: ReactNode;
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
declare const compileBuilderV2Output: (input: {
|
|
160
|
+
css?: unknown;
|
|
161
|
+
html?: unknown;
|
|
162
|
+
}) => BuilderV2CompiledOutput;
|
|
163
|
+
|
|
164
|
+
type BuilderV2PagePayloadDoc = BuilderV2PageData & {
|
|
165
|
+
id: number | string;
|
|
166
|
+
};
|
|
167
|
+
type CreateBuilderV2PageServiceArgs = {
|
|
168
|
+
collectionSlug?: string;
|
|
169
|
+
payload: Payload;
|
|
170
|
+
user: Record<string, unknown>;
|
|
171
|
+
};
|
|
172
|
+
type SaveBuilderV2PageInput = {
|
|
173
|
+
compiled: {
|
|
174
|
+
css?: string;
|
|
175
|
+
html?: string;
|
|
176
|
+
};
|
|
177
|
+
projectData: BuilderV2ProjectData;
|
|
178
|
+
title?: string;
|
|
179
|
+
validationIssues?: BuilderV2ValidationIssue[];
|
|
180
|
+
};
|
|
181
|
+
declare const toBuilderV2EditorInitialData: (page: BuilderV2PageData) => {
|
|
182
|
+
projectData: BuilderV2ProjectData;
|
|
183
|
+
title: string;
|
|
184
|
+
};
|
|
185
|
+
declare const createBuilderV2PageService: ({ collectionSlug, payload, user, }: CreateBuilderV2PageServiceArgs) => {
|
|
186
|
+
getPageForBuilder: (pageID: string) => Promise<{
|
|
187
|
+
id: string;
|
|
188
|
+
initialData: {
|
|
189
|
+
projectData: BuilderV2ProjectData;
|
|
190
|
+
title: string;
|
|
191
|
+
};
|
|
192
|
+
page: BuilderV2PagePayloadDoc;
|
|
193
|
+
}>;
|
|
194
|
+
saveDraft: (pageID: string, input: SaveBuilderV2PageInput) => Promise<{
|
|
195
|
+
compiled: BuilderV2CompiledOutput;
|
|
196
|
+
id: string;
|
|
197
|
+
status: "draft";
|
|
198
|
+
}>;
|
|
199
|
+
publish: (pageID: string, input: SaveBuilderV2PageInput) => Promise<{
|
|
200
|
+
compiled: BuilderV2CompiledOutput;
|
|
201
|
+
id: string;
|
|
202
|
+
status: "published";
|
|
203
|
+
}>;
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
declare const createEmptyBuilderV2ProjectData: (title?: string) => BuilderV2ProjectData;
|
|
207
|
+
declare const normalizeBuilderV2ProjectData: (value: unknown, fallbackTitle?: string) => BuilderV2ProjectData;
|
|
208
|
+
|
|
209
|
+
type PageLike = {
|
|
210
|
+
id: number | string;
|
|
211
|
+
parent?: number | string | {
|
|
212
|
+
id?: number | string;
|
|
213
|
+
} | null;
|
|
214
|
+
parentId?: number | string | null;
|
|
215
|
+
path?: string | null;
|
|
216
|
+
slug?: string | null;
|
|
217
|
+
title?: string | null;
|
|
218
|
+
_status?: 'draft' | 'published';
|
|
219
|
+
};
|
|
220
|
+
declare const buildBuilderV2PageTree: (pages: PageLike[]) => BuilderV2PageTreeNode[];
|
|
221
|
+
|
|
222
|
+
declare function BuilderPageRuntime({ adapter, className, page }: BuilderV2RuntimeProps): react_jsx_runtime.JSX.Element;
|
|
223
|
+
|
|
224
|
+
declare const parseBuilderV2DynamicComponents: (html: string) => BuilderV2DynamicComponentInstance[];
|
|
225
|
+
declare const splitBuilderV2HtmlIntoChunks: (html: string) => BuilderV2RenderableChunk[];
|
|
226
|
+
|
|
227
|
+
declare const sanitizeBuilderHtml: (value: unknown) => string;
|
|
228
|
+
declare const sanitizeBuilderCss: (value: unknown) => string;
|
|
229
|
+
declare const scopeBuilderCss: (value: unknown, scope?: string) => string;
|
|
230
|
+
|
|
231
|
+
declare const validateBuilderV2Output: (input: {
|
|
232
|
+
css?: unknown;
|
|
233
|
+
html?: unknown;
|
|
234
|
+
}) => BuilderV2ValidationIssue[];
|
|
235
|
+
declare const hasBlockingBuilderV2Issues: (issues: BuilderV2ValidationIssue[]) => boolean;
|
|
236
|
+
|
|
237
|
+
export { BuilderPageRuntime, type BuilderV2Asset, type BuilderV2CompiledOutput, type BuilderV2DynamicComponentInstance, type BuilderV2EditorInitialData, type BuilderV2FieldOptions, type BuilderV2Mode, type BuilderV2PageData, type BuilderV2PagePayloadDoc, type BuilderV2PageTreeNode, type BuilderV2PermissionSet, type BuilderV2ProjectAdapter, type BuilderV2ProjectComponentDefinition, type BuilderV2ProjectData, type BuilderV2RenderResult, type BuilderV2RenderableChunk, type BuilderV2RuntimeComponent, type BuilderV2RuntimeComponentProps, type BuilderV2RuntimeProps, type BuilderV2ThemeTokens, type BuilderV2TraitDefinition, type BuilderV2ValidationIssue, type BuilderV2VersionSnapshot, type CreateBuilderV2PageServiceArgs, type SaveBuilderV2PageInput, appendBuilderV2PageFields, buildBuilderV2PageTree, compileBuilderV2Output, createBuilderV2PageFields, createBuilderV2PageService, createEmptyBuilderV2ProjectData, hasBlockingBuilderV2Issues, normalizeBuilderV2ProjectData, parseBuilderV2DynamicComponents, sanitizeBuilderCss, sanitizeBuilderHtml, scopeBuilderCss, splitBuilderV2HtmlIntoChunks, toBuilderV2EditorInitialData, validateBuilderV2Output };
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import { Field, Payload } from 'payload';
|
|
2
|
+
import { ComponentType, ReactNode } from 'react';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
type BuilderV2FieldOptions = {
|
|
6
|
+
hidden?: boolean;
|
|
7
|
+
};
|
|
8
|
+
declare const createBuilderV2PageFields: (options?: BuilderV2FieldOptions) => Field[];
|
|
9
|
+
declare const appendBuilderV2PageFields: (fields: Field[], options?: BuilderV2FieldOptions) => Field[];
|
|
10
|
+
|
|
11
|
+
type BuilderV2Mode = 'grapes-v2';
|
|
12
|
+
type BuilderV2ValidationIssue = {
|
|
13
|
+
code: string;
|
|
14
|
+
message: string;
|
|
15
|
+
path: string;
|
|
16
|
+
severity: 'error' | 'warning';
|
|
17
|
+
};
|
|
18
|
+
type BuilderV2Role = 'admin' | 'client' | 'developer' | 'editor';
|
|
19
|
+
type BuilderV2PermissionSet = {
|
|
20
|
+
canEditCustomCode?: boolean;
|
|
21
|
+
canManageGlobalStyles?: boolean;
|
|
22
|
+
canManageReusableSections?: boolean;
|
|
23
|
+
canPublish?: boolean;
|
|
24
|
+
canUseEmbeds?: boolean;
|
|
25
|
+
role?: BuilderV2Role;
|
|
26
|
+
};
|
|
27
|
+
type BuilderV2CompiledOutput = {
|
|
28
|
+
css: string;
|
|
29
|
+
dynamicComponents: BuilderV2DynamicComponentInstance[];
|
|
30
|
+
html: string;
|
|
31
|
+
validationIssues?: BuilderV2ValidationIssue[];
|
|
32
|
+
};
|
|
33
|
+
type BuilderV2ProjectData = Record<string, unknown>;
|
|
34
|
+
type BuilderV2ThemeTokens = {
|
|
35
|
+
buttons?: Record<string, unknown>;
|
|
36
|
+
colors?: Record<string, string>;
|
|
37
|
+
fonts?: Record<string, string>;
|
|
38
|
+
radii?: Record<string, string>;
|
|
39
|
+
shadows?: Record<string, string>;
|
|
40
|
+
spacing?: Record<string, string>;
|
|
41
|
+
typography?: Record<string, unknown>;
|
|
42
|
+
};
|
|
43
|
+
type BuilderV2PageTreeNode = {
|
|
44
|
+
children?: BuilderV2PageTreeNode[];
|
|
45
|
+
id: number | string;
|
|
46
|
+
parentId?: number | string | null;
|
|
47
|
+
path: string;
|
|
48
|
+
slug: string;
|
|
49
|
+
status?: 'draft' | 'published';
|
|
50
|
+
title: string;
|
|
51
|
+
};
|
|
52
|
+
type BuilderV2VersionSnapshot = {
|
|
53
|
+
compiledCss?: string;
|
|
54
|
+
compiledHtml?: string;
|
|
55
|
+
createdAt: string;
|
|
56
|
+
id: string;
|
|
57
|
+
label: string;
|
|
58
|
+
projectData?: BuilderV2ProjectData | null;
|
|
59
|
+
published?: boolean;
|
|
60
|
+
};
|
|
61
|
+
type BuilderV2ReusableSection = {
|
|
62
|
+
category?: string;
|
|
63
|
+
id: string;
|
|
64
|
+
name: string;
|
|
65
|
+
projectData: BuilderV2ProjectData;
|
|
66
|
+
thumbnail?: string;
|
|
67
|
+
};
|
|
68
|
+
type BuilderV2EditorMeta = {
|
|
69
|
+
editorPageBasePath?: string;
|
|
70
|
+
pageTree?: BuilderV2PageTreeNode[];
|
|
71
|
+
permissions?: BuilderV2PermissionSet;
|
|
72
|
+
themeTokens?: BuilderV2ThemeTokens;
|
|
73
|
+
};
|
|
74
|
+
type BuilderV2PageData = {
|
|
75
|
+
builderAutosaveProjectData?: BuilderV2ProjectData | null;
|
|
76
|
+
builderDynamicComponents?: BuilderV2DynamicComponentInstance[];
|
|
77
|
+
builderLastPublishedAt?: string;
|
|
78
|
+
builderLastSavedAt?: string;
|
|
79
|
+
builderLockedAreas?: string[];
|
|
80
|
+
builderMode?: string;
|
|
81
|
+
builderProjectData?: BuilderV2ProjectData | null;
|
|
82
|
+
builderPublishedProjectData?: BuilderV2ProjectData | null;
|
|
83
|
+
builderPublishedSnapshot?: BuilderV2VersionSnapshot | null;
|
|
84
|
+
builderReusableSections?: BuilderV2ReusableSection[];
|
|
85
|
+
builderSeo?: Record<string, unknown> | null;
|
|
86
|
+
builderThemeTokens?: BuilderV2ThemeTokens | null;
|
|
87
|
+
builderValidationIssues?: BuilderV2ValidationIssue[];
|
|
88
|
+
builderVersions?: BuilderV2VersionSnapshot[];
|
|
89
|
+
compiledCss?: string;
|
|
90
|
+
compiledHtml?: string;
|
|
91
|
+
id?: number | string;
|
|
92
|
+
slug?: string;
|
|
93
|
+
title?: string;
|
|
94
|
+
};
|
|
95
|
+
type BuilderV2Asset = {
|
|
96
|
+
alt?: string;
|
|
97
|
+
filename?: string;
|
|
98
|
+
id: number | string;
|
|
99
|
+
src: string;
|
|
100
|
+
type?: string;
|
|
101
|
+
};
|
|
102
|
+
type BuilderV2DynamicComponentInstance = {
|
|
103
|
+
component: string;
|
|
104
|
+
id: string;
|
|
105
|
+
props: Record<string, unknown>;
|
|
106
|
+
};
|
|
107
|
+
type BuilderV2RuntimeComponentProps = {
|
|
108
|
+
instance: BuilderV2DynamicComponentInstance;
|
|
109
|
+
page?: BuilderV2PageData;
|
|
110
|
+
};
|
|
111
|
+
type BuilderV2RuntimeComponent = ComponentType<BuilderV2RuntimeComponentProps>;
|
|
112
|
+
type BuilderV2ProjectComponentDefinition = {
|
|
113
|
+
editorPreview?: (props: Record<string, unknown>) => string;
|
|
114
|
+
label: string;
|
|
115
|
+
render: BuilderV2RuntimeComponent;
|
|
116
|
+
traits?: BuilderV2TraitDefinition[];
|
|
117
|
+
type: string;
|
|
118
|
+
};
|
|
119
|
+
type BuilderV2TraitDefinition = {
|
|
120
|
+
label: string;
|
|
121
|
+
name: string;
|
|
122
|
+
options?: Array<{
|
|
123
|
+
label: string;
|
|
124
|
+
value: string;
|
|
125
|
+
}>;
|
|
126
|
+
placeholder?: string;
|
|
127
|
+
type: 'checkbox' | 'number' | 'select' | 'text' | 'textarea';
|
|
128
|
+
};
|
|
129
|
+
type BuilderV2ProjectAdapter = {
|
|
130
|
+
components?: Record<string, BuilderV2ProjectComponentDefinition | BuilderV2RuntimeComponent>;
|
|
131
|
+
dataProviders?: Record<string, unknown>;
|
|
132
|
+
defaultThemeTokens?: BuilderV2ThemeTokens;
|
|
133
|
+
id: string;
|
|
134
|
+
label?: string;
|
|
135
|
+
themeTokens?: Record<string, unknown>;
|
|
136
|
+
};
|
|
137
|
+
type BuilderV2EditorInitialData = {
|
|
138
|
+
meta?: BuilderV2EditorMeta;
|
|
139
|
+
projectData?: BuilderV2ProjectData | null;
|
|
140
|
+
title?: string;
|
|
141
|
+
};
|
|
142
|
+
type BuilderV2RuntimeProps = {
|
|
143
|
+
adapter?: BuilderV2ProjectAdapter;
|
|
144
|
+
className?: string;
|
|
145
|
+
page: BuilderV2PageData;
|
|
146
|
+
};
|
|
147
|
+
type BuilderV2RenderableChunk = {
|
|
148
|
+
html: string;
|
|
149
|
+
kind: 'html';
|
|
150
|
+
} | {
|
|
151
|
+
instance: BuilderV2DynamicComponentInstance;
|
|
152
|
+
kind: 'component';
|
|
153
|
+
};
|
|
154
|
+
type BuilderV2RenderResult = {
|
|
155
|
+
css: string;
|
|
156
|
+
nodes: ReactNode;
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
declare const compileBuilderV2Output: (input: {
|
|
160
|
+
css?: unknown;
|
|
161
|
+
html?: unknown;
|
|
162
|
+
}) => BuilderV2CompiledOutput;
|
|
163
|
+
|
|
164
|
+
type BuilderV2PagePayloadDoc = BuilderV2PageData & {
|
|
165
|
+
id: number | string;
|
|
166
|
+
};
|
|
167
|
+
type CreateBuilderV2PageServiceArgs = {
|
|
168
|
+
collectionSlug?: string;
|
|
169
|
+
payload: Payload;
|
|
170
|
+
user: Record<string, unknown>;
|
|
171
|
+
};
|
|
172
|
+
type SaveBuilderV2PageInput = {
|
|
173
|
+
compiled: {
|
|
174
|
+
css?: string;
|
|
175
|
+
html?: string;
|
|
176
|
+
};
|
|
177
|
+
projectData: BuilderV2ProjectData;
|
|
178
|
+
title?: string;
|
|
179
|
+
validationIssues?: BuilderV2ValidationIssue[];
|
|
180
|
+
};
|
|
181
|
+
declare const toBuilderV2EditorInitialData: (page: BuilderV2PageData) => {
|
|
182
|
+
projectData: BuilderV2ProjectData;
|
|
183
|
+
title: string;
|
|
184
|
+
};
|
|
185
|
+
declare const createBuilderV2PageService: ({ collectionSlug, payload, user, }: CreateBuilderV2PageServiceArgs) => {
|
|
186
|
+
getPageForBuilder: (pageID: string) => Promise<{
|
|
187
|
+
id: string;
|
|
188
|
+
initialData: {
|
|
189
|
+
projectData: BuilderV2ProjectData;
|
|
190
|
+
title: string;
|
|
191
|
+
};
|
|
192
|
+
page: BuilderV2PagePayloadDoc;
|
|
193
|
+
}>;
|
|
194
|
+
saveDraft: (pageID: string, input: SaveBuilderV2PageInput) => Promise<{
|
|
195
|
+
compiled: BuilderV2CompiledOutput;
|
|
196
|
+
id: string;
|
|
197
|
+
status: "draft";
|
|
198
|
+
}>;
|
|
199
|
+
publish: (pageID: string, input: SaveBuilderV2PageInput) => Promise<{
|
|
200
|
+
compiled: BuilderV2CompiledOutput;
|
|
201
|
+
id: string;
|
|
202
|
+
status: "published";
|
|
203
|
+
}>;
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
declare const createEmptyBuilderV2ProjectData: (title?: string) => BuilderV2ProjectData;
|
|
207
|
+
declare const normalizeBuilderV2ProjectData: (value: unknown, fallbackTitle?: string) => BuilderV2ProjectData;
|
|
208
|
+
|
|
209
|
+
type PageLike = {
|
|
210
|
+
id: number | string;
|
|
211
|
+
parent?: number | string | {
|
|
212
|
+
id?: number | string;
|
|
213
|
+
} | null;
|
|
214
|
+
parentId?: number | string | null;
|
|
215
|
+
path?: string | null;
|
|
216
|
+
slug?: string | null;
|
|
217
|
+
title?: string | null;
|
|
218
|
+
_status?: 'draft' | 'published';
|
|
219
|
+
};
|
|
220
|
+
declare const buildBuilderV2PageTree: (pages: PageLike[]) => BuilderV2PageTreeNode[];
|
|
221
|
+
|
|
222
|
+
declare function BuilderPageRuntime({ adapter, className, page }: BuilderV2RuntimeProps): react_jsx_runtime.JSX.Element;
|
|
223
|
+
|
|
224
|
+
declare const parseBuilderV2DynamicComponents: (html: string) => BuilderV2DynamicComponentInstance[];
|
|
225
|
+
declare const splitBuilderV2HtmlIntoChunks: (html: string) => BuilderV2RenderableChunk[];
|
|
226
|
+
|
|
227
|
+
declare const sanitizeBuilderHtml: (value: unknown) => string;
|
|
228
|
+
declare const sanitizeBuilderCss: (value: unknown) => string;
|
|
229
|
+
declare const scopeBuilderCss: (value: unknown, scope?: string) => string;
|
|
230
|
+
|
|
231
|
+
declare const validateBuilderV2Output: (input: {
|
|
232
|
+
css?: unknown;
|
|
233
|
+
html?: unknown;
|
|
234
|
+
}) => BuilderV2ValidationIssue[];
|
|
235
|
+
declare const hasBlockingBuilderV2Issues: (issues: BuilderV2ValidationIssue[]) => boolean;
|
|
236
|
+
|
|
237
|
+
export { BuilderPageRuntime, type BuilderV2Asset, type BuilderV2CompiledOutput, type BuilderV2DynamicComponentInstance, type BuilderV2EditorInitialData, type BuilderV2FieldOptions, type BuilderV2Mode, type BuilderV2PageData, type BuilderV2PagePayloadDoc, type BuilderV2PageTreeNode, type BuilderV2PermissionSet, type BuilderV2ProjectAdapter, type BuilderV2ProjectComponentDefinition, type BuilderV2ProjectData, type BuilderV2RenderResult, type BuilderV2RenderableChunk, type BuilderV2RuntimeComponent, type BuilderV2RuntimeComponentProps, type BuilderV2RuntimeProps, type BuilderV2ThemeTokens, type BuilderV2TraitDefinition, type BuilderV2ValidationIssue, type BuilderV2VersionSnapshot, type CreateBuilderV2PageServiceArgs, type SaveBuilderV2PageInput, appendBuilderV2PageFields, buildBuilderV2PageTree, compileBuilderV2Output, createBuilderV2PageFields, createBuilderV2PageService, createEmptyBuilderV2ProjectData, hasBlockingBuilderV2Issues, normalizeBuilderV2ProjectData, parseBuilderV2DynamicComponents, sanitizeBuilderCss, sanitizeBuilderHtml, scopeBuilderCss, splitBuilderV2HtmlIntoChunks, toBuilderV2EditorInitialData, validateBuilderV2Output };
|