@nakamura-123/pages 1.4.1 → 1.4.3

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 (54) hide show
  1. package/dist/component/Article/ArticleContentView.d.ts +5 -1
  2. package/dist/component/Article/ArticleContentView.js +199 -34
  3. package/dist/component/Article/ArticleContents.js +5 -4
  4. package/dist/component/Article/ArticleImage.d.ts +9 -0
  5. package/dist/component/Article/ArticleImage.js +46 -0
  6. package/dist/component/Article/ArticleSectionPager.d.ts +17 -0
  7. package/dist/component/Article/ArticleSectionPager.js +193 -0
  8. package/dist/component/Article/ArticleTable.d.ts +10 -0
  9. package/dist/component/Article/ArticleTable.js +74 -0
  10. package/dist/component/Article/ChipStrip.d.ts +10 -0
  11. package/dist/component/Article/ChipStrip.js +82 -0
  12. package/dist/component/Article/Cloze.d.ts +31 -0
  13. package/dist/component/Article/Cloze.js +338 -0
  14. package/dist/component/Article/FramesFigure.d.ts +27 -0
  15. package/dist/component/Article/FramesFigure.js +438 -0
  16. package/dist/component/Article/RefLink.d.ts +42 -0
  17. package/dist/component/Article/RefLink.js +184 -0
  18. package/dist/component/Basic/BasicContents.js +5 -4
  19. package/dist/component/Basic/MiniTestCard.js +3 -2
  20. package/dist/component/Grade/GAllTags.js +3 -4
  21. package/dist/component/Rating/RatingBar.d.ts +9 -0
  22. package/dist/component/Rating/RatingBar.js +358 -0
  23. package/dist/component/Rating/keyboardScroll.d.ts +7 -0
  24. package/dist/component/Rating/keyboardScroll.js +37 -0
  25. package/dist/component/Result/QuizFlatList.js +11 -10
  26. package/dist/component/Result/ResultActions.js +151 -58
  27. package/dist/component/Result/ResultHero.js +19 -18
  28. package/dist/component/SettingBtns/LanguageModal.js +1 -0
  29. package/dist/functions/articleContentFnc.d.ts +49 -1
  30. package/dist/functions/articleContentFnc.js +191 -2
  31. package/dist/functions/joinTitleFnc.d.ts +1 -0
  32. package/dist/functions/joinTitleFnc.js +15 -0
  33. package/dist/functions/ratingFnc.d.ts +4 -0
  34. package/dist/functions/ratingFnc.js +30 -0
  35. package/dist/hooks/resultHook.d.ts +2 -1
  36. package/dist/hooks/resultHook.js +13 -1
  37. package/dist/page/ArticleDetail.js +58 -15
  38. package/dist/page/ArticlePage.js +4 -1
  39. package/dist/page/BasicPage.js +4 -1
  40. package/dist/page/ImgZoom.d.ts +4 -3
  41. package/dist/page/ImgZoom.js +16 -2
  42. package/dist/page/QuizPage.js +23 -11
  43. package/dist/page/ReportPage.js +3 -2
  44. package/dist/quiz/QuizContentsDrill.js +26 -16
  45. package/dist/quiz/common/MyTextqqyy.d.ts +4 -0
  46. package/dist/quiz/common/MyTextqqyy.js +14 -4
  47. package/dist/quiz/common/renderTransUdl.d.ts +3 -0
  48. package/dist/quiz/common/renderTransUdl.js +20 -0
  49. package/dist/quiz/explain/ExplainLogic.d.ts +1 -0
  50. package/dist/quiz/explain/ExplainLogic.js +3 -2
  51. package/dist/quiz/explain/NormalExplain.js +3 -0
  52. package/dist/quiz/grammar/GQuestion.js +13 -1
  53. package/dist/tsconfig.tsbuildinfo +1 -1
  54. package/package.json +2 -2
