@khanacademy/perseus 61.1.0 → 61.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/es/index.js +2 -2
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/widgets/iframe/iframe.d.ts +2 -2
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1883,7 +1883,7 @@ class Group extends React__namespace.Component{componentDidMount(){this.forceUpd
|
|
|
1883
1883
|
|
|
1884
1884
|
const getPromptJSON$e=()=>{return getUnsupportedPromptJSON("iframe")};
|
|
1885
1885
|
|
|
1886
|
-
const{updateQueryString}=Util;class Iframe extends React__namespace.Component{componentDidMount(){$__default.default(window).on("message",this.handleMessageEvent);}componentWillUnmount(){$__default.default(window).off("message",this.handleMessageEvent);}getUserInput(){return {status:this.props.status,message:this.props.message}}getPromptJSON(){return getPromptJSON$e()}render(){const style={width:String(this.props.width),height:String(this.props.height)};const{InitialRequestUrl}=getDependencies();Object.entries(style).forEach(([key,value])=>{if(!value.endsWith("%")&&!value.endsWith("px")){style[key]=value+"px";}});let url=this.props.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",this.props.width);url=updateQueryString(url,"height",this.props.height);url=updateQueryString(url,"origin",InitialRequestUrl.origin);}if(this.props.settings){const settings={};
|
|
1886
|
+
const{updateQueryString}=Util;class Iframe extends React__namespace.Component{componentDidMount(){$__default.default(window).on("message",this.handleMessageEvent);}componentWillUnmount(){$__default.default(window).off("message",this.handleMessageEvent);}getUserInput(){return {status:this.props.status,message:this.props.message}}getPromptJSON(){return getPromptJSON$e()}render(){const style={width:String(this.props.width),height:String(this.props.height)};const{InitialRequestUrl}=getDependencies();Object.entries(style).forEach(([key,value])=>{if(!value.endsWith("%")&&!value.endsWith("px")){style[key]=value+"px";}});let url=this.props.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",this.props.width);url=updateQueryString(url,"height",this.props.height);url=updateQueryString(url,"origin",InitialRequestUrl.origin);}if(this.props.settings){const settings={};this.props.settings.forEach(setting=>{if(setting.name&&setting.value){settings[setting.name]=setting.value;}});url=updateQueryString(url,"settings",JSON.stringify(settings));}let sandboxProperties="allow-same-origin allow-scripts";sandboxProperties+=" allow-top-navigation";return jsxRuntimeExports.jsx("iframe",{sandbox:sandboxProperties,style:style,src:url,allowFullScreen:this.props.allowFullScreen})}constructor(...args){super(...args),this.handleMessageEvent=e=>{let data={};try{data=JSON.parse(e.originalEvent.data);}catch{return}if(data.testsPassed===undefined){return}const status=data.testsPassed?"correct":"incorrect";this.change({status:status,message:data.message});},this.change=(...args)=>{return change.apply(this,args)};}}Iframe.defaultProps={status:"incomplete",message:null,allowFullScreen:false,allowTopNavigation:false};var Iframe$1 = {name:"iframe",displayName:"Iframe (deprecated)",widget:Iframe,hidden:true};
|
|
1887
1887
|
|
|
1888
1888
|
const getPromptJSON$d=renderProps=>{return {type:"image",options:{altText:renderProps.alt,title:renderProps.title,caption:renderProps.caption,imageUrl:renderProps.backgroundImage.url}}};
|
|
1889
1889
|
|
|
@@ -2120,7 +2120,7 @@ var extraWidgets = [Categorizer$1,CSProgram$1,Dropdown$1,Explanation$1,Definitio
|
|
|
2120
2120
|
|
|
2121
2121
|
const init=function(){perseusCore.registerCoreWidgets();registerWidgets(basicWidgets);registerWidgets(extraWidgets);replaceDeprecatedWidgets();};
|
|
2122
2122
|
|
|
2123
|
-
const libName="@khanacademy/perseus";const libVersion="61.
|
|
2123
|
+
const libName="@khanacademy/perseus";const libVersion="61.2.0";perseusUtils.addLibraryVersionToPerseusDebug(libName,libVersion);
|
|
2124
2124
|
|
|
2125
2125
|
const apiVersion={major:12,minor:0};
|
|
2126
2126
|
|