@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/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
|
}
|
|
@@ -455,6 +502,42 @@ function configureAdmin(config) {
|
|
|
455
502
|
formUploadsCollectionSlug
|
|
456
503
|
}
|
|
457
504
|
}
|
|
505
|
+
},
|
|
506
|
+
studioFormSubmission: {
|
|
507
|
+
path: `${formsBasePath}/submissions/:id`,
|
|
508
|
+
Component: {
|
|
509
|
+
exportName: "AdminStudioFormSubmissionView",
|
|
510
|
+
path: clientPath,
|
|
511
|
+
clientProps: {
|
|
512
|
+
...studioNavClientProps,
|
|
513
|
+
formsCollectionSlug,
|
|
514
|
+
formSubmissionsCollectionSlug,
|
|
515
|
+
formUploadsCollectionSlug
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
},
|
|
519
|
+
studioFormUpload: {
|
|
520
|
+
path: `${formsBasePath}/uploads/:id`,
|
|
521
|
+
Component: {
|
|
522
|
+
exportName: "AdminStudioFormUploadView",
|
|
523
|
+
path: clientPath,
|
|
524
|
+
clientProps: {
|
|
525
|
+
...studioNavClientProps,
|
|
526
|
+
formUploadsCollectionSlug
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
},
|
|
530
|
+
studioFormDetail: {
|
|
531
|
+
path: `${formsBasePath}/:id`,
|
|
532
|
+
Component: {
|
|
533
|
+
exportName: "AdminStudioFormDetailView",
|
|
534
|
+
path: clientPath,
|
|
535
|
+
clientProps: {
|
|
536
|
+
...studioNavClientProps,
|
|
537
|
+
formsCollectionSlug,
|
|
538
|
+
formSubmissionsCollectionSlug
|
|
539
|
+
}
|
|
540
|
+
}
|
|
458
541
|
}
|
|
459
542
|
} : {},
|
|
460
543
|
studioMedia: {
|
|
@@ -524,6 +607,7 @@ function configureAdmin(config) {
|
|
|
524
607
|
path: clientPath,
|
|
525
608
|
clientProps: {
|
|
526
609
|
brandName,
|
|
610
|
+
logoOnDarkUrl,
|
|
527
611
|
logoUrl
|
|
528
612
|
}
|
|
529
613
|
}
|
|
@@ -560,8 +644,17 @@ function configureAdmin(config) {
|
|
|
560
644
|
const hasThemePreference = existingFields.some(
|
|
561
645
|
(field) => typeof field === "object" && field !== null && "name" in field && field.name === "themePreference"
|
|
562
646
|
);
|
|
647
|
+
const normalizedAuth = usersCollection.auth === true ? {
|
|
648
|
+
tokenExpiration: userSessionDurationSeconds,
|
|
649
|
+
useSessions: true
|
|
650
|
+
} : usersCollection.auth && typeof usersCollection.auth === "object" ? {
|
|
651
|
+
...usersCollection.auth,
|
|
652
|
+
tokenExpiration: usersCollection.auth.tokenExpiration ?? userSessionDurationSeconds,
|
|
653
|
+
useSessions: usersCollection.auth.useSessions ?? true
|
|
654
|
+
} : usersCollection.auth;
|
|
563
655
|
const nextCollection = {
|
|
564
656
|
...usersCollection,
|
|
657
|
+
auth: normalizedAuth,
|
|
565
658
|
fields: !allowThemePreference || hasThemePreference ? existingFields : [...existingFields, createThemePreferenceField(defaultTheme)]
|
|
566
659
|
};
|
|
567
660
|
return attachStudioBackBreadcrumbToCollection(nextCollection);
|
|
@@ -623,13 +716,31 @@ function configureAdmin(config) {
|
|
|
623
716
|
return attachStudioBackBreadcrumbToCollection(mediaCollection);
|
|
624
717
|
},
|
|
625
718
|
wrapFormsCollection(formsCollection) {
|
|
626
|
-
return
|
|
719
|
+
return attachStudioEditRedirectToCollection(formsCollection, {
|
|
720
|
+
description: "Redirecting to the Studio form workspace.",
|
|
721
|
+
emptyHref: formsBasePath,
|
|
722
|
+
emptyLabel: "Open Forms",
|
|
723
|
+
pathBase: formsBasePath,
|
|
724
|
+
title: "Opening Form..."
|
|
725
|
+
});
|
|
627
726
|
},
|
|
628
727
|
wrapFormSubmissionsCollection(formSubmissionsCollection) {
|
|
629
|
-
return
|
|
728
|
+
return attachStudioEditRedirectToCollection(formSubmissionsCollection, {
|
|
729
|
+
description: "Redirecting to the Studio submission workspace.",
|
|
730
|
+
emptyHref: formsBasePath,
|
|
731
|
+
emptyLabel: "Open Forms",
|
|
732
|
+
pathBase: `${formsBasePath}/submissions`,
|
|
733
|
+
title: "Opening Submission..."
|
|
734
|
+
});
|
|
630
735
|
},
|
|
631
736
|
wrapFormUploadsCollection(formUploadsCollection) {
|
|
632
|
-
return
|
|
737
|
+
return attachStudioEditRedirectToCollection(formUploadsCollection, {
|
|
738
|
+
description: "Redirecting to the Studio upload workspace.",
|
|
739
|
+
emptyHref: formsBasePath,
|
|
740
|
+
emptyLabel: "Open Forms",
|
|
741
|
+
pathBase: `${formsBasePath}/uploads`,
|
|
742
|
+
title: "Opening Upload..."
|
|
743
|
+
});
|
|
633
744
|
},
|
|
634
745
|
wrapGlobals(globals2) {
|
|
635
746
|
const labelMap = {
|
|
@@ -3629,6 +3740,7 @@ var defaultBuilderThemeTokens = {
|
|
|
3629
3740
|
|
|
3630
3741
|
// src/studio-pages/builder/adapters/settingsV2.ts
|
|
3631
3742
|
var isRecord3 = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
3743
|
+
var isTextAlign = (value) => value === "left" || value === "center" || value === "right" || value === "justify";
|
|
3632
3744
|
var parsePercent = (value) => {
|
|
3633
3745
|
if (typeof value === "number" && Number.isFinite(value)) {
|
|
3634
3746
|
return Math.max(0, Math.min(100, value));
|
|
@@ -3671,6 +3783,10 @@ var mergeSettings = (defaults, input) => {
|
|
|
3671
3783
|
};
|
|
3672
3784
|
var legacyBlockToV2Settings = (block) => {
|
|
3673
3785
|
const current = structuredClone(defaultBuilderBlockSettingsV2);
|
|
3786
|
+
if (block.blockType === "hero" && block.variant === "centered") {
|
|
3787
|
+
current.typography.headingAlign = "center";
|
|
3788
|
+
current.typography.bodyAlign = "center";
|
|
3789
|
+
}
|
|
3674
3790
|
current.layout.contentWidth = block.contentWidth === "narrow" || block.contentWidth === "content" || block.contentWidth === "wide" || block.contentWidth === "full" || block.contentWidth === "inherit" ? block.contentWidth : current.layout.contentWidth;
|
|
3675
3791
|
current.layout.sectionPaddingX = block.sectionPaddingX === "none" || block.sectionPaddingX === "sm" || block.sectionPaddingX === "md" || block.sectionPaddingX === "lg" || block.sectionPaddingX === "inherit" ? block.sectionPaddingX : current.layout.sectionPaddingX;
|
|
3676
3792
|
current.layout.sectionPaddingY = block.sectionPaddingY === "none" || block.sectionPaddingY === "sm" || block.sectionPaddingY === "lg" ? block.sectionPaddingY : current.layout.sectionPaddingY;
|
|
@@ -3707,8 +3823,8 @@ var legacyBlockToV2Settings = (block) => {
|
|
|
3707
3823
|
current.media.positionX = parsePercent(block.imagePositionX ?? block.backgroundImagePositionX);
|
|
3708
3824
|
current.media.positionY = parsePercent(block.imagePositionY ?? block.backgroundImagePositionY);
|
|
3709
3825
|
current.media.height = parsePixel(block.imageHeight);
|
|
3710
|
-
current.typography.headingAlign = block.textHeadingAlign
|
|
3711
|
-
current.typography.bodyAlign = block.textBodyAlign
|
|
3826
|
+
current.typography.headingAlign = isTextAlign(block.textHeadingAlign) ? block.textHeadingAlign : current.typography.headingAlign;
|
|
3827
|
+
current.typography.bodyAlign = isTextAlign(block.textBodyAlign) ? block.textBodyAlign : current.typography.bodyAlign;
|
|
3712
3828
|
current.typography.maxTextWidth = block.textMaxWidth === "auto" || block.textMaxWidth === "sm" || block.textMaxWidth === "md" || block.textMaxWidth === "lg" || block.textMaxWidth === "full" ? block.textMaxWidth : current.typography.maxTextWidth;
|
|
3713
3829
|
current.typography.lineHeightPreset = block.textLineHeightPreset === "tight" || block.textLineHeightPreset === "normal" || block.textLineHeightPreset === "relaxed" ? block.textLineHeightPreset : current.typography.lineHeightPreset;
|
|
3714
3830
|
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-3AHBR7RI.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 = {
|
|
@@ -256,36 +256,44 @@ h4 {
|
|
|
256
256
|
}
|
|
257
257
|
|
|
258
258
|
.hero-content {
|
|
259
|
-
position: absolute;
|
|
260
|
-
inset: 0;
|
|
261
259
|
display: flex;
|
|
262
260
|
flex-direction: column;
|
|
263
261
|
justify-content: center;
|
|
264
|
-
|
|
262
|
+
inset: 0;
|
|
265
263
|
max-width: 610px;
|
|
264
|
+
padding: 2rem;
|
|
265
|
+
position: absolute;
|
|
266
|
+
text-align: var(--orion-builder-body-align, left);
|
|
266
267
|
}
|
|
267
268
|
|
|
268
269
|
.hero h1 {
|
|
269
270
|
font-size: clamp(2rem, 4vw, 3.1rem);
|
|
270
271
|
letter-spacing: -0.02em;
|
|
271
272
|
margin: 0;
|
|
273
|
+
text-align: var(--orion-builder-heading-align, var(--orion-builder-body-align, left));
|
|
272
274
|
}
|
|
273
275
|
|
|
274
276
|
.hero p {
|
|
277
|
+
color: color-mix(in srgb, var(--orion-studio-accent-contrast) 90%, transparent);
|
|
275
278
|
margin-top: 0.75rem;
|
|
276
279
|
max-width: 48ch;
|
|
277
|
-
|
|
280
|
+
text-align: var(--orion-builder-body-align, left);
|
|
278
281
|
}
|
|
279
282
|
|
|
280
283
|
.hero-actions {
|
|
281
284
|
display: flex;
|
|
282
285
|
flex-wrap: wrap;
|
|
283
286
|
gap: 0.75rem;
|
|
287
|
+
justify-content: var(--orion-builder-actions-align, flex-start);
|
|
284
288
|
margin-top: 1.1rem;
|
|
285
289
|
}
|
|
286
290
|
|
|
287
291
|
.hero-centered .hero-content {
|
|
288
|
-
text-align: center;
|
|
292
|
+
text-align: var(--orion-builder-body-align, center);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.hero .kicker {
|
|
296
|
+
text-align: var(--orion-builder-heading-align, var(--orion-builder-body-align, left));
|
|
289
297
|
}
|
|
290
298
|
|
|
291
299
|
.features {
|
|
@@ -984,6 +992,11 @@ h4 {
|
|
|
984
992
|
text-align: var(--orion-builder-heading-align, inherit);
|
|
985
993
|
}
|
|
986
994
|
|
|
995
|
+
.orion-builder-content p,
|
|
996
|
+
.orion-builder-content li {
|
|
997
|
+
text-align: var(--orion-builder-body-align, inherit);
|
|
998
|
+
}
|
|
999
|
+
|
|
987
1000
|
/* Builder-only override: show full testimonial copy even if host app globals clamp it. */
|
|
988
1001
|
.orion-builder-shell .orion-builder-content .testimonial-quote {
|
|
989
1002
|
-webkit-box-orient: initial;
|
|
@@ -156,6 +156,7 @@ var defaultBuilderThemeTokens = {
|
|
|
156
156
|
|
|
157
157
|
// src/studio-pages/builder/adapters/settingsV2.ts
|
|
158
158
|
var isRecord = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
159
|
+
var isTextAlign = (value) => value === "left" || value === "center" || value === "right" || value === "justify";
|
|
159
160
|
var parsePercent = (value) => {
|
|
160
161
|
if (typeof value === "number" && Number.isFinite(value)) {
|
|
161
162
|
return Math.max(0, Math.min(100, value));
|
|
@@ -198,6 +199,10 @@ var mergeSettings = (defaults, input) => {
|
|
|
198
199
|
};
|
|
199
200
|
var legacyBlockToV2Settings = (block) => {
|
|
200
201
|
const current = structuredClone(defaultBuilderBlockSettingsV2);
|
|
202
|
+
if (block.blockType === "hero" && block.variant === "centered") {
|
|
203
|
+
current.typography.headingAlign = "center";
|
|
204
|
+
current.typography.bodyAlign = "center";
|
|
205
|
+
}
|
|
201
206
|
current.layout.contentWidth = block.contentWidth === "narrow" || block.contentWidth === "content" || block.contentWidth === "wide" || block.contentWidth === "full" || block.contentWidth === "inherit" ? block.contentWidth : current.layout.contentWidth;
|
|
202
207
|
current.layout.sectionPaddingX = block.sectionPaddingX === "none" || block.sectionPaddingX === "sm" || block.sectionPaddingX === "md" || block.sectionPaddingX === "lg" || block.sectionPaddingX === "inherit" ? block.sectionPaddingX : current.layout.sectionPaddingX;
|
|
203
208
|
current.layout.sectionPaddingY = block.sectionPaddingY === "none" || block.sectionPaddingY === "sm" || block.sectionPaddingY === "lg" ? block.sectionPaddingY : current.layout.sectionPaddingY;
|
|
@@ -234,8 +239,8 @@ var legacyBlockToV2Settings = (block) => {
|
|
|
234
239
|
current.media.positionX = parsePercent(block.imagePositionX ?? block.backgroundImagePositionX);
|
|
235
240
|
current.media.positionY = parsePercent(block.imagePositionY ?? block.backgroundImagePositionY);
|
|
236
241
|
current.media.height = parsePixel(block.imageHeight);
|
|
237
|
-
current.typography.headingAlign = block.textHeadingAlign
|
|
238
|
-
current.typography.bodyAlign = block.textBodyAlign
|
|
242
|
+
current.typography.headingAlign = isTextAlign(block.textHeadingAlign) ? block.textHeadingAlign : current.typography.headingAlign;
|
|
243
|
+
current.typography.bodyAlign = isTextAlign(block.textBodyAlign) ? block.textBodyAlign : current.typography.bodyAlign;
|
|
239
244
|
current.typography.maxTextWidth = block.textMaxWidth === "auto" || block.textMaxWidth === "sm" || block.textMaxWidth === "md" || block.textMaxWidth === "lg" || block.textMaxWidth === "full" ? block.textMaxWidth : current.typography.maxTextWidth;
|
|
240
245
|
current.typography.lineHeightPreset = block.textLineHeightPreset === "tight" || block.textLineHeightPreset === "normal" || block.textLineHeightPreset === "relaxed" ? block.textLineHeightPreset : current.typography.lineHeightPreset;
|
|
241
246
|
current.typography.letterSpacingPreset = block.textLetterSpacingPreset === "tight" || block.textLetterSpacingPreset === "normal" || block.textLetterSpacingPreset === "relaxed" ? block.textLetterSpacingPreset : current.typography.letterSpacingPreset;
|
|
@@ -4704,8 +4709,9 @@ function BuilderPageEditor({
|
|
|
4704
4709
|
const heroMedia = block.blockType === "hero" ? resolveMedia(block.media) : null;
|
|
4705
4710
|
const heroHasImage = block.blockType === "hero" && Boolean(heroBackgroundImageURL || heroMedia?.url);
|
|
4706
4711
|
const heroTextColor = block.blockType === "hero" ? heroHasImage ? "#ffffff" : heroBackgroundColor ? getReadableTextColor(heroBackgroundColor, resolvedThemeTokens.colors.headingText, "#ffffff") : resolvedThemeTokens.colors.headingText : null;
|
|
4712
|
+
const bodyAlign = blockTypography.bodyAlign === "center" || blockTypography.bodyAlign === "justify" || blockTypography.bodyAlign === "right" ? blockTypography.bodyAlign : "left";
|
|
4707
4713
|
const typographyStyle = resolveTypographyStyleFromSettings({
|
|
4708
|
-
bodyAlign
|
|
4714
|
+
bodyAlign,
|
|
4709
4715
|
letterSpacingPreset: blockTypography.letterSpacingPreset === "tight" || blockTypography.letterSpacingPreset === "relaxed" ? blockTypography.letterSpacingPreset : "normal",
|
|
4710
4716
|
lineHeightPreset: blockTypography.lineHeightPreset === "tight" || blockTypography.lineHeightPreset === "relaxed" ? blockTypography.lineHeightPreset : "normal",
|
|
4711
4717
|
maxTextWidth: blockTypography.maxTextWidth === "sm" || blockTypography.maxTextWidth === "md" || blockTypography.maxTextWidth === "lg" || blockTypography.maxTextWidth === "full" ? blockTypography.maxTextWidth : "auto"
|
|
@@ -4721,6 +4727,8 @@ function BuilderPageEditor({
|
|
|
4721
4727
|
...shell.contentStyle,
|
|
4722
4728
|
...inheritProjectStyles ? {} : {
|
|
4723
4729
|
"--orion-builder-heading-align": headingAlign,
|
|
4730
|
+
"--orion-builder-body-align": bodyAlign,
|
|
4731
|
+
"--orion-builder-actions-align": bodyAlign === "center" ? "center" : bodyAlign === "right" ? "flex-end" : "flex-start",
|
|
4724
4732
|
"--orion-builder-heading-color": headingColor,
|
|
4725
4733
|
color: bodyColor,
|
|
4726
4734
|
...typographyStyle
|
|
@@ -129,6 +129,7 @@ var defaultBuilderThemeTokens = {
|
|
|
129
129
|
|
|
130
130
|
// src/studio-pages/builder/adapters/settingsV2.ts
|
|
131
131
|
var isRecord = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
132
|
+
var isTextAlign = (value) => value === "left" || value === "center" || value === "right" || value === "justify";
|
|
132
133
|
var parsePercent = (value) => {
|
|
133
134
|
if (typeof value === "number" && Number.isFinite(value)) {
|
|
134
135
|
return Math.max(0, Math.min(100, value));
|
|
@@ -171,6 +172,10 @@ var mergeSettings = (defaults, input) => {
|
|
|
171
172
|
};
|
|
172
173
|
var legacyBlockToV2Settings = (block) => {
|
|
173
174
|
const current = structuredClone(defaultBuilderBlockSettingsV2);
|
|
175
|
+
if (block.blockType === "hero" && block.variant === "centered") {
|
|
176
|
+
current.typography.headingAlign = "center";
|
|
177
|
+
current.typography.bodyAlign = "center";
|
|
178
|
+
}
|
|
174
179
|
current.layout.contentWidth = block.contentWidth === "narrow" || block.contentWidth === "content" || block.contentWidth === "wide" || block.contentWidth === "full" || block.contentWidth === "inherit" ? block.contentWidth : current.layout.contentWidth;
|
|
175
180
|
current.layout.sectionPaddingX = block.sectionPaddingX === "none" || block.sectionPaddingX === "sm" || block.sectionPaddingX === "md" || block.sectionPaddingX === "lg" || block.sectionPaddingX === "inherit" ? block.sectionPaddingX : current.layout.sectionPaddingX;
|
|
176
181
|
current.layout.sectionPaddingY = block.sectionPaddingY === "none" || block.sectionPaddingY === "sm" || block.sectionPaddingY === "lg" ? block.sectionPaddingY : current.layout.sectionPaddingY;
|
|
@@ -207,8 +212,8 @@ var legacyBlockToV2Settings = (block) => {
|
|
|
207
212
|
current.media.positionX = parsePercent(block.imagePositionX ?? block.backgroundImagePositionX);
|
|
208
213
|
current.media.positionY = parsePercent(block.imagePositionY ?? block.backgroundImagePositionY);
|
|
209
214
|
current.media.height = parsePixel(block.imageHeight);
|
|
210
|
-
current.typography.headingAlign = block.textHeadingAlign
|
|
211
|
-
current.typography.bodyAlign = block.textBodyAlign
|
|
215
|
+
current.typography.headingAlign = isTextAlign(block.textHeadingAlign) ? block.textHeadingAlign : current.typography.headingAlign;
|
|
216
|
+
current.typography.bodyAlign = isTextAlign(block.textBodyAlign) ? block.textBodyAlign : current.typography.bodyAlign;
|
|
212
217
|
current.typography.maxTextWidth = block.textMaxWidth === "auto" || block.textMaxWidth === "sm" || block.textMaxWidth === "md" || block.textMaxWidth === "lg" || block.textMaxWidth === "full" ? block.textMaxWidth : current.typography.maxTextWidth;
|
|
213
218
|
current.typography.lineHeightPreset = block.textLineHeightPreset === "tight" || block.textLineHeightPreset === "normal" || block.textLineHeightPreset === "relaxed" ? block.textLineHeightPreset : current.typography.lineHeightPreset;
|
|
214
219
|
current.typography.letterSpacingPreset = block.textLetterSpacingPreset === "tight" || block.textLetterSpacingPreset === "normal" || block.textLetterSpacingPreset === "relaxed" ? block.textLetterSpacingPreset : current.typography.letterSpacingPreset;
|
|
@@ -4584,8 +4589,9 @@ function BuilderPageEditor({
|
|
|
4584
4589
|
const heroMedia = block.blockType === "hero" ? resolveMedia(block.media) : null;
|
|
4585
4590
|
const heroHasImage = block.blockType === "hero" && Boolean(heroBackgroundImageURL || heroMedia?.url);
|
|
4586
4591
|
const heroTextColor = block.blockType === "hero" ? heroHasImage ? "#ffffff" : heroBackgroundColor ? getReadableTextColor(heroBackgroundColor, resolvedThemeTokens.colors.headingText, "#ffffff") : resolvedThemeTokens.colors.headingText : null;
|
|
4592
|
+
const bodyAlign = blockTypography.bodyAlign === "center" || blockTypography.bodyAlign === "justify" || blockTypography.bodyAlign === "right" ? blockTypography.bodyAlign : "left";
|
|
4587
4593
|
const typographyStyle = resolveTypographyStyleFromSettings({
|
|
4588
|
-
bodyAlign
|
|
4594
|
+
bodyAlign,
|
|
4589
4595
|
letterSpacingPreset: blockTypography.letterSpacingPreset === "tight" || blockTypography.letterSpacingPreset === "relaxed" ? blockTypography.letterSpacingPreset : "normal",
|
|
4590
4596
|
lineHeightPreset: blockTypography.lineHeightPreset === "tight" || blockTypography.lineHeightPreset === "relaxed" ? blockTypography.lineHeightPreset : "normal",
|
|
4591
4597
|
maxTextWidth: blockTypography.maxTextWidth === "sm" || blockTypography.maxTextWidth === "md" || blockTypography.maxTextWidth === "lg" || blockTypography.maxTextWidth === "full" ? blockTypography.maxTextWidth : "auto"
|
|
@@ -4601,6 +4607,8 @@ function BuilderPageEditor({
|
|
|
4601
4607
|
...shell.contentStyle,
|
|
4602
4608
|
...inheritProjectStyles ? {} : {
|
|
4603
4609
|
"--orion-builder-heading-align": headingAlign,
|
|
4610
|
+
"--orion-builder-body-align": bodyAlign,
|
|
4611
|
+
"--orion-builder-actions-align": bodyAlign === "center" ? "center" : bodyAlign === "right" ? "flex-end" : "flex-start",
|
|
4604
4612
|
"--orion-builder-heading-color": headingColor,
|
|
4605
4613
|
color: bodyColor,
|
|
4606
4614
|
...typographyStyle
|
|
@@ -156,6 +156,7 @@ var defaultBuilderThemeTokens = {
|
|
|
156
156
|
|
|
157
157
|
// src/studio-pages/builder/adapters/settingsV2.ts
|
|
158
158
|
var isRecord = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
159
|
+
var isTextAlign = (value) => value === "left" || value === "center" || value === "right" || value === "justify";
|
|
159
160
|
var parsePercent = (value) => {
|
|
160
161
|
if (typeof value === "number" && Number.isFinite(value)) {
|
|
161
162
|
return Math.max(0, Math.min(100, value));
|
|
@@ -198,6 +199,10 @@ var mergeSettings = (defaults, input) => {
|
|
|
198
199
|
};
|
|
199
200
|
var legacyBlockToV2Settings = (block) => {
|
|
200
201
|
const current = structuredClone(defaultBuilderBlockSettingsV2);
|
|
202
|
+
if (block.blockType === "hero" && block.variant === "centered") {
|
|
203
|
+
current.typography.headingAlign = "center";
|
|
204
|
+
current.typography.bodyAlign = "center";
|
|
205
|
+
}
|
|
201
206
|
current.layout.contentWidth = block.contentWidth === "narrow" || block.contentWidth === "content" || block.contentWidth === "wide" || block.contentWidth === "full" || block.contentWidth === "inherit" ? block.contentWidth : current.layout.contentWidth;
|
|
202
207
|
current.layout.sectionPaddingX = block.sectionPaddingX === "none" || block.sectionPaddingX === "sm" || block.sectionPaddingX === "md" || block.sectionPaddingX === "lg" || block.sectionPaddingX === "inherit" ? block.sectionPaddingX : current.layout.sectionPaddingX;
|
|
203
208
|
current.layout.sectionPaddingY = block.sectionPaddingY === "none" || block.sectionPaddingY === "sm" || block.sectionPaddingY === "lg" ? block.sectionPaddingY : current.layout.sectionPaddingY;
|
|
@@ -234,8 +239,8 @@ var legacyBlockToV2Settings = (block) => {
|
|
|
234
239
|
current.media.positionX = parsePercent(block.imagePositionX ?? block.backgroundImagePositionX);
|
|
235
240
|
current.media.positionY = parsePercent(block.imagePositionY ?? block.backgroundImagePositionY);
|
|
236
241
|
current.media.height = parsePixel(block.imageHeight);
|
|
237
|
-
current.typography.headingAlign = block.textHeadingAlign
|
|
238
|
-
current.typography.bodyAlign = block.textBodyAlign
|
|
242
|
+
current.typography.headingAlign = isTextAlign(block.textHeadingAlign) ? block.textHeadingAlign : current.typography.headingAlign;
|
|
243
|
+
current.typography.bodyAlign = isTextAlign(block.textBodyAlign) ? block.textBodyAlign : current.typography.bodyAlign;
|
|
239
244
|
current.typography.maxTextWidth = block.textMaxWidth === "auto" || block.textMaxWidth === "sm" || block.textMaxWidth === "md" || block.textMaxWidth === "lg" || block.textMaxWidth === "full" ? block.textMaxWidth : current.typography.maxTextWidth;
|
|
240
245
|
current.typography.lineHeightPreset = block.textLineHeightPreset === "tight" || block.textLineHeightPreset === "normal" || block.textLineHeightPreset === "relaxed" ? block.textLineHeightPreset : current.typography.lineHeightPreset;
|
|
241
246
|
current.typography.letterSpacingPreset = block.textLetterSpacingPreset === "tight" || block.textLetterSpacingPreset === "normal" || block.textLetterSpacingPreset === "relaxed" ? block.textLetterSpacingPreset : current.typography.letterSpacingPreset;
|
|
@@ -7,14 +7,14 @@ import {
|
|
|
7
7
|
pageStudioModuleManifest,
|
|
8
8
|
resolveBuilderThemeTokens,
|
|
9
9
|
toEditorInitialDoc
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-EDW7DPXW.mjs";
|
|
11
11
|
import "../chunk-OQSEJXC4.mjs";
|
|
12
12
|
import {
|
|
13
13
|
createDefaultStudioDocument,
|
|
14
14
|
defaultBuilderThemeTokens,
|
|
15
15
|
layoutToStudioDocument,
|
|
16
16
|
studioDocumentToLayout
|
|
17
|
-
} from "../chunk-
|
|
17
|
+
} from "../chunk-4LSIUED5.mjs";
|
|
18
18
|
import "../chunk-ADIIWIYL.mjs";
|
|
19
19
|
import "../chunk-6BWS3CLP.mjs";
|
|
20
20
|
export {
|
package/package.json
CHANGED