@wodira/browser 1.0.0 → 1.2.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 (44) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +111 -1
  3. package/dist/index.cjs +36 -0
  4. package/dist/index.d.ts +90 -1
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +36 -0
  7. package/dist/types.d.ts +3 -0
  8. package/dist/types.d.ts.map +1 -1
  9. package/dist/ui/boxes/cdn.js +15 -15
  10. package/dist/ui/boxes/index.js +4 -4
  11. package/dist/ui/components.d.ts +33 -1
  12. package/dist/ui/components.d.ts.map +1 -1
  13. package/dist/ui/events.d.ts +1 -1
  14. package/dist/ui/events.d.ts.map +1 -1
  15. package/dist/ui/i18n.d.ts +1 -1
  16. package/dist/ui/i18n.d.ts.map +1 -1
  17. package/dist/ui/index-dqnha6dj.js +1625 -0
  18. package/dist/ui/index-h2b598n9.js +1624 -0
  19. package/dist/ui/{index-tfej862z.js → index-k8s7q1sf.js} +50 -1568
  20. package/dist/ui/index.d.ts +1 -0
  21. package/dist/ui/index.d.ts.map +1 -1
  22. package/dist/ui/index.js +352 -125
  23. package/dist/ui/map-view-8tyrehav.js +28737 -0
  24. package/dist/ui/maplibre-gl-worker.mjs +10 -0
  25. package/dist/ui/route-3d/cdn.d.ts +2 -0
  26. package/dist/ui/route-3d/cdn.d.ts.map +1 -0
  27. package/dist/ui/route-3d/cdn.js +1527 -0
  28. package/dist/ui/route-3d/gpx.d.ts +14 -0
  29. package/dist/ui/route-3d/gpx.d.ts.map +1 -0
  30. package/dist/ui/route-3d/index.d.ts +12 -0
  31. package/dist/ui/route-3d/index.d.ts.map +1 -0
  32. package/dist/ui/route-3d/index.js +16 -0
  33. package/dist/ui/route-3d/map-view.d.ts +73 -0
  34. package/dist/ui/route-3d/map-view.d.ts.map +1 -0
  35. package/dist/ui/route-3d/maplibre-gl-worker.mjs +10 -0
  36. package/dist/ui/route-3d/route-3d.d.ts +168 -0
  37. package/dist/ui/route-3d/route-3d.d.ts.map +1 -0
  38. package/dist/ui/route-3d/route-geo.d.ts +77 -0
  39. package/dist/ui/route-3d/route-geo.d.ts.map +1 -0
  40. package/dist/ui/shirt-sponsors/cdn.js +29 -27
  41. package/dist/ui/shirt-sponsors/index.js +5 -3
  42. package/dist/ui/shirt-sponsors/shirt-auction.d.ts +19 -0
  43. package/dist/ui/shirt-sponsors/shirt-auction.d.ts.map +1 -1
  44. package/package.json +15 -6
