@pod-os/elements 0.40.0 → 0.41.0-rc.4453840.0

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.
Files changed (25) hide show
  1. package/dist/cjs/{index-Bc4gZgPG.js → index-BP03J2RA.js} +246 -75
  2. package/dist/cjs/{jsonld-V2RB47OZ-JAbnY92y.js → jsonld-V2RB47OZ-B6QDxKa1.js} +1 -1
  3. package/dist/cjs/pos-add-literal-value_3.cjs.entry.js +1 -1
  4. package/dist/cjs/pos-add-new-thing_32.cjs.entry.js +1 -1
  5. package/dist/cjs/pos-add-relation.cjs.entry.js +1 -1
  6. package/dist/cjs/pos-container-contents.cjs.entry.js +1 -1
  7. package/dist/cjs/pos-subjects.cjs.entry.js +1 -1
  8. package/dist/components/index2.js +1 -1
  9. package/dist/elements/elements.esm.js +1 -1
  10. package/dist/elements/{p-57d32176.entry.js → p-1e0bd264.entry.js} +1 -1
  11. package/dist/elements/{p-a8628eb4.entry.js → p-3ef3a9a9.entry.js} +1 -1
  12. package/dist/elements/{p-f6da714c.entry.js → p-5506bf9a.entry.js} +1 -1
  13. package/dist/elements/{p-DuW6UWKz.js → p-DqO-cIHe.js} +1 -1
  14. package/dist/elements/{p-ed1d9d77.entry.js → p-d31c55b9.entry.js} +1 -1
  15. package/dist/elements/{p-2ee1efdb.entry.js → p-f9c10964.entry.js} +1 -1
  16. package/dist/elements/p-sVi8GCz5.js +67 -0
  17. package/dist/esm/{index-LnGgDqFG.js → index-CMbRpNym.js} +246 -75
  18. package/dist/esm/{jsonld-V2RB47OZ-DFmZ008Y.js → jsonld-V2RB47OZ-zn531VHn.js} +1 -1
  19. package/dist/esm/pos-add-literal-value_3.entry.js +1 -1
  20. package/dist/esm/pos-add-new-thing_32.entry.js +1 -1
  21. package/dist/esm/pos-add-relation.entry.js +1 -1
  22. package/dist/esm/pos-container-contents.entry.js +1 -1
  23. package/dist/esm/pos-subjects.entry.js +1 -1
  24. package/package.json +2 -2
  25. package/dist/elements/p-BXBNVUZ5.js +0 -67
