react-pdf-levelup 2.0.19 → 2.0.21

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/README.md CHANGED
@@ -1,54 +1,54 @@
1
- # React + TypeScript + Vite
2
-
3
- This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4
-
5
- Currently, two official plugins are available:
6
-
7
- - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
8
- - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9
-
10
- ## Expanding the ESLint configuration
11
-
12
- If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
13
-
14
- ```js
15
- export default tseslint.config({
16
- extends: [
17
- // Remove ...tseslint.configs.recommended and replace with this
18
- ...tseslint.configs.recommendedTypeChecked,
19
- // Alternatively, use this for stricter rules
20
- ...tseslint.configs.strictTypeChecked,
21
- // Optionally, add this for stylistic rules
22
- ...tseslint.configs.stylisticTypeChecked,
23
- ],
24
- languageOptions: {
25
- // other options...
26
- parserOptions: {
27
- project: ['./tsconfig.node.json', './tsconfig.app.json'],
28
- tsconfigRootDir: import.meta.dirname,
29
- },
30
- },
31
- })
32
- ```
33
-
34
- You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
35
-
36
- ```js
37
- // eslint.config.js
38
- import reactX from 'eslint-plugin-react-x'
39
- import reactDom from 'eslint-plugin-react-dom'
40
-
41
- export default tseslint.config({
42
- plugins: {
43
- // Add the react-x and react-dom plugins
44
- 'react-x': reactX,
45
- 'react-dom': reactDom,
46
- },
47
- rules: {
48
- // other rules...
49
- // Enable its recommended typescript rules
50
- ...reactX.configs['recommended-typescript'].rules,
51
- ...reactDom.configs.recommended.rules,
52
- },
53
- })
54
- ```
1
+ # React + TypeScript + Vite
2
+
3
+ This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4
+
5
+ Currently, two official plugins are available:
6
+
7
+ - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
8
+ - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9
+
10
+ ## Expanding the ESLint configuration
11
+
12
+ If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
13
+
14
+ ```js
15
+ export default tseslint.config({
16
+ extends: [
17
+ // Remove ...tseslint.configs.recommended and replace with this
18
+ ...tseslint.configs.recommendedTypeChecked,
19
+ // Alternatively, use this for stricter rules
20
+ ...tseslint.configs.strictTypeChecked,
21
+ // Optionally, add this for stylistic rules
22
+ ...tseslint.configs.stylisticTypeChecked,
23
+ ],
24
+ languageOptions: {
25
+ // other options...
26
+ parserOptions: {
27
+ project: ['./tsconfig.node.json', './tsconfig.app.json'],
28
+ tsconfigRootDir: import.meta.dirname,
29
+ },
30
+ },
31
+ })
32
+ ```
33
+
34
+ You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
35
+
36
+ ```js
37
+ // eslint.config.js
38
+ import reactX from 'eslint-plugin-react-x'
39
+ import reactDom from 'eslint-plugin-react-dom'
40
+
41
+ export default tseslint.config({
42
+ plugins: {
43
+ // Add the react-x and react-dom plugins
44
+ 'react-x': reactX,
45
+ 'react-dom': reactDom,
46
+ },
47
+ rules: {
48
+ // other rules...
49
+ // Enable its recommended typescript rules
50
+ ...reactX.configs['recommended-typescript'].rules,
51
+ ...reactDom.configs.recommended.rules,
52
+ },
53
+ })
54
+ ```
package/dist/index.d.mts CHANGED
@@ -57,15 +57,20 @@ interface TableProps {
57
57
  interface CellProps {
58
58
  children?: React$1.ReactNode;
59
59
  style?: any;
60
- cellSize?: "small" | "medium" | "large";
61
60
  width?: string | number;
62
61
  height?: string | number;
63
62
  colSpan?: number;
63
+ isLast?: boolean;
64
+ isLastRow?: boolean;
65
+ isOdd?: boolean;
64
66
  }
65
67
  declare const Table: React$1.FC<TableProps>;
66
68
  declare const Thead: React$1.FC<TableProps>;
67
69
  declare const Tbody: React$1.FC<TableProps>;
68
- declare const Tr: React$1.FC<TableProps>;
70
+ declare const Tr: React$1.FC<TableProps & {
71
+ isLastRow?: boolean;
72
+ isOdd?: boolean;
73
+ }>;
69
74
  declare const Th: React$1.FC<CellProps>;
70
75
  declare const Td: React$1.FC<CellProps>;
71
76
 
@@ -104,19 +109,33 @@ interface PageElementProps {
104
109
  declare const Header: React$1.FC<PageElementProps>;
105
110
  declare const Footer: React$1.FC<PageElementProps>;
106
111
 
107
- interface QRProps {
108
- value: string;
112
+ interface QRCustomProps {
113
+ url: string;
109
114
  size?: number;
110
- style?: any;
111
- colorDark?: string;
112
- colorLight?: string;
113
- margin?: number;
115
+ colorData?: string;
116
+ colorDataBG?: string;
114
117
  logo?: string;
115
118
  logoWidth?: number;
116
119
  logoHeight?: number;
120
+ margin?: number;
117
121
  errorCorrectionLevel?: "L" | "M" | "Q" | "H";
122
+ style?: any;
123
+ dotType?: "rounded" | "dots" | "classy" | "classy-rounded" | "square" | "extra-rounded";
124
+ cornerSquareType?: "square" | "dot" | "extra-rounded";
125
+ cornerDotType?: "square" | "dot";
126
+ cornerSquareColor?: string;
127
+ cornerDotColor?: string;
128
+ logoBG?: string;
129
+ logoText?: string;
130
+ moveText?: number;
131
+ textColor?: string;
132
+ fontSize?: number;
133
+ fontFamily?: string;
134
+ textBackgroundColor?: string;
135
+ textPadding?: number;
136
+ textBold?: boolean;
118
137
  }
119
- declare const QR: React$1.FC<QRProps>;
138
+ declare const QR: React$1.FC<QRCustomProps>;
120
139
 
121
140
  interface ListProps {
122
141
  children: React$1.ReactNode;
package/dist/index.d.ts CHANGED
@@ -57,15 +57,20 @@ interface TableProps {
57
57
  interface CellProps {
58
58
  children?: React$1.ReactNode;
59
59
  style?: any;
60
- cellSize?: "small" | "medium" | "large";
61
60
  width?: string | number;
62
61
  height?: string | number;
63
62
  colSpan?: number;
63
+ isLast?: boolean;
64
+ isLastRow?: boolean;
65
+ isOdd?: boolean;
64
66
  }
65
67
  declare const Table: React$1.FC<TableProps>;
66
68
  declare const Thead: React$1.FC<TableProps>;
67
69
  declare const Tbody: React$1.FC<TableProps>;
68
- declare const Tr: React$1.FC<TableProps>;
70
+ declare const Tr: React$1.FC<TableProps & {
71
+ isLastRow?: boolean;
72
+ isOdd?: boolean;
73
+ }>;
69
74
  declare const Th: React$1.FC<CellProps>;
70
75
  declare const Td: React$1.FC<CellProps>;
71
76
 
@@ -104,19 +109,33 @@ interface PageElementProps {
104
109
  declare const Header: React$1.FC<PageElementProps>;
105
110
  declare const Footer: React$1.FC<PageElementProps>;
106
111
 
107
- interface QRProps {
108
- value: string;
112
+ interface QRCustomProps {
113
+ url: string;
109
114
  size?: number;
110
- style?: any;
111
- colorDark?: string;
112
- colorLight?: string;
113
- margin?: number;
115
+ colorData?: string;
116
+ colorDataBG?: string;
114
117
  logo?: string;
115
118
  logoWidth?: number;
116
119
  logoHeight?: number;
120
+ margin?: number;
117
121
  errorCorrectionLevel?: "L" | "M" | "Q" | "H";
122
+ style?: any;
123
+ dotType?: "rounded" | "dots" | "classy" | "classy-rounded" | "square" | "extra-rounded";
124
+ cornerSquareType?: "square" | "dot" | "extra-rounded";
125
+ cornerDotType?: "square" | "dot";
126
+ cornerSquareColor?: string;
127
+ cornerDotColor?: string;
128
+ logoBG?: string;
129
+ logoText?: string;
130
+ moveText?: number;
131
+ textColor?: string;
132
+ fontSize?: number;
133
+ fontFamily?: string;
134
+ textBackgroundColor?: string;
135
+ textPadding?: number;
136
+ textBold?: boolean;
118
137
  }
119
- declare const QR: React$1.FC<QRProps>;
138
+ declare const QR: React$1.FC<QRCustomProps>;
120
139
 
121
140
  interface ListProps {
122
141
  children: React$1.ReactNode;
package/dist/index.js CHANGED
@@ -325,80 +325,100 @@ var styles5 = import_renderer5.StyleSheet.create({
325
325
  width: "100%",
326
326
  borderWidth: 1,
327
327
  borderColor: "#000",
328
- overflow: "hidden",
329
328
  marginBottom: 20
330
329
  },
331
330
  thead: {
332
- backgroundColor: "#f0f0f0"
331
+ backgroundColor: "#ccc"
333
332
  },
334
- tbody: {},
335
333
  tr: {
336
- flexDirection: "row",
337
- borderBottomWidth: 1,
338
- borderColor: "#000"
334
+ flexDirection: "row"
339
335
  },
340
- th: {
341
- paddingTop: 4,
336
+ textBold: {
342
337
  fontSize: 10,
343
338
  fontFamily: "Helvetica",
344
339
  fontWeight: "bold",
345
- borderRight: 1,
346
- borderColor: "#000",
347
- textAlign: "center"
340
+ textAlign: "center",
341
+ paddingTop: 4
348
342
  },
349
- td: {
350
- paddingTop: 4,
351
- paddingLeft: 8,
352
- paddingRight: 8,
343
+ text: {
353
344
  fontSize: 10,
354
345
  fontFamily: "Helvetica",
355
- borderRight: 1,
356
- borderColor: "#000"
357
- },
358
- cellSmall: {
359
- width: "25%"
360
- },
361
- cellMedium: {
362
- width: "33.33%"
346
+ paddingTop: 4,
347
+ paddingLeft: 8,
348
+ paddingRight: 8
363
349
  },
364
- cellLarge: {
365
- width: "50%"
350
+ zebraOdd: {
351
+ backgroundColor: "#eeeeee"
366
352
  }
367
353
  });
368
- var cellSizeMapping = {
369
- small: styles5.cellSmall,
370
- medium: styles5.cellMedium,
371
- large: styles5.cellLarge
372
- };
373
- var Table = ({ children, style }) => {
374
- return /* @__PURE__ */ import_react5.default.createElement(import_renderer5.View, { style: [styles5.table, style] }, children);
375
- };
376
- var Thead = ({ children, style }) => {
377
- return /* @__PURE__ */ import_react5.default.createElement(import_renderer5.View, { style: [styles5.thead, style] }, children);
378
- };
354
+ var Table = ({ children, style }) => /* @__PURE__ */ import_react5.default.createElement(import_renderer5.View, { style: [styles5.table, style] }, children);
355
+ var Thead = ({ children, style }) => /* @__PURE__ */ import_react5.default.createElement(import_renderer5.View, { style: [styles5.thead, style] }, children);
379
356
  var Tbody = ({ children, style }) => {
380
- return /* @__PURE__ */ import_react5.default.createElement(import_renderer5.View, { style: [styles5.tbody, style] }, children);
381
- };
382
- var Tr = ({ children, style }) => {
383
- return /* @__PURE__ */ import_react5.default.createElement(import_renderer5.View, { style: [styles5.tr, style] }, children);
384
- };
385
- var Th = ({ children, style, cellSize = "medium", width, height, colSpan }) => {
386
- const spanWidth = colSpan ? `${100 / 3 * colSpan}%` : void 0;
387
- const sizeStyle = cellSizeMapping[cellSize];
388
- const customStyle = {
389
- width: width || spanWidth || sizeStyle?.width,
357
+ const rows = import_react5.default.Children.toArray(children);
358
+ const count = rows.length;
359
+ return /* @__PURE__ */ import_react5.default.createElement(import_react5.default.Fragment, null, rows.map(
360
+ (row, idx) => import_react5.default.cloneElement(row, {
361
+ isLastRow: idx === count - 1,
362
+ isOdd: idx % 2 === 1
363
+ })
364
+ ));
365
+ };
366
+ var Tr = ({
367
+ children,
368
+ style,
369
+ isLastRow = false,
370
+ isOdd = false
371
+ }) => {
372
+ const elements = import_react5.default.Children.toArray(children);
373
+ const count = elements.length;
374
+ return /* @__PURE__ */ import_react5.default.createElement(import_renderer5.View, { style: [styles5.tr, style] }, elements.map((child, idx) => {
375
+ const isLast = idx === count - 1;
376
+ const width = `${(100 / count).toFixed(2)}%`;
377
+ return import_react5.default.cloneElement(child, { width, isLast, isLastRow, isOdd });
378
+ }));
379
+ };
380
+ var Th = ({
381
+ children,
382
+ style,
383
+ width,
384
+ height,
385
+ colSpan,
386
+ isLast = false,
387
+ isLastRow = false
388
+ }) => {
389
+ const baseWidth = typeof width === "string" && colSpan ? `${(parseFloat(width) * colSpan).toFixed(2)}%` : width;
390
+ const borders = {
391
+ borderRightWidth: isLast ? 0 : 1,
392
+ borderBottomWidth: isLastRow ? 0 : 1,
393
+ borderColor: "#000",
390
394
  ...height !== void 0 && { height }
391
395
  };
392
- return /* @__PURE__ */ import_react5.default.createElement(import_renderer5.View, { style: [styles5.th, customStyle, style] }, /* @__PURE__ */ import_react5.default.createElement(import_renderer5.Text, null, children));
396
+ return /* @__PURE__ */ import_react5.default.createElement(import_renderer5.View, { style: [styles5.textBold, { width: baseWidth }, borders, style] }, /* @__PURE__ */ import_react5.default.createElement(import_renderer5.Text, null, children));
393
397
  };
394
- var Td = ({ children, style, cellSize = "medium", width, height, colSpan }) => {
395
- const spanWidth = colSpan ? `${100 / 3 * colSpan}%` : void 0;
396
- const sizeStyle = cellSizeMapping[cellSize];
397
- const customStyle = {
398
- width: width || spanWidth || sizeStyle?.width,
398
+ var Td = ({
399
+ children,
400
+ style,
401
+ width,
402
+ height,
403
+ colSpan,
404
+ isLast = false,
405
+ isLastRow = false,
406
+ isOdd = false
407
+ }) => {
408
+ const baseWidth = typeof width === "string" && colSpan ? `${(parseFloat(width) * colSpan).toFixed(2)}%` : width;
409
+ const borders = {
410
+ borderRightWidth: isLast ? 0 : 1,
411
+ borderBottomWidth: isLastRow ? 0 : 1,
412
+ borderColor: "#000",
399
413
  ...height !== void 0 && { height }
400
414
  };
401
- return /* @__PURE__ */ import_react5.default.createElement(import_renderer5.View, { style: [styles5.td, customStyle, style] }, /* @__PURE__ */ import_react5.default.createElement(import_renderer5.Text, null, children));
415
+ return /* @__PURE__ */ import_react5.default.createElement(import_renderer5.View, { style: [
416
+ styles5.text,
417
+ isOdd && styles5.zebraOdd,
418
+ { width: baseWidth },
419
+ borders,
420
+ style
421
+ ] }, /* @__PURE__ */ import_react5.default.createElement(import_renderer5.Text, null, children));
402
422
  };
403
423
 
404
424
  // src/components/core/Grid.tsx
@@ -507,154 +527,174 @@ var Footer = ({ children, style, fixed = false }) => {
507
527
 
508
528
  // src/components/core/QR.tsx
509
529
  var import_react8 = __toESM(require("react"));
510
- var import_renderer8 = require("@react-pdf/renderer");
511
530
  var import_react9 = require("react");
512
-
513
- // src/components/core/QRGenerator.tsx
514
- var import_qrcode = __toESM(require("qrcode"));
515
- var generateQRAsBase64 = async ({
516
- value,
517
- size = 150,
518
- colorDark = "#000000",
519
- colorLight = "#ffffff",
520
- margin = 0,
521
- errorCorrectionLevel = "M"
522
- }) => {
523
- try {
524
- const options = {
525
- errorCorrectionLevel,
526
- type: "image/png",
527
- quality: 0.92,
528
- margin,
529
- color: {
530
- dark: colorDark,
531
- light: colorLight
532
- },
533
- width: size
534
- };
535
- const qrDataUrl = import_qrcode.default.toDataURL(value, options);
536
- return qrDataUrl;
537
- } catch (error) {
538
- console.error("Error generando QR:", error);
539
- return "";
540
- }
541
- };
542
- var addLogoToQR = async (qrDataUrl, logoUrl, logoWidth, logoHeight) => {
543
- return new Promise((resolve) => {
544
- if (!qrDataUrl || !logoUrl) {
545
- resolve(qrDataUrl);
546
- return;
547
- }
548
- try {
549
- const canvas = document.createElement("canvas");
550
- const ctx = canvas.getContext("2d");
551
- if (!ctx) {
552
- resolve(qrDataUrl);
553
- return;
554
- }
555
- const qrImage = new Image();
556
- qrImage.crossOrigin = "anonymous";
557
- qrImage.onload = () => {
558
- canvas.width = qrImage.width;
559
- canvas.height = qrImage.height;
560
- ctx.drawImage(qrImage, 0, 0, canvas.width, canvas.height);
561
- const logoImage = new Image();
562
- logoImage.crossOrigin = "anonymous";
563
- logoImage.onload = () => {
564
- const x = (canvas.width - logoWidth) / 2;
565
- const y = (canvas.height - logoHeight) / 2;
566
- ctx.fillStyle = "#FFFFFF";
567
- ctx.fillRect(x - 5, y - 5, logoWidth + 10, logoHeight + 10);
568
- ctx.drawImage(logoImage, x, y, logoWidth, logoHeight);
569
- const finalQrDataUrl = canvas.toDataURL("image/png");
570
- resolve(finalQrDataUrl);
571
- };
572
- logoImage.onerror = () => {
573
- console.error("Error cargando el logo");
574
- resolve(qrDataUrl);
575
- };
576
- logoImage.src = logoUrl;
577
- };
578
- qrImage.onerror = () => {
579
- console.error("Error cargando el QR");
580
- resolve("");
581
- };
582
- qrImage.src = qrDataUrl;
583
- } catch (error) {
584
- console.error("Error procesando el QR con logo:", error);
585
- resolve(qrDataUrl);
586
- }
587
- });
588
- };
589
-
590
- // src/components/core/QR.tsx
591
- var styles8 = import_renderer8.StyleSheet.create({
592
- qrContainer: {
593
- display: "flex",
594
- alignItems: "center",
595
- justifyContent: "center",
596
- margin: 10
597
- }
598
- });
599
- var errorLevelMap = {
600
- 0: "L",
601
- 1: "M",
602
- 2: "Q",
603
- 3: "H"
604
- };
531
+ var import_renderer8 = require("@react-pdf/renderer");
532
+ var import_qr_code_styling = __toESM(require("qr-code-styling"));
605
533
  var QR = ({
606
- value,
607
- size = 150,
608
- style,
609
- colorDark = "#000000",
610
- colorLight = "#ffffff",
611
- margin = 0,
612
- logo = "",
534
+ url,
535
+ size = 200,
536
+ colorData = "#000000",
537
+ colorDataBG = "#ffffff",
538
+ logo,
613
539
  logoWidth = 30,
614
- logoHeight = 30,
615
- errorCorrectionLevel = "M"
540
+ logoHeight,
541
+ margin = 0,
542
+ errorCorrectionLevel = "H",
543
+ style,
544
+ dotType = "square",
545
+ cornerSquareType = "square",
546
+ cornerDotType = "square",
547
+ cornerSquareColor,
548
+ cornerDotColor,
549
+ logoBG = colorDataBG,
550
+ logoText,
551
+ moveText = 0,
552
+ textColor = colorData,
553
+ fontSize = 12,
554
+ fontFamily = "Helvetica",
555
+ textBackgroundColor = colorDataBG,
556
+ textPadding = 1,
557
+ textBold = true
616
558
  }) => {
617
- const [qrDataUrl, setQrDataUrl] = (0, import_react9.useState)("");
559
+ const [qrDataURL, setQrDataURL] = (0, import_react9.useState)(null);
560
+ const actualLogoWidth = logoWidth || Math.floor(size * 0.2);
561
+ const actualLogoHeight = logoHeight || actualLogoWidth;
618
562
  (0, import_react9.useEffect)(() => {
619
- const generateQR = async () => {
563
+ if (typeof window === "undefined") return;
564
+ const generateQRCode = async () => {
620
565
  try {
621
- const baseQrDataUrl = await generateQRAsBase64({
622
- value,
623
- size,
624
- colorDark,
625
- colorLight,
626
- margin,
627
- errorCorrectionLevel: typeof errorCorrectionLevel === "number" ? errorLevelMap[errorCorrectionLevel] || "M" : errorCorrectionLevel
566
+ const qrCode = new import_qr_code_styling.default({
567
+ width: size,
568
+ height: size,
569
+ type: "canvas",
570
+ data: url,
571
+ dotsOptions: {
572
+ color: colorData,
573
+ type: dotType
574
+ },
575
+ cornersSquareOptions: {
576
+ color: cornerSquareColor || colorData,
577
+ type: cornerSquareType
578
+ },
579
+ cornersDotOptions: {
580
+ color: cornerDotColor || colorData,
581
+ type: cornerDotType
582
+ },
583
+ backgroundOptions: {
584
+ color: colorDataBG
585
+ },
586
+ qrOptions: {
587
+ errorCorrectionLevel
588
+ },
589
+ margin
628
590
  });
629
- if (logo && logoWidth && logoHeight) {
630
- const qrWithLogo = await addLogoToQR(baseQrDataUrl, logo, logoWidth, logoHeight);
631
- setQrDataUrl(qrWithLogo);
632
- } else {
633
- setQrDataUrl(baseQrDataUrl);
634
- }
591
+ const container = document.createElement("div");
592
+ container.style.position = "absolute";
593
+ container.style.top = "-9999px";
594
+ container.style.left = "-9999px";
595
+ document.body.appendChild(container);
596
+ qrCode.append(container);
597
+ setTimeout(() => {
598
+ try {
599
+ const qrCanvas = container.querySelector("canvas");
600
+ if (qrCanvas) {
601
+ const canvas = document.createElement("canvas");
602
+ canvas.width = size;
603
+ canvas.height = size;
604
+ const ctx = canvas.getContext("2d");
605
+ if (ctx) {
606
+ ctx.drawImage(qrCanvas, 0, 0);
607
+ const dataURL = canvas.toDataURL("image/png");
608
+ setQrDataURL(dataURL);
609
+ }
610
+ }
611
+ document.body.removeChild(container);
612
+ } catch (error) {
613
+ console.error("Error capturing QR code:", error);
614
+ }
615
+ }, 100);
635
616
  } catch (error) {
636
- console.error("Error generando QR:", error);
637
- const fallbackUrl2 = `https://api.qrserver.com/v1/create-qr-code/?data=${encodeURIComponent(
638
- value
639
- )}&size=${size}x${size}&color=${encodeURIComponent(colorDark.replace("#", ""))}&bgcolor=${encodeURIComponent(
640
- colorLight.replace("#", "")
641
- )}`;
642
- setQrDataUrl(fallbackUrl2);
617
+ console.error("Error generating QR code:", error);
643
618
  }
644
619
  };
645
- generateQR();
646
- }, [value, size, colorDark, colorLight, margin, logo, logoWidth, logoHeight, errorCorrectionLevel]);
647
- const fallbackUrl = `https://api.qrserver.com/v1/create-qr-code/?data=${encodeURIComponent(
648
- value
649
- )}&size=${size}x${size}`;
650
- return /* @__PURE__ */ import_react8.default.createElement(import_renderer8.View, { style: [styles8.qrContainer, style] }, /* @__PURE__ */ import_react8.default.createElement(import_renderer8.Image, { src: qrDataUrl || fallbackUrl, style: { width: size, height: size } }));
620
+ generateQRCode();
621
+ }, [
622
+ url,
623
+ size,
624
+ colorData,
625
+ colorDataBG,
626
+ margin,
627
+ errorCorrectionLevel,
628
+ dotType,
629
+ cornerSquareType,
630
+ cornerDotType,
631
+ cornerSquareColor,
632
+ cornerDotColor,
633
+ logoBG
634
+ ]);
635
+ if (!qrDataURL) return null;
636
+ const centerPosition = size / 2;
637
+ const logoContainerSize = Math.max(actualLogoWidth, actualLogoHeight) + 10;
638
+ return /* @__PURE__ */ import_react8.default.createElement(import_renderer8.View, { style: { width: size, height: size, position: "relative", ...style } }, /* @__PURE__ */ import_react8.default.createElement(import_renderer8.Image, { src: qrDataURL || "/placeholder.svg", style: { width: size, height: size } }), logo && /* @__PURE__ */ import_react8.default.createElement(
639
+ import_renderer8.View,
640
+ {
641
+ style: {
642
+ position: "absolute",
643
+ width: logoContainerSize,
644
+ height: logoContainerSize,
645
+ backgroundColor: logoBG || colorDataBG,
646
+ left: centerPosition - logoContainerSize / 2,
647
+ top: centerPosition - logoContainerSize / 2,
648
+ borderRadius: 100,
649
+ border: `5px solid ${colorData}`,
650
+ padding: 0
651
+ }
652
+ },
653
+ /* @__PURE__ */ import_react8.default.createElement(
654
+ import_renderer8.Image,
655
+ {
656
+ src: logo || "/placeholder.svg",
657
+ style: {
658
+ objectFit: "contain",
659
+ width: actualLogoWidth,
660
+ height: actualLogoHeight || actualLogoWidth
661
+ }
662
+ }
663
+ )
664
+ ), !logo && logoText && /* @__PURE__ */ import_react8.default.createElement(
665
+ import_renderer8.View,
666
+ {
667
+ style: {
668
+ position: "absolute",
669
+ backgroundColor: textBackgroundColor,
670
+ padding: textPadding,
671
+ borderRadius: 4,
672
+ left: moveText + centerPosition - 20,
673
+ // Approximate center
674
+ top: centerPosition - 10
675
+ // Approximate center
676
+ }
677
+ },
678
+ /* @__PURE__ */ import_react8.default.createElement(
679
+ import_renderer8.Text,
680
+ {
681
+ style: {
682
+ color: textColor,
683
+ fontSize,
684
+ fontFamily,
685
+ fontWeight: textBold ? "bold" : "normal"
686
+ }
687
+ },
688
+ logoText
689
+ )
690
+ ));
651
691
  };
652
692
  var QR_default = QR;
653
693
 
654
694
  // src/components/core/Lista.tsx
655
695
  var import_react10 = __toESM(require("react"));
656
696
  var import_renderer9 = require("@react-pdf/renderer");
657
- var styles9 = import_renderer9.StyleSheet.create({
697
+ var styles8 = import_renderer9.StyleSheet.create({
658
698
  ul: {
659
699
  marginBottom: 10,
660
700
  paddingLeft: 15
@@ -724,7 +764,7 @@ var UL = ({ children, style, type = "disc" }) => {
724
764
  }
725
765
  return child;
726
766
  });
727
- return /* @__PURE__ */ import_react10.default.createElement(import_renderer9.View, { style: [styles9.ul, style] }, childrenWithBullets);
767
+ return /* @__PURE__ */ import_react10.default.createElement(import_renderer9.View, { style: [styles8.ul, style] }, childrenWithBullets);
728
768
  };
729
769
  var OL = ({ children, style, type = "decimal", start = 1 }) => {
730
770
  const childrenWithNumbers = import_react10.default.Children.map(children, (child, index) => {
@@ -738,7 +778,7 @@ var OL = ({ children, style, type = "decimal", start = 1 }) => {
738
778
  }
739
779
  return child;
740
780
  });
741
- return /* @__PURE__ */ import_react10.default.createElement(import_renderer9.View, { style: [styles9.ol, style] }, childrenWithNumbers);
781
+ return /* @__PURE__ */ import_react10.default.createElement(import_renderer9.View, { style: [styles8.ol, style] }, childrenWithNumbers);
742
782
  };
743
783
  var LI = ({ children, style, bulletType = "disc", isOrdered = false, index = 1, start = 1, value }) => {
744
784
  let marker;
@@ -748,7 +788,7 @@ var LI = ({ children, style, bulletType = "disc", isOrdered = false, index = 1,
748
788
  } else {
749
789
  marker = getBulletPoint(bulletType);
750
790
  }
751
- return /* @__PURE__ */ import_react10.default.createElement(import_renderer9.View, { style: [styles9.li, style] }, /* @__PURE__ */ import_react10.default.createElement(import_renderer9.Text, { style: styles9.bulletPoint }, marker), /* @__PURE__ */ import_react10.default.createElement(import_renderer9.View, { style: styles9.itemContent }, typeof children === "string" ? /* @__PURE__ */ import_react10.default.createElement(import_renderer9.Text, null, children) : children));
791
+ return /* @__PURE__ */ import_react10.default.createElement(import_renderer9.View, { style: [styles8.li, style] }, /* @__PURE__ */ import_react10.default.createElement(import_renderer9.Text, { style: styles8.bulletPoint }, marker), /* @__PURE__ */ import_react10.default.createElement(import_renderer9.View, { style: styles8.itemContent }, typeof children === "string" ? /* @__PURE__ */ import_react10.default.createElement(import_renderer9.Text, null, children) : children));
752
792
  };
753
793
 
754
794
  // src/components/core/index.tsx
package/dist/index.mjs CHANGED
@@ -71,7 +71,7 @@ var LayoutPDF_default = LayoutPDF;
71
71
 
72
72
  // src/components/core/Img.tsx
73
73
  import React2 from "react";
74
- import { Image as Image2, StyleSheet as StyleSheet2 } from "@react-pdf/renderer";
74
+ import { Image, StyleSheet as StyleSheet2 } from "@react-pdf/renderer";
75
75
  var styles2 = StyleSheet2.create({
76
76
  image: {
77
77
  width: "100%",
@@ -80,7 +80,7 @@ var styles2 = StyleSheet2.create({
80
80
  }
81
81
  });
82
82
  var Img = ({ src, style }) => {
83
- return /* @__PURE__ */ React2.createElement(Image2, { src, style: [styles2.image, style] });
83
+ return /* @__PURE__ */ React2.createElement(Image, { src, style: [styles2.image, style] });
84
84
  };
85
85
  var Img_default = Img;
86
86
 
@@ -237,80 +237,100 @@ var styles5 = StyleSheet5.create({
237
237
  width: "100%",
238
238
  borderWidth: 1,
239
239
  borderColor: "#000",
240
- overflow: "hidden",
241
240
  marginBottom: 20
242
241
  },
243
242
  thead: {
244
- backgroundColor: "#f0f0f0"
243
+ backgroundColor: "#ccc"
245
244
  },
246
- tbody: {},
247
245
  tr: {
248
- flexDirection: "row",
249
- borderBottomWidth: 1,
250
- borderColor: "#000"
246
+ flexDirection: "row"
251
247
  },
252
- th: {
253
- paddingTop: 4,
248
+ textBold: {
254
249
  fontSize: 10,
255
250
  fontFamily: "Helvetica",
256
251
  fontWeight: "bold",
257
- borderRight: 1,
258
- borderColor: "#000",
259
- textAlign: "center"
252
+ textAlign: "center",
253
+ paddingTop: 4
260
254
  },
261
- td: {
262
- paddingTop: 4,
263
- paddingLeft: 8,
264
- paddingRight: 8,
255
+ text: {
265
256
  fontSize: 10,
266
257
  fontFamily: "Helvetica",
267
- borderRight: 1,
268
- borderColor: "#000"
269
- },
270
- cellSmall: {
271
- width: "25%"
272
- },
273
- cellMedium: {
274
- width: "33.33%"
258
+ paddingTop: 4,
259
+ paddingLeft: 8,
260
+ paddingRight: 8
275
261
  },
276
- cellLarge: {
277
- width: "50%"
262
+ zebraOdd: {
263
+ backgroundColor: "#eeeeee"
278
264
  }
279
265
  });
280
- var cellSizeMapping = {
281
- small: styles5.cellSmall,
282
- medium: styles5.cellMedium,
283
- large: styles5.cellLarge
284
- };
285
- var Table = ({ children, style }) => {
286
- return /* @__PURE__ */ React5.createElement(View2, { style: [styles5.table, style] }, children);
287
- };
288
- var Thead = ({ children, style }) => {
289
- return /* @__PURE__ */ React5.createElement(View2, { style: [styles5.thead, style] }, children);
290
- };
266
+ var Table = ({ children, style }) => /* @__PURE__ */ React5.createElement(View2, { style: [styles5.table, style] }, children);
267
+ var Thead = ({ children, style }) => /* @__PURE__ */ React5.createElement(View2, { style: [styles5.thead, style] }, children);
291
268
  var Tbody = ({ children, style }) => {
292
- return /* @__PURE__ */ React5.createElement(View2, { style: [styles5.tbody, style] }, children);
293
- };
294
- var Tr = ({ children, style }) => {
295
- return /* @__PURE__ */ React5.createElement(View2, { style: [styles5.tr, style] }, children);
296
- };
297
- var Th = ({ children, style, cellSize = "medium", width, height, colSpan }) => {
298
- const spanWidth = colSpan ? `${100 / 3 * colSpan}%` : void 0;
299
- const sizeStyle = cellSizeMapping[cellSize];
300
- const customStyle = {
301
- width: width || spanWidth || sizeStyle?.width,
269
+ const rows = React5.Children.toArray(children);
270
+ const count = rows.length;
271
+ return /* @__PURE__ */ React5.createElement(React5.Fragment, null, rows.map(
272
+ (row, idx) => React5.cloneElement(row, {
273
+ isLastRow: idx === count - 1,
274
+ isOdd: idx % 2 === 1
275
+ })
276
+ ));
277
+ };
278
+ var Tr = ({
279
+ children,
280
+ style,
281
+ isLastRow = false,
282
+ isOdd = false
283
+ }) => {
284
+ const elements = React5.Children.toArray(children);
285
+ const count = elements.length;
286
+ return /* @__PURE__ */ React5.createElement(View2, { style: [styles5.tr, style] }, elements.map((child, idx) => {
287
+ const isLast = idx === count - 1;
288
+ const width = `${(100 / count).toFixed(2)}%`;
289
+ return React5.cloneElement(child, { width, isLast, isLastRow, isOdd });
290
+ }));
291
+ };
292
+ var Th = ({
293
+ children,
294
+ style,
295
+ width,
296
+ height,
297
+ colSpan,
298
+ isLast = false,
299
+ isLastRow = false
300
+ }) => {
301
+ const baseWidth = typeof width === "string" && colSpan ? `${(parseFloat(width) * colSpan).toFixed(2)}%` : width;
302
+ const borders = {
303
+ borderRightWidth: isLast ? 0 : 1,
304
+ borderBottomWidth: isLastRow ? 0 : 1,
305
+ borderColor: "#000",
302
306
  ...height !== void 0 && { height }
303
307
  };
304
- return /* @__PURE__ */ React5.createElement(View2, { style: [styles5.th, customStyle, style] }, /* @__PURE__ */ React5.createElement(Text3, null, children));
308
+ return /* @__PURE__ */ React5.createElement(View2, { style: [styles5.textBold, { width: baseWidth }, borders, style] }, /* @__PURE__ */ React5.createElement(Text3, null, children));
305
309
  };
306
- var Td = ({ children, style, cellSize = "medium", width, height, colSpan }) => {
307
- const spanWidth = colSpan ? `${100 / 3 * colSpan}%` : void 0;
308
- const sizeStyle = cellSizeMapping[cellSize];
309
- const customStyle = {
310
- width: width || spanWidth || sizeStyle?.width,
310
+ var Td = ({
311
+ children,
312
+ style,
313
+ width,
314
+ height,
315
+ colSpan,
316
+ isLast = false,
317
+ isLastRow = false,
318
+ isOdd = false
319
+ }) => {
320
+ const baseWidth = typeof width === "string" && colSpan ? `${(parseFloat(width) * colSpan).toFixed(2)}%` : width;
321
+ const borders = {
322
+ borderRightWidth: isLast ? 0 : 1,
323
+ borderBottomWidth: isLastRow ? 0 : 1,
324
+ borderColor: "#000",
311
325
  ...height !== void 0 && { height }
312
326
  };
313
- return /* @__PURE__ */ React5.createElement(View2, { style: [styles5.td, customStyle, style] }, /* @__PURE__ */ React5.createElement(Text3, null, children));
327
+ return /* @__PURE__ */ React5.createElement(View2, { style: [
328
+ styles5.text,
329
+ isOdd && styles5.zebraOdd,
330
+ { width: baseWidth },
331
+ borders,
332
+ style
333
+ ] }, /* @__PURE__ */ React5.createElement(Text3, null, children));
314
334
  };
315
335
 
316
336
  // src/components/core/Grid.tsx
@@ -419,154 +439,174 @@ var Footer = ({ children, style, fixed = false }) => {
419
439
 
420
440
  // src/components/core/QR.tsx
421
441
  import React8 from "react";
422
- import { Image as Image3, StyleSheet as StyleSheet8, View as View5 } from "@react-pdf/renderer";
423
442
  import { useEffect, useState } from "react";
424
-
425
- // src/components/core/QRGenerator.tsx
426
- import QRCode from "qrcode";
427
- var generateQRAsBase64 = async ({
428
- value,
429
- size = 150,
430
- colorDark = "#000000",
431
- colorLight = "#ffffff",
432
- margin = 0,
433
- errorCorrectionLevel = "M"
434
- }) => {
435
- try {
436
- const options = {
437
- errorCorrectionLevel,
438
- type: "image/png",
439
- quality: 0.92,
440
- margin,
441
- color: {
442
- dark: colorDark,
443
- light: colorLight
444
- },
445
- width: size
446
- };
447
- const qrDataUrl = QRCode.toDataURL(value, options);
448
- return qrDataUrl;
449
- } catch (error) {
450
- console.error("Error generando QR:", error);
451
- return "";
452
- }
453
- };
454
- var addLogoToQR = async (qrDataUrl, logoUrl, logoWidth, logoHeight) => {
455
- return new Promise((resolve) => {
456
- if (!qrDataUrl || !logoUrl) {
457
- resolve(qrDataUrl);
458
- return;
459
- }
460
- try {
461
- const canvas = document.createElement("canvas");
462
- const ctx = canvas.getContext("2d");
463
- if (!ctx) {
464
- resolve(qrDataUrl);
465
- return;
466
- }
467
- const qrImage = new Image();
468
- qrImage.crossOrigin = "anonymous";
469
- qrImage.onload = () => {
470
- canvas.width = qrImage.width;
471
- canvas.height = qrImage.height;
472
- ctx.drawImage(qrImage, 0, 0, canvas.width, canvas.height);
473
- const logoImage = new Image();
474
- logoImage.crossOrigin = "anonymous";
475
- logoImage.onload = () => {
476
- const x = (canvas.width - logoWidth) / 2;
477
- const y = (canvas.height - logoHeight) / 2;
478
- ctx.fillStyle = "#FFFFFF";
479
- ctx.fillRect(x - 5, y - 5, logoWidth + 10, logoHeight + 10);
480
- ctx.drawImage(logoImage, x, y, logoWidth, logoHeight);
481
- const finalQrDataUrl = canvas.toDataURL("image/png");
482
- resolve(finalQrDataUrl);
483
- };
484
- logoImage.onerror = () => {
485
- console.error("Error cargando el logo");
486
- resolve(qrDataUrl);
487
- };
488
- logoImage.src = logoUrl;
489
- };
490
- qrImage.onerror = () => {
491
- console.error("Error cargando el QR");
492
- resolve("");
493
- };
494
- qrImage.src = qrDataUrl;
495
- } catch (error) {
496
- console.error("Error procesando el QR con logo:", error);
497
- resolve(qrDataUrl);
498
- }
499
- });
500
- };
501
-
502
- // src/components/core/QR.tsx
503
- var styles8 = StyleSheet8.create({
504
- qrContainer: {
505
- display: "flex",
506
- alignItems: "center",
507
- justifyContent: "center",
508
- margin: 10
509
- }
510
- });
511
- var errorLevelMap = {
512
- 0: "L",
513
- 1: "M",
514
- 2: "Q",
515
- 3: "H"
516
- };
443
+ import { Image as Image2, View as View5, Text as Text5 } from "@react-pdf/renderer";
444
+ import QRCodeStyling from "qr-code-styling";
517
445
  var QR = ({
518
- value,
519
- size = 150,
520
- style,
521
- colorDark = "#000000",
522
- colorLight = "#ffffff",
523
- margin = 0,
524
- logo = "",
446
+ url,
447
+ size = 200,
448
+ colorData = "#000000",
449
+ colorDataBG = "#ffffff",
450
+ logo,
525
451
  logoWidth = 30,
526
- logoHeight = 30,
527
- errorCorrectionLevel = "M"
452
+ logoHeight,
453
+ margin = 0,
454
+ errorCorrectionLevel = "H",
455
+ style,
456
+ dotType = "square",
457
+ cornerSquareType = "square",
458
+ cornerDotType = "square",
459
+ cornerSquareColor,
460
+ cornerDotColor,
461
+ logoBG = colorDataBG,
462
+ logoText,
463
+ moveText = 0,
464
+ textColor = colorData,
465
+ fontSize = 12,
466
+ fontFamily = "Helvetica",
467
+ textBackgroundColor = colorDataBG,
468
+ textPadding = 1,
469
+ textBold = true
528
470
  }) => {
529
- const [qrDataUrl, setQrDataUrl] = useState("");
471
+ const [qrDataURL, setQrDataURL] = useState(null);
472
+ const actualLogoWidth = logoWidth || Math.floor(size * 0.2);
473
+ const actualLogoHeight = logoHeight || actualLogoWidth;
530
474
  useEffect(() => {
531
- const generateQR = async () => {
475
+ if (typeof window === "undefined") return;
476
+ const generateQRCode = async () => {
532
477
  try {
533
- const baseQrDataUrl = await generateQRAsBase64({
534
- value,
535
- size,
536
- colorDark,
537
- colorLight,
538
- margin,
539
- errorCorrectionLevel: typeof errorCorrectionLevel === "number" ? errorLevelMap[errorCorrectionLevel] || "M" : errorCorrectionLevel
478
+ const qrCode = new QRCodeStyling({
479
+ width: size,
480
+ height: size,
481
+ type: "canvas",
482
+ data: url,
483
+ dotsOptions: {
484
+ color: colorData,
485
+ type: dotType
486
+ },
487
+ cornersSquareOptions: {
488
+ color: cornerSquareColor || colorData,
489
+ type: cornerSquareType
490
+ },
491
+ cornersDotOptions: {
492
+ color: cornerDotColor || colorData,
493
+ type: cornerDotType
494
+ },
495
+ backgroundOptions: {
496
+ color: colorDataBG
497
+ },
498
+ qrOptions: {
499
+ errorCorrectionLevel
500
+ },
501
+ margin
540
502
  });
541
- if (logo && logoWidth && logoHeight) {
542
- const qrWithLogo = await addLogoToQR(baseQrDataUrl, logo, logoWidth, logoHeight);
543
- setQrDataUrl(qrWithLogo);
544
- } else {
545
- setQrDataUrl(baseQrDataUrl);
546
- }
503
+ const container = document.createElement("div");
504
+ container.style.position = "absolute";
505
+ container.style.top = "-9999px";
506
+ container.style.left = "-9999px";
507
+ document.body.appendChild(container);
508
+ qrCode.append(container);
509
+ setTimeout(() => {
510
+ try {
511
+ const qrCanvas = container.querySelector("canvas");
512
+ if (qrCanvas) {
513
+ const canvas = document.createElement("canvas");
514
+ canvas.width = size;
515
+ canvas.height = size;
516
+ const ctx = canvas.getContext("2d");
517
+ if (ctx) {
518
+ ctx.drawImage(qrCanvas, 0, 0);
519
+ const dataURL = canvas.toDataURL("image/png");
520
+ setQrDataURL(dataURL);
521
+ }
522
+ }
523
+ document.body.removeChild(container);
524
+ } catch (error) {
525
+ console.error("Error capturing QR code:", error);
526
+ }
527
+ }, 100);
547
528
  } catch (error) {
548
- console.error("Error generando QR:", error);
549
- const fallbackUrl2 = `https://api.qrserver.com/v1/create-qr-code/?data=${encodeURIComponent(
550
- value
551
- )}&size=${size}x${size}&color=${encodeURIComponent(colorDark.replace("#", ""))}&bgcolor=${encodeURIComponent(
552
- colorLight.replace("#", "")
553
- )}`;
554
- setQrDataUrl(fallbackUrl2);
529
+ console.error("Error generating QR code:", error);
555
530
  }
556
531
  };
557
- generateQR();
558
- }, [value, size, colorDark, colorLight, margin, logo, logoWidth, logoHeight, errorCorrectionLevel]);
559
- const fallbackUrl = `https://api.qrserver.com/v1/create-qr-code/?data=${encodeURIComponent(
560
- value
561
- )}&size=${size}x${size}`;
562
- return /* @__PURE__ */ React8.createElement(View5, { style: [styles8.qrContainer, style] }, /* @__PURE__ */ React8.createElement(Image3, { src: qrDataUrl || fallbackUrl, style: { width: size, height: size } }));
532
+ generateQRCode();
533
+ }, [
534
+ url,
535
+ size,
536
+ colorData,
537
+ colorDataBG,
538
+ margin,
539
+ errorCorrectionLevel,
540
+ dotType,
541
+ cornerSquareType,
542
+ cornerDotType,
543
+ cornerSquareColor,
544
+ cornerDotColor,
545
+ logoBG
546
+ ]);
547
+ if (!qrDataURL) return null;
548
+ const centerPosition = size / 2;
549
+ const logoContainerSize = Math.max(actualLogoWidth, actualLogoHeight) + 10;
550
+ return /* @__PURE__ */ React8.createElement(View5, { style: { width: size, height: size, position: "relative", ...style } }, /* @__PURE__ */ React8.createElement(Image2, { src: qrDataURL || "/placeholder.svg", style: { width: size, height: size } }), logo && /* @__PURE__ */ React8.createElement(
551
+ View5,
552
+ {
553
+ style: {
554
+ position: "absolute",
555
+ width: logoContainerSize,
556
+ height: logoContainerSize,
557
+ backgroundColor: logoBG || colorDataBG,
558
+ left: centerPosition - logoContainerSize / 2,
559
+ top: centerPosition - logoContainerSize / 2,
560
+ borderRadius: 100,
561
+ border: `5px solid ${colorData}`,
562
+ padding: 0
563
+ }
564
+ },
565
+ /* @__PURE__ */ React8.createElement(
566
+ Image2,
567
+ {
568
+ src: logo || "/placeholder.svg",
569
+ style: {
570
+ objectFit: "contain",
571
+ width: actualLogoWidth,
572
+ height: actualLogoHeight || actualLogoWidth
573
+ }
574
+ }
575
+ )
576
+ ), !logo && logoText && /* @__PURE__ */ React8.createElement(
577
+ View5,
578
+ {
579
+ style: {
580
+ position: "absolute",
581
+ backgroundColor: textBackgroundColor,
582
+ padding: textPadding,
583
+ borderRadius: 4,
584
+ left: moveText + centerPosition - 20,
585
+ // Approximate center
586
+ top: centerPosition - 10
587
+ // Approximate center
588
+ }
589
+ },
590
+ /* @__PURE__ */ React8.createElement(
591
+ Text5,
592
+ {
593
+ style: {
594
+ color: textColor,
595
+ fontSize,
596
+ fontFamily,
597
+ fontWeight: textBold ? "bold" : "normal"
598
+ }
599
+ },
600
+ logoText
601
+ )
602
+ ));
563
603
  };
564
604
  var QR_default = QR;
565
605
 
566
606
  // src/components/core/Lista.tsx
567
607
  import React9 from "react";
568
- import { View as View6, Text as Text5, StyleSheet as StyleSheet9 } from "@react-pdf/renderer";
569
- var styles9 = StyleSheet9.create({
608
+ import { View as View6, Text as Text6, StyleSheet as StyleSheet8 } from "@react-pdf/renderer";
609
+ var styles8 = StyleSheet8.create({
570
610
  ul: {
571
611
  marginBottom: 10,
572
612
  paddingLeft: 15
@@ -636,7 +676,7 @@ var UL = ({ children, style, type = "disc" }) => {
636
676
  }
637
677
  return child;
638
678
  });
639
- return /* @__PURE__ */ React9.createElement(View6, { style: [styles9.ul, style] }, childrenWithBullets);
679
+ return /* @__PURE__ */ React9.createElement(View6, { style: [styles8.ul, style] }, childrenWithBullets);
640
680
  };
641
681
  var OL = ({ children, style, type = "decimal", start = 1 }) => {
642
682
  const childrenWithNumbers = React9.Children.map(children, (child, index) => {
@@ -650,7 +690,7 @@ var OL = ({ children, style, type = "decimal", start = 1 }) => {
650
690
  }
651
691
  return child;
652
692
  });
653
- return /* @__PURE__ */ React9.createElement(View6, { style: [styles9.ol, style] }, childrenWithNumbers);
693
+ return /* @__PURE__ */ React9.createElement(View6, { style: [styles8.ol, style] }, childrenWithNumbers);
654
694
  };
655
695
  var LI = ({ children, style, bulletType = "disc", isOrdered = false, index = 1, start = 1, value }) => {
656
696
  let marker;
@@ -660,11 +700,11 @@ var LI = ({ children, style, bulletType = "disc", isOrdered = false, index = 1,
660
700
  } else {
661
701
  marker = getBulletPoint(bulletType);
662
702
  }
663
- return /* @__PURE__ */ React9.createElement(View6, { style: [styles9.li, style] }, /* @__PURE__ */ React9.createElement(Text5, { style: styles9.bulletPoint }, marker), /* @__PURE__ */ React9.createElement(View6, { style: styles9.itemContent }, typeof children === "string" ? /* @__PURE__ */ React9.createElement(Text5, null, children) : children));
703
+ return /* @__PURE__ */ React9.createElement(View6, { style: [styles8.li, style] }, /* @__PURE__ */ React9.createElement(Text6, { style: styles8.bulletPoint }, marker), /* @__PURE__ */ React9.createElement(View6, { style: styles8.itemContent }, typeof children === "string" ? /* @__PURE__ */ React9.createElement(Text6, null, children) : children));
664
704
  };
665
705
 
666
706
  // src/components/core/index.tsx
667
- import { View as View7, Text as Text6, StyleSheet as StyleSheet10, Font } from "@react-pdf/renderer";
707
+ import { View as View7, Text as Text7, StyleSheet as StyleSheet9, Font } from "@react-pdf/renderer";
668
708
 
669
709
  // src/functions/decodeBase64Pdf.ts
670
710
  var decodeBase64Pdf = (base64, fileName) => {
@@ -756,11 +796,11 @@ export {
756
796
  Small,
757
797
  Span,
758
798
  Strong,
759
- StyleSheet10 as StyleSheet,
799
+ StyleSheet9 as StyleSheet,
760
800
  Table,
761
801
  Tbody,
762
802
  Td,
763
- Text6 as Text,
803
+ Text7 as Text,
764
804
  Th,
765
805
  Thead,
766
806
  Tr,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-pdf-levelup",
3
- "version": "2.0.19",
3
+ "version": "2.0.21",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -18,16 +18,18 @@
18
18
  "publicar": "npm run upVersion && npm run update-jsx && npm run build-lib && npm publish",
19
19
  "demo": "ts-node ./src/useExample/index.ts"
20
20
  },
21
+ "peerDependencies": {
22
+ "@react-pdf/renderer": "^4.3.0",
23
+ "react": "^18",
24
+ "react-dom": "^18",
25
+ "qr-code-styling": "^1.9.2"
26
+ },
21
27
  "dependencies": {
22
28
  "@babel/standalone": "^7.23.10",
23
29
  "@monaco-editor/react": "^4.7.0",
24
- "@react-pdf/renderer": "^4.3.0",
25
- "easyqrcodejs": "^4.6.2",
30
+ "i": "^0.3.7",
26
31
  "lucide-react": "^0.485.0",
27
- "qrcode": "^1.5.4",
28
- "react": "^18.2.0",
29
- "react-dom": "^18.2.0",
30
- "react-pdf-levelup": "^2.0.18",
32
+ "npm": "^11.3.0",
31
33
  "react-router-dom": "^7.4.1",
32
34
  "rimraf": "^6.0.1",
33
35
  "ts-node": "^10.9.2"
@@ -35,7 +37,6 @@
35
37
  "devDependencies": {
36
38
  "@eslint/js": "^9.21.0",
37
39
  "@react-pdf/types": "^2.9.0",
38
- "@types/qrcode": "^1.5.5",
39
40
  "@types/react": "^18.2.56",
40
41
  "@types/react-dom": "^18.2.19",
41
42
  "@vitejs/plugin-react": "^4.3.4",
@@ -44,6 +45,7 @@
44
45
  "eslint-plugin-react-refresh": "^0.4.19",
45
46
  "globals": "^15.15.0",
46
47
  "json": "^11.0.0",
48
+ "react-pdf-levelup": "^2.0.18",
47
49
  "tsup": "^8.4.0",
48
50
  "typescript": "~5.7.2",
49
51
  "typescript-eslint": "^8.24.1",