@sesionario/blocks 1.26.1 → 1.27.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/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 +1 -1
package/dist/pdf.cjs
CHANGED
|
@@ -459,7 +459,8 @@ function PdfViewer({
|
|
|
459
459
|
workerSrc,
|
|
460
460
|
initialPage = 1,
|
|
461
461
|
className,
|
|
462
|
-
labels
|
|
462
|
+
labels,
|
|
463
|
+
closeAction
|
|
463
464
|
}) {
|
|
464
465
|
configurePdfWorker(workerSrc);
|
|
465
466
|
const [numPages, setNumPages] = react.useState(0);
|
|
@@ -647,125 +648,135 @@ function PdfViewer({
|
|
|
647
648
|
className
|
|
648
649
|
),
|
|
649
650
|
children: [
|
|
650
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 items-center gap-1 overflow-x-auto border-b px-2 py-2", children: [
|
|
651
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
652
|
-
"
|
|
653
|
-
{
|
|
654
|
-
type: "button",
|
|
655
|
-
className: "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md border bg-background text-foreground hover:bg-accent",
|
|
656
|
-
onClick: () => setThumbsOpen((v) => !v),
|
|
657
|
-
"aria-label": thumbsOpen ? labels.hideThumbnails ?? "Ocultar miniaturas" : labels.showThumbnails ?? "Mostrar miniaturas",
|
|
658
|
-
"aria-pressed": thumbsOpen,
|
|
659
|
-
children: thumbsOpen ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PanelLeftClose, { className: "h-4 w-4" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PanelLeft, { className: "h-4 w-4" })
|
|
660
|
-
}
|
|
661
|
-
),
|
|
662
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
663
|
-
"button",
|
|
664
|
-
{
|
|
665
|
-
type: "button",
|
|
666
|
-
className: "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md border bg-background hover:bg-accent disabled:opacity-50",
|
|
667
|
-
onClick: () => goToPage(pageNumber - 1),
|
|
668
|
-
disabled: pageNumber <= 1,
|
|
669
|
-
"aria-label": labels.previousPage ?? "P\xE1gina anterior",
|
|
670
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeft, { className: "h-4 w-4" })
|
|
671
|
-
}
|
|
672
|
-
),
|
|
673
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
674
|
-
"form",
|
|
675
|
-
{
|
|
676
|
-
onSubmit: submitPageJump,
|
|
677
|
-
className: "flex shrink-0 items-center gap-1 text-xs text-muted-foreground",
|
|
678
|
-
children: [
|
|
679
|
-
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "sr-only", htmlFor: "pdf-page-jump", children: labels.pageJumpAria ?? "Ir a p\xE1gina" }),
|
|
680
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
681
|
-
"input",
|
|
682
|
-
{
|
|
683
|
-
id: "pdf-page-jump",
|
|
684
|
-
value: pageDraft,
|
|
685
|
-
onChange: (e) => setPageDraft(e.target.value),
|
|
686
|
-
className: "h-8 w-12 rounded-md border bg-background px-1 text-center text-foreground",
|
|
687
|
-
inputMode: "numeric"
|
|
688
|
-
}
|
|
689
|
-
),
|
|
690
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-10 whitespace-nowrap", children: pageOf })
|
|
691
|
-
]
|
|
692
|
-
}
|
|
693
|
-
),
|
|
694
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
695
|
-
"button",
|
|
696
|
-
{
|
|
697
|
-
type: "button",
|
|
698
|
-
className: "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md border bg-background hover:bg-accent disabled:opacity-50",
|
|
699
|
-
onClick: () => goToPage(pageNumber + 1),
|
|
700
|
-
disabled: pageNumber >= numPages,
|
|
701
|
-
"aria-label": labels.nextPage ?? "P\xE1gina siguiente",
|
|
702
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-4 w-4" })
|
|
703
|
-
}
|
|
704
|
-
),
|
|
705
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
706
|
-
"button",
|
|
707
|
-
{
|
|
708
|
-
type: "button",
|
|
709
|
-
className: "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md border bg-background hover:bg-accent disabled:opacity-50",
|
|
710
|
-
onClick: zoomOut,
|
|
711
|
-
disabled: zoomIndex <= 0,
|
|
712
|
-
"aria-label": labels.zoomOut ?? "Alejar",
|
|
713
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ZoomOut, { className: "h-4 w-4" })
|
|
714
|
-
}
|
|
715
|
-
),
|
|
716
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
717
|
-
"button",
|
|
718
|
-
{
|
|
719
|
-
type: "button",
|
|
720
|
-
className: "inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-background px-2 text-xs hover:bg-accent",
|
|
721
|
-
onClick: fitMode === "width" ? fitPage : fitWidth,
|
|
722
|
-
children: fitMode === "width" ? labels.fitPage ?? "Ajustar p\xE1gina" : labels.fitWidth ?? "Ajustar ancho"
|
|
723
|
-
}
|
|
724
|
-
),
|
|
725
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
726
|
-
"button",
|
|
727
|
-
{
|
|
728
|
-
type: "button",
|
|
729
|
-
className: "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md border bg-background hover:bg-accent disabled:opacity-50",
|
|
730
|
-
onClick: zoomIn,
|
|
731
|
-
disabled: zoomIndex >= ZOOM_STEPS.length - 1,
|
|
732
|
-
"aria-label": labels.zoomIn ?? "Acercar",
|
|
733
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ZoomIn, { className: "h-4 w-4" })
|
|
734
|
-
}
|
|
735
|
-
),
|
|
736
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
737
|
-
"button",
|
|
738
|
-
{
|
|
739
|
-
type: "button",
|
|
740
|
-
className: "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md border bg-background hover:bg-accent",
|
|
741
|
-
onClick: () => setRotation((r) => (r + 90) % 360),
|
|
742
|
-
"aria-label": labels.rotate ?? "Rotar",
|
|
743
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.RotateCw, { className: "h-4 w-4" })
|
|
744
|
-
}
|
|
745
|
-
),
|
|
746
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
747
|
-
"button",
|
|
748
|
-
{
|
|
749
|
-
type: "button",
|
|
750
|
-
className: "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md border bg-background hover:bg-accent",
|
|
751
|
-
onClick: () => void toggleFullscreen(),
|
|
752
|
-
"aria-label": isFullscreen ? labels.exitFullscreen ?? "Salir de pantalla completa" : labels.enterFullscreen ?? "Pantalla completa",
|
|
753
|
-
children: isFullscreen ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Minimize2, { className: "h-4 w-4" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Maximize2, { className: "h-4 w-4" })
|
|
754
|
-
}
|
|
755
|
-
),
|
|
756
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
757
|
-
"a",
|
|
651
|
+
(closeAction || !loadError) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 items-center gap-1 overflow-x-auto border-b px-2 py-2", children: [
|
|
652
|
+
closeAction ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
653
|
+
"div",
|
|
758
654
|
{
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
className: "inline-flex h-8 shrink-0 items-center gap-1 rounded-md border bg-background px-2 text-xs hover:bg-accent",
|
|
763
|
-
children: [
|
|
764
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Download, { className: "h-4 w-4" }),
|
|
765
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "hidden sm:inline", children: labels.download ?? "Descargar" })
|
|
766
|
-
]
|
|
655
|
+
"data-slot": "pdf-close-action",
|
|
656
|
+
className: "mr-1 flex shrink-0 items-center",
|
|
657
|
+
children: closeAction
|
|
767
658
|
}
|
|
768
|
-
)
|
|
659
|
+
) : null,
|
|
660
|
+
!loadError && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
661
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
662
|
+
"button",
|
|
663
|
+
{
|
|
664
|
+
type: "button",
|
|
665
|
+
className: "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md border bg-background text-foreground hover:bg-accent",
|
|
666
|
+
onClick: () => setThumbsOpen((v) => !v),
|
|
667
|
+
"aria-label": thumbsOpen ? labels.hideThumbnails ?? "Ocultar miniaturas" : labels.showThumbnails ?? "Mostrar miniaturas",
|
|
668
|
+
"aria-pressed": thumbsOpen,
|
|
669
|
+
children: thumbsOpen ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PanelLeftClose, { className: "h-4 w-4" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PanelLeft, { className: "h-4 w-4" })
|
|
670
|
+
}
|
|
671
|
+
),
|
|
672
|
+
/* @__PURE__ */ jsxRuntime.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 <= 1,
|
|
679
|
+
"aria-label": labels.previousPage ?? "P\xE1gina anterior",
|
|
680
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeft, { className: "h-4 w-4" })
|
|
681
|
+
}
|
|
682
|
+
),
|
|
683
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
684
|
+
"form",
|
|
685
|
+
{
|
|
686
|
+
onSubmit: submitPageJump,
|
|
687
|
+
className: "flex shrink-0 items-center gap-1 text-xs text-muted-foreground",
|
|
688
|
+
children: [
|
|
689
|
+
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "sr-only", htmlFor: "pdf-page-jump", children: labels.pageJumpAria ?? "Ir a p\xE1gina" }),
|
|
690
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
691
|
+
"input",
|
|
692
|
+
{
|
|
693
|
+
id: "pdf-page-jump",
|
|
694
|
+
value: pageDraft,
|
|
695
|
+
onChange: (e) => setPageDraft(e.target.value),
|
|
696
|
+
className: "h-8 w-12 rounded-md border bg-background px-1 text-center text-foreground",
|
|
697
|
+
inputMode: "numeric"
|
|
698
|
+
}
|
|
699
|
+
),
|
|
700
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-10 whitespace-nowrap", children: pageOf })
|
|
701
|
+
]
|
|
702
|
+
}
|
|
703
|
+
),
|
|
704
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
705
|
+
"button",
|
|
706
|
+
{
|
|
707
|
+
type: "button",
|
|
708
|
+
className: "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md border bg-background hover:bg-accent disabled:opacity-50",
|
|
709
|
+
onClick: () => goToPage(pageNumber + 1),
|
|
710
|
+
disabled: pageNumber >= numPages,
|
|
711
|
+
"aria-label": labels.nextPage ?? "P\xE1gina siguiente",
|
|
712
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-4 w-4" })
|
|
713
|
+
}
|
|
714
|
+
),
|
|
715
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
716
|
+
"button",
|
|
717
|
+
{
|
|
718
|
+
type: "button",
|
|
719
|
+
className: "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md border bg-background hover:bg-accent disabled:opacity-50",
|
|
720
|
+
onClick: zoomOut,
|
|
721
|
+
disabled: zoomIndex <= 0,
|
|
722
|
+
"aria-label": labels.zoomOut ?? "Alejar",
|
|
723
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ZoomOut, { className: "h-4 w-4" })
|
|
724
|
+
}
|
|
725
|
+
),
|
|
726
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
727
|
+
"button",
|
|
728
|
+
{
|
|
729
|
+
type: "button",
|
|
730
|
+
className: "inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-background px-2 text-xs hover:bg-accent",
|
|
731
|
+
onClick: fitMode === "width" ? fitPage : fitWidth,
|
|
732
|
+
children: fitMode === "width" ? labels.fitPage ?? "Ajustar p\xE1gina" : labels.fitWidth ?? "Ajustar ancho"
|
|
733
|
+
}
|
|
734
|
+
),
|
|
735
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
736
|
+
"button",
|
|
737
|
+
{
|
|
738
|
+
type: "button",
|
|
739
|
+
className: "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md border bg-background hover:bg-accent disabled:opacity-50",
|
|
740
|
+
onClick: zoomIn,
|
|
741
|
+
disabled: zoomIndex >= ZOOM_STEPS.length - 1,
|
|
742
|
+
"aria-label": labels.zoomIn ?? "Acercar",
|
|
743
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ZoomIn, { className: "h-4 w-4" })
|
|
744
|
+
}
|
|
745
|
+
),
|
|
746
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
747
|
+
"button",
|
|
748
|
+
{
|
|
749
|
+
type: "button",
|
|
750
|
+
className: "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md border bg-background hover:bg-accent",
|
|
751
|
+
onClick: () => setRotation((r) => (r + 90) % 360),
|
|
752
|
+
"aria-label": labels.rotate ?? "Rotar",
|
|
753
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.RotateCw, { className: "h-4 w-4" })
|
|
754
|
+
}
|
|
755
|
+
),
|
|
756
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
757
|
+
"button",
|
|
758
|
+
{
|
|
759
|
+
type: "button",
|
|
760
|
+
className: "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md border bg-background hover:bg-accent",
|
|
761
|
+
onClick: () => void toggleFullscreen(),
|
|
762
|
+
"aria-label": isFullscreen ? labels.exitFullscreen ?? "Salir de pantalla completa" : labels.enterFullscreen ?? "Pantalla completa",
|
|
763
|
+
children: isFullscreen ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Minimize2, { className: "h-4 w-4" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Maximize2, { className: "h-4 w-4" })
|
|
764
|
+
}
|
|
765
|
+
),
|
|
766
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
767
|
+
"a",
|
|
768
|
+
{
|
|
769
|
+
href: downloadHref,
|
|
770
|
+
download: fileName,
|
|
771
|
+
"aria-label": labels.downloadAria ?? labels.download ?? "Descargar",
|
|
772
|
+
className: "inline-flex h-8 shrink-0 items-center gap-1 rounded-md border bg-background px-2 text-xs hover:bg-accent",
|
|
773
|
+
children: [
|
|
774
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Download, { className: "h-4 w-4" }),
|
|
775
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "hidden sm:inline", children: labels.download ?? "Descargar" })
|
|
776
|
+
]
|
|
777
|
+
}
|
|
778
|
+
)
|
|
779
|
+
] })
|
|
769
780
|
] }),
|
|
770
781
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex min-h-0 flex-1", children: [
|
|
771
782
|
numPages > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|