@khanacademy/perseus 90.0.1 → 90.0.2
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/{chunk-register-all-widgets-for-testing-BTFpfYiU.js → chunk-register-all-widgets-for-testing-CgikCidU.js} +2 -2
- package/dist/{chunk-register-all-widgets-for-testing-BTFpfYiU.js.map → chunk-register-all-widgets-for-testing-CgikCidU.js.map} +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/testing.js +1 -1
- package/dist/widgets/iframe/iframe.d.ts +2 -22
- package/package.json +9 -9
|
@@ -2015,7 +2015,7 @@ class Group extends React.Component{componentDidMount(){this.forceUpdate();}getP
|
|
|
2015
2015
|
|
|
2016
2016
|
const getPromptJSON$d=()=>{return getUnsupportedPromptJSON("iframe")};
|
|
2017
2017
|
|
|
2018
|
-
const{updateQueryString}=Util;
|
|
2018
|
+
const{updateQueryString}=Util;const Iframe=forwardRef(function Iframe(props,ref){const{strings,locale}=usePerseusI18n();const{InitialRequestUrl}=getDependencies();const{allowFullScreen}=props.options;useEffect(()=>{function handleMessageEvent(e){let data={};try{data=JSON.parse(e.data);}catch{return}if(data.testsPassed===undefined){return}props.handleUserInput({status:data.testsPassed?"correct":"incorrect",message:data.message});}window.addEventListener("message",handleMessageEvent);return ()=>{window.removeEventListener("message",handleMessageEvent);}},[props]);useImperativeHandle(ref,()=>({getPromptJSON(){return getPromptJSON$d()},getSerializedState(){const{userInput,alignment,options,...rest}=props;const defaults={allowTopNavigation:false};return {...defaults,...options,...rest}}}));const style=getIframeStyle(props.options);const url=getIframeUrl(props.options,locale,InitialRequestUrl.origin);return jsxRuntimeExports.jsx("iframe",{title:strings.embeddedContent,sandbox:"allow-same-origin allow-scripts allow-top-navigation",style:style,src:url,allowFullScreen:allowFullScreen})});function getIframeUrl(options,locale,origin){let url=options.url;if(url&&url.length&&url.indexOf("http")!==0){url="https://www.khanacademy.org/computer-programming/program/"+url+"/embedded?buttons=no&embed=yes&editor=no&author=no";url=updateQueryString(url,"width",`${options.width}`);url=updateQueryString(url,"height",`${options.height}`);url=updateQueryString(url,"origin",origin);}if(locale&&url?.includes("khanacademy.org")){url=updateQueryString(url,"lang",locale);}if(options.settings){const settings={};options.settings.forEach(setting=>{if(setting.name&&setting.value){settings[setting.name]=setting.value;}});url=updateQueryString(url,"settings",JSON.stringify(settings));}return url}function getIframeStyle(options){return {width:toCssSize(String(options.width)),height:toCssSize(String(options.height))}}function toCssSize(value){if(value.endsWith("%")||value.endsWith("px")){return value}return `${value}px`}function getUserInputFromSerializedState$8(serializedState){return {status:serializedState.status,message:serializedState.message}}function getStartUserInput$8(){return {status:"incomplete",message:null}}var Iframe$1 = {name:"iframe",displayName:"Iframe (deprecated)",widget:Iframe,hidden:true,getStartUserInput: getStartUserInput$8,getUserInputFromSerializedState: getUserInputFromSerializedState$8};
|
|
2019
2019
|
|
|
2020
2020
|
const getPromptJSON$c=widgetData=>{return {type:"image",options:{altText:widgetData.options.alt,title:widgetData.options.title,caption:widgetData.options.caption,imageUrl:widgetData.options.backgroundImage.url}}};
|
|
2021
2021
|
|
|
@@ -2110,4 +2110,4 @@ var allWidgets = [...basicWidgets,...extraWidgets];
|
|
|
2110
2110
|
const registerAllWidgetsForTesting=()=>{registerWidgets(allWidgets);replaceDeprecatedWidgets();};
|
|
2111
2111
|
|
|
2112
2112
|
export { dependencies as $, ApiOptions as A, ButtonGroup as B, ClassNames as C, DependenciesContext as D, Expression as E, NumericInput$1 as F, Graphie as G, HUD as H, Icon as I, JiptParagraphs as J, Radio as K, Categorizer$1 as L, MathInput as M, NumberInput as N, InteractiveGraph$1 as O, PerseusI18nContext as P, Matrix$1 as Q, RangeInput as R, SvgImage as S, TextInput as T, UserInputManager as U, Table$1 as V, Plotter$1 as W, Grapher$1 as X, iconChevronDown as Y, iconTrash as Z, bodyXsmallBold as _, InlineIcon as a, Log as a0, MathRenderingContext as a1, interactiveSizes$1 as a2, PerseusI18nContextProvider as a3, usePerseusI18n as a4, KhanColors as a5, preprocessTex as a6, registerAllWidgetsForTesting as a7, containerSizeClass as a8, getInteractiveBoxFromSizeClass as a9, mathOnlyParser as aa, getWidgetSubTypeByWidgetId as ab, contentHasWidgetType as ac, getWidgetFromWidgetMap as ad, getWidgetsFromWidgetMap as ae, getAbsoluteValueCoords as af, getCircleCoords as ag, getExponentialCoords as ah, getLogarithmCoords as ai, getLineCoords as aj, getLinearSystemCoords as ak, getPointCoords as al, getPolygonCoords as am, getSegmentCoords as an, getSinusoidCoords as ao, getTangentCoords as ap, getVectorCoords as aq, getQuadraticCoords as ar, getAngleCoords as as, deriveUserInputFromSerializedState as at, parseDataFromJSONP as au, MultiButtonGroup as b, basicWidgets as c, replaceDeprecatedWidgets as d, extraWidgets as e, Renderer as f, Util as g, getDependencies as h, hintPaddingInlineStart as i, jsxRuntimeExports as j, hintBorderWidth as k, context as l, mediaQueries as m, getWidgetTypeByWidgetId as n, getWidgetExport as o, PerseusMarkdown as p, getEquationString as q, registerWidgets as r, sharedStyles as s, typeToButton as t, defaultPlotProps as u, chooseType as v, DEFAULT_GRAPHER_PROPS as w, widgets$1 as x, allWidgets as y, InputNumber as z };
|
|
2113
|
-
//# sourceMappingURL=chunk-register-all-widgets-for-testing-
|
|
2113
|
+
//# sourceMappingURL=chunk-register-all-widgets-for-testing-CgikCidU.js.map
|