@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
|
@@ -1,65 +1,53 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
4
|
};
|
|
16
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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 lib_1 = require("@nakamura-123/lib");
|
|
11
|
+
const common_1 = require("@nakamura-123/common");
|
|
12
|
+
const quizHook_1 = require("../../hooks/quizHook");
|
|
13
|
+
const db_1 = require("@nakamura-123/db");
|
|
14
|
+
const react_redux_2 = require("react-redux");
|
|
15
|
+
const { changeTagLevel } = db_1.TagModel;
|
|
16
|
+
const SelectTag = () => {
|
|
17
|
+
const realm = (0, react_2.useRealm)();
|
|
18
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
|
19
|
+
const { t } = (0, common_1.useDrillTranslation)();
|
|
20
|
+
const selected = (0, react_redux_2.useSelector)((state) => state.quiz.selected);
|
|
21
|
+
const selectedSystem = selected.system || "drill";
|
|
22
|
+
let tagInfos = null;
|
|
23
|
+
let tagId = null;
|
|
35
24
|
if (selectedSystem === "JlptBasic" || selectedSystem === "JlptListen") {
|
|
36
|
-
|
|
25
|
+
const question = (0, quizHook_1.useQuestionDataJ)();
|
|
37
26
|
if (!question)
|
|
38
27
|
return null;
|
|
39
28
|
tagInfos = getTagInfos(lib_1.tagLevels, question.tag);
|
|
40
29
|
tagId = (0, quizHook_1.useTagIdJ)(question.quizId, selected.tagName);
|
|
41
30
|
}
|
|
42
31
|
else {
|
|
43
|
-
|
|
32
|
+
const question = (0, quizHook_1.useQuestionDataD)();
|
|
44
33
|
if (!question)
|
|
45
34
|
return null;
|
|
46
35
|
tagInfos = getTagInfos(lib_1.tagLevels, question.tag);
|
|
47
|
-
tagId = (0, quizHook_1.
|
|
36
|
+
tagId = (0, quizHook_1.useTagId)(question.tagObjectId, question.yearId, question.num);
|
|
48
37
|
}
|
|
49
|
-
|
|
38
|
+
const onPress = (level) => {
|
|
50
39
|
if (tagId)
|
|
51
|
-
dispatch(changeTagLevel({ realm
|
|
40
|
+
dispatch(changeTagLevel({ realm, tagId, level }));
|
|
52
41
|
};
|
|
53
42
|
if (!tagInfos)
|
|
54
43
|
return null;
|
|
55
44
|
return (<react_native_1.View style={styles.container}>
|
|
56
|
-
{tagInfos.map(
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
<react_native_1.View style={__assign(__assign({}, styles.textBack), { backgroundColor: textBackColor })}>
|
|
45
|
+
{tagInfos.map(({ circleColor, iconColor, textColor, level }, i) => {
|
|
46
|
+
const textBackColor = textColor !== "transparent" ? lib_1.colors.bkBeige : "transparent";
|
|
47
|
+
return (<react_native_1.Pressable key={i} style={styles.tag} onPress={() => onPress(level)}>
|
|
48
|
+
<react_native_1.View style={Object.assign(Object.assign({}, styles.textBack), { backgroundColor: textBackColor })}>
|
|
61
49
|
<common_1.MyText style={styles.tagTxt} fsize="sm" color={textColor}>
|
|
62
|
-
{t(
|
|
50
|
+
{t(`quiz.tag.${level}`)}
|
|
63
51
|
</common_1.MyText>
|
|
64
52
|
</react_native_1.View>
|
|
65
53
|
<common_1.IconInCircle name="tag" circleColor={circleColor} iconColor={iconColor} size={15}/>
|
|
@@ -67,18 +55,15 @@ var SelectTag = function () {
|
|
|
67
55
|
})}
|
|
68
56
|
</react_native_1.View>);
|
|
69
57
|
};
|
|
70
|
-
|
|
71
|
-
return tagLevels.map(
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
level: level,
|
|
78
|
-
});
|
|
79
|
-
});
|
|
58
|
+
const getTagInfos = (tagLevels, selectedLevel) => {
|
|
59
|
+
return tagLevels.map(({ level, color }) => ({
|
|
60
|
+
circleColor: level === selectedLevel ? color : "bkBeige",
|
|
61
|
+
iconColor: level === selectedLevel ? "white" : color,
|
|
62
|
+
textColor: level === selectedLevel ? "text" : "transparent",
|
|
63
|
+
level,
|
|
64
|
+
}));
|
|
80
65
|
};
|
|
81
|
-
|
|
66
|
+
const styles = react_native_1.StyleSheet.create({
|
|
82
67
|
container: {
|
|
83
68
|
flexDirection: "row",
|
|
84
69
|
justifyContent: "space-between",
|
|
@@ -1,50 +1,34 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
4
|
};
|
|
16
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
var fontWeigth = (0, react_redux_1.useSelector)(function (state) { return state.quizCfg.inQuizOption.fWeight; });
|
|
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 MathView = require("react-native-math-view").default;
|
|
10
|
+
const react_redux_2 = require("react-redux");
|
|
11
|
+
const common_1 = require("@nakamura-123/common");
|
|
12
|
+
const lib_1 = require("@nakamura-123/lib");
|
|
13
|
+
const react_native_animatable_1 = require("react-native-animatable");
|
|
14
|
+
const MyTextqqyy = ({ children, style, isNotSearch, fsize, selectable, }) => {
|
|
15
|
+
const dispatch = (0, react_redux_2.useDispatch)();
|
|
16
|
+
let fontSize = (0, react_redux_1.useSelector)((state) => state.quizCfg.inQuizOption.fsize);
|
|
17
|
+
let fontWeigth = (0, react_redux_1.useSelector)((state) => state.quizCfg.inQuizOption.fWeight);
|
|
30
18
|
if (fsize)
|
|
31
19
|
fontSize = fsize;
|
|
32
|
-
|
|
33
|
-
return (<common_1.MyText style={
|
|
34
|
-
{parsedText.map(
|
|
35
|
-
return renderText(item, function (word) { return lib_1.utilFnc.handleSearch(word); }, fontSize, fontWeigth, dispatch);
|
|
36
|
-
})}
|
|
20
|
+
const parsedText = parseText(children, isNotSearch !== null && isNotSearch !== void 0 ? isNotSearch : false);
|
|
21
|
+
return (<common_1.MyText style={Object.assign(Object.assign({}, styles.p), style)} selectable={selectable}>
|
|
22
|
+
{parsedText.map((item) => renderText(item, (word) => lib_1.utilFnc.handleSearch(word), fontSize, fontWeigth, dispatch))}
|
|
37
23
|
</common_1.MyText>);
|
|
38
24
|
};
|
|
39
25
|
exports.default = MyTextqqyy;
|
|
40
26
|
// 01_まず、文章をqqとyyで分割したうえで、オブジェクトを作る関数を作成します。
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
return parts.map(
|
|
27
|
+
const parseText = (text, isNotSearch) => {
|
|
28
|
+
const parts = text.split(/(qq.*?qq|yy.*?yy|JJ.*?JJ|JB.*?BJ|ZZ[AB]ZZ|XX.*?XX)/g);
|
|
29
|
+
return parts.map((chunk, index) => {
|
|
44
30
|
// 共通処理: 前後の識別子を取り除くヘルパー
|
|
45
|
-
|
|
46
|
-
return chunk.slice(identifier.length, -identifier.length);
|
|
47
|
-
};
|
|
31
|
+
const extractContent = (identifier) => chunk.slice(identifier.length, -identifier.length);
|
|
48
32
|
// 条件別処理
|
|
49
33
|
// a.数式
|
|
50
34
|
if (chunk.startsWith("qq") && chunk.endsWith("qq"))
|
|
@@ -75,27 +59,25 @@ var parseText = function (text, isNotSearch) {
|
|
|
75
59
|
});
|
|
76
60
|
};
|
|
77
61
|
// 02_次に、それぞれの部分を適切なコンポーネントに変換する関数を作成します。
|
|
78
|
-
|
|
62
|
+
const renderText = (item, onSearch, fsize, fWeight, dispatch) => {
|
|
79
63
|
var _a, _b;
|
|
80
|
-
|
|
64
|
+
const renderContentByType = {
|
|
81
65
|
math: <MathView math={item.content} key={item.key}/>,
|
|
82
|
-
search: (<common_1.MyText key={item.key} style={styles.searchText} onPress={
|
|
66
|
+
search: (<common_1.MyText key={item.key} style={styles.searchText} onPress={() => onSearch(item.content || "")} fsize={fsize} weight={fWeight} color="ltBlack">
|
|
83
67
|
{item.content}
|
|
84
68
|
</common_1.MyText>),
|
|
85
|
-
multiAns: (<common_1.MyText key={item.key} fsize={fsize} weight={fWeight} color="red" onPress={
|
|
69
|
+
multiAns: (<common_1.MyText key={item.key} fsize={fsize} weight={fWeight} color="red" onPress={() => onSearch(item.content || "")}>
|
|
86
70
|
{(_a = item.content) === null || _a === void 0 ? void 0 : _a.replace(/yy/g, "")}
|
|
87
71
|
</common_1.MyText>),
|
|
88
|
-
multiAnsB: (<common_1.MyText key={item.key} fsize={fsize} weight={fWeight} color="blue" onPress={
|
|
72
|
+
multiAnsB: (<common_1.MyText key={item.key} fsize={fsize} weight={fWeight} color="blue" onPress={() => onSearch(item.content || "")}>
|
|
89
73
|
{(_b = item.content) === null || _b === void 0 ? void 0 : _b.replace(/yy/g, "")}
|
|
90
74
|
</common_1.MyText>),
|
|
91
75
|
multiRed: <react_native_animatable_1.View key={item.key} style={styles.redBox}/>,
|
|
92
76
|
multiBlue: <react_native_animatable_1.View key={item.key} style={styles.grayBox}/>,
|
|
93
|
-
blankAns: (<common_1.PressAnimatedWrap key={item.key} onPress={
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
});
|
|
98
|
-
}} style={styles.blankBox} scale={0.6}>
|
|
77
|
+
blankAns: (<common_1.PressAnimatedWrap key={item.key} onPress={() => dispatch({
|
|
78
|
+
type: "quiz/setBlankNum",
|
|
79
|
+
payload: Number(item.content),
|
|
80
|
+
})} style={styles.blankBox} scale={0.6}>
|
|
99
81
|
<common_1.MyText color="white" fsize="sm">
|
|
100
82
|
{item.content}
|
|
101
83
|
</common_1.MyText>
|
|
@@ -106,7 +88,7 @@ var renderText = function (item, onSearch, fsize, fWeight, dispatch) {
|
|
|
106
88
|
};
|
|
107
89
|
return renderContentByType[item.type] || renderContentByType.text;
|
|
108
90
|
};
|
|
109
|
-
|
|
91
|
+
const styles = react_native_1.StyleSheet.create({
|
|
110
92
|
p: {
|
|
111
93
|
margin: 5,
|
|
112
94
|
},
|
|
@@ -3,25 +3,24 @@ 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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var nextQuizAction = (0, quizActionHook_1.useNextQuizAction)();
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const react_redux_1 = require("react-redux");
|
|
8
|
+
const common_1 = require("@nakamura-123/common");
|
|
9
|
+
const stores_1 = require("@nakamura-123/stores");
|
|
10
|
+
const TabAnimeView_1 = __importDefault(require("../../component/TabAnimeView"));
|
|
11
|
+
const quizHook_1 = require("../../hooks/quizHook");
|
|
12
|
+
const quizActionHook_1 = require("../../hooks/quizActionHook");
|
|
13
|
+
const PageContainerWrap = ({ navigation, scrollViewRef, children, }) => {
|
|
14
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
|
15
|
+
const mode = (0, quizHook_1.useGetMode)();
|
|
16
|
+
const { turn, activeTurn } = (0, react_redux_1.useSelector)((state) => state.quiz.currentInfo.state);
|
|
17
|
+
const nextQuizAction = (0, quizActionHook_1.useNextQuizAction)();
|
|
19
18
|
// 左右のスワイプでタブを切り替える
|
|
20
|
-
|
|
19
|
+
const swipeRight = () => {
|
|
21
20
|
if (mode === "result" || turn > 0)
|
|
22
21
|
dispatch(stores_1.quizAction.beforeTurn());
|
|
23
22
|
};
|
|
24
|
-
|
|
23
|
+
const swipeLeft = () => {
|
|
25
24
|
if (mode === "result")
|
|
26
25
|
dispatch(stores_1.quizAction.nextTurn());
|
|
27
26
|
else if (turn === activeTurn && mode === "check")
|
|
@@ -3,25 +3,24 @@ 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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var regex = /\)ff\(/;
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const react_redux_1 = require("react-redux");
|
|
8
|
+
const lib_1 = require("@nakamura-123/lib");
|
|
9
|
+
const MyTextqqyy_1 = __importDefault(require("./MyTextqqyy"));
|
|
10
|
+
const common_1 = require("@nakamura-123/common");
|
|
11
|
+
const ZoomableImage_1 = __importDefault(require("./ZoomableImage"));
|
|
12
|
+
const RubyText_1 = __importDefault(require("./RubyText"));
|
|
13
|
+
const utils_1 = require("@nakamura-123/lib/dist/functions/utils");
|
|
14
|
+
const RenderImgOrText = ({ word, imgKey = null, navigation, isNotSearch, selectable, }) => {
|
|
15
|
+
const appSystem = (0, react_redux_1.useSelector)((state) => state.app.appSetting.setting.appSystem);
|
|
16
|
+
const isJLPT = appSystem === "JLPT";
|
|
17
|
+
const qImgs = (0, react_redux_1.useSelector)((state) => state.app.imgs.qImgs);
|
|
18
|
+
const rImgs = (0, react_redux_1.useSelector)((state) => state.app.imgs.rImgs);
|
|
19
|
+
const regex = /\)ff\(/;
|
|
21
20
|
if (typeof word === "string" && /^\//.test(word)) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
const isQuizImg = /^\/q[0-9]/.test(word);
|
|
22
|
+
const isAnsImg = /^\/a[0-9]/.test(word);
|
|
23
|
+
const path = isQuizImg || isAnsImg || isJLPT
|
|
25
24
|
? lib_1.utilFnc.getImgPathFromWord(qImgs, imgKey, word)
|
|
26
25
|
: (0, utils_1.getrImgPath)(rImgs, word);
|
|
27
26
|
if (!path)
|
|
@@ -1,59 +1,45 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
4
|
};
|
|
16
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
var fontSize = (0, react_redux_1.useSelector)(function (state) { return state.quizCfg.inQuizOption.fsize; });
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const react_native_1 = require("react-native");
|
|
8
|
+
const MyTextqqyy_1 = __importDefault(require("./MyTextqqyy"));
|
|
9
|
+
const react_redux_1 = require("react-redux");
|
|
10
|
+
const lib_1 = require("@nakamura-123/lib");
|
|
11
|
+
const common_1 = require("@nakamura-123/common");
|
|
12
|
+
const RubyText = ({ fsize, cStyle, isNoWrap, children, }) => {
|
|
13
|
+
const parsedText = lib_1.utilFnc.parseRubyText(children);
|
|
14
|
+
let fontSize = (0, react_redux_1.useSelector)((state) => state.quizCfg.inQuizOption.fsize);
|
|
27
15
|
// const nextSize = getNextFontSize(fontSize);
|
|
28
16
|
fontSize = fsize || fontSize;
|
|
29
17
|
// const marginBottom = fontSize === "xxl" ? 0 : -5;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return (<react_native_1.View style={
|
|
33
|
-
{parsedText.map(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
<MyTextqqyy_1.default style={__assign({}, styles.ruby)} fsize="xs">
|
|
18
|
+
const flexWrap = isNoWrap ? "nowrap" : "wrap";
|
|
19
|
+
const { bHeight, oHeight } = getLineHeight(fontSize);
|
|
20
|
+
return (<react_native_1.View style={Object.assign(Object.assign({}, styles.lineWrap), { flexWrap })}>
|
|
21
|
+
{parsedText.map((part, index) => part.ruby ? (<react_native_1.View key={index}>
|
|
22
|
+
<react_native_1.Text key={index} style={Object.assign(Object.assign({}, styles.rubyWrapper), cStyle)}>
|
|
23
|
+
<MyTextqqyy_1.default style={Object.assign({}, styles.ruby)} fsize="xs">
|
|
37
24
|
{part.ruby}
|
|
38
25
|
</MyTextqqyy_1.default>
|
|
39
26
|
{"\n"}
|
|
40
|
-
<MyTextqqyy_1.default style={
|
|
27
|
+
<MyTextqqyy_1.default style={Object.assign(Object.assign({}, styles.base), { lineHeight: bHeight })} fsize={fontSize}>
|
|
41
28
|
{part.base}
|
|
42
29
|
</MyTextqqyy_1.default>
|
|
43
30
|
</react_native_1.Text>
|
|
44
31
|
{part.udl && <common_1.UnderLine />}
|
|
45
32
|
</react_native_1.View>) : (<react_native_1.View key={index}>
|
|
46
|
-
<MyTextqqyy_1.default style={
|
|
33
|
+
<MyTextqqyy_1.default style={Object.assign(Object.assign({}, styles.onlyBase), { lineHeight: oHeight })} fsize={fontSize}>
|
|
47
34
|
{part.base}
|
|
48
35
|
</MyTextqqyy_1.default>
|
|
49
36
|
{part.udl && <common_1.UnderLine />}
|
|
50
|
-
</react_native_1.View>)
|
|
51
|
-
})}
|
|
37
|
+
</react_native_1.View>))}
|
|
52
38
|
</react_native_1.View>);
|
|
53
39
|
};
|
|
54
40
|
// LineHeightを算出し、返す
|
|
55
|
-
|
|
56
|
-
|
|
41
|
+
const getLineHeight = (fontSize) => {
|
|
42
|
+
const lineHeightMap = {
|
|
57
43
|
xxxl: { bHeight: 28, oHeight: 42 },
|
|
58
44
|
xxl: { bHeight: 24, oHeight: 39 },
|
|
59
45
|
xl: { bHeight: 20, oHeight: 36 },
|
|
@@ -64,7 +50,7 @@ var getLineHeight = function (fontSize) {
|
|
|
64
50
|
};
|
|
65
51
|
return lineHeightMap[fontSize];
|
|
66
52
|
};
|
|
67
|
-
|
|
53
|
+
const styles = react_native_1.StyleSheet.create({
|
|
68
54
|
lineWrap: {
|
|
69
55
|
flexDirection: "row",
|
|
70
56
|
},
|
|
@@ -3,15 +3,12 @@ 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
|
-
return navigation === null || navigation === void 0 ? void 0 : navigation.navigate("ImgZoom", { path: path });
|
|
13
|
-
};
|
|
14
|
-
return (<react_native_1.TouchableOpacity onPress={function () { return handleImgPress(path); }} activeOpacity={0.7}>
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const react_native_1 = require("react-native");
|
|
8
|
+
const common_1 = require("@nakamura-123/common");
|
|
9
|
+
const ZoomableImage = ({ navigation, path, maxHeightValue, }) => {
|
|
10
|
+
const handleImgPress = (path) => navigation === null || navigation === void 0 ? void 0 : navigation.navigate("ImgZoom", { path });
|
|
11
|
+
return (<react_native_1.TouchableOpacity onPress={() => handleImgPress(path)} activeOpacity={0.7}>
|
|
15
12
|
<common_1.MyImage path={path} maxHeightValue={maxHeightValue}/>
|
|
16
13
|
</react_native_1.TouchableOpacity>);
|
|
17
14
|
};
|
|
@@ -3,23 +3,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var style = _a.style, titleStyle = _a.titleStyle;
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const react_native_1 = require("react-native");
|
|
8
|
+
const lib_1 = require("@nakamura-123/lib");
|
|
9
|
+
const common_1 = require("@nakamura-123/common");
|
|
10
|
+
const quizHook_1 = require("../../hooks/quizHook");
|
|
11
|
+
const CorrectedBar = ({ style, titleStyle }) => {
|
|
13
12
|
// 状態に応じた色やアイコンを設定
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
const isCorrect = (0, quizHook_1.useOneQuestionData)("isCorrected");
|
|
14
|
+
const mode = (0, quizHook_1.useGetMode)();
|
|
16
15
|
if (mode === "quiz")
|
|
17
16
|
return null;
|
|
18
17
|
// デザインの条件
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return (<react_native_1.View style={[styles.bar, { backgroundColor
|
|
18
|
+
const backgroundColor = isCorrect ? lib_1.colors.red : lib_1.colors.blue;
|
|
19
|
+
const iconName = isCorrect ? "circle" : "times";
|
|
20
|
+
const title = isCorrect ? "正解" : "不正解";
|
|
21
|
+
return (<react_native_1.View style={[styles.bar, { backgroundColor }, style]}>
|
|
23
22
|
<common_1.Icon5 name={iconName} size={15} color="white"/>
|
|
24
23
|
<common_1.MyText fsize="md" color="white" style={[styles.title, titleStyle]}>
|
|
25
24
|
{title}
|
|
@@ -27,7 +26,7 @@ var CorrectedBar = function (_a) {
|
|
|
27
26
|
<common_1.Icon5 name={iconName} size={15} color="white"/>
|
|
28
27
|
</react_native_1.View>);
|
|
29
28
|
};
|
|
30
|
-
|
|
29
|
+
const styles = react_native_1.StyleSheet.create({
|
|
31
30
|
bar: {
|
|
32
31
|
width: "100%",
|
|
33
32
|
height: 25,
|
|
@@ -3,15 +3,14 @@ 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
|
-
var question = (0, quizHook_1.useQuestionDataD)();
|
|
6
|
+
const types_1 = require("@nakamura-123/types");
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const react_native_1 = require("react-native");
|
|
9
|
+
const NormalExplain_1 = __importDefault(require("./NormalExplain"));
|
|
10
|
+
const quizHook_1 = require("../../hooks/quizHook");
|
|
11
|
+
const MultiExplain_1 = __importDefault(require("./MultiExplain"));
|
|
12
|
+
const Explain = ({ navigation }) => {
|
|
13
|
+
const question = (0, quizHook_1.useQuestionDataD)();
|
|
15
14
|
if (!question)
|
|
16
15
|
return null;
|
|
17
16
|
return (<>
|
|
@@ -19,5 +18,5 @@ var Explain = function (_a) {
|
|
|
19
18
|
<NormalExplain_1.default navigation={navigation}/>
|
|
20
19
|
</>);
|
|
21
20
|
};
|
|
22
|
-
|
|
21
|
+
const styles = react_native_1.StyleSheet.create({});
|
|
23
22
|
exports.default = Explain;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getExplainDatas = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const getExplainDatas = (word, Q) => {
|
|
5
|
+
const { yearId, num, form } = Q;
|
|
6
6
|
if (word.startsWith("lmn"))
|
|
7
7
|
return { word: word.slice(3), color: "lemon", viewType: "base" };
|
|
8
8
|
if (word.startsWith("(記入例"))
|
|
9
|
-
return { word
|
|
9
|
+
return { word, color: "light", viewType: "copy" };
|
|
10
10
|
if (word.startsWith("/"))
|
|
11
|
-
return { word
|
|
11
|
+
return { word, viewType: "rImg" };
|
|
12
12
|
if (word.startsWith("https"))
|
|
13
|
-
return { word
|
|
13
|
+
return { word, viewType: "mImg", yearId, num };
|
|
14
14
|
if (!form)
|
|
15
15
|
return getNormalChoice(Q.choices, word);
|
|
16
16
|
switch (form) {
|
|
@@ -19,36 +19,30 @@ var getExplainDatas = function (word, Q) {
|
|
|
19
19
|
case "multi":
|
|
20
20
|
return getMultiChoice(Q.multiSel, word);
|
|
21
21
|
default:
|
|
22
|
-
return { word
|
|
22
|
+
return { word, viewType: "base" };
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
25
|
exports.getExplainDatas = getExplainDatas;
|
|
26
26
|
// 選択肢取得の共通ロジック
|
|
27
|
-
|
|
27
|
+
const processWord = (word, getChoice) => {
|
|
28
28
|
if (!word.startsWith("ans"))
|
|
29
|
-
return { word
|
|
30
|
-
|
|
29
|
+
return { word, viewType: "base" };
|
|
30
|
+
const num = extractNumber(word);
|
|
31
31
|
if (num === null)
|
|
32
|
-
return { word
|
|
33
|
-
|
|
32
|
+
return { word, viewType: "base" };
|
|
33
|
+
const choice = getChoice(num);
|
|
34
34
|
return choice
|
|
35
35
|
? { word: choice, viewType: "base", color: "light" }
|
|
36
|
-
: { word
|
|
36
|
+
: { word, viewType: "base" };
|
|
37
37
|
};
|
|
38
38
|
// 通常選択肢
|
|
39
|
-
|
|
40
|
-
return processWord(word, function (num) { var _a; return ((_a = choices.find(function (choice) { return choice.num === num; })) === null || _a === void 0 ? void 0 : _a.choice) || null; });
|
|
41
|
-
};
|
|
39
|
+
const getNormalChoice = (choices, word) => processWord(word, (num) => { var _a; return ((_a = choices.find((choice) => choice.num === num)) === null || _a === void 0 ? void 0 : _a.choice) || null; });
|
|
42
40
|
// 空欄選択肢
|
|
43
|
-
|
|
44
|
-
return processWord(word, function (num) { return blankAns[num - 1] || null; });
|
|
45
|
-
};
|
|
41
|
+
const getBlankChoice = (blankAns, word) => processWord(word, (num) => blankAns[num - 1] || null);
|
|
46
42
|
// マルチ選択肢
|
|
47
|
-
|
|
48
|
-
return processWord(word, function (num) { var _a, _b; return ((_b = (_a = multiSel[num - 1]) === null || _a === void 0 ? void 0 : _a.find(function (choice) { return choice.num === 1; })) === null || _b === void 0 ? void 0 : _b.choice) || null; });
|
|
49
|
-
};
|
|
43
|
+
const getMultiChoice = (multiSel, word) => processWord(word, (num) => { var _a, _b; return ((_b = (_a = multiSel[num - 1]) === null || _a === void 0 ? void 0 : _a.find((choice) => choice.num === 1)) === null || _b === void 0 ? void 0 : _b.choice) || null; });
|
|
50
44
|
// ヘルパー関数: 数字を抽出
|
|
51
|
-
|
|
52
|
-
|
|
45
|
+
const extractNumber = (input) => {
|
|
46
|
+
const match = input.match(/\d+/);
|
|
53
47
|
return match ? parseInt(match[0], 10) : null;
|
|
54
48
|
};
|
|
@@ -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
|
-
|
|
13
|
-
var pathes = _a.pathes, word = _a.word, navigation = _a.navigation, index = _a.index;
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const react_native_1 = require("react-native");
|
|
8
|
+
const FontAwesome5_1 = __importDefault(require("@expo/vector-icons/FontAwesome5"));
|
|
9
|
+
const lib_1 = require("@nakamura-123/lib");
|
|
10
|
+
const common_1 = require("@nakamura-123/common");
|
|
11
|
+
const ZoomableImage_1 = __importDefault(require("../common/ZoomableImage"));
|
|
12
|
+
const MovieBtn = ({ pathes, word, navigation, index, }) => {
|
|
14
13
|
return (<react_native_1.View key={index}>
|
|
15
|
-
<react_native_1.TouchableOpacity style={styles.youtubeButton} onPress={
|
|
14
|
+
<react_native_1.TouchableOpacity style={styles.youtubeButton} onPress={() => lib_1.utilFnc.handleSearch(word)}>
|
|
16
15
|
<react_native_1.View style={styles.iconContainer}>
|
|
17
16
|
<FontAwesome5_1.default name="youtube" size={20} color="#ff0000"/>
|
|
18
17
|
</react_native_1.View>
|
|
@@ -20,10 +19,10 @@ var MovieBtn = function (_a) {
|
|
|
20
19
|
<common_1.MyText color="white">公式解説動画を見る</common_1.MyText>
|
|
21
20
|
</react_native_1.View>
|
|
22
21
|
</react_native_1.TouchableOpacity>
|
|
23
|
-
{pathes.map(
|
|
22
|
+
{pathes.map((path, j) => (<ZoomableImage_1.default key={j} path={path} navigation={navigation}/>))}
|
|
24
23
|
</react_native_1.View>);
|
|
25
24
|
};
|
|
26
|
-
|
|
25
|
+
const styles = react_native_1.StyleSheet.create({
|
|
27
26
|
youtubeButton: {
|
|
28
27
|
flexDirection: "row",
|
|
29
28
|
alignItems: "center",
|