@delmaredigital/payload-puck 0.1.2 → 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.
- package/LICENSE +21 -73
- package/README.md +78 -22
- package/dist/AccordionClient.d.mts +1 -1
- package/dist/AccordionClient.d.ts +1 -1
- package/dist/AccordionClient.js +2 -2
- package/dist/AccordionClient.mjs +2 -2
- package/dist/AnimatedWrapper.d.mts +1 -1
- package/dist/AnimatedWrapper.d.ts +1 -1
- package/dist/components/index.d.mts +15 -18
- package/dist/components/index.d.ts +15 -18
- package/dist/components/index.js +305 -198
- package/dist/components/index.mjs +305 -198
- package/dist/config/config.editor.d.mts +1 -1
- package/dist/config/config.editor.d.ts +1 -1
- package/dist/config/config.editor.js +292 -194
- package/dist/config/config.editor.mjs +292 -194
- package/dist/config/index.js +214 -123
- package/dist/config/index.mjs +214 -123
- package/dist/editor/index.js +221 -129
- package/dist/editor/index.mjs +221 -129
- package/dist/fields/index.d.mts +2 -2
- package/dist/fields/index.d.ts +2 -2
- package/dist/fields/index.js +43 -24
- package/dist/fields/index.mjs +43 -24
- package/dist/render/index.js +214 -123
- package/dist/render/index.mjs +214 -123
- package/dist/{shared-DeNKN95N.d.mts → shared-X9UpCJKW.d.mts} +3 -1
- package/dist/{shared-DeNKN95N.d.ts → shared-X9UpCJKW.d.ts} +3 -1
- package/package.json +4 -3
package/dist/config/index.js
CHANGED
|
@@ -501,25 +501,23 @@ function responsiveValueToCSS(value, converter, uniqueId) {
|
|
|
501
501
|
mediaQueryCSS: ""
|
|
502
502
|
};
|
|
503
503
|
}
|
|
504
|
-
const
|
|
505
|
-
let baseStyles = {};
|
|
504
|
+
const cssRules = [];
|
|
506
505
|
BREAKPOINTS.forEach((bp) => {
|
|
507
506
|
const bpValue = value[bp.key];
|
|
508
507
|
if (bpValue === void 0) return;
|
|
509
508
|
const cssProps = converter(bpValue);
|
|
510
509
|
if (!cssProps) return;
|
|
510
|
+
const styleString = cssPropertiesToString(cssProps);
|
|
511
|
+
if (!styleString) return;
|
|
511
512
|
if (bp.key === "xs") {
|
|
512
|
-
|
|
513
|
+
cssRules.push(`.${uniqueId} { ${styleString} }`);
|
|
513
514
|
} else {
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
`@media (min-width: ${bp.minWidth}px) { .${uniqueId} { ${styleString} } }`
|
|
518
|
-
);
|
|
519
|
-
}
|
|
515
|
+
cssRules.push(
|
|
516
|
+
`@media (min-width: ${bp.minWidth}px) { .${uniqueId} { ${styleString} } }`
|
|
517
|
+
);
|
|
520
518
|
}
|
|
521
519
|
});
|
|
522
|
-
return { baseStyles, mediaQueryCSS:
|
|
520
|
+
return { baseStyles: {}, mediaQueryCSS: cssRules.join("\n") };
|
|
523
521
|
}
|
|
524
522
|
function visibilityValueToCSS(visibility, uniqueId) {
|
|
525
523
|
if (!visibility) return "";
|
|
@@ -569,16 +567,13 @@ function generateUniqueId() {
|
|
|
569
567
|
}
|
|
570
568
|
var defaultProps = {
|
|
571
569
|
content: [],
|
|
572
|
-
|
|
573
|
-
customPadding: null,
|
|
570
|
+
visibility: null,
|
|
574
571
|
dimensions: null,
|
|
572
|
+
background: null,
|
|
575
573
|
border: null,
|
|
574
|
+
padding: null,
|
|
576
575
|
margin: null,
|
|
577
|
-
animation: null
|
|
578
|
-
innerBackground: null,
|
|
579
|
-
innerPadding: null,
|
|
580
|
-
innerBorder: null,
|
|
581
|
-
visibility: null
|
|
576
|
+
animation: null
|
|
582
577
|
};
|
|
583
578
|
var ContainerConfig = {
|
|
584
579
|
label: "Container",
|
|
@@ -588,84 +583,86 @@ var ContainerConfig = {
|
|
|
588
583
|
defaultProps,
|
|
589
584
|
render: ({
|
|
590
585
|
content: Content,
|
|
591
|
-
|
|
592
|
-
customPadding,
|
|
586
|
+
visibility,
|
|
593
587
|
dimensions,
|
|
588
|
+
background,
|
|
594
589
|
border,
|
|
590
|
+
padding,
|
|
595
591
|
margin,
|
|
596
|
-
animation
|
|
597
|
-
innerBackground,
|
|
598
|
-
innerPadding,
|
|
599
|
-
innerBorder,
|
|
600
|
-
visibility
|
|
592
|
+
animation
|
|
601
593
|
}) => {
|
|
602
594
|
const uniqueId = generateUniqueId();
|
|
603
|
-
const
|
|
604
|
-
const innerClass = `puck-container-inner-${uniqueId}`;
|
|
595
|
+
const containerClass = `puck-container-${uniqueId}`;
|
|
605
596
|
const mediaQueries = [];
|
|
606
|
-
const
|
|
607
|
-
const
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
const outerPaddingResult = responsiveValueToCSS(
|
|
611
|
-
customPadding,
|
|
612
|
-
(v) => ({ padding: paddingValueToCSS(v) }),
|
|
613
|
-
outerClass
|
|
614
|
-
);
|
|
615
|
-
Object.assign(outerStyles, outerPaddingResult.baseStyles);
|
|
616
|
-
if (outerPaddingResult.mediaQueryCSS) {
|
|
617
|
-
mediaQueries.push(outerPaddingResult.mediaQueryCSS);
|
|
618
|
-
}
|
|
619
|
-
const outerBorderStyles = borderValueToCSS(border);
|
|
620
|
-
if (outerBorderStyles) {
|
|
621
|
-
Object.assign(outerStyles, outerBorderStyles);
|
|
597
|
+
const containerStyles = {};
|
|
598
|
+
const backgroundStyles = backgroundValueToCSS(background);
|
|
599
|
+
if (backgroundStyles) {
|
|
600
|
+
Object.assign(containerStyles, backgroundStyles);
|
|
622
601
|
}
|
|
623
|
-
const
|
|
624
|
-
|
|
625
|
-
(
|
|
626
|
-
outerClass
|
|
627
|
-
);
|
|
628
|
-
Object.assign(outerStyles, marginResult.baseStyles);
|
|
629
|
-
if (marginResult.mediaQueryCSS) {
|
|
630
|
-
mediaQueries.push(marginResult.mediaQueryCSS);
|
|
602
|
+
const borderStyles = borderValueToCSS(border);
|
|
603
|
+
if (borderStyles) {
|
|
604
|
+
Object.assign(containerStyles, borderStyles);
|
|
631
605
|
}
|
|
632
|
-
const innerBackgroundStyles = backgroundValueToCSS(innerBackground);
|
|
633
|
-
const innerStyles = {
|
|
634
|
-
...innerBackgroundStyles
|
|
635
|
-
};
|
|
636
606
|
const dimensionsResult = responsiveValueToCSS(
|
|
637
607
|
dimensions,
|
|
638
608
|
dimensionsValueToCSS,
|
|
639
|
-
|
|
609
|
+
containerClass
|
|
640
610
|
);
|
|
641
|
-
Object.assign(
|
|
611
|
+
Object.assign(containerStyles, dimensionsResult.baseStyles);
|
|
642
612
|
if (dimensionsResult.mediaQueryCSS) {
|
|
643
613
|
mediaQueries.push(dimensionsResult.mediaQueryCSS);
|
|
644
614
|
}
|
|
645
|
-
const
|
|
646
|
-
|
|
615
|
+
const hasMinHeight = (() => {
|
|
616
|
+
if (!dimensions) return false;
|
|
617
|
+
if (typeof dimensions === "object" && "xs" in dimensions) {
|
|
618
|
+
const responsiveDims = dimensions;
|
|
619
|
+
return Object.values(responsiveDims).some((v) => {
|
|
620
|
+
if (!v || typeof v !== "object") return false;
|
|
621
|
+
const dim2 = v;
|
|
622
|
+
return dim2.minHeight?.enabled && dim2.minHeight?.value > 0;
|
|
623
|
+
});
|
|
624
|
+
}
|
|
625
|
+
const dim = dimensions;
|
|
626
|
+
return dim.minHeight?.enabled && dim.minHeight?.value > 0;
|
|
627
|
+
})();
|
|
628
|
+
if (hasMinHeight) {
|
|
629
|
+
containerStyles.display = "flex";
|
|
630
|
+
containerStyles.flexDirection = "column";
|
|
631
|
+
}
|
|
632
|
+
const paddingResult = responsiveValueToCSS(
|
|
633
|
+
padding,
|
|
647
634
|
(v) => ({ padding: paddingValueToCSS(v) }),
|
|
648
|
-
|
|
635
|
+
containerClass
|
|
649
636
|
);
|
|
650
|
-
Object.assign(
|
|
651
|
-
if (
|
|
652
|
-
mediaQueries.push(
|
|
637
|
+
Object.assign(containerStyles, paddingResult.baseStyles);
|
|
638
|
+
if (paddingResult.mediaQueryCSS) {
|
|
639
|
+
mediaQueries.push(paddingResult.mediaQueryCSS);
|
|
653
640
|
}
|
|
654
|
-
const
|
|
655
|
-
|
|
656
|
-
|
|
641
|
+
const marginResult = responsiveValueToCSS(
|
|
642
|
+
margin,
|
|
643
|
+
(v) => ({ margin: marginValueToCSS(v) }),
|
|
644
|
+
containerClass
|
|
645
|
+
);
|
|
646
|
+
Object.assign(containerStyles, marginResult.baseStyles);
|
|
647
|
+
if (marginResult.mediaQueryCSS) {
|
|
648
|
+
mediaQueries.push(marginResult.mediaQueryCSS);
|
|
657
649
|
}
|
|
658
|
-
const visibilityCSS = visibilityValueToCSS(visibility,
|
|
650
|
+
const visibilityCSS = visibilityValueToCSS(visibility, containerClass);
|
|
659
651
|
if (visibilityCSS) {
|
|
660
652
|
mediaQueries.push(visibilityCSS);
|
|
661
653
|
}
|
|
662
|
-
const contentClasses = cn("px-4", innerClass);
|
|
663
|
-
const hasInnerStyles = Object.keys(innerStyles).length > 0;
|
|
664
654
|
const allMediaQueryCSS = mediaQueries.join("\n");
|
|
655
|
+
const hasStyles = Object.keys(containerStyles).length > 0;
|
|
665
656
|
const ContentSlot = Content;
|
|
657
|
+
const renderContent = () => {
|
|
658
|
+
if (hasMinHeight) {
|
|
659
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 1, display: "flex", flexDirection: "column", minHeight: 0 }, children: /* @__PURE__ */ jsxRuntime.jsx(ContentSlot, { style: { flex: 1 } }) });
|
|
660
|
+
}
|
|
661
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ContentSlot, {});
|
|
662
|
+
};
|
|
666
663
|
return /* @__PURE__ */ jsxRuntime.jsxs(AnimatedWrapper.AnimatedWrapper, { animation, children: [
|
|
667
664
|
allMediaQueryCSS && /* @__PURE__ */ jsxRuntime.jsx("style", { children: allMediaQueryCSS }),
|
|
668
|
-
|
|
665
|
+
hasStyles ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: containerClass, style: containerStyles, children: renderContent() }) : /* @__PURE__ */ jsxRuntime.jsx(ContentSlot, { className: containerClass })
|
|
669
666
|
] });
|
|
670
667
|
}
|
|
671
668
|
};
|
|
@@ -893,15 +890,33 @@ var idCounter4 = 0;
|
|
|
893
890
|
function generateUniqueId4() {
|
|
894
891
|
return `s${(++idCounter4).toString(36)}${Math.random().toString(36).slice(2, 6)}`;
|
|
895
892
|
}
|
|
893
|
+
var DEFAULT_CONTENT_DIMENSIONS = {
|
|
894
|
+
mode: "contained",
|
|
895
|
+
alignment: "center",
|
|
896
|
+
maxWidth: { value: 1200, unit: "px", enabled: true }
|
|
897
|
+
};
|
|
898
|
+
var DEFAULT_CONTENT_PADDING = {
|
|
899
|
+
top: 0,
|
|
900
|
+
right: 16,
|
|
901
|
+
bottom: 0,
|
|
902
|
+
left: 16,
|
|
903
|
+
unit: "px",
|
|
904
|
+
linked: false
|
|
905
|
+
};
|
|
896
906
|
var defaultProps4 = {
|
|
897
907
|
id: "",
|
|
898
908
|
content: [],
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
909
|
+
// Section layer defaults
|
|
910
|
+
sectionBackground: null,
|
|
911
|
+
sectionBorder: null,
|
|
912
|
+
sectionPadding: null,
|
|
913
|
+
sectionMargin: null,
|
|
914
|
+
// Content layer defaults - 1200px max-width so two-layer design is immediately visible
|
|
915
|
+
contentDimensions: { xs: DEFAULT_CONTENT_DIMENSIONS },
|
|
916
|
+
contentBackground: null,
|
|
917
|
+
contentBorder: null,
|
|
918
|
+
contentPadding: { xs: DEFAULT_CONTENT_PADDING },
|
|
919
|
+
// Other
|
|
905
920
|
animation: null,
|
|
906
921
|
visibility: null
|
|
907
922
|
};
|
|
@@ -914,12 +929,14 @@ var SectionConfig = {
|
|
|
914
929
|
render: ({
|
|
915
930
|
id,
|
|
916
931
|
content: Content,
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
932
|
+
sectionBackground,
|
|
933
|
+
sectionBorder,
|
|
934
|
+
sectionPadding,
|
|
935
|
+
sectionMargin,
|
|
936
|
+
contentDimensions,
|
|
937
|
+
contentBackground,
|
|
938
|
+
contentBorder,
|
|
939
|
+
contentPadding,
|
|
923
940
|
animation,
|
|
924
941
|
visibility
|
|
925
942
|
}) => {
|
|
@@ -927,53 +944,90 @@ var SectionConfig = {
|
|
|
927
944
|
const sectionClass = `puck-section-${uniqueId}`;
|
|
928
945
|
const contentClass = `puck-section-content-${uniqueId}`;
|
|
929
946
|
const mediaQueries = [];
|
|
930
|
-
const
|
|
947
|
+
const sectionBackgroundStyles = backgroundValueToCSS(sectionBackground);
|
|
931
948
|
const sectionStyles = {
|
|
932
|
-
...
|
|
949
|
+
...sectionBackgroundStyles
|
|
933
950
|
};
|
|
934
|
-
const
|
|
935
|
-
|
|
951
|
+
const sectionBorderStyles = borderValueToCSS(sectionBorder);
|
|
952
|
+
if (sectionBorderStyles) {
|
|
953
|
+
Object.assign(sectionStyles, sectionBorderStyles);
|
|
954
|
+
}
|
|
955
|
+
const sectionPaddingResult = responsiveValueToCSS(
|
|
956
|
+
sectionPadding,
|
|
936
957
|
(v) => ({ padding: paddingValueToCSS(v) }),
|
|
937
958
|
sectionClass
|
|
938
959
|
);
|
|
939
|
-
Object.assign(sectionStyles,
|
|
940
|
-
if (
|
|
941
|
-
mediaQueries.push(
|
|
942
|
-
}
|
|
943
|
-
const borderStyles = borderValueToCSS(border);
|
|
944
|
-
if (borderStyles) {
|
|
945
|
-
Object.assign(sectionStyles, borderStyles);
|
|
960
|
+
Object.assign(sectionStyles, sectionPaddingResult.baseStyles);
|
|
961
|
+
if (sectionPaddingResult.mediaQueryCSS) {
|
|
962
|
+
mediaQueries.push(sectionPaddingResult.mediaQueryCSS);
|
|
946
963
|
}
|
|
947
|
-
const
|
|
948
|
-
|
|
964
|
+
const sectionMarginResult = responsiveValueToCSS(
|
|
965
|
+
sectionMargin,
|
|
949
966
|
(v) => ({ margin: marginValueToCSS(v) }),
|
|
950
967
|
sectionClass
|
|
951
968
|
);
|
|
952
|
-
Object.assign(sectionStyles,
|
|
953
|
-
if (
|
|
954
|
-
mediaQueries.push(
|
|
969
|
+
Object.assign(sectionStyles, sectionMarginResult.baseStyles);
|
|
970
|
+
if (sectionMarginResult.mediaQueryCSS) {
|
|
971
|
+
mediaQueries.push(sectionMarginResult.mediaQueryCSS);
|
|
955
972
|
}
|
|
956
973
|
const visibilityCSS = visibilityValueToCSS(visibility, sectionClass);
|
|
957
974
|
if (visibilityCSS) {
|
|
958
975
|
mediaQueries.push(visibilityCSS);
|
|
959
976
|
}
|
|
960
|
-
const
|
|
961
|
-
const
|
|
962
|
-
|
|
977
|
+
const contentBackgroundStyles = backgroundValueToCSS(contentBackground);
|
|
978
|
+
const contentStyles = {
|
|
979
|
+
...contentBackgroundStyles
|
|
980
|
+
};
|
|
981
|
+
const contentDimensionsResult = responsiveValueToCSS(
|
|
982
|
+
contentDimensions,
|
|
963
983
|
dimensionsValueToCSS,
|
|
964
984
|
contentClass
|
|
965
985
|
);
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
986
|
+
Object.assign(contentStyles, contentDimensionsResult.baseStyles);
|
|
987
|
+
if (contentDimensionsResult.mediaQueryCSS) {
|
|
988
|
+
mediaQueries.push(contentDimensionsResult.mediaQueryCSS);
|
|
989
|
+
}
|
|
990
|
+
const hasMinHeight = (() => {
|
|
991
|
+
if (!contentDimensions) return false;
|
|
992
|
+
if (typeof contentDimensions === "object" && "xs" in contentDimensions) {
|
|
993
|
+
const responsiveDims = contentDimensions;
|
|
994
|
+
return Object.values(responsiveDims).some((v) => {
|
|
995
|
+
if (!v || typeof v !== "object") return false;
|
|
996
|
+
const dim2 = v;
|
|
997
|
+
return dim2.minHeight?.enabled && dim2.minHeight?.value > 0;
|
|
998
|
+
});
|
|
999
|
+
}
|
|
1000
|
+
const dim = contentDimensions;
|
|
1001
|
+
return dim.minHeight?.enabled && dim.minHeight?.value > 0;
|
|
1002
|
+
})();
|
|
1003
|
+
if (hasMinHeight) {
|
|
1004
|
+
contentStyles.display = "flex";
|
|
1005
|
+
contentStyles.flexDirection = "column";
|
|
1006
|
+
}
|
|
1007
|
+
const contentBorderStyles = borderValueToCSS(contentBorder);
|
|
1008
|
+
if (contentBorderStyles) {
|
|
1009
|
+
Object.assign(contentStyles, contentBorderStyles);
|
|
1010
|
+
}
|
|
1011
|
+
const contentPaddingResult = responsiveValueToCSS(
|
|
1012
|
+
contentPadding,
|
|
1013
|
+
(v) => ({ padding: paddingValueToCSS(v) }),
|
|
973
1014
|
contentClass
|
|
974
1015
|
);
|
|
1016
|
+
Object.assign(contentStyles, contentPaddingResult.baseStyles);
|
|
1017
|
+
if (contentPaddingResult.mediaQueryCSS) {
|
|
1018
|
+
mediaQueries.push(contentPaddingResult.mediaQueryCSS);
|
|
1019
|
+
}
|
|
1020
|
+
const sectionClasses = cn("relative w-full", sectionClass);
|
|
1021
|
+
const contentClasses = cn("relative z-10", contentClass);
|
|
1022
|
+
const hasContentStyles = Object.keys(contentStyles).length > 0;
|
|
975
1023
|
const allMediaQueryCSS = mediaQueries.join("\n");
|
|
976
1024
|
const ContentSlot = Content;
|
|
1025
|
+
const renderContent = () => {
|
|
1026
|
+
if (hasMinHeight) {
|
|
1027
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 1, display: "flex", flexDirection: "column", minHeight: 0 }, children: /* @__PURE__ */ jsxRuntime.jsx(ContentSlot, { style: { flex: 1 } }) });
|
|
1028
|
+
}
|
|
1029
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ContentSlot, {});
|
|
1030
|
+
};
|
|
977
1031
|
return /* @__PURE__ */ jsxRuntime.jsxs(AnimatedWrapper.AnimatedWrapper, { animation, children: [
|
|
978
1032
|
allMediaQueryCSS && /* @__PURE__ */ jsxRuntime.jsx("style", { children: allMediaQueryCSS }),
|
|
979
1033
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -982,7 +1036,7 @@ var SectionConfig = {
|
|
|
982
1036
|
id: id || void 0,
|
|
983
1037
|
className: sectionClasses,
|
|
984
1038
|
style: sectionStyles,
|
|
985
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1039
|
+
children: hasContentStyles ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: contentClasses, style: contentStyles, children: renderContent() }) : /* @__PURE__ */ jsxRuntime.jsx(ContentSlot, { className: contentClasses })
|
|
986
1040
|
}
|
|
987
1041
|
)
|
|
988
1042
|
] });
|
|
@@ -1203,6 +1257,14 @@ var TextConfig = {
|
|
|
1203
1257
|
) });
|
|
1204
1258
|
}
|
|
1205
1259
|
};
|
|
1260
|
+
var DEFAULT_PADDING = {
|
|
1261
|
+
top: 0,
|
|
1262
|
+
right: 16,
|
|
1263
|
+
bottom: 0,
|
|
1264
|
+
left: 16,
|
|
1265
|
+
unit: "px",
|
|
1266
|
+
linked: false
|
|
1267
|
+
};
|
|
1206
1268
|
var defaultProps9 = {
|
|
1207
1269
|
content: "<p>Enter your content here...</p>",
|
|
1208
1270
|
alignment: null,
|
|
@@ -1210,7 +1272,8 @@ var defaultProps9 = {
|
|
|
1210
1272
|
dimensions: null,
|
|
1211
1273
|
animation: null,
|
|
1212
1274
|
margin: null,
|
|
1213
|
-
customPadding:
|
|
1275
|
+
customPadding: DEFAULT_PADDING
|
|
1276
|
+
// Default 16px horizontal padding
|
|
1214
1277
|
};
|
|
1215
1278
|
var RichTextConfig = {
|
|
1216
1279
|
label: "Rich Text",
|
|
@@ -1235,17 +1298,25 @@ var RichTextConfig = {
|
|
|
1235
1298
|
const alignmentValue = alignment ?? "left";
|
|
1236
1299
|
const alignmentClass = alignmentMap[alignmentValue] || alignmentMap.left;
|
|
1237
1300
|
if (!content || content === "<p></p>") {
|
|
1238
|
-
return /* @__PURE__ */ jsxRuntime.jsx(AnimatedWrapper.AnimatedWrapper, { animation, children: /* @__PURE__ */ jsxRuntime.jsx("section", { className: cn("relative overflow-hidden
|
|
1301
|
+
return /* @__PURE__ */ jsxRuntime.jsx(AnimatedWrapper.AnimatedWrapper, { animation, children: /* @__PURE__ */ jsxRuntime.jsx("section", { className: cn("relative overflow-hidden", alignmentClass), style: Object.keys(style).length > 0 ? style : void 0, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "prose dark:prose-invert max-w-none", children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: /* @__PURE__ */ jsxRuntime.jsx("em", { children: "No content available" }) }) }) }) });
|
|
1239
1302
|
}
|
|
1240
|
-
return /* @__PURE__ */ jsxRuntime.jsx(AnimatedWrapper.AnimatedWrapper, { animation, children: /* @__PURE__ */ jsxRuntime.jsx("section", { className: cn("relative overflow-hidden
|
|
1303
|
+
return /* @__PURE__ */ jsxRuntime.jsx(AnimatedWrapper.AnimatedWrapper, { animation, children: /* @__PURE__ */ jsxRuntime.jsx("section", { className: cn("relative overflow-hidden", alignmentClass), style: Object.keys(style).length > 0 ? style : void 0, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1241
1304
|
"div",
|
|
1242
1305
|
{
|
|
1243
|
-
className: "prose dark:prose-invert",
|
|
1306
|
+
className: "prose dark:prose-invert max-w-none",
|
|
1244
1307
|
dangerouslySetInnerHTML: { __html: content }
|
|
1245
1308
|
}
|
|
1246
1309
|
) }) });
|
|
1247
1310
|
}
|
|
1248
1311
|
};
|
|
1312
|
+
var DEFAULT_PADDING2 = {
|
|
1313
|
+
top: 16,
|
|
1314
|
+
right: 16,
|
|
1315
|
+
bottom: 16,
|
|
1316
|
+
left: 16,
|
|
1317
|
+
unit: "px",
|
|
1318
|
+
linked: true
|
|
1319
|
+
};
|
|
1249
1320
|
var idCounter7 = 0;
|
|
1250
1321
|
function generateUniqueId7() {
|
|
1251
1322
|
return `i${(++idCounter7).toString(36)}${Math.random().toString(36).slice(2, 6)}`;
|
|
@@ -1262,7 +1333,8 @@ var defaultProps10 = {
|
|
|
1262
1333
|
alignment: null,
|
|
1263
1334
|
transform: null,
|
|
1264
1335
|
animation: null,
|
|
1265
|
-
customPadding:
|
|
1336
|
+
customPadding: DEFAULT_PADDING2,
|
|
1337
|
+
// Default 16px padding
|
|
1266
1338
|
visibility: null
|
|
1267
1339
|
};
|
|
1268
1340
|
var ImageConfig = {
|
|
@@ -1302,7 +1374,7 @@ var ImageConfig = {
|
|
|
1302
1374
|
if (!image?.url) {
|
|
1303
1375
|
return /* @__PURE__ */ jsxRuntime.jsxs(AnimatedWrapper.AnimatedWrapper, { animation, children: [
|
|
1304
1376
|
visibilityCSS && /* @__PURE__ */ jsxRuntime.jsx("style", { children: visibilityCSS }),
|
|
1305
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
1377
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: wrapperClass, style: Object.keys(style).length > 0 ? style : void 0, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: alignmentClasses, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1306
1378
|
"div",
|
|
1307
1379
|
{
|
|
1308
1380
|
className: cn(
|
|
@@ -1341,7 +1413,7 @@ var ImageConfig = {
|
|
|
1341
1413
|
) : imageElement;
|
|
1342
1414
|
return /* @__PURE__ */ jsxRuntime.jsxs(AnimatedWrapper.AnimatedWrapper, { animation, children: [
|
|
1343
1415
|
visibilityCSS && /* @__PURE__ */ jsxRuntime.jsx("style", { children: visibilityCSS }),
|
|
1344
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
1416
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: wrapperClass, style: Object.keys(style).length > 0 ? style : void 0, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: alignmentClasses, children: content }) })
|
|
1345
1417
|
] });
|
|
1346
1418
|
}
|
|
1347
1419
|
};
|
|
@@ -1735,6 +1807,14 @@ var ButtonConfig = {
|
|
|
1735
1807
|
);
|
|
1736
1808
|
}
|
|
1737
1809
|
};
|
|
1810
|
+
var DEFAULT_CONTENT_PADDING2 = {
|
|
1811
|
+
top: 16,
|
|
1812
|
+
right: 16,
|
|
1813
|
+
bottom: 16,
|
|
1814
|
+
left: 16,
|
|
1815
|
+
unit: "px",
|
|
1816
|
+
linked: true
|
|
1817
|
+
};
|
|
1738
1818
|
var defaultProps12 = {
|
|
1739
1819
|
image: null,
|
|
1740
1820
|
heading: "Card Heading",
|
|
@@ -1749,12 +1829,13 @@ var defaultProps12 = {
|
|
|
1749
1829
|
alignment: null,
|
|
1750
1830
|
transform: null,
|
|
1751
1831
|
animation: null,
|
|
1752
|
-
|
|
1832
|
+
contentPadding: DEFAULT_CONTENT_PADDING2
|
|
1833
|
+
// Default 16px padding
|
|
1753
1834
|
};
|
|
1754
1835
|
var CardConfig = {
|
|
1755
1836
|
label: "Card",
|
|
1756
1837
|
defaultProps: defaultProps12,
|
|
1757
|
-
render: ({ image, heading, text, link, openInNewTab, shadow, background, dimensions, alignment, margin, border, transform, animation,
|
|
1838
|
+
render: ({ image, heading, text, link, openInNewTab, shadow, background, dimensions, alignment, margin, border, transform, animation, contentPadding }) => {
|
|
1758
1839
|
const hasBorderRadius = border?.radius && border.radius > 0;
|
|
1759
1840
|
const cardClasses = cn(
|
|
1760
1841
|
"overflow-hidden transition-all bg-card",
|
|
@@ -1790,9 +1871,10 @@ var CardConfig = {
|
|
|
1790
1871
|
if (borderStyles) {
|
|
1791
1872
|
Object.assign(cardStyle, borderStyles);
|
|
1792
1873
|
}
|
|
1793
|
-
const
|
|
1794
|
-
|
|
1795
|
-
|
|
1874
|
+
const contentStyle = {};
|
|
1875
|
+
const contentPaddingCSS = paddingValueToCSS(contentPadding);
|
|
1876
|
+
if (contentPaddingCSS) {
|
|
1877
|
+
contentStyle.padding = contentPaddingCSS;
|
|
1796
1878
|
}
|
|
1797
1879
|
const cardContent = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cardClasses, style: cardStyle, children: [
|
|
1798
1880
|
image?.url ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative aspect-video w-full overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1803,7 +1885,7 @@ var CardConfig = {
|
|
|
1803
1885
|
className: "w-full h-full object-cover"
|
|
1804
1886
|
}
|
|
1805
1887
|
) }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "aspect-video w-full bg-muted flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "No image" }) }),
|
|
1806
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
1888
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle, children: [
|
|
1807
1889
|
heading && /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-lg font-semibold text-foreground mb-2", children: heading }),
|
|
1808
1890
|
text && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground text-sm", children: text })
|
|
1809
1891
|
] })
|
|
@@ -1824,6 +1906,14 @@ var CardConfig = {
|
|
|
1824
1906
|
return /* @__PURE__ */ jsxRuntime.jsx(AnimatedWrapper.AnimatedWrapper, { animation, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: alignmentClasses, children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: wrapperStyle, children: cardContent }) }) });
|
|
1825
1907
|
}
|
|
1826
1908
|
};
|
|
1909
|
+
var DEFAULT_PADDING3 = {
|
|
1910
|
+
top: 0,
|
|
1911
|
+
right: 16,
|
|
1912
|
+
bottom: 0,
|
|
1913
|
+
left: 16,
|
|
1914
|
+
unit: "px",
|
|
1915
|
+
linked: false
|
|
1916
|
+
};
|
|
1827
1917
|
var defaultProps13 = {
|
|
1828
1918
|
style: "solid",
|
|
1829
1919
|
color: null,
|
|
@@ -1831,7 +1921,8 @@ var defaultProps13 = {
|
|
|
1831
1921
|
dimensions: null,
|
|
1832
1922
|
transform: null,
|
|
1833
1923
|
animation: null,
|
|
1834
|
-
customPadding:
|
|
1924
|
+
customPadding: DEFAULT_PADDING3
|
|
1925
|
+
// Default 16px horizontal padding
|
|
1835
1926
|
};
|
|
1836
1927
|
var DividerConfig = {
|
|
1837
1928
|
label: "Divider",
|
|
@@ -1855,7 +1946,7 @@ var DividerConfig = {
|
|
|
1855
1946
|
}
|
|
1856
1947
|
const customColor = colorValueToCSS(color);
|
|
1857
1948
|
const hrStyle = customColor ? { borderColor: customColor } : void 0;
|
|
1858
|
-
return /* @__PURE__ */ jsxRuntime.jsx(AnimatedWrapper.AnimatedWrapper, { animation, children: /* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
1949
|
+
return /* @__PURE__ */ jsxRuntime.jsx(AnimatedWrapper.AnimatedWrapper, { animation, children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: Object.keys(wrapperStyle).length > 0 ? wrapperStyle : void 0, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1859
1950
|
"hr",
|
|
1860
1951
|
{
|
|
1861
1952
|
className: cn(
|