@geotrekce/geotrek-rando-widget 0.0.2 → 0.0.3

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 (71) hide show
  1. package/dist/cjs/geotrek-rando-widget.cjs.js +1 -1
  2. package/dist/cjs/{grw-app_7.cjs.entry.js → grw-app_10.cjs.entry.js} +275 -47
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/collection/collection-manifest.json +3 -0
  5. package/dist/collection/components/grw-app/grw-app.css +1 -0
  6. package/dist/collection/components/grw-app/grw-app.js +82 -6
  7. package/dist/collection/components/grw-information-desk-detail/grw-information-desk-detail.css +30 -0
  8. package/dist/collection/components/grw-information-desk-detail/grw-information-desk-detail.js +53 -0
  9. package/dist/collection/components/grw-map/grw-map.css +81 -0
  10. package/dist/collection/components/grw-map/grw-map.js +255 -31
  11. package/dist/collection/components/grw-poi-detail/grw-poi-detail.css +30 -0
  12. package/dist/collection/components/grw-poi-detail/grw-poi-detail.js +41 -0
  13. package/dist/collection/components/grw-sensitive-area-detail/grw-sensitive-area-detail.css +16 -0
  14. package/dist/collection/components/grw-sensitive-area-detail/grw-sensitive-area-detail.js +38 -0
  15. package/dist/collection/components/grw-trek-card/grw-trek-card.css +3 -0
  16. package/dist/collection/components/grw-trek-card/grw-trek-card.js +4 -4
  17. package/dist/collection/components/grw-trek-detail/grw-trek-detail.css +35 -0
  18. package/dist/collection/components/grw-trek-detail/grw-trek-detail.js +40 -6
  19. package/dist/collection/components/grw-treks-list/grw-treks-list.css +1 -0
  20. package/dist/collection/components/grw-treks-list/grw-treks-list.js +2 -2
  21. package/dist/collection/store/grw-trek-provider.js +11 -5
  22. package/dist/collection/store/grw-treks-provider.js +3 -3
  23. package/dist/collection/store/store.js +3 -0
  24. package/dist/collection/stories/App.js +14 -6
  25. package/dist/collection/stories/App.stories.js +10 -6
  26. package/dist/collection/stories/TrekCard.js +2 -1
  27. package/dist/collection/stories/TrekCard.stories.js +4 -3
  28. package/dist/collection/stories/TrekDetail.js +3 -1
  29. package/dist/collection/stories/TrekDetail.stories.js +5 -3
  30. package/dist/collection/stories/TrekMap.js +6 -4
  31. package/dist/collection/stories/TrekMap.stories.js +7 -5
  32. package/dist/collection/stories/TreksList.js +2 -1
  33. package/dist/collection/stories/TreksList.stories.js +4 -3
  34. package/dist/collection/stories/TreksMap.stories.js +3 -3
  35. package/dist/collection/utils/utils.js +2 -2
  36. package/dist/components/grw-app.js +31 -5
  37. package/dist/components/grw-information-desk-detail.d.ts +11 -0
  38. package/dist/components/grw-information-desk-detail.js +6 -0
  39. package/dist/components/grw-information-desk-detail2.js +34 -0
  40. package/dist/components/grw-map2.js +203 -28
  41. package/dist/components/grw-poi-detail.d.ts +11 -0
  42. package/dist/components/grw-poi-detail.js +6 -0
  43. package/dist/components/grw-poi-detail2.js +32 -0
  44. package/dist/components/grw-sensitive-area-detail.d.ts +11 -0
  45. package/dist/components/grw-sensitive-area-detail.js +6 -0
  46. package/dist/components/grw-sensitive-area-detail2.js +32 -0
  47. package/dist/components/grw-trek-card2.js +3 -3
  48. package/dist/components/grw-trek-detail2.js +25 -5
  49. package/dist/components/grw-trek-provider2.js +11 -5
  50. package/dist/components/grw-treks-list2.js +2 -2
  51. package/dist/components/grw-treks-provider2.js +3 -3
  52. package/dist/components/length.js +2 -2
  53. package/dist/components/store.js +3 -0
  54. package/dist/esm/geotrek-rando-widget.js +1 -1
  55. package/dist/esm/{grw-app_7.entry.js → grw-app_10.entry.js} +273 -48
  56. package/dist/esm/loader.js +1 -1
  57. package/dist/geotrek-rando-widget/geotrek-rando-widget.css +1 -1
  58. package/dist/geotrek-rando-widget/geotrek-rando-widget.esm.js +1 -1
  59. package/dist/geotrek-rando-widget/p-73bc92fe.entry.js +1 -0
  60. package/dist/types/components/grw-app/grw-app.d.ts +4 -0
  61. package/dist/types/components/grw-information-desk-detail/grw-information-desk-detail.d.ts +5 -0
  62. package/dist/types/components/grw-map/grw-map.d.ts +13 -4
  63. package/dist/types/components/grw-poi-detail/grw-poi-detail.d.ts +5 -0
  64. package/dist/types/components/grw-sensitive-area-detail/grw-sensitive-area-detail.d.ts +5 -0
  65. package/dist/types/components/grw-trek-detail/grw-trek-detail.d.ts +1 -0
  66. package/dist/types/components.d.ts +65 -1
  67. package/dist/types/store/store.d.ts +7 -1
  68. package/dist/types/types/types.d.ts +46 -3
  69. package/package.json +5 -7
  70. package/readme.md +20 -1
  71. package/dist/geotrek-rando-widget/p-b7c66d2d.entry.js +0 -1
