@nakamura-123/pages 1.1.17 → 1.1.23

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.
Files changed (168) hide show
  1. package/dist/component/Basic/Badge5s.js +18 -30
  2. package/dist/component/Basic/BasicContents.js +38 -39
  3. package/dist/component/Basic/BasicProgressBar.js +16 -17
  4. package/dist/component/Basic/BasicSetting.js +14 -15
  5. package/dist/component/Basic/MiniTestCard.js +32 -33
  6. package/dist/component/Basic/Paw5s.js +9 -13
  7. package/dist/component/Basic/SelectedExamCnt.js +14 -15
  8. package/dist/component/Basic/SubCategoryLeft.js +5 -6
  9. package/dist/component/Basic/SubCategoryList.js +49 -62
  10. package/dist/component/Boot/SelectRange.js +18 -21
  11. package/dist/component/Boot/ToggleRange.js +11 -14
  12. package/dist/component/Coin/AppReviews.js +9 -10
  13. package/dist/component/Coin/CatchCopy.js +6 -6
  14. package/dist/component/Coin/CoinCheck.js +18 -54
  15. package/dist/component/Coin/CoinFnc.js +210 -282
  16. package/dist/component/Coin/CoinPageComponent.d.ts +1 -0
  17. package/dist/component/Coin/CoinPageComponent.js +22 -22
  18. package/dist/component/Coin/ReceiptFnc.js +3 -3
  19. package/dist/component/Coin/Recommend.js +10 -10
  20. package/dist/component/Coin/WaitingPayBanner.js +8 -9
  21. package/dist/component/Discription.js +6 -7
  22. package/dist/component/Grade/AllTags.js +12 -12
  23. package/dist/component/Grade/BasicBadge.js +20 -32
  24. package/dist/component/Grade/GradeCard/ChangeWeeklyModal.js +8 -10
  25. package/dist/component/Grade/GradeCard/ChangeWeeklyTargetBtn.js +21 -22
  26. package/dist/component/Grade/GradeCard/DatePickerModal.js +17 -19
  27. package/dist/component/Grade/GradeCard/GradeCard.js +19 -20
  28. package/dist/component/Grade/GradeCard/Square3sGrade.js +16 -17
  29. package/dist/component/Grade/GradeCard/TargetDate.js +19 -20
  30. package/dist/component/Grade/GradeCard/WeeklyAchivedRate.js +7 -8
  31. package/dist/component/Grade/GradeCard/WeeklyProgress.js +19 -29
  32. package/dist/component/Grade/JAllTags.js +16 -16
  33. package/dist/component/Grade/QuizCntGraph.js +31 -45
  34. package/dist/component/Grade/ShareBtn.js +30 -68
  35. package/dist/component/Grade/Square4s.js +14 -15
  36. package/dist/component/Grade/UnitCircles.js +18 -23
  37. package/dist/component/Grade/YearCircles.js +17 -22
  38. package/dist/component/Guide.js +6 -7
  39. package/dist/component/Home/OpeningMsg.js +14 -14
  40. package/dist/component/OnlineInput/OnlineInputFnc.js +6 -6
  41. package/dist/component/OnlineInput/OnlineSaveBtn.js +7 -8
  42. package/dist/component/OnlineInput/OnlineSavedList.js +13 -14
  43. package/dist/component/OnlineInput/PasswardModal.js +64 -110
  44. package/dist/component/OnlineInput/PasswordIdModal.js +40 -80
  45. package/dist/component/QuizSet/QuizOptionDrill.js +29 -42
  46. package/dist/component/Result/AdCard.js +21 -16
  47. package/dist/component/Result/CharaCard.js +15 -16
  48. package/dist/component/Result/LessonTitle.js +10 -10
  49. package/dist/component/Result/QuizFlatList.js +26 -30
  50. package/dist/component/Result/ScoreCircle.js +8 -9
  51. package/dist/component/SelectRange/SelectYearRange.js +22 -34
  52. package/dist/component/SettingBtns/QuizOptionSelector.js +16 -17
  53. package/dist/component/SettingBtns/Range.js +9 -9
  54. package/dist/component/SettingBtns/TransBtn.js +17 -17
  55. package/dist/component/TabAnimeView.js +9 -10
  56. package/dist/component/Tag5s.js +10 -14
  57. package/dist/component/TagBadge5s.js +16 -17
  58. package/dist/component/TagBadge5sPress.js +14 -15
  59. package/dist/component/TestPage/AverageBar.js +12 -24
  60. package/dist/component/TestPage/BarChartContainer.js +30 -31
  61. package/dist/component/TestPage/ChartControl.js +5 -6
  62. package/dist/component/TestPage/Square3s.js +12 -13
  63. package/dist/functions/badgeBasicFnc.js +22 -42
  64. package/dist/functions/badgeDailyFnc.js +24 -35
  65. package/dist/functions/badgeFilter.js +16 -18
  66. package/dist/functions/badgeFnc.js +24 -33
  67. package/dist/functions/createQuizFncD.js +33 -33
  68. package/dist/functions/createQuizFncJ.js +27 -33
  69. package/dist/functions/gradeFnc.js +48 -87
  70. package/dist/functions/oldStorageFnc.js +77 -200
  71. package/dist/functions/questionFilterD.js +19 -28
  72. package/dist/functions/questionFilterJ.js +9 -9
  73. package/dist/functions/questionFormatD.js +34 -47
  74. package/dist/functions/questionFormatJ.js +30 -41
  75. package/dist/functions/tagFncD.js +37 -39
  76. package/dist/functions/tagFncJ.js +16 -19
  77. package/dist/functions/testFnc.js +6 -7
  78. package/dist/hooks/BadgeHook.js +24 -35
  79. package/dist/hooks/ExitQuizHook.js +21 -21
  80. package/dist/hooks/basicHook.js +12 -12
  81. package/dist/hooks/quizActionHook.js +44 -57
  82. package/dist/hooks/quizHook.d.ts +2 -1
  83. package/dist/hooks/quizHook.js +58 -48
  84. package/dist/index.js +25 -25
  85. package/dist/page/BadgePage.js +26 -29
  86. package/dist/page/BasicPage.js +23 -25
  87. package/dist/page/BootPage.js +48 -53
  88. package/dist/page/CoinPage.d.ts +1 -0
  89. package/dist/page/CoinPage.js +90 -144
  90. package/dist/page/FAQPage.js +23 -23
  91. package/dist/page/GetBadgePage.js +35 -71
  92. package/dist/page/GradePage.js +26 -27
  93. package/dist/page/GuidePage.js +28 -33
  94. package/dist/page/HistoryPage.js +25 -33
  95. package/dist/page/HomePage.d.ts +1 -0
  96. package/dist/page/HomePage.js +62 -108
  97. package/dist/page/ImgZoom.js +8 -9
  98. package/dist/page/InformationPage.js +15 -15
  99. package/dist/page/JDetailSettingPage.js +23 -25
  100. package/dist/page/OnlineInputPage.js +19 -20
  101. package/dist/page/QuizPage.js +25 -26
  102. package/dist/page/QuizSettingPage.js +19 -19
  103. package/dist/page/QuizSetupPage.js +40 -43
  104. package/dist/page/ReportPage.js +55 -94
  105. package/dist/page/ResultPage.js +55 -103
  106. package/dist/page/SettingPage.js +35 -40
  107. package/dist/page/TestPage.js +41 -44
  108. package/dist/quiz/QuizContentsDrill.js +17 -18
  109. package/dist/quiz/QuizContentsJLPT.js +8 -9
  110. package/dist/quiz/Title.js +22 -22
  111. package/dist/quiz/answer/Answer.js +20 -20
  112. package/dist/quiz/answer/BlangGuide.js +10 -10
  113. package/dist/quiz/answer/BlankAnswer.js +11 -12
  114. package/dist/quiz/answer/BlankBtn.js +10 -10
  115. package/dist/quiz/answer/CheckButton.js +6 -9
  116. package/dist/quiz/answer/ChoiceView.js +15 -30
  117. package/dist/quiz/answer/Input/CollapseExplain.js +10 -11
  118. package/dist/quiz/answer/Input/InputAnswerBtn.js +9 -9
  119. package/dist/quiz/answer/Input/InputBox.js +17 -18
  120. package/dist/quiz/answer/Input/InputCounter.js +6 -7
  121. package/dist/quiz/answer/Input/InputFnc.js +10 -19
  122. package/dist/quiz/answer/Input/InputSaveSelector.js +12 -13
  123. package/dist/quiz/answer/Input/InputTab.js +12 -13
  124. package/dist/quiz/answer/Input/InputWarnning.js +13 -14
  125. package/dist/quiz/answer/InputGuide.js +10 -10
  126. package/dist/quiz/answer/InputNav.js +38 -39
  127. package/dist/quiz/answer/MultiChoice.js +20 -22
  128. package/dist/quiz/answer/MultiGuide.js +10 -10
  129. package/dist/quiz/answer/MultiNextBtn.js +13 -14
  130. package/dist/quiz/answer/NormalChoice.js +29 -42
  131. package/dist/quiz/answer/NormalMultiGuide.js +11 -12
  132. package/dist/quiz/answer/styles/getChoiceStyle.js +4 -4
  133. package/dist/quiz/check/Check.js +17 -18
  134. package/dist/quiz/check/NextQuizBtn.js +18 -19
  135. package/dist/quiz/check/SelectTag.js +36 -51
  136. package/dist/quiz/common/MyTextqqyy.js +29 -47
  137. package/dist/quiz/common/PageContainerWrap.js +14 -15
  138. package/dist/quiz/common/RenderImgOrText.js +17 -18
  139. package/dist/quiz/common/RubyText.js +21 -35
  140. package/dist/quiz/common/ZoomableImage.js +6 -9
  141. package/dist/quiz/explain/CorrectedBar.js +13 -14
  142. package/dist/quiz/explain/Explain.js +9 -10
  143. package/dist/quiz/explain/ExplainLogic.js +17 -23
  144. package/dist/quiz/explain/MovieBtn.js +10 -11
  145. package/dist/quiz/explain/MultiExplain.js +12 -24
  146. package/dist/quiz/explain/NormalExplain.js +29 -30
  147. package/dist/quiz/function/choiceFnc.js +2 -2
  148. package/dist/quiz/jAnswer/JAnswer.js +24 -26
  149. package/dist/quiz/jAnswer/JAnswerContents.js +12 -27
  150. package/dist/quiz/jQuestion/JQuestion.js +12 -13
  151. package/dist/quiz/jQuestion/JQuestionBottomText.js +14 -15
  152. package/dist/quiz/jQuestion/JQuestionText.js +13 -14
  153. package/dist/quiz/jQuestion/QuizCnt.js +9 -9
  154. package/dist/quiz/jQuestion/TimeLimit.js +23 -25
  155. package/dist/quiz/question/FillDiagram.js +12 -13
  156. package/dist/quiz/question/Question.js +25 -26
  157. package/dist/quiz/question/QuestionFormats.js +29 -45
  158. package/dist/quiz/question/QuestionReference.js +7 -7
  159. package/dist/quiz/question/SearchYoutue.js +10 -11
  160. package/dist/quiz/save/QuizSaveData.js +18 -19
  161. package/dist/quiz/setting/Above3BtnJ.js +25 -30
  162. package/dist/quiz/setting/Bottom3Btn.js +25 -30
  163. package/dist/quiz/setting/GuideBtn.js +19 -22
  164. package/dist/quiz/setting/RepeatBtn.js +27 -34
  165. package/dist/quiz/setting/ReturnBtn.js +8 -20
  166. package/dist/quiz/setting/ReturnSaveBtn.js +21 -33
  167. package/dist/tsconfig.tsbuildinfo +1 -1
  168. package/package.json +2 -2
