@orion-studios/payload-studio 0.5.0-beta.4 → 0.5.0-beta.41

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 +457 -5
  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-GNYOAC5N.mjs} +44 -13
  20. package/dist/{chunk-UJFU323N.mjs → chunk-LB72FZZ3.mjs} +33 -9
  21. package/dist/{chunk-ETRRXURT.mjs → chunk-SIL2J5MF.mjs} +14 -0
  22. package/dist/{chunk-PC5622T7.mjs → chunk-XQYJXB46.mjs} +444 -6
  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 +904 -204
  33. package/dist/index.mjs +12 -12
  34. package/dist/nextjs/index.d.mts +1 -1
  35. package/dist/nextjs/index.d.ts +1 -1
  36. package/dist/nextjs/index.js +290 -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 +3593 -1279
  40. package/dist/studio-pages/client.mjs +3593 -1279
  41. package/dist/studio-pages/index.js +33 -8
  42. package/dist/studio-pages/index.mjs +2 -2
  43. package/package.json +24 -12
  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
+ import {
2
+ admin_app_exports
3
+ } from "./chunk-XVH5SCBD.mjs";
1
4
  import {
2
5
  admin_exports
3
- } from "./chunk-J7W5EE3B.mjs";
6
+ } from "./chunk-7IGLXLUB.mjs";
7
+ import {
8
+ blocks_exports
9
+ } from "./chunk-XQYJXB46.mjs";
10
+ import {
11
+ nextjs_exports
12
+ } from "./chunk-GNYOAC5N.mjs";
4
13
  import {
5
14
  studio_exports
6
15
  } from "./chunk-N67KVM2S.mjs";
