update VPDisplay

This commit is contained in:
lingdocs 2022-07-05 16:42:43 -05:00
parent f770a93270
commit 27f5019bbd
4 changed files with 11 additions and 5 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@lingdocs/pashto-inflector", "name": "@lingdocs/pashto-inflector",
"version": "3.2.4", "version": "3.2.5",
"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

@ -10,16 +10,18 @@ import CompiledPTextDisplay from "../CompiledPTextDisplay";
import RenderedBlocksDisplay from "../RenderedBlocksDisplay"; import RenderedBlocksDisplay from "../RenderedBlocksDisplay";
import useStickyState from "../../lib/useStickyState"; import useStickyState from "../../lib/useStickyState";
function VPDisplay({ VPS, opts, setForm, justify, onlyOne, length }: { function VPDisplay({ VPS, opts, setForm, justify, onlyOne, length, mode: preferredMode, script: preferredScript }: {
VPS: T.VPSelectionState, VPS: T.VPSelectionState,
opts: T.TextOptions, opts: T.TextOptions,
setForm: "disable" | ((form: T.FormVersion) => void), setForm: "disable" | ((form: T.FormVersion) => void),
justify?: "left" | "right" | "center", justify?: "left" | "right" | "center",
onlyOne?: boolean | "concat", onlyOne?: boolean | "concat",
length?: "long" | "short", length?: "long" | "short",
mode?: Mode,
script?: "p" | "f"
}) { }) {
const [mode, setMode] = useState<Mode>("text"); const [mode, setMode] = useState<Mode>(preferredMode || "text");
const [script, setScript] = useStickyState<"p" | "f">("f", "blockScriptChoice"); const [script, setScript] = useStickyState<"p" | "f">(preferredScript || "f", "blockScriptChoice");
const VP = completeVPSelection(VPS); const VP = completeVPSelection(VPS);
if (!VP) { if (!VP) {
return <div className="lead text-muted text-center mt-4"> return <div className="lead text-muted text-center mt-4">

View File

@ -34,6 +34,8 @@ import useStickyState from "./lib/useStickyState";
import { isPastTense } from "./lib/phrase-building/vp-tools"; import { isPastTense } from "./lib/phrase-building/vp-tools";
import Block, { NPBlock, APBlock } from "./components/blocks/Block"; import Block, { NPBlock, APBlock } from "./components/blocks/Block";
import { roleIcon } from "./components/vp-explorer/VPExplorerExplanationModal"; import { roleIcon } from "./components/vp-explorer/VPExplorerExplanationModal";
import CompiledPTextDisplay from "./components/CompiledPTextDisplay";
import RenderedBlocksDisplay from "./components/RenderedBlocksDisplay";
import { import {
makePsString, makePsString,
removeFVarients, removeFVarients,
@ -266,6 +268,8 @@ export {
VPDisplay, VPDisplay,
EPPicker, EPPicker,
VPPicker, VPPicker,
CompiledPTextDisplay,
RenderedBlocksDisplay,
// OTHER // OTHER
typePredicates, typePredicates,
grammarUnits, grammarUnits,

File diff suppressed because one or more lines are too long