@@ -1,44 +1,32 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
14
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
15
4
  };
16
5
  Object.defineProperty(exports, "__esModule", { value: true });
17
- var react_1 = __importDefault(require("react"));
18
- var react_native_1 = require("react-native");
19
- var MyTextqqyy_1 = __importDefault(require("../common/MyTextqqyy"));
20
- var lib_1 = require("@nakamura-123/lib");
21
- var MultiExplain = function (_a) {
22
- var question = _a.question;
23
- var multiSel = question.multiSel, selectedIndexes = question.selectedIndexes;
6
+ const react_1 = __importDefault(require("react"));
7
+ const react_native_1 = require("react-native");
8
+ const MyTextqqyy_1 = __importDefault(require("../common/MyTextqqyy"));
9
+ const lib_1 = require("@nakamura-123/lib");
10
+ const MultiExplain = ({ question }) => {
11
+ const { multiSel, selectedIndexes } = question;
24
12
  return (<react_native_1.View style={styles.container}>
25
- {multiSel.map(function (choices, index) { return (<react_native_1.View key={index} style={styles.sectionBox}>
26
- {choices.map(function (choice, i) {
27
- var color = choice.isCorrect
13
+ {multiSel.map((choices, index) => (<react_native_1.View key={index} style={styles.sectionBox}>
14
+ {choices.map((choice, i) => {
15
+ const color = choice.isCorrect
28
16
  ? "red"
29
17
  : selectedIndexes[index] === i
30
18
  ? "blue"
31
19
  : "ltBeige";
32
- return (<react_native_1.View key={i} style={__assign(__assign({}, styles.textBox), { borderColor: lib_1.colors[color] })}>
20
+ return (<react_native_1.View key={i} style={Object.assign(Object.assign({}, styles.textBox), { borderColor: lib_1.colors[color] })}>
33
21
  <MyTextqqyy_1.default style={{ color: lib_1.colors[color] }}>
34
22
  {choice.choice}
35
23
  </MyTextqqyy_1.default>
36
24
  </react_native_1.View>);
37
25
  })}
38
- </react_native_1.View>); })}
26
+ </react_native_1.View>))}
39
27
  </react_native_1.View>);
40
28
  };
41
- var styles = react_native_1.StyleSheet.create({
29
+ const styles = react_native_1.StyleSheet.create({
42
30
  container: {
43
31
  flex: 1,
44
32
  justifyContent: "center",
@@ -3,32 +3,31 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- var react_1 = __importDefault(require("react"));
7
- var react_native_1 = require("react-native");
8
- var react_redux_1 = require("react-redux");
9
- var lib_1 = require("@nakamura-123/lib");
10
- var common_1 = require("@nakamura-123/common");
11
- var RenderImgOrText_1 = __importDefault(require("../common/RenderImgOrText"));
12
- var quizHook_1 = require("../../hooks/quizHook");
13
- var ExplainLogic_1 = require("./ExplainLogic");
14
- var ZoomableImage_1 = __importDefault(require("../common/ZoomableImage"));
15
- var MyTextqqyy_1 = __importDefault(require("../common/MyTextqqyy"));
16
- var MovieBtn_1 = __importDefault(require("./MovieBtn"));
17
- var NormalExplain = function (_a) {
18
- var navigation = _a.navigation;
19
- var question = (0, quizHook_1.useQuestionDataD)();
20
- var rImgs = (0, react_redux_1.useSelector)(function (state) { return state.app.imgs.rImgs; });
21
- var mImgs = (0, react_redux_1.useSelector)(function (state) { return state.app.imgs.mImgs; });
22
- var fsize = (0, react_redux_1.useSelector)(function (state) { return state.quizCfg.inQuizOption.fsize; });
6
+ const react_1 = __importDefault(require("react"));
7
+ const react_native_1 = require("react-native");
8
+ const react_redux_1 = require("react-redux");
9
+ const lib_1 = require("@nakamura-123/lib");
10
+ const common_1 = require("@nakamura-123/common");
11
+ const RenderImgOrText_1 = __importDefault(require("../common/RenderImgOrText"));
12
+ const quizHook_1 = require("../../hooks/quizHook");
13
+ const ExplainLogic_1 = require("./ExplainLogic");
14
+ const ZoomableImage_1 = __importDefault(require("../common/ZoomableImage"));
15
+ const MyTextqqyy_1 = __importDefault(require("../common/MyTextqqyy"));
16
+ const MovieBtn_1 = __importDefault(require("./MovieBtn"));
17
+ const NormalExplain = ({ navigation }) => {
18
+ const question = (0, quizHook_1.useQuestionDataD)();
19
+ const rImgs = (0, react_redux_1.useSelector)((state) => state.app.imgs.rImgs);
20
+ const mImgs = (0, react_redux_1.useSelector)((state) => state.app.imgs.mImgs);
21
+ const fsize = (0, react_redux_1.useSelector)((state) => state.quizCfg.inQuizOption.fsize);
23
22
  if (!question)
24
23
  return null;
25
- var yearId = question.yearId, explain = question.explain;
24
+ const { yearId, explain } = question;
26
25
  if (!explain)
27
26
  return null;
28
- var explainInfos = explain.map(function (word) {
27
+ const explainInfos = explain.map((word) => {
29
28
  return (0, ExplainLogic_1.getExplainDatas)(word, question);
30
29
  });
31
- var formIsInput = question.form === "input";
30
+ const formIsInput = question.form === "input";
32
31
  // 解説がない場合
33
32
  if (explainInfos.length === 0)
34
33
  return (<react_native_1.View style={styles.container}>
@@ -36,33 +35,33 @@ var NormalExplain = function (_a) {
36
35
  こちらの問題の解説は掲載しておりません。過去問題集やWEBサイトなどでご確認ください。
37
36
  </MyTextqqyy_1.default>
38
37
  </react_native_1.View>);
39
- var marginBottom = getMarginBottom(fsize);
38
+ const marginBottom = getMarginBottom(fsize);
40
39
  // 解説表示
41
40
  return (<react_native_1.View style={styles.container}>
42
41
  {/* 解説表示 */}
43
- {explainInfos.map(function (I, index) {
44
- var color = I.color && !I.word.startsWith("/") ? I.color : "ltBeige";
42
+ {explainInfos.map((I, index) => {
43
+ const color = I.color && !I.word.startsWith("/") ? I.color : "ltBeige";
45
44
  if (I.viewType === "base") {
46
- var mt20 = I.color === "light" ? 25 : 0;
45
+ const mt20 = I.color === "light" ? 25 : 0;
47
46
  return (<react_native_1.View style={{
48
47
  backgroundColor: lib_1.colors[color],
49
- marginBottom: marginBottom,
48
+ marginBottom,
50
49
  marginTop: mt20,
51
50
  }} key={index}>
52
51
  <RenderImgOrText_1.default word={I.word} imgKey={"a" + yearId} navigation={navigation}/>
53
52
  </react_native_1.View>);
54
53
  }
55
54
  if (I.viewType === "copy") {
56
- return (<react_native_1.View style={{ backgroundColor: lib_1.colors[color], marginBottom: marginBottom }} key={index}>
55
+ return (<react_native_1.View style={{ backgroundColor: lib_1.colors[color], marginBottom }} key={index}>
57
56
  <RenderImgOrText_1.default word={I.word} imgKey={"a" + yearId} navigation={navigation} selectable={true}/>
58
57
  </react_native_1.View>);
59
58
  }
60
59
  if (I.viewType === "rImg") {
61
- var path = lib_1.utilFnc.getrImgPath(rImgs, I.word);
60
+ const path = lib_1.utilFnc.getrImgPath(rImgs, I.word);
62
61
  return (<ZoomableImage_1.default key={index} path={path} navigation={navigation} maxHeightValue={1000}/>);
63
62
  }
64
63
  if (I.viewType === "mImg") {
65
- var pathes = lib_1.utilFnc.getmImgPathes(mImgs, I.yearId, I.num);
64
+ const pathes = lib_1.utilFnc.getmImgPathes(mImgs, I.yearId, I.num);
66
65
  return (<MovieBtn_1.default key={index} pathes={pathes} word={I.word} navigation={navigation} index={index}/>);
67
66
  }
68
67
  })}
@@ -71,7 +70,7 @@ var NormalExplain = function (_a) {
71
70
  </common_1.MyText>)}
72
71
  </react_native_1.View>);
73
72
  };
74
- var styles = react_native_1.StyleSheet.create({
73
+ const styles = react_native_1.StyleSheet.create({
75
74
  container: {
76
75
  justifyContent: "flex-start",
77
76
  backgroundColor: lib_1.colors.ltBeige,
@@ -82,7 +81,7 @@ var styles = react_native_1.StyleSheet.create({
82
81
  marginTop: 10,
83
82
  },
84
83
  });
85
- var getMarginBottom = function (fsize) {
84
+ const getMarginBottom = (fsize) => {
86
85
  switch (fsize) {
87
86
  case "xs":
88
87
  return 3;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.calcMaxChoiceLength = void 0;
4
- var calcMaxChoiceLength = function (choices) {
5
- return choices.reduce(function (max, current) {
4
+ const calcMaxChoiceLength = (choices) => {
5
+ return choices.reduce((max, current) => {
6
6
  return Math.max(max, current.choice.length);
7
7
  }, 0);
8
8
  };
@@ -3,41 +3,39 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- var stores_1 = require("@nakamura-123/stores");
7
- var react_1 = __importDefault(require("react"));
8
- var react_native_1 = require("react-native");
9
- var react_redux_1 = require("react-redux");
10
- var quizHook_1 = require("../../hooks/quizHook");
11
- var JAnswerContents_1 = __importDefault(require("./JAnswerContents"));
12
- var react_redux_2 = require("react-redux");
13
- var quizActionHook_1 = require("../../hooks/quizActionHook");
14
- var getChoiceStyle_1 = require("../answer/styles/getChoiceStyle");
15
- var JAnswer = function (_a) {
16
- var navigation = _a.navigation;
17
- var dispatch = (0, react_redux_2.useDispatch)();
18
- var question = (0, quizHook_1.useQuestionDataJ)();
19
- var selectedIndexes = (question === null || question === void 0 ? void 0 : question.selectedIndexes) || [];
20
- var choices = (question === null || question === void 0 ? void 0 : question.choices) || [];
21
- var form = question === null || question === void 0 ? void 0 : question.form;
22
- var useHandleCheck = (0, quizActionHook_1.useChangeModeToCheck)("JLPT", question);
23
- var isDoublePress = (0, react_redux_1.useSelector)(function (state) { return state.quizCfg.inQuizOption; }).isDoublePress;
24
- var mode = (0, quizHook_1.useGetMode)();
25
- var isCorrected = (question === null || question === void 0 ? void 0 : question.isCorrected) === false ? false : (question === null || question === void 0 ? void 0 : question.isCorrected) || null;
6
+ const stores_1 = require("@nakamura-123/stores");
7
+ const react_1 = __importDefault(require("react"));
8
+ const react_native_1 = require("react-native");
9
+ const react_redux_1 = require("react-redux");
10
+ const quizHook_1 = require("../../hooks/quizHook");
11
+ const JAnswerContents_1 = __importDefault(require("./JAnswerContents"));
12
+ const react_redux_2 = require("react-redux");
13
+ const quizActionHook_1 = require("../../hooks/quizActionHook");
14
+ const getChoiceStyle_1 = require("../answer/styles/getChoiceStyle");
15
+ const JAnswer = ({ navigation }) => {
16
+ const dispatch = (0, react_redux_2.useDispatch)();
17
+ const question = (0, quizHook_1.useQuestionDataJ)();
18
+ const selectedIndexes = (question === null || question === void 0 ? void 0 : question.selectedIndexes) || [];
19
+ const choices = (question === null || question === void 0 ? void 0 : question.choices) || [];
20
+ const form = question === null || question === void 0 ? void 0 : question.form;
21
+ const useHandleCheck = (0, quizActionHook_1.useChangeModeToCheck)("JLPT", question);
22
+ const { isDoublePress } = (0, react_redux_1.useSelector)((state) => state.quizCfg.inQuizOption);
23
+ const mode = (0, quizHook_1.useGetMode)();
24
+ const isCorrected = (question === null || question === void 0 ? void 0 : question.isCorrected) === false ? false : (question === null || question === void 0 ? void 0 : question.isCorrected) || null;
26
25
  // 選択肢を選んだ時の処理
27
- var handleChoice = function (i) {
26
+ const handleChoice = (i) => {
28
27
  var _a;
29
28
  if (mode !== "quiz")
30
29
  return;
31
30
  dispatch(stores_1.quizAction.replaceSelectedIndex([i]));
32
- var correct = (_a = choices[i]) === null || _a === void 0 ? void 0 : _a.isCorrect;
31
+ const correct = (_a = choices[i]) === null || _a === void 0 ? void 0 : _a.isCorrect;
33
32
  // 共通処理
34
33
  useHandleCheck && useHandleCheck(correct);
35
34
  };
36
35
  // 選択肢のアウトラインの色を決める
37
- var wordAndColors = choices.map(function (_a, i) {
38
- var choice = _a.choice, isCorrect = _a.isCorrect;
36
+ const wordAndColors = choices.map(({ choice, isCorrect }, i) => {
39
37
  if (form === "basicSelImg" || form === "listenSelImg")
40
- choice = "/".concat(choice);
38
+ choice = `/${choice}`;
41
39
  return {
42
40
  word: choice,
43
41
  color: (0, getChoiceStyle_1.getChoiceOutlineColor)(selectedIndexes, mode, isCorrect, i),
@@ -46,7 +44,7 @@ var JAnswer = function (_a) {
46
44
  // imgだった場合、表示させるためのTopKey
47
45
  return (<JAnswerContents_1.default wordAndColors={wordAndColors} isDoublePress={isDoublePress} handleChoice={handleChoice} isNotSearch={false} navigation={navigation} isCorrected={isCorrected}/>);
48
46
  };
49
- var styles = react_native_1.StyleSheet.create({
47
+ const styles = react_native_1.StyleSheet.create({
50
48
  container: {
51
49
  backgroundColor: "#fff",
52
50
  },
@@ -1,38 +1,24 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
14
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
15
4
  };
16
5
  Object.defineProperty(exports, "__esModule", { value: true });
17
- var common_1 = require("@nakamura-123/common");
18
- var react_1 = __importDefault(require("react"));
19
- var react_native_1 = require("react-native");
20
- var RenderImgOrText_1 = __importDefault(require("../common/RenderImgOrText"));
21
- var lib_1 = require("@nakamura-123/lib");
22
- var RepeatBtn_1 = __importDefault(require("../setting/RepeatBtn"));
23
- var GuideBtn_1 = __importDefault(require("../setting/GuideBtn"));
24
- var JAnswerContents = function (_a) {
25
- var wordAndColors = _a.wordAndColors, isDoublePress = _a.isDoublePress, handleChoice = _a.handleChoice, isNotSearch = _a.isNotSearch, navigation = _a.navigation, isCorrected = _a.isCorrected;
6
+ const common_1 = require("@nakamura-123/common");
7
+ const react_1 = __importDefault(require("react"));
8
+ const react_native_1 = require("react-native");
9
+ const RenderImgOrText_1 = __importDefault(require("../common/RenderImgOrText"));
10
+ const lib_1 = require("@nakamura-123/lib");
11
+ const RepeatBtn_1 = __importDefault(require("../setting/RepeatBtn"));
12
+ const GuideBtn_1 = __importDefault(require("../setting/GuideBtn"));
13
+ const JAnswerContents = ({ wordAndColors, isDoublePress, handleChoice, isNotSearch, navigation, isCorrected, }) => {
26
14
  return (<react_native_1.View>
27
15
  <react_native_1.View style={styles.bottomBtnBox}>
28
16
  <RepeatBtn_1.default isPreLoad={true}/>
29
17
  <GuideBtn_1.default navigation={navigation}/>
30
18
  </react_native_1.View>
31
19
  <react_native_1.View style={styles.container}>
32
- {wordAndColors.map(function (_a, i) {
33
- var word = _a.word, color = _a.color;
34
- return (<common_1.DoubleTapWrapper key={i} onPress={function () { return handleChoice(i); }} isDoublePress={isDoublePress}>
35
- <react_native_1.View style={__assign(__assign({}, styles.choice), { borderColor: lib_1.colors[color] })}>
20
+ {wordAndColors.map(({ word, color }, i) => (<common_1.DoubleTapWrapper key={i} onPress={() => handleChoice(i)} isDoublePress={isDoublePress}>
21
+ <react_native_1.View style={Object.assign(Object.assign({}, styles.choice), { borderColor: lib_1.colors[color] })}>
36
22
  {color === "red" && (<>
37
23
  <react_native_1.View style={styles.maruBox}>
38
24
  <common_1.IconInCircle name="check" size={15} iconColor="green" cStyle={{ width: 25, height: 25 }}/>
@@ -48,12 +34,11 @@ var JAnswerContents = function (_a) {
48
34
  </common_1.BoundText>)}
49
35
  <RenderImgOrText_1.default word={word} isNotSearch={isNotSearch}/>
50
36
  </react_native_1.View>
51
- </common_1.DoubleTapWrapper>);
52
- })}
37
+ </common_1.DoubleTapWrapper>))}
53
38
  </react_native_1.View>
54
39
  </react_native_1.View>);
55
40
  };
56
- var styles = react_native_1.StyleSheet.create({
41
+ const styles = react_native_1.StyleSheet.create({
57
42
  container: {
58
43
  justifyContent: "space-between",
59
44
  flexDirection: "row",
@@ -3,18 +3,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- var lib_1 = require("@nakamura-123/lib");
7
- var react_1 = __importDefault(require("react"));
8
- var react_native_1 = require("react-native");
9
- var TimeLimit_1 = __importDefault(require("./TimeLimit"));
10
- var QuizCnt_1 = __importDefault(require("./QuizCnt"));
11
- var JQuestionText_1 = __importDefault(require("./JQuestionText"));
12
- var quizHook_1 = require("../../hooks/quizHook");
13
- var JQuestionBottomText_1 = __importDefault(require("./JQuestionBottomText"));
14
- var Above3BtnJ_1 = __importDefault(require("../setting/Above3BtnJ"));
15
- var JQuestion = function (_a) {
16
- var navigation = _a.navigation;
17
- var question = (0, quizHook_1.useQuestionDataJ)();
6
+ const lib_1 = require("@nakamura-123/lib");
7
+ const react_1 = __importDefault(require("react"));
8
+ const react_native_1 = require("react-native");
9
+ const TimeLimit_1 = __importDefault(require("./TimeLimit"));
10
+ const QuizCnt_1 = __importDefault(require("./QuizCnt"));
11
+ const JQuestionText_1 = __importDefault(require("./JQuestionText"));
12
+ const quizHook_1 = require("../../hooks/quizHook");
13
+ const JQuestionBottomText_1 = __importDefault(require("./JQuestionBottomText"));
14
+ const Above3BtnJ_1 = __importDefault(require("../setting/Above3BtnJ"));
15
+ const JQuestion = ({ navigation }) => {
16
+ const question = (0, quizHook_1.useQuestionDataJ)();
18
17
  return (<react_native_1.View>
19
18
  <react_native_1.View style={styles.container}>
20
19
  <QuizCnt_1.default />
@@ -25,7 +24,7 @@ var JQuestion = function (_a) {
25
24
  <Above3BtnJ_1.default navigation={navigation}/>
26
25
  </react_native_1.View>);
27
26
  };
28
- var styles = react_native_1.StyleSheet.create({
27
+ const styles = react_native_1.StyleSheet.create({
29
28
  container: {
30
29
  backgroundColor: lib_1.colors.bkBeige,
31
30
  alignItems: "center",
@@ -3,28 +3,27 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- var react_1 = __importDefault(require("react"));
7
- var react_native_1 = require("react-native");
8
- var quizHook_1 = require("../../hooks/quizHook");
9
- var RubyText_1 = __importDefault(require("../common/RubyText"));
10
- var JQuestionBottomText = function (_a) {
11
- var question = _a.question;
12
- var mode = (0, quizHook_1.useGetMode)();
13
- var form = question === null || question === void 0 ? void 0 : question.form;
14
- var answerText = getAnswerText(question, form);
6
+ const react_1 = __importDefault(require("react"));
7
+ const react_native_1 = require("react-native");
8
+ const quizHook_1 = require("../../hooks/quizHook");
9
+ const RubyText_1 = __importDefault(require("../common/RubyText"));
10
+ const JQuestionBottomText = ({ question }) => {
11
+ const mode = (0, quizHook_1.useGetMode)();
12
+ const form = question === null || question === void 0 ? void 0 : question.form;
13
+ const answerText = getAnswerText(question, form);
15
14
  if (mode === "quiz")
16
15
  return null;
17
16
  return (<react_native_1.View style={styles.container}>
18
17
  <RubyText_1.default>{answerText}</RubyText_1.default>
19
18
  </react_native_1.View>);
20
19
  };
21
- var getAnswerText = function (question, form) {
20
+ const getAnswerText = (question, form) => {
22
21
  if (!question || !form)
23
22
  return "";
24
- var enSentence = question.enSentence, enWord = question.enWord, jpWord = question.jpWord;
25
- var enSentenceForms = ["basicSelImg", "listenSelImg"];
26
- var enWordForms = ["basicSelEn", "listenSelEn"];
27
- var jpWordForms = ["basicSelJp", "listenSelJp"];
23
+ const { enSentence, enWord, jpWord } = question;
24
+ const enSentenceForms = ["basicSelImg", "listenSelImg"];
25
+ const enWordForms = ["basicSelEn", "listenSelEn"];
26
+ const jpWordForms = ["basicSelJp", "listenSelJp"];
28
27
  if (enSentenceForms.includes(form))
29
28
  return enSentence;
30
29
  if (enWordForms.includes(form))
@@ -33,7 +32,7 @@ var getAnswerText = function (question, form) {
33
32
  return jpWord;
34
33
  return enWord; // fallback
35
34
  };
36
- var styles = react_native_1.StyleSheet.create({
35
+ const styles = react_native_1.StyleSheet.create({
37
36
  container: {
38
37
  padding: 10,
39
38
  alignItems: "center",
@@ -3,25 +3,24 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- var react_1 = __importDefault(require("react"));
7
- var react_native_1 = require("react-native");
8
- var RubyText_1 = __importDefault(require("../common/RubyText"));
9
- var RepeatBtn_1 = __importDefault(require("../setting/RepeatBtn"));
10
- var quizHook_1 = require("../../hooks/quizHook");
11
- var JQuestionText = function (_a) {
12
- var question = _a.question;
13
- var mode = (0, quizHook_1.useGetMode)();
6
+ const react_1 = __importDefault(require("react"));
7
+ const react_native_1 = require("react-native");
8
+ const RubyText_1 = __importDefault(require("../common/RubyText"));
9
+ const RepeatBtn_1 = __importDefault(require("../setting/RepeatBtn"));
10
+ const quizHook_1 = require("../../hooks/quizHook");
11
+ const JQuestionText = ({ question }) => {
12
+ const mode = (0, quizHook_1.useGetMode)();
14
13
  if (!question)
15
14
  return null;
16
- var quizText = question.question;
17
- var form = question === null || question === void 0 ? void 0 : question.form;
18
- var listenForms = [
15
+ const quizText = question.question;
16
+ const form = question === null || question === void 0 ? void 0 : question.form;
17
+ const listenForms = [
19
18
  "listenSelImg",
20
19
  "listenSelEn",
21
20
  "listenSelJp",
22
21
  ];
23
- var isListenForm = listenForms.includes(form);
24
- var fontSize = form === "basicSelImg" || form === "listenSelImg" ? "xl" : "xxxl";
22
+ const isListenForm = listenForms.includes(form);
23
+ const fontSize = form === "basicSelImg" || form === "listenSelImg" ? "xl" : "xxxl";
25
24
  if (isListenForm && mode === "quiz")
26
25
  return (<react_native_1.View style={styles.container}>
27
26
  <RepeatBtn_1.default />
@@ -30,7 +29,7 @@ var JQuestionText = function (_a) {
30
29
  <RubyText_1.default fsize={fontSize}>{quizText}</RubyText_1.default>
31
30
  </react_native_1.View>);
32
31
  };
33
- var styles = react_native_1.StyleSheet.create({
32
+ const styles = react_native_1.StyleSheet.create({
34
33
  container: {
35
34
  height: 100,
36
35
  justifyContent: "center",
@@ -3,14 +3,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- var react_redux_1 = require("react-redux");
7
- var common_1 = require("@nakamura-123/common");
8
- var lib_1 = require("@nakamura-123/lib");
9
- var react_1 = __importDefault(require("react"));
10
- var react_native_1 = require("react-native");
11
- var QuizCnt = function () {
12
- var turn = (0, react_redux_1.useSelector)(function (state) { return state.quiz.currentInfo.state.turn; }) + 1;
13
- var quizLength = (0, react_redux_1.useSelector)(function (state) { return state.quiz.quizList.length; });
6
+ const react_redux_1 = require("react-redux");
7
+ const common_1 = require("@nakamura-123/common");
8
+ const lib_1 = require("@nakamura-123/lib");
9
+ const react_1 = __importDefault(require("react"));
10
+ const react_native_1 = require("react-native");
11
+ const QuizCnt = () => {
12
+ const turn = (0, react_redux_1.useSelector)((state) => state.quiz.currentInfo.state.turn) + 1;
13
+ const quizLength = (0, react_redux_1.useSelector)((state) => state.quiz.quizList.length);
14
14
  return (<react_native_1.View style={styles.circle}>
15
15
  <common_1.MyText style={styles.mainText}>
16
16
  {turn}
@@ -18,7 +18,7 @@ var QuizCnt = function () {
18
18
  </common_1.MyText>
19
19
  </react_native_1.View>);
20
20
  };
21
- var styles = react_native_1.StyleSheet.create({
21
+ const styles = react_native_1.StyleSheet.create({
22
22
  circle: {
23
23
  // marginVertical: 10,
24
24
  marginTop: 3,
@@ -23,31 +23,30 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- var lib_1 = require("@nakamura-123/lib");
27
- var react_1 = __importStar(require("react"));
28
- var react_native_1 = require("react-native");
29
- var quizHook_1 = require("../../hooks/quizHook");
30
- var native_1 = require("@react-navigation/native");
31
- var react_redux_1 = require("react-redux");
32
- var stores_1 = require("@nakamura-123/stores");
33
- var react_redux_2 = require("react-redux");
34
- var TimeLimit = function (_a) {
35
- var _b = _a.timeLimit, timeLimit = _b === void 0 ? 10000 : _b;
36
- var dispatch = (0, react_redux_1.useDispatch)();
37
- var animationRef = (0, react_1.useRef)(null);
38
- var finishedVoice = (0, react_redux_2.useSelector)(function (state) { return state.quiz.currentInfo.jlpt.isFinishVoice; });
26
+ const lib_1 = require("@nakamura-123/lib");
27
+ const react_1 = __importStar(require("react"));
28
+ const react_native_1 = require("react-native");
29
+ const quizHook_1 = require("../../hooks/quizHook");
30
+ const native_1 = require("@react-navigation/native");
31
+ const react_redux_1 = require("react-redux");
32
+ const stores_1 = require("@nakamura-123/stores");
33
+ const react_redux_2 = require("react-redux");
34
+ const TimeLimit = ({ timeLimit = 10000 }) => {
35
+ const dispatch = (0, react_redux_1.useDispatch)();
36
+ const animationRef = (0, react_1.useRef)(null);
37
+ const finishedVoice = (0, react_redux_2.useSelector)((state) => state.quiz.currentInfo.jlpt.isFinishVoice);
39
38
  // if (!timeLimit) timeLimit = 10000;
40
- var progressAnim = (0, react_1.useRef)(new react_native_1.Animated.Value(1)).current;
41
- var mode = (0, quizHook_1.useGetMode)();
42
- var isFocused = (0, native_1.useIsFocused)();
43
- var barColor = timeLimit ? lib_1.colors.ltGreen : lib_1.colors.bkBeige;
44
- (0, react_1.useEffect)(function () {
39
+ const progressAnim = (0, react_1.useRef)(new react_native_1.Animated.Value(1)).current;
40
+ const mode = (0, quizHook_1.useGetMode)();
41
+ const isFocused = (0, native_1.useIsFocused)();
42
+ const barColor = timeLimit ? lib_1.colors.ltGreen : lib_1.colors.bkBeige;
43
+ (0, react_1.useEffect)(() => {
45
44
  var _a;
46
45
  if (!timeLimit || mode !== "quiz" || !isFocused)
47
46
  return;
48
47
  (_a = animationRef.current) === null || _a === void 0 ? void 0 : _a.stop(); // 前のアニメーション停止
49
- progressAnim.stopAnimation(function (currentValue) {
50
- var remaining = currentValue * timeLimit;
48
+ progressAnim.stopAnimation((currentValue) => {
49
+ const remaining = currentValue * timeLimit;
51
50
  animationRef.current = react_native_1.Animated.timing(progressAnim, {
52
51
  toValue: 0,
53
52
  duration: remaining,
@@ -55,8 +54,7 @@ var TimeLimit = function (_a) {
55
54
  });
56
55
  if (finishedVoice)
57
56
  animationRef.current.start();
58
- var listenerId = progressAnim.addListener(function (_a) {
59
- var value = _a.value;
57
+ const listenerId = progressAnim.addListener(({ value }) => {
60
58
  if (value <= 0) {
61
59
  dispatch(stores_1.quizAction.setIsCorrected(false));
62
60
  dispatch(stores_1.quizAction.changeMode("check"));
@@ -64,12 +62,12 @@ var TimeLimit = function (_a) {
64
62
  }
65
63
  });
66
64
  });
67
- return function () {
65
+ return () => {
68
66
  var _a;
69
67
  (_a = animationRef.current) === null || _a === void 0 ? void 0 : _a.stop();
70
68
  };
71
69
  }, [timeLimit, mode, isFocused, finishedVoice]);
72
- var widthInterpolate = progressAnim.interpolate({
70
+ const widthInterpolate = progressAnim.interpolate({
73
71
  inputRange: [0, 1],
74
72
  outputRange: ["0%", "100%"],
75
73
  });
@@ -80,7 +78,7 @@ var TimeLimit = function (_a) {
80
78
  ]}/>
81
79
  </react_native_1.View>);
82
80
  };
83
- var styles = react_native_1.StyleSheet.create({
81
+ const styles = react_native_1.StyleSheet.create({
84
82
  backgroundBar: {
85
83
  marginTop: 10,
86
84
  width: "90%",
@@ -3,25 +3,24 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- var react_1 = __importDefault(require("react"));
7
- var react_redux_1 = require("react-redux");
8
- var common_1 = require("@nakamura-123/common");
9
- var FillDiagram = function (_a) {
10
- var navigation = _a.navigation, word = _a.word, yearId = _a.yearId;
11
- var qImgs = (0, react_redux_1.useSelector)(function (state) { return state.app.imgs.qImgs; });
12
- var diagramPathNum = getFullImgPathFromWord(word, qImgs, yearId);
13
- return (<common_1.MiniIconBtn onPress={function () { return navigation.navigate("ImgZoom", { path: diagramPathNum }); }} icon="image" title="全体図" color="beige" size="sm" outline outerStyle={{ marginLeft: 5 }}/>);
6
+ const react_1 = __importDefault(require("react"));
7
+ const react_redux_1 = require("react-redux");
8
+ const common_1 = require("@nakamura-123/common");
9
+ const FillDiagram = ({ navigation, word, yearId, }) => {
10
+ const qImgs = (0, react_redux_1.useSelector)((state) => state.app.imgs.qImgs);
11
+ const diagramPathNum = getFullImgPathFromWord(word, qImgs, yearId);
12
+ return (<common_1.MiniIconBtn onPress={() => navigation.navigate("ImgZoom", { path: diagramPathNum })} icon="image" title="全体図" color="beige" size="sm" outline outerStyle={{ marginLeft: 5 }}/>);
14
13
  };
15
14
  // 関数定義
16
15
  // 画像パスを取得
17
- var getFullImgPathFromWord = function (word, qImgs, yearId) {
18
- var num = extractNumberFromString(word);
19
- var path = qImgs["diagram"]["q".concat(yearId, "_").concat(num)];
16
+ const getFullImgPathFromWord = (word, qImgs, yearId) => {
17
+ const num = extractNumberFromString(word);
18
+ const path = qImgs["diagram"][`q${yearId}_${num}`];
20
19
  return path;
21
20
  };
22
21
  // 数字を抽出
23
- var extractNumberFromString = function (input) {
24
- var match = input.match(/\d+/);
22
+ const extractNumberFromString = (input) => {
23
+ const match = input.match(/\d+/);
25
24
  return match ? parseInt(match[0], 10) : null;
26
25
  };
27
26
  exports.default = FillDiagram;