@johnnycubides/catalejo-vue3-desktop-v2 0.1.3 → 0.1.5
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.
|
@@ -15,4 +15,4 @@
|
|
|
15
15
|
</category>
|
|
16
16
|
</xml>`;function Wt(){const e=window.innerWidth,o=window.innerHeight;return e<o}const $t={media:"media/",renderer:"geras",toolboxPosition:"start",horizontalLayout:Wt(),zoom:{controls:!0,wheel:!0,startScale:1,maxScale:3,minScale:.3,scaleSpeed:1.2,pinch:!0},trashcan:!0,grid:{spacing:25,length:1,colour:"#ccc",snap:!0},toolbox:Rt};function Ut(e){return F.inject(e.value,$t)}function At(e,o){const t=F.utils.xml.textToDom(e);try{return F.Xml.clearWorkspaceAndLoadFromXml(t,o),{status:i.OK}}catch{return{status:i.FAILED}}}function Xt(e){e==W.ES?F.setLocale(at):F.setLocale(st)}function Mt(e){return e.lang=="lua"?rt.luaGenerator:e.lang=="python"?ct.pythonGenerator:void 0}let Ne=[];function Kt(e,o){Le(Ne,e.platform).status==i.NOTFOUND&&(e.initBlockly(it,Mt(e),o),Ne.push(e.platform))}const Ht={class:"div_blockly"},qt=R({__name:"BlocklyEditor",props:["projects","index","update","workspace","plugin"],emits:["xmltext-index","blockly-mounted"],setup(e,{emit:o}){const t=e,n=o,l=s(),a=s();let r;const u=[F.Events.SELECTED],E=d=>{for(const c in u)if(d.type===u[c]){const D=F.Xml.workspaceToDom(r),L=F.Xml.domToPrettyText(D);n("xmltext-index",L,t.index)}};return $(async()=>{r=Ut(l),Xt(0),r.addChangeListener(E),n("blockly-mounted")}),N(()=>[t.index,t.update],async([d])=>{if(t.projects.length>0&&t.workspace==j.BLOCKLY){await Ge();const c=t.projects[d].config.platform;c!=null&&c!=""&&(Kt(t.plugin,r),r.updateToolbox(t.plugin.toolbox)),At(t.projects[d].blocklycode,r),F.svgResize(r),r.scrollCenter()}}),(d,c)=>(x(),O("div",Ht,[v("div",{class:"blocklyDivClass",id:"blocklyDiv",ref_key:"blocklyDivRef",ref:l},null,512),v("xml",{style:{display:"none"},ref_key:"blocklyToolbox",ref:a},[Je(d.$slots,"default")],512)]))}}),zt={class:"card"},Qt=R({__name:"ToolBar",props:["lang","plugin"],emits:["menu-toggle","save-project-request","close-project","config-project","plugin-command"],setup(e,{emit:o}){const t=e,n=o,l=s([]),a=s(W.EN),r=[{label:b(te.menu,t.lang),icon:"pi pi-arrow-right-arrow-left",command:()=>{n("menu-toggle")}},{label:b(te.save,t.lang),icon:"pi pi-save",command:()=>{n("save-project-request")}},{label:b(te.close,t.lang),icon:"pi pi-times",command:()=>{n("close-project")}},{label:b(te.config,t.lang),icon:"pi pi-cog",command:()=>{n("config-project")}}];function u(d){for(let c=0;c<d.length;c++)if(Array.isArray(d[c].items))u(d[c].items);else{const D=d[c].command;d[c].command=function(){n("plugin-command",D)}}return d}const E=d=>{if(d!=null){let c=d.getItemsToolBarOfPlugin(t.lang);c!=null&&c.length>0?(c=u(c),l.value=[...r,...c]):l.value=r}else l.value=r};return N(()=>t.plugin,d=>{E(d)}),N(()=>t.lang,()=>{a.value=t.lang}),$(()=>{l.value=r}),(d,c)=>(x(),O("div",zt,[f(g(ke),{model:l.value},null,8,["model"]),f(g(ve))]))}}),Jt={class:"container"},Gt=R({__name:"TextareaDialog",setup(e){const o=Ze("dialogRef");let t;const n=s(""),l=s("");return $(()=>{t=o.value.data,n.value=t.description,l.value=t.content}),(a,r)=>(x(),O("div",Jt,[v("p",null,T(n.value),1),f(g(Me),{modelValue:l.value,"onUpdate:modelValue":r[0]||(r[0]=u=>l.value=u),autoResize:""},null,8,["modelValue"])]))}}),Zt=J(Gt,[["__scopeId","data-v-e2622354"]]);function Te(e,o){for(let t=0;t<e.length;t++)if(e[t].path===o)return{status:i.EXISTS,data:t};return{status:i.NOEXIST}}async function Yt(e,o){const t=Fe(o);if(t.extension=="")return{status:i.WITHOUTCHANGE};if(!se.includes(t.extension))return{status:i.WITHOUTCHANGE};const n=Te(e,t.path);if(n.status==i.EXISTS)return{status:i.REQUEST_SELECT_FILE_IN_TABVIEW,data:n.data};{const l=await jt(t.path);if(l.status==0){const a=t.extension=="json"?JSON.parse(l.data):{},r=ye(l.data,t.extension),u={path:t.path,filename:t.filename,extension:t.extension,content:l.data,blocklycode:a.blocklycode||void 0,codemirrorCursor:0,config:r,status:i.ADDED};return e.push(u),{status:i.REQUEST_SELECT_FILE_IN_TABVIEW,data:e.length-1}}else return{status:i.WITHOUTCHANGE}}}async function eo(e,o,t){const n=Fe(o);if(n.extension=="")return{status:i.WITHOUTCHANGE};if(!se.includes(n.extension))return{status:i.WITHOUTCHANGE};const l=Te(e,n.path);if(l.status==i.EXISTS)return{status:i.REQUEST_SELECT_FILE_IN_TABVIEW,data:l.data};if(t!=""){const a=n.extension=="json"?JSON.parse(t):{},r=ye(t,n.extension),u={path:n.path,filename:n.filename,extension:n.extension,content:t,blocklycode:a.blocklycode||void 0,codemirrorCursor:0,config:r,status:i.ADDED};return e.push(u),{status:i.REQUEST_SELECT_FILE_IN_TABVIEW,data:e.length-1}}else return{status:i.WITHOUTCHANGE}}function to(e,o){return e!==void 0&&e.length>o?(e.splice(o,1),{status:i.OK}):{status:i.FAILED}}function oo(e,o,t,n){return e[n].content=o,e[n].codemirrorCursor=t,e[n].status=i.UNSAVED,{status:i.OK}}function no(e,o,t){return e[t].blocklycode=o,e[t].status=i.UNSAVED,{status:i.OK}}function lo(e){return Pe.includes(e.extension)?{status:i.SET_WS,data:j.BLOCKLY}:Ce.includes(e.extension)?{status:i.SET_WS,data:j.CODEMIRROR}:{status:i.SET_WS,data:j.WELCOME}}function ao(e,o){const t=e[o];if(t.extension=="json"&&t.blocklycode!==void 0){const n={config:t.config||"",blocklycode:t.blocklycode};e[o].content=JSON.stringify(n)}return{status:i.OK}}function so(e,o,t){const n=e[o];let l;if(Pe.includes(n.extension)&&t!=null)l=t;else if(Ce.includes(n.extension))l=ye(n.content,n.extension);else return{status:i.FAILED};return e[o].config=l,{status:i.OK}}function ye(e,o){return o=="lua"?ro(e):o=="py"?io(e):o=="json"?co(e):{}}function io(e){const o={},t=e.split(`
|
|
17
17
|
`);for(const n of t){const l=n.match(/# (\w+): (.+)/);if(l){const[,a,r]=l;o[a]=String(r)}}return o}function ro(e){const o={},t=e.split(`
|
|
18
|
-
`);for(const n of t){const l=n.match(/-- (\w+): (.+)/);if(l){const[,a,r]=l;o[a]=String(r)}}return o}function co(e){const o=JSON.parse(e).config;return o===void 0?{}:o}function uo(e){let o=[];return e.config!=null&&(Object.keys(e.config).forEach(t=>{o.push({label:[t],value:e.config[t]})}),o.push({label:"",value:""})),o}function po(e){let o={};for(let t=0;t<e.length;t++){const n=e[t].label;if(n!=""&&n!=null){const l=e[t].value;o[n]=l}}return o}function Fe(e){const o=me(e);if(o.so==k.UNIX){const t=e.split("/").pop(),n=e.includes(".")?e.split(".").pop():"";return{path:e,filename:t||"",extension:n||""}}else if(o.so==k.WINDOWS){const t=e.split("\\").pop(),n=e.includes(".")?e.split(".").pop():"";return{path:e,filename:t||"",extension:n||""}}else return{path:"",filename:"",extension:""}}async function fo(e){return await kt(e)}async function vo(e,o){return ao(e,o),so(e,o),await Ct(e[o].path,e[o].content)}function mo(e,o){if(o.length>0)for(let t=0;t<o.length;t++)e[o[t].platform]=o[t]}let go=[];console.log("
|
|
18
|
+
`);for(const n of t){const l=n.match(/-- (\w+): (.+)/);if(l){const[,a,r]=l;o[a]=String(r)}}return o}function co(e){const o=JSON.parse(e).config;return o===void 0?{}:o}function uo(e){let o=[];return e.config!=null&&(Object.keys(e.config).forEach(t=>{o.push({label:[t],value:e.config[t]})}),o.push({label:"",value:""})),o}function po(e){let o={};for(let t=0;t<e.length;t++){const n=e[t].label;if(n!=""&&n!=null){const l=e[t].value;o[n]=l}}return o}function Fe(e){const o=me(e);if(o.so==k.UNIX){const t=e.split("/").pop(),n=e.includes(".")?e.split(".").pop():"";return{path:e,filename:t||"",extension:n||""}}else if(o.so==k.WINDOWS){const t=e.split("\\").pop(),n=e.includes(".")?e.split(".").pop():"";return{path:e,filename:t||"",extension:n||""}}else return{path:"",filename:"",extension:""}}async function fo(e){return await kt(e)}async function vo(e,o){return ao(e,o),so(e,o),await Ct(e[o].path,e[o].content)}function mo(e,o){if(o.length>0)for(let t=0;t<o.length;t++)e[o[t].platform]=o[t]}let go=[];console.log("plugins to load");const be=e=>(Ye("data-v-d1519de7"),e=e(),et(),e),Eo={style:{height:"100%"}},ho={class:"main_div"},yo=be(()=>v("p",null,"Catalejo",-1)),bo={id:"tree_and_commands",class:"tree_and_commands"},_o={id:"treeview",class:"treeview"},xo={id:"editor",class:"editor"},Do={id:"toolbar",class:"toolbar"},Io={id:"tabView",class:"tabview"},Oo={id:"blocklyEditor",class:"blocklyeditorclass"},No={id:"textEditor",class:"texteditorclass"},wo=be(()=>v("span",null,": ",-1)),ko=be(()=>v("div",{id:"log"},null,-1)),jo=R({__name:"App",setup(e){const o=s([]),t=s([]),n=s(""),l=s(0),a=s([]),r=s(),u=s(),E=s(!1),d=s(!1),c=s(W.EN),D=s(j.BLOCKLY),L=s({}),C=s();c.value=W.ES;const B=we(),P=Ke(),S=s(!0),V=s(!1),K=s(""),H=s([{label:"",value:""}]),G=s(""),q=s(""),re=m=>{o.value=m},Z=async m=>{const y=await Yt(a.value,m||"");y.status==i.REQUEST_SELECT_FILE_IN_TABVIEW&&(u.value=y.data)},ce=m=>{u.value=m},U=(m,y,I)=>{d.value=!d.value,oo(a.value,m,y,I)},z=(m,y)=>{d.value=!d.value,no(a.value,m,y)},p=async(m,y)=>{const I=await eo(a.value,m,y);I.status==i.REQUEST_SELECT_FILE_IN_TABVIEW&&(u.value=I.data)},h=async()=>{(await vo(a.value,u.value||0)).status==i.OK?B.add({severity:"success",summary:b(A.savefile.ok,c.value),detail:"",life:3e3}):B.add({severity:"error",summary:b(A.savefile.error,c.value),detail:"",life:3e3})},_=()=>{a.value.length>0&&(to(a.value,u.value||0),a.value.length>0&&u.value!=null?u.value<a.value.length?E.value=!E.value:u.value=u.value-1:(D.value=j.WELCOME,u.value=-1))},Q=()=>{K.value=b(A.titleConfigProjectDialog,c.value),G.value=b(A.dialogButton.ok,c.value),q.value=b(A.dialogButton.close,c.value),u.value!=null&&(H.value=uo(a.value[u.value])),V.value=!0},Be=()=>{D.value=j.WELCOME},ue=async m=>{const y=await fo(m);y.status==i.OK&&(Le(t.value,m).status==i.NOTFOUND&&t.value.push(m),o.value=y.data,n.value=m,l.value=t.value.length)};s(!1),s(""),s();const Se=async m=>{if(B.add({severity:"info",summary:b(A.toastProccess,c.value),detail:"",life:1500}),C.value!=null){const y=await C.value.commandEmit(r.value,m);switch(y.typeResult){case fe.TOAST:B.add(y.data);break;case fe.TEXT_PRINT:P.open(Zt,{data:y.data,props:{maximizable:!0,header:y.data.title}});break}}},_e=m=>{},Ve=()=>{S.value=!S.value,E.value=!E.value},Re=()=>{V.value=!1,u.value!=null&&(a.value[u.value].config=po(H.value))},We=()=>{if(a.value.length>0&&u.value!==void 0){const m=lo(a.value[u.value]);m.status==i.SET_WS&&(D.value=m.data)}},$e=()=>{if(a.value.length>0&&u.value!==void 0){const m=a.value[u.value].config.platform;m!=null&&m!=""?C.value=L.value[m]:C.value=void 0}},Ue=()=>{u.value!=null&&(r.value=a.value[u.value])};return N(u,()=>{We(),$e(),Ue()}),$(async()=>{ue("/home/johnny/projects/catalejo-lua/work"),mo(L.value,go)}),(m,y)=>(x(),O("main",Eo,[v("div",ho,[Y(v("div",{id:"menu_collapse",class:"menu_collapse",onMouseover:y[0]||(y[0]=I=>_e()),onMouseout:y[1]||(y[1]=I=>_e())},[yo,Y(v("div",bo,[v("div",null,[f(Vt,{plugins:L.value,lang:c.value,workDirPath:n.value,onDirconfigUpdate:re,onSaveProjectRequest:h,onNewProjectRequest:p,onDirPathSelected:ue},null,8,["plugins","lang","workDirPath"])]),v("div",_o,[f(Dt,{filePaths:o.value,dirPaths:t.value,dirPathsLength:l.value,lang:c.value,onFileSelected:Z,onDirPathSelected:ue},null,8,["filePaths","dirPaths","dirPathsLength","lang"])])],512),[[ee,S.value]])],544),[[ee,S.value]]),v("div",xo,[v("div",Do,[f(Qt,{lang:c.value,plugin:C.value,onMenuToggle:Ve,onSaveProjectRequest:h,onCloseProject:_,onConfigProject:Q,onPluginCommand:Se},null,8,["lang","plugin"])]),v("div",Io,[f(wt,{index:u.value,projects:a.value,contentchanges:d.value,lang:c.value,update:E.value,onIndexOfProjectToLoad:ce},null,8,["index","projects","contentchanges","lang","update"])]),Y(v("div",Oo,[f(qt,{projects:a.value,index:u.value,workspace:D.value,plugin:C.value,update:E.value,onXmltextIndex:z,onBlocklyMounted:Be},null,8,["projects","index","workspace","plugin","update"])],512),[[ee,D.value==g(j).BLOCKLY]]),Y(v("div",No,[f(pt,{projects:a.value,index:u.value,workspace:D.value,update:E.value,onContentCursorIndex:U},null,8,["projects","index","workspace","update"])],512),[[ee,D.value==g(j).CODEMIRROR]])]),f(g(pe),{visible:V.value,"onUpdate:visible":y[3]||(y[3]=I=>V.value=I),modal:"",header:K.value,style:{width:"32rem"}},{default:ne(()=>[v("div",null,[(x(!0),O(le,null,ae(H.value,I=>(x(),O("div",null,[f(g(oe),{type:"text",size:"small",modelValue:I.label,"onUpdate:modelValue":de=>I.label=de},null,8,["modelValue","onUpdate:modelValue"]),wo,f(g(oe),{type:"text",size:"small",modelValue:I.value,"onUpdate:modelValue":de=>I.value=de},null,8,["modelValue","onUpdate:modelValue"])]))),256)),f(g(M),{type:"button",label:q.value,severity:"secondary",onClick:y[2]||(y[2]=I=>V.value=!1)},null,8,["label"]),f(g(M),{type:"button",label:G.value,onClick:Re},null,8,["label"])])]),_:1},8,["visible","header"]),f(g(ve)),f(g(He))]),ko]))}}),Co=J(jo,[["__scopeId","data-v-d1519de7"]]),ie=tt(Co);ie.use(qe);ie.use(ze);ie.use(Qe);ie.mount("#app");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.main_div{display:flex;padding:0;margin:0;height:100%}.menu_collapse{width:200px;flex:0 0 auto;margin:0;padding:0}.tree_and_commands{width:100%;margin:0;padding:0}.editor{flex:1 0 0 auto;display:flex;flex-direction:column;align-items:stretch;overflow:auto;width:100%}.tabview{max-height:content;overflow-y:auto;width:100%;height:55px}.toolbar{height:55px}.blocklyeditorclass{flex:1;height:100%;max-width:100%;overflow-x:auto;overflow-y:auto}.texteditorclass{flex:1;max-width:100%;overflow-x:auto;overflow-y:auto}@media (max-width: 768px){.main_div{font-size:10px}}[data-v-7d510def] .p-tree{padding:0}.card[data-v-8ef45e55]{background:var(--surface-card);padding:0;border-radius:10px;margin-bottom:0}[data-v-8ef45e55] .p-tabview .p-tabview-panels{padding:0;background:gray}[data-v-8ef45e55] .p-tabview .p-tabview-nav{padding:3px}.card[data-v-dad5592a]{background:var(--surface-card);padding:0rem;border-radius:10px;margin-bottom:0rem}.blocklyWorkspace:hover .blocklyTreeLabel{display:none}.blocklyToolboxContents{flex-wrap:nowrap}.blocklyToolboxDiv{background-color:#63a1d2}.blocklyToolboxDiv:hover{width:auto}.div_blockly{width:100%;height:100%}.blocklyDivClass{height:100%;width:100%;text-align:left;position:relative}.blocklyTreeLabel{display:block-inline;color:#fff}.blocklySvg{width:100%;height:100%}.blocklyAreaClass{height:100%}.container[data-v-e2622354],.container textarea[data-v-e2622354]{width:100%}.main_div[data-v-
|
|
1
|
+
.main_div{display:flex;padding:0;margin:0;height:100%}.menu_collapse{width:200px;flex:0 0 auto;margin:0;padding:0}.tree_and_commands{width:100%;margin:0;padding:0}.editor{flex:1 0 0 auto;display:flex;flex-direction:column;align-items:stretch;overflow:auto;width:100%}.tabview{max-height:content;overflow-y:auto;width:100%;height:55px}.toolbar{height:55px}.blocklyeditorclass{flex:1;height:100%;max-width:100%;overflow-x:auto;overflow-y:auto}.texteditorclass{flex:1;max-width:100%;overflow-x:auto;overflow-y:auto}@media (max-width: 768px){.main_div{font-size:10px}}[data-v-7d510def] .p-tree{padding:0}.card[data-v-8ef45e55]{background:var(--surface-card);padding:0;border-radius:10px;margin-bottom:0}[data-v-8ef45e55] .p-tabview .p-tabview-panels{padding:0;background:gray}[data-v-8ef45e55] .p-tabview .p-tabview-nav{padding:3px}.card[data-v-dad5592a]{background:var(--surface-card);padding:0rem;border-radius:10px;margin-bottom:0rem}.blocklyWorkspace:hover .blocklyTreeLabel{display:none}.blocklyToolboxContents{flex-wrap:nowrap}.blocklyToolboxDiv{background-color:#63a1d2}.blocklyToolboxDiv:hover{width:auto}.div_blockly{width:100%;height:100%}.blocklyDivClass{height:100%;width:100%;text-align:left;position:relative}.blocklyTreeLabel{display:block-inline;color:#fff}.blocklySvg{width:100%;height:100%}.blocklyAreaClass{height:100%}.container[data-v-e2622354],.container textarea[data-v-e2622354]{width:100%}.main_div[data-v-d1519de7]{display:flex;padding:0;margin:0;height:100%}.menu_collapse[data-v-d1519de7]{width:200px;flex:0 0 auto;margin:0;padding:0}.tree_and_commands[data-v-d1519de7]{width:100%;margin:0;padding:0}.editor[data-v-d1519de7]{flex:1 0 0 auto;display:flex;flex-direction:column;align-items:stretch;overflow:auto;width:100%}.tabview[data-v-d1519de7]{max-height:content;overflow-y:auto;width:100%;height:55px}.toolbar[data-v-d1519de7]{height:55px}.blocklyeditorclass[data-v-d1519de7]{flex:1;height:100%;max-width:100%;overflow-x:auto;overflow-y:auto}.texteditorclass[data-v-d1519de7]{flex:1;max-width:100%;overflow-x:auto;overflow-y:auto}@media (max-width: 768px){.main_div[data-v-d1519de7]{font-size:10px}}
|
package/dist/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<link rel="icon" href="/favicon.ico">
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
7
|
<title>Vite App</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-ByndffMI.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/@vue-CfPxtCWx.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/primevue-CEz28wR_.js">
|
|
11
11
|
<link rel="modulepreload" crossorigin href="/assets/@lezer-6dgAjmMZ.js">
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<link rel="modulepreload" crossorigin href="/assets/codemirror-DYWAmcfC.js">
|
|
16
16
|
<link rel="modulepreload" crossorigin href="/assets/blockly-C3KDyeBl.js">
|
|
17
17
|
<link rel="stylesheet" crossorigin href="/assets/primevue-VvdNDlPa.css">
|
|
18
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
18
|
+
<link rel="stylesheet" crossorigin href="/assets/index-DjROOgZJ.css">
|
|
19
19
|
<link rel="stylesheet" crossorigin href="/assets/primeicons-B7yeMe2z.css">
|
|
20
20
|
</head>
|
|
21
21
|
<body>
|
package/dist/plugins/plugins.js
CHANGED