@hotosm/ui 0.9.2 → 0.10.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.
- package/dist/chunks/{chunk.N7SRHM5F.js → chunk.G5R5NK6C.js} +1 -1
- package/dist/chunks/{chunk.PESN3BZK.js → chunk.IKKWEPSE.js} +1 -1
- package/dist/chunks/chunk.IW4CQOKU.js +1 -0
- package/dist/chunks/chunk.K3ILHIDX.js +89 -0
- package/dist/chunks/{chunk.FZ7HQZU4.js → chunk.L2GREEZE.js} +1 -1
- package/dist/chunks/{chunk.XFKYNNG3.js → chunk.LLGJXBVH.js} +9 -3
- package/dist/chunks/{chunk.3AWIVJTF.js → chunk.NZMGMJCM.js} +1 -1
- package/dist/chunks/{chunk.6WYUOJRX.js → chunk.UB7NXUCE.js} +28 -2
- package/dist/chunks/{chunk.ZZ7X3H3S.js → chunk.UFI755NV.js} +1 -1
- package/dist/components/announcement/announcement.component.d.ts +32 -0
- package/dist/components/announcement/announcement.component.js +1 -0
- package/dist/components/announcement/announcement.d.ts +7 -0
- package/dist/components/announcement/announcement.js +1 -0
- package/dist/components/consent/consent.component.js +1 -1
- package/dist/components/consent/consent.js +1 -1
- package/dist/components/file-input-dropzone/file-input-dropzone.component.js +1 -1
- package/dist/components/file-input-dropzone/file-input-dropzone.js +1 -1
- package/dist/components/header/header.component.js +1 -1
- package/dist/components/header/header.js +1 -1
- package/dist/components/header/header.styles.js +1 -1
- package/dist/hotosm-ui.d.ts +2 -1
- package/dist/hotosm-ui.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as e}from"./chunk.
|
|
1
|
+
import{b as e}from"./chunk.UFI755NV.js";var n=e;customElements.get("hot-consent")||customElements.define("hot-consent",e);export{n as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as M}from"./chunk.L7KUSNV7.js";import{a as f,b as m,c as z}from"./chunk.ZETV7TDG.js";import{d as h,e as x,f as F}from"./chunk.QABMDRWR.js";import{d as n,e as o,f as d,g as c}from"./chunk.N2W26RCT.js";var E={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},y=l=>(...a)=>({_$litDirective$:l,values:a}),$=class{constructor(a){}get _$AU(){return this._$AM._$AU}_$AT(a,e,i){this._$Ct=a,this._$AM=e,this._$Ci=i}_$AS(a,e){return this.update(a,e)}update(a,e){return this.render(...e)}};var _=y(class extends ${constructor(l){var a;if(super(l),l.type!==E.ATTRIBUTE||l.name!=="class"||((a=l.strings)==null?void 0:a.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(l){return" "+Object.keys(l).filter(a=>l[a]).join(" ")+" "}update(l,[a]){var i,s;if(this.st===void 0){this.st=new Set,l.strings!==void 0&&(this.nt=new Set(l.strings.join(" ").split(/\s/).filter(t=>t!=="")));for(let t in a)a[t]&&!((i=this.nt)!=null&&i.has(t))&&this.st.add(t);return this.render(a)}let e=l.element.classList;for(let t of this.st)t in a||(e.remove(t),this.st.delete(t));for(let t in a){let p=!!a[t];p===this.st.has(t)||(s=this.nt)!=null&&s.has(t)||(p?(e.add(t),this.st.add(t)):(e.remove(t),this.st.delete(t)))}return x}});Promise.allSettled([import("@awesome.me/webawesome/dist/components/icon/icon.js"),import("@awesome.me/webawesome/dist/components/divider/divider.js")]);var S,T,C,D,P,A,B,L,k,W,I,O,r=class extends F{constructor(){super(...arguments);this.name="hot-file-input-dropzone";d(this,S,!1);d(this,T,"");d(this,C,0);d(this,D,!1);d(this,P,!1);d(this,A,"");d(this,B,"traditional");d(this,L,!1);d(this,k,[]);d(this,W,"");d(this,I,"");d(this,O)}get multiple(){return o(this,S)}set multiple(e){c(this,S,e)}get accept(){return o(this,T)}set accept(e){c(this,T,e)}get maxSize(){return o(this,C)}set maxSize(e){c(this,C,e)}get showPreview(){return o(this,D)}set showPreview(e){c(this,D,e)}get disabled(){return o(this,P)}set disabled(e){c(this,P,e)}get label(){return o(this,A)}set label(e){c(this,A,e)}get variant(){return o(this,B)}set variant(e){c(this,B,e)}get isDragging(){return o(this,L)}set isDragging(e){c(this,L,e)}get selectedFiles(){return o(this,k)}set selectedFiles(e){c(this,k,e)}get errorMessage(){return o(this,W)}set errorMessage(e){c(this,W,e)}get statusMessage(){return o(this,I)}set statusMessage(e){c(this,I,e)}get fileInput(){return o(this,O)}set fileInput(e){c(this,O,e)}_generateId(){return`file-${Date.now()}-${Math.random().toString(36).substring(2,11)}`}_handleDragOver(e){e.preventDefault(),e.stopPropagation(),this.disabled||(this.isDragging=!0)}_handleDragLeave(e){e.preventDefault(),e.stopPropagation(),this.isDragging=!1}_handleDrop(e){var s;if(e.preventDefault(),e.stopPropagation(),this.isDragging=!1,this.disabled)return;let i=Array.from(((s=e.dataTransfer)==null?void 0:s.files)||[]);this._processFiles(i)}_handleClick(){this.disabled||this.fileInput.click()}_handleKeyDown(e){!this.disabled&&(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.fileInput.click())}_handleFileInputChange(e){let i=e.target,s=Array.from(i.files||[]);this._processFiles(s)}_processFiles(e){if(this.errorMessage="",!this.multiple&&e.length>1){this.errorMessage="Only one file can be selected";return}if(this.accept){let t=this.accept.split(",").map(u=>u.trim().toLowerCase()),p=e.filter(u=>{let b=u.name.toLowerCase(),g=u.type.toLowerCase();return!t.some(v=>{if(v.startsWith("."))return b.endsWith(v);if(v.endsWith("/*")){let w=v.split("/")[0];if(g)return g.startsWith(w+"/");let j=b.substring(b.lastIndexOf("."));return this._getFileIcon(j).includes(w)}return g?g===v:!1})});if(p.length>0){this.errorMessage=`Invalid file type(s): ${p.map(u=>u.name).join(", ")}`;return}}if(this.maxSize>0){let t=e.filter(p=>p.size>this.maxSize);if(t.length>0){this.errorMessage=`File(s) exceed maximum size of ${this._formatFileSize(this.maxSize)}: ${t.map(p=>p.name).join(", ")}`;return}}let i=e.map(t=>({file:t,id:this._generateId()}));this.multiple?this.selectedFiles=[...i,...this.selectedFiles]:this.selectedFiles=i,this.dispatchEvent(new CustomEvent("hot-file-change",{detail:{files:this.selectedFiles.map(t=>t.file)},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("hot-files-selected",{detail:{files:i.map(t=>t.file),allFiles:this.selectedFiles.map(t=>t.file)},bubbles:!0,composed:!0}));let s=i.length;this.statusMessage=`${s} ${s===1?"file":"files"} selected: ${i.map(t=>t.file.name).join(", ")}`}_removeFile(e){let i=this.selectedFiles.find(s=>s.id===e);this.selectedFiles=this.selectedFiles.filter(s=>s.id!==e),this.fileInput&&(this.fileInput.value=""),this.dispatchEvent(new CustomEvent("hot-file-change",{detail:{files:this.selectedFiles.map(s=>s.file)},bubbles:!0,composed:!0})),i&&(this.statusMessage=`File removed: ${i.file.name}. ${this.selectedFiles.length} ${this.selectedFiles.length===1?"file":"files"} remaining.`)}_formatFileSize(e){if(e===0)return"0 Bytes";let i=1e3,s=["Bytes","KB","MB","GB"],t=Math.floor(Math.log(e)/Math.log(i)),p=e/Math.pow(i,t);return`${Math.round(p*10)/10} ${s[t]}`}_getFileIcon(e){return e.startsWith("image/")?"file-image":e.startsWith("video/")?"file-video":e.startsWith("audio/")?"file-audio":e==="application/pdf"?"file-pdf":e.includes("word")?"file-word":e.includes("sheet")||e.includes("excel")?"file-excel":e.includes("zip")||e.includes("rar")||e.includes("7z")?"file-archive":e.includes("text")?"file-text":"file"}clearFiles(){this.selectedFiles=[],this.errorMessage="",this.fileInput&&(this.fileInput.value="")}getFiles(){return this.selectedFiles.map(e=>e.file)}render(){let e={dropzone:!0,"dropzone--dragging":this.isDragging,"dropzone--disabled":this.disabled,"dropzone--has-files":this.selectedFiles.length>0,"dropzone--compact":this.variant==="compact"},i=this.variant==="compact";return h`
|
|
2
2
|
<div class="file-input-dropzone">
|
|
3
3
|
${this.label&&this.variant==="traditional"?h`<label class="label" id="dropzone-label">${this.label}</label>`:""}
|
|
4
4
|
${this.variant==="traditional"?h`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as e}from"./chunk.K3ILHIDX.js";var t=e;customElements.get("hot-announcement")||customElements.define("hot-announcement",e);export{t as a};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import{a as n,b as d}from"./chunk.ZETV7TDG.js";import{a as l,d as o,f as c}from"./chunk.QABMDRWR.js";import{d as t,e as s,f as i,g as a}from"./chunk.N2W26RCT.js";Promise.allSettled([import("@awesome.me/webawesome/dist/components/callout/callout.js"),import("@awesome.me/webawesome/dist/components/icon/icon.js"),import("@awesome.me/webawesome/dist/components/button/button.js")]);var m,u,h,b,g,p,e=class extends c{constructor(){super(...arguments);this.name="hot-announcement";i(this,m,"");i(this,u,"");i(this,h,"");i(this,b,"brand");i(this,g,"Dismiss");i(this,p,"hot-announcement");this.visible=!1}get version(){return s(this,m)}set version(r){a(this,m,r)}get title(){return s(this,u)}set title(r){a(this,u,r)}get message(){return s(this,h)}set message(r){a(this,h,r)}get variant(){return s(this,b)}set variant(r){a(this,b,r)}get dismissLabel(){return s(this,g)}set dismissLabel(r){a(this,g,r)}get storageKey(){return s(this,p)}set storageKey(r){a(this,p,r)}storageFullKey(){return`${this.storageKey}-${this.version}-dismissed`}dismiss(){this.version.length>0&&localStorage.setItem(this.storageFullKey(),"true"),this.visible=!1,this.dispatchEvent(new CustomEvent("dismiss",{detail:{version:this.version},bubbles:!0,composed:!0}))}connectedCallback(){super.connectedCallback(),this._evaluateVisibility()}willUpdate(r){(r.has("version")||r.has("storageKey"))&&this._evaluateVisibility()}_evaluateVisibility(){if(this.version.length===0){console.warn("[hot-announcement] `version` is required so dismissal can be keyed per release. Banner hidden."),this.visible=!1;return}let r=localStorage.getItem(this.storageFullKey())==="true";this.visible=!r}render(){return this.visible?o`
|
|
2
|
+
<div class="announcement-banner" role="status">
|
|
3
|
+
<wa-callout variant="${this.variant}" appearance="outlined filled" size="medium">
|
|
4
|
+
<wa-icon slot="icon" family="classic" variant="solid" name="circle-info"></wa-icon>
|
|
5
|
+
<div class="announcement-content">
|
|
6
|
+
<div class="announcement-body">
|
|
7
|
+
${this.title.length>0?o`<strong>${this.title}</strong>`:null}
|
|
8
|
+
<slot>${this.message}</slot>
|
|
9
|
+
</div>
|
|
10
|
+
<button
|
|
11
|
+
type="button"
|
|
12
|
+
class="announcement-dismiss"
|
|
13
|
+
aria-label="${this.dismissLabel}"
|
|
14
|
+
@click=${()=>this.dismiss()}
|
|
15
|
+
>
|
|
16
|
+
<wa-icon name="xmark"></wa-icon>
|
|
17
|
+
</button>
|
|
18
|
+
</div>
|
|
19
|
+
</wa-callout>
|
|
20
|
+
</div>
|
|
21
|
+
`:null}};m=new WeakMap,u=new WeakMap,h=new WeakMap,b=new WeakMap,g=new WeakMap,p=new WeakMap,e.styles=l`
|
|
22
|
+
:host {
|
|
23
|
+
display: block;
|
|
24
|
+
font-family: var(--hot-font-sans);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.announcement-banner {
|
|
28
|
+
position: sticky;
|
|
29
|
+
top: 0;
|
|
30
|
+
z-index: 1000;
|
|
31
|
+
width: 100%;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
wa-callout {
|
|
35
|
+
border-radius: 0;
|
|
36
|
+
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.announcement-content {
|
|
40
|
+
display: flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
gap: var(--hot-spacing-small);
|
|
43
|
+
width: 100%;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.announcement-body {
|
|
47
|
+
padding: 0 var(--hot-spacing-x-small);
|
|
48
|
+
flex: 1;
|
|
49
|
+
min-width: 0;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.announcement-body strong {
|
|
53
|
+
display: block;
|
|
54
|
+
margin-bottom: var(--hot-spacing-3x-small);
|
|
55
|
+
font-weight: var(--hot-font-weight-semibold);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.announcement-body ::slotted(a),
|
|
59
|
+
.announcement-body a {
|
|
60
|
+
color: var(--hot-color-primary-600);
|
|
61
|
+
text-decoration: underline;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.announcement-dismiss {
|
|
65
|
+
flex-shrink: 0;
|
|
66
|
+
display: inline-flex;
|
|
67
|
+
align-items: center;
|
|
68
|
+
justify-content: center;
|
|
69
|
+
width: 1.75rem;
|
|
70
|
+
height: 1.75rem;
|
|
71
|
+
padding: 0;
|
|
72
|
+
border: none;
|
|
73
|
+
border-radius: var(--hot-border-radius-medium);
|
|
74
|
+
background: transparent;
|
|
75
|
+
color: inherit;
|
|
76
|
+
cursor: pointer;
|
|
77
|
+
font-size: 1rem;
|
|
78
|
+
line-height: 1;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.announcement-dismiss:hover {
|
|
82
|
+
background: rgba(0, 0, 0, 0.06);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.announcement-dismiss:focus-visible {
|
|
86
|
+
outline: 2px solid var(--hot-color-primary-500);
|
|
87
|
+
outline-offset: 2px;
|
|
88
|
+
}
|
|
89
|
+
`,t([n({type:String})],e.prototype,"version",1),t([n({type:String})],e.prototype,"title",1),t([n({type:String})],e.prototype,"message",1),t([n({type:String})],e.prototype,"variant",1),t([n({type:String,attribute:"dismiss-label"})],e.prototype,"dismissLabel",1),t([n({type:String,attribute:"storage-key"})],e.prototype,"storageKey",1),t([d()],e.prototype,"visible",2);var x=e;export{e as a,x as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as e}from"./chunk.
|
|
1
|
+
import{b as e}from"./chunk.LLGJXBVH.js";var a=e;customElements.get("hot-header")||customElements.define("hot-header",e);export{a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as w,b as f}from"./chunk.
|
|
1
|
+
import{a as w,b as f}from"./chunk.UB7NXUCE.js";import{a as y}from"./chunk.KO4EOD3I.js";import{a as d}from"./chunk.ZETV7TDG.js";import{d as i,f as g}from"./chunk.QABMDRWR.js";import{d as o,e as l,f as c,g as h}from"./chunk.N2W26RCT.js";Promise.allSettled([import("@awesome.me/webawesome/dist/components/tab-group/tab-group.js"),import("@awesome.me/webawesome/dist/components/icon/icon.js"),import("@awesome.me/webawesome/dist/components/drawer/drawer.js"),import("@awesome.me/webawesome/dist/components/dropdown/dropdown.js"),import("@awesome.me/webawesome/dist/components/dropdown-item/dropdown-item.js")]);y();var S,m,$,E,L,T,k,A,_,C,I,x,s=class s extends g{constructor(){super(...arguments);this.name="hot-header";c(this,S,"");c(this,m,"Mapping our world together");c(this,$,"Humanitarian OpenStreetMap Team Website");c(this,E,"https://www.hotosm.org");c(this,L,"");c(this,T,!1);c(this,k,[]);c(this,A,[]);c(this,_,"small");c(this,C,!1);c(this,I,0);c(this,x,0);this._navScrollAtStart=!0;this._navScrollAtEnd=!1;this._boundLocationSync=null}get title(){return l(this,S)}set title(e){h(this,S,e)}get topTagline(){return l(this,m)}set topTagline(e){h(this,m,e)}get topLinkLabel(){return l(this,$)}set topLinkLabel(e){h(this,$,e)}get topLinkHref(){return l(this,E)}set topLinkHref(e){h(this,E,e)}get logo(){return l(this,L)}set logo(e){h(this,L,e)}get drawer(){return l(this,T)}set drawer(e){h(this,T,e)}get tabs(){return l(this,k)}set tabs(e){h(this,k,e)}get drawerLinks(){return l(this,A)}set drawerLinks(e){h(this,A,e)}get size(){return l(this,_)}set size(e){h(this,_,e)}get tabsCenterAlign(){return l(this,C)}set tabsCenterAlign(e){h(this,C,e)}get selectedTab(){return l(this,I)}set selectedTab(e){h(this,I,e)}get activeTabIndex(){return l(this,x)}set activeTabIndex(e){h(this,x,e)}async connectedCallback(){super.connectedCallback(),this._boundLocationSync=()=>this.syncActiveTab(),window.addEventListener("popstate",this._boundLocationSync),window.addEventListener("hot-locationchange",this._boundLocationSync),window.addEventListener("htmx:pushedIntoHistory",this._boundLocationSync),s._patchHistory()}disconnectedCallback(){super.disconnectedCallback(),this._boundLocationSync&&(window.removeEventListener("popstate",this._boundLocationSync),window.removeEventListener("hot-locationchange",this._boundLocationSync),window.removeEventListener("htmx:pushedIntoHistory",this._boundLocationSync),this._boundLocationSync=null)}firstUpdated(e){this._updateNavScrollState(),this.syncActiveTab()}updated(e){if(super.updated(e),e.has("selectedTab")){let t=this.selectedTab;typeof t=="number"&&t>=0&&t<this.tabs.length&&t!==this.activeTabIndex&&(this.activeTabIndex=t)}(e.has("tabs")||e.has("size"))&&(this.updateComplete.then(()=>this._updateNavScrollState()),e.has("tabs")&&this.syncActiveTab())}selectTab(e){if(e!==this.selectedTab&&e>=0&&e<this.tabs.length){let t=this.selectedTab;this.selectedTab=e,this.activeTabIndex=e,this.dispatchEvent(new CustomEvent("tab-change",{detail:{selectedIndex:e,previousIndex:t,tab:this.tabs[e]},bubbles:!0})),this.requestUpdate()}}_updateNavScrollState(){var v;let e=(v=this.renderRoot)==null?void 0:v.querySelector(".header--nav-scroll");if(!e)return;let{scrollLeft:t,scrollWidth:a,clientWidth:r}=e,n=t<=0,u=t+r>=a-1;(n!==this._navScrollAtStart||u!==this._navScrollAtEnd)&&(this._navScrollAtStart=n,this._navScrollAtEnd=u,this.requestUpdate())}_scrollNav(e){var n;let t=(n=this.renderRoot)==null?void 0:n.querySelector(".header--nav-scroll");if(!t)return;let a=Math.max(t.scrollWidth-t.clientWidth,0),r=e==="right"?a:0;t.scrollTo({left:r,behavior:"smooth"}),window.setTimeout(()=>this._updateNavScrollState(),250)}syncActiveTab(){var r;if(typeof window=="undefined"||!((r=this.tabs)!=null&&r.length))return;let e=window.location.pathname.replace(/\/+$/,"");if(!e)return;let t=-1,a=-1;this.tabs.forEach((n,u)=>{if(n!=null&&n.href)try{let p=new URL(n.href,window.location.origin).pathname.replace(/\/+$/,"");if(!p)return;e===p?(t=u,a=Number.MAX_SAFE_INTEGER):a<Number.MAX_SAFE_INTEGER&&e.startsWith(p)&&p.length>a&&(t=u,a=p.length)}catch(v){}}),t>=0&&t!==this.activeTabIndex&&(this.selectedTab=t,this.activeTabIndex=t,this.requestUpdate())}static _patchHistory(){if(s._historyPatched||typeof window=="undefined")return;s._historyPatched=!0;let e=history.pushState.bind(history),t=history.replaceState.bind(history);history.pushState=function(a,r,n){e(a,r,n),window.dispatchEvent(new Event("hot-locationchange"))},history.replaceState=function(a,r,n){t(a,r,n),window.dispatchEvent(new Event("hot-locationchange"))}}render(){let e=typeof this.logo=="string"||this.logo instanceof URL?typeof this.logo=="string"?this.logo:this.logo.href:"";return i`
|
|
2
2
|
<div class="header-container">
|
|
3
3
|
${this.size!=="small"?i`
|
|
4
4
|
<div class="header--top">
|
|
@@ -103,7 +103,8 @@ import{a as w,b as f}from"./chunk.6WYUOJRX.js";import{a as y}from"./chunk.KO4EOD
|
|
|
103
103
|
|
|
104
104
|
|
|
105
105
|
<div id="right-section" class="header--right-section">
|
|
106
|
-
<slot name="
|
|
106
|
+
<slot name="lang" class="header--lang-slot"></slot>
|
|
107
|
+
<slot name="auth" class="header--auth-slot"></slot>
|
|
107
108
|
${this._showDrawer?i`
|
|
108
109
|
<wa-drawer label=" " id="drawer-overview">
|
|
109
110
|
<div class="drawer-content">
|
|
@@ -139,6 +140,11 @@ import{a as w,b as f}from"./chunk.6WYUOJRX.js";import{a as y}from"./chunk.KO4EOD
|
|
|
139
140
|
</li>
|
|
140
141
|
`)}
|
|
141
142
|
</ul>
|
|
143
|
+
|
|
144
|
+
<div class="drawer-extras">
|
|
145
|
+
<slot name="drawer-lang" class="drawer-lang-slot"></slot>
|
|
146
|
+
<slot name="drawer-auth" class="drawer-auth-slot"></slot>
|
|
147
|
+
</div>
|
|
142
148
|
</div>
|
|
143
149
|
</wa-drawer>
|
|
144
150
|
<wa-button
|
|
@@ -154,4 +160,4 @@ import{a as w,b as f}from"./chunk.6WYUOJRX.js";import{a as y}from"./chunk.KO4EOD
|
|
|
154
160
|
|
|
155
161
|
</header>
|
|
156
162
|
</div>
|
|
157
|
-
`}async _tabClick(e,t,a){e.preventDefault(),e.stopPropagation();try{this.selectTab(a),setTimeout(async()=>{try{typeof t=="function"&&await t()}catch(r){console.error("Error during navigation:",r),typeof t=="function"&&t()}},0)}catch(r){console.error("Error handling tab click:",r);try{typeof t=="function"&&t()}catch(n){console.error("Fallback navigation also failed:",n)}}}_handleTabShow(e){try{let t=e.target,a=parseInt(t.getAttribute("data-index")||"0",10);!isNaN(a)&&a<this.tabs.length&&this.selectTab(a)}catch(t){console.error("Error handling tab show event:",t)}}get _showDrawer(){return this.drawer||this.tabs.length>0}_handleDrawerOpen(){var t;let e=(t=this.renderRoot)==null?void 0:t.querySelector("#drawer-overview");e&&(e.open=!0)}};S=new WeakMap,m=new WeakMap,$=new WeakMap,E=new WeakMap,L=new WeakMap,T=new WeakMap,k=new WeakMap,A=new WeakMap,_=new WeakMap,C=new WeakMap,I=new WeakMap,
|
|
163
|
+
`}async _tabClick(e,t,a){e.preventDefault(),e.stopPropagation();try{this.selectTab(a),setTimeout(async()=>{try{typeof t=="function"&&await t()}catch(r){console.error("Error during navigation:",r),typeof t=="function"&&t()}},0)}catch(r){console.error("Error handling tab click:",r);try{typeof t=="function"&&t()}catch(n){console.error("Fallback navigation also failed:",n)}}}_handleTabShow(e){try{let t=e.target,a=parseInt(t.getAttribute("data-index")||"0",10);!isNaN(a)&&a<this.tabs.length&&this.selectTab(a)}catch(t){console.error("Error handling tab show event:",t)}}get _showDrawer(){return this.drawer||this.tabs.length>0}_handleDrawerOpen(){var t;let e=(t=this.renderRoot)==null?void 0:t.querySelector("#drawer-overview");e&&(e.open=!0)}};S=new WeakMap,m=new WeakMap,$=new WeakMap,E=new WeakMap,L=new WeakMap,T=new WeakMap,k=new WeakMap,A=new WeakMap,_=new WeakMap,C=new WeakMap,I=new WeakMap,x=new WeakMap,s.styles=[f],s._historyPatched=!1,o([d({type:String})],s.prototype,"title",1),o([d({type:String,attribute:"top-tagline"})],s.prototype,"topTagline",1),o([d({type:String,attribute:"top-link-label"})],s.prototype,"topLinkLabel",1),o([d({type:String,attribute:"top-link-href"})],s.prototype,"topLinkHref",1),o([d({type:String})],s.prototype,"logo",1),o([d({type:Boolean})],s.prototype,"drawer",1),o([d({type:Array})],s.prototype,"tabs",1),o([d({type:Array})],s.prototype,"drawerLinks",1),o([d({type:String})],s.prototype,"size",1),o([d({type:Boolean,attribute:"tabs-center-align"})],s.prototype,"tabsCenterAlign",1),o([d({type:Number})],s.prototype,"selectedTab",1),o([d({type:Number})],s.prototype,"activeTabIndex",1);var b=s,V=b;export{b as a,V as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as e}from"./chunk.
|
|
1
|
+
import{b as e}from"./chunk.IKKWEPSE.js";var t=e;customElements.get("hot-file-input-dropzone")||customElements.define("hot-file-input-dropzone",e);export{t as a};
|
|
@@ -235,6 +235,22 @@ import{a as u}from"./chunk.QABMDRWR.js";import{a as h,c as v}from"./chunk.N2W26R
|
|
|
235
235
|
flex-shrink: 0;
|
|
236
236
|
}
|
|
237
237
|
|
|
238
|
+
/* Slots in the right rail are hidden on mobile and instead projected
|
|
239
|
+
* through their drawer-* counterparts inside the sidebar. */
|
|
240
|
+
@media (max-width: 768px) {
|
|
241
|
+
.header--lang-slot,
|
|
242
|
+
.header--auth-slot {
|
|
243
|
+
display: none;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
@media (min-width: 769px) {
|
|
248
|
+
.drawer-lang-slot,
|
|
249
|
+
.drawer-auth-slot {
|
|
250
|
+
display: none;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
238
254
|
/* Base mobile touch target for drawer / close buttons */
|
|
239
255
|
wa-button[appearance="outlined"] {
|
|
240
256
|
min-width: 2.5rem;
|
|
@@ -471,10 +487,13 @@ import{a as u}from"./chunk.QABMDRWR.js";import{a as h,c as v}from"./chunk.N2W26R
|
|
|
471
487
|
display: none;
|
|
472
488
|
}
|
|
473
489
|
|
|
474
|
-
.header--right-section
|
|
490
|
+
.header--right-section,
|
|
491
|
+
.header--size-small .header--right-section,
|
|
492
|
+
.header--size-medium .header--right-section,
|
|
493
|
+
.header--size-large .header--right-section {
|
|
475
494
|
justify-content: center;
|
|
476
495
|
margin-top: 0;
|
|
477
|
-
gap: var(--hot-spacing-
|
|
496
|
+
gap: calc(var(--hot-spacing-medium) * 2);
|
|
478
497
|
}
|
|
479
498
|
|
|
480
499
|
.header--size-small .header--logo-img {
|
|
@@ -561,6 +580,13 @@ import{a as u}from"./chunk.QABMDRWR.js";import{a as h,c as v}from"./chunk.N2W26R
|
|
|
561
580
|
text-decoration: underline;
|
|
562
581
|
}
|
|
563
582
|
|
|
583
|
+
.drawer-extras {
|
|
584
|
+
display: flex;
|
|
585
|
+
flex-direction: column;
|
|
586
|
+
gap: var(--hot-spacing-small);
|
|
587
|
+
margin-top: var(--hot-spacing-medium);
|
|
588
|
+
}
|
|
589
|
+
|
|
564
590
|
@media (min-width: 769px) {
|
|
565
591
|
.drawer-nav {
|
|
566
592
|
display: none;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as d}from"./chunk.TUEFHEUN.js";import{a as l}from"./chunk.KO4EOD3I.js";import{a as o}from"./chunk.ZETV7TDG.js";import{d as r,f as c}from"./chunk.QABMDRWR.js";import{d as s,e as a,f as n,g as i}from"./chunk.N2W26RCT.js";Promise.allSettled([import("@awesome.me/webawesome/dist/components/callout/callout.js"),import("@awesome.me/webawesome/dist/components/icon/icon.js"),import("@awesome.me/webawesome/dist/components/button/button.js")]);l();var u,g,p,b,m,h,e=class extends c{constructor(){super(...arguments);this.name="hot-consent";n(this,u,"");n(this,g,!1);n(this,p,"About the information we collect");n(this,b,"We use cookies and similar technologies to recognize and analyze your visits, and measure traffic usage and activity.");n(this,m,"I Agree");n(this,h,"I Do Not Agree")}get consentId(){return a(this,u)}set consentId(t){i(this,u,t)}get isOpen(){return a(this,g)}set isOpen(t){i(this,g,t)}get title(){return a(this,p)}set title(t){i(this,p,t)}get message(){return a(this,b)}set message(t){i(this,b,t)}get agreeLabel(){return a(this,m)}set agreeLabel(t){i(this,m,t)}get notAgreeLabel(){return a(this,h)}set notAgreeLabel(t){i(this,h,t)}render(){return this.isOpen?r`
|
|
2
2
|
<div class="consent-overlay">
|
|
3
3
|
<div class="consent-container">
|
|
4
4
|
<wa-callout variant="brand" appearance="outlined filled" size="large" class="consent-callout">
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
import type { PropertyValues } from "lit";
|
|
3
|
+
type AnnouncementVariant = "brand" | "success" | "neutral" | "warning";
|
|
4
|
+
export declare class Announcement extends LitElement {
|
|
5
|
+
name: string;
|
|
6
|
+
/** Release identifier used to key dismissal state. Required. */
|
|
7
|
+
accessor version: string;
|
|
8
|
+
/** Optional bold headline shown before the body content. */
|
|
9
|
+
accessor title: string;
|
|
10
|
+
/** Plain-text body shown when no slotted content is provided. */
|
|
11
|
+
accessor message: string;
|
|
12
|
+
/** Visual variant mapped onto wa-callout. */
|
|
13
|
+
accessor variant: AnnouncementVariant;
|
|
14
|
+
/** Aria-label for the dismiss button. */
|
|
15
|
+
accessor dismissLabel: string;
|
|
16
|
+
/**
|
|
17
|
+
* Prefix for the localStorage key. The full key is
|
|
18
|
+
* `${storageKey}-${version}-dismissed`. Override to run multiple
|
|
19
|
+
* independent banners on the same origin.
|
|
20
|
+
*/
|
|
21
|
+
accessor storageKey: string;
|
|
22
|
+
private visible;
|
|
23
|
+
static styles: import("lit").CSSResult;
|
|
24
|
+
private storageFullKey;
|
|
25
|
+
/** Dismiss the banner and persist the choice for this version. */
|
|
26
|
+
dismiss(): void;
|
|
27
|
+
connectedCallback(): void;
|
|
28
|
+
protected willUpdate(changedProps: PropertyValues): void;
|
|
29
|
+
private _evaluateVisibility;
|
|
30
|
+
protected render(): import("lit").TemplateResult<1> | null;
|
|
31
|
+
}
|
|
32
|
+
export default Announcement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"../../chunks/chunk.K3ILHIDX.js";import"../../chunks/chunk.ZETV7TDG.js";import"../../chunks/chunk.QABMDRWR.js";import"../../chunks/chunk.N2W26RCT.js";export{a as Announcement,b as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"../../chunks/chunk.IW4CQOKU.js";import"../../chunks/chunk.K3ILHIDX.js";import"../../chunks/chunk.ZETV7TDG.js";import"../../chunks/chunk.QABMDRWR.js";import"../../chunks/chunk.N2W26RCT.js";export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"../../chunks/chunk.
|
|
1
|
+
import{a,b}from"../../chunks/chunk.UFI755NV.js";import"../../chunks/chunk.TUEFHEUN.js";import"../../chunks/chunk.KO4EOD3I.js";import"../../chunks/chunk.ZETV7TDG.js";import"../../chunks/chunk.QABMDRWR.js";import"../../chunks/chunk.N2W26RCT.js";export{a as Consent,b as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunks/chunk.
|
|
1
|
+
import{a}from"../../chunks/chunk.G5R5NK6C.js";import"../../chunks/chunk.UFI755NV.js";import"../../chunks/chunk.TUEFHEUN.js";import"../../chunks/chunk.KO4EOD3I.js";import"../../chunks/chunk.ZETV7TDG.js";import"../../chunks/chunk.QABMDRWR.js";import"../../chunks/chunk.N2W26RCT.js";export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"../../chunks/chunk.
|
|
1
|
+
import{a,b}from"../../chunks/chunk.IKKWEPSE.js";import"../../chunks/chunk.MKQTK2RW.js";import"../../chunks/chunk.NCBKWO6J.js";import"../../chunks/chunk.UVBWHOA2.js";import"../../chunks/chunk.L7KUSNV7.js";import"../../chunks/chunk.ZETV7TDG.js";import"../../chunks/chunk.QABMDRWR.js";import"../../chunks/chunk.N2W26RCT.js";export{a as FileInputDropzone,b as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunks/chunk.
|
|
1
|
+
import{a}from"../../chunks/chunk.NZMGMJCM.js";import"../../chunks/chunk.IKKWEPSE.js";import"../../chunks/chunk.MKQTK2RW.js";import"../../chunks/chunk.NCBKWO6J.js";import"../../chunks/chunk.UVBWHOA2.js";import"../../chunks/chunk.L7KUSNV7.js";import"../../chunks/chunk.ZETV7TDG.js";import"../../chunks/chunk.QABMDRWR.js";import"../../chunks/chunk.N2W26RCT.js";export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"../../chunks/chunk.
|
|
1
|
+
import{a,b}from"../../chunks/chunk.LLGJXBVH.js";import"../../chunks/chunk.UB7NXUCE.js";import"../../chunks/chunk.KO4EOD3I.js";import"../../chunks/chunk.ZETV7TDG.js";import"../../chunks/chunk.QABMDRWR.js";import"../../chunks/chunk.N2W26RCT.js";export{a as Header,b as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunks/chunk.
|
|
1
|
+
import{a}from"../../chunks/chunk.L2GREEZE.js";import"../../chunks/chunk.LLGJXBVH.js";import"../../chunks/chunk.UB7NXUCE.js";import"../../chunks/chunk.KO4EOD3I.js";import"../../chunks/chunk.ZETV7TDG.js";import"../../chunks/chunk.QABMDRWR.js";import"../../chunks/chunk.N2W26RCT.js";export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"../../chunks/chunk.
|
|
1
|
+
import{a,b}from"../../chunks/chunk.UB7NXUCE.js";import"../../chunks/chunk.QABMDRWR.js";import"../../chunks/chunk.N2W26RCT.js";export{a as headerVariants,b as styles};
|
package/dist/hotosm-ui.d.ts
CHANGED
|
@@ -2,8 +2,9 @@ import HotHeader from "./components/header/header.js";
|
|
|
2
2
|
import HotLogo from "./components/logo/logo.js";
|
|
3
3
|
import HotTracking from "./components/tracking/tracking.js";
|
|
4
4
|
import HotConsent from "./components/consent/consent.js";
|
|
5
|
+
import HotAnnouncement from "./components/announcement/announcement.js";
|
|
5
6
|
import HotFileInputDropzone from "./components/file-input-dropzone/file-input-dropzone.js";
|
|
6
7
|
import HotListCard from "./components/list-card/list-card.js";
|
|
7
8
|
import HotToolMenu from "./components/tool-menu/tool-menu.js";
|
|
8
9
|
export { injectCSSIntoShadowDOM } from "./utils/shadow-dom-css.js";
|
|
9
|
-
export { HotHeader as Header, HotLogo as Logo, HotConsent as Consent, HotTracking as Tracking, HotFileInputDropzone as FileInputDropzone, HotListCard as ListCard, HotToolMenu as ToolMenu, };
|
|
10
|
+
export { HotHeader as Header, HotLogo as Logo, HotConsent as Consent, HotTracking as Tracking, HotAnnouncement as Announcement, HotFileInputDropzone as FileInputDropzone, HotListCard as ListCard, HotToolMenu as ToolMenu, };
|
package/dist/hotosm-ui.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as p}from"./chunks/chunk.ZG2J5SU5.js";import"./chunks/chunk.34AG3B2Y.js";import"./chunks/chunk.ZKUACKKG.js";import{a as y}from"./chunks/chunk.V7C4W6GD.js";import"./chunks/chunk.24HG5LKA.js";import"./chunks/chunk.DCR6GEE6.js";import{a as u}from"./chunks/chunk.V5BQICX2.js";import"./chunks/chunk.DNXHV7I7.js";import{a as d}from"./chunks/chunk.G5R5NK6C.js";import{a as m}from"./chunks/chunk.L2GREEZE.js";import"./chunks/chunk.LLGJXBVH.js";import"./chunks/chunk.UB7NXUCE.js";import{a as f}from"./chunks/chunk.IW4CQOKU.js";import"./chunks/chunk.K3ILHIDX.js";import{a as S}from"./chunks/chunk.NZMGMJCM.js";import"./chunks/chunk.IKKWEPSE.js";import{a as h}from"./chunks/chunk.MKQTK2RW.js";import"./chunks/chunk.NCBKWO6J.js";import"./chunks/chunk.UVBWHOA2.js";import"./chunks/chunk.L7KUSNV7.js";import"./chunks/chunk.UFI755NV.js";import"./chunks/chunk.TUEFHEUN.js";import"./chunks/chunk.KO4EOD3I.js";import"./chunks/chunk.ZETV7TDG.js";import"./chunks/chunk.QABMDRWR.js";import"./chunks/chunk.N2W26RCT.js";function a(t,e=document){let o=[],r=e.querySelectorAll(t);return o.push(...Array.from(r)),e.querySelectorAll("*").forEach(i=>{i.shadowRoot&&o.push(...a(t,i.shadowRoot))}),o}function g(t){let{css:e,selector:o="wa-button",all:r=!0,styleId:s="hot-theme-injection"}=t;(r?a(o):[a(o)[0]].filter(Boolean)).forEach(n=>{if(!n)return;let c=()=>{if(!n.shadowRoot){setTimeout(c,10);return}if(n.shadowRoot.getElementById(s))return;let l=document.createElement("style");l.id=s,l.textContent=e,n.shadowRoot.appendChild(l)};c()})}export{f as Announcement,d as Consent,S as FileInputDropzone,m as Header,h as ListCard,p as Logo,y as ToolMenu,u as Tracking,g as injectCSSIntoShadowDOM};
|