Last active
August 8, 2021 18:58
-
-
Save av/d25102496498d75a8b68bb3c5d056305 to your computer and use it in GitHub Desktop.
Custom Widget Bundle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"eGRc":[function(require,module,exports) { | |
function t(t,n){return l(t)||o(t,n)||r(t,n)||e()}function e(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function r(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function o(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,l=[],a=!0,u=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(l.push(n.value),!e||l.length!==e);a=!0);}catch(i){u=!0,o=i}finally{try{a||null==r.return||r.return()}finally{if(u)throw o}}return l}}function l(t){if(Array.isArray(t))return t}var a=PremiumPortal,u=a.React,i=a.ReactDOM,c=u.useState;function m(e){e.widget;var r=t(c(0),2),n=r[0],o=r[1];return u.createElement(u.Fragment,null,u.createElement("h1",null,"Count: ",n),u.createElement("button",{onClick:function(){return o(n+1)}},"Inc"))}console.log("👋 Hello from bundle!",PremiumPortal),PremiumPortal.Dashboard.registerWidget(m,{name:"CustomWidget",displayName:"Custom Widget",description:"Just a custom external widget",defaultConfig:{title:{label:"Title",type:"string",value:"Custom Widget"}}}); | |
},{}]},{},["eGRc"], null) | |
//# sourceMappingURL=/simplest.js.map |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment