@orion-studios/payload-studio 0.5.0-beta.7 → 0.5.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/README.md +20 -0
- package/dist/admin/client.d.mts +2 -0
- package/dist/admin/client.d.ts +2 -0
- package/dist/admin/client.js +779 -137
- package/dist/admin/client.mjs +769 -129
- package/dist/admin/index.d.mts +1 -1
- package/dist/admin/index.d.ts +1 -1
- package/dist/admin/index.js +100 -8
- package/dist/admin/index.mjs +3 -1
- package/dist/admin-app/client.d.mts +7 -0
- package/dist/admin-app/client.d.ts +7 -0
- package/dist/admin-app/client.js +1262 -3
- package/dist/admin-app/client.mjs +1164 -2
- package/dist/admin-app/index.d.mts +1 -1
- package/dist/admin-app/index.d.ts +1 -1
- package/dist/admin-app/index.js +167 -0
- package/dist/admin-app/index.mjs +13 -1
- package/dist/admin-app/styles.css +229 -0
- package/dist/blocks/index.js +633 -8
- package/dist/blocks/index.mjs +2 -2
- package/dist/{chunk-ZLLNO5FM.mjs → chunk-CKX5Y2HU.mjs} +44 -13
- package/dist/{chunk-J7W5EE3B.mjs → chunk-HCEPGEAI.mjs} +100 -8
- package/dist/chunk-HXGAG6I7.mjs +325 -0
- package/dist/chunk-ROTPP5CU.mjs +99 -0
- package/dist/{chunk-ETRRXURT.mjs → chunk-SIL2J5MF.mjs} +14 -0
- package/dist/chunk-VDGSMD6H.mjs +1072 -0
- package/dist/{chunk-PC5622T7.mjs → chunk-XK3K5GRP.mjs} +620 -9
- package/dist/chunk-XVH5SCBD.mjs +234 -0
- package/dist/{index-CmR6NInu.d.ts → index-BIwu3qIH.d.mts} +29 -3
- package/dist/{index-CmR6NInu.d.mts → index-BIwu3qIH.d.ts} +29 -3
- package/dist/index-CdnUNrvX.d.mts +134 -0
- package/dist/{index-DbH0Ljwp.d.ts → index-CpG3UHcS.d.mts} +1 -0
- package/dist/{index-DbH0Ljwp.d.mts → index-CpG3UHcS.d.ts} +1 -0
- package/dist/index-DyHbWliW.d.ts +134 -0
- package/dist/index-ZbOx4OCF.d.mts +128 -0
- package/dist/index-ZbOx4OCF.d.ts +128 -0
- package/dist/{index-DJFhANvJ.d.mts → index-cDYkEj29.d.mts} +20 -2
- package/dist/{index-DJFhANvJ.d.ts → index-cDYkEj29.d.ts} +20 -2
- package/dist/index.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +2145 -305
- package/dist/index.mjs +9 -9
- package/dist/nextjs/index.d.mts +1 -1
- package/dist/nextjs/index.d.ts +1 -1
- package/dist/nextjs/index.js +996 -13
- package/dist/nextjs/index.mjs +4 -1
- package/dist/studio/index.d.mts +2 -1
- package/dist/studio/index.d.ts +2 -1
- package/dist/studio/index.js +171 -2
- package/dist/studio/index.mjs +7 -3
- package/dist/studio-pages/builder.css +358 -8
- package/dist/studio-pages/client.d.mts +17 -0
- package/dist/studio-pages/client.d.ts +17 -0
- package/dist/studio-pages/client.js +5657 -1478
- package/dist/studio-pages/client.mjs +5549 -1461
- package/dist/studio-pages/index.d.mts +3 -2
- package/dist/studio-pages/index.d.ts +3 -2
- package/dist/studio-pages/index.js +799 -29
- package/dist/studio-pages/index.mjs +6 -2
- package/package.json +26 -12
- package/dist/chunk-AAOHJDNS.mjs +0 -67
- package/dist/chunk-N67KVM2S.mjs +0 -156
- package/dist/chunk-UJFU323N.mjs +0 -301
- package/dist/index-B9N5MyjF.d.mts +0 -39
- package/dist/index-BallJs-K.d.mts +0 -43
- package/dist/index-BallJs-K.d.ts +0 -43
- package/dist/index-g8tBHLKD.d.ts +0 -39
package/dist/admin/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { A as AdminConfig, c as configureAdmin, a as createThemePreferenceField, t as themePreferenceField, w as withTooltips } from '../index-
|
|
1
|
+
export { A as AdminConfig, c as configureAdmin, a as createHeaderNavItemsField, b as createThemePreferenceField, t as themePreferenceField, w as withTooltips } from '../index-cDYkEj29.mjs';
|
|
2
2
|
import 'payload';
|
package/dist/admin/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { A as AdminConfig, c as configureAdmin, a as createThemePreferenceField, t as themePreferenceField, w as withTooltips } from '../index-
|
|
1
|
+
export { A as AdminConfig, c as configureAdmin, a as createHeaderNavItemsField, b as createThemePreferenceField, t as themePreferenceField, w as withTooltips } from '../index-cDYkEj29.js';
|
|
2
2
|
import 'payload';
|
package/dist/admin/index.js
CHANGED
|
@@ -31,6 +31,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
var admin_exports = {};
|
|
32
32
|
__export(admin_exports, {
|
|
33
33
|
configureAdmin: () => configureAdmin,
|
|
34
|
+
createHeaderNavItemsField: () => createHeaderNavItemsField,
|
|
34
35
|
createThemePreferenceField: () => createThemePreferenceField,
|
|
35
36
|
themePreferenceField: () => themePreferenceField,
|
|
36
37
|
withTooltips: () => withTooltips
|
|
@@ -87,14 +88,25 @@ function configureAdmin(config) {
|
|
|
87
88
|
defaultTheme = "brand-light",
|
|
88
89
|
logoUrl
|
|
89
90
|
} = config;
|
|
90
|
-
const studioEnabled =
|
|
91
|
+
const studioEnabled = config.studio?.enabled ?? true;
|
|
91
92
|
const pagesCollectionSlug = config.studio?.pages?.collectionSlug || "pages";
|
|
92
93
|
const mediaCollectionSlug = config.studio?.media?.collectionSlug || "media";
|
|
93
|
-
const
|
|
94
|
+
const contactFormStudioPath = "/studio-contact-form";
|
|
95
|
+
const configuredGlobals = config.studio?.globals || [
|
|
94
96
|
{ slug: "site-settings", label: "Website Settings" },
|
|
95
97
|
{ slug: "header", label: "Header & Navigation" },
|
|
96
|
-
{ slug: "footer", label: "Footer" }
|
|
98
|
+
{ slug: "footer", label: "Footer" },
|
|
99
|
+
{ slug: "contact-form", label: "Contact Form" }
|
|
97
100
|
];
|
|
101
|
+
const globals = configuredGlobals.map((global) => {
|
|
102
|
+
if (global.slug !== "contact-form" || global.href) {
|
|
103
|
+
return global;
|
|
104
|
+
}
|
|
105
|
+
return {
|
|
106
|
+
...global,
|
|
107
|
+
href: contactFormStudioPath
|
|
108
|
+
};
|
|
109
|
+
});
|
|
98
110
|
let cssPath;
|
|
99
111
|
const pkgDist = getPkgDistDir();
|
|
100
112
|
const sourceCssPath = import_path.default.resolve(pkgDist, "admin.css");
|
|
@@ -124,7 +136,8 @@ function configureAdmin(config) {
|
|
|
124
136
|
clientProps: {
|
|
125
137
|
brandName,
|
|
126
138
|
logoUrl,
|
|
127
|
-
globalsBasePath: "/
|
|
139
|
+
globalsBasePath: "/studio-globals",
|
|
140
|
+
globalsExtraMatchPrefixes: [contactFormStudioPath],
|
|
128
141
|
mediaCollectionSlug,
|
|
129
142
|
pagesCollectionSlug
|
|
130
143
|
}
|
|
@@ -156,7 +169,8 @@ function configureAdmin(config) {
|
|
|
156
169
|
clientProps: {
|
|
157
170
|
brandName,
|
|
158
171
|
logoUrl,
|
|
159
|
-
globalsBasePath: "/
|
|
172
|
+
globalsBasePath: "/studio-globals",
|
|
173
|
+
globalsExtraMatchPrefixes: [contactFormStudioPath],
|
|
160
174
|
mediaCollectionSlug,
|
|
161
175
|
pagesCollectionSlug
|
|
162
176
|
}
|
|
@@ -170,7 +184,18 @@ function configureAdmin(config) {
|
|
|
170
184
|
path: clientPath,
|
|
171
185
|
clientProps: {
|
|
172
186
|
globals,
|
|
173
|
-
globalsBasePath: "/
|
|
187
|
+
globalsBasePath: "/studio-globals"
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
studioContactForm: {
|
|
192
|
+
path: "/studio-contact-form",
|
|
193
|
+
Component: {
|
|
194
|
+
exportName: "AdminStudioContactFormView",
|
|
195
|
+
path: clientPath,
|
|
196
|
+
clientProps: {
|
|
197
|
+
globalSlug: "contact-form",
|
|
198
|
+
globalsBasePath: "/studio-globals"
|
|
174
199
|
}
|
|
175
200
|
}
|
|
176
201
|
}
|
|
@@ -217,16 +242,47 @@ function configureAdmin(config) {
|
|
|
217
242
|
const labelMap = {
|
|
218
243
|
header: { group: "Site Design", label: "Header & Navigation" },
|
|
219
244
|
footer: { group: "Site Design", label: "Footer" },
|
|
220
|
-
"site-settings": { group: "Site Design", label: "Website Settings" }
|
|
245
|
+
"site-settings": { group: "Site Design", label: "Website Settings" },
|
|
246
|
+
"contact-form": { group: "Lead Forms", label: "Contact Form" }
|
|
221
247
|
};
|
|
222
248
|
return globals2.map((global) => {
|
|
223
249
|
const mapping = labelMap[global.slug];
|
|
224
250
|
if (!mapping) return global;
|
|
251
|
+
const shouldAttachContactFormRedirect = studioEnabled && global.slug === "contact-form";
|
|
252
|
+
const existingViews = global.admin?.components?.views;
|
|
253
|
+
const existingEditViews = existingViews?.edit;
|
|
254
|
+
const hasCustomContactFormEditView = Boolean(
|
|
255
|
+
existingEditViews?.root || existingEditViews?.default && typeof existingEditViews.default === "object" && existingEditViews.default.Component
|
|
256
|
+
);
|
|
257
|
+
const contactFormEditViews = shouldAttachContactFormRedirect && !hasCustomContactFormEditView ? {
|
|
258
|
+
...existingEditViews,
|
|
259
|
+
default: {
|
|
260
|
+
...typeof existingEditViews?.default === "object" ? existingEditViews.default : {},
|
|
261
|
+
Component: {
|
|
262
|
+
exportName: "StudioContactFormRedirect",
|
|
263
|
+
path: clientPath,
|
|
264
|
+
clientProps: {
|
|
265
|
+
studioContactFormPath: contactFormStudioPath
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
} : existingEditViews;
|
|
225
270
|
return {
|
|
226
271
|
...global,
|
|
227
272
|
admin: {
|
|
228
273
|
...global.admin,
|
|
229
|
-
group: mapping.group
|
|
274
|
+
group: mapping.group,
|
|
275
|
+
components: {
|
|
276
|
+
...global.admin?.components,
|
|
277
|
+
...shouldAttachContactFormRedirect ? {
|
|
278
|
+
views: {
|
|
279
|
+
...existingViews,
|
|
280
|
+
...contactFormEditViews ? {
|
|
281
|
+
edit: contactFormEditViews
|
|
282
|
+
} : {}
|
|
283
|
+
}
|
|
284
|
+
} : {}
|
|
285
|
+
}
|
|
230
286
|
},
|
|
231
287
|
label: mapping.label
|
|
232
288
|
};
|
|
@@ -294,9 +350,45 @@ function addTooltipToField(field, tooltips) {
|
|
|
294
350
|
}
|
|
295
351
|
return field;
|
|
296
352
|
}
|
|
353
|
+
|
|
354
|
+
// src/admin/fields/headerNav.ts
|
|
355
|
+
var createHeaderNavItemsField = () => ({
|
|
356
|
+
name: "navItems",
|
|
357
|
+
type: "array",
|
|
358
|
+
labels: { singular: "Navigation Link", plural: "Navigation Links" },
|
|
359
|
+
admin: {
|
|
360
|
+
description: "The links displayed in your website's main navigation menu."
|
|
361
|
+
},
|
|
362
|
+
fields: [
|
|
363
|
+
{
|
|
364
|
+
name: "label",
|
|
365
|
+
type: "text",
|
|
366
|
+
required: true,
|
|
367
|
+
admin: {
|
|
368
|
+
description: "The text shown for this navigation link."
|
|
369
|
+
}
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
name: "href",
|
|
373
|
+
type: "text",
|
|
374
|
+
required: true,
|
|
375
|
+
admin: {
|
|
376
|
+
description: 'The URL this link points to (e.g., "/about" or "https://example.com").'
|
|
377
|
+
}
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
name: "parentHref",
|
|
381
|
+
type: "text",
|
|
382
|
+
admin: {
|
|
383
|
+
description: "Optional parent link URL. If set to another nav item href, this item appears in that dropdown."
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
]
|
|
387
|
+
});
|
|
297
388
|
// Annotate the CommonJS export names for ESM import in node:
|
|
298
389
|
0 && (module.exports = {
|
|
299
390
|
configureAdmin,
|
|
391
|
+
createHeaderNavItemsField,
|
|
300
392
|
createThemePreferenceField,
|
|
301
393
|
themePreferenceField,
|
|
302
394
|
withTooltips
|
package/dist/admin/index.mjs
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
configureAdmin,
|
|
3
|
+
createHeaderNavItemsField,
|
|
3
4
|
createThemePreferenceField,
|
|
4
5
|
themePreferenceField,
|
|
5
6
|
withTooltips
|
|
6
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-HCEPGEAI.mjs";
|
|
7
8
|
import "../chunk-6BWS3CLP.mjs";
|
|
8
9
|
export {
|
|
9
10
|
configureAdmin,
|
|
11
|
+
createHeaderNavItemsField,
|
|
10
12
|
createThemePreferenceField,
|
|
11
13
|
themePreferenceField,
|
|
12
14
|
withTooltips
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { AdminShellClient } from './components/AdminShellClient'
|
|
2
|
+
export { HeaderNavItemsEditor } from './components/HeaderNavItemsEditor'
|
|
3
|
+
export { HeaderNavEditorWithPreview } from './components/HeaderNavEditorWithPreview'
|
|
4
|
+
export { MediaDetailPanel } from './components/MediaDetailPanel'
|
|
5
|
+
export { MediaListItem } from './components/MediaListItem'
|
|
6
|
+
export { MediaUploadForm } from './components/MediaUploadForm'
|
|
7
|
+
export { PageEditorFrame } from './components/PageEditorFrame'
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { AdminShellClient } from './components/AdminShellClient'
|
|
2
|
+
export { HeaderNavItemsEditor } from './components/HeaderNavItemsEditor'
|
|
3
|
+
export { HeaderNavEditorWithPreview } from './components/HeaderNavEditorWithPreview'
|
|
4
|
+
export { MediaDetailPanel } from './components/MediaDetailPanel'
|
|
5
|
+
export { MediaListItem } from './components/MediaListItem'
|
|
6
|
+
export { MediaUploadForm } from './components/MediaUploadForm'
|
|
7
|
+
export { PageEditorFrame } from './components/PageEditorFrame'
|