react-pdf-levelup 3.1.17 → 3.1.18
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.cjs +55 -7
- package/dist/index.d.cts +15 -1
- package/dist/index.d.ts +15 -1
- package/dist/index.js +52 -5
- package/package.json +16 -8
package/dist/index.cjs
CHANGED
|
@@ -48,7 +48,7 @@ __export(index_exports, {
|
|
|
48
48
|
Col9: () => Col9,
|
|
49
49
|
Container: () => Container,
|
|
50
50
|
Em: () => Em,
|
|
51
|
-
Font: () =>
|
|
51
|
+
Font: () => import_renderer11.Font,
|
|
52
52
|
H1: () => H1,
|
|
53
53
|
H2: () => H2,
|
|
54
54
|
H3: () => H3,
|
|
@@ -57,6 +57,7 @@ __export(index_exports, {
|
|
|
57
57
|
H6: () => H6,
|
|
58
58
|
Header: () => Header,
|
|
59
59
|
Img: () => Img_default,
|
|
60
|
+
ImgBg: () => ImgBg_default,
|
|
60
61
|
LI: () => LI,
|
|
61
62
|
LayoutPDF: () => LayoutPDF_default,
|
|
62
63
|
Left: () => Left,
|
|
@@ -69,17 +70,17 @@ __export(index_exports, {
|
|
|
69
70
|
Small: () => Small,
|
|
70
71
|
Span: () => Span,
|
|
71
72
|
Strong: () => Strong,
|
|
72
|
-
StyleSheet: () =>
|
|
73
|
+
StyleSheet: () => import_renderer11.StyleSheet,
|
|
73
74
|
Table: () => Table,
|
|
74
75
|
Tbody: () => Tbody,
|
|
75
76
|
Td: () => Td,
|
|
76
|
-
Text: () =>
|
|
77
|
+
Text: () => import_renderer11.Text,
|
|
77
78
|
Th: () => Th,
|
|
78
79
|
Thead: () => Thead,
|
|
79
80
|
Tr: () => Tr,
|
|
80
81
|
U: () => U,
|
|
81
82
|
UL: () => UL,
|
|
82
|
-
View: () =>
|
|
83
|
+
View: () => import_renderer11.View,
|
|
83
84
|
decodeBase64Pdf: () => decodeBase64Pdf_default,
|
|
84
85
|
generatePDF: () => generatePDF_default
|
|
85
86
|
});
|
|
@@ -110,6 +111,7 @@ var LayoutPDF = ({
|
|
|
110
111
|
padding = 30,
|
|
111
112
|
margen = "normal",
|
|
112
113
|
style = {},
|
|
114
|
+
pagination = true,
|
|
113
115
|
footer,
|
|
114
116
|
lines = footer ? 2 : 1
|
|
115
117
|
}) => {
|
|
@@ -250,7 +252,7 @@ var LayoutPDF = ({
|
|
|
250
252
|
fontSize: 10,
|
|
251
253
|
color: "grey"
|
|
252
254
|
};
|
|
253
|
-
return /* @__PURE__ */ import_react.default.createElement(import_renderer.Document, null, /* @__PURE__ */ import_react.default.createElement(import_renderer.Page, { size: safeSize, orientation: pdfOrientation, style: pageStyle, wrap: true }, /* @__PURE__ */ import_react.default.createElement(import_renderer.View, { style: { paddingBottom: footerHeight } }, children), /* @__PURE__ */ import_react.default.createElement(import_renderer.View, { style: footerStyle, fixed: true }, footer, /* @__PURE__ */ import_react.default.createElement(import_renderer.Text, { style: { fontSize: footerStyle.fontSize }, render: ({ pageNumber, totalPages }) => `${pageNumber} / ${totalPages}` }))));
|
|
255
|
+
return /* @__PURE__ */ import_react.default.createElement(import_renderer.Document, null, /* @__PURE__ */ import_react.default.createElement(import_renderer.Page, { size: safeSize, orientation: pdfOrientation, style: pageStyle, wrap: true }, /* @__PURE__ */ import_react.default.createElement(import_renderer.View, { style: { paddingBottom: footerHeight } }, children), pagination ? /* @__PURE__ */ import_react.default.createElement(import_renderer.View, { style: footerStyle, fixed: true }, footer, /* @__PURE__ */ import_react.default.createElement(import_renderer.Text, { style: { fontSize: footerStyle.fontSize }, render: ({ pageNumber, totalPages }) => `${pageNumber} / ${totalPages}` })) : null));
|
|
254
256
|
};
|
|
255
257
|
var LayoutPDF_default = LayoutPDF;
|
|
256
258
|
|
|
@@ -753,7 +755,7 @@ var QR = ({
|
|
|
753
755
|
logo = "",
|
|
754
756
|
logoWidth = 30,
|
|
755
757
|
logoHeight = 30,
|
|
756
|
-
errorCorrectionLevel = "M"
|
|
758
|
+
errorCorrectionLevel = logo ? "H" : "M"
|
|
757
759
|
}) => {
|
|
758
760
|
const [qrDataUrl, setQrDataUrl] = (0, import_react8.useState)("");
|
|
759
761
|
(0, import_react8.useEffect)(() => {
|
|
@@ -893,7 +895,7 @@ var LI = ({ children, style, bulletType = "disc", isOrdered = false, index = 1,
|
|
|
893
895
|
};
|
|
894
896
|
|
|
895
897
|
// src/components/core/index.tsx
|
|
896
|
-
var
|
|
898
|
+
var import_renderer11 = require("@react-pdf/renderer");
|
|
897
899
|
|
|
898
900
|
// src/functions/decodeBase64Pdf.ts
|
|
899
901
|
var decodeBase64Pdf = (base64, fileName) => {
|
|
@@ -944,6 +946,51 @@ var generatePDF = async ({ template: Template, data }) => {
|
|
|
944
946
|
}
|
|
945
947
|
};
|
|
946
948
|
var generatePDF_default = generatePDF;
|
|
949
|
+
|
|
950
|
+
// src/components/core/ImgBg.tsx
|
|
951
|
+
var import_react11 = __toESM(require("react"), 1);
|
|
952
|
+
var import_renderer10 = require("@react-pdf/renderer");
|
|
953
|
+
var styles9 = import_renderer10.StyleSheet.create({
|
|
954
|
+
container: {
|
|
955
|
+
position: "relative",
|
|
956
|
+
width: "100%",
|
|
957
|
+
height: "100%"
|
|
958
|
+
},
|
|
959
|
+
background: {
|
|
960
|
+
position: "absolute",
|
|
961
|
+
top: 0,
|
|
962
|
+
left: 0,
|
|
963
|
+
right: 0,
|
|
964
|
+
bottom: 0
|
|
965
|
+
},
|
|
966
|
+
content: {
|
|
967
|
+
position: "relative"
|
|
968
|
+
}
|
|
969
|
+
});
|
|
970
|
+
var ImgBg = ({
|
|
971
|
+
src,
|
|
972
|
+
width = "100%",
|
|
973
|
+
height = "100%",
|
|
974
|
+
opacity = 0.2,
|
|
975
|
+
children,
|
|
976
|
+
style,
|
|
977
|
+
fixed = false,
|
|
978
|
+
objectFit = "cover",
|
|
979
|
+
objectPosition = "center"
|
|
980
|
+
}) => {
|
|
981
|
+
return /* @__PURE__ */ import_react11.default.createElement(import_renderer10.View, { style: [styles9.container, style] }, /* @__PURE__ */ import_react11.default.createElement(
|
|
982
|
+
import_renderer10.Image,
|
|
983
|
+
{
|
|
984
|
+
src,
|
|
985
|
+
style: [
|
|
986
|
+
styles9.background,
|
|
987
|
+
{ width, height, opacity, objectFit, objectPosition }
|
|
988
|
+
],
|
|
989
|
+
fixed
|
|
990
|
+
}
|
|
991
|
+
), /* @__PURE__ */ import_react11.default.createElement(import_renderer10.View, { style: styles9.content }, children));
|
|
992
|
+
};
|
|
993
|
+
var ImgBg_default = ImgBg;
|
|
947
994
|
// Annotate the CommonJS export names for ESM import in node:
|
|
948
995
|
0 && (module.exports = {
|
|
949
996
|
A,
|
|
@@ -973,6 +1020,7 @@ var generatePDF_default = generatePDF;
|
|
|
973
1020
|
H6,
|
|
974
1021
|
Header,
|
|
975
1022
|
Img,
|
|
1023
|
+
ImgBg,
|
|
976
1024
|
LI,
|
|
977
1025
|
LayoutPDF,
|
|
978
1026
|
Left,
|
package/dist/index.d.cts
CHANGED
|
@@ -9,6 +9,7 @@ interface LayoutPDFProps {
|
|
|
9
9
|
padding?: number;
|
|
10
10
|
margen?: "apa" | "normal" | "estrecho" | "ancho";
|
|
11
11
|
style?: any;
|
|
12
|
+
pagination: true;
|
|
12
13
|
footer?: React$1.ReactNode;
|
|
13
14
|
lines?: number;
|
|
14
15
|
}
|
|
@@ -158,4 +159,17 @@ interface PDFData {
|
|
|
158
159
|
}
|
|
159
160
|
declare const generatePDF: ({ template: Template, data }: PDFData) => Promise<string>;
|
|
160
161
|
|
|
161
|
-
|
|
162
|
+
interface ImgBgProps {
|
|
163
|
+
src: string;
|
|
164
|
+
width?: number | string;
|
|
165
|
+
height?: number | string;
|
|
166
|
+
opacity?: number;
|
|
167
|
+
children?: React$1.ReactNode;
|
|
168
|
+
style?: any;
|
|
169
|
+
fixed?: boolean;
|
|
170
|
+
objectFit?: "cover" | "contain" | "fill" | "none" | "scale-down";
|
|
171
|
+
objectPosition?: string;
|
|
172
|
+
}
|
|
173
|
+
declare const ImgBg: React$1.FC<ImgBgProps>;
|
|
174
|
+
|
|
175
|
+
export { A, BR, Blockquote, Center, Col1, Col10, Col11, Col12, Col2, Col3, Col4, Col5, Col6, Col7, Col8, Col9, Container, Em, H1, H2, H3, H4, H5, H6, Header, Img, ImgBg, LI, LayoutPDF, Left, Mark, OL, P, QR, Right, Row, Small, Span, Strong, Table, Tbody, Td, Th, Thead, Tr, U, UL, decodeBase64Pdf, generatePDF };
|
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ interface LayoutPDFProps {
|
|
|
9
9
|
padding?: number;
|
|
10
10
|
margen?: "apa" | "normal" | "estrecho" | "ancho";
|
|
11
11
|
style?: any;
|
|
12
|
+
pagination: true;
|
|
12
13
|
footer?: React$1.ReactNode;
|
|
13
14
|
lines?: number;
|
|
14
15
|
}
|
|
@@ -158,4 +159,17 @@ interface PDFData {
|
|
|
158
159
|
}
|
|
159
160
|
declare const generatePDF: ({ template: Template, data }: PDFData) => Promise<string>;
|
|
160
161
|
|
|
161
|
-
|
|
162
|
+
interface ImgBgProps {
|
|
163
|
+
src: string;
|
|
164
|
+
width?: number | string;
|
|
165
|
+
height?: number | string;
|
|
166
|
+
opacity?: number;
|
|
167
|
+
children?: React$1.ReactNode;
|
|
168
|
+
style?: any;
|
|
169
|
+
fixed?: boolean;
|
|
170
|
+
objectFit?: "cover" | "contain" | "fill" | "none" | "scale-down";
|
|
171
|
+
objectPosition?: string;
|
|
172
|
+
}
|
|
173
|
+
declare const ImgBg: React$1.FC<ImgBgProps>;
|
|
174
|
+
|
|
175
|
+
export { A, BR, Blockquote, Center, Col1, Col10, Col11, Col12, Col2, Col3, Col4, Col5, Col6, Col7, Col8, Col9, Container, Em, H1, H2, H3, H4, H5, H6, Header, Img, ImgBg, LI, LayoutPDF, Left, Mark, OL, P, QR, Right, Row, Small, Span, Strong, Table, Tbody, Td, Th, Thead, Tr, U, UL, decodeBase64Pdf, generatePDF };
|
package/dist/index.js
CHANGED
|
@@ -23,6 +23,7 @@ var LayoutPDF = ({
|
|
|
23
23
|
padding = 30,
|
|
24
24
|
margen = "normal",
|
|
25
25
|
style = {},
|
|
26
|
+
pagination = true,
|
|
26
27
|
footer,
|
|
27
28
|
lines = footer ? 2 : 1
|
|
28
29
|
}) => {
|
|
@@ -163,7 +164,7 @@ var LayoutPDF = ({
|
|
|
163
164
|
fontSize: 10,
|
|
164
165
|
color: "grey"
|
|
165
166
|
};
|
|
166
|
-
return /* @__PURE__ */ React.createElement(Document, null, /* @__PURE__ */ React.createElement(Page, { size: safeSize, orientation: pdfOrientation, style: pageStyle, wrap: true }, /* @__PURE__ */ React.createElement(View, { style: { paddingBottom: footerHeight } }, children), /* @__PURE__ */ React.createElement(View, { style: footerStyle, fixed: true }, footer, /* @__PURE__ */ React.createElement(Text, { style: { fontSize: footerStyle.fontSize }, render: ({ pageNumber, totalPages }) => `${pageNumber} / ${totalPages}` }))));
|
|
167
|
+
return /* @__PURE__ */ React.createElement(Document, null, /* @__PURE__ */ React.createElement(Page, { size: safeSize, orientation: pdfOrientation, style: pageStyle, wrap: true }, /* @__PURE__ */ React.createElement(View, { style: { paddingBottom: footerHeight } }, children), pagination ? /* @__PURE__ */ React.createElement(View, { style: footerStyle, fixed: true }, footer, /* @__PURE__ */ React.createElement(Text, { style: { fontSize: footerStyle.fontSize }, render: ({ pageNumber, totalPages }) => `${pageNumber} / ${totalPages}` })) : null));
|
|
167
168
|
};
|
|
168
169
|
var LayoutPDF_default = LayoutPDF;
|
|
169
170
|
|
|
@@ -666,7 +667,7 @@ var QR = ({
|
|
|
666
667
|
logo = "",
|
|
667
668
|
logoWidth = 30,
|
|
668
669
|
logoHeight = 30,
|
|
669
|
-
errorCorrectionLevel = "M"
|
|
670
|
+
errorCorrectionLevel = logo ? "H" : "M"
|
|
670
671
|
}) => {
|
|
671
672
|
const [qrDataUrl, setQrDataUrl] = useState("");
|
|
672
673
|
useEffect(() => {
|
|
@@ -806,7 +807,7 @@ var LI = ({ children, style, bulletType = "disc", isOrdered = false, index = 1,
|
|
|
806
807
|
};
|
|
807
808
|
|
|
808
809
|
// src/components/core/index.tsx
|
|
809
|
-
import { View as
|
|
810
|
+
import { View as View9, Text as Text5, StyleSheet as StyleSheet10, Font } from "@react-pdf/renderer";
|
|
810
811
|
|
|
811
812
|
// src/functions/decodeBase64Pdf.ts
|
|
812
813
|
var decodeBase64Pdf = (base64, fileName) => {
|
|
@@ -857,6 +858,51 @@ var generatePDF = async ({ template: Template, data }) => {
|
|
|
857
858
|
}
|
|
858
859
|
};
|
|
859
860
|
var generatePDF_default = generatePDF;
|
|
861
|
+
|
|
862
|
+
// src/components/core/ImgBg.tsx
|
|
863
|
+
import React9 from "react";
|
|
864
|
+
import { Image as Image4, StyleSheet as StyleSheet9, View as View8 } from "@react-pdf/renderer";
|
|
865
|
+
var styles9 = StyleSheet9.create({
|
|
866
|
+
container: {
|
|
867
|
+
position: "relative",
|
|
868
|
+
width: "100%",
|
|
869
|
+
height: "100%"
|
|
870
|
+
},
|
|
871
|
+
background: {
|
|
872
|
+
position: "absolute",
|
|
873
|
+
top: 0,
|
|
874
|
+
left: 0,
|
|
875
|
+
right: 0,
|
|
876
|
+
bottom: 0
|
|
877
|
+
},
|
|
878
|
+
content: {
|
|
879
|
+
position: "relative"
|
|
880
|
+
}
|
|
881
|
+
});
|
|
882
|
+
var ImgBg = ({
|
|
883
|
+
src,
|
|
884
|
+
width = "100%",
|
|
885
|
+
height = "100%",
|
|
886
|
+
opacity = 0.2,
|
|
887
|
+
children,
|
|
888
|
+
style,
|
|
889
|
+
fixed = false,
|
|
890
|
+
objectFit = "cover",
|
|
891
|
+
objectPosition = "center"
|
|
892
|
+
}) => {
|
|
893
|
+
return /* @__PURE__ */ React9.createElement(View8, { style: [styles9.container, style] }, /* @__PURE__ */ React9.createElement(
|
|
894
|
+
Image4,
|
|
895
|
+
{
|
|
896
|
+
src,
|
|
897
|
+
style: [
|
|
898
|
+
styles9.background,
|
|
899
|
+
{ width, height, opacity, objectFit, objectPosition }
|
|
900
|
+
],
|
|
901
|
+
fixed
|
|
902
|
+
}
|
|
903
|
+
), /* @__PURE__ */ React9.createElement(View8, { style: styles9.content }, children));
|
|
904
|
+
};
|
|
905
|
+
var ImgBg_default = ImgBg;
|
|
860
906
|
export {
|
|
861
907
|
A,
|
|
862
908
|
BR,
|
|
@@ -885,6 +931,7 @@ export {
|
|
|
885
931
|
H6,
|
|
886
932
|
Header,
|
|
887
933
|
Img_default as Img,
|
|
934
|
+
ImgBg_default as ImgBg,
|
|
888
935
|
LI,
|
|
889
936
|
LayoutPDF_default as LayoutPDF,
|
|
890
937
|
Left,
|
|
@@ -897,7 +944,7 @@ export {
|
|
|
897
944
|
Small,
|
|
898
945
|
Span,
|
|
899
946
|
Strong,
|
|
900
|
-
|
|
947
|
+
StyleSheet10 as StyleSheet,
|
|
901
948
|
Table,
|
|
902
949
|
Tbody,
|
|
903
950
|
Td,
|
|
@@ -907,7 +954,7 @@ export {
|
|
|
907
954
|
Tr,
|
|
908
955
|
U,
|
|
909
956
|
UL,
|
|
910
|
-
|
|
957
|
+
View9 as View,
|
|
911
958
|
decodeBase64Pdf_default as decodeBase64Pdf,
|
|
912
959
|
generatePDF_default as generatePDF
|
|
913
960
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-pdf-levelup",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.18",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -20,24 +20,32 @@
|
|
|
20
20
|
"demo": "tsx ./src/useExample/index.ts"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
|
-
"@react-pdf/renderer": "^4.3.0",
|
|
24
|
-
"qrcode": "^1.5.4",
|
|
25
|
-
"react": "^19",
|
|
26
|
-
"react-dom": "^19"
|
|
27
|
-
},
|
|
28
|
-
"dependencies": {
|
|
29
23
|
"@babel/standalone": "^7.23.10",
|
|
30
24
|
"@monaco-editor/react": "^4.7.0",
|
|
25
|
+
"@radix-ui/react-dialog": "^1.1.15",
|
|
26
|
+
"@radix-ui/react-icons": "^1.3.2",
|
|
27
|
+
"@radix-ui/react-scroll-area": "^1.2.10",
|
|
28
|
+
"@radix-ui/react-tabs": "^1.1.13",
|
|
29
|
+
"@radix-ui/react-tooltip": "^1.2.8",
|
|
30
|
+
"autoprefixer": "^10.4.21",
|
|
31
31
|
"canvas": "^3.1.2",
|
|
32
|
+
"class-variance-authority": "^0.7.1",
|
|
32
33
|
"i": "^0.3.7",
|
|
33
34
|
"jsdom": "^26.1.0",
|
|
34
35
|
"lucide-react": "^0.485.0",
|
|
35
|
-
"npm": "^11.3.0",
|
|
36
36
|
"qr-code-styling": "^1.9.2",
|
|
37
37
|
"react-router-dom": "^7.4.1",
|
|
38
38
|
"rimraf": "^6.0.1",
|
|
39
|
+
"tailwind-merge": "^3.3.1",
|
|
40
|
+
"tailwindcss": "^4.1.12",
|
|
39
41
|
"ts-node": "^10.9.2"
|
|
40
42
|
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"@react-pdf/renderer": "^4.3.0",
|
|
45
|
+
"qrcode": "^1.5.4",
|
|
46
|
+
"react": "^18",
|
|
47
|
+
"react-dom": "^18"
|
|
48
|
+
},
|
|
41
49
|
"devDependencies": {
|
|
42
50
|
"@eslint/js": "^9.21.0",
|
|
43
51
|
"@react-pdf/types": "^2.9.0",
|