@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.
Files changed (46) hide show
  1. package/dist/admin/client.d.mts +1 -0
  2. package/dist/admin/client.d.ts +1 -0
  3. package/dist/admin/client.js +3924 -1355
  4. package/dist/admin/client.mjs +4090 -1533
  5. package/dist/admin/index.d.mts +2 -3
  6. package/dist/admin/index.d.ts +2 -3
  7. package/dist/admin/index.js +141 -1522
  8. package/dist/admin/index.mjs +2 -4
  9. package/dist/admin-app/client.js +11 -4
  10. package/dist/admin-app/client.mjs +1 -1
  11. package/dist/admin-app/index.d.mts +2 -2
  12. package/dist/admin-app/index.d.ts +2 -2
  13. package/dist/admin-app/index.mjs +4 -4
  14. package/dist/admin-app/styles.css +343 -41
  15. package/dist/admin.css +18 -2
  16. package/dist/{chunk-KPIX7OSV.mjs → chunk-2XH7X34N.mjs} +11 -4
  17. package/dist/{chunk-PF3EBZXF.mjs → chunk-7ZMXZRBP.mjs} +39 -3
  18. package/dist/chunk-JC3UV74N.mjs +1033 -0
  19. package/dist/{chunk-XKUTZ7IU.mjs → chunk-OL53KHTB.mjs} +46 -2
  20. package/dist/{chunk-EHUE4LCT.mjs → chunk-RKTIFEUY.mjs} +33 -3
  21. package/dist/chunk-W2UOCJDX.mjs +32 -0
  22. package/dist/{chunk-OTHERBGX.mjs → chunk-ZADL33R6.mjs} +1 -1
  23. package/dist/{index-bbA3HSxa.d.ts → index-BV0vEGl6.d.ts} +6 -9
  24. package/dist/{index-Cv-6qnrw.d.mts → index-D5zrOdyv.d.mts} +3 -1
  25. package/dist/{index-52HdVLQq.d.ts → index-DAdN56fM.d.ts} +1 -1
  26. package/dist/{index-DEkV-sMs.d.mts → index-DLfPOqYA.d.mts} +6 -9
  27. package/dist/{index-Crx_MtPw.d.ts → index-Dv-Alx4h.d.ts} +3 -1
  28. package/dist/{index-DEQC3Dwj.d.mts → index-G_uTNffQ.d.mts} +1 -1
  29. package/dist/index.d.mts +5 -5
  30. package/dist/index.d.ts +5 -5
  31. package/dist/index.js +287 -1542
  32. package/dist/index.mjs +6 -6
  33. package/dist/nextjs/index.js +39 -3
  34. package/dist/nextjs/index.mjs +2 -2
  35. package/dist/{sitePreviewTypes-BkHCWxNW.d.mts → sitePreviewTypes-BrJwGzJj.d.mts} +1 -1
  36. package/dist/{sitePreviewTypes-BkHCWxNW.d.ts → sitePreviewTypes-BrJwGzJj.d.ts} +1 -1
  37. package/dist/studio-pages/builder.css +24 -5
  38. package/dist/studio-pages/client.js +529 -63
  39. package/dist/studio-pages/client.mjs +529 -63
  40. package/dist/studio-pages/index.d.mts +1 -1
  41. package/dist/studio-pages/index.d.ts +1 -1
  42. package/dist/studio-pages/index.js +84 -4
  43. package/dist/studio-pages/index.mjs +2 -2
  44. package/package.json +1 -1
  45. package/dist/chunk-DYXSAVUQ.mjs +0 -2372
  46. package/dist/chunk-Z6L5K5MH.mjs +0 -64
@@ -40,7 +40,9 @@ var defaultBuilderBlockSettingsV2 = {
40
40
  },
