@orion-studios/payload-studio 0.6.0-beta.2 → 0.6.0-beta.20
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/dist/admin/client.d.mts +1 -1
- package/dist/admin/client.d.ts +1 -1
- package/dist/admin/client.js +4485 -2425
- package/dist/admin/client.mjs +3870 -1816
- package/dist/admin/index.d.mts +2 -2
- package/dist/admin/index.d.ts +2 -2
- package/dist/admin/index.js +116 -5
- package/dist/admin/index.mjs +1 -1
- package/dist/admin-app/index.d.mts +2 -2
- package/dist/admin-app/index.d.ts +2 -2
- package/dist/admin-app/styles.css +466 -41
- package/dist/admin.css +18 -2
- package/dist/{chunk-QJAWO6K3.mjs → chunk-3AHBR7RI.mjs} +116 -5
- package/dist/{chunk-PF3EBZXF.mjs → chunk-4LSIUED5.mjs} +7 -2
- package/dist/{chunk-XKUTZ7IU.mjs → chunk-EDW7DPXW.mjs} +1 -1
- package/dist/{chunk-OTHERBGX.mjs → chunk-H4GTEY24.mjs} +1 -1
- package/dist/index-BV0vEGl6.d.ts +188 -0
- package/dist/{index-52HdVLQq.d.ts → index-DAdN56fM.d.ts} +1 -1
- package/dist/index-DLfPOqYA.d.mts +188 -0
- package/dist/{index-DEQC3Dwj.d.mts → index-G_uTNffQ.d.mts} +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +123 -7
- package/dist/index.mjs +4 -4
- package/dist/nextjs/index.js +7 -2
- package/dist/nextjs/index.mjs +2 -2
- package/dist/{sitePreviewTypes-BkHCWxNW.d.mts → sitePreviewTypes-BrJwGzJj.d.mts} +1 -1
- package/dist/{sitePreviewTypes-BkHCWxNW.d.ts → sitePreviewTypes-BrJwGzJj.d.ts} +1 -1
- package/dist/studio-pages/builder.css +18 -5
- package/dist/studio-pages/client.js +11 -3
- package/dist/studio-pages/client.mjs +11 -3
- package/dist/studio-pages/index.js +7 -2
- package/dist/studio-pages/index.mjs +2 -2
- package/package.json +1 -1
- package/dist/index-B6_D4Hm4.d.ts +0 -439
- package/dist/index-CYaWadBl.d.mts +0 -439
package/dist/admin/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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,
|
|
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 ResolvedStudioDashboardPanel, f as ResolvedStudioSection, S as StudioDashboardPanel, g as StudioDashboardPanelSpan, h as StudioGlobalLink, j as StudioSection, k as StudioSectionCard, l as StudioSectionComponent, m as StudioSectionRole, n as StudioSectionView, o as configureAdmin, p as createHeaderNavItemsField, q as createSocialMediaConnectionsField, r as createSocialMediaGlobal, s as createThemePreferenceField, t as socialMediaConnectionsField, u as themePreferenceField, w as withTooltips } from '../index-DLfPOqYA.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-
|
|
4
|
+
import '../sitePreviewTypes-BrJwGzJj.mjs';
|
package/dist/admin/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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,
|
|
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 ResolvedStudioDashboardPanel, f as ResolvedStudioSection, S as StudioDashboardPanel, g as StudioDashboardPanelSpan, h as StudioGlobalLink, j as StudioSection, k as StudioSectionCard, l as StudioSectionComponent, m as StudioSectionRole, n as StudioSectionView, o as configureAdmin, p as createHeaderNavItemsField, q as createSocialMediaConnectionsField, r as createSocialMediaGlobal, s as createThemePreferenceField, t as socialMediaConnectionsField, u as themePreferenceField, w as withTooltips } from '../index-BV0vEGl6.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-
|
|
4
|
+
import '../sitePreviewTypes-BrJwGzJj.js';
|
package/dist/admin/index.js
CHANGED
|
@@ -81,7 +81,7 @@ var adminNavIcons = [
|
|
|
81
81
|
];
|
|
82
82
|
|
|
83
83
|
// src/shared/studioSections.ts
|
|
84
|
-
var studioRoles = /* @__PURE__ */ new Set(["admin", "editor", "client"]);
|
|
84
|
+
var studioRoles = /* @__PURE__ */ new Set(["admin", "developer", "editor", "client"]);
|
|
85
85
|
var studioIcons = new Set(adminNavIcons);
|
|
86
86
|
var isRecord = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
87
87
|
var isAbsoluteExternalURL = (value) => /^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(value) || value.startsWith("//");
|
|
@@ -215,8 +215,10 @@ function configureAdmin(config) {
|
|
|
215
215
|
brandPrimary = "#3b82f6",
|
|
216
216
|
brandSecondary = "#8b5cf6",
|
|
217
217
|
defaultTheme = "brand-light",
|
|
218
|
+
logoOnDarkUrl,
|
|
218
219
|
logoUrl,
|
|
219
|
-
allowThemePreference = false
|
|
220
|
+
allowThemePreference = false,
|
|
221
|
+
userSessionDurationSeconds = 60 * 60 * 24
|
|
220
222
|
} = config;
|
|
221
223
|
const studioEnabled = config.studio?.enabled ?? true;
|
|
222
224
|
const formsEnabled = config.studio?.forms?.enabled ?? false;
|
|
@@ -321,6 +323,49 @@ function configureAdmin(config) {
|
|
|
321
323
|
}
|
|
322
324
|
};
|
|
323
325
|
};
|
|
326
|
+
const attachStudioEditRedirectToCollection = (collection, options) => {
|
|
327
|
+
if (!studioEnabled) {
|
|
328
|
+
return collection;
|
|
329
|
+
}
|
|
330
|
+
const collectionWithBreadcrumb = attachStudioBackBreadcrumbToCollection(collection);
|
|
331
|
+
const existingViews = collectionWithBreadcrumb.admin?.components?.views;
|
|
332
|
+
const existingEditViews = existingViews?.edit;
|
|
333
|
+
const hasCustomEditView = Boolean(
|
|
334
|
+
existingEditViews?.root || existingEditViews?.default && typeof existingEditViews.default === "object" && existingEditViews.default.Component
|
|
335
|
+
);
|
|
336
|
+
if (hasCustomEditView) {
|
|
337
|
+
return collectionWithBreadcrumb;
|
|
338
|
+
}
|
|
339
|
+
return {
|
|
340
|
+
...collectionWithBreadcrumb,
|
|
341
|
+
admin: {
|
|
342
|
+
...collectionWithBreadcrumb.admin,
|
|
343
|
+
components: {
|
|
344
|
+
...collectionWithBreadcrumb.admin?.components,
|
|
345
|
+
views: {
|
|
346
|
+
...existingViews,
|
|
347
|
+
edit: {
|
|
348
|
+
...existingEditViews,
|
|
349
|
+
default: {
|
|
350
|
+
...typeof existingEditViews?.default === "object" ? existingEditViews.default : {},
|
|
351
|
+
Component: {
|
|
352
|
+
exportName: "StudioDocumentRedirect",
|
|
353
|
+
path: clientPath,
|
|
354
|
+
clientProps: {
|
|
355
|
+
description: options.description,
|
|
356
|
+
...options.emptyHref ? { emptyHref: options.emptyHref } : {},
|
|
357
|
+
...options.emptyLabel ? { emptyLabel: options.emptyLabel } : {},
|
|
358
|
+
pathBase: options.pathBase,
|
|
359
|
+
title: options.title
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
};
|
|
368
|
+
};
|
|
324
369
|
return {
|
|
325
370
|
admin: {
|
|
326
371
|
css: cssPath,
|
|
@@ -338,6 +383,7 @@ function configureAdmin(config) {
|
|
|
338
383
|
path: clientPath,
|
|
339
384
|
clientProps: {
|
|
340
385
|
brandName,
|
|
386
|
+
logoOnDarkUrl,
|
|
341
387
|
logoUrl
|
|
342
388
|
}
|
|
343
389
|
},
|
|
@@ -346,6 +392,7 @@ function configureAdmin(config) {
|
|
|
346
392
|
path: clientPath,
|
|
347
393
|
clientProps: {
|
|
348
394
|
brandName,
|
|
395
|
+
logoOnDarkUrl,
|
|
349
396
|
logoUrl
|
|
350
397
|
}
|
|
351
398
|
}
|
|
@@ -429,6 +476,42 @@ function configureAdmin(config) {
|
|
|
429
476
|
formUploadsCollectionSlug
|
|
430
477
|
}
|
|
431
478
|
}
|
|
479
|
+
},
|
|
480
|
+
studioFormSubmission: {
|
|
481
|
+
path: `${formsBasePath}/submissions/:id`,
|
|
482
|
+
Component: {
|
|
483
|
+
exportName: "AdminStudioFormSubmissionView",
|
|
484
|
+
path: clientPath,
|
|
485
|
+
clientProps: {
|
|
486
|
+
...studioNavClientProps,
|
|
487
|
+
formsCollectionSlug,
|
|
488
|
+
formSubmissionsCollectionSlug,
|
|
489
|
+
formUploadsCollectionSlug
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
},
|
|
493
|
+
studioFormUpload: {
|
|
494
|
+
path: `${formsBasePath}/uploads/:id`,
|
|
495
|
+
Component: {
|
|
496
|
+
exportName: "AdminStudioFormUploadView",
|
|
497
|
+
path: clientPath,
|
|
498
|
+
clientProps: {
|
|
499
|
+
...studioNavClientProps,
|
|
500
|
+
formUploadsCollectionSlug
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
},
|
|
504
|
+
studioFormDetail: {
|
|
505
|
+
path: `${formsBasePath}/:id`,
|
|
506
|
+
Component: {
|
|
507
|
+
exportName: "AdminStudioFormDetailView",
|
|
508
|
+
path: clientPath,
|
|
509
|
+
clientProps: {
|
|
510
|
+
...studioNavClientProps,
|
|
511
|
+
formsCollectionSlug,
|
|
512
|
+
formSubmissionsCollectionSlug
|
|
513
|
+
}
|
|
514
|
+
}
|
|
432
515
|
}
|
|
433
516
|
} : {},
|
|
434
517
|
studioMedia: {
|
|
@@ -498,6 +581,7 @@ function configureAdmin(config) {
|
|
|
498
581
|
path: clientPath,
|
|
499
582
|
clientProps: {
|
|
500
583
|
brandName,
|
|
584
|
+
logoOnDarkUrl,
|
|
501
585
|
logoUrl
|
|
502
586
|
}
|
|
503
587
|
}
|
|
@@ -534,8 +618,17 @@ function configureAdmin(config) {
|
|
|
534
618
|
const hasThemePreference = existingFields.some(
|
|
535
619
|
(field) => typeof field === "object" && field !== null && "name" in field && field.name === "themePreference"
|
|
536
620
|
);
|
|
621
|
+
const normalizedAuth = usersCollection.auth === true ? {
|
|
622
|
+
tokenExpiration: userSessionDurationSeconds,
|
|
623
|
+
useSessions: true
|
|
624
|
+
} : usersCollection.auth && typeof usersCollection.auth === "object" ? {
|
|
625
|
+
...usersCollection.auth,
|
|
626
|
+
tokenExpiration: usersCollection.auth.tokenExpiration ?? userSessionDurationSeconds,
|
|
627
|
+
useSessions: usersCollection.auth.useSessions ?? true
|
|
628
|
+
} : usersCollection.auth;
|
|
537
629
|
const nextCollection = {
|
|
538
630
|
...usersCollection,
|
|
631
|
+
auth: normalizedAuth,
|
|
539
632
|
fields: !allowThemePreference || hasThemePreference ? existingFields : [...existingFields, createThemePreferenceField(defaultTheme)]
|
|
540
633
|
};
|
|
541
634
|
return attachStudioBackBreadcrumbToCollection(nextCollection);
|
|
@@ -597,13 +690,31 @@ function configureAdmin(config) {
|
|
|
597
690
|
return attachStudioBackBreadcrumbToCollection(mediaCollection);
|
|
598
691
|
},
|
|
599
692
|
wrapFormsCollection(formsCollection) {
|
|
600
|
-
return
|
|
693
|
+
return attachStudioEditRedirectToCollection(formsCollection, {
|
|
694
|
+
description: "Redirecting to the Studio form workspace.",
|
|
695
|
+
emptyHref: formsBasePath,
|
|
696
|
+
emptyLabel: "Open Forms",
|
|
697
|
+
pathBase: formsBasePath,
|
|
698
|
+
title: "Opening Form..."
|
|
699
|
+
});
|
|
601
700
|
},
|
|
602
701
|
wrapFormSubmissionsCollection(formSubmissionsCollection) {
|
|
603
|
-
return
|
|
702
|
+
return attachStudioEditRedirectToCollection(formSubmissionsCollection, {
|
|
703
|
+
description: "Redirecting to the Studio submission workspace.",
|
|
704
|
+
emptyHref: formsBasePath,
|
|
705
|
+
emptyLabel: "Open Forms",
|
|
706
|
+
pathBase: `${formsBasePath}/submissions`,
|
|
707
|
+
title: "Opening Submission..."
|
|
708
|
+
});
|
|
604
709
|
},
|
|
605
710
|
wrapFormUploadsCollection(formUploadsCollection) {
|
|
606
|
-
return
|
|
711
|
+
return attachStudioEditRedirectToCollection(formUploadsCollection, {
|
|
712
|
+
description: "Redirecting to the Studio upload workspace.",
|
|
713
|
+
emptyHref: formsBasePath,
|
|
714
|
+
emptyLabel: "Open Forms",
|
|
715
|
+
pathBase: `${formsBasePath}/uploads`,
|
|
716
|
+
title: "Opening Upload..."
|
|
717
|
+
});
|
|
607
718
|
},
|
|
608
719
|
wrapGlobals(globals2) {
|
|
609
720
|
const labelMap = {
|
package/dist/admin/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as AdminBreadcrumbs, a as AdminNavInput, b as AdminNavLinkItem, c as AdminPage, d as AdminPageLinkOption, e as AdminPageRecord, M as MediaDetailPanelProps, f as MediaListItemProps, N as NestedNavItem, g as NestedNavItemInput, h as NestedNavTree, j as buildAdminPageLinkOptions, k as buildNestedNavTree, l as getAdminNavRows, n as normalizeAdminNavInputs, m as normalizeNestedNavItems, p as parseAdminHeaderNavFromForm } from '../index-
|
|
2
|
-
export { A as AdminBreadcrumbItem, a as AdminNavIcon, b as AdminNavItem, c as AdminRole, S as SiteFooterPreviewData, d as SiteHeaderPreviewData, e as SitePreviewLink, f as SitePreviewLocationSummary, g as SitePreviewSocialLink, n as navItemIsActive, r as roleCanAccessNav } from '../sitePreviewTypes-
|
|
1
|
+
export { A as AdminBreadcrumbs, a as AdminNavInput, b as AdminNavLinkItem, c as AdminPage, d as AdminPageLinkOption, e as AdminPageRecord, M as MediaDetailPanelProps, f as MediaListItemProps, N as NestedNavItem, g as NestedNavItemInput, h as NestedNavTree, j as buildAdminPageLinkOptions, k as buildNestedNavTree, l as getAdminNavRows, n as normalizeAdminNavInputs, m as normalizeNestedNavItems, p as parseAdminHeaderNavFromForm } from '../index-G_uTNffQ.mjs';
|
|
2
|
+
export { A as AdminBreadcrumbItem, a as AdminNavIcon, b as AdminNavItem, c as AdminRole, S as SiteFooterPreviewData, d as SiteHeaderPreviewData, e as SitePreviewLink, f as SitePreviewLocationSummary, g as SitePreviewSocialLink, n as navItemIsActive, r as roleCanAccessNav } from '../sitePreviewTypes-BrJwGzJj.mjs';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import 'react';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as AdminBreadcrumbs, a as AdminNavInput, b as AdminNavLinkItem, c as AdminPage, d as AdminPageLinkOption, e as AdminPageRecord, M as MediaDetailPanelProps, f as MediaListItemProps, N as NestedNavItem, g as NestedNavItemInput, h as NestedNavTree, j as buildAdminPageLinkOptions, k as buildNestedNavTree, l as getAdminNavRows, n as normalizeAdminNavInputs, m as normalizeNestedNavItems, p as parseAdminHeaderNavFromForm } from '../index-
|
|
2
|
-
export { A as AdminBreadcrumbItem, a as AdminNavIcon, b as AdminNavItem, c as AdminRole, S as SiteFooterPreviewData, d as SiteHeaderPreviewData, e as SitePreviewLink, f as SitePreviewLocationSummary, g as SitePreviewSocialLink, n as navItemIsActive, r as roleCanAccessNav } from '../sitePreviewTypes-
|
|
1
|
+
export { A as AdminBreadcrumbs, a as AdminNavInput, b as AdminNavLinkItem, c as AdminPage, d as AdminPageLinkOption, e as AdminPageRecord, M as MediaDetailPanelProps, f as MediaListItemProps, N as NestedNavItem, g as NestedNavItemInput, h as NestedNavTree, j as buildAdminPageLinkOptions, k as buildNestedNavTree, l as getAdminNavRows, n as normalizeAdminNavInputs, m as normalizeNestedNavItems, p as parseAdminHeaderNavFromForm } from '../index-DAdN56fM.js';
|
|
2
|
+
export { A as AdminBreadcrumbItem, a as AdminNavIcon, b as AdminNavItem, c as AdminRole, S as SiteFooterPreviewData, d as SiteHeaderPreviewData, e as SitePreviewLink, f as SitePreviewLocationSummary, g as SitePreviewSocialLink, n as navItemIsActive, r as roleCanAccessNav } from '../sitePreviewTypes-BrJwGzJj.js';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import 'react';
|