@bendyline/squisq-react 2.11.23 → 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.
- package/dist/{AudioController-DwMsPe38.d.ts → AudioController-DAwQyEM_.d.ts} +7 -0
- package/dist/{chunk-7J4YN7EK.js → chunk-245G4EEN.js} +78 -21
- package/dist/{chunk-AAZBM5PV.js → chunk-JKR5LJXK.js} +308 -202
- package/dist/hooks/index.d.ts +12 -2
- package/dist/hooks/index.js +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/player/index.d.ts +2 -2
- package/dist/player/index.js +2 -2
- package/dist/{player-BONjpRpG.d.ts → player-BrLTAA_l.d.ts} +3 -1
- package/dist/squisq-player.full.global.js +425 -425
- package/dist/squisq-player.global.js +77 -77
- package/dist/standalone-player-full.js +1 -1
- package/dist/standalone-source.js +1 -1
- package/package.json +2 -2
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
useDocPlayback,
|
|
7
7
|
useMediaSchedule,
|
|
8
8
|
useViewportOrientation
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-245G4EEN.js";
|
|
10
10
|
import {
|
|
11
11
|
useAutoSurface
|
|
12
12
|
} from "./chunk-TT6ENR6T.js";
|
|
@@ -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 =
|
|
562
|
-
if (currentTime >= chunks[i].endTime
|
|
563
|
-
|
|
564
|
-
|
|
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:
|
|
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:
|
|
911
|
+
border: `2px solid ${PLAYER_ACCENT}`,
|
|
912
912
|
boxShadow: "0 1px 3px rgba(0,0,0,0.5)",
|
|
913
913
|
zIndex: 3
|
|
914
914
|
} : {
|
|
@@ -987,8 +987,105 @@ function DocProgressBar({
|
|
|
987
987
|
);
|
|
988
988
|
}
|
|
989
989
|
|
|
990
|
-
// src/
|
|
990
|
+
// src/PlayPauseIcon.tsx
|
|
991
991
|
import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
992
|
+
var SPINNER_DELAY_SECONDS = 0.15;
|
|
993
|
+
var ICON_STYLE = { pointerEvents: "none" };
|
|
994
|
+
var RING_CIRCUMFERENCE = 2 * Math.PI * 10.5;
|
|
995
|
+
function prefersReducedMotion() {
|
|
996
|
+
if (typeof window === "undefined" || typeof window.matchMedia !== "function") return false;
|
|
997
|
+
return window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
998
|
+
}
|
|
999
|
+
function PlayPauseIcon({ isPlaying, isBuffering = false, size }) {
|
|
1000
|
+
if (isPlaying && isBuffering) {
|
|
1001
|
+
const arc = RING_CIRCUMFERENCE / 4;
|
|
1002
|
+
return (
|
|
1003
|
+
// A fresh <svg> per state restarts its animation timeline, so the
|
|
1004
|
+
// fade-in delay counts from the moment loading began.
|
|
1005
|
+
/* @__PURE__ */ jsxs2(
|
|
1006
|
+
"svg",
|
|
1007
|
+
{
|
|
1008
|
+
viewBox: "0 0 24 24",
|
|
1009
|
+
fill: "currentColor",
|
|
1010
|
+
width: size,
|
|
1011
|
+
height: size,
|
|
1012
|
+
"aria-hidden": "true",
|
|
1013
|
+
style: ICON_STYLE,
|
|
1014
|
+
"data-testid": "play-pause-buffering",
|
|
1015
|
+
children: [
|
|
1016
|
+
/* @__PURE__ */ jsx5("path", { d: "M9 8h2v8H9zm4 0h2v8h-2z" }),
|
|
1017
|
+
/* @__PURE__ */ jsxs2("g", { opacity: "0", children: [
|
|
1018
|
+
/* @__PURE__ */ jsx5(
|
|
1019
|
+
"animate",
|
|
1020
|
+
{
|
|
1021
|
+
attributeName: "opacity",
|
|
1022
|
+
from: "0",
|
|
1023
|
+
to: "1",
|
|
1024
|
+
begin: `${SPINNER_DELAY_SECONDS}s`,
|
|
1025
|
+
dur: "0.2s",
|
|
1026
|
+
fill: "freeze"
|
|
1027
|
+
}
|
|
1028
|
+
),
|
|
1029
|
+
/* @__PURE__ */ jsx5(
|
|
1030
|
+
"circle",
|
|
1031
|
+
{
|
|
1032
|
+
cx: "12",
|
|
1033
|
+
cy: "12",
|
|
1034
|
+
r: "10.5",
|
|
1035
|
+
fill: "none",
|
|
1036
|
+
stroke: "currentColor",
|
|
1037
|
+
strokeOpacity: "0.25",
|
|
1038
|
+
strokeWidth: "2"
|
|
1039
|
+
}
|
|
1040
|
+
),
|
|
1041
|
+
/* @__PURE__ */ jsx5(
|
|
1042
|
+
"circle",
|
|
1043
|
+
{
|
|
1044
|
+
cx: "12",
|
|
1045
|
+
cy: "12",
|
|
1046
|
+
r: "10.5",
|
|
1047
|
+
fill: "none",
|
|
1048
|
+
stroke: "currentColor",
|
|
1049
|
+
strokeWidth: "2",
|
|
1050
|
+
strokeLinecap: "round",
|
|
1051
|
+
strokeDasharray: `${arc} ${RING_CIRCUMFERENCE - arc}`,
|
|
1052
|
+
children: !prefersReducedMotion() && /* @__PURE__ */ jsx5(
|
|
1053
|
+
"animateTransform",
|
|
1054
|
+
{
|
|
1055
|
+
attributeName: "transform",
|
|
1056
|
+
type: "rotate",
|
|
1057
|
+
from: "0 12 12",
|
|
1058
|
+
to: "360 12 12",
|
|
1059
|
+
dur: "0.9s",
|
|
1060
|
+
repeatCount: "indefinite"
|
|
1061
|
+
}
|
|
1062
|
+
)
|
|
1063
|
+
}
|
|
1064
|
+
)
|
|
1065
|
+
] })
|
|
1066
|
+
]
|
|
1067
|
+
},
|
|
1068
|
+
"buffering"
|
|
1069
|
+
)
|
|
1070
|
+
);
|
|
1071
|
+
}
|
|
1072
|
+
return /* @__PURE__ */ jsx5(
|
|
1073
|
+
"svg",
|
|
1074
|
+
{
|
|
1075
|
+
viewBox: "0 0 24 24",
|
|
1076
|
+
fill: "currentColor",
|
|
1077
|
+
width: size,
|
|
1078
|
+
height: size,
|
|
1079
|
+
"aria-hidden": "true",
|
|
1080
|
+
style: ICON_STYLE,
|
|
1081
|
+
children: isPlaying ? /* @__PURE__ */ jsx5("path", { d: "M6 19h4V5H6v14zm8-14v14h4V5h-4z" }) : /* @__PURE__ */ jsx5("path", { d: "M8 5v14l11-7z" })
|
|
1082
|
+
},
|
|
1083
|
+
isPlaying ? "pause" : "play"
|
|
1084
|
+
);
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
// src/DocControlsOverlay.tsx
|
|
1088
|
+
import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
992
1089
|
function DocControlsOverlay({
|
|
993
1090
|
state,
|
|
994
1091
|
actions,
|
|
@@ -996,7 +1093,7 @@ function DocControlsOverlay({
|
|
|
996
1093
|
expandedBlocks,
|
|
997
1094
|
getBlockTitle
|
|
998
1095
|
}) {
|
|
999
|
-
return /* @__PURE__ */
|
|
1096
|
+
return /* @__PURE__ */ jsxs3(
|
|
1000
1097
|
"div",
|
|
1001
1098
|
{
|
|
1002
1099
|
className: "doc-player__controls",
|
|
@@ -1013,7 +1110,7 @@ function DocControlsOverlay({
|
|
|
1013
1110
|
zIndex: 100
|
|
1014
1111
|
},
|
|
1015
1112
|
children: [
|
|
1016
|
-
/* @__PURE__ */
|
|
1113
|
+
/* @__PURE__ */ jsx6(
|
|
1017
1114
|
"button",
|
|
1018
1115
|
{
|
|
1019
1116
|
onClick: actions.restart,
|
|
@@ -1029,10 +1126,10 @@ function DocControlsOverlay({
|
|
|
1029
1126
|
},
|
|
1030
1127
|
title: "Restart",
|
|
1031
1128
|
"aria-label": "Restart from beginning",
|
|
1032
|
-
children: /* @__PURE__ */
|
|
1129
|
+
children: /* @__PURE__ */ jsx6("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "18", height: "18", children: /* @__PURE__ */ jsx6("path", { d: "M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z" }) })
|
|
1033
1130
|
}
|
|
1034
1131
|
),
|
|
1035
|
-
/* @__PURE__ */
|
|
1132
|
+
/* @__PURE__ */ jsx6(
|
|
1036
1133
|
"button",
|
|
1037
1134
|
{
|
|
1038
1135
|
onClick: actions.toggle,
|
|
@@ -1051,15 +1148,17 @@ function DocControlsOverlay({
|
|
|
1051
1148
|
height: "40px"
|
|
1052
1149
|
},
|
|
1053
1150
|
"aria-label": state.isPlaying ? "Pause" : "Play",
|
|
1054
|
-
|
|
1151
|
+
"aria-busy": state.isPlaying && state.isBuffering ? true : void 0,
|
|
1152
|
+
title: state.isPlaying && state.isBuffering ? "Loading audio\u2026" : void 0,
|
|
1153
|
+
children: /* @__PURE__ */ jsx6(PlayPauseIcon, { isPlaying: state.isPlaying, isBuffering: state.isBuffering, size: 20 })
|
|
1055
1154
|
}
|
|
1056
1155
|
),
|
|
1057
|
-
/* @__PURE__ */
|
|
1156
|
+
/* @__PURE__ */ jsxs3("span", { style: { color: "white", fontSize: "12px", minWidth: "80px", fontFamily: "monospace" }, children: [
|
|
1058
1157
|
formatTime(state.currentTime),
|
|
1059
1158
|
" / ",
|
|
1060
1159
|
formatTime(state.totalDuration)
|
|
1061
1160
|
] }),
|
|
1062
|
-
/* @__PURE__ */
|
|
1161
|
+
/* @__PURE__ */ jsx6(
|
|
1063
1162
|
DocProgressBar,
|
|
1064
1163
|
{
|
|
1065
1164
|
state,
|
|
@@ -1069,12 +1168,12 @@ function DocControlsOverlay({
|
|
|
1069
1168
|
getBlockTitle
|
|
1070
1169
|
}
|
|
1071
1170
|
),
|
|
1072
|
-
/* @__PURE__ */
|
|
1171
|
+
/* @__PURE__ */ jsxs3("span", { style: { color: "rgba(255,255,255,0.5)", fontSize: "11px", whiteSpace: "nowrap" }, children: [
|
|
1073
1172
|
state.currentBlockIndex + 1,
|
|
1074
1173
|
"/",
|
|
1075
1174
|
state.totalBlocks
|
|
1076
1175
|
] }),
|
|
1077
|
-
state.hasCaptions && /* @__PURE__ */
|
|
1176
|
+
state.hasCaptions && /* @__PURE__ */ jsxs3(
|
|
1078
1177
|
"button",
|
|
1079
1178
|
{
|
|
1080
1179
|
onClick: () => actions.cycleCaptionMode(),
|
|
@@ -1093,12 +1192,12 @@ function DocControlsOverlay({
|
|
|
1093
1192
|
title: state.captionMode === "off" ? "Captions: Off (click for Standard)" : state.captionMode === "standard" ? "Captions: Standard (click for Social)" : "Captions: Social (click to turn off)",
|
|
1094
1193
|
"aria-label": "Cycle caption style",
|
|
1095
1194
|
children: [
|
|
1096
|
-
/* @__PURE__ */
|
|
1097
|
-
state.captionMode !== "off" && /* @__PURE__ */
|
|
1195
|
+
/* @__PURE__ */ jsx6("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "18", height: "18", children: /* @__PURE__ */ jsx6("path", { d: "M19 4H5a2 2 0 00-2 2v12a2 2 0 002 2h14a2 2 0 002-2V6a2 2 0 00-2-2zm-8 7H9.5v-.5h-2v3h2V13H11v1a1 1 0 01-1 1H7a1 1 0 01-1-1v-4a1 1 0 011-1h3a1 1 0 011 1v1zm7 0h-1.5v-.5h-2v3h2V13H18v1a1 1 0 01-1 1h-3a1 1 0 01-1-1v-4a1 1 0 011-1h3a1 1 0 011 1v1z" }) }),
|
|
1196
|
+
state.captionMode !== "off" && /* @__PURE__ */ jsx6("span", { style: { fontSize: "10px", textTransform: "uppercase", letterSpacing: "0.5px" }, children: state.captionMode === "standard" ? "CC" : "SM" })
|
|
1098
1197
|
]
|
|
1099
1198
|
}
|
|
1100
1199
|
),
|
|
1101
|
-
actions.toggleFullscreen && /* @__PURE__ */
|
|
1200
|
+
actions.toggleFullscreen && /* @__PURE__ */ jsx6(
|
|
1102
1201
|
"button",
|
|
1103
1202
|
{
|
|
1104
1203
|
onClick: actions.toggleFullscreen,
|
|
@@ -1114,7 +1213,7 @@ function DocControlsOverlay({
|
|
|
1114
1213
|
},
|
|
1115
1214
|
title: state.isFullscreen ? "Exit fullscreen (F)" : "Fullscreen (F)",
|
|
1116
1215
|
"aria-label": state.isFullscreen ? "Exit fullscreen" : "Enter fullscreen",
|
|
1117
|
-
children: state.isFullscreen ? /* @__PURE__ */
|
|
1216
|
+
children: state.isFullscreen ? /* @__PURE__ */ jsx6("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "18", height: "18", children: /* @__PURE__ */ jsx6("path", { d: "M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z" }) }) : /* @__PURE__ */ jsx6("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "18", height: "18", children: /* @__PURE__ */ jsx6("path", { d: "M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z" }) })
|
|
1118
1217
|
}
|
|
1119
1218
|
)
|
|
1120
1219
|
]
|
|
@@ -1124,7 +1223,7 @@ function DocControlsOverlay({
|
|
|
1124
1223
|
|
|
1125
1224
|
// src/DocControlsSlideshow.tsx
|
|
1126
1225
|
import { useCallback as useCallback2, useEffect as useEffect3, useId, useLayoutEffect, useRef as useRef3, useState as useState3 } from "react";
|
|
1127
|
-
import { jsx as
|
|
1226
|
+
import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1128
1227
|
function DocControlsSlideshow({
|
|
1129
1228
|
state,
|
|
1130
1229
|
slideNav,
|
|
@@ -1214,7 +1313,7 @@ function DocControlsSlideshow({
|
|
|
1214
1313
|
else nextIndex = (focusedIndex - 1 + items.length) % items.length;
|
|
1215
1314
|
items[nextIndex]?.focus();
|
|
1216
1315
|
};
|
|
1217
|
-
return /* @__PURE__ */
|
|
1316
|
+
return /* @__PURE__ */ jsxs4(
|
|
1218
1317
|
"div",
|
|
1219
1318
|
{
|
|
1220
1319
|
ref: controlsRef,
|
|
@@ -1236,7 +1335,7 @@ function DocControlsSlideshow({
|
|
|
1236
1335
|
WebkitBackdropFilter: "blur(8px)"
|
|
1237
1336
|
},
|
|
1238
1337
|
children: [
|
|
1239
|
-
/* @__PURE__ */
|
|
1338
|
+
/* @__PURE__ */ jsx7(
|
|
1240
1339
|
"button",
|
|
1241
1340
|
{
|
|
1242
1341
|
onClick: (e) => {
|
|
@@ -1265,10 +1364,10 @@ function DocControlsSlideshow({
|
|
|
1265
1364
|
onMouseLeave: (e) => {
|
|
1266
1365
|
e.currentTarget.style.background = "none";
|
|
1267
1366
|
},
|
|
1268
|
-
children: /* @__PURE__ */
|
|
1367
|
+
children: /* @__PURE__ */ jsx7("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "18", height: "18", children: /* @__PURE__ */ jsx7("path", { d: "M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z" }) })
|
|
1269
1368
|
}
|
|
1270
1369
|
),
|
|
1271
|
-
/* @__PURE__ */
|
|
1370
|
+
/* @__PURE__ */ jsx7(
|
|
1272
1371
|
"button",
|
|
1273
1372
|
{
|
|
1274
1373
|
ref: triggerRef,
|
|
@@ -1302,7 +1401,7 @@ function DocControlsSlideshow({
|
|
|
1302
1401
|
children: counterText
|
|
1303
1402
|
}
|
|
1304
1403
|
),
|
|
1305
|
-
isPickerOpen && /* @__PURE__ */
|
|
1404
|
+
isPickerOpen && /* @__PURE__ */ jsx7(
|
|
1306
1405
|
"div",
|
|
1307
1406
|
{
|
|
1308
1407
|
ref: menuRef,
|
|
@@ -1329,7 +1428,7 @@ function DocControlsSlideshow({
|
|
|
1329
1428
|
},
|
|
1330
1429
|
children: slides.map((slide, index) => {
|
|
1331
1430
|
const isCurrent = index === currentBlockIndex;
|
|
1332
|
-
return /* @__PURE__ */
|
|
1431
|
+
return /* @__PURE__ */ jsxs4(
|
|
1333
1432
|
"button",
|
|
1334
1433
|
{
|
|
1335
1434
|
type: "button",
|
|
@@ -1362,7 +1461,7 @@ function DocControlsSlideshow({
|
|
|
1362
1461
|
event.currentTarget.style.background = isCurrent ? "rgba(255,255,255,0.14)" : "transparent";
|
|
1363
1462
|
},
|
|
1364
1463
|
children: [
|
|
1365
|
-
/* @__PURE__ */
|
|
1464
|
+
/* @__PURE__ */ jsx7(
|
|
1366
1465
|
"span",
|
|
1367
1466
|
{
|
|
1368
1467
|
style: {
|
|
@@ -1374,7 +1473,7 @@ function DocControlsSlideshow({
|
|
|
1374
1473
|
children: slide.label
|
|
1375
1474
|
}
|
|
1376
1475
|
),
|
|
1377
|
-
/* @__PURE__ */
|
|
1476
|
+
/* @__PURE__ */ jsx7(
|
|
1378
1477
|
"span",
|
|
1379
1478
|
{
|
|
1380
1479
|
style: {
|
|
@@ -1396,7 +1495,7 @@ function DocControlsSlideshow({
|
|
|
1396
1495
|
})
|
|
1397
1496
|
}
|
|
1398
1497
|
),
|
|
1399
|
-
/* @__PURE__ */
|
|
1498
|
+
/* @__PURE__ */ jsx7(
|
|
1400
1499
|
"button",
|
|
1401
1500
|
{
|
|
1402
1501
|
onClick: (e) => {
|
|
@@ -1425,7 +1524,7 @@ function DocControlsSlideshow({
|
|
|
1425
1524
|
onMouseLeave: (e) => {
|
|
1426
1525
|
e.currentTarget.style.background = "none";
|
|
1427
1526
|
},
|
|
1428
|
-
children: /* @__PURE__ */
|
|
1527
|
+
children: /* @__PURE__ */ jsx7("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "18", height: "18", children: /* @__PURE__ */ jsx7("path", { d: "M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z" }) })
|
|
1429
1528
|
}
|
|
1430
1529
|
)
|
|
1431
1530
|
]
|
|
@@ -1436,7 +1535,7 @@ function DocControlsSlideshow({
|
|
|
1436
1535
|
// src/DashboardView.tsx
|
|
1437
1536
|
import { Fragment as Fragment2, useEffect as useEffect4, useMemo as useMemo3, useRef as useRef4 } from "react";
|
|
1438
1537
|
import { materializeDashboard, resolveThemeForDoc, VIEWPORT_PRESETS } from "@bendyline/squisq/doc";
|
|
1439
|
-
import { jsx as
|
|
1538
|
+
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1440
1539
|
async function waitForDashboardAssets(root) {
|
|
1441
1540
|
if (typeof document !== "undefined" && document.fonts?.ready) {
|
|
1442
1541
|
try {
|
|
@@ -1548,7 +1647,7 @@ function DashboardView({
|
|
|
1548
1647
|
margin: "0 auto",
|
|
1549
1648
|
"--squisq-dashboard-aspect": (activeViewport.width / activeViewport.height).toFixed(6)
|
|
1550
1649
|
};
|
|
1551
|
-
return /* @__PURE__ */
|
|
1650
|
+
return /* @__PURE__ */ jsxs5(
|
|
1552
1651
|
"div",
|
|
1553
1652
|
{
|
|
1554
1653
|
ref: rootRef,
|
|
@@ -1557,7 +1656,7 @@ function DashboardView({
|
|
|
1557
1656
|
"data-dashboard-style": materialization.style,
|
|
1558
1657
|
style: canvasStyle,
|
|
1559
1658
|
children: [
|
|
1560
|
-
/* @__PURE__ */
|
|
1659
|
+
/* @__PURE__ */ jsx8("div", { style: coverStyle, "aria-hidden": "true", children: /* @__PURE__ */ jsx8(
|
|
1561
1660
|
BlockRenderer,
|
|
1562
1661
|
{
|
|
1563
1662
|
block: backdropBottom,
|
|
@@ -1570,8 +1669,8 @@ function DashboardView({
|
|
|
1570
1669
|
theme: activeTheme
|
|
1571
1670
|
}
|
|
1572
1671
|
) }),
|
|
1573
|
-
materialization.cells.map((cell) => /* @__PURE__ */
|
|
1574
|
-
cell.frame && /* @__PURE__ */
|
|
1672
|
+
materialization.cells.map((cell) => /* @__PURE__ */ jsxs5(Fragment2, { children: [
|
|
1673
|
+
cell.frame && /* @__PURE__ */ jsx8(
|
|
1575
1674
|
"div",
|
|
1576
1675
|
{
|
|
1577
1676
|
className: "squisq-dashboard__frame",
|
|
@@ -1585,7 +1684,7 @@ function DashboardView({
|
|
|
1585
1684
|
height: cell.frame.rectPct.height,
|
|
1586
1685
|
pointerEvents: "none"
|
|
1587
1686
|
},
|
|
1588
|
-
children: /* @__PURE__ */
|
|
1687
|
+
children: /* @__PURE__ */ jsx8(
|
|
1589
1688
|
BlockRenderer,
|
|
1590
1689
|
{
|
|
1591
1690
|
block: syntheticBlock(`dashboard-frame-${cell.index}`, cell.frame.layers),
|
|
@@ -1603,7 +1702,7 @@ function DashboardView({
|
|
|
1603
1702
|
)
|
|
1604
1703
|
}
|
|
1605
1704
|
),
|
|
1606
|
-
/* @__PURE__ */
|
|
1705
|
+
/* @__PURE__ */ jsxs5(
|
|
1607
1706
|
"div",
|
|
1608
1707
|
{
|
|
1609
1708
|
className: "squisq-dashboard__cell",
|
|
@@ -1620,7 +1719,7 @@ function DashboardView({
|
|
|
1620
1719
|
...cell.frame?.contentRadiusPct ? { borderRadius: cell.frame.contentRadiusPct, overflow: "hidden" } : {}
|
|
1621
1720
|
},
|
|
1622
1721
|
children: [
|
|
1623
|
-
/* @__PURE__ */
|
|
1722
|
+
/* @__PURE__ */ jsx8(
|
|
1624
1723
|
BlockRenderer,
|
|
1625
1724
|
{
|
|
1626
1725
|
block: { ...cell.block, layers: cell.layers },
|
|
@@ -1637,7 +1736,7 @@ function DashboardView({
|
|
|
1637
1736
|
cell.frame && cell.frame.overlayLayers.length > 0 && // Borders and accents ride above the block: a template that
|
|
1638
1737
|
// paints its own opaque surface would bury them. Same box, so
|
|
1639
1738
|
// the cell's clip rounds them to the card's corners.
|
|
1640
|
-
/* @__PURE__ */
|
|
1739
|
+
/* @__PURE__ */ jsx8("div", { style: { position: "absolute", inset: 0, pointerEvents: "none" }, children: /* @__PURE__ */ jsx8(
|
|
1641
1740
|
BlockRenderer,
|
|
1642
1741
|
{
|
|
1643
1742
|
block: syntheticBlock(
|
|
@@ -1660,7 +1759,7 @@ function DashboardView({
|
|
|
1660
1759
|
}
|
|
1661
1760
|
)
|
|
1662
1761
|
] }, `${cell.index}-${cell.block.id}`)),
|
|
1663
|
-
materialization.title && titleBlock && /* @__PURE__ */
|
|
1762
|
+
materialization.title && titleBlock && /* @__PURE__ */ jsx8(
|
|
1664
1763
|
"div",
|
|
1665
1764
|
{
|
|
1666
1765
|
className: "squisq-dashboard__title",
|
|
@@ -1671,7 +1770,7 @@ function DashboardView({
|
|
|
1671
1770
|
width: materialization.title.rectPct.width,
|
|
1672
1771
|
height: materialization.title.rectPct.height
|
|
1673
1772
|
},
|
|
1674
|
-
children: /* @__PURE__ */
|
|
1773
|
+
children: /* @__PURE__ */ jsx8(
|
|
1675
1774
|
BlockRenderer,
|
|
1676
1775
|
{
|
|
1677
1776
|
block: titleBlock,
|
|
@@ -1689,7 +1788,7 @@ function DashboardView({
|
|
|
1689
1788
|
)
|
|
1690
1789
|
}
|
|
1691
1790
|
),
|
|
1692
|
-
backdropTop && /* @__PURE__ */
|
|
1791
|
+
backdropTop && /* @__PURE__ */ jsx8("div", { style: { ...coverStyle, pointerEvents: "none" }, "aria-hidden": "true", children: /* @__PURE__ */ jsx8(
|
|
1693
1792
|
BlockRenderer,
|
|
1694
1793
|
{
|
|
1695
1794
|
block: backdropTop,
|
|
@@ -1722,7 +1821,7 @@ import {
|
|
|
1722
1821
|
resolvePageBlock,
|
|
1723
1822
|
resolveThemeForDoc as resolveThemeForDoc2
|
|
1724
1823
|
} from "@bendyline/squisq/doc";
|
|
1725
|
-
import { Fragment as Fragment3, jsx as
|
|
1824
|
+
import { Fragment as Fragment3, jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1726
1825
|
var VISUAL_TEMPLATES = /* @__PURE__ */ new Set([
|
|
1727
1826
|
"diagram",
|
|
1728
1827
|
"tree",
|
|
@@ -1768,9 +1867,9 @@ function FaceBlock({
|
|
|
1768
1867
|
() => resolveVisualBlock(block, theme, viewport, customTemplates),
|
|
1769
1868
|
[block, customTemplates, theme, viewport]
|
|
1770
1869
|
);
|
|
1771
|
-
return /* @__PURE__ */
|
|
1772
|
-
!visualBlock && block.title && /* @__PURE__ */
|
|
1773
|
-
!visualBlock && block.contents && block.contents.length > 0 && /* @__PURE__ */
|
|
1870
|
+
return /* @__PURE__ */ jsxs6("section", { className: "squisq-flashcards__content-block", "data-source-block-id": block.id, children: [
|
|
1871
|
+
!visualBlock && block.title && /* @__PURE__ */ jsx9(Heading, { className: "squisq-flashcards__content-title", children: block.title }),
|
|
1872
|
+
!visualBlock && block.contents && block.contents.length > 0 && /* @__PURE__ */ jsx9(
|
|
1774
1873
|
MarkdownRenderer,
|
|
1775
1874
|
{
|
|
1776
1875
|
nodes: block.contents,
|
|
@@ -1780,12 +1879,12 @@ function FaceBlock({
|
|
|
1780
1879
|
fenceRenderers
|
|
1781
1880
|
}
|
|
1782
1881
|
),
|
|
1783
|
-
(visualBlock || block.layers && block.layers.length > 0) && /* @__PURE__ */
|
|
1882
|
+
(visualBlock || block.layers && block.layers.length > 0) && /* @__PURE__ */ jsx9(
|
|
1784
1883
|
"div",
|
|
1785
1884
|
{
|
|
1786
1885
|
className: "squisq-flashcards__canvas",
|
|
1787
1886
|
style: { aspectRatio: `${viewport.width} / ${viewport.height}` },
|
|
1788
|
-
children: /* @__PURE__ */
|
|
1887
|
+
children: /* @__PURE__ */ jsx9(
|
|
1789
1888
|
BlockRenderer,
|
|
1790
1889
|
{
|
|
1791
1890
|
block: visualBlock ?? block,
|
|
@@ -1799,7 +1898,7 @@ function FaceBlock({
|
|
|
1799
1898
|
)
|
|
1800
1899
|
}
|
|
1801
1900
|
),
|
|
1802
|
-
!visualBlock && block.children?.map((child) => /* @__PURE__ */
|
|
1901
|
+
!visualBlock && block.children?.map((child) => /* @__PURE__ */ jsx9(
|
|
1803
1902
|
FaceBlock,
|
|
1804
1903
|
{
|
|
1805
1904
|
block: child,
|
|
@@ -1817,10 +1916,10 @@ function FaceBlock({
|
|
|
1817
1916
|
] });
|
|
1818
1917
|
}
|
|
1819
1918
|
function FaceContent(props) {
|
|
1820
|
-
return /* @__PURE__ */
|
|
1919
|
+
return /* @__PURE__ */ jsx9("div", { className: "squisq-flashcards__face-content", children: props.face.blocks.map((block) => /* @__PURE__ */ jsx9(FaceBlock, { block, depth: 0, ...props }, block.id)) });
|
|
1821
1920
|
}
|
|
1822
1921
|
function FlashcardFaceView(props) {
|
|
1823
|
-
return /* @__PURE__ */
|
|
1922
|
+
return /* @__PURE__ */ jsx9(FaceContent, { ...props, viewport: props.viewport ?? VIEWPORT_PRESETS2.landscape });
|
|
1824
1923
|
}
|
|
1825
1924
|
function hashSeed(value) {
|
|
1826
1925
|
let hash = 2166136261;
|
|
@@ -1847,7 +1946,7 @@ function shuffled(values, seed) {
|
|
|
1847
1946
|
return result;
|
|
1848
1947
|
}
|
|
1849
1948
|
function ChoiceContent(props) {
|
|
1850
|
-
return /* @__PURE__ */
|
|
1949
|
+
return /* @__PURE__ */ jsx9(FaceContent, { ...props, face: props.choice.content });
|
|
1851
1950
|
}
|
|
1852
1951
|
function isInteractiveTarget(target) {
|
|
1853
1952
|
return target instanceof Element && !!target.closest('button, a, input, select, textarea, [contenteditable="true"]');
|
|
@@ -2014,23 +2113,23 @@ function FlashcardView({
|
|
|
2014
2113
|
const missedIds = deck.cards.filter((card) => ratings[card.id] === "again").map((card) => card.id);
|
|
2015
2114
|
const gotItCount = deck.cards.filter((card) => ratings[card.id] === "got-it").length;
|
|
2016
2115
|
if (deck.cards.length === 0) {
|
|
2017
|
-
return /* @__PURE__ */
|
|
2116
|
+
return /* @__PURE__ */ jsx9(
|
|
2018
2117
|
"div",
|
|
2019
2118
|
{
|
|
2020
2119
|
className: `squisq-flashcards squisq-flashcards--empty${className ? ` ${className}` : ""}`,
|
|
2021
2120
|
style: rootStyle,
|
|
2022
2121
|
role: "region",
|
|
2023
2122
|
"aria-label": "Flashcards",
|
|
2024
|
-
children: /* @__PURE__ */
|
|
2025
|
-
/* @__PURE__ */
|
|
2026
|
-
/* @__PURE__ */
|
|
2027
|
-
deck.diagnostics.length > 0 && /* @__PURE__ */
|
|
2123
|
+
children: /* @__PURE__ */ jsxs6("div", { className: "squisq-flashcards__empty-card", children: [
|
|
2124
|
+
/* @__PURE__ */ jsx9("h2", { children: "No complete flashcards yet" }),
|
|
2125
|
+
/* @__PURE__ */ jsx9("p", { children: "Add an answer beneath a heading, or nest an answer block under a question." }),
|
|
2126
|
+
deck.diagnostics.length > 0 && /* @__PURE__ */ jsx9("ul", { children: deck.diagnostics.map((diagnostic, index) => /* @__PURE__ */ jsx9("li", { children: diagnostic.message }, `${diagnostic.blockId}-${diagnostic.code}-${index}`)) })
|
|
2028
2127
|
] })
|
|
2029
2128
|
}
|
|
2030
2129
|
);
|
|
2031
2130
|
}
|
|
2032
2131
|
if (finished) {
|
|
2033
|
-
return /* @__PURE__ */
|
|
2132
|
+
return /* @__PURE__ */ jsx9(
|
|
2034
2133
|
"div",
|
|
2035
2134
|
{
|
|
2036
2135
|
className: `squisq-flashcards${className ? ` ${className}` : ""}`,
|
|
@@ -2039,15 +2138,15 @@ function FlashcardView({
|
|
|
2039
2138
|
"aria-label": "Flashcard session summary",
|
|
2040
2139
|
tabIndex: 0,
|
|
2041
2140
|
onKeyDown: globalKeyboardShortcuts ? void 0 : handleShortcut,
|
|
2042
|
-
children: /* @__PURE__ */
|
|
2043
|
-
/* @__PURE__ */
|
|
2044
|
-
/* @__PURE__ */
|
|
2141
|
+
children: /* @__PURE__ */ jsxs6("div", { className: "squisq-flashcards__summary", children: [
|
|
2142
|
+
/* @__PURE__ */ jsx9("span", { className: "squisq-flashcards__eyebrow", children: "Session complete" }),
|
|
2143
|
+
/* @__PURE__ */ jsxs6("h2", { children: [
|
|
2045
2144
|
gotItCount,
|
|
2046
2145
|
" remembered"
|
|
2047
2146
|
] }),
|
|
2048
|
-
/* @__PURE__ */
|
|
2049
|
-
/* @__PURE__ */
|
|
2050
|
-
missedIds.length > 0 && /* @__PURE__ */
|
|
2147
|
+
/* @__PURE__ */ jsx9("p", { children: missedIds.length === 0 ? `You completed all ${deck.cards.length} cards.` : `${missedIds.length} ${missedIds.length === 1 ? "card needs" : "cards need"} another look.` }),
|
|
2148
|
+
/* @__PURE__ */ jsxs6("div", { className: "squisq-flashcards__summary-actions", children: [
|
|
2149
|
+
missedIds.length > 0 && /* @__PURE__ */ jsx9(
|
|
2051
2150
|
"button",
|
|
2052
2151
|
{
|
|
2053
2152
|
type: "button",
|
|
@@ -2059,8 +2158,8 @@ function FlashcardView({
|
|
|
2059
2158
|
children: "Retry missed"
|
|
2060
2159
|
}
|
|
2061
2160
|
),
|
|
2062
|
-
/* @__PURE__ */
|
|
2063
|
-
/* @__PURE__ */
|
|
2161
|
+
/* @__PURE__ */ jsx9("button", { type: "button", className: "squisq-flashcards__button", onClick: restart, children: "Study again" }),
|
|
2162
|
+
/* @__PURE__ */ jsx9("button", { type: "button", className: "squisq-flashcards__button", onClick: previousCard, children: "Previous card" })
|
|
2064
2163
|
] })
|
|
2065
2164
|
] })
|
|
2066
2165
|
}
|
|
@@ -2068,7 +2167,7 @@ function FlashcardView({
|
|
|
2068
2167
|
}
|
|
2069
2168
|
const choices = currentCard?.choices ? shuffled(currentCard.choices, `${currentCard.id}:${sessionSeed}`) : [];
|
|
2070
2169
|
const selectedChoice = choices.find((choice) => choice.id === selectedChoiceId);
|
|
2071
|
-
return /* @__PURE__ */
|
|
2170
|
+
return /* @__PURE__ */ jsxs6(
|
|
2072
2171
|
"div",
|
|
2073
2172
|
{
|
|
2074
2173
|
className: `squisq-flashcards${className ? ` ${className}` : ""}`,
|
|
@@ -2078,13 +2177,13 @@ function FlashcardView({
|
|
|
2078
2177
|
tabIndex: 0,
|
|
2079
2178
|
onKeyDown: globalKeyboardShortcuts ? void 0 : handleShortcut,
|
|
2080
2179
|
children: [
|
|
2081
|
-
/* @__PURE__ */
|
|
2082
|
-
/* @__PURE__ */
|
|
2083
|
-
/* @__PURE__ */
|
|
2084
|
-
deck.title && /* @__PURE__ */
|
|
2180
|
+
/* @__PURE__ */ jsxs6("header", { className: "squisq-flashcards__header", children: [
|
|
2181
|
+
/* @__PURE__ */ jsxs6("div", { className: "squisq-flashcards__deck-copy", children: [
|
|
2182
|
+
/* @__PURE__ */ jsx9("span", { className: "squisq-flashcards__eyebrow", children: "Flashcards" }),
|
|
2183
|
+
deck.title && /* @__PURE__ */ jsx9("h1", { children: deck.title })
|
|
2085
2184
|
] }),
|
|
2086
|
-
/* @__PURE__ */
|
|
2087
|
-
/* @__PURE__ */
|
|
2185
|
+
/* @__PURE__ */ jsxs6("div", { className: "squisq-flashcards__tools", children: [
|
|
2186
|
+
/* @__PURE__ */ jsx9(
|
|
2088
2187
|
"button",
|
|
2089
2188
|
{
|
|
2090
2189
|
type: "button",
|
|
@@ -2097,25 +2196,25 @@ function FlashcardView({
|
|
|
2097
2196
|
children: "Shuffle"
|
|
2098
2197
|
}
|
|
2099
2198
|
),
|
|
2100
|
-
/* @__PURE__ */
|
|
2199
|
+
/* @__PURE__ */ jsx9("button", { type: "button", className: "squisq-flashcards__tool", onClick: restart, children: "Restart" })
|
|
2101
2200
|
] })
|
|
2102
2201
|
] }),
|
|
2103
|
-
/* @__PURE__ */
|
|
2104
|
-
/* @__PURE__ */
|
|
2202
|
+
/* @__PURE__ */ jsxs6("div", { className: "squisq-flashcards__progress-row", children: [
|
|
2203
|
+
/* @__PURE__ */ jsxs6("span", { children: [
|
|
2105
2204
|
"Card ",
|
|
2106
2205
|
cardIndex + 1,
|
|
2107
2206
|
" of ",
|
|
2108
2207
|
sessionCards.length
|
|
2109
2208
|
] }),
|
|
2110
|
-
/* @__PURE__ */
|
|
2209
|
+
/* @__PURE__ */ jsx9("span", { children: revealed ? "Answer revealed" : "Question" })
|
|
2111
2210
|
] }),
|
|
2112
|
-
/* @__PURE__ */
|
|
2211
|
+
/* @__PURE__ */ jsx9("div", { className: "squisq-flashcards__progress", "aria-hidden": "true", children: /* @__PURE__ */ jsx9(
|
|
2113
2212
|
"span",
|
|
2114
2213
|
{
|
|
2115
2214
|
style: { width: `${(cardIndex + (revealed ? 1 : 0)) / sessionCards.length * 100}%` }
|
|
2116
2215
|
}
|
|
2117
2216
|
) }),
|
|
2118
|
-
/* @__PURE__ */
|
|
2217
|
+
/* @__PURE__ */ jsxs6(
|
|
2119
2218
|
"main",
|
|
2120
2219
|
{
|
|
2121
2220
|
ref: cardViewportRef,
|
|
@@ -2124,12 +2223,12 @@ function FlashcardView({
|
|
|
2124
2223
|
"aria-label": "Scrollable flashcard content",
|
|
2125
2224
|
tabIndex: 0,
|
|
2126
2225
|
children: [
|
|
2127
|
-
currentCard.label && /* @__PURE__ */
|
|
2128
|
-
/* @__PURE__ */
|
|
2129
|
-
currentCard.kind === "multiple-choice" && /* @__PURE__ */
|
|
2226
|
+
currentCard.label && /* @__PURE__ */ jsx9("div", { className: "squisq-flashcards__label", children: currentCard.label }),
|
|
2227
|
+
/* @__PURE__ */ jsx9("section", { className: "squisq-flashcards__front", "aria-label": "Question", children: /* @__PURE__ */ jsx9(FaceContent, { ...faceProps, face: currentCard.front }) }),
|
|
2228
|
+
currentCard.kind === "multiple-choice" && /* @__PURE__ */ jsx9("div", { className: "squisq-flashcards__choices", role: "group", "aria-label": "Answer choices", children: choices.map((choice, index) => {
|
|
2130
2229
|
const selected = selectedChoiceId === choice.id;
|
|
2131
2230
|
const status = revealed ? choice.correct ? "correct" : selected ? "incorrect" : "idle" : "idle";
|
|
2132
|
-
return /* @__PURE__ */
|
|
2231
|
+
return /* @__PURE__ */ jsxs6(
|
|
2133
2232
|
"button",
|
|
2134
2233
|
{
|
|
2135
2234
|
type: "button",
|
|
@@ -2139,41 +2238,41 @@ function FlashcardView({
|
|
|
2139
2238
|
disabled: revealed,
|
|
2140
2239
|
onClick: () => choose(choice),
|
|
2141
2240
|
children: [
|
|
2142
|
-
/* @__PURE__ */
|
|
2143
|
-
/* @__PURE__ */
|
|
2241
|
+
/* @__PURE__ */ jsx9("span", { className: "squisq-flashcards__choice-key", "aria-hidden": "true", children: index + 1 }),
|
|
2242
|
+
/* @__PURE__ */ jsx9(ChoiceContent, { ...faceProps, choice })
|
|
2144
2243
|
]
|
|
2145
2244
|
},
|
|
2146
2245
|
choice.id
|
|
2147
2246
|
);
|
|
2148
2247
|
}) }),
|
|
2149
|
-
revealed && currentCard.kind === "basic" && /* @__PURE__ */
|
|
2150
|
-
/* @__PURE__ */
|
|
2151
|
-
/* @__PURE__ */
|
|
2248
|
+
revealed && currentCard.kind === "basic" && /* @__PURE__ */ jsxs6("section", { className: "squisq-flashcards__answer", "aria-label": "Answer", children: [
|
|
2249
|
+
/* @__PURE__ */ jsx9("span", { className: "squisq-flashcards__answer-label", children: "Answer" }),
|
|
2250
|
+
/* @__PURE__ */ jsx9(FaceContent, { ...faceProps, face: currentCard.back })
|
|
2152
2251
|
] }),
|
|
2153
|
-
revealed && currentCard.kind === "multiple-choice" && /* @__PURE__ */
|
|
2252
|
+
revealed && currentCard.kind === "multiple-choice" && /* @__PURE__ */ jsxs6(
|
|
2154
2253
|
"div",
|
|
2155
2254
|
{
|
|
2156
2255
|
className: "squisq-flashcards__feedback",
|
|
2157
2256
|
"data-correct": selectedChoice?.correct === true,
|
|
2158
2257
|
"aria-live": "polite",
|
|
2159
2258
|
children: [
|
|
2160
|
-
/* @__PURE__ */
|
|
2161
|
-
!selectedChoice?.correct && /* @__PURE__ */
|
|
2162
|
-
/* @__PURE__ */
|
|
2163
|
-
/* @__PURE__ */
|
|
2259
|
+
/* @__PURE__ */ jsx9("strong", { children: selectedChoice === void 0 ? "Answer revealed" : selectedChoice.correct ? "Correct" : "Not quite" }),
|
|
2260
|
+
!selectedChoice?.correct && /* @__PURE__ */ jsxs6("div", { className: "squisq-flashcards__correct-answer", children: [
|
|
2261
|
+
/* @__PURE__ */ jsx9("span", { children: "The correct answer is" }),
|
|
2262
|
+
/* @__PURE__ */ jsx9(FaceContent, { ...faceProps, face: currentCard.back })
|
|
2164
2263
|
] })
|
|
2165
2264
|
]
|
|
2166
2265
|
}
|
|
2167
2266
|
),
|
|
2168
|
-
revealed && currentCard.explanation && /* @__PURE__ */
|
|
2169
|
-
/* @__PURE__ */
|
|
2170
|
-
/* @__PURE__ */
|
|
2267
|
+
revealed && currentCard.explanation && /* @__PURE__ */ jsxs6("section", { className: "squisq-flashcards__explanation", "aria-label": "Explanation", children: [
|
|
2268
|
+
/* @__PURE__ */ jsx9("span", { className: "squisq-flashcards__answer-label", children: "Explanation" }),
|
|
2269
|
+
/* @__PURE__ */ jsx9(FaceContent, { ...faceProps, face: currentCard.explanation })
|
|
2171
2270
|
] })
|
|
2172
2271
|
]
|
|
2173
2272
|
}
|
|
2174
2273
|
),
|
|
2175
|
-
/* @__PURE__ */
|
|
2176
|
-
/* @__PURE__ */
|
|
2274
|
+
/* @__PURE__ */ jsxs6("footer", { className: "squisq-flashcards__footer", children: [
|
|
2275
|
+
/* @__PURE__ */ jsx9(
|
|
2177
2276
|
"button",
|
|
2178
2277
|
{
|
|
2179
2278
|
type: "button",
|
|
@@ -2183,8 +2282,8 @@ function FlashcardView({
|
|
|
2183
2282
|
children: "Previous"
|
|
2184
2283
|
}
|
|
2185
2284
|
),
|
|
2186
|
-
/* @__PURE__ */
|
|
2187
|
-
/* @__PURE__ */
|
|
2285
|
+
/* @__PURE__ */ jsx9("div", { className: "squisq-flashcards__primary-actions", children: revealed && currentCard.kind === "basic" ? /* @__PURE__ */ jsxs6(Fragment3, { children: [
|
|
2286
|
+
/* @__PURE__ */ jsx9(
|
|
2188
2287
|
"button",
|
|
2189
2288
|
{
|
|
2190
2289
|
type: "button",
|
|
@@ -2193,7 +2292,7 @@ function FlashcardView({
|
|
|
2193
2292
|
children: "Again"
|
|
2194
2293
|
}
|
|
2195
2294
|
),
|
|
2196
|
-
/* @__PURE__ */
|
|
2295
|
+
/* @__PURE__ */ jsx9(
|
|
2197
2296
|
"button",
|
|
2198
2297
|
{
|
|
2199
2298
|
type: "button",
|
|
@@ -2202,7 +2301,7 @@ function FlashcardView({
|
|
|
2202
2301
|
children: "Got it"
|
|
2203
2302
|
}
|
|
2204
2303
|
)
|
|
2205
|
-
] }) : /* @__PURE__ */
|
|
2304
|
+
] }) : /* @__PURE__ */ jsx9(
|
|
2206
2305
|
"button",
|
|
2207
2306
|
{
|
|
2208
2307
|
type: "button",
|
|
@@ -2212,7 +2311,7 @@ function FlashcardView({
|
|
|
2212
2311
|
}
|
|
2213
2312
|
) })
|
|
2214
2313
|
] }),
|
|
2215
|
-
/* @__PURE__ */
|
|
2314
|
+
/* @__PURE__ */ jsxs6("p", { className: "squisq-flashcards__shortcut-hint", children: [
|
|
2216
2315
|
"Use \u2190 and \u2192 to navigate, Space to reveal",
|
|
2217
2316
|
currentCard.kind === "multiple-choice" ? ", or 1\u20139 to answer" : "",
|
|
2218
2317
|
"."
|
|
@@ -2520,7 +2619,7 @@ function buildSegmentTitleMap(doc) {
|
|
|
2520
2619
|
}
|
|
2521
2620
|
|
|
2522
2621
|
// src/DocPlayer.tsx
|
|
2523
|
-
import { jsx as
|
|
2622
|
+
import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2524
2623
|
function isDevEnvironment() {
|
|
2525
2624
|
try {
|
|
2526
2625
|
return typeof process !== "undefined" && process.env.NODE_ENV !== "production";
|
|
@@ -2558,10 +2657,10 @@ function DocPlayer(props) {
|
|
|
2558
2657
|
);
|
|
2559
2658
|
const resolvedDoc = doc ?? markdownDoc;
|
|
2560
2659
|
if (!resolvedDoc) {
|
|
2561
|
-
return /* @__PURE__ */
|
|
2660
|
+
return /* @__PURE__ */ jsx10("div", { className: "doc-player doc-player--empty" });
|
|
2562
2661
|
}
|
|
2563
2662
|
if (props.displayMode === "flashcards") {
|
|
2564
|
-
return /* @__PURE__ */
|
|
2663
|
+
return /* @__PURE__ */ jsx10("div", { className: "doc-player doc-player--flashcards", children: /* @__PURE__ */ jsx10(
|
|
2565
2664
|
FlashcardView,
|
|
2566
2665
|
{
|
|
2567
2666
|
doc: resolvedDoc,
|
|
@@ -2575,7 +2674,7 @@ function DocPlayer(props) {
|
|
|
2575
2674
|
}
|
|
2576
2675
|
) });
|
|
2577
2676
|
}
|
|
2578
|
-
return /* @__PURE__ */
|
|
2677
|
+
return /* @__PURE__ */ jsx10(DocPlayerContent, { ...props, doc: resolvedDoc });
|
|
2579
2678
|
}
|
|
2580
2679
|
function DocPlayerContent({
|
|
2581
2680
|
doc,
|
|
@@ -2676,6 +2775,7 @@ function DocPlayerContent({
|
|
|
2676
2775
|
totalDuration,
|
|
2677
2776
|
isEnded,
|
|
2678
2777
|
isReady: isAudioReady,
|
|
2778
|
+
isBuffering = false,
|
|
2679
2779
|
isAvailable,
|
|
2680
2780
|
unavailableMessage,
|
|
2681
2781
|
play,
|
|
@@ -3194,6 +3294,7 @@ function DocPlayerContent({
|
|
|
3194
3294
|
const playbackState = useMemo5(
|
|
3195
3295
|
() => ({
|
|
3196
3296
|
isPlaying,
|
|
3297
|
+
isBuffering,
|
|
3197
3298
|
currentTime,
|
|
3198
3299
|
totalDuration,
|
|
3199
3300
|
isCoverVisible: showCoverBlock,
|
|
@@ -3214,6 +3315,7 @@ function DocPlayerContent({
|
|
|
3214
3315
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- doc.audio.segments is stable within a given doc
|
|
3215
3316
|
[
|
|
3216
3317
|
isPlaying,
|
|
3318
|
+
isBuffering,
|
|
3217
3319
|
currentTime,
|
|
3218
3320
|
totalDuration,
|
|
3219
3321
|
showCoverBlock,
|
|
@@ -3496,7 +3598,7 @@ function DocPlayerContent({
|
|
|
3496
3598
|
return () => document.removeEventListener("keydown", handleDocumentKeyDown);
|
|
3497
3599
|
}, [globalKeyboardShortcuts, handleKeyboardShortcut, isDashboardMode, isLinearMode, renderMode]);
|
|
3498
3600
|
if (isLinearMode) {
|
|
3499
|
-
return /* @__PURE__ */
|
|
3601
|
+
return /* @__PURE__ */ jsx10(
|
|
3500
3602
|
"div",
|
|
3501
3603
|
{
|
|
3502
3604
|
ref: containerRef,
|
|
@@ -3508,7 +3610,7 @@ function DocPlayerContent({
|
|
|
3508
3610
|
height: "100%",
|
|
3509
3611
|
overflow: "hidden"
|
|
3510
3612
|
},
|
|
3511
|
-
children: /* @__PURE__ */
|
|
3613
|
+
children: /* @__PURE__ */ jsx10(
|
|
3512
3614
|
LinearDocView,
|
|
3513
3615
|
{
|
|
3514
3616
|
doc,
|
|
@@ -3526,7 +3628,7 @@ function DocPlayerContent({
|
|
|
3526
3628
|
);
|
|
3527
3629
|
}
|
|
3528
3630
|
if (isDashboardMode) {
|
|
3529
|
-
return /* @__PURE__ */
|
|
3631
|
+
return /* @__PURE__ */ jsx10(
|
|
3530
3632
|
"div",
|
|
3531
3633
|
{
|
|
3532
3634
|
ref: containerRef,
|
|
@@ -3539,7 +3641,7 @@ function DocPlayerContent({
|
|
|
3539
3641
|
margin: "0 auto",
|
|
3540
3642
|
overflow: "hidden"
|
|
3541
3643
|
},
|
|
3542
|
-
children: /* @__PURE__ */
|
|
3644
|
+
children: /* @__PURE__ */ jsx10(
|
|
3543
3645
|
DashboardView,
|
|
3544
3646
|
{
|
|
3545
3647
|
doc,
|
|
@@ -3559,7 +3661,7 @@ function DocPlayerContent({
|
|
|
3559
3661
|
}
|
|
3560
3662
|
);
|
|
3561
3663
|
}
|
|
3562
|
-
return /* @__PURE__ */
|
|
3664
|
+
return /* @__PURE__ */ jsxs7(
|
|
3563
3665
|
"div",
|
|
3564
3666
|
{
|
|
3565
3667
|
ref: containerRef,
|
|
@@ -3587,8 +3689,8 @@ function DocPlayerContent({
|
|
|
3587
3689
|
touchAction: swipeEnabled ? "pan-y" : void 0
|
|
3588
3690
|
},
|
|
3589
3691
|
children: [
|
|
3590
|
-
/* @__PURE__ */
|
|
3591
|
-
/* @__PURE__ */
|
|
3692
|
+
/* @__PURE__ */ jsx10("audio", { ref: audioRef, preload: "auto", muted }),
|
|
3693
|
+
/* @__PURE__ */ jsx10(
|
|
3592
3694
|
MediaClipLayer,
|
|
3593
3695
|
{
|
|
3594
3696
|
schedule: mediaSchedule,
|
|
@@ -3605,8 +3707,8 @@ function DocPlayerContent({
|
|
|
3605
3707
|
pipFrameStyle
|
|
3606
3708
|
}
|
|
3607
3709
|
),
|
|
3608
|
-
/* @__PURE__ */
|
|
3609
|
-
showCoverBlock && coverBlock && /* @__PURE__ */
|
|
3710
|
+
/* @__PURE__ */ jsxs7("div", { className: "doc-player__viewport", children: [
|
|
3711
|
+
showCoverBlock && coverBlock && /* @__PURE__ */ jsx10("div", { className: "doc-player__block doc-player__block--cover", children: /* @__PURE__ */ jsx10(
|
|
3610
3712
|
BlockRenderer,
|
|
3611
3713
|
{
|
|
3612
3714
|
block: coverBlock,
|
|
@@ -3626,7 +3728,7 @@ function DocPlayerContent({
|
|
|
3626
3728
|
// reconciles one block's layers onto another's (templates reuse layer
|
|
3627
3729
|
// ids like `title`/`background`), which would otherwise reuse stale
|
|
3628
3730
|
// DOM / skip entrance animations mid-transition.
|
|
3629
|
-
/* @__PURE__ */
|
|
3731
|
+
/* @__PURE__ */ jsx10("div", { className: "doc-player__block doc-player__block--previous", children: /* @__PURE__ */ jsx10(
|
|
3630
3732
|
BlockRenderer,
|
|
3631
3733
|
{
|
|
3632
3734
|
block: previousBlock,
|
|
@@ -3643,7 +3745,7 @@ function DocPlayerContent({
|
|
|
3643
3745
|
videoEmbeds: renderMode ? "placeholder" : "poster"
|
|
3644
3746
|
}
|
|
3645
3747
|
) }, previousBlock.id),
|
|
3646
|
-
currentBlock && /* @__PURE__ */
|
|
3748
|
+
currentBlock && /* @__PURE__ */ jsx10(
|
|
3647
3749
|
"div",
|
|
3648
3750
|
{
|
|
3649
3751
|
className: `doc-player__block doc-player__block--active${swipe.phase !== "idle" ? ` doc-player__block--${swipe.phase}` : ""}`,
|
|
@@ -3652,7 +3754,7 @@ function DocPlayerContent({
|
|
|
3652
3754
|
...swipe.phase !== "idle" ? { transform: `translateX(${swipe.offsetPx}px)` } : {},
|
|
3653
3755
|
...showCoverBlock ? { opacity: 0, pointerEvents: "none" } : {}
|
|
3654
3756
|
} : void 0,
|
|
3655
|
-
children: /* @__PURE__ */
|
|
3757
|
+
children: /* @__PURE__ */ jsx10(
|
|
3656
3758
|
BlockRenderer,
|
|
3657
3759
|
{
|
|
3658
3760
|
block: currentBlock,
|
|
@@ -3672,7 +3774,7 @@ function DocPlayerContent({
|
|
|
3672
3774
|
},
|
|
3673
3775
|
currentBlock.id
|
|
3674
3776
|
),
|
|
3675
|
-
hasCaptions && (renderMode ? captionsEnabled : true) && /* @__PURE__ */
|
|
3777
|
+
hasCaptions && (renderMode ? captionsEnabled : true) && /* @__PURE__ */ jsx10(
|
|
3676
3778
|
CaptionOverlay,
|
|
3677
3779
|
{
|
|
3678
3780
|
captions: doc.captions,
|
|
@@ -3685,7 +3787,7 @@ function DocPlayerContent({
|
|
|
3685
3787
|
viewport: captionViewport
|
|
3686
3788
|
}
|
|
3687
3789
|
),
|
|
3688
|
-
isDebugMode && /* @__PURE__ */
|
|
3790
|
+
isDebugMode && /* @__PURE__ */ jsxs7(
|
|
3689
3791
|
"div",
|
|
3690
3792
|
{
|
|
3691
3793
|
className: "doc-player__debug",
|
|
@@ -3706,27 +3808,27 @@ function DocPlayerContent({
|
|
|
3706
3808
|
textAlign: "left"
|
|
3707
3809
|
},
|
|
3708
3810
|
children: [
|
|
3709
|
-
/* @__PURE__ */
|
|
3710
|
-
/* @__PURE__ */
|
|
3711
|
-
/* @__PURE__ */
|
|
3811
|
+
/* @__PURE__ */ jsx10("div", { style: { color: "#ffcc00", fontWeight: "bold", marginBottom: "4px" }, children: "DEBUG MODE" }),
|
|
3812
|
+
/* @__PURE__ */ jsxs7("div", { children: [
|
|
3813
|
+
/* @__PURE__ */ jsx10("span", { style: { color: "#888" }, children: "template:" }),
|
|
3712
3814
|
" ",
|
|
3713
|
-
/* @__PURE__ */
|
|
3815
|
+
/* @__PURE__ */ jsx10("span", { style: { color: "#ff6b6b" }, children: currentBlock?.template ?? "raw" })
|
|
3714
3816
|
] }),
|
|
3715
|
-
/* @__PURE__ */
|
|
3716
|
-
/* @__PURE__ */
|
|
3817
|
+
/* @__PURE__ */ jsxs7("div", { children: [
|
|
3818
|
+
/* @__PURE__ */ jsx10("span", { style: { color: "#888" }, children: "block:" }),
|
|
3717
3819
|
" ",
|
|
3718
3820
|
currentBlockIndex + 1,
|
|
3719
3821
|
"/",
|
|
3720
3822
|
expandedBlocks.length,
|
|
3721
3823
|
" ",
|
|
3722
|
-
/* @__PURE__ */
|
|
3824
|
+
/* @__PURE__ */ jsxs7("span", { style: { color: "#666" }, children: [
|
|
3723
3825
|
"(",
|
|
3724
3826
|
currentBlock?.id || "none",
|
|
3725
3827
|
")"
|
|
3726
3828
|
] })
|
|
3727
3829
|
] }),
|
|
3728
|
-
/* @__PURE__ */
|
|
3729
|
-
/* @__PURE__ */
|
|
3830
|
+
/* @__PURE__ */ jsxs7("div", { children: [
|
|
3831
|
+
/* @__PURE__ */ jsx10("span", { style: { color: "#888" }, children: "time:" }),
|
|
3730
3832
|
" ",
|
|
3731
3833
|
currentTime.toFixed(2),
|
|
3732
3834
|
"s /",
|
|
@@ -3734,7 +3836,7 @@ function DocPlayerContent({
|
|
|
3734
3836
|
totalDuration.toFixed(1),
|
|
3735
3837
|
"s",
|
|
3736
3838
|
" ",
|
|
3737
|
-
/* @__PURE__ */
|
|
3839
|
+
/* @__PURE__ */ jsxs7("span", { style: { color: "#666" }, children: [
|
|
3738
3840
|
"(progress: ",
|
|
3739
3841
|
(docProgress * 100).toFixed(1),
|
|
3740
3842
|
"%, scriptDur: ",
|
|
@@ -3742,8 +3844,8 @@ function DocPlayerContent({
|
|
|
3742
3844
|
")"
|
|
3743
3845
|
] })
|
|
3744
3846
|
] }),
|
|
3745
|
-
/* @__PURE__ */
|
|
3746
|
-
/* @__PURE__ */
|
|
3847
|
+
/* @__PURE__ */ jsxs7("div", { children: [
|
|
3848
|
+
/* @__PURE__ */ jsx10("span", { style: { color: "#888" }, children: "blockTime:" }),
|
|
3747
3849
|
" ",
|
|
3748
3850
|
blockTime.toFixed(2),
|
|
3749
3851
|
"s /",
|
|
@@ -3751,58 +3853,58 @@ function DocPlayerContent({
|
|
|
3751
3853
|
(currentBlock?.duration || 0).toFixed(1),
|
|
3752
3854
|
"s"
|
|
3753
3855
|
] }),
|
|
3754
|
-
/* @__PURE__ */
|
|
3755
|
-
/* @__PURE__ */
|
|
3856
|
+
/* @__PURE__ */ jsxs7("div", { children: [
|
|
3857
|
+
/* @__PURE__ */ jsx10("span", { style: { color: "#888" }, children: "segment:" }),
|
|
3756
3858
|
" ",
|
|
3757
3859
|
currentSegment,
|
|
3758
3860
|
"/",
|
|
3759
3861
|
doc.audio.segments.length - 1,
|
|
3760
3862
|
" ",
|
|
3761
|
-
/* @__PURE__ */
|
|
3863
|
+
/* @__PURE__ */ jsxs7("span", { style: { color: "#666" }, children: [
|
|
3762
3864
|
"(",
|
|
3763
3865
|
doc.audio.segments[currentSegment]?.name || "none",
|
|
3764
3866
|
")"
|
|
3765
3867
|
] })
|
|
3766
3868
|
] }),
|
|
3767
|
-
/* @__PURE__ */
|
|
3768
|
-
/* @__PURE__ */
|
|
3869
|
+
/* @__PURE__ */ jsxs7("div", { children: [
|
|
3870
|
+
/* @__PURE__ */ jsx10("span", { style: { color: "#888" }, children: "viewport:" }),
|
|
3769
3871
|
" ",
|
|
3770
3872
|
activeViewport.name || `${activeViewport.width}x${activeViewport.height}`,
|
|
3771
3873
|
" ",
|
|
3772
|
-
/* @__PURE__ */
|
|
3874
|
+
/* @__PURE__ */ jsxs7("span", { style: { color: "#666" }, children: [
|
|
3773
3875
|
"(",
|
|
3774
3876
|
activeOrientation,
|
|
3775
3877
|
")"
|
|
3776
3878
|
] })
|
|
3777
3879
|
] }),
|
|
3778
|
-
/* @__PURE__ */
|
|
3779
|
-
/* @__PURE__ */
|
|
3880
|
+
/* @__PURE__ */ jsxs7("div", { children: [
|
|
3881
|
+
/* @__PURE__ */ jsx10("span", { style: { color: "#888" }, children: "playing:" }),
|
|
3780
3882
|
" ",
|
|
3781
|
-
/* @__PURE__ */
|
|
3782
|
-
showCoverBlock && /* @__PURE__ */
|
|
3883
|
+
/* @__PURE__ */ jsx10("span", { style: { color: isPlaying ? "#4ade80" : "#f87171" }, children: isPlaying ? "yes" : "no" }),
|
|
3884
|
+
showCoverBlock && /* @__PURE__ */ jsx10("span", { style: { color: "#60a5fa" }, children: " (cover)" })
|
|
3783
3885
|
] }),
|
|
3784
3886
|
hasCaptions && (() => {
|
|
3785
3887
|
const debugPhrase = getCaptionAtTime2(doc.captions, currentTime);
|
|
3786
3888
|
const debugEnabled = captionsEnabled && (isPlaying || currentTime > 0);
|
|
3787
|
-
return /* @__PURE__ */
|
|
3788
|
-
/* @__PURE__ */
|
|
3789
|
-
/* @__PURE__ */
|
|
3889
|
+
return /* @__PURE__ */ jsxs7(Fragment4, { children: [
|
|
3890
|
+
/* @__PURE__ */ jsxs7("div", { children: [
|
|
3891
|
+
/* @__PURE__ */ jsx10("span", { style: { color: "#888" }, children: "captions:" }),
|
|
3790
3892
|
" ",
|
|
3791
3893
|
doc.captions?.phrases.length || 0,
|
|
3792
3894
|
" phrases",
|
|
3793
3895
|
" ",
|
|
3794
|
-
/* @__PURE__ */
|
|
3896
|
+
/* @__PURE__ */ jsxs7("span", { style: { color: captionsEnabled ? "#4ade80" : "#666" }, children: [
|
|
3795
3897
|
"(",
|
|
3796
3898
|
captionsEnabled ? "on" : "off",
|
|
3797
3899
|
")"
|
|
3798
3900
|
] })
|
|
3799
3901
|
] }),
|
|
3800
|
-
/* @__PURE__ */
|
|
3801
|
-
/* @__PURE__ */
|
|
3902
|
+
/* @__PURE__ */ jsxs7("div", { children: [
|
|
3903
|
+
/* @__PURE__ */ jsx10("span", { style: { color: "#888" }, children: "cc.enabled:" }),
|
|
3802
3904
|
" ",
|
|
3803
|
-
/* @__PURE__ */
|
|
3905
|
+
/* @__PURE__ */ jsx10("span", { style: { color: debugEnabled ? "#4ade80" : "#f87171" }, children: String(debugEnabled) }),
|
|
3804
3906
|
" ",
|
|
3805
|
-
/* @__PURE__ */
|
|
3907
|
+
/* @__PURE__ */ jsxs7("span", { style: { color: "#666" }, children: [
|
|
3806
3908
|
"(playing=",
|
|
3807
3909
|
String(isPlaying),
|
|
3808
3910
|
" t>0=",
|
|
@@ -3810,15 +3912,15 @@ function DocPlayerContent({
|
|
|
3810
3912
|
")"
|
|
3811
3913
|
] })
|
|
3812
3914
|
] }),
|
|
3813
|
-
/* @__PURE__ */
|
|
3814
|
-
/* @__PURE__ */
|
|
3915
|
+
/* @__PURE__ */ jsxs7("div", { children: [
|
|
3916
|
+
/* @__PURE__ */ jsx10("span", { style: { color: "#888" }, children: "cc.phrase:" }),
|
|
3815
3917
|
" ",
|
|
3816
|
-
/* @__PURE__ */
|
|
3918
|
+
/* @__PURE__ */ jsx10("span", { style: { color: debugPhrase ? "#4ade80" : "#f87171" }, children: debugPhrase ? `"${debugPhrase.text.slice(0, 30)}..."` : "null" })
|
|
3817
3919
|
] }),
|
|
3818
|
-
debugPhrase && /* @__PURE__ */
|
|
3819
|
-
/* @__PURE__ */
|
|
3920
|
+
debugPhrase && /* @__PURE__ */ jsxs7("div", { children: [
|
|
3921
|
+
/* @__PURE__ */ jsx10("span", { style: { color: "#888" }, children: "cc.range:" }),
|
|
3820
3922
|
" ",
|
|
3821
|
-
/* @__PURE__ */
|
|
3923
|
+
/* @__PURE__ */ jsxs7("span", { style: { color: "#60a5fa" }, children: [
|
|
3822
3924
|
debugPhrase.startTime.toFixed(2),
|
|
3823
3925
|
"-",
|
|
3824
3926
|
debugPhrase.endTime.toFixed(2)
|
|
@@ -3830,7 +3932,7 @@ function DocPlayerContent({
|
|
|
3830
3932
|
}
|
|
3831
3933
|
)
|
|
3832
3934
|
] }),
|
|
3833
|
-
!renderMode && !isAvailable && unavailableMessage && /* @__PURE__ */
|
|
3935
|
+
!renderMode && !isAvailable && unavailableMessage && /* @__PURE__ */ jsxs7(
|
|
3834
3936
|
"div",
|
|
3835
3937
|
{
|
|
3836
3938
|
className: "doc-player__unavailable",
|
|
@@ -3851,12 +3953,12 @@ function DocPlayerContent({
|
|
|
3851
3953
|
zIndex: 50
|
|
3852
3954
|
},
|
|
3853
3955
|
children: [
|
|
3854
|
-
/* @__PURE__ */
|
|
3855
|
-
/* @__PURE__ */
|
|
3956
|
+
/* @__PURE__ */ jsx10("span", { style: { fontSize: "32px" }, children: "\u{1F50A}" }),
|
|
3957
|
+
/* @__PURE__ */ jsx10("span", { children: unavailableMessage })
|
|
3856
3958
|
]
|
|
3857
3959
|
}
|
|
3858
3960
|
),
|
|
3859
|
-
!renderMode && !isSlideshowMode && showControls && /* @__PURE__ */
|
|
3961
|
+
!renderMode && !isSlideshowMode && showControls && /* @__PURE__ */ jsx10(
|
|
3860
3962
|
DocControlsOverlay,
|
|
3861
3963
|
{
|
|
3862
3964
|
state: playbackState,
|
|
@@ -3866,7 +3968,7 @@ function DocPlayerContent({
|
|
|
3866
3968
|
getBlockTitle
|
|
3867
3969
|
}
|
|
3868
3970
|
),
|
|
3869
|
-
!renderMode && !isSlideshowMode && !showControls && showScrubber && /* @__PURE__ */
|
|
3971
|
+
!renderMode && !isSlideshowMode && !showControls && showScrubber && /* @__PURE__ */ jsx10(
|
|
3870
3972
|
"div",
|
|
3871
3973
|
{
|
|
3872
3974
|
className: "doc-player__scrubber",
|
|
@@ -3881,7 +3983,7 @@ function DocPlayerContent({
|
|
|
3881
3983
|
alignItems: "center",
|
|
3882
3984
|
zIndex: 100
|
|
3883
3985
|
},
|
|
3884
|
-
children: /* @__PURE__ */
|
|
3986
|
+
children: /* @__PURE__ */ jsx10(
|
|
3885
3987
|
DocProgressBar,
|
|
3886
3988
|
{
|
|
3887
3989
|
state: playbackState,
|
|
@@ -3893,7 +3995,7 @@ function DocPlayerContent({
|
|
|
3893
3995
|
)
|
|
3894
3996
|
}
|
|
3895
3997
|
),
|
|
3896
|
-
!renderMode && isSlideshowMode && showControls && /* @__PURE__ */
|
|
3998
|
+
!renderMode && isSlideshowMode && showControls && /* @__PURE__ */ jsx10(
|
|
3897
3999
|
DocControlsSlideshow,
|
|
3898
4000
|
{
|
|
3899
4001
|
state: playbackState,
|
|
@@ -3903,14 +4005,14 @@ function DocPlayerContent({
|
|
|
3903
4005
|
onPickerOpenChange: setIsSlideshowPickerOpen
|
|
3904
4006
|
}
|
|
3905
4007
|
),
|
|
3906
|
-
!isSlideshowMode && tapFeedback && /* @__PURE__ */
|
|
4008
|
+
!isSlideshowMode && tapFeedback && /* @__PURE__ */ jsx10("div", { className: "doc-player__tap-feedback", children: /* @__PURE__ */ jsx10("svg", { viewBox: "0 0 24 24", fill: "white", width: "48", height: "48", children: tapFeedback === "pause" ? /* @__PURE__ */ jsx10("path", { d: "M6 19h4V5H6v14zm8-14v14h4V5h-4z" }) : /* @__PURE__ */ jsx10("path", { d: "M8 5v14l11-7z" }) }) }, tapFeedback)
|
|
3907
4009
|
]
|
|
3908
4010
|
}
|
|
3909
4011
|
);
|
|
3910
4012
|
}
|
|
3911
4013
|
|
|
3912
4014
|
// src/DocControlsBottom.tsx
|
|
3913
|
-
import { jsx as
|
|
4015
|
+
import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
3914
4016
|
function DocControlsBottom({
|
|
3915
4017
|
state,
|
|
3916
4018
|
actions,
|
|
@@ -3918,32 +4020,34 @@ function DocControlsBottom({
|
|
|
3918
4020
|
expandedBlocks,
|
|
3919
4021
|
getBlockTitle
|
|
3920
4022
|
}) {
|
|
3921
|
-
return /* @__PURE__ */
|
|
3922
|
-
/* @__PURE__ */
|
|
4023
|
+
return /* @__PURE__ */ jsxs8("div", { className: "doc-controls-bottom", children: [
|
|
4024
|
+
/* @__PURE__ */ jsx11(
|
|
3923
4025
|
"button",
|
|
3924
4026
|
{
|
|
3925
4027
|
className: "bottom-ctrl-btn",
|
|
3926
4028
|
onClick: actions.restart,
|
|
3927
4029
|
title: "Restart",
|
|
3928
4030
|
"aria-label": "Restart from beginning",
|
|
3929
|
-
children: /* @__PURE__ */
|
|
4031
|
+
children: /* @__PURE__ */ jsx11("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "18", height: "18", children: /* @__PURE__ */ jsx11("path", { d: "M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z" }) })
|
|
3930
4032
|
}
|
|
3931
4033
|
),
|
|
3932
|
-
/* @__PURE__ */
|
|
4034
|
+
/* @__PURE__ */ jsx11(
|
|
3933
4035
|
"button",
|
|
3934
4036
|
{
|
|
3935
4037
|
className: "bottom-ctrl-btn bottom-play-btn",
|
|
3936
4038
|
onClick: actions.toggle,
|
|
3937
4039
|
"aria-label": state.isPlaying ? "Pause" : "Play",
|
|
3938
|
-
|
|
4040
|
+
"aria-busy": state.isPlaying && state.isBuffering ? true : void 0,
|
|
4041
|
+
title: state.isPlaying && state.isBuffering ? "Loading audio\u2026" : void 0,
|
|
4042
|
+
children: /* @__PURE__ */ jsx11(PlayPauseIcon, { isPlaying: state.isPlaying, isBuffering: state.isBuffering, size: 20 })
|
|
3939
4043
|
}
|
|
3940
4044
|
),
|
|
3941
|
-
/* @__PURE__ */
|
|
4045
|
+
/* @__PURE__ */ jsxs8("span", { className: "bottom-time", children: [
|
|
3942
4046
|
formatTime(state.currentTime),
|
|
3943
4047
|
" / ",
|
|
3944
4048
|
formatTime(state.totalDuration)
|
|
3945
4049
|
] }),
|
|
3946
|
-
/* @__PURE__ */
|
|
4050
|
+
/* @__PURE__ */ jsx11(
|
|
3947
4051
|
DocProgressBar,
|
|
3948
4052
|
{
|
|
3949
4053
|
state,
|
|
@@ -3953,84 +4057,86 @@ function DocControlsBottom({
|
|
|
3953
4057
|
getBlockTitle
|
|
3954
4058
|
}
|
|
3955
4059
|
),
|
|
3956
|
-
/* @__PURE__ */
|
|
4060
|
+
/* @__PURE__ */ jsxs8("span", { className: "bottom-segment", children: [
|
|
3957
4061
|
state.currentBlockIndex + 1,
|
|
3958
4062
|
"/",
|
|
3959
4063
|
state.totalBlocks
|
|
3960
4064
|
] }),
|
|
3961
|
-
state.hasCaptions && /* @__PURE__ */
|
|
4065
|
+
state.hasCaptions && /* @__PURE__ */ jsx11(
|
|
3962
4066
|
"button",
|
|
3963
4067
|
{
|
|
3964
4068
|
className: `bottom-ctrl-btn ${state.captionMode !== "off" ? "bottom-ctrl-btn--active" : ""}`,
|
|
3965
4069
|
onClick: () => actions.cycleCaptionMode(),
|
|
3966
4070
|
title: state.captionMode === "off" ? "Captions: Off" : state.captionMode === "standard" ? "Captions: Standard" : "Captions: Social",
|
|
3967
4071
|
"aria-label": "Cycle caption style",
|
|
3968
|
-
children: /* @__PURE__ */
|
|
4072
|
+
children: /* @__PURE__ */ jsx11("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "18", height: "18", children: /* @__PURE__ */ jsx11("path", { d: "M19 4H5a2 2 0 00-2 2v12a2 2 0 002 2h14a2 2 0 002-2V6a2 2 0 00-2-2zm-8 7H9.5v-.5h-2v3h2V13H11v1a1 1 0 01-1 1H7a1 1 0 01-1-1v-4a1 1 0 011-1h3a1 1 0 011 1v1zm7 0h-1.5v-.5h-2v3h2V13H18v1a1 1 0 01-1 1h-3a1 1 0 01-1-1v-4a1 1 0 011-1h3a1 1 0 011 1v1z" }) })
|
|
3969
4073
|
}
|
|
3970
4074
|
),
|
|
3971
|
-
actions.toggleFullscreen && /* @__PURE__ */
|
|
4075
|
+
actions.toggleFullscreen && /* @__PURE__ */ jsx11(
|
|
3972
4076
|
"button",
|
|
3973
4077
|
{
|
|
3974
4078
|
className: `bottom-ctrl-btn ${state.isFullscreen ? "bottom-ctrl-btn--active" : ""}`,
|
|
3975
4079
|
onClick: actions.toggleFullscreen,
|
|
3976
4080
|
title: state.isFullscreen ? "Exit fullscreen (F)" : "Fullscreen (F)",
|
|
3977
4081
|
"aria-label": state.isFullscreen ? "Exit fullscreen" : "Enter fullscreen",
|
|
3978
|
-
children: state.isFullscreen ? /* @__PURE__ */
|
|
4082
|
+
children: state.isFullscreen ? /* @__PURE__ */ jsx11("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "18", height: "18", children: /* @__PURE__ */ jsx11("path", { d: "M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z" }) }) : /* @__PURE__ */ jsx11("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "18", height: "18", children: /* @__PURE__ */ jsx11("path", { d: "M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z" }) })
|
|
3979
4083
|
}
|
|
3980
4084
|
)
|
|
3981
4085
|
] });
|
|
3982
4086
|
}
|
|
3983
4087
|
|
|
3984
4088
|
// src/DocControlsSidebar.tsx
|
|
3985
|
-
import { jsx as
|
|
4089
|
+
import { jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
3986
4090
|
function DocControlsSidebar({ state, actions }) {
|
|
3987
|
-
return /* @__PURE__ */
|
|
3988
|
-
/* @__PURE__ */
|
|
4091
|
+
return /* @__PURE__ */ jsxs9("div", { className: "doc-controls-sidebar", children: [
|
|
4092
|
+
/* @__PURE__ */ jsx12(
|
|
3989
4093
|
"button",
|
|
3990
4094
|
{
|
|
3991
4095
|
className: "sidebar-ctrl-btn",
|
|
3992
4096
|
onClick: actions.restart,
|
|
3993
4097
|
title: "Restart",
|
|
3994
4098
|
"aria-label": "Restart from beginning",
|
|
3995
|
-
children: /* @__PURE__ */
|
|
4099
|
+
children: /* @__PURE__ */ jsx12("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "20", height: "20", children: /* @__PURE__ */ jsx12("path", { d: "M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z" }) })
|
|
3996
4100
|
}
|
|
3997
4101
|
),
|
|
3998
|
-
/* @__PURE__ */
|
|
4102
|
+
/* @__PURE__ */ jsx12(
|
|
3999
4103
|
"button",
|
|
4000
4104
|
{
|
|
4001
4105
|
className: "sidebar-ctrl-btn sidebar-play-btn",
|
|
4002
4106
|
onClick: actions.toggle,
|
|
4003
4107
|
"aria-label": state.isPlaying ? "Pause" : "Play",
|
|
4004
|
-
|
|
4108
|
+
"aria-busy": state.isPlaying && state.isBuffering ? true : void 0,
|
|
4109
|
+
title: state.isPlaying && state.isBuffering ? "Loading audio\u2026" : void 0,
|
|
4110
|
+
children: /* @__PURE__ */ jsx12(PlayPauseIcon, { isPlaying: state.isPlaying, isBuffering: state.isBuffering, size: 22 })
|
|
4005
4111
|
}
|
|
4006
4112
|
),
|
|
4007
|
-
/* @__PURE__ */
|
|
4008
|
-
/* @__PURE__ */
|
|
4009
|
-
/* @__PURE__ */
|
|
4113
|
+
/* @__PURE__ */ jsxs9("div", { className: "sidebar-time", children: [
|
|
4114
|
+
/* @__PURE__ */ jsx12("div", { children: formatTime(state.currentTime) }),
|
|
4115
|
+
/* @__PURE__ */ jsx12("div", { className: "sidebar-time-total", children: formatTime(state.totalDuration) })
|
|
4010
4116
|
] }),
|
|
4011
|
-
/* @__PURE__ */
|
|
4117
|
+
/* @__PURE__ */ jsxs9("div", { className: "sidebar-segment", children: [
|
|
4012
4118
|
state.currentBlockIndex + 1,
|
|
4013
4119
|
"/",
|
|
4014
4120
|
state.totalBlocks
|
|
4015
4121
|
] }),
|
|
4016
|
-
state.hasCaptions && /* @__PURE__ */
|
|
4122
|
+
state.hasCaptions && /* @__PURE__ */ jsx12(
|
|
4017
4123
|
"button",
|
|
4018
4124
|
{
|
|
4019
4125
|
className: `sidebar-ctrl-btn ${state.captionMode !== "off" ? "sidebar-ctrl-btn--active" : ""}`,
|
|
4020
4126
|
onClick: () => actions.cycleCaptionMode(),
|
|
4021
4127
|
title: state.captionMode === "off" ? "Captions: Off" : state.captionMode === "standard" ? "Captions: Standard" : "Captions: Social",
|
|
4022
4128
|
"aria-label": "Cycle caption style",
|
|
4023
|
-
children: /* @__PURE__ */
|
|
4129
|
+
children: /* @__PURE__ */ jsx12("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "20", height: "20", children: /* @__PURE__ */ jsx12("path", { d: "M19 4H5a2 2 0 00-2 2v12a2 2 0 002 2h14a2 2 0 002-2V6a2 2 0 00-2-2zm-8 7H9.5v-.5h-2v3h2V13H11v1a1 1 0 01-1 1H7a1 1 0 01-1-1v-4a1 1 0 011-1h3a1 1 0 011 1v1zm7 0h-1.5v-.5h-2v3h2V13H18v1a1 1 0 01-1 1h-3a1 1 0 01-1-1v-4a1 1 0 011-1h3a1 1 0 011 1v1z" }) })
|
|
4024
4130
|
}
|
|
4025
4131
|
),
|
|
4026
|
-
actions.toggleFullscreen && /* @__PURE__ */
|
|
4132
|
+
actions.toggleFullscreen && /* @__PURE__ */ jsx12(
|
|
4027
4133
|
"button",
|
|
4028
4134
|
{
|
|
4029
4135
|
className: `sidebar-ctrl-btn ${state.isFullscreen ? "sidebar-ctrl-btn--active" : ""}`,
|
|
4030
4136
|
onClick: actions.toggleFullscreen,
|
|
4031
4137
|
title: state.isFullscreen ? "Exit fullscreen (F)" : "Fullscreen (F)",
|
|
4032
4138
|
"aria-label": state.isFullscreen ? "Exit fullscreen" : "Enter fullscreen",
|
|
4033
|
-
children: state.isFullscreen ? /* @__PURE__ */
|
|
4139
|
+
children: state.isFullscreen ? /* @__PURE__ */ jsx12("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "20", height: "20", children: /* @__PURE__ */ jsx12("path", { d: "M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z" }) }) : /* @__PURE__ */ jsx12("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "20", height: "20", children: /* @__PURE__ */ jsx12("path", { d: "M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z" }) })
|
|
4034
4140
|
}
|
|
4035
4141
|
)
|
|
4036
4142
|
] });
|
|
@@ -4038,7 +4144,7 @@ function DocControlsSidebar({ state, actions }) {
|
|
|
4038
4144
|
|
|
4039
4145
|
// src/DocPlayerWithSidebar.tsx
|
|
4040
4146
|
import { useRef as useRef8, useState as useState7, useCallback as useCallback6, useEffect as useEffect8 } from "react";
|
|
4041
|
-
import { jsx as
|
|
4147
|
+
import { jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
4042
4148
|
var DEFAULT_STATE = {
|
|
4043
4149
|
isPlaying: false,
|
|
4044
4150
|
currentTime: 0,
|
|
@@ -4100,8 +4206,8 @@ function DocPlayerWithSidebar({
|
|
|
4100
4206
|
}, 250);
|
|
4101
4207
|
return () => clearInterval(interval);
|
|
4102
4208
|
}, []);
|
|
4103
|
-
return /* @__PURE__ */
|
|
4104
|
-
/* @__PURE__ */
|
|
4209
|
+
return /* @__PURE__ */ jsxs10("div", { className: "doc-player-sidebar-layout", children: [
|
|
4210
|
+
/* @__PURE__ */ jsx13("div", { className: "doc-player-sidebar-layout__video", children: /* @__PURE__ */ jsx13(
|
|
4105
4211
|
DocPlayer,
|
|
4106
4212
|
{
|
|
4107
4213
|
doc,
|
|
@@ -4124,7 +4230,7 @@ function DocPlayerWithSidebar({
|
|
|
4124
4230
|
forceViewport
|
|
4125
4231
|
}
|
|
4126
4232
|
) }),
|
|
4127
|
-
actionsRef.current && /* @__PURE__ */
|
|
4233
|
+
actionsRef.current && /* @__PURE__ */ jsx13(DocControlsSidebar, { state: stateRef.current, actions: actionsRef.current })
|
|
4128
4234
|
] });
|
|
4129
4235
|
}
|
|
4130
4236
|
|