-
-
Notifications
You must be signed in to change notification settings - Fork 162
/
Copy pathmain.js
1 lines (1 loc) · 1.64 KB
/
main.js
1
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),window.HTMLMediaElement={},window.HTMLFrameSetElement={},window.HTMLBodyElement={},window.HTMLFrameElement={};const application=require("application"),fs=require("uxp").storage.localFileSystem;var scenegraph=require("scenegraph");let dialog,panel;function helloHandlerFunction(e){const n=require("clipboard");if(null==dialog){dialog=document.createElement("dialog");let e=document.createElement("form");dialog.appendChild(e),e.style.width=200;let l=document.createElement("h1");l.textContent="Hello World",e.appendChild(l);let t=document.createElement("footer");e.appendChild(t);let o=document.createElement("button");o.uxpVariant="cta",o.textContent="Copy",o.onclick=e=>{n.copyText("hello world")},t.appendChild(o);let a=document.createElement("button");a.uxpVariant="cta",a.textContent="Close",a.onclick=e=>dialog.close(),t.appendChild(a)}document.body.appendChild(dialog).showModal()}function getPanel(){if(null==panel){const e='<link rel="stylesheet" type="text/css" href="main.css">';panel=document.createElement("panel");let n=document.createElement("header");n.innerHTML=e,panel.appendChild(n);let l=document.createElement("app-root");panel.appendChild(l)}return panel}module.exports={commands:{helloCommand:helloHandlerFunction},panels:{sympliPanel:{show(e){global.manifest=require("./manifest.json"),global.configs=require("./src/assets/config.json"),e.node.appendChild(getPanel()),require("./src/polyfills"),require("./src/runtime"),require("./src/main")},hide(e){e.node.firstChild&&e.node.firstChild.remove()},update(e,n){global.sympliDocumentChangedHandler&&global.sympliDocumentChangedHandler()}}}};