@delmaredigital/payload-puck 0.1.3 → 0.2.0

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.
@@ -544,25 +544,23 @@ function responsiveValueToCSS(value, converter, uniqueId) {
544
544
  mediaQueryCSS: ""
545
545
  };
546
546
  }
547
- const mediaQueries = [];
548
- let baseStyles = {};
547
+ const cssRules = [];
549
548
  BREAKPOINTS.forEach((bp) => {
550
549
  const bpValue = value[bp.key];
551
550
  if (bpValue === void 0) return;
552
551
  const cssProps = converter(bpValue);
553
552
  if (!cssProps) return;
553
+ const styleString = cssPropertiesToString(cssProps);
554
+ if (!styleString) return;
554
555
  if (bp.key === "xs") {
555
- baseStyles = cssProps;
556
+ cssRules.push(`.${uniqueId} { ${styleString} }`);
556
557
  } else {
557
- const styleString = cssPropertiesToString(cssProps);
558
- if (styleString) {
559
- mediaQueries.push(
560
- `@media (min-width: ${bp.minWidth}px) { .${uniqueId} { ${styleString} } }`
561
- );
562
- }
558
+ cssRules.push(
559
+ `@media (min-width: ${bp.minWidth}px) { .${uniqueId} { ${styleString} } }`
560
+ );
563
561
  }
564
562
  });
565
- return { baseStyles, mediaQueryCSS: mediaQueries.join("\n") };
563
+ return { baseStyles: {}, mediaQueryCSS: cssRules.join("\n") };
566
564
  }