@@ -0,0 +1,193 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ const react_1 = __importStar(require("react"));
30
+ const react_native_1 = require("react-native");
31
+ const react_native_pager_view_1 = __importDefault(require("react-native-pager-view"));
32
+ const lib_1 = require("@nakamura-123/lib");
33
+ const common_1 = require("@nakamura-123/common");
34
+ const ArticleContentView_1 = __importDefault(require("./ArticleContentView"));
35
+ const ChipStrip_1 = __importDefault(require("./ChipStrip"));
36
+ const RatingBar_1 = __importDefault(require("../Rating/RatingBar"));
37
+ const keyboardScroll_1 = require("../Rating/keyboardScroll");
38
+ const ratingFnc_1 = require("../../functions/ratingFnc");
39
+ const articleContentFnc_1 = require("../../functions/articleContentFnc");
40
+ // 記事ごとに、最後に見ていたページと各ページの縦の位置。アプリを閉じるまで覚えておく
41
+ const positions = new Map();
42
+ const positionOf = (articleId) => {
43
+ const found = positions.get(articleId);
44
+ if (found)
45
+ return found;
46
+ const created = { page: 0, ys: [] };
47
+ positions.set(articleId, created);
48
+ return created;
49
+ };
50
+ const sectionKey = (section, i) => { var _a; return `${i}-${(_a = section.id) !== null && _a !== void 0 ? _a : ""}`; };
51
+ // LESSONを見出し(#)ごとのページにし、横に払って進む。上の見出しの帯で今どこかが分かり、押せば飛べる
52
+ const ArticleSectionPager = ({ title, sections, articleId, navigation, footer, startId, restorePosition, onReportWrong, }) => {
53
+ const pagerRef = (0, react_1.useRef)(null);
54
+ // 開いたときのページと、各ページの縦の位置。開いたあとは変えない
55
+ const [start] = (0, react_1.useState)(() => {
56
+ const saved = positions.get(articleId);
57
+ if (restorePosition && saved)
58
+ return { page: saved.page, ys: [...saved.ys] };
59
+ const found = startId ? (0, articleContentFnc_1.findSectionIndex)(sections, startId) : -1;
60
+ return { page: Math.max(found, 0), ys: [] };
61
+ });
62
+ const [index, setIndex] = (0, react_1.useState)(start.page);
63
+ // 開き直しでなければ、前の位置は捨てて今開いたところから覚え直す
64
+ (0, react_1.useEffect)(() => {
65
+ if (restorePosition && positions.has(articleId))
66
+ return;
67
+ positions.set(articleId, { page: start.page, ys: [] });
68
+ }, []);
69
+ // 今のページはonPageSelectedだけで決める(ここでも決めると、押したときに2回描き直す)
70
+ const goTo = (i) => { var _a; return (_a = pagerRef.current) === null || _a === void 0 ? void 0 : _a.setPage(i); };
71
+ return (<react_native_1.View style={styles.container}>
72
+ {/* ヘッダーは透明で、戻るボタンと設定ボタンが画面の上に浮いている。帯はその間に置く */}
73
+ <react_native_1.View style={styles.stripRow}>
74
+ <ChipStrip_1.default labels={sections.map((section) => section.title)} index={index} onSelect={goTo} style={styles.stripScroll}/>
75
+ </react_native_1.View>
76
+
77
+ <react_native_pager_view_1.default ref={pagerRef} style={styles.pager} initialPage={start.page} onPageSelected={(e) => {
78
+ setIndex(e.nativeEvent.position);
79
+ positionOf(articleId).page = e.nativeEvent.position;
80
+ }}>
81
+ {sections.map((section, i) => {
82
+ var _a, _b, _c;
83
+ return (<react_native_1.View key={sectionKey(section, i)} collapsable={false} style={styles.page}>
84
+ <SectionPage section={section} index={i} initialY={(_a = start.ys[i]) !== null && _a !== void 0 ? _a : 0} title={i === 0 ? title : ""} articleId={articleId} navigation={navigation} prevTitle={(_b = sections[i - 1]) === null || _b === void 0 ? void 0 : _b.title} nextTitle={(_c = sections[i + 1]) === null || _c === void 0 ? void 0 : _c.title} onReportWrong={onReportWrong} onPrev={() => goTo(i - 1)} onNext={() => goTo(i + 1)} footer={i === sections.length - 1 ? footer : null}/>
85
+ </react_native_1.View>);
86
+ })}
87
+ </react_native_pager_view_1.default>
88
+ </react_native_1.View>);
89
+ };
90
+ // ページを払うたびに帯の色を変えるので、ページの中身はそのたびに描き直さないようにする(式の多いLESSONで重くなるため)。
91
+ // onPrev・onNextは毎回新しく作られるが、中身はページの番号で決まるので比べない
92
+ const SectionPage = (0, react_1.memo)(({ section, index, initialY, title, articleId, navigation, prevTitle, nextTitle, onReportWrong, onPrev, onNext, footer, }) => {
93
+ var _a;
94
+ const scrollRef = (0, react_1.useRef)(null);
95
+ const { scrollToInput, onScroll } = (0, keyboardScroll_1.useKeyboardScroll)(scrollRef);
96
+ return (<keyboardScroll_1.KeyboardScrollContext.Provider value={scrollToInput}>
97
+ <react_native_1.ScrollView ref={scrollRef} contentContainerStyle={styles.pageContent} contentOffset={{ x: 0, y: initialY }}
98
+ // 評価の書く欄(ページの終わり)がキーボードに隠れないよう、iOSでキーボードの分の余白を足す
99
+ automaticallyAdjustKeyboardInsets keyboardShouldPersistTaps="handled" onScroll={onScroll} scrollEventThrottle={16} onScrollEndDrag={(e) => {
100
+ positionOf(articleId).ys[index] = e.nativeEvent.contentOffset.y;
101
+ }} onMomentumScrollEnd={(e) => {
102
+ positionOf(articleId).ys[index] = e.nativeEvent.contentOffset.y;
103
+ }}>
104
+ <ArticleContentView_1.default content={{ title, blocks: section.blocks }} articleId={articleId} navigation={navigation} exampleOffset={section.exampleOffset} isLesson/>
105
+ {/* 見出しのページごとに評価する。本文の印は、そのページの中身から作る */}
106
+ <RatingBar_1.default target={(0, ratingFnc_1.lessonTarget)(articleId, (_a = section.id) !== null && _a !== void 0 ? _a : `p${index}`)} ver={(0, ratingFnc_1.ratingVer)(JSON.stringify(section.blocks))} kind="lesson" onReport={onReportWrong}/>
107
+ {/* 前後の見出しへ。片方しか無いページでも、前は左・次は右の位置のまま置く */}
108
+ <react_native_1.View style={styles.navRow}>
109
+ {prevTitle !== undefined ? (<common_1.PressAnimatedWrap onPress={onPrev} outerStyle={styles.navOuter} style={[styles.navButton, styles.navPrev]}>
110
+ <common_1.Icon5 name="arrow-left" size={14} color="ltBlack"/>
111
+ <common_1.MyText fsize="sm" weight={700} color="text" style={styles.navTextPrev} numberOfLines={1}>
112
+ {prevTitle}
113
+ </common_1.MyText>
114
+ </common_1.PressAnimatedWrap>) : (<react_native_1.View style={styles.navOuter}/>)}
115
+ {nextTitle !== undefined ? (<common_1.PressAnimatedWrap onPress={onNext} outerStyle={styles.navOuter} style={[styles.navButton, styles.navNext]}>
116
+ <common_1.MyText fsize="sm" weight={700} color="text" style={styles.navTextNext} numberOfLines={1}>
117
+ {nextTitle}
118
+ </common_1.MyText>
119
+ <common_1.Icon5 name="arrow-right" size={14} color="ltBlack"/>
120
+ </common_1.PressAnimatedWrap>) : (<react_native_1.View style={styles.navOuter}/>)}
121
+ </react_native_1.View>
122
+ {footer}
123
+ </react_native_1.ScrollView>
124
+ </keyboardScroll_1.KeyboardScrollContext.Provider>);
125
+ }, (prev, next) => prev.section === next.section &&
126
+ prev.index === next.index &&
127
+ prev.title === next.title &&
128
+ prev.articleId === next.articleId &&
129
+ prev.prevTitle === next.prevTitle &&
130
+ prev.nextTitle === next.nextTitle &&
131
+ prev.footer === next.footer);
132
+ const styles = react_native_1.StyleSheet.create({
133
+ container: {
134
+ flex: 1,
135
+ backgroundColor: lib_1.colors.beige,
136
+ },
137
+ // 高さと左右の空きは、透明なヘッダーの戻るボタン(左・幅40+余白10)と設定ボタン(右)に合わせる
138
+ stripRow: {
139
+ height: 52,
140
+ justifyContent: "center",
141
+ borderBottomWidth: 1,
142
+ borderBottomColor: lib_1.colors.light,
143
+ backgroundColor: lib_1.colors.beige,
144
+ },
145
+ stripScroll: {
146
+ marginLeft: 58,
147
+ marginRight: 70,
148
+ },
149
+ pager: {
150
+ flex: 1,
151
+ },
152
+ page: {
153
+ flex: 1,
154
+ },
155
+ // 右下のボタン(解説に戻る・図を開き直す)に最後のページの下のボタンが隠れないようにする
156
+ pageContent: {
157
+ paddingBottom: 110,
158
+ },
159
+ navRow: {
160
+ flexDirection: "row",
161
+ marginHorizontal: 10,
162
+ marginTop: 10,
163
+ gap: 10,
164
+ },
165
+ navOuter: {
166
+ flex: 1,
167
+ },
168
+ navButton: {
169
+ height: 44,
170
+ paddingHorizontal: 12,
171
+ flexDirection: "row",
172
+ alignItems: "center",
173
+ borderRadius: 10,
174
+ borderWidth: 1,
175
+ borderColor: lib_1.colors.light,
176
+ backgroundColor: lib_1.colors.bkBeige,
177
+ },
178
+ navPrev: {
179
+ justifyContent: "flex-start",
180
+ },
181
+ navNext: {
182
+ justifyContent: "flex-end",
183
+ },
184
+ navTextPrev: {
185
+ flexShrink: 1,
186
+ marginLeft: 8,
187
+ },
188
+ navTextNext: {
189
+ flexShrink: 1,
190
+ marginRight: 8,
191
+ },
192
+ });
193
+ exports.default = ArticleSectionPager;
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import { FontSize, FontWeight } from "@nakamura-123/lib";
3
+ interface Props {
4
+ rows: string[][];
5
+ blockIndex: number;
6
+ fsize: FontSize;
7
+ weight: FontWeight;
8
+ }
9
+ declare const ArticleTable: React.FC<Props>;
10
+ export default ArticleTable;
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
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 MyTextqqyy_1 = __importDefault(require("../../quiz/common/MyTextqqyy"));
11
+ const ExplainLogic_1 = require("../../quiz/explain/ExplainLogic");
12
+ const articleContentFnc_1 = require("../../functions/articleContentFnc");
13
+ const Cloze_1 = require("./Cloze");
14
+ // 解説の表(ExplainTable)と列幅の決め方はそろえ、見た目だけ記事の形(黒い見出しの行)にする。
15
+ // 見出しの行は白文字で描くため数式の部品を通さない(数式の部品は中の文字の色を自分で決めてしまう)
16
+ const ArticleTable = ({ rows, blockIndex, fsize, weight }) => {
17
+ const searchEnabled = (0, Cloze_1.useLessonSearch)();
18
+ const weights = (0, ExplainLogic_1.columnWeights)(rows);
19
+ const columns = weights.length;
20
+ return (<react_native_1.View style={styles.table}>
21
+ {rows.map((cells, r) => (<react_native_1.View key={r} style={[styles.row, r === 0 ? styles.headRow : styles.bodyRow]}>
22
+ {Array.from({ length: columns }, (_, c) => {
23
+ var _a;
24
+ const text = (_a = cells[c]) !== null && _a !== void 0 ? _a : "";
25
+ return (<react_native_1.View key={c} style={[
26
+ styles.cell,
27
+ { flex: weights[c] },
28
+ c > 0 && styles.cellDivider,
29
+ ]}>
30
+ {r === 0 ? (<common_1.MyText fsize={fsize} weight={700} color="white">
31
+ {text}
32
+ </common_1.MyText>) : (0, articleContentFnc_1.usesClozeText)(text, searchEnabled) ? (<Cloze_1.ClozeText text={text} fsize={fsize} weight={weight} groupOf={(k) => (0, articleContentFnc_1.tableHoleGroup)(blockIndex, r, c, k)} holeEm={3.5}/>) : text.includes("qq") ? (<MyTextqqyy_1.default fsize={fsize} weight={weight} style={styles.qqText} isNotSearch>
33
+ {text}
34
+ </MyTextqqyy_1.default>) : (<common_1.MyText fsize={fsize} weight={weight} color="text">
35
+ {text}
36
+ </common_1.MyText>)}
37
+ </react_native_1.View>);
38
+ })}
39
+ </react_native_1.View>))}
40
+ </react_native_1.View>);
41
+ };
42
+ const styles = react_native_1.StyleSheet.create({
43
+ table: {
44
+ borderWidth: 1.5,
45
+ borderColor: lib_1.colors.darkGray,
46
+ borderRadius: 12,
47
+ overflow: "hidden",
48
+ backgroundColor: lib_1.colors.white,
49
+ marginVertical: 8,
50
+ },
51
+ row: {
52
+ flexDirection: "row",
53
+ },
54
+ headRow: {
55
+ backgroundColor: lib_1.colors.darkGray,
56
+ },
57
+ bodyRow: {
58
+ borderTopWidth: 1,
59
+ borderTopColor: lib_1.colors.light,
60
+ },
61
+ cell: {
62
+ paddingVertical: 6,
63
+ paddingHorizontal: 7,
64
+ },
65
+ cellDivider: {
66
+ borderLeftWidth: 1,
67
+ borderLeftColor: lib_1.colors.light,
68
+ },
69
+ // 数式の部品が持つmargin: 5を外し、数式の無いセルと位置をそろえる
70
+ qqText: {
71
+ margin: 0,
72
+ },
73
+ });
74
+ exports.default = ArticleTable;
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import { StyleProp, ViewStyle } from "react-native";
3
+ interface Props {
4
+ labels: string[];
5
+ index: number;
6
+ onSelect: (index: number) => void;
7
+ style?: StyleProp<ViewStyle>;
8
+ }
9
+ declare const ChipStrip: React.FC<Props>;
10
+ export default ChipStrip;
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ const react_1 = __importStar(require("react"));
27
+ const react_native_1 = require("react-native");
28
+ const lib_1 = require("@nakamura-123/lib");
29
+ const common_1 = require("@nakamura-123/common");
30
+ // 横に並べた札の帯。今のものを黒い札にし、押せばそこへ移る(LESSONの見出しの帯と、全画面の図の名前の帯)
31
+ const ChipStrip = ({ labels, index, onSelect, style }) => {
32
+ const stripRef = (0, react_1.useRef)(null);
33
+ const chipLayouts = (0, react_1.useRef)({});
34
+ const [stripWidth, setStripWidth] = (0, react_1.useState)(0);
35
+ // 今の札が帯の真ん中に来るように帯を動かす(札が多いと帯の外に出てしまうため)
36
+ (0, react_1.useEffect)(() => {
37
+ var _a;
38
+ const chip = chipLayouts.current[index];
39
+ if (!chip || !stripWidth)
40
+ return;
41
+ (_a = stripRef.current) === null || _a === void 0 ? void 0 : _a.scrollTo({
42
+ x: Math.max(0, chip.x - (stripWidth - chip.width) / 2),
43
+ animated: true,
44
+ });
45
+ }, [index, stripWidth]);
46
+ return (<react_native_1.ScrollView ref={stripRef} horizontal showsHorizontalScrollIndicator={false} style={[styles.scroll, style]} contentContainerStyle={styles.strip} onLayout={(e) => setStripWidth(e.nativeEvent.layout.width)}>
47
+ {labels.map((label, i) => {
48
+ const isActive = i === index;
49
+ return (<react_native_1.View key={`${i}-${label}`} onLayout={(e) => {
50
+ chipLayouts.current[i] = e.nativeEvent.layout;
51
+ }}>
52
+ <common_1.PressAnimatedWrap onPress={() => onSelect(i)} style={[styles.chip, isActive && styles.chipActive]}>
53
+ <common_1.MyText fsize="sm" weight={isActive ? 700 : 500} color={isActive ? "white" : "text"}>
54
+ {label}
55
+ </common_1.MyText>
56
+ </common_1.PressAnimatedWrap>
57
+ </react_native_1.View>);
58
+ })}
59
+ </react_native_1.ScrollView>);
60
+ };
61
+ const styles = react_native_1.StyleSheet.create({
62
+ scroll: {
63
+ flexGrow: 0,
64
+ },
65
+ strip: {
66
+ alignItems: "center",
67
+ gap: 6,
68
+ },
69
+ chip: {
70
+ paddingHorizontal: 12,
71
+ paddingVertical: 5,
72
+ borderRadius: 999,
73
+ borderWidth: 1,
74
+ borderColor: lib_1.colors.light,
75
+ backgroundColor: lib_1.colors.bkBeige,
76
+ },
77
+ chipActive: {
78
+ borderColor: lib_1.colors.darkGray,
79
+ backgroundColor: lib_1.colors.darkGray,
80
+ },
81
+ });
82
+ exports.default = ChipStrip;
@@ -0,0 +1,31 @@
1
+ import React from "react";
2
+ import { TextStyle } from "react-native";
3
+ import { FontSize, FontWeight } from "@nakamura-123/lib";
4
+ import { ArticleBlock } from "@nakamura-123/types";
5
+ export declare const ClozeProvider: React.FC<{
6
+ blocks: ArticleBlock[];
7
+ searchEnabled: boolean;
8
+ children: React.ReactNode;
9
+ }>;
10
+ export declare const useLessonSearch: () => boolean;
11
+ export declare const ClozeBar: React.FC;
12
+ interface ClozeTextProps {
13
+ text: string;
14
+ fsize: FontSize;
15
+ weight: FontWeight;
16
+ style?: TextStyle;
17
+ groupOf?: (hole: number) => string;
18
+ holeEm?: number;
19
+ ruby?: boolean;
20
+ }
21
+ export declare const RUBY_LINE_EM = 2.3;
22
+ export declare const ClozeText: React.FC<ClozeTextProps>;
23
+ interface ExampleTextProps {
24
+ text: string;
25
+ group: string;
26
+ fsize: FontSize;
27
+ weight: FontWeight;
28
+ style?: TextStyle;
29
+ }
30
+ export declare const ExampleText: React.FC<ExampleTextProps>;
31
+ export {};