@jswork/react-questkit 1.0.4 → 1.0.5

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.mjs CHANGED
@@ -2544,11 +2544,12 @@ function LinkMatchFeedback({
2544
2544
  function pairKey(left, right) {
2545
2545
  return `${left}-${right}`;
2546
2546
  }
2547
- function inferKind(items) {
2548
- const first = items[0];
2549
- if (!first) return "text";
2550
- if (first.image || first.art) return "image";
2551
- if (!first.text && first.audio) return "audio";
2547
+ function nodeKind(node, legacyKind) {
2548
+ if (legacyKind) return legacyKind;
2549
+ if (!node) return "text";
2550
+ if (node.image || node.art) return "image";
2551
+ if (node.text !== void 0) return "text";
2552
+ if (node.audio) return "audio";
2552
2553
  return "text";
2553
2554
  }
2554
2555
  function nodeLabel(node, kind, nodeIndex) {
@@ -2559,9 +2560,9 @@ function nodeLabel(node, kind, nodeIndex) {
2559
2560
  if (kind === "audio") return `\u64AD\u653E\u97F3\u9891 ${nodeIndex + 1}`;
2560
2561
  return typeof node.text === "string" ? node.text : void 0;
2561
2562
  }
2562
- function boardKind(leftKind, rightKind) {
2563
- if (leftKind === "image" || rightKind === "image") return "image";
2564
- if (leftKind === "audio" || rightKind === "audio") return "audio";
2563
+ function boardKindOf(kinds) {
2564
+ if (kinds.includes("image")) return "image";
2565
+ if (kinds.includes("audio")) return "audio";
2565
2566
  return "text";
2566
2567
  }
2567
2568
  function nodeOk(data, side, nodeIndex) {
@@ -2571,7 +2572,7 @@ function nodeOk(data, side, nodeIndex) {
2571
2572
  }
2572
2573
 
2573
2574
  // src/questions/link-match/link-node.tsx
2574
- import { Fragment as Fragment5, jsx as jsx27, jsxs as jsxs19 } from "react/jsx-runtime";
2575
+ import { jsx as jsx27, jsxs as jsxs19 } from "react/jsx-runtime";
2575
2576
  var BARS = [8, 14, 20, 10, 24, 16, 9, 18, 12];
2576
2577
  function LinkNode({
2577
2578
  side,
@@ -2626,15 +2627,15 @@ function LinkNode({
2626
2627
  ] }) : kind === "audio" ? /* @__PURE__ */ jsxs19("span", { className: "rqk-link-node-audio", children: [
2627
2628
  /* @__PURE__ */ jsx27("span", { className: "rqk-link-node-audio-icon", "aria-hidden": true, children: /* @__PURE__ */ jsx27("span", { className: "rqk-link-node-audio-triangle" }) }),
2628
2629
  /* @__PURE__ */ jsx27("span", { className: "rqk-link-node-wave", "aria-hidden": true, children: BARS.map((height, barIndex) => /* @__PURE__ */ jsx27("span", { style: { height } }, barIndex)) })
2629
- ] }) : /* @__PURE__ */ jsxs19(Fragment5, { children: [
2630
- /* @__PURE__ */ jsx27("span", { className: "rqk-link-node-text", children: node.text }),
2631
- node.phonetic ? /* @__PURE__ */ jsx27("span", { className: "rqk-link-node-sub", children: node.phonetic }) : null,
2632
- node.speak || node.audio ? /* @__PURE__ */ jsxs19("span", { className: "rqk-link-node-sound", "aria-hidden": true, children: [
2633
- /* @__PURE__ */ jsx27("span", {}),
2634
- /* @__PURE__ */ jsx27("span", {}),
2635
- /* @__PURE__ */ jsx27("span", {})
2636
- ] }) : null
2630
+ ] }) : /* @__PURE__ */ jsxs19("span", { className: "rqk-link-node-text", children: [
2631
+ /* @__PURE__ */ jsx27("span", { className: "rqk-link-node-word", children: node.text }),
2632
+ node.phonetic ? /* @__PURE__ */ jsx27("span", { className: "rqk-link-node-sub", children: node.phonetic }) : null
2637
2633
  ] }),
2634
+ kind !== "audio" && node.audio ? /* @__PURE__ */ jsxs19("span", { className: "rqk-link-node-sound", "aria-hidden": true, children: [
2635
+ /* @__PURE__ */ jsx27("span", {}),
2636
+ /* @__PURE__ */ jsx27("span", {}),
2637
+ /* @__PURE__ */ jsx27("span", {})
2638
+ ] }) : null,
2638
2639
  /* @__PURE__ */ jsx27("span", { className: "rqk-link-dot", "aria-hidden": true })
2639
2640
  ]
2640
2641
  }
@@ -2645,8 +2646,8 @@ function LinkNode({
2645
2646
  import { jsx as jsx28, jsxs as jsxs20 } from "react/jsx-runtime";
2646
2647
  function LinkBoard({
2647
2648
  data,
2648
- leftKind,
2649
- rightKind,
2649
+ leftKinds,
2650
+ rightKinds,
2650
2651
  boardHeightKind,
2651
2652
  boardRef,
2652
2653
  leftRefs,
@@ -2681,18 +2682,16 @@ function LinkBoard({
2681
2682
  path.key
2682
2683
  )) }),
2683
2684
  ["left", "right"].map((side) => {
2684
- const kind = side === "left" ? leftKind : rightKind;
2685
+ const kinds = side === "left" ? leftKinds : rightKinds;
2685
2686
  const nodes = side === "left" ? data.left : data.right;
2686
2687
  const refs = side === "left" ? leftRefs : rightRefs;
2687
2688
  return /* @__PURE__ */ jsx28(
2688
2689
  "div",
2689
2690
  {
2690
- className: classNames(
2691
- "rqk-link-column",
2692
- `rqk-link-column-${side}`,
2693
- `rqk-link-column-${kind}`
2694
- ),
2691
+ className: classNames("rqk-link-column", `rqk-link-column-${side}`),
2695
2692
  children: nodes.map((node, nodeIndex) => {
2693
+ var _a;
2694
+ const kind = (_a = kinds[nodeIndex]) != null ? _a : "text";
2696
2695
  const linked = shownPairs.some(
2697
2696
  ([left, right]) => side === "left" ? left === nodeIndex : right === nodeIndex
2698
2697
  );
@@ -2729,52 +2728,46 @@ function LinkBoard({
2729
2728
 
2730
2729
  // src/questions/link-match/use-link-audio.ts
2731
2730
  import { useEffect as useEffect9, useRef as useRef9, useState as useState12 } from "react";
2731
+ var MIN_PLAYING_MS = 500;
2732
2732
  function useLinkAudio(data) {
2733
- const config = useQuestConfig();
2734
2733
  const [playing, setPlaying] = useState12(null);
2735
2734
  const audioRef = useRef9(null);
2735
+ const playToken = useRef9(0);
2736
2736
  const speakNode = (side, nodeIndex) => {
2737
- var _a, _b, _c;
2737
+ var _a;
2738
2738
  const node = (side === "left" ? data.left : data.right)[nodeIndex];
2739
- if (!node) return;
2739
+ if (!(node == null ? void 0 : node.audio)) return;
2740
+ const token = ++playToken.current;
2740
2741
  (_a = audioRef.current) == null ? void 0 : _a.pause();
2741
2742
  audioRef.current = null;
2742
- if (node.audio) {
2743
- try {
2744
- const audio = new Audio(node.audio);
2745
- audioRef.current = audio;
2746
- const clear = () => {
2743
+ try {
2744
+ const audio = new Audio(node.audio);
2745
+ audioRef.current = audio;
2746
+ const startedAt = Date.now();
2747
+ const clear = (immediate = false) => {
2748
+ if (playToken.current !== token) return;
2749
+ const remaining = immediate ? 0 : Math.max(0, MIN_PLAYING_MS - (Date.now() - startedAt));
2750
+ window.setTimeout(() => {
2751
+ if (playToken.current !== token) return;
2747
2752
  if (audioRef.current === audio) audioRef.current = null;
2748
2753
  setPlaying(
2749
2754
  (current) => (current == null ? void 0 : current.side) === side && current.index === nodeIndex ? null : current
2750
2755
  );
2751
- };
2752
- audio.onended = clear;
2753
- audio.onerror = clear;
2754
- setPlaying({ side, index: nodeIndex });
2755
- const played = audio.play();
2756
- if (played && typeof played.catch === "function") void played.catch(clear);
2757
- } catch (e) {
2758
- setPlaying(null);
2759
- }
2760
- return;
2761
- }
2762
- if (node.speak) {
2763
- const text = (_b = node.spokenText) != null ? _b : typeof node.text === "string" ? node.text : "";
2764
- if (!text) return;
2756
+ }, remaining);
2757
+ };
2758
+ audio.onended = () => clear();
2759
+ audio.onerror = () => clear(true);
2765
2760
  setPlaying({ side, index: nodeIndex });
2766
- try {
2767
- void Promise.resolve(((_c = config.speakText) != null ? _c : speakWithSynthesis)(text)).finally(
2768
- () => setPlaying(null)
2769
- );
2770
- } catch (e) {
2771
- setPlaying(null);
2772
- }
2761
+ const played = audio.play();
2762
+ if (played && typeof played.catch === "function") void played.catch(() => clear(true));
2763
+ } catch (e) {
2764
+ if (playToken.current === token) setPlaying(null);
2773
2765
  }
2774
2766
  };
2775
2767
  useEffect9(
2776
2768
  () => () => {
2777
2769
  var _a;
2770
+ playToken.current += 1;
2778
2771
  (_a = audioRef.current) == null ? void 0 : _a.pause();
2779
2772
  audioRef.current = null;
2780
2773
  },
@@ -2858,12 +2851,12 @@ function useLinkPairs({
2858
2851
  onSubmit,
2859
2852
  sound,
2860
2853
  demoAttempt,
2861
- leftKind,
2862
- rightKind,
2863
2854
  speakNode
2864
2855
  }) {
2865
2856
  var _a;
2866
2857
  const readonly = isReadonly(mode);
2858
+ const totalPairs = Math.min(data.left.length, data.right.length);
2859
+ const hasAnswer = data.pairs.length > 0;
2867
2860
  const expected = useMemo4(
2868
2861
  () => new Set(data.pairs.map(([left, right]) => pairKey(left, right))),
2869
2862
  [data.pairs]
@@ -2871,19 +2864,17 @@ function useLinkPairs({
2871
2864
  const [pairs, setPairs] = useState14([]);
2872
2865
  const [selection, setSelection] = useState14(null);
2873
2866
  const judge = useJudge({
2874
- evaluate: () => pairs.length === data.pairs.length && pairs.every(([left, right]) => expected.has(pairKey(left, right))),
2867
+ evaluate: () => pairs.length === totalPairs && (!hasAnswer || pairs.every(([left, right]) => expected.has(pairKey(left, right)))),
2875
2868
  onFirstWrong: () => setPairs((current) => current.filter(([left, right]) => expected.has(pairKey(left, right)))),
2876
2869
  sound,
2877
2870
  demoAttempt
2878
2871
  });
2879
2872
  const frozen = readonly || judge.phase === "correct" || judge.phase === "locked";
2880
2873
  const shownPairs = readonly ? data.pairs : pairs;
2881
- const complete = pairs.length === data.pairs.length;
2874
+ const complete = pairs.length === totalPairs;
2882
2875
  const handleNode = (side, nodeIndex) => {
2883
2876
  const node = (side === "left" ? data.left : data.right)[nodeIndex];
2884
- if (projectKind(side, leftKind, rightKind) === "audio" || (node == null ? void 0 : node.audio)) {
2885
- speakNode(side, nodeIndex);
2886
- }
2877
+ if (node == null ? void 0 : node.audio) speakNode(side, nodeIndex);
2887
2878
  if (frozen) return;
2888
2879
  if (sound !== false) questSfx.tick();
2889
2880
  const existing = pairs.find(
@@ -2934,15 +2925,13 @@ function useLinkPairs({
2934
2925
  readonly,
2935
2926
  selection,
2936
2927
  shownPairs,
2937
- pairs
2928
+ pairs,
2929
+ totalPairs
2938
2930
  };
2939
2931
  }
2940
- function projectKind(side, leftKind, rightKind) {
2941
- return side === "left" ? leftKind : rightKind;
2942
- }
2943
2932
 
2944
2933
  // src/questions/link-match/index.tsx
2945
- import { Fragment as Fragment6, jsx as jsx29, jsxs as jsxs21 } from "react/jsx-runtime";
2934
+ import { Fragment as Fragment5, jsx as jsx29, jsxs as jsxs21 } from "react/jsx-runtime";
2946
2935
  function LinkMatch({
2947
2936
  data,
2948
2937
  mode = "answer",
@@ -2958,11 +2947,10 @@ function LinkMatch({
2958
2947
  demoAttempt,
2959
2948
  className
2960
2949
  }) {
2961
- var _a, _b;
2962
2950
  const labels = useQuestLabels();
2963
- const leftKind = (_a = data.leftKind) != null ? _a : inferKind(data.left);
2964
- const rightKind = (_b = data.rightKind) != null ? _b : inferKind(data.right);
2965
- const boardHeightKind = boardKind(leftKind, rightKind);
2951
+ const leftKinds = data.left.map((node) => nodeKind(node, data.leftKind));
2952
+ const rightKinds = data.right.map((node) => nodeKind(node, data.rightKind));
2953
+ const boardHeightKind = boardKindOf([...leftKinds, ...rightKinds]);
2966
2954
  const audio = useLinkAudio(data);
2967
2955
  const pairs = useLinkPairs({
2968
2956
  data,
@@ -2970,8 +2958,6 @@ function LinkMatch({
2970
2958
  onSubmit,
2971
2959
  sound,
2972
2960
  demoAttempt,
2973
- leftKind,
2974
- rightKind,
2975
2961
  speakNode: audio.speakNode
2976
2962
  });
2977
2963
  const geometry = useLinkGeometry({
@@ -2986,7 +2972,7 @@ function LinkMatch({
2986
2972
  labels,
2987
2973
  complete: pairs.complete,
2988
2974
  pairCount: pairs.pairs.length,
2989
- totalPairs: data.pairs.length,
2975
+ totalPairs: pairs.totalPairs,
2990
2976
  onNext,
2991
2977
  onSubmit: pairs.handleSubmit,
2992
2978
  onRetry: pairs.judge.retry
@@ -3013,14 +2999,14 @@ function LinkMatch({
3013
2999
  }
3014
3000
  ),
3015
3001
  footer: /* @__PURE__ */ jsx29(ActionBar, { actions, index, total, onPrev }),
3016
- children: /* @__PURE__ */ jsxs21(Fragment6, { children: [
3002
+ children: /* @__PURE__ */ jsxs21(Fragment5, { children: [
3017
3003
  data.hint ? /* @__PURE__ */ jsx29("div", { className: "rqk-link-hint", children: data.hint }) : null,
3018
3004
  /* @__PURE__ */ jsx29(
3019
3005
  LinkBoard,
3020
3006
  {
3021
3007
  data,
3022
- leftKind,
3023
- rightKind,
3008
+ leftKinds,
3009
+ rightKinds,
3024
3010
  boardHeightKind,
3025
3011
  boardRef: geometry.boardRef,
3026
3012
  leftRefs: geometry.leftRefs,
@@ -3219,7 +3205,7 @@ function RearrangeSlots({
3219
3205
  }
3220
3206
 
3221
3207
  // src/questions/rearrange/rearrange-page.tsx
3222
- import { Fragment as Fragment7, jsx as jsx34, jsxs as jsxs25 } from "react/jsx-runtime";
3208
+ import { Fragment as Fragment6, jsx as jsx34, jsxs as jsxs25 } from "react/jsx-runtime";
3223
3209
  function RearrangePage({
3224
3210
  data,
3225
3211
  slots,
@@ -3233,7 +3219,7 @@ function RearrangePage({
3233
3219
  onSlot,
3234
3220
  onPick
3235
3221
  }) {
3236
- return /* @__PURE__ */ jsxs25(Fragment7, { children: [
3222
+ return /* @__PURE__ */ jsxs25(Fragment6, { children: [
3237
3223
  /* @__PURE__ */ jsx34(
3238
3224
  RearrangeSlots,
3239
3225
  {
@@ -3426,7 +3412,7 @@ function useRearrange({
3426
3412
  }
3427
3413
 
3428
3414
  // src/questions/rearrange/index.tsx
3429
- import { Fragment as Fragment8, jsx as jsx35, jsxs as jsxs26 } from "react/jsx-runtime";
3415
+ import { Fragment as Fragment7, jsx as jsx35, jsxs as jsxs26 } from "react/jsx-runtime";
3430
3416
  function Rearrange({
3431
3417
  data,
3432
3418
  mode = "answer",
@@ -3459,11 +3445,11 @@ function Rearrange({
3459
3445
  title: title != null ? title : data.kind === "word" ? "\u5355\u8BCD\u91CD\u7EC4" : "\u53E5\u5B50\u91CD\u7EC4",
3460
3446
  index,
3461
3447
  total,
3462
- instruction: instruction != null ? instruction : data.kind === "word" ? /* @__PURE__ */ jsxs26(Fragment8, { children: [
3448
+ instruction: instruction != null ? instruction : data.kind === "word" ? /* @__PURE__ */ jsxs26(Fragment7, { children: [
3463
3449
  "\u6309\u5B57\u6BCD\u987A\u5E8F\u586B\u5165",
3464
3450
  /* @__PURE__ */ jsx35("b", { children: "\u6A2A\u7EBF" }),
3465
3451
  "\uFF0C\u62FC\u51FA\u5355\u8BCD"
3466
- ] }) : /* @__PURE__ */ jsxs26(Fragment8, { children: [
3452
+ ] }) : /* @__PURE__ */ jsxs26(Fragment7, { children: [
3467
3453
  "\u6309\u6B63\u786E\u987A\u5E8F\u628A\u8BCD\u5757\u586B\u5165",
3468
3454
  /* @__PURE__ */ jsx35("b", { children: "\u6A2A\u7EBF" }),
3469
3455
  "\uFF0C\u62FC\u51FA\u53E5\u5B50"
@@ -3616,7 +3602,7 @@ function ClassifyCategory({
3616
3602
  }
3617
3603
 
3618
3604
  // src/questions/classify/classify-page.tsx
3619
- import { Fragment as Fragment9, jsx as jsx38, jsxs as jsxs29 } from "react/jsx-runtime";
3605
+ import { Fragment as Fragment8, jsx as jsx38, jsxs as jsxs29 } from "react/jsx-runtime";
3620
3606
  function ClassifyPage({
3621
3607
  data,
3622
3608
  placed,
@@ -3628,7 +3614,7 @@ function ClassifyPage({
3628
3614
  onUnplace,
3629
3615
  onPick
3630
3616
  }) {
3631
- return /* @__PURE__ */ jsxs29(Fragment9, { children: [
3617
+ return /* @__PURE__ */ jsxs29(Fragment8, { children: [
3632
3618
  data.categories.map((category, categoryIndex) => /* @__PURE__ */ jsx38(
3633
3619
  ClassifyCategory,
3634
3620
  {
@@ -3774,7 +3760,7 @@ function useClassify({
3774
3760
  }
3775
3761
 
3776
3762
  // src/questions/classify/index.tsx
3777
- import { Fragment as Fragment10, jsx as jsx40, jsxs as jsxs30 } from "react/jsx-runtime";
3763
+ import { Fragment as Fragment9, jsx as jsx40, jsxs as jsxs30 } from "react/jsx-runtime";
3778
3764
  function Classify({
3779
3765
  data,
3780
3766
  mode = "answer",
@@ -3807,7 +3793,7 @@ function Classify({
3807
3793
  title: title != null ? title : "\u5206\u7C7B\u9898",
3808
3794
  index,
3809
3795
  total,
3810
- instruction: instruction != null ? instruction : /* @__PURE__ */ jsxs30(Fragment10, { children: [
3796
+ instruction: instruction != null ? instruction : /* @__PURE__ */ jsxs30(Fragment9, { children: [
3811
3797
  "\u628A\u5355\u8BCD\u70B9\u9009\u5230",
3812
3798
  /* @__PURE__ */ jsx40("b", { children: "\u6B63\u786E\u7684\u7C7B\u522B" })
3813
3799
  ] }),
@@ -4022,7 +4008,7 @@ function useRewrite({
4022
4008
  }
4023
4009
 
4024
4010
  // src/questions/rewrite/index.tsx
4025
- import { Fragment as Fragment11, jsx as jsx44, jsxs as jsxs33 } from "react/jsx-runtime";
4011
+ import { Fragment as Fragment10, jsx as jsx44, jsxs as jsxs33 } from "react/jsx-runtime";
4026
4012
  function Rewrite({
4027
4013
  data,
4028
4014
  mode = "answer",
@@ -4070,7 +4056,7 @@ function Rewrite({
4070
4056
  }
4071
4057
  ),
4072
4058
  footer: /* @__PURE__ */ jsx44(ActionBar, { actions, index, total, onPrev }),
4073
- children: /* @__PURE__ */ jsxs33(Fragment11, { children: [
4059
+ children: /* @__PURE__ */ jsxs33(Fragment10, { children: [
4074
4060
  /* @__PURE__ */ jsx44(
4075
4061
  RewriteAnswerCard,
4076
4062
  {
@@ -4307,7 +4293,7 @@ function useFillBlank({
4307
4293
  }
4308
4294
 
4309
4295
  // src/questions/fill-blank/index.tsx
4310
- import { Fragment as Fragment12, jsx as jsx48, jsxs as jsxs35 } from "react/jsx-runtime";
4296
+ import { Fragment as Fragment11, jsx as jsx48, jsxs as jsxs35 } from "react/jsx-runtime";
4311
4297
  function FillBlank({
4312
4298
  data,
4313
4299
  mode = "answer",
@@ -4340,7 +4326,7 @@ function FillBlank({
4340
4326
  title: title != null ? title : "\u586B\u7A7A\u9898",
4341
4327
  index,
4342
4328
  total,
4343
- instruction: instruction != null ? instruction : /* @__PURE__ */ jsxs35(Fragment12, { children: [
4329
+ instruction: instruction != null ? instruction : /* @__PURE__ */ jsxs35(Fragment11, { children: [
4344
4330
  "\u8BFB\u77ED\u6587\uFF0C\u5728",
4345
4331
  /* @__PURE__ */ jsx48("b", { children: "\u6A2A\u7EBF" }),
4346
4332
  "\u5904\u8F93\u5165\u6B63\u786E\u7684\u8BCD"
@@ -4359,7 +4345,7 @@ function FillBlank({
4359
4345
  }
4360
4346
  ),
4361
4347
  footer: /* @__PURE__ */ jsx48(ActionBar, { actions, index, total, onPrev }),
4362
- children: /* @__PURE__ */ jsxs35(Fragment12, { children: [
4348
+ children: /* @__PURE__ */ jsxs35(Fragment11, { children: [
4363
4349
  /* @__PURE__ */ jsx48(
4364
4350
  FillBlankPassage,
4365
4351
  {
@@ -4638,7 +4624,7 @@ function useWordSelect({
4638
4624
  }
4639
4625
 
4640
4626
  // src/questions/word-select/index.tsx
4641
- import { Fragment as Fragment13, jsx as jsx52, jsxs as jsxs38 } from "react/jsx-runtime";
4627
+ import { Fragment as Fragment12, jsx as jsx52, jsxs as jsxs38 } from "react/jsx-runtime";
4642
4628
  function WordSelect({
4643
4629
  data,
4644
4630
  mode = "answer",
@@ -4671,7 +4657,7 @@ function WordSelect({
4671
4657
  title: title != null ? title : "\u9009\u8BCD\u586B\u7A7A",
4672
4658
  index,
4673
4659
  total,
4674
- instruction: instruction != null ? instruction : /* @__PURE__ */ jsxs38(Fragment13, { children: [
4660
+ instruction: instruction != null ? instruction : /* @__PURE__ */ jsxs38(Fragment12, { children: [
4675
4661
  "\u4ECE\u9009\u9879\u5E93",
4676
4662
  /* @__PURE__ */ jsx52("b", { children: "\u9009\u8BCD" }),
4677
4663
  "\uFF0C\u8865\u5168\u77ED\u6587"
@@ -4690,7 +4676,7 @@ function WordSelect({
4690
4676
  }
4691
4677
  ),
4692
4678
  footer: /* @__PURE__ */ jsx52(ActionBar, { actions, index, total, onPrev }),
4693
- children: /* @__PURE__ */ jsxs38(Fragment13, { children: [
4679
+ children: /* @__PURE__ */ jsxs38(Fragment12, { children: [
4694
4680
  /* @__PURE__ */ jsx52(
4695
4681
  WordSelectPassage,
4696
4682
  {
@@ -4948,7 +4934,7 @@ function useSortSentences({
4948
4934
  }
4949
4935
 
4950
4936
  // src/questions/sort-sentences/index.tsx
4951
- import { Fragment as Fragment14, jsx as jsx56, jsxs as jsxs41 } from "react/jsx-runtime";
4937
+ import { Fragment as Fragment13, jsx as jsx56, jsxs as jsxs41 } from "react/jsx-runtime";
4952
4938
  function SortSentences({
4953
4939
  data,
4954
4940
  mode = "answer",
@@ -4981,7 +4967,7 @@ function SortSentences({
4981
4967
  title: title != null ? title : "\u53E5\u5B50\u6392\u5E8F",
4982
4968
  index,
4983
4969
  total,
4984
- instruction: instruction != null ? instruction : /* @__PURE__ */ jsxs41(Fragment14, { children: [
4970
+ instruction: instruction != null ? instruction : /* @__PURE__ */ jsxs41(Fragment13, { children: [
4985
4971
  "\u6309\u6B63\u786E",
4986
4972
  /* @__PURE__ */ jsx56("b", { children: "\u987A\u5E8F" }),
4987
4973
  "\u6392\u5217\u53E5\u5B50\uFF0C\u70B9\u51FB\u7A7A\u884C\u653E\u5165"
@@ -4999,7 +4985,7 @@ function SortSentences({
4999
4985
  }
5000
4986
  ),
5001
4987
  footer: actions.length > 0 || index > 1 && Boolean(onPrev) ? /* @__PURE__ */ jsx56(ActionBar, { actions, index, total, onPrev }) : void 0,
5002
- children: /* @__PURE__ */ jsxs41(Fragment14, { children: [
4988
+ children: /* @__PURE__ */ jsxs41(Fragment13, { children: [
5003
4989
  /* @__PURE__ */ jsx56(
5004
4990
  SortRows,
5005
4991
  {
@@ -5278,7 +5264,7 @@ function useCloze({
5278
5264
  }
5279
5265
 
5280
5266
  // src/questions/cloze/index.tsx
5281
- import { Fragment as Fragment15, jsx as jsx60, jsxs as jsxs44 } from "react/jsx-runtime";
5267
+ import { Fragment as Fragment14, jsx as jsx60, jsxs as jsxs44 } from "react/jsx-runtime";
5282
5268
  function Cloze({
5283
5269
  data,
5284
5270
  mode = "answer",
@@ -5326,7 +5312,7 @@ function Cloze({
5326
5312
  }
5327
5313
  ),
5328
5314
  footer: /* @__PURE__ */ jsx60(ActionBar, { actions, index, total, onPrev }),
5329
- children: /* @__PURE__ */ jsxs44(Fragment15, { children: [
5315
+ children: /* @__PURE__ */ jsxs44(Fragment14, { children: [
5330
5316
  /* @__PURE__ */ jsx60(
5331
5317
  ClozePassage,
5332
5318
  {
@@ -5564,7 +5550,7 @@ function ReadingQuestion({
5564
5550
  }
5565
5551
 
5566
5552
  // src/questions/reading-comprehension/reading-page.tsx
5567
- import { Fragment as Fragment16, jsx as jsx65, jsxs as jsxs48 } from "react/jsx-runtime";
5553
+ import { Fragment as Fragment15, jsx as jsx65, jsxs as jsxs48 } from "react/jsx-runtime";
5568
5554
  function ReadingPage({
5569
5555
  data,
5570
5556
  collapsible,
@@ -5580,7 +5566,7 @@ function ReadingPage({
5580
5566
  onChip,
5581
5567
  onPick
5582
5568
  }) {
5583
- return /* @__PURE__ */ jsxs48(Fragment16, { children: [
5569
+ return /* @__PURE__ */ jsxs48(Fragment15, { children: [
5584
5570
  /* @__PURE__ */ jsx65(
5585
5571
  ReadingPassage,
5586
5572
  {
@@ -5771,7 +5757,7 @@ function useReadingComprehension({
5771
5757
  }
5772
5758
 
5773
5759
  // src/questions/reading-comprehension/index.tsx
5774
- import { Fragment as Fragment17, jsx as jsx66, jsxs as jsxs49 } from "react/jsx-runtime";
5760
+ import { Fragment as Fragment16, jsx as jsx66, jsxs as jsxs49 } from "react/jsx-runtime";
5775
5761
  function ReadingComprehension({
5776
5762
  data,
5777
5763
  mode = "answer",
@@ -5812,7 +5798,7 @@ function ReadingComprehension({
5812
5798
  title: title != null ? title : "\u9605\u8BFB\u7406\u89E3",
5813
5799
  index,
5814
5800
  total,
5815
- instruction: instruction != null ? instruction : /* @__PURE__ */ jsxs49(Fragment17, { children: [
5801
+ instruction: instruction != null ? instruction : /* @__PURE__ */ jsxs49(Fragment16, { children: [
5816
5802
  "\u9605\u8BFB\u77ED\u6587\uFF0C\u5B8C\u6210 ",
5817
5803
  /* @__PURE__ */ jsx66("b", { children: data.questions.length }),
5818
5804
  " \u9053\u5C0F\u9898"
@@ -5880,7 +5866,7 @@ function listenTaskActions({
5880
5866
  }
5881
5867
 
5882
5868
  // src/questions/listen-task/feedback.tsx
5883
- import { Fragment as Fragment18, jsx as jsx67, jsxs as jsxs50 } from "react/jsx-runtime";
5869
+ import { Fragment as Fragment17, jsx as jsx67, jsxs as jsxs50 } from "react/jsx-runtime";
5884
5870
  function ListenFeedback({
5885
5871
  data,
5886
5872
  tracks,
@@ -5891,21 +5877,21 @@ function ListenFeedback({
5891
5877
  const stats = (_a = data.stats) != null ? _a : [
5892
5878
  {
5893
5879
  label: "\u542C\u97F3\u9891\u65F6\u957F",
5894
- value: /* @__PURE__ */ jsxs50(Fragment18, { children: [
5880
+ value: /* @__PURE__ */ jsxs50(Fragment17, { children: [
5895
5881
  (timeOnTask / 60).toFixed(1),
5896
5882
  /* @__PURE__ */ jsx67("small", { children: "min" })
5897
5883
  ] })
5898
5884
  },
5899
5885
  {
5900
5886
  label: "\u97F3\u9891\u6570\u91CF",
5901
- value: /* @__PURE__ */ jsxs50(Fragment18, { children: [
5887
+ value: /* @__PURE__ */ jsxs50(Fragment17, { children: [
5902
5888
  tracks.length,
5903
5889
  /* @__PURE__ */ jsx67("small", { children: "\u6BB5" })
5904
5890
  ] })
5905
5891
  },
5906
5892
  {
5907
5893
  label: "\u5B8C\u6210\u5EA6",
5908
- value: /* @__PURE__ */ jsxs50(Fragment18, { children: [
5894
+ value: /* @__PURE__ */ jsxs50(Fragment17, { children: [
5909
5895
  overall,
5910
5896
  /* @__PURE__ */ jsx67("small", { children: "%" })
5911
5897
  ] })
@@ -6005,7 +5991,7 @@ function ListenRing({ percent }) {
6005
5991
  }
6006
5992
 
6007
5993
  // src/questions/listen-task/listen-player.tsx
6008
- import { Fragment as Fragment19, jsx as jsx71, jsxs as jsxs54 } from "react/jsx-runtime";
5994
+ import { Fragment as Fragment18, jsx as jsx71, jsxs as jsxs54 } from "react/jsx-runtime";
6009
5995
  function ListenPlayer({ model }) {
6010
5996
  var _a;
6011
5997
  const track = model.track;
@@ -6080,7 +6066,7 @@ function ListenPlayer({ model }) {
6080
6066
  ] }),
6081
6067
  /* @__PURE__ */ jsxs54("div", { className: "rqk-listen-progress", children: [
6082
6068
  /* @__PURE__ */ jsx71(ListenRing, { percent }),
6083
- /* @__PURE__ */ jsx71("div", { className: "rqk-listen-credit", children: Math.abs(model.position - credit) > 0.75 ? /* @__PURE__ */ jsxs54(Fragment19, { children: [
6069
+ /* @__PURE__ */ jsx71("div", { className: "rqk-listen-credit", children: Math.abs(model.position - credit) > 0.75 ? /* @__PURE__ */ jsxs54(Fragment18, { children: [
6084
6070
  "\u64AD\u653E ",
6085
6071
  /* @__PURE__ */ jsx71("b", { children: formatTime(model.position) }),
6086
6072
  " / ",
@@ -6088,7 +6074,7 @@ function ListenPlayer({ model }) {
6088
6074
  /* @__PURE__ */ jsx71("span", { className: "rqk-listen-credit-sep", children: "\xB7" }),
6089
6075
  "\u6709\u6548 ",
6090
6076
  /* @__PURE__ */ jsx71("b", { children: formatTime(credit) })
6091
- ] }) : /* @__PURE__ */ jsxs54(Fragment19, { children: [
6077
+ ] }) : /* @__PURE__ */ jsxs54(Fragment18, { children: [
6092
6078
  "\u6709\u6548\u64AD\u653E ",
6093
6079
  /* @__PURE__ */ jsx71("b", { children: formatTime(credit) }),
6094
6080
  " / ",
@@ -6333,7 +6319,7 @@ function useListenTask({
6333
6319
  }
6334
6320
 
6335
6321
  // src/questions/listen-task/index.tsx
6336
- import { Fragment as Fragment20, jsx as jsx72, jsxs as jsxs55 } from "react/jsx-runtime";
6322
+ import { Fragment as Fragment19, jsx as jsx72, jsxs as jsxs55 } from "react/jsx-runtime";
6337
6323
  function ListenTask({
6338
6324
  data,
6339
6325
  mode = "answer",
@@ -6366,7 +6352,7 @@ function ListenTask({
6366
6352
  title: title != null ? title : model.view === "feedback" ? "\u542C\u529B\u7EDF\u8BA1" : "\u542C\u529B\u4EFB\u52A1",
6367
6353
  index,
6368
6354
  total,
6369
- instruction: instruction != null ? instruction : /* @__PURE__ */ jsxs55(Fragment20, { children: [
6355
+ instruction: instruction != null ? instruction : /* @__PURE__ */ jsxs55(Fragment19, { children: [
6370
6356
  model.tracks.length > 1 ? "\u542C\u5B8C\u6BCF\u6BB5\u97F3\u9891" : "\u542C\u5B8C\u97F3\u9891",
6371
6357
  "\uFF0C\u6709\u6548\u64AD\u653E ",
6372
6358
  /* @__PURE__ */ jsx72("b", { children: "\u226590%" }),
@@ -6386,7 +6372,7 @@ function ListenTask({
6386
6372
  overall: model.overall,
6387
6373
  timeOnTask: model.timeOnTask
6388
6374
  }
6389
- ) : /* @__PURE__ */ jsxs55(Fragment20, { children: [
6375
+ ) : /* @__PURE__ */ jsxs55(Fragment19, { children: [
6390
6376
  /* @__PURE__ */ jsx72(ListenHero, { data, compact: model.tracks.length > 1 }),
6391
6377
  /* @__PURE__ */ jsx72(ListenPlayer, { model })
6392
6378
  ] })
@@ -6417,7 +6403,7 @@ function videoTaskActions({
6417
6403
  }
6418
6404
 
6419
6405
  // src/questions/video-task/feedback.tsx
6420
- import { Fragment as Fragment21, jsx as jsx73, jsxs as jsxs56 } from "react/jsx-runtime";
6406
+ import { Fragment as Fragment20, jsx as jsx73, jsxs as jsxs56 } from "react/jsx-runtime";
6421
6407
  function VideoFeedback({
6422
6408
  data,
6423
6409
  overall,
@@ -6427,21 +6413,21 @@ function VideoFeedback({
6427
6413
  const stats = (_a = data.stats) != null ? _a : [
6428
6414
  {
6429
6415
  label: "\u89C2\u770B\u65F6\u957F",
6430
- value: /* @__PURE__ */ jsxs56(Fragment21, { children: [
6416
+ value: /* @__PURE__ */ jsxs56(Fragment20, { children: [
6431
6417
  (timeOnTask / 60).toFixed(1),
6432
6418
  /* @__PURE__ */ jsx73("small", { children: "min" })
6433
6419
  ] })
6434
6420
  },
6435
6421
  {
6436
6422
  label: "\u89C6\u9891\u6570\u91CF",
6437
- value: /* @__PURE__ */ jsxs56(Fragment21, { children: [
6423
+ value: /* @__PURE__ */ jsxs56(Fragment20, { children: [
6438
6424
  data.videos.length,
6439
6425
  /* @__PURE__ */ jsx73("small", { children: "\u4E2A" })
6440
6426
  ] })
6441
6427
  },
6442
6428
  {
6443
6429
  label: "\u5B8C\u6210\u5EA6",
6444
- value: /* @__PURE__ */ jsxs56(Fragment21, { children: [
6430
+ value: /* @__PURE__ */ jsxs56(Fragment20, { children: [
6445
6431
  overall,
6446
6432
  /* @__PURE__ */ jsx73("small", { children: "%" })
6447
6433
  ] })
@@ -6517,7 +6503,7 @@ function VideoRing({ percent }) {
6517
6503
  }
6518
6504
 
6519
6505
  // src/questions/video-task/video-controls.tsx
6520
- import { Fragment as Fragment22, jsx as jsx76, jsxs as jsxs59 } from "react/jsx-runtime";
6506
+ import { Fragment as Fragment21, jsx as jsx76, jsxs as jsxs59 } from "react/jsx-runtime";
6521
6507
  function VideoControls({
6522
6508
  data,
6523
6509
  video,
@@ -6592,7 +6578,7 @@ function VideoControls({
6592
6578
  ] }),
6593
6579
  /* @__PURE__ */ jsxs59("div", { className: "rqk-video-progress", children: [
6594
6580
  /* @__PURE__ */ jsx76(VideoRing, { percent: percentFor(current) }),
6595
- /* @__PURE__ */ jsx76("div", { className: "rqk-video-credit", children: Math.abs(position - ((_a = credits[current]) != null ? _a : 0)) > 0.75 ? /* @__PURE__ */ jsxs59(Fragment22, { children: [
6581
+ /* @__PURE__ */ jsx76("div", { className: "rqk-video-credit", children: Math.abs(position - ((_a = credits[current]) != null ? _a : 0)) > 0.75 ? /* @__PURE__ */ jsxs59(Fragment21, { children: [
6596
6582
  "\u64AD\u653E ",
6597
6583
  /* @__PURE__ */ jsx76("b", { children: formatTime(position) }),
6598
6584
  " / ",
@@ -6600,7 +6586,7 @@ function VideoControls({
6600
6586
  /* @__PURE__ */ jsx76("span", { className: "rqk-video-credit-sep", children: "\xB7" }),
6601
6587
  "\u6709\u6548 ",
6602
6588
  /* @__PURE__ */ jsx76("b", { children: formatTime((_b = credits[current]) != null ? _b : 0) })
6603
- ] }) : /* @__PURE__ */ jsxs59(Fragment22, { children: [
6589
+ ] }) : /* @__PURE__ */ jsxs59(Fragment21, { children: [
6604
6590
  "\u6709\u6548\u89C2\u770B ",
6605
6591
  /* @__PURE__ */ jsx76("b", { children: formatTime((_c = credits[current]) != null ? _c : 0) }),
6606
6592
  " / ",
@@ -6837,7 +6823,7 @@ function useVideoTask({ data, onSubmit }) {
6837
6823
  }
6838
6824
 
6839
6825
  // src/questions/video-task/index.tsx
6840
- import { Fragment as Fragment23, jsx as jsx78, jsxs as jsxs61 } from "react/jsx-runtime";
6826
+ import { Fragment as Fragment22, jsx as jsx78, jsxs as jsxs61 } from "react/jsx-runtime";
6841
6827
  function VideoTask({
6842
6828
  data,
6843
6829
  mode = "answer",
@@ -6867,7 +6853,7 @@ function VideoTask({
6867
6853
  title: title != null ? title : model.view === "feedback" ? "\u89C6\u9891\u7EDF\u8BA1" : "\u89C6\u9891\u4EFB\u52A1",
6868
6854
  index,
6869
6855
  total,
6870
- instruction: instruction != null ? instruction : /* @__PURE__ */ jsxs61(Fragment23, { children: [
6856
+ instruction: instruction != null ? instruction : /* @__PURE__ */ jsxs61(Fragment22, { children: [
6871
6857
  "\u89C2\u770B\u89C6\u9891\uFF0C\u6709\u6548\u89C2\u770B ",
6872
6858
  /* @__PURE__ */ jsx78("b", { children: "\u226590%" }),
6873
6859
  " \u89C6\u4E3A\u5B8C\u6210"
@@ -6876,7 +6862,7 @@ function VideoTask({
6876
6862
  className: classNames("rqk-quest", "rqk-video", className),
6877
6863
  dataQuest: "video-task",
6878
6864
  footer: /* @__PURE__ */ jsx78(ActionBar, { actions, index, total, onPrev }),
6879
- children: model.view === "feedback" ? /* @__PURE__ */ jsx78(VideoFeedback, { data, overall: model.overall, timeOnTask: model.timeOnTask }) : /* @__PURE__ */ jsxs61(Fragment23, { children: [
6865
+ children: model.view === "feedback" ? /* @__PURE__ */ jsx78(VideoFeedback, { data, overall: model.overall, timeOnTask: model.timeOnTask }) : /* @__PURE__ */ jsxs61(Fragment22, { children: [
6880
6866
  /* @__PURE__ */ jsx78(
6881
6867
  VideoStage,
6882
6868
  {
@@ -6951,7 +6937,7 @@ function BlankInput2({
6951
6937
  }
6952
6938
 
6953
6939
  // src/index.tsx
6954
- var version = "1.0.4";
6940
+ var version = "1.0.5";
6955
6941
  var questkit = {
6956
6942
  version,
6957
6943
  QuestShell,