@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
@@ -3,39 +3,38 @@ 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 FillDiagram_1 = __importDefault(require("./FillDiagram"));
11
- var SearchYoutue_1 = __importDefault(require("./SearchYoutue"));
12
- var RenderImgOrText_1 = __importDefault(require("../common/RenderImgOrText"));
13
- var QuestionReference_1 = __importDefault(require("./QuestionReference"));
14
- var quizHook_1 = require("../../hooks/quizHook");
15
- var QuestionFormats_1 = require("./QuestionFormats");
16
- var quizHook_2 = require("../../hooks/quizHook");
17
- var Question = function (_a) {
18
- var navigation = _a.navigation;
19
- var question = (0, quizHook_1.useQuestionDataD)();
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 FillDiagram_1 = __importDefault(require("./FillDiagram"));
11
+ const SearchYoutue_1 = __importDefault(require("./SearchYoutue"));
12
+ const RenderImgOrText_1 = __importDefault(require("../common/RenderImgOrText"));
13
+ const QuestionReference_1 = __importDefault(require("./QuestionReference"));
14
+ const quizHook_1 = require("../../hooks/quizHook");
15
+ const QuestionFormats_1 = require("./QuestionFormats");
16
+ const quizHook_2 = require("../../hooks/quizHook");
17
+ const Question = ({ navigation }) => {
18
+ let question = (0, quizHook_1.useQuestionDataD)();
20
19
  if (!question)
21
20
  return null;
22
21
  // クイズの問題文を取得
23
- var yearId = question.yearId, style = question.style, title = question.title, form = question.form;
24
- var multiState = (0, react_redux_1.useSelector)(function (state) { return state.quiz.currentInfo.multi; });
25
- var mode = (0, quizHook_2.useGetMode)();
26
- var isQuizMode = mode === "quiz";
22
+ const { yearId, style, title, form } = question;
23
+ const multiState = (0, react_redux_1.useSelector)((state) => state.quiz.currentInfo.multi);
24
+ const mode = (0, quizHook_2.useGetMode)();
25
+ const isQuizMode = mode === "quiz";
27
26
  if (form === "multi")
28
- question = (0, QuestionFormats_1.formatMultiQuestion)({ question: question, multiState: multiState, mode: mode });
27
+ question = (0, QuestionFormats_1.formatMultiQuestion)({ question, multiState, mode });
29
28
  if (form === "blank")
30
29
  question = (0, QuestionFormats_1.formatBlankQuestion)(question, question.blankAns, isQuizMode);
31
- var questionWords = question.question;
30
+ const questionWords = question.question;
32
31
  // ボタン部分
33
- var diagramPath = findDiagramInStyle(style);
34
- var isYoutubeSearch = (0, react_redux_1.useSelector)(function (state) { var _a; return (_a = state.app.appSetting.setting) === null || _a === void 0 ? void 0 : _a.isYoutubeSearch; });
32
+ const diagramPath = findDiagramInStyle(style);
33
+ const isYoutubeSearch = (0, react_redux_1.useSelector)((state) => { var _a; return (_a = state.app.appSetting.setting) === null || _a === void 0 ? void 0 : _a.isYoutubeSearch; });
35
34
  // 問題文章がmultiの場合の整形
36
35
  return (<react_native_1.View style={styles.container}>
37
36
  {/* 問題表示 */}
38
- {questionWords.map(function (word, index) { return (<RenderImgOrText_1.default key={index} word={word} imgKey={"q" + yearId} navigation={navigation}/>); })}
37
+ {questionWords.map((word, index) => (<RenderImgOrText_1.default key={index} word={word} imgKey={"q" + yearId} navigation={navigation}/>))}
39
38
  <QuestionReference_1.default />
40
39
  {/* ボタン類(youtube、全体図) */}
41
40
  <react_native_1.View style={styles.btnBox}>
@@ -46,10 +45,10 @@ var Question = function (_a) {
46
45
  };
47
46
  // 関数定義
48
47
  // styleから図のパスを取得
49
- var findDiagramInStyle = function (style) {
50
- return style.find(function (item) { return item.includes("diagram"); });
48
+ const findDiagramInStyle = (style) => {
49
+ return style.find((item) => item.includes("diagram"));
51
50
  };
52
- var styles = react_native_1.StyleSheet.create({
51
+ const styles = react_native_1.StyleSheet.create({
53
52
  container: {
54
53
  justifyContent: "flex-start",
55
54
  backgroundColor: lib_1.colors.ltBeige,
@@ -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
  Object.defineProperty(exports, "__esModule", { value: true });
14
3
  exports.formatBlankQuestion = exports.formatMultiQuestion = void 0;
15
4
  // 01.メインロジック・複数選択問題のフォーマット
16
- var formatMultiQuestion = function (_a) {
17
- var question = _a.question, multiState = _a.multiState, mode = _a.mode;
18
- var questionTexts = question.question, multiSel = question.multiSel, selectedIndexes = question.selectedIndexes;
5
+ const formatMultiQuestion = ({ question, multiState, mode, }) => {
6
+ const { question: questionTexts, multiSel, selectedIndexes } = question;
19
7
  // ansSels を抽出
20
- var formattedQuestions = questionTexts.map(function (qText) {
21
- return replaceMultiText(qText, multiState, multiSel, mode, selectedIndexes);
22
- });
23
- return __assign(__assign({}, question), { question: formattedQuestions });
8
+ const formattedQuestions = questionTexts.map((qText) => replaceMultiText(qText, multiState, multiSel, mode, selectedIndexes));
9
+ return Object.assign(Object.assign({}, question), { question: formattedQuestions });
24
10
  };
25
11
  exports.formatMultiQuestion = formatMultiQuestion;
26
12
  // 02.複数選択問題のzz1部分を赤や青、答えに置き換える
27
- var RED_ZZ = "ZZAZZ";
28
- var BLUE_ZZ = "ZZBZZ";
29
- var replaceMultiText = function (qText, multiState, multiSel, mode, selectedIndexes) {
30
- var returnText = qText;
31
- var ansSels = multiSel.map(function (array) { var _a, _b; return (_b = (_a = array.find(function (a) { return a.isCorrect; })) === null || _a === void 0 ? void 0 : _a.choice) !== null && _b !== void 0 ? _b : ""; });
32
- ansSels.forEach(function (sel, i) {
33
- var nom = i + 1;
34
- var regex = new RegExp("zz".concat(nom), "g");
35
- var state = mode === "quiz"
13
+ const RED_ZZ = "ZZAZZ";
14
+ const BLUE_ZZ = "ZZBZZ";
15
+ const replaceMultiText = (qText, multiState, multiSel, mode, selectedIndexes) => {
16
+ let returnText = qText;
17
+ const ansSels = multiSel.map((array) => { var _a, _b; return (_b = (_a = array.find((a) => a.isCorrect)) === null || _a === void 0 ? void 0 : _a.choice) !== null && _b !== void 0 ? _b : ""; });
18
+ ansSels.forEach((sel, i) => {
19
+ const nom = i + 1;
20
+ const regex = new RegExp(`zz${nom}`, "g");
21
+ const state = mode === "quiz"
36
22
  ? checkMultiState(multiState, i)
37
23
  : checkMultiStateResult(multiSel, selectedIndexes, i);
38
24
  if (state === "this")
@@ -40,15 +26,15 @@ var replaceMultiText = function (qText, multiState, multiSel, mode, selectedInde
40
26
  else if (state === "next")
41
27
  returnText = returnText.replace(regex, BLUE_ZZ);
42
28
  else if (state === "correct")
43
- returnText = returnText.replace(regex, "JJ".concat(sel, "JJ"));
29
+ returnText = returnText.replace(regex, `JJ${sel}JJ`);
44
30
  else if (state === "inCorrect")
45
- returnText = returnText.replace(regex, "JB".concat(sel, "BJ"));
31
+ returnText = returnText.replace(regex, `JB${sel}BJ`);
46
32
  });
47
33
  return returnText;
48
34
  };
49
35
  // 03.zz1などの形を判定する
50
- var checkMultiState = function (multiState, index) {
51
- var mTurn = multiState.turn, mMode = multiState.mode, isCorrects = multiState.isCorrects;
36
+ const checkMultiState = (multiState, index) => {
37
+ const { turn: mTurn, mode: mMode, isCorrects } = multiState;
52
38
  if (index === mTurn && mMode === "quiz")
53
39
  return "this";
54
40
  if (index > mTurn)
@@ -56,33 +42,31 @@ var checkMultiState = function (multiState, index) {
56
42
  return isCorrects[index] ? "correct" : "inCorrect";
57
43
  };
58
44
  // 04.check時とresult時の表示
59
- var checkMultiStateResult = function (multiSel, selectedIndexes, index) {
45
+ const checkMultiStateResult = (multiSel, selectedIndexes, index) => {
60
46
  if (!selectedIndexes || selectedIndexes.length === 0)
61
47
  return "inCorrect";
62
48
  if (multiSel.length > selectedIndexes.length)
63
49
  return "inCorrect";
64
- var selectedIndex = selectedIndexes[index];
65
- var isCorrect = multiSel[index][selectedIndex].isCorrect;
50
+ const selectedIndex = selectedIndexes[index];
51
+ const isCorrect = multiSel[index][selectedIndex].isCorrect;
66
52
  if (isCorrect)
67
53
  return "correct";
68
54
  else
69
55
  return "inCorrect";
70
56
  };
71
57
  // 10. 穴埋め問題のフォーマット
72
- var formatBlankQuestion = function (question, blankAns, isQuizMode) {
73
- return __assign(__assign({}, question), { question: question.question.map(function (qText) {
74
- return replaceBlankText(qText, blankAns, isQuizMode);
75
- }) });
58
+ const formatBlankQuestion = (question, blankAns, isQuizMode) => {
59
+ return Object.assign(Object.assign({}, question), { question: question.question.map((qText) => replaceBlankText(qText, blankAns, isQuizMode)) });
76
60
  };
77
61
  exports.formatBlankQuestion = formatBlankQuestion;
78
- var replaceBlankText = function (qText, blankAns, isQuizMode) {
79
- var returnText = qText;
80
- blankAns.forEach(function (ans, i) {
81
- var nom = i + 1;
82
- var regex = new RegExp("zz".concat(nom), "g");
62
+ const replaceBlankText = (qText, blankAns, isQuizMode) => {
63
+ let returnText = qText;
64
+ blankAns.forEach((ans, i) => {
65
+ const nom = i + 1;
66
+ const regex = new RegExp(`zz${nom}`, "g");
83
67
  returnText = isQuizMode
84
- ? returnText.replace(regex, "XX".concat(nom, "XX"))
85
- : returnText.replace(regex, "JJ".concat(ans, "JJ"));
68
+ ? returnText.replace(regex, `XX${nom}XX`)
69
+ : returnText.replace(regex, `JJ${ans}JJ`);
86
70
  });
87
71
  return returnText;
88
72
  };
@@ -3,19 +3,19 @@ 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 common_1 = require("@nakamura-123/common");
10
- var QuestionReference = function () {
11
- var quizSource = (0, react_redux_1.useSelector)(function (state) { var _a; return (_a = state.app.appSetting.quizName) === null || _a === void 0 ? void 0 : _a.quizReference; });
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 common_1 = require("@nakamura-123/common");
10
+ const QuestionReference = () => {
11
+ const quizSource = (0, react_redux_1.useSelector)((state) => { var _a; return (_a = state.app.appSetting.quizName) === null || _a === void 0 ? void 0 : _a.quizReference; });
12
12
  if (quizSource === "")
13
13
  return null;
14
14
  return (<react_native_1.View style={styles.container}>
15
15
  <common_1.MyText style={styles.text}> 出典:{quizSource}</common_1.MyText>
16
16
  </react_native_1.View>);
17
17
  };
18
- var styles = react_native_1.StyleSheet.create({
18
+ const styles = react_native_1.StyleSheet.create({
19
19
  container: {
20
20
  flex: 1,
21
21
  alignItems: "flex-end",
@@ -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 react_1 = __importDefault(require("react"));
7
- var react_native_1 = require("react-native");
8
- var react_redux_1 = require("react-redux");
9
- var common_1 = require("@nakamura-123/common");
10
- var lib_1 = require("@nakamura-123/lib");
11
- var SearchYoutube = function (_a) {
12
- var title = _a.title;
13
- var examName = (0, react_redux_1.useSelector)(function (state) { var _a; return (_a = state.app.appSetting.quizName) === null || _a === void 0 ? void 0 : _a.appName; });
14
- var searchWord = "".concat(examName, "+").concat(title);
15
- return (<common_1.MiniIconBtn onPress={function () { return lib_1.utilFnc.handleYoutubeSearch(searchWord); }} icon="youtube" title="検索" color="beige" size="sm" outline/>);
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 common_1 = require("@nakamura-123/common");
10
+ const lib_1 = require("@nakamura-123/lib");
11
+ const SearchYoutube = ({ title }) => {
12
+ const examName = (0, react_redux_1.useSelector)((state) => { var _a; return (_a = state.app.appSetting.quizName) === null || _a === void 0 ? void 0 : _a.appName; });
13
+ const searchWord = `${examName}+${title}`;
14
+ return (<common_1.MiniIconBtn onPress={() => lib_1.utilFnc.handleYoutubeSearch(searchWord)} icon="youtube" title="検索" color="beige" size="sm" outline/>);
16
15
  };
17
16
  // 関数定義
18
17
  // 画像パスを取得
19
- var styles = react_native_1.StyleSheet.create({});
18
+ const styles = react_native_1.StyleSheet.create({});
20
19
  exports.default = SearchYoutube;
@@ -23,35 +23,34 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- var react_1 = __importStar(require("react"));
27
- var react_native_1 = require("react-native");
28
- var react_redux_1 = require("react-redux");
29
- var Animatable = __importStar(require("react-native-animatable"));
30
- var common_1 = require("@nakamura-123/common");
31
- var stores_1 = require("@nakamura-123/stores");
32
- var loadQuizFromStorage = stores_1.saveStorage.loadQuizFromStorage;
33
- var QuizSaveData = function (_a) {
34
- var navigation = _a.navigation, saveKey = _a.saveKey;
35
- var dispatch = (0, react_redux_1.useDispatch)();
36
- var t = (0, common_1.useDrillTranslation)().t;
37
- var isExistedSaveData = (0, react_redux_1.useSelector)(function (state) { return state.score.isSave[saveKey]; });
38
- var lessonTitle = (0, react_redux_1.useSelector)(function (state) { return state.quiz.selected.lesson.title; });
39
- var turn = (0, react_redux_1.useSelector)(function (state) { return state.quiz.currentInfo.state.turn; });
40
- (0, react_1.useEffect)(function () {
26
+ const react_1 = __importStar(require("react"));
27
+ const react_native_1 = require("react-native");
28
+ const react_redux_1 = require("react-redux");
29
+ const Animatable = __importStar(require("react-native-animatable"));
30
+ const common_1 = require("@nakamura-123/common");
31
+ const stores_1 = require("@nakamura-123/stores");
32
+ const { loadQuizFromStorage } = stores_1.saveStorage;
33
+ const QuizSaveData = ({ navigation, saveKey }) => {
34
+ const dispatch = (0, react_redux_1.useDispatch)();
35
+ const { t } = (0, common_1.useDrillTranslation)();
36
+ const isExistedSaveData = (0, react_redux_1.useSelector)((state) => state.score.isSave[saveKey]);
37
+ const lessonTitle = (0, react_redux_1.useSelector)((state) => state.quiz.selected.lesson.title);
38
+ const turn = (0, react_redux_1.useSelector)((state) => state.quiz.currentInfo.state.turn);
39
+ (0, react_1.useEffect)(() => {
41
40
  dispatch(loadQuizFromStorage(saveKey));
42
41
  }, []);
43
42
  if (!isExistedSaveData)
44
43
  return null;
45
- var title = t("quiz.continue.title");
46
- var note = "\u3010".concat(lessonTitle, "\u3011").concat(turn + 1).concat(t("quiz.continue.note"));
47
- var onPress = function () {
44
+ const title = t("quiz.continue.title");
45
+ const note = `【${lessonTitle}】${turn + 1}${t("quiz.continue.note")}`;
46
+ const onPress = () => {
48
47
  navigation.navigate("Quiz");
49
48
  };
50
49
  return (<Animatable.View style={styles.fixedBottom} animation="fadeIn" duration={500} useNativeDriver>
51
50
  <common_1.RectangleCard title={title} note={note} left={<common_1.IconInCircle name="save" size={30}/>} onPress={onPress} color="blue" style={styles.card}/>
52
51
  </Animatable.View>);
53
52
  };
54
- var styles = react_native_1.StyleSheet.create({
53
+ const styles = react_native_1.StyleSheet.create({
55
54
  fixedBottom: {
56
55
  position: "absolute",
57
56
  bottom: 0,
@@ -3,33 +3,28 @@ 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 common_1 = require("@nakamura-123/common");
10
- var stores_1 = require("@nakamura-123/stores");
11
- var quizHook_1 = require("../../hooks/quizHook");
12
- var quizActionHook_1 = require("../../hooks/quizActionHook");
13
- var Bottom3BtnJ = function (_a) {
14
- var navigation = _a.navigation;
15
- var dispatch = (0, react_redux_1.useDispatch)();
16
- var mode = (0, quizHook_1.useGetMode)();
17
- var nextQuizAction = (0, quizActionHook_1.useNextQuizAction)();
18
- var _b = (0, react_redux_1.useSelector)(function (state) { return state.quiz.currentInfo.state; }), turn = _b.turn, activeTurn = _b.activeTurn;
19
- var isActiveTurn = turn === activeTurn;
20
- var btnList = [
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 common_1 = require("@nakamura-123/common");
10
+ const stores_1 = require("@nakamura-123/stores");
11
+ const quizHook_1 = require("../../hooks/quizHook");
12
+ const quizActionHook_1 = require("../../hooks/quizActionHook");
13
+ const Bottom3BtnJ = ({ navigation }) => {
14
+ const dispatch = (0, react_redux_1.useDispatch)();
15
+ const mode = (0, quizHook_1.useGetMode)();
16
+ const nextQuizAction = (0, quizActionHook_1.useNextQuizAction)();
17
+ const { turn, activeTurn } = (0, react_redux_1.useSelector)((state) => state.quiz.currentInfo.state);
18
+ const isActiveTurn = turn === activeTurn;
19
+ const btnList = [
21
20
  // 1つ目
22
- createBtnInfo("arrow-left", "Back", function () {
23
- return dispatch(stores_1.quizAction.beforeTurn());
24
- }),
21
+ createBtnInfo("arrow-left", "Back", () => dispatch(stores_1.quizAction.beforeTurn())),
25
22
  // 2つ目
26
- createBtnInfo("envelope", "Mail", function () { return navigation.navigate("Report"); }),
23
+ createBtnInfo("envelope", "Mail", () => navigation.navigate("Report")),
27
24
  // 3つ目 quizなら「パス」、checkなら「次へ」
28
25
  mode === "quiz"
29
- ? createBtnInfo("arrow-right", "Skip", function () {
30
- return dispatch(stores_1.quizAction.changeMode("check"));
31
- })
32
- : createBtnInfo("arrow-right", "Next", function () {
26
+ ? createBtnInfo("arrow-right", "Skip", () => dispatch(stores_1.quizAction.changeMode("check")))
27
+ : createBtnInfo("arrow-right", "Next", () => {
33
28
  if (mode === "result" || !isActiveTurn)
34
29
  dispatch(stores_1.quizAction.nextTurn());
35
30
  else
@@ -37,15 +32,15 @@ var Bottom3BtnJ = function (_a) {
37
32
  }),
38
33
  ];
39
34
  return (<react_native_1.View style={styles.container}>
40
- {btnList.map(function (btn) { return (<common_1.IconTextBtn btn={btn} key={btn.text}/>); })}
35
+ {btnList.map((btn) => (<common_1.IconTextBtn btn={btn} key={btn.text}/>))}
41
36
  </react_native_1.View>);
42
37
  };
43
- var createBtnInfo = function (icon, text, onPress) { return ({
44
- icon: icon,
45
- text: text,
46
- onPress: onPress,
47
- }); };
48
- var styles = react_native_1.StyleSheet.create({
38
+ const createBtnInfo = (icon, text, onPress) => ({
39
+ icon,
40
+ text,
41
+ onPress,
42
+ });
43
+ const styles = react_native_1.StyleSheet.create({
49
44
  container: {
50
45
  flexDirection: "row",
51
46
  justifyContent: "center",
@@ -3,33 +3,28 @@ 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 common_1 = require("@nakamura-123/common");
10
- var stores_1 = require("@nakamura-123/stores");
11
- var quizHook_1 = require("../../hooks/quizHook");
12
- var quizActionHook_1 = require("../../hooks/quizActionHook");
13
- var NextQuiz = function (_a) {
14
- var navigation = _a.navigation;
15
- var dispatch = (0, react_redux_1.useDispatch)();
16
- var mode = (0, quizHook_1.useGetMode)();
17
- var nextQuizAction = (0, quizActionHook_1.useNextQuizAction)();
18
- var _b = (0, react_redux_1.useSelector)(function (state) { return state.quiz.currentInfo.state; }), turn = _b.turn, activeTurn = _b.activeTurn;
19
- var isActiveTurn = turn === activeTurn;
20
- var btnList = [
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 common_1 = require("@nakamura-123/common");
10
+ const stores_1 = require("@nakamura-123/stores");
11
+ const quizHook_1 = require("../../hooks/quizHook");
12
+ const quizActionHook_1 = require("../../hooks/quizActionHook");
13
+ const NextQuiz = ({ navigation }) => {
14
+ const dispatch = (0, react_redux_1.useDispatch)();
15
+ const mode = (0, quizHook_1.useGetMode)();
16
+ const nextQuizAction = (0, quizActionHook_1.useNextQuizAction)();
17
+ const { turn, activeTurn } = (0, react_redux_1.useSelector)((state) => state.quiz.currentInfo.state);
18
+ const isActiveTurn = turn === activeTurn;
19
+ const btnList = [
21
20
  // 1つ目
22
- createBtnInfo("arrow-left", "戻る", function () {
23
- return dispatch(stores_1.quizAction.beforeTurn());
24
- }),
21
+ createBtnInfo("arrow-left", "戻る", () => dispatch(stores_1.quizAction.beforeTurn())),
25
22
  // 2つ目
26
- createBtnInfo("envelope", "報告", function () { return navigation.navigate("Report"); }),
23
+ createBtnInfo("envelope", "報告", () => navigation.navigate("Report")),
27
24
  // 3つ目 quizなら「パス」、checkなら「次へ」
28
25
  mode === "quiz"
29
- ? createBtnInfo("question-circle", "パス", function () {
30
- return dispatch(stores_1.quizAction.changeMode("check"));
31
- })
32
- : createBtnInfo("arrow-right", "次へ", function () {
26
+ ? createBtnInfo("question-circle", "パス", () => dispatch(stores_1.quizAction.changeMode("check")))
27
+ : createBtnInfo("arrow-right", "次へ", () => {
33
28
  if (mode === "result" || !isActiveTurn)
34
29
  dispatch(stores_1.quizAction.nextTurn());
35
30
  else
@@ -37,15 +32,15 @@ var NextQuiz = function (_a) {
37
32
  }),
38
33
  ];
39
34
  return (<react_native_1.View style={styles.container}>
40
- {btnList.map(function (btn) { return (<common_1.IconTextBtn btn={btn} key={btn.text}/>); })}
35
+ {btnList.map((btn) => (<common_1.IconTextBtn btn={btn} key={btn.text}/>))}
41
36
  </react_native_1.View>);
42
37
  };
43
- var createBtnInfo = function (icon, text, onPress) { return ({
44
- icon: icon,
45
- text: text,
46
- onPress: onPress,
47
- }); };
48
- var styles = react_native_1.StyleSheet.create({
38
+ const createBtnInfo = (icon, text, onPress) => ({
39
+ icon,
40
+ text,
41
+ onPress,
42
+ });
43
+ const styles = react_native_1.StyleSheet.create({
49
44
  container: {
50
45
  flexDirection: "row",
51
46
  justifyContent: "center",
@@ -3,39 +3,36 @@ 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 common_1 = require("@nakamura-123/common");
9
- var quizHook_1 = require("../../hooks/quizHook");
10
- var lib_1 = require("@nakamura-123/lib");
11
- var GuideBtn = function (_a) {
12
- var navigation = _a.navigation;
13
- var question = (0, quizHook_1.useQuestionDataJ)();
14
- var mode = (0, quizHook_1.useGetMode)();
6
+ const react_1 = __importDefault(require("react"));
7
+ const react_native_1 = require("react-native");
8
+ const common_1 = require("@nakamura-123/common");
9
+ const quizHook_1 = require("../../hooks/quizHook");
10
+ const lib_1 = require("@nakamura-123/lib");
11
+ const GuideBtn = ({ navigation }) => {
12
+ const question = (0, quizHook_1.useQuestionDataJ)();
13
+ const mode = (0, quizHook_1.useGetMode)();
15
14
  if (mode === "quiz")
16
15
  return <react_native_1.View></react_native_1.View>; // modeがquizでない場合は何も表示しない
17
- var quizId = (question === null || question === void 0 ? void 0 : question.quizId) || null;
16
+ const quizId = (question === null || question === void 0 ? void 0 : question.quizId) || null;
18
17
  if (quizId === null || !question)
19
18
  return <react_native_1.View></react_native_1.View>; // quizIdがnullの場合は何も表示しない
20
- var quizType = question.form === "basicSelImg" || question.form === "listenSelImg"
19
+ const quizType = question.form === "basicSelImg" || question.form === "listenSelImg"
21
20
  ? "jpSentence"
22
21
  : "jpWord";
23
- var searchBtn = createBtnInfo("search", "Search", function () {
24
- var searchWord = lib_1.utilFnc.parseRubyText(question[quizType]);
25
- var removeRuby = lib_1.utilFnc.removeRuby(searchWord);
22
+ const searchBtn = createBtnInfo("search", "Search", () => {
23
+ const searchWord = lib_1.utilFnc.parseRubyText(question[quizType]);
24
+ const removeRuby = lib_1.utilFnc.removeRuby(searchWord);
26
25
  lib_1.utilFnc.handleSearchTrans(removeRuby);
27
26
  });
28
- var guideBtn = createBtnInfo("book", "Guide", function () {
29
- return navigation.navigate("Guide", { quizId: quizId });
30
- });
27
+ const guideBtn = createBtnInfo("book", "Guide", () => navigation.navigate("Guide", { quizId: quizId }));
31
28
  return (<react_native_1.View style={{ flexDirection: "row", alignItems: "center" }}>
32
29
  <common_1.IconTextBtn btn={searchBtn} style={{ marginLeft: "auto" }} key={searchBtn.text}/>
33
30
  <common_1.IconTextBtn btn={guideBtn} key={guideBtn.text}/>
34
31
  </react_native_1.View>);
35
32
  };
36
- var createBtnInfo = function (icon, text, onPress) { return ({
37
- icon: icon,
38
- text: text,
39
- onPress: onPress,
40
- }); };
33
+ const createBtnInfo = (icon, text, onPress) => ({
34
+ icon,
35
+ text,
36
+ onPress,
37
+ });
41
38
  exports.default = GuideBtn;
@@ -23,42 +23,37 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- var react_1 = __importStar(require("react"));
27
- var react_native_1 = require("react-native");
28
- var react_redux_1 = require("react-redux");
29
- var lib_1 = require("@nakamura-123/lib");
30
- var common_1 = require("@nakamura-123/common");
31
- var quizHook_1 = require("../../hooks/quizHook");
32
- var react_redux_2 = require("react-redux");
33
- var RepeatBtn = function (_a) {
34
- var isPreLoad = _a.isPreLoad;
35
- var dispatch = (0, react_redux_1.useDispatch)();
36
- var question = (0, quizHook_1.useQuestionDataJ)();
37
- var quizId = (question === null || question === void 0 ? void 0 : question.quizId) || null;
26
+ const react_1 = __importStar(require("react"));
27
+ const react_native_1 = require("react-native");
28
+ const react_redux_1 = require("react-redux");
29
+ const lib_1 = require("@nakamura-123/lib");
30
+ const common_1 = require("@nakamura-123/common");
31
+ const quizHook_1 = require("../../hooks/quizHook");
32
+ const react_redux_2 = require("react-redux");
33
+ const RepeatBtn = ({ isPreLoad }) => {
34
+ const dispatch = (0, react_redux_1.useDispatch)();
35
+ const question = (0, quizHook_1.useQuestionDataJ)();
36
+ const quizId = (question === null || question === void 0 ? void 0 : question.quizId) || null;
38
37
  if (quizId === null)
39
38
  return <react_native_1.View></react_native_1.View>; // quizIdがnullの場合は何も表示しない
40
39
  // 音声の設定
41
- var mode = (0, quizHook_1.useGetMode)();
42
- var voice = (0, quizHook_1.useGetVoicePath)(quizId);
43
- var wordVoice = (0, quizHook_1.useGetVoicePath)(quizId, "word");
44
- var sentenceVoice = (0, quizHook_1.useGetVoicePath)(quizId, "sentence");
45
- var voiceVolume = (0, react_redux_2.useSelector)(function (state) { return state.quizCfg.inQuizOption.voiceVolume; });
46
- var finishedVoice = function () {
47
- return dispatch({ type: "quiz/changeFinishVoice", payload: true });
48
- };
49
- var finishedVoiceReset = function () {
50
- return dispatch({ type: "quiz/changeFinishVoice", payload: false });
51
- };
40
+ const mode = (0, quizHook_1.useGetMode)();
41
+ const voice = (0, quizHook_1.useGetVoicePath)(quizId);
42
+ const wordVoice = (0, quizHook_1.useGetVoicePath)(quizId, "word");
43
+ const sentenceVoice = (0, quizHook_1.useGetVoicePath)(quizId, "sentence");
44
+ const voiceVolume = (0, react_redux_2.useSelector)((state) => state.quizCfg.inQuizOption.voiceVolume);
45
+ const finishedVoice = () => dispatch({ type: "quiz/changeFinishVoice", payload: true });
46
+ const finishedVoiceReset = () => dispatch({ type: "quiz/changeFinishVoice", payload: false });
52
47
  // 音声のプリロード・初回再生
53
- (0, react_1.useEffect)(function () {
48
+ (0, react_1.useEffect)(() => {
54
49
  if (!isPreLoad || !wordVoice || !sentenceVoice)
55
50
  return;
56
- var isPlay = mode === "quiz";
51
+ const isPlay = mode === "quiz";
57
52
  if (voice)
58
53
  lib_1.voiceFnc.preloadVoiceById(voice, isPlay, voiceVolume, finishedVoice);
59
54
  else
60
55
  finishedVoice();
61
- return function () {
56
+ return () => {
62
57
  lib_1.voiceFnc.unloadVoiceById(wordVoice);
63
58
  lib_1.voiceFnc.unloadVoiceById(sentenceVoice);
64
59
  finishedVoiceReset();
@@ -66,15 +61,13 @@ var RepeatBtn = function (_a) {
66
61
  }, [quizId]);
67
62
  if (!voice)
68
63
  return <react_native_1.View></react_native_1.View>; // voiceがnullの場合は何も表示しない
69
- var btn = createBtnInfo("volume-up", "Repeat", function () {
70
- return lib_1.voiceFnc.playVoice(voice, voiceVolume);
71
- });
64
+ const btn = createBtnInfo("volume-up", "Repeat", () => lib_1.voiceFnc.playVoice(voice, voiceVolume));
72
65
  return (<common_1.IconTextBtn btn={btn} style={{ marginRight: "auto" }} key={btn.text}/> // IconTextBtnを使用
73
66
  );
74
67
  };
75
- var createBtnInfo = function (icon, text, onPress) { return ({
76
- icon: icon,
77
- text: text,
78
- onPress: onPress,
79
- }); };
68
+ const createBtnInfo = (icon, text, onPress) => ({
69
+ icon,
70
+ text,
71
+ onPress,
72
+ });
80
73
  exports.default = RepeatBtn;