@orion-studios/payload-studio 0.6.0-beta.3 → 0.6.0-beta.31
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 +4160 -1732
- package/dist/admin/client.mjs +4240 -1818
- package/dist/admin/index.d.mts +2 -2
- package/dist/admin/index.d.ts +2 -2
- package/dist/admin/index.js +140 -17
- 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 +705 -41
- package/dist/admin.css +18 -2
- 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/{chunk-QJAWO6K3.mjs → chunk-JC3UV74N.mjs} +140 -17
- 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 +147 -19
- 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 +24 -5
- package/dist/studio-pages/client.js +374 -54
- package/dist/studio-pages/client.mjs +374 -54
- 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
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { Field, CollectionConfig, GlobalConfig } from 'payload';
|
|
2
|
+
import { a as AdminNavIcon, e as SitePreviewLink, f as SitePreviewLocationSummary } from './sitePreviewTypes-BrJwGzJj.mjs';
|
|
3
|
+
import { a as SocialMediaPlatform, 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, h as SocialMediaProfileData, i as SocialMediaProfilesData } from './socialMedia-C05Iy-SV.mjs';
|
|
4
|
+
|
|
5
|
+
type ThemeOption = 'light' | 'dark' | 'brand-light' | 'brand-dark';
|
|
6
|
+
declare const createThemePreferenceField: (defaultTheme?: ThemeOption) => Field;
|
|
7
|
+
declare const themePreferenceField: Field;
|
|
8
|
+
|
|
9
|
+
type StudioSectionRole = 'admin' | 'developer' | 'editor' | 'client';
|
|
10
|
+
type StudioSectionCard = {
|
|
11
|
+
description?: string;
|
|
12
|
+
title: string;
|
|
13
|
+
};
|
|
14
|
+
type StudioSectionComponent = {
|
|
15
|
+
clientProps?: Record<string, unknown>;
|
|
16
|
+
exportName: string;
|
|
17
|
+
path: string;
|
|
18
|
+
};
|
|
19
|
+
type StudioSectionView = {
|
|
20
|
+
Component: StudioSectionComponent;
|
|
21
|
+
path: string;
|
|
22
|
+
};
|
|
23
|
+
type StudioDashboardPanelSpan = 'full' | 'half';
|
|
24
|
+
type StudioDashboardPanel = {
|
|
25
|
+
Component: StudioSectionComponent;
|
|
26
|
+
priority?: number;
|
|
27
|
+
roles?: StudioSectionRole[];
|
|
28
|
+
span?: StudioDashboardPanelSpan;
|
|
29
|
+
};
|
|
30
|
+
type StudioSection = {
|
|
31
|
+
card?: StudioSectionCard;
|
|
32
|
+
dashboard?: StudioDashboardPanel;
|
|
33
|
+
href?: string;
|
|
34
|
+
id: string;
|
|
35
|
+
icon?: AdminNavIcon;
|
|
36
|
+
label: string;
|
|
37
|
+
matchPrefixes?: string[];
|
|
38
|
+
roles?: StudioSectionRole[];
|
|
39
|
+
view?: StudioSectionView;
|
|
40
|
+
};
|
|
41
|
+
type ResolvedStudioSection = {
|
|
42
|
+
card?: StudioSectionCard;
|
|
43
|
+
href: string;
|
|
44
|
+
id: string;
|
|
45
|
+
icon?: AdminNavIcon;
|
|
46
|
+
label: string;
|
|
47
|
+
matchPrefixes: string[];
|
|
48
|
+
roles?: StudioSectionRole[];
|
|
49
|
+
};
|
|
50
|
+
type ResolvedStudioDashboardPanel = {
|
|
51
|
+
Component: StudioSectionComponent;
|
|
52
|
+
href: string;
|
|
53
|
+
id: string;
|
|
54
|
+
label: string;
|
|
55
|
+
priority: number;
|
|
56
|
+
roles?: StudioSectionRole[];
|
|
57
|
+
span: StudioDashboardPanelSpan;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
type StudioGlobalLink = {
|
|
61
|
+
description?: string;
|
|
62
|
+
href?: string;
|
|
63
|
+
label: string;
|
|
64
|
+
slug: string;
|
|
65
|
+
};
|
|
66
|
+
type AdminStudioHeaderPreviewConfig = {
|
|
67
|
+
actionHref?: string;
|
|
68
|
+
actionLabel?: string;
|
|
69
|
+
};
|
|
70
|
+
type AdminStudioFooterPreviewConfig = {
|
|
71
|
+
builtByHref?: string;
|
|
72
|
+
builtByLabel?: string;
|
|
73
|
+
description?: string;
|
|
74
|
+
footerCategories?: string[];
|
|
75
|
+
footerLinks?: SitePreviewLink[];
|
|
76
|
+
};
|
|
77
|
+
type AdminStudioSitePreviewConfig = {
|
|
78
|
+
footer?: AdminStudioFooterPreviewConfig;
|
|
79
|
+
header?: AdminStudioHeaderPreviewConfig;
|
|
80
|
+
locationSummary?: SitePreviewLocationSummary;
|
|
81
|
+
};
|
|
82
|
+
interface AdminStudioConfig {
|
|
83
|
+
enabled?: boolean;
|
|
84
|
+
forms?: {
|
|
85
|
+
collectionSlug?: string;
|
|
86
|
+
enabled?: boolean;
|
|
87
|
+
submissionsCollectionSlug?: string;
|
|
88
|
+
uploadsCollectionSlug?: string;
|
|
89
|
+
};
|
|
90
|
+
globals?: StudioGlobalLink[];
|
|
91
|
+
media?: {
|
|
92
|
+
collectionSlug?: string;
|
|
93
|
+
};
|
|
94
|
+
pages?: {
|
|
95
|
+
builderBasePath?: string;
|
|
96
|
+
collectionSlug?: string;
|
|
97
|
+
};
|
|
98
|
+
sitePreview?: AdminStudioSitePreviewConfig;
|
|
99
|
+
sections?: StudioSection[];
|
|
100
|
+
}
|
|
101
|
+
interface AdminConfig {
|
|
102
|
+
allowThemePreference?: boolean;
|
|
103
|
+
brandName: string;
|
|
104
|
+
brandPrimary?: string;
|
|
105
|
+
brandSecondary?: string;
|
|
106
|
+
defaultTheme?: ThemeOption;
|
|
107
|
+
logoOnDarkUrl?: string;
|
|
108
|
+
logoUrl?: string;
|
|
109
|
+
basePath?: string;
|
|
110
|
+
studio?: AdminStudioConfig;
|
|
111
|
+
userSessionDurationSeconds?: number;
|
|
112
|
+
}
|
|
113
|
+
type ConfiguredAdmin = {
|
|
114
|
+
admin: Record<string, unknown>;
|
|
115
|
+
brandName: string;
|
|
116
|
+
brandPrimary: string;
|
|
117
|
+
brandSecondary: string;
|
|
118
|
+
defaultTheme: ThemeOption;
|
|
119
|
+
wrapUsers(usersCollection: CollectionConfig): CollectionConfig;
|
|
120
|
+
wrapPagesCollection(pagesCollection: CollectionConfig): CollectionConfig;
|
|
121
|
+
wrapMediaCollection(mediaCollection: CollectionConfig): CollectionConfig;
|
|
122
|
+
wrapFormsCollection(formsCollection: CollectionConfig): CollectionConfig;
|
|
123
|
+
wrapFormSubmissionsCollection(formSubmissionsCollection: CollectionConfig): CollectionConfig;
|
|
124
|
+
wrapFormUploadsCollection(formUploadsCollection: CollectionConfig): CollectionConfig;
|
|
125
|
+
wrapGlobals(globals: GlobalConfig[]): GlobalConfig[];
|
|
126
|
+
};
|
|
127
|
+
declare function configureAdmin(config: AdminConfig): ConfiguredAdmin;
|
|
128
|
+
|
|
129
|
+
declare function withTooltips(fields: Field[], customTooltips?: Record<string, string>): Field[];
|
|
130
|
+
|
|
131
|
+
declare const createHeaderNavItemsField: () => Field;
|
|
132
|
+
|
|
133
|
+
type CreateSocialMediaConnectionsFieldOptions = {
|
|
134
|
+
description?: string;
|
|
135
|
+
label?: string;
|
|
136
|
+
name?: string;
|
|
137
|
+
platforms?: SocialMediaPlatform[];
|
|
138
|
+
};
|
|
139
|
+
declare const createSocialMediaConnectionsField: (options?: CreateSocialMediaConnectionsFieldOptions) => Field;
|
|
140
|
+
declare const socialMediaConnectionsField: Field;
|
|
141
|
+
|
|
142
|
+
type CreateSocialMediaGlobalOptions = {
|
|
143
|
+
description?: string;
|
|
144
|
+
fieldOptions?: Omit<CreateSocialMediaConnectionsFieldOptions, 'label' | 'name'>;
|
|
145
|
+
slug?: string;
|
|
146
|
+
};
|
|
147
|
+
declare const createSocialMediaGlobal: (options?: CreateSocialMediaGlobalOptions) => GlobalConfig;
|
|
148
|
+
|
|
149
|
+
type index_AdminConfig = AdminConfig;
|
|
150
|
+
type index_AdminStudioConfig = AdminStudioConfig;
|
|
151
|
+
type index_AdminStudioFooterPreviewConfig = AdminStudioFooterPreviewConfig;
|
|
152
|
+
type index_AdminStudioHeaderPreviewConfig = AdminStudioHeaderPreviewConfig;
|
|
153
|
+
type index_AdminStudioSitePreviewConfig = AdminStudioSitePreviewConfig;
|
|
154
|
+
type index_CreateSocialMediaConnectionsFieldOptions = CreateSocialMediaConnectionsFieldOptions;
|
|
155
|
+
type index_CreateSocialMediaGlobalOptions = CreateSocialMediaGlobalOptions;
|
|
156
|
+
type index_ResolvedStudioDashboardPanel = ResolvedStudioDashboardPanel;
|
|
157
|
+
type index_ResolvedStudioSection = ResolvedStudioSection;
|
|
158
|
+
declare const index_SOCIAL_MEDIA_DEFAULT_ICON_BY_PLATFORM: typeof SOCIAL_MEDIA_DEFAULT_ICON_BY_PLATFORM;
|
|
159
|
+
declare const index_SOCIAL_MEDIA_ICON_OPTIONS: typeof SOCIAL_MEDIA_ICON_OPTIONS;
|
|
160
|
+
declare const index_SOCIAL_MEDIA_PLATFORMS: typeof SOCIAL_MEDIA_PLATFORMS;
|
|
161
|
+
declare const index_SOCIAL_MEDIA_PLATFORM_LABELS: typeof SOCIAL_MEDIA_PLATFORM_LABELS;
|
|
162
|
+
declare const index_SocialMediaGlobalData: typeof SocialMediaGlobalData;
|
|
163
|
+
declare const index_SocialMediaIconLibrary: typeof SocialMediaIconLibrary;
|
|
164
|
+
declare const index_SocialMediaIconOption: typeof SocialMediaIconOption;
|
|
165
|
+
declare const index_SocialMediaPlatform: typeof SocialMediaPlatform;
|
|
166
|
+
declare const index_SocialMediaProfileData: typeof SocialMediaProfileData;
|
|
167
|
+
declare const index_SocialMediaProfilesData: typeof SocialMediaProfilesData;
|
|
168
|
+
type index_StudioDashboardPanel = StudioDashboardPanel;
|
|
169
|
+
type index_StudioDashboardPanelSpan = StudioDashboardPanelSpan;
|
|
170
|
+
type index_StudioGlobalLink = StudioGlobalLink;
|
|
171
|
+
type index_StudioSection = StudioSection;
|
|
172
|
+
type index_StudioSectionCard = StudioSectionCard;
|
|
173
|
+
type index_StudioSectionComponent = StudioSectionComponent;
|
|
174
|
+
type index_StudioSectionRole = StudioSectionRole;
|
|
175
|
+
type index_StudioSectionView = StudioSectionView;
|
|
176
|
+
declare const index_configureAdmin: typeof configureAdmin;
|
|
177
|
+
declare const index_createHeaderNavItemsField: typeof createHeaderNavItemsField;
|
|
178
|
+
declare const index_createSocialMediaConnectionsField: typeof createSocialMediaConnectionsField;
|
|
179
|
+
declare const index_createSocialMediaGlobal: typeof createSocialMediaGlobal;
|
|
180
|
+
declare const index_createThemePreferenceField: typeof createThemePreferenceField;
|
|
181
|
+
declare const index_socialMediaConnectionsField: typeof socialMediaConnectionsField;
|
|
182
|
+
declare const index_themePreferenceField: typeof themePreferenceField;
|
|
183
|
+
declare const index_withTooltips: typeof withTooltips;
|
|
184
|
+
declare namespace index {
|
|
185
|
+
export { type index_AdminConfig as AdminConfig, type index_AdminStudioConfig as AdminStudioConfig, type index_AdminStudioFooterPreviewConfig as AdminStudioFooterPreviewConfig, type index_AdminStudioHeaderPreviewConfig as AdminStudioHeaderPreviewConfig, type index_AdminStudioSitePreviewConfig as AdminStudioSitePreviewConfig, type index_CreateSocialMediaConnectionsFieldOptions as CreateSocialMediaConnectionsFieldOptions, type index_CreateSocialMediaGlobalOptions as CreateSocialMediaGlobalOptions, type index_ResolvedStudioDashboardPanel as ResolvedStudioDashboardPanel, type index_ResolvedStudioSection as ResolvedStudioSection, index_SOCIAL_MEDIA_DEFAULT_ICON_BY_PLATFORM as SOCIAL_MEDIA_DEFAULT_ICON_BY_PLATFORM, index_SOCIAL_MEDIA_ICON_OPTIONS as SOCIAL_MEDIA_ICON_OPTIONS, index_SOCIAL_MEDIA_PLATFORMS as SOCIAL_MEDIA_PLATFORMS, index_SOCIAL_MEDIA_PLATFORM_LABELS as SOCIAL_MEDIA_PLATFORM_LABELS, index_SocialMediaGlobalData as SocialMediaGlobalData, index_SocialMediaIconLibrary as SocialMediaIconLibrary, index_SocialMediaIconOption as SocialMediaIconOption, index_SocialMediaPlatform as SocialMediaPlatform, index_SocialMediaProfileData as SocialMediaProfileData, index_SocialMediaProfilesData as SocialMediaProfilesData, type index_StudioDashboardPanel as StudioDashboardPanel, type index_StudioDashboardPanelSpan as StudioDashboardPanelSpan, type index_StudioGlobalLink as StudioGlobalLink, type index_StudioSection as StudioSection, type index_StudioSectionCard as StudioSectionCard, type index_StudioSectionComponent as StudioSectionComponent, type index_StudioSectionRole as StudioSectionRole, type index_StudioSectionView as StudioSectionView, index_configureAdmin as configureAdmin, index_createHeaderNavItemsField as createHeaderNavItemsField, index_createSocialMediaConnectionsField as createSocialMediaConnectionsField, index_createSocialMediaGlobal as createSocialMediaGlobal, index_createThemePreferenceField as createThemePreferenceField, index_socialMediaConnectionsField as socialMediaConnectionsField, index_themePreferenceField as themePreferenceField, index_withTooltips as withTooltips };
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export { type AdminConfig as A, type CreateSocialMediaConnectionsFieldOptions as C, type ResolvedStudioDashboardPanel as R, type StudioDashboardPanel as S, type AdminStudioConfig as a, type AdminStudioFooterPreviewConfig as b, type AdminStudioHeaderPreviewConfig as c, type AdminStudioSitePreviewConfig as d, type CreateSocialMediaGlobalOptions as e, type ResolvedStudioSection as f, type StudioDashboardPanelSpan as g, type StudioGlobalLink as h, index as i, type StudioSection as j, type StudioSectionCard as k, type StudioSectionComponent as l, type StudioSectionRole as m, type StudioSectionView as n, configureAdmin as o, createHeaderNavItemsField as p, createSocialMediaConnectionsField as q, createSocialMediaGlobal as r, createThemePreferenceField as s, socialMediaConnectionsField as t, themePreferenceField as u, withTooltips as w };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { 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-
|
|
2
|
+
import { 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 { ReactNode } from 'react';
|
|
4
4
|
|
|
5
5
|
type AdminBreadcrumbsProps = {
|
package/dist/index.d.mts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { i as admin } from './index-
|
|
2
|
-
export { i as adminApp } from './index-
|
|
1
|
+
export { i as admin } from './index-DLfPOqYA.mjs';
|
|
2
|
+
export { i as adminApp } from './index-G_uTNffQ.mjs';
|
|
3
3
|
export { i as blocks } from './index-CluwY0ZQ.mjs';
|
|
4
4
|
export { i as nextjs } from './index-D8BNfUJb.mjs';
|
|
5
5
|
export { i as studio } from './index-DWmudwDm.mjs';
|
|
6
6
|
export { i as studioPages } from './index-Cv-6qnrw.mjs';
|
|
7
7
|
import 'payload';
|
|
8
|
-
import './sitePreviewTypes-
|
|
8
|
+
import './sitePreviewTypes-BrJwGzJj.mjs';
|
|
9
9
|
import './socialMedia-C05Iy-SV.mjs';
|
|
10
10
|
import 'react/jsx-runtime';
|
|
11
11
|
import 'react';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { i as admin } from './index-
|
|
2
|
-
export { i as adminApp } from './index-
|
|
1
|
+
export { i as admin } from './index-BV0vEGl6.js';
|
|
2
|
+
export { i as adminApp } from './index-DAdN56fM.js';
|
|
3
3
|
export { i as blocks } from './index-CluwY0ZQ.js';
|
|
4
4
|
export { i as nextjs } from './index-DD_E2UfJ.js';
|
|
5
5
|
export { i as studio } from './index-DWmudwDm.js';
|
|
6
6
|
export { i as studioPages } from './index-Crx_MtPw.js';
|
|
7
7
|
import 'payload';
|
|
8
|
-
import './sitePreviewTypes-
|
|
8
|
+
import './sitePreviewTypes-BrJwGzJj.js';
|
|
9
9
|
import './socialMedia-C05Iy-SV.js';
|
|
10
10
|
import 'react/jsx-runtime';
|
|
11
11
|
import 'react';
|
package/dist/index.js
CHANGED
|
@@ -107,7 +107,7 @@ var navItemIsActive = (pathname, item) => {
|
|
|
107
107
|
};
|
|
108
108
|
|
|
109
109
|
// src/shared/studioSections.ts
|
|
110
|
-
var studioRoles = /* @__PURE__ */ new Set(["admin", "editor", "client"]);
|
|
110
|
+
var studioRoles = /* @__PURE__ */ new Set(["admin", "developer", "editor", "client"]);
|
|
111
111
|
var studioIcons = new Set(adminNavIcons);
|
|
112
112
|
var isRecord = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
113
113
|
var isAbsoluteExternalURL = (value) => /^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(value) || value.startsWith("//");
|
|
@@ -241,8 +241,10 @@ function configureAdmin(config) {
|
|
|
241
241
|
brandPrimary = "#3b82f6",
|
|
242
242
|
brandSecondary = "#8b5cf6",
|
|
243
243
|
defaultTheme = "brand-light",
|
|
244
|
+
logoOnDarkUrl,
|
|
244
245
|
logoUrl,
|
|
245
|
-
allowThemePreference = false
|
|
246
|
+
allowThemePreference = false,
|
|
247
|
+
userSessionDurationSeconds = 60 * 60 * 24
|
|
246
248
|
} = config;
|
|
247
249
|
const studioEnabled = config.studio?.enabled ?? true;
|
|
248
250
|
const formsEnabled = config.studio?.forms?.enabled ?? false;
|
|
@@ -347,6 +349,49 @@ function configureAdmin(config) {
|
|
|
347
349
|
}
|
|
348
350
|
};
|
|
349
351
|
};
|
|
352
|
+
const attachStudioEditRedirectToCollection = (collection, options) => {
|
|
353
|
+
if (!studioEnabled) {
|
|
354
|
+
return collection;
|
|
355
|
+
}
|
|
356
|
+
const collectionWithBreadcrumb = attachStudioBackBreadcrumbToCollection(collection);
|
|
357
|
+
const existingViews = collectionWithBreadcrumb.admin?.components?.views;
|
|
358
|
+
const existingEditViews = existingViews?.edit;
|
|
359
|
+
const hasCustomEditView = Boolean(
|
|
360
|
+
existingEditViews?.root || existingEditViews?.default && typeof existingEditViews.default === "object" && existingEditViews.default.Component
|
|
361
|
+
);
|
|
362
|
+
if (hasCustomEditView) {
|
|
363
|
+
return collectionWithBreadcrumb;
|
|
364
|
+
}
|
|
365
|
+
return {
|
|
366
|
+
...collectionWithBreadcrumb,
|
|
367
|
+
admin: {
|
|
368
|
+
...collectionWithBreadcrumb.admin,
|
|
369
|
+
components: {
|
|
370
|
+
...collectionWithBreadcrumb.admin?.components,
|
|
371
|
+
views: {
|
|
372
|
+
...existingViews,
|
|
373
|
+
edit: {
|
|
374
|
+
...existingEditViews,
|
|
375
|
+
default: {
|
|
376
|
+
...typeof existingEditViews?.default === "object" ? existingEditViews.default : {},
|
|
377
|
+
Component: {
|
|
378
|
+
exportName: "StudioDocumentRedirect",
|
|
379
|
+
path: clientPath,
|
|
380
|
+
clientProps: {
|
|
381
|
+
description: options.description,
|
|
382
|
+
...options.emptyHref ? { emptyHref: options.emptyHref } : {},
|
|
383
|
+
...options.emptyLabel ? { emptyLabel: options.emptyLabel } : {},
|
|
384
|
+
pathBase: options.pathBase,
|
|
385
|
+
title: options.title
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
};
|
|
394
|
+
};
|
|
350
395
|
return {
|
|
351
396
|
admin: {
|
|
352
397
|
css: cssPath,
|
|
@@ -364,6 +409,7 @@ function configureAdmin(config) {
|
|
|
364
409
|
path: clientPath,
|
|
365
410
|
clientProps: {
|
|
366
411
|
brandName,
|
|
412
|
+
logoOnDarkUrl,
|
|
367
413
|
logoUrl
|
|
368
414
|
}
|
|
369
415
|
},
|
|
@@ -372,6 +418,7 @@ function configureAdmin(config) {
|
|
|
372
418
|
path: clientPath,
|
|
373
419
|
clientProps: {
|
|
374
420
|
brandName,
|
|
421
|
+
logoOnDarkUrl,
|
|
375
422
|
logoUrl
|
|
376
423
|
}
|
|
377
424
|
}
|
|
@@ -386,6 +433,7 @@ function configureAdmin(config) {
|
|
|
386
433
|
},
|
|
387
434
|
...studioEnabled ? {
|
|
388
435
|
studioGlobals: {
|
|
436
|
+
exact: true,
|
|
389
437
|
path: globalsBasePath,
|
|
390
438
|
Component: {
|
|
391
439
|
exportName: "AdminStudioGlobalsView",
|
|
@@ -397,10 +445,11 @@ function configureAdmin(config) {
|
|
|
397
445
|
}
|
|
398
446
|
}
|
|
399
447
|
},
|
|
400
|
-
|
|
401
|
-
|
|
448
|
+
studioPageNew: {
|
|
449
|
+
exact: true,
|
|
450
|
+
path: `${pagesBasePath}/new`,
|
|
402
451
|
Component: {
|
|
403
|
-
exportName: "
|
|
452
|
+
exportName: "AdminStudioNewPageView",
|
|
404
453
|
path: clientPath,
|
|
405
454
|
clientProps: {
|
|
406
455
|
...studioNavClientProps,
|
|
@@ -409,6 +458,7 @@ function configureAdmin(config) {
|
|
|
409
458
|
}
|
|
410
459
|
},
|
|
411
460
|
studioPageEditor: {
|
|
461
|
+
exact: true,
|
|
412
462
|
path: `${pagesBasePath}/:id`,
|
|
413
463
|
Component: {
|
|
414
464
|
exportName: "AdminStudioPageEditView",
|
|
@@ -419,10 +469,11 @@ function configureAdmin(config) {
|
|
|
419
469
|
}
|
|
420
470
|
}
|
|
421
471
|
},
|
|
422
|
-
|
|
423
|
-
|
|
472
|
+
studioPages: {
|
|
473
|
+
exact: true,
|
|
474
|
+
path: pagesBasePath,
|
|
424
475
|
Component: {
|
|
425
|
-
exportName: "
|
|
476
|
+
exportName: "AdminStudioPagesListView",
|
|
426
477
|
path: clientPath,
|
|
427
478
|
clientProps: {
|
|
428
479
|
...studioNavClientProps,
|
|
@@ -431,6 +482,7 @@ function configureAdmin(config) {
|
|
|
431
482
|
}
|
|
432
483
|
},
|
|
433
484
|
studioContactForm: {
|
|
485
|
+
exact: true,
|
|
434
486
|
path: contactFormStudioPath,
|
|
435
487
|
Component: {
|
|
436
488
|
exportName: "AdminStudioContactFormView",
|
|
@@ -443,7 +495,47 @@ function configureAdmin(config) {
|
|
|
443
495
|
}
|
|
444
496
|
},
|
|
445
497
|
...formsEnabled ? {
|
|
498
|
+
studioFormSubmission: {
|
|
499
|
+
exact: true,
|
|
500
|
+
path: `${formsBasePath}/submissions/:id`,
|
|
501
|
+
Component: {
|
|
502
|
+
exportName: "AdminStudioFormSubmissionView",
|
|
503
|
+
path: clientPath,
|
|
504
|
+
clientProps: {
|
|
505
|
+
...studioNavClientProps,
|
|
506
|
+
formsCollectionSlug,
|
|
507
|
+
formSubmissionsCollectionSlug,
|
|
508
|
+
formUploadsCollectionSlug
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
},
|
|
512
|
+
studioFormUpload: {
|
|
513
|
+
exact: true,
|
|
514
|
+
path: `${formsBasePath}/uploads/:id`,
|
|
515
|
+
Component: {
|
|
516
|
+
exportName: "AdminStudioFormUploadView",
|
|
517
|
+
path: clientPath,
|
|
518
|
+
clientProps: {
|
|
519
|
+
...studioNavClientProps,
|
|
520
|
+
formUploadsCollectionSlug
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
},
|
|
524
|
+
studioFormDetail: {
|
|
525
|
+
exact: true,
|
|
526
|
+
path: `${formsBasePath}/:id`,
|
|
527
|
+
Component: {
|
|
528
|
+
exportName: "AdminStudioFormDetailView",
|
|
529
|
+
path: clientPath,
|
|
530
|
+
clientProps: {
|
|
531
|
+
...studioNavClientProps,
|
|
532
|
+
formsCollectionSlug,
|
|
533
|
+
formSubmissionsCollectionSlug
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
},
|
|
446
537
|
studioForms: {
|
|
538
|
+
exact: true,
|
|
447
539
|
path: formsBasePath,
|
|
448
540
|
Component: {
|
|
449
541
|
exportName: "AdminStudioFormsView",
|
|
@@ -457,10 +549,11 @@ function configureAdmin(config) {
|
|
|
457
549
|
}
|
|
458
550
|
}
|
|
459
551
|
} : {},
|
|
460
|
-
|
|
461
|
-
|
|
552
|
+
studioMediaItem: {
|
|
553
|
+
exact: true,
|
|
554
|
+
path: `${mediaBasePath}/:id`,
|
|
462
555
|
Component: {
|
|
463
|
-
exportName: "
|
|
556
|
+
exportName: "AdminStudioMediaItemView",
|
|
464
557
|
path: clientPath,
|
|
465
558
|
clientProps: {
|
|
466
559
|
...studioNavClientProps,
|
|
@@ -468,10 +561,11 @@ function configureAdmin(config) {
|
|
|
468
561
|
}
|
|
469
562
|
}
|
|
470
563
|
},
|
|
471
|
-
|
|
472
|
-
|
|
564
|
+
studioMedia: {
|
|
565
|
+
exact: true,
|
|
566
|
+
path: mediaBasePath,
|
|
473
567
|
Component: {
|
|
474
|
-
exportName: "
|
|
568
|
+
exportName: "AdminStudioMediaView",
|
|
475
569
|
path: clientPath,
|
|
476
570
|
clientProps: {
|
|
477
571
|
...studioNavClientProps,
|
|
@@ -480,6 +574,7 @@ function configureAdmin(config) {
|
|
|
480
574
|
}
|
|
481
575
|
},
|
|
482
576
|
studioTools: {
|
|
577
|
+
exact: true,
|
|
483
578
|
path: toolsBasePath,
|
|
484
579
|
Component: {
|
|
485
580
|
exportName: "AdminStudioToolsView",
|
|
@@ -524,6 +619,7 @@ function configureAdmin(config) {
|
|
|
524
619
|
path: clientPath,
|
|
525
620
|
clientProps: {
|
|
526
621
|
brandName,
|
|
622
|
+
logoOnDarkUrl,
|
|
527
623
|
logoUrl
|
|
528
624
|
}
|
|
529
625
|
}
|
|
@@ -560,8 +656,17 @@ function configureAdmin(config) {
|
|
|
560
656
|
const hasThemePreference = existingFields.some(
|
|
561
657
|
(field) => typeof field === "object" && field !== null && "name" in field && field.name === "themePreference"
|
|
562
658
|
);
|
|
659
|
+
const normalizedAuth = usersCollection.auth === true ? {
|
|
660
|
+
tokenExpiration: userSessionDurationSeconds,
|
|
661
|
+
useSessions: true
|
|
662
|
+
} : usersCollection.auth && typeof usersCollection.auth === "object" ? {
|
|
663
|
+
...usersCollection.auth,
|
|
664
|
+
tokenExpiration: usersCollection.auth.tokenExpiration ?? userSessionDurationSeconds,
|
|
665
|
+
useSessions: usersCollection.auth.useSessions ?? true
|
|
666
|
+
} : usersCollection.auth;
|
|
563
667
|
const nextCollection = {
|
|
564
668
|
...usersCollection,
|
|
669
|
+
auth: normalizedAuth,
|
|
565
670
|
fields: !allowThemePreference || hasThemePreference ? existingFields : [...existingFields, createThemePreferenceField(defaultTheme)]
|
|
566
671
|
};
|
|
567
672
|
return attachStudioBackBreadcrumbToCollection(nextCollection);
|
|
@@ -623,13 +728,31 @@ function configureAdmin(config) {
|
|
|
623
728
|
return attachStudioBackBreadcrumbToCollection(mediaCollection);
|
|
624
729
|
},
|
|
625
730
|
wrapFormsCollection(formsCollection) {
|
|
626
|
-
return
|
|
731
|
+
return attachStudioEditRedirectToCollection(formsCollection, {
|
|
732
|
+
description: "Redirecting to the Studio form workspace.",
|
|
733
|
+
emptyHref: formsBasePath,
|
|
734
|
+
emptyLabel: "Open Forms",
|
|
735
|
+
pathBase: formsBasePath,
|
|
736
|
+
title: "Opening Form..."
|
|
737
|
+
});
|
|
627
738
|
},
|
|
628
739
|
wrapFormSubmissionsCollection(formSubmissionsCollection) {
|
|
629
|
-
return
|
|
740
|
+
return attachStudioEditRedirectToCollection(formSubmissionsCollection, {
|
|
741
|
+
description: "Redirecting to the Studio submission workspace.",
|
|
742
|
+
emptyHref: formsBasePath,
|
|
743
|
+
emptyLabel: "Open Forms",
|
|
744
|
+
pathBase: `${formsBasePath}/submissions`,
|
|
745
|
+
title: "Opening Submission..."
|
|
746
|
+
});
|
|
630
747
|
},
|
|
631
748
|
wrapFormUploadsCollection(formUploadsCollection) {
|
|
632
|
-
return
|
|
749
|
+
return attachStudioEditRedirectToCollection(formUploadsCollection, {
|
|
750
|
+
description: "Redirecting to the Studio upload workspace.",
|
|
751
|
+
emptyHref: formsBasePath,
|
|
752
|
+
emptyLabel: "Open Forms",
|
|
753
|
+
pathBase: `${formsBasePath}/uploads`,
|
|
754
|
+
title: "Opening Upload..."
|
|
755
|
+
});
|
|
633
756
|
},
|
|
634
757
|
wrapGlobals(globals2) {
|
|
635
758
|
const labelMap = {
|
|
@@ -3629,6 +3752,7 @@ var defaultBuilderThemeTokens = {
|
|
|
3629
3752
|
|
|
3630
3753
|
// src/studio-pages/builder/adapters/settingsV2.ts
|
|
3631
3754
|
var isRecord3 = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
3755
|
+
var isTextAlign = (value) => value === "left" || value === "center" || value === "right" || value === "justify";
|
|
3632
3756
|
var parsePercent = (value) => {
|
|
3633
3757
|
if (typeof value === "number" && Number.isFinite(value)) {
|
|
3634
3758
|
return Math.max(0, Math.min(100, value));
|
|
@@ -3671,6 +3795,10 @@ var mergeSettings = (defaults, input) => {
|
|
|
3671
3795
|
};
|
|
3672
3796
|
var legacyBlockToV2Settings = (block) => {
|
|
3673
3797
|
const current = structuredClone(defaultBuilderBlockSettingsV2);
|
|
3798
|
+
if (block.blockType === "hero" && block.variant === "centered") {
|
|
3799
|
+
current.typography.headingAlign = "center";
|
|
3800
|
+
current.typography.bodyAlign = "center";
|
|
3801
|
+
}
|
|
3674
3802
|
current.layout.contentWidth = block.contentWidth === "narrow" || block.contentWidth === "content" || block.contentWidth === "wide" || block.contentWidth === "full" || block.contentWidth === "inherit" ? block.contentWidth : current.layout.contentWidth;
|
|
3675
3803
|
current.layout.sectionPaddingX = block.sectionPaddingX === "none" || block.sectionPaddingX === "sm" || block.sectionPaddingX === "md" || block.sectionPaddingX === "lg" || block.sectionPaddingX === "inherit" ? block.sectionPaddingX : current.layout.sectionPaddingX;
|
|
3676
3804
|
current.layout.sectionPaddingY = block.sectionPaddingY === "none" || block.sectionPaddingY === "sm" || block.sectionPaddingY === "lg" ? block.sectionPaddingY : current.layout.sectionPaddingY;
|
|
@@ -3707,8 +3835,8 @@ var legacyBlockToV2Settings = (block) => {
|
|
|
3707
3835
|
current.media.positionX = parsePercent(block.imagePositionX ?? block.backgroundImagePositionX);
|
|
3708
3836
|
current.media.positionY = parsePercent(block.imagePositionY ?? block.backgroundImagePositionY);
|
|
3709
3837
|
current.media.height = parsePixel(block.imageHeight);
|
|
3710
|
-
current.typography.headingAlign = block.textHeadingAlign
|
|
3711
|
-
current.typography.bodyAlign = block.textBodyAlign
|
|
3838
|
+
current.typography.headingAlign = isTextAlign(block.textHeadingAlign) ? block.textHeadingAlign : current.typography.headingAlign;
|
|
3839
|
+
current.typography.bodyAlign = isTextAlign(block.textBodyAlign) ? block.textBodyAlign : current.typography.bodyAlign;
|
|
3712
3840
|
current.typography.maxTextWidth = block.textMaxWidth === "auto" || block.textMaxWidth === "sm" || block.textMaxWidth === "md" || block.textMaxWidth === "lg" || block.textMaxWidth === "full" ? block.textMaxWidth : current.typography.maxTextWidth;
|
|
3713
3841
|
current.typography.lineHeightPreset = block.textLineHeightPreset === "tight" || block.textLineHeightPreset === "normal" || block.textLineHeightPreset === "relaxed" ? block.textLineHeightPreset : current.typography.lineHeightPreset;
|
|
3714
3842
|
current.typography.letterSpacingPreset = block.textLetterSpacingPreset === "tight" || block.textLetterSpacingPreset === "normal" || block.textLetterSpacingPreset === "relaxed" ? block.textLetterSpacingPreset : current.typography.letterSpacingPreset;
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
admin_exports
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JC3UV74N.mjs";
|
|
4
4
|
import {
|
|
5
5
|
admin_app_exports
|
|
6
6
|
} from "./chunk-RKTIFEUY.mjs";
|
|
@@ -10,13 +10,13 @@ import {
|
|
|
10
10
|
} from "./chunk-JQAHXYAM.mjs";
|
|
11
11
|
import {
|
|
12
12
|
nextjs_exports
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-H4GTEY24.mjs";
|
|
14
14
|
import "./chunk-ZTXJG4K5.mjs";
|
|
15
15
|
import {
|
|
16
16
|
studio_pages_exports
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-EDW7DPXW.mjs";
|
|
18
18
|
import "./chunk-OQSEJXC4.mjs";
|
|
19
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-4LSIUED5.mjs";
|
|
20
20
|
import {
|
|
21
21
|
studio_exports
|
|
22
22
|
} from "./chunk-ADIIWIYL.mjs";
|
package/dist/nextjs/index.js
CHANGED
|
@@ -166,6 +166,7 @@ var defaultBuilderItemSettingsV2 = {
|
|
|
166
166
|
|
|
167
167
|
// src/studio-pages/builder/adapters/settingsV2.ts
|
|
168
168
|
var isRecord2 = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
169
|
+
var isTextAlign = (value) => value === "left" || value === "center" || value === "right" || value === "justify";
|
|
169
170
|
var parsePercent = (value) => {
|
|
170
171
|
if (typeof value === "number" && Number.isFinite(value)) {
|
|
171
172
|
return Math.max(0, Math.min(100, value));
|
|
@@ -208,6 +209,10 @@ var mergeSettings = (defaults, input) => {
|
|
|
208
209
|
};
|
|
209
210
|
var legacyBlockToV2Settings = (block) => {
|
|
210
211
|
const current = structuredClone(defaultBuilderBlockSettingsV2);
|
|
212
|
+
if (block.blockType === "hero" && block.variant === "centered") {
|
|
213
|
+
current.typography.headingAlign = "center";
|
|
214
|
+
current.typography.bodyAlign = "center";
|
|
215
|
+
}
|
|
211
216
|
current.layout.contentWidth = block.contentWidth === "narrow" || block.contentWidth === "content" || block.contentWidth === "wide" || block.contentWidth === "full" || block.contentWidth === "inherit" ? block.contentWidth : current.layout.contentWidth;
|
|
212
217
|
current.layout.sectionPaddingX = block.sectionPaddingX === "none" || block.sectionPaddingX === "sm" || block.sectionPaddingX === "md" || block.sectionPaddingX === "lg" || block.sectionPaddingX === "inherit" ? block.sectionPaddingX : current.layout.sectionPaddingX;
|
|
213
218
|
current.layout.sectionPaddingY = block.sectionPaddingY === "none" || block.sectionPaddingY === "sm" || block.sectionPaddingY === "lg" ? block.sectionPaddingY : current.layout.sectionPaddingY;
|
|
@@ -244,8 +249,8 @@ var legacyBlockToV2Settings = (block) => {
|
|
|
244
249
|
current.media.positionX = parsePercent(block.imagePositionX ?? block.backgroundImagePositionX);
|
|
245
250
|
current.media.positionY = parsePercent(block.imagePositionY ?? block.backgroundImagePositionY);
|
|
246
251
|
current.media.height = parsePixel(block.imageHeight);
|
|
247
|
-
current.typography.headingAlign = block.textHeadingAlign
|
|
248
|
-
current.typography.bodyAlign = block.textBodyAlign
|
|
252
|
+
current.typography.headingAlign = isTextAlign(block.textHeadingAlign) ? block.textHeadingAlign : current.typography.headingAlign;
|
|
253
|
+
current.typography.bodyAlign = isTextAlign(block.textBodyAlign) ? block.textBodyAlign : current.typography.bodyAlign;
|
|
249
254
|
current.typography.maxTextWidth = block.textMaxWidth === "auto" || block.textMaxWidth === "sm" || block.textMaxWidth === "md" || block.textMaxWidth === "lg" || block.textMaxWidth === "full" ? block.textMaxWidth : current.typography.maxTextWidth;
|
|
250
255
|
current.typography.lineHeightPreset = block.textLineHeightPreset === "tight" || block.textLineHeightPreset === "normal" || block.textLineHeightPreset === "relaxed" ? block.textLineHeightPreset : current.typography.lineHeightPreset;
|
|
251
256
|
current.typography.letterSpacingPreset = block.textLetterSpacingPreset === "tight" || block.textLetterSpacingPreset === "normal" || block.textLetterSpacingPreset === "relaxed" ? block.textLetterSpacingPreset : current.typography.letterSpacingPreset;
|
package/dist/nextjs/index.mjs
CHANGED
|
@@ -5,9 +5,9 @@ import {
|
|
|
5
5
|
createSiteQueries,
|
|
6
6
|
resolveMedia,
|
|
7
7
|
resolveSocialMediaLinks
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-H4GTEY24.mjs";
|
|
9
9
|
import "../chunk-ZTXJG4K5.mjs";
|
|
10
|
-
import "../chunk-
|
|
10
|
+
import "../chunk-4LSIUED5.mjs";
|
|
11
11
|
import "../chunk-ADIIWIYL.mjs";
|
|
12
12
|
import "../chunk-6BWS3CLP.mjs";
|
|
13
13
|
export {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type AdminRole = 'admin' | 'editor' | 'client';
|
|
1
|
+
type AdminRole = 'admin' | 'developer' | 'editor' | 'client';
|
|
2
2
|
declare const adminNavIcons: readonly ["dashboard", "pages", "forms", "globals", "media", "tools", "account", "analytics"];
|
|
3
3
|
type AdminNavIcon = (typeof adminNavIcons)[number];
|
|
4
4
|
type AdminNavItem = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type AdminRole = 'admin' | 'editor' | 'client';
|
|
1
|
+
type AdminRole = 'admin' | 'developer' | 'editor' | 'client';
|
|
2
2
|
declare const adminNavIcons: readonly ["dashboard", "pages", "forms", "globals", "media", "tools", "account", "analytics"];
|
|
3
3
|
type AdminNavIcon = (typeof adminNavIcons)[number];
|
|
4
4
|
type AdminNavItem = {
|