@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,59 +3,58 @@ 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 react_2 = require("@realm/react");
10
- var common_1 = require("@nakamura-123/common");
11
- var db_1 = require("@nakamura-123/db");
12
- var QuizSaveData_1 = __importDefault(require("../quiz/save/QuizSaveData"));
13
- var SelectRange_1 = __importDefault(require("../component/Boot/SelectRange"));
14
- var TagBadge5sPress_1 = __importDefault(require("../component/TagBadge5sPress"));
15
- var QuizOptionDrill_1 = __importDefault(require("../component/QuizSet/QuizOptionDrill"));
16
- var tagFncD_1 = require("../functions/tagFncD");
17
- var AverageBar_1 = __importDefault(require("../component/TestPage/AverageBar"));
18
- var createQuizFncD_1 = require("../functions/createQuizFncD");
19
- var quizActionHook_1 = require("../hooks/quizActionHook");
20
- var Discription_1 = __importDefault(require("../component/Discription"));
21
- var BootDiscription = "このモードでは、出題範囲を自由にカスタマイズできます。苦手分野の克服などに、ぜひご活用ください。";
22
- var BootPage = function (_a) {
23
- var navigation = _a.navigation, subject = _a.subject;
24
- var dispatch = (0, react_redux_1.useDispatch)();
25
- var t = (0, common_1.useDrillTranslation)().t;
26
- var useStartQuiz = (0, quizActionHook_1.useStartQuizAction)();
27
- var startCfg = (0, react_redux_1.useSelector)(function (state) { return state.quizCfg.startCfg; });
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 react_2 = require("@realm/react");
10
+ const common_1 = require("@nakamura-123/common");
11
+ const db_1 = require("@nakamura-123/db");
12
+ const QuizSaveData_1 = __importDefault(require("../quiz/save/QuizSaveData"));
13
+ const SelectRange_1 = __importDefault(require("../component/Boot/SelectRange"));
14
+ const TagBadge5sPress_1 = __importDefault(require("../component/TagBadge5sPress"));
15
+ const QuizOptionDrill_1 = __importDefault(require("../component/QuizSet/QuizOptionDrill"));
16
+ const tagFncD_1 = require("../functions/tagFncD");
17
+ const AverageBar_1 = __importDefault(require("../component/TestPage/AverageBar"));
18
+ const createQuizFncD_1 = require("../functions/createQuizFncD");
19
+ const quizActionHook_1 = require("../hooks/quizActionHook");
20
+ const Discription_1 = __importDefault(require("../component/Discription"));
21
+ const BootDiscription = "このモードでは、出題範囲を自由にカスタマイズできます。苦手分野の克服などに、ぜひご活用ください。";
22
+ const BootPage = ({ navigation, subject }) => {
23
+ const dispatch = (0, react_redux_1.useDispatch)();
24
+ const { t } = (0, common_1.useDrillTranslation)();
25
+ const useStartQuiz = (0, quizActionHook_1.useStartQuizAction)();
26
+ const startCfg = (0, react_redux_1.useSelector)((state) => state.quizCfg.startCfg);
28
27
  // セーブの確認
29
- var isExistedSaveData = (0, react_redux_1.useSelector)(function (state) { return state.score.isSave[subject.name]; });
28
+ const isExistedSaveData = (0, react_redux_1.useSelector)((state) => state.score.isSave[subject.name]);
30
29
  // タグの選択を計算
31
- var QuestionDB = (0, react_2.useQuery)(db_1.DQuestionSchema);
32
- var unitRange = (0, react_redux_1.useSelector)(function (state) { return state.setting.boot.outOfUnit; });
33
- var yearRange = (0, react_redux_1.useSelector)(function (state) { return state.setting.boot.outOfYear; });
34
- var tagLevels = (0, tagFncD_1.getBootTagLevelCnts)(QuestionDB, unitRange, yearRange);
35
- var unitLength = (0, react_redux_1.useSelector)(function (state) { return state.app.unitList; }).length;
36
- var yearLength = (0, react_redux_1.useSelector)(function (state) { return state.app.yearList; }).length;
30
+ const QuestionDB = (0, react_2.useQuery)(db_1.DQuestionSchema);
31
+ const unitRange = (0, react_redux_1.useSelector)((state) => state.setting.boot.outOfUnit);
32
+ const yearRange = (0, react_redux_1.useSelector)((state) => state.setting.boot.outOfYear);
33
+ const tagLevels = (0, tagFncD_1.getBootTagLevelCnts)(QuestionDB, unitRange, yearRange);
34
+ const unitLength = (0, react_redux_1.useSelector)((state) => state.app.unitList).length;
35
+ const yearLength = (0, react_redux_1.useSelector)((state) => state.app.yearList).length;
37
36
  // アベレージバーのデータ生成
38
- var l4TagCnt = (0, tagFncD_1.getCompletedTagRate)(tagLevels, true);
39
- var allQuizCnt = tagLevels.length || 0;
40
- var average = Math.round((l4TagCnt / allQuizCnt) * 100) || 0;
41
- var barLabel = t("boot.barLabel") + allQuizCnt;
37
+ const l4TagCnt = (0, tagFncD_1.getCompletedTagRate)(tagLevels, true);
38
+ const allQuizCnt = tagLevels.length || 0;
39
+ const average = Math.round((l4TagCnt / allQuizCnt) * 100) || 0;
40
+ const barLabel = t("boot.barLabel") + allQuizCnt;
42
41
  // 履歴情報
43
- var historyParams = {
42
+ const historyParams = {
44
43
  subject: subject.name,
45
44
  db: "boot",
46
45
  };
47
46
  // 課金ロック
48
- var isLocked = common_1.commonHook.useIsLocked("boot");
49
- var startIcon = isLocked ? "lock" : "play";
50
- var studyIcon = isLocked ? "lock" : "book";
47
+ const isLocked = common_1.commonHook.useIsLocked("boot");
48
+ const startIcon = isLocked ? "lock" : "play";
49
+ const studyIcon = isLocked ? "lock" : "book";
51
50
  // スタートボタンの設定
52
- var handleStart = function () {
51
+ const handleStart = () => {
53
52
  if (isLocked) {
54
53
  navigation.navigate("Coin");
55
54
  return;
56
55
  }
57
- var quizList = (0, createQuizFncD_1.getBootQuestions)(QuestionDB, startCfg, unitRange, yearRange);
58
- var quizCnt = quizList.length;
56
+ const quizList = (0, createQuizFncD_1.getBootQuestions)(QuestionDB, startCfg, unitRange, yearRange);
57
+ const quizCnt = quizList.length;
59
58
  dispatch({
60
59
  type: "quiz/setLesson",
61
60
  payload: {
@@ -65,21 +64,19 @@ var BootPage = function (_a) {
65
64
  lesson: { title: subject.title, key: quizCnt },
66
65
  },
67
66
  });
68
- var isExistQuiz = useStartQuiz(subject.name, quizList);
67
+ const isExistQuiz = useStartQuiz(subject.name, quizList);
69
68
  if (!isExistQuiz)
70
69
  return;
71
70
  navigation.navigate("Quiz");
72
71
  };
73
- var handlePreStudy = function () {
72
+ const handlePreStudy = () => {
74
73
  handleStart();
75
74
  dispatch({ type: "quiz/toResult" });
76
75
  };
77
76
  // 選択数を計算
78
- var unitRangeCnt = unitLength - unitRange.length;
79
- var yearRangeCnt = yearLength - yearRange.length;
80
- var selectedTagCnt = tagLevels.filter(function (tag) {
81
- return startCfg.tags.includes(tag);
82
- }).length;
77
+ const unitRangeCnt = unitLength - unitRange.length;
78
+ const yearRangeCnt = yearLength - yearRange.length;
79
+ const selectedTagCnt = tagLevels.filter((tag) => startCfg.tags.includes(tag)).length;
83
80
  return (<react_native_1.SafeAreaView style={{ flex: 1 }}>
84
81
  <react_native_1.ScrollView style={styles.container}>
85
82
  <Discription_1.default MSG={t("boot.msg")}/>
@@ -93,12 +90,10 @@ var BootPage = function (_a) {
93
90
  <common_1.IconTitle icon="sliders-h" title={t("boot.setting")} mt={20}/>
94
91
  <QuizOptionDrill_1.default />
95
92
  <react_native_1.View style={styles.btnBox}>
96
- <common_1.MiniIconBtn onPress={function () { return handlePreStudy(); }} icon={studyIcon} title={t("boot.study")} color="ltBlack"/>
97
- <common_1.MiniIconBtn onPress={function () { return handleStart(); }} icon={startIcon} title={t("boot.start")} color="red"/>
93
+ <common_1.MiniIconBtn onPress={() => handlePreStudy()} icon={studyIcon} title={t("boot.study")} color="ltBlack"/>
94
+ <common_1.MiniIconBtn onPress={() => handleStart()} icon={startIcon} title={t("boot.start")} color="red"/>
98
95
  </react_native_1.View>
99
- <common_1.RoundRectangleIcon title={t("boot.showHistory")} onPress={function () {
100
- return navigation.navigate("History", { info: historyParams });
101
- }} icon="history"/>
96
+ <common_1.RoundRectangleIcon title={t("boot.showHistory")} onPress={() => navigation.navigate("History", { info: historyParams })} icon="history"/>
102
97
  <react_native_1.View style={{ height: 50 }}/>
103
98
  {isExistedSaveData && <react_native_1.View style={{ height: 100 }}/>}
104
99
  </react_native_1.ScrollView>
@@ -107,7 +102,7 @@ var BootPage = function (_a) {
107
102
  </react_native_1.View>
108
103
  </react_native_1.SafeAreaView>);
109
104
  };
110
- var styles = react_native_1.StyleSheet.create({
105
+ const styles = react_native_1.StyleSheet.create({
111
106
  container: {
112
107
  padding: 20,
113
108
  marginTop: 20,
@@ -4,6 +4,7 @@ import { Comment } from "../component/Coin/AppReviews";
4
4
  interface Props {
5
5
  navigation: Nav.NavigationProp<"Coin">;
6
6
  comments?: Comment[];
7
+ warningContent?: React.ReactNode;
7
8
  }
8
9
  declare const CoinPage: React.FC<Props>;
9
10
  export default CoinPage;
@@ -31,55 +31,27 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
31
31
  step((generator = generator.apply(thisArg, _arguments || [])).next());
32
32
  });
33
33
  };
34
- var __generator = (this && this.__generator) || function (thisArg, body) {
35
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
36
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
37
- function verb(n) { return function (v) { return step([n, v]); }; }
38
- function step(op) {
39
- if (f) throw new TypeError("Generator is already executing.");
40
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
41
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
42
- if (y = 0, t) op = [op[0] & 2, t.value];
43
- switch (op[0]) {
44
- case 0: case 1: t = op; break;
45
- case 4: _.label++; return { value: op[1], done: false };
46
- case 5: _.label++; y = op[1]; op = [0]; continue;
47
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
48
- default:
49
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
50
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
51
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
52
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
53
- if (t[2]) _.ops.pop();
54
- _.trys.pop(); continue;
55
- }
56
- op = body.call(thisArg, _);
57
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
58
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
59
- }
60
- };
61
34
  var __importDefault = (this && this.__importDefault) || function (mod) {
62
35
  return (mod && mod.__esModule) ? mod : { "default": mod };
63
36
  };
64
37
  Object.defineProperty(exports, "__esModule", { value: true });
65
- var react_1 = __importStar(require("react"));
66
- var react_redux_1 = require("react-redux");
67
- var stores_1 = require("@nakamura-123/stores");
68
- var CoinPageComponent_1 = __importDefault(require("../component/Coin/CoinPageComponent"));
69
- var CoinFnc_1 = require("../component/Coin/CoinFnc");
70
- var ReceiptFnc_1 = require("../component/Coin/ReceiptFnc");
71
- var common_1 = require("@nakamura-123/common");
72
- var CoinPage = function (_a) {
73
- var navigation = _a.navigation, _b = _a.comments, comments = _b === void 0 ? [] : _b;
74
- var dispatch = (0, react_redux_1.useDispatch)();
75
- var t = (0, common_1.useDrillTranslation)().t;
76
- var allFreeId = (0, react_redux_1.useSelector)(function (state) { var _a; return (_a = state.app.appSetting.setting) === null || _a === void 0 ? void 0 : _a.payment.items.allFreeId; });
77
- var allFreeState = (0, react_redux_1.useSelector)(function (state) { return state.setting.payment.allFreeState; });
78
- var isAllfreePaid = allFreeState === "paid";
79
- var _c = (0, react_1.useState)([]), products = _c[0], setProducts = _c[1];
80
- var _d = (0, react_1.useState)(true), loading = _d[0], setLoading = _d[1];
81
- var items = allFreeId ? [allFreeId] : [];
82
- (0, react_1.useEffect)(function () {
38
+ const react_1 = __importStar(require("react"));
39
+ const react_redux_1 = require("react-redux");
40
+ const stores_1 = require("@nakamura-123/stores");
41
+ const CoinPageComponent_1 = __importDefault(require("../component/Coin/CoinPageComponent"));
42
+ const CoinFnc_1 = require("../component/Coin/CoinFnc");
43
+ const ReceiptFnc_1 = require("../component/Coin/ReceiptFnc");
44
+ const common_1 = require("@nakamura-123/common");
45
+ const CoinPage = ({ navigation, comments = [], warningContent, }) => {
46
+ const dispatch = (0, react_redux_1.useDispatch)();
47
+ const { t } = (0, common_1.useDrillTranslation)();
48
+ const allFreeId = (0, react_redux_1.useSelector)((state) => { var _a; return (_a = state.app.appSetting.setting) === null || _a === void 0 ? void 0 : _a.payment.items.allFreeId; });
49
+ const allFreeState = (0, react_redux_1.useSelector)((state) => state.setting.payment.allFreeState);
50
+ const isAllfreePaid = allFreeState === "paid";
51
+ const [products, setProducts] = (0, react_1.useState)([]);
52
+ const [loading, setLoading] = (0, react_1.useState)(true);
53
+ const items = allFreeId ? [allFreeId] : [];
54
+ (0, react_1.useEffect)(() => {
83
55
  (0, CoinFnc_1.initializeIAP)(items, setProducts, setLoading);
84
56
  // 🔧 修正4: endConnection()を削除(接続を維持)
85
57
  // アプリ終了時に自動的に切断されるため、明示的な切断は不要
@@ -88,107 +60,81 @@ var CoinPage = function (_a) {
88
60
  // };
89
61
  }, []);
90
62
  // 02.購入時の処理の実行
91
- var handlePurchaseItem = function (productId) { return __awaiter(void 0, void 0, void 0, function () {
92
- var purchase, receipt, error_1;
93
- return __generator(this, function (_a) {
94
- switch (_a.label) {
95
- case 0:
96
- setLoading(true); // 処理開始
97
- _a.label = 1;
98
- case 1:
99
- _a.trys.push([1, 6, 7, 8]);
100
- console.log("購入処理開始: ", productId);
101
- return [4 /*yield*/, (0, CoinFnc_1.handlePurchase)(productId)];
102
- case 2:
103
- purchase = _a.sent();
104
- if (!purchase) {
105
- console.warn("購入がキャンセルまたは失敗しました");
106
- return [2 /*return*/];
107
- }
108
- console.log("購入成功、レシート処理開始");
109
- receipt = (0, ReceiptFnc_1.unifyReceipt)(purchase);
110
- if (!receipt) return [3 /*break*/, 4];
111
- console.log("レシート情報: ", {
112
- productId: receipt.productId,
113
- isPaid: receipt.isPaid,
114
- paymentState: receipt.isPaid ? "paid" : "wait",
115
- });
116
- return [4 /*yield*/, stores_1.coinStorage.savePurchasedItems(receipt)];
117
- case 3:
118
- _a.sent();
119
- dispatch((0, CoinFnc_1.updateAllFreeState)(receipt));
120
- console.log("レシート保存完了");
121
- return [3 /*break*/, 5];
122
- case 4:
123
- console.error("レシートの統一に失敗しました", purchase);
124
- _a.label = 5;
125
- case 5: return [3 /*break*/, 8];
126
- case 6:
127
- error_1 = _a.sent();
128
- console.error("購入処理中にエラーが発生しました", error_1);
129
- console.error("エラーの詳細: ", error_1 instanceof Error ? error_1.message : String(error_1));
130
- return [3 /*break*/, 8];
131
- case 7:
132
- dispatch(stores_1.settingStorage.saveSetting());
133
- setLoading(false); // 処理終了
134
- return [7 /*endfinally*/];
135
- case 8: return [2 /*return*/];
63
+ const handlePurchaseItem = (productId) => __awaiter(void 0, void 0, void 0, function* () {
64
+ setLoading(true); // 処理開始
65
+ try {
66
+ console.log("購入処理開始: ", productId);
67
+ const purchase = yield (0, CoinFnc_1.handlePurchase)(productId);
68
+ if (!purchase) {
69
+ console.warn("購入がキャンセルまたは失敗しました");
70
+ return;
71
+ }
72
+ console.log("購入成功、レシート処理開始");
73
+ const receipt = (0, ReceiptFnc_1.unifyReceipt)(purchase);
74
+ if (receipt) {
75
+ console.log("レシート情報: ", {
76
+ productId: receipt.productId,
77
+ isPaid: receipt.isPaid,
78
+ paymentState: receipt.isPaid ? "paid" : "wait",
79
+ });
80
+ yield stores_1.coinStorage.savePurchasedItems(receipt);
81
+ dispatch((0, CoinFnc_1.updateAllFreeState)(receipt));
82
+ console.log("レシート保存完了");
83
+ }
84
+ else {
85
+ console.error("レシートの統一に失敗しました", purchase);
136
86
  }
137
- });
138
- }); };
87
+ }
88
+ catch (error) {
89
+ console.error("購入処理中にエラーが発生しました", error);
90
+ console.error("エラーの詳細: ", error instanceof Error ? error.message : String(error));
91
+ }
92
+ finally {
93
+ dispatch(stores_1.settingStorage.saveSetting());
94
+ setLoading(false); // 処理終了
95
+ }
96
+ });
139
97
  // 03.復元処理の実行
140
- var handleRestore = function () { return __awaiter(void 0, void 0, void 0, function () {
141
- var receipts, error_2;
142
- return __generator(this, function (_a) {
143
- switch (_a.label) {
144
- case 0:
145
- setLoading(true); // 処理開始
146
- receipts = null;
147
- _a.label = 1;
148
- case 1:
149
- _a.trys.push([1, 3, 4, 5]);
150
- console.log("復元処理開始");
151
- return [4 /*yield*/, (0, CoinFnc_1.restorePurchases)(dispatch, true)];
152
- case 2:
153
- receipts = _a.sent();
154
- if (receipts) {
155
- console.log("復元されたアイテム: ", receipts.length, "件");
156
- receipts.forEach(function (receipt) {
157
- dispatch((0, CoinFnc_1.updateAllFreeState)(receipt));
158
- });
159
- }
160
- else {
161
- console.log("復元するアイテムがありませんでした");
162
- }
163
- return [3 /*break*/, 5];
164
- case 3:
165
- error_2 = _a.sent();
166
- console.error("復元処理中にエラーが発生しました", error_2);
167
- console.error("エラーの詳細: ", error_2 instanceof Error ? error_2.message : String(error_2));
168
- return [3 /*break*/, 5];
169
- case 4:
170
- // 🔧 修正5(再修正): エラー時のみ保存しない、正常完了時は常に保存
171
- // receipts === null → 通信エラー等(状態を保持)
172
- // receipts === [] → 購入なし/返金済み("none"に更新して保存)
173
- // receipts !== null → 正常に取得完了(常に保存)
174
- if (receipts !== null) {
175
- dispatch(stores_1.settingStorage.saveSetting());
176
- if (receipts.length > 0) {
177
- console.log("\u5FA9\u5143\u6210\u529F\uFF1A".concat(receipts.length, "\u4EF6\u306E\u8CFC\u5165\u3092\u78BA\u8A8D\u3057\u3001\u8A2D\u5B9A\u3092\u4FDD\u5B58\u3057\u307E\u3057\u305F"));
178
- }
179
- else {
180
- console.log('復元完了:購入アイテムなし(返金済み等)。状態を"none"に更新しました');
181
- }
182
- }
183
- else {
184
- console.log("復元エラー:通信失敗等のため設定を保存しませんでした(既存状態を保持)");
185
- }
186
- setLoading(false); // 処理終了
187
- return [7 /*endfinally*/];
188
- case 5: return [2 /*return*/];
98
+ const handleRestore = () => __awaiter(void 0, void 0, void 0, function* () {
99
+ setLoading(true); // 処理開始
100
+ let receipts = null; // スコープを外に出す
101
+ try {
102
+ console.log("復元処理開始");
103
+ receipts = yield (0, CoinFnc_1.restorePurchases)(dispatch, true);
104
+ if (receipts) {
105
+ console.log("復元されたアイテム: ", receipts.length, "件");
106
+ receipts.forEach((receipt) => {
107
+ dispatch((0, CoinFnc_1.updateAllFreeState)(receipt));
108
+ });
109
+ }
110
+ else {
111
+ console.log("復元するアイテムがありませんでした");
189
112
  }
190
- });
191
- }); };
192
- return (<CoinPageComponent_1.default navigation={navigation} comments={comments} products={products} onPurchase={handlePurchaseItem} onRestore={handleRestore} loading={loading} isAllfreePaid={isAllfreePaid}/>);
113
+ }
114
+ catch (error) {
115
+ console.error("復元処理中にエラーが発生しました", error);
116
+ console.error("エラーの詳細: ", error instanceof Error ? error.message : String(error));
117
+ }
118
+ finally {
119
+ // 🔧 修正5(再修正): エラー時のみ保存しない、正常完了時は常に保存
120
+ // receipts === null → 通信エラー等(状態を保持)
121
+ // receipts === [] → 購入なし/返金済み("none"に更新して保存)
122
+ // receipts !== null → 正常に取得完了(常に保存)
123
+ if (receipts !== null) {
124
+ dispatch(stores_1.settingStorage.saveSetting());
125
+ if (receipts.length > 0) {
126
+ console.log(`復元成功:${receipts.length}件の購入を確認し、設定を保存しました`);
127
+ }
128
+ else {
129
+ console.log('復元完了:購入アイテムなし(返金済み等)。状態を"none"に更新しました');
130
+ }
131
+ }
132
+ else {
133
+ console.log("復元エラー:通信失敗等のため設定を保存しませんでした(既存状態を保持)");
134
+ }
135
+ setLoading(false); // 処理終了
136
+ }
137
+ });
138
+ return (<CoinPageComponent_1.default navigation={navigation} comments={comments} products={products} onPurchase={handlePurchaseItem} onRestore={handleRestore} loading={loading} isAllfreePaid={isAllfreePaid} warningContent={warningContent}/>);
193
139
  };
194
140
  exports.default = CoinPage;
@@ -26,22 +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 common_1 = require("@nakamura-123/common");
30
- var lib_1 = require("@nakamura-123/lib");
31
- var react_1 = __importStar(require("react"));
32
- var react_native_1 = require("react-native");
33
- var react_native_collapsible_1 = __importDefault(require("react-native-collapsible"));
34
- var faqJa_1 = require("../component/FAQ/faqJa");
35
- var faqEn_1 = require("../component/FAQ/faqEn");
36
- var react_redux_1 = require("react-redux");
37
- var FAQPage = function () {
38
- var _a = (0, react_1.useState)(new Set()), openIndexes = _a[0], setOpenIndexes = _a[1];
39
- var i18n = (0, common_1.useDrillTranslation)().i18n;
40
- var faqDatas = (i18n === null || i18n === void 0 ? void 0 : i18n.language) === "en" ? faqEn_1.faqEnDatas : faqJa_1.faqJaDatas;
41
- var isJLPT = (0, react_redux_1.useSelector)(function (state) { return state.app.appSetting.setting.appSystem; }) === "JLPT";
42
- var toggleCollapse = function (groupIndex, questionIndex) {
43
- var uniqueKey = "".concat(groupIndex, "-").concat(questionIndex);
44
- var newOpenIndexes = new Set(openIndexes);
29
+ const common_1 = require("@nakamura-123/common");
30
+ const lib_1 = require("@nakamura-123/lib");
31
+ const react_1 = __importStar(require("react"));
32
+ const react_native_1 = require("react-native");
33
+ const react_native_collapsible_1 = __importDefault(require("react-native-collapsible"));
34
+ const faqJa_1 = require("../component/FAQ/faqJa");
35
+ const faqEn_1 = require("../component/FAQ/faqEn");
36
+ const react_redux_1 = require("react-redux");
37
+ const FAQPage = () => {
38
+ const [openIndexes, setOpenIndexes] = (0, react_1.useState)(new Set());
39
+ const { i18n } = (0, common_1.useDrillTranslation)();
40
+ const faqDatas = (i18n === null || i18n === void 0 ? void 0 : i18n.language) === "en" ? faqEn_1.faqEnDatas : faqJa_1.faqJaDatas;
41
+ const isJLPT = (0, react_redux_1.useSelector)((state) => state.app.appSetting.setting.appSystem) === "JLPT";
42
+ const toggleCollapse = (groupIndex, questionIndex) => {
43
+ const uniqueKey = `${groupIndex}-${questionIndex}`;
44
+ const newOpenIndexes = new Set(openIndexes);
45
45
  if (newOpenIndexes.has(uniqueKey)) {
46
46
  newOpenIndexes.delete(uniqueKey);
47
47
  }
@@ -58,14 +58,14 @@ var FAQPage = function () {
58
58
  return (<react_native_1.View style={styles.container}>
59
59
  <common_1.MyText style={styles.title}>FAQ</common_1.MyText>
60
60
  <react_native_1.ScrollView contentContainerStyle={styles.scrollContainer} showsVerticalScrollIndicator={false}>
61
- {faqDatas.map(function (group, groupIndex) { return (<react_native_1.View key={"group-".concat(groupIndex)} style={styles.section}>
61
+ {faqDatas.map((group, groupIndex) => (<react_native_1.View key={`group-${groupIndex}`} style={styles.section}>
62
62
  {/* セクションタイトル */}
63
63
  <common_1.MyText style={styles.sectionTitle}>{group.title}</common_1.MyText>
64
64
  {/* 各質問 */}
65
- {group.lists.map(function (item, questionIndex) {
66
- var uniqueKey = "".concat(groupIndex, "-").concat(questionIndex);
67
- return (<react_native_1.View style={styles.faqItem} key={"item-".concat(uniqueKey)}>
68
- <react_native_1.TouchableOpacity style={styles.questionContainer} onPress={function () { return toggleCollapse(groupIndex, questionIndex); }}>
65
+ {group.lists.map((item, questionIndex) => {
66
+ const uniqueKey = `${groupIndex}-${questionIndex}`;
67
+ return (<react_native_1.View style={styles.faqItem} key={`item-${uniqueKey}`}>
68
+ <react_native_1.TouchableOpacity style={styles.questionContainer} onPress={() => toggleCollapse(groupIndex, questionIndex)}>
69
69
  <react_native_1.View style={styles.titleBox}>
70
70
  <common_1.MyText>{item.que}</common_1.MyText>
71
71
  </react_native_1.View>
@@ -80,11 +80,11 @@ var FAQPage = function () {
80
80
  </react_native_collapsible_1.default>
81
81
  </react_native_1.View>);
82
82
  })}
83
- </react_native_1.View>); })}
83
+ </react_native_1.View>))}
84
84
  </react_native_1.ScrollView>
85
85
  </react_native_1.View>);
86
86
  };
87
- var styles = react_native_1.StyleSheet.create({
87
+ const styles = react_native_1.StyleSheet.create({
88
88
  container: {
89
89
  flex: 1,
90
90
  padding: 20,
@@ -31,82 +31,46 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
31
31
  step((generator = generator.apply(thisArg, _arguments || [])).next());
32
32
  });
33
33
  };
34
- var __generator = (this && this.__generator) || function (thisArg, body) {
35
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
36
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
37
- function verb(n) { return function (v) { return step([n, v]); }; }
38
- function step(op) {
39
- if (f) throw new TypeError("Generator is already executing.");
40
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
41
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
42
- if (y = 0, t) op = [op[0] & 2, t.value];
43
- switch (op[0]) {
44
- case 0: case 1: t = op; break;
45
- case 4: _.label++; return { value: op[1], done: false };
46
- case 5: _.label++; y = op[1]; op = [0]; continue;
47
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
48
- default:
49
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
50
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
51
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
52
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
53
- if (t[2]) _.ops.pop();
54
- _.trys.pop(); continue;
55
- }
56
- op = body.call(thisArg, _);
57
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
58
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
59
- }
60
- };
61
34
  Object.defineProperty(exports, "__esModule", { value: true });
62
- var react_1 = __importStar(require("react"));
63
- var react_native_1 = require("react-native");
64
- var Animatable = __importStar(require("react-native-animatable"));
65
- var react_redux_1 = require("react-redux");
66
- var common_1 = require("@nakamura-123/common");
67
- var lib_1 = require("@nakamura-123/lib");
68
- var GetBadgePage = function (_a) {
69
- var navigation = _a.navigation;
70
- var dispatch = (0, react_redux_1.useDispatch)();
71
- var imgs = (0, react_redux_1.useSelector)(function (state) { return state.app.imgs; });
72
- var showCharactor = (0, react_redux_1.useSelector)(function (state) { var _a; return (_a = state.app.appSetting.setting) === null || _a === void 0 ? void 0 : _a.showCharactor; }) || false;
73
- var notification = (0, react_redux_1.useSelector)(function (state) { return state.score.notification; });
35
+ const react_1 = __importStar(require("react"));
36
+ const react_native_1 = require("react-native");
37
+ const Animatable = __importStar(require("react-native-animatable"));
38
+ const react_redux_1 = require("react-redux");
39
+ const common_1 = require("@nakamura-123/common");
40
+ const lib_1 = require("@nakamura-123/lib");
41
+ const GetBadgePage = ({ navigation }) => {
42
+ const dispatch = (0, react_redux_1.useDispatch)();
43
+ const imgs = (0, react_redux_1.useSelector)((state) => state.app.imgs);
44
+ const showCharactor = (0, react_redux_1.useSelector)((state) => { var _a; return (_a = state.app.appSetting.setting) === null || _a === void 0 ? void 0 : _a.showCharactor; }) || false;
45
+ const notification = (0, react_redux_1.useSelector)((state) => state.score.notification);
74
46
  if (notification.length === 0)
75
47
  return null;
76
- var imgPath = imgs.chara.l3;
77
- var title = notification[0].title || "";
78
- var badgeName = notification[0].name || "";
79
- var badgeColor = notification[0].color || "blue";
80
- var badgeIcon = notification[0].icon || "star";
81
- var animatableRef = (0, react_1.useRef)(null);
82
- (0, react_1.useEffect)(function () {
83
- return function () {
48
+ const imgPath = imgs.chara.l3;
49
+ const title = notification[0].title || "";
50
+ const badgeName = notification[0].name || "";
51
+ const badgeColor = notification[0].color || "blue";
52
+ const badgeIcon = notification[0].icon || "star";
53
+ const animatableRef = (0, react_1.useRef)(null);
54
+ (0, react_1.useEffect)(() => {
55
+ return () => {
84
56
  dispatch({ type: "score/removeFirstNotification" });
85
57
  };
86
58
  }, []);
87
- var handleNext = function () { return __awaiter(void 0, void 0, void 0, function () {
88
- return __generator(this, function (_a) {
89
- switch (_a.label) {
90
- case 0:
91
- if (!animatableRef.current) return [3 /*break*/, 5];
92
- return [4 /*yield*/, animatableRef.current.fadeOut(300)];
93
- case 1:
94
- _a.sent(); // アニメーション終了を待つ
95
- if (!(notification.length > 1)) return [3 /*break*/, 4];
96
- dispatch({ type: "score/removeFirstNotification" });
97
- if (!animatableRef.current) return [3 /*break*/, 3];
98
- return [4 /*yield*/, animatableRef.current.fadeIn(300)];
99
- case 2:
100
- _a.sent();
101
- _a.label = 3;
102
- case 3: return [3 /*break*/, 5];
103
- case 4:
104
- navigation.goBack(); // データがない場合は画面遷移
105
- _a.label = 5;
106
- case 5: return [2 /*return*/];
59
+ const handleNext = () => __awaiter(void 0, void 0, void 0, function* () {
60
+ if (animatableRef.current) {
61
+ yield animatableRef.current.fadeOut(300); // アニメーション終了を待つ
62
+ if (notification.length > 1) {
63
+ dispatch({ type: "score/removeFirstNotification" });
64
+ // データが更新された後にフェードインを実行
65
+ if (animatableRef.current) {
66
+ yield animatableRef.current.fadeIn(300);
67
+ }
107
68
  }
108
- });
109
- }); };
69
+ else {
70
+ navigation.goBack(); // データがない場合は画面遷移
71
+ }
72
+ }
73
+ });
110
74
  return (<react_native_1.View style={styles.page}>
111
75
  <Animatable.View ref={animatableRef} animation="fadeIn" duration={300} style={styles.card}>
112
76
  <common_1.MyText fsize="xl">Congratulations!</common_1.MyText>
@@ -124,13 +88,13 @@ var GetBadgePage = function (_a) {
124
88
  </common_1.MyText>
125
89
  </react_native_1.View>
126
90
  <react_native_1.View style={styles.btnBox}>
127
- <common_1.MiniIconBtn onPress={function () { return navigation.navigate("Badge"); }} icon="shield-alt" title="バッジ一覧" color="ltBlack" outerStyle={styles.miniBtnOuter}/>
91
+ <common_1.MiniIconBtn onPress={() => navigation.navigate("Badge")} icon="shield-alt" title="バッジ一覧" color="ltBlack" outerStyle={styles.miniBtnOuter}/>
128
92
  <common_1.MiniIconBtn onPress={handleNext} icon="arrow-right" title="次 へ" color="blue" outerStyle={styles.miniBtnOuter}/>
129
93
  </react_native_1.View>
130
94
  </Animatable.View>
131
95
  </react_native_1.View>);
132
96
  };
133
- var styles = react_native_1.StyleSheet.create({
97
+ const styles = react_native_1.StyleSheet.create({
134
98
  page: {
135
99
  flex: 1,
136
100
  justifyContent: "center",