@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.
- package/dist/component/Basic/Badge5s.js +18 -30
- package/dist/component/Basic/BasicContents.js +38 -39
- package/dist/component/Basic/BasicProgressBar.js +16 -17
- package/dist/component/Basic/BasicSetting.js +14 -15
- package/dist/component/Basic/MiniTestCard.js +32 -33
- package/dist/component/Basic/Paw5s.js +9 -13
- package/dist/component/Basic/SelectedExamCnt.js +14 -15
- package/dist/component/Basic/SubCategoryLeft.js +5 -6
- package/dist/component/Basic/SubCategoryList.js +49 -62
- package/dist/component/Boot/SelectRange.js +18 -21
- package/dist/component/Boot/ToggleRange.js +11 -14
- package/dist/component/Coin/AppReviews.js +9 -10
- package/dist/component/Coin/CatchCopy.js +6 -6
- package/dist/component/Coin/CoinCheck.js +18 -54
- package/dist/component/Coin/CoinFnc.js +210 -282
- package/dist/component/Coin/CoinPageComponent.d.ts +1 -0
- package/dist/component/Coin/CoinPageComponent.js +22 -22
- package/dist/component/Coin/ReceiptFnc.js +3 -3
- package/dist/component/Coin/Recommend.js +10 -10
- package/dist/component/Coin/WaitingPayBanner.js +8 -9
- package/dist/component/Discription.js +6 -7
- package/dist/component/Grade/AllTags.js +12 -12
- package/dist/component/Grade/BasicBadge.js +20 -32
- package/dist/component/Grade/GradeCard/ChangeWeeklyModal.js +8 -10
- package/dist/component/Grade/GradeCard/ChangeWeeklyTargetBtn.js +21 -22
- package/dist/component/Grade/GradeCard/DatePickerModal.js +17 -19
- package/dist/component/Grade/GradeCard/GradeCard.js +19 -20
- package/dist/component/Grade/GradeCard/Square3sGrade.js +16 -17
- package/dist/component/Grade/GradeCard/TargetDate.js +19 -20
- package/dist/component/Grade/GradeCard/WeeklyAchivedRate.js +7 -8
- package/dist/component/Grade/GradeCard/WeeklyProgress.js +19 -29
- package/dist/component/Grade/JAllTags.js +16 -16
- package/dist/component/Grade/QuizCntGraph.js +31 -45
- package/dist/component/Grade/ShareBtn.js +30 -68
- package/dist/component/Grade/Square4s.js +14 -15
- package/dist/component/Grade/UnitCircles.js +18 -23
- package/dist/component/Grade/YearCircles.js +17 -22
- package/dist/component/Guide.js +6 -7
- package/dist/component/Home/OpeningMsg.js +14 -14
- package/dist/component/OnlineInput/OnlineInputFnc.js +6 -6
- package/dist/component/OnlineInput/OnlineSaveBtn.js +7 -8
- package/dist/component/OnlineInput/OnlineSavedList.js +13 -14
- package/dist/component/OnlineInput/PasswardModal.js +64 -110
- package/dist/component/OnlineInput/PasswordIdModal.js +40 -80
- package/dist/component/QuizSet/QuizOptionDrill.js +29 -42
- package/dist/component/Result/AdCard.js +21 -16
- package/dist/component/Result/CharaCard.js +15 -16
- package/dist/component/Result/LessonTitle.js +10 -10
- package/dist/component/Result/QuizFlatList.js +26 -30
- package/dist/component/Result/ScoreCircle.js +8 -9
- package/dist/component/SelectRange/SelectYearRange.js +22 -34
- package/dist/component/SettingBtns/QuizOptionSelector.js +16 -17
- package/dist/component/SettingBtns/Range.js +9 -9
- package/dist/component/SettingBtns/TransBtn.js +17 -17
- package/dist/component/TabAnimeView.js +9 -10
- package/dist/component/Tag5s.js +10 -14
- package/dist/component/TagBadge5s.js +16 -17
- package/dist/component/TagBadge5sPress.js +14 -15
- package/dist/component/TestPage/AverageBar.js +12 -24
- package/dist/component/TestPage/BarChartContainer.js +30 -31
- package/dist/component/TestPage/ChartControl.js +5 -6
- package/dist/component/TestPage/Square3s.js +12 -13
- package/dist/functions/badgeBasicFnc.js +22 -42
- package/dist/functions/badgeDailyFnc.js +24 -35
- package/dist/functions/badgeFilter.js +16 -18
- package/dist/functions/badgeFnc.js +24 -33
- package/dist/functions/createQuizFncD.js +33 -33
- package/dist/functions/createQuizFncJ.js +27 -33
- package/dist/functions/gradeFnc.js +48 -87
- package/dist/functions/oldStorageFnc.js +77 -200
- package/dist/functions/questionFilterD.js +19 -28
- package/dist/functions/questionFilterJ.js +9 -9
- package/dist/functions/questionFormatD.js +34 -47
- package/dist/functions/questionFormatJ.js +30 -41
- package/dist/functions/tagFncD.js +37 -39
- package/dist/functions/tagFncJ.js +16 -19
- package/dist/functions/testFnc.js +6 -7
- package/dist/hooks/BadgeHook.js +24 -35
- package/dist/hooks/ExitQuizHook.js +21 -21
- package/dist/hooks/basicHook.js +12 -12
- package/dist/hooks/quizActionHook.js +44 -57
- package/dist/hooks/quizHook.d.ts +2 -1
- package/dist/hooks/quizHook.js +58 -48
- package/dist/index.js +25 -25
- package/dist/page/BadgePage.js +26 -29
- package/dist/page/BasicPage.js +23 -25
- package/dist/page/BootPage.js +48 -53
- package/dist/page/CoinPage.d.ts +1 -0
- package/dist/page/CoinPage.js +90 -144
- package/dist/page/FAQPage.js +23 -23
- package/dist/page/GetBadgePage.js +35 -71
- package/dist/page/GradePage.js +26 -27
- package/dist/page/GuidePage.js +28 -33
- package/dist/page/HistoryPage.js +25 -33
- package/dist/page/HomePage.d.ts +1 -0
- package/dist/page/HomePage.js +62 -108
- package/dist/page/ImgZoom.js +8 -9
- package/dist/page/InformationPage.js +15 -15
- package/dist/page/JDetailSettingPage.js +23 -25
- package/dist/page/OnlineInputPage.js +19 -20
- package/dist/page/QuizPage.js +25 -26
- package/dist/page/QuizSettingPage.js +19 -19
- package/dist/page/QuizSetupPage.js +40 -43
- package/dist/page/ReportPage.js +55 -94
- package/dist/page/ResultPage.js +55 -103
- package/dist/page/SettingPage.js +35 -40
- package/dist/page/TestPage.js +41 -44
- package/dist/quiz/QuizContentsDrill.js +17 -18
- package/dist/quiz/QuizContentsJLPT.js +8 -9
- package/dist/quiz/Title.js +22 -22
- package/dist/quiz/answer/Answer.js +20 -20
- package/dist/quiz/answer/BlangGuide.js +10 -10
- package/dist/quiz/answer/BlankAnswer.js +11 -12
- package/dist/quiz/answer/BlankBtn.js +10 -10
- package/dist/quiz/answer/CheckButton.js +6 -9
- package/dist/quiz/answer/ChoiceView.js +15 -30
- package/dist/quiz/answer/Input/CollapseExplain.js +10 -11
- package/dist/quiz/answer/Input/InputAnswerBtn.js +9 -9
- package/dist/quiz/answer/Input/InputBox.js +17 -18
- package/dist/quiz/answer/Input/InputCounter.js +6 -7
- package/dist/quiz/answer/Input/InputFnc.js +10 -19
- package/dist/quiz/answer/Input/InputSaveSelector.js +12 -13
- package/dist/quiz/answer/Input/InputTab.js +12 -13
- package/dist/quiz/answer/Input/InputWarnning.js +13 -14
- package/dist/quiz/answer/InputGuide.js +10 -10
- package/dist/quiz/answer/InputNav.js +38 -39
- package/dist/quiz/answer/MultiChoice.js +20 -22
- package/dist/quiz/answer/MultiGuide.js +10 -10
- package/dist/quiz/answer/MultiNextBtn.js +13 -14
- package/dist/quiz/answer/NormalChoice.js +29 -42
- package/dist/quiz/answer/NormalMultiGuide.js +11 -12
- package/dist/quiz/answer/styles/getChoiceStyle.js +4 -4
- package/dist/quiz/check/Check.js +17 -18
- package/dist/quiz/check/NextQuizBtn.js +18 -19
- package/dist/quiz/check/SelectTag.js +36 -51
- package/dist/quiz/common/MyTextqqyy.js +29 -47
- package/dist/quiz/common/PageContainerWrap.js +14 -15
- package/dist/quiz/common/RenderImgOrText.js +17 -18
- package/dist/quiz/common/RubyText.js +21 -35
- package/dist/quiz/common/ZoomableImage.js +6 -9
- package/dist/quiz/explain/CorrectedBar.js +13 -14
- package/dist/quiz/explain/Explain.js +9 -10
- package/dist/quiz/explain/ExplainLogic.js +17 -23
- package/dist/quiz/explain/MovieBtn.js +10 -11
- package/dist/quiz/explain/MultiExplain.js +12 -24
- package/dist/quiz/explain/NormalExplain.js +29 -30
- package/dist/quiz/function/choiceFnc.js +2 -2
- package/dist/quiz/jAnswer/JAnswer.js +24 -26
- package/dist/quiz/jAnswer/JAnswerContents.js +12 -27
- package/dist/quiz/jQuestion/JQuestion.js +12 -13
- package/dist/quiz/jQuestion/JQuestionBottomText.js +14 -15
- package/dist/quiz/jQuestion/JQuestionText.js +13 -14
- package/dist/quiz/jQuestion/QuizCnt.js +9 -9
- package/dist/quiz/jQuestion/TimeLimit.js +23 -25
- package/dist/quiz/question/FillDiagram.js +12 -13
- package/dist/quiz/question/Question.js +25 -26
- package/dist/quiz/question/QuestionFormats.js +29 -45
- package/dist/quiz/question/QuestionReference.js +7 -7
- package/dist/quiz/question/SearchYoutue.js +10 -11
- package/dist/quiz/save/QuizSaveData.js +18 -19
- package/dist/quiz/setting/Above3BtnJ.js +25 -30
- package/dist/quiz/setting/Bottom3Btn.js +25 -30
- package/dist/quiz/setting/GuideBtn.js +19 -22
- package/dist/quiz/setting/RepeatBtn.js +27 -34
- package/dist/quiz/setting/ReturnBtn.js +8 -20
- package/dist/quiz/setting/ReturnSaveBtn.js +21 -33
- package/dist/tsconfig.tsbuildinfo +1 -1
- 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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
? openingMsgs.filter(
|
|
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)(
|
|
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
|
-
|
|
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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
|
|
19
|
-
|
|
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
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
20
|
+
const onPress = (id) => {
|
|
22
21
|
setId(id);
|
|
23
22
|
setVisible();
|
|
24
23
|
};
|
|
25
24
|
return (<react_native_1.View>
|
|
26
|
-
{items.map(
|
|
27
|
-
title={item.title} note={item.date} left={<common_1.IconInCircle name="save" size={25}/>} color="blue" onPress={
|
|
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
|
-
|
|
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
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
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
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
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={
|
|
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={
|
|
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
|
|
115
|
+
return [...dataList] // 新しい配列を作る
|
|
116
|
+
.sort((a, b) => new Date(b.date).getTime() - new Date(a.date).getTime())
|
|
163
117
|
.slice(2)
|
|
164
|
-
.map(
|
|
118
|
+
.map((item) => item.id);
|
|
165
119
|
}
|
|
166
|
-
|
|
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
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
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={
|
|
119
|
-
<react_native_1.TextInput style={styles.input} placeholder="Password(4文字以上)" value={password} onChangeText={
|
|
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={
|
|
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
|
-
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
dispatch(stores_1.cfgAction.selectOption({ key: type, 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
|
-
|
|
55
|
-
|
|
56
|
-
(0, react_1.useEffect)(
|
|
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(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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(
|
|
57
|
+
{t(`setup.select.${type}`)}
|
|
69
58
|
</common_1.MyText>
|
|
70
|
-
<common_1.OptionSelector key={i} options={options.map(
|
|
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
|
-
|
|
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
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
return
|
|
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
|
}
|