@orion-studios/payload-studio 0.6.0-beta.35 → 0.6.0-beta.37

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/index.mjs CHANGED
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  admin_exports
3
3
  } from "./chunk-JC3UV74N.mjs";
4
- import {
5
- blocks_exports
6
- } from "./chunk-JQAHXYAM.mjs";
7
4
  import {
8
5
  admin_app_exports
9
6
  } from "./chunk-RKTIFEUY.mjs";
10
7
  import "./chunk-W2UOCJDX.mjs";
8
+ import {
9
+ blocks_exports
10
+ } from "./chunk-JQAHXYAM.mjs";
11
11
  import {
12
12
  nextjs_exports
13
13
  } from "./chunk-H4GTEY24.mjs";
@@ -956,6 +956,36 @@ var normalizeNumber = (value, fallback) => {
956
956
  }
957
957
  return fallback;
958
958
  };
959
+ var sectionPaddingPointMap = {
960
+ none: 0,
961
+ sm: 17,
962
+ md: 31,
963
+ lg: 41
964
+ };
965
+ var heroDefaultPaddingPt = 30;
966
+ var normalizeSectionPaddingY = (value) => value === "none" || value === "sm" || value === "lg" ? value : "md";
967
+ var normalizePaddingPointValue = (value) => {
968
+ if (typeof value === "number" && Number.isFinite(value)) {
969
+ return Math.max(0, Math.min(240, Math.round(value)));
970
+ }
971
+ if (typeof value === "string" && value.trim().length > 0) {
972
+ const parsed = Number(value);
973
+ if (Number.isFinite(parsed)) {
974
+ return Math.max(0, Math.min(240, Math.round(parsed)));
975
+ }
976
+ }
977
+ return null;
978
+ };
979
+ var getEffectiveVerticalPaddingValue = (block, key) => {
980
+ const explicit = normalizePaddingPointValue(getByPath(block, key));
981
+ if (explicit !== null) {
982
+ return explicit;
983
+ }
984
+ const layoutSectionPaddingY = getByPath(block, "settings.layout.sectionPaddingY");
985
+ const legacySectionPaddingY = block.sectionPaddingY;
986
+ const inherited = block.blockType === "hero" ? heroDefaultPaddingPt : sectionPaddingPointMap[normalizeSectionPaddingY(layoutSectionPaddingY || legacySectionPaddingY)];
987
+ return inherited;
988
+ };
959
989
  var getRelationID = (value) => {
960
990
  if (typeof value === "number" || typeof value === "string") {
961
991
  return value;
@@ -1200,19 +1230,20 @@ function BlockInspectorRenderer({
1200
1230
  }
1201
1231
  ) : null,
1202
1232
  (hasMediaGroupContent ? group.fields.filter((field) => !(group.key === "media" && field.key.startsWith("settings.media."))) : group.fields).map((field) => {
1203
- if (field.key === "settings.layout.paddingBottomPt" && Boolean(getByPath(block, "settings.layout.linkVerticalPadding"))) {
1233
+ if (field.key === "settings.layout.paddingBottomPt" && getByPath(block, "settings.layout.linkVerticalPadding") !== false) {
1204
1234
  return null;
1205
1235
  }
1206
- if (field.key === "settings.layout.paddingRightPt" && Boolean(getByPath(block, "settings.layout.linkHorizontalPadding"))) {
1236
+ if (field.key === "settings.layout.paddingRightPt" && getByPath(block, "settings.layout.linkHorizontalPadding") !== false) {
1207
1237
  return null;
1208
1238
  }
1209
1239
  const fieldValue = getByPath(block, field.key);
1210
1240
  if (field.type === "checkbox") {
1241
+ const checked = field.key === "settings.layout.linkVerticalPadding" || field.key === "settings.layout.linkHorizontalPadding" ? typeof fieldValue === "boolean" ? fieldValue : true : Boolean(fieldValue);
1211
1242
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { className: "orion-builder-settings-label is-checkbox", children: [
1212
1243
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1213
1244
  "input",
1214
1245
  {
1215
- checked: Boolean(fieldValue),
1246
+ checked,
1216
1247
  onChange: (event) => updateForKey(field.key, event.target.checked),
1217
1248
  type: "checkbox"
1218
1249
  }
@@ -1235,8 +1266,8 @@ function BlockInspectorRenderer({
1235
1266
  ] }, field.key);
1236
1267
  }
1237
1268
  if (field.type === "number") {
1238
- const numberValue = typeof fieldValue === "number" ? fieldValue : typeof fieldValue === "string" && fieldValue.trim().length > 0 ? Number(fieldValue) : null;
1239
- const resolvedValue = typeof numberValue === "number" && Number.isFinite(numberValue) ? numberValue : "";
1269
+ const numberValue = normalizePaddingPointValue(fieldValue);
1270
+ const resolvedValue = numberValue !== null ? numberValue : field.key === "settings.layout.paddingTopPt" || field.key === "settings.layout.paddingBottomPt" ? getEffectiveVerticalPaddingValue(block, field.key) : "";
1240
1271
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { className: "orion-builder-settings-label", children: [
1241
1272
  field.label,
1242
1273
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
@@ -3935,6 +3966,7 @@ var sectionPaddingMap = {
3935
3966
  md: "2.6rem",
3936
3967
  lg: "3.4rem"
3937
3968
  };
3969
+ var heroDefaultPadding = "30pt";
3938
3970
  var quickAddBlockTypes = [
3939
3971
  "hero",
3940
3972
  "featureGrid",
@@ -4289,10 +4321,10 @@ var sectionStyleFromBlock = (block, pageDefaults) => {
4289
4321
  } : {},
4290
4322
  sectionClass: `orion-builder-shell is-${pageDefaults.pageWidthDefault} padx-${resolvedSectionPaddingX}`,
4291
4323
  sectionInnerStyle: {
4292
- paddingBottom: customPaddingBottom === null ? sectionPaddingMap[sectionPaddingY] : `${customPaddingBottom}pt`,
4324
+ paddingBottom: customPaddingBottom === null ? block.blockType === "hero" ? heroDefaultPadding : sectionPaddingMap[sectionPaddingY] : `${customPaddingBottom}pt`,
4293
4325
  paddingLeft: customPaddingLeft === null ? void 0 : `${customPaddingLeft}pt`,
4294
4326
  paddingRight: customPaddingRight === null ? void 0 : `${customPaddingRight}pt`,
4295
- paddingTop: customPaddingTop === null ? sectionPaddingMap[sectionPaddingY] : `${customPaddingTop}pt`
4327
+ paddingTop: customPaddingTop === null ? block.blockType === "hero" ? heroDefaultPadding : sectionPaddingMap[sectionPaddingY] : `${customPaddingTop}pt`
4296
4328
  },
4297
4329
  sectionStyle: sectionMode === "color" ? { background: sectionColor } : sectionMode === "gradient" ? { background: sectionGradient } : block.blockType === "hero" ? { background: "transparent" } : {}
4298
4330
  };
@@ -929,6 +929,36 @@ var normalizeNumber = (value, fallback) => {
929
929
  }
930
930
  return fallback;
931
931
  };
932
+ var sectionPaddingPointMap = {
933
+ none: 0,
934
+ sm: 17,
935
+ md: 31,
936
+ lg: 41
937
+ };
938
+ var heroDefaultPaddingPt = 30;
939
+ var normalizeSectionPaddingY = (value) => value === "none" || value === "sm" || value === "lg" ? value : "md";
940
+ var normalizePaddingPointValue = (value) => {
941
+ if (typeof value === "number" && Number.isFinite(value)) {
942
+ return Math.max(0, Math.min(240, Math.round(value)));
943
+ }
944
+ if (typeof value === "string" && value.trim().length > 0) {
945
+ const parsed = Number(value);
946
+ if (Number.isFinite(parsed)) {
947
+ return Math.max(0, Math.min(240, Math.round(parsed)));
948
+ }
949
+ }
950
+ return null;
951
+ };
952
+ var getEffectiveVerticalPaddingValue = (block, key) => {
953
+ const explicit = normalizePaddingPointValue(getByPath(block, key));
954
+ if (explicit !== null) {
955
+ return explicit;
956
+ }
957
+ const layoutSectionPaddingY = getByPath(block, "settings.layout.sectionPaddingY");
958
+ const legacySectionPaddingY = block.sectionPaddingY;
959
+ const inherited = block.blockType === "hero" ? heroDefaultPaddingPt : sectionPaddingPointMap[normalizeSectionPaddingY(layoutSectionPaddingY || legacySectionPaddingY)];
960
+ return inherited;
961
+ };
932
962
  var getRelationID = (value) => {
933
963
  if (typeof value === "number" || typeof value === "string") {
934
964
  return value;
@@ -1173,19 +1203,20 @@ function BlockInspectorRenderer({
1173
1203
  }
1174
1204
  ) : null,
1175
1205
  (hasMediaGroupContent ? group.fields.filter((field) => !(group.key === "media" && field.key.startsWith("settings.media."))) : group.fields).map((field) => {
1176
- if (field.key === "settings.layout.paddingBottomPt" && Boolean(getByPath(block, "settings.layout.linkVerticalPadding"))) {
1206
+ if (field.key === "settings.layout.paddingBottomPt" && getByPath(block, "settings.layout.linkVerticalPadding") !== false) {
1177
1207
  return null;
1178
1208
  }
1179
- if (field.key === "settings.layout.paddingRightPt" && Boolean(getByPath(block, "settings.layout.linkHorizontalPadding"))) {
1209
+ if (field.key === "settings.layout.paddingRightPt" && getByPath(block, "settings.layout.linkHorizontalPadding") !== false) {
1180
1210
  return null;
1181
1211
  }
1182
1212
  const fieldValue = getByPath(block, field.key);
1183
1213
  if (field.type === "checkbox") {
1214
+ const checked = field.key === "settings.layout.linkVerticalPadding" || field.key === "settings.layout.linkHorizontalPadding" ? typeof fieldValue === "boolean" ? fieldValue : true : Boolean(fieldValue);
1184
1215
  return /* @__PURE__ */ jsxs3("label", { className: "orion-builder-settings-label is-checkbox", children: [
1185
1216
  /* @__PURE__ */ jsx3(
1186
1217
  "input",
1187
1218
  {
1188
- checked: Boolean(fieldValue),
1219
+ checked,
1189
1220
  onChange: (event) => updateForKey(field.key, event.target.checked),
1190
1221
  type: "checkbox"
1191
1222
  }
@@ -1208,8 +1239,8 @@ function BlockInspectorRenderer({
1208
1239
  ] }, field.key);
1209
1240
  }
1210
1241
  if (field.type === "number") {
1211
- const numberValue = typeof fieldValue === "number" ? fieldValue : typeof fieldValue === "string" && fieldValue.trim().length > 0 ? Number(fieldValue) : null;
1212
- const resolvedValue = typeof numberValue === "number" && Number.isFinite(numberValue) ? numberValue : "";
1242
+ const numberValue = normalizePaddingPointValue(fieldValue);
1243
+ const resolvedValue = numberValue !== null ? numberValue : field.key === "settings.layout.paddingTopPt" || field.key === "settings.layout.paddingBottomPt" ? getEffectiveVerticalPaddingValue(block, field.key) : "";
1213
1244
  return /* @__PURE__ */ jsxs3("label", { className: "orion-builder-settings-label", children: [
1214
1245
  field.label,
1215
1246
  /* @__PURE__ */ jsx3(
@@ -3815,6 +3846,7 @@ var sectionPaddingMap = {
3815
3846
  md: "2.6rem",
3816
3847
  lg: "3.4rem"
3817
3848
  };
3849
+ var heroDefaultPadding = "30pt";
3818
3850
  var quickAddBlockTypes = [
3819
3851
  "hero",
3820
3852
  "featureGrid",
@@ -4169,10 +4201,10 @@ var sectionStyleFromBlock = (block, pageDefaults) => {
4169
4201
  } : {},
4170
4202
  sectionClass: `orion-builder-shell is-${pageDefaults.pageWidthDefault} padx-${resolvedSectionPaddingX}`,
4171
4203
  sectionInnerStyle: {
4172
- paddingBottom: customPaddingBottom === null ? sectionPaddingMap[sectionPaddingY] : `${customPaddingBottom}pt`,
4204
+ paddingBottom: customPaddingBottom === null ? block.blockType === "hero" ? heroDefaultPadding : sectionPaddingMap[sectionPaddingY] : `${customPaddingBottom}pt`,
4173
4205
  paddingLeft: customPaddingLeft === null ? void 0 : `${customPaddingLeft}pt`,
4174
4206
  paddingRight: customPaddingRight === null ? void 0 : `${customPaddingRight}pt`,
4175
- paddingTop: customPaddingTop === null ? sectionPaddingMap[sectionPaddingY] : `${customPaddingTop}pt`
4207
+ paddingTop: customPaddingTop === null ? block.blockType === "hero" ? heroDefaultPadding : sectionPaddingMap[sectionPaddingY] : `${customPaddingTop}pt`
4176
4208
  },
4177
4209
  sectionStyle: sectionMode === "color" ? { background: sectionColor } : sectionMode === "gradient" ? { background: sectionGradient } : block.blockType === "hero" ? { background: "transparent" } : {}
4178
4210
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orion-studios/payload-studio",
3
- "version": "0.6.0-beta.35",
3
+ "version": "0.6.0-beta.37",
4
4
  "description": "Base CMS, builder, and custom admin toolkit for Orion Studios websites",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",