@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
@@ -26,56 +26,55 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- var react_1 = __importStar(require("react"));
30
- var react_native_1 = require("react-native");
31
- var react_2 = require("@realm/react");
32
- var react_redux_1 = require("react-redux");
33
- var lib_1 = require("@nakamura-123/lib");
34
- var db_1 = require("@nakamura-123/db");
35
- var InputFnc_1 = require("./Input/InputFnc");
36
- var InputBox_1 = __importDefault(require("./Input/InputBox"));
37
- var InputTab_1 = __importDefault(require("./Input/InputTab"));
38
- var InputSaveSelector_1 = __importDefault(require("./Input/InputSaveSelector"));
39
- var InputCounter_1 = __importDefault(require("./Input/InputCounter"));
40
- var quizHook_1 = require("../../hooks/quizHook");
41
- var InputAnswerBtn_1 = __importDefault(require("./Input/InputAnswerBtn"));
42
- var InputWarnning_1 = __importDefault(require("./Input/InputWarnning"));
43
- var InputNav = function (_a) {
44
- var _b, _c, _d;
45
- var question = _a.question;
46
- var dispatch = (0, react_redux_1.useDispatch)();
47
- var _e = react_1.default.useState(0), index = _e[0], setIndex = _e[1];
48
- var inputId = question.inputId;
49
- var InputDB = (0, react_2.useQuery)(db_1.InputSchema);
50
- var realm = (0, react_2.useRealm)();
51
- var Input = InputDB.find(function (data) { return data.inputId === inputId; });
52
- var mode = (0, quizHook_1.useGetMode)();
29
+ const react_1 = __importStar(require("react"));
30
+ const react_native_1 = require("react-native");
31
+ const react_2 = require("@realm/react");
32
+ const react_redux_1 = require("react-redux");
33
+ const lib_1 = require("@nakamura-123/lib");
34
+ const db_1 = require("@nakamura-123/db");
35
+ const InputFnc_1 = require("./Input/InputFnc");
36
+ const InputBox_1 = __importDefault(require("./Input/InputBox"));
37
+ const InputTab_1 = __importDefault(require("./Input/InputTab"));
38
+ const InputSaveSelector_1 = __importDefault(require("./Input/InputSaveSelector"));
39
+ const InputCounter_1 = __importDefault(require("./Input/InputCounter"));
40
+ const quizHook_1 = require("../../hooks/quizHook");
41
+ const InputAnswerBtn_1 = __importDefault(require("./Input/InputAnswerBtn"));
42
+ const InputWarnning_1 = __importDefault(require("./Input/InputWarnning"));
43
+ const InputNav = ({ question }) => {
44
+ var _a, _b, _c;
45
+ const dispatch = (0, react_redux_1.useDispatch)();
46
+ const [index, setIndex] = react_1.default.useState(0);
47
+ const inputId = question.inputId;
48
+ const InputDB = (0, react_2.useQuery)(db_1.InputSchema);
49
+ const realm = (0, react_2.useRealm)();
50
+ const Input = InputDB.find((data) => data.inputId === inputId);
51
+ const mode = (0, quizHook_1.useGetMode)();
53
52
  // storeのセーブデータを取得
54
- var saveDatas = (0, react_redux_1.useSelector)(function (state) { return state.quiz.currentInfo.input; });
53
+ const saveDatas = (0, react_redux_1.useSelector)((state) => state.quiz.currentInfo.input);
55
54
  // カウンターの情報を取得
56
- var inputSize = (Input === null || Input === void 0 ? void 0 : Input.size) || "lg";
57
- var limitCnt = lib_1.maxTextLimitInfo[inputSize];
58
- var currentCnt = ((_b = saveDatas[index]) === null || _b === void 0 ? void 0 : _b.saveText.length) || 0;
59
- var baseText = Input ? (0, InputFnc_1.createBaseText)(Input.baseText) : "";
60
- (0, react_1.useEffect)(function () {
55
+ const inputSize = (Input === null || Input === void 0 ? void 0 : Input.size) || "lg";
56
+ const limitCnt = lib_1.maxTextLimitInfo[inputSize];
57
+ const currentCnt = ((_a = saveDatas[index]) === null || _a === void 0 ? void 0 : _a.saveText.length) || 0;
58
+ const baseText = Input ? (0, InputFnc_1.createBaseText)(Input.baseText) : "";
59
+ (0, react_1.useEffect)(() => {
61
60
  if (Input) {
62
- var firstText = (0, InputFnc_1.createBaseText)(Input.baseText);
61
+ const firstText = (0, InputFnc_1.createBaseText)(Input.baseText);
63
62
  dispatch({ type: "quiz/setFirstInput", payload: firstText });
64
63
  }
65
- return function () {
66
- dispatch(db_1.InputModel.saveStoreInput({ realm: realm, inputId: inputId }));
64
+ return () => {
65
+ dispatch(db_1.InputModel.saveStoreInput({ realm, inputId }));
67
66
  };
68
67
  }, []);
69
- (0, react_1.useEffect)(function () {
68
+ (0, react_1.useEffect)(() => {
70
69
  if (mode === "quiz")
71
70
  return;
72
- Input === null || Input === void 0 ? void 0 : Input.saveInputs.forEach(function (data) {
71
+ Input === null || Input === void 0 ? void 0 : Input.saveInputs.forEach((data) => {
73
72
  dispatch({ type: "quiz/addInput", payload: data });
74
73
  });
75
74
  }, [mode]);
76
- var text = ((_c = saveDatas[index]) === null || _c === void 0 ? void 0 : _c.saveText) || "";
77
- var isSave = ((_d = saveDatas[index]) === null || _d === void 0 ? void 0 : _d.isSave) || false;
78
- var isCloseSelect = index === saveDatas.length;
75
+ const text = ((_b = saveDatas[index]) === null || _b === void 0 ? void 0 : _b.saveText) || "";
76
+ const isSave = ((_c = saveDatas[index]) === null || _c === void 0 ? void 0 : _c.isSave) || false;
77
+ const isCloseSelect = index === saveDatas.length;
79
78
  return (<react_native_1.View style={styles.container}>
80
79
  <InputWarnning_1.default saveDatas={saveDatas}/>
81
80
  <InputTab_1.default selectedIndex={index} setIndex={setIndex}/>
@@ -89,7 +88,7 @@ var InputNav = function (_a) {
89
88
  {mode === "quiz" && <InputAnswerBtn_1.default />}
90
89
  </react_native_1.View>);
91
90
  };
92
- var styles = react_native_1.StyleSheet.create({
91
+ const styles = react_native_1.StyleSheet.create({
93
92
  container: { flex: 1 },
94
93
  bottomBox: {
95
94
  flexDirection: "row",
@@ -3,35 +3,33 @@ 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 ChoiceView_1 = __importDefault(require("./ChoiceView"));
9
- var choiceFnc_1 = require("../function/choiceFnc");
10
- var getChoiceStyle_1 = require("./styles/getChoiceStyle");
11
- var quizHook_1 = require("../../hooks/quizHook");
12
- var quizActionHook_1 = require("../../hooks/quizActionHook");
13
- var MultiChoice = function (_a) {
14
- var question = _a.question;
15
- var nextMultiQuizAtion = (0, quizActionHook_1.useNextMultiQuisAction)(question);
16
- var mode = (0, quizHook_1.useGetMode)();
17
- var quizStyles = question.style, yearId = question.yearId, multiSel = question.multiSel, selectedIndexes = question.selectedIndexes;
18
- var _b = (0, react_redux_1.useSelector)(function (state) { return state.quizCfg.inQuizOption; }), isUserVertical = _b.isVertical, isDoublePress = _b.isDoublePress;
19
- var _c = (0, react_redux_1.useSelector)(function (state) { return state.quiz.currentInfo.multi; }), mTurn = _c.turn, mMode = _c.mode, mCorrects = _c.isCorrects;
20
- var choices = multiSel[mTurn];
6
+ const react_1 = __importDefault(require("react"));
7
+ const react_redux_1 = require("react-redux");
8
+ const ChoiceView_1 = __importDefault(require("./ChoiceView"));
9
+ const choiceFnc_1 = require("../function/choiceFnc");
10
+ const getChoiceStyle_1 = require("./styles/getChoiceStyle");
11
+ const quizHook_1 = require("../../hooks/quizHook");
12
+ const quizActionHook_1 = require("../../hooks/quizActionHook");
13
+ const MultiChoice = ({ question }) => {
14
+ const nextMultiQuizAtion = (0, quizActionHook_1.useNextMultiQuisAction)(question);
15
+ const mode = (0, quizHook_1.useGetMode)();
16
+ const { style: quizStyles, yearId, multiSel, selectedIndexes } = question;
17
+ const { isVertical: isUserVertical, isDoublePress } = (0, react_redux_1.useSelector)((state) => state.quizCfg.inQuizOption);
18
+ const { turn: mTurn, mode: mMode, isCorrects: mCorrects, } = (0, react_redux_1.useSelector)((state) => state.quiz.currentInfo.multi);
19
+ const choices = multiSel[mTurn];
21
20
  // 選択肢を選んだ時の処理
22
- var handleChoice = function (i) { return nextMultiQuizAtion(i); };
21
+ const handleChoice = (i) => nextMultiQuizAtion(i);
23
22
  // ChoiceViewに必要なロジックを作成(normalとほぼ共通)
24
- var wordAndColors = choices.map(function (_a, i) {
25
- var choice = _a.choice, isCorrect = _a.isCorrect;
26
- var turnSelectedIndex = selectedIndexes[mTurn];
23
+ const wordAndColors = choices.map(({ choice, isCorrect }, i) => {
24
+ const turnSelectedIndex = selectedIndexes[mTurn];
27
25
  return {
28
26
  word: choice,
29
27
  color: (0, getChoiceStyle_1.getChoiceOutlineColor)([turnSelectedIndex], mMode, isCorrect, i),
30
28
  };
31
29
  });
32
- var maxChoiceLength = (0, choiceFnc_1.calcMaxChoiceLength)(choices);
33
- var imgKey = "a".concat(yearId);
34
- var isVertical = (0, getChoiceStyle_1.checkIsVertical)(quizStyles, isUserVertical);
30
+ const maxChoiceLength = (0, choiceFnc_1.calcMaxChoiceLength)(choices);
31
+ const imgKey = `a${yearId}`;
32
+ const isVertical = (0, getChoiceStyle_1.checkIsVertical)(quizStyles, isUserVertical);
35
33
  return (<ChoiceView_1.default wordAndColors={wordAndColors} isDoublePress={isDoublePress} handleChoice={handleChoice} maxChoiceLength={maxChoiceLength} imgKey={imgKey} isVertical={isVertical} isNotSearch={mode === "quiz"} isCorrected={mCorrects[mTurn]}/>);
36
34
  };
37
35
  exports.default = MultiChoice;
@@ -3,22 +3,22 @@ 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 common_1 = require("@nakamura-123/common");
7
- var lib_1 = require("@nakamura-123/lib");
8
- var react_1 = __importDefault(require("react"));
9
- var react_native_1 = require("react-native");
10
- var react_redux_1 = require("react-redux");
11
- var MultiGuide = function () {
12
- var viewHeight = 20;
13
- var _a = (0, react_redux_1.useSelector)(function (state) { return state.quiz.currentInfo.multi; }), mTurn = _a.turn, mMode = _a.mode;
14
- var shouldShow = mMode === "quiz" && mTurn === 0;
6
+ const common_1 = require("@nakamura-123/common");
7
+ const lib_1 = require("@nakamura-123/lib");
8
+ const react_1 = __importDefault(require("react"));
9
+ const react_native_1 = require("react-native");
10
+ const react_redux_1 = require("react-redux");
11
+ const MultiGuide = () => {
12
+ const viewHeight = 20;
13
+ const { turn: mTurn, mode: mMode } = (0, react_redux_1.useSelector)((state) => state.quiz.currentInfo.multi);
14
+ const shouldShow = mMode === "quiz" && mTurn === 0;
15
15
  return (<common_1.CollopseView height={viewHeight} visible={shouldShow} style={styles.container}>
16
16
  <common_1.MyText fsize="sm" color="red">
17
17
  上の赤い□に当てはまるものを選べ
18
18
  </common_1.MyText>
19
19
  </common_1.CollopseView>);
20
20
  };
21
- var styles = react_native_1.StyleSheet.create({
21
+ const styles = react_native_1.StyleSheet.create({
22
22
  container: {
23
23
  justifyContent: "center",
24
24
  alignItems: "center",
@@ -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 common_1 = require("@nakamura-123/common");
8
- var react_native_1 = require("react-native");
9
- var react_redux_1 = require("react-redux");
10
- var MultiNextBtn = function (_a) {
11
- var question = _a.question;
12
- var dispatch = (0, react_redux_1.useDispatch)();
13
- var multiSel = question.multiSel;
14
- var _b = (0, react_redux_1.useSelector)(function (state) { return state.quiz.currentInfo.multi; }), mTurn = _b.turn, mMode = _b.mode;
15
- var isLastCheck = isLastTurn(mTurn, multiSel) && mMode === "check";
16
- var shouldShow = mMode !== "quiz" && !isLastCheck;
17
- var onPress = function () {
6
+ const react_1 = __importDefault(require("react"));
7
+ const common_1 = require("@nakamura-123/common");
8
+ const react_native_1 = require("react-native");
9
+ const react_redux_1 = require("react-redux");
10
+ const MultiNextBtn = ({ question }) => {
11
+ const dispatch = (0, react_redux_1.useDispatch)();
12
+ const { multiSel } = question;
13
+ const { turn: mTurn, mode: mMode } = (0, react_redux_1.useSelector)((state) => state.quiz.currentInfo.multi);
14
+ const isLastCheck = isLastTurn(mTurn, multiSel) && mMode === "check";
15
+ const shouldShow = mMode !== "quiz" && !isLastCheck;
16
+ const onPress = () => {
18
17
  dispatch({ type: "quiz/nextTurnMulti" });
19
18
  dispatch({ type: "quiz/changeModeMulti", payload: "quiz" });
20
19
  };
@@ -22,10 +21,10 @@ var MultiNextBtn = function (_a) {
22
21
  <common_1.MiniIconBtn icon="arrow-right" onPress={onPress} title=" 次の選択へ" color="blue" width="49%"/>
23
22
  </common_1.CollopseView>);
24
23
  };
25
- var isLastTurn = function (turn, multiSel) {
24
+ const isLastTurn = (turn, multiSel) => {
26
25
  return turn === multiSel.length - 1;
27
26
  };
28
- var styles = react_native_1.StyleSheet.create({
27
+ const styles = react_native_1.StyleSheet.create({
29
28
  container: {
30
29
  width: "100%",
31
30
  flexDirection: "row",
@@ -1,65 +1,52 @@
1
1
  "use strict";
2
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
3
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
4
- if (ar || !(i in from)) {
5
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
6
- ar[i] = from[i];
7
- }
8
- }
9
- return to.concat(ar || Array.prototype.slice.call(from));
10
- };
11
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
12
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
4
  };
14
5
  Object.defineProperty(exports, "__esModule", { value: true });
15
- var react_1 = __importDefault(require("react"));
16
- var react_redux_1 = require("react-redux");
17
- var stores_1 = require("@nakamura-123/stores");
18
- var ChoiceView_1 = __importDefault(require("./ChoiceView"));
19
- var choiceFnc_1 = require("../function/choiceFnc");
20
- var getChoiceStyle_1 = require("./styles/getChoiceStyle");
21
- var quizHook_1 = require("../../hooks/quizHook");
22
- var quizActionHook_1 = require("../../hooks/quizActionHook");
6
+ const react_1 = __importDefault(require("react"));
7
+ const react_redux_1 = require("react-redux");
8
+ const stores_1 = require("@nakamura-123/stores");
9
+ const ChoiceView_1 = __importDefault(require("./ChoiceView"));
10
+ const choiceFnc_1 = require("../function/choiceFnc");
11
+ const getChoiceStyle_1 = require("./styles/getChoiceStyle");
12
+ const quizHook_1 = require("../../hooks/quizHook");
13
+ const quizActionHook_1 = require("../../hooks/quizActionHook");
23
14
  // ここには独自のロジックを書く
24
- var NormalChoice = function (_a) {
25
- var question = _a.question;
26
- var dispatch = (0, react_redux_1.useDispatch)();
27
- var useHandleCheck = (0, quizActionHook_1.useChangeModeToCheck)();
28
- var choices = question.choices, quizStyles = question.style, yearId = question.yearId, selectedIndexes = question.selectedIndexes;
29
- var _b = (0, react_redux_1.useSelector)(function (state) { return state.quizCfg.inQuizOption; }), isUserVertical = _b.isVertical, isDoublePress = _b.isDoublePress;
30
- var mode = (0, quizHook_1.useGetMode)();
15
+ const NormalChoice = ({ question }) => {
16
+ const dispatch = (0, react_redux_1.useDispatch)();
17
+ const useHandleCheck = (0, quizActionHook_1.useChangeModeToCheck)();
18
+ const { choices, style: quizStyles, yearId, selectedIndexes } = question;
19
+ const { isVertical: isUserVertical, isDoublePress } = (0, react_redux_1.useSelector)((state) => state.quizCfg.inQuizOption);
20
+ const mode = (0, quizHook_1.useGetMode)();
31
21
  // 選択肢を選んだ時の処理
32
- var correctCnt = choices.filter(function (choice) { return choice.isCorrect; }).length;
33
- var isCorrected = (question === null || question === void 0 ? void 0 : question.isCorrected) === false ? false : (question === null || question === void 0 ? void 0 : question.isCorrected) || null;
34
- var handleChoice = function (i) {
22
+ const correctCnt = choices.filter((choice) => choice.isCorrect).length;
23
+ const isCorrected = (question === null || question === void 0 ? void 0 : question.isCorrected) === false ? false : (question === null || question === void 0 ? void 0 : question.isCorrected) || null;
24
+ const handleChoice = (i) => {
35
25
  if (mode !== "quiz")
36
26
  return;
37
- var newSelectedIndexes = selectedIndexes.includes(i)
38
- ? selectedIndexes.filter(function (index) { return index !== i; })
39
- : __spreadArray(__spreadArray([], selectedIndexes, true), [i], false);
27
+ const newSelectedIndexes = selectedIndexes.includes(i)
28
+ ? selectedIndexes.filter((index) => index !== i)
29
+ : [...selectedIndexes, i];
40
30
  dispatch(stores_1.quizAction.replaceSelectedIndex(newSelectedIndexes));
41
- var isFinished = newSelectedIndexes.length >= correctCnt;
31
+ const isFinished = newSelectedIndexes.length >= correctCnt;
42
32
  if (!isFinished)
43
33
  return;
44
34
  // 選択肢を選択(複数答えがあるときは全て)選んだ場合、checkモードへ移行する際の処理
45
- var isCorrect = newSelectedIndexes.every(function (index) { var _a; return (_a = choices[index]) === null || _a === void 0 ? void 0 : _a.isCorrect; });
35
+ const isCorrect = newSelectedIndexes.every((index) => { var _a; return (_a = choices[index]) === null || _a === void 0 ? void 0 : _a.isCorrect; });
46
36
  // 共通処理
47
37
  useHandleCheck && useHandleCheck(isCorrect);
48
38
  };
49
39
  // 選択肢のアウトラインの色を決める
50
- var wordAndColors = choices.map(function (_a, i) {
51
- var choice = _a.choice, isCorrect = _a.isCorrect;
52
- return ({
53
- word: choice,
54
- color: (0, getChoiceStyle_1.getChoiceOutlineColor)(selectedIndexes, mode, isCorrect, i),
55
- });
56
- });
40
+ const wordAndColors = choices.map(({ choice, isCorrect }, i) => ({
41
+ word: choice,
42
+ color: (0, getChoiceStyle_1.getChoiceOutlineColor)(selectedIndexes, mode, isCorrect, i),
43
+ }));
57
44
  // 最大文字数を計算
58
- var maxChoiceLength = (0, choiceFnc_1.calcMaxChoiceLength)(choices);
45
+ const maxChoiceLength = (0, choiceFnc_1.calcMaxChoiceLength)(choices);
59
46
  // imgだった場合、表示させるためのTopKey
60
- var imgKey = "a".concat(yearId);
47
+ const imgKey = `a${yearId}`;
61
48
  // 縦に4つ並べるか横に2つ並べるかを決める
62
- var isVertical = (0, getChoiceStyle_1.checkIsVertical)(quizStyles, isUserVertical);
49
+ const isVertical = (0, getChoiceStyle_1.checkIsVertical)(quizStyles, isUserVertical);
63
50
  return (<ChoiceView_1.default wordAndColors={wordAndColors} isDoublePress={isDoublePress} handleChoice={handleChoice} maxChoiceLength={maxChoiceLength} imgKey={imgKey} isVertical={isVertical} isNotSearch={mode === "quiz"} isCorrected={isCorrected}/>);
64
51
  };
65
52
  exports.default = NormalChoice;
@@ -3,24 +3,23 @@ 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 common_1 = require("@nakamura-123/common");
7
- var lib_1 = require("@nakamura-123/lib");
8
- var react_1 = __importDefault(require("react"));
9
- var react_native_1 = require("react-native");
10
- var quizHook_1 = require("../../hooks/quizHook");
11
- var NormalMultiGuide = function (_a) {
12
- var question = _a.question;
13
- var viewHeight = 20;
14
- var mode = (0, quizHook_1.useGetMode)();
15
- var shouldShow = mode === "quiz" && (question === null || question === void 0 ? void 0 : question.ans.length) > 1;
16
- var number = question === null || question === void 0 ? void 0 : question.ans.length;
6
+ const common_1 = require("@nakamura-123/common");
7
+ const lib_1 = require("@nakamura-123/lib");
8
+ const react_1 = __importDefault(require("react"));
9
+ const react_native_1 = require("react-native");
10
+ const quizHook_1 = require("../../hooks/quizHook");
11
+ const NormalMultiGuide = ({ question }) => {
12
+ const viewHeight = 20;
13
+ const mode = (0, quizHook_1.useGetMode)();
14
+ const shouldShow = mode === "quiz" && (question === null || question === void 0 ? void 0 : question.ans.length) > 1;
15
+ const number = question === null || question === void 0 ? void 0 : question.ans.length;
17
16
  return (<common_1.CollopseView height={viewHeight} visible={shouldShow} style={styles.container}>
18
17
  <common_1.MyText fsize="sm" color="red">
19
18
  答えを{number}つ選んでください
20
19
  </common_1.MyText>
21
20
  </common_1.CollopseView>);
22
21
  };
23
- var styles = react_native_1.StyleSheet.create({
22
+ const styles = react_native_1.StyleSheet.create({
24
23
  container: {
25
24
  justifyContent: "center",
26
25
  alignItems: "center",
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getChoiceOutlineColor = exports.checkIsVertical = exports.getChoiceStyle = void 0;
4
- var lib_1 = require("@nakamura-123/lib");
5
- var getChoiceStyle = function (isVertical, maxChoiceLength, color) {
4
+ const lib_1 = require("@nakamura-123/lib");
5
+ const getChoiceStyle = (isVertical, maxChoiceLength, color) => {
6
6
  return {
7
7
  backgroundColor: lib_1.colors.ltBeige,
8
8
  flexDirection: "row",
@@ -16,13 +16,13 @@ var getChoiceStyle = function (isVertical, maxChoiceLength, color) {
16
16
  };
17
17
  };
18
18
  exports.getChoiceStyle = getChoiceStyle;
19
- var checkIsVertical = function (quizStyles, userSettingVertical) {
19
+ const checkIsVertical = (quizStyles, userSettingVertical) => {
20
20
  if (quizStyles.includes("vertical") || userSettingVertical)
21
21
  return true;
22
22
  return false;
23
23
  };
24
24
  exports.checkIsVertical = checkIsVertical;
25
- var getChoiceOutlineColor = function (selectedIndexes, mode, isCorrect, i) {
25
+ const getChoiceOutlineColor = (selectedIndexes, mode, isCorrect, i) => {
26
26
  if (__DEV__ && mode === "quiz" && isCorrect)
27
27
  return "green"; //これはテスト用です
28
28
  if (mode === "quiz")
@@ -26,23 +26,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- var react_native_1 = require("react-native");
30
- var react_1 = __importStar(require("react"));
31
- var react_2 = require("@realm/react");
32
- var react_redux_1 = require("react-redux");
33
- var db_1 = require("@nakamura-123/db");
34
- var SelectTag_1 = __importDefault(require("./SelectTag"));
35
- var NextQuizBtn_1 = __importDefault(require("./NextQuizBtn"));
36
- var quizHook_1 = require("../../hooks/quizHook");
37
- var BadgeHook_1 = require("../../hooks/BadgeHook");
38
- var Check = function (_a) {
39
- var navigation = _a.navigation;
40
- var dispatch = (0, react_redux_1.useDispatch)();
41
- var realm = (0, react_2.useRealm)();
42
- var isLastCheckTurn = (0, quizHook_1.useIsLastCheckTurn)();
43
- var checkBadgeEligibility = (0, BadgeHook_1.useCheckBadgeEligibility)();
44
- var type = (0, react_redux_1.useSelector)(function (state) { return state.quiz.selected.type; });
45
- (0, react_1.useEffect)(function () {
29
+ const react_native_1 = require("react-native");
30
+ const react_1 = __importStar(require("react"));
31
+ const react_2 = require("@realm/react");
32
+ const react_redux_1 = require("react-redux");
33
+ const db_1 = require("@nakamura-123/db");
34
+ const SelectTag_1 = __importDefault(require("./SelectTag"));
35
+ const NextQuizBtn_1 = __importDefault(require("./NextQuizBtn"));
36
+ const quizHook_1 = require("../../hooks/quizHook");
37
+ const BadgeHook_1 = require("../../hooks/BadgeHook");
38
+ const Check = ({ navigation }) => {
39
+ const dispatch = (0, react_redux_1.useDispatch)();
40
+ const realm = (0, react_2.useRealm)();
41
+ const isLastCheckTurn = (0, quizHook_1.useIsLastCheckTurn)();
42
+ const checkBadgeEligibility = (0, BadgeHook_1.useCheckBadgeEligibility)();
43
+ const type = (0, react_redux_1.useSelector)((state) => state.quiz.selected.type);
44
+ (0, react_1.useEffect)(() => {
46
45
  if (!isLastCheckTurn)
47
46
  return;
48
47
  if (type === "test")
@@ -64,7 +63,7 @@ var Check = function (_a) {
64
63
  </react_native_1.View>
65
64
  </react_native_1.View>);
66
65
  };
67
- var styles = react_native_1.StyleSheet.create({
66
+ const styles = react_native_1.StyleSheet.create({
68
67
  container: {
69
68
  flexDirection: "row",
70
69
  justifyContent: "space-between",
@@ -3,30 +3,29 @@ 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 MaterialCommunityIcons_1 = __importDefault(require("@expo/vector-icons/MaterialCommunityIcons"));
10
- var lib_1 = require("@nakamura-123/lib");
11
- var common_1 = require("@nakamura-123/common");
12
- var stores_1 = require("@nakamura-123/stores");
13
- var quizActionHook_1 = require("../../hooks/quizActionHook");
14
- var NextQuiz = function (_a) {
15
- var navigation = _a.navigation;
16
- var dispatch = (0, react_redux_1.useDispatch)();
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, mode = _b.mode;
19
- var isResult = mode === "result";
20
- var isActiveTurn = turn === activeTurn;
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 MaterialCommunityIcons_1 = __importDefault(require("@expo/vector-icons/MaterialCommunityIcons"));
10
+ const lib_1 = require("@nakamura-123/lib");
11
+ const common_1 = require("@nakamura-123/common");
12
+ const stores_1 = require("@nakamura-123/stores");
13
+ const quizActionHook_1 = require("../../hooks/quizActionHook");
14
+ const NextQuiz = ({ navigation }) => {
15
+ const dispatch = (0, react_redux_1.useDispatch)();
16
+ const nextQuizAction = (0, quizActionHook_1.useNextQuizAction)();
17
+ const { turn, activeTurn, mode } = (0, react_redux_1.useSelector)((state) => state.quiz.currentInfo.state);
18
+ const isResult = mode === "result";
19
+ const isActiveTurn = turn === activeTurn;
21
20
  // 画面遷移のための関数を定義
22
21
  // 2つのボタンを定義
23
- var btnInfo = {
22
+ const btnInfo = {
24
23
  next: { icon: "gesture-swipe-left", text: "Next" },
25
24
  return: { icon: "reply", text: "Return" },
26
25
  };
27
26
  // ボタンの表示を切り替え
28
- var btn = isActiveTurn || isResult ? btnInfo.next : btnInfo.return;
29
- var onPress = function () {
27
+ const btn = isActiveTurn || isResult ? btnInfo.next : btnInfo.return;
28
+ const onPress = () => {
30
29
  if (!isActiveTurn && !isResult)
31
30
  dispatch(stores_1.quizAction.returnToActiveTurn());
32
31
  else if (isResult)
@@ -43,7 +42,7 @@ var NextQuiz = function (_a) {
43
42
  </common_1.MyText>
44
43
  </react_native_1.Pressable>);
45
44
  };
46
- var styles = react_native_1.StyleSheet.create({
45
+ const styles = react_native_1.StyleSheet.create({
47
46
  button: {
48
47
  justifyContent: "center",
49
48
  alignItems: "center",