41
41
  typography: {
42
42
  bodyAlign: "left",
43
+ bodySizePt: null,
43
44
  headingAlign: "left",
45
+ headingSizePt: null,
44
46
  letterSpacingPreset: "normal",
45
47
  lineHeightPreset: "normal",
46
48
  maxTextWidth: "auto"
@@ -69,7 +71,9 @@ var defaultBuilderItemSettingsV2 = {
69
71
  },
70
72
  typography: {
71
73
  bodyAlign: "left",
74
+ bodySizePt: null,
72
75
  headingAlign: "left",
76
+ headingSizePt: null,
73
77
  letterSpacingPreset: "normal",
74
78
  lineHeightPreset: "normal",
75
79
  maxTextWidth: "auto"
@@ -99,6 +103,7 @@ var defaultBuilderThemeTokens = {
99
103
 
100
104
  // src/studio-pages/builder/adapters/settingsV2.ts
101
105
  var isRecord = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
106
+ var isTextAlign = (value) => value === "left" || value === "center" || value === "right" || value === "justify";
102
107
  var parsePercent = (value) => {
103
108
  if (typeof value === "number" && Number.isFinite(value)) {
104
109
  return Math.max(0, Math.min(100, value));
@@ -123,6 +128,18 @@ var parsePixel = (value) => {
123
128
  }
124
129
  return null;
125
130
  };
131
+ var parsePoint = (value) => {
132
+ if (typeof value === "number" && Number.isFinite(value)) {
133
+ return Math.max(6, Math.min(120, Math.round(value)));
134
+ }
135
+ if (typeof value === "string" && value.trim().length > 0) {
136
+ const parsed = Number(value);
137
+ if (Number.isFinite(parsed)) {
138
+ return Math.max(6, Math.min(120, Math.round(parsed)));
139
+ }
140
+ }
141
+ return null;
142
+ };
126
143
  var mergeSettings = (defaults, input) => {
127
144
  if (!isRecord(input)) {
128
145
  return structuredClone(defaults);
@@ -141,6 +158,10 @@ var mergeSettings = (defaults, input) => {
141
158
  };
142
159
  var legacyBlockToV2Settings = (block) => {
143
160
  const current = structuredClone(defaultBuilderBlockSettingsV2);
161
+ if (block.blockType === "hero" && block.variant === "centered") {
162
+ current.typography.headingAlign = "center";
163
+ current.typography.bodyAlign = "center";
164
+ }
144
165
  current.layout.contentWidth = block.contentWidth === "narrow" || block.contentWidth === "content" || block.contentWidth === "wide" || block.contentWidth === "full" || block.contentWidth === "inherit" ? block.contentWidth : current.layout.contentWidth;
145
166
  current.layout.sectionPaddingX = block.sectionPaddingX === "none" || block.sectionPaddingX === "sm" || block.sectionPaddingX === "md" || block.sectionPaddingX === "lg" || block.sectionPaddingX === "inherit" ? block.sectionPaddingX : current.layout.sectionPaddingX;
146
167
  current.layout.sectionPaddingY = block.sectionPaddingY === "none" || block.sectionPaddingY === "sm" || block.sectionPaddingY === "lg" ? block.sectionPaddingY : current.layout.sectionPaddingY;
@@ -177,15 +198,28 @@ var legacyBlockToV2Settings = (block) => {
177
198
  current.media.positionX = parsePercent(block.imagePositionX ?? block.backgroundImagePositionX);
178
199
  current.media.positionY = parsePercent(block.imagePositionY ?? block.backgroundImagePositionY);
179
200
  current.media.height = parsePixel(block.imageHeight);
180
- current.typography.headingAlign = block.textHeadingAlign === "left" || block.textHeadingAlign === "center" || block.textHeadingAlign === "right" || block.textHeadingAlign === "justify" ? block.textHeadingAlign : current.typography.headingAlign;
181
- current.typography.bodyAlign = block.textBodyAlign === "left" || block.textBodyAlign === "center" || block.textBodyAlign === "right" || block.textBodyAlign === "justify" ? block.textBodyAlign : current.typography.bodyAlign;
201
+ current.typography.headingAlign = isTextAlign(block.textHeadingAlign) ? block.textHeadingAlign : current.typography.headingAlign;
202
+ current.typography.bodyAlign = isTextAlign(block.textBodyAlign) ? block.textBodyAlign : current.typography.bodyAlign;
203
+ current.typography.headingSizePt = parsePoint(block.textHeadingSizePt);
204
+ current.typography.bodySizePt = parsePoint(block.textBodySizePt);
182
205
  current.typography.maxTextWidth = block.textMaxWidth === "auto" || block.textMaxWidth === "sm" || block.textMaxWidth === "md" || block.textMaxWidth === "lg" || block.textMaxWidth === "full" ? block.textMaxWidth : current.typography.maxTextWidth;
183
206
  current.typography.lineHeightPreset = block.textLineHeightPreset === "tight" || block.textLineHeightPreset === "normal" || block.textLineHeightPreset === "relaxed" ? block.textLineHeightPreset : current.typography.lineHeightPreset;
184
207
  current.typography.letterSpacingPreset = block.textLetterSpacingPreset === "tight" || block.textLetterSpacingPreset === "normal" || block.textLetterSpacingPreset === "relaxed" ? block.textLetterSpacingPreset : current.typography.letterSpacingPreset;
185
208
  current.advanced.editCopyInPanel = Boolean(block.editCopyInPanel ?? current.advanced.editCopyInPanel);
186
209
  current.advanced.customClassName = typeof block.customClassName === "string" ? block.customClassName : current.advanced.customClassName;
187
210
  current.advanced.hideOnMobile = Boolean(block.hideOnMobile ?? current.advanced.hideOnMobile);
188
- return mergeSettings(current, block.settings);
211
+ const settings = mergeSettings(current, block.settings);
212
+ if (block.blockType === "hero") {
213
+ const top = settings.layout.paddingTopPt;
214
+ const bottom = settings.layout.paddingBottomPt;
215
+ const hasLegacyLinkedHeroPadding = settings.layout.linkVerticalPadding !== false && (top === null || typeof top === "undefined" || top === 30) && (bottom === null || typeof bottom === "undefined" || bottom === 30 || bottom === 20);
216
+ if (hasLegacyLinkedHeroPadding) {
217
+ settings.layout.linkVerticalPadding = false;
218
+ settings.layout.paddingTopPt = 30;
219
+ settings.layout.paddingBottomPt = 20;
220
+ }
221
+ }
222
+ return settings;
189
223
  };
190
224
  var v2SettingsToLegacyBlock = (blockWithSettings) => {
191
225
  const settings = legacyBlockToV2Settings(blockWithSettings);
@@ -211,6 +245,8 @@ var v2SettingsToLegacyBlock = (blockWithSettings) => {
211
245
  next.contentGradientAngle = settings.appearance.contentGradientAngle;
212
246
  next.textHeadingAlign = settings.typography.headingAlign;
213
247
  next.textBodyAlign = settings.typography.bodyAlign;
248
+ next.textHeadingSizePt = settings.typography.headingSizePt;
249
+ next.textBodySizePt = settings.typography.bodySizePt;
214
250
  next.textMaxWidth = settings.typography.maxTextWidth;
215
251
  next.textLineHeightPreset = settings.typography.lineHeightPreset;
216
252
  next.textLetterSpacingPreset = settings.typography.letterSpacingPreset;