This PR adds a `networkId` prop to the `Widget` component to allow using a `near` object outside the singleton state to allow testing Mainnet components on a Testnet initialized VM or vice versa
- Expose `encodeURIComponent`, `decodeURIComponent`, `btoa`, `atob`, `isFinite`, `decodeURI` and `encodeURI` in the global scope.
- Refactor native functions into an object, making it easier to add new functions.
## 2.2.2
- Gracefully handle compilation errors in `VM`. Previously, the VM would throw an error when the compilation failed, which resulted in a blank screen. Now, the VM will render the error message instead.
## 2.2.1
- Fix href sanitization for non-lowercase attribute names.
- Add testnet URL to the config.
- Fix SecureIframe bug which did not allow posting a message to iframe window if iframeResizer was used
An example of a valid `srcDoc` for a SecureIframe using iframeResizer:
```jsx
const code = `
<script>
// ...your code...
// define message handler
const handleMessage = (m) => {
console.log('received message', m)
document.getElementById("messageText").innerHTML = m;
};
// finally, configure iframe resizer options before importing the script
window.iFrameResizer = {
onMessage: handleMessage
}
</script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.6/iframeResizer.contentWindow.js"></script>
<p id="messageText">loading...</p>
`;
return (
<div>
<iframe
iframeResizer
className="w-100"
srcDoc={code}
message="my message"
/>
</div>
);
```