@khanacademy/perseus-core 19.0.3 → 19.2.0
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 -0
- package/dist/es/index.item-splitting.js +1 -1
- package/dist/es/index.item-splitting.js.map +1 -1
- package/dist/es/index.js +2 -2
- package/dist/es/index.js.map +1 -1
- package/dist/feature-flags.d.ts +4 -3
- package/dist/index.item-splitting.js +1 -1
- package/dist/index.item-splitting.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/parse-perseus-json/perseus-parsers/image-widget.d.ts +1 -0
- package/package.json +4 -4
package/dist/data-schema.d.ts
CHANGED
|
@@ -448,6 +448,7 @@ export type PerseusImageWidgetOptions = {
|
|
|
448
448
|
title?: string;
|
|
449
449
|
caption?: string;
|
|
450
450
|
alt?: string;
|
|
451
|
+
longDescription?: string;
|
|
451
452
|
backgroundImage: PerseusImageBackground;
|
|
452
453
|
static?: boolean;
|
|
453
454
|
/** @deprecated - labels were removed from the image widget in 2017 */
|
|
@@ -96,7 +96,7 @@ const stringToNumber=(rawValue,ctx)=>{if(typeof rawValue==="number"){return ctx.
|
|
|
96
96
|
|
|
97
97
|
function emptyToZero(x){return x===""?0:x}const imageDimensionToNumber=pipeParsers(union(number).or(string).parser).then(convert(emptyToZero)).then(stringToNumber).parser;const dimensionOrUndefined=defaulted(optional(imageDimensionToNumber),()=>undefined);const parsePerseusImageBackground=object({url:optional(nullable(string)),width:dimensionOrUndefined,height:dimensionOrUndefined,top:dimensionOrUndefined,left:dimensionOrUndefined,bottom:dimensionOrUndefined,scale:dimensionOrUndefined});
|
|
98
98
|
|
|
99
|
-
const pairOfNumbers$2=pair(number,number);const parseImageWidget=parseWidget(constant("image"),object({title:optional(string),caption:optional(string),alt:optional(string),backgroundImage:parsePerseusImageBackground,static:optional(boolean),labels:optional(array(object({content:string,alignment:string,coordinates:array(number)}))),range:optional(pair(pairOfNumbers$2,pairOfNumbers$2)),box:optional(pairOfNumbers$2)}));
|
|
99
|
+
const pairOfNumbers$2=pair(number,number);const parseImageWidget=parseWidget(constant("image"),object({title:optional(string),caption:optional(string),alt:optional(string),longDescription:optional(string),backgroundImage:parsePerseusImageBackground,static:optional(boolean),labels:optional(array(object({content:string,alignment:string,coordinates:array(number)}))),range:optional(pair(pairOfNumbers$2,pairOfNumbers$2)),box:optional(pairOfNumbers$2)}));
|
|
100
100
|
|
|
101
101
|
const booleanToString=(rawValue,ctx)=>{if(typeof rawValue==="boolean"){return ctx.success(String(rawValue))}return ctx.failure("boolean",rawValue)};const parseInputNumberWidget=parseWidget(constant("input-number"),object({answerType:optional(enumeration("number","decimal","integer","rational","improper","mixed","percent","pi")),inexact:optional(boolean),maxError:optional(union(number).or(string).parser),rightAlign:optional(boolean),simplify:enumeration("required","optional","enforced"),size:enumeration("normal","small"),value:defaulted(union(number).or(string).or(booleanToString).parser,()=>0),customKeypad:optional(boolean)}));
|
|
102
102
|
|