@orion-studios/payload-studio 0.5.0-beta.11 → 0.5.0-beta.111

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 (77) hide show
  1. package/README.md +54 -0
  2. package/dist/admin/client.d.mts +3 -0
  3. package/dist/admin/client.d.ts +3 -0
  4. package/dist/admin/client.js +1745 -200
  5. package/dist/admin/client.mjs +1756 -214
  6. package/dist/admin/index.d.mts +2 -1
  7. package/dist/admin/index.d.ts +2 -1
  8. package/dist/admin/index.js +424 -11
  9. package/dist/admin/index.mjs +19 -1
  10. package/dist/admin-app/client.d.mts +7 -0
  11. package/dist/admin-app/client.d.ts +7 -0
  12. package/dist/admin-app/client.js +1270 -3
  13. package/dist/admin-app/client.mjs +1172 -2
  14. package/dist/admin-app/index.d.mts +1 -1
  15. package/dist/admin-app/index.d.ts +1 -1
  16. package/dist/admin-app/index.js +167 -0
  17. package/dist/admin-app/index.mjs +13 -1
  18. package/dist/admin-app/styles.css +247 -0
  19. package/dist/admin.css +8 -0
  20. package/dist/blocks/index.js +1011 -191
  21. package/dist/blocks/index.mjs +2 -2
  22. package/dist/chunk-ADIIWIYL.mjs +322 -0
  23. package/dist/{chunk-ZLLNO5FM.mjs → chunk-BET2YLAS.mjs} +104 -15
  24. package/dist/chunk-DAIZDGHL.mjs +614 -0
  25. package/dist/chunk-GKMBYYXF.mjs +776 -0
  26. package/dist/chunk-JQAHXYAM.mjs +1829 -0
  27. package/dist/chunk-OQSEJXC4.mjs +166 -0
  28. package/dist/chunk-PF3EBZXF.mjs +326 -0
  29. package/dist/chunk-ROTPP5CU.mjs +99 -0
  30. package/dist/chunk-XVH5SCBD.mjs +234 -0
  31. package/dist/chunk-ZTXJG4K5.mjs +85 -0
  32. package/dist/index-7lxTrxSG.d.mts +128 -0
  33. package/dist/index-7lxTrxSG.d.ts +128 -0
  34. package/dist/index-B7QvY3yF.d.mts +245 -0
  35. package/dist/index-BK03FiEM.d.ts +245 -0
  36. package/dist/{index-CmR6NInu.d.ts → index-BzKOThsI.d.mts} +30 -3
  37. package/dist/{index-CmR6NInu.d.mts → index-BzKOThsI.d.ts} +30 -3
  38. package/dist/{index-DbH0Ljwp.d.mts → index-D8BNfUJb.d.mts} +17 -2
  39. package/dist/{index-DbH0Ljwp.d.ts → index-DD_E2UfJ.d.ts} +17 -2
  40. package/dist/index-DUi_XND6.d.ts +193 -0
  41. package/dist/index-gLl_358v.d.mts +193 -0
  42. package/dist/index.d.mts +6 -5
  43. package/dist/index.d.ts +6 -5
  44. package/dist/index.js +2876 -460
  45. package/dist/index.mjs +12 -10
  46. package/dist/nextjs/index.d.mts +2 -1
  47. package/dist/nextjs/index.d.ts +2 -1
  48. package/dist/nextjs/index.js +497 -16
  49. package/dist/nextjs/index.mjs +8 -3
  50. package/dist/socialMedia-C05Iy-SV.d.mts +21 -0
  51. package/dist/socialMedia-C05Iy-SV.d.ts +21 -0
  52. package/dist/studio/index.d.mts +2 -1
  53. package/dist/studio/index.d.ts +2 -1
  54. package/dist/studio/index.js +171 -5
  55. package/dist/studio/index.mjs +7 -3
  56. package/dist/studio-pages/builder.css +517 -32
  57. package/dist/studio-pages/client.d.mts +75 -1
  58. package/dist/studio-pages/client.d.ts +75 -1
  59. package/dist/studio-pages/client.js +5662 -2759
  60. package/dist/studio-pages/client.mjs +5578 -2767
  61. package/dist/studio-pages/index.d.mts +4 -2
  62. package/dist/studio-pages/index.d.ts +4 -2
  63. package/dist/studio-pages/index.js +859 -71
  64. package/dist/studio-pages/index.mjs +10 -4
  65. package/package.json +35 -13
  66. package/dist/chunk-AAOHJDNS.mjs +0 -67
  67. package/dist/chunk-ETRRXURT.mjs +0 -141
  68. package/dist/chunk-J7W5EE3B.mjs +0 -278
  69. package/dist/chunk-N67KVM2S.mjs +0 -156
  70. package/dist/chunk-NESLJZFE.mjs +0 -303
  71. package/dist/chunk-U5BSPWAD.mjs +0 -1034
  72. package/dist/index-B9N5MyjF.d.mts +0 -39
  73. package/dist/index-BallJs-K.d.mts +0 -43
  74. package/dist/index-BallJs-K.d.ts +0 -43
  75. package/dist/index-DJFhANvJ.d.mts +0 -128
  76. package/dist/index-DJFhANvJ.d.ts +0 -128
  77. package/dist/index-g8tBHLKD.d.ts +0 -39
