@orion-studios/payload-studio 0.5.0-beta.3 → 0.5.0-beta.30

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.
Files changed (46) hide show
  1. package/dist/admin/client.js +68 -7
  2. package/dist/admin/client.mjs +68 -7
  3. package/dist/admin/index.d.mts +1 -1
  4. package/dist/admin/index.d.ts +1 -1
  5. package/dist/admin/index.js +37 -0
  6. package/dist/admin/index.mjs +3 -1
  7. package/dist/admin-app/client.d.mts +4 -0
  8. package/dist/admin-app/client.d.ts +4 -0
  9. package/dist/admin-app/client.js +705 -2
  10. package/dist/admin-app/client.mjs +701 -1
  11. package/dist/admin-app/index.d.mts +1 -1
  12. package/dist/admin-app/index.d.ts +1 -1
  13. package/dist/admin-app/index.js +167 -0
  14. package/dist/admin-app/index.mjs +13 -1
  15. package/dist/admin-app/styles.css +127 -0
  16. package/dist/blocks/index.js +193 -3
  17. package/dist/blocks/index.mjs +2 -2
  18. package/dist/{chunk-J7W5EE3B.mjs → chunk-7IGLXLUB.mjs} +37 -0
  19. package/dist/{chunk-ZLLNO5FM.mjs → chunk-GPQPDEB5.mjs} +44 -13
  20. package/dist/{chunk-PC5622T7.mjs → chunk-H7DSTEVT.mjs} +180 -4
  21. package/dist/{chunk-UJFU323N.mjs → chunk-QW24Y4UH.mjs} +18 -8
  22. package/dist/{chunk-ETRRXURT.mjs → chunk-SIL2J5MF.mjs} +14 -0
  23. package/dist/chunk-XVH5SCBD.mjs +234 -0
  24. package/dist/index-BBvk9b9i.d.mts +97 -0
  25. package/dist/index-BBvk9b9i.d.ts +97 -0
  26. package/dist/{index-DbH0Ljwp.d.mts → index-CpG3UHcS.d.mts} +1 -0
  27. package/dist/{index-DbH0Ljwp.d.ts → index-CpG3UHcS.d.ts} +1 -0
  28. package/dist/{index-DJFhANvJ.d.ts → index-Dj21uD_B.d.mts} +5 -2
  29. package/dist/{index-DJFhANvJ.d.mts → index-Dj21uD_B.d.ts} +5 -2
  30. package/dist/index.d.mts +3 -3
  31. package/dist/index.d.ts +3 -3
  32. package/dist/index.js +674 -250
  33. package/dist/index.mjs +11 -11
  34. package/dist/nextjs/index.d.mts +1 -1
  35. package/dist/nextjs/index.d.ts +1 -1
  36. package/dist/nextjs/index.js +276 -13
  37. package/dist/nextjs/index.mjs +4 -1
  38. package/dist/studio-pages/builder.css +25 -1
  39. package/dist/studio-pages/client.js +2063 -1118
  40. package/dist/studio-pages/client.mjs +2063 -1118
  41. package/dist/studio-pages/index.js +18 -7
  42. package/dist/studio-pages/index.mjs +2 -2
  43. package/package.json +2 -2
  44. package/dist/chunk-AAOHJDNS.mjs +0 -67
  45. package/dist/index-BallJs-K.d.mts +0 -43
  46. package/dist/index-BallJs-K.d.ts +0 -43
package/dist/index.mjs CHANGED
@@ -1,22 +1,22 @@
1
1
  import {
2
2
  admin_exports
3
- } from "./chunk-J7W5EE3B.mjs";
3
+ } from "./chunk-7IGLXLUB.mjs";
4
4
  import {
5
- studio_exports
6
- } from "./chunk-N67KVM2S.mjs";
5
+ admin_app_exports
6
+ } from "./chunk-XVH5SCBD.mjs";
7
7
  import {
8
- studio_pages_exports
9
- } from "./chunk-UJFU323N.mjs";
8
+ blocks_exports
9
+ } from "./chunk-H7DSTEVT.mjs";
10
10
  import {
11
11
  nextjs_exports
12
- } from "./chunk-ZLLNO5FM.mjs";
12
+ } from "./chunk-GPQPDEB5.mjs";
13
13
  import {
14
- admin_app_exports
15
- } from "./chunk-AAOHJDNS.mjs";
14
+ studio_exports
15
+ } from "./chunk-N67KVM2S.mjs";
16
16
  import {
17
- blocks_exports
18
- } from "./chunk-PC5622T7.mjs";
19
- import "./chunk-ETRRXURT.mjs";
17
+ studio_pages_exports
18
+ } from "./chunk-QW24Y4UH.mjs";
19
+ import "./chunk-SIL2J5MF.mjs";
20
20
  import "./chunk-6BWS3CLP.mjs";
21
21
  export {
22
22
  admin_exports as admin,
@@ -1,2 +1,2 @@
1
- export { F as FooterData, H as HeaderData, S as SiteNavItem, a as SiteSettingsData, W as WEBSITE_CONTENT_TAG, c as createPageQueries, b as createPayloadClient, d as createSiteQueries, r as resolveMedia } from '../index-DbH0Ljwp.mjs';
1
+ export { F as FooterData, H as HeaderData, S as SiteNavItem, a as SiteSettingsData, W as WEBSITE_CONTENT_TAG, c as createPageQueries, b as createPayloadClient, d as createSiteQueries, r as resolveMedia } from '../index-CpG3UHcS.mjs';
2
2
  import 'payload';
@@ -1,2 +1,2 @@
1
- export { F as FooterData, H as HeaderData, S as SiteNavItem, a as SiteSettingsData, W as WEBSITE_CONTENT_TAG, c as createPageQueries, b as createPayloadClient, d as createSiteQueries, r as resolveMedia } from '../index-DbH0Ljwp.js';
1
+ export { F as FooterData, H as HeaderData, S as SiteNavItem, a as SiteSettingsData, W as WEBSITE_CONTENT_TAG, c as createPageQueries, b as createPayloadClient, d as createSiteQueries, r as resolveMedia } from '../index-CpG3UHcS.js';
2
2
  import 'payload';
@@ -43,6 +43,262 @@ function createPayloadClient(config) {
43
43
 
44
44
  // src/nextjs/queries/pages.ts
45
45
  var import_cache = require("next/cache");
46
+
47
+ // src/studio/index.ts
48
+ var isRecord = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
49
+ function assertStudioDocumentV1(input) {
50
+ if (!isRecord(input)) {
51
+ throw new Error("Studio document must be an object");
52
+ }
53
+ if (input.schemaVersion !== 1) {
54
+ throw new Error("Unsupported studio schemaVersion");
55
+ }
56
+ if (!Array.isArray(input.nodes)) {
57
+ throw new Error("Studio document nodes must be an array");
58
+ }
59
+ const nodes = input.nodes.map((node, index) => {
60
+ if (!isRecord(node)) {
61
+ throw new Error(`Node at index ${index} must be an object`);
62
+ }
63
+ if (typeof node.id !== "string" || node.id.length === 0) {
64
+ throw new Error(`Node at index ${index} has invalid id`);
65
+ }
66
+ if (typeof node.type !== "string" || node.type.length === 0) {
67
+ throw new Error(`Node at index ${index} has invalid type`);
68
+ }
69
+ if (!isRecord(node.data)) {
70
+ throw new Error(`Node at index ${index} has invalid data`);
71
+ }
72
+ return {
73
+ id: node.id,
74
+ type: node.type,
75
+ data: node.data
76
+ };
77
+ });
78
+ return {
79
+ metadata: isRecord(input.metadata) ? input.metadata : void 0,
80
+ schemaVersion: 1,
81
+ title: typeof input.title === "string" ? input.title : void 0,
82
+ nodes,
83
+ updatedAt: typeof input.updatedAt === "string" ? input.updatedAt : void 0
84
+ };
85
+ }
86
+
87
+ // src/blocks/blocks/sectionStyleFields.ts
88
+ var sectionStyleDefaults = {
89
+ contentBackgroundColor: "#ffffff",
90
+ contentBackgroundMode: "none",
91
+ contentGradientAngle: "135",
92
+ contentGradientFrom: "#ffffff",
93
+ contentGradientPreset: "none",
94
+ contentGradientTo: "#f4f6f2",
95
+ contentWidth: "inherit",
96
+ sectionPaddingX: "inherit",
97
+ sectionBackgroundColor: "#ffffff",
98
+ sectionBackgroundMode: "none",
99
+ sectionGradientAngle: "135",
100
+ sectionGradientFrom: "#124a37",
101
+ sectionGradientPreset: "forest",
102
+ sectionGradientTo: "#1f684f",
103
+ sectionPaddingY: "md",
104
+ sectionWidth: "content"
105
+ };
106
+
107
+ // src/studio-pages/index.ts
108
+ var withSectionStyleDefaults = (value) => ({
109
+ ...sectionStyleDefaults,
110
+ ...value
111
+ });
112
+ var defaultNodeData = {
113
+ bookingEmbed: {
114
+ ...withSectionStyleDefaults({}),
115
+ buttonHref: "/contact",
116
+ buttonLabel: "Book Consultation",
117
+ description: "Let visitors book a consultation.",
118
+ title: "Book a Time"
119
+ },
120
+ beforeAfter: withSectionStyleDefaults({
121
+ items: [
122
+ {
123
+ description: "Before and after result summary.",
124
+ imageCornerStyle: "rounded",
125
+ imageFit: "cover",
126
+ imagePosition: "center",
127
+ label: "Project One"
128
+ }
129
+ ],
130
+ subtitle: "Show visual proof from real projects.",
131
+ title: "Before & After Results"
132
+ }),
133
+ cta: {
134
+ ...withSectionStyleDefaults({}),
135
+ backgroundColor: "#1f684f",
136
+ buttonHref: "/contact",
137
+ buttonLabel: "Contact Us",
138
+ description: "Optional supporting copy.",
139
+ headline: "Ready to get started?",
140
+ style: "light"
141
+ },
142
+ faq: {
143
+ ...withSectionStyleDefaults({}),
144
+ items: [{ answer: "Answer goes here.", question: "Frequently asked question?" }],
145
+ title: "Frequently Asked Questions"
146
+ },
147
+ featureGrid: {
148
+ ...withSectionStyleDefaults({}),
149
+ items: [
150
+ { description: "Explain this point.", icon: "01", imageCornerStyle: "rounded", imageFit: "cover", imagePosition: "center", title: "Feature One" },
151
+ { description: "Explain this point.", icon: "02", imageCornerStyle: "rounded", imageFit: "cover", imagePosition: "center", title: "Feature Two" },
152
+ { description: "Explain this point.", icon: "03", imageCornerStyle: "rounded", imageFit: "cover", imagePosition: "center", title: "Feature Three" }
153
+ ],
154
+ title: "Section Title",
155
+ variant: "cards"
156
+ },
157
+ formEmbed: {
158
+ ...withSectionStyleDefaults({}),
159
+ description: "Collect lead details from visitors.",
160
+ formType: "quote",
161
+ title: "Request a Quote"
162
+ },
163
+ hero: {
164
+ ...withSectionStyleDefaults({}),
165
+ backgroundColor: "",
166
+ backgroundImageCornerStyle: "rounded",
167
+ backgroundImageFit: "cover",
168
+ backgroundImagePosition: "center",
169
+ heroHeight: "sm",
170
+ headline: "New Hero Section",
171
+ kicker: "Optional kicker",
172
+ primaryHref: "/contact",
173
+ primaryLabel: "Primary Action",
174
+ secondaryHref: "/services",
175
+ secondaryLabel: "Secondary Action",
176
+ subheadline: "Describe your offer clearly for website visitors.",
177
+ variant: "default"
178
+ },
179
+ media: {
180
+ ...withSectionStyleDefaults({}),
181
+ caption: "Add a caption",
182
+ imageCornerStyle: "rounded",
183
+ imageFit: "cover",
184
+ imagePosition: "center",
185
+ size: "default"
186
+ },
187
+ logoWall: withSectionStyleDefaults({
188
+ items: [
189
+ { imageCornerStyle: "rounded", imageFit: "contain", imagePosition: "center", name: "Trusted Partner 1" },
190
+ { imageCornerStyle: "rounded", imageFit: "contain", imagePosition: "center", name: "Trusted Partner 2" },
191
+ { imageCornerStyle: "rounded", imageFit: "contain", imagePosition: "center", name: "Trusted Partner 3" }
192
+ ],
193
+ subtitle: "Trusted by teams and homeowners across Central Texas.",
194
+ title: "Trusted by Local Organizations"
195
+ }),
196
+ richText: {
197
+ ...withSectionStyleDefaults({}),
198
+ content: {
199
+ root: {
200
+ children: [
201
+ {
202
+ children: [
203
+ {
204
+ detail: 0,
205
+ format: 0,
206
+ mode: "normal",
207
+ style: "",
208
+ text: "Write your content here.",
209
+ type: "text",
210
+ version: 1
211
+ }
212
+ ],
213
+ direction: "ltr",
214
+ format: "",
215
+ indent: 0,
216
+ type: "paragraph",
217
+ version: 1
218
+ }
219
+ ],
220
+ direction: "ltr",
221
+ format: "",
222
+ indent: 0,
223
+ type: "root",
224
+ version: 1
225
+ }
226
+ },
227
+ title: "Section Heading",
228
+ width: "normal"
229
+ },
230
+ testimonials: {
231
+ ...withSectionStyleDefaults({}),
232
+ items: [{ location: "City, ST", name: "Customer Name", quote: "Customer feedback goes here." }],
233
+ title: "What Customers Say"
234
+ },
235
+ stats: withSectionStyleDefaults({
236
+ items: [
237
+ { description: "Average response time", label: "Same-Day Quotes", value: "24h" },
238
+ { description: "Projects completed", label: "Completed Jobs", value: "1,200+" },
239
+ { description: "Client satisfaction score", label: "Satisfaction", value: "4.9/5" }
240
+ ],
241
+ subtitle: "Highlight measurable outcomes to build trust quickly.",
242
+ title: "Performance Highlights"
243
+ })
244
+ };
245
+ var nodeTypeLabels = {
246
+ bookingEmbed: "Booking Embed",
247
+ beforeAfter: "Before / After",
248
+ cta: "Call To Action",
249
+ faq: "FAQ",
250
+ featureGrid: "Feature Grid",
251
+ formEmbed: "Form Embed",
252
+ hero: "Hero",
253
+ logoWall: "Logo Wall",
254
+ media: "Media",
255
+ richText: "Rich Text",
256
+ stats: "Stats",
257
+ testimonials: "Testimonials"
258
+ };
259
+ var pageNodeTypes = Object.keys(defaultNodeData).map((type) => ({
260
+ type,
261
+ displayName: nodeTypeLabels[type] || type,
262
+ description: `Page node for ${nodeTypeLabels[type] || type}`,
263
+ getDefaultData: () => structuredClone(defaultNodeData[type])
264
+ }));
265
+ var pageInspectorPanels = Object.keys(defaultNodeData).map((nodeType) => ({
266
+ id: `${nodeType}-panel`,
267
+ label: `${nodeTypeLabels[nodeType] || nodeType} Settings`,
268
+ nodeType,
269
+ fields: [
270
+ {
271
+ key: "title",
272
+ label: "Title",
273
+ type: "text"
274
+ }
275
+ ]
276
+ }));
277
+ var studioDocumentToLayout = (document) => document.nodes.map((node) => ({
278
+ id: node.id,
279
+ blockType: node.type,
280
+ ...node.data
281
+ }));
282
+
283
+ // src/nextjs/queries/pages.ts
284
+ var PAGE_QUERY_CACHE_VERSION = "v2-studio-layout-published-only";
285
+ function withStudioDocumentLayout(page) {
286
+ if (!page) {
287
+ return null;
288
+ }
289
+ try {
290
+ const studioDocument = assertStudioDocumentV1(page.studioDocument);
291
+ const compiledLayout = studioDocumentToLayout(studioDocument);
292
+ if (Array.isArray(compiledLayout) && compiledLayout.length > 0) {
293
+ return {
294
+ ...page,
295
+ layout: compiledLayout
296
+ };
297
+ }
298
+ } catch {
299
+ }
300
+ return page;
301
+ }
46
302
  function normalizePath(segments) {
47
303
  if (!segments || segments.length === 0) {
48
304
  return "/";
@@ -51,35 +307,42 @@ function normalizePath(segments) {
51
307
  return cleaned.length > 0 ? `/${cleaned}` : "/";
52
308
  }
53
309
  async function queryPageByPath(payload, path, draft) {
310
+ const pathWhere = {
311
+ path: {
312
+ equals: path
313
+ }
314
+ };
315
+ const publishedWhere = {
316
+ _status: {
317
+ equals: "published"
318
+ }
319
+ };
54
320
  const result = await payload.find({
55
321
  collection: "pages",
56
322
  depth: 2,
57
323
  draft,
58
324
  limit: 1,
59
325
  overrideAccess: false,
60
- where: {
61
- path: {
62
- equals: path
63
- }
64
- }
326
+ where: draft ? pathWhere : { and: [pathWhere, publishedWhere] }
65
327
  });
66
328
  if (result.docs.length > 0) {
67
- return result.docs[0] || null;
329
+ return withStudioDocumentLayout(result.docs[0] || null);
68
330
  }
69
331
  if (path === "/") {
332
+ const homeWhere = {
333
+ slug: {
334
+ equals: "home"
335
+ }
336
+ };
70
337
  const homeResult = await payload.find({
71
338
  collection: "pages",
72
339
  depth: 2,
73
340
  draft,
74
341
  limit: 1,
75
342
  overrideAccess: false,
76
- where: {
77
- slug: {
78
- equals: "home"
79
- }
80
- }
343
+ where: draft ? homeWhere : { and: [homeWhere, publishedWhere] }
81
344
  });
82
- return homeResult.docs[0] || null;
345
+ return withStudioDocumentLayout(homeResult.docs[0] || null);
83
346
  }
84
347
  return null;
85
348
  }
@@ -89,7 +352,7 @@ function createPageQueries(getPayloadClient, contentTag = "website-content") {
89
352
  const payload = await getPayloadClient();
90
353
  return queryPageByPath(payload, path, false);
91
354
  },
92
- ["page-by-path"],
355
+ ["page-by-path", PAGE_QUERY_CACHE_VERSION],
93
356
  { tags: [contentTag] }
94
357
  );
95
358
  async function getPageBySegments(segments, draft = false) {
@@ -4,7 +4,10 @@ import {
4
4
  createPayloadClient,
5
5
  createSiteQueries,
6
6
  resolveMedia
7
- } from "../chunk-ZLLNO5FM.mjs";
7
+ } from "../chunk-GPQPDEB5.mjs";
8
+ import "../chunk-N67KVM2S.mjs";
9
+ import "../chunk-QW24Y4UH.mjs";
10
+ import "../chunk-SIL2J5MF.mjs";
8
11
  import "../chunk-6BWS3CLP.mjs";
9
12
  export {
10
13
  WEBSITE_CONTENT_TAG,
@@ -38,6 +38,22 @@ h4 {
38
38
  padding-inline: var(--orion-shell-inline);
39
39
  }
40
40
 
41
+ .orion-builder-shell.padx-none {
42
+ --orion-shell-inline: 0px;
43
+ }
44
+
45
+ .orion-builder-shell.padx-sm {
46
+ --orion-shell-inline: 0.6rem;
47
+ }
48
+
49
+ .orion-builder-shell.padx-md {
50
+ --orion-shell-inline: 1.2rem;
51
+ }
52
+
53
+ .orion-builder-shell.padx-lg {
54
+ --orion-shell-inline: 2rem;
55
+ }
56
+
41
57
  .orion-builder-shell.pad-sm {
42
58
  --orion-shell-padding-y: 1.4rem;
43
59
  }
@@ -88,8 +104,13 @@ h4 {
88
104
  padding: 0;
89
105
  }
90
106
 
91
- .orion-builder-content .hero {
107
+ .orion-builder-shell .hero {
92
108
  margin: 0;
109
+ background: transparent;
110
+ }
111
+
112
+ .orion-builder-shell .hero-media {
113
+ background: transparent;
93
114
  }
94
115
 
95
116
  .section {
@@ -149,11 +170,14 @@ h4 {
149
170
 
150
171
  .hero-grid {
151
172
  display: grid;
173
+ border-radius: inherit;
174
+ overflow: hidden;
152
175
  }
153
176
 
154
177
  .hero-media {
155
178
  min-height: 360px;
156
179
  background: transparent;
180
+ border-radius: inherit;
157
181
  }
158
182
 
159
183
  .hero-content {