|
@@ -104,6 +104,7 @@ export interface IWbwFields {
|
|
|
export type TWbwDisplayMode = "block" | "inline" | "list";
|
|
export type TWbwDisplayMode = "block" | "inline" | "list";
|
|
|
interface IWidget {
|
|
interface IWidget {
|
|
|
data: IWbw;
|
|
data: IWbw;
|
|
|
|
|
+ answer?: IWbw;
|
|
|
channelId: string;
|
|
channelId: string;
|
|
|
display?: TWbwDisplayMode;
|
|
display?: TWbwDisplayMode;
|
|
|
fields?: IWbwFields;
|
|
fields?: IWbwFields;
|
|
@@ -115,6 +116,7 @@ interface IWidget {
|
|
|
}
|
|
}
|
|
|
const WbwWordWidget = ({
|
|
const WbwWordWidget = ({
|
|
|
data,
|
|
data,
|
|
|
|
|
+ answer,
|
|
|
channelId,
|
|
channelId,
|
|
|
display,
|
|
display,
|
|
|
mode = "edit",
|
|
mode = "edit",
|
|
@@ -288,6 +290,7 @@ const WbwWordWidget = ({
|
|
|
key="meaning"
|
|
key="meaning"
|
|
|
mode={mode}
|
|
mode={mode}
|
|
|
data={wordData}
|
|
data={wordData}
|
|
|
|
|
+ answer={answer}
|
|
|
display={display}
|
|
display={display}
|
|
|
onChange={(e: string) => {
|
|
onChange={(e: string) => {
|
|
|
const newData: IWbw = JSON.parse(JSON.stringify(wordData));
|
|
const newData: IWbw = JSON.parse(JSON.stringify(wordData));
|
|
@@ -303,6 +306,7 @@ const WbwWordWidget = ({
|
|
|
<WbwFactors
|
|
<WbwFactors
|
|
|
key="factors"
|
|
key="factors"
|
|
|
data={wordData}
|
|
data={wordData}
|
|
|
|
|
+ answer={answer}
|
|
|
display={display}
|
|
display={display}
|
|
|
onChange={(e: string) => {
|
|
onChange={(e: string) => {
|
|
|
console.log("factor change", e);
|
|
console.log("factor change", e);
|
|
@@ -320,6 +324,7 @@ const WbwWordWidget = ({
|
|
|
<WbwFactorMeaning
|
|
<WbwFactorMeaning
|
|
|
key="fm"
|
|
key="fm"
|
|
|
data={wordData}
|
|
data={wordData}
|
|
|
|
|
+ answer={answer}
|
|
|
display={display}
|
|
display={display}
|
|
|
factors={newFactors}
|
|
factors={newFactors}
|
|
|
onChange={(e: string) => {
|
|
onChange={(e: string) => {
|
|
@@ -361,6 +366,7 @@ const WbwWordWidget = ({
|
|
|
<WbwCase
|
|
<WbwCase
|
|
|
key="case"
|
|
key="case"
|
|
|
data={wordData}
|
|
data={wordData}
|
|
|
|
|
+ answer={answer}
|
|
|
display={display}
|
|
display={display}
|
|
|
onSplit={(e: boolean) => {
|
|
onSplit={(e: boolean) => {
|
|
|
console.log("onSplit", wordData.factors?.value);
|
|
console.log("onSplit", wordData.factors?.value);
|