@geotrekce/geotrek-rando-widget 0.0.1 → 0.0.2

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 (53) hide show
  1. package/dist/cjs/geotrek-rando-widget.cjs.js +2 -2
  2. package/dist/cjs/grw-app_7.cjs.entry.js +137 -55
  3. package/dist/cjs/{index-31255e29.js → index-c6f73e30.js} +36 -0
  4. package/dist/cjs/loader.cjs.js +2 -2
  5. package/dist/collection/assets/departure-arrival.svg +1 -1
  6. package/dist/collection/components/grw-app/grw-app.css +60 -37
  7. package/dist/collection/components/grw-app/grw-app.js +277 -15
  8. package/dist/collection/components/grw-map/grw-map.css +36 -0
  9. package/dist/collection/components/grw-map/grw-map.js +157 -18
  10. package/dist/collection/components/grw-trek-card/grw-trek-card.js +87 -32
  11. package/dist/collection/components/grw-trek-detail/grw-trek-detail.css +1 -1
  12. package/dist/collection/components/grw-trek-detail/grw-trek-detail.js +87 -32
  13. package/dist/collection/components/grw-treks-list/grw-treks-list.css +3 -12
  14. package/dist/collection/components/grw-treks-list/grw-treks-list.js +46 -4
  15. package/dist/collection/store/grw-trek-provider.js +28 -6
  16. package/dist/collection/store/grw-treks-provider.js +155 -9
  17. package/dist/collection/stories/App.js +31 -1
  18. package/dist/collection/stories/App.stories.js +21 -1
  19. package/dist/collection/stories/TrekCard.js +8 -3
  20. package/dist/collection/stories/TrekCard.stories.js +2 -0
  21. package/dist/collection/stories/TrekDetail.js +8 -3
  22. package/dist/collection/stories/TrekDetail.stories.js +2 -0
  23. package/dist/collection/stories/TrekMap.js +10 -3
  24. package/dist/collection/stories/TrekMap.stories.js +13 -1
  25. package/dist/collection/stories/TreksList.js +16 -3
  26. package/dist/collection/stories/TreksList.stories.js +10 -0
  27. package/dist/collection/stories/TreksMap.js +12 -3
  28. package/dist/collection/stories/TreksMap.stories.js +15 -1
  29. package/dist/components/grw-app.js +39 -6
  30. package/dist/components/grw-map2.js +56 -20
  31. package/dist/components/grw-trek-card2.js +25 -7
  32. package/dist/components/grw-trek-detail2.js +26 -8
  33. package/dist/components/grw-trek-provider2.js +10 -7
  34. package/dist/components/grw-treks-list2.js +10 -4
  35. package/dist/components/grw-treks-provider2.js +26 -11
  36. package/dist/esm/geotrek-rando-widget.js +2 -2
  37. package/dist/esm/grw-app_7.entry.js +137 -55
  38. package/dist/esm/{index-b36f38f5.js → index-7aa9e822.js} +36 -0
  39. package/dist/esm/loader.js +2 -2
  40. package/dist/geotrek-rando-widget/geotrek-rando-widget.esm.js +1 -1
  41. package/dist/geotrek-rando-widget/p-332ba9ab.js +2 -0
  42. package/dist/geotrek-rando-widget/p-b7c66d2d.entry.js +1 -0
  43. package/dist/types/components/grw-app/grw-app.d.ts +21 -2
  44. package/dist/types/components/grw-map/grw-map.d.ts +8 -0
  45. package/dist/types/components/grw-trek-card/grw-trek-card.d.ts +3 -1
  46. package/dist/types/components/grw-trek-detail/grw-trek-detail.d.ts +2 -0
  47. package/dist/types/components/grw-treks-list/grw-treks-list.d.ts +2 -0
  48. package/dist/types/components.d.ts +70 -0
  49. package/dist/types/store/grw-trek-provider.d.ts +1 -0
  50. package/dist/types/store/grw-treks-provider.d.ts +8 -0
  51. package/package.json +1 -1
  52. package/dist/geotrek-rando-widget/p-f721481d.js +0 -2
  53. package/dist/geotrek-rando-widget/p-fe788eaa.entry.js +0 -1
