@hotosm/ui 0.10.2 → 1.0.1
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/LICENSE.md +521 -587
- package/README.md +72 -92
- package/dist/chunks/{chunk.MKQTK2RW.js → chunk.347QGSW2.js} +1 -1
- package/dist/chunks/{chunk.IKKWEPSE.js → chunk.45EZ2EC2.js} +1 -1
- package/dist/chunks/{chunk.DNXHV7I7.js → chunk.54C4CCIE.js} +1 -1
- package/dist/chunks/{chunk.V5BQICX2.js → chunk.6HIYAU2K.js} +1 -1
- package/dist/chunks/{chunk.L7KUSNV7.js → chunk.AYSFL7J5.js} +1 -1
- package/dist/chunks/{chunk.N7SRHM5F.js → chunk.B3F7XGIL.js} +1 -1
- package/dist/chunks/{chunk.NCBKWO6J.js → chunk.B77WIT2F.js} +1 -1
- package/dist/chunks/{chunk.UB7NXUCE.js → chunk.BWW4EBSJ.js} +33 -39
- package/dist/chunks/{chunk.WENKDNDZ.js → chunk.DMESFENF.js} +1 -1
- package/dist/chunks/{chunk.ZETV7TDG.js → chunk.DVVFVLNQ.js} +1 -1
- package/dist/chunks/{chunk.NZMGMJCM.js → chunk.GP3AB7RO.js} +1 -1
- package/dist/chunks/{chunk.V7C4W6GD.js → chunk.GQ4LISAU.js} +1 -1
- package/dist/chunks/{chunk.QABMDRWR.js → chunk.HOF672RD.js} +1 -1
- package/dist/chunks/chunk.HQKELQDW.js +144 -0
- package/dist/chunks/{chunk.ZZ7X3H3S.js → chunk.HZNHTKN6.js} +1 -1
- package/dist/chunks/{chunk.IASKXF74.js → chunk.IV3UXIV2.js} +1 -1
- package/dist/chunks/chunk.IVW6CBE7.js +36 -0
- package/dist/chunks/chunk.LH3TTPVQ.js +23 -0
- package/dist/chunks/{chunk.ZKUACKKG.js → chunk.LIASDRWH.js} +1 -1
- package/dist/chunks/{chunk.34AG3B2Y.js → chunk.LJ4XIP4K.js} +1 -1
- package/dist/chunks/{chunk.L2GREEZE.js → chunk.N2MY7EL5.js} +1 -1
- package/dist/chunks/{chunk.UVBWHOA2.js → chunk.TJOQKPXN.js} +1 -1
- package/dist/chunks/{chunk.ZG2J5SU5.js → chunk.TMPPHKMO.js} +1 -1
- package/dist/chunks/{chunk.TUEFHEUN.js → chunk.VSRVTIBV.js} +1 -1
- package/dist/components/announcement/announcement.component.js +1 -1
- package/dist/components/announcement/announcement.js +1 -1
- package/dist/components/consent/consent.component.js +1 -1
- package/dist/components/consent/consent.js +1 -1
- package/dist/components/consent/consent.styles.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/file-input-dropzone/file-input-dropzone.styles.js +1 -1
- package/dist/components/header/header.component.d.ts +13 -28
- 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/components/list-card/list-card.component.js +1 -1
- package/dist/components/list-card/list-card.js +1 -1
- package/dist/components/list-card/list-card.styles.js +1 -1
- package/dist/components/logo/logo.component.js +1 -1
- package/dist/components/logo/logo.js +1 -1
- package/dist/components/logo/logo.styles.js +1 -1
- package/dist/components/tool-menu/tool-menu.component.d.ts +0 -2
- package/dist/components/tool-menu/tool-menu.component.js +1 -1
- package/dist/components/tool-menu/tool-menu.js +1 -1
- package/dist/components/tool-menu/tool-menu.styles.js +1 -1
- package/dist/components/tracking/tracking.component.js +1 -1
- package/dist/components/tracking/tracking.js +1 -1
- package/dist/hotosm-ui.js +1 -1
- package/dist/style-core.css +1 -1
- package/dist/style.css +1 -1
- package/dist/themes/hot-wa.css +2 -2
- package/dist/webawesome-all.d.ts +1 -0
- package/dist/webawesome-all.js +70 -0
- package/package.json +8 -4
- package/dist/chunks/chunk.24HG5LKA.js +0 -32
- package/dist/chunks/chunk.DCR6GEE6.js +0 -58
- package/dist/chunks/chunk.LLGJXBVH.js +0 -163
package/README.md
CHANGED
|
@@ -63,14 +63,14 @@ built with [Lit](https://lit.dev) and themed for HOTOSM tools using
|
|
|
63
63
|
- Provide a consistent HOT look-and-feel out of the box.
|
|
64
64
|
- Keep the component set small and focused (header, sidebar, footer, etc.).
|
|
65
65
|
|
|
66
|
-
**WebAwesome version:** `3.
|
|
66
|
+
**WebAwesome version:** `3.11.0`
|
|
67
67
|
|
|
68
68
|
---
|
|
69
69
|
|
|
70
70
|
## Installation
|
|
71
71
|
|
|
72
72
|
```bash
|
|
73
|
-
pnpm install @hotosm/ui @awesome.me/webawesome@3.
|
|
73
|
+
pnpm install @hotosm/ui @awesome.me/webawesome@3.11.0
|
|
74
74
|
```
|
|
75
75
|
|
|
76
76
|
> [!NOTE]
|
|
@@ -82,81 +82,46 @@ pnpm install @hotosm/ui @awesome.me/webawesome@3.2.1
|
|
|
82
82
|
|
|
83
83
|
## Loading Styles
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
Use the single self-contained stylesheet (WebAwesome base styles + HOT
|
|
86
|
+
theme inlined):
|
|
86
87
|
|
|
87
|
-
|
|
88
|
+
```js
|
|
89
|
+
import "@hotosm/ui/dist/style.css";
|
|
90
|
+
```
|
|
88
91
|
|
|
89
|
-
|
|
90
|
-
already inlined. Nothing else to load.
|
|
92
|
+
Or from CDN:
|
|
91
93
|
|
|
92
94
|
<!-- markdownlint-disable MD013 -->
|
|
93
95
|
|
|
94
96
|
```html
|
|
95
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@hotosm/ui@0.
|
|
97
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@hotosm/ui@1.0.0/dist/style.css" />
|
|
96
98
|
```
|
|
97
99
|
|
|
98
100
|
<!-- markdownlint-enable MD013 -->
|
|
99
101
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
```js
|
|
103
|
-
import "@hotosm/ui/dist/style.css";
|
|
104
|
-
```
|
|
102
|
+
`style-core.css` (HOT theme only, no WebAwesome) exists for pages that
|
|
103
|
+
load the WebAwesome base stylesheets themselves - most apps don't need it.
|
|
105
104
|
|
|
106
|
-
###
|
|
105
|
+
### Fonts
|
|
107
106
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
107
|
+
Fonts are **not** bundled in the CSS
|
|
108
|
+
([#178](https://github.com/hotosm/ui/issues/178) - a CSS `@import` would
|
|
109
|
+
serialise the font download behind the stylesheet). Add them to your HTML
|
|
110
|
+
so they load in parallel:
|
|
111
111
|
|
|
112
112
|
<!-- markdownlint-disable MD013 -->
|
|
113
113
|
|
|
114
114
|
```html
|
|
115
|
-
|
|
116
|
-
<link
|
|
117
|
-
rel="stylesheet"
|
|
118
|
-
href="https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3.2.1/dist/styles/native.css"
|
|
119
|
-
/>
|
|
115
|
+
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
116
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
120
117
|
<link
|
|
121
118
|
rel="stylesheet"
|
|
122
|
-
href="https://
|
|
119
|
+
href="https://fonts.googleapis.com/css2?family=Archivo:wght@300;400;500;700&family=Barlow:wght@400;500;700&family=Barlow+Condensed:wght@400;500;700&family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap"
|
|
123
120
|
/>
|
|
124
|
-
<link
|
|
125
|
-
rel="stylesheet"
|
|
126
|
-
href="https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3.2.1/dist/styles/themes/default.css"
|
|
127
|
-
/>
|
|
128
|
-
|
|
129
|
-
<!-- HOT theme only (fonts + design tokens + WebAwesome overrides) -->
|
|
130
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@hotosm/ui@0.6.1/dist/style-core.css" />
|
|
131
121
|
```
|
|
132
122
|
|
|
133
123
|
<!-- markdownlint-enable MD013 -->
|
|
134
124
|
|
|
135
|
-
Or from a bundler:
|
|
136
|
-
|
|
137
|
-
```js
|
|
138
|
-
// WebAwesome (resolve from node_modules)
|
|
139
|
-
import "@awesome.me/webawesome/dist/styles/native.css";
|
|
140
|
-
import "@awesome.me/webawesome/dist/styles/utilities.css";
|
|
141
|
-
import "@awesome.me/webawesome/dist/styles/themes/default.css";
|
|
142
|
-
|
|
143
|
-
// HOT theme only
|
|
144
|
-
import "@hotosm/ui/dist/style-core.css";
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
| File | Size | Contains |
|
|
148
|
-
| ---------------- | ------- | ------------------------------------------- |
|
|
149
|
-
| `style.css` | ~105 KB | WebAwesome + fonts + HOT theme (everything) |
|
|
150
|
-
| `style-core.css` | ~21 KB | Fonts + HOT theme only (no WebAwesome) |
|
|
151
|
-
|
|
152
|
-
> [!TIP]
|
|
153
|
-
> **Which should I pick?**
|
|
154
|
-
>
|
|
155
|
-
> - Building a single standalone app? Use **Option A** - zero config.
|
|
156
|
-
> - Running multiple HOT tools on the same domain or expecting users to
|
|
157
|
-
> navigate between them? Use **Option B** - the ~84 KB of shared
|
|
158
|
-
> WebAwesome CSS is fetched once and cached by the browser.
|
|
159
|
-
|
|
160
125
|
---
|
|
161
126
|
|
|
162
127
|
## HTML Setup
|
|
@@ -185,63 +150,78 @@ Add the required WebAwesome classes to your `<html>` element:
|
|
|
185
150
|
|
|
186
151
|
### Via Bundler (Vite, Webpack, etc.)
|
|
187
152
|
|
|
188
|
-
|
|
153
|
+
Recommended: register **all** WebAwesome elements once, up front, so every
|
|
154
|
+
custom element is defined before first render - this eliminates flash of
|
|
155
|
+
undefined custom elements (FOUCE) without maintaining per-page import
|
|
156
|
+
lists:
|
|
189
157
|
|
|
190
158
|
```js
|
|
191
|
-
import "@hotosm/ui/dist/
|
|
159
|
+
import "@hotosm/ui/dist/style.css";
|
|
160
|
+
import "@hotosm/ui/dist/webawesome-all.js"; // registers every wa-* element
|
|
161
|
+
import "@hotosm/ui/dist/components/header/header.js"; // hot-* components you use
|
|
192
162
|
```
|
|
193
163
|
|
|
194
164
|
```html
|
|
195
165
|
<hot-header title="My App"></hot-header>
|
|
196
166
|
```
|
|
197
167
|
|
|
168
|
+
Put WebAwesome in its own long-lived chunk so app deploys don't invalidate
|
|
169
|
+
the browser-cached copy:
|
|
170
|
+
|
|
171
|
+
```js
|
|
172
|
+
// vite.config.ts
|
|
173
|
+
build: {
|
|
174
|
+
rollupOptions: {
|
|
175
|
+
output: {
|
|
176
|
+
manualChunks(id) {
|
|
177
|
+
if (id.includes("@awesome.me/webawesome")) return "webawesome";
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
Byte-critical app? Skip `webawesome-all.js` and cherry-pick individual
|
|
185
|
+
WebAwesome components instead - then add the `wa-cloak` class to `<html>`
|
|
186
|
+
as a FOUCE backstop (pure CSS, ships in WebAwesome's `utilities.css`,
|
|
187
|
+
already included in `style.css`).
|
|
188
|
+
|
|
198
189
|
### Via CDN / Plain HTML / HTMX
|
|
199
190
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
191
|
+
Load the raw dist files, with an import map to resolve the bare
|
|
192
|
+
`@awesome.me/webawesome/...` imports in `webawesome-all.js`. The map's
|
|
193
|
+
WebAwesome pin must match the version this `@hotosm/ui` release was
|
|
194
|
+
built against. Do not use jsDelivr's `/+esm` URLs - they duplicate
|
|
195
|
+
element registrations and most `wa-*` elements never register.
|
|
196
|
+
|
|
197
|
+
<!-- markdownlint-disable MD013 -->
|
|
203
198
|
|
|
204
199
|
```html
|
|
205
200
|
<!DOCTYPE html>
|
|
206
|
-
|
|
201
|
+
<!-- wa-cloak: hides the page until all custom elements are defined (2s max) -->
|
|
202
|
+
<html class="wa-theme-default wa-palette-hotosm wa-cloak">
|
|
207
203
|
<head>
|
|
208
|
-
<!--
|
|
209
|
-
<link
|
|
210
|
-
rel="stylesheet"
|
|
211
|
-
href="https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3.2.1/dist/styles/native.css"
|
|
212
|
-
/>
|
|
213
|
-
<link
|
|
214
|
-
rel="stylesheet"
|
|
215
|
-
href="https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3.2.1/dist/styles/utilities.css"
|
|
216
|
-
/>
|
|
217
|
-
<link
|
|
218
|
-
rel="stylesheet"
|
|
219
|
-
href="https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3.2.1/dist/styles/themes/default.css"
|
|
220
|
-
/>
|
|
204
|
+
<!-- Fonts: see "Fonts" above -->
|
|
221
205
|
|
|
222
|
-
<!--
|
|
223
|
-
|
|
224
|
-
<link
|
|
225
|
-
rel="stylesheet"
|
|
226
|
-
href="https://cdn.jsdelivr.net/npm/@hotosm/ui@0.6.1/dist/style-core.css"
|
|
227
|
-
/>
|
|
206
|
+
<!-- WebAwesome base styles + HOT theme, self-contained -->
|
|
207
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@hotosm/ui@1.0.0/dist/style.css" />
|
|
228
208
|
|
|
229
|
-
<!-- Import map: resolves WebAwesome bare-module specifiers
|
|
230
|
-
inside hotosm-ui.js -->
|
|
231
|
-
<!-- WA components load lazily from CDN only when first used;
|
|
232
|
-
no separate loader needed -->
|
|
233
209
|
<script type="importmap">
|
|
234
210
|
{
|
|
235
211
|
"imports": {
|
|
236
|
-
"@awesome.me/webawesome/dist/components/": "https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3.
|
|
212
|
+
"@awesome.me/webawesome/dist/components/": "https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3.11.0/dist-cdn/components/"
|
|
237
213
|
}
|
|
238
214
|
}
|
|
239
215
|
</script>
|
|
240
216
|
|
|
241
|
-
<!--
|
|
217
|
+
<!-- Register every wa-* element, then the hot-* components -->
|
|
242
218
|
<script
|
|
243
219
|
type="module"
|
|
244
|
-
src="https://cdn.jsdelivr.net/npm/@hotosm/ui@0.
|
|
220
|
+
src="https://cdn.jsdelivr.net/npm/@hotosm/ui@1.0.0/dist/webawesome-all.js"
|
|
221
|
+
></script>
|
|
222
|
+
<script
|
|
223
|
+
type="module"
|
|
224
|
+
src="https://cdn.jsdelivr.net/npm/@hotosm/ui@1.0.0/dist/hotosm-ui.js"
|
|
245
225
|
></script>
|
|
246
226
|
</head>
|
|
247
227
|
|
|
@@ -258,11 +238,11 @@ all HOT tools (Option B from the styles section above):
|
|
|
258
238
|
</html>
|
|
259
239
|
```
|
|
260
240
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
241
|
+
<!-- markdownlint-enable MD013 -->
|
|
242
|
+
|
|
243
|
+
For multi-page (HTMX) apps, also inline a few critical theme tokens in
|
|
244
|
+
`<head>` so first paint looks right before the CDN CSS arrives - see
|
|
245
|
+
[Loading Strategies](https://hotosm.github.io/ui/?path=/docs/loading-strategies--docs).
|
|
266
246
|
|
|
267
247
|
### React
|
|
268
248
|
|
|
@@ -335,4 +315,4 @@ pnpm run dev # starts Storybook on localhost:3001
|
|
|
335
315
|
|
|
336
316
|
HOT UI is free and open source software. You may use any HOT UI project
|
|
337
317
|
under the terms of the
|
|
338
|
-
[GNU
|
|
318
|
+
[GNU General Public License (GPL) Version 3](LICENSE.md).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as t}from"./chunk.
|
|
1
|
+
import{b as t}from"./chunk.B77WIT2F.js";var a=t;customElements.get("hot-list-card")||customElements.define("hot-list-card",t);export{a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as M}from"./chunk.
|
|
1
|
+
import{a as M}from"./chunk.AYSFL7J5.js";import{a as f,b as m,c as z}from"./chunk.DVVFVLNQ.js";import{d as h,e as x,g as F}from"./chunk.HOF672RD.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`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as l,b as r}from"./chunk.
|
|
1
|
+
import{a as l,b as r}from"./chunk.DVVFVLNQ.js";import{a as g,d as h,g as b}from"./chunk.HOF672RD.js";import{d as t,e as s,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"),import("@awesome.me/webawesome/dist/components/dialog/dialog.js")]);var m,w,v,f,x,a=class extends b{constructor(){super(...arguments);this.name="hot-tracking";n(this,m,"");n(this,w,"");n(this,v,"https://matomo.hotosm.org");n(this,f,!0);n(this,x,"We use cookies and similar technologies to help personalize content, tailor and measure ads, and provide a better experience. By clicking 'Accept', you consent to our use of cookies and tracking technologies.");this.consentGiven=!1;this.consentShown=!1;this.errorMessage="";this.showError=!1;this.successMessage="";this.showSuccess=!1;this.infoMessage="";this.showInfo=!1}get siteId(){return s(this,m)}set siteId(e){i(this,m,e)}get domain(){return s(this,w)}set domain(e){i(this,w,e)}get matomoURL(){return s(this,v)}set matomoURL(e){i(this,v,e)}get showConsent(){return s(this,f)}set showConsent(e){i(this,f,e)}get consentMessage(){return s(this,x)}set consentMessage(e){i(this,x,e)}get consentKey(){return`hot-matomo-consent-${this.siteId}`}getStoredConsent(){let e=localStorage.getItem(this.consentKey);return e===null?null:e==="true"}setStoredConsent(e){localStorage.setItem(this.consentKey,String(e))}agree(){this.consentGiven=!0,this.consentShown=!1,this.setStoredConsent(!0);let e=window._paq=window._paq||[];e.push(["rememberConsentGiven"]),e.push(["trackPageView"]),this.showSuccessCallout("Tracking consent granted. Thank you!")}disagree(){this.consentGiven=!1,this.consentShown=!1,this.setStoredConsent(!1),(window._paq=window._paq||[]).push(["forgetConsentGiven"]),this.showInfoCallout("Tracking disabled. You can change this preference later.")}showConsentBanner(){this.showConsent&&!this.consentGiven&&!this.consentShown&&(this.consentShown=!0)}showErrorCallout(e){this.errorMessage=e,this.showError=!0,setTimeout(()=>{this.showError=!1},1e4)}showSuccessCallout(e){this.successMessage=e,this.showSuccess=!0,setTimeout(()=>{this.showSuccess=!1},5e3)}showInfoCallout(e){this.infoMessage=e,this.showInfo=!0,setTimeout(()=>{this.showInfo=!1},5e3)}render(){return h`
|
|
2
2
|
${this.showError?h`
|
|
3
3
|
<div class="error-banner">
|
|
4
4
|
<wa-callout style="padding: 1rem;" variant="danger" appearance="outlined filled" size="large">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as t}from"./chunk.
|
|
1
|
+
import{b as t}from"./chunk.54C4CCIE.js";var a=t;customElements.get("hot-tracking")||customElements.define("hot-tracking",t);export{a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as e}from"./chunk.
|
|
1
|
+
import{b as e}from"./chunk.HZNHTKN6.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 r}from"./chunk.
|
|
1
|
+
import{a as r}from"./chunk.TJOQKPXN.js";import{a as n}from"./chunk.DVVFVLNQ.js";import{d as a,g as c}from"./chunk.HOF672RD.js";import{d as t,e as s,f as o,g as i}from"./chunk.N2W26RCT.js";Promise.allSettled([import("@awesome.me/webawesome/dist/components/icon/icon.js")]);var h,m,d,v,u,y,e=class extends c{constructor(){super(...arguments);this.name="hot-list-card";o(this,h,"");o(this,m,"");o(this,d,"");o(this,v,"");o(this,u,!1);o(this,y,!1)}get title(){return s(this,h)}set title(l){i(this,h,l)}get subtitle(){return s(this,m)}set subtitle(l){i(this,m,l)}get icon(){return s(this,d)}set icon(l){i(this,d,l)}get itemId(){return s(this,v)}set itemId(l){i(this,v,l)}get showRemove(){return s(this,u)}set showRemove(l){i(this,u,l)}get showIcon(){return s(this,y)}set showIcon(l){i(this,y,l)}_handleRemove(){this.dispatchEvent(new CustomEvent("hot-remove",{detail:{id:this.itemId},bubbles:!0,composed:!0}))}_handleKeyDown(l){(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),this._handleRemove())}render(){let l=this.showIcon&&this.icon;return a`
|
|
2
2
|
<div class="list-item" role="listitem">
|
|
3
3
|
${l?a`<wa-icon name=${this.icon} class="list-icon" aria-hidden="true"></wa-icon>`:""}
|
|
4
4
|
<div class="list-info">
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as v}from"./chunk.HOF672RD.js";import{a as h,c as u}from"./chunk.N2W26RCT.js";function f(a){var r,e,t="";if(typeof a=="string"||typeof a=="number")t+=a;else if(typeof a=="object")if(Array.isArray(a)){var i=a.length;for(r=0;r<i;r++)a[r]&&(e=f(a[r]))&&(t&&(t+=" "),t+=e)}else for(e in a)a[e]&&(t&&(t+=" "),t+=e);return t}function x(){for(var a,r,e=0,t="",i=arguments.length;e<i;e++)(a=arguments[e])&&(r=f(a))&&(t&&(t+=" "),t+=r);return t}var b=a=>typeof a=="boolean"?`${a}`:a===0?"0":a,w=x,y=(a,r)=>e=>{var t;if((r==null?void 0:r.variants)==null)return w(a,e==null?void 0:e.class,e==null?void 0:e.className);let{variants:i,defaultVariants:d}=r,z=Object.keys(i).map(o=>{let n=e==null?void 0:e[o],s=d==null?void 0:d[o];if(n===null)return null;let l=b(n)||b(s);return i[o][l]}),g=e&&Object.entries(e).reduce((o,n)=>{let[s,l]=n;return l===void 0||(o[s]=l),o},{}),k=r==null||(t=r.compoundVariants)===null||t===void 0?void 0:t.reduce((o,n)=>{let c=n,{class:s,className:l}=c,j=u(c,["class","className"]);return Object.entries(j).every(V=>{let[p,m]=V;return Array.isArray(m)?m.includes(h(h({},d),g)[p]):h(h({},d),g)[p]===m})?[...o,s,l]:o},[]);return w(a,z,k,e==null?void 0:e.class,e==null?void 0:e.className)};var T=y("header",{variants:{size:{small:"header--size-small",medium:"header--size-medium",large:"header--size-large"}}}),U=v`
|
|
2
2
|
/* ================================================================
|
|
3
3
|
* Layout
|
|
4
4
|
* ================================================================ */
|
|
@@ -87,6 +87,7 @@ import{a as u}from"./chunk.QABMDRWR.js";import{a as h,c as v}from"./chunk.N2W26R
|
|
|
87
87
|
* Logo / title link
|
|
88
88
|
* ================================================================ */
|
|
89
89
|
|
|
90
|
+
/* Allow long titles to truncate without shrinking the logo. */
|
|
90
91
|
.header--link {
|
|
91
92
|
text-decoration: none;
|
|
92
93
|
display: flex;
|
|
@@ -94,12 +95,14 @@ import{a as u}from"./chunk.QABMDRWR.js";import{a as h,c as v}from"./chunk.N2W26R
|
|
|
94
95
|
justify-content: flex-start;
|
|
95
96
|
padding-right: var(--hot-spacing-2x-small);
|
|
96
97
|
gap: var(--hot-spacing-x-small);
|
|
97
|
-
flex-shrink:
|
|
98
|
+
flex-shrink: 1;
|
|
99
|
+
min-width: 0;
|
|
98
100
|
}
|
|
99
101
|
|
|
100
102
|
.header--link hot-logo {
|
|
101
103
|
display: flex;
|
|
102
104
|
align-items: center;
|
|
105
|
+
flex-shrink: 0;
|
|
103
106
|
}
|
|
104
107
|
|
|
105
108
|
.header--link .header--logo-img {
|
|
@@ -108,6 +111,7 @@ import{a as u}from"./chunk.QABMDRWR.js";import{a as h,c as v}from"./chunk.N2W26R
|
|
|
108
111
|
display: block;
|
|
109
112
|
object-fit: contain;
|
|
110
113
|
vertical-align: middle;
|
|
114
|
+
flex-shrink: 0;
|
|
111
115
|
}
|
|
112
116
|
|
|
113
117
|
.header--title {
|
|
@@ -117,10 +121,13 @@ import{a as u}from"./chunk.QABMDRWR.js";import{a as h,c as v}from"./chunk.N2W26R
|
|
|
117
121
|
margin: 0;
|
|
118
122
|
line-height: 1;
|
|
119
123
|
white-space: nowrap;
|
|
124
|
+
min-width: 0;
|
|
125
|
+
overflow: hidden;
|
|
126
|
+
text-overflow: ellipsis;
|
|
120
127
|
}
|
|
121
128
|
|
|
122
129
|
/* ================================================================
|
|
123
|
-
* Navigation (desktop tabs with
|
|
130
|
+
* Navigation (desktop tabs, with wa-tab-group's own scroll controls)
|
|
124
131
|
* Hidden on mobile; shown via media query below.
|
|
125
132
|
* ================================================================ */
|
|
126
133
|
|
|
@@ -146,32 +153,16 @@ import{a as u}from"./chunk.QABMDRWR.js";import{a as h,c as v}from"./chunk.N2W26R
|
|
|
146
153
|
display: none;
|
|
147
154
|
}
|
|
148
155
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
border: none;
|
|
156
|
+
/* Style WebAwesome's built-in overflow controls. */
|
|
157
|
+
.header--tab-group::part(scroll-button) {
|
|
152
158
|
color: var(--hot-color-neutral-500);
|
|
153
|
-
cursor: pointer;
|
|
154
|
-
padding: 0;
|
|
155
|
-
font-size: var(--hot-font-size-medium);
|
|
156
|
-
line-height: 1;
|
|
157
|
-
display: flex;
|
|
158
|
-
align-items: center;
|
|
159
|
-
justify-content: center;
|
|
160
159
|
flex-shrink: 0;
|
|
161
160
|
}
|
|
162
161
|
|
|
163
|
-
.header--
|
|
162
|
+
.header--tab-group::part(scroll-button):hover {
|
|
164
163
|
color: var(--hot-color-neutral-800);
|
|
165
164
|
}
|
|
166
165
|
|
|
167
|
-
.header--nav-arrow[disabled] {
|
|
168
|
-
opacity: 0;
|
|
169
|
-
pointer-events: none;
|
|
170
|
-
width: 0;
|
|
171
|
-
padding: 0;
|
|
172
|
-
overflow: hidden;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
166
|
.header--nav-mobile {
|
|
176
167
|
display: block;
|
|
177
168
|
width: 100%;
|
|
@@ -182,7 +173,7 @@ import{a as u}from"./chunk.QABMDRWR.js";import{a as h,c as v}from"./chunk.N2W26R
|
|
|
182
173
|
* Tabs
|
|
183
174
|
* ================================================================ */
|
|
184
175
|
|
|
185
|
-
.header--tab-group::part(
|
|
176
|
+
.header--tab-group::part(tab-group) {
|
|
186
177
|
--track-color: transparent;
|
|
187
178
|
--indicator-color: transparent;
|
|
188
179
|
}
|
|
@@ -196,7 +187,7 @@ import{a as u}from"./chunk.QABMDRWR.js";import{a as h,c as v}from"./chunk.N2W26R
|
|
|
196
187
|
justify-content: center;
|
|
197
188
|
}
|
|
198
189
|
|
|
199
|
-
.header--tab::part(
|
|
190
|
+
.header--tab::part(tab) {
|
|
200
191
|
font-size: var(--hot-font-size-medium);
|
|
201
192
|
font-weight: var(--hot-font-weight-bold);
|
|
202
193
|
color: var(--hot-color-neutral-600);
|
|
@@ -208,17 +199,17 @@ import{a as u}from"./chunk.QABMDRWR.js";import{a as h,c as v}from"./chunk.N2W26R
|
|
|
208
199
|
white-space: nowrap;
|
|
209
200
|
}
|
|
210
201
|
|
|
211
|
-
.header--tab[active]::part(
|
|
202
|
+
.header--tab[active]::part(tab) {
|
|
212
203
|
color: var(--hot-color-neutral-800);
|
|
213
204
|
border-bottom-color: var(--hot-color-neutral-800);
|
|
214
205
|
}
|
|
215
206
|
|
|
216
|
-
.header--tab:hover::part(
|
|
207
|
+
.header--tab:hover::part(tab) {
|
|
217
208
|
color: var(--hot-color-neutral-800);
|
|
218
209
|
border-bottom-color: var(--hot-color-neutral-300);
|
|
219
210
|
}
|
|
220
211
|
|
|
221
|
-
.header--tab[active]:hover::part(
|
|
212
|
+
.header--tab[active]:hover::part(tab) {
|
|
222
213
|
color: var(--hot-color-neutral-900);
|
|
223
214
|
border-bottom-color: var(--hot-color-neutral-900);
|
|
224
215
|
}
|
|
@@ -235,8 +226,7 @@ import{a as u}from"./chunk.QABMDRWR.js";import{a as h,c as v}from"./chunk.N2W26R
|
|
|
235
226
|
flex-shrink: 0;
|
|
236
227
|
}
|
|
237
228
|
|
|
238
|
-
/*
|
|
239
|
-
* through their drawer-* counterparts inside the sidebar. */
|
|
229
|
+
/* Use the drawer-specific auth and language slots on mobile. */
|
|
240
230
|
@media (max-width: 768px) {
|
|
241
231
|
.header--lang-slot,
|
|
242
232
|
.header--auth-slot {
|
|
@@ -258,10 +248,7 @@ import{a as u}from"./chunk.QABMDRWR.js";import{a as h,c as v}from"./chunk.N2W26R
|
|
|
258
248
|
padding: 0.5rem;
|
|
259
249
|
}
|
|
260
250
|
|
|
261
|
-
/*
|
|
262
|
-
* When drawer is not explicitly enabled but tabs exist, show the
|
|
263
|
-
* hamburger only on mobile so users can still reach the nav items.
|
|
264
|
-
*/
|
|
251
|
+
/* Hide the automatic tab drawer button on desktop. */
|
|
265
252
|
.header--drawer-mobile-only {
|
|
266
253
|
display: inline-flex;
|
|
267
254
|
}
|
|
@@ -366,7 +353,7 @@ import{a as u}from"./chunk.QABMDRWR.js";import{a as h,c as v}from"./chunk.N2W26R
|
|
|
366
353
|
font-size: var(--hot-font-size-medium);
|
|
367
354
|
}
|
|
368
355
|
|
|
369
|
-
.header--size-small .header--tab::part(
|
|
356
|
+
.header--size-small .header--tab::part(tab) {
|
|
370
357
|
font-size: var(--hot-font-size-small);
|
|
371
358
|
padding: var(--hot-spacing-x-small);
|
|
372
359
|
}
|
|
@@ -377,7 +364,7 @@ import{a as u}from"./chunk.QABMDRWR.js";import{a as h,c as v}from"./chunk.N2W26R
|
|
|
377
364
|
gap: var(--hot-spacing-2x-small);
|
|
378
365
|
}
|
|
379
366
|
|
|
380
|
-
.header--size-small .login-button::part(
|
|
367
|
+
.header--size-small .login-button::part(button) {
|
|
381
368
|
padding: var(--hot-spacing-3x-small) var(--hot-spacing-x-small);
|
|
382
369
|
font-size: var(--hot-font-size-small);
|
|
383
370
|
}
|
|
@@ -388,7 +375,7 @@ import{a as u}from"./chunk.QABMDRWR.js";import{a as h,c as v}from"./chunk.N2W26R
|
|
|
388
375
|
padding: 0;
|
|
389
376
|
}
|
|
390
377
|
|
|
391
|
-
.header--size-small .header--right-section wa-button[appearance="outlined"]::part(
|
|
378
|
+
.header--size-small .header--right-section wa-button[appearance="outlined"]::part(button) {
|
|
392
379
|
min-width: 1.5rem;
|
|
393
380
|
min-height: 1.5rem;
|
|
394
381
|
padding: var(--hot-spacing-3x-small);
|
|
@@ -413,7 +400,7 @@ import{a as u}from"./chunk.QABMDRWR.js";import{a as h,c as v}from"./chunk.N2W26R
|
|
|
413
400
|
max-height: 2.25rem;
|
|
414
401
|
}
|
|
415
402
|
|
|
416
|
-
.header--size-medium .login-button::part(
|
|
403
|
+
.header--size-medium .login-button::part(button) {
|
|
417
404
|
padding: var(--hot-spacing-2x-small) var(--hot-spacing-x-small);
|
|
418
405
|
font-size: var(--hot-font-size-small);
|
|
419
406
|
}
|
|
@@ -424,7 +411,7 @@ import{a as u}from"./chunk.QABMDRWR.js";import{a as h,c as v}from"./chunk.N2W26R
|
|
|
424
411
|
padding: 0;
|
|
425
412
|
}
|
|
426
413
|
|
|
427
|
-
.header--size-medium .header--right-section wa-button[appearance="outlined"]::part(
|
|
414
|
+
.header--size-medium .header--right-section wa-button[appearance="outlined"]::part(button) {
|
|
428
415
|
min-width: 2rem;
|
|
429
416
|
min-height: 2rem;
|
|
430
417
|
padding: var(--hot-spacing-2x-small);
|
|
@@ -554,6 +541,13 @@ import{a as u}from"./chunk.QABMDRWR.js";import{a as h,c as v}from"./chunk.N2W26R
|
|
|
554
541
|
color: var(--hot-color-primary-600);
|
|
555
542
|
}
|
|
556
543
|
|
|
544
|
+
/* Mirror of the desktop underline, so the drawer shows the current page too */
|
|
545
|
+
.drawer-nav-button--active {
|
|
546
|
+
font-weight: var(--hot-font-weight-bold);
|
|
547
|
+
box-shadow: inset 3px 0 0 0 var(--hot-color-neutral-800);
|
|
548
|
+
padding-left: var(--hot-spacing-x-small);
|
|
549
|
+
}
|
|
550
|
+
|
|
557
551
|
.drawer-separator {
|
|
558
552
|
border: 0;
|
|
559
553
|
border-top: 1px solid var(--hot-color-neutral-100);
|
|
@@ -592,4 +586,4 @@ import{a as u}from"./chunk.QABMDRWR.js";import{a as h,c as v}from"./chunk.N2W26R
|
|
|
592
586
|
display: none;
|
|
593
587
|
}
|
|
594
588
|
}
|
|
595
|
-
`;export{T as a,
|
|
589
|
+
`;export{T as a,U as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as l,b as g}from"./chunk.
|
|
1
|
+
import{a as l,b as g}from"./chunk.DVVFVLNQ.js";import{a as f,d as u,g as v}from"./chunk.HOF672RD.js";import{d as s,e as r,f as a,g as o}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 $=["brand","success","neutral","warning"],N=new RegExp(`\\[([^\\]]+)\\]\\((https?:\\/\\/[^\\s)]+)\\)|(?<=^|[\\s(])(https?:\\/\\/[^\\s<"]+[^\\s<".,:;')\\]])`,"g");function y(h){if(typeof h!="string"||h.length===0)return null;let m=new Date(h);return Number.isNaN(m.getTime())?null:m}var w,x,A,k,C,S,V,e=class extends v{constructor(){super(...arguments);this.name="hot-announcement";a(this,w,"");a(this,x,"");a(this,A,"");a(this,k,"brand");a(this,C,"Dismiss");a(this,S,"hot-announcement");a(this,V,"");this.visible=!1;this.startsAt=null;this.endsAt=null;this.fetchAbort=null}get version(){return r(this,w)}set version(t){o(this,w,t)}get title(){return r(this,x)}set title(t){o(this,x,t)}get message(){return r(this,A)}set message(t){o(this,A,t)}get variant(){return r(this,k)}set variant(t){o(this,k,t)}get dismissLabel(){return r(this,C)}set dismissLabel(t){o(this,C,t)}get storageKey(){return r(this,S)}set storageKey(t){o(this,S,t)}get src(){return r(this,V)}set src(t){o(this,V,t)}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()}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.fetchAbort)==null||t.abort(),this.fetchAbort=null}willUpdate(t){if(t.has("src")&&this.src.length>0){this._loadRemoteConfig();return}(t.has("version")||t.has("storageKey"))&&this._evaluateVisibility()}async _loadRemoteConfig(){var i;(i=this.fetchAbort)==null||i.abort();let t=new AbortController;this.fetchAbort=t,this.visible=!1;try{let n=await fetch(this.src,{signal:t.signal});if(!n.ok)return;let d=await n.text();if(d.trim().length===0)return;let c=JSON.parse(d);this._applyRemoteConfig(c)}catch(n){if(n.name==="AbortError")return}finally{this.fetchAbort===t&&(this.fetchAbort=null)}}_applyRemoteConfig(t){typeof t.version=="string"&&(this.version=t.version),typeof t.title=="string"&&(this.title=t.title),typeof t.message=="string"&&(this.message=t.message),typeof t.variant=="string"&&$.includes(t.variant)&&(this.variant=t.variant),this.startsAt=y(t.startsAt),this.endsAt=y(t.endsAt),this._evaluateVisibility()}_evaluateVisibility(){if(this.version.length===0){this.src.length===0&&console.warn("[hot-announcement] `version` is required so dismissal can be keyed per release. Banner hidden."),this.visible=!1;return}let t=Date.now();if(this.startsAt&&t<this.startsAt.getTime()){this.visible=!1;return}if(this.endsAt&&t>this.endsAt.getTime()){this.visible=!1;return}let i=localStorage.getItem(this.storageFullKey())==="true";this.visible=!i}renderMessage(){let t=[],i=0;for(let n of this.message.matchAll(N)){let[d,c,p,b]=n,R=p!=null?p:b;t.push(this.message.slice(i,n.index)),t.push(u`<a href="${R}" target="_blank" rel="noopener noreferrer"
|
|
2
2
|
>${c!=null?c:b}</a
|
|
3
3
|
>`),i=n.index+d.length}return t.length===0?this.message:(t.push(this.message.slice(i)),t)}render(){return this.visible?u`
|
|
4
4
|
<div class="announcement-banner" role="status">
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as d,c as m}from"./chunk.
|
|
1
|
+
import{b as d,c as m}from"./chunk.HOF672RD.js";import{a as l,b as p}from"./chunk.N2W26RCT.js";var y={attribute:!0,type:String,converter:d,reflect:!1,hasChanged:m},g=(e=y,s,t)=>{let{kind:a,metadata:c}=t,i=globalThis.litPropertyMetadata.get(c);if(i===void 0&&globalThis.litPropertyMetadata.set(c,i=new Map),a==="setter"&&((e=Object.create(e)).wrapped=!0),i.set(t.name,e),a==="accessor"){let{name:n}=t;return{set(o){let r=s.get.call(this);s.set.call(this,o),this.requestUpdate(n,r,e,!0,o)},init(o){return o!==void 0&&this.C(n,void 0,e,o),o}}}if(a==="setter"){let{name:n}=t;return function(o){let r=this[n];s.call(this,o),this.requestUpdate(n,r,e,!0,o)}}throw Error("Unsupported decorator location: "+a)};function f(e){return(s,t)=>typeof t=="object"?g(e,s,t):((a,c,i)=>{let n=c.hasOwnProperty(i);return c.constructor.createProperty(i,a),n?Object.getOwnPropertyDescriptor(c,i):void 0})(e,s,t)}function v(e){return f(p(l({},e),{state:!0,attribute:!1}))}var u=(e,s,t)=>(t.configurable=!0,t.enumerable=!0,Reflect.decorate&&typeof s!="object"&&Object.defineProperty(e,s,t),t);function S(e,s){return(t,a,c)=>{let i=n=>{var o,r;return(r=(o=n.renderRoot)==null?void 0:o.querySelector(e))!=null?r:null};if(s){let{get:n,set:o}=typeof a=="object"?t:c!=null?c:(()=>{let r=Symbol();return{get(){return this[r]},set(h){this[r]=h}}})();return u(t,a,{get(){let r=n.call(this);return r===void 0&&(r=i(this),(r!==null||this.hasUpdated)&&o.call(this,r)),r}})}return u(t,a,{get(){return i(this)}})}}export{f as a,v as b,S as c};
|
|
2
2
|
/*! Bundled license information:
|
|
3
3
|
|
|
4
4
|
@lit/reactive-element/decorators/property.js:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as e}from"./chunk.
|
|
1
|
+
import{b as e}from"./chunk.45EZ2EC2.js";var t=e;customElements.get("hot-file-input-dropzone")||customElements.define("hot-file-input-dropzone",e);export{t as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as o}from"./chunk.
|
|
1
|
+
import{b as o}from"./chunk.LH3TTPVQ.js";var t=o;customElements.get("hotosm-tool-menu")||customElements.define("hotosm-tool-menu",o);export{t as a};
|