Skip to content

Commit 2bf4db0

Browse files
committed
fixed sandwich issue
1 parent 0f75e5b commit 2bf4db0

File tree

5 files changed

+23
-87
lines changed

5 files changed

+23
-87
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"@formkit/auto-animate": "^1.0.0-beta.6",
1818
"@fortawesome/fontawesome-free": "5.15.4",
1919
"@lingdocs/lingdocs-main": "^0.3.3",
20-
"@lingdocs/ps-react": "7.8.4",
20+
"@lingdocs/ps-react": "7.8.7",
2121
"@mdx-js/rollup": "^2.2.1",
2222
"@stefanprobst/rehype-extract-toc": "^2.2.0",
2323
"@types/mdx": "^2.0.3",

src/components/phrase-diagram/BlockDiagram.tsx

+9-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,15 @@ function BlockDiagram({
1818
const rendered =
1919
children.type === "AP"
2020
? renderAPSelection(children, 0)
21-
: renderNPSelection(children, false, false, "subject", "none", false);
21+
: renderNPSelection(
22+
children,
23+
false,
24+
false,
25+
"subject",
26+
"none",
27+
false,
28+
"no"
29+
);
2230
const english = getEnglishFromRendered(rendered);
2331
return (
2432
<div className="mb-3">

src/games/sub-cores/NPAdjGame.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const NPAdjWriting: GameSubCore<Level> = ({
4646
const rendered: T.Rendered<T.NPSelection> | T.Rendered<T.APSelection> =
4747
selection.type === "AP"
4848
? renderAPSelection(selection, 0) // WOULD BE CLEANER IF THIS WAS JUST A PURE SANDWICH, NOT AT AP
49-
: renderNPSelection(np, false, false, "subject", "none", false);
49+
: renderNPSelection(np, false, false, "subject", "none", false, "no");
5050
const answer = getPashtoFromRendered(rendered, false);
5151
return {
5252
selection,
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,11 @@
1-
import {
2-
Types as T,
3-
randFromArray,
4-
} from "@lingdocs/ps-react";
5-
6-
export const sandwiches: T.Sandwich[] = [
7-
{
8-
type: "sandwich",
9-
before: { p: "له", f: "la" },
10-
after: { p: "نه", f: "na" },
11-
e: "from",
12-
},
13-
{
14-
type: "sandwich",
15-
before: { p: "له", f: "la" },
16-
after: { p: "څخه", f: "tsuxa" },
17-
e: "from",
18-
},
19-
{
20-
type: "sandwich",
21-
before: { p: "له", f: "la" },
22-
after: { p: "سره", f: "sara" },
23-
e: "with",
24-
},
25-
{
26-
type: "sandwich",
27-
before: undefined,
28-
after: { p: "ته", f: "ta" },
29-
e: "to",
30-
},
31-
{
32-
type: "sandwich",
33-
before: { p: "د", f: "du" },
34-
after: { p: "لپاره", f: "lapaara" },
35-
e: "for",
36-
},
37-
{
38-
type: "sandwich",
39-
before: { p: "د", f: "du" },
40-
after: { p: "په څانګ", f: "pu tsaang" },
41-
e: "beside",
42-
},
43-
// {
44-
// type: "sandwich",
45-
// before: { p: "په", f: "pu" },
46-
// after: { p: "کې", f: "ke" },
47-
// e: "in",
48-
// },
49-
{
50-
type: "sandwich",
51-
before: { p: "د", f: "du" },
52-
after: { p: "لاندې", f: "laande" },
53-
e: "under",
54-
},
55-
{
56-
type: "sandwich",
57-
before: { p: "د", f: "du" },
58-
after: { p: "په شان", f: "pu shaan" },
59-
e: "like",
60-
},
61-
{
62-
type: "sandwich",
63-
before: { p: "د", f: "du" },
64-
after: { p: "غوندې", f: "ghwunde" },
65-
e: "like",
66-
},
67-
// {
68-
// type: "sandwich",
69-
// before: { p: "د", f: "du" },
70-
// after: { p: "په اړه", f: "pu aRa" },
71-
// e: "about",
72-
// },
73-
];
1+
import { Types as T, randFromArray, sandwiches } from "@lingdocs/ps-react";
742

753
export function makeSandwich(np: T.NPSelection): T.APSelection {
76-
return {
77-
type: "AP",
78-
selection: {
79-
...randFromArray(sandwiches),
80-
inside: np,
81-
},
82-
};
4+
return {
5+
type: "AP",
6+
selection: {
7+
...randFromArray(sandwiches),
8+
inside: np,
9+
},
10+
};
8311
}

yarn.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -1367,10 +1367,10 @@
13671367
rambda "^6.7.0"
13681368
react-select "^5.2.2"
13691369

1370-
"@lingdocs/[email protected].4":
1371-
version "7.8.4"
1372-
resolved "https://npm.lingdocs.com/@lingdocs/ps-react/-/ps-react-7.8.4.tgz#f46eaa535041495cbabc01484ee930ad48a47149"
1373-
integrity sha512-nclWIyzpJqqEMZB8OVW/WQepUqHqu5WyeEmwTxpLHqVs3RLhE52giwUjK+xRdXaaOcjI9K2Itkfl+nMa1GlSlw==
1370+
"@lingdocs/[email protected].7":
1371+
version "7.8.7"
1372+
resolved "https://npm.lingdocs.com/@lingdocs/ps-react/-/ps-react-7.8.7.tgz#bb84422162761ee5868868f6e9628d49c87b4a32"
1373+
integrity sha512-J9IQUvrmI+IFGaMcsxgECNt8OXUUtkOU0PtB+tCHl0ok8XXHIsoeNpxCWqQ+cp/VApKdfefWRhR2iZirTRp2Kg==
13741374
dependencies:
13751375
"@formkit/auto-animate" "^1.0.0-beta.3"
13761376
classnames "^2.5.1"

0 commit comments

Comments
 (0)