UNPKG

doric-framework

Version:

A column-based widget UI framework for Vue 3

4 lines (3 loc) 19.8 kB
(function(f,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("splitpanes"),require("vuedraggable"),require("pinia")):typeof define=="function"&&define.amd?define(["exports","vue","splitpanes","vuedraggable","pinia"],e):(f=typeof globalThis<"u"?globalThis:f||self,e(f.DoricFramework={},f.Vue,f.splitpanes$1,f.draggable,f.pinia))})(this,function(f,e,x,N,T){"use strict";const ct="";let S={};const D=t=>{S=t},b=T.defineStore("doric-workspace",{state:()=>({columns:[]}),actions:{insertColumn(t){this.columns=[...this.columns.slice(0,t),[],...this.columns.slice(t)]},removeColumn(t){this.columns[t].forEach(s=>{this.removeWidget(s.id)}),this.columns=[...this.columns.slice(0,t),...this.columns.slice(t+1)]},addWidget(t,s){const o=O(t),n=$(o,this.widgetIds);this.columns[s]=[...this.columns[s],n]},removeWidget(t){if(!this.widgets.find(o=>o.id===t))throw new Error(`Widget with id "${t}" not found`);this.widgets.forEach(o=>{Object.keys(o.inputs).forEach(n=>{o.inputs[n].subscriptions=o.inputs[n].subscriptions.filter(i=>i!==t)})}),this.columns=this.columns.map(o=>o.filter(n=>n.id!==t))}},getters:{workspaceShape:t=>t.columns.map(s=>s.map(o=>({id:o.id,type:o.type,label:o.label}))),widgetIds:t=>t.columns.flat().map(s=>s.id),widgets:t=>t.columns.flat(),getSubscribers:t=>(s,o)=>t.columns.flat().filter(n=>n.id!==s&&o in n.inputs&&(n.inputs[o].subscriptionState==="all"||n.inputs[o].subscriptionState==="some"&&n.inputs[o].subscriptions.includes(s))),sharedParameters:t=>{const n=t.columns.flat().map(i=>Object.keys(i.inputs).map(c=>({widgetId:i.id,key:c,input:i.inputs[c]}))).flat().filter(i=>i.input.shared).map(i=>({widgetId:i.widgetId,key:i.key,value:i.input.value}));return Object.fromEntries(n.map(i=>[`${i.widgetId}.${i.key}`,i.value]))}}}),A=t=>{if(!t)return{};const s={};return Object.keys(t).forEach(o=>{var n,i;s[o]=Object.assign({value:"",shared:!1,subscriptions:[],subscriptionState:(i=(n=t[o])==null?void 0:n.subscriptions)!=null&&i.length?"some":"all"},t[o])}),s},O=t=>{if(!("type"in t)||typeof t.type!="string")throw console.error(`Widget is missing a type or the type is not a string: `,t),new Error("Widget is missing a type or the type is not a string");return{type:t.type,id:(t==null?void 0:t.id)||"",label:(t==null?void 0:t.label)||(t.type in S?S[t.type]:t.type),inputs:A((t==null?void 0:t.inputs)||{})}},$=(t,s)=>{if(!t.id||s.includes(t.id)){const o={...t},n=t.type.replace("-widget",""),i=s.filter(a=>a.startsWith(n)).map(a=>parseInt(a.replace(n+"-",""))).filter(a=>!isNaN(a)),c=Math.max(-1,...i)+1;return o.id=`${n}-${c}`,o}else if(t.id===t.type){const o={...t,id:`${t.type}-0`};return $(o,s)}return t},C=()=>b().workspaceShape,U=t=>new Promise((s,o)=>{const n=b(),i=[];if(!Array.isArray(t)){o("Workspace is not an array");return}if(!t.every(a=>Array.isArray(a))){o("Workspace is not an array of arrays");return}if(!t.flat().every(a=>typeof a=="object")){o("Widgets in new Workspace are not all objects");return}const c=t.map(a=>a.map(h=>{const g=O(h),E=$(g,i);return i.push(E.id),E}));n.columns=[],e.nextTick(()=>{n.columns=c,s()})}),I=t=>{b().insertColumn(t)},F=t=>{b().removeColumn(t)},w=t=>{const o=b().widgets.find(n=>n.id===t);if(!o)throw new Error(`Widget with id "${t}" not found`);return o},L=(t,s)=>{b().addWidget(t,s)},P=t=>{b().removeWidget(t)},j=(t,s,o)=>{const n=b(),i=n.widgets.find(c=>c.id===t);if(!i)throw new Error(`Widget with id "${t}" not found`);n.columns=n.columns.map(c=>c.filter(a=>a.id!==t)).map((c,a)=>a===s?[...c.slice(0,o),i,...c.slice(o)]:c)},H=()=>b().sharedParameters,R=t=>{const s=b();t.forEach(({widgetId:o,key:n,value:i})=>{const c=s.widgets.find(a=>a.id===o);if(!c){console.error(`Widget with id "${o}" not found`);return}if(!("inputs"in c)){console.error(`Widget with id "${o}" has no inputs`);return}if(!(n in((c==null?void 0:c.inputs)||{}))){console.error(`Widget with id "${o}" has no input "${n}"`);return}c.inputs[n].value=i})},M=new Set(["string","number","boolean"]),J=(t,s)=>o=>{const n=b();if(o instanceof Object&&"value"in o){const c=Object.getOwnPropertyDescriptor(o,"value")||{};"get"in c&&"set"in c&&(o=o.value)}if(!M.has(typeof o)){console.error(`Widget "${t}" tried to emit a non-primitive value to "${s}". Only strings, numbers, and booleans are supported.`);return}n.getSubscribers(t,s).forEach(c=>{if(!(s in((c==null?void 0:c.inputs)||{}))){console.error(`Widget subscribes to "${s}" but has no listener. This may be a mistake in the workspace configuration or the widget is missing a 'useDoricInput' declaration.`);return}c.inputs[s].value=o})},v=(t,s,o)=>{var c;const i=b().widgets.find(a=>a.id===t);if(!i)throw new Error(`Widget with id "${t}" not found`);return(c=i.inputs)!=null&&c[s]||(i.inputs[s]={value:"",shared:(o==null?void 0:o.shared)||!1,subscriptions:[],subscriptionState:"all"}),{get value(){return i.inputs[s].value},set value(a){if(!M.has(typeof a)){console.error(`Widget "${t}" tried to give input "${s}" a non-primitive value. Only strings, numbers, and booleans are supported.`);return}i.inputs[s].value=a}}},G=()=>{const t=b(),s=JSON.parse(JSON.stringify(t.columns));return s.forEach((o,n)=>{o.forEach((i,c)=>{if(i.inputs&&Object.keys(i.inputs).length>0){const a=i.inputs;Object.keys(a).forEach(h=>{const g={};a[h].value&&(g.value=a[h].value),a[h].shared&&(g.shared=!0),a[h].subscriptionState==="all"||a[h].subscriptionState==="none"?g.subscriptionState=a[h].subscriptionState:(g.subscriptionState="some",g.subscriptions=a[h].subscriptions),s[n][c].inputs[h]=g})}})}),s},_=t=>(e.pushScopeId("data-v-b9e0d65b"),t=t(),e.popScopeId(),t),Q={key:0},X={key:1},Y={class:"font-bold text-blue-800 text-sm"},Z={class:"table w-full"},K={class:"table-row"},ee=_(()=>e.createElementVNode("div",{class:"table-cell pb-1 pr-2"},"Value:",-1)),te={class:"table-cell pb-1"},oe=["onUpdate:modelValue"],se={class:"table-row"},ne=_(()=>e.createElementVNode("div",{class:"table-cell pb-1 pr-2"},"Subscriptions:",-1)),ie={class:"table-cell pb-1"},re={class:"flex flex-row"},ce={class:"flex justify-center items-center"},ae=["onUpdate:modelValue"],le=[_(()=>e.createElementVNode("option",{value:"none"},"None",-1)),_(()=>e.createElementVNode("option",{value:"all"},"All",-1)),_(()=>e.createElementVNode("option",{value:"some"},"Some",-1))],de={class:"flex justify-center items-center pl-1"},pe=["onClick"],ue=[_(()=>e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-5 h-5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7.5 3.75H6A2.25 2.25 0 003.75 6v1.5M16.5 3.75H18A2.25 2.25 0 0120.25 6v1.5m0 9V18A2.25 2.25 0 0118 20.25h-1.5m-9 0H6A2.25 2.25 0 013.75 18v-1.5M15 12a3 3 0 11-6 0 3 3 0 016 0z"})],-1))],he={class:"table-row"},ge=_(()=>e.createElementVNode("div",{class:"table-cell pb-1 pr-2"},"Share:",-1)),me={class:"table-cell pb-1 truncate"},fe={class:"flex flex-row justify-between shared-toggle"},be=["id","checked","onChange"],_e=["for"],ke=[_(()=>e.createElementVNode("div",{class:"dot"},null,-1))],we=e.defineComponent({__name:"WidgetConfig",props:{widgetId:{type:String,required:!0}},emits:["setSubscriptionMode"],setup(t,{emit:s}){const o=t,n=w(o.widgetId),i=g=>{n.inputs[g].shared=!n.inputs[g].shared},c=e.ref(""),a=g=>{c.value===g?(s("setSubscriptionMode"),c.value=""):(s("setSubscriptionMode",o.widgetId,g),c.value=g)},h=()=>{s("setSubscriptionMode"),c.value=""};return(g,E)=>Object.keys(e.unref(n).inputs).length===0?(e.openBlock(),e.createElementBlock("div",Q,"This widget does not declare any inputs.")):(e.openBlock(),e.createElementBlock("div",X,[e.createElementVNode("div",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Object.keys(e.unref(n).inputs),(m,B)=>(e.openBlock(),e.createElementBlock("div",{key:m,class:e.normalizeClass(["relative flex flex-col p-2",{"border-t-2":B>0}])},[e.createElementVNode("span",Y,e.toDisplayString(m),1),e.createElementVNode("div",Z,[e.createElementVNode("div",K,[ee,e.createElementVNode("div",te,[e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":k=>e.unref(n).inputs[m].value=k},null,8,oe),[[e.vModelText,e.unref(n).inputs[m].value]])])]),e.createElementVNode("div",se,[ne,e.createElementVNode("div",ie,[e.createElementVNode("div",re,[e.createElementVNode("div",ce,[e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":k=>e.unref(n).inputs[m].subscriptionState=k,onChange:h},le,40,ae),[[e.vModelSelect,e.unref(n).inputs[m].subscriptionState]])]),e.createElementVNode("div",de,[e.withDirectives(e.createElementVNode("button",{class:e.normalizeClass(["subscription-button",{active:c.value===m}]),onClick:k=>a(m)},ue,10,pe),[[e.vShow,e.unref(n).inputs[m].subscriptionState==="some"]])])])])]),e.createElementVNode("div",he,[ge,e.createElementVNode("div",me,[e.createElementVNode("div",fe,[e.createElementVNode("input",{style:{display:"none"},type:"checkbox",id:`${t.widgetId}.${m}`,checked:e.unref(n).inputs[m].shared,onChange:k=>i(m)},null,40,be),e.createElementVNode("label",{for:`${t.widgetId}.${m}`},ke,8,_e)])])])])],2))),128))])]))}}),ht="",W=(t,s)=>{const o=t.__vccOpts||t;for(const[n,i]of s)o[n]=i;return o},Ee=W(we,[["__scopeId","data-v-b9e0d65b"]]),ye={class:"component-name"},Ce=e.defineComponent({__name:"MissingWidget",props:{type:String},setup(t){return(s,o)=>(e.openBlock(),e.createElementBlock("div",null,[e.createTextVNode(" Missing widget definition: "),e.createElementVNode("span",ye,e.toDisplayString(t.type),1)]))}}),gt="",Ve=W(Ce,[["__scopeId","data-v-b609b1cd"]]),Ne=e.defineComponent({__name:"ScopedComponent",props:{widget:{},widgetId:{}},setup(t){const s=t;return e.provide("useDoricOutput",o=>J(s.widgetId,o)),e.provide("useDoricInput",(o,n)=>v(s.widgetId,o,n)),(o,n)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.widget)))}}),V=t=>(e.pushScopeId("data-v-0724aae3"),t=t(),e.popScopeId(),t),Se={class:"doric-widget-framework"},$e={class:"relative mx-1 my-2"},We=["onClick"],Be={class:"flex-1 flex flex-row items-center"},xe={class:"text-gray-900 text-sm font-bold mx-2 my-1"},De=["onUpdate:modelValue"],Oe=["onClick"],Ie=[V(()=>e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-5 h-5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.324.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 011.37.49l1.296 2.247a1.125 1.125 0 01-.26 1.431l-1.003.827c-.293.24-.438.613-.431.992a6.759 6.759 0 010 .255c-.007.378.138.75.43.99l1.005.828c.424.35.534.954.26 1.43l-1.298 2.247a1.125 1.125 0 01-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.57 6.57 0 01-.22.128c-.331.183-.581.495-.644.869l-.213 1.28c-.09.543-.56.941-1.11.941h-2.594c-.55 0-1.02-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 01-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 01-1.369-.49l-1.297-2.247a1.125 1.125 0 01.26-1.431l1.004-.827c.292-.24.437-.613.43-.992a6.932 6.932 0 010-.255c.007-.378-.138-.75-.43-.99l-1.004-.828a1.125 1.125 0 01-.26-1.43l1.297-2.247a1.125 1.125 0 011.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.087.22-.128.332-.183.582-.495.644-.869l.214-1.281z"}),e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})],-1))],je=["onClick"],Me=[V(()=>e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-5 h-5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1))],ze={key:0,class:"p-1"},qe={key:0,class:"widget"},Te={key:0,class:"column-buttons"},Ae={class:"center"},Ue=["onClick"],Fe={class:"center"},Le=["onClick"],Pe=[V(()=>e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-4 h-4"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 4.5v15m7.5-7.5h-15"})],-1))],He=["onClick"],Re={key:1,class:"column-insert"},Je=[V(()=>e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",class:"w-4 h-4"},[e.createElementVNode("path",{d:"M10.75 4.75a.75.75 0 00-1.5 0v4.5h-4.5a.75.75 0 000 1.5h4.5v4.5a.75.75 0 001.5 0v-4.5h4.5a.75.75 0 000-1.5h-4.5v-4.5z"})],-1))],ve=e.defineComponent({__name:"DoricFramework",props:{locked:{type:Boolean,required:!1,default:!1},widgets:{type:Object,required:!0,default:()=>({})},workspace:{type:Object,required:!0,default:()=>[[]]}},emits:["setSharedParameters","onWorkspaceReady"],setup(t,{emit:s}){const o=t;D(Object.fromEntries(Object.keys(o.widgets).map(r=>[r,o.widgets[r].defaultLabel])));const n=e.ref(!1),i=e.ref(""),c=e.ref(-1),a=e.ref({widgetId:"",input:""}),h=()=>{i.value="",a.value={widgetId:"",input:""},c.value=-1},g=r=>{if(!r)return console.warn("newWorkspace is null"),!1;n.value=!0,h(),U(r).then(()=>{n.value=!1}).then(()=>{s("onWorkspaceReady")})};e.watch(()=>o.workspace,g),g(o.workspace),e.watch(H,(r,d)=>{s("setSharedParameters",r,d)}),e.watch(()=>o.widgets,r=>{D(Object.fromEntries(Object.keys(r).map(d=>[d,r[d].defaultLabel])))}),e.watch(()=>o.locked,r=>{r&&h()});const E=r=>{const d=i.value;h(),d!==r&&(i.value=r)},m=r=>{h(),P(r)},B=r=>{h(),c.value!==r&&(c.value=r)},k=(r,d)=>{L({id:`${r}-0`,type:`${r}`},d),h()},Ye=(r,d)=>{Object.entries(d).forEach(([u,p])=>{var l;if((l=p==null?void 0:p.element)!=null&&l.id&&Number.isInteger(p==null?void 0:p.newIndex)){const y=p.element.id,rt=p.newIndex;(u==="moved"||u==="added")&&j(y,r,rt)}})},Ze=r=>{I(r)},Ke=r=>{F(r)},z=(r,d)=>{const u=r?0:C().length;I(u),Object.entries(d).forEach(([p,l])=>{const y=l.element.id;p==="added"&&j(y,u,0)})};e.defineComponent({name:"DoricFramework",props:{locked:{type:Boolean,required:!1,default:!1},widgets:{type:Object,required:!0,default:()=>({})},workspace:{type:Object,required:!0,default:()=>[]}},emits:["setSharedParameters","onWorkspaceReady"]});const et=(r,d)=>{if(!r){a.value={widgetId:"",input:""};return}a.value={widgetId:r,input:d}},tt=r=>i.value===r?"border-blue-600 hover:border-blue-700":"border-gray-200 hover:border-gray-300",ot=r=>o.locked?"bg-gray-100":i.value===r?"bg-blue-100 group-hover:bg-blue-200":"bg-gray-50 group-hover:bg-gray-100",st={subscribed:"subscribed",unsubscribed:"not-subscribed"},q=(r,d,u)=>{const p=w(r);if(!p)throw console.error(`Widget not found: ${r}`),new Error(`Widget not found: ${r}`);return p.inputs[d].subscriptions.includes(u)},nt=(r,d,u)=>st[q(r,d,u)?"subscribed":"unsubscribed"],it=r=>{if(!a.value.widgetId||!a.value.input){console.error("Should be impossible: toggleSubscription called without subscriptionMode");return}const d=w(a.value.widgetId),u=a.value.input,p=[...d.inputs[u].subscriptions];if(!p.includes(r))p.push(r);else{const l=p.indexOf(r);l>-1&&p.splice(l,1)}d.inputs[u].subscriptions=[...p]};return(r,d)=>(e.openBlock(),e.createElementBlock("div",Se,[e.createVNode(e.unref(N),{class:"list-group",list:[],group:"widgets",onChange:d[0]||(d[0]=u=>z(!0,u)),itemKey:"id"},{item:e.withCtx(u=>[]),_:1}),e.createVNode(e.unref(x.Splitpanes),null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(C)(),(u,p)=>(e.openBlock(),e.createBlock(e.unref(x.Pane),{"min-size":"20",key:p,size:100/e.unref(C)().length},{default:e.withCtx(()=>[e.createVNode(e.unref(N),{class:"list-group",list:u,group:"widgets",onChange:l=>Ye(p,l),itemKey:"id",handle:".drag-handle"},{item:e.withCtx(({element:l})=>[e.createElementVNode("div",$e,[a.value.input&&i.value!==l.id?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:()=>it(l.id),class:e.normalizeClass(["subscription-helper",nt(a.value.widgetId,a.value.input,l.id)])},[e.createElementVNode("div",null,e.toDisplayString(q(a.value.widgetId,a.value.input,l.id)?"Subscribed":"Click to Subscribe"),1)],10,We)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["doric-widget-framework__widget border-2 rounded group",tt(l.id)])},[e.createElementVNode("header",{class:e.normalizeClass(["p-1",ot(l.id)+(t.locked?"":" drag-handle")])},[e.createElementVNode("div",Be,[e.createElementVNode("span",xe,e.toDisplayString(i.value!==l.id?l.label:"Label:"),1),i.value===l.id?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text","onUpdate:modelValue":y=>e.unref(w)(l.id).label=y,class:"w-full mr-2"},null,8,De)),[[e.vModelText,e.unref(w)(l.id).label]]):e.createCommentVNode("",!0)]),t.locked?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([{invisible:i.value&&i.value!==l.id},"flex flex-row items-center"])},[(l==null?void 0:l.type)in t.widgets&&"widget"in t.widgets[l.type]?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:()=>E(l.id),class:e.normalizeClass(["config-button",i.value===l.id?"active-config":""])},Ie,10,Oe)):e.createCommentVNode("",!0),e.createElementVNode("button",{onClick:()=>m(l.id),class:e.normalizeClass(["config-button",i.value===l.id?"active-config":""])},Me,10,je)],2))],2),i.value===l.id?(e.openBlock(),e.createElementBlock("div",ze,[e.createVNode(Ee,{widgetId:l.id,onSetSubscriptionMode:et},null,8,["widgetId"])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass([{hidden:i.value===l.id},"p-1"])},[(l==null?void 0:l.type)in t.widgets&&"widget"in t.widgets[l.type]?(e.openBlock(),e.createElementBlock("div",qe,[e.createVNode(Ne,{widget:t.widgets[l.type].widget,widgetId:l.id},null,8,["widget","widgetId"])])):(e.openBlock(),e.createBlock(Ve,{key:1,type:l==null?void 0:l.type},null,8,["type"]))],2)],2)])]),_:2},1032,["list","onChange"]),t.locked?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Te,[e.createElementVNode("div",Ae,[u.length===0?(e.openBlock(),e.createElementBlock("button",{key:0,class:"remove-column-button",onClick:()=>Ke(p)}," Remove Column ",8,Ue)):e.createCommentVNode("",!0)]),e.createElementVNode("div",null,[e.createElementVNode("div",Fe,[e.createElementVNode("button",{class:e.normalizeClass("add-widget-button "+(p===c.value?"toggled":"")),onClick:()=>B(p===c.value?-1:p),title:"Add Widget"},Pe,10,Le)]),e.createElementVNode("div",{class:e.normalizeClass(["add-widget-list",{collapsed:c.value!==p}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Object.keys(t.widgets),l=>(e.openBlock(),e.createElementBlock("button",{key:l,onClick:()=>k(l,p)},e.toDisplayString(t.widgets[l].defaultLabel),9,He))),128))],2)])]))]),_:2},1032,["size"]))),128))]),_:1}),t.locked?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(N),{key:0,class:"list-group",list:[],group:"widgets",onChange:d[1]||(d[1]=u=>z(!1,u)),itemKey:"id"},{item:e.withCtx(u=>[]),_:1})),t.locked?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Re,[e.createElementVNode("button",{onClick:d[2]||(d[2]=u=>Ze(e.unref(C)().length))},Je)]))]))}}),kt="",wt="",Ge=W(ve,[["__scopeId","data-v-0724aae3"]]),Qe=function(t,s){return e.inject("useDoricInput",()=>(console.error("useDoricInput is not ready. This is probably a bug in Doric."),{value:""}))(t,s)},Xe=function(t){return e.inject("useDoricOutput",()=>(console.error("useDoricOutput is not ready. This is probably a bug in Doric."),()=>{console.error("useDoricOutput is not ready. This is probably a bug in Doric.")}))(t)},Et="";f.default=Ge,f.exportWorkspace=G,f.pushWorkspaceState=R,f.useDoricInput=Qe,f.useDoricOutput=Xe,Object.defineProperties(f,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}); //# sourceMappingURL=doric-framework.umd.cjs.map