@zerohive/hive-viewer 0.2.6 → 0.2.7
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 +20 -39
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +20 -39
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +20 -39
- package/dist/styles.css +135 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -840,49 +840,46 @@ function Toolbar(props) {
|
|
|
840
840
|
role: "toolbar",
|
|
841
841
|
"aria-label": t("a11y.toolbar", "Document toolbar"),
|
|
842
842
|
children: [
|
|
843
|
-
/* @__PURE__ */ jsxs8("div", { className: "hv-
|
|
843
|
+
/* @__PURE__ */ jsxs8("div", { className: "hv-toolbar__group", children: [
|
|
844
844
|
/* @__PURE__ */ jsx8(
|
|
845
845
|
"button",
|
|
846
846
|
{
|
|
847
|
-
|
|
848
|
-
className: "hv-btn text-sm",
|
|
847
|
+
className: `hv-btn ${props.showThumbnails ? "hv-btn--active" : ""}`,
|
|
849
848
|
onClick: props.onToggleThumbnails,
|
|
850
849
|
"aria-pressed": props.showThumbnails,
|
|
851
|
-
children:
|
|
850
|
+
children: "Thumbnails"
|
|
852
851
|
}
|
|
853
852
|
),
|
|
854
853
|
props.mode !== "create" && /* @__PURE__ */ jsx8(
|
|
855
854
|
"button",
|
|
856
855
|
{
|
|
857
|
-
|
|
858
|
-
className: "hv-btn text-sm",
|
|
856
|
+
className: `hv-btn ${props.showSignatures ? "hv-btn--active" : ""}`,
|
|
859
857
|
onClick: props.onToggleSignatures,
|
|
860
858
|
"aria-pressed": props.showSignatures,
|
|
861
|
-
children:
|
|
859
|
+
children: "Signatures"
|
|
862
860
|
}
|
|
863
|
-
)
|
|
864
|
-
|
|
861
|
+
)
|
|
862
|
+
] }),
|
|
863
|
+
/* @__PURE__ */ jsxs8("div", { className: "hv-toolbar__group hv-segment", children: [
|
|
865
864
|
/* @__PURE__ */ jsx8(
|
|
866
865
|
"button",
|
|
867
866
|
{
|
|
868
|
-
|
|
869
|
-
className: props.layout === "single" ? "hv-btn hv-btn--active text-sm" : "hv-btn text-sm",
|
|
867
|
+
className: `hv-btn ${props.layout === "single" ? "hv-btn--active" : ""}`,
|
|
870
868
|
onClick: () => props.onChangeLayout("single"),
|
|
871
|
-
children:
|
|
869
|
+
children: "Single page"
|
|
872
870
|
}
|
|
873
871
|
),
|
|
874
872
|
/* @__PURE__ */ jsx8(
|
|
875
873
|
"button",
|
|
876
874
|
{
|
|
877
|
-
|
|
878
|
-
className: props.layout === "side-by-side" ? "hv-btn hv-btn--active text-sm" : "hv-btn text-sm",
|
|
875
|
+
className: `hv-btn ${props.layout === "side-by-side" ? "hv-btn--active" : ""}`,
|
|
879
876
|
onClick: () => props.onChangeLayout("side-by-side"),
|
|
880
|
-
children:
|
|
877
|
+
children: "Side-by-side"
|
|
881
878
|
}
|
|
882
879
|
)
|
|
883
880
|
] }),
|
|
884
|
-
/* @__PURE__ */ jsxs8("div", { className: "hv-
|
|
885
|
-
props.showHeaderFooterToggle && /* @__PURE__ */ jsxs8("label", { className: "hv-
|
|
881
|
+
/* @__PURE__ */ jsxs8("div", { className: "hv-toolbar__group hv-toolbar__actions", children: [
|
|
882
|
+
props.showHeaderFooterToggle && /* @__PURE__ */ jsxs8("label", { className: "hv-switch", children: [
|
|
886
883
|
/* @__PURE__ */ jsx8(
|
|
887
884
|
"input",
|
|
888
885
|
{
|
|
@@ -891,36 +888,20 @@ function Toolbar(props) {
|
|
|
891
888
|
onChange: props.onToggleHeaderFooter
|
|
892
889
|
}
|
|
893
890
|
),
|
|
894
|
-
/* @__PURE__ */ jsx8("span", {
|
|
891
|
+
/* @__PURE__ */ jsx8("span", { className: "hv-switch__slider" }),
|
|
892
|
+
/* @__PURE__ */ jsx8("span", { className: "hv-switch__label", children: t("toolbar.letterhead", "Letterhead") })
|
|
895
893
|
] }),
|
|
896
894
|
props.allowSigning && /* @__PURE__ */ jsx8(
|
|
897
895
|
"button",
|
|
898
896
|
{
|
|
899
|
-
|
|
900
|
-
className: "hv-btn hv-btn--primary text-sm",
|
|
897
|
+
className: "hv-btn hv-btn--primary",
|
|
901
898
|
onClick: props.onSign,
|
|
902
899
|
disabled: props.signingDisabled,
|
|
903
|
-
children:
|
|
904
|
-
}
|
|
905
|
-
),
|
|
906
|
-
props.canExportPdf && /* @__PURE__ */ jsx8(
|
|
907
|
-
"button",
|
|
908
|
-
{
|
|
909
|
-
type: "button",
|
|
910
|
-
className: "hv-btn text-sm",
|
|
911
|
-
onClick: props.onExportPdf,
|
|
912
|
-
children: t("toolbar.exportPdf", "Export as PDF")
|
|
900
|
+
children: "Sign document"
|
|
913
901
|
}
|
|
914
902
|
),
|
|
915
|
-
props.
|
|
916
|
-
|
|
917
|
-
{
|
|
918
|
-
type: "button",
|
|
919
|
-
className: "hv-btn hv-btn--primary text-sm",
|
|
920
|
-
onClick: props.onSave,
|
|
921
|
-
children: t("toolbar.save", "Save")
|
|
922
|
-
}
|
|
923
|
-
)
|
|
903
|
+
props.canExportPdf && /* @__PURE__ */ jsx8("button", { className: "hv-btn", onClick: props.onExportPdf, children: "Export PDF" }),
|
|
904
|
+
props.canSave && /* @__PURE__ */ jsx8("button", { className: "hv-btn hv-btn--primary", onClick: props.onSave, children: "Save" })
|
|
924
905
|
] })
|
|
925
906
|
]
|
|
926
907
|
}
|
package/dist/styles.css
CHANGED
|
@@ -492,7 +492,8 @@
|
|
|
492
492
|
display: flex;
|
|
493
493
|
gap: 8px;
|
|
494
494
|
padding: 8px 12px;
|
|
495
|
-
|
|
495
|
+
justify-content: space-around;
|
|
496
|
+
align-items: start;
|
|
496
497
|
border-bottom: 1px solid #e5e7eb;
|
|
497
498
|
}
|
|
498
499
|
|
|
@@ -540,4 +541,137 @@
|
|
|
540
541
|
|
|
541
542
|
.hv-editor.ro {
|
|
542
543
|
cursor: default;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
/* === Toolbar container === */
|
|
547
|
+
.hv-toolbar {
|
|
548
|
+
position: sticky;
|
|
549
|
+
top: 0;
|
|
550
|
+
z-index: 40;
|
|
551
|
+
|
|
552
|
+
display: flex;
|
|
553
|
+
align-items: center;
|
|
554
|
+
justify-content: space-between;
|
|
555
|
+
gap: 12px;
|
|
556
|
+
|
|
557
|
+
padding: 10px 14px;
|
|
558
|
+
background: #ffffff;
|
|
559
|
+
border-bottom: 1px solid #e5e7eb;
|
|
560
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
/* === Groups === */
|
|
564
|
+
.hv-toolbar__group {
|
|
565
|
+
display: flex;
|
|
566
|
+
align-items: center;
|
|
567
|
+
gap: 6px;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
.hv-toolbar__actions {
|
|
571
|
+
gap: 8px;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
/* === Buttons === */
|
|
575
|
+
.hv-btn {
|
|
576
|
+
appearance: none;
|
|
577
|
+
border: 1px solid #d1d5db;
|
|
578
|
+
background: #fff;
|
|
579
|
+
color: #111827;
|
|
580
|
+
|
|
581
|
+
font-size: 13px;
|
|
582
|
+
font-weight: 500;
|
|
583
|
+
padding: 6px 12px;
|
|
584
|
+
border-radius: 8px;
|
|
585
|
+
|
|
586
|
+
cursor: pointer;
|
|
587
|
+
transition: all 0.15s ease;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
.hv-btn:hover {
|
|
591
|
+
background: #f9fafb;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
.hv-btn:disabled {
|
|
595
|
+
opacity: 0.5;
|
|
596
|
+
cursor: not-allowed;
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
.hv-btn--active {
|
|
600
|
+
background: #eef2ff;
|
|
601
|
+
border-color: #6366f1;
|
|
602
|
+
color: #4338ca;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
.hv-btn--primary {
|
|
606
|
+
background: #4f46e5;
|
|
607
|
+
border-color: #4f46e5;
|
|
608
|
+
color: white;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
.hv-btn--primary:hover {
|
|
612
|
+
background: #4338ca;
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
/* === Segmented layout control === */
|
|
616
|
+
.hv-segment {
|
|
617
|
+
background: #f3f4f6;
|
|
618
|
+
padding: 4px;
|
|
619
|
+
border-radius: 10px;
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
.hv-segment .hv-btn {
|
|
623
|
+
border: none;
|
|
624
|
+
background: transparent;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
.hv-segment .hv-btn--active {
|
|
628
|
+
background: white;
|
|
629
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
/* === Switch === */
|
|
633
|
+
.hv-switch {
|
|
634
|
+
display: inline-flex;
|
|
635
|
+
align-items: center;
|
|
636
|
+
gap: 8px;
|
|
637
|
+
cursor: pointer;
|
|
638
|
+
user-select: none;
|
|
639
|
+
font-size: 13px;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
.hv-switch input {
|
|
643
|
+
display: none;
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
.hv-switch__slider {
|
|
647
|
+
width: 34px;
|
|
648
|
+
height: 18px;
|
|
649
|
+
background: #d1d5db;
|
|
650
|
+
border-radius: 999px;
|
|
651
|
+
position: relative;
|
|
652
|
+
transition: background 0.2s ease;
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
.hv-switch__slider::after {
|
|
656
|
+
content: "";
|
|
657
|
+
position: absolute;
|
|
658
|
+
top: 2px;
|
|
659
|
+
left: 2px;
|
|
660
|
+
width: 14px;
|
|
661
|
+
height: 14px;
|
|
662
|
+
background: white;
|
|
663
|
+
border-radius: 50%;
|
|
664
|
+
transition: transform 0.2s ease;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
.hv-switch input:checked+.hv-switch__slider {
|
|
668
|
+
background: #4f46e5;
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
.hv-switch input:checked+.hv-switch__slider::after {
|
|
672
|
+
transform: translateX(16px);
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
.hv-switch__label {
|
|
676
|
+
color: #374151;
|
|
543
677
|
}
|