@@ -0,0 +1,5 @@
1
+ import { Poi } from 'types/types';
2
+ export declare class GrwPoiDetail {
3
+ poi: Poi;
4
+ render(): any;
5
+ }
@@ -0,0 +1,5 @@
1
+ import { SensitiveArea } from 'types/types';
2
+ export declare class GrwSensitiveAreaDetail {
3
+ sensitiveArea: SensitiveArea;
4
+ render(): any;
5
+ }
@@ -2,6 +2,7 @@ import { Difficulty, Practice, Route, Trek } from 'types/types';
2
2
  export declare class GrwTrekDetail {
3
3
  trek: Trek;
4
4
  colorPrimary: string;
5
+ colorPrimaryShade: string;
5
6
  colorPrimaryTint: string;
6
7
  currentTrek: Trek;
7
8
  difficulty: Difficulty;
@@ -5,7 +5,7 @@
5
5
  * It contains typing information for all components that exist in this project.
6
6
  */
7
7
  import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
8
- import { Trek } from "types/types";
8
+ import { InformationDesk, Poi, SensitiveArea, Trek } from "types/types";
9
9
  export namespace Components {
10
10
  interface GrwApp {
11
11
  "api": string;
@@ -15,11 +15,15 @@ export namespace Components {
15
15
  "cities": string;
16
16
  "colorArrivalIcon": string;
17
17
  "colorDepartureIcon": string;
18
+ "colorPoiIcon": string;
18
19
  "colorPrimary": string;
20
+ "colorPrimaryShade": string;
19
21
  "colorPrimaryTint": string;
22
+ "colorSensitiveArea": string;
20
23
  "colorTrekLine": string;
21
24
  "districts": string;
22
25
  "inBbox": string;
26
+ "language": string;
23
27
  "portals": string;
24
28
  "practices": string;
25
29
  "routes": string;
@@ -28,17 +32,28 @@ export namespace Components {
28
32
  "urlLayer": string;
29
33
  "zoom": any;
30
34
  }
35
+ interface GrwInformationDeskDetail {
36
+ "informationDesk": InformationDesk;
37
+ }
31
38
  interface GrwMap {
32
39
  "attribution": string;
33
40
  "center": string;
34
41
  "colorArrivalIcon": string;
35
42
  "colorDepartureIcon": string;
43
+ "colorPoiIcon": string;
36
44
  "colorPrimary": string;
37
45
  "colorPrimaryTint": string;
46
+ "colorSensitiveArea": string;
38
47
  "colorTrekLine": string;
39
48
  "urlLayer": string;
40
49
  "zoom": number;
41
50
  }
51
+ interface GrwPoiDetail {
52
+ "poi": Poi;
53
+ }
54
+ interface GrwSensitiveAreaDetail {
55
+ "sensitiveArea": SensitiveArea;
56
+ }
42
57
  interface GrwTrekCard {
43
58
  "colorPrimary": string;
44
59
  "colorPrimaryTint": string;
@@ -46,6 +61,7 @@ export namespace Components {
46
61
  }
47
62
  interface GrwTrekDetail {
48
63
  "colorPrimary": string;
64
+ "colorPrimaryShade": string;
49
65
  "colorPrimaryTint": string;
50
66
  "trek": Trek;
51
67
  }
@@ -71,6 +87,10 @@ export namespace Components {
71
87
  "themes": string;
72
88
  }
73
89
  }
90
+ export interface GrwMapCustomEvent<T> extends CustomEvent<T> {
91
+ detail: T;
92
+ target: HTMLGrwMapElement;
93
+ }
74
94
  export interface GrwTrekCardCustomEvent<T> extends CustomEvent<T> {
75
95
  detail: T;
76
96
  target: HTMLGrwTrekCardElement;
@@ -82,12 +102,30 @@ declare global {
82
102
  prototype: HTMLGrwAppElement;
83
103
  new (): HTMLGrwAppElement;
84
104
  };
105
+ interface HTMLGrwInformationDeskDetailElement extends Components.GrwInformationDeskDetail, HTMLStencilElement {
106
+ }
107
+ var HTMLGrwInformationDeskDetailElement: {
108
+ prototype: HTMLGrwInformationDeskDetailElement;
109
+ new (): HTMLGrwInformationDeskDetailElement;
110
+ };
85
111
  interface HTMLGrwMapElement extends Components.GrwMap, HTMLStencilElement {
86
112
  }
87
113
  var HTMLGrwMapElement: {
88
114
  prototype: HTMLGrwMapElement;
89
115
  new (): HTMLGrwMapElement;
90
116
  };
117
+ interface HTMLGrwPoiDetailElement extends Components.GrwPoiDetail, HTMLStencilElement {
118
+ }
119
+ var HTMLGrwPoiDetailElement: {
120
+ prototype: HTMLGrwPoiDetailElement;
121
+ new (): HTMLGrwPoiDetailElement;
122
+ };
123
+ interface HTMLGrwSensitiveAreaDetailElement extends Components.GrwSensitiveAreaDetail, HTMLStencilElement {
124
+ }
125
+ var HTMLGrwSensitiveAreaDetailElement: {
126
+ prototype: HTMLGrwSensitiveAreaDetailElement;
127
+ new (): HTMLGrwSensitiveAreaDetailElement;
128
+ };
91
129
  interface HTMLGrwTrekCardElement extends Components.GrwTrekCard, HTMLStencilElement {
92
130
  }
93
131
  var HTMLGrwTrekCardElement: {
@@ -120,7 +158,10 @@ declare global {
120
158
  };
121
159
  interface HTMLElementTagNameMap {
122
160
  "grw-app": HTMLGrwAppElement;
161
+ "grw-information-desk-detail": HTMLGrwInformationDeskDetailElement;
123
162
  "grw-map": HTMLGrwMapElement;
163
+ "grw-poi-detail": HTMLGrwPoiDetailElement;
164
+ "grw-sensitive-area-detail": HTMLGrwSensitiveAreaDetailElement;
124
165
  "grw-trek-card": HTMLGrwTrekCardElement;
125
166
  "grw-trek-detail": HTMLGrwTrekDetailElement;
126
167
  "grw-trek-provider": HTMLGrwTrekProviderElement;
@@ -137,11 +178,15 @@ declare namespace LocalJSX {
137
178
  "cities"?: string;
138
179
  "colorArrivalIcon"?: string;
139
180
  "colorDepartureIcon"?: string;
181
+ "colorPoiIcon"?: string;
140
182
  "colorPrimary"?: string;
183
+ "colorPrimaryShade"?: string;
141
184
  "colorPrimaryTint"?: string;
185
+ "colorSensitiveArea"?: string;
142
186
  "colorTrekLine"?: string;
143
187
  "districts"?: string;
144
188
  "inBbox"?: string;
189
+ "language"?: string;
145
190
  "portals"?: string;
146
191
  "practices"?: string;
147
192
  "routes"?: string;
@@ -150,17 +195,29 @@ declare namespace LocalJSX {
150
195
  "urlLayer"?: string;
151
196
  "zoom"?: any;
152
197
  }
198
+ interface GrwInformationDeskDetail {
199
+ "informationDesk"?: InformationDesk;
200
+ }
153
201
  interface GrwMap {
154
202
  "attribution"?: string;
155
203
  "center"?: string;
156
204
  "colorArrivalIcon"?: string;
157
205
  "colorDepartureIcon"?: string;
206
+ "colorPoiIcon"?: string;
158
207
  "colorPrimary"?: string;
159
208
  "colorPrimaryTint"?: string;
209
+ "colorSensitiveArea"?: string;
160
210
  "colorTrekLine"?: string;
211
+ "onTrekCardPress"?: (event: GrwMapCustomEvent<number>) => void;
161
212
  "urlLayer"?: string;
162
213
  "zoom"?: number;
163
214
  }
215
+ interface GrwPoiDetail {
216
+ "poi"?: Poi;
217
+ }
218
+ interface GrwSensitiveAreaDetail {
219
+ "sensitiveArea"?: SensitiveArea;
220
+ }
164
221
  interface GrwTrekCard {
165
222
  "colorPrimary"?: string;
166
223
  "colorPrimaryTint"?: string;
@@ -169,6 +226,7 @@ declare namespace LocalJSX {
169
226
  }
170
227
  interface GrwTrekDetail {
171
228
  "colorPrimary"?: string;
229
+ "colorPrimaryShade"?: string;
172
230
  "colorPrimaryTint"?: string;
173
231
  "trek"?: Trek;
174
232
  }
@@ -195,7 +253,10 @@ declare namespace LocalJSX {
195
253
  }
196
254
  interface IntrinsicElements {
197
255
  "grw-app": GrwApp;
256
+ "grw-information-desk-detail": GrwInformationDeskDetail;
198
257
  "grw-map": GrwMap;
258
+ "grw-poi-detail": GrwPoiDetail;
259
+ "grw-sensitive-area-detail": GrwSensitiveAreaDetail;
199
260
  "grw-trek-card": GrwTrekCard;
200
261
  "grw-trek-detail": GrwTrekDetail;
201
262
  "grw-trek-provider": GrwTrekProvider;
@@ -208,7 +269,10 @@ declare module "@stencil/core" {
208
269
  export namespace JSX {
209
270
  interface IntrinsicElements {
210
271
  "grw-app": LocalJSX.GrwApp & JSXBase.HTMLAttributes<HTMLGrwAppElement>;
272
+ "grw-information-desk-detail": LocalJSX.GrwInformationDeskDetail & JSXBase.HTMLAttributes<HTMLGrwInformationDeskDetailElement>;
211
273
  "grw-map": LocalJSX.GrwMap & JSXBase.HTMLAttributes<HTMLGrwMapElement>;
274
+ "grw-poi-detail": LocalJSX.GrwPoiDetail & JSXBase.HTMLAttributes<HTMLGrwPoiDetailElement>;
275
+ "grw-sensitive-area-detail": LocalJSX.GrwSensitiveAreaDetail & JSXBase.HTMLAttributes<HTMLGrwSensitiveAreaDetailElement>;
212
276
  "grw-trek-card": LocalJSX.GrwTrekCard & JSXBase.HTMLAttributes<HTMLGrwTrekCardElement>;
213
277
  "grw-trek-detail": LocalJSX.GrwTrekDetail & JSXBase.HTMLAttributes<HTMLGrwTrekDetailElement>;
214
278
  "grw-trek-provider": LocalJSX.GrwTrekProvider & JSXBase.HTMLAttributes<HTMLGrwTrekProviderElement>;
@@ -1,18 +1,24 @@
1
- import { Difficulties, Practices, Routes, Trek, Treks } from 'types/types';
1
+ import { Difficulties, InformationDesks, Pois, Practices, Routes, SensitiveAreas, Trek, Treks } from 'types/types';
2
2
  declare const state: {
3
3
  api: string;
4
4
  treks: Treks;
5
5
  difficulties: Difficulties;
6
6
  routes: Routes;
7
7
  practices: Practices;
8
+ currentSensitiveAreas: SensitiveAreas;
9
+ currentPois: Pois;
8
10
  currentTrek: Trek;
11
+ currentInformationDesks: InformationDesks;
9
12
  }, onChange: import("@stencil/store/dist/types").OnChangeHandler<{
10
13
  api: string;
11
14
  treks: Treks;
12
15
  difficulties: Difficulties;
13
16
  routes: Routes;
14
17
  practices: Practices;
18
+ currentSensitiveAreas: SensitiveAreas;
19
+ currentPois: Pois;
15
20
  currentTrek: Trek;
21
+ currentInformationDesks: InformationDesks;
16
22
  }>;
17
23
  export { onChange };
18
24
  export default state;
@@ -1,4 +1,4 @@
1
- import { LineString, Position } from 'geojson';
1
+ import { LineString, Geometry, Position } from 'geojson';
2
2
  export declare type Treks = Trek[];
3
3
  export declare type Trek = {
4
4
  id: number;
@@ -14,6 +14,10 @@ export declare type Trek = {
14
14
  ascent: number;
15
15
  geometry?: LineString;
16
16
  departure_geom?: Position;
17
+ gpx?: string;
18
+ kml?: string;
19
+ pdf?: string;
20
+ parking_location?: Position;
17
21
  };
18
22
  export declare type Attachments = Attachment[];
19
23
  export declare type Attachment = {
@@ -29,7 +33,6 @@ export declare type Attachment = {
29
33
  export declare type Difficulties = Difficulty[];
30
34
  export declare type Difficulty = {
31
35
  id: number;
32
- cirkwi_level: number;
33
36
  label: string;
34
37
  pictogram: string;
35
38
  };
@@ -43,6 +46,46 @@ export declare type Practices = Practice[];
43
46
  export declare type Practice = {
44
47
  id: number;
45
48
  name: string;
46
- order: number;
49
+ pictogram: string;
50
+ };
51
+ export declare type SensitiveAreas = SensitiveArea[];
52
+ export declare type SensitiveArea = {
53
+ id: number;
54
+ geometry: Geometry;
55
+ name: string;
56
+ description: string;
57
+ };
58
+ export declare type Pois = Poi[];
59
+ export declare type Poi = {
60
+ id: number;
61
+ name: string;
62
+ description: string;
63
+ attachments: Attachments;
64
+ type: any;
65
+ type_label: any;
66
+ type_pictogram: any;
67
+ url: string;
68
+ published: boolean;
69
+ geometry: Geometry;
70
+ };
71
+ export declare type InformationDesks = InformationDesk[];
72
+ export declare type InformationDesk = {
73
+ id: number;
74
+ name: string;
75
+ description: string;
76
+ type: InformationDeskType;
77
+ phone: string;
78
+ email: string;
79
+ website: string;
80
+ municipality: string;
81
+ postal_code: string;
82
+ street: string;
83
+ photo_url: string;
84
+ latitude: string;
85
+ longitude: string;
86
+ };
87
+ export declare type InformationDeskType = {
88
+ id: number;
89
+ label: string;
47
90
  pictogram: string;
48
91
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geotrekce/geotrek-rando-widget",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "Geotrek Rando Widget",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -28,24 +28,22 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "@stencil/core": "^2.13.0",
31
- "@types/geojson": "^7946.0.8",
32
- "@types/leaflet": "^1.7.11",
33
31
  "leaflet": "^1.8.0"
34
32
  },
35
33
  "devDependencies": {
36
34
  "@babel/core": "^7.18.5",
37
35
  "@stencil/sass": "^1.5.2",
38
36
  "@stencil/store": "^1.5.0",
39
- "@storybook/addon-actions": "^6.5.9",
40
- "@storybook/addon-essentials": "^6.5.9",
41
- "@storybook/addon-interactions": "^6.5.9",
42
- "@storybook/addon-links": "^6.5.9",
37
+ "@storybook/addon-controls": "^6.5.9",
38
+ "@storybook/addon-docs": "^6.5.9",
43
39
  "@storybook/builder-webpack4": "^6.5.9",
44
40
  "@storybook/html": "^6.5.9",
45
41
  "@storybook/manager-webpack4": "^6.5.9",
46
42
  "@storybook/storybook-deployer": "^2.8.11",
47
43
  "@storybook/testing-library": "^0.0.13",
44
+ "@types/geojson": "^7946.0.8",
48
45
  "@types/jest": "^27.0.3",
46
+ "@types/leaflet": "^1.7.11",
49
47
  "babel-loader": "^8.2.5",
50
48
  "jest": "^27.4.5",
51
49
  "jest-cli": "^27.4.5",
package/readme.md CHANGED
@@ -1,3 +1,22 @@
1
1
  # Geotrek Rando Widget
2
2
 
3
- [Storybook](https://geotrekce.github.io/Geotrek-rando-widget/)
3
+ Web components of _Geotrek Rando_ (http://geotrek.fr).
4
+ You can use a complete app or each component independantly.
5
+
6
+ ## Usage
7
+
8
+ To use the latest version, Copy-Paste this inside <head></head>
9
+
10
+ ```
11
+ <link rel="stylesheet" href="https://unpkg.com/@geotrekce/geotrek-rando-widget@latest/dist/geotrek-rando-widget/geotrek-rando-widget.css" />
12
+ <script type="module" src="https://unpkg.com/@geotrekce/geotrek-rando-widget@latest/dist/geotrek-rando-widget/geotrek-rando-widget.esm.js"></script>
13
+ <script nomodule src="https://unpkg.com/@geotrekce/geotrek-rando-widget@latest/dist/geotrek-rando-widget/geotrek-rando-widget.js"></script>
14
+ ```
15
+
16
+ You can replace _latest_ with a specific version.
17
+
18
+ ## Storybook
19
+
20
+ Storybook helps you to [explore Geotrek Rando Widget and create you own component](https://geotrekce.github.io/Geotrek-rando-widget/).
21
+
22
+ Once you made your component, you can get the code to copy-paste by clicking on _Docs_ then _Show code_.