567
565
  var DEFAULT_VISIBILITY = {
568
566
  xs: true,
@@ -1942,12 +1940,12 @@ var Checkbox = React6.forwardRef(
1942
1940
  );
1943
1941
  Checkbox.displayName = "Checkbox";
1944
1942
  var DEFAULT_VALUE3 = {
1945
- mode: "contained",
1943
+ mode: "full",
1946
1944
  alignment: "center",
1947
1945
  maxWidth: {
1948
- value: 1200,
1946
+ value: 0,
1949
1947
  unit: "px",
1950
- enabled: true
1948
+ enabled: false
1951
1949
  },
1952
1950
  advancedMode: false
1953
1951
  };
@@ -2174,11 +2172,13 @@ function DimensionsFieldInner({
2174
2172
  const handleAdvancedToggle = useCallback(() => {
2175
2173
  const newAdvancedMode = !advancedMode;
2176
2174
  setAdvancedMode(newAdvancedMode);
2177
- onChange({
2178
- ...currentValue,
2179
- advancedMode: newAdvancedMode
2180
- });
2181
- }, [advancedMode, currentValue, onChange]);
2175
+ if (value !== null) {
2176
+ onChange({
2177
+ ...currentValue,
2178
+ advancedMode: newAdvancedMode
2179
+ });
2180
+ }
2181
+ }, [advancedMode, currentValue, onChange, value]);
2182
2182
  const modeConfig = [
2183
2183
  { mode: "full", icon: MoveHorizontal, label: "Full", title: "Full width (100%)" },
2184
2184
  { mode: "contained", icon: Square, label: "Contain", title: "Contained (centered with max-width)" },
@@ -4716,7 +4716,7 @@ function ResponsiveFieldInner({
4716
4716
  }) {
4717
4717
  const [activeBreakpoint, setActiveBreakpoint] = useState("xs");
4718
4718
  const getCurrentValue = useCallback(() => {
4719
- if (!value) return defaultValue ?? null;
4719
+ if (!value) return null;
4720
4720
  if (activeBreakpoint === "xs") {
4721
4721
  return value.xs ?? defaultValue ?? null;
4722
4722
  }
@@ -4738,21 +4738,35 @@ function ResponsiveFieldInner({
4738
4738
  const hasOverride = useCallback(
4739
4739
  (breakpoint) => {
4740
4740
  if (!value) return false;
4741
- if (breakpoint === "xs") return value.xs !== void 0;
4741
+ if (breakpoint === "xs") return false;
4742
4742
  return value[breakpoint] !== void 0;
4743
4743
  },
4744
4744
  [value]
4745
4745
  );
4746
+ const getInheritanceSource = useCallback(() => {
4747
+ if (!value || activeBreakpoint === "xs") return null;
4748
+ if (value[activeBreakpoint] !== void 0) return null;
4749
+ const breakpointOrder = ["xl", "lg", "md", "sm", "xs"];
4750
+ const activeIndex = breakpointOrder.indexOf(activeBreakpoint);
4751
+ for (let i = activeIndex + 1; i < breakpointOrder.length; i++) {
4752
+ const bp = breakpointOrder[i];
4753
+ if (value[bp] !== void 0) {
4754
+ return bp;
4755
+ }
4756
+ }
4757
+ return null;
4758
+ }, [value, activeBreakpoint]);
4746
4759
  const handleInnerChange = useCallback(
4747
4760
  (newValue) => {
4748
4761
  if (activeBreakpoint === "xs") {
4749
- if (newValue === null && defaultValue !== void 0) {
4750
- onChange({ ...value, xs: defaultValue });
4751
- } else if (newValue !== null) {
4762
+ if (newValue === null) {
4763
+ onChange(null);
4764
+ } else {
4752
4765
  onChange({ ...value, xs: newValue });
4753
4766
  }
4754
4767
  } else {
4755
4768
  if (newValue === null) {
4769
+ if (!value) return;
4756
4770
  const newResponsive = { ...value };
4757
4771
  delete newResponsive[activeBreakpoint];
4758
4772
  onChange(newResponsive);
@@ -4781,6 +4795,7 @@ function ResponsiveFieldInner({
4781
4795
  const currentValue = getCurrentValue();
4782
4796
  const isOverrideBreakpoint = activeBreakpoint !== "xs";
4783
4797
  const currentHasOverride = hasOverride(activeBreakpoint);
4798
+ const inheritanceSource = getInheritanceSource();
4784
4799
  const overrideCount = value ? ["sm", "md", "lg", "xl"].filter((bp) => value[bp] !== void 0).length : 0;
4785
4800
  return /* @__PURE__ */ jsxs("div", { className: "puck-field space-y-3", children: [
4786
4801
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
@@ -4822,7 +4837,11 @@ function ResponsiveFieldInner({
4822
4837
  /* @__PURE__ */ jsx("span", { children: activeBreakpoint === "xs" ? "Extra small screens (0-639px)" : /* @__PURE__ */ jsxs(Fragment, { children: [
4823
4838
  BREAKPOINTS.find((bp) => bp.key === activeBreakpoint)?.minWidth,
4824
4839
  "px and up",
4825
- !currentHasOverride && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground/60", children: " (inheriting from xs)" })
4840
+ !currentHasOverride && inheritanceSource && /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground/60", children: [
4841
+ " (inheriting from ",
4842
+ inheritanceSource.toUpperCase(),
4843
+ ")"
4844
+ ] })
4826
4845
  ] }) }),
4827
4846
  isOverrideBreakpoint && currentHasOverride && !readOnly && /* @__PURE__ */ jsx(
4828
4847
  Button,
@@ -4974,11 +4993,6 @@ function createResponsiveVisibilityField(config = {}) {
4974
4993
  )
4975
4994
  };
4976
4995
  }
4977
- var DEFAULT_DIMENSIONS = {
4978
- mode: "contained",
4979
- alignment: "center",
4980
- maxWidth: { value: 1200, unit: "px", enabled: true }
4981
- };
4982
4996
  var DEFAULT_PADDING = {
4983
4997
  top: 0,
4984
4998
  right: 0,
@@ -4987,18 +5001,20 @@ var DEFAULT_PADDING = {
4987
5001
  unit: "px",
4988
5002
  linked: true
4989
5003
  };
5004
+ var DEFAULT_DIMENSIONS = {
5005
+ mode: "full",
5006
+ alignment: "center",
5007
+ maxWidth: { value: 100, unit: "%", enabled: true }
5008
+ };
4990
5009
  var defaultProps = {
4991
5010
  content: [],
4992
- background: null,
4993
- customPadding: null,
5011
+ visibility: null,
4994
5012
  dimensions: null,
5013
+ background: null,
4995
5014
  border: null,
5015
+ padding: null,
4996
5016
  margin: null,
4997
- animation: null,
4998
- innerBackground: null,
4999
- innerPadding: null,
5000
- innerBorder: null,
5001
- visibility: null
5017
+ animation: null
5002
5018
  };
5003
5019
  var ContainerConfig = {
5004
5020
  label: "Container",
@@ -5007,119 +5023,113 @@ var ContainerConfig = {
5007
5023
  content: {
5008
5024
  type: "slot"
5009
5025
  },
5010
- // Responsive visibility control
5026
+ // Visibility first
5011
5027
  visibility: createResponsiveVisibilityField({ label: "Visibility" }),
5012
- // Outer (section-level) options
5013
- background: createBackgroundField({ label: "Outer Background" }),
5014
- border: createBorderField({ label: "Outer Border" }),
5015
- // Responsive dimensions field
5028
+ // Dimensions
5016
5029
  dimensions: createResponsiveField({
5017
- label: "Dimensions (Responsive)",
5030
+ label: "Dimensions",
5018
5031
  innerField: (config) => createDimensionsField(config),
5019
5032
  defaultValue: DEFAULT_DIMENSIONS
5020
5033
  }),
5021
- animation: createAnimationField({ label: "Animation" }),
5022
- // Inner (content container) options
5023
- innerBackground: createBackgroundField({ label: "Inner Background" }),
5024
- innerBorder: createBorderField({ label: "Inner Border" }),
5025
- // Responsive inner padding
5026
- innerPadding: createResponsiveField({
5027
- label: "Inner Padding (Responsive)",
5034
+ // Styling
5035
+ background: createBackgroundField({ label: "Background" }),
5036
+ border: createBorderField({ label: "Border" }),
5037
+ // Spacing
5038
+ padding: createResponsiveField({
5039
+ label: "Padding",
5028
5040
  innerField: (config) => createPaddingField(config),
5029
5041
  defaultValue: DEFAULT_PADDING
5030
5042
  }),
5031
- // Spacing (grouped at bottom) - Responsive
5032
5043
  margin: createResponsiveField({
5033
- label: "Margin (Responsive)",
5044
+ label: "Margin",
5034
5045
  innerField: (config) => createMarginField(config),
5035
5046
  defaultValue: DEFAULT_PADDING
5036
5047
  }),
5037
- customPadding: createResponsiveField({
5038
- label: "Outer Padding (Responsive)",
5039
- innerField: (config) => createPaddingField(config),
5040
- defaultValue: DEFAULT_PADDING
5041
- })
5048
+ // Animation
5049
+ animation: createAnimationField({ label: "Animation" })
5042
5050
  },
5043
5051
  defaultProps,
5044
5052
  render: ({
5045
5053
  content: Content3,
5046
- background,
5047
- customPadding,
5054
+ visibility,
5048
5055
  dimensions,
5056
+ background,
5049
5057
  border,
5058
+ padding,
5050
5059
  margin,
5051
- animation,
5052
- innerBackground,
5053
- innerPadding,
5054
- innerBorder,
5055
- visibility
5060
+ animation
5056
5061
  }) => {
5057
5062
  const uniqueId = useId().replace(/:/g, "");
5058
- const outerClass = `puck-container-outer-${uniqueId}`;
5059
- const innerClass = `puck-container-inner-${uniqueId}`;
5063
+ const containerClass = `puck-container-${uniqueId}`;
5060
5064
  const mediaQueries = [];
5061
- const outerBackgroundStyles = backgroundValueToCSS(background);
5062
- const outerStyles = {
5063
- ...outerBackgroundStyles
5064
- };
5065
- const outerPaddingResult = responsiveValueToCSS(
5066
- customPadding,
5067
- (v) => ({ padding: paddingValueToCSS(v) }),
5068
- outerClass
5069
- );
5070
- Object.assign(outerStyles, outerPaddingResult.baseStyles);
5071
- if (outerPaddingResult.mediaQueryCSS) {
5072
- mediaQueries.push(outerPaddingResult.mediaQueryCSS);
5073
- }
5074
- const outerBorderStyles = borderValueToCSS(border);
5075
- if (outerBorderStyles) {
5076
- Object.assign(outerStyles, outerBorderStyles);
5065
+ const containerStyles = {};
5066
+ const backgroundStyles = backgroundValueToCSS(background);
5067
+ if (backgroundStyles) {
5068
+ Object.assign(containerStyles, backgroundStyles);
5077
5069
  }
5078
- const marginResult = responsiveValueToCSS(
5079
- margin,
5080
- (v) => ({ margin: marginValueToCSS(v) }),
5081
- outerClass
5082
- );
5083
- Object.assign(outerStyles, marginResult.baseStyles);
5084
- if (marginResult.mediaQueryCSS) {
5085
- mediaQueries.push(marginResult.mediaQueryCSS);
5070
+ const borderStyles = borderValueToCSS(border);
5071
+ if (borderStyles) {
5072
+ Object.assign(containerStyles, borderStyles);
5086
5073
  }
5087
- const innerBackgroundStyles = backgroundValueToCSS(innerBackground);
5088
- const innerStyles = {
5089
- ...innerBackgroundStyles
5090
- };
5091
5074
  const dimensionsResult = responsiveValueToCSS(
5092
5075
  dimensions,
5093
5076
  dimensionsValueToCSS,
5094
- innerClass
5077
+ containerClass
5095
5078
  );
5096
- Object.assign(innerStyles, dimensionsResult.baseStyles);
5079
+ Object.assign(containerStyles, dimensionsResult.baseStyles);
5097
5080
  if (dimensionsResult.mediaQueryCSS) {
5098
5081
  mediaQueries.push(dimensionsResult.mediaQueryCSS);
5099
5082
  }
5100
- const innerPaddingResult = responsiveValueToCSS(
5101
- innerPadding,
5083
+ const hasMinHeight = (() => {
5084
+ if (!dimensions) return false;
5085
+ if (typeof dimensions === "object" && "xs" in dimensions) {
5086
+ const responsiveDims = dimensions;
5087
+ return Object.values(responsiveDims).some((v) => {
5088
+ if (!v || typeof v !== "object") return false;
5089
+ const dim2 = v;
5090
+ return dim2.minHeight?.enabled && dim2.minHeight?.value > 0;
5091
+ });
5092
+ }
5093
+ const dim = dimensions;
5094
+ return dim.minHeight?.enabled && dim.minHeight?.value > 0;
5095
+ })();
5096
+ if (hasMinHeight) {
5097
+ containerStyles.display = "flex";
5098
+ containerStyles.flexDirection = "column";
5099
+ }
5100
+ const paddingResult = responsiveValueToCSS(
5101
+ padding,
5102
5102
  (v) => ({ padding: paddingValueToCSS(v) }),
5103
- innerClass
5103
+ containerClass
5104
5104
  );
5105
- Object.assign(innerStyles, innerPaddingResult.baseStyles);
5106
- if (innerPaddingResult.mediaQueryCSS) {
5107
- mediaQueries.push(innerPaddingResult.mediaQueryCSS);
5105
+ Object.assign(containerStyles, paddingResult.baseStyles);
5106
+ if (paddingResult.mediaQueryCSS) {
5107
+ mediaQueries.push(paddingResult.mediaQueryCSS);
5108
5108
  }
5109
- const innerBorderStyles = borderValueToCSS(innerBorder);
5110
- if (innerBorderStyles) {
5111
- Object.assign(innerStyles, innerBorderStyles);
5109
+ const marginResult = responsiveValueToCSS(
5110
+ margin,
5111
+ (v) => ({ margin: marginValueToCSS(v) }),
5112
+ containerClass
5113
+ );
5114
+ Object.assign(containerStyles, marginResult.baseStyles);
5115
+ if (marginResult.mediaQueryCSS) {
5116
+ mediaQueries.push(marginResult.mediaQueryCSS);
5112
5117
  }
5113
- const visibilityCSS = visibilityValueToCSS(visibility, outerClass);
5118
+ const visibilityCSS = visibilityValueToCSS(visibility, containerClass);
5114
5119
  if (visibilityCSS) {
5115
5120
  mediaQueries.push(visibilityCSS);
5116
5121
  }
5117
- const contentClasses = cn("px-4", innerClass);
5118
- const hasInnerStyles = Object.keys(innerStyles).length > 0;
5119
5122
  const allMediaQueryCSS = mediaQueries.join("\n");
5123
+ const hasStyles = Object.keys(containerStyles).length > 0;
5124
+ const renderContent = () => {
5125
+ if (hasMinHeight) {
5126
+ return /* @__PURE__ */ jsx("div", { style: { flex: 1, display: "flex", flexDirection: "column", minHeight: 0 }, children: /* @__PURE__ */ jsx(Content3, { style: { flex: 1 } }) });
5127
+ }
5128
+ return /* @__PURE__ */ jsx(Content3, {});
5129
+ };
5120
5130
  return /* @__PURE__ */ jsxs(AnimatedWrapper, { animation, children: [
5121
5131
  allMediaQueryCSS && /* @__PURE__ */ jsx("style", { children: allMediaQueryCSS }),
5122
- /* @__PURE__ */ jsx("div", { className: outerClass, style: outerStyles, children: hasInnerStyles ? /* @__PURE__ */ jsx("div", { className: contentClasses, style: innerStyles, children: /* @__PURE__ */ jsx(Content3, {}) }) : /* @__PURE__ */ jsx(Content3, { className: contentClasses, style: innerStyles }) })
5132
+ hasStyles ? /* @__PURE__ */ jsx("div", { className: containerClass, style: containerStyles, children: renderContent() }) : /* @__PURE__ */ jsx(Content3, { className: containerClass })
5123
5133
  ] });
5124
5134
  }
5125
5135
  };
@@ -5614,20 +5624,33 @@ var DEFAULT_PADDING4 = {
5614
5624
  unit: "px",
5615
5625
  linked: true
5616
5626
  };
5617
- var DEFAULT_DIMENSIONS4 = {
5618
- mode: "full",
5627
+ var DEFAULT_CONTENT_DIMENSIONS = {
5628
+ mode: "contained",
5619
5629
  alignment: "center",
5620
- maxWidth: { value: 100, unit: "%", enabled: true }
5630
+ maxWidth: { value: 1200, unit: "px", enabled: true }
5631
+ };
5632
+ var DEFAULT_CONTENT_PADDING = {
5633
+ top: 0,
5634
+ right: 16,
5635
+ bottom: 0,
5636
+ left: 16,
5637
+ unit: "px",
5638
+ linked: false
5621
5639
  };
5622
5640
  var defaultProps4 = {
5623
5641
  id: "",
5624
5642
  content: [],
5625
- background: null,
5626
- fullWidth: false,
5627
- customPadding: null,
5628
- dimensions: null,
5629
- border: null,
5630
- margin: null,
5643
+ // Section layer defaults
5644
+ sectionBackground: null,
5645
+ sectionBorder: null,
5646
+ sectionPadding: null,
5647
+ sectionMargin: null,
5648
+ // Content layer defaults - 1200px max-width so two-layer design is immediately visible
5649
+ contentDimensions: { xs: DEFAULT_CONTENT_DIMENSIONS },
5650
+ contentBackground: null,
5651
+ contentBorder: null,
5652
+ contentPadding: { xs: DEFAULT_CONTENT_PADDING },
5653
+ // Other
5631
5654
  animation: null,
5632
5655
  visibility: null
5633
5656
  };
@@ -5635,6 +5658,9 @@ var SectionConfig = {
5635
5658
  label: "Section",
5636
5659
  fields: {
5637
5660
  _reset: createResetField({ defaultProps: defaultProps4 }),
5661
+ // Visibility first
5662
+ visibility: createResponsiveVisibilityField({ label: "Visibility" }),
5663
+ // Section ID for anchors
5638
5664
  id: {
5639
5665
  type: "text",
5640
5666
  label: "Section ID"
@@ -5642,49 +5668,47 @@ var SectionConfig = {
5642
5668
  content: {
5643
5669
  type: "slot"
5644
5670
  },
5645
- // Responsive visibility control
5646
- visibility: createResponsiveVisibilityField({ label: "Visibility" }),
5647
- fullWidth: {
5648
- type: "radio",
5649
- label: "Full Width Content",
5650
- options: [
5651
- { label: "Yes", value: true },
5652
- { label: "No", value: false }
5653
- ]
5654
- },
5655
- // Background
5656
- background: createBackgroundField({ label: "Background" }),
5657
- // Advanced custom options
5658
- border: createBorderField({ label: "Border" }),
5659
- // Responsive dimensions
5660
- dimensions: createResponsiveField({
5661
- label: "Dimensions (Responsive)",
5662
- innerField: (config) => createDimensionsField(config),
5663
- defaultValue: DEFAULT_DIMENSIONS4
5671
+ // Section layer (outer)
5672
+ sectionBackground: createBackgroundField({ label: "Section Background" }),
5673
+ sectionBorder: createBorderField({ label: "Section Border" }),
5674
+ sectionPadding: createResponsiveField({
5675
+ label: "Section Padding",
5676
+ innerField: (config) => createPaddingField(config),
5677
+ defaultValue: DEFAULT_PADDING4
5664
5678
  }),
5665
- animation: createAnimationField({ label: "Animation" }),
5666
- // Spacing (grouped at bottom) - Responsive
5667
- margin: createResponsiveField({
5668
- label: "Margin (Responsive)",
5679
+ sectionMargin: createResponsiveField({
5680
+ label: "Section Margin",
5669
5681
  innerField: (config) => createMarginField(config),
5670
5682
  defaultValue: DEFAULT_PADDING4
5671
5683
  }),
5672
- customPadding: createResponsiveField({
5673
- label: "Padding (Responsive)",
5684
+ // Content layer (inner)
5685
+ contentDimensions: createResponsiveField({
5686
+ label: "Content Dimensions",
5687
+ innerField: (config) => createDimensionsField(config),
5688
+ defaultValue: DEFAULT_CONTENT_DIMENSIONS
5689
+ }),
5690
+ contentBackground: createBackgroundField({ label: "Content Background" }),
5691
+ contentBorder: createBorderField({ label: "Content Border" }),
5692
+ contentPadding: createResponsiveField({
5693
+ label: "Content Padding",
5674
5694
  innerField: (config) => createPaddingField(config),
5675
5695
  defaultValue: DEFAULT_PADDING4
5676
- })
5696
+ }),
5697
+ // Animation
5698
+ animation: createAnimationField({ label: "Animation" })
5677
5699
  },
5678
5700
  defaultProps: defaultProps4,
5679
5701
  render: ({
5680
5702
  id,
5681
5703
  content: Content3,
5682
- background,
5683
- fullWidth,
5684
- customPadding,
5685
- dimensions,
5686
- border,
5687
- margin,
5704
+ sectionBackground,
5705
+ sectionBorder,
5706
+ sectionPadding,
5707
+ sectionMargin,
5708
+ contentDimensions,
5709
+ contentBackground,
5710
+ contentBorder,
5711
+ contentPadding,
5688
5712
  animation,
5689
5713
  visibility
5690
5714
  }) => {
@@ -5692,52 +5716,89 @@ var SectionConfig = {
5692
5716
  const sectionClass = `puck-section-${uniqueId}`;
5693
5717
  const contentClass = `puck-section-content-${uniqueId}`;
5694
5718
  const mediaQueries = [];
5695
- const backgroundStyles = backgroundValueToCSS(background);
5719
+ const sectionBackgroundStyles = backgroundValueToCSS(sectionBackground);
5696
5720
  const sectionStyles = {
5697
- ...backgroundStyles
5721
+ ...sectionBackgroundStyles
5698
5722
  };
5699
- const paddingResult = responsiveValueToCSS(
5700
- customPadding,
5723
+ const sectionBorderStyles = borderValueToCSS(sectionBorder);
5724
+ if (sectionBorderStyles) {
5725
+ Object.assign(sectionStyles, sectionBorderStyles);
5726
+ }
5727
+ const sectionPaddingResult = responsiveValueToCSS(
5728
+ sectionPadding,
5701
5729
  (v) => ({ padding: paddingValueToCSS(v) }),
5702
5730
  sectionClass
5703
5731
  );
5704
- Object.assign(sectionStyles, paddingResult.baseStyles);
5705
- if (paddingResult.mediaQueryCSS) {
5706
- mediaQueries.push(paddingResult.mediaQueryCSS);
5707
- }
5708
- const borderStyles = borderValueToCSS(border);
5709
- if (borderStyles) {
5710
- Object.assign(sectionStyles, borderStyles);
5732
+ Object.assign(sectionStyles, sectionPaddingResult.baseStyles);
5733
+ if (sectionPaddingResult.mediaQueryCSS) {
5734
+ mediaQueries.push(sectionPaddingResult.mediaQueryCSS);
5711
5735
  }
5712
- const marginResult = responsiveValueToCSS(
5713
- margin,
5736
+ const sectionMarginResult = responsiveValueToCSS(
5737
+ sectionMargin,
5714
5738
  (v) => ({ margin: marginValueToCSS(v) }),
5715
5739
  sectionClass
5716
5740
  );
5717
- Object.assign(sectionStyles, marginResult.baseStyles);
5718
- if (marginResult.mediaQueryCSS) {
5719
- mediaQueries.push(marginResult.mediaQueryCSS);
5741
+ Object.assign(sectionStyles, sectionMarginResult.baseStyles);
5742
+ if (sectionMarginResult.mediaQueryCSS) {
5743
+ mediaQueries.push(sectionMarginResult.mediaQueryCSS);
5720
5744
  }
5721
5745
  const visibilityCSS = visibilityValueToCSS(visibility, sectionClass);
5722
5746
  if (visibilityCSS) {
5723
5747
  mediaQueries.push(visibilityCSS);
5724
5748
  }
5725
- const sectionClasses = cn("relative w-full", sectionClass);
5726
- const dimensionsResult = responsiveValueToCSS(
5727
- dimensions,
5749
+ const contentBackgroundStyles = backgroundValueToCSS(contentBackground);
5750
+ const contentStyles = {
5751
+ ...contentBackgroundStyles
5752
+ };
5753
+ const contentDimensionsResult = responsiveValueToCSS(
5754
+ contentDimensions,
5728
5755
  dimensionsValueToCSS,
5729
5756
  contentClass
5730
5757
  );
5731
- if (dimensionsResult.mediaQueryCSS) {
5732
- mediaQueries.push(dimensionsResult.mediaQueryCSS);
5733
- }
5734
- const contentClasses = cn(
5735
- "relative z-10",
5736
- // Only apply preset content width if no dimensions set
5737
- !dimensions && !fullWidth && "max-w-[1200px] mx-auto px-4",
5758
+ Object.assign(contentStyles, contentDimensionsResult.baseStyles);
5759
+ if (contentDimensionsResult.mediaQueryCSS) {
5760
+ mediaQueries.push(contentDimensionsResult.mediaQueryCSS);
5761
+ }
5762
+ const hasMinHeight = (() => {
5763
+ if (!contentDimensions) return false;
5764
+ if (typeof contentDimensions === "object" && "xs" in contentDimensions) {
5765
+ const responsiveDims = contentDimensions;
5766
+ return Object.values(responsiveDims).some((v) => {
5767
+ if (!v || typeof v !== "object") return false;
5768
+ const dim2 = v;
5769
+ return dim2.minHeight?.enabled && dim2.minHeight?.value > 0;
5770
+ });
5771
+ }
5772
+ const dim = contentDimensions;
5773
+ return dim.minHeight?.enabled && dim.minHeight?.value > 0;
5774
+ })();
5775
+ if (hasMinHeight) {
5776
+ contentStyles.display = "flex";
5777
+ contentStyles.flexDirection = "column";
5778
+ }
5779
+ const contentBorderStyles = borderValueToCSS(contentBorder);
5780
+ if (contentBorderStyles) {
5781
+ Object.assign(contentStyles, contentBorderStyles);
5782
+ }
5783
+ const contentPaddingResult = responsiveValueToCSS(
5784
+ contentPadding,
5785
+ (v) => ({ padding: paddingValueToCSS(v) }),
5738
5786
  contentClass
5739
5787
  );
5788
+ Object.assign(contentStyles, contentPaddingResult.baseStyles);
5789
+ if (contentPaddingResult.mediaQueryCSS) {
5790
+ mediaQueries.push(contentPaddingResult.mediaQueryCSS);
5791
+ }
5792
+ const sectionClasses = cn("relative w-full", sectionClass);
5793
+ const contentClasses = cn("relative z-10", contentClass);
5794
+ const hasContentStyles = Object.keys(contentStyles).length > 0;
5740
5795
  const allMediaQueryCSS = mediaQueries.join("\n");
5796
+ const renderContent = () => {
5797
+ if (hasMinHeight) {
5798
+ return /* @__PURE__ */ jsx("div", { style: { flex: 1, display: "flex", flexDirection: "column", minHeight: 0 }, children: /* @__PURE__ */ jsx(Content3, { style: { flex: 1 } }) });
5799
+ }
5800
+ return /* @__PURE__ */ jsx(Content3, {});
5801
+ };
5741
5802
  return /* @__PURE__ */ jsxs(AnimatedWrapper, { animation, children: [
5742
5803
  allMediaQueryCSS && /* @__PURE__ */ jsx("style", { children: allMediaQueryCSS }),
5743
5804
  /* @__PURE__ */ jsx(
@@ -5746,7 +5807,7 @@ var SectionConfig = {
5746
5807
  id: id || void 0,
5747
5808
  className: sectionClasses,
5748
5809
  style: sectionStyles,
5749
- children: /* @__PURE__ */ jsx(Content3, { className: contentClasses, style: dimensionsResult.baseStyles })
5810
+ children: hasContentStyles ? /* @__PURE__ */ jsx("div", { className: contentClasses, style: contentStyles, children: renderContent() }) : /* @__PURE__ */ jsx(Content3, { className: contentClasses })
5750
5811
  }
5751
5812
  )
5752
5813
  ] });
@@ -6240,7 +6301,7 @@ var DEFAULT_PADDING5 = {
6240
6301
  unit: "px",
6241
6302
  linked: true
6242
6303
  };
6243
- var DEFAULT_DIMENSIONS5 = {
6304
+ var DEFAULT_DIMENSIONS4 = {
6244
6305
  mode: "full",
6245
6306
  alignment: "center",
6246
6307
  maxWidth: { value: 100, unit: "%", enabled: true }
@@ -6267,7 +6328,7 @@ var TemplateConfig = {
6267
6328
  dimensions: createResponsiveField({
6268
6329
  label: "Dimensions (Responsive)",
6269
6330
  innerField: (config) => createDimensionsField(config),
6270
- defaultValue: DEFAULT_DIMENSIONS5
6331
+ defaultValue: DEFAULT_DIMENSIONS4
6271
6332
  }),
6272
6333
  // Spacing (grouped at bottom) - Responsive
6273
6334
  margin: createResponsiveField({
@@ -6596,6 +6657,14 @@ var TextConfig = {
6596
6657
  ) });
6597
6658
  }
6598
6659
  };
6660
+ var DEFAULT_PADDING6 = {
6661
+ top: 0,
6662
+ right: 16,
6663
+ bottom: 0,
6664
+ left: 16,
6665
+ unit: "px",
6666
+ linked: false
6667
+ };
6599
6668
  var defaultProps10 = {
6600
6669
  content: "<p>Enter your content here...</p>",
6601
6670
  alignment: null,
@@ -6603,7 +6672,8 @@ var defaultProps10 = {
6603
6672
  dimensions: null,
6604
6673
  animation: null,
6605
6674
  margin: null,
6606
- customPadding: null
6675
+ customPadding: DEFAULT_PADDING6
6676
+ // Default 16px horizontal padding, visible in editor
6607
6677
  };
6608
6678
  var RichTextConfig = {
6609
6679
  label: "Rich Text",
@@ -6642,12 +6712,12 @@ var RichTextConfig = {
6642
6712
  const alignmentValue = alignment ?? "left";
6643
6713
  const alignmentClass = alignmentMap[alignmentValue] || alignmentMap.left;
6644
6714
  if (!content || content === "<p></p>") {
6645
- return /* @__PURE__ */ jsx(AnimatedWrapper, { animation, children: /* @__PURE__ */ jsx("section", { className: cn("relative overflow-hidden px-4", alignmentClass), style: Object.keys(style).length > 0 ? style : void 0, children: /* @__PURE__ */ jsx("div", { className: "prose dark:prose-invert", children: /* @__PURE__ */ jsx("p", { children: /* @__PURE__ */ jsx("em", { children: "No content available" }) }) }) }) });
6715
+ return /* @__PURE__ */ jsx(AnimatedWrapper, { animation, children: /* @__PURE__ */ jsx("section", { className: cn("relative overflow-hidden", alignmentClass), style: Object.keys(style).length > 0 ? style : void 0, children: /* @__PURE__ */ jsx("div", { className: "prose dark:prose-invert max-w-none", children: /* @__PURE__ */ jsx("p", { children: /* @__PURE__ */ jsx("em", { children: "No content available" }) }) }) }) });
6646
6716
  }
6647
- return /* @__PURE__ */ jsx(AnimatedWrapper, { animation, children: /* @__PURE__ */ jsx("section", { className: cn("relative overflow-hidden px-4", alignmentClass), style: Object.keys(style).length > 0 ? style : void 0, children: /* @__PURE__ */ jsx(
6717
+ return /* @__PURE__ */ jsx(AnimatedWrapper, { animation, children: /* @__PURE__ */ jsx("section", { className: cn("relative overflow-hidden", alignmentClass), style: Object.keys(style).length > 0 ? style : void 0, children: /* @__PURE__ */ jsx(
6648
6718
  "div",
6649
6719
  {
6650
- className: "prose dark:prose-invert",
6720
+ className: "prose dark:prose-invert max-w-none",
6651
6721
  dangerouslySetInnerHTML: { __html: content }
6652
6722
  }
6653
6723
  ) }) });
@@ -7805,7 +7875,7 @@ function RichTextRender({
7805
7875
  }
7806
7876
  return Object.keys(s).length > 0 ? s : void 0;
7807
7877
  }, [dimensions, margin, customPadding]);
7808
- return /* @__PURE__ */ jsx("section", { className: "relative overflow-hidden", style, children: /* @__PURE__ */ jsx("div", { className: "prose dark:prose-invert", dangerouslySetInnerHTML: { __html: content } }) });
7878
+ return /* @__PURE__ */ jsx("section", { className: "relative overflow-hidden", style, children: /* @__PURE__ */ jsx("div", { className: "prose dark:prose-invert max-w-none", dangerouslySetInnerHTML: { __html: content } }) });
7809
7879
  }
7810
7880
  var RichTextEditorConfig = {
7811
7881
  label: "Rich Text",
@@ -8245,6 +8315,14 @@ function createTransformField(config) {
8245
8315
  )
8246
8316
  };
8247
8317
  }
8318
+ var DEFAULT_PADDING7 = {
8319
+ top: 16,
8320
+ right: 16,
8321
+ bottom: 16,
8322
+ left: 16,
8323
+ unit: "px",
8324
+ linked: true
8325
+ };
8248
8326
  var defaultProps12 = {
8249
8327
  image: null,
8250
8328
  alt: "",
@@ -8257,7 +8335,8 @@ var defaultProps12 = {
8257
8335
  alignment: null,
8258
8336
  transform: null,
8259
8337
  animation: null,
8260
- customPadding: null,
8338
+ customPadding: DEFAULT_PADDING7,
8339
+ // Default 16px padding, visible in editor
8261
8340
  visibility: null
8262
8341
  };
8263
8342
  var ImageConfig = {
@@ -8328,7 +8407,7 @@ var ImageConfig = {
8328
8407
  if (!image?.url) {
8329
8408
  return /* @__PURE__ */ jsxs(AnimatedWrapper, { animation, children: [
8330
8409
  visibilityCSS && /* @__PURE__ */ jsx("style", { children: visibilityCSS }),
8331
- /* @__PURE__ */ jsx("div", { className: cn("py-4 px-4", wrapperClass), style: Object.keys(style).length > 0 ? style : void 0, children: /* @__PURE__ */ jsx("div", { className: alignmentClasses, children: /* @__PURE__ */ jsx(
8410
+ /* @__PURE__ */ jsx("div", { className: wrapperClass, style: Object.keys(style).length > 0 ? style : void 0, children: /* @__PURE__ */ jsx("div", { className: alignmentClasses, children: /* @__PURE__ */ jsx(
8332
8411
  "div",
8333
8412
  {
8334
8413
  className: cn(
@@ -8367,7 +8446,7 @@ var ImageConfig = {
8367
8446
  ) : imageElement;
8368
8447
  return /* @__PURE__ */ jsxs(AnimatedWrapper, { animation, children: [
8369
8448
  visibilityCSS && /* @__PURE__ */ jsx("style", { children: visibilityCSS }),
8370
- /* @__PURE__ */ jsx("div", { className: cn("py-4 px-4", wrapperClass), style: Object.keys(style).length > 0 ? style : void 0, children: /* @__PURE__ */ jsx("div", { className: alignmentClasses, children: content }) })
8449
+ /* @__PURE__ */ jsx("div", { className: wrapperClass, style: Object.keys(style).length > 0 ? style : void 0, children: /* @__PURE__ */ jsx("div", { className: alignmentClasses, children: content }) })
8371
8450
  ] });
8372
8451
  }
8373
8452
  };
@@ -8715,6 +8794,14 @@ var ButtonConfig = {
8715
8794
  );
8716
8795
  }
8717
8796
  };
8797
+ var DEFAULT_CONTENT_PADDING2 = {
8798
+ top: 16,
8799
+ right: 16,
8800
+ bottom: 16,
8801
+ left: 16,
8802
+ unit: "px",
8803
+ linked: true
8804
+ };
8718
8805
  var defaultProps14 = {
8719
8806
  image: null,
8720
8807
  heading: "Card Heading",
@@ -8729,7 +8816,8 @@ var defaultProps14 = {
8729
8816
  alignment: null,
8730
8817
  transform: null,
8731
8818
  animation: null,
8732
- customPadding: null
8819
+ contentPadding: DEFAULT_CONTENT_PADDING2
8820
+ // Default 16px padding, visible in editor
8733
8821
  };
8734
8822
  var CardConfig = {
8735
8823
  label: "Card",
@@ -8773,10 +8861,10 @@ var CardConfig = {
8773
8861
  animation: createAnimationField({ label: "Animation" }),
8774
8862
  // Spacing (grouped at bottom)
8775
8863
  margin: createMarginField({ label: "Margin" }),
8776
- customPadding: createPaddingField({ label: "Padding" })
8864
+ contentPadding: createPaddingField({ label: "Content Padding" })
8777
8865
  },
8778
8866
  defaultProps: defaultProps14,
8779
- render: ({ image, heading, text, link, openInNewTab, shadow, background, dimensions, alignment, margin, border, transform, animation, customPadding }) => {
8867
+ render: ({ image, heading, text, link, openInNewTab, shadow, background, dimensions, alignment, margin, border, transform, animation, contentPadding }) => {
8780
8868
  const hasBorderRadius = border?.radius && border.radius > 0;
8781
8869
  const cardClasses = cn(
8782
8870
  "overflow-hidden transition-all bg-card",
@@ -8812,9 +8900,10 @@ var CardConfig = {
8812
8900
  if (borderStyles) {
8813
8901
  Object.assign(cardStyle, borderStyles);
8814
8902
  }
8815
- const paddingCSS = paddingValueToCSS(customPadding);
8816
- if (paddingCSS) {
8817
- cardStyle.padding = paddingCSS;
8903
+ const contentStyle = {};
8904
+ const contentPaddingCSS = paddingValueToCSS(contentPadding);
8905
+ if (contentPaddingCSS) {
8906
+ contentStyle.padding = contentPaddingCSS;
8818
8907
  }
8819
8908
  const cardContent = /* @__PURE__ */ jsxs("div", { className: cardClasses, style: cardStyle, children: [
8820
8909
  image?.url ? /* @__PURE__ */ jsx("div", { className: "relative aspect-video w-full overflow-hidden", children: /* @__PURE__ */ jsx(
@@ -8825,7 +8914,7 @@ var CardConfig = {
8825
8914
  className: "w-full h-full object-cover"
8826
8915
  }
8827
8916
  ) }) : /* @__PURE__ */ jsx("div", { className: "aspect-video w-full bg-muted flex items-center justify-center", children: /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "No image" }) }),
8828
- /* @__PURE__ */ jsxs("div", { className: "p-4", children: [
8917
+ /* @__PURE__ */ jsxs("div", { style: contentStyle, children: [
8829
8918
  heading && /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold text-foreground mb-2", children: heading }),
8830
8919
  text && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: text })
8831
8920
  ] })
@@ -8846,6 +8935,14 @@ var CardConfig = {
8846
8935
  return /* @__PURE__ */ jsx(AnimatedWrapper, { animation, children: /* @__PURE__ */ jsx("div", { className: alignmentClasses, children: /* @__PURE__ */ jsx("div", { style: wrapperStyle, children: cardContent }) }) });
8847
8936
  }
8848
8937
  };
8938
+ var DEFAULT_PADDING8 = {
8939
+ top: 0,
8940
+ right: 16,
8941
+ bottom: 0,
8942
+ left: 16,
8943
+ unit: "px",
8944
+ linked: false
8945
+ };
8849
8946
  var defaultProps15 = {
8850
8947
  style: "solid",
8851
8948
  color: null,
@@ -8853,7 +8950,8 @@ var defaultProps15 = {
8853
8950
  dimensions: null,
8854
8951
  transform: null,
8855
8952
  animation: null,
8856
- customPadding: null
8953
+ customPadding: DEFAULT_PADDING8
8954
+ // Default 16px horizontal padding, visible in editor
8857
8955
  };
8858
8956
  var DividerConfig = {
8859
8957
  label: "Divider",
@@ -8888,7 +8986,7 @@ var DividerConfig = {
8888
8986
  }
8889
8987
  const customColor = colorValueToCSS(color);
8890
8988
  const hrStyle = customColor ? { borderColor: customColor } : void 0;
8891
- return /* @__PURE__ */ jsx(AnimatedWrapper, { animation, children: /* @__PURE__ */ jsx("div", { className: "px-4", style: Object.keys(wrapperStyle).length > 0 ? wrapperStyle : void 0, children: /* @__PURE__ */ jsx(
8989
+ return /* @__PURE__ */ jsx(AnimatedWrapper, { animation, children: /* @__PURE__ */ jsx("div", { style: Object.keys(wrapperStyle).length > 0 ? wrapperStyle : void 0, children: /* @__PURE__ */ jsx(
8892
8990
  "hr",
8893
8991
  {
8894
8992
  className: cn(
@@ -9003,9 +9101,9 @@ function AccordionRenderer({
9003
9101
  Object.assign(style, transformStyles);
9004
9102
  }
9005
9103
  if (!items || items.length === 0) {
9006
- return /* @__PURE__ */ jsx(AnimatedWrapper, { animation, children: /* @__PURE__ */ jsx("div", { className: "px-4", style: Object.keys(style).length > 0 ? style : void 0, children: /* @__PURE__ */ jsx("div", { className: accordionClasses, style: accordionStyle, children: /* @__PURE__ */ jsx("div", { className: "p-4 text-center text-muted-foreground", children: "No accordion items. Add items in the editor." }) }) }) });
9104
+ return /* @__PURE__ */ jsx(AnimatedWrapper, { animation, children: /* @__PURE__ */ jsx("div", { style: Object.keys(style).length > 0 ? style : void 0, children: /* @__PURE__ */ jsx("div", { className: accordionClasses, style: accordionStyle, children: /* @__PURE__ */ jsx("div", { className: "p-4 text-center text-muted-foreground", children: "No accordion items. Add items in the editor." }) }) }) });
9007
9105
  }
9008
- return /* @__PURE__ */ jsx(AnimatedWrapper, { animation, children: /* @__PURE__ */ jsx("div", { className: "px-4", style: Object.keys(style).length > 0 ? style : void 0, children: /* @__PURE__ */ jsx("div", { className: accordionClasses, style: accordionStyle, children: items.map((item, index) => /* @__PURE__ */ jsx(
9106
+ return /* @__PURE__ */ jsx(AnimatedWrapper, { animation, children: /* @__PURE__ */ jsx("div", { style: Object.keys(style).length > 0 ? style : void 0, children: /* @__PURE__ */ jsx("div", { className: accordionClasses, style: accordionStyle, children: items.map((item, index) => /* @__PURE__ */ jsx(
9009
9107
  AccordionItem,
9010
9108
  {
9011
9109
  item,
@@ -9016,6 +9114,14 @@ function AccordionRenderer({
9016
9114
  index
9017
9115
  )) }) }) });
9018
9116
  }
9117
+ var DEFAULT_PADDING9 = {
9118
+ top: 0,
9119
+ right: 16,
9120
+ bottom: 0,
9121
+ left: 16,
9122
+ unit: "px",
9123
+ linked: false
9124
+ };
9019
9125
  var defaultProps16 = {
9020
9126
  items: [
9021
9127
  {
@@ -9036,7 +9142,8 @@ var defaultProps16 = {
9036
9142
  dimensions: null,
9037
9143
  transform: null,
9038
9144
  animation: null,
9039
- customPadding: null
9145
+ customPadding: DEFAULT_PADDING9
9146
+ // Default 16px horizontal padding, visible in editor
9040
9147
  };
9041
9148
  var AccordionConfig = {
9042
9149
  label: "Accordion",