@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { B as BuilderBlock, a as BuilderBlockPreviewRenderArgs, b as BuilderBlockPreviewRenderer, c as BuilderBlockSettingsV2, d as BuilderInlineTextComponentProps, e as BuilderPreviewEditingHelpers, f as BuilderPreviewTextFieldOptions, g as BuilderRenderWithSectionShell, h as BuilderSettingsPanelMode, j as BuilderThemeTokenOverrides, k as BuilderThemeTokens, S as SectionPreset, l as createDefaultStudioDocument, m as createStudioPageService, n as defaultBuilderThemeTokens, o as getStudioDocumentFromPage, p as layoutToStudioDocument, q as pageInspectorPanels, r as pageNodeTypes, s as pagePaletteGroups, t as pageStudioModuleManifest, u as resolveBuilderThemeTokens, v as studioDocumentToLayout, w as toEditorInitialDoc } from '../index-
|
|
1
|
+
export { B as BuilderBlock, a as BuilderBlockPreviewRenderArgs, b as BuilderBlockPreviewRenderer, c as BuilderBlockSettingsV2, d as BuilderInlineTextComponentProps, e as BuilderPreviewEditingHelpers, f as BuilderPreviewTextFieldOptions, g as BuilderRenderWithSectionShell, h as BuilderSettingsPanelMode, j as BuilderThemeTokenOverrides, k as BuilderThemeTokens, S as SectionPreset, l as createDefaultStudioDocument, m as createStudioPageService, n as defaultBuilderThemeTokens, o as getStudioDocumentFromPage, p as layoutToStudioDocument, q as pageInspectorPanels, r as pageNodeTypes, s as pagePaletteGroups, t as pageStudioModuleManifest, u as resolveBuilderThemeTokens, v as studioDocumentToLayout, w as toEditorInitialDoc } from '../index-DRu4fKxf.mjs';
|
|
2
2
|
import '../index-DWmudwDm.mjs';
|
|
3
3
|
import 'payload';
|
|
4
4
|
import 'react';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { B as BuilderBlock, a as BuilderBlockPreviewRenderArgs, b as BuilderBlockPreviewRenderer, c as BuilderBlockSettingsV2, d as BuilderInlineTextComponentProps, e as BuilderPreviewEditingHelpers, f as BuilderPreviewTextFieldOptions, g as BuilderRenderWithSectionShell, h as BuilderSettingsPanelMode, j as BuilderThemeTokenOverrides, k as BuilderThemeTokens, S as SectionPreset, l as createDefaultStudioDocument, m as createStudioPageService, n as defaultBuilderThemeTokens, o as getStudioDocumentFromPage, p as layoutToStudioDocument, q as pageInspectorPanels, r as pageNodeTypes, s as pagePaletteGroups, t as pageStudioModuleManifest, u as resolveBuilderThemeTokens, v as studioDocumentToLayout, w as toEditorInitialDoc } from '../index-
|
|
1
|
+
export { B as BuilderBlock, a as BuilderBlockPreviewRenderArgs, b as BuilderBlockPreviewRenderer, c as BuilderBlockSettingsV2, d as BuilderInlineTextComponentProps, e as BuilderPreviewEditingHelpers, f as BuilderPreviewTextFieldOptions, g as BuilderRenderWithSectionShell, h as BuilderSettingsPanelMode, j as BuilderThemeTokenOverrides, k as BuilderThemeTokens, S as SectionPreset, l as createDefaultStudioDocument, m as createStudioPageService, n as defaultBuilderThemeTokens, o as getStudioDocumentFromPage, p as layoutToStudioDocument, q as pageInspectorPanels, r as pageNodeTypes, s as pagePaletteGroups, t as pageStudioModuleManifest, u as resolveBuilderThemeTokens, v as studioDocumentToLayout, w as toEditorInitialDoc } from '../index-vkEwwsoC.js';
|
|
2
2
|
import '../index-DWmudwDm.js';
|
|
3
3
|
import 'payload';
|
|
4
4
|
import 'react';
|
|
@@ -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,15 +239,26 @@ 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;
|
|
242
247
|
current.advanced.editCopyInPanel = Boolean(block.editCopyInPanel ?? current.advanced.editCopyInPanel);
|
|
243
248
|
current.advanced.customClassName = typeof block.customClassName === "string" ? block.customClassName : current.advanced.customClassName;
|
|
244
249
|
current.advanced.hideOnMobile = Boolean(block.hideOnMobile ?? current.advanced.hideOnMobile);
|
|
245
|
-
|
|
250
|
+
const settings = mergeSettings(current, block.settings);
|
|
251
|
+
if (block.blockType === "hero") {
|
|
252
|
+
const top = settings.layout.paddingTopPt;
|
|
253
|
+
const bottom = settings.layout.paddingBottomPt;
|
|
254
|
+
const hasLegacyLinkedHeroPadding = settings.layout.linkVerticalPadding !== false && (top === null || typeof top === "undefined" || top === 30) && (bottom === null || typeof bottom === "undefined" || bottom === 30 || bottom === 20);
|
|
255
|
+
if (hasLegacyLinkedHeroPadding) {
|
|
256
|
+
settings.layout.linkVerticalPadding = false;
|
|
257
|
+
settings.layout.paddingTopPt = 30;
|
|
258
|
+
settings.layout.paddingBottomPt = 20;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
return settings;
|
|
246
262
|
};
|
|
247
263
|
var v2SettingsToLegacyBlock = (blockWithSettings) => {
|
|
248
264
|
const settings = legacyBlockToV2Settings(blockWithSettings);
|
|
@@ -364,7 +380,33 @@ var alignOptions = [
|
|
|
364
380
|
{ label: "Right", value: "right" },
|
|
365
381
|
{ label: "Justify", value: "justify" }
|
|
366
382
|
];
|
|
367
|
-
var layoutFieldSet = [
|
|
383
|
+
var layoutFieldSet = [
|
|
384
|
+
{
|
|
385
|
+
group: "layout",
|
|
386
|
+
key: "settings.layout.linkVerticalPadding",
|
|
387
|
+
label: "Link Top/Bottom Padding",
|
|
388
|
+
tags: ["spacing", "padding", "vertical"],
|
|
389
|
+
type: "checkbox"
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
group: "layout",
|
|
393
|
+
key: "settings.layout.paddingTopPt",
|
|
394
|
+
label: "Top Padding (pt)",
|
|
395
|
+
max: 240,
|
|
396
|
+
min: 0,
|
|
397
|
+
tags: ["spacing", "padding", "top"],
|
|
398
|
+
type: "number"
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
group: "layout",
|
|
402
|
+
key: "settings.layout.paddingBottomPt",
|
|
403
|
+
label: "Bottom Padding (pt)",
|
|
404
|
+
max: 240,
|
|
405
|
+
min: 0,
|
|
406
|
+
tags: ["spacing", "padding", "bottom"],
|
|
407
|
+
type: "number"
|
|
408
|
+
}
|
|
409
|
+
];
|
|
368
410
|
var typographyFieldSet = [
|
|
369
411
|
{
|
|
370
412
|
group: "typography",
|
|
@@ -7,15 +7,15 @@ import {
|
|
|
7
7
|
pageStudioModuleManifest,
|
|
8
8
|
resolveBuilderThemeTokens,
|
|
9
9
|
toEditorInitialDoc
|
|
10
|
-
} from "../chunk-
|
|
11
|
-
import "../chunk-OQSEJXC4.mjs";
|
|
10
|
+
} from "../chunk-LUF62ZWF.mjs";
|
|
12
11
|
import {
|
|
13
12
|
createDefaultStudioDocument,
|
|
14
13
|
defaultBuilderThemeTokens,
|
|
15
14
|
layoutToStudioDocument,
|
|
16
15
|
studioDocumentToLayout
|
|
17
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-CUPMTHGX.mjs";
|
|
18
17
|
import "../chunk-ADIIWIYL.mjs";
|
|
18
|
+
import "../chunk-OQSEJXC4.mjs";
|
|
19
19
|
import "../chunk-6BWS3CLP.mjs";
|
|
20
20
|
export {
|
|
21
21
|
createDefaultStudioDocument,
|
package/package.json
CHANGED