@sesionario/blocks 1.26.1 → 1.28.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/dist/charts.cjs +1904 -0
- package/dist/charts.cjs.map +1 -0
- package/dist/charts.d.cts +247 -0
- package/dist/charts.d.ts +247 -0
- package/dist/charts.js +1887 -0
- package/dist/charts.js.map +1 -0
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/pdf.cjs +129 -118
- package/dist/pdf.cjs.map +1 -1
- package/dist/pdf.d.cts +7 -1
- package/dist/pdf.d.ts +7 -1
- package/dist/pdf.js +129 -118
- package/dist/pdf.js.map +1 -1
- package/package.json +19 -1
package/dist/pdf.js
CHANGED
|
@@ -437,7 +437,8 @@ function PdfViewer({
|
|
|
437
437
|
workerSrc,
|
|
438
438
|
initialPage = 1,
|
|
439
439
|
className,
|
|
440
|
-
labels
|
|
440
|
+
labels,
|
|
441
|
+
closeAction
|
|
441
442
|
}) {
|
|
442
443
|
configurePdfWorker(workerSrc);
|
|
443
444
|
const [numPages, setNumPages] = useState(0);
|
|
@@ -625,125 +626,135 @@ function PdfViewer({
|
|
|
625
626
|
className
|
|
626
627
|
),
|
|
627
628
|
children: [
|
|
628
|
-
/* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-1 overflow-x-auto border-b px-2 py-2", children: [
|
|
629
|
-
/* @__PURE__ */ jsx(
|
|
630
|
-
"
|
|
631
|
-
{
|
|
632
|
-
type: "button",
|
|
633
|
-
className: "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md border bg-background text-foreground hover:bg-accent",
|
|
634
|
-
onClick: () => setThumbsOpen((v) => !v),
|
|
635
|
-
"aria-label": thumbsOpen ? labels.hideThumbnails ?? "Ocultar miniaturas" : labels.showThumbnails ?? "Mostrar miniaturas",
|
|
636
|
-
"aria-pressed": thumbsOpen,
|
|
637
|
-
children: thumbsOpen ? /* @__PURE__ */ jsx(PanelLeftClose, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(PanelLeft, { className: "h-4 w-4" })
|
|
638
|
-
}
|
|
639
|
-
),
|
|
640
|
-
/* @__PURE__ */ jsx(
|
|
641
|
-
"button",
|
|
642
|
-
{
|
|
643
|
-
type: "button",
|
|
644
|
-
className: "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md border bg-background hover:bg-accent disabled:opacity-50",
|
|
645
|
-
onClick: () => goToPage(pageNumber - 1),
|
|
646
|
-
disabled: pageNumber <= 1,
|
|
647
|
-
"aria-label": labels.previousPage ?? "P\xE1gina anterior",
|
|
648
|
-
children: /* @__PURE__ */ jsx(ChevronLeft, { className: "h-4 w-4" })
|
|
649
|
-
}
|
|
650
|
-
),
|
|
651
|
-
/* @__PURE__ */ jsxs(
|
|
652
|
-
"form",
|
|
653
|
-
{
|
|
654
|
-
onSubmit: submitPageJump,
|
|
655
|
-
className: "flex shrink-0 items-center gap-1 text-xs text-muted-foreground",
|
|
656
|
-
children: [
|
|
657
|
-
/* @__PURE__ */ jsx("label", { className: "sr-only", htmlFor: "pdf-page-jump", children: labels.pageJumpAria ?? "Ir a p\xE1gina" }),
|
|
658
|
-
/* @__PURE__ */ jsx(
|
|
659
|
-
"input",
|
|
660
|
-
{
|
|
661
|
-
id: "pdf-page-jump",
|
|
662
|
-
value: pageDraft,
|
|
663
|
-
onChange: (e) => setPageDraft(e.target.value),
|
|
664
|
-
className: "h-8 w-12 rounded-md border bg-background px-1 text-center text-foreground",
|
|
665
|
-
inputMode: "numeric"
|
|
666
|
-
}
|
|
667
|
-
),
|
|
668
|
-
/* @__PURE__ */ jsx("span", { className: "min-w-10 whitespace-nowrap", children: pageOf })
|
|
669
|
-
]
|
|
670
|
-
}
|
|
671
|
-
),
|
|
672
|
-
/* @__PURE__ */ jsx(
|
|
673
|
-
"button",
|
|
674
|
-
{
|
|
675
|
-
type: "button",
|
|
676
|
-
className: "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md border bg-background hover:bg-accent disabled:opacity-50",
|
|
677
|
-
onClick: () => goToPage(pageNumber + 1),
|
|
678
|
-
disabled: pageNumber >= numPages,
|
|
679
|
-
"aria-label": labels.nextPage ?? "P\xE1gina siguiente",
|
|
680
|
-
children: /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4" })
|
|
681
|
-
}
|
|
682
|
-
),
|
|
683
|
-
/* @__PURE__ */ jsx(
|
|
684
|
-
"button",
|
|
685
|
-
{
|
|
686
|
-
type: "button",
|
|
687
|
-
className: "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md border bg-background hover:bg-accent disabled:opacity-50",
|
|
688
|
-
onClick: zoomOut,
|
|
689
|
-
disabled: zoomIndex <= 0,
|
|
690
|
-
"aria-label": labels.zoomOut ?? "Alejar",
|
|
691
|
-
children: /* @__PURE__ */ jsx(ZoomOut, { className: "h-4 w-4" })
|
|
692
|
-
}
|
|
693
|
-
),
|
|
694
|
-
/* @__PURE__ */ jsx(
|
|
695
|
-
"button",
|
|
696
|
-
{
|
|
697
|
-
type: "button",
|
|
698
|
-
className: "inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-background px-2 text-xs hover:bg-accent",
|
|
699
|
-
onClick: fitMode === "width" ? fitPage : fitWidth,
|
|
700
|
-
children: fitMode === "width" ? labels.fitPage ?? "Ajustar p\xE1gina" : labels.fitWidth ?? "Ajustar ancho"
|
|
701
|
-
}
|
|
702
|
-
),
|
|
703
|
-
/* @__PURE__ */ jsx(
|
|
704
|
-
"button",
|
|
705
|
-
{
|
|
706
|
-
type: "button",
|
|
707
|
-
className: "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md border bg-background hover:bg-accent disabled:opacity-50",
|
|
708
|
-
onClick: zoomIn,
|
|
709
|
-
disabled: zoomIndex >= ZOOM_STEPS.length - 1,
|
|
710
|
-
"aria-label": labels.zoomIn ?? "Acercar",
|
|
711
|
-
children: /* @__PURE__ */ jsx(ZoomIn, { className: "h-4 w-4" })
|
|
712
|
-
}
|
|
713
|
-
),
|
|
714
|
-
/* @__PURE__ */ jsx(
|
|
715
|
-
"button",
|
|
716
|
-
{
|
|
717
|
-
type: "button",
|
|
718
|
-
className: "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md border bg-background hover:bg-accent",
|
|
719
|
-
onClick: () => setRotation((r) => (r + 90) % 360),
|
|
720
|
-
"aria-label": labels.rotate ?? "Rotar",
|
|
721
|
-
children: /* @__PURE__ */ jsx(RotateCw, { className: "h-4 w-4" })
|
|
722
|
-
}
|
|
723
|
-
),
|
|
724
|
-
/* @__PURE__ */ jsx(
|
|
725
|
-
"button",
|
|
726
|
-
{
|
|
727
|
-
type: "button",
|
|
728
|
-
className: "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md border bg-background hover:bg-accent",
|
|
729
|
-
onClick: () => void toggleFullscreen(),
|
|
730
|
-
"aria-label": isFullscreen ? labels.exitFullscreen ?? "Salir de pantalla completa" : labels.enterFullscreen ?? "Pantalla completa",
|
|
731
|
-
children: isFullscreen ? /* @__PURE__ */ jsx(Minimize2, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(Maximize2, { className: "h-4 w-4" })
|
|
732
|
-
}
|
|
733
|
-
),
|
|
734
|
-
/* @__PURE__ */ jsxs(
|
|
735
|
-
"a",
|
|
629
|
+
(closeAction || !loadError) && /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-1 overflow-x-auto border-b px-2 py-2", children: [
|
|
630
|
+
closeAction ? /* @__PURE__ */ jsx(
|
|
631
|
+
"div",
|
|
736
632
|
{
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
className: "inline-flex h-8 shrink-0 items-center gap-1 rounded-md border bg-background px-2 text-xs hover:bg-accent",
|
|
741
|
-
children: [
|
|
742
|
-
/* @__PURE__ */ jsx(Download, { className: "h-4 w-4" }),
|
|
743
|
-
/* @__PURE__ */ jsx("span", { className: "hidden sm:inline", children: labels.download ?? "Descargar" })
|
|
744
|
-
]
|
|
633
|
+
"data-slot": "pdf-close-action",
|
|
634
|
+
className: "mr-1 flex shrink-0 items-center",
|
|
635
|
+
children: closeAction
|
|
745
636
|
}
|
|
746
|
-
)
|
|
637
|
+
) : null,
|
|
638
|
+
!loadError && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
639
|
+
/* @__PURE__ */ jsx(
|
|
640
|
+
"button",
|
|
641
|
+
{
|
|
642
|
+
type: "button",
|
|
643
|
+
className: "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md border bg-background text-foreground hover:bg-accent",
|
|
644
|
+
onClick: () => setThumbsOpen((v) => !v),
|
|
645
|
+
"aria-label": thumbsOpen ? labels.hideThumbnails ?? "Ocultar miniaturas" : labels.showThumbnails ?? "Mostrar miniaturas",
|
|
646
|
+
"aria-pressed": thumbsOpen,
|
|
647
|
+
children: thumbsOpen ? /* @__PURE__ */ jsx(PanelLeftClose, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(PanelLeft, { className: "h-4 w-4" })
|
|
648
|
+
}
|
|
649
|
+
),
|
|
650
|
+
/* @__PURE__ */ jsx(
|
|
651
|
+
"button",
|
|
652
|
+
{
|
|
653
|
+
type: "button",
|
|
654
|
+
className: "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md border bg-background hover:bg-accent disabled:opacity-50",
|
|
655
|
+
onClick: () => goToPage(pageNumber - 1),
|
|
656
|
+
disabled: pageNumber <= 1,
|
|
657
|
+
"aria-label": labels.previousPage ?? "P\xE1gina anterior",
|
|
658
|
+
children: /* @__PURE__ */ jsx(ChevronLeft, { className: "h-4 w-4" })
|
|
659
|
+
}
|
|
660
|
+
),
|
|
661
|
+
/* @__PURE__ */ jsxs(
|
|
662
|
+
"form",
|
|
663
|
+
{
|
|
664
|
+
onSubmit: submitPageJump,
|
|
665
|
+
className: "flex shrink-0 items-center gap-1 text-xs text-muted-foreground",
|
|
666
|
+
children: [
|
|
667
|
+
/* @__PURE__ */ jsx("label", { className: "sr-only", htmlFor: "pdf-page-jump", children: labels.pageJumpAria ?? "Ir a p\xE1gina" }),
|
|
668
|
+
/* @__PURE__ */ jsx(
|
|
669
|
+
"input",
|
|
670
|
+
{
|
|
671
|
+
id: "pdf-page-jump",
|
|
672
|
+
value: pageDraft,
|
|
673
|
+
onChange: (e) => setPageDraft(e.target.value),
|
|
674
|
+
className: "h-8 w-12 rounded-md border bg-background px-1 text-center text-foreground",
|
|
675
|
+
inputMode: "numeric"
|
|
676
|
+
}
|
|
677
|
+
),
|
|
678
|
+
/* @__PURE__ */ jsx("span", { className: "min-w-10 whitespace-nowrap", children: pageOf })
|
|
679
|
+
]
|
|
680
|
+
}
|
|
681
|
+
),
|
|
682
|
+
/* @__PURE__ */ jsx(
|
|
683
|
+
"button",
|
|
684
|
+
{
|
|
685
|
+
type: "button",
|
|
686
|
+
className: "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md border bg-background hover:bg-accent disabled:opacity-50",
|
|
687
|
+
onClick: () => goToPage(pageNumber + 1),
|
|
688
|
+
disabled: pageNumber >= numPages,
|
|
689
|
+
"aria-label": labels.nextPage ?? "P\xE1gina siguiente",
|
|
690
|
+
children: /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4" })
|
|
691
|
+
}
|
|
692
|
+
),
|
|
693
|
+
/* @__PURE__ */ jsx(
|
|
694
|
+
"button",
|
|
695
|
+
{
|
|
696
|
+
type: "button",
|
|
697
|
+
className: "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md border bg-background hover:bg-accent disabled:opacity-50",
|
|
698
|
+
onClick: zoomOut,
|
|
699
|
+
disabled: zoomIndex <= 0,
|
|
700
|
+
"aria-label": labels.zoomOut ?? "Alejar",
|
|
701
|
+
children: /* @__PURE__ */ jsx(ZoomOut, { className: "h-4 w-4" })
|
|
702
|
+
}
|
|
703
|
+
),
|
|
704
|
+
/* @__PURE__ */ jsx(
|
|
705
|
+
"button",
|
|
706
|
+
{
|
|
707
|
+
type: "button",
|
|
708
|
+
className: "inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-background px-2 text-xs hover:bg-accent",
|
|
709
|
+
onClick: fitMode === "width" ? fitPage : fitWidth,
|
|
710
|
+
children: fitMode === "width" ? labels.fitPage ?? "Ajustar p\xE1gina" : labels.fitWidth ?? "Ajustar ancho"
|
|
711
|
+
}
|
|
712
|
+
),
|
|
713
|
+
/* @__PURE__ */ jsx(
|
|
714
|
+
"button",
|
|
715
|
+
{
|
|
716
|
+
type: "button",
|
|
717
|
+
className: "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md border bg-background hover:bg-accent disabled:opacity-50",
|
|
718
|
+
onClick: zoomIn,
|
|
719
|
+
disabled: zoomIndex >= ZOOM_STEPS.length - 1,
|
|
720
|
+
"aria-label": labels.zoomIn ?? "Acercar",
|
|
721
|
+
children: /* @__PURE__ */ jsx(ZoomIn, { className: "h-4 w-4" })
|
|
722
|
+
}
|
|
723
|
+
),
|
|
724
|
+
/* @__PURE__ */ jsx(
|
|
725
|
+
"button",
|
|
726
|
+
{
|
|
727
|
+
type: "button",
|
|
728
|
+
className: "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md border bg-background hover:bg-accent",
|
|
729
|
+
onClick: () => setRotation((r) => (r + 90) % 360),
|
|
730
|
+
"aria-label": labels.rotate ?? "Rotar",
|
|
731
|
+
children: /* @__PURE__ */ jsx(RotateCw, { className: "h-4 w-4" })
|
|
732
|
+
}
|
|
733
|
+
),
|
|
734
|
+
/* @__PURE__ */ jsx(
|
|
735
|
+
"button",
|
|
736
|
+
{
|
|
737
|
+
type: "button",
|
|
738
|
+
className: "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md border bg-background hover:bg-accent",
|
|
739
|
+
onClick: () => void toggleFullscreen(),
|
|
740
|
+
"aria-label": isFullscreen ? labels.exitFullscreen ?? "Salir de pantalla completa" : labels.enterFullscreen ?? "Pantalla completa",
|
|
741
|
+
children: isFullscreen ? /* @__PURE__ */ jsx(Minimize2, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(Maximize2, { className: "h-4 w-4" })
|
|
742
|
+
}
|
|
743
|
+
),
|
|
744
|
+
/* @__PURE__ */ jsxs(
|
|
745
|
+
"a",
|
|
746
|
+
{
|
|
747
|
+
href: downloadHref,
|
|
748
|
+
download: fileName,
|
|
749
|
+
"aria-label": labels.downloadAria ?? labels.download ?? "Descargar",
|
|
750
|
+
className: "inline-flex h-8 shrink-0 items-center gap-1 rounded-md border bg-background px-2 text-xs hover:bg-accent",
|
|
751
|
+
children: [
|
|
752
|
+
/* @__PURE__ */ jsx(Download, { className: "h-4 w-4" }),
|
|
753
|
+
/* @__PURE__ */ jsx("span", { className: "hidden sm:inline", children: labels.download ?? "Descargar" })
|
|
754
|
+
]
|
|
755
|
+
}
|
|
756
|
+
)
|
|
757
|
+
] })
|
|
747
758
|
] }),
|
|
748
759
|
/* @__PURE__ */ jsxs("div", { className: "relative flex min-h-0 flex-1", children: [
|
|
749
760
|
numPages > 0 && /* @__PURE__ */ jsx(
|