@khanacademy/perseus-core 30.0.0 → 30.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/data-schema.d.ts +1 -1
- package/dist/es/index.item-splitting.js +1 -1
- package/dist/es/index.item-splitting.js.map +1 -1
- package/dist/es/index.js +5 -5
- package/dist/es/index.js.map +1 -1
- package/dist/index.item-splitting.js +1 -1
- package/dist/index.item-splitting.js.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/parse-perseus-json/perseus-parsers/perseus-answer-area.d.ts +4 -3
- package/package.json +1 -1
package/dist/data-schema.d.ts
CHANGED
|
@@ -300,7 +300,7 @@ export type PerseusImageDetail = {
|
|
|
300
300
|
export declare const ItemExtras: readonly ["calculator", "financialCalculatorMonthlyPayment", "financialCalculatorTotalAmount", "financialCalculatorTimeToPayOff", "periodicTable", "periodicTableWithKey"];
|
|
301
301
|
export type CalculatorVariant = "scientific" | "graphing" | "four_function";
|
|
302
302
|
export type PerseusAnswerArea = Record<(typeof ItemExtras)[number], boolean> & {
|
|
303
|
-
calculatorVariant
|
|
303
|
+
calculatorVariant?: CalculatorVariant;
|
|
304
304
|
};
|
|
305
305
|
/**
|
|
306
306
|
* The type representing the common structure of all widget's options. The
|
|
@@ -144,7 +144,7 @@ union(parsePerseusRenderer).or(array(parsePerseusRenderer)).parser;
|
|
|
144
144
|
|
|
145
145
|
const parseHint=object({replace:defaulted(optional(boolean),()=>undefined),placeholder:defaulted(optional(boolean),()=>undefined),content:string,widgets:defaulted(parseWidgetsMap,()=>({})),images:parseImages,metadata:any});
|
|
146
146
|
|
|
147
|
-
const booleanOrFalse=defaulted(boolean,()=>false);const
|
|
147
|
+
const booleanOrFalse=defaulted(boolean,()=>false);const calculatorVariantOrUndefined=pipeParsers(defaulted(nullable(enumeration("scientific","graphing","four_function")),()=>null)).then(convert(v=>v??undefined)).parser;const baseParser=defaulted(object({calculator:booleanOrFalse,calculatorVariant:calculatorVariantOrUndefined,financialCalculatorMonthlyPayment:booleanOrFalse,financialCalculatorTotalAmount:booleanOrFalse,financialCalculatorTimeToPayOff:booleanOrFalse,periodicTable:booleanOrFalse,periodicTableWithKey:booleanOrFalse}),()=>({calculator:false,calculatorVariant:undefined,financialCalculatorMonthlyPayment:false,financialCalculatorTotalAmount:false,financialCalculatorTimeToPayOff:false,periodicTable:false,periodicTableWithKey:false}));const parsePerseusAnswerArea=pipeParsers(baseParser).then(convert(parsed=>{const{calculatorVariant:parsedCalcVariant,...rest}=parsed;const calculatorVariant=parsed.calculator&&parsedCalcVariant===undefined?"scientific":parsedCalcVariant;return calculatorVariant!==undefined?{...rest,calculatorVariant}:rest})).parser;
|
|
148
148
|
|
|
149
149
|
const parsePerseusItem=object({question:parsePerseusRenderer,hints:defaulted(array(parseHint),()=>[]),answerArea:parsePerseusAnswerArea});
|
|
150
150
|
|