@hotosm/ui 0.6.1 → 0.7.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 (54) hide show
  1. package/README.md +231 -139
  2. package/dist/chunks/{chunk.GEAU3JJH.js → chunk.252GL6HT.js} +11 -11
  3. package/dist/chunks/{chunk.JVUHDRTK.js → chunk.2Y7OBKRQ.js} +1 -1
  4. package/dist/chunks/{chunk.AL4CJN73.js → chunk.5QY2VLMG.js} +1 -1
  5. package/dist/chunks/{chunk.J7OUGJBS.js → chunk.6BGQ256H.js} +2 -2
  6. package/dist/chunks/{chunk.7TYQYCSB.js → chunk.7JIKOYG6.js} +1 -1
  7. package/dist/chunks/{chunk.3LBUXCAP.js → chunk.APYFF2XE.js} +1 -1
  8. package/dist/chunks/{chunk.2Y2ST5QL.js → chunk.BVHLTKMC.js} +1 -1
  9. package/dist/chunks/{chunk.QWZJAW2S.js → chunk.CNUZFRRF.js} +2 -2
  10. package/dist/chunks/{chunk.LHZ7Q2M3.js → chunk.FDQFFQX3.js} +5 -5
  11. package/dist/chunks/chunk.FN6G7X23.js +251 -0
  12. package/dist/chunks/{chunk.OICCPCO3.js → chunk.IILWGAOM.js} +1 -1
  13. package/dist/chunks/{chunk.G6ZZSFVM.js → chunk.JYPMFVPO.js} +1 -1
  14. package/dist/chunks/chunk.LKMWWUYT.js +20 -0
  15. package/dist/chunks/{chunk.BD4Q32VT.js → chunk.LVCDAVRU.js} +4 -4
  16. package/dist/chunks/{chunk.ARF626EG.js → chunk.LXN3PNAP.js} +1 -1
  17. package/dist/chunks/chunk.P6GWPFCT.js +32 -0
  18. package/dist/chunks/{chunk.7BVHA4G6.js → chunk.X354U5TL.js} +3 -3
  19. package/dist/chunks/{chunk.DDWCUURX.js → chunk.XU6UFL27.js} +4 -4
  20. package/dist/chunks/{chunk.MZOQNTPX.js → chunk.ZGC6XD6L.js} +37 -56
  21. package/dist/components/consent/consent.component.d.ts +0 -3
  22. package/dist/components/consent/consent.component.js +1 -1
  23. package/dist/components/consent/consent.js +1 -1
  24. package/dist/components/consent/consent.styles.js +1 -1
  25. package/dist/components/file-input-dropzone/file-input-dropzone.component.d.ts +0 -2
  26. package/dist/components/file-input-dropzone/file-input-dropzone.component.js +1 -1
  27. package/dist/components/file-input-dropzone/file-input-dropzone.js +1 -1
  28. package/dist/components/file-input-dropzone/file-input-dropzone.styles.js +1 -1
  29. package/dist/components/header/header.component.d.ts +0 -4
  30. package/dist/components/header/header.component.js +1 -1
  31. package/dist/components/header/header.js +1 -1
  32. package/dist/components/header/header.styles.js +1 -1
  33. package/dist/components/list-card/list-card.component.d.ts +0 -1
  34. package/dist/components/list-card/list-card.component.js +1 -1
  35. package/dist/components/list-card/list-card.js +1 -1
  36. package/dist/components/list-card/list-card.styles.js +1 -1
  37. package/dist/components/logo/logo.component.js +1 -1
  38. package/dist/components/logo/logo.js +1 -1
  39. package/dist/components/tool-menu/tool-menu.component.d.ts +0 -3
  40. package/dist/components/tool-menu/tool-menu.component.js +1 -1
  41. package/dist/components/tool-menu/tool-menu.js +1 -1
  42. package/dist/components/tool-menu/tool-menu.styles.js +1 -1
  43. package/dist/components/tracking/tracking.component.d.ts +0 -3
  44. package/dist/components/tracking/tracking.component.js +1 -1
  45. package/dist/components/tracking/tracking.js +1 -1
  46. package/dist/hotosm-ui.js +1 -1
  47. package/dist/style-core.css +1 -0
  48. package/dist/style.css +1 -1
  49. package/dist/themes/hot-wa.css +152 -115
  50. package/dist/themes/hot.css +1 -1
  51. package/package.json +4 -2
  52. package/dist/chunks/chunk.CQO3GWTI.js +0 -32
  53. package/dist/chunks/chunk.PLECT4NZ.js +0 -20
  54. package/dist/chunks/chunk.U4AAC5ID.js +0 -239
