@orion-studios/payload-studio 0.6.0-beta.4 → 0.6.0-beta.41
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-PF3EBZXF.mjs → chunk-7ZMXZRBP.mjs} +39 -3
- package/dist/chunk-JC3UV74N.mjs +1033 -0
- package/dist/{chunk-XKUTZ7IU.mjs → chunk-OL53KHTB.mjs} +46 -2
- package/dist/{chunk-EHUE4LCT.mjs → chunk-RKTIFEUY.mjs} +33 -3
- package/dist/chunk-W2UOCJDX.mjs +32 -0
- package/dist/{chunk-OTHERBGX.mjs → chunk-ZADL33R6.mjs} +1 -1
- package/dist/{index-bbA3HSxa.d.ts → index-BV0vEGl6.d.ts} +6 -9
- package/dist/{index-Cv-6qnrw.d.mts → index-D5zrOdyv.d.mts} +3 -1
- 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-Crx_MtPw.d.ts → index-Dv-Alx4h.d.ts} +3 -1
- package/dist/{index-DEQC3Dwj.d.mts → index-G_uTNffQ.d.mts} +1 -1
- package/dist/index.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +287 -1542
- package/dist/index.mjs +6 -6
- package/dist/nextjs/index.js +39 -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 +529 -63
- package/dist/studio-pages/client.mjs +529 -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 +84 -4
- package/dist/studio-pages/index.mjs +2 -2
- 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-D5zrOdyv.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-Dv-Alx4h.js';
|
|
2
2
|
import '../index-DWmudwDm.js';
|
|
3
3
|
import 'payload';
|
|
4
4
|
import 'react';
|
|
@@ -97,7 +97,9 @@ var defaultBuilderBlockSettingsV2 = {
|
|
|
97
97
|
},
|
|
98
98
|
typography: {
|
|
99
99
|
bodyAlign: "left",
|
|
100
|
+
bodySizePt: null,
|
|
100
101
|
headingAlign: "left",
|
|
102
|
+
headingSizePt: null,
|
|
101
103
|
letterSpacingPreset: "normal",
|
|
102
104
|
lineHeightPreset: "normal",
|
|
103
105
|
maxTextWidth: "auto"
|
|
@@ -126,7 +128,9 @@ var defaultBuilderItemSettingsV2 = {
|
|
|
126
128
|
},
|
|
127
129
|
typography: {
|
|
128
130
|
bodyAlign: "left",
|
|
131
|
+
bodySizePt: null,
|
|
129
132
|
headingAlign: "left",
|
|
133
|
+
headingSizePt: null,
|
|
130
134
|
letterSpacingPreset: "normal",
|
|
131
135
|
lineHeightPreset: "normal",
|
|
132
136
|
maxTextWidth: "auto"
|
|
@@ -156,6 +160,7 @@ var defaultBuilderThemeTokens = {
|
|
|
156
160
|
|
|
157
161
|
// src/studio-pages/builder/adapters/settingsV2.ts
|
|
158
162
|
var isRecord = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
163
|
+
var isTextAlign = (value) => value === "left" || value === "center" || value === "right" || value === "justify";
|
|
159
164
|
var parsePercent = (value) => {
|
|
160
165
|
if (typeof value === "number" && Number.isFinite(value)) {
|
|
161
166
|
return Math.max(0, Math.min(100, value));
|
|
@@ -180,6 +185,18 @@ var parsePixel = (value) => {
|
|
|
180
185
|
}
|
|
181
186
|
return null;
|
|
182
187
|
};
|
|
188
|
+
var parsePoint = (value) => {
|
|
189
|
+
if (typeof value === "number" && Number.isFinite(value)) {
|
|
190
|
+
return Math.max(6, Math.min(120, Math.round(value)));
|
|
191
|
+
}
|
|
192
|
+
if (typeof value === "string" && value.trim().length > 0) {
|
|
193
|
+
const parsed = Number(value);
|
|
194
|
+
if (Number.isFinite(parsed)) {
|
|
195
|
+
return Math.max(6, Math.min(120, Math.round(parsed)));
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return null;
|
|
199
|
+
};
|
|
183
200
|
var mergeSettings = (defaults, input) => {
|
|
184
201
|
if (!isRecord(input)) {
|
|
185
202
|
return structuredClone(defaults);
|
|
@@ -198,6 +215,10 @@ var mergeSettings = (defaults, input) => {
|
|
|
198
215
|
};
|
|
199
216
|
var legacyBlockToV2Settings = (block) => {
|
|
200
217
|
const current = structuredClone(defaultBuilderBlockSettingsV2);
|
|
218
|
+
if (block.blockType === "hero" && block.variant === "centered") {
|
|
219
|
+
current.typography.headingAlign = "center";
|
|
220
|
+
current.typography.bodyAlign = "center";
|
|
221
|
+
}
|
|
201
222
|
current.layout.contentWidth = block.contentWidth === "narrow" || block.contentWidth === "content" || block.contentWidth === "wide" || block.contentWidth === "full" || block.contentWidth === "inherit" ? block.contentWidth : current.layout.contentWidth;
|
|
202
223
|
current.layout.sectionPaddingX = block.sectionPaddingX === "none" || block.sectionPaddingX === "sm" || block.sectionPaddingX === "md" || block.sectionPaddingX === "lg" || block.sectionPaddingX === "inherit" ? block.sectionPaddingX : current.layout.sectionPaddingX;
|
|
203
224
|
current.layout.sectionPaddingY = block.sectionPaddingY === "none" || block.sectionPaddingY === "sm" || block.sectionPaddingY === "lg" ? block.sectionPaddingY : current.layout.sectionPaddingY;
|
|
@@ -234,15 +255,28 @@ var legacyBlockToV2Settings = (block) => {
|
|
|
234
255
|
current.media.positionX = parsePercent(block.imagePositionX ?? block.backgroundImagePositionX);
|
|
235
256
|
current.media.positionY = parsePercent(block.imagePositionY ?? block.backgroundImagePositionY);
|
|
236
257
|
current.media.height = parsePixel(block.imageHeight);
|
|
237
|
-
current.typography.headingAlign = block.textHeadingAlign
|
|
238
|
-
current.typography.bodyAlign = block.textBodyAlign
|
|
258
|
+
current.typography.headingAlign = isTextAlign(block.textHeadingAlign) ? block.textHeadingAlign : current.typography.headingAlign;
|
|
259
|
+
current.typography.bodyAlign = isTextAlign(block.textBodyAlign) ? block.textBodyAlign : current.typography.bodyAlign;
|
|
260
|
+
current.typography.headingSizePt = parsePoint(block.textHeadingSizePt);
|
|
261
|
+
current.typography.bodySizePt = parsePoint(block.textBodySizePt);
|
|
239
262
|
current.typography.maxTextWidth = block.textMaxWidth === "auto" || block.textMaxWidth === "sm" || block.textMaxWidth === "md" || block.textMaxWidth === "lg" || block.textMaxWidth === "full" ? block.textMaxWidth : current.typography.maxTextWidth;
|
|
240
263
|
current.typography.lineHeightPreset = block.textLineHeightPreset === "tight" || block.textLineHeightPreset === "normal" || block.textLineHeightPreset === "relaxed" ? block.textLineHeightPreset : current.typography.lineHeightPreset;
|
|
241
264
|
current.typography.letterSpacingPreset = block.textLetterSpacingPreset === "tight" || block.textLetterSpacingPreset === "normal" || block.textLetterSpacingPreset === "relaxed" ? block.textLetterSpacingPreset : current.typography.letterSpacingPreset;
|
|
242
265
|
current.advanced.editCopyInPanel = Boolean(block.editCopyInPanel ?? current.advanced.editCopyInPanel);
|
|
243
266
|
current.advanced.customClassName = typeof block.customClassName === "string" ? block.customClassName : current.advanced.customClassName;
|
|
244
267
|
current.advanced.hideOnMobile = Boolean(block.hideOnMobile ?? current.advanced.hideOnMobile);
|
|
245
|
-
|
|
268
|
+
const settings = mergeSettings(current, block.settings);
|
|
269
|
+
if (block.blockType === "hero") {
|
|
270
|
+
const top = settings.layout.paddingTopPt;
|
|
271
|
+
const bottom = settings.layout.paddingBottomPt;
|
|
272
|
+
const hasLegacyLinkedHeroPadding = settings.layout.linkVerticalPadding !== false && (top === null || typeof top === "undefined" || top === 30) && (bottom === null || typeof bottom === "undefined" || bottom === 30 || bottom === 20);
|
|
273
|
+
if (hasLegacyLinkedHeroPadding) {
|
|
274
|
+
settings.layout.linkVerticalPadding = false;
|
|
275
|
+
settings.layout.paddingTopPt = 30;
|
|
276
|
+
settings.layout.paddingBottomPt = 20;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
return settings;
|
|
246
280
|
};
|
|
247
281
|
var v2SettingsToLegacyBlock = (blockWithSettings) => {
|
|
248
282
|
const settings = legacyBlockToV2Settings(blockWithSettings);
|
|
@@ -268,6 +302,8 @@ var v2SettingsToLegacyBlock = (blockWithSettings) => {
|
|
|
268
302
|
next.contentGradientAngle = settings.appearance.contentGradientAngle;
|
|
269
303
|
next.textHeadingAlign = settings.typography.headingAlign;
|
|
270
304
|
next.textBodyAlign = settings.typography.bodyAlign;
|
|
305
|
+
next.textHeadingSizePt = settings.typography.headingSizePt;
|
|
306
|
+
next.textBodySizePt = settings.typography.bodySizePt;
|
|
271
307
|
next.textMaxWidth = settings.typography.maxTextWidth;
|
|
272
308
|
next.textLineHeightPreset = settings.typography.lineHeightPreset;
|
|
273
309
|
next.textLetterSpacingPreset = settings.typography.letterSpacingPreset;
|
|
@@ -364,8 +400,52 @@ var alignOptions = [
|
|
|
364
400
|
{ label: "Right", value: "right" },
|
|
365
401
|
{ label: "Justify", value: "justify" }
|
|
366
402
|
];
|
|
367
|
-
var layoutFieldSet = [
|
|
403
|
+
var layoutFieldSet = [
|
|
404
|
+
{
|
|
405
|
+
group: "layout",
|
|
406
|
+
key: "settings.layout.linkVerticalPadding",
|
|
407
|
+
label: "Link Top/Bottom Padding",
|
|
408
|
+
tags: ["spacing", "padding", "vertical"],
|
|
409
|
+
type: "checkbox"
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
group: "layout",
|
|
413
|
+
key: "settings.layout.paddingTopPt",
|
|
414
|
+
label: "Top Padding (pt)",
|
|
415
|
+
max: 240,
|
|
416
|
+
min: 0,
|
|
417
|
+
tags: ["spacing", "padding", "top"],
|
|
418
|
+
type: "number"
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
group: "layout",
|
|
422
|
+
key: "settings.layout.paddingBottomPt",
|
|
423
|
+
label: "Bottom Padding (pt)",
|
|
424
|
+
max: 240,
|
|
425
|
+
min: 0,
|
|
426
|
+
tags: ["spacing", "padding", "bottom"],
|
|
427
|
+
type: "number"
|
|
428
|
+
}
|
|
429
|
+
];
|
|
368
430
|
var typographyFieldSet = [
|
|
431
|
+
{
|
|
432
|
+
group: "typography",
|
|
433
|
+
key: "settings.typography.headingSizePt",
|
|
434
|
+
label: "Heading Text Size (pt)",
|
|
435
|
+
max: 120,
|
|
436
|
+
min: 6,
|
|
437
|
+
tags: ["text", "size", "heading", "font"],
|
|
438
|
+
type: "number"
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
group: "typography",
|
|
442
|
+
key: "settings.typography.bodySizePt",
|
|
443
|
+
label: "Body Text Size (pt)",
|
|
444
|
+
max: 72,
|
|
445
|
+
min: 6,
|
|
446
|
+
tags: ["text", "size", "body", "paragraph", "font"],
|
|
447
|
+
type: "number"
|
|
448
|
+
},
|
|
369
449
|
{
|
|
370
450
|
group: "typography",
|
|
371
451
|
key: "settings.typography.headingAlign",
|
|
@@ -7,14 +7,14 @@ import {
|
|
|
7
7
|
pageStudioModuleManifest,
|
|
8
8
|
resolveBuilderThemeTokens,
|
|
9
9
|
toEditorInitialDoc
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-OL53KHTB.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-7ZMXZRBP.mjs";
|
|
18
18
|
import "../chunk-ADIIWIYL.mjs";
|
|
19
19
|
import "../chunk-6BWS3CLP.mjs";
|
|
20
20
|
export {
|
package/package.json
CHANGED