@@ -10,30 +10,65 @@ export namespace Components {
10
10
  interface GrwApp {
11
11
  "api": string;
12
12
  "appName": string;
13
+ "attribution": string;
14
+ "center": string;
15
+ "cities": string;
16
+ "colorArrivalIcon": string;
17
+ "colorDepartureIcon": string;
13
18
  "colorPrimary": string;
14
19
  "colorPrimaryTint": string;
20
+ "colorTrekLine": string;
21
+ "districts": string;
22
+ "inBbox": string;
15
23
  "portals": string;
24
+ "practices": string;
25
+ "routes": string;
26
+ "structures": string;
27
+ "themes": string;
28
+ "urlLayer": string;
29
+ "zoom": any;
16
30
  }
17
31
  interface GrwMap {
32
+ "attribution": string;
33
+ "center": string;
18
34
  "colorArrivalIcon": string;
19
35
  "colorDepartureIcon": string;
36
+ "colorPrimary": string;
37
+ "colorPrimaryTint": string;
20
38
  "colorTrekLine": string;
39
+ "urlLayer": string;
40
+ "zoom": number;
21
41
  }
22
42
  interface GrwTrekCard {
43
+ "colorPrimary": string;
44
+ "colorPrimaryTint": string;
23
45
  "trek": Trek;
24
46
  }
25
47
  interface GrwTrekDetail {
48
+ "colorPrimary": string;
49
+ "colorPrimaryTint": string;
26
50
  "trek": Trek;
27
51
  }
28
52
  interface GrwTrekProvider {
29
53
  "api": string;
54
+ "language": string;
30
55
  "trekId": string;
31
56
  }
32
57
  interface GrwTreksList {
58
+ "colorPrimary": string;
59
+ "colorPrimaryTint": string;
33
60
  }
34
61
  interface GrwTreksProvider {
35
62
  "api": string;
63
+ "cities": string;
64
+ "districts": string;
65
+ "inBbox": string;
66
+ "language": string;
36
67
  "portals": string;
68
+ "practices": string;
69
+ "routes": string;
70
+ "structures": string;
71
+ "themes": string;
37
72
  }
38
73
  }
