Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: handle offline treks #90

Merged
merged 1 commit into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,13 @@
"@raruto/leaflet-elevation": "^1.9.0",
"@stencil/core": "^3.4.1",
"choices.js": "^10.2.0",
"idb": "^8.0.0",
"leaflet": "^1.9.4",
"leaflet-i18n": "^0.3.3",
"leaflet-rotate": "^0.2.8",
"leaflet.locatecontrol": "^0.79.0",
"leaflet.markercluster": "^1.5.3",
"leaflet.offline": "^3.0.1",
"swiper": "^9.4.1"
},
"devDependencies": {
Expand Down
77 changes: 73 additions & 4 deletions src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,12 @@ export namespace Components {
"colorTrekLine": string;
"districts": string;
"emergencyNumber": number;
"enableOffline": boolean;
"fabBackgroundColor": string;
"fabColor": string;
"fontFamily": string;
"globalTilesMaxZoomOffline": number;
"globalTilesMinZoomOffline": number;
"inBbox": string;
"languages": string;
"nameLayer": string;
Expand All @@ -47,6 +50,8 @@ export namespace Components {
"themes": string;
"touristicContents": boolean;
"touristicEvents": boolean;
"trekTilesMaxZoomOffline": number;
"trekTilesMinZoomOffline": number;
"treks": boolean;
"urlLayer": string;
"useGradient": boolean;
Expand Down Expand Up @@ -99,6 +104,7 @@ export namespace Components {
"fontFamily": string;
"isLargeView": boolean;
"nameLayer": string;
"trekTilesMaxZoomOffline": number;
"urlLayer": string;
"useGradient": boolean;
"zoom": number;
Expand All @@ -120,6 +126,10 @@ export namespace Components {
interface GrwSensitiveAreaDetail {
"sensitiveArea": SensitiveArea;
}
interface GrwSwitch {
"action": Function;
"fontFamily": string;
}
interface GrwTouristicContentCard {
"fontFamily": string;
"isInsideHorizontalList": boolean;
Expand All @@ -142,7 +152,7 @@ export namespace Components {
"api": string;
"languages": string;
"portals": string;
"touristicContentId": string;
"touristicContentId": number;
}
interface GrwTouristicContentsList {
"colorOnSecondaryContainer": string;
Expand Down Expand Up @@ -226,24 +236,39 @@ export namespace Components {
"colorPrimaryContainer": string;
"colorSecondaryContainer": string;
"colorSurfaceContainerLow": string;
"defaultBackgroundLayerAttribution": any;
"defaultBackgroundLayerUrl": any;
"emergencyNumber": number;
"enableOffline": boolean;
"fontFamily": string;
"globalTilesMaxZoomOffline": number;
"globalTilesMinZoomOffline": number;
"isLargeView": boolean;
"trek": Trek;
"trekTilesMaxZoomOffline": number;
"trekTilesMinZoomOffline": number;
"weather": boolean;
}
interface GrwTrekProvider {
"api": string;
"cities": string;
"districts": string;
"inBbox": string;
"languages": string;
"portals": string;
"trekId": string;
"practices": string;
"routes": string;
"structures": string;
"themes": string;
"trekId": number;
}
interface GrwTreksList {
"colorOnSecondaryContainer": string;
"colorOnSurface": string;
"colorPrimaryApp": string;
"colorSecondaryContainer": string;
"colorSurfaceContainerLow": string;
"displayOnlyOfflineTreks": boolean;
"fontFamily": string;
"isLargeView": boolean;
}
Expand All @@ -260,6 +285,10 @@ export namespace Components {
"themes": string;
}
}
export interface GrwAppCustomEvent<T> extends CustomEvent<T> {
detail: T;
target: HTMLGrwAppElement;
}
export interface GrwFiltersCustomEvent<T> extends CustomEvent<T> {
detail: T;
target: HTMLGrwFiltersElement;
Expand Down Expand Up @@ -367,6 +396,12 @@ declare global {
prototype: HTMLGrwSensitiveAreaDetailElement;
new (): HTMLGrwSensitiveAreaDetailElement;
};
interface HTMLGrwSwitchElement extends Components.GrwSwitch, HTMLStencilElement {
}
var HTMLGrwSwitchElement: {
prototype: HTMLGrwSwitchElement;
new (): HTMLGrwSwitchElement;
};
interface HTMLGrwTouristicContentCardElement extends Components.GrwTouristicContentCard, HTMLStencilElement {
}
var HTMLGrwTouristicContentCardElement: {
Expand Down Expand Up @@ -471,6 +506,7 @@ declare global {
"grw-segmented-segment": HTMLGrwSegmentedSegmentElement;
"grw-select-language": HTMLGrwSelectLanguageElement;
"grw-sensitive-area-detail": HTMLGrwSensitiveAreaDetailElement;
"grw-switch": HTMLGrwSwitchElement;
"grw-touristic-content-card": HTMLGrwTouristicContentCardElement;
"grw-touristic-content-detail": HTMLGrwTouristicContentDetailElement;
"grw-touristic-content-provider": HTMLGrwTouristicContentProviderElement;
Expand Down Expand Up @@ -514,12 +550,17 @@ declare namespace LocalJSX {
"colorTrekLine"?: string;
"districts"?: string;
"emergencyNumber"?: number;
"enableOffline"?: boolean;
"fabBackgroundColor"?: string;
"fabColor"?: string;
"fontFamily"?: string;
"globalTilesMaxZoomOffline"?: number;
"globalTilesMinZoomOffline"?: number;
"inBbox"?: string;
"languages"?: string;
"nameLayer"?: string;
"onTrekDeletePress"?: (event: GrwAppCustomEvent<number>) => void;
"onTrekDownloadPress"?: (event: GrwAppCustomEvent<number>) => void;
"portals"?: string;
"practices"?: string;
"rounded"?: boolean;
Expand All @@ -528,6 +569,8 @@ declare namespace LocalJSX {
"themes"?: string;
"touristicContents"?: boolean;
"touristicEvents"?: boolean;
"trekTilesMaxZoomOffline"?: number;
"trekTilesMinZoomOffline"?: number;
"treks"?: boolean;
"urlLayer"?: string;
"useGradient"?: boolean;
Expand Down Expand Up @@ -585,6 +628,7 @@ declare namespace LocalJSX {
"onTouristicContentCardPress"?: (event: GrwMapCustomEvent<number>) => void;
"onTouristicEventCardPress"?: (event: GrwMapCustomEvent<number>) => void;
"onTrekCardPress"?: (event: GrwMapCustomEvent<number>) => void;
"trekTilesMaxZoomOffline"?: number;
"urlLayer"?: string;
"useGradient"?: boolean;
"zoom"?: number;
Expand All @@ -606,6 +650,10 @@ declare namespace LocalJSX {
interface GrwSensitiveAreaDetail {
"sensitiveArea"?: SensitiveArea;
}
interface GrwSwitch {
"action"?: Function;
"fontFamily"?: string;
}
interface GrwTouristicContentCard {
"fontFamily"?: string;
"isInsideHorizontalList"?: boolean;
Expand All @@ -631,7 +679,7 @@ declare namespace LocalJSX {
"api"?: string;
"languages"?: string;
"portals"?: string;
"touristicContentId"?: string;
"touristicContentId"?: number;
}
interface GrwTouristicContentsList {
"colorOnSecondaryContainer"?: string;
Expand Down Expand Up @@ -721,8 +769,13 @@ declare namespace LocalJSX {
"colorPrimaryContainer"?: string;
"colorSecondaryContainer"?: string;
"colorSurfaceContainerLow"?: string;
"defaultBackgroundLayerAttribution"?: any;
"defaultBackgroundLayerUrl"?: any;
"emergencyNumber"?: number;
"enableOffline"?: boolean;
"fontFamily"?: string;
"globalTilesMaxZoomOffline"?: number;
"globalTilesMinZoomOffline"?: number;
"isLargeView"?: boolean;
"onDescriptionIsInViewport"?: (event: GrwTrekDetailCustomEvent<boolean>) => void;
"onInformationPlacesIsInViewport"?: (event: GrwTrekDetailCustomEvent<boolean>) => void;
Expand All @@ -733,21 +786,35 @@ declare namespace LocalJSX {
"onStepsIsInViewport"?: (event: GrwTrekDetailCustomEvent<boolean>) => void;
"onTouristicContentsIsInViewport"?: (event: GrwTrekDetailCustomEvent<boolean>) => void;
"onTouristicEventsIsInViewport"?: (event: GrwTrekDetailCustomEvent<boolean>) => void;
"onTrekDeleteConfirm"?: (event: GrwTrekDetailCustomEvent<number>) => void;
"onTrekDeleteSuccessConfirm"?: (event: GrwTrekDetailCustomEvent<number>) => void;
"onTrekDownloadConfirm"?: (event: GrwTrekDetailCustomEvent<number>) => void;
"onTrekDownloadedSuccessConfirm"?: (event: GrwTrekDetailCustomEvent<number>) => void;
"trek"?: Trek;
"trekTilesMaxZoomOffline"?: number;
"trekTilesMinZoomOffline"?: number;
"weather"?: boolean;
}
interface GrwTrekProvider {
"api"?: string;
"cities"?: string;
"districts"?: string;
"inBbox"?: string;
"languages"?: string;
"portals"?: string;
"trekId"?: string;
"practices"?: string;
"routes"?: string;
"structures"?: string;
"themes"?: string;
"trekId"?: number;
}
interface GrwTreksList {
"colorOnSecondaryContainer"?: string;
"colorOnSurface"?: string;
"colorPrimaryApp"?: string;
"colorSecondaryContainer"?: string;
"colorSurfaceContainerLow"?: string;
"displayOnlyOfflineTreks"?: boolean;
"fontFamily"?: string;
"isLargeView"?: boolean;
}
Expand Down Expand Up @@ -777,6 +844,7 @@ declare namespace LocalJSX {
"grw-segmented-segment": GrwSegmentedSegment;
"grw-select-language": GrwSelectLanguage;
"grw-sensitive-area-detail": GrwSensitiveAreaDetail;
"grw-switch": GrwSwitch;
"grw-touristic-content-card": GrwTouristicContentCard;
"grw-touristic-content-detail": GrwTouristicContentDetail;
"grw-touristic-content-provider": GrwTouristicContentProvider;
Expand Down Expand Up @@ -811,6 +879,7 @@ declare module "@stencil/core" {
"grw-segmented-segment": LocalJSX.GrwSegmentedSegment & JSXBase.HTMLAttributes<HTMLGrwSegmentedSegmentElement>;
"grw-select-language": LocalJSX.GrwSelectLanguage & JSXBase.HTMLAttributes<HTMLGrwSelectLanguageElement>;
"grw-sensitive-area-detail": LocalJSX.GrwSensitiveAreaDetail & JSXBase.HTMLAttributes<HTMLGrwSensitiveAreaDetailElement>;
"grw-switch": LocalJSX.GrwSwitch & JSXBase.HTMLAttributes<HTMLGrwSwitchElement>;
"grw-touristic-content-card": LocalJSX.GrwTouristicContentCard & JSXBase.HTMLAttributes<HTMLGrwTouristicContentCardElement>;
"grw-touristic-content-detail": LocalJSX.GrwTouristicContentDetail & JSXBase.HTMLAttributes<HTMLGrwTouristicContentDetailElement>;
"grw-touristic-content-provider": LocalJSX.GrwTouristicContentProvider & JSXBase.HTMLAttributes<HTMLGrwTouristicContentProviderElement>;
Expand Down
Loading
Loading