@khanacademy/perseus-core 36.0.0 → 36.1.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/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/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/regression-tests/item-data/radio-with-weird-alignment.d.ts +63 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -116,7 +116,7 @@ const parseImages=defaulted(record(string,parsePerseusImageDetail),()=>({}));
|
|
|
116
116
|
|
|
117
117
|
function convert(f){return (rawValue,ctx)=>ctx.success(f(rawValue))}
|
|
118
118
|
|
|
119
|
-
|
|
119
|
+
function toValidAlignment(alignment){switch(alignment){case "default":case "block":case "inline-block":case "inline":case "wrap-left":case "wrap-right":case "full-width":case undefined:return alignment;default:return "default"}}const parseAlignment=pipeParsers(optional(string)).then(convert(toValidAlignment)).parser;function parseWidget(parseType,parseOptions){return object({type:parseType,static:optional(boolean),graded:optional(boolean),alignment:parseAlignment,options:parseOptions,key:optional(nullable(number)),version:optional(object({major:number,minor:number}))})}function parseWidgetWithVersion(parseVersion,parseType,parseOptions){return object({type:parseType,static:optional(boolean),graded:optional(boolean),alignment:parseAlignment,options:parseOptions,key:optional(nullable(number)),version:parseVersion})}
|
|
120
120
|
|
|
121
121
|
const parseBlankWidget=parseWidget(constant("blank"),object({displayType:defaulted(enumeration("normal","superscript","subscript"),()=>"normal"),correctId:string}));
|
|
122
122
|
|
|
@@ -256,7 +256,7 @@ const parseUserInputMap=(rawValue,ctx)=>{if(!isPlainObject(rawValue)){return ctx
|
|
|
256
256
|
|
|
257
257
|
function parseAndMigratePerseusItem(data){const object=typeof data==="string"?JSON.parse(data):data;const result=parse(object,parsePerseusItem);if(isFailure(result)){return failure({message:result.detail,invalidObject:object})}return result}function parseAndMigratePerseusArticle(data){const object=typeof data==="string"?JSON.parse(data):data;const result=parse(object,parsePerseusArticle);if(isFailure(result)){return failure({message:result.detail,invalidObject:object})}return result}function parseAndMigrateUserInputMap(data){const object=typeof data==="string"?JSON.parse(data):data;const result=parse(object,parseUserInputMap);if(isFailure(result)){return failure({message:result.detail,invalidObject:object})}return result}function parseAndMigratePerseusRenderer(data){const object=typeof data==="string"?JSON.parse(data):data;const result=parse(object,parsePerseusRenderer);if(isFailure(result)){return failure({message:result.detail,invalidObject:object})}return result}
|
|
258
258
|
|
|
259
|
-
const libName="@khanacademy/perseus-core";const libVersion="36.
|
|
259
|
+
const libName="@khanacademy/perseus-core";const libVersion="36.1.0";perseusUtils.addLibraryVersionToPerseusDebug(libName,libVersion);
|
|
260
260
|
|
|
261
261
|
const Errors=Object.freeze({Unknown:"Unknown",Internal:"Internal",InvalidInput:"InvalidInput",NotAllowed:"NotAllowed",TransientService:"TransientService",Service:"Service"});
|
|
262
262
|
|