39
74
  export interface GrwTrekCardCustomEvent<T> extends CustomEvent<T> {
@@ -97,31 +132,66 @@ declare namespace LocalJSX {
97
132
  interface GrwApp {
98
133
  "api"?: string;
99
134
  "appName"?: string;
135
+ "attribution"?: string;
136
+ "center"?: string;
137
+ "cities"?: string;
138
+ "colorArrivalIcon"?: string;
139
+ "colorDepartureIcon"?: string;
100
140
  "colorPrimary"?: string;
101
141
  "colorPrimaryTint"?: string;
142
+ "colorTrekLine"?: string;
143
+ "districts"?: string;
144
+ "inBbox"?: string;
102
145
  "portals"?: string;
146
+ "practices"?: string;
147
+ "routes"?: string;
148
+ "structures"?: string;
149
+ "themes"?: string;
150
+ "urlLayer"?: string;
151
+ "zoom"?: any;
103
152
  }
104
153
  interface GrwMap {
154
+ "attribution"?: string;
155
+ "center"?: string;
105
156
  "colorArrivalIcon"?: string;
106
157
  "colorDepartureIcon"?: string;
158
+ "colorPrimary"?: string;
159
+ "colorPrimaryTint"?: string;
107
160
  "colorTrekLine"?: string;
161
+ "urlLayer"?: string;
162
+ "zoom"?: number;
108
163
  }
109
164
  interface GrwTrekCard {
165
+ "colorPrimary"?: string;
166
+ "colorPrimaryTint"?: string;
110
167
  "onTrekCardPress"?: (event: GrwTrekCardCustomEvent<number>) => void;
111
168
  "trek"?: Trek;
112
169
  }
113
170
  interface GrwTrekDetail {
171
+ "colorPrimary"?: string;
172
+ "colorPrimaryTint"?: string;
114
173
  "trek"?: Trek;
115
174
  }
116
175
  interface GrwTrekProvider {
117
176
  "api"?: string;
177
+ "language"?: string;
118
178
  "trekId"?: string;
119
179
  }
120
180
  interface GrwTreksList {
181
+ "colorPrimary"?: string;
182
+ "colorPrimaryTint"?: string;
121
183
  }
122
184
  interface GrwTreksProvider {
123
185
  "api"?: string;
186
+ "cities"?: string;
187
+ "districts"?: string;
188
+ "inBbox"?: string;
189
+ "language"?: string;
124
190
  "portals"?: string;
191
+ "practices"?: string;
192
+ "routes"?: string;
193
+ "structures"?: string;
194
+ "themes"?: string;
125
195
  }
126
196
  interface IntrinsicElements {
127
197
  "grw-app": GrwApp;
@@ -1,4 +1,5 @@
1
1
  export declare class GrwTrekProvider {
2
+ language: string;
2
3
  api: string;
3
4
  trekId: string;
4
5
  componentWillLoad(): Promise<void>;
@@ -1,6 +1,14 @@
1
1
  export declare class GrwTreksProvider {
2
+ language: string;
2
3
  api: string;
4
+ inBbox: string;
5
+ cities: string;
6
+ districts: string;
7
+ structures: string;
8
+ themes: string;
3
9
  portals: string;
10
+ routes: string;
11
+ practices: string;
4
12
  componentWillLoad(): Promise<void>;
5
13
  render(): any;
6
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geotrekce/geotrek-rando-widget",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "Geotrek Rando Widget",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -1,2 +0,0 @@
1
- let e,t,n=null,l=!1;const s="undefined"!=typeof window?window:{},o=s.document||{head:{}},c={t:0,l:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},r=e=>Promise.resolve(e),i=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replace}catch(e){}return!1})(),u=(e,t,n)=>{n&&n.map((([n,l,s])=>{const o=f(e,n),r=a(t,s),i=d(n);c.ael(o,l,r,i),(t.o=t.o||[]).push((()=>c.rel(o,l,r,i)))}))},a=(e,t)=>n=>{try{256&e.t?e.i[t](n):(e.u=e.u||[]).push([t,n])}catch(e){X(e)}},f=(e,t)=>8&t?s:e,d=e=>0!=(2&e),h=new WeakMap,$=e=>"sc-"+e.h,y={},m=e=>"object"==(e=typeof e)||"function"===e,p=(e,t,...n)=>{let l=null,s=!1,o=!1;const c=[],r=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?r(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!m(l))&&(l+=""),s&&o?c[c.length-1].$+=l:c.push(s?b(null,l):l),o=s)};if(r(n),t){const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}const i=b(e,null);return i.m=t,c.length>0&&(i.p=c),i},b=(e,t)=>({t:0,g:e,$:t,S:null,p:null,m:null}),w={},g=(e,t,n,l,o,r)=>{if(n!==l){let i=Q(e,t),u=t.toLowerCase();if("class"===t){const t=e.classList,s=j(n),o=j(l);t.remove(...s.filter((e=>e&&!o.includes(e)))),t.add(...o.filter((e=>e&&!s.includes(e))))}else if("style"===t){for(const t in n)l&&null!=l[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in l)n&&l[t]===n[t]||(t.includes("-")?e.style.setProperty(t,l[t]):e.style[t]=l[t])}else if(i||"o"!==t[0]||"n"!==t[1]){const s=m(l);if((i||s&&null!==l)&&!o)try{if(e.tagName.includes("-"))e[t]=l;else{const s=null==l?"":l;"list"===t?i=!1:null!=n&&e[t]==s||(e[t]=s)}}catch(e){}null==l||!1===l?!1===l&&""!==e.getAttribute(t)||e.removeAttribute(t):(!i||4&r||o)&&!s&&e.setAttribute(t,l=!0===l?"":l)}else t="-"===t[2]?t.slice(3):Q(s,u)?u.slice(2):u[2]+t.slice(3),n&&c.rel(e,t,n,!1),l&&c.ael(e,t,l,!1)}},S=/\s/,j=e=>e?e.split(S):[],k=(e,t,n,l)=>{const s=11===t.S.nodeType&&t.S.host?t.S.host:t.S,o=e&&e.m||y,c=t.m||y;for(l in o)l in c||g(s,l,o[l],void 0,n,t.t);for(l in c)g(s,l,o[l],c[l],n,t.t)},v=(t,n,l)=>{const s=n.p[l];let c,r,i=0;if(null!==s.$)c=s.S=o.createTextNode(s.$);else if(c=s.S=o.createElement(s.g),k(null,s,!1),null!=e&&c["s-si"]!==e&&c.classList.add(c["s-si"]=e),s.p)for(i=0;i<s.p.length;++i)r=v(t,s,i),r&&c.appendChild(r);return c},M=(e,n,l,s,o,c)=>{let r,i=e;for(i.shadowRoot&&i.tagName===t&&(i=i.shadowRoot);o<=c;++o)s[o]&&(r=v(null,l,o),r&&(s[o].S=r,i.insertBefore(r,n)))},C=(e,t,n,l)=>{for(;t<=n;++t)(l=e[t])&&l.S.remove()},O=(e,t)=>e.g===t.g,L=(e,t)=>{const n=t.S=e.S,l=e.p,s=t.p,o=t.$;null===o?(k(e,t,!1),null!==l&&null!==s?((e,t,n,l)=>{let s,o=0,c=0,r=t.length-1,i=t[0],u=t[r],a=l.length-1,f=l[0],d=l[a];for(;o<=r&&c<=a;)null==i?i=t[++o]:null==u?u=t[--r]:null==f?f=l[++c]:null==d?d=l[--a]:O(i,f)?(L(i,f),i=t[++o],f=l[++c]):O(u,d)?(L(u,d),u=t[--r],d=l[--a]):O(i,d)?(L(i,d),e.insertBefore(i.S,u.S.nextSibling),i=t[++o],d=l[--a]):O(u,f)?(L(u,f),e.insertBefore(u.S,i.S),u=t[--r],f=l[++c]):(s=v(t&&t[c],n,c),f=l[++c],s&&i.S.parentNode.insertBefore(s,i.S));o>r?M(e,null==l[a+1]?null:l[a+1].S,n,l,c,a):c>a&&C(t,o,r)})(n,l,t,s):null!==s?(null!==e.$&&(n.textContent=""),M(n,null,t,s,0,s.length-1)):null!==l&&C(l,0,l.length-1)):e.$!==o&&(n.data=o)},P=e=>I(e).j,x=(e,t,n)=>{const l=P(e);return{emit:e=>E(l,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},E=(e,t,n)=>{const l=c.ce(t,n);return e.dispatchEvent(l),l},N=(e,t)=>{t&&!e.k&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.k=t)))},T=(e,t)=>{if(e.t|=16,!(4&e.t))return N(e,e.v),re((()=>W(e,t)));e.t|=512},W=(e,t)=>{const n=e.i;let l;return t&&(e.t|=256,e.u&&(e.u.map((([e,t])=>F(n,e,t))),e.u=null),l=F(n,"componentWillLoad")),V(l,(()=>A(e,n,t)))},A=async(e,t,n)=>{const l=e.j,s=l["s-rc"];n&&(e=>{const t=e.M,n=e.j,l=t.t,s=((e,t)=>{let n=$(t);const l=ee.get(n);if(e=11===e.nodeType?e:o,l)if("string"==typeof l){let t,s=h.get(e=e.head||e);s||h.set(e,s=new Set),s.has(n)||(t=o.createElement("style"),t.innerHTML=l,e.insertBefore(t,e.querySelector("link")),s&&s.add(n))}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return n})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=s,n.classList.add(s+"-h"))})(e);H(e,t),s&&(s.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>U(e);0===t.length?n():(Promise.all(t).then(n),e.t|=4,t.length=0)}},H=(l,s)=>{try{n=s,s=s.render(),l.t&=-17,l.t|=2,((n,l)=>{const s=n.j,o=n.C||b(null,null),c=(e=>e&&e.g===w)(l)?l:p(null,null,l);t=s.tagName,c.g=null,c.t|=4,n.C=c,c.S=o.S=s.shadowRoot||s,e=s["s-sc"],L(o,c)})(l,s)}catch(e){X(e,l.j)}return n=null,null},R=()=>n,U=e=>{const t=e.j,n=e.i,l=e.v;64&e.t||(e.t|=64,_(t),F(n,"componentDidLoad"),e.O(t),l||D()),e.k&&(e.k(),e.k=void 0),512&e.t&&ce((()=>T(e,!1))),e.t&=-517},q=e=>{{const t=I(e),n=t.j.isConnected;return n&&2==(18&t.t)&&T(t,!1),n}},D=()=>{_(o.documentElement),ce((()=>E(s,"appload",{detail:{namespace:"geotrek-rando-widget"}})))},F=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){X(e)}},V=(e,t)=>e&&e.then?e.then(t):t(),_=e=>e.classList.add("hydrated"),z=(e,t,n)=>{if(t.L){const l=Object.entries(t.L),s=e.prototype;if(l.map((([e,[l]])=>{(31&l||2&n&&32&l)&&Object.defineProperty(s,e,{get(){return((e,t)=>I(this).P.get(t))(0,e)},set(n){((e,t,n,l)=>{const s=I(e),o=s.P.get(t),c=s.t,r=s.i;n=((e,t)=>null==e||m(e)?e:1&t?e+"":e)(n,l.L[t][0]),8&c&&void 0!==o||n===o||Number.isNaN(o)&&Number.isNaN(n)||(s.P.set(t,n),r&&2==(18&c)&&T(s,!1))})(this,e,n,t)},configurable:!0,enumerable:!0})})),1&n){const t=new Map;s.attributeChangedCallback=function(e,n,l){c.jmp((()=>{const n=t.get(e);if(this.hasOwnProperty(n))l=this[n],delete this[n];else if(s.hasOwnProperty(n)&&"number"==typeof this[n]&&this[n]==l)return;this[n]=(null!==l||"boolean"!=typeof this[n])&&l}))},e.observedAttributes=l.filter((([e,t])=>15&t[0])).map((([e,n])=>{const l=n[1]||e;return t.set(l,e),l}))}}return e},B=(e,t={})=>{const n=[],l=t.exclude||[],r=s.customElements,a=o.head,f=a.querySelector("meta[charset]"),d=o.createElement("style"),h=[];let y,m=!0;Object.assign(c,t),c.l=new URL(t.resourcesUrl||"./",o.baseURI).href,e.map((e=>{e[1].map((t=>{const s={t:t[0],h:t[1],L:t[2],N:t[3]};s.L=t[2],s.N=t[3];const o=s.h,a=class extends HTMLElement{constructor(e){super(e),K(e=this,s),1&s.t&&e.attachShadow({mode:"open"})}connectedCallback(){y&&(clearTimeout(y),y=null),m?h.push(this):c.jmp((()=>(e=>{if(0==(1&c.t)){const t=I(e),n=t.M,l=()=>{};if(1&t.t)u(e,t,n.N);else{t.t|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){N(t,t.v=n);break}}n.L&&Object.entries(n.L).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,s)=>{if(0==(32&t.t)){{if(t.t|=32,(s=Z(n)).then){const e=()=>{};s=await s,e()}s.isProxied||(z(s,n,2),s.isProxied=!0);const e=()=>{};t.t|=8;try{new s(t)}catch(e){X(e)}t.t&=-9,e()}if(s.style){let e=s.style;const t=$(n);if(!ee.has(t)){const l=()=>{};((e,t,n)=>{let l=ee.get(e);i&&n?(l=l||new CSSStyleSheet,l.replace(t)):l=t,ee.set(e,l)})(t,e,!!(1&n.t)),l()}}}const o=t.v,c=()=>T(t,!0);o&&o["s-rc"]?o["s-rc"].push(c):c()})(0,t,n)}l()}})(this)))}disconnectedCallback(){c.jmp((()=>(()=>{if(0==(1&c.t)){const e=I(this),t=e.i;e.o&&(e.o.map((e=>e())),e.o=void 0),F(t,"disconnectedCallback")}})()))}componentOnReady(){return I(this).T}};s.W=e[0],l.includes(o)||r.get(o)||(n.push(o),r.define(o,z(a,s,1)))}))})),d.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",d.setAttribute("data-styles",""),a.insertBefore(d,f?f.nextSibling:a.firstChild),m=!1,h.length?h.map((e=>e.connectedCallback())):c.jmp((()=>y=setTimeout(D,30)))},G=new WeakMap,I=e=>G.get(e),J=(e,t)=>G.set(t.i=e,t),K=(e,t)=>{const n={t:0,j:e,M:t,P:new Map};return n.T=new Promise((e=>n.O=e)),e["s-p"]=[],e["s-rc"]=[],u(e,n,t.N),G.set(e,n)},Q=(e,t)=>t in e,X=(e,t)=>(0,console.error)(e,t),Y=new Map,Z=e=>{const t=e.h.replace(/-/g,"_"),n=e.W,l=Y.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(Y.set(n,e),e[t])),X)
2
- /*!__STENCIL_STATIC_IMPORT_SWITCH__*/},ee=new Map,te=[],ne=[],le=(e,t)=>n=>{e.push(n),l||(l=!0,t&&4&c.t?ce(oe):c.raf(oe))},se=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){X(e)}e.length=0},oe=()=>{se(te),se(ne),(l=te.length>0)&&c.raf(oe)},ce=e=>r().then(e),re=le(ne,!0);export{w as H,P as a,B as b,x as c,q as f,R as g,p as h,r as p,J as r}