@hotosm/ui 0.3.1-b1 → 0.3.1-b3
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/button.LEHBRWP3.js +1 -0
- package/dist/chunks/callout.USQGOL5A.js +69 -0
- package/dist/chunks/{chunk.DQ7UCE7O.js → chunk.4YLAIDAG.js} +1 -1
- package/dist/chunks/chunk.6ZDEZIWM.js +73 -0
- package/dist/chunks/chunk.7VBX4GII.js +1 -0
- package/dist/chunks/chunk.BPVA67NM.js +94 -0
- package/dist/chunks/chunk.FIQQYKEP.js +14 -0
- package/dist/chunks/{chunk.N5L63ITD.js → chunk.IG27I42A.js} +1 -1
- package/dist/chunks/{chunk.XYLRVYKD.js → chunk.IWVLJ74K.js} +2 -2
- package/dist/chunks/chunk.KPZVTN5G.js +460 -0
- package/dist/chunks/chunk.NI7UJOOZ.js +1 -0
- package/dist/chunks/chunk.OHRBDQCO.js +45 -0
- package/dist/chunks/{chunk.277I73JI.js → chunk.T4GALJJA.js} +1 -1
- package/dist/chunks/chunk.TFICHQZE.js +186 -0
- package/dist/chunks/chunk.U4P7XQR4.js +40 -0
- package/dist/chunks/{chunk.TVZQJVLS.js → chunk.UTSKEKTV.js} +1 -1
- package/dist/chunks/{chunk.TJK2P3MY.js → chunk.XCJG4HAO.js} +3 -3
- package/dist/chunks/dialog.7CZCE2KM.js +217 -0
- package/dist/chunks/icon.ZB6BUFKB.js +1 -0
- package/dist/chunks/tab-group.JN54CODM.js +360 -0
- package/dist/components/consent/consent.component.d.ts +0 -3
- 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/header/header.component.d.ts +0 -3
- 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/icons.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/tracking/tracking.component.d.ts +0 -3
- 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/package.json +4 -3
- package/dist/chunks/chunk.2C7KHCNI.js +0 -40
- package/dist/chunks/chunk.3BMRK6RX.js +0 -94
- package/dist/chunks/chunk.6QXNTVCU.js +0 -1
- package/dist/chunks/chunk.7P5E5KMI.js +0 -73
- package/dist/chunks/chunk.BLTVEIFI.js +0 -1
- package/dist/chunks/chunk.GRD7DOAE.js +0 -14
- package/dist/chunks/chunk.GTA7FK6E.js +0 -1
- package/dist/chunks/chunk.H27BHZTL.js +0 -1
- package/dist/chunks/chunk.NK4IZUTO.js +0 -1
- package/dist/chunks/chunk.PICS5Z5K.js +0 -1
- package/dist/chunks/chunk.RGDK5VTE.js +0 -1
- package/dist/chunks/chunk.V76UU3GK.js +0 -1
- package/dist/chunks/chunk.W5TPMQK4.js +0 -1
- package/dist/react/consent/index.js +0 -1
- package/dist/react/header/index.js +0 -1
- package/dist/react/index.js +0 -1
- package/dist/react/logo/index.js +0 -1
- package/dist/react/tracking/index.js +0 -1
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
var o=`@layer wa-utilities {
|
|
2
|
+
:host([size='small']),
|
|
3
|
+
.wa-size-s {
|
|
4
|
+
font-size: var(--wa-font-size-s);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
:host([size='medium']),
|
|
8
|
+
.wa-size-m {
|
|
9
|
+
font-size: var(--wa-font-size-m);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
:host([size='large']),
|
|
13
|
+
.wa-size-l {
|
|
14
|
+
font-size: var(--wa-font-size-l);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
`;var a=`@layer wa-utilities {
|
|
18
|
+
/** Register color properties so that the space toggle hack can work. */
|
|
19
|
+
@property --wa-color-fill-loud {
|
|
20
|
+
syntax: '<color>';
|
|
21
|
+
inherits: true;
|
|
22
|
+
initial-value: transparent;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@property --wa-color-fill-normal {
|
|
26
|
+
syntax: '<color>';
|
|
27
|
+
inherits: true;
|
|
28
|
+
initial-value: transparent;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@property --wa-color-fill-quiet {
|
|
32
|
+
syntax: '<color>';
|
|
33
|
+
inherits: true;
|
|
34
|
+
initial-value: transparent;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@property --wa-color-border-loud {
|
|
38
|
+
syntax: '<color>';
|
|
39
|
+
inherits: true;
|
|
40
|
+
initial-value: transparent;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@property --wa-color-border-normal {
|
|
44
|
+
syntax: '<color>';
|
|
45
|
+
inherits: true;
|
|
46
|
+
initial-value: transparent;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@property --wa-color-border-quiet {
|
|
50
|
+
syntax: '<color>';
|
|
51
|
+
inherits: true;
|
|
52
|
+
initial-value: transparent;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@property --wa-color-on-loud {
|
|
56
|
+
syntax: '<color>';
|
|
57
|
+
inherits: true;
|
|
58
|
+
initial-value: transparent;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@property --wa-color-on-normal {
|
|
62
|
+
syntax: '<color>';
|
|
63
|
+
inherits: true;
|
|
64
|
+
initial-value: transparent;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@property --wa-color-on-quiet {
|
|
68
|
+
syntax: '<color>';
|
|
69
|
+
inherits: true;
|
|
70
|
+
initial-value: transparent;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Element defaults.
|
|
75
|
+
We want these to resolve to inherit when inside a variant, and only be applied when not inside an explicit variant.
|
|
76
|
+
*/
|
|
77
|
+
|
|
78
|
+
:host(wa-button),
|
|
79
|
+
button,
|
|
80
|
+
input[type='button'],
|
|
81
|
+
input[type='submit'],
|
|
82
|
+
:host(wa-tag) {
|
|
83
|
+
--wa-color-fill-loud: var(--wa-no-variant, var(--wa-color-neutral-fill-loud));
|
|
84
|
+
--wa-color-fill-normal: var(--wa-no-variant, var(--wa-color-neutral-fill-normal));
|
|
85
|
+
--wa-color-fill-quiet: var(--wa-no-variant, var(--wa-color-neutral-fill-quiet));
|
|
86
|
+
--wa-color-border-loud: var(--wa-no-variant, var(--wa-color-neutral-border-loud));
|
|
87
|
+
--wa-color-border-normal: var(--wa-no-variant, var(--wa-color-neutral-border-normal));
|
|
88
|
+
--wa-color-border-quiet: var(--wa-no-variant, var(--wa-color-neutral-border-quiet));
|
|
89
|
+
--wa-color-on-loud: var(--wa-no-variant, var(--wa-color-neutral-on-loud));
|
|
90
|
+
--wa-color-on-normal: var(--wa-no-variant, var(--wa-color-neutral-on-normal));
|
|
91
|
+
--wa-color-on-quiet: var(--wa-no-variant, var(--wa-color-neutral-on-quiet));
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
:host(wa-callout),
|
|
95
|
+
:host(wa-badge) {
|
|
96
|
+
--wa-color-fill-loud: var(--wa-no-variant, var(--wa-color-brand-fill-loud));
|
|
97
|
+
--wa-color-fill-normal: var(--wa-no-variant, var(--wa-color-brand-fill-normal));
|
|
98
|
+
--wa-color-fill-quiet: var(--wa-no-variant, var(--wa-color-brand-fill-quiet));
|
|
99
|
+
--wa-color-border-loud: var(--wa-no-variant, var(--wa-color-brand-border-loud));
|
|
100
|
+
--wa-color-border-normal: var(--wa-no-variant, var(--wa-color-brand-border-normal));
|
|
101
|
+
--wa-color-border-quiet: var(--wa-no-variant, var(--wa-color-brand-border-quiet));
|
|
102
|
+
--wa-color-on-loud: var(--wa-no-variant, var(--wa-color-brand-on-loud));
|
|
103
|
+
--wa-color-on-normal: var(--wa-no-variant, var(--wa-color-brand-on-normal));
|
|
104
|
+
--wa-color-on-quiet: var(--wa-no-variant, var(--wa-color-brand-on-quiet));
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Variants
|
|
109
|
+
*/
|
|
110
|
+
|
|
111
|
+
:root,
|
|
112
|
+
.wa-neutral,
|
|
113
|
+
:host([variant='neutral']) {
|
|
114
|
+
--wa-color-fill-loud: var(--wa-color-neutral-fill-loud);
|
|
115
|
+
--wa-color-fill-normal: var(--wa-color-neutral-fill-normal);
|
|
116
|
+
--wa-color-fill-quiet: var(--wa-color-neutral-fill-quiet);
|
|
117
|
+
--wa-color-border-loud: var(--wa-color-neutral-border-loud);
|
|
118
|
+
--wa-color-border-normal: var(--wa-color-neutral-border-normal);
|
|
119
|
+
--wa-color-border-quiet: var(--wa-color-neutral-border-quiet);
|
|
120
|
+
--wa-color-on-loud: var(--wa-color-neutral-on-loud);
|
|
121
|
+
--wa-color-on-normal: var(--wa-color-neutral-on-normal);
|
|
122
|
+
--wa-color-on-quiet: var(--wa-color-neutral-on-quiet);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.wa-brand,
|
|
126
|
+
:host([variant='brand']) {
|
|
127
|
+
--wa-color-fill-loud: var(--wa-color-brand-fill-loud);
|
|
128
|
+
--wa-color-fill-normal: var(--wa-color-brand-fill-normal);
|
|
129
|
+
--wa-color-fill-quiet: var(--wa-color-brand-fill-quiet);
|
|
130
|
+
--wa-color-border-loud: var(--wa-color-brand-border-loud);
|
|
131
|
+
--wa-color-border-normal: var(--wa-color-brand-border-normal);
|
|
132
|
+
--wa-color-border-quiet: var(--wa-color-brand-border-quiet);
|
|
133
|
+
--wa-color-on-loud: var(--wa-color-brand-on-loud);
|
|
134
|
+
--wa-color-on-normal: var(--wa-color-brand-on-normal);
|
|
135
|
+
--wa-color-on-quiet: var(--wa-color-brand-on-quiet);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.wa-success,
|
|
139
|
+
:host([variant='success']) {
|
|
140
|
+
--wa-color-fill-loud: var(--wa-color-success-fill-loud);
|
|
141
|
+
--wa-color-fill-normal: var(--wa-color-success-fill-normal);
|
|
142
|
+
--wa-color-fill-quiet: var(--wa-color-success-fill-quiet);
|
|
143
|
+
--wa-color-border-loud: var(--wa-color-success-border-loud);
|
|
144
|
+
--wa-color-border-normal: var(--wa-color-success-border-normal);
|
|
145
|
+
--wa-color-border-quiet: var(--wa-color-success-border-quiet);
|
|
146
|
+
--wa-color-on-loud: var(--wa-color-success-on-loud);
|
|
147
|
+
--wa-color-on-normal: var(--wa-color-success-on-normal);
|
|
148
|
+
--wa-color-on-quiet: var(--wa-color-success-on-quiet);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.wa-warning,
|
|
152
|
+
:host([variant='warning']) {
|
|
153
|
+
--wa-color-fill-loud: var(--wa-color-warning-fill-loud);
|
|
154
|
+
--wa-color-fill-normal: var(--wa-color-warning-fill-normal);
|
|
155
|
+
--wa-color-fill-quiet: var(--wa-color-warning-fill-quiet);
|
|
156
|
+
--wa-color-border-loud: var(--wa-color-warning-border-loud);
|
|
157
|
+
--wa-color-border-normal: var(--wa-color-warning-border-normal);
|
|
158
|
+
--wa-color-border-quiet: var(--wa-color-warning-border-quiet);
|
|
159
|
+
--wa-color-on-loud: var(--wa-color-warning-on-loud);
|
|
160
|
+
--wa-color-on-normal: var(--wa-color-warning-on-normal);
|
|
161
|
+
--wa-color-on-quiet: var(--wa-color-warning-on-quiet);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.wa-danger,
|
|
165
|
+
:host([variant='danger']) {
|
|
166
|
+
--wa-color-fill-loud: var(--wa-color-danger-fill-loud);
|
|
167
|
+
--wa-color-fill-normal: var(--wa-color-danger-fill-normal);
|
|
168
|
+
--wa-color-fill-quiet: var(--wa-color-danger-fill-quiet);
|
|
169
|
+
--wa-color-border-loud: var(--wa-color-danger-border-loud);
|
|
170
|
+
--wa-color-border-normal: var(--wa-color-danger-border-normal);
|
|
171
|
+
--wa-color-border-quiet: var(--wa-color-danger-border-quiet);
|
|
172
|
+
--wa-color-on-loud: var(--wa-color-danger-on-loud);
|
|
173
|
+
--wa-color-on-normal: var(--wa-color-danger-on-normal);
|
|
174
|
+
--wa-color-on-quiet: var(--wa-color-danger-on-quiet);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.wa-neutral,
|
|
178
|
+
.wa-brand,
|
|
179
|
+
.wa-success,
|
|
180
|
+
.wa-warning,
|
|
181
|
+
.wa-danger,
|
|
182
|
+
:host([variant]) {
|
|
183
|
+
--wa-no-variant: /* space toggle */;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
`;export{o as a,a as b};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
var N=globalThis,L=N.ShadowRoot&&(N.ShadyCSS===void 0||N.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,V=Symbol(),tt=new WeakMap,x=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==V)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(L&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=tt.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&tt.set(e,t))}return t}toString(){return this.cssText}},et=o=>new x(typeof o=="string"?o:o+"",void 0,V),Et=(o,...t)=>{let e=o.length===1?o[0]:t.reduce((s,i,n)=>s+(r=>{if(r._$cssResult$===!0)return r.cssText;if(typeof r=="number")return r;throw Error("Value passed to 'css' function must be a 'css' function result: "+r+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[n+1],o[0]);return new x(e,o,V)},st=(o,t)=>{if(L)o.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=N.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,o.appendChild(s)}},W=L?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return et(e)})(o):o;var{is:bt,defineProperty:Ct,getOwnPropertyDescriptor:wt,getOwnPropertyNames:xt,getOwnPropertySymbols:Pt,getPrototypeOf:Ut}=Object,A=globalThis,it=A.trustedTypes,Ot=it?it.emptyScript:"",q=A.reactiveElementPolyfillSupport,P=(o,t)=>o,K={toAttribute(o,t){switch(t){case Boolean:o=o?Ot:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch(s){e=null}}return e}},at=(o,t)=>!bt(o,t),ot={attribute:!0,type:String,converter:K,reflect:!1,useDefault:!1,hasChanged:at},rt,nt;(rt=Symbol.metadata)!=null||(Symbol.metadata=Symbol("metadata")),(nt=A.litPropertyMetadata)!=null||(A.litPropertyMetadata=new WeakMap);var $=class extends HTMLElement{static addInitializer(t){var e;this._$Ei(),((e=this.l)!=null?e:this.l=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=ot){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&Ct(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){var r;let{get:i,set:n}=(r=wt(this.prototype,t))!=null?r:{get(){return this[e]},set(a){this[e]=a}};return{get:i,set(a){let h=i==null?void 0:i.call(this);n==null||n.call(this,a),this.requestUpdate(t,h,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){var e;return(e=this.elementProperties.get(t))!=null?e:ot}static _$Ei(){if(this.hasOwnProperty(P("elementProperties")))return;let t=Ut(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(P("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(P("properties"))){let e=this.properties,s=[...xt(e),...Pt(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(W(i))}else t!==void 0&&e.push(W(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e,s;((e=this._$EO)!=null?e:this._$EO=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&((s=t.hostConnected)==null||s.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){var e;let t=(e=this.shadowRoot)!=null?e:this.attachShadow(this.constructor.shadowRootOptions);return st(t,this.constructor.elementStyles),t}connectedCallback(){var t,e;(t=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(s=>{var i;return(i=s.hostConnected)==null?void 0:i.call(s)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var s;return(s=e.hostDisconnected)==null?void 0:s.call(e)})}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){var n;let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let r=(((n=s.converter)==null?void 0:n.toAttribute)!==void 0?s.converter:K).toAttribute(e,s.type);this._$Em=t,r==null?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(t,e){var n,r,a,h;let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let l=s.getPropertyOptions(i),d=typeof l.converter=="function"?{fromAttribute:l.converter}:((n=l.converter)==null?void 0:n.fromAttribute)!==void 0?l.converter:K;this._$Em=i,this[i]=(h=(a=d.fromAttribute(e,l.type))!=null?a:(r=this._$Ej)==null?void 0:r.get(i))!=null?h:null,this._$Em=null}}requestUpdate(t,e,s){var i,n;if(t!==void 0){let r=this.constructor,a=this[t];if(s!=null||(s=r.getPropertyOptions(t)),!(((i=s.hasChanged)!=null?i:at)(a,e)||s.useDefault&&s.reflect&&a===((n=this._$Ej)==null?void 0:n.get(t))&&!this.hasAttribute(r._$Eu(t,s))))return;this.C(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:i,wrapped:n},r){var a,h,l;s&&!((a=this._$Ej)!=null?a:this._$Ej=new Map).has(t)&&(this._$Ej.set(t,(h=r!=null?r:e)!=null?h:this[t]),n!==!0||r!==void 0)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),i===!0&&this._$Em!==t&&((l=this._$Eq)!=null?l:this._$Eq=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var s,i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if((s=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[r,a]of this._$Ep)this[r]=a;this._$Ep=void 0}let n=this.constructor.elementProperties;if(n.size>0)for(let[r,a]of n){let{wrapped:h}=a,l=this[r];h!==!0||this._$AL.has(r)||l===void 0||this.C(r,void 0,a,l)}}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(i=this._$EO)==null||i.forEach(n=>{var r;return(r=n.hostUpdate)==null?void 0:r.call(n)}),this.update(e)):this._$EM()}catch(n){throw t=!1,this._$EM(),n}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(s=>{var i;return(i=s.hostUpdated)==null?void 0:i.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&(this._$Eq=this._$Eq.forEach(e=>this._$ET(e,this[e]))),this._$EM()}updated(t){}firstUpdated(t){}},ht;$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[P("elementProperties")]=new Map,$[P("finalized")]=new Map,q==null||q({ReactiveElement:$}),((ht=A.reactiveElementVersions)!=null?ht:A.reactiveElementVersions=[]).push("2.1.0");var O=globalThis,k=O.trustedTypes,lt=k?k.createPolicy("lit-html",{createHTML:o=>o}):void 0,J="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,G="?"+_,Ht=`<${G}>`,y=document,H=()=>y.createComment(""),R=o=>o===null||typeof o!="object"&&typeof o!="function",Q=Array.isArray,ft=o=>Q(o)||typeof(o==null?void 0:o[Symbol.iterator])=="function",Z=`[
|
|
2
|
+
\f\r]`,U=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ct=/-->/g,dt=/>/g,m=RegExp(`>|${Z}(?:([^\\s"'>=/]+)(${Z}*=${Z}*(?:[^
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),pt=/'/g,ut=/"/g,At=/^(?:script|style|textarea|title)$/i,X=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),Lt=X(1),kt=X(2),Dt=X(3),v=Symbol.for("lit-noChange"),p=Symbol.for("lit-nothing"),$t=new WeakMap,g=y.createTreeWalker(y,129);function mt(o,t){if(!Q(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return lt!==void 0?lt.createHTML(t):t}var gt=(o,t)=>{let e=o.length-1,s=[],i,n=t===2?"<svg>":t===3?"<math>":"",r=U;for(let a=0;a<e;a++){let h=o[a],l,d,c=-1,u=0;for(;u<h.length&&(r.lastIndex=u,d=r.exec(h),d!==null);)u=r.lastIndex,r===U?d[1]==="!--"?r=ct:d[1]!==void 0?r=dt:d[2]!==void 0?(At.test(d[2])&&(i=RegExp("</"+d[2],"g")),r=m):d[3]!==void 0&&(r=m):r===m?d[0]===">"?(r=i!=null?i:U,c=-1):d[1]===void 0?c=-2:(c=r.lastIndex-d[2].length,l=d[1],r=d[3]===void 0?m:d[3]==='"'?ut:pt):r===ut||r===pt?r=m:r===ct||r===dt?r=U:(r=m,i=void 0);let f=r===m&&o[a+1].startsWith("/>")?" ":"";n+=r===U?h+Ht:c>=0?(s.push(l),h.slice(0,c)+J+h.slice(c)+_+f):h+_+(c===-2?a:f)}return[mt(o,n+(o[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]},T=class o{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,r=0,a=t.length-1,h=this.parts,[l,d]=gt(t,e);if(this.el=o.createElement(l,s),g.currentNode=this.el.content,e===2||e===3){let c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(i=g.nextNode())!==null&&h.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(let c of i.getAttributeNames())if(c.endsWith(J)){let u=d[r++],f=i.getAttribute(c).split(_),M=/([.?@])?(.*)/.exec(u);h.push({type:1,index:n,name:M[2],strings:f,ctor:M[1]==="."?B:M[1]==="?"?j:M[1]==="@"?z:E}),i.removeAttribute(c)}else c.startsWith(_)&&(h.push({type:6,index:n}),i.removeAttribute(c));if(At.test(i.tagName)){let c=i.textContent.split(_),u=c.length-1;if(u>0){i.textContent=k?k.emptyScript:"";for(let f=0;f<u;f++)i.append(c[f],H()),g.nextNode(),h.push({type:2,index:++n});i.append(c[u],H())}}}else if(i.nodeType===8)if(i.data===G)h.push({type:2,index:n});else{let c=-1;for(;(c=i.data.indexOf(_,c+1))!==-1;)h.push({type:7,index:n}),c+=_.length-1}n++}}static createElement(t,e){let s=y.createElement("template");return s.innerHTML=t,s}};function S(o,t,e=o,s){var r,a,h;if(t===v)return t;let i=s!==void 0?(r=e._$Co)==null?void 0:r[s]:e._$Cl,n=R(t)?void 0:t._$litDirective$;return(i==null?void 0:i.constructor)!==n&&((a=i==null?void 0:i._$AO)==null||a.call(i,!1),n===void 0?i=void 0:(i=new n(o),i._$AT(o,e,s)),s!==void 0?((h=e._$Co)!=null?h:e._$Co=[])[s]=i:e._$Cl=i),i!==void 0&&(t=S(o,i._$AS(o,t.values),i,s)),t}var D=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var l;let{el:{content:e},parts:s}=this._$AD,i=((l=t==null?void 0:t.creationScope)!=null?l:y).importNode(e,!0);g.currentNode=i;let n=g.nextNode(),r=0,a=0,h=s[0];for(;h!==void 0;){if(r===h.index){let d;h.type===2?d=new C(n,n.nextSibling,this,t):h.type===1?d=new h.ctor(n,h.name,h.strings,this,t):h.type===6&&(d=new I(n,this,t)),this._$AV.push(d),h=s[++a]}r!==(h==null?void 0:h.index)&&(n=g.nextNode(),r++)}return g.currentNode=y,i}p(t){let e=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}},C=class o{get _$AU(){var t,e;return(e=(t=this._$AM)==null?void 0:t._$AU)!=null?e:this._$Cv}constructor(t,e,s,i){var n;this.type=2,this._$AH=p,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=(n=i==null?void 0:i.isConnected)!=null?n:!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=S(this,t,e),R(t)?t===p||t==null||t===""?(this._$AH!==p&&this._$AR(),this._$AH=p):t!==this._$AH&&t!==v&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):ft(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==p&&R(this._$AH)?this._$AA.nextSibling.data=t:this.T(y.createTextNode(t)),this._$AH=t}$(t){var n;let{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=T.createElement(mt(s.h,s.h[0]),this.options)),s);if(((n=this._$AH)==null?void 0:n._$AD)===i)this._$AH.p(e);else{let r=new D(i,this),a=r.u(this.options);r.p(e),this.T(a),this._$AH=r}}_$AC(t){let e=$t.get(t.strings);return e===void 0&&$t.set(t.strings,e=new T(t)),e}k(t){Q(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,s,i=0;for(let n of t)i===e.length?e.push(s=new o(this.O(H()),this.O(H()),this,this.options)):s=e[i],s._$AI(n),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){var s;for((s=this._$AP)==null?void 0:s.call(this,!1,!0,e);t&&t!==this._$AB;){let i=t.nextSibling;t.remove(),t=i}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}},E=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,n){this.type=1,this._$AH=p,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=n,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=p}_$AI(t,e=this,s,i){let n=this.strings,r=!1;if(n===void 0)t=S(this,t,e,0),r=!R(t)||t!==this._$AH&&t!==v,r&&(this._$AH=t);else{let a=t,h,l;for(t=n[0],h=0;h<n.length-1;h++)l=S(this,a[s+h],e,h),l===v&&(l=this._$AH[h]),r||(r=!R(l)||l!==this._$AH[h]),l===p?t=p:t!==p&&(t+=(l!=null?l:"")+n[h+1]),this._$AH[h]=l}r&&!i&&this.j(t)}j(t){t===p?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t!=null?t:"")}},B=class extends E{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===p?void 0:t}},j=class extends E{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==p)}},z=class extends E{constructor(t,e,s,i,n){super(t,e,s,i,n),this.type=5}_$AI(t,e=this){var r;if((t=(r=S(this,t,e,0))!=null?r:p)===v)return;let s=this._$AH,i=t===p&&s!==p||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==p&&(s===p||i);i&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,s;typeof this._$AH=="function"?this._$AH.call((s=(e=this.options)==null?void 0:e.host)!=null?s:this.element,t):this._$AH.handleEvent(t)}},I=class{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){S(this,t)}},Bt={M:J,P:_,A:G,C:1,L:gt,R:D,D:ft,V:S,I:C,H:E,N:j,U:z,B,F:I},F=O.litHtmlPolyfillSupport,_t;F==null||F(T,C),((_t=O.litHtmlVersions)!=null?_t:O.litHtmlVersions=[]).push("3.3.0");var yt=(o,t,e)=>{var n,r;let s=(n=e==null?void 0:e.renderBefore)!=null?n:t,i=s._$litPart$;if(i===void 0){let a=(r=e==null?void 0:e.renderBefore)!=null?r:null;s._$litPart$=i=new C(t.insertBefore(H(),a),a,void 0,e!=null?e:{})}return i._$AI(o),i};var b=globalThis,w=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,s;let t=super.createRenderRoot();return(s=(e=this.renderOptions).renderBefore)!=null||(e.renderBefore=t.firstChild),t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=yt(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return v}},vt;w._$litElement$=!0,w.finalized=!0,(vt=b.litElementHydrateSupport)==null||vt.call(b,{LitElement:w});var Y=b.litElementPolyfillSupport;Y==null||Y({LitElement:w});var St;((St=b.litElementVersions)!=null?St:b.litElementVersions=[]).push("4.2.0");export{et as a,Et as b,K as c,at as d,Lt as e,kt as f,Dt as g,v as h,p as i,Bt as j,w as k};
|
|
4
|
+
/*! Bundled license information:
|
|
5
|
+
|
|
6
|
+
@lit/reactive-element/css-tag.js:
|
|
7
|
+
(**
|
|
8
|
+
* @license
|
|
9
|
+
* Copyright 2019 Google LLC
|
|
10
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
|
+
*)
|
|
12
|
+
|
|
13
|
+
@lit/reactive-element/reactive-element.js:
|
|
14
|
+
(**
|
|
15
|
+
* @license
|
|
16
|
+
* Copyright 2017 Google LLC
|
|
17
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
18
|
+
*)
|
|
19
|
+
|
|
20
|
+
lit-html/lit-html.js:
|
|
21
|
+
(**
|
|
22
|
+
* @license
|
|
23
|
+
* Copyright 2017 Google LLC
|
|
24
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
25
|
+
*)
|
|
26
|
+
|
|
27
|
+
lit-element/lit-element.js:
|
|
28
|
+
(**
|
|
29
|
+
* @license
|
|
30
|
+
* Copyright 2017 Google LLC
|
|
31
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
32
|
+
*)
|
|
33
|
+
|
|
34
|
+
lit-html/is-server.js:
|
|
35
|
+
(**
|
|
36
|
+
* @license
|
|
37
|
+
* Copyright 2022 Google LLC
|
|
38
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
39
|
+
*)
|
|
40
|
+
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{b as c,c as o}from"./chunk.6ZDEZIWM.js";import{b as u,e as l,k as b}from"./chunk.U4P7XQR4.js";import{d as a,e as n,f as s,g as i}from"./chunk.NI7UJOOZ.js";async function y(){customElements.get("wa-callout")||await import("./callout.USQGOL5A.js"),customElements.get("wa-icon")||await import("./icon.ZB6BUFKB.js"),customElements.get("wa-button")||await import("./button.LEHBRWP3.js")}(async()=>await y())();var w,m,f,x,v,t=class extends b{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
2
|
${this.showError?l`
|
|
3
3
|
<div class="error-banner">
|
|
4
4
|
<wa-callout style="padding: 1rem;" variant="danger" appearance="outlined filled" size="large">
|
|
@@ -54,7 +54,7 @@ import{a as c,b as r}from"./chunk.7P5E5KMI.js";import{a as b,d as l,e as u}from"
|
|
|
54
54
|
</wa-callout>
|
|
55
55
|
</div>
|
|
56
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}console.log(`Setting Matomo tracking for site=${e} domain=${this.domain}`);let
|
|
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}console.log(`Setting Matomo tracking for site=${e} domain=${this.domain}`);let r=window._paq=window._paq||[];r.push(["requireConsent"]),r.push(["setDomains",[this.domain]]),r.push(["enableLinkTracking"]),r.push(["trackVisibleContentImpressions"]),function(g){r.push(["setTrackerUrl",`${g}/matomo.php`]),r.push(["setSiteId",e]);let h=document,p=h.createElement("script"),d=h.getElementsByTagName("script")[0];(d==null?void 0:d.parentNode)!=null?(p.async=!0,p.src=`${g}/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=u`
|
|
58
58
|
:host {
|
|
59
59
|
display: block;
|
|
60
60
|
font-family: var(--wa-font-sans);
|
|
@@ -236,4 +236,4 @@ import{a as c,b as r}from"./chunk.7P5E5KMI.js";import{a as b,d as l,e as u}from"
|
|
|
236
236
|
width: 100%;
|
|
237
237
|
}
|
|
238
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([
|
|
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([o()],t.prototype,"consentGiven",2),a([o()],t.prototype,"consentShown",2),a([o()],t.prototype,"errorMessage",2),a([o()],t.prototype,"showError",2),a([o()],t.prototype,"successMessage",2),a([o()],t.prototype,"showSuccess",2),a([o()],t.prototype,"infoMessage",2),a([o()],t.prototype,"showInfo",2);var $=t;customElements.define("hot-tracking",t);export{t as a,$ as b};
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import{a as h,b as p}from"./chunk.7VBX4GII.js";import{a as f,b as v,c as b}from"./chunk.KPZVTN5G.js";import"./chunk.TFICHQZE.js";import{a as g}from"./chunk.OHRBDQCO.js";import{a as i,b as w}from"./chunk.FIQQYKEP.js";import{a as u,b as r,d as m}from"./chunk.6ZDEZIWM.js";import{e as d}from"./chunk.U4P7XQR4.js";import"./chunk.NI7UJOOZ.js";function y(e){return e.split(" ").map(t=>t.trim()).filter(t=>t!=="")}var x=class extends Event{constructor(){super("wa-after-hide",{bubbles:!0,cancelable:!1,composed:!0})}},k=class extends Event{constructor(){super("wa-after-show",{bubbles:!0,cancelable:!1,composed:!0})}},E=class extends Event{constructor(e){super("wa-hide",{bubbles:!0,cancelable:!0,composed:!0}),this.detail=e}},C=class extends Event{constructor(){super("wa-show",{bubbles:!0,cancelable:!0,composed:!0})}};function l(e,t){return new Promise(n=>{let a=new AbortController,{signal:c}=a;if(e.classList.contains(t))return;e.classList.remove(t),e.classList.add(t);let s=()=>{e.classList.remove(t),n(),a.abort()};e.addEventListener("animationend",s,{once:!0,signal:c}),e.addEventListener("animationcancel",s,{once:!0,signal:c})})}var S=`:host {
|
|
2
|
+
--width: 31rem;
|
|
3
|
+
--spacing: var(--wa-space-l);
|
|
4
|
+
--show-duration: 200ms;
|
|
5
|
+
--hide-duration: 200ms;
|
|
6
|
+
|
|
7
|
+
display: none;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
:host([open]) {
|
|
11
|
+
display: block;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.dialog {
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
top: 0;
|
|
18
|
+
right: 0;
|
|
19
|
+
bottom: 0;
|
|
20
|
+
left: 0;
|
|
21
|
+
width: var(--width);
|
|
22
|
+
max-width: calc(100% - var(--wa-space-2xl));
|
|
23
|
+
max-height: calc(100% - var(--wa-space-2xl));
|
|
24
|
+
background-color: var(--wa-color-surface-raised);
|
|
25
|
+
border-radius: var(--wa-panel-border-radius);
|
|
26
|
+
border: none;
|
|
27
|
+
box-shadow: var(--wa-shadow-l);
|
|
28
|
+
padding: 0;
|
|
29
|
+
margin: auto;
|
|
30
|
+
|
|
31
|
+
&.show {
|
|
32
|
+
animation: show-dialog var(--show-duration) ease;
|
|
33
|
+
|
|
34
|
+
&::backdrop {
|
|
35
|
+
animation: show-backdrop var(--show-duration, 200ms) ease;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&.hide {
|
|
40
|
+
animation: show-dialog var(--hide-duration) ease reverse;
|
|
41
|
+
|
|
42
|
+
&::backdrop {
|
|
43
|
+
animation: show-backdrop var(--hide-duration, 200ms) ease reverse;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&.pulse {
|
|
48
|
+
animation: pulse 250ms ease;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.dialog:focus {
|
|
53
|
+
outline: none;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* Ensure there's enough vertical padding for phones that don't update vh when chrome appears (e.g. iPhone) */
|
|
57
|
+
@media screen and (max-width: 420px) {
|
|
58
|
+
.dialog {
|
|
59
|
+
max-height: 80vh;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.open {
|
|
64
|
+
display: flex;
|
|
65
|
+
opacity: 1;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.header {
|
|
69
|
+
flex: 0 0 auto;
|
|
70
|
+
display: flex;
|
|
71
|
+
flex-wrap: nowrap;
|
|
72
|
+
|
|
73
|
+
padding-inline-start: var(--spacing);
|
|
74
|
+
padding-block-end: 0;
|
|
75
|
+
|
|
76
|
+
/* Subtract the close button's padding so that the X is visually aligned with the edges of the dialog content */
|
|
77
|
+
padding-inline-end: calc(var(--spacing) - var(--wa-form-control-padding-block));
|
|
78
|
+
padding-block-start: calc(var(--spacing) - var(--wa-form-control-padding-block));
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.title {
|
|
82
|
+
align-self: center;
|
|
83
|
+
flex: 1 1 auto;
|
|
84
|
+
font-family: inherit;
|
|
85
|
+
font-size: var(--wa-font-size-l);
|
|
86
|
+
font-weight: var(--wa-font-weight-heading);
|
|
87
|
+
line-height: var(--wa-line-height-condensed);
|
|
88
|
+
margin: 0;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.header-actions {
|
|
92
|
+
align-self: start;
|
|
93
|
+
display: flex;
|
|
94
|
+
flex-shrink: 0;
|
|
95
|
+
flex-wrap: wrap;
|
|
96
|
+
justify-content: end;
|
|
97
|
+
gap: var(--wa-space-2xs);
|
|
98
|
+
padding-inline-start: var(--spacing);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.header-actions wa-button,
|
|
102
|
+
.header-actions ::slotted(wa-button) {
|
|
103
|
+
flex: 0 0 auto;
|
|
104
|
+
display: flex;
|
|
105
|
+
align-items: center;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.body {
|
|
109
|
+
flex: 1 1 auto;
|
|
110
|
+
display: block;
|
|
111
|
+
padding: var(--spacing);
|
|
112
|
+
overflow: auto;
|
|
113
|
+
-webkit-overflow-scrolling: touch;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.footer {
|
|
117
|
+
flex: 0 0 auto;
|
|
118
|
+
display: flex;
|
|
119
|
+
flex-wrap: wrap;
|
|
120
|
+
gap: var(--wa-space-xs);
|
|
121
|
+
justify-content: end;
|
|
122
|
+
padding: var(--spacing);
|
|
123
|
+
padding-block-start: 0;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.footer ::slotted(wa-button:not(:first-of-type)) {
|
|
127
|
+
margin-inline-start: var(--wa-spacing-xs);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.dialog::backdrop {
|
|
131
|
+
/*
|
|
132
|
+
NOTE: the ::backdrop element doesn't inherit properly in Safari yet, but it will in 17.4! At that time, we can
|
|
133
|
+
remove the fallback values here.
|
|
134
|
+
*/
|
|
135
|
+
background-color: var(--wa-color-overlay-modal, rgb(0 0 0 / 0.25));
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
@keyframes pulse {
|
|
139
|
+
0% {
|
|
140
|
+
scale: 1;
|
|
141
|
+
}
|
|
142
|
+
50% {
|
|
143
|
+
scale: 1.02;
|
|
144
|
+
}
|
|
145
|
+
100% {
|
|
146
|
+
scale: 1;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
@keyframes show-dialog {
|
|
151
|
+
from {
|
|
152
|
+
opacity: 0;
|
|
153
|
+
scale: 0.8;
|
|
154
|
+
}
|
|
155
|
+
to {
|
|
156
|
+
opacity: 1;
|
|
157
|
+
scale: 1;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
@keyframes show-backdrop {
|
|
162
|
+
from {
|
|
163
|
+
opacity: 0;
|
|
164
|
+
}
|
|
165
|
+
to {
|
|
166
|
+
opacity: 1;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
@media (forced-colors: active) {
|
|
171
|
+
.dialog {
|
|
172
|
+
border: solid 1px white;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
`,o=class extends w{constructor(){super(...arguments),this.localize=new f(this),this.hasSlotController=new b(this,"footer","header-actions","label"),this.open=!1,this.label="",this.withoutHeader=!1,this.lightDismiss=!1,this.handleDocumentKeyDown=e=>{e.key==="Escape"&&this.open&&(e.preventDefault(),e.stopPropagation(),this.requestClose(this.dialog))}}firstUpdated(){this.open&&(this.addOpenListeners(),this.dialog.showModal(),h(this))}disconnectedCallback(){super.disconnectedCallback(),p(this),this.removeOpenListeners()}async requestClose(e){let t=new E({source:e});if(this.dispatchEvent(t),t.defaultPrevented){this.open=!0,l(this.dialog,"pulse");return}this.removeOpenListeners(),await l(this.dialog,"hide"),this.open=!1,this.dialog.close(),p(this);let n=this.originalTrigger;typeof(n==null?void 0:n.focus)=="function"&&setTimeout(()=>n.focus()),this.dispatchEvent(new x)}addOpenListeners(){document.addEventListener("keydown",this.handleDocumentKeyDown)}removeOpenListeners(){document.removeEventListener("keydown",this.handleDocumentKeyDown)}handleDialogCancel(e){e.preventDefault(),this.dialog.classList.contains("hide")||this.requestClose(this.dialog)}handleDialogClick(e){let n=e.target.closest('[data-dialog="close"]');n&&(e.stopPropagation(),this.requestClose(n))}async handleDialogPointerDown(e){e.target===this.dialog&&(this.lightDismiss?this.requestClose(this.dialog):await l(this.dialog,"pulse"))}handleOpenChange(){this.open&&!this.dialog.open?this.show():!this.open&&this.dialog.open&&(this.open=!0,this.requestClose(this.dialog))}async show(){let e=new C;if(this.dispatchEvent(e),e.defaultPrevented){this.open=!1;return}this.addOpenListeners(),this.originalTrigger=document.activeElement,this.open=!0,this.dialog.showModal(),h(this),requestAnimationFrame(()=>{let t=this.querySelector("[autofocus]");t&&typeof t.focus=="function"&&t.focus()}),await l(this.dialog,"show"),this.dispatchEvent(new k)}render(){let e=!this.withoutHeader&&(this.label.length>0||this.hasSlotController.test("label")||this.hasSlotController.test("header-actions")),t=this.hasSlotController.test("footer");return d`
|
|
176
|
+
<dialog
|
|
177
|
+
part="dialog"
|
|
178
|
+
class=${v({dialog:!0,open:this.open})}
|
|
179
|
+
@cancel=${this.handleDialogCancel}
|
|
180
|
+
@click=${this.handleDialogClick}
|
|
181
|
+
@pointerdown=${this.handleDialogPointerDown}
|
|
182
|
+
>
|
|
183
|
+
${e?d`
|
|
184
|
+
<header part="header" class="header">
|
|
185
|
+
<h2 part="title" class="title" id="title">
|
|
186
|
+
<!-- If there's no label, use an invisible character to prevent the header from collapsing -->
|
|
187
|
+
<slot name="label"> ${this.label.length>0?this.label:"\uFEFF"} </slot>
|
|
188
|
+
</h2>
|
|
189
|
+
<div part="header-actions" class="header-actions">
|
|
190
|
+
<slot name="header-actions"></slot>
|
|
191
|
+
<wa-button
|
|
192
|
+
part="close-button"
|
|
193
|
+
exportparts="base:close-button__base"
|
|
194
|
+
class="close"
|
|
195
|
+
appearance="plain"
|
|
196
|
+
@click="${n=>this.requestClose(n.target)}"
|
|
197
|
+
>
|
|
198
|
+
<wa-icon
|
|
199
|
+
name="xmark"
|
|
200
|
+
label=${this.localize.term("close")}
|
|
201
|
+
library="system"
|
|
202
|
+
variant="solid"
|
|
203
|
+
></wa-icon>
|
|
204
|
+
</wa-button>
|
|
205
|
+
</div>
|
|
206
|
+
</header>
|
|
207
|
+
`:""}
|
|
208
|
+
|
|
209
|
+
<div part="body" class="body"><slot></slot></div>
|
|
210
|
+
|
|
211
|
+
${t?d`
|
|
212
|
+
<footer part="footer" class="footer">
|
|
213
|
+
<slot name="footer"></slot>
|
|
214
|
+
</footer>
|
|
215
|
+
`:""}
|
|
216
|
+
</dialog>
|
|
217
|
+
`}};o.css=S;i([m(".dialog")],o.prototype,"dialog",2);i([r({type:Boolean,reflect:!0})],o.prototype,"open",2);i([r({reflect:!0})],o.prototype,"label",2);i([r({attribute:"without-header",type:Boolean,reflect:!0})],o.prototype,"withoutHeader",2);i([r({attribute:"light-dismiss",type:Boolean})],o.prototype,"lightDismiss",2);i([g("open",{waitUntilFirstUpdate:!0})],o.prototype,"handleOpenChange",1);o=i([u("wa-dialog")],o);document.addEventListener("click",e=>{let t=e.target.closest("[data-dialog]");if(t instanceof Element){let[n,a]=y(t.getAttribute("data-dialog")||"");if(n==="open"&&(a!=null&&a.length)){let s=t.getRootNode().getElementById(a);(s==null?void 0:s.localName)==="wa-dialog"?s.open=!0:console.warn(`A dialog with an ID of "${a}" could not be found in this document.`)}}});!1||document.addEventListener("pointerdown",()=>{});export{o as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as o}from"./chunk.OHRBDQCO.js";import"./chunk.FIQQYKEP.js";import"./chunk.6ZDEZIWM.js";import"./chunk.U4P7XQR4.js";import"./chunk.NI7UJOOZ.js";export{o as default};
|