This commit is contained in:
lingdocs 2022-06-04 18:19:24 -05:00
parent 0f720e3be1
commit 41bd7bfab7
4 changed files with 13 additions and 9 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@lingdocs/pashto-inflector", "name": "@lingdocs/pashto-inflector",
"version": "2.8.1", "version": "2.8.2",
"author": "lingdocs.com", "author": "lingdocs.com",
"description": "A Pashto inflection and verb conjugation engine, inculding React components for displaying Pashto text, inflections, and conjugations", "description": "A Pashto inflection and verb conjugation engine, inculding React components for displaying Pashto text, inflections, and conjugations",
"homepage": "https://verbs.lingdocs.com", "homepage": "https://verbs.lingdocs.com",

View File

@ -13,7 +13,7 @@ function Block({ opts, block }: {
} }
if (block.type === "AP") { if (block.type === "AP") {
const english = getEnglishFromRendered(block); const english = getEnglishFromRendered(block);
return <AP opts={opts} english={english}>{block}</AP> return <APBlock opts={opts} english={english}>{block}</APBlock>
} }
if (block.type === "subjectSelection") { if (block.type === "subjectSelection") {
return <SubjectBlock opts={opts} np={block.selection} /> return <SubjectBlock opts={opts} np={block.selection} />
@ -24,7 +24,7 @@ function Block({ opts, block }: {
<div>Pred</div> <div>Pred</div>
{block.selection.type === "EQComp" {block.selection.type === "EQComp"
? <EqCompBlock opts={opts} comp={block.selection.selection} /> ? <EqCompBlock opts={opts} comp={block.selection.selection} />
: <NP opts={opts} english={english}>{block.selection}</NP>} : <NPBlock opts={opts} english={english}>{block.selection}</NPBlock>}
</div> </div>
} }
if (block.type === "nu") { if (block.type === "nu") {
@ -83,7 +83,7 @@ function SubjectBlock({ opts, np }: {
const english = getEnglishFromRendered(np); const english = getEnglishFromRendered(np);
return <div className="text-center"> return <div className="text-center">
<div>Subject</div> <div>Subject</div>
<NP opts={opts} english={english}>{np}</NP> <NPBlock opts={opts} english={english}>{np}</NPBlock>
</div>; </div>;
} }
@ -154,7 +154,7 @@ function EqCompBlock({ opts, comp }: {
</div>; </div>;
} }
function AP({ opts, children, english }: { export function APBlock({ opts, children, english }: {
opts: T.TextOptions, opts: T.TextOptions,
children: T.Rendered<T.APSelection>, children: T.Rendered<T.APSelection>,
english?: string, english?: string,
@ -211,7 +211,7 @@ function Sandwich({ opts, sandwich }: {
<Possesors opts={opts}>{sandwich.inside.selection.type !== "pronoun" ? sandwich.inside.selection.possesor : undefined}</Possesors> <Possesors opts={opts}>{sandwich.inside.selection.type !== "pronoun" ? sandwich.inside.selection.possesor : undefined}</Possesors>
<div className="mr-2 ml-1 mb-1"><strong>{sandwich.before ? sandwich.before.f : ""}</strong></div> <div className="mr-2 ml-1 mb-1"><strong>{sandwich.before ? sandwich.before.f : ""}</strong></div>
<div> <div>
<NP opts={opts} inside>{sandwich.inside}</NP> <NPBlock opts={opts} inside>{sandwich.inside}</NPBlock>
</div> </div>
<div className="ml-2 mr-1 mb-1"><strong>{sandwich.after ? sandwich.after.f : ""}</strong></div> <div className="ml-2 mr-1 mb-1"><strong>{sandwich.after ? sandwich.after.f : ""}</strong></div>
</div> </div>
@ -219,7 +219,7 @@ function Sandwich({ opts, sandwich }: {
</div>; </div>;
} }
function NP({ opts, children, inside, english }: { export function NPBlock({ opts, children, inside, english }: {
opts: T.TextOptions, opts: T.TextOptions,
children: T.Rendered<T.NPSelection>, children: T.Rendered<T.NPSelection>,
inside?: boolean, inside?: boolean,
@ -268,7 +268,7 @@ function Possesors({ opts, children }: {
<div className={classNames("d-flex", "flex-row", "align-items-center", { "text-muted": contraction })}> <div className={classNames("d-flex", "flex-row", "align-items-center", { "text-muted": contraction })}>
<div className="mr-1 pb-2">du</div> <div className="mr-1 pb-2">du</div>
<div> <div>
<NP opts={opts} inside>{children.np}</NP> <NPBlock opts={opts} inside>{children.np}</NPBlock>
</div> </div>
</div> </div>

View File

@ -29,6 +29,7 @@ import EntrySelect from "./components/EntrySelect";
import VerbInfo, { RootsAndStems } from "./components/verb-info/VerbInfo"; import VerbInfo, { RootsAndStems } from "./components/verb-info/VerbInfo";
import VPExplorer from "./components/vp-explorer/VPExplorer"; import VPExplorer from "./components/vp-explorer/VPExplorer";
import useStickyState from "./lib/useStickyState"; import useStickyState from "./lib/useStickyState";
import Block, { NPBlock, APBlock } from "./components/blocks/Block";
import { import {
makePsString, makePsString,
removeFVarients, removeFVarients,
@ -247,6 +248,9 @@ export {
EntrySelect, EntrySelect,
NPPicker, NPPicker,
APPicker, APPicker,
NPBlock,
APBlock,
Block,
// OTHER // OTHER
typePredicates, typePredicates,
grammarUnits, grammarUnits,

File diff suppressed because one or more lines are too long