@@ -1,156 +0,0 @@
1
- import {
2
- __export
3
- } from "./chunk-6BWS3CLP.mjs";
4
-
5
- // src/studio/index.ts
6
- var studio_exports = {};
7
- __export(studio_exports, {
8
- assertStudioDocumentV1: () => assertStudioDocumentV1,
9
- compileStudioDocument: () => compileStudioDocument,
10
- createEmptyStudioDocument: () => createEmptyStudioDocument,
11
- createStudioRegistry: () => createStudioRegistry,
12
- migrateStudioDocument: () => migrateStudioDocument,
13
- validateStudioDocument: () => validateStudioDocument
14
- });
15
- var isRecord = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
16
- var makeIssue = (message, path, code = "studio.invalid") => ({
17
- code,
18
- message,
19
- path,
20
- severity: "error"
21
- });
22
- var createEmptyStudioDocument = (title) => ({
23
- metadata: {},
24
- schemaVersion: 1,
25
- title,
26
- nodes: [],
27
- updatedAt: (/* @__PURE__ */ new Date()).toISOString()
28
- });
29
- function assertStudioDocumentV1(input) {
30
- if (!isRecord(input)) {
31
- throw new Error("Studio document must be an object");
32
- }
33
- if (input.schemaVersion !== 1) {
34
- throw new Error("Unsupported studio schemaVersion");
35
- }
36
- if (!Array.isArray(input.nodes)) {
37
- throw new Error("Studio document nodes must be an array");
38
- }
39
- const nodes = input.nodes.map((node, index) => {
40
- if (!isRecord(node)) {
41
- throw new Error(`Node at index ${index} must be an object`);
42
- }
43
- if (typeof node.id !== "string" || node.id.length === 0) {
44
- throw new Error(`Node at index ${index} has invalid id`);
45
- }
46
- if (typeof node.type !== "string" || node.type.length === 0) {
47
- throw new Error(`Node at index ${index} has invalid type`);
48
- }
49
- if (!isRecord(node.data)) {
50
- throw new Error(`Node at index ${index} has invalid data`);
51
- }
52
- return {
53
- id: node.id,
54
- type: node.type,
55
- data: node.data
56
- };
57
- });
58
- return {
59
- metadata: isRecord(input.metadata) ? input.metadata : void 0,
60
- schemaVersion: 1,
61
- title: typeof input.title === "string" ? input.title : void 0,
62
- nodes,
63
- updatedAt: typeof input.updatedAt === "string" ? input.updatedAt : void 0
64
- };
65
- }
66
- function createStudioRegistry(modules) {
67
- const moduleByID = new Map(modules.map((mod) => [mod.id, mod]));
68
- const nodeTypes = modules.flatMap((mod) => mod.nodeTypes);
69
- const nodeTypeByName = new Map(nodeTypes.map((definition) => [definition.type, definition]));
70
- return {
71
- getModuleByID: (id) => moduleByID.get(id),
72
- getNodeTypeByName: (type) => nodeTypeByName.get(type),
73
- listInspectorPanels: () => modules.flatMap((mod) => mod.inspectorPanels),
74
- listModules: () => [...modules],
75
- listPaletteGroups: () => modules.flatMap((mod) => mod.paletteGroups),
76
- listNodeTypes: () => [...nodeTypes]
77
- };
78
- }
79
- function validateStudioDocument(document, modules) {
80
- const issues = [];
81
- if (document.schemaVersion !== 1) {
82
- issues.push(makeIssue("Unsupported schema version", "schemaVersion", "studio.schemaVersion"));
83
- }
84
- if (!Array.isArray(document.nodes)) {
85
- issues.push(makeIssue("Nodes must be an array", "nodes", "studio.nodes"));
86
- return issues;
87
- }
88
- const registry = createStudioRegistry(modules);
89
- const nodeIDs = /* @__PURE__ */ new Set();
90
- document.nodes.forEach((node, index) => {
91
- if (!node.id) {
92
- issues.push(makeIssue("Node id is required", `nodes.${index}.id`, "studio.node.id"));
93
- }
94
- if (nodeIDs.has(node.id)) {
95
- issues.push(makeIssue("Node id must be unique", `nodes.${index}.id`, "studio.node.id.duplicate"));
96
- }
97
- nodeIDs.add(node.id);
98
- if (!registry.getNodeTypeByName(node.type)) {
99
- issues.push(makeIssue("Unsupported node type", `nodes.${index}.type`, "studio.node.type"));
100
- }
101
- });
102
- for (const module of modules) {
103
- for (const validate of module.validators) {
104
- issues.push(...validate(document));
105
- }
106
- }
107
- return issues;
108
- }
109
- function compileStudioDocument(document, modules) {
110
- const issues = validateStudioDocument(document, modules);
111
- const compilerEntries = modules.filter((mod) => typeof mod.compiler?.compileNode === "function").map((mod) => mod.compiler?.compileNode);
112
- const layout = document.nodes.map((node) => {
113
- for (const compileNode of compilerEntries) {
114
- if (!compileNode) {
115
- continue;
116
- }
117
- const compiled = compileNode(node);
118
- if (compiled) {
119
- return compiled;
120
- }
121
- }
122
- return {
123
- id: node.id,
124
- blockType: node.type,
125
- ...node.data
126
- };
127
- });
128
- return {
129
- issues,
130
- layout
131
- };
132
- }
133
- function migrateStudioDocument(value, migrations) {
134
- const sorted = [...migrations].sort((a, b) => a.fromVersion - b.fromVersion);
135
- if (isRecord(value) && value.schemaVersion === 1) {
136
- return assertStudioDocumentV1(value);
137
- }
138
- let current = value;
139
- for (const migration of sorted) {
140
- if (!isRecord(current) || current.schemaVersion !== migration.fromVersion) {
141
- continue;
142
- }
143
- current = migration.migrate(current);
144
- }
145
- return assertStudioDocumentV1(current);
146
- }
147
-
148
- export {
149
- createEmptyStudioDocument,
150
- assertStudioDocumentV1,
151
- createStudioRegistry,
152
- validateStudioDocument,
153
- compileStudioDocument,
154
- migrateStudioDocument,
155
- studio_exports
156
- };
@@ -1,303 +0,0 @@
1
- import {
2
- sectionStyleDefaults
3
- } from "./chunk-ETRRXURT.mjs";
4
- import {
5
- __export
6
- } from "./chunk-6BWS3CLP.mjs";
7
-
8
- // src/studio-pages/index.ts
9
- var studio_pages_exports = {};
10
- __export(studio_pages_exports, {
11
- createDefaultStudioDocument: () => createDefaultStudioDocument,
12
- layoutToStudioDocument: () => layoutToStudioDocument,
13
- pageInspectorPanels: () => pageInspectorPanels,
14
- pageNodeTypes: () => pageNodeTypes,
15
- pagePaletteGroups: () => pagePaletteGroups,
16
- pageStudioModuleManifest: () => pageStudioModuleManifest,
17
- studioDocumentToLayout: () => studioDocumentToLayout
18
- });
19
- var withSectionStyleDefaults = (value) => ({
20
- ...sectionStyleDefaults,
21
- ...value
22
- });
23
- var defaultNodeData = {
24
- bookingEmbed: {
25
- ...withSectionStyleDefaults({}),
26
- buttonHref: "/contact",
27
- buttonLabel: "Book Consultation",
28
- description: "Let visitors book a consultation.",
29
- title: "Book a Time"
30
- },
31
- beforeAfter: withSectionStyleDefaults({
32
- items: [
33
- {
34
- description: "Before and after result summary.",
35
- label: "Project One"
36
- }
37
- ],
38
- subtitle: "Show visual proof from real projects.",
39
- title: "Before & After Results"
40
- }),
41
- cta: {
42
- ...withSectionStyleDefaults({}),
43
- backgroundColor: "#1f684f",
44
- buttonHref: "/contact",
45
- buttonLabel: "Contact Us",
46
- description: "Optional supporting copy.",
47
- headline: "Ready to get started?",
48
- style: "light"
49
- },
50
- faq: {
51
- ...withSectionStyleDefaults({}),
52
- items: [{ answer: "Answer goes here.", question: "Frequently asked question?" }],
53
- title: "Frequently Asked Questions"
54
- },
55
- featureGrid: {
56
- ...withSectionStyleDefaults({}),
57
- items: [
58
- { description: "Explain this point.", icon: "01", title: "Feature One" },
59
- { description: "Explain this point.", icon: "02", title: "Feature Two" },
60
- { description: "Explain this point.", icon: "03", title: "Feature Three" }
61
- ],
62
- title: "Section Title",
63
- variant: "cards"
64
- },
65
- formEmbed: {
66
- ...withSectionStyleDefaults({}),
67
- description: "Collect lead details from visitors.",
68
- formType: "quote",
69
- title: "Request a Quote"
70
- },
71
- hero: {
72
- ...withSectionStyleDefaults({}),
73
- backgroundColor: "",
74
- backgroundImageFit: "cover",
75
- backgroundImagePosition: "center",
76
- headline: "New Hero Section",
77
- kicker: "Optional kicker",
78
- primaryHref: "/contact",
79
- primaryLabel: "Primary Action",
80
- secondaryHref: "/services",
81
- secondaryLabel: "Secondary Action",
82
- subheadline: "Describe your offer clearly for website visitors.",
83
- variant: "default"
84
- },
85
- media: {
86
- ...withSectionStyleDefaults({}),
87
- caption: "Add a caption",
88
- size: "default"
89
- },
90
- logoWall: withSectionStyleDefaults({
91
- items: [
92
- { name: "Trusted Partner 1" },
93
- { name: "Trusted Partner 2" },
94
- { name: "Trusted Partner 3" }
95
- ],
96
- subtitle: "Trusted by teams and homeowners across Central Texas.",
97
- title: "Trusted by Local Organizations"
98
- }),
99
- richText: {
100
- ...withSectionStyleDefaults({}),
101
- content: {
102
- root: {
103
- children: [
104
- {
105
- children: [
106
- {
107
- detail: 0,
108
- format: 0,
109
- mode: "normal",
110
- style: "",
111
- text: "Write your content here.",
112
- type: "text",
113
- version: 1
114
- }
115
- ],
116
- direction: "ltr",
117
- format: "",
118
- indent: 0,
119
- type: "paragraph",
120
- version: 1
121
- }
122
- ],
123
- direction: "ltr",
124
- format: "",
125
- indent: 0,
126
- type: "root",
127
- version: 1
128
- }
129
- },
130
- title: "Section Heading",
131
- width: "normal"
132
- },
133
- testimonials: {
134
- ...withSectionStyleDefaults({}),
135
- items: [{ location: "City, ST", name: "Customer Name", quote: "Customer feedback goes here." }],
136
- title: "What Customers Say"
137
- },
138
- stats: withSectionStyleDefaults({
139
- items: [
140
- { description: "Average response time", label: "Same-Day Quotes", value: "24h" },
141
- { description: "Projects completed", label: "Completed Jobs", value: "1,200+" },
142
- { description: "Client satisfaction score", label: "Satisfaction", value: "4.9/5" }
143
- ],
144
- subtitle: "Highlight measurable outcomes to build trust quickly.",
145
- title: "Performance Highlights"
146
- })
147
- };
148
- var nodeTypeLabels = {
149
- bookingEmbed: "Booking Embed",
150
- beforeAfter: "Before / After",
151
- cta: "Call To Action",
152
- faq: "FAQ",
153
- featureGrid: "Feature Grid",
154
- formEmbed: "Form Embed",
155
- hero: "Hero",
156
- logoWall: "Logo Wall",
157
- media: "Media",
158
- richText: "Rich Text",
159
- stats: "Stats",
160
- testimonials: "Testimonials"
161
- };
162
- var pageNodeTypes = Object.keys(defaultNodeData).map((type) => ({
163
- type,
164
- displayName: nodeTypeLabels[type] || type,
165
- description: `Page node for ${nodeTypeLabels[type] || type}`,
166
- getDefaultData: () => structuredClone(defaultNodeData[type])
167
- }));
168
- var validatePageDocument = (document) => {
169
- const issues = [];
170
- if (!document.title || document.title.trim().length === 0) {
171
- issues.push({
172
- code: "pages.title.required",
173
- message: "Page title is required before publishing.",
174
- path: "title",
175
- severity: "error"
176
- });
177
- }
178
- if (document.nodes.length === 0) {
179
- issues.push({
180
- code: "pages.nodes.required",
181
- message: "At least one section is required.",
182
- path: "nodes",
183
- severity: "error"
184
- });
185
- }
186
- document.nodes.forEach((node, index) => {
187
- if (node.type === "hero" && typeof node.data.headline !== "string") {
188
- issues.push({
189
- code: "pages.hero.headline",
190
- message: "Hero section requires a headline.",
191
- path: `nodes.${index}.data.headline`,
192
- severity: "error"
193
- });
194
- }
195
- });
196
- return issues;
197
- };
198
- var pagePaletteGroups = [
199
- {
200
- id: "page-core",
201
- label: "Core Sections",
202
- items: [
203
- { nodeType: "hero", title: "Hero", description: "Top-of-page headline and CTA" },
204
- { nodeType: "featureGrid", title: "Feature Grid", description: "Service or value cards" },
205
- { nodeType: "stats", title: "Stats", description: "Key performance highlights" },
206
- { nodeType: "logoWall", title: "Logo Wall", description: "Trust logos and badges" },
207
- { nodeType: "beforeAfter", title: "Before / After", description: "Visual before-and-after gallery" },
208
- { nodeType: "richText", title: "Rich Text", description: "Long-form content area" },
209
- { nodeType: "media", title: "Media", description: "Image/video section" },
210
- { nodeType: "testimonials", title: "Testimonials", description: "Social proof quotes" },
211
- { nodeType: "faq", title: "FAQ", description: "Question-and-answer section" },
212
- { nodeType: "cta", title: "Call To Action", description: "Conversion strip with button" },
213
- { nodeType: "formEmbed", title: "Form Embed", description: "Lead capture form" },
214
- { nodeType: "bookingEmbed", title: "Booking Embed", description: "Scheduling panel" }
215
- ]
216
- }
217
- ];
218
- var pageInspectorPanels = Object.keys(defaultNodeData).map((nodeType) => ({
219
- id: `${nodeType}-panel`,
220
- label: `${nodeTypeLabels[nodeType] || nodeType} Settings`,
221
- nodeType,
222
- fields: [
223
- {
224
- key: "title",
225
- label: "Title",
226
- type: "text"
227
- }
228
- ]
229
- }));
230
- var pageStudioModuleManifest = {
231
- id: "studio-pages",
232
- version: "0.1.0-beta.0",
233
- displayName: "Pages Studio Module",
234
- nodeTypes: pageNodeTypes,
235
- paletteGroups: pagePaletteGroups,
236
- inspectorPanels: pageInspectorPanels,
237
- validators: [validatePageDocument],
238
- migrations: [],
239
- compiler: {
240
- compileNode: (node) => ({
241
- id: node.id,
242
- blockType: node.type,
243
- ...node.data
244
- })
245
- },
246
- permissions: [
247
- { action: "read", role: "admin" },
248
- { action: "read", role: "editor" },
249
- { action: "read", role: "client" },
250
- { action: "update", role: "admin" },
251
- { action: "update", role: "editor" },
252
- { action: "update", role: "client" },
253
- { action: "publish", role: "admin" },
254
- { action: "publish", role: "editor" }
255
- ]
256
- };
257
- var ensureNodeID = (inputID, index) => {
258
- if (typeof inputID === "string" && inputID.length > 0) {
259
- return inputID;
260
- }
261
- return `node-${index + 1}`;
262
- };
263
- var layoutToStudioDocument = (layout, title, metadata) => {
264
- const nodes = layout.filter((block) => typeof block.blockType === "string").map((block, index) => {
265
- const blockType = String(block.blockType);
266
- const { id, blockType: _, ...data } = block;
267
- return {
268
- id: ensureNodeID(id, index),
269
- type: blockType,
270
- data
271
- };
272
- });
273
- return {
274
- metadata,
275
- schemaVersion: 1,
276
- title,
277
- nodes,
278
- updatedAt: (/* @__PURE__ */ new Date()).toISOString()
279
- };
280
- };
281
- var studioDocumentToLayout = (document) => document.nodes.map((node) => ({
282
- id: node.id,
283
- blockType: node.type,
284
- ...node.data
285
- }));
286
- var createDefaultStudioDocument = (title) => ({
287
- metadata: {},
288
- schemaVersion: 1,
289
- title,
290
- nodes: [],
291
- updatedAt: (/* @__PURE__ */ new Date()).toISOString()
292
- });
293
-
294
- export {
295
- pageNodeTypes,
296
- pagePaletteGroups,
297
- pageInspectorPanels,
298
- pageStudioModuleManifest,
299
- layoutToStudioDocument,
300
- studioDocumentToLayout,
301
- createDefaultStudioDocument,
302
- studio_pages_exports
303
- };