@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
@@ -23,20 +23,20 @@ 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_redux_1 = require("react-redux");
28
- var common_1 = require("@nakamura-123/common");
29
- var OpeningMsg = function () {
30
- var dispatch = (0, react_redux_1.useDispatch)();
31
- var _a = (0, react_1.useState)(false), isShowed = _a[0], setIsShowed = _a[1];
32
- var _b = (0, react_1.useState)(null), msg = _b[0], setMsg = _b[1];
33
- var openingMsgs = (0, react_redux_1.useSelector)(function (state) { return state.app.appSetting.information.openingMsgs; });
34
- var showedMsgIds = (0, react_redux_1.useSelector)(function (state) { return state.setting.showedMsgIds; });
35
- var settingAsyncLoaded = (0, react_redux_1.useSelector)(function (state) { return state.setting.asyncLoaded; });
36
- var unshowedMsgs = Array.isArray(openingMsgs) && Array.isArray(showedMsgIds)
37
- ? openingMsgs.filter(function (m) { return !showedMsgIds.includes(m.id); })
26
+ const react_1 = __importStar(require("react"));
27
+ const react_redux_1 = require("react-redux");
28
+ const common_1 = require("@nakamura-123/common");
29
+ const OpeningMsg = () => {
30
+ const dispatch = (0, react_redux_1.useDispatch)();
31
+ const [isShowed, setIsShowed] = (0, react_1.useState)(false);
32
+ const [msg, setMsg] = (0, react_1.useState)(null);
33
+ const openingMsgs = (0, react_redux_1.useSelector)((state) => state.app.appSetting.information.openingMsgs);
34
+ const showedMsgIds = (0, react_redux_1.useSelector)((state) => state.setting.showedMsgIds);
35
+ const settingAsyncLoaded = (0, react_redux_1.useSelector)((state) => state.setting.asyncLoaded);
36
+ const unshowedMsgs = Array.isArray(openingMsgs) && Array.isArray(showedMsgIds)
37
+ ? openingMsgs.filter((m) => !showedMsgIds.includes(m.id))
38
38
  : [];
39
- (0, react_1.useEffect)(function () {
39
+ (0, react_1.useEffect)(() => {
40
40
  if (unshowedMsgs.length === 0)
41
41
  return;
42
42
  if (openingMsgs.length === 0)
@@ -46,7 +46,7 @@ var OpeningMsg = function () {
46
46
  setMsg(unshowedMsgs[0]);
47
47
  setIsShowed(true);
48
48
  }, [unshowedMsgs.length, settingAsyncLoaded]);
49
- var handleClose = function () {
49
+ const handleClose = () => {
50
50
  if (msg) {
51
51
  dispatch({ type: "setting/addShowedMsgId", payload: msg.id });
52
52
  setIsShowed(false);
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.correctAlart = exports.checkId = exports.checkPassword = void 0;
4
- var react_native_1 = require("react-native");
5
- var checkPassword = function (password) {
6
- var isAlphanumeric = /^[a-zA-Z0-9]+$/;
4
+ const react_native_1 = require("react-native");
5
+ const checkPassword = (password) => {
6
+ const isAlphanumeric = /^[a-zA-Z0-9]+$/;
7
7
  if (password.length < 4) {
8
8
  react_native_1.Alert.alert("入力エラー", "4文字以上必要です。");
9
9
  return false;
@@ -15,8 +15,8 @@ var checkPassword = function (password) {
15
15
  return true;
16
16
  };
17
17
  exports.checkPassword = checkPassword;
18
- var checkId = function (id) {
19
- var isAlphanumeric = /^[a-zA-Z0-9]+$/;
18
+ const checkId = (id) => {
19
+ const isAlphanumeric = /^[a-zA-Z0-9]+$/;
20
20
  if (id.length !== 8) {
21
21
  react_native_1.Alert.alert("入力エラー", "8文字で入力してください。");
22
22
  return false;
@@ -28,7 +28,7 @@ var checkId = function (id) {
28
28
  return true;
29
29
  };
30
30
  exports.checkId = checkId;
31
- var correctAlart = function () {
31
+ const correctAlart = () => {
32
32
  react_native_1.Alert.alert("保存完了", "オンラインバックアップが完了しました。");
33
33
  };
34
34
  exports.correctAlart = correctAlart;
@@ -3,16 +3,15 @@ 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 react_1 = __importDefault(require("react"));
8
- var react_native_1 = require("react-native");
9
- var TITLE = "新しい保存データを作成";
10
- var NOTE = "バックアップデータをオンライン上に作成します。";
11
- var OnlineSaveBtn = function (_a) {
12
- var onPress = _a.onPress;
6
+ const common_1 = require("@nakamura-123/common");
7
+ const react_1 = __importDefault(require("react"));
8
+ const react_native_1 = require("react-native");
9
+ const TITLE = "新しい保存データを作成";
10
+ const NOTE = "バックアップデータをオンライン上に作成します。";
11
+ const OnlineSaveBtn = ({ onPress }) => {
13
12
  return (<common_1.RectangleCard title={TITLE} note={NOTE} color="green" left={<common_1.IconInCircle name="plus" size={25}/>} onPress={onPress} outerStyle={styles.button}/>);
14
13
  };
15
- var styles = react_native_1.StyleSheet.create({
14
+ const styles = react_native_1.StyleSheet.create({
16
15
  button: {
17
16
  marginVertical: 20,
18
17
  },
@@ -3,31 +3,30 @@ 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 react_1 = __importDefault(require("react"));
8
- var react_native_1 = require("react-native");
9
- var react_redux_1 = require("react-redux");
10
- var OnlineSavedList = function (_a) {
11
- var setVisible = _a.setVisible, setId = _a.setId;
12
- var datas = (0, react_redux_1.useSelector)(function (state) { return state.setting.input.onlineSave; });
13
- var items = datas
14
- .map(function (data) { return ({
6
+ const common_1 = require("@nakamura-123/common");
7
+ const react_1 = __importDefault(require("react"));
8
+ const react_native_1 = require("react-native");
9
+ const react_redux_1 = require("react-redux");
10
+ const OnlineSavedList = ({ setVisible, setId }) => {
11
+ const datas = (0, react_redux_1.useSelector)((state) => state.setting.input.onlineSave);
12
+ let items = datas
13
+ .map((data) => ({
15
14
  id: data.id,
16
15
  title: data.id,
17
16
  date: data.date,
18
- }); })
17
+ }))
19
18
  .reverse();
20
19
  items.push({ id: "", title: "リスト以外のIDでロード", date: "" });
21
- var onPress = function (id) {
20
+ const onPress = (id) => {
22
21
  setId(id);
23
22
  setVisible();
24
23
  };
25
24
  return (<react_native_1.View>
26
- {items.map(function (item) { return (<common_1.RectangleCard key={item.id} // mapでレンダリングする際にはkeyが必要
27
- title={item.title} note={item.date} left={<common_1.IconInCircle name="save" size={25}/>} color="blue" onPress={function () { return onPress(item.id); }} outerStyle={styles.item}/>); })}
25
+ {items.map((item) => (<common_1.RectangleCard key={item.id} // mapでレンダリングする際にはkeyが必要
26
+ title={item.title} note={item.date} left={<common_1.IconInCircle name="save" size={25}/>} color="blue" onPress={() => onPress(item.id)} outerStyle={styles.item}/>))}
28
27
  </react_native_1.View>);
29
28
  };
30
- var styles = react_native_1.StyleSheet.create({
29
+ const styles = react_native_1.StyleSheet.create({
31
30
  item: {
32
31
  marginBottom: 10,
33
32
  },
@@ -31,114 +31,67 @@ 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
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
62
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
63
- if (ar || !(i in from)) {
64
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
65
- ar[i] = from[i];
66
- }
67
- }
68
- return to.concat(ar || Array.prototype.slice.call(from));
69
- };
70
34
  Object.defineProperty(exports, "__esModule", { value: true });
71
- var react_1 = __importStar(require("react"));
72
- var react_native_1 = require("react-native");
73
- var common_1 = require("@nakamura-123/common");
74
- var react_2 = require("@realm/react");
75
- var OnlineInputFnc_1 = require("./OnlineInputFnc");
76
- var db_1 = require("@nakamura-123/db");
77
- var react_redux_1 = require("react-redux");
78
- var stores_1 = require("@nakamura-123/stores");
79
- var lib_1 = require("@nakamura-123/lib");
80
- var PasswordModal = function (_a) {
81
- var isVisible = _a.isVisible, onClose = _a.onClose;
82
- var realm = (0, react_2.useRealm)();
83
- var dispatch = (0, react_redux_1.useDispatch)();
84
- var saveUrl = (0, react_redux_1.useSelector)(function (state) { var _a; return (_a = state.app.appSetting.setting) === null || _a === void 0 ? void 0 : _a.api.inputSave; }) || "";
85
- var appKey = (0, react_redux_1.useSelector)(function (state) { return state.app.appSetting.quizName.appKey; }) ||
35
+ const react_1 = __importStar(require("react"));
36
+ const react_native_1 = require("react-native");
37
+ const common_1 = require("@nakamura-123/common");
38
+ const react_2 = require("@realm/react");
39
+ const OnlineInputFnc_1 = require("./OnlineInputFnc");
40
+ const db_1 = require("@nakamura-123/db");
41
+ const react_redux_1 = require("react-redux");
42
+ const stores_1 = require("@nakamura-123/stores");
43
+ const lib_1 = require("@nakamura-123/lib");
44
+ const PasswordModal = ({ isVisible, onClose }) => {
45
+ const realm = (0, react_2.useRealm)();
46
+ const dispatch = (0, react_redux_1.useDispatch)();
47
+ const saveUrl = (0, react_redux_1.useSelector)((state) => { var _a; return (_a = state.app.appSetting.setting) === null || _a === void 0 ? void 0 : _a.api.inputSave; }) || "";
48
+ const appKey = (0, react_redux_1.useSelector)((state) => state.app.appSetting.quizName.appKey) ||
86
49
  "";
87
- var datas = (0, react_redux_1.useSelector)(function (state) { return state.setting.input.onlineSave; });
88
- var _b = (0, react_1.useState)(""), password = _b[0], setPassword = _b[1];
89
- var _c = (0, react_1.useState)(false), loading = _c[0], setLoading = _c[1];
50
+ const datas = (0, react_redux_1.useSelector)((state) => state.setting.input.onlineSave);
51
+ const [password, setPassword] = (0, react_1.useState)("");
52
+ const [loading, setLoading] = (0, react_1.useState)(false);
90
53
  // セーブ時の動作
91
- var handleSave = function () { return __awaiter(void 0, void 0, void 0, function () {
92
- var isChecked, oldIds, inputSaveData, sendData, res, date, error_1;
93
- return __generator(this, function (_a) {
94
- switch (_a.label) {
95
- case 0:
96
- isChecked = (0, OnlineInputFnc_1.checkPassword)(password);
97
- if (!isChecked)
98
- return [2 /*return*/];
99
- oldIds = getOldIds(datas);
100
- setLoading(true);
101
- _a.label = 1;
102
- case 1:
103
- _a.trys.push([1, 3, 4, 5]);
104
- inputSaveData = db_1.InputModel.getAllInput(realm);
105
- sendData = {
106
- appKey: appKey,
107
- password: password,
108
- saveData: inputSaveData,
109
- deleteIds: oldIds,
110
- };
111
- return [4 /*yield*/, stores_1.inputApi.inputSaveApi(sendData, saveUrl)];
112
- case 2:
113
- res = _a.sent();
114
- date = lib_1.timeFnc.getNowString();
115
- dispatch({
116
- type: "setting/addOnlineSave",
117
- payload: { date: date, id: res.id },
118
- });
119
- // 古いデータを削除
120
- dispatch({
121
- type: "setting/deleteOnlineSave",
122
- payload: res.deleteIds || [],
123
- });
124
- (0, OnlineInputFnc_1.correctAlart)();
125
- dispatch(stores_1.settingStorage.saveSetting());
126
- return [3 /*break*/, 5];
127
- case 3:
128
- error_1 = _a.sent();
129
- // エラーの種類に応じた処理
130
- console.error("エラーが発生しました:", error_1);
131
- return [3 /*break*/, 5];
132
- case 4:
133
- // ローディング状態の解除とモーダルのクローズ
134
- setLoading(false);
135
- onClose();
136
- setPassword("");
137
- return [7 /*endfinally*/];
138
- case 5: return [2 /*return*/];
139
- }
140
- });
141
- }); };
54
+ const handleSave = () => __awaiter(void 0, void 0, void 0, function* () {
55
+ const isChecked = (0, OnlineInputFnc_1.checkPassword)(password);
56
+ if (!isChecked)
57
+ return;
58
+ const oldIds = getOldIds(datas);
59
+ setLoading(true);
60
+ try {
61
+ const inputSaveData = db_1.InputModel.getAllInput(realm);
62
+ const sendData = {
63
+ appKey,
64
+ password,
65
+ saveData: inputSaveData,
66
+ deleteIds: oldIds,
67
+ };
68
+ // API呼び出し
69
+ const res = yield stores_1.inputApi.inputSaveApi(sendData, saveUrl);
70
+ // 成功レスポンスの処理
71
+ const date = lib_1.timeFnc.getNowString();
72
+ dispatch({
73
+ type: "setting/addOnlineSave",
74
+ payload: { date, id: res.id },
75
+ });
76
+ // 古いデータを削除
77
+ dispatch({
78
+ type: "setting/deleteOnlineSave",
79
+ payload: res.deleteIds || [],
80
+ });
81
+ (0, OnlineInputFnc_1.correctAlart)();
82
+ dispatch(stores_1.settingStorage.saveSetting());
83
+ }
84
+ catch (error) {
85
+ // エラーの種類に応じた処理
86
+ console.error("エラーが発生しました:", error);
87
+ }
88
+ finally {
89
+ // ローディング状態の解除とモーダルのクローズ
90
+ setLoading(false);
91
+ onClose();
92
+ setPassword("");
93
+ }
94
+ });
142
95
  return (<common_1.BaseModal isVisible={isVisible} onClose={onClose}>
143
96
  <common_1.Spinner loading={loading}/>
144
97
  <react_native_1.View style={styles.msgBox}>
@@ -150,20 +103,21 @@ var PasswordModal = function (_a) {
150
103
  <common_1.MyText>・保存上限は3スロット。それ以上は古いデータから削除。</common_1.MyText>
151
104
  </react_native_1.View>
152
105
  <react_native_1.View style={styles.inputBox}>
153
- <react_native_1.TextInput style={styles.input} placeholder="pass123" value={password} onChangeText={function (text) { return setPassword(text); }}/>
106
+ <react_native_1.TextInput style={styles.input} placeholder="pass123" value={password} onChangeText={(text) => setPassword(text)}/>
154
107
  </react_native_1.View>
155
108
  <react_native_1.View style={styles.btnBox}>
156
109
  <common_1.MiniIconBtn onPress={onClose} icon="times" title="キャンセル" color="ltBlack"/>
157
- <common_1.MiniIconBtn onPress={function () { return handleSave(); }} icon="cloud-upload-alt" title="保存する" color="green"/>
110
+ <common_1.MiniIconBtn onPress={() => handleSave()} icon="cloud-upload-alt" title="保存する" color="green"/>
158
111
  </react_native_1.View>
159
112
  </common_1.BaseModal>);
160
113
  };
161
114
  function getOldIds(dataList) {
162
- return __spreadArray([], dataList, true).sort(function (a, b) { return new Date(b.date).getTime() - new Date(a.date).getTime(); })
115
+ return [...dataList] // 新しい配列を作る
116
+ .sort((a, b) => new Date(b.date).getTime() - new Date(a.date).getTime())
163
117
  .slice(2)
164
- .map(function (item) { return item.id; });
118
+ .map((item) => item.id);
165
119
  }
166
- var styles = react_native_1.StyleSheet.create({
120
+ const styles = react_native_1.StyleSheet.create({
167
121
  msgBox: {
168
122
  alignItems: "flex-start",
169
123
  },
@@ -31,100 +31,60 @@ 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 common_1 = require("@nakamura-123/common");
65
- var react_2 = require("@realm/react");
66
- var OnlineInputFnc_1 = require("./OnlineInputFnc");
67
- var db_1 = require("@nakamura-123/db");
68
- var react_redux_1 = require("react-redux");
69
- var stores_1 = require("@nakamura-123/stores");
70
- var PasswordIdModal = function (_a) {
71
- var isVisible = _a.isVisible, onClose = _a.onClose, id = _a.id, setId = _a.setId;
72
- var realm = (0, react_2.useRealm)();
73
- var loadUrl = (0, react_redux_1.useSelector)(function (state) { var _a; return (_a = state.app.appSetting.setting) === null || _a === void 0 ? void 0 : _a.api.inputLoad; }) || "";
74
- var appKey = (0, react_redux_1.useSelector)(function (state) { return state.app.appSetting.quizName.appKey; });
75
- var _b = (0, react_1.useState)(""), password = _b[0], setPassword = _b[1];
76
- var _c = (0, react_1.useState)(false), loading = _c[0], setLoading = _c[1];
35
+ const react_1 = __importStar(require("react"));
36
+ const react_native_1 = require("react-native");
37
+ const common_1 = require("@nakamura-123/common");
38
+ const react_2 = require("@realm/react");
39
+ const OnlineInputFnc_1 = require("./OnlineInputFnc");
40
+ const db_1 = require("@nakamura-123/db");
41
+ const react_redux_1 = require("react-redux");
42
+ const stores_1 = require("@nakamura-123/stores");
43
+ const PasswordIdModal = ({ isVisible, onClose, id, setId }) => {
44
+ const realm = (0, react_2.useRealm)();
45
+ const loadUrl = (0, react_redux_1.useSelector)((state) => { var _a; return (_a = state.app.appSetting.setting) === null || _a === void 0 ? void 0 : _a.api.inputLoad; }) || "";
46
+ const appKey = (0, react_redux_1.useSelector)((state) => state.app.appSetting.quizName.appKey);
47
+ const [password, setPassword] = (0, react_1.useState)("");
48
+ const [loading, setLoading] = (0, react_1.useState)(false);
77
49
  // セーブ時の動作
78
- var handleSave = function () { return __awaiter(void 0, void 0, void 0, function () {
79
- var isPass, isId, res, error_1;
80
- return __generator(this, function (_a) {
81
- switch (_a.label) {
82
- case 0:
83
- isPass = (0, OnlineInputFnc_1.checkPassword)(password);
84
- isId = (0, OnlineInputFnc_1.checkId)(id);
85
- if (!isPass || !isId)
86
- return [2 /*return*/];
87
- setLoading(true);
88
- _a.label = 1;
89
- case 1:
90
- _a.trys.push([1, 3, 4, 5]);
91
- return [4 /*yield*/, stores_1.inputApi.inputLoadApi({ id: id, password: password, appKey: appKey }, loadUrl)];
92
- case 2:
93
- res = _a.sent();
94
- // 成功レスポンスの処理
95
- db_1.InputModel.updateSaveText(realm, res.data);
96
- (0, OnlineInputFnc_1.correctAlart)();
97
- return [3 /*break*/, 5];
98
- case 3:
99
- error_1 = _a.sent();
100
- console.error("エラーが発生しました:", error_1);
101
- return [3 /*break*/, 5];
102
- case 4:
103
- setLoading(false);
104
- onClose();
105
- setId("");
106
- setPassword("");
107
- return [7 /*endfinally*/];
108
- case 5: return [2 /*return*/];
109
- }
110
- });
111
- }); };
50
+ const handleSave = () => __awaiter(void 0, void 0, void 0, function* () {
51
+ const isPass = (0, OnlineInputFnc_1.checkPassword)(password);
52
+ const isId = (0, OnlineInputFnc_1.checkId)(id);
53
+ if (!isPass || !isId)
54
+ return;
55
+ setLoading(true);
56
+ try {
57
+ const res = yield stores_1.inputApi.inputLoadApi({ id, password, appKey }, loadUrl);
58
+ // 成功レスポンスの処理
59
+ db_1.InputModel.updateSaveText(realm, res.data);
60
+ (0, OnlineInputFnc_1.correctAlart)();
61
+ }
62
+ catch (error) {
63
+ console.error("エラーが発生しました:", error);
64
+ }
65
+ finally {
66
+ setLoading(false);
67
+ onClose();
68
+ setId("");
69
+ setPassword("");
70
+ }
71
+ });
112
72
  return (<common_1.BaseModal isVisible={isVisible} onClose={onClose}>
113
73
  <common_1.Spinner loading={loading}/>
114
74
  <react_native_1.View style={styles.msgBox}>
115
75
  <common_1.MyText>IDとパスワードを入力してください</common_1.MyText>
116
76
  </react_native_1.View>
117
77
  <react_native_1.View style={styles.inputBox}>
118
- <react_native_1.TextInput style={styles.input} placeholder="ID(セーブ時に発行された8文字)" value={id} onChangeText={function (text) { return setId(text); }}/>
119
- <react_native_1.TextInput style={styles.input} placeholder="Password(4文字以上)" value={password} onChangeText={function (text) { return setPassword(text); }}/>
78
+ <react_native_1.TextInput style={styles.input} placeholder="ID(セーブ時に発行された8文字)" value={id} onChangeText={(text) => setId(text)}/>
79
+ <react_native_1.TextInput style={styles.input} placeholder="Password(4文字以上)" value={password} onChangeText={(text) => setPassword(text)}/>
120
80
  </react_native_1.View>
121
81
  <react_native_1.View style={styles.btnBox}>
122
82
  <common_1.MiniIconBtn onPress={onClose} icon="times" title="キャンセル" color="ltBlack"/>
123
- <common_1.MiniIconBtn onPress={function () { return handleSave(); }} icon="cloud-download-alt" title="読み込む" color="blue"/>
83
+ <common_1.MiniIconBtn onPress={() => handleSave()} icon="cloud-download-alt" title="読み込む" color="blue"/>
124
84
  </react_native_1.View>
125
85
  </common_1.BaseModal>);
126
86
  };
127
- var styles = react_native_1.StyleSheet.create({
87
+ const styles = react_native_1.StyleSheet.create({
128
88
  msgBox: {
129
89
  alignItems: "center",
130
90
  },
@@ -1,15 +1,4 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
3
  if (k2 === undefined) k2 = k;
15
4
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -34,47 +23,45 @@ var __importStar = (this && this.__importStar) || function (mod) {
34
23
  return result;
35
24
  };
36
25
  Object.defineProperty(exports, "__esModule", { value: true });
37
- var react_1 = __importStar(require("react"));
38
- var react_native_1 = require("react-native");
39
- var react_redux_1 = require("react-redux");
40
- var common_1 = require("@nakamura-123/common");
41
- var lib_1 = require("@nakamura-123/lib");
42
- var stores_1 = require("@nakamura-123/stores");
43
- var QuizOption = function (_a) {
44
- var t = (0, common_1.useDrillTranslation)().t;
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 common_1 = require("@nakamura-123/common");
30
+ const lib_1 = require("@nakamura-123/lib");
31
+ const stores_1 = require("@nakamura-123/stores");
32
+ const QuizOption = ({}) => {
33
+ const { t } = (0, common_1.useDrillTranslation)();
45
34
  // 設定の選択
46
- var dispatch = (0, react_redux_1.useDispatch)();
47
- var selected = (0, react_redux_1.useSelector)(function (state) { return state.quiz.selected; });
48
- var noShuffle = selected.lesson.noShuffle;
49
- var system = selected.system || "drill";
50
- var storeOption = (0, react_redux_1.useSelector)(function (state) { return state.quizCfg.startCfg.option; });
51
- var handleSelect = function (type, value) {
52
- dispatch(stores_1.cfgAction.selectOption({ key: type, value: value }));
35
+ const dispatch = (0, react_redux_1.useDispatch)();
36
+ const selected = (0, react_redux_1.useSelector)((state) => state.quiz.selected);
37
+ const noShuffle = selected.lesson.noShuffle;
38
+ const system = selected.system || "drill";
39
+ const storeOption = (0, react_redux_1.useSelector)((state) => state.quizCfg.startCfg.option);
40
+ const handleSelect = (type, value) => {
41
+ dispatch(stores_1.cfgAction.selectOption({ key: type, value }));
53
42
  };
54
- var jQuizStartOption = removeOptionByValue(selected.system || "drill");
55
- var quizOption = system === "drill" ? lib_1.startOption.dQuizStartOption : jQuizStartOption;
56
- (0, react_1.useEffect)(function () {
43
+ const jQuizStartOption = removeOptionByValue(selected.system || "drill");
44
+ let quizOption = system === "drill" ? lib_1.startOption.dQuizStartOption : jQuizStartOption;
45
+ (0, react_1.useEffect)(() => {
57
46
  if (noShuffle)
58
47
  dispatch(stores_1.cfgAction.selectOption({ key: "isShuffle", value: false }));
59
48
  }, [noShuffle]);
60
49
  return (<react_native_1.View style={styles.container}>
61
50
  <common_1.HelpMark name="quizOption.tag"/>
62
- {quizOption.map(function (O, i) {
63
- var type = O.type, options = O.options;
64
- var selectedValue = storeOption[type];
65
- var selectedIndex = options.findIndex(function (o) { return o === selectedValue; });
51
+ {quizOption.map((O, i) => {
52
+ const { type, options } = O;
53
+ const selectedValue = storeOption[type];
54
+ const selectedIndex = options.findIndex((o) => o === selectedValue);
66
55
  return (<react_native_1.View key={type} style={styles.container}>
67
56
  <common_1.MyText color="text" fsize="sm" style={styles.title}>
68
- {t("setup.select.".concat(type))}
57
+ {t(`setup.select.${type}`)}
69
58
  </common_1.MyText>
70
- <common_1.OptionSelector key={i} options={options.map(function (o) {
71
- return t("setup.startOption.".concat(O.type, ".").concat(o));
72
- })} selected={selectedIndex} onSelect={function (index) { return handleSelect(type, options[index]); }}/>
59
+ <common_1.OptionSelector key={i} options={options.map((o) => t(`setup.startOption.${O.type}.${o}`))} selected={selectedIndex} onSelect={(index) => handleSelect(type, options[index])}/>
73
60
  </react_native_1.View>);
74
61
  })}
75
62
  </react_native_1.View>);
76
63
  };
77
- var styles = react_native_1.StyleSheet.create({
64
+ const styles = react_native_1.StyleSheet.create({
78
65
  container: {
79
66
  width: "100%",
80
67
  marginBottom: 10,
@@ -86,10 +73,10 @@ var styles = react_native_1.StyleSheet.create({
86
73
  function removeOptionByValue(quizSystem) {
87
74
  if (quizSystem !== "JlptListen")
88
75
  return lib_1.startOption.jQuizStartOption;
89
- var jOption = lib_1.startOption.jQuizStartOption;
90
- var TARGET_VALUE = "selectJapanese";
91
- var newOptions = jOption.map(function (optionGroup) {
92
- return __assign(__assign({}, optionGroup), { options: optionGroup.options.filter(function (opt) { return opt !== TARGET_VALUE; }) });
76
+ const jOption = lib_1.startOption.jQuizStartOption;
77
+ const TARGET_VALUE = "selectJapanese";
78
+ const newOptions = jOption.map((optionGroup) => {
79
+ return Object.assign(Object.assign({}, optionGroup), { options: optionGroup.options.filter((opt) => opt !== TARGET_VALUE) });
93
80
  });
94
81
  return newOptions;
95
82
  }