@@ -1,239 +0,0 @@
1
- import{a as c,b as r}from"./chunk.ZETV7TDG.js";import{a as b,d as l,f as u}from"./chunk.QABMDRWR.js";import{d as a,e as n,f as s,g as i}from"./chunk.N2W26RCT.js";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 w,m,f,x,v,t=class extends u{constructor(){super(...arguments);this.name="hot-tracking";s(this,w,"");s(this,m,"");s(this,f,"https://matomo.hotosm.org");s(this,x,!0);s(this,v,"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 n(this,w)}set siteId(e){i(this,w,e)}get domain(){return n(this,m)}set domain(e){i(this,m,e)}get matomoURL(){return n(this,f)}set matomoURL(e){i(this,f,e)}get showConsent(){return n(this,x)}set showConsent(e){i(this,x,e)}get consentMessage(){return n(this,v)}set consentMessage(e){i(this,v,e)}agree(){this.consentGiven=!0,this.consentShown=!1;let e=window._paq=window._paq||[];e.length!==0&&(e.push(["rememberConsentGiven"]),e.push(["trackPageView"]),this.showSuccessCallout("Tracking consent granted. Thank you!"))}disagree(){this.consentGiven=!1,this.consentShown=!1;let e=window._paq=window._paq||[];e.length!==0&&(e.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 l`
2
- ${this.showError?l`
3
- <div class="error-banner">
4
- <wa-callout style="padding: 1rem;" variant="danger" appearance="outlined filled" size="large">
5
- <wa-icon slot="icon" family="classic" variant="solid" name="circle-exclamation"></wa-icon>
6
- <div style="padding: 0 1rem;">
7
- <strong>Tracking Configuration Error</strong><br />
8
- ${this.errorMessage}
9
- </div>
10
- </wa-callout>
11
- </div>
12
- `:""}
13
-
14
- ${this.showSuccess?l`
15
- <div class="toast-banner">
16
- <wa-callout style="padding: 1rem;" variant="success" appearance="outlined accent" size="medium">
17
- <wa-icon slot="icon" family="classic" variant="solid" name="circle-check"></wa-icon>
18
- <div style="padding: 0 1rem;">
19
- <strong>Success!</strong><br />
20
- ${this.successMessage}
21
- </div>
22
- </wa-callout>
23
- </div>
24
- `:""}
25
-
26
- ${this.showInfo?l`
27
- <div class="toast-banner">
28
- <wa-callout style="padding: 1rem;" variant="brand" appearance="outlined filled" size="medium">
29
- <wa-icon slot="icon" family="classic" variant="solid" name="circle-info"></wa-icon>
30
- <div style="padding: 0 1rem;">
31
- <strong>Information</strong><br />
32
- ${this.infoMessage}
33
- </div>
34
- </wa-callout>
35
- </div>
36
- `:""}
37
-
38
- ${this.consentShown?l`
39
- <div class="consent-banner">
40
- <wa-callout variant="brand" appearance="outlined filled" size="large">
41
- <wa-icon slot="icon" family="classic" variant="solid" name="shield-check"></wa-icon>
42
- <div style="padding: 1rem;">
43
- <strong>Privacy & Tracking</strong><br />
44
- ${this.consentMessage}
45
- <div class="consent-actions">
46
- <wa-button size="small" variant="neutral" @click=${e=>{e.preventDefault(),e.stopPropagation(),this.disagree()}}>
47
- Decline
48
- </wa-button>
49
- <wa-button size="small" variant="brand" @click=${e=>{e.preventDefault(),e.stopPropagation(),this.agree()}}>
50
- Accept
51
- </wa-button>
52
- </div>
53
- </div>
54
- </wa-callout>
55
- </div>
56
- `:""}
57
- `}connectedCallback(){if(super.connectedCallback(),window.location.hostname!==this.domain){this.showErrorCallout(`Matomo tracking is not configured for this domain. Current domain: ${window.location.hostname}, Expected: ${this.domain}`);return}let e=this.siteId;if(e.length===0||this.domain.length===0){this.showErrorCallout("Matomo tracking is not properly configured. Please provide both site-id and domain attributes.");return}let o=window._paq=window._paq||[];o.push(["requireConsent"]),o.push(["setDomains",[this.domain]]),o.push(["enableLinkTracking"]),o.push(["trackVisibleContentImpressions"]),(function(h){o.push(["setTrackerUrl",`${h}/matomo.php`]),o.push(["setSiteId",e]);let g=document,p=g.createElement("script"),d=g.getElementsByTagName("script")[0];(d==null?void 0:d.parentNode)!=null?(p.async=!0,p.src=`${h}/matomo.js`,d.parentNode.insertBefore(p,d)):console.warn("Script insertion failed. Parent node is null.")})(this.matomoURL),setTimeout(()=>{this.showConsentBanner()},1e3)}};w=new WeakMap,m=new WeakMap,f=new WeakMap,x=new WeakMap,v=new WeakMap,t.styles=b`
58
- :host {
59
- display: block;
60
- font-family: var(--wa-font-sans);
61
- }
62
-
63
- .consent-banner {
64
- position: fixed;
65
- bottom: 0;
66
- left: 0;
67
- right: 0;
68
- z-index: 1000;
69
- padding: 1rem;
70
- background: rgba(255, 255, 255, 0.95);
71
- backdrop-filter: blur(10px);
72
- border-top: 1px solid rgba(0, 0, 0, 0.1);
73
- }
74
-
75
- .error-banner {
76
- position: fixed;
77
- top: 1rem;
78
- left: 1rem;
79
- right: 1rem;
80
- z-index: 1001;
81
- max-width: 600px;
82
- margin: 0 auto;
83
- }
84
-
85
- .toast-banner {
86
- position: fixed;
87
- top: 1rem;
88
- right: 1rem;
89
- z-index: 1002;
90
- max-width: 450px;
91
- animation: slideIn 0.3s ease-out;
92
- }
93
-
94
- @keyframes slideIn {
95
- from {
96
- transform: translateX(100%);
97
- opacity: 0;
98
- }
99
- to {
100
- transform: translateX(0);
101
- opacity: 1;
102
- }
103
- }
104
-
105
- .consent-actions {
106
- display: flex;
107
- gap: 0.75rem;
108
- margin-top: 1rem;
109
- justify-content: flex-end;
110
- }
111
-
112
- wa-callout {
113
- --wa-callout-spacing: 1.5rem;
114
- box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
115
- border-radius: 12px;
116
- border: 1px solid rgba(0, 0, 0, 0.08);
117
- backdrop-filter: blur(8px);
118
- }
119
-
120
- wa-button {
121
- min-width: 80px;
122
- font-weight: 500;
123
- transition: all 0.2s ease;
124
- }
125
-
126
- wa-button:hover {
127
- transform: translateY(-1px);
128
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
129
- }
130
-
131
- .error-banner wa-callout {
132
- border-radius: 16px;
133
- box-shadow: 0 16px 48px rgba(243, 77, 71, 0.2);
134
- border: 1px solid rgba(243, 77, 71, 0.2);
135
- background: linear-gradient(135deg, rgba(254, 236, 239, 0.95), rgba(253, 208, 214, 0.95));
136
- }
137
-
138
- .error-banner wa-callout::before {
139
- content: '';
140
- position: absolute;
141
- top: 0;
142
- left: 0;
143
- right: 0;
144
- height: 4px;
145
- background: linear-gradient(90deg, var(--hot-color-red-500), var(--hot-color-red-600), var(--hot-color-red-700));
146
- border-radius: 16px 16px 0 0;
147
- }
148
-
149
- .toast-banner wa-callout {
150
- border-radius: 14px;
151
- box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
152
- border: 1px solid rgba(0, 0, 0, 0.06);
153
- background: rgba(255, 255, 255, 0.98);
154
- backdrop-filter: blur(12px);
155
- }
156
-
157
- .toast-banner wa-callout[variant="success"] {
158
- box-shadow: 0 12px 40px rgba(34, 197, 94, 0.15);
159
- border: 1px solid rgba(34, 197, 94, 0.2);
160
- background: linear-gradient(135deg, rgba(240, 253, 244, 0.95), rgba(220, 252, 231, 0.95));
161
- }
162
-
163
- .toast-banner wa-callout[variant="success"]::before {
164
- content: '';
165
- position: absolute;
166
- top: 0;
167
- left: 0;
168
- right: 0;
169
- height: 3px;
170
- background: linear-gradient(90deg, #22c55e, #16a34a);
171
- border-radius: 14px 14px 0 0;
172
- }
173
-
174
- .toast-banner wa-callout[variant="brand"] {
175
- box-shadow: 0 12px 40px rgba(243, 77, 71, 0.15);
176
- border: 1px solid rgba(243, 77, 71, 0.2);
177
- background: linear-gradient(135deg, rgba(254, 236, 239, 0.95), rgba(253, 208, 214, 0.95));
178
- }
179
-
180
- .toast-banner wa-callout[variant="brand"]::before {
181
- content: '';
182
- position: absolute;
183
- top: 0;
184
- left: 0;
185
- right: 0;
186
- height: 3px;
187
- background: linear-gradient(90deg, var(--hot-color-red-500), var(--hot-color-red-600));
188
- border-radius: 14px 14px 0 0;
189
- }
190
-
191
- .consent-banner wa-callout {
192
- border-radius: 16px;
193
- box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
194
- border: 1px solid rgba(0, 0, 0, 0.08);
195
- background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(249, 250, 251, 0.98));
196
- backdrop-filter: blur(16px);
197
- }
198
-
199
- .consent-banner wa-callout::before {
200
- content: '';
201
- position: absolute;
202
- top: 0;
203
- left: 0;
204
- right: 0;
205
- height: 4px;
206
- background: linear-gradient(90deg, var(--hot-color-red-500), var(--hot-color-red-600), var(--hot-color-red-700));
207
- border-radius: 16px 16px 0 0;
208
- }
209
-
210
- wa-icon {
211
- filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
212
- }
213
-
214
- @media (max-width: 768px) {
215
- .consent-banner {
216
- padding: 0.75rem;
217
- }
218
-
219
- .error-banner {
220
- left: 0.5rem;
221
- right: 0.5rem;
222
- max-width: none;
223
- }
224
-
225
- .toast-banner {
226
- right: 0.5rem;
227
- max-width: calc(100vw - 1rem);
228
- }
229
-
230
- .consent-actions {
231
- flex-direction: column;
232
- gap: 0.5rem;
233
- }
234
-
235
- wa-button {
236
- width: 100%;
237
- }
238
- }
239
- `,a([c({type:String,attribute:"site-id"})],t.prototype,"siteId",1),a([c({type:String})],t.prototype,"domain",1),a([c({type:String})],t.prototype,"matomoURL",1),a([c({type:Boolean,attribute:"show-consent"})],t.prototype,"showConsent",1),a([c({type:String,attribute:"consent-message"})],t.prototype,"consentMessage",1),a([r()],t.prototype,"consentGiven",2),a([r()],t.prototype,"consentShown",2),a([r()],t.prototype,"errorMessage",2),a([r()],t.prototype,"showError",2),a([r()],t.prototype,"successMessage",2),a([r()],t.prototype,"showSuccess",2),a([r()],t.prototype,"infoMessage",2),a([r()],t.prototype,"showInfo",2);var q=t;export{t as a,q as b};