@djangocfg/nextjs 2.1.20 → 2.1.22
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/config/index.mjs +1 -1
- package/dist/config/index.mjs.map +1 -1
- package/dist/index.mjs +199 -186
- package/dist/index.mjs.map +1 -1
- package/dist/og-image/components/index.mjs +196 -184
- package/dist/og-image/components/index.mjs.map +1 -1
- package/dist/og-image/index.mjs +198 -185
- package/dist/og-image/index.mjs.map +1 -1
- package/package.json +4 -4
- package/src/og-image/components/DefaultTemplate.tsx +0 -1
package/dist/index.mjs
CHANGED
|
@@ -14,7 +14,7 @@ var require_package = __commonJS({
|
|
|
14
14
|
"package.json"(exports, module) {
|
|
15
15
|
module.exports = {
|
|
16
16
|
name: "@djangocfg/nextjs",
|
|
17
|
-
version: "2.1.
|
|
17
|
+
version: "2.1.22",
|
|
18
18
|
description: "Next.js server utilities: sitemap, health, OG images, contact forms, navigation, config",
|
|
19
19
|
keywords: [
|
|
20
20
|
"nextjs",
|
|
@@ -561,7 +561,7 @@ function createOgImageMetadataGenerator(options) {
|
|
|
561
561
|
}
|
|
562
562
|
|
|
563
563
|
// src/og-image/components/DefaultTemplate.tsx
|
|
564
|
-
import
|
|
564
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
565
565
|
function DefaultTemplate({
|
|
566
566
|
title,
|
|
567
567
|
description,
|
|
@@ -593,7 +593,7 @@ function DefaultTemplate({
|
|
|
593
593
|
}) {
|
|
594
594
|
const calculatedTitleSize = titleSize || (title.length > 60 ? 56 : 72);
|
|
595
595
|
const backgroundStyle = backgroundType === "gradient" ? `linear-gradient(135deg, ${gradientStart} 0%, ${gradientEnd} 100%)` : backgroundColor;
|
|
596
|
-
const gridOverlay = devMode ? /* @__PURE__ */
|
|
596
|
+
const gridOverlay = devMode ? /* @__PURE__ */ jsx(
|
|
597
597
|
"div",
|
|
598
598
|
{
|
|
599
599
|
style: {
|
|
@@ -612,7 +612,7 @@ function DefaultTemplate({
|
|
|
612
612
|
}
|
|
613
613
|
}
|
|
614
614
|
) : null;
|
|
615
|
-
return /* @__PURE__ */
|
|
615
|
+
return /* @__PURE__ */ jsxs(
|
|
616
616
|
"div",
|
|
617
617
|
{
|
|
618
618
|
style: {
|
|
@@ -626,102 +626,108 @@ function DefaultTemplate({
|
|
|
626
626
|
padding: `${padding}px`,
|
|
627
627
|
fontFamily: "system-ui, -apple-system, sans-serif",
|
|
628
628
|
position: "relative"
|
|
629
|
-
}
|
|
630
|
-
},
|
|
631
|
-
gridOverlay,
|
|
632
|
-
(showLogo && logo || showSiteName && siteName) && /* @__PURE__ */ React2.createElement(
|
|
633
|
-
"div",
|
|
634
|
-
{
|
|
635
|
-
style: {
|
|
636
|
-
display: "flex",
|
|
637
|
-
alignItems: "center",
|
|
638
|
-
gap: "16px"
|
|
639
|
-
}
|
|
640
629
|
},
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
630
|
+
children: [
|
|
631
|
+
gridOverlay,
|
|
632
|
+
(showLogo && logo || showSiteName && siteName) && /* @__PURE__ */ jsxs(
|
|
633
|
+
"div",
|
|
634
|
+
{
|
|
635
|
+
style: {
|
|
636
|
+
display: "flex",
|
|
637
|
+
alignItems: "center",
|
|
638
|
+
gap: "16px"
|
|
639
|
+
},
|
|
640
|
+
children: [
|
|
641
|
+
showLogo && logo && // eslint-disable-next-line @next/next/no-img-element
|
|
642
|
+
/* @__PURE__ */ jsx(
|
|
643
|
+
"img",
|
|
644
|
+
{
|
|
645
|
+
src: logo,
|
|
646
|
+
alt: "Logo",
|
|
647
|
+
width: logoSize,
|
|
648
|
+
height: logoSize,
|
|
649
|
+
style: {
|
|
650
|
+
borderRadius: "8px"
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
),
|
|
654
|
+
showSiteName && siteName && /* @__PURE__ */ jsx(
|
|
655
|
+
"div",
|
|
656
|
+
{
|
|
657
|
+
style: {
|
|
658
|
+
fontSize: siteNameSize,
|
|
659
|
+
fontWeight: 600,
|
|
660
|
+
color: siteNameColor,
|
|
661
|
+
letterSpacing: "-0.02em"
|
|
662
|
+
},
|
|
663
|
+
children: siteName
|
|
664
|
+
}
|
|
665
|
+
)
|
|
666
|
+
]
|
|
651
667
|
}
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
668
|
+
),
|
|
669
|
+
/* @__PURE__ */ jsxs(
|
|
670
|
+
"div",
|
|
671
|
+
{
|
|
672
|
+
style: {
|
|
673
|
+
display: "flex",
|
|
674
|
+
flexDirection: "column",
|
|
675
|
+
gap: "24px",
|
|
676
|
+
flex: 1,
|
|
677
|
+
justifyContent: "center"
|
|
678
|
+
},
|
|
679
|
+
children: [
|
|
680
|
+
/* @__PURE__ */ jsx(
|
|
681
|
+
"div",
|
|
682
|
+
{
|
|
683
|
+
style: {
|
|
684
|
+
fontSize: calculatedTitleSize,
|
|
685
|
+
fontWeight: titleWeight,
|
|
686
|
+
color: titleColor,
|
|
687
|
+
lineHeight: 1.1,
|
|
688
|
+
letterSpacing: "-0.03em",
|
|
689
|
+
textShadow: backgroundType === "gradient" ? "0 2px 20px rgba(0, 0, 0, 0.2)" : "none",
|
|
690
|
+
maxWidth: "100%",
|
|
691
|
+
wordWrap: "break-word"
|
|
692
|
+
},
|
|
693
|
+
children: title
|
|
694
|
+
}
|
|
695
|
+
),
|
|
696
|
+
description && /* @__PURE__ */ jsx(
|
|
697
|
+
"div",
|
|
698
|
+
{
|
|
699
|
+
style: {
|
|
700
|
+
fontSize: descriptionSize,
|
|
701
|
+
fontWeight: 400,
|
|
702
|
+
color: descriptionColor,
|
|
703
|
+
lineHeight: 1.5,
|
|
704
|
+
letterSpacing: "-0.01em",
|
|
705
|
+
maxWidth: "90%",
|
|
706
|
+
display: "-webkit-box",
|
|
707
|
+
WebkitLineClamp: 2,
|
|
708
|
+
WebkitBoxOrient: "vertical",
|
|
709
|
+
overflow: "hidden"
|
|
710
|
+
},
|
|
711
|
+
children: description
|
|
712
|
+
}
|
|
713
|
+
)
|
|
714
|
+
]
|
|
690
715
|
}
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
letterSpacing: "-0.01em",
|
|
703
|
-
maxWidth: "90%",
|
|
704
|
-
display: "-webkit-box",
|
|
705
|
-
WebkitLineClamp: 2,
|
|
706
|
-
WebkitBoxOrient: "vertical",
|
|
707
|
-
overflow: "hidden"
|
|
716
|
+
),
|
|
717
|
+
/* @__PURE__ */ jsx(
|
|
718
|
+
"div",
|
|
719
|
+
{
|
|
720
|
+
style: {
|
|
721
|
+
display: "flex",
|
|
722
|
+
width: "100%",
|
|
723
|
+
height: "4px",
|
|
724
|
+
background: backgroundType === "gradient" ? `linear-gradient(90deg, ${gradientStart} 0%, ${gradientEnd} 100%)` : gradientStart,
|
|
725
|
+
borderRadius: "2px"
|
|
726
|
+
}
|
|
708
727
|
}
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
),
|
|
713
|
-
/* @__PURE__ */ React2.createElement(
|
|
714
|
-
"div",
|
|
715
|
-
{
|
|
716
|
-
style: {
|
|
717
|
-
display: "flex",
|
|
718
|
-
width: "100%",
|
|
719
|
-
height: "4px",
|
|
720
|
-
background: backgroundType === "gradient" ? `linear-gradient(90deg, ${gradientStart} 0%, ${gradientEnd} 100%)` : gradientStart,
|
|
721
|
-
borderRadius: "2px"
|
|
722
|
-
}
|
|
723
|
-
}
|
|
724
|
-
)
|
|
728
|
+
)
|
|
729
|
+
]
|
|
730
|
+
}
|
|
725
731
|
);
|
|
726
732
|
}
|
|
727
733
|
function LightTemplate({
|
|
@@ -755,7 +761,7 @@ function LightTemplate({
|
|
|
755
761
|
}) {
|
|
756
762
|
const calculatedTitleSize = titleSize || (title.length > 60 ? 56 : 72);
|
|
757
763
|
const backgroundStyle = backgroundType === "gradient" ? `linear-gradient(135deg, ${gradientStart} 0%, ${gradientEnd} 100%)` : backgroundColor;
|
|
758
|
-
const gridOverlay = devMode ? /* @__PURE__ */
|
|
764
|
+
const gridOverlay = devMode ? /* @__PURE__ */ jsx(
|
|
759
765
|
"div",
|
|
760
766
|
{
|
|
761
767
|
style: {
|
|
@@ -774,7 +780,7 @@ function LightTemplate({
|
|
|
774
780
|
}
|
|
775
781
|
}
|
|
776
782
|
) : null;
|
|
777
|
-
return /* @__PURE__ */
|
|
783
|
+
return /* @__PURE__ */ jsxs(
|
|
778
784
|
"div",
|
|
779
785
|
{
|
|
780
786
|
style: {
|
|
@@ -788,101 +794,108 @@ function LightTemplate({
|
|
|
788
794
|
padding: `${padding}px`,
|
|
789
795
|
fontFamily: "system-ui, -apple-system, sans-serif",
|
|
790
796
|
position: "relative"
|
|
791
|
-
}
|
|
792
|
-
},
|
|
793
|
-
gridOverlay,
|
|
794
|
-
(showLogo && logo || showSiteName && siteName) && /* @__PURE__ */ React2.createElement(
|
|
795
|
-
"div",
|
|
796
|
-
{
|
|
797
|
-
style: {
|
|
798
|
-
display: "flex",
|
|
799
|
-
alignItems: "center",
|
|
800
|
-
gap: "16px"
|
|
801
|
-
}
|
|
802
797
|
},
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
798
|
+
children: [
|
|
799
|
+
gridOverlay,
|
|
800
|
+
(showLogo && logo || showSiteName && siteName) && /* @__PURE__ */ jsxs(
|
|
801
|
+
"div",
|
|
802
|
+
{
|
|
803
|
+
style: {
|
|
804
|
+
display: "flex",
|
|
805
|
+
alignItems: "center",
|
|
806
|
+
gap: "16px"
|
|
807
|
+
},
|
|
808
|
+
children: [
|
|
809
|
+
showLogo && logo && // eslint-disable-next-line @next/next/no-img-element
|
|
810
|
+
/* @__PURE__ */ jsx(
|
|
811
|
+
"img",
|
|
812
|
+
{
|
|
813
|
+
src: logo,
|
|
814
|
+
alt: "Logo",
|
|
815
|
+
width: logoSize,
|
|
816
|
+
height: logoSize,
|
|
817
|
+
style: {
|
|
818
|
+
borderRadius: "8px"
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
),
|
|
822
|
+
showSiteName && siteName && /* @__PURE__ */ jsx(
|
|
823
|
+
"div",
|
|
824
|
+
{
|
|
825
|
+
style: {
|
|
826
|
+
fontSize: siteNameSize,
|
|
827
|
+
fontWeight: 600,
|
|
828
|
+
color: siteNameColor,
|
|
829
|
+
letterSpacing: "-0.02em"
|
|
830
|
+
},
|
|
831
|
+
children: siteName
|
|
832
|
+
}
|
|
833
|
+
)
|
|
834
|
+
]
|
|
813
835
|
}
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
836
|
+
),
|
|
837
|
+
/* @__PURE__ */ jsxs(
|
|
838
|
+
"div",
|
|
839
|
+
{
|
|
840
|
+
style: {
|
|
841
|
+
display: "flex",
|
|
842
|
+
flexDirection: "column",
|
|
843
|
+
gap: "24px",
|
|
844
|
+
flex: 1,
|
|
845
|
+
justifyContent: "center"
|
|
846
|
+
},
|
|
847
|
+
children: [
|
|
848
|
+
/* @__PURE__ */ jsx(
|
|
849
|
+
"div",
|
|
850
|
+
{
|
|
851
|
+
style: {
|
|
852
|
+
fontSize: calculatedTitleSize,
|
|
853
|
+
fontWeight: titleWeight,
|
|
854
|
+
color: titleColor,
|
|
855
|
+
lineHeight: 1.1,
|
|
856
|
+
letterSpacing: "-0.03em",
|
|
857
|
+
maxWidth: "100%",
|
|
858
|
+
wordWrap: "break-word"
|
|
859
|
+
},
|
|
860
|
+
children: title
|
|
861
|
+
}
|
|
862
|
+
),
|
|
863
|
+
description && /* @__PURE__ */ jsx(
|
|
864
|
+
"div",
|
|
865
|
+
{
|
|
866
|
+
style: {
|
|
867
|
+
fontSize: descriptionSize,
|
|
868
|
+
fontWeight: 400,
|
|
869
|
+
color: descriptionColor,
|
|
870
|
+
lineHeight: 1.5,
|
|
871
|
+
letterSpacing: "-0.01em",
|
|
872
|
+
maxWidth: "90%"
|
|
873
|
+
},
|
|
874
|
+
children: description
|
|
875
|
+
}
|
|
876
|
+
)
|
|
877
|
+
]
|
|
851
878
|
}
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
letterSpacing: "-0.01em",
|
|
864
|
-
maxWidth: "90%"
|
|
879
|
+
),
|
|
880
|
+
/* @__PURE__ */ jsx(
|
|
881
|
+
"div",
|
|
882
|
+
{
|
|
883
|
+
style: {
|
|
884
|
+
display: "flex",
|
|
885
|
+
width: "100%",
|
|
886
|
+
height: "4px",
|
|
887
|
+
background: backgroundType === "gradient" ? `linear-gradient(90deg, ${gradientStart} 0%, ${gradientEnd} 100%)` : gradientStart,
|
|
888
|
+
borderRadius: "2px"
|
|
889
|
+
}
|
|
865
890
|
}
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
),
|
|
870
|
-
/* @__PURE__ */ React2.createElement(
|
|
871
|
-
"div",
|
|
872
|
-
{
|
|
873
|
-
style: {
|
|
874
|
-
display: "flex",
|
|
875
|
-
width: "100%",
|
|
876
|
-
height: "4px",
|
|
877
|
-
background: backgroundType === "gradient" ? `linear-gradient(90deg, ${gradientStart} 0%, ${gradientEnd} 100%)` : gradientStart,
|
|
878
|
-
borderRadius: "2px"
|
|
879
|
-
}
|
|
880
|
-
}
|
|
881
|
-
)
|
|
891
|
+
)
|
|
892
|
+
]
|
|
893
|
+
}
|
|
882
894
|
);
|
|
883
895
|
}
|
|
884
896
|
|
|
885
897
|
// src/og-image/route.tsx
|
|
898
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
886
899
|
function createOgImageHandler(config) {
|
|
887
900
|
const {
|
|
888
901
|
template: Template = DefaultTemplate,
|
|
@@ -1016,7 +1029,7 @@ function createOgImageHandler(config) {
|
|
|
1016
1029
|
showSiteName: parseValue(decodedParams.showSiteName, "boolean") ?? defaultProps.showSiteName
|
|
1017
1030
|
};
|
|
1018
1031
|
return new ImageResponse(
|
|
1019
|
-
/* @__PURE__ */
|
|
1032
|
+
/* @__PURE__ */ jsx2(Template, { ...templateProps }),
|
|
1020
1033
|
{
|
|
1021
1034
|
width: size.width,
|
|
1022
1035
|
height: size.height,
|