@bendyline/squisq-react 2.11.24 → 2.11.25

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.
@@ -476,6 +476,7 @@ function contrastText(hex) {
476
476
  var TARGET_CHUNK_SIZE = 4;
477
477
  var MIN_CHUNK_SIZE = 2;
478
478
  var MAX_CHUNK_SIZE = 6;
479
+ var SOCIAL_CAPTION_HOLD_SECONDS = 1;
479
480
  function resolvePhraseTiming(phrase) {
480
481
  if (phrase.words && phrase.words.length > 0) {
481
482
  return phrase.words.map((w) => ({
@@ -558,17 +559,15 @@ function SocialCaptionOverlay({
558
559
  }
559
560
  }
560
561
  if (!activeChunk) {
561
- for (let i = 0; i < chunks.length - 1; i++) {
562
- if (currentTime >= chunks[i].endTime && currentTime < chunks[i + 1].startTime) {
563
- activeChunk = chunks[i];
564
- activeWordIndex = activeChunk.words.length - 1;
562
+ for (let i = chunks.length - 1; i >= 0; i--) {
563
+ if (currentTime >= chunks[i].endTime) {
564
+ if (currentTime < chunks[i].endTime + SOCIAL_CAPTION_HOLD_SECONDS) {
565
+ activeChunk = chunks[i];
566
+ activeWordIndex = activeChunk.words.length - 1;
567
+ }
565
568
  break;
566
569
  }
567
570
  }
568
- if (!activeChunk && chunks.length > 0 && currentTime >= chunks[chunks.length - 1].startTime) {
569
- activeChunk = chunks[chunks.length - 1];
570
- activeWordIndex = activeChunk.words.length - 1;
571
- }
572
571
  }
573
572
  if (!activeChunk) return null;
574
573
  if (activeWordIndex === -1) {
@@ -764,6 +763,7 @@ function formatTime(seconds) {
764
763
  // src/DocProgressBar.tsx
765
764
  import { useRef as useRef2, useState as useState2, useCallback } from "react";
766
765
  import { jsx as jsx4, jsxs } from "react/jsx-runtime";
766
+ var PLAYER_ACCENT = "var(--squisq-player-accent, #5b9bd5)";
767
767
  function DocProgressBar({
768
768
  state,
769
769
  actions,
@@ -881,7 +881,7 @@ function DocProgressBar({
881
881
  left: 0,
882
882
  width: `${playProgress * 100}%`,
883
883
  height: "6px",
884
- background: "#5b9bd5",
884
+ background: PLAYER_ACCENT,
885
885
  borderRadius: "3px"
886
886
  }
887
887
  }
@@ -908,7 +908,7 @@ function DocProgressBar({
908
908
  height: "14px",
909
909
  padding: 0,
910
910
  backgroundColor: active ? "#ffffff" : "rgba(255,255,255,0.75)",
911
- border: "2px solid #5b9bd5",
911
+ border: `2px solid ${PLAYER_ACCENT}`,
912
912
  boxShadow: "0 1px 3px rgba(0,0,0,0.5)",
913
913
  zIndex: 3
914
914
  } : {
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@ import {
15
15
  formatTime,
16
16
  resolveDocPlayerAppearance,
17
17
  useMediaClipDurations
18
- } from "./chunk-WGLW7T3F.js";
18
+ } from "./chunk-JKR5LJXK.js";
19
19
  import {
20
20
  PaginatedDocView
21
21
  } from "./chunk-KORFPHSJ.js";
@@ -12,7 +12,7 @@ import {
12
12
  MediaClipLayer,
13
13
  SocialCaptionOverlay,
14
14
  formatTime
15
- } from "../chunk-WGLW7T3F.js";
15
+ } from "../chunk-JKR5LJXK.js";
16
16
  import "../chunk-E7UE2PCJ.js";
17
17
  import "../chunk-245G4EEN.js";
18
18
  import "../chunk-TT6ENR6T.js";