@pod-os/elements 0.39.0 → 0.40.0-rc.0e71f55.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 (47) hide show
  1. package/dist/cjs/elements.cjs.js +1 -1
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/pos-add-new-thing_32.cjs.entry.js +21 -10
  4. package/dist/cjs/pos-markdown-document.cjs.entry.js +1 -1
  5. package/dist/cjs/pos-relations_2.cjs.entry.js +1 -1
  6. package/dist/cjs/pos-tool-attachments.cjs.entry.js +1 -1
  7. package/dist/collection/components/pos-login/pos-login.css +3 -0
  8. package/dist/collection/components/pos-login-form/pos-login-form.css +41 -0
  9. package/dist/collection/components/pos-login-form/pos-login-form.js +13 -2
  10. package/dist/collection/components/pos-markdown-document/pos-markdown-document.js +1 -1
  11. package/dist/collection/components/pos-navigation/bar/pos-navigation-bar.js +1 -1
  12. package/dist/collection/components/pos-navigation/pos-navigation.js +1 -1
  13. package/dist/collection/components/pos-new-thing-form/pos-new-thing-form.js +1 -1
  14. package/dist/collection/components/pos-relations/pos-relations.js +1 -1
  15. package/dist/collection/components/pos-router/pos-router.js +1 -1
  16. package/dist/collection/components/pos-select-term/pos-select-term.js +1 -1
  17. package/dist/collection/components/pos-share/pos-share.js +1 -1
  18. package/dist/collection/components/pos-upload/pos-upload.js +1 -1
  19. package/dist/collection/store/settings.js +2 -0
  20. package/dist/collection/tools/pos-tool-attachments/pos-tool-attachments.js +1 -1
  21. package/dist/components/pos-login-form2.js +1 -1
  22. package/dist/components/pos-login2.js +1 -1
  23. package/dist/components/pos-markdown-document2.js +1 -1
  24. package/dist/components/pos-navigation-bar2.js +1 -1
  25. package/dist/components/pos-navigation2.js +1 -1
  26. package/dist/components/pos-new-thing-form2.js +1 -1
  27. package/dist/components/pos-relations2.js +1 -1
  28. package/dist/components/pos-router2.js +1 -1
  29. package/dist/components/pos-select-term2.js +1 -1
  30. package/dist/components/pos-share2.js +1 -1
  31. package/dist/components/pos-tool-attachments.js +1 -1
  32. package/dist/components/pos-upload2.js +1 -1
  33. package/dist/components/settings.js +1 -1
  34. package/dist/elements/elements.esm.js +1 -1
  35. package/dist/elements/{p-ceeba057.entry.js → p-0febf76e.entry.js} +1 -1
  36. package/dist/elements/{p-1910fa2d.entry.js → p-57d32176.entry.js} +5 -5
  37. package/dist/elements/{p-780eb6aa.entry.js → p-c4034954.entry.js} +1 -1
  38. package/dist/elements/{p-80c897c2.entry.js → p-d6e9d178.entry.js} +1 -1
  39. package/dist/esm/elements.js +1 -1
  40. package/dist/esm/loader.js +1 -1
  41. package/dist/esm/pos-add-new-thing_32.entry.js +21 -10
  42. package/dist/esm/pos-markdown-document.entry.js +1 -1
  43. package/dist/esm/pos-relations_2.entry.js +1 -1
  44. package/dist/esm/pos-tool-attachments.entry.js +1 -1
  45. package/dist/types/components/pos-login-form/pos-login-form.d.ts +2 -0
  46. package/dist/types/store/settings.d.ts +1 -0
  47. package/package.json +5 -5
