@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/es/index.js
CHANGED
|
@@ -1840,7 +1840,7 @@ class Group extends React.Component{componentDidMount(){this.forceUpdate();}getU
|
|
|
1840
1840
|
|
|
1841
1841
|
const getPromptJSON$e=()=>{return getUnsupportedPromptJSON("iframe")};
|
|
1842
1842
|
|
|
1843
|
-
const{updateQueryString}=Util;class Iframe extends React.Component{componentDidMount(){$(window).on("message",this.handleMessageEvent);}componentWillUnmount(){$(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={};
|
|
1843
|
+
const{updateQueryString}=Util;class Iframe extends React.Component{componentDidMount(){$(window).on("message",this.handleMessageEvent);}componentWillUnmount(){$(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};
|
|
1844
1844
|
|
|
1845
1845
|
const getPromptJSON$d=renderProps=>{return {type:"image",options:{altText:renderProps.alt,title:renderProps.title,caption:renderProps.caption,imageUrl:renderProps.backgroundImage.url}}};
|
|
1846
1846
|
|
|
@@ -2077,7 +2077,7 @@ var extraWidgets = [Categorizer$1,CSProgram$1,Dropdown$1,Explanation$1,Definitio
|
|
|
2077
2077
|
|
|
2078
2078
|
const init=function(){registerCoreWidgets();registerWidgets(basicWidgets);registerWidgets(extraWidgets);replaceDeprecatedWidgets();};
|
|
2079
2079
|
|
|
2080
|
-
const libName="@khanacademy/perseus";const libVersion="61.
|
|
2080
|
+
const libName="@khanacademy/perseus";const libVersion="61.2.0";addLibraryVersionToPerseusDebug(libName,libVersion);
|
|
2081
2081
|
|
|
2082
2082
|
const apiVersion={major:12,minor:0};
|
|
2083
2083
|
|