@@ -1 +1 @@
1
- import{r as t,c as s,h as e,H as i}from"./p-spEUIGXI.js";import{L as n}from"./p-BXBNVUZ5.js";import{s as o}from"./p-BW_CkW1K.js";import{c as r}from"./p-vFMstSdt.js";const l=class{constructor(e){t(this,e),this.subscribeResource=s(this,"pod-os:resource",7),this.contents=[],this.loading=!0,this.createNewItem=null,this.disconnected$=new r.Subject,this.receiveResource=t=>{this.container=t.assume(n),this.loading=!1,this.container.observeContains().pipe(r.takeUntil(this.disconnected$)).subscribe((t=>this.contents=t.toSorted(((t,s)=>t.name.localeCompare(s.name)))))}}onCreateNewFile(){this.createNewItem="file"}onCreateNewFolder(){this.createNewItem="folder"}componentWillLoad(){o(this)}handleKeyDown(t){"Escape"===t.key&&(this.createNewItem=null)}render(){if(this.loading)return null;const t=this.contents.map((t=>e("li",{key:t.uri},e("pos-resource",{lazy:!0,uri:t.uri},e("pos-container-item",null,t.name)))));return null!==this.createNewItem&&t.unshift(e("li",{key:"new-item"},e("pos-create-new-container-item",{type:this.createNewItem,container:this.container}))),e(i,null,e("pos-container-toolbar",{"onPod-os:create-new-file":()=>this.onCreateNewFile(),"onPod-os:create-new-folder":()=>this.onCreateNewFolder()}),t.length>0?e("ul",{"aria-label":"Container contents"},t):e("p",null,"The container is empty"))}disconnectedCallback(){this.disconnected$.next(),this.disconnected$.complete()}};l.style="ul{list-style:none;padding:0;margin:0}li{padding:0;margin:0}";export{l as pos_container_contents}
1
+ import{r as t,c as s,h as e,H as i}from"./p-spEUIGXI.js";import{L as n}from"./p-sVi8GCz5.js";import{s as o}from"./p-BW_CkW1K.js";import{c as r}from"./p-vFMstSdt.js";const l=class{constructor(e){t(this,e),this.subscribeResource=s(this,"pod-os:resource",7),this.contents=[],this.loading=!0,this.createNewItem=null,this.disconnected$=new r.Subject,this.receiveResource=t=>{this.container=t.assume(n),this.loading=!1,this.container.observeContains().pipe(r.takeUntil(this.disconnected$)).subscribe((t=>this.contents=t.toSorted(((t,s)=>t.name.localeCompare(s.name)))))}}onCreateNewFile(){this.createNewItem="file"}onCreateNewFolder(){this.createNewItem="folder"}componentWillLoad(){o(this)}handleKeyDown(t){"Escape"===t.key&&(this.createNewItem=null)}render(){if(this.loading)return null;const t=this.contents.map((t=>e("li",{key:t.uri},e("pos-resource",{lazy:!0,uri:t.uri},e("pos-container-item",null,t.name)))));return null!==this.createNewItem&&t.unshift(e("li",{key:"new-item"},e("pos-create-new-container-item",{type:this.createNewItem,container:this.container}))),e(i,null,e("pos-container-toolbar",{"onPod-os:create-new-file":()=>this.onCreateNewFile(),"onPod-os:create-new-folder":()=>this.onCreateNewFolder()}),t.length>0?e("ul",{"aria-label":"Container contents"},t):e("p",null,"The container is empty"))}disconnectedCallback(){this.disconnected$.next(),this.disconnected$.complete()}};l.style="ul{list-style:none;padding:0;margin:0}li{padding:0;margin:0}";export{l as pos_container_contents}
@@ -1 +1 @@
1
- import{r as s,c as t,h as o,H as r,a as i}from"./p-spEUIGXI.js";import{u as a}from"./p-yVO4JQ9P.js";import"./p-Bz2zblgU.js";import{l as e}from"./p-BXBNVUZ5.js";import{u as n}from"./p-D0uCfr1-.js";const l=class{constructor(o){s(this,o),this.addedRelation=t(this,"pod-os:added-relation",7),this.error=t(this,"pod-os:error",7)}async componentWillLoad(){this.os=await n(this.el),this.resource=await a(this.el)}onTermSelected(s){this.valueInput.focus(),this.selectedTermUri=s.detail.uri}async save(){try{await this.os.addRelation(this.resource,this.selectedTermUri,this.currentValue);const s={predicate:this.selectedTermUri,label:e(this.selectedTermUri),uris:[this.currentValue]};this.addedRelation.emit(s),this.currentValue=""}catch(s){this.error.emit(s)}}render(){if(this.resource.editable)return o(r,null,o("sl-icon",{name:"plus-circle"}),o("pos-select-term",{placeholder:"Add relation","onPod-os:term-selected":s=>this.onTermSelected(s)}),o("input",{ref:s=>this.valueInput=s,type:"url","aria-label":"URI",placeholder:"",value:this.currentValue,onInput:s=>this.currentValue=s.target.value,onChange:()=>this.save()}))}get el(){return i(this)}};l.style=":host{display:flex;align-items:center;gap:0.2rem}input{padding:var(--size-2);background-color:transparent;color:var(--pos-normal-text-color);border:none}input:focus{outline:2px solid var(--pos-primary-color);background-color:var(--pos-input-background-color);transition:outline 0.1s, background-color 0.1s}";export{l as pos_add_relation}
1
+ import{r as s,c as t,h as o,H as r,a as i}from"./p-spEUIGXI.js";import{u as a}from"./p-yVO4JQ9P.js";import"./p-Bz2zblgU.js";import{l as e}from"./p-sVi8GCz5.js";import{u as n}from"./p-D0uCfr1-.js";const l=class{constructor(o){s(this,o),this.addedRelation=t(this,"pod-os:added-relation",7),this.error=t(this,"pod-os:error",7)}async componentWillLoad(){this.os=await n(this.el),this.resource=await a(this.el)}onTermSelected(s){this.valueInput.focus(),this.selectedTermUri=s.detail.uri}async save(){try{await this.os.addRelation(this.resource,this.selectedTermUri,this.currentValue);const s={predicate:this.selectedTermUri,label:e(this.selectedTermUri),uris:[this.currentValue]};this.addedRelation.emit(s),this.currentValue=""}catch(s){this.error.emit(s)}}render(){if(this.resource.editable)return o(r,null,o("sl-icon",{name:"plus-circle"}),o("pos-select-term",{placeholder:"Add relation","onPod-os:term-selected":s=>this.onTermSelected(s)}),o("input",{ref:s=>this.valueInput=s,type:"url","aria-label":"URI",placeholder:"",value:this.currentValue,onInput:s=>this.currentValue=s.target.value,onChange:()=>this.save()}))}get el(){return i(this)}};l.style=":host{display:flex;align-items:center;gap:0.2rem}input{padding:var(--size-2);background-color:transparent;color:var(--pos-normal-text-color);border:none}input:focus{outline:2px solid var(--pos-primary-color);background-color:var(--pos-input-background-color);transition:outline 0.1s, background-color 0.1s}";export{l as pos_add_relation}