From 216408f0354fa1ee725132a098c868844208e227 Mon Sep 17 00:00:00 2001 From: lingdocs <71590811+lingdocs@users.noreply.github.com> Date: Tue, 5 Jul 2022 16:44:14 -0500 Subject: [PATCH] m --- package.json | 2 +- src/components/ep-explorer/EPDisplay.tsx | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index f82b9c7..f81b8b7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@lingdocs/pashto-inflector", - "version": "3.2.5", + "version": "3.2.6", "author": "lingdocs.com", "description": "A Pashto inflection and verb conjugation engine, inculding React components for displaying Pashto text, inflections, and conjugations", "homepage": "https://verbs.lingdocs.com", diff --git a/src/components/ep-explorer/EPDisplay.tsx b/src/components/ep-explorer/EPDisplay.tsx index 47eefaa..6bd0e52 100644 --- a/src/components/ep-explorer/EPDisplay.tsx +++ b/src/components/ep-explorer/EPDisplay.tsx @@ -9,16 +9,18 @@ import EPBlocksDisplay from "../RenderedBlocksDisplay"; import ModeSelect, { Mode, ScriptSelect } from "../DisplayModeSelect"; import { useStickyState } from "../../library"; -function EPDisplay({ eps, opts, setOmitSubject, justify, onlyOne, length }: { +function EPDisplay({ eps, opts, setOmitSubject, justify, onlyOne, length, mode: preferredMode, script: preferredScript }: { eps: T.EPSelectionState, opts: T.TextOptions, setOmitSubject: ((value: "true" | "false") => void) | false justify?: "left" | "right" | "center", onlyOne?: boolean | "concat", length?: "long" | "short", + mode?: Mode, + script?: "p" | "f", }) { - const [mode, setMode] = useState("text"); - const [script, setScript] = useStickyState<"p" | "f">("f", "blockScriptChoice"); + const [mode, setMode] = useState(preferredMode || "text"); + const [script, setScript] = useStickyState<"p" | "f">(preferredScript || "f", "blockScriptChoice"); const EP = completeEPSelection(eps); const subject = getSubjectSelection(eps.blocks);