@orion-studios/payload-studio 0.6.0-beta.9 → 0.7.0
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 +6 -1
- package/bin/init.js +329 -0
- package/dist/admin/client.js +2106 -585
- package/dist/admin/client.mjs +2161 -653
- package/dist/admin/index.d.mts +2 -2
- package/dist/admin/index.d.ts +2 -2
- package/dist/admin/index.js +190 -36
- package/dist/admin/index.mjs +2 -2
- package/dist/admin-app/client.js +14 -5
- package/dist/admin-app/client.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 +361 -41
- package/dist/admin.css +98 -2
- package/dist/blocks/index.mjs +1 -2
- package/dist/builder-v2/client.d.mts +18 -0
- package/dist/builder-v2/client.d.ts +18 -0
- package/dist/builder-v2/client.js +4287 -0
- package/dist/builder-v2/client.mjs +4162 -0
- package/dist/builder-v2/index.d.mts +249 -0
- package/dist/builder-v2/index.d.ts +249 -0
- package/dist/builder-v2/index.js +836 -0
- package/dist/builder-v2/index.mjs +786 -0
- package/dist/builder-v2/styles.css +2705 -0
- package/dist/{chunk-PF3EBZXF.mjs → chunk-7ZMXZRBP.mjs} +39 -3
- package/dist/{chunk-XKUTZ7IU.mjs → chunk-DTHBPJXU.mjs} +246 -25
- package/dist/{chunk-JQAHXYAM.mjs → chunk-KMYMSR7W.mjs} +163 -3
- package/dist/{chunk-WLOPFFN2.mjs → chunk-MMJNHBOF.mjs} +193 -39
- package/dist/{chunk-KPIX7OSV.mjs → chunk-NF37A575.mjs} +14 -5
- package/dist/{chunk-OTHERBGX.mjs → chunk-OF6BATTO.mjs} +57 -112
- package/dist/chunk-VA545CHJ.mjs +202 -0
- package/dist/forms/index.d.mts +25 -0
- package/dist/forms/index.d.ts +25 -0
- package/dist/forms/index.js +237 -0
- package/dist/forms/index.mjs +25 -0
- package/dist/forms/server.d.mts +35 -0
- package/dist/forms/server.d.ts +35 -0
- package/dist/forms/server.js +442 -0
- package/dist/forms/server.mjs +228 -0
- package/dist/{index-Crx_MtPw.d.ts → index-0xXWuOuz.d.ts} +38 -6
- package/dist/{index-Cv-6qnrw.d.mts → index-BU82akSL.d.mts} +38 -6
- package/dist/{index-Bm2SaC3r.d.mts → index-BbTcimgH.d.mts} +4 -2
- package/dist/{index-D8BNfUJb.d.mts → index-Cen-9wcc.d.mts} +17 -5
- package/dist/{index-52HdVLQq.d.ts → index-DAdN56fM.d.ts} +1 -1
- package/dist/{index-CkT_eyhK.d.ts → index-DV-nW43e.d.ts} +4 -2
- package/dist/{index-DEQC3Dwj.d.mts → index-G_uTNffQ.d.mts} +1 -1
- package/dist/{index-DD_E2UfJ.d.ts → index-gxcMPpm-.d.ts} +17 -5
- package/dist/index.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +522 -171
- package/dist/index.mjs +10 -11
- package/dist/nextjs/index.d.mts +1 -1
- package/dist/nextjs/index.d.ts +1 -1
- package/dist/nextjs/index.js +95 -114
- 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 +66 -5
- package/dist/studio-pages/client.js +618 -73
- package/dist/studio-pages/client.mjs +641 -96
- package/dist/studio-pages/index.d.mts +1 -1
- package/dist/studio-pages/index.d.ts +1 -1
- package/dist/studio-pages/index.js +1893 -24
- package/dist/studio-pages/index.mjs +11 -3
- package/package.json +38 -3
- package/dist/chunk-OQSEJXC4.mjs +0 -166
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 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-
|
|
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-BbTcimgH.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 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-
|
|
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-DV-nW43e.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,6 +215,7 @@ function configureAdmin(config) {
|
|
|
215
215
|
brandPrimary = "#3b82f6",
|
|
216
216
|
brandSecondary = "#8b5cf6",
|
|
217
217
|
defaultTheme = "brand-light",
|
|
218
|
+
logoOnDarkUrl,
|
|
218
219
|
logoUrl,
|
|
219
220
|
allowThemePreference = false,
|
|
220
221
|
userSessionDurationSeconds = 60 * 60 * 24
|
|
@@ -259,23 +260,33 @@ function configureAdmin(config) {
|
|
|
259
260
|
if (cssSources.length === 0) {
|
|
260
261
|
cssPath = sourceCssPath;
|
|
261
262
|
} else {
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
263
|
+
try {
|
|
264
|
+
let css = cssSources.map((filePath) => import_fs.default.readFileSync(filePath, "utf-8")).join("\n\n");
|
|
265
|
+
css = css.replace(
|
|
266
|
+
"--orion-cms-brand-primary-fallback: #3b82f6;",
|
|
267
|
+
`--orion-cms-brand-primary-fallback: ${brandPrimary};`
|
|
268
|
+
);
|
|
269
|
+
css = css.replace(
|
|
270
|
+
"--orion-cms-brand-secondary-fallback: #8b5cf6;",
|
|
271
|
+
`--orion-cms-brand-secondary-fallback: ${brandSecondary};`
|
|
272
|
+
);
|
|
273
|
+
const outputBasePath = config.basePath || process.cwd();
|
|
274
|
+
const genDir = import_path.default.resolve(outputBasePath, ".generated");
|
|
275
|
+
const genPath = import_path.default.resolve(genDir, "admin.css");
|
|
276
|
+
let existing = null;
|
|
277
|
+
try {
|
|
278
|
+
existing = import_fs.default.readFileSync(genPath, "utf-8");
|
|
279
|
+
} catch {
|
|
280
|
+
existing = null;
|
|
281
|
+
}
|
|
282
|
+
if (existing !== css) {
|
|
283
|
+
import_fs.default.mkdirSync(genDir, { recursive: true });
|
|
284
|
+
import_fs.default.writeFileSync(genPath, css);
|
|
285
|
+
}
|
|
286
|
+
cssPath = genPath;
|
|
287
|
+
} catch {
|
|
288
|
+
cssPath = sourceCssPath;
|
|
275
289
|
}
|
|
276
|
-
const genPath = import_path.default.resolve(genDir, "admin.css");
|
|
277
|
-
import_fs.default.writeFileSync(genPath, css);
|
|
278
|
-
cssPath = genPath;
|
|
279
290
|
}
|
|
280
291
|
const clientPath = "@orion-studios/payload-studio/admin/client";
|
|
281
292
|
const studioNavClientProps = {
|
|
@@ -322,6 +333,49 @@ function configureAdmin(config) {
|
|
|
322
333
|
}
|
|
323
334
|
};
|
|
324
335
|
};
|
|
336
|
+
const attachStudioEditRedirectToCollection = (collection, options) => {
|
|
337
|
+
if (!studioEnabled) {
|
|
338
|
+
return collection;
|
|
339
|
+
}
|
|
340
|
+
const collectionWithBreadcrumb = attachStudioBackBreadcrumbToCollection(collection);
|
|
341
|
+
const existingViews = collectionWithBreadcrumb.admin?.components?.views;
|
|
342
|
+
const existingEditViews = existingViews?.edit;
|
|
343
|
+
const hasCustomEditView = Boolean(
|
|
344
|
+
existingEditViews?.root || existingEditViews?.default && typeof existingEditViews.default === "object" && existingEditViews.default.Component
|
|
345
|
+
);
|
|
346
|
+
if (hasCustomEditView) {
|
|
347
|
+
return collectionWithBreadcrumb;
|
|
348
|
+
}
|
|
349
|
+
return {
|
|
350
|
+
...collectionWithBreadcrumb,
|
|
351
|
+
admin: {
|
|
352
|
+
...collectionWithBreadcrumb.admin,
|
|
353
|
+
components: {
|
|
354
|
+
...collectionWithBreadcrumb.admin?.components,
|
|
355
|
+
views: {
|
|
356
|
+
...existingViews,
|
|
357
|
+
edit: {
|
|
358
|
+
...existingEditViews,
|
|
359
|
+
default: {
|
|
360
|
+
...typeof existingEditViews?.default === "object" ? existingEditViews.default : {},
|
|
361
|
+
Component: {
|
|
362
|
+
exportName: "StudioDocumentRedirect",
|
|
363
|
+
path: clientPath,
|
|
364
|
+
clientProps: {
|
|
365
|
+
description: options.description,
|
|
366
|
+
...options.emptyHref ? { emptyHref: options.emptyHref } : {},
|
|
367
|
+
...options.emptyLabel ? { emptyLabel: options.emptyLabel } : {},
|
|
368
|
+
pathBase: options.pathBase,
|
|
369
|
+
title: options.title
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
};
|
|
378
|
+
};
|
|
325
379
|
return {
|
|
326
380
|
admin: {
|
|
327
381
|
css: cssPath,
|
|
@@ -339,6 +393,7 @@ function configureAdmin(config) {
|
|
|
339
393
|
path: clientPath,
|
|
340
394
|
clientProps: {
|
|
341
395
|
brandName,
|
|
396
|
+
logoOnDarkUrl,
|
|
342
397
|
logoUrl
|
|
343
398
|
}
|
|
344
399
|
},
|
|
@@ -347,6 +402,7 @@ function configureAdmin(config) {
|
|
|
347
402
|
path: clientPath,
|
|
348
403
|
clientProps: {
|
|
349
404
|
brandName,
|
|
405
|
+
logoOnDarkUrl,
|
|
350
406
|
logoUrl
|
|
351
407
|
}
|
|
352
408
|
}
|
|
@@ -361,6 +417,7 @@ function configureAdmin(config) {
|
|
|
361
417
|
},
|
|
362
418
|
...studioEnabled ? {
|
|
363
419
|
studioGlobals: {
|
|
420
|
+
exact: true,
|
|
364
421
|
path: globalsBasePath,
|
|
365
422
|
Component: {
|
|
366
423
|
exportName: "AdminStudioGlobalsView",
|
|
@@ -372,10 +429,11 @@ function configureAdmin(config) {
|
|
|
372
429
|
}
|
|
373
430
|
}
|
|
374
431
|
},
|
|
375
|
-
|
|
376
|
-
|
|
432
|
+
studioPageNew: {
|
|
433
|
+
exact: true,
|
|
434
|
+
path: `${pagesBasePath}/new`,
|
|
377
435
|
Component: {
|
|
378
|
-
exportName: "
|
|
436
|
+
exportName: "AdminStudioNewPageView",
|
|
379
437
|
path: clientPath,
|
|
380
438
|
clientProps: {
|
|
381
439
|
...studioNavClientProps,
|
|
@@ -384,6 +442,7 @@ function configureAdmin(config) {
|
|
|
384
442
|
}
|
|
385
443
|
},
|
|
386
444
|
studioPageEditor: {
|
|
445
|
+
exact: true,
|
|
387
446
|
path: `${pagesBasePath}/:id`,
|
|
388
447
|
Component: {
|
|
389
448
|
exportName: "AdminStudioPageEditView",
|
|
@@ -394,10 +453,11 @@ function configureAdmin(config) {
|
|
|
394
453
|
}
|
|
395
454
|
}
|
|
396
455
|
},
|
|
397
|
-
|
|
398
|
-
|
|
456
|
+
studioPages: {
|
|
457
|
+
exact: true,
|
|
458
|
+
path: pagesBasePath,
|
|
399
459
|
Component: {
|
|
400
|
-
exportName: "
|
|
460
|
+
exportName: "AdminStudioPagesListView",
|
|
401
461
|
path: clientPath,
|
|
402
462
|
clientProps: {
|
|
403
463
|
...studioNavClientProps,
|
|
@@ -406,6 +466,7 @@ function configureAdmin(config) {
|
|
|
406
466
|
}
|
|
407
467
|
},
|
|
408
468
|
studioContactForm: {
|
|
469
|
+
exact: true,
|
|
409
470
|
path: contactFormStudioPath,
|
|
410
471
|
Component: {
|
|
411
472
|
exportName: "AdminStudioContactFormView",
|
|
@@ -418,7 +479,47 @@ function configureAdmin(config) {
|
|
|
418
479
|
}
|
|
419
480
|
},
|
|
420
481
|
...formsEnabled ? {
|
|
482
|
+
studioFormSubmission: {
|
|
483
|
+
exact: true,
|
|
484
|
+
path: `${formsBasePath}/submissions/:id`,
|
|
485
|
+
Component: {
|
|
486
|
+
exportName: "AdminStudioFormSubmissionView",
|
|
487
|
+
path: clientPath,
|
|
488
|
+
clientProps: {
|
|
489
|
+
...studioNavClientProps,
|
|
490
|
+
formsCollectionSlug,
|
|
491
|
+
formSubmissionsCollectionSlug,
|
|
492
|
+
formUploadsCollectionSlug
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
},
|
|
496
|
+
studioFormUpload: {
|
|
497
|
+
exact: true,
|
|
498
|
+
path: `${formsBasePath}/uploads/:id`,
|
|
499
|
+
Component: {
|
|
500
|
+
exportName: "AdminStudioFormUploadView",
|
|
501
|
+
path: clientPath,
|
|
502
|
+
clientProps: {
|
|
503
|
+
...studioNavClientProps,
|
|
504
|
+
formUploadsCollectionSlug
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
},
|
|
508
|
+
studioFormDetail: {
|
|
509
|
+
exact: true,
|
|
510
|
+
path: `${formsBasePath}/:id`,
|
|
511
|
+
Component: {
|
|
512
|
+
exportName: "AdminStudioFormDetailView",
|
|
513
|
+
path: clientPath,
|
|
514
|
+
clientProps: {
|
|
515
|
+
...studioNavClientProps,
|
|
516
|
+
formsCollectionSlug,
|
|
517
|
+
formSubmissionsCollectionSlug
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
},
|
|
421
521
|
studioForms: {
|
|
522
|
+
exact: true,
|
|
422
523
|
path: formsBasePath,
|
|
423
524
|
Component: {
|
|
424
525
|
exportName: "AdminStudioFormsView",
|
|
@@ -432,10 +533,11 @@ function configureAdmin(config) {
|
|
|
432
533
|
}
|
|
433
534
|
}
|
|
434
535
|
} : {},
|
|
435
|
-
|
|
436
|
-
|
|
536
|
+
studioMediaItem: {
|
|
537
|
+
exact: true,
|
|
538
|
+
path: `${mediaBasePath}/:id`,
|
|
437
539
|
Component: {
|
|
438
|
-
exportName: "
|
|
540
|
+
exportName: "AdminStudioMediaItemView",
|
|
439
541
|
path: clientPath,
|
|
440
542
|
clientProps: {
|
|
441
543
|
...studioNavClientProps,
|
|
@@ -443,10 +545,11 @@ function configureAdmin(config) {
|
|
|
443
545
|
}
|
|
444
546
|
}
|
|
445
547
|
},
|
|
446
|
-
|
|
447
|
-
|
|
548
|
+
studioMedia: {
|
|
549
|
+
exact: true,
|
|
550
|
+
path: mediaBasePath,
|
|
448
551
|
Component: {
|
|
449
|
-
exportName: "
|
|
552
|
+
exportName: "AdminStudioMediaView",
|
|
450
553
|
path: clientPath,
|
|
451
554
|
clientProps: {
|
|
452
555
|
...studioNavClientProps,
|
|
@@ -455,6 +558,7 @@ function configureAdmin(config) {
|
|
|
455
558
|
}
|
|
456
559
|
},
|
|
457
560
|
studioTools: {
|
|
561
|
+
exact: true,
|
|
458
562
|
path: toolsBasePath,
|
|
459
563
|
Component: {
|
|
460
564
|
exportName: "AdminStudioToolsView",
|
|
@@ -499,6 +603,7 @@ function configureAdmin(config) {
|
|
|
499
603
|
path: clientPath,
|
|
500
604
|
clientProps: {
|
|
501
605
|
brandName,
|
|
606
|
+
logoOnDarkUrl,
|
|
502
607
|
logoUrl
|
|
503
608
|
}
|
|
504
609
|
}
|
|
@@ -607,25 +712,74 @@ function configureAdmin(config) {
|
|
|
607
712
|
return attachStudioBackBreadcrumbToCollection(mediaCollection);
|
|
608
713
|
},
|
|
609
714
|
wrapFormsCollection(formsCollection) {
|
|
610
|
-
return
|
|
715
|
+
return attachStudioEditRedirectToCollection(formsCollection, {
|
|
716
|
+
description: "Redirecting to the Studio form workspace.",
|
|
717
|
+
emptyHref: formsBasePath,
|
|
718
|
+
emptyLabel: "Open Forms",
|
|
719
|
+
pathBase: formsBasePath,
|
|
720
|
+
title: "Opening Form..."
|
|
721
|
+
});
|
|
611
722
|
},
|
|
612
723
|
wrapFormSubmissionsCollection(formSubmissionsCollection) {
|
|
613
|
-
return
|
|
724
|
+
return attachStudioEditRedirectToCollection(formSubmissionsCollection, {
|
|
725
|
+
description: "Redirecting to the Studio submission workspace.",
|
|
726
|
+
emptyHref: formsBasePath,
|
|
727
|
+
emptyLabel: "Open Forms",
|
|
728
|
+
pathBase: `${formsBasePath}/submissions`,
|
|
729
|
+
title: "Opening Submission..."
|
|
730
|
+
});
|
|
614
731
|
},
|
|
615
732
|
wrapFormUploadsCollection(formUploadsCollection) {
|
|
616
|
-
return
|
|
733
|
+
return attachStudioEditRedirectToCollection(formUploadsCollection, {
|
|
734
|
+
description: "Redirecting to the Studio upload workspace.",
|
|
735
|
+
emptyHref: formsBasePath,
|
|
736
|
+
emptyLabel: "Open Forms",
|
|
737
|
+
pathBase: `${formsBasePath}/uploads`,
|
|
738
|
+
title: "Opening Upload..."
|
|
739
|
+
});
|
|
617
740
|
},
|
|
618
741
|
wrapGlobals(globals2) {
|
|
619
|
-
const
|
|
742
|
+
const defaultLabelMap = {
|
|
620
743
|
header: { group: "Site Design", label: "Header & Navigation" },
|
|
621
744
|
footer: { group: "Site Design", label: "Footer" },
|
|
622
745
|
"site-settings": { group: "Site Design", label: "Website Settings" },
|
|
623
746
|
"social-media": { group: "Site Design", label: "Social Media" },
|
|
624
747
|
"contact-form": { group: "Lead Forms", label: "Contact Form" }
|
|
625
748
|
};
|
|
749
|
+
const configuredBySlug = new Map(
|
|
750
|
+
(config.studio?.globals || []).map((link) => [link.slug, link])
|
|
751
|
+
);
|
|
752
|
+
const attachBreadcrumbToGlobal = (global) => {
|
|
753
|
+
if (!studioEnabled) {
|
|
754
|
+
return global;
|
|
755
|
+
}
|
|
756
|
+
const existingControls = global.admin?.components?.elements?.beforeDocumentControls;
|
|
757
|
+
return {
|
|
758
|
+
...global,
|
|
759
|
+
admin: {
|
|
760
|
+
...global.admin,
|
|
761
|
+
components: {
|
|
762
|
+
...global.admin?.components,
|
|
763
|
+
elements: {
|
|
764
|
+
...global.admin?.components?.elements,
|
|
765
|
+
beforeDocumentControls: appendComponent(
|
|
766
|
+
existingControls,
|
|
767
|
+
studioBackBreadcrumbComponent,
|
|
768
|
+
"StudioBackBreadcrumb"
|
|
769
|
+
)
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
};
|
|
774
|
+
};
|
|
626
775
|
return globals2.map((global) => {
|
|
627
|
-
const
|
|
628
|
-
|
|
776
|
+
const configured = configuredBySlug.get(global.slug);
|
|
777
|
+
const defaults = defaultLabelMap[global.slug];
|
|
778
|
+
const mapping = configured || defaults ? {
|
|
779
|
+
group: configured?.group || defaults?.group,
|
|
780
|
+
label: configured?.label || defaults?.label || global.slug
|
|
781
|
+
} : void 0;
|
|
782
|
+
if (!mapping) return attachBreadcrumbToGlobal(global);
|
|
629
783
|
const shouldAttachSiteSettingsEditView = studioEnabled && global.slug === "site-settings";
|
|
630
784
|
const shouldAttachSocialMediaEditView = studioEnabled && global.slug === "social-media";
|
|
631
785
|
const shouldAttachContactFormRedirect = studioEnabled && global.slug === "contact-form";
|
|
@@ -734,7 +888,7 @@ function configureAdmin(config) {
|
|
|
734
888
|
...global,
|
|
735
889
|
admin: {
|
|
736
890
|
...global.admin,
|
|
737
|
-
group: mapping.group,
|
|
891
|
+
...mapping.group ? { group: mapping.group } : {},
|
|
738
892
|
components: {
|
|
739
893
|
...global.admin?.components,
|
|
740
894
|
elements: {
|
package/dist/admin/index.mjs
CHANGED
|
@@ -7,14 +7,14 @@ import {
|
|
|
7
7
|
socialMediaConnectionsField,
|
|
8
8
|
themePreferenceField,
|
|
9
9
|
withTooltips
|
|
10
|
-
} from "../chunk-
|
|
11
|
-
import "../chunk-W2UOCJDX.mjs";
|
|
10
|
+
} from "../chunk-MMJNHBOF.mjs";
|
|
12
11
|
import {
|
|
13
12
|
SOCIAL_MEDIA_DEFAULT_ICON_BY_PLATFORM,
|
|
14
13
|
SOCIAL_MEDIA_ICON_OPTIONS,
|
|
15
14
|
SOCIAL_MEDIA_PLATFORMS,
|
|
16
15
|
SOCIAL_MEDIA_PLATFORM_LABELS
|
|
17
16
|
} from "../chunk-ZTXJG4K5.mjs";
|
|
17
|
+
import "../chunk-W2UOCJDX.mjs";
|
|
18
18
|
import "../chunk-6BWS3CLP.mjs";
|
|
19
19
|
export {
|
|
20
20
|
SOCIAL_MEDIA_DEFAULT_ICON_BY_PLATFORM,
|
package/dist/admin-app/client.js
CHANGED
|
@@ -111,6 +111,14 @@ function NavIcon({ name }) {
|
|
|
111
111
|
return null;
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
+
function LogoutIcon() {
|
|
115
|
+
const props = { width: iconSize, height: iconSize, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", style: iconStyle };
|
|
116
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { ...props, "aria-hidden": "true", children: [
|
|
117
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4" }),
|
|
118
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("polyline", { points: "10 17 5 12 10 7" }),
|
|
119
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", { x1: "5", y1: "12", x2: "17", y2: "12" })
|
|
120
|
+
] });
|
|
121
|
+
}
|
|
114
122
|
function AdminShellClient({
|
|
115
123
|
children,
|
|
116
124
|
brandName,
|
|
@@ -122,14 +130,12 @@ function AdminShellClient({
|
|
|
122
130
|
onLogout,
|
|
123
131
|
storageKey = "orion-admin-shell-collapsed"
|
|
124
132
|
}) {
|
|
125
|
-
const [collapsed, setCollapsed] = (0, import_react.useState)(
|
|
133
|
+
const [collapsed, setCollapsed] = (0, import_react.useState)(true);
|
|
126
134
|
const [loggingOut, setLoggingOut] = (0, import_react.useState)(false);
|
|
127
135
|
(0, import_react.useEffect)(() => {
|
|
128
136
|
try {
|
|
129
137
|
const stored = window.localStorage.getItem(storageKey);
|
|
130
|
-
|
|
131
|
-
setCollapsed(true);
|
|
132
|
-
}
|
|
138
|
+
setCollapsed(stored === "1");
|
|
133
139
|
} catch {
|
|
134
140
|
}
|
|
135
141
|
}, [storageKey]);
|
|
@@ -191,7 +197,10 @@ function AdminShellClient({
|
|
|
191
197
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "orion-admin-user-label", children: "Signed in as" }),
|
|
192
198
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "orion-admin-user-email", children: userEmail })
|
|
193
199
|
] }) : null,
|
|
194
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
200
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", { className: "orion-admin-logout", disabled: loggingOut, onClick: handleLogout, type: "button", children: [
|
|
201
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(LogoutIcon, {}),
|
|
202
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: loggingOut ? "Logging out..." : "Log out" })
|
|
203
|
+
] })
|
|
195
204
|
] })
|
|
196
205
|
] }),
|
|
197
206
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("main", { className: "orion-admin-main", children })
|
|
@@ -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';
|