@orion-studios/payload-studio 0.6.0-beta.4 → 0.6.0-beta.40
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 -0
- package/dist/admin/client.d.ts +1 -0
- package/dist/admin/client.js +3924 -1355
- package/dist/admin/client.mjs +4090 -1533
- package/dist/admin/index.d.mts +2 -3
- package/dist/admin/index.d.ts +2 -3
- package/dist/admin/index.js +141 -1522
- package/dist/admin/index.mjs +2 -4
- package/dist/admin-app/client.js +11 -4
- 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/index.mjs +4 -4
- package/dist/admin-app/styles.css +343 -41
- package/dist/admin.css +18 -2
- package/dist/{chunk-KPIX7OSV.mjs → chunk-2XH7X34N.mjs} +11 -4
- package/dist/{chunk-OTHERBGX.mjs → chunk-AWL7TIEI.mjs} +1 -1
- package/dist/{chunk-PF3EBZXF.mjs → chunk-CUPMTHGX.mjs} +19 -3
- package/dist/chunk-JC3UV74N.mjs +1033 -0
- package/dist/{chunk-XKUTZ7IU.mjs → chunk-LUF62ZWF.mjs} +31 -5
- package/dist/{chunk-EHUE4LCT.mjs → chunk-RKTIFEUY.mjs} +33 -3
- package/dist/chunk-W2UOCJDX.mjs +32 -0
- package/dist/{index-bbA3HSxa.d.ts → index-BV0vEGl6.d.ts} +6 -9
- package/dist/{index-52HdVLQq.d.ts → index-DAdN56fM.d.ts} +1 -1
- package/dist/{index-DEkV-sMs.d.mts → index-DLfPOqYA.d.mts} +6 -9
- package/dist/{index-Cv-6qnrw.d.mts → index-DRu4fKxf.d.mts} +1 -1
- package/dist/{index-DEQC3Dwj.d.mts → index-G_uTNffQ.d.mts} +1 -1
- package/dist/{index-Crx_MtPw.d.ts → index-vkEwwsoC.d.ts} +1 -1
- package/dist/index.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +249 -1542
- package/dist/index.mjs +10 -10
- package/dist/nextjs/index.js +19 -3
- 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 +455 -63
- package/dist/studio-pages/client.mjs +455 -63
- package/dist/studio-pages/index.d.mts +1 -1
- package/dist/studio-pages/index.d.ts +1 -1
- package/dist/studio-pages/index.js +46 -4
- package/dist/studio-pages/index.mjs +3 -3
- package/package.json +1 -1
- package/dist/chunk-DYXSAVUQ.mjs +0 -2372
- package/dist/chunk-Z6L5K5MH.mjs +0 -64
|
@@ -99,6 +99,7 @@ var defaultBuilderThemeTokens = {
|
|
|
99
99
|
|
|
100
100
|
// src/studio-pages/builder/adapters/settingsV2.ts
|
|
101
101
|
var isRecord = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
102
|
+
var isTextAlign = (value) => value === "left" || value === "center" || value === "right" || value === "justify";
|
|
102
103
|
var parsePercent = (value) => {
|
|
103
104
|
if (typeof value === "number" && Number.isFinite(value)) {
|
|
104
105
|
return Math.max(0, Math.min(100, value));
|
|
@@ -141,6 +142,10 @@ var mergeSettings = (defaults, input) => {
|
|
|
141
142
|
};
|
|
142
143
|
var legacyBlockToV2Settings = (block) => {
|
|
143
144
|
const current = structuredClone(defaultBuilderBlockSettingsV2);
|
|
145
|
+
if (block.blockType === "hero" && block.variant === "centered") {
|
|
146
|
+
current.typography.headingAlign = "center";
|
|
147
|
+
current.typography.bodyAlign = "center";
|
|
148
|
+
}
|
|
144
149
|
current.layout.contentWidth = block.contentWidth === "narrow" || block.contentWidth === "content" || block.contentWidth === "wide" || block.contentWidth === "full" || block.contentWidth === "inherit" ? block.contentWidth : current.layout.contentWidth;
|
|
145
150
|
current.layout.sectionPaddingX = block.sectionPaddingX === "none" || block.sectionPaddingX === "sm" || block.sectionPaddingX === "md" || block.sectionPaddingX === "lg" || block.sectionPaddingX === "inherit" ? block.sectionPaddingX : current.layout.sectionPaddingX;
|
|
146
151
|
current.layout.sectionPaddingY = block.sectionPaddingY === "none" || block.sectionPaddingY === "sm" || block.sectionPaddingY === "lg" ? block.sectionPaddingY : current.layout.sectionPaddingY;
|
|
@@ -177,15 +182,26 @@ var legacyBlockToV2Settings = (block) => {
|
|
|
177
182
|
current.media.positionX = parsePercent(block.imagePositionX ?? block.backgroundImagePositionX);
|
|
178
183
|
current.media.positionY = parsePercent(block.imagePositionY ?? block.backgroundImagePositionY);
|
|
179
184
|
current.media.height = parsePixel(block.imageHeight);
|
|
180
|
-
current.typography.headingAlign = block.textHeadingAlign
|
|
181
|
-
current.typography.bodyAlign = block.textBodyAlign
|
|
185
|
+
current.typography.headingAlign = isTextAlign(block.textHeadingAlign) ? block.textHeadingAlign : current.typography.headingAlign;
|
|
186
|
+
current.typography.bodyAlign = isTextAlign(block.textBodyAlign) ? block.textBodyAlign : current.typography.bodyAlign;
|
|
182
187
|
current.typography.maxTextWidth = block.textMaxWidth === "auto" || block.textMaxWidth === "sm" || block.textMaxWidth === "md" || block.textMaxWidth === "lg" || block.textMaxWidth === "full" ? block.textMaxWidth : current.typography.maxTextWidth;
|
|
183
188
|
current.typography.lineHeightPreset = block.textLineHeightPreset === "tight" || block.textLineHeightPreset === "normal" || block.textLineHeightPreset === "relaxed" ? block.textLineHeightPreset : current.typography.lineHeightPreset;
|
|
184
189
|
current.typography.letterSpacingPreset = block.textLetterSpacingPreset === "tight" || block.textLetterSpacingPreset === "normal" || block.textLetterSpacingPreset === "relaxed" ? block.textLetterSpacingPreset : current.typography.letterSpacingPreset;
|
|
185
190
|
current.advanced.editCopyInPanel = Boolean(block.editCopyInPanel ?? current.advanced.editCopyInPanel);
|
|
186
191
|
current.advanced.customClassName = typeof block.customClassName === "string" ? block.customClassName : current.advanced.customClassName;
|
|
187
192
|
current.advanced.hideOnMobile = Boolean(block.hideOnMobile ?? current.advanced.hideOnMobile);
|
|
188
|
-
|
|
193
|
+
const settings = mergeSettings(current, block.settings);
|
|
194
|
+
if (block.blockType === "hero") {
|
|
195
|
+
const top = settings.layout.paddingTopPt;
|
|
196
|
+
const bottom = settings.layout.paddingBottomPt;
|
|
197
|
+
const hasLegacyLinkedHeroPadding = settings.layout.linkVerticalPadding !== false && (top === null || typeof top === "undefined" || top === 30) && (bottom === null || typeof bottom === "undefined" || bottom === 30 || bottom === 20);
|
|
198
|
+
if (hasLegacyLinkedHeroPadding) {
|
|
199
|
+
settings.layout.linkVerticalPadding = false;
|
|
200
|
+
settings.layout.paddingTopPt = 30;
|
|
201
|
+
settings.layout.paddingBottomPt = 20;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
return settings;
|
|
189
205
|
};
|
|
190
206
|
var v2SettingsToLegacyBlock = (blockWithSettings) => {
|
|
191
207
|
const settings = legacyBlockToV2Settings(blockWithSettings);
|