@@ -0,0 +1,14 @@
1
+ import type { RoutePoint, RouteWaypoint, RouteWaypointType } from './route-geo.js';
2
+ export interface ParsedGpx {
3
+ name: string | null;
4
+ points: RoutePoint[];
5
+ waypoints: RouteWaypoint[];
6
+ }
7
+ /** Maps common waypoint names and GPX `<type>`/`<sym>` values to a marker kind. */
8
+ export declare function waypointType(label: string): RouteWaypointType;
9
+ /**
10
+ * Reads tracks (`trkpt`), or routes (`rtept`) when there are no tracks, plus waypoints.
11
+ * Multiple segments are joined in document order. Throws when the text is not GPX.
12
+ */
13
+ export declare function parseGpx(text: string): ParsedGpx;
14
+ //# sourceMappingURL=gpx.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gpx.d.ts","sourceRoot":"","sources":["../../../src/ui/route-3d/gpx.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnF,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,SAAS,EAAE,aAAa,EAAE,CAAC;CAC5B;AA6BD,mFAAmF;AACnF,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,iBAAiB,CAa7D;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CA8BhD"}
@@ -0,0 +1,12 @@
1
+ import { WodiraRoute3d } from './route-3d.js';
2
+ export { WodiraRoute3d } from './route-3d.js';
3
+ export { parseGpx, type ParsedGpx } from './gpx.js';
4
+ export { measureRoute, type RoutePoint, type RouteProfile, type RouteTrack, type RouteWaypoint, type RouteWaypointType, } from './route-geo.js';
5
+ /** Registers `<wodira-route-3d>`. Safe to call more than once. */
6
+ export declare function defineWodiraRouteElements(): void;
7
+ declare global {
8
+ interface HTMLElementTagNameMap {
9
+ 'wodira-route-3d': WodiraRoute3d;
10
+ }
11
+ }
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/route-3d/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EACL,YAAY,EACZ,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,iBAAiB,GACvB,MAAM,gBAAgB,CAAC;AAExB,kEAAkE;AAClE,wBAAgB,yBAAyB,IAAI,IAAI,CAIhD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,iBAAiB,EAAE,aAAa,CAAC;KAClC;CACF"}
@@ -0,0 +1,16 @@
1
+ import {
2
+ parseGpx2,
3
+ measureRoute2,
4
+ WodiraRoute3d2,
5
+ defineWodiraRouteElements2
6
+ } from "../index-dqnha6dj.js";
7
+ import {
8
+ __chunks
9
+ } from "../index-k8s7q1sf.js";
10
+ __chunks(import.meta.url,["30ke05qc","dqnha6dj","k8s7q1sf","8tyrehav"],[["./index.js",1,2],["../index-dqnha6dj.js",2],["../index-k8s7q1sf.js"],["../map-view-8tyrehav.js",1]],0);
11
+ export {
12
+ WodiraRoute3d2 as WodiraRoute3d,
13
+ defineWodiraRouteElements2 as defineWodiraRouteElements,
14
+ measureRoute2 as measureRoute,
15
+ parseGpx2 as parseGpx
16
+ };
@@ -0,0 +1,73 @@
1
+ import { type RouteProfile, type RouteTrack, type RouteWaypointType } from './route-geo.js';
2
+ export interface RouteMapColors {
3
+ route: string;
4
+ glow: string;
5
+ highlight: string;
6
+ }
7
+ export interface RouteMapLabels {
8
+ startFinish: string;
9
+ start: string;
10
+ finish: string;
11
+ km: string;
12
+ waypoints: Record<RouteWaypointType, string>;
13
+ cooperativeDesktop: string;
14
+ cooperativeMac: string;
15
+ cooperativeMobile: string;
16
+ }
17
+ export interface RouteMapOptions {
18
+ container: HTMLElement;
19
+ colors: RouteMapColors;
20
+ labels: RouteMapLabels;
21
+ /** Gestures that would scroll the page need ctrl/⌘ or two fingers. */
22
+ cooperative: boolean;
23
+ threeD: boolean;
24
+ workerUrl?: string;
25
+ onHover: (distance: number | null) => void;
26
+ onFlight: (distance: number | null) => void;
27
+ onBearing: (bearing: number, pitch: number) => void;
28
+ onFail: () => void;
29
+ }
30
+ export declare class RouteMapView {
31
+ private readonly map;
32
+ private readonly options;
33
+ private colors;
34
+ private track;
35
+ private profile;
36
+ private markers;
37
+ private kmMarkers;
38
+ private kmVisibilityFrame;
39
+ private revealFrame;
40
+ private flightFrame;
41
+ private flightActive;
42
+ private flightBearing;
43
+ private styleReady;
44
+ private terrainOn;
45
+ private overviewZoom;
46
+ private disposed;
47
+ private readonly reducedMotion;
48
+ constructor(options: RouteMapOptions);
49
+ private readonly emitBearing;
50
+ private addRouteLayers;
51
+ private hoverAt;
52
+ setTrack(track: RouteTrack, profile: RouteProfile, animate: boolean): Promise<void>;
53
+ private placeMarkers;
54
+ private readonly scheduleKmVisibility;
55
+ private updateKmVisibility;
56
+ private paintReveal;
57
+ private reveal;
58
+ /** Frames the whole route, tilted in 3D and turned so it reads along its longest axis. */
59
+ frame(duration?: number): void;
60
+ setCursor(distance: number | null): void;
61
+ setColors(colors: RouteMapColors): void;
62
+ set3d(enabled: boolean): void;
63
+ setCooperative(enabled: boolean): void;
64
+ zoomBy(delta: number): void;
65
+ resetNorth(): void;
66
+ get flying(): boolean;
67
+ /** Follows the route with a chase camera from `from` metres; calls onFlight as it goes. */
68
+ fly(from?: number): void;
69
+ stopFlight(): void;
70
+ resize(): void;
71
+ dispose(): void;
72
+ }
73
+ //# sourceMappingURL=map-view.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"map-view.d.ts","sourceRoot":"","sources":["../../../src/ui/route-3d/map-view.ts"],"names":[],"mappings":"AAYA,OAAO,EAQL,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,iBAAiB,EACvB,MAAM,gBAAgB,CAAC;AAExB,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC;IAC7C,kBAAkB,EAAE,MAAM,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,WAAW,CAAC;IACvB,MAAM,EAAE,cAAc,CAAC;IACvB,MAAM,EAAE,cAAc,CAAC;IACvB,sEAAsE;IACtE,WAAW,EAAE,OAAO,CAAC;IACrB,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC3C,QAAQ,EAAE,CAAC,QAAQ,EA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