@@ -1 +1 @@
1
- import{proxyCustomElement as e,HTMLElement as o,createEvent as r,h as s,transformTag as t}from"@stencil/core/internal/client";import{d as a}from"./pos-label2.js";import{d as i}from"./pos-make-findable2.js";import{d as n}from"./pos-resource2.js";import{d as c}from"./pos-share2.js";const l=e(class extends o{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.navigate=r(this,"pod-os:navigate",7)}onClick(){this.navigate.emit(this.current)}activate(e){(e.ctrlKey||e.metaKey)&&"k"===e.key&&(e.preventDefault(),this.navigate.emit(this.current))}render(){const e=this.current?`${this.current.label()} (Click to search or enter URI)`:"Search or enter URI";return s("section",{key:"5f49aa9dad9d07550ee8ffbee90036cbc1efda55",class:"current"},this.current&&this.searchIndexReady&&s("pos-make-findable",{key:"85974a4772aaf8cad3a11cdcd49e6df10141bfe3",uri:this.current.uri}),s("button",{key:"40660a3455b0f3392c68d7aea0075b102a1762a2","aria-label":e,onClick:()=>this.onClick()},s("div",{key:"9ab8922175d701f714f72aefb95745cf5ae4bb95"},this.current?this.current.label():"Search or enter URI"),this.icon()),this.current&&s("pos-share",{key:"3b80c1987f9f5138b11b8a106171fc73a236f426",uri:this.current.uri}))}icon(){return s("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},s("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"}))}static get style(){return"section.current{display:flex;align-items:center;box-sizing:border-box;padding:0 var(--size-2) 0 0;height:var(--pos-navigation-bar-height);flex-grow:1;gap:0;background-color:var(--pos-input-background-color);border-radius:var(--radius-md);width:100%;&:focus-within{outline:var(--pos-input-focus-outline)}button{cursor:pointer;font-size:var(--scale-1);display:flex;align-items:center;justify-content:center;flex-grow:1;background:none;color:var(--pos-normal-text-color);outline:none;border:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;&:focus{text-decoration:underline}:first-child{flex-grow:1}svg{width:var(--size-6);color:var(--pos-subtle-text-color)}}pos-share{height:80%;&:hover{&::part(button){color:var(--pos-primary-color);background-color:var(--pos-border-color);border-radius:var(--radius-full)}}&::part(button){font-size:var(--size-4);background:none;outline:none;border:none;color:var(--pos-subtle-text-color)}}}"}},[1,"pos-navigation-bar",{current:[16],searchIndexReady:[4,"search-index-ready"]},[[4,"keydown","activate"]]]);function d(){"undefined"!=typeof customElements&&["pos-navigation-bar","pos-label","pos-make-findable","pos-resource","pos-share"].forEach((e=>{switch(e){case"pos-navigation-bar":customElements.get(t(e))||customElements.define(t(e),l);break;case"pos-label":customElements.get(t(e))||a();break;case"pos-make-findable":customElements.get(t(e))||i();break;case"pos-resource":customElements.get(t(e))||n();break;case"pos-share":customElements.get(t(e))||c()}}))}export{l as P,d}
1
+ import{proxyCustomElement as e,HTMLElement as o,createEvent as r,h as s,transformTag as t}from"@stencil/core/internal/client";import{d as a}from"./pos-label2.js";import{d as i}from"./pos-make-findable2.js";import{d as n}from"./pos-resource2.js";import{d as c}from"./pos-share2.js";const l=e(class extends o{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.navigate=r(this,"pod-os:navigate",7)}onClick(){this.navigate.emit(this.current)}activate(e){(e.ctrlKey||e.metaKey)&&"k"===e.key&&(e.preventDefault(),this.navigate.emit(this.current))}render(){const e=this.current?`${this.current.label()} (Click to search or enter URI)`:"Search or enter URI";return s("section",{key:"a66626042ab42e63094b7b27729f0c299d6e62a3",class:"current"},this.current&&this.searchIndexReady&&s("pos-make-findable",{key:"4e2e2e3271c4ed78c34e32e0a815a87dd9d73b52",uri:this.current.uri}),s("button",{key:"5ff874354f32f9fef4b15337ce7230c43df0c0ca","aria-label":e,onClick:()=>this.onClick()},s("div",{key:"d00d82f397fb9f3ede61484d6cc2ae74ef92fd06"},this.current?this.current.label():"Search or enter URI"),this.icon()),this.current&&s("pos-share",{key:"a86d78b83dedc4f7cc77170f96c973fe21ded57d",uri:this.current.uri}))}icon(){return s("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},s("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"}))}static get style(){return"section.current{display:flex;align-items:center;box-sizing:border-box;padding:0 var(--size-2) 0 0;height:var(--pos-navigation-bar-height);flex-grow:1;gap:0;background-color:var(--pos-input-background-color);border-radius:var(--radius-md);width:100%;&:focus-within{outline:var(--pos-input-focus-outline)}button{cursor:pointer;font-size:var(--scale-1);display:flex;align-items:center;justify-content:center;flex-grow:1;background:none;color:var(--pos-normal-text-color);outline:none;border:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;&:focus{text-decoration:underline}:first-child{flex-grow:1}svg{width:var(--size-6);color:var(--pos-subtle-text-color)}}pos-share{height:80%;&:hover{&::part(button){color:var(--pos-primary-color);background-color:var(--pos-border-color);border-radius:var(--radius-full)}}&::part(button){font-size:var(--size-4);background:none;outline:none;border:none;color:var(--pos-subtle-text-color)}}}"}},[1,"pos-navigation-bar",{current:[16],searchIndexReady:[4,"search-index-ready"]},[[4,"keydown","activate"]]]);function d(){"undefined"!=typeof customElements&&["pos-navigation-bar","pos-label","pos-make-findable","pos-resource","pos-share"].forEach((e=>{switch(e){case"pos-navigation-bar":customElements.get(t(e))||customElements.define(t(e),l);break;case"pos-label":customElements.get(t(e))||a();break;case"pos-make-findable":customElements.get(t(e))||i();break;case"pos-resource":customElements.get(t(e))||n();break;case"pos-share":customElements.get(t(e))||c()}}))}export{l as P,d}
@@ -1 +1 @@
1
- import{proxyCustomElement as o,HTMLElement as s,createEvent as i,h as e,transformTag as t}from"@stencil/core/internal/client";import{c as a}from"./index3.js";import{s as r}from"./session.js";import{s as n}from"./PodOsAware.js";import{d as l}from"./pos-description2.js";import{d}from"./pos-label2.js";import{d as c}from"./pos-make-findable2.js";import{d as h}from"./pos-navigation-bar2.js";import{d as p}from"./pos-resource2.js";import{d as u}from"./pos-rich-link2.js";import{d as m}from"./pos-share2.js";const g=o(class extends s{constructor(o){super(),!1!==o&&this.__registerHost(),this.__attachShadow(),this.subscribePodOs=i(this,"pod-os:init",7),this.linkEmitter=i(this,"pod-os:link",7),this.uri="",this.inputValue=this.uri,this.searchIndex=void 0,this.suggestions=[],this.selectedIndex=-1,this.resource=null,this.changeEvents=new a.Subject,this.debouncedSearch=null,this.receivePodOs=async o=>{this.os=o}}updateResource(){var o;try{this.resource=this.uri?null===(o=this.os)||void 0===o?void 0:o.store.get(this.uri):null}catch(o){this.resource=null}}componentWillLoad(){n(this),this.updateResource(),r.onChange("isLoggedIn",(async o=>{o?await this.buildSearchIndex():this.clearSearchIndex()})),this.debouncedSearch=this.changeEvents.pipe(a.debounceTime(300)).subscribe((()=>this.search()))}disconnectedCallback(){var o;null===(o=this.debouncedSearch)||void 0===o||o.unsubscribe()}async buildSearchIndex(){this.searchIndex=await this.os.buildSearchIndex(r.state.profile)}rebuildSearchIndex(){this.searchIndex.rebuild()}openNavigationDialog(o){var s,i;this.resource=o.detail,o.detail&&(this.inputValue=o.detail.uri,this.search()),null===(s=this.inputRef)||void 0===s||s.select(),null===(i=this.dialogRef)||void 0===i||i.show()}clearSearchIndex(){var o;null===(o=this.searchIndex)||void 0===o||o.clear()}onChange(o){this.inputValue=o.target.value,this.changeEvents.next()}closeDialog(){var o;null===(o=this.dialogRef)||void 0===o||o.close(),this.selectedIndex=-1}clearSuggestions(){var o;this.suggestions=[],null===(o=this.dialogRef)||void 0===o||o.close(),this.selectedIndex=-1}onClickSelf(o){o.stopPropagation()}handleKeyDown(o){"Escape"===o.key?this.closeDialog():"ArrowDown"===o.key?(o.preventDefault(),this.selectedIndex=Math.min(this.selectedIndex+1,this.suggestions.length-1)):"ArrowUp"===o.key&&(o.preventDefault(),this.selectedIndex=Math.max(this.selectedIndex-1,0))}search(){this.searchIndex&&(this.suggestions=this.inputValue?this.searchIndex.search(this.inputValue):[])}onSubmit(){this.linkEmitter.emit(this.suggestions&&this.selectedIndex>-1?this.suggestions[this.selectedIndex].ref:this.inputValue)}render(){return e("nav",{key:"d5ad4841674cf172e9401a63fc50e58900ca5b1f"},e("search",{key:"8daf86774c49234d10637160fd983681ac483b44"},e("pos-navigation-bar",{key:"200137643dbc0aa1f120c231dc70a0d3f71b596a",searchIndexReady:void 0!==this.searchIndex,current:this.resource}),e("dialog",{key:"f2fb1d3e4a38d17efb6bd80ca791e8a30fafab66",ref:o=>this.dialogRef=o},e("form",{key:"e54698d8fb968a5ee6007cc4d5644fec36bf74f3",method:"dialog",onSubmit:()=>this.onSubmit()},e("input",{key:"633a4030c6296b5c94e2661bd73168afc1e04438",ref:o=>this.inputRef=o,enterkeyhint:"search","aria-label":"Search or enter URI",placeholder:"Search or enter URI",value:this.uri,onChange:o=>this.onChange(o),onInput:o=>this.onChange(o),role:"combobox","aria-autocomplete":"list","aria-expanded":this.suggestions.length>0,"aria-controls":"suggestions-list","aria-activedescendant":this.selectedIndex>=0?`option-${this.selectedIndex}`:null}),this.suggestions.length>0?e("div",{class:"suggestions"},e("ol",{id:"suggestions-list",role:"listbox","aria-label":"Search results"},this.suggestions.map(((o,s)=>e("li",{id:`option-${s}`,role:"option","aria-selected":s===this.selectedIndex?"true":"false"},e("pos-rich-link",{uri:o.ref})))))):null))))}static get watchers(){return{uri:[{updateResource:0}],os:[{updateResource:0}]}}static get style(){return":host{--pos-navigation-bar-height:var(--size-10)}search{position:relative}.suggestions ol{border:1px solid var(--pos-border-color);display:flex;flex-direction:column;margin:0;padding:0;list-style-type:none}.suggestions{width:100%;overflow-y:auto;max-height:90dvh;li{padding:1rem;background-color:var(--pos-background-color);pos-rich-link{--background-color:inherit}&[aria-selected='true']{background-color:var(--pos-primary-color);&:hover{background-color:var(--pos-primary-color)}}&:hover{background-color:var(--pos-border-color)}}}.suggestions li.selected pos-rich-link{--label-color:white;--description-color:var(--pos-border-color);--uri-color:var(--pos-subtle-text-color)}dialog{position:absolute;margin-top:calc(-1 * var(--pos-navigation-bar-height));padding:0;width:100%;max-width:100%;min-width:100%;overflow:hidden;max-height:100dvh;background-color:var(--pos-background-color);color:var(--pos-normal-text-color);border:var(--pos-border-color);border-radius:var(--radius-md);box-shadow:var(--shadow-md);form{display:flex;flex-direction:column;height:100%;width:100%;align-items:center;input{display:flex;font-size:var(--scale-1);height:var(--pos-navigation-bar-height);border-top-left-radius:var(--radius-md);border-top-right-radius:var(--radius-md);padding-left:var(--size-2);width:100%;border:none;outline:none;color:var(--pos-normal-text-color);background-color:var(--pos-input-background-color);box-sizing:border-box}}}dialog[open]{display:flex;z-index:var(--layer-top);animation:slideIn 100ms ease-out}@media (max-width: 640px){search{position:unset}dialog{margin-top:var(--size-1);top:0;width:95dvw;max-width:unset;min-width:unset;form{input{height:var(--size-12);font-size:var(--scale-fluid-3)}}}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}"}},[1,"pos-navigation",{uri:[1],os:[32],inputValue:[32],searchIndex:[32],suggestions:[32],selectedIndex:[32],resource:[32]},[[0,"pod-os:search:index-created","buildSearchIndex"],[0,"pod-os:search:index-updated","rebuildSearchIndex"],[0,"pod-os:navigate","openNavigationDialog"],[4,"click","closeDialog"],[0,"pod-os:link","clearSuggestions"],[0,"click","onClickSelf"],[0,"keydown","handleKeyDown"]],{uri:[{updateResource:0}],os:[{updateResource:0}]}]);function b(){"undefined"!=typeof customElements&&["pos-navigation","pos-description","pos-label","pos-make-findable","pos-navigation-bar","pos-resource","pos-rich-link","pos-share"].forEach((o=>{switch(o){case"pos-navigation":customElements.get(t(o))||customElements.define(t(o),g);break;case"pos-description":customElements.get(t(o))||l();break;case"pos-label":customElements.get(t(o))||d();break;case"pos-make-findable":customElements.get(t(o))||c();break;case"pos-navigation-bar":customElements.get(t(o))||h();break;case"pos-resource":customElements.get(t(o))||p();break;case"pos-rich-link":customElements.get(t(o))||u();break;case"pos-share":customElements.get(t(o))||m()}}))}export{g as P,b as d}
1
+ import{proxyCustomElement as o,HTMLElement as e,createEvent as s,h as i,transformTag as a}from"@stencil/core/internal/client";import{c as t}from"./index3.js";import{s as r}from"./session.js";import{s as n}from"./PodOsAware.js";import{d as l}from"./pos-description2.js";import{d}from"./pos-label2.js";import{d as c}from"./pos-make-findable2.js";import{d as h}from"./pos-navigation-bar2.js";import{d as p}from"./pos-resource2.js";import{d as u}from"./pos-rich-link2.js";import{d as m}from"./pos-share2.js";const g=o(class extends e{constructor(o){super(),!1!==o&&this.__registerHost(),this.__attachShadow(),this.subscribePodOs=s(this,"pod-os:init",7),this.linkEmitter=s(this,"pod-os:link",7),this.uri="",this.inputValue=this.uri,this.searchIndex=void 0,this.suggestions=[],this.selectedIndex=-1,this.resource=null,this.changeEvents=new t.Subject,this.debouncedSearch=null,this.receivePodOs=async o=>{this.os=o}}updateResource(){var o;try{this.resource=this.uri?null===(o=this.os)||void 0===o?void 0:o.store.get(this.uri):null}catch(o){this.resource=null}}componentWillLoad(){n(this),this.updateResource(),r.onChange("isLoggedIn",(async o=>{o?await this.buildSearchIndex():this.clearSearchIndex()})),this.debouncedSearch=this.changeEvents.pipe(t.debounceTime(300)).subscribe((()=>this.search()))}disconnectedCallback(){var o;null===(o=this.debouncedSearch)||void 0===o||o.unsubscribe()}async buildSearchIndex(){this.searchIndex=await this.os.buildSearchIndex(r.state.profile)}rebuildSearchIndex(){this.searchIndex.rebuild()}openNavigationDialog(o){var e,s;this.resource=o.detail,o.detail&&(this.inputValue=o.detail.uri,this.search()),null===(e=this.inputRef)||void 0===e||e.select(),null===(s=this.dialogRef)||void 0===s||s.show()}clearSearchIndex(){var o;null===(o=this.searchIndex)||void 0===o||o.clear()}onChange(o){this.inputValue=o.target.value,this.changeEvents.next()}closeDialog(){var o;null===(o=this.dialogRef)||void 0===o||o.close(),this.selectedIndex=-1}clearSuggestions(){var o;this.suggestions=[],null===(o=this.dialogRef)||void 0===o||o.close(),this.selectedIndex=-1}onClickSelf(o){o.stopPropagation()}handleKeyDown(o){"Escape"===o.key?this.closeDialog():"ArrowDown"===o.key?(o.preventDefault(),this.selectedIndex=Math.min(this.selectedIndex+1,this.suggestions.length-1)):"ArrowUp"===o.key&&(o.preventDefault(),this.selectedIndex=Math.max(this.selectedIndex-1,0))}search(){this.searchIndex&&(this.suggestions=this.inputValue?this.searchIndex.search(this.inputValue):[])}onSubmit(){this.linkEmitter.emit(this.suggestions&&this.selectedIndex>-1?this.suggestions[this.selectedIndex].ref:this.inputValue)}render(){return i("nav",{key:"44f504f9a905c6e63353741cda554a6a35a46f82"},i("search",{key:"98e7cae9729db2959d992f9e41a4cc99064b9eb0"},i("pos-navigation-bar",{key:"c0ce90fcc8334d0ea784ca3126a1524b036631ac",searchIndexReady:void 0!==this.searchIndex,current:this.resource}),i("dialog",{key:"a9b1418ad48ae298fbd8eaa56e62eb613e8deef6",ref:o=>this.dialogRef=o},i("form",{key:"a75933116bd844e0afc4e94eee713adb6d6bb4ea",method:"dialog",onSubmit:()=>this.onSubmit()},i("input",{key:"c6de46f82392acf3752e51e64dc6e5526f8d6a04",ref:o=>this.inputRef=o,enterkeyhint:"search","aria-label":"Search or enter URI",placeholder:"Search or enter URI",value:this.uri,onChange:o=>this.onChange(o),onInput:o=>this.onChange(o),role:"combobox","aria-autocomplete":"list","aria-expanded":this.suggestions.length>0,"aria-controls":"suggestions-list","aria-activedescendant":this.selectedIndex>=0?`option-${this.selectedIndex}`:null}),this.suggestions.length>0?i("div",{class:"suggestions"},i("ol",{id:"suggestions-list",role:"listbox","aria-label":"Search results"},this.suggestions.map(((o,e)=>i("li",{id:`option-${e}`,role:"option","aria-selected":e===this.selectedIndex?"true":"false"},i("pos-rich-link",{uri:o.ref})))))):null))))}static get watchers(){return{uri:[{updateResource:0}],os:[{updateResource:0}]}}static get style(){return":host{--pos-navigation-bar-height:var(--size-10)}search{position:relative}.suggestions ol{border:1px solid var(--pos-border-color);display:flex;flex-direction:column;margin:0;padding:0;list-style-type:none}.suggestions{width:100%;overflow-y:auto;max-height:90dvh;li{padding:1rem;background-color:var(--pos-background-color);pos-rich-link{--background-color:inherit}&[aria-selected='true']{background-color:var(--pos-primary-color);&:hover{background-color:var(--pos-primary-color)}}&:hover{background-color:var(--pos-border-color)}}}.suggestions li.selected pos-rich-link{--label-color:white;--description-color:var(--pos-border-color);--uri-color:var(--pos-subtle-text-color)}dialog{position:absolute;margin-top:calc(-1 * var(--pos-navigation-bar-height));padding:0;width:100%;max-width:100%;min-width:100%;overflow:hidden;max-height:100dvh;background-color:var(--pos-background-color);color:var(--pos-normal-text-color);border:var(--pos-border-color);border-radius:var(--radius-md);box-shadow:var(--shadow-md);form{display:flex;flex-direction:column;height:100%;width:100%;align-items:center;input{display:flex;font-size:var(--scale-1);height:var(--pos-navigation-bar-height);border-top-left-radius:var(--radius-md);border-top-right-radius:var(--radius-md);padding-left:var(--size-2);width:100%;border:none;outline:none;color:var(--pos-normal-text-color);background-color:var(--pos-input-background-color);box-sizing:border-box}}}dialog[open]{display:flex;z-index:var(--layer-top);animation:slideIn 100ms ease-out}@media (max-width: 640px){search{position:unset}dialog{margin-top:var(--size-1);top:0;width:95dvw;max-width:unset;min-width:unset;form{input{height:var(--size-12);font-size:var(--scale-fluid-3)}}}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}"}},[1,"pos-navigation",{uri:[1],os:[32],inputValue:[32],searchIndex:[32],suggestions:[32],selectedIndex:[32],resource:[32]},[[0,"pod-os:search:index-created","buildSearchIndex"],[0,"pod-os:search:index-updated","rebuildSearchIndex"],[0,"pod-os:navigate","openNavigationDialog"],[4,"click","closeDialog"],[0,"pod-os:link","clearSuggestions"],[0,"click","onClickSelf"],[0,"keydown","handleKeyDown"]],{uri:[{updateResource:0}],os:[{updateResource:0}]}]);function b(){"undefined"!=typeof customElements&&["pos-navigation","pos-description","pos-label","pos-make-findable","pos-navigation-bar","pos-resource","pos-rich-link","pos-share"].forEach((o=>{switch(o){case"pos-navigation":customElements.get(a(o))||customElements.define(a(o),g);break;case"pos-description":customElements.get(a(o))||l();break;case"pos-label":customElements.get(a(o))||d();break;case"pos-make-findable":customElements.get(a(o))||c();break;case"pos-navigation-bar":customElements.get(a(o))||h();break;case"pos-resource":customElements.get(a(o))||p();break;case"pos-rich-link":customElements.get(a(o))||u();break;case"pos-share":customElements.get(a(o))||m()}}))}export{g as P,b as d}
@@ -1 +1 @@
1
- import{proxyCustomElement as e,HTMLElement as t,createEvent as s,h as i,transformTag as o}from"@stencil/core/internal/client";import{s as r}from"./PodOsAware.js";import{d as a}from"./pos-select-term2.js";const n=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.linkEmitter=s(this,"pod-os:link",7),this.errorEmitter=s(this,"pod-os:error",7),this.subscribePodOs=s(this,"pod-os:init",7),this.canSubmit=!1,this.receivePodOs=async e=>{this.os=e}}validate(){this.canSubmit=Boolean(this.name&&this.selectedTypeUri)}componentWillLoad(){r(this)}render(){return i("form",{key:"64781cfb0e570d2368325d674c6637c581bb87c2",method:"dialog",onSubmit:e=>this.handleSubmit(e)},i("label",{key:"409e04f147430042eb334024fc7061574ab543cf",htmlFor:"type"},"Type"),i("pos-select-term",{key:"8d5d580ee1f1e2e2c60cac0cc06798e94a0d28c3",id:"type",placeholder:"",value:this.selectedTypeUri,"onPod-os:term-selected":e=>this.onTermSelected(e)}),i("label",{key:"a45199618751e24b7d4a1bc13ad85c599cc93d1c",htmlFor:"name"},"Name"),i("input",{key:"bee3be7a680abbffc08caa5c549b68b1e653872d",id:"name",type:"text",value:this.name,onInput:e=>this.handleChange(e)}),this.newUri?i("div",{id:"new-uri",title:"This will be the URI of the new thing"},this.newUri):null,i("input",{key:"e8fab4d442188f7f2f325ff7bde3dce6d3f772f6",id:"create",type:"submit",value:"Create",disabled:!this.canSubmit}))}handleChange(e){this.name=e.target.value,this.newUri=this.os.proposeUriForNewThing(this.referenceUri,this.name)}onTermSelected(e){this.selectedTypeUri=e.detail.uri}async handleSubmit(e){try{await this.os.addNewThing(this.newUri,this.name,this.selectedTypeUri),this.linkEmitter.emit(this.newUri),this.reset()}catch(t){e.preventDefault(),this.errorEmitter.emit(t)}}reset(){this.name="",this.newUri="",this.selectedTypeUri=""}static get delegatesFocus(){return!0}static get watchers(){return{name:[{validate:0}],selectedTypeUri:[{validate:0}]}}static get style(){return":host{display:block}form{display:grid;grid-template-columns:var(--size-16) 1fr;grid-gap:var(--scale-0)}label{grid-column:1 / 2;display:flex;align-items:center;justify-content:flex-end}input,pos-select-term,button{grid-column:2 / 3}input,pos-select-term::part(input){outline:var(--pos-input-outline);padding:var(--scale-000);border:none;border-radius:var(--radius-xs);width:var(--size-full);box-sizing:border-box;background:var(--pos-input-background-color);color:var(--pos-normal-text-color)}input:focus-within,pos-select-term::part(input):focus-within{outline:var(--pos-input-focus-outline)}#new-uri{grid-column:1/3;cursor:default;word-break:break-all;color:var(--pos-normal-text-color);font-weight:var(--weight-light);background:var(--pos-disabled-color);padding:var(--scale-000);border-radius:var(--radius-xs)}input#create{outline:none;box-shadow:var(--shadow-sm);cursor:pointer;color:var(--pos-primary-text-color);background-color:var(--pos-primary-color)}input#create:disabled{cursor:default;color:var(--pos-disabled-text-color);background-color:var(--pos-disabled-color);box-shadow:none}input#create:hover:not(:disabled),input#create:focus{filter:brightness(110%);box-shadow:var(--shadow-md)}"}},[17,"pos-new-thing-form",{referenceUri:[1,"reference-uri"],os:[32],newUri:[32],name:[32],selectedTypeUri:[32],canSubmit:[32]},void 0,{name:[{validate:0}],selectedTypeUri:[{validate:0}]}]);function c(){"undefined"!=typeof customElements&&["pos-new-thing-form","pos-select-term"].forEach((e=>{switch(e){case"pos-new-thing-form":customElements.get(o(e))||customElements.define(o(e),n);break;case"pos-select-term":customElements.get(o(e))||a()}}))}export{n as P,c as d}
1
+ import{proxyCustomElement as e,HTMLElement as t,createEvent as s,h as i,transformTag as o}from"@stencil/core/internal/client";import{s as r}from"./PodOsAware.js";import{d as a}from"./pos-select-term2.js";const d=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.linkEmitter=s(this,"pod-os:link",7),this.errorEmitter=s(this,"pod-os:error",7),this.subscribePodOs=s(this,"pod-os:init",7),this.canSubmit=!1,this.receivePodOs=async e=>{this.os=e}}validate(){this.canSubmit=Boolean(this.name&&this.selectedTypeUri)}componentWillLoad(){r(this)}render(){return i("form",{key:"4926181b537caafb59e07a22a1ad57b321d85db7",method:"dialog",onSubmit:e=>this.handleSubmit(e)},i("label",{key:"a1a22fe893a3b963c93d8963345b266987fd2f4b",htmlFor:"type"},"Type"),i("pos-select-term",{key:"549dd0e431534ba1320049ef47bdb2e2efd2d49e",id:"type",placeholder:"",value:this.selectedTypeUri,"onPod-os:term-selected":e=>this.onTermSelected(e)}),i("label",{key:"5cf8edca5189307fdd2adc2c0035115b51a0b2fd",htmlFor:"name"},"Name"),i("input",{key:"ea4d4c78016cda1c546fd6aa3addfdedd453c1e2",id:"name",type:"text",value:this.name,onInput:e=>this.handleChange(e)}),this.newUri?i("div",{id:"new-uri",title:"This will be the URI of the new thing"},this.newUri):null,i("input",{key:"95da60988cc9ef920add0bd1d5531d234a92372e",id:"create",type:"submit",value:"Create",disabled:!this.canSubmit}))}handleChange(e){this.name=e.target.value,this.newUri=this.os.proposeUriForNewThing(this.referenceUri,this.name)}onTermSelected(e){this.selectedTypeUri=e.detail.uri}async handleSubmit(e){try{await this.os.addNewThing(this.newUri,this.name,this.selectedTypeUri),this.linkEmitter.emit(this.newUri),this.reset()}catch(t){e.preventDefault(),this.errorEmitter.emit(t)}}reset(){this.name="",this.newUri="",this.selectedTypeUri=""}static get delegatesFocus(){return!0}static get watchers(){return{name:[{validate:0}],selectedTypeUri:[{validate:0}]}}static get style(){return":host{display:block}form{display:grid;grid-template-columns:var(--size-16) 1fr;grid-gap:var(--scale-0)}label{grid-column:1 / 2;display:flex;align-items:center;justify-content:flex-end}input,pos-select-term,button{grid-column:2 / 3}input,pos-select-term::part(input){outline:var(--pos-input-outline);padding:var(--scale-000);border:none;border-radius:var(--radius-xs);width:var(--size-full);box-sizing:border-box;background:var(--pos-input-background-color);color:var(--pos-normal-text-color)}input:focus-within,pos-select-term::part(input):focus-within{outline:var(--pos-input-focus-outline)}#new-uri{grid-column:1/3;cursor:default;word-break:break-all;color:var(--pos-normal-text-color);font-weight:var(--weight-light);background:var(--pos-disabled-color);padding:var(--scale-000);border-radius:var(--radius-xs)}input#create{outline:none;box-shadow:var(--shadow-sm);cursor:pointer;color:var(--pos-primary-text-color);background-color:var(--pos-primary-color)}input#create:disabled{cursor:default;color:var(--pos-disabled-text-color);background-color:var(--pos-disabled-color);box-shadow:none}input#create:hover:not(:disabled),input#create:focus{filter:brightness(110%);box-shadow:var(--shadow-md)}"}},[17,"pos-new-thing-form",{referenceUri:[1,"reference-uri"],os:[32],newUri:[32],name:[32],selectedTypeUri:[32],canSubmit:[32]},void 0,{name:[{validate:0}],selectedTypeUri:[{validate:0}]}]);function n(){"undefined"!=typeof customElements&&["pos-new-thing-form","pos-select-term"].forEach((e=>{switch(e){case"pos-new-thing-form":customElements.get(o(e))||customElements.define(o(e),d);break;case"pos-select-term":customElements.get(o(e))||a()}}))}export{d as P,n as d}
@@ -1 +1 @@
1
- import{proxyCustomElement as e,HTMLElement as o,createEvent as s,h as r,Host as a,transformTag as c}from"@stencil/core/internal/client";import{s as t}from"./ResourceAware.js";import{d as i}from"./pos-add-relation2.js";import{d as l}from"./pos-description2.js";import{d}from"./pos-label2.js";import{d as n}from"./pos-predicate2.js";import{d as p}from"./pos-resource2.js";import{d as m}from"./pos-rich-link2.js";import{d as u}from"./pos-select-term2.js";const b=e(class extends o{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.subscribeResource=s(this,"pod-os:resource",7),this.data=[],this.receiveResource=e=>{this.data=e.relations()}}componentWillLoad(){t(this)}relationAdded(e){const o=this.data.find((o=>o.predicate===e.predicate));this.data=o?this.data.map((s=>s.predicate===o.predicate?{predicate:o.predicate,label:o.label,uris:[...o.uris,...e.uris]}:s)):[...this.data,e]}render(){const e=this.data.map((e=>r("div",{class:"predicate-values"},r("dt",null,r("pos-predicate",{uri:e.predicate,label:e.label})),r("div",{class:"values"},e.uris.map((e=>r("dd",null,r("pos-rich-link",{uri:e}))))))));return r(a,{key:"e5b836c6e70ff59cce961eea0844dae97f92a338"},this.data.length>0?r("dl",null,e):null,r("pos-add-relation",{key:"c59a7ce4cd4dc3861d16b81b5a385beb4dbb65d7","onPod-os:added-relation":e=>this.relationAdded(e.detail)}))}static get style(){return":host{--background-base-color:color-mix(in srgb, var(--pos-background-color), var(--color-grey-800) 10%);--background-color-even:hsl(from var(--background-base-color) h s calc(l + 7));--background-color-odd:hsl(from var(--background-base-color) h s calc(l + 10));--border-color:var(--background-base-color)}dd{padding:0;margin:0}dl{display:flex;flex-direction:column;gap:var(--size-1);padding:0;margin:0}dt{margin-bottom:var(--size-1)}.predicate-values:nth-child(odd){background-color:var(--background-color-odd)}.predicate-values:nth-child(even){background-color:var(--background-color-even)}.predicate-values{display:flex;flex-direction:column;border:var(--size-px) solid var(--border-color);padding:var(--size-2);gap:var(--size-1);.values{display:flex;flex-direction:column;gap:var(--size-3)}}pos-rich-link{--background-color:inherit}"}},[1,"pos-relations",{data:[32]}]);function h(){"undefined"!=typeof customElements&&["pos-relations","pos-add-relation","pos-description","pos-label","pos-predicate","pos-resource","pos-rich-link","pos-select-term"].forEach((e=>{switch(e){case"pos-relations":customElements.get(c(e))||customElements.define(c(e),b);break;case"pos-add-relation":customElements.get(c(e))||i();break;case"pos-description":customElements.get(c(e))||l();break;case"pos-label":customElements.get(c(e))||d();break;case"pos-predicate":customElements.get(c(e))||n();break;case"pos-resource":customElements.get(c(e))||p();break;case"pos-rich-link":customElements.get(c(e))||m();break;case"pos-select-term":customElements.get(c(e))||u()}}))}export{b as P,h as d}
1
+ import{proxyCustomElement as e,HTMLElement as o,createEvent as s,h as r,Host as a,transformTag as t}from"@stencil/core/internal/client";import{s as c}from"./ResourceAware.js";import{d as i}from"./pos-add-relation2.js";import{d as l}from"./pos-description2.js";import{d}from"./pos-label2.js";import{d as n}from"./pos-predicate2.js";import{d as p}from"./pos-resource2.js";import{d as m}from"./pos-rich-link2.js";import{d as u}from"./pos-select-term2.js";const b=e(class extends o{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.subscribeResource=s(this,"pod-os:resource",7),this.data=[],this.receiveResource=e=>{this.data=e.relations()}}componentWillLoad(){c(this)}relationAdded(e){const o=this.data.find((o=>o.predicate===e.predicate));this.data=o?this.data.map((s=>s.predicate===o.predicate?{predicate:o.predicate,label:o.label,uris:[...o.uris,...e.uris]}:s)):[...this.data,e]}render(){const e=this.data.map((e=>r("div",{class:"predicate-values"},r("dt",null,r("pos-predicate",{uri:e.predicate,label:e.label})),r("div",{class:"values"},e.uris.map((e=>r("dd",null,r("pos-rich-link",{uri:e}))))))));return r(a,{key:"90d62fb25fa7de819e041ddacf101cb962a425f7"},this.data.length>0?r("dl",null,e):null,r("pos-add-relation",{key:"ef4342b879e69aa2a23d3bd597434e606c31081a","onPod-os:added-relation":e=>this.relationAdded(e.detail)}))}static get style(){return":host{--background-base-color:color-mix(in srgb, var(--pos-background-color), var(--color-grey-800) 10%);--background-color-even:hsl(from var(--background-base-color) h s calc(l + 7));--background-color-odd:hsl(from var(--background-base-color) h s calc(l + 10));--border-color:var(--background-base-color)}dd{padding:0;margin:0}dl{display:flex;flex-direction:column;gap:var(--size-1);padding:0;margin:0}dt{margin-bottom:var(--size-1)}.predicate-values:nth-child(odd){background-color:var(--background-color-odd)}.predicate-values:nth-child(even){background-color:var(--background-color-even)}.predicate-values{display:flex;flex-direction:column;border:var(--size-px) solid var(--border-color);padding:var(--size-2);gap:var(--size-1);.values{display:flex;flex-direction:column;gap:var(--size-3)}}pos-rich-link{--background-color:inherit}"}},[1,"pos-relations",{data:[32]}]);function h(){"undefined"!=typeof customElements&&["pos-relations","pos-add-relation","pos-description","pos-label","pos-predicate","pos-resource","pos-rich-link","pos-select-term"].forEach((e=>{switch(e){case"pos-relations":customElements.get(t(e))||customElements.define(t(e),b);break;case"pos-add-relation":customElements.get(t(e))||i();break;case"pos-description":customElements.get(t(e))||l();break;case"pos-label":customElements.get(t(e))||d();break;case"pos-predicate":customElements.get(t(e))||n();break;case"pos-resource":customElements.get(t(e))||p();break;case"pos-rich-link":customElements.get(t(e))||m();break;case"pos-select-term":customElements.get(t(e))||u()}}))}export{b as P,h as d}
@@ -1 +1 @@
1
- import{getRenderingRef as e,forceUpdate as t,proxyCustomElement as n,HTMLElement as s,createEvent as o,h as r,transformTag as i}from"@stencil/core/internal/client";const c=e=>!("isConnected"in e)||e.isConnected,u=(()=>{let e;return(...t)=>{e&&clearTimeout(e),e=setTimeout((()=>{e=0,(e=>{for(let t of e.keys())e.set(t,e.get(t).filter(c))})(...t)}),2e3)}})(),a=(e,t)=>{if("string"==typeof t){if(t===e)return{}}else if("function"==typeof t){const n=t(e);if(n)return!0===n?{}:{...n}}else{const n=t.exec(e);if(n)return t.lastIndex=0,{...n}}},l=e=>e.pathname.toLowerCase(),d=(()=>{const n=window,s=new URL(n.location.href),o=l,{state:r,onChange:i,dispose:c}=((n,s)=>{const o=((e,t=(e,t)=>e!==t)=>{let n=new Map(Object.entries(null!=e?e:{}));const s={dispose:[],get:[],set:[],reset:[]},o=()=>{n=new Map(Object.entries(null!=e?e:{})),s.reset.forEach((e=>e()))},r=e=>(s.get.forEach((t=>t(e))),n.get(e)),i=(e,o)=>{const r=n.get(e);t(o,r,e)&&(n.set(e,o),s.set.forEach((t=>t(e,o,r))))},c="undefined"==typeof Proxy?{}:new Proxy(e,{get:(e,t)=>r(t),ownKeys:()=>Array.from(n.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(e,t)=>n.has(t),set:(e,t,n)=>(i(t,n),!0)}),u=(e,t)=>(s[e].push(t),()=>{((e,t)=>{const n=e.indexOf(t);n>=0&&(e[n]=e[e.length-1],e.length--)})(s[e],t)});return{state:c,get:r,set:i,on:u,onChange:(t,n)=>{const s=u("set",((e,s)=>{e===t&&n(s)})),o=u("reset",(()=>n(e[t])));return()=>{s(),o()}},use:(...e)=>{const t=e.reduce(((e,t)=>(t.set&&e.push(u("set",t.set)),t.get&&e.push(u("get",t.get)),t.reset&&e.push(u("reset",t.reset)),t.dispose&&e.push(u("dispose",t.dispose)),e)),[]);return()=>t.forEach((e=>e()))},dispose:()=>{s.dispose.forEach((e=>e())),o()},reset:o,forceUpdate:e=>{const t=n.get(e);s.set.forEach((n=>n(e,t,t)))}}})(n,s);return o.use((()=>{if("function"!=typeof e)return{};const n=new Map;return{dispose:()=>n.clear(),get:t=>{const s=e();s&&((e,t,n)=>{const s=e.get(t);s?s.includes(n)||s.push(n):e.set(t,[n])})(n,t,s)},set:e=>{const s=n.get(e);s&&n.set(e,s.filter(t)),u(n)},reset:()=>{n.forEach((e=>e.forEach(t))),u(n)}}})()),o})({url:s,activePath:o(s)},((e,t,n)=>"url"===n?e.href!==t.href:e!==t)),d=e=>{history.pushState(null,null,e);const t=new URL(e,document.baseURI);r.url=t,r.activePath=o(t)},p=e=>{const{activePath:t}=r;for(let n of e){const s=a(t,n.path);if(s){if(null!=n.to){const s="string"==typeof n.to?n.to:n.to(t);return d(s),p(e)}return{params:s,route:n}}}},f=()=>{const e=new URL(n.location.href);r.url=e,r.activePath=o(e)},h={Switch:(e,t)=>{const n=p(t);if(n)return"function"==typeof n.route.jsx?n.route.jsx(n.params):n.route.jsx},get url(){return r.url},get activePath(){return r.activePath},push:d,onChange:i,dispose:()=>{n.removeEventListener("popstate",f),c()}};return f(),n.addEventListener("popstate",f),h})(),p=n(class extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.routeChanged=o(this,"pod-os:route-changed",7),this.mode="standalone"}linkClicked(e){this.navigate(e.detail)}sessionRestored(e){d.push(e.detail.url)}componentWillLoad(){this.updateUri(),d.onChange("url",(()=>{this.updateUri()}))}navigate(e){d.push("?uri="+encodeURIComponent(e))}updateUri(){this.uri=new URLSearchParams(window.location.search).get("uri")||("standalone"===this.mode?"pod-os:dashboard":window.location.href),this.routeChanged.emit(this.uri)}render(){return r("slot",{key:"c092d822705ddca00018c6850358412be5f0aef0"})}static get style(){return".toolbar{display:flex;flex-direction:row;gap:0;align-items:center;margin-left:0.5rem}pos-navigation{flex-grow:1}"}},[260,"pos-router",{mode:[1],uri:[32]},[[0,"pod-os:link","linkClicked"],[8,"pod-os:session-restored","sessionRestored"]]]);function f(){"undefined"!=typeof customElements&&["pos-router"].forEach((e=>{"pos-router"===e&&(customElements.get(i(e))||customElements.define(i(e),p))}))}export{p as P,f as d}
1
+ import{getRenderingRef as e,forceUpdate as t,proxyCustomElement as n,HTMLElement as s,createEvent as o,h as r,transformTag as i}from"@stencil/core/internal/client";const c=e=>!("isConnected"in e)||e.isConnected,u=(()=>{let e;return(...t)=>{e&&clearTimeout(e),e=setTimeout((()=>{e=0,(e=>{for(let t of e.keys())e.set(t,e.get(t).filter(c))})(...t)}),2e3)}})(),a=(e,t)=>{if("string"==typeof t){if(t===e)return{}}else if("function"==typeof t){const n=t(e);if(n)return!0===n?{}:{...n}}else{const n=t.exec(e);if(n)return t.lastIndex=0,{...n}}},l=e=>e.pathname.toLowerCase(),p=(()=>{const n=window,s=new URL(n.location.href),o=l,{state:r,onChange:i,dispose:c}=((n,s)=>{const o=((e,t=(e,t)=>e!==t)=>{let n=new Map(Object.entries(null!=e?e:{}));const s={dispose:[],get:[],set:[],reset:[]},o=()=>{n=new Map(Object.entries(null!=e?e:{})),s.reset.forEach((e=>e()))},r=e=>(s.get.forEach((t=>t(e))),n.get(e)),i=(e,o)=>{const r=n.get(e);t(o,r,e)&&(n.set(e,o),s.set.forEach((t=>t(e,o,r))))},c="undefined"==typeof Proxy?{}:new Proxy(e,{get:(e,t)=>r(t),ownKeys:()=>Array.from(n.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(e,t)=>n.has(t),set:(e,t,n)=>(i(t,n),!0)}),u=(e,t)=>(s[e].push(t),()=>{((e,t)=>{const n=e.indexOf(t);n>=0&&(e[n]=e[e.length-1],e.length--)})(s[e],t)});return{state:c,get:r,set:i,on:u,onChange:(t,n)=>{const s=u("set",((e,s)=>{e===t&&n(s)})),o=u("reset",(()=>n(e[t])));return()=>{s(),o()}},use:(...e)=>{const t=e.reduce(((e,t)=>(t.set&&e.push(u("set",t.set)),t.get&&e.push(u("get",t.get)),t.reset&&e.push(u("reset",t.reset)),t.dispose&&e.push(u("dispose",t.dispose)),e)),[]);return()=>t.forEach((e=>e()))},dispose:()=>{s.dispose.forEach((e=>e())),o()},reset:o,forceUpdate:e=>{const t=n.get(e);s.set.forEach((n=>n(e,t,t)))}}})(n,s);return o.use((()=>{if("function"!=typeof e)return{};const n=new Map;return{dispose:()=>n.clear(),get:t=>{const s=e();s&&((e,t,n)=>{const s=e.get(t);s?s.includes(n)||s.push(n):e.set(t,[n])})(n,t,s)},set:e=>{const s=n.get(e);s&&n.set(e,s.filter(t)),u(n)},reset:()=>{n.forEach((e=>e.forEach(t))),u(n)}}})()),o})({url:s,activePath:o(s)},((e,t,n)=>"url"===n?e.href!==t.href:e!==t)),p=e=>{history.pushState(null,null,e);const t=new URL(e,document.baseURI);r.url=t,r.activePath=o(t)},f=e=>{const{activePath:t}=r;for(let n of e){const s=a(t,n.path);if(s){if(null!=n.to){const s="string"==typeof n.to?n.to:n.to(t);return p(s),f(e)}return{params:s,route:n}}}},d=()=>{const e=new URL(n.location.href);r.url=e,r.activePath=o(e)},h={Switch:(e,t)=>{const n=f(t);if(n)return"function"==typeof n.route.jsx?n.route.jsx(n.params):n.route.jsx},get url(){return r.url},get activePath(){return r.activePath},push:p,onChange:i,dispose:()=>{n.removeEventListener("popstate",d),c()}};return d(),n.addEventListener("popstate",d),h})(),f=n(class extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.routeChanged=o(this,"pod-os:route-changed",7),this.mode="standalone"}linkClicked(e){this.navigate(e.detail)}sessionRestored(e){p.push(e.detail.url)}componentWillLoad(){this.updateUri(),p.onChange("url",(()=>{this.updateUri()}))}navigate(e){p.push("?uri="+encodeURIComponent(e))}updateUri(){this.uri=new URLSearchParams(window.location.search).get("uri")||("standalone"===this.mode?"pod-os:dashboard":window.location.href),this.routeChanged.emit(this.uri)}render(){return r("slot",{key:"7e0f0f4ff13b90a511272ca93fee4f954eebb5f4"})}static get style(){return".toolbar{display:flex;flex-direction:row;gap:0;align-items:center;margin-left:0.5rem}pos-navigation{flex-grow:1}"}},[260,"pos-router",{mode:[1],uri:[32]},[[0,"pod-os:link","linkClicked"],[8,"pod-os:session-restored","sessionRestored"]]]);function d(){"undefined"!=typeof customElements&&["pos-router"].forEach((e=>{"pos-router"===e&&(customElements.get(i(e))||customElements.define(i(e),f))}))}export{f as P,d}
@@ -1 +1 @@
1
- import{proxyCustomElement as t,HTMLElement as e,createEvent as s,h as o,Host as r,transformTag as i}from"@stencil/core/internal/client";import{s as n}from"./PodOsAware.js";const a=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.subscribePodOs=s(this,"pod-os:init",7),this.termSelected=s(this,"pod-os:term-selected",7),this.placeholder="Type to search...",this.value="",this.terms=[],this.receivePodOs=async t=>{this.os=t}}componentWillLoad(){n(this)}setTerms(){this.terms=this.os.listKnownTerms()}handleChange(t){this.termSelected.emit({uri:t.target.value})}render(){return o(r,{key:"6a2e97c7b3c21cbcb7e64af30f133b7f721a589f"},o("input",{key:"57bdfec32da3713362fcaf49f25b98184fed03f8",part:"input",list:"terms",placeholder:this.placeholder,value:this.value,onChange:t=>this.handleChange(t)}),o("datalist",{key:"8d92be9bbb91323a8fef79c542f92de72e9d1829",part:"terms",id:"terms"},this.terms.map((t=>o("option",{value:t.uri},t.shorthand)))))}static get delegatesFocus(){return!0}static get watchers(){return{os:[{setTerms:0}]}}static get style(){return":host{display:block}input{background-color:transparent;color:var(--pos-normal-text-color);border:none;padding-top:1rem;padding-bottom:1rem}input:focus{outline:none}"}},[17,"pos-select-term",{placeholder:[1],value:[1],os:[32],terms:[32]},void 0,{os:[{setTerms:0}]}]);function c(){"undefined"!=typeof customElements&&["pos-select-term"].forEach((t=>{"pos-select-term"===t&&(customElements.get(i(t))||customElements.define(i(t),a))}))}export{a as P,c as d}
1
+ import{proxyCustomElement as t,HTMLElement as e,createEvent as s,h as o,Host as r,transformTag as i}from"@stencil/core/internal/client";import{s as a}from"./PodOsAware.js";const n=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.subscribePodOs=s(this,"pod-os:init",7),this.termSelected=s(this,"pod-os:term-selected",7),this.placeholder="Type to search...",this.value="",this.terms=[],this.receivePodOs=async t=>{this.os=t}}componentWillLoad(){a(this)}setTerms(){this.terms=this.os.listKnownTerms()}handleChange(t){this.termSelected.emit({uri:t.target.value})}render(){return o(r,{key:"2a4b6f065c03e62274de7a5c73c95e9539baea21"},o("input",{key:"724179b341841a39d37ebdb94c16c4c09b7673a9",part:"input",list:"terms",placeholder:this.placeholder,value:this.value,onChange:t=>this.handleChange(t)}),o("datalist",{key:"a8fb7b0ab70e4b4fcb92d6efab25341c37eeea3a",part:"terms",id:"terms"},this.terms.map((t=>o("option",{value:t.uri},t.shorthand)))))}static get delegatesFocus(){return!0}static get watchers(){return{os:[{setTerms:0}]}}static get style(){return":host{display:block}input{background-color:transparent;color:var(--pos-normal-text-color);border:none;padding-top:1rem;padding-bottom:1rem}input:focus{outline:none}"}},[17,"pos-select-term",{placeholder:[1],value:[1],os:[32],terms:[32]},void 0,{os:[{setTerms:0}]}]);function c(){"undefined"!=typeof customElements&&["pos-select-term"].forEach((t=>{"pos-select-term"===t&&(customElements.get(i(t))||customElements.define(i(t),n))}))}export{n as P,c as d}
@@ -1 +1 @@
1
- import{proxyCustomElement as e,HTMLElement as t,h as s,transformTag as i}from"@stencil/core/internal/client";import"./chunk.ZGGPD2XJ.js";import"./chunk.YHLNUJ7P.js";import"./chunk.4TUIT776.js";import"./chunk.HVTXQL7M.js";import"./chunk.5JY5FUCG.js";import"./chunk.6CTB5ZDJ.js";import"./chunk.IVVHNXMC.js";import{u as a}from"./usePodOS.js";const c=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.apps=[]}async resourceLoaded(e){e.detail===this.uri&&await this.updateApps()}async componentWillLoad(){this.os=await a(this.el),await this.updateApps()}async updateApps(){const e=this.os.store.get(this.uri);this.apps=this.os.proposeAppsFor(e)}onSelect(e){const{value:t}=e.detail.item;var s;"copy-uri"===t?navigator.clipboard.writeText(this.uri):(s=t.urlTemplate.expand({uri:this.uri}),window.open(s.toString(),"_blank"))}render(){return s("sl-dropdown",{key:"6f05a2eb1b492c9424fa28b76826b59192d93ac3"},s("button",{key:"c0f7530ece1ad1f6cfe85e7291dbc50aa6cbdec7",slot:"trigger","aria-label":"Share",part:"button"},s("sl-icon",{key:"9e4c5299dea09378599c97166b10e32ca2db9181",name:"share"})),s("sl-menu",{key:"cbceb11123c96e008df27021fc4a00050d807fe5"},s("sl-menu-item",{key:"3cf3473830aa4d7bc272057febd8fa1c11821c91",value:"copy-uri"},s("sl-icon",{key:"e1256e2dc3466630484ba23321c79bb3fdc8e81d",slot:"prefix",name:"copy"}),"Copy URI"),this.apps.length>0&&s(n,{key:"5093596308586326c8201f52e609d6037aae9716",apps:this.apps})))}get el(){return this}static get watchers(){return{uri:[{updateApps:0}]}}static get style(){return":host{display:flex;aspect-ratio:1/1;height:var(--size-8);align-items:center;justify-content:center}sl-dropdown{height:100%;width:100%;display:flex;align-items:center;justify-content:center;&::part(trigger){height:100%;width:100%}button{display:flex;align-items:center;justify-content:center;height:100%;width:100%;cursor:pointer;padding:0;margin:0}}sl-menu-item[disabled]{&::part(base){cursor:default;opacity:1}}"}},[1,"pos-share",{uri:[1],apps:[32],os:[32]},[[4,"pod-os:resource-loaded","resourceLoaded"],[0,"sl-select","onSelect"]],{uri:[{updateApps:0}]}]);function n({apps:e}){return[s("sl-divider",null),s("sl-menu-item",{disabled:!0},"Open with..."),e.map((e=>s("sl-menu-item",{value:e},e.name)))]}function r(){"undefined"!=typeof customElements&&["pos-share"].forEach((e=>{"pos-share"===e&&(customElements.get(i(e))||customElements.define(i(e),c))}))}export{c as P,r as d}
1
+ import{proxyCustomElement as e,HTMLElement as t,h as s,transformTag as i}from"@stencil/core/internal/client";import"./chunk.ZGGPD2XJ.js";import"./chunk.YHLNUJ7P.js";import"./chunk.4TUIT776.js";import"./chunk.HVTXQL7M.js";import"./chunk.5JY5FUCG.js";import"./chunk.6CTB5ZDJ.js";import"./chunk.IVVHNXMC.js";import{u as a}from"./usePodOS.js";const n=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.apps=[]}async resourceLoaded(e){e.detail===this.uri&&await this.updateApps()}async componentWillLoad(){this.os=await a(this.el),await this.updateApps()}async updateApps(){const e=this.os.store.get(this.uri);this.apps=this.os.proposeAppsFor(e)}onSelect(e){const{value:t}=e.detail.item;var s;"copy-uri"===t?navigator.clipboard.writeText(this.uri):(s=t.urlTemplate.expand({uri:this.uri}),window.open(s.toString(),"_blank"))}render(){return s("sl-dropdown",{key:"9fe1f5774f811f40ca0a3c51b12df8122e4765d8"},s("button",{key:"bdb2c61d418749cb7cedf0ead54babf7ba1d3a93",slot:"trigger","aria-label":"Share",part:"button"},s("sl-icon",{key:"d0a5ab504ea43edada1b378b8d7627cd4f812aae",name:"share"})),s("sl-menu",{key:"75d02eb169c84416c5625f3899987c8e6123d1e1"},s("sl-menu-item",{key:"b7b6219a57fb40b702f396203e80b419ac6159e1",value:"copy-uri"},s("sl-icon",{key:"de2921edf5269c22efd828f5eb31f122375061f1",slot:"prefix",name:"copy"}),"Copy URI"),this.apps.length>0&&s(r,{key:"b636c8e8ea6db6d104eaf4b4cb27078dc8dc0531",apps:this.apps})))}get el(){return this}static get watchers(){return{uri:[{updateApps:0}]}}static get style(){return":host{display:flex;aspect-ratio:1/1;height:var(--size-8);align-items:center;justify-content:center}sl-dropdown{height:100%;width:100%;display:flex;align-items:center;justify-content:center;&::part(trigger){height:100%;width:100%}button{display:flex;align-items:center;justify-content:center;height:100%;width:100%;cursor:pointer;padding:0;margin:0}}sl-menu-item[disabled]{&::part(base){cursor:default;opacity:1}}"}},[1,"pos-share",{uri:[1],apps:[32],os:[32]},[[4,"pod-os:resource-loaded","resourceLoaded"],[0,"sl-select","onSelect"]],{uri:[{updateApps:0}]}]);function r({apps:e}){return[s("sl-divider",null),s("sl-menu-item",{disabled:!0},"Open with..."),e.map((e=>s("sl-menu-item",{value:e},e.name)))]}function o(){"undefined"!=typeof customElements&&["pos-share"].forEach((e=>{"pos-share"===e&&(customElements.get(i(e))||customElements.define(i(e),n))}))}export{n as P,o as d}
@@ -1 +1 @@
1
- import{proxyCustomElement as e,HTMLElement as s,h as o,Host as t,transformTag as a}from"@stencil/core/internal/client";import{u as r}from"./usePodOS.js";import{u as i}from"./useResource.js";import{d as c}from"./pos-attachments2.js";import{d as n}from"./pos-description2.js";import{d as l}from"./pos-label2.js";import{d as p}from"./pos-resource2.js";import{d}from"./pos-rich-link2.js";import{d as m}from"./pos-upload2.js";const u=e(class extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow()}async componentWillLoad(){this.os=await r(this.el),this.resource=await i(this.el)}render(){var e;return o(t,{key:"a7b586f6dc94539b6df4c021f24d445ef858eaad"},o("section",{key:"3e153c97c3b74c650778d5d41e611a85cb775636"},o("article",{key:"917100ecfbe18110a98c36ec9e1beb86af76b4ee"},o("h2",{key:"a28c4dd56847eabbc549e6917c6217a8e3ab2cc9"},"Attachments"),o("pos-attachments",{key:"bf1c808c5f830bc9528c638615f027d6860ea14b",ref:e=>this.attachmentsElement=e}))),o("section",{key:"82a81b160c07847b6957b3e484239eb80eb5acb3"},(null===(e=this.resource)||void 0===e?void 0:e.editable)?o("pos-upload",{accept:["*/*"],uploader:e=>{const s=this.os.attachments().uploadAndAddAttachment(this.resource,e);return s.map((s=>{this.attachmentsElement.addToList({uri:s.url,label:e.name})})),s}}):null))}get el(){return this}static get style(){return":host{display:flex;flex-direction:column;gap:var(--size-1);h2{margin:0;padding:0;font-size:var(--scale-2)}}:host{--gap-size:var(--size-1);display:flex;flex-direction:column;gap:var(--gap-size);margin:var(--gap-size)}section{display:flex;flex-direction:column;gap:var(--gap-size)}@media (min-width: 640px){:host{--gap-size:var(--size-4);flex-direction:row;flex-wrap:wrap;section{&:first-of-type{flex:1}}section:not(:first-of-type){flex:0 0 30%}}}article{padding:var(--size-2);display:flex;flex-direction:column;gap:var(--size-2);outline:var(--pos-border-solid);border-radius:var(--radius-sm);box-shadow:var(--shadow-md);background-color:var(--pos-card-background);header{display:flex;flex-direction:column;gap:var(--size-2);h1{margin:0}}}"}},[1,"pos-tool-attachments",{os:[32],resource:[32]}]),f=u,b=function(){"undefined"!=typeof customElements&&["pos-tool-attachments","pos-attachments","pos-description","pos-label","pos-resource","pos-rich-link","pos-upload"].forEach((e=>{switch(e){case"pos-tool-attachments":customElements.get(a(e))||customElements.define(a(e),u);break;case"pos-attachments":customElements.get(a(e))||c();break;case"pos-description":customElements.get(a(e))||n();break;case"pos-label":customElements.get(a(e))||l();break;case"pos-resource":customElements.get(a(e))||p();break;case"pos-rich-link":customElements.get(a(e))||d();break;case"pos-upload":customElements.get(a(e))||m()}}))};export{f as PosToolAttachments,b as defineCustomElement}
1
+ import{proxyCustomElement as e,HTMLElement as s,h as o,Host as t,transformTag as a}from"@stencil/core/internal/client";import{u as r}from"./usePodOS.js";import{u as i}from"./useResource.js";import{d as c}from"./pos-attachments2.js";import{d as n}from"./pos-description2.js";import{d}from"./pos-label2.js";import{d as l}from"./pos-resource2.js";import{d as p}from"./pos-rich-link2.js";import{d as m}from"./pos-upload2.js";const u=e(class extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow()}async componentWillLoad(){this.os=await r(this.el),this.resource=await i(this.el)}render(){var e;return o(t,{key:"d401de6fd1b51f630bbd5ce6db7ad9c77768d63e"},o("section",{key:"5a59f3c915fabb231558c09b474eaf002e685bc5"},o("article",{key:"650081c28531d7709b2daf1e70587798b5f92455"},o("h2",{key:"1a571e2cbd20a0f57bb634426269a5bc1bd23095"},"Attachments"),o("pos-attachments",{key:"76d57dbcbc7d4534ced8e3bd2f3dd49509039e50",ref:e=>this.attachmentsElement=e}))),o("section",{key:"1a4d06abe179261b511e936fb44261b37540f286"},(null===(e=this.resource)||void 0===e?void 0:e.editable)?o("pos-upload",{accept:["*/*"],uploader:e=>{const s=this.os.attachments().uploadAndAddAttachment(this.resource,e);return s.map((s=>{this.attachmentsElement.addToList({uri:s.url,label:e.name})})),s}}):null))}get el(){return this}static get style(){return":host{display:flex;flex-direction:column;gap:var(--size-1);h2{margin:0;padding:0;font-size:var(--scale-2)}}:host{--gap-size:var(--size-1);display:flex;flex-direction:column;gap:var(--gap-size);margin:var(--gap-size)}section{display:flex;flex-direction:column;gap:var(--gap-size)}@media (min-width: 640px){:host{--gap-size:var(--size-4);flex-direction:row;flex-wrap:wrap;section{&:first-of-type{flex:1}}section:not(:first-of-type){flex:0 0 30%}}}article{padding:var(--size-2);display:flex;flex-direction:column;gap:var(--size-2);outline:var(--pos-border-solid);border-radius:var(--radius-sm);box-shadow:var(--shadow-md);background-color:var(--pos-card-background);header{display:flex;flex-direction:column;gap:var(--size-2);h1{margin:0}}}"}},[1,"pos-tool-attachments",{os:[32],resource:[32]}]),f=u,b=function(){"undefined"!=typeof customElements&&["pos-tool-attachments","pos-attachments","pos-description","pos-label","pos-resource","pos-rich-link","pos-upload"].forEach((e=>{switch(e){case"pos-tool-attachments":customElements.get(a(e))||customElements.define(a(e),u);break;case"pos-attachments":customElements.get(a(e))||c();break;case"pos-description":customElements.get(a(e))||n();break;case"pos-label":customElements.get(a(e))||d();break;case"pos-resource":customElements.get(a(e))||l();break;case"pos-rich-link":customElements.get(a(e))||p();break;case"pos-upload":customElements.get(a(e))||m()}}))};export{f as PosToolAttachments,b as defineCustomElement}