7
- import {
8
- admin_app_exports
9
- } from "./chunk-AAOHJDNS.mjs";
10
16
  import {
11
17
  studio_pages_exports
12
- } from "./chunk-UJFU323N.mjs";
13
- import {
14
- nextjs_exports
15
- } from "./chunk-ZLLNO5FM.mjs";
16
- import {
17
- blocks_exports
18
- } from "./chunk-PC5622T7.mjs";
19
- import "./chunk-ETRRXURT.mjs";
18
+ } from "./chunk-LB72FZZ3.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,276 @@ 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.", iconType: "badge", icon: "01", imageCornerStyle: "rounded", imageFit: "cover", imagePosition: "center", title: "Feature One" },
151
+ { description: "Explain this point.", iconType: "badge", icon: "02", imageCornerStyle: "rounded", imageFit: "cover", imagePosition: "center", title: "Feature Two" },
152
+ { description: "Explain this point.", iconType: "badge", 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
+ backgroundOverlayMode: "none",
167
+ backgroundOverlayOpacity: 45,
168
+ backgroundOverlayColor: "#000000",
169
+ backgroundOverlayGradientFrom: "#0d4a37",
170
+ backgroundOverlayGradientTo: "#1f684f",
171
+ backgroundOverlayGradientAngle: "135",
172
+ backgroundOverlayGradientFromStrength: 100,
173
+ backgroundOverlayGradientToStrength: 100,
174
+ backgroundOverlayGradientStart: 0,
175
+ backgroundOverlayGradientEnd: 100,
176
+ backgroundOverlayGradientFeather: 100,
177
+ backgroundImageCornerStyle: "rounded",
178
+ backgroundImageFit: "cover",
179
+ backgroundImagePosition: "center",
180
+ heroHeight: "sm",
181
+ headline: "New Hero Section",
182
+ kicker: "Optional kicker",
183
+ primaryHref: "/contact",
184
+ primaryLabel: "Primary Action",
185
+ secondaryHref: "/services",
186
+ secondaryLabel: "Secondary Action",
187
+ subheadline: "Describe your offer clearly for website visitors.",
188
+ variant: "default"
189
+ },
190
+ media: {
191
+ ...withSectionStyleDefaults({}),
192
+ caption: "Add a caption",
193
+ imageCornerStyle: "rounded",
194
+ imageFit: "cover",
195
+ imagePosition: "center",
196
+ size: "default"
197
+ },
198
+ logoWall: withSectionStyleDefaults({
199
+ items: [
200
+ { imageCornerStyle: "rounded", imageFit: "contain", imagePosition: "center", name: "Trusted Partner 1" },
201
+ { imageCornerStyle: "rounded", imageFit: "contain", imagePosition: "center", name: "Trusted Partner 2" },
202
+ { imageCornerStyle: "rounded", imageFit: "contain", imagePosition: "center", name: "Trusted Partner 3" }
203
+ ],
204
+ subtitle: "Trusted by teams and homeowners across Central Texas.",
205
+ title: "Trusted by Local Organizations"
206
+ }),
207
+ richText: {
208
+ ...withSectionStyleDefaults({}),
209
+ content: {
210
+ root: {
211
+ children: [
212
+ {
213
+ children: [
214
+ {
215
+ detail: 0,
216
+ format: 0,
217
+ mode: "normal",
218
+ style: "",
219
+ text: "Write your content here.",
220
+ type: "text",
221
+ version: 1
222
+ }
223
+ ],
224
+ direction: "ltr",
225
+ format: "",
226
+ indent: 0,
227
+ type: "paragraph",
228
+ version: 1
229
+ }
230
+ ],
231
+ direction: "ltr",
232
+ format: "",
233
+ indent: 0,
234
+ type: "root",
235
+ version: 1
236
+ }
237
+ },
238
+ title: "Section Heading",
239
+ width: "normal"
240
+ },
241
+ testimonials: {
242
+ ...withSectionStyleDefaults({}),
243
+ autoRotate: true,
244
+ items: [{ location: "City, ST", name: "Customer Name", quote: "Customer feedback goes here." }],
245
+ rotateIntervalSeconds: 7,
246
+ title: "What Customers Say",
247
+ visibleCount: 3
248
+ },
249
+ stats: withSectionStyleDefaults({
250
+ items: [
251
+ { description: "Average response time", label: "Same-Day Quotes", value: "24h" },
252
+ { description: "Projects completed", label: "Completed Jobs", value: "1,200+" },
253
+ { description: "Client satisfaction score", label: "Satisfaction", value: "4.9/5" }
254
+ ],
255
+ subtitle: "Highlight measurable outcomes to build trust quickly.",
256
+ title: "Performance Highlights"
257
+ })
258
+ };
259
+ var nodeTypeLabels = {
260
+ bookingEmbed: "Booking Embed",
261
+ beforeAfter: "Before / After",
262
+ cta: "Call To Action",
263
+ faq: "FAQ",
264
+ featureGrid: "Feature Grid",
265
+ formEmbed: "Form Embed",
266
+ hero: "Hero",
267
+ logoWall: "Logo Wall",
268
+ media: "Media",
269
+ richText: "Rich Text",
270
+ stats: "Stats",
271
+ testimonials: "Testimonials"
272
+ };
273
+ var pageNodeTypes = Object.keys(defaultNodeData).map((type) => ({
274
+ type,
275
+ displayName: nodeTypeLabels[type] || type,
276
+ description: `Page node for ${nodeTypeLabels[type] || type}`,
277
+ getDefaultData: () => structuredClone(defaultNodeData[type])
278
+ }));
279
+ var pageInspectorPanels = Object.keys(defaultNodeData).map((nodeType) => ({
280
+ id: `${nodeType}-panel`,
281
+ label: `${nodeTypeLabels[nodeType] || nodeType} Settings`,
282
+ nodeType,
283
+ fields: [
284
+ {
285
+ key: "title",
286
+ label: "Title",
287
+ type: "text"
288
+ }
289
+ ]
290
+ }));
291
+ var studioDocumentToLayout = (document) => document.nodes.map((node) => ({
292
+ id: node.id,
293
+ blockType: node.type,
294
+ ...node.data
295
+ }));
296
+
297
+ // src/nextjs/queries/pages.ts
298
+ var PAGE_QUERY_CACHE_VERSION = "v2-studio-layout-published-only";
299
+ function withStudioDocumentLayout(page) {
300
+ if (!page) {
301
+ return null;
302
+ }
303
+ try {
304
+ const studioDocument = assertStudioDocumentV1(page.studioDocument);
305
+ const compiledLayout = studioDocumentToLayout(studioDocument);
306
+ if (Array.isArray(compiledLayout) && compiledLayout.length > 0) {
307
+ return {
308
+ ...page,
309
+ layout: compiledLayout
310
+ };
311
+ }
312
+ } catch {
313
+ }
314
+ return page;
315
+ }
46
316
  function normalizePath(segments) {
47
317
  if (!segments || segments.length === 0) {
48
318
  return "/";
@@ -51,35 +321,42 @@ function normalizePath(segments) {
51
321
  return cleaned.length > 0 ? `/${cleaned}` : "/";
52
322
  }
53
323
  async function queryPageByPath(payload, path, draft) {
324
+ const pathWhere = {
325
+ path: {
326
+ equals: path
327
+ }
328
+ };
329
+ const publishedWhere = {
330
+ _status: {
331
+ equals: "published"
332
+ }
333
+ };
54
334
  const result = await payload.find({
55
335
  collection: "pages",
56
336
  depth: 2,
57
337
  draft,
58
338
  limit: 1,
59
339
  overrideAccess: false,
60
- where: {
61
- path: {
62
- equals: path
63
- }
64
- }
340
+ where: draft ? pathWhere : { and: [pathWhere, publishedWhere] }
65
341
  });
66
342
  if (result.docs.length > 0) {
67
- return result.docs[0] || null;
343
+ return withStudioDocumentLayout(result.docs[0] || null);
68
344
  }
69
345
  if (path === "/") {
346
+ const homeWhere = {
347
+ slug: {
348
+ equals: "home"
349
+ }
350
+ };
70
351
  const homeResult = await payload.find({
71
352
  collection: "pages",
72
353
  depth: 2,
73
354
  draft,
74
355
  limit: 1,
75
356
  overrideAccess: false,
76
- where: {
77
- slug: {
78
- equals: "home"
79
- }
80
- }
357
+ where: draft ? homeWhere : { and: [homeWhere, publishedWhere] }
81
358
  });
82
- return homeResult.docs[0] || null;
359
+ return withStudioDocumentLayout(homeResult.docs[0] || null);
83
360
  }
84
361
  return null;
85
362
  }
@@ -89,7 +366,7 @@ function createPageQueries(getPayloadClient, contentTag = "website-content") {
89
366
  const payload = await getPayloadClient();
90
367
  return queryPageByPath(payload, path, false);
91
368
  },
92
- ["page-by-path"],
369
+ ["page-by-path", PAGE_QUERY_CACHE_VERSION],
93
370
  { tags: [contentTag] }
94
371
  );
95
372
  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-GNYOAC5N.mjs";
8
+ import "../chunk-N67KVM2S.mjs";
9
+ import "../chunk-LB72FZZ3.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 {