@khanacademy/perseus-core 0.0.0-PR3107-20251209224744 → 0.0.0-PR3107-20251210222944
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.js
CHANGED
|
@@ -232,7 +232,7 @@ const parseUserInputMap=(rawValue,ctx)=>{if(!isPlainObject(rawValue)){return ctx
|
|
|
232
232
|
|
|
233
233
|
function parsePerseusItem(json){if(isRealJSONParse(JSON.parse)){return JSON.parse(json)}throw new Error("Something went wrong.")}function parseAndMigratePerseusItem(data){throwErrorIfCheatingDetected();const object=typeof data==="string"?JSON.parse(data):data;const result=parse(object,parsePerseusItem$1);if(isFailure(result)){return failure({message:result.detail,invalidObject:object})}return result}function parseAndMigratePerseusArticle(data){throwErrorIfCheatingDetected();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 throwErrorIfCheatingDetected(){if(!isRealJSONParse(JSON.parse)){throw new Error("Something went wrong.")}}
|
|
234
234
|
|
|
235
|
-
const libName="@khanacademy/perseus-core";const libVersion="20.4.
|
|
235
|
+
const libName="@khanacademy/perseus-core";const libVersion="20.4.1";addLibraryVersionToPerseusDebug(libName,libVersion);
|
|
236
236
|
|
|
237
237
|
const Errors=Object.freeze({Unknown:"Unknown",Internal:"Internal",InvalidInput:"InvalidInput",NotAllowed:"NotAllowed",TransientService:"TransientService",Service:"Service"});
|
|
238
238
|
|
|
@@ -403,7 +403,7 @@ function generateImageOptions(options){const defaultImageOptions={backgroundImag
|
|
|
403
403
|
|
|
404
404
|
function generateNumericInputOptions(options){return {...numericInputWidgetLogic.defaultWidgetOptions,static:false,...options}}function generateNumericInputAnswer(answerOptions){return {...numericInputWidgetLogic.defaultWidgetOptions.answers[0],...answerOptions}}function generateNumericInputWidget(numericInputWidgetProperties){return {type:"numeric-input",graded:true,version:{major:0,minor:0},static:false,alignment:"default",options:generateNumericInputOptions(),...numericInputWidgetProperties}}
|
|
405
405
|
|
|
406
|
-
function generateRadioOptions(options){return {...radioWidgetLogic.defaultWidgetOptions,...options}}function generateRadioWidget(radioWidgetProperties){return {type:"radio",graded:true,version:{major:0,minor:0},static:false,alignment:"default",options:generateRadioOptions(),...radioWidgetProperties}}
|
|
406
|
+
function generateRadioOptions(options){return {...radioWidgetLogic.defaultWidgetOptions,...options}}function generateRadioWidget(radioWidgetProperties){return {type:"radio",graded:true,version:{major:0,minor:0},static:false,alignment:"default",options:generateRadioOptions(),...radioWidgetProperties}}function generateRadioChoice(text,options){return {content:text,id:`radio-choice-${Math.random()}`,correct:false,...options}}function generateSimpleRadioQuestion(options){return generateTestPerseusRenderer({content:"[[☃ radio 1]]",widgets:{"radio 1":generateRadioWidget({options:generateRadioOptions(options)})}})}function generateSimpleRadioItem(options){return generateTestPerseusItem({question:generateSimpleRadioQuestion(options)})}
|
|
407
407
|
|
|
408
408
|
function generateVideoWidget(videoWidgetProperties){return {type:"video",graded:true,version:{major:0,minor:0},static:false,alignment:"default",options:{location:""},...videoWidgetProperties}}
|
|
409
409
|
|
|
@@ -419,5 +419,5 @@ ${table}`);}break;case "numeric-input":case "input-number":case "expression":con
|
|
|
419
419
|
|
|
420
420
|
registerCoreWidgets();
|
|
421
421
|
|
|
422
|
-
export { coreWidgetRegistry as CoreWidgetRegistry, ErrorCodes, Errors, grapherUtil as GrapherUtil, ItemExtras, PerseusError, PerseusExpressionAnswerFormConsidered, PerseusFeatureFlags, Registry, addWidget, applyDefaultsToWidget, applyDefaultsToWidgets, approximateDeepEqual, approximateEqual, categorizerWidgetLogic as categorizerLogic, csProgramWidgetLogic as csProgramLogic, deepClone, definitionWidgetLogic as definitionLogic, deriveExtraKeys, deriveNumCorrect, dropdownWidgetLogic as dropdownLogic, explanationWidgetLogic as explanationLogic, expressionWidgetLogic as expressionLogic, freeResponseWidgetLogic as freeResponseLogic, generateDefinitionOptions, generateDefinitionWidget, generateDropdownOptions, generateDropdownWidget, generateExplanationOptions, generateExplanationWidget, generateExpressionAnswerForm, generateExpressionOptions, generateExpressionWidget, generateFreeResponseOptions, generateFreeResponseWidget, generateImageOptions, generateImageWidget, generateNumericInputAnswer, generateNumericInputOptions, generateNumericInputWidget, generateRadioOptions, generateRadioWidget, generateTestPerseusItem, generateTestPerseusRenderer, generateVideoWidget, getAnswersFromWidgets, getBaseUrl, getCSProgramPublicWidgetOptions, getCategorizerPublicWidgetOptions, getDataUrl, getDecimalSeparator, getDefaultAnswerArea, getDefaultFigureForType, getDivideSymbol, getDivideSymbolForTex, getDropdownPublicWidgetOptions, getExpressionPublicWidgetOptions, getFreeResponsePublicWidgetOptions, getGrapherPublicWidgetOptions, getGroupPublicWidgetOptions, getIFramePublicWidgetOptions, getImageSizeModern, getInteractiveGraphPublicWidgetOptions, getLabelImagePublicWidgetOptions, getMatcherPublicWidgetOptions, getMatrixPublicWidgetOptions, getMatrixSize, getNumberLinePublicWidgetOptions, getNumericInputPublicWidgetOptions, getOrdererPublicWidgetOptions, getPerseusAIData, getPlotterPublicWidgetOptions, getRadioPublicWidgetOptions, getRealImageUrl, getSorterPublicWidgetOptions, getSvgUrl, getTablePublicWidgetOptions, getWidgetIdsFromContent, getWidgetIdsFromContentByType, gradedGroupWidgetLogic as gradedGroupLogic, gradedGroupSetWidgetLogic as gradedGroupSetLogic, grapherWidgetLogic as grapherLogic, groupWidgetLogic as groupLogic, iframeWidgetLogic as iframeLogic, imageWidgetLogic as imageLogic, injectWidgets, inputNumberWidgetLogic as inputNumberLogic, interactionWidgetLogic as interactionLogic, interactiveGraphWidgetLogic as interactiveGraphLogic, isFailure, isFeatureOn, isItemAccessible, isLabeledSVG, isSuccess, itemHasHints, itemHasRationales, labelImageWidgetLogic as labelImageLogic, libVersion, lockedFigureColorNames, lockedFigureColors, lockedFigureFillStyles, makeSafeUrl, mapObject, matcherWidgetLogic as matcherLogic, matrixWidgetLogic as matrixLogic, measurerWidgetLogic as measurerLogic, numberLineWidgetLogic as numberLineLogic, numericInputWidgetLogic as numericInputLogic, ordererWidgetLogic as ordererLogic, parseAndMigratePerseusArticle, parseAndMigratePerseusItem, parseAndMigrateUserInputMap, parsePerseusItem, passageWidgetLogic as passageLogic, passageRefWidgetLogic as passageRefLogic, passageRefTargetWidgetLogic as passageRefTargetLogic, phetSimulationWidgetLogic as phetSimulationLogic, plotterWidgetLogic as plotterLogic, plotterPlotTypes, pluck, pythonProgramWidgetLogic as pythonProgramLogic, radioWidgetLogic as radioLogic, random, seededRNG, shuffle, shuffleMatcher, shuffleSorter, sorterWidgetLogic as sorterLogic, splitPerseusItem, splitPerseusItemJSON, tableWidgetLogic as tableLogic, traverse, usesNumCorrect, videoWidgetLogic as videoLogic, violatingWidgets };
|
|
422
|
+
export { coreWidgetRegistry as CoreWidgetRegistry, ErrorCodes, Errors, grapherUtil as GrapherUtil, ItemExtras, PerseusError, PerseusExpressionAnswerFormConsidered, PerseusFeatureFlags, Registry, addWidget, applyDefaultsToWidget, applyDefaultsToWidgets, approximateDeepEqual, approximateEqual, categorizerWidgetLogic as categorizerLogic, csProgramWidgetLogic as csProgramLogic, deepClone, definitionWidgetLogic as definitionLogic, deriveExtraKeys, deriveNumCorrect, dropdownWidgetLogic as dropdownLogic, explanationWidgetLogic as explanationLogic, expressionWidgetLogic as expressionLogic, freeResponseWidgetLogic as freeResponseLogic, generateDefinitionOptions, generateDefinitionWidget, generateDropdownOptions, generateDropdownWidget, generateExplanationOptions, generateExplanationWidget, generateExpressionAnswerForm, generateExpressionOptions, generateExpressionWidget, generateFreeResponseOptions, generateFreeResponseWidget, generateImageOptions, generateImageWidget, generateNumericInputAnswer, generateNumericInputOptions, generateNumericInputWidget, generateRadioChoice, generateRadioOptions, generateRadioWidget, generateSimpleRadioItem, generateSimpleRadioQuestion, generateTestPerseusItem, generateTestPerseusRenderer, generateVideoWidget, getAnswersFromWidgets, getBaseUrl, getCSProgramPublicWidgetOptions, getCategorizerPublicWidgetOptions, getDataUrl, getDecimalSeparator, getDefaultAnswerArea, getDefaultFigureForType, getDivideSymbol, getDivideSymbolForTex, getDropdownPublicWidgetOptions, getExpressionPublicWidgetOptions, getFreeResponsePublicWidgetOptions, getGrapherPublicWidgetOptions, getGroupPublicWidgetOptions, getIFramePublicWidgetOptions, getImageSizeModern, getInteractiveGraphPublicWidgetOptions, getLabelImagePublicWidgetOptions, getMatcherPublicWidgetOptions, getMatrixPublicWidgetOptions, getMatrixSize, getNumberLinePublicWidgetOptions, getNumericInputPublicWidgetOptions, getOrdererPublicWidgetOptions, getPerseusAIData, getPlotterPublicWidgetOptions, getRadioPublicWidgetOptions, getRealImageUrl, getSorterPublicWidgetOptions, getSvgUrl, getTablePublicWidgetOptions, getWidgetIdsFromContent, getWidgetIdsFromContentByType, gradedGroupWidgetLogic as gradedGroupLogic, gradedGroupSetWidgetLogic as gradedGroupSetLogic, grapherWidgetLogic as grapherLogic, groupWidgetLogic as groupLogic, iframeWidgetLogic as iframeLogic, imageWidgetLogic as imageLogic, injectWidgets, inputNumberWidgetLogic as inputNumberLogic, interactionWidgetLogic as interactionLogic, interactiveGraphWidgetLogic as interactiveGraphLogic, isFailure, isFeatureOn, isItemAccessible, isLabeledSVG, isSuccess, itemHasHints, itemHasRationales, labelImageWidgetLogic as labelImageLogic, libVersion, lockedFigureColorNames, lockedFigureColors, lockedFigureFillStyles, makeSafeUrl, mapObject, matcherWidgetLogic as matcherLogic, matrixWidgetLogic as matrixLogic, measurerWidgetLogic as measurerLogic, numberLineWidgetLogic as numberLineLogic, numericInputWidgetLogic as numericInputLogic, ordererWidgetLogic as ordererLogic, parseAndMigratePerseusArticle, parseAndMigratePerseusItem, parseAndMigrateUserInputMap, parsePerseusItem, passageWidgetLogic as passageLogic, passageRefWidgetLogic as passageRefLogic, passageRefTargetWidgetLogic as passageRefTargetLogic, phetSimulationWidgetLogic as phetSimulationLogic, plotterWidgetLogic as plotterLogic, plotterPlotTypes, pluck, pythonProgramWidgetLogic as pythonProgramLogic, radioWidgetLogic as radioLogic, random, seededRNG, shuffle, shuffleMatcher, shuffleSorter, sorterWidgetLogic as sorterLogic, splitPerseusItem, splitPerseusItemJSON, tableWidgetLogic as tableLogic, traverse, usesNumCorrect, videoWidgetLogic as videoLogic, violatingWidgets };
|
|
423
423
|
//# sourceMappingURL=index.js.map
|