@orion-studios/payload-studio 0.5.0-beta.99 → 0.6.0-beta.1
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 +58 -68
- package/dist/admin/client.d.mts +5 -0
- package/dist/admin/client.d.ts +5 -0
- package/dist/admin/client.js +4440 -806
- package/dist/admin/client.mjs +3279 -785
- package/dist/admin/index.d.mts +2 -1
- package/dist/admin/index.d.ts +2 -1
- package/dist/admin/index.js +380 -55
- package/dist/admin/index.mjs +2 -1
- package/dist/admin-app/client.d.mts +1 -0
- package/dist/admin-app/client.d.ts +1 -0
- package/dist/admin-app/client.js +285 -109
- package/dist/admin-app/client.mjs +59 -871
- package/dist/admin-app/index.d.mts +2 -1
- package/dist/admin-app/index.d.ts +2 -1
- package/dist/admin-app/index.mjs +5 -3
- package/dist/admin-app/styles.css +1708 -56
- package/dist/admin.css +158 -35
- package/dist/blocks/index.js +415 -200
- package/dist/blocks/index.mjs +2 -2
- package/dist/{chunk-XK3K5GRP.mjs → chunk-JQAHXYAM.mjs} +271 -67
- package/dist/chunk-KPIX7OSV.mjs +1051 -0
- package/dist/chunk-OQSEJXC4.mjs +166 -0
- package/dist/{chunk-XHWQJUX5.mjs → chunk-OTHERBGX.mjs} +3 -3
- package/dist/chunk-PF3EBZXF.mjs +326 -0
- package/dist/{chunk-74XFAVXU.mjs → chunk-Q2HGC67S.mjs} +371 -55
- package/dist/{chunk-XVH5SCBD.mjs → chunk-RKTIFEUY.mjs} +4 -19
- package/dist/chunk-W2UOCJDX.mjs +32 -0
- package/dist/{chunk-C4J35SPJ.mjs → chunk-XKUTZ7IU.mjs} +257 -452
- package/dist/{index-ZbOx4OCF.d.mts → index-52HdVLQq.d.ts} +12 -22
- package/dist/index-BMitiKK8.d.ts +435 -0
- package/dist/index-Crx_MtPw.d.ts +223 -0
- package/dist/index-Cv-6qnrw.d.mts +223 -0
- package/dist/{index-ZbOx4OCF.d.ts → index-DEQC3Dwj.d.mts} +12 -22
- package/dist/{index-BIwu3qIH.d.mts → index-DWmudwDm.d.mts} +2 -1
- package/dist/{index-BIwu3qIH.d.ts → index-DWmudwDm.d.ts} +2 -1
- package/dist/index-D_b24Gef.d.mts +435 -0
- package/dist/index.d.mts +5 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.js +1855 -1205
- package/dist/index.mjs +10 -8
- package/dist/nextjs/index.js +5 -684
- package/dist/nextjs/index.mjs +2 -3
- package/dist/sitePreviewTypes-BkHCWxNW.d.mts +58 -0
- package/dist/sitePreviewTypes-BkHCWxNW.d.ts +58 -0
- package/dist/studio/index.d.mts +1 -1
- package/dist/studio/index.d.ts +1 -1
- package/dist/studio-pages/builder.css +125 -83
- package/dist/studio-pages/client.d.mts +58 -1
- package/dist/studio-pages/client.d.ts +58 -1
- package/dist/studio-pages/client.js +450 -241
- package/dist/studio-pages/client.mjs +455 -247
- package/dist/studio-pages/index.d.mts +3 -2
- package/dist/studio-pages/index.d.ts +3 -2
- package/dist/studio-pages/index.js +418 -183
- package/dist/studio-pages/index.mjs +15 -6
- package/package.json +10 -4
- package/dist/chunk-SIL2J5MF.mjs +0 -155
- package/dist/index-BnoqmQDP.d.mts +0 -219
- package/dist/index-CTpik6fR.d.ts +0 -219
- package/dist/index-R7hA134j.d.mts +0 -140
- package/dist/index-vjrjy0P4.d.ts +0 -140
package/dist/admin/index.d.mts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export { A as AdminConfig, C as CreateSocialMediaConnectionsFieldOptions,
|
|
1
|
+
export { A as AdminConfig, a as AdminStudioConfig, b as AdminStudioFooterPreviewConfig, c as AdminStudioHeaderPreviewConfig, d as AdminStudioSitePreviewConfig, C as CreateSocialMediaConnectionsFieldOptions, e as CreateSocialMediaGlobalOptions, R as ResolvedStudioSection, S as StudioGlobalLink, f as StudioSection, g as StudioSectionCard, h as StudioSectionComponent, j as StudioSectionRole, k as StudioSectionView, l as configureAdmin, m as createHeaderNavItemsField, n as createSocialMediaConnectionsField, o as createSocialMediaGlobal, p as createThemePreferenceField, s as socialMediaConnectionsField, t as themePreferenceField, w as withTooltips } from '../index-D_b24Gef.mjs';
|
|
2
2
|
export { b as SOCIAL_MEDIA_DEFAULT_ICON_BY_PLATFORM, c as SOCIAL_MEDIA_ICON_OPTIONS, d as SOCIAL_MEDIA_PLATFORMS, e as SOCIAL_MEDIA_PLATFORM_LABELS, S as SocialMediaGlobalData, f as SocialMediaIconLibrary, g as SocialMediaIconOption, a as SocialMediaPlatform, h as SocialMediaProfileData, i as SocialMediaProfilesData } from '../socialMedia-C05Iy-SV.mjs';
|
|
3
3
|
import 'payload';
|
|
4
|
+
import '../sitePreviewTypes-BkHCWxNW.mjs';
|
package/dist/admin/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export { A as AdminConfig, C as CreateSocialMediaConnectionsFieldOptions,
|
|
1
|
+
export { A as AdminConfig, a as AdminStudioConfig, b as AdminStudioFooterPreviewConfig, c as AdminStudioHeaderPreviewConfig, d as AdminStudioSitePreviewConfig, C as CreateSocialMediaConnectionsFieldOptions, e as CreateSocialMediaGlobalOptions, R as ResolvedStudioSection, S as StudioGlobalLink, f as StudioSection, g as StudioSectionCard, h as StudioSectionComponent, j as StudioSectionRole, k as StudioSectionView, l as configureAdmin, m as createHeaderNavItemsField, n as createSocialMediaConnectionsField, o as createSocialMediaGlobal, p as createThemePreferenceField, s as socialMediaConnectionsField, t as themePreferenceField, w as withTooltips } from '../index-BMitiKK8.js';
|
|
2
2
|
export { b as SOCIAL_MEDIA_DEFAULT_ICON_BY_PLATFORM, c as SOCIAL_MEDIA_ICON_OPTIONS, d as SOCIAL_MEDIA_PLATFORMS, e as SOCIAL_MEDIA_PLATFORM_LABELS, S as SocialMediaGlobalData, f as SocialMediaIconLibrary, g as SocialMediaIconOption, a as SocialMediaPlatform, h as SocialMediaProfileData, i as SocialMediaProfilesData } from '../socialMedia-C05Iy-SV.js';
|
|
3
3
|
import 'payload';
|
|
4
|
+
import '../sitePreviewTypes-BkHCWxNW.js';
|
package/dist/admin/index.js
CHANGED
|
@@ -68,8 +68,21 @@ var createThemePreferenceField = (defaultTheme = "brand-light") => ({
|
|
|
68
68
|
});
|
|
69
69
|
var themePreferenceField = createThemePreferenceField("brand-light");
|
|
70
70
|
|
|
71
|
+
// src/admin-app/routeRegistry.ts
|
|
72
|
+
var adminNavIcons = [
|
|
73
|
+
"dashboard",
|
|
74
|
+
"pages",
|
|
75
|
+
"forms",
|
|
76
|
+
"globals",
|
|
77
|
+
"media",
|
|
78
|
+
"tools",
|
|
79
|
+
"account",
|
|
80
|
+
"analytics"
|
|
81
|
+
];
|
|
82
|
+
|
|
71
83
|
// src/shared/studioSections.ts
|
|
72
84
|
var studioRoles = /* @__PURE__ */ new Set(["admin", "editor", "client"]);
|
|
85
|
+
var studioIcons = new Set(adminNavIcons);
|
|
73
86
|
var isRecord = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
74
87
|
var isAbsoluteExternalURL = (value) => /^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(value) || value.startsWith("//");
|
|
75
88
|
var normalizePathLikeValue = (value) => {
|
|
@@ -110,6 +123,7 @@ var normalizeCard = (value) => {
|
|
|
110
123
|
...typeof value.description === "string" && value.description.trim().length > 0 ? { description: value.description.trim() } : {}
|
|
111
124
|
};
|
|
112
125
|
};
|
|
126
|
+
var normalizeIcon = (value) => typeof value === "string" && studioIcons.has(value) ? value : void 0;
|
|
113
127
|
var resolveStudioSections = (value) => {
|
|
114
128
|
if (!Array.isArray(value)) {
|
|
115
129
|
return [];
|
|
@@ -135,6 +149,7 @@ var resolveStudioSections = (value) => {
|
|
|
135
149
|
label,
|
|
136
150
|
href,
|
|
137
151
|
matchPrefixes,
|
|
152
|
+
...normalizeIcon(entry.icon) ? { icon: normalizeIcon(entry.icon) } : {},
|
|
138
153
|
...normalizeRoles(entry.roles) ? { roles: normalizeRoles(entry.roles) } : {},
|
|
139
154
|
...normalizeCard(entry.card) ? { card: normalizeCard(entry.card) } : {}
|
|
140
155
|
});
|
|
@@ -200,17 +215,28 @@ function configureAdmin(config) {
|
|
|
200
215
|
brandPrimary = "#3b82f6",
|
|
201
216
|
brandSecondary = "#8b5cf6",
|
|
202
217
|
defaultTheme = "brand-light",
|
|
203
|
-
logoUrl
|
|
218
|
+
logoUrl,
|
|
219
|
+
allowThemePreference = false
|
|
204
220
|
} = config;
|
|
205
221
|
const studioEnabled = config.studio?.enabled ?? true;
|
|
222
|
+
const formsEnabled = config.studio?.forms?.enabled ?? false;
|
|
223
|
+
const formsCollectionSlug = config.studio?.forms?.collectionSlug || "forms";
|
|
224
|
+
const formSubmissionsCollectionSlug = config.studio?.forms?.submissionsCollectionSlug || "form-submissions";
|
|
225
|
+
const formUploadsCollectionSlug = config.studio?.forms?.uploadsCollectionSlug || "form-uploads";
|
|
206
226
|
const pagesCollectionSlug = config.studio?.pages?.collectionSlug || "pages";
|
|
227
|
+
const builderBasePath = config.studio?.pages?.builderBasePath || "/builder";
|
|
207
228
|
const mediaCollectionSlug = config.studio?.media?.collectionSlug || "media";
|
|
208
|
-
const
|
|
229
|
+
const globalsBasePath = "/site-globals";
|
|
230
|
+
const pagesBasePath = "/pages";
|
|
231
|
+
const formsBasePath = "/forms";
|
|
232
|
+
const mediaBasePath = "/media";
|
|
233
|
+
const toolsBasePath = "/tools";
|
|
234
|
+
const contactFormStudioPath = "/contact-form";
|
|
209
235
|
const configuredGlobals = config.studio?.globals || [
|
|
210
236
|
{ slug: "site-settings", label: "Website Settings" },
|
|
211
237
|
{ slug: "header", label: "Header & Navigation" },
|
|
212
238
|
{ slug: "footer", label: "Footer" },
|
|
213
|
-
{ slug: "
|
|
239
|
+
{ slug: "social-media", label: "Social Media" }
|
|
214
240
|
];
|
|
215
241
|
const globals = configuredGlobals.map((global) => {
|
|
216
242
|
if (global.slug !== "contact-form" || global.href) {
|
|
@@ -223,24 +249,78 @@ function configureAdmin(config) {
|
|
|
223
249
|
});
|
|
224
250
|
const studioSections = resolveStudioSections(config.studio?.sections || []);
|
|
225
251
|
const studioSectionViews = resolveStudioSectionViews(config.studio?.sections || []);
|
|
252
|
+
const sitePreview = config.studio?.sitePreview;
|
|
226
253
|
let cssPath;
|
|
227
254
|
const pkgDist = getPkgDistDir();
|
|
228
255
|
const sourceCssPath = import_path.default.resolve(pkgDist, "admin.css");
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
256
|
+
const adminAppCssPath = import_path.default.resolve(pkgDist, "admin-app", "styles.css");
|
|
257
|
+
const cssSources = [sourceCssPath, adminAppCssPath].filter((filePath) => import_fs.default.existsSync(filePath));
|
|
258
|
+
if (cssSources.length === 0) {
|
|
259
|
+
cssPath = sourceCssPath;
|
|
260
|
+
} else {
|
|
261
|
+
let css = cssSources.map((filePath) => import_fs.default.readFileSync(filePath, "utf-8")).join("\n\n");
|
|
262
|
+
css = css.replace(
|
|
263
|
+
"--orion-cms-brand-primary-fallback: #3b82f6;",
|
|
264
|
+
`--orion-cms-brand-primary-fallback: ${brandPrimary};`
|
|
265
|
+
);
|
|
266
|
+
css = css.replace(
|
|
267
|
+
"--orion-cms-brand-secondary-fallback: #8b5cf6;",
|
|
268
|
+
`--orion-cms-brand-secondary-fallback: ${brandSecondary};`
|
|
269
|
+
);
|
|
270
|
+
const outputBasePath = config.basePath || process.cwd();
|
|
271
|
+
const genDir = import_path.default.resolve(outputBasePath, ".generated");
|
|
234
272
|
if (!import_fs.default.existsSync(genDir)) {
|
|
235
273
|
import_fs.default.mkdirSync(genDir, { recursive: true });
|
|
236
274
|
}
|
|
237
275
|
const genPath = import_path.default.resolve(genDir, "admin.css");
|
|
238
276
|
import_fs.default.writeFileSync(genPath, css);
|
|
239
277
|
cssPath = genPath;
|
|
240
|
-
} else {
|
|
241
|
-
cssPath = sourceCssPath;
|
|
242
278
|
}
|
|
243
279
|
const clientPath = "@orion-studios/payload-studio/admin/client";
|
|
280
|
+
const studioNavClientProps = {
|
|
281
|
+
brandName,
|
|
282
|
+
formSubmissionsCollectionSlug,
|
|
283
|
+
formsCollectionSlug,
|
|
284
|
+
formsEnabled,
|
|
285
|
+
formUploadsCollectionSlug,
|
|
286
|
+
globalsBasePath,
|
|
287
|
+
globalsExtraMatchPrefixes: [contactFormStudioPath],
|
|
288
|
+
logoUrl,
|
|
289
|
+
mediaCollectionSlug,
|
|
290
|
+
pagesCollectionSlug,
|
|
291
|
+
sections: studioSections
|
|
292
|
+
};
|
|
293
|
+
const studioBackBreadcrumbComponent = {
|
|
294
|
+
exportName: "StudioBackBreadcrumb",
|
|
295
|
+
path: clientPath
|
|
296
|
+
};
|
|
297
|
+
const hasMatchingComponent = (items, exportName) => Array.isArray(items) && items.some(
|
|
298
|
+
(item) => item && typeof item === "object" && item.exportName === exportName && item.path === clientPath
|
|
299
|
+
);
|
|
300
|
+
const appendComponent = (items, component, exportName) => hasMatchingComponent(items, exportName) ? items || [] : [...items || [], component];
|
|
301
|
+
const attachStudioBackBreadcrumbToCollection = (collection) => {
|
|
302
|
+
if (!studioEnabled) {
|
|
303
|
+
return collection;
|
|
304
|
+
}
|
|
305
|
+
const existingBeforeDocumentControls = collection.admin?.components?.edit?.beforeDocumentControls;
|
|
306
|
+
return {
|
|
307
|
+
...collection,
|
|
308
|
+
admin: {
|
|
309
|
+
...collection.admin,
|
|
310
|
+
components: {
|
|
311
|
+
...collection.admin?.components,
|
|
312
|
+
edit: {
|
|
313
|
+
...collection.admin?.components?.edit,
|
|
314
|
+
beforeDocumentControls: appendComponent(
|
|
315
|
+
existingBeforeDocumentControls,
|
|
316
|
+
studioBackBreadcrumbComponent,
|
|
317
|
+
"StudioBackBreadcrumb"
|
|
318
|
+
)
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
};
|
|
323
|
+
};
|
|
244
324
|
return {
|
|
245
325
|
admin: {
|
|
246
326
|
css: cssPath,
|
|
@@ -249,15 +329,7 @@ function configureAdmin(config) {
|
|
|
249
329
|
Nav: {
|
|
250
330
|
exportName: "AdminStudioNav",
|
|
251
331
|
path: clientPath,
|
|
252
|
-
clientProps:
|
|
253
|
-
brandName,
|
|
254
|
-
logoUrl,
|
|
255
|
-
globalsBasePath: "/studio-globals",
|
|
256
|
-
globalsExtraMatchPrefixes: [contactFormStudioPath],
|
|
257
|
-
mediaCollectionSlug,
|
|
258
|
-
pagesCollectionSlug,
|
|
259
|
-
sections: studioSections
|
|
260
|
-
}
|
|
332
|
+
clientProps: studioNavClientProps
|
|
261
333
|
}
|
|
262
334
|
} : {},
|
|
263
335
|
graphics: {
|
|
@@ -283,37 +355,113 @@ function configureAdmin(config) {
|
|
|
283
355
|
Component: {
|
|
284
356
|
exportName: studioEnabled ? "AdminStudioDashboard" : "Dashboard",
|
|
285
357
|
path: clientPath,
|
|
286
|
-
clientProps:
|
|
287
|
-
brandName,
|
|
288
|
-
logoUrl,
|
|
289
|
-
globalsBasePath: "/studio-globals",
|
|
290
|
-
globalsExtraMatchPrefixes: [contactFormStudioPath],
|
|
291
|
-
mediaCollectionSlug,
|
|
292
|
-
pagesCollectionSlug,
|
|
293
|
-
sections: studioSections
|
|
294
|
-
}
|
|
358
|
+
clientProps: studioNavClientProps
|
|
295
359
|
}
|
|
296
360
|
},
|
|
297
361
|
...studioEnabled ? {
|
|
298
362
|
studioGlobals: {
|
|
299
|
-
path:
|
|
363
|
+
path: globalsBasePath,
|
|
300
364
|
Component: {
|
|
301
365
|
exportName: "AdminStudioGlobalsView",
|
|
302
366
|
path: clientPath,
|
|
303
367
|
clientProps: {
|
|
368
|
+
...studioNavClientProps,
|
|
304
369
|
globals,
|
|
305
|
-
globalsBasePath
|
|
370
|
+
globalsBasePath
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
},
|
|
374
|
+
studioPages: {
|
|
375
|
+
path: pagesBasePath,
|
|
376
|
+
Component: {
|
|
377
|
+
exportName: "AdminStudioPagesListView",
|
|
378
|
+
path: clientPath,
|
|
379
|
+
clientProps: {
|
|
380
|
+
...studioNavClientProps,
|
|
381
|
+
pagesCollectionSlug
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
},
|
|
385
|
+
studioPageEditor: {
|
|
386
|
+
path: `${pagesBasePath}/:id`,
|
|
387
|
+
Component: {
|
|
388
|
+
exportName: "AdminStudioPageEditView",
|
|
389
|
+
path: clientPath,
|
|
390
|
+
clientProps: {
|
|
391
|
+
...studioNavClientProps,
|
|
392
|
+
builderBasePath
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
},
|
|
396
|
+
studioPageNew: {
|
|
397
|
+
path: `${pagesBasePath}/new`,
|
|
398
|
+
Component: {
|
|
399
|
+
exportName: "AdminStudioNewPageView",
|
|
400
|
+
path: clientPath,
|
|
401
|
+
clientProps: {
|
|
402
|
+
...studioNavClientProps,
|
|
403
|
+
pagesCollectionSlug
|
|
306
404
|
}
|
|
307
405
|
}
|
|
308
406
|
},
|
|
309
407
|
studioContactForm: {
|
|
310
|
-
path:
|
|
408
|
+
path: contactFormStudioPath,
|
|
311
409
|
Component: {
|
|
312
410
|
exportName: "AdminStudioContactFormView",
|
|
313
411
|
path: clientPath,
|
|
314
412
|
clientProps: {
|
|
413
|
+
...studioNavClientProps,
|
|
315
414
|
globalSlug: "contact-form",
|
|
316
|
-
globalsBasePath
|
|
415
|
+
globalsBasePath
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
},
|
|
419
|
+
...formsEnabled ? {
|
|
420
|
+
studioForms: {
|
|
421
|
+
path: formsBasePath,
|
|
422
|
+
Component: {
|
|
423
|
+
exportName: "AdminStudioFormsView",
|
|
424
|
+
path: clientPath,
|
|
425
|
+
clientProps: {
|
|
426
|
+
...studioNavClientProps,
|
|
427
|
+
formsCollectionSlug,
|
|
428
|
+
formSubmissionsCollectionSlug,
|
|
429
|
+
formUploadsCollectionSlug
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
} : {},
|
|
434
|
+
studioMedia: {
|
|
435
|
+
path: mediaBasePath,
|
|
436
|
+
Component: {
|
|
437
|
+
exportName: "AdminStudioMediaView",
|
|
438
|
+
path: clientPath,
|
|
439
|
+
clientProps: {
|
|
440
|
+
...studioNavClientProps,
|
|
441
|
+
mediaCollectionSlug
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
},
|
|
445
|
+
studioMediaItem: {
|
|
446
|
+
path: `${mediaBasePath}/:id`,
|
|
447
|
+
Component: {
|
|
448
|
+
exportName: "AdminStudioMediaItemView",
|
|
449
|
+
path: clientPath,
|
|
450
|
+
clientProps: {
|
|
451
|
+
...studioNavClientProps,
|
|
452
|
+
mediaCollectionSlug
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
},
|
|
456
|
+
studioTools: {
|
|
457
|
+
path: toolsBasePath,
|
|
458
|
+
Component: {
|
|
459
|
+
exportName: "AdminStudioToolsView",
|
|
460
|
+
path: clientPath,
|
|
461
|
+
clientProps: {
|
|
462
|
+
...studioNavClientProps,
|
|
463
|
+
mediaCollectionSlug,
|
|
464
|
+
pagesCollectionSlug
|
|
317
465
|
}
|
|
318
466
|
}
|
|
319
467
|
},
|
|
@@ -322,7 +470,13 @@ function configureAdmin(config) {
|
|
|
322
470
|
id,
|
|
323
471
|
{
|
|
324
472
|
path: view.path,
|
|
325
|
-
Component:
|
|
473
|
+
Component: {
|
|
474
|
+
...view.Component,
|
|
475
|
+
clientProps: {
|
|
476
|
+
...studioNavClientProps,
|
|
477
|
+
...view.Component.clientProps || {}
|
|
478
|
+
}
|
|
479
|
+
}
|
|
326
480
|
}
|
|
327
481
|
])
|
|
328
482
|
)
|
|
@@ -333,19 +487,33 @@ function configureAdmin(config) {
|
|
|
333
487
|
exportName: "ThemeProvider",
|
|
334
488
|
path: clientPath,
|
|
335
489
|
clientProps: {
|
|
490
|
+
allowThemePreference,
|
|
336
491
|
defaultTheme
|
|
337
492
|
}
|
|
338
493
|
}
|
|
339
494
|
],
|
|
340
|
-
|
|
495
|
+
beforeLogin: [
|
|
341
496
|
{
|
|
342
|
-
exportName: "
|
|
497
|
+
exportName: "AdminLoginIntro",
|
|
343
498
|
path: clientPath,
|
|
344
499
|
clientProps: {
|
|
345
|
-
|
|
500
|
+
brandName,
|
|
501
|
+
logoUrl
|
|
346
502
|
}
|
|
347
503
|
}
|
|
348
|
-
]
|
|
504
|
+
],
|
|
505
|
+
...allowThemePreference ? {
|
|
506
|
+
afterNavLinks: [
|
|
507
|
+
{
|
|
508
|
+
exportName: "ThemeSwitcher",
|
|
509
|
+
path: clientPath,
|
|
510
|
+
clientProps: {
|
|
511
|
+
allowThemePreference,
|
|
512
|
+
defaultTheme
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
]
|
|
516
|
+
} : {}
|
|
349
517
|
},
|
|
350
518
|
meta: {
|
|
351
519
|
titleSuffix: ` \u2014 ${brandName}`
|
|
@@ -360,11 +528,77 @@ function configureAdmin(config) {
|
|
|
360
528
|
const hasThemePreference = existingFields.some(
|
|
361
529
|
(field) => typeof field === "object" && field !== null && "name" in field && field.name === "themePreference"
|
|
362
530
|
);
|
|
363
|
-
|
|
531
|
+
const nextCollection = {
|
|
364
532
|
...usersCollection,
|
|
365
|
-
fields: hasThemePreference ? existingFields : [...existingFields, createThemePreferenceField(defaultTheme)]
|
|
533
|
+
fields: !allowThemePreference || hasThemePreference ? existingFields : [...existingFields, createThemePreferenceField(defaultTheme)]
|
|
534
|
+
};
|
|
535
|
+
return attachStudioBackBreadcrumbToCollection(nextCollection);
|
|
536
|
+
},
|
|
537
|
+
wrapPagesCollection(pagesCollection) {
|
|
538
|
+
if (!studioEnabled) {
|
|
539
|
+
return pagesCollection;
|
|
540
|
+
}
|
|
541
|
+
const collectionWithBreadcrumb = attachStudioBackBreadcrumbToCollection(pagesCollection);
|
|
542
|
+
const existingEditMenuItems = collectionWithBreadcrumb.admin?.components?.edit?.editMenuItems;
|
|
543
|
+
const existingViews = collectionWithBreadcrumb.admin?.components?.views;
|
|
544
|
+
const existingEditViews = existingViews?.edit;
|
|
545
|
+
const hasCustomEditView = Boolean(
|
|
546
|
+
existingEditViews?.root || existingEditViews?.default && typeof existingEditViews.default === "object" && existingEditViews.default.Component
|
|
547
|
+
);
|
|
548
|
+
return {
|
|
549
|
+
...collectionWithBreadcrumb,
|
|
550
|
+
admin: {
|
|
551
|
+
...collectionWithBreadcrumb.admin,
|
|
552
|
+
components: {
|
|
553
|
+
...collectionWithBreadcrumb.admin?.components,
|
|
554
|
+
edit: {
|
|
555
|
+
...collectionWithBreadcrumb.admin?.components?.edit,
|
|
556
|
+
editMenuItems: appendComponent(
|
|
557
|
+
existingEditMenuItems,
|
|
558
|
+
{
|
|
559
|
+
exportName: "OpenInStudioMenuItem",
|
|
560
|
+
path: clientPath,
|
|
561
|
+
clientProps: {
|
|
562
|
+
pagesPathBase: pagesBasePath
|
|
563
|
+
}
|
|
564
|
+
},
|
|
565
|
+
"OpenInStudioMenuItem"
|
|
566
|
+
)
|
|
567
|
+
},
|
|
568
|
+
views: {
|
|
569
|
+
...existingViews,
|
|
570
|
+
...hasCustomEditView ? {} : {
|
|
571
|
+
edit: {
|
|
572
|
+
...existingEditViews,
|
|
573
|
+
default: {
|
|
574
|
+
...typeof existingEditViews?.default === "object" ? existingEditViews.default : {},
|
|
575
|
+
Component: {
|
|
576
|
+
exportName: "PageEditRedirectToStudio",
|
|
577
|
+
path: clientPath,
|
|
578
|
+
clientProps: {
|
|
579
|
+
pagesPathBase: pagesBasePath
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
}
|
|
366
588
|
};
|
|
367
589
|
},
|
|
590
|
+
wrapMediaCollection(mediaCollection) {
|
|
591
|
+
return attachStudioBackBreadcrumbToCollection(mediaCollection);
|
|
592
|
+
},
|
|
593
|
+
wrapFormsCollection(formsCollection) {
|
|
594
|
+
return attachStudioBackBreadcrumbToCollection(formsCollection);
|
|
595
|
+
},
|
|
596
|
+
wrapFormSubmissionsCollection(formSubmissionsCollection) {
|
|
597
|
+
return attachStudioBackBreadcrumbToCollection(formSubmissionsCollection);
|
|
598
|
+
},
|
|
599
|
+
wrapFormUploadsCollection(formUploadsCollection) {
|
|
600
|
+
return attachStudioBackBreadcrumbToCollection(formUploadsCollection);
|
|
601
|
+
},
|
|
368
602
|
wrapGlobals(globals2) {
|
|
369
603
|
const labelMap = {
|
|
370
604
|
header: { group: "Site Design", label: "Header & Navigation" },
|
|
@@ -376,25 +610,110 @@ function configureAdmin(config) {
|
|
|
376
610
|
return globals2.map((global) => {
|
|
377
611
|
const mapping = labelMap[global.slug];
|
|
378
612
|
if (!mapping) return global;
|
|
613
|
+
const shouldAttachSiteSettingsEditView = studioEnabled && global.slug === "site-settings";
|
|
614
|
+
const shouldAttachSocialMediaEditView = studioEnabled && global.slug === "social-media";
|
|
379
615
|
const shouldAttachContactFormRedirect = studioEnabled && global.slug === "contact-form";
|
|
616
|
+
const shouldAttachHeaderEditView = studioEnabled && global.slug === "header";
|
|
617
|
+
const shouldAttachFooterEditView = studioEnabled && global.slug === "footer";
|
|
380
618
|
const existingViews = global.admin?.components?.views;
|
|
381
619
|
const existingEditViews = existingViews?.edit;
|
|
382
|
-
const
|
|
620
|
+
const hasCustomEditView = Boolean(
|
|
383
621
|
existingEditViews?.root || existingEditViews?.default && typeof existingEditViews.default === "object" && existingEditViews.default.Component
|
|
384
622
|
);
|
|
385
|
-
const
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
623
|
+
const nextEditViews = (() => {
|
|
624
|
+
if (shouldAttachSiteSettingsEditView && !hasCustomEditView) {
|
|
625
|
+
return {
|
|
626
|
+
...existingEditViews,
|
|
627
|
+
default: {
|
|
628
|
+
...typeof existingEditViews?.default === "object" ? existingEditViews.default : {},
|
|
629
|
+
Component: {
|
|
630
|
+
exportName: "AdminStudioSiteSettingsGlobalView",
|
|
631
|
+
path: clientPath,
|
|
632
|
+
clientProps: {
|
|
633
|
+
...studioNavClientProps,
|
|
634
|
+
globalSlug: global.slug,
|
|
635
|
+
mediaCollectionSlug
|
|
636
|
+
}
|
|
637
|
+
}
|
|
394
638
|
}
|
|
395
|
-
}
|
|
639
|
+
};
|
|
640
|
+
}
|
|
641
|
+
if (shouldAttachSocialMediaEditView && !hasCustomEditView) {
|
|
642
|
+
return {
|
|
643
|
+
...existingEditViews,
|
|
644
|
+
default: {
|
|
645
|
+
...typeof existingEditViews?.default === "object" ? existingEditViews.default : {},
|
|
646
|
+
Component: {
|
|
647
|
+
exportName: "AdminStudioSocialMediaGlobalView",
|
|
648
|
+
path: clientPath,
|
|
649
|
+
clientProps: {
|
|
650
|
+
...studioNavClientProps,
|
|
651
|
+
globalSlug: global.slug
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
};
|
|
656
|
+
}
|
|
657
|
+
if (shouldAttachHeaderEditView && !hasCustomEditView) {
|
|
658
|
+
return {
|
|
659
|
+
...existingEditViews,
|
|
660
|
+
default: {
|
|
661
|
+
...typeof existingEditViews?.default === "object" ? existingEditViews.default : {},
|
|
662
|
+
Component: {
|
|
663
|
+
exportName: "AdminStudioHeaderGlobalView",
|
|
664
|
+
path: clientPath,
|
|
665
|
+
clientProps: {
|
|
666
|
+
...studioNavClientProps,
|
|
667
|
+
actionHref: sitePreview?.header?.actionHref,
|
|
668
|
+
actionLabel: sitePreview?.header?.actionLabel,
|
|
669
|
+
globalSlug: global.slug,
|
|
670
|
+
locationSummary: sitePreview?.locationSummary,
|
|
671
|
+
pagesCollectionSlug
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
};
|
|
676
|
+
}
|
|
677
|
+
if (shouldAttachFooterEditView && !hasCustomEditView) {
|
|
678
|
+
return {
|
|
679
|
+
...existingEditViews,
|
|
680
|
+
default: {
|
|
681
|
+
...typeof existingEditViews?.default === "object" ? existingEditViews.default : {},
|
|
682
|
+
Component: {
|
|
683
|
+
exportName: "AdminStudioFooterGlobalView",
|
|
684
|
+
path: clientPath,
|
|
685
|
+
clientProps: {
|
|
686
|
+
...studioNavClientProps,
|
|
687
|
+
builtByHref: sitePreview?.footer?.builtByHref,
|
|
688
|
+
builtByLabel: sitePreview?.footer?.builtByLabel,
|
|
689
|
+
description: sitePreview?.footer?.description,
|
|
690
|
+
footerCategories: sitePreview?.footer?.footerCategories,
|
|
691
|
+
footerLinks: sitePreview?.footer?.footerLinks,
|
|
692
|
+
globalSlug: global.slug,
|
|
693
|
+
locationSummary: sitePreview?.locationSummary
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
};
|
|
698
|
+
}
|
|
699
|
+
if (shouldAttachContactFormRedirect && !hasCustomEditView) {
|
|
700
|
+
return {
|
|
701
|
+
...existingEditViews,
|
|
702
|
+
default: {
|
|
703
|
+
...typeof existingEditViews?.default === "object" ? existingEditViews.default : {},
|
|
704
|
+
Component: {
|
|
705
|
+
exportName: "StudioContactFormRedirect",
|
|
706
|
+
path: clientPath,
|
|
707
|
+
clientProps: {
|
|
708
|
+
studioContactFormPath: contactFormStudioPath
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
};
|
|
396
713
|
}
|
|
397
|
-
|
|
714
|
+
return existingEditViews;
|
|
715
|
+
})();
|
|
716
|
+
const existingBeforeDocumentControls = global.admin?.components?.elements?.beforeDocumentControls;
|
|
398
717
|
return {
|
|
399
718
|
...global,
|
|
400
719
|
admin: {
|
|
@@ -402,12 +721,18 @@ function configureAdmin(config) {
|
|
|
402
721
|
group: mapping.group,
|
|
403
722
|
components: {
|
|
404
723
|
...global.admin?.components,
|
|
405
|
-
|
|
724
|
+
elements: {
|
|
725
|
+
...global.admin?.components?.elements,
|
|
726
|
+
beforeDocumentControls: studioEnabled ? appendComponent(
|
|
727
|
+
existingBeforeDocumentControls,
|
|
728
|
+
studioBackBreadcrumbComponent,
|
|
729
|
+
"StudioBackBreadcrumb"
|
|
730
|
+
) : existingBeforeDocumentControls
|
|
731
|
+
},
|
|
732
|
+
...nextEditViews ? {
|
|
406
733
|
views: {
|
|
407
734
|
...existingViews,
|
|
408
|
-
|
|
409
|
-
edit: contactFormEditViews
|
|
410
|
-
} : {}
|
|
735
|
+
edit: nextEditViews
|
|
411
736
|
}
|
|
412
737
|
} : {}
|
|
413
738
|
}
|
package/dist/admin/index.mjs
CHANGED
|
@@ -7,7 +7,8 @@ import {
|
|
|
7
7
|
socialMediaConnectionsField,
|
|
8
8
|
themePreferenceField,
|
|
9
9
|
withTooltips
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-Q2HGC67S.mjs";
|
|
11
|
+
import "../chunk-W2UOCJDX.mjs";
|
|
11
12
|
import {
|
|
12
13
|
SOCIAL_MEDIA_DEFAULT_ICON_BY_PLATFORM,
|
|
13
14
|
SOCIAL_MEDIA_ICON_OPTIONS,
|
|
@@ -5,3 +5,4 @@ export { MediaDetailPanel } from './components/MediaDetailPanel'
|
|
|
5
5
|
export { MediaListItem } from './components/MediaListItem'
|
|
6
6
|
export { MediaUploadForm } from './components/MediaUploadForm'
|
|
7
7
|
export { PageEditorFrame } from './components/PageEditorFrame'
|
|
8
|
+
export { SiteFooterPreview, SiteHeaderPreview } from './components/SitePreview'
|
|
@@ -5,3 +5,4 @@ export { MediaDetailPanel } from './components/MediaDetailPanel'
|
|
|
5
5
|
export { MediaListItem } from './components/MediaListItem'
|
|
6
6
|
export { MediaUploadForm } from './components/MediaUploadForm'
|
|
7
7
|
export { PageEditorFrame } from './components/PageEditorFrame'
|
|
8
|
+
export { SiteFooterPreview, SiteHeaderPreview } from './components/SitePreview'
|