@bendyline/squisq-react 2.11.13 → 2.11.14

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.
@@ -820,6 +820,12 @@ function DocProgressBar({
820
820
  },
821
821
  [expandedBlocks]
822
822
  );
823
+ let currentChapterIndex = -1;
824
+ for (const marker of blockMarkers) {
825
+ if (marker.isSectionStart && marker.block.startTime <= state.currentTime) {
826
+ currentChapterIndex = marker.index;
827
+ }
828
+ }
823
829
  return /* @__PURE__ */ jsxs(
824
830
  "div",
825
831
  {
@@ -878,39 +884,57 @@ function DocProgressBar({
878
884
  }
879
885
  }
880
886
  ),
881
- blockMarkers.map((marker, i) => /* @__PURE__ */ jsx4(
882
- "button",
883
- {
884
- type: "button",
885
- style: {
886
- position: "absolute",
887
- left: `${marker.position}%`,
888
- transform: "translateX(-50%)",
889
- width: "10px",
890
- height: "10px",
891
- borderRadius: "50%",
892
- background: marker.index === state.currentBlockIndex ? "#ffffff" : "rgba(255,255,255,0.5)",
893
- border: "2px solid #5b9bd5",
894
- padding: 0,
895
- cursor: "pointer",
896
- zIndex: 2,
897
- transition: "transform 0.15s, background 0.15s"
898
- },
899
- title: marker.title,
900
- "aria-label": `Seek to ${marker.title}`,
901
- onClick: (e) => {
902
- e.stopPropagation();
903
- actions.seekTo(marker.block.startTime);
904
- },
905
- onMouseEnter: (e) => {
906
- e.currentTarget.style.transform = "translateX(-50%) scale(1.3)";
887
+ blockMarkers.map((marker, i) => {
888
+ const chapter = marker.isSectionStart;
889
+ const active = chapter ? marker.index === currentChapterIndex : marker.index === state.currentBlockIndex;
890
+ return /* @__PURE__ */ jsx4(
891
+ "button",
892
+ {
893
+ type: "button",
894
+ "data-marker": chapter ? "chapter" : "slide",
895
+ tabIndex: chapter ? 0 : -1,
896
+ style: {
897
+ position: "absolute",
898
+ left: `${marker.position}%`,
899
+ transform: "translateX(-50%)",
900
+ boxSizing: "border-box",
901
+ borderRadius: "50%",
902
+ cursor: "pointer",
903
+ transition: "transform 0.15s, background-color 0.15s",
904
+ ...chapter ? {
905
+ width: "14px",
906
+ height: "14px",
907
+ padding: 0,
908
+ backgroundColor: active ? "#ffffff" : "rgba(255,255,255,0.75)",
909
+ border: "2px solid #5b9bd5",
910
+ boxShadow: "0 1px 3px rgba(0,0,0,0.5)",
911
+ zIndex: 3
912
+ } : {
913
+ width: "12px",
914
+ height: "12px",
915
+ padding: "3px",
916
+ backgroundClip: "content-box",
917
+ backgroundColor: active ? "#ffffff" : "rgba(255,255,255,0.55)",
918
+ border: "none",
919
+ zIndex: 2
920
+ }
921
+ },
922
+ title: marker.title,
923
+ "aria-label": `Seek to ${marker.title}`,
924
+ onClick: (e) => {
925
+ e.stopPropagation();
926
+ actions.seekTo(marker.block.startTime);
927
+ },
928
+ onMouseEnter: (e) => {
929
+ e.currentTarget.style.transform = "translateX(-50%) scale(1.3)";
930
+ },
931
+ onMouseLeave: (e) => {
932
+ e.currentTarget.style.transform = "translateX(-50%)";
933
+ }
907
934
  },
908
- onMouseLeave: (e) => {
909
- e.currentTarget.style.transform = "translateX(-50%)";
910
- }
911
- },
912
- `${marker.block.id}-${i}`
913
- )),
935
+ `${marker.block.id}-${i}`
936
+ );
937
+ }),
914
938
  hoverPosition !== null && /* @__PURE__ */ jsxs(
915
939
  "div",
916
940
  {
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@ import {
15
15
  formatTime,
16
16
  resolveDocPlayerAppearance,
17
17
  useMediaClipDurations
18
- } from "./chunk-QWUQNB4E.js";
18
+ } from "./chunk-VUMNXXK4.js";
19
19
  import {
20
20
  PaginatedDocView
21
21
  } from "./chunk-7T26IKW2.js";
@@ -12,7 +12,7 @@ import {
12
12
  MediaClipLayer,
13
13
  SocialCaptionOverlay,
14
14
  formatTime
15
- } from "../chunk-QWUQNB4E.js";
15
+ } from "../chunk-VUMNXXK4.js";
16
16
  import {
17
17
  BlockRenderer
18
18
  } from "../chunk-P3FJ3YKS.js";