@sjvair/monitor-map 3.0.2 → 3.0.4

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 (324) hide show
  1. package/dist/lib/LoadScreen.svelte +68 -0
  2. package/dist/lib/LoadScreen.svelte.d.ts +25 -0
  3. package/dist/lib/MainMapView.svelte +1 -0
  4. package/dist/lib/MainMapView.svelte.d.ts +26 -0
  5. package/dist/lib/MapLegend.svelte +15 -0
  6. package/dist/lib/MapLegend.svelte.d.ts +18 -0
  7. package/dist/lib/MonitorDetailPanel.svelte +152 -0
  8. package/dist/lib/MonitorDetailPanel.svelte.d.ts +3 -0
  9. package/dist/lib/MonitorMapLayout.svelte +193 -0
  10. package/dist/lib/MonitorMapLayout.svelte.d.ts +7 -0
  11. package/dist/lib/actions.d.ts +3 -0
  12. package/dist/lib/actions.js +12 -8
  13. package/dist/lib/assets/icons/adjustment-horizontal.svg +3 -0
  14. package/dist/lib/assets/logos/airgradient-blue.svg +63 -0
  15. package/dist/lib/assets/logos/airnow-compact.jpg +0 -0
  16. package/dist/lib/assets/logos/carb-compact.jpg +0 -0
  17. package/dist/lib/assets/logos/purpleair-compact.png +0 -0
  18. package/dist/lib/assets/logos/sjvair-parts/sjvair-air.webp +0 -0
  19. package/dist/lib/assets/logos/sjvair-parts/sjvair-icon.webp +0 -0
  20. package/dist/lib/assets/logos/sjvair-parts/sjvair-sjv.webp +0 -0
  21. package/dist/lib/assets/logos/sjvair-white.svg +115 -0
  22. package/dist/lib/assets/logos/sjvair.svg +96 -0
  23. package/dist/lib/collocation-sites/CollocationTooltip.svelte +98 -0
  24. package/dist/lib/collocation-sites/CollocationTooltip.svelte.d.ts +7 -0
  25. package/dist/lib/collocation-sites/collocation-utils.d.ts +3 -0
  26. package/dist/lib/collocation-sites/collocation-utils.js +30 -0
  27. package/dist/lib/collocation-sites/collocations-icon-manager.svelte.d.ts +7 -0
  28. package/dist/lib/collocation-sites/collocations-icon-manager.svelte.js +17 -20
  29. package/dist/lib/collocation-sites/collocations-map-integration.svelte.d.ts +18 -0
  30. package/dist/lib/collocation-sites/collocations-map-integration.svelte.js +98 -83
  31. package/dist/lib/collocation-sites/collocations.svelte.d.ts +9 -0
  32. package/dist/lib/collocation-sites/collocations.svelte.js +17 -26
  33. package/dist/lib/collocation-sites/types.d.ts +8 -0
  34. package/dist/lib/collocation-sites/types.js +1 -0
  35. package/dist/lib/colors.d.ts +17 -0
  36. package/dist/lib/colors.js +29 -23
  37. package/dist/lib/components/DataBox.svelte +29 -0
  38. package/dist/lib/components/DataBox.svelte.d.ts +9 -0
  39. package/dist/lib/components/DisplayOption.svelte +7 -0
  40. package/dist/lib/components/DisplayOption.svelte.d.ts +5 -0
  41. package/dist/lib/components/MapLayersDisplayOptions.svelte +42 -0
  42. package/dist/lib/components/MapLayersDisplayOptions.svelte.d.ts +18 -0
  43. package/dist/lib/components/SegmentedControl.svelte +61 -0
  44. package/dist/lib/components/SegmentedControl.svelte.d.ts +11 -0
  45. package/dist/lib/components/ToggleSwitch.svelte +93 -0
  46. package/dist/lib/components/ToggleSwitch.svelte.d.ts +9 -0
  47. package/dist/lib/components/ui/button/button.svelte +89 -0
  48. package/dist/lib/components/ui/button/button.svelte.d.ts +70 -0
  49. package/dist/lib/components/ui/button/index.d.ts +2 -0
  50. package/dist/lib/components/ui/button/index.js +4 -0
  51. package/dist/lib/components/ui/range-calendar/index.d.ts +19 -0
  52. package/dist/lib/components/ui/range-calendar/index.js +21 -0
  53. package/dist/lib/components/ui/range-calendar/range-calendar-caption.svelte +76 -0
  54. package/dist/lib/components/ui/range-calendar/range-calendar-caption.svelte.d.ts +19 -0
  55. package/dist/lib/components/ui/range-calendar/range-calendar-cell.svelte +19 -0
  56. package/dist/lib/components/ui/range-calendar/range-calendar-cell.svelte.d.ts +4 -0
  57. package/dist/lib/components/ui/range-calendar/range-calendar-day.svelte +36 -0
  58. package/dist/lib/components/ui/range-calendar/range-calendar-day.svelte.d.ts +4 -0
  59. package/dist/lib/components/ui/range-calendar/range-calendar-grid-body.svelte +7 -0
  60. package/dist/lib/components/ui/range-calendar/range-calendar-grid-body.svelte.d.ts +4 -0
  61. package/dist/lib/components/ui/range-calendar/range-calendar-grid-head.svelte +7 -0
  62. package/dist/lib/components/ui/range-calendar/range-calendar-grid-head.svelte.d.ts +4 -0
  63. package/dist/lib/components/ui/range-calendar/range-calendar-grid-row.svelte +12 -0
  64. package/dist/lib/components/ui/range-calendar/range-calendar-grid-row.svelte.d.ts +4 -0
  65. package/dist/lib/components/ui/range-calendar/range-calendar-grid.svelte +16 -0
  66. package/dist/lib/components/ui/range-calendar/range-calendar-grid.svelte.d.ts +4 -0
  67. package/dist/lib/components/ui/range-calendar/range-calendar-head-cell.svelte +19 -0
  68. package/dist/lib/components/ui/range-calendar/range-calendar-head-cell.svelte.d.ts +4 -0
  69. package/dist/lib/components/ui/range-calendar/range-calendar-header.svelte +19 -0
  70. package/dist/lib/components/ui/range-calendar/range-calendar-header.svelte.d.ts +4 -0
  71. package/dist/lib/components/ui/range-calendar/range-calendar-heading.svelte +16 -0
  72. package/dist/lib/components/ui/range-calendar/range-calendar-heading.svelte.d.ts +4 -0
  73. package/dist/lib/components/ui/range-calendar/range-calendar-month-select.svelte +44 -0
  74. package/dist/lib/components/ui/range-calendar/range-calendar-month-select.svelte.d.ts +4 -0
  75. package/dist/lib/components/ui/range-calendar/range-calendar-month.svelte +15 -0
  76. package/dist/lib/components/ui/range-calendar/range-calendar-month.svelte.d.ts +5 -0
  77. package/dist/lib/components/ui/range-calendar/range-calendar-months.svelte +19 -0
  78. package/dist/lib/components/ui/range-calendar/range-calendar-months.svelte.d.ts +5 -0
  79. package/dist/lib/components/ui/range-calendar/range-calendar-nav.svelte +19 -0
  80. package/dist/lib/components/ui/range-calendar/range-calendar-nav.svelte.d.ts +5 -0
  81. package/dist/lib/components/ui/range-calendar/range-calendar-next-button.svelte +36 -0
  82. package/dist/lib/components/ui/range-calendar/range-calendar-next-button.svelte.d.ts +8 -0
  83. package/dist/lib/components/ui/range-calendar/range-calendar-prev-button.svelte +36 -0
  84. package/dist/lib/components/ui/range-calendar/range-calendar-prev-button.svelte.d.ts +8 -0
  85. package/dist/lib/components/ui/range-calendar/range-calendar-year-select.svelte +43 -0
  86. package/dist/lib/components/ui/range-calendar/range-calendar-year-select.svelte.d.ts +4 -0
  87. package/dist/lib/components/ui/range-calendar/range-calendar.svelte +112 -0
  88. package/dist/lib/components/ui/range-calendar/range-calendar.svelte.d.ts +21 -0
  89. package/dist/lib/data-chart/DataChart.svelte +303 -0
  90. package/dist/lib/data-chart/DataChart.svelte.d.ts +7 -0
  91. package/dist/lib/data-chart/DateRange.d.ts +6 -0
  92. package/dist/lib/data-chart/DateRange.js +15 -14
  93. package/dist/lib/data-chart/chart-utils.d.ts +3 -0
  94. package/dist/lib/data-chart/chart-utils.js +157 -93
  95. package/dist/lib/data-chart/data-chart.svelte.d.ts +7 -0
  96. package/dist/lib/data-chart/data-chart.svelte.js +7 -28
  97. package/dist/lib/data-chart/requests.d.ts +3 -0
  98. package/dist/lib/data-chart/requests.js +36 -28
  99. package/dist/lib/data-chart/tooltip.d.ts +10 -0
  100. package/dist/lib/data-chart/tooltip.js +160 -98
  101. package/dist/lib/ev-stations/components/EvStationClusterTooltip.svelte +16 -0
  102. package/dist/lib/ev-stations/components/EvStationClusterTooltip.svelte.d.ts +7 -0
  103. package/dist/lib/ev-stations/components/EvStationTooltip.svelte +127 -0
  104. package/dist/lib/ev-stations/components/EvStationTooltip.svelte.d.ts +7 -0
  105. package/dist/lib/ev-stations/components/EvStationsDisplayOptions.svelte +46 -0
  106. package/dist/lib/ev-stations/components/EvStationsDisplayOptions.svelte.d.ts +18 -0
  107. package/dist/lib/ev-stations/data-maps.d.ts +5 -0
  108. package/dist/lib/ev-stations/data-maps.js +152 -0
  109. package/dist/lib/ev-stations/ev-station-icons.d.ts +16 -0
  110. package/dist/lib/ev-stations/ev-station-icons.js +26 -0
  111. package/dist/lib/ev-stations/ev-stations-cluster-renderer.d.ts +19 -0
  112. package/dist/lib/ev-stations/ev-stations-cluster-renderer.js +131 -0
  113. package/dist/lib/ev-stations/ev-stations-map-integration.svelte.d.ts +31 -0
  114. package/dist/lib/ev-stations/ev-stations-map-integration.svelte.js +207 -0
  115. package/dist/lib/ev-stations/ev-stations.svelte.d.ts +9 -0
  116. package/dist/lib/ev-stations/ev-stations.svelte.js +55 -0
  117. package/dist/lib/ev-stations/types.d.ts +53 -0
  118. package/dist/lib/ev-stations/types.js +1 -0
  119. package/dist/lib/ev-stations/zip-codes.d.ts +13 -0
  120. package/dist/lib/ev-stations/zip-codes.js +458 -0
  121. package/dist/lib/hms/components/HMSFireLegend.svelte +21 -0
  122. package/dist/lib/hms/components/HMSFireLegend.svelte.d.ts +18 -0
  123. package/dist/lib/hms/hms-fire-icon-manager.d.ts +5 -0
  124. package/dist/lib/hms/hms-fire-icon-manager.js +28 -37
  125. package/dist/lib/hms/hms-fire-map-integration.svelte.d.ts +23 -0
  126. package/dist/lib/hms/hms-fire-map-integration.svelte.js +94 -97
  127. package/dist/lib/hms/hms-smoke-map-integration.svelte.d.ts +19 -0
  128. package/dist/lib/hms/hms-smoke-map-integration.svelte.js +68 -84
  129. package/dist/lib/hms/hms.svelte.d.ts +19 -0
  130. package/dist/lib/hms/hms.svelte.js +225 -76
  131. package/dist/lib/index.d.ts +68 -0
  132. package/dist/lib/index.js +56 -19
  133. package/dist/lib/map/Map.svelte +13 -0
  134. package/dist/lib/map/Map.svelte.d.ts +8 -0
  135. package/dist/lib/map/MapStyleDisplayOptions.svelte +61 -0
  136. package/dist/lib/map/MapStyleDisplayOptions.svelte.d.ts +3 -0
  137. package/dist/lib/map/Menu.svelte +64 -0
  138. package/dist/lib/map/Menu.svelte.d.ts +5 -0
  139. package/dist/lib/map/icons.d.ts +7 -0
  140. package/dist/lib/map/icons.js +24 -22
  141. package/dist/lib/map/integrations/base-layer-seperator.d.ts +9 -0
  142. package/dist/lib/map/integrations/base-layer-seperator.js +11 -12
  143. package/dist/lib/map/integrations/click-manager.d.ts +14 -0
  144. package/dist/lib/map/integrations/click-manager.js +52 -33
  145. package/dist/lib/map/integrations/integrations-manager.d.ts +8 -0
  146. package/dist/lib/map/integrations/integrations-manager.js +20 -12
  147. package/dist/lib/map/integrations/map-display-option.svelte.d.ts +7 -0
  148. package/dist/lib/map/integrations/map-display-option.svelte.js +10 -18
  149. package/dist/lib/map/integrations/map-geojson-integration.svelte.d.ts +13 -0
  150. package/dist/lib/map/integrations/map-geojson-integration.svelte.js +21 -17
  151. package/dist/lib/map/integrations/map-icon-manager.d.ts +15 -0
  152. package/dist/lib/map/integrations/map-icon-manager.js +52 -43
  153. package/dist/lib/map/integrations/map-integration.svelte.d.ts +6 -0
  154. package/dist/lib/map/integrations/map-integration.svelte.js +2 -5
  155. package/dist/lib/map/integrations/map-layer-integration.svelte.d.ts +11 -0
  156. package/dist/lib/map/integrations/map-layer-integration.svelte.js +36 -23
  157. package/dist/lib/map/integrations/tooltip.svelte.d.ts +28 -0
  158. package/dist/lib/map/integrations/tooltip.svelte.js +120 -78
  159. package/dist/lib/map/integrations/types.d.ts +14 -0
  160. package/dist/lib/map/integrations/types.js +1 -0
  161. package/dist/lib/map/map.svelte.d.ts +14 -0
  162. package/dist/lib/map/map.svelte.js +48 -50
  163. package/dist/lib/map/utils.d.ts +7 -0
  164. package/dist/lib/map/utils.js +33 -27
  165. package/dist/lib/monitors/components/MonitorClusterTooltip.svelte +112 -0
  166. package/dist/lib/monitors/components/MonitorClusterTooltip.svelte.d.ts +7 -0
  167. package/dist/lib/monitors/components/MonitorMarkersLegend.svelte +41 -0
  168. package/dist/lib/monitors/components/MonitorMarkersLegend.svelte.d.ts +3 -0
  169. package/dist/lib/monitors/components/MonitorSubscriptionManager.svelte +128 -0
  170. package/dist/lib/monitors/components/MonitorSubscriptionManager.svelte.d.ts +6 -0
  171. package/dist/lib/monitors/components/MonitorTooltip.svelte +61 -0
  172. package/dist/lib/monitors/components/MonitorTooltip.svelte.d.ts +7 -0
  173. package/dist/lib/monitors/components/MonitorWidgetModal.svelte +100 -0
  174. package/dist/lib/monitors/components/MonitorWidgetModal.svelte.d.ts +6 -0
  175. package/dist/lib/monitors/components/MonitorsDisplayOptions.svelte +79 -0
  176. package/dist/lib/monitors/components/MonitorsDisplayOptions.svelte.d.ts +3 -0
  177. package/dist/lib/monitors/monitor-utils.d.ts +4 -0
  178. package/dist/lib/monitors/monitor-utils.js +33 -23
  179. package/dist/lib/monitors/monitors-cluster-renderer.d.ts +33 -0
  180. package/dist/lib/monitors/monitors-cluster-renderer.js +218 -209
  181. package/dist/lib/monitors/monitors-icon-manager.svelte.d.ts +13 -0
  182. package/dist/lib/monitors/monitors-icon-manager.svelte.js +75 -70
  183. package/dist/lib/monitors/monitors-map-integration.svelte.d.ts +40 -0
  184. package/dist/lib/monitors/monitors-map-integration.svelte.js +278 -270
  185. package/dist/lib/monitors/monitors.svelte.d.ts +16 -0
  186. package/dist/lib/monitors/monitors.svelte.js +38 -67
  187. package/dist/lib/monitors/types.d.ts +26 -0
  188. package/dist/lib/monitors/types.js +1 -0
  189. package/dist/lib/reactivity.svelte.d.ts +0 -0
  190. package/dist/lib/reactivity.svelte.js +83 -0
  191. package/dist/lib/router-context.d.ts +27 -0
  192. package/dist/lib/router-context.js +13 -0
  193. package/dist/lib/routes.d.ts +2 -0
  194. package/dist/lib/routes.js +11 -0
  195. package/dist/lib/search/Search.svelte +189 -0
  196. package/dist/lib/search/Search.svelte.d.ts +3 -0
  197. package/dist/lib/search/service.d.ts +17 -0
  198. package/dist/lib/search/service.js +80 -0
  199. package/dist/lib/utils.d.ts +13 -0
  200. package/dist/lib/utils.js +11 -7
  201. package/dist/lib/weather.d.ts +1 -0
  202. package/dist/lib/weather.js +11 -7
  203. package/dist/lib/wind/wind.svelte.d.ts +10 -0
  204. package/dist/lib/wind/wind.svelte.js +13 -21
  205. package/package.json +45 -42
  206. package/src/lib/LoadScreen.svelte +5 -5
  207. package/src/lib/MainMapView.svelte +1 -0
  208. package/src/lib/MapLegend.svelte +15 -0
  209. package/src/lib/MonitorDetailPanel.svelte +152 -0
  210. package/src/lib/MonitorMapLayout.svelte +193 -0
  211. package/src/lib/components/MapLayersDisplayOptions.svelte +6 -2
  212. package/src/lib/hms/components/HMSFireLegend.svelte +21 -0
  213. package/src/lib/hms/hms.svelte.ts +8 -9
  214. package/src/lib/index.ts +52 -0
  215. package/src/lib/map/Map.svelte +1 -0
  216. package/src/lib/map/Menu.svelte +4 -7
  217. package/src/lib/map/integrations/map-icon-manager.ts +4 -1
  218. package/src/lib/monitors/monitors.svelte.ts +1 -3
  219. package/src/lib/router-context.ts +48 -0
  220. package/src/lib/routes.ts +13 -0
  221. package/src/lib/search/Search.svelte +189 -0
  222. package/src/lib/search/service.ts +101 -0
  223. package/src/lib/utils.ts +11 -0
  224. package/dist/lib/LoadScreen.js +0 -73
  225. package/dist/lib/assets/icons/adjustment-horizontal.js +0 -4
  226. package/dist/lib/collocation-sites/CollocationTooltip.js +0 -105
  227. package/dist/lib/components/DataBox.js +0 -30
  228. package/dist/lib/components/DisplayOption.js +0 -10
  229. package/dist/lib/components/MapLayersDisplayOptions.js +0 -78
  230. package/dist/lib/components/SegmentedControl.js +0 -37
  231. package/dist/lib/components/ToggleSwitch.js +0 -17
  232. package/dist/lib/components/ui/button/button.js +0 -34
  233. package/dist/lib/components/ui/range-calendar/range-calendar-caption.js +0 -79
  234. package/dist/lib/components/ui/range-calendar/range-calendar-cell.js +0 -34
  235. package/dist/lib/components/ui/range-calendar/range-calendar-day.js +0 -34
  236. package/dist/lib/components/ui/range-calendar/range-calendar-grid-body.js +0 -26
  237. package/dist/lib/components/ui/range-calendar/range-calendar-grid-head.js +0 -26
  238. package/dist/lib/components/ui/range-calendar/range-calendar-grid-row.js +0 -34
  239. package/dist/lib/components/ui/range-calendar/range-calendar-grid.js +0 -34
  240. package/dist/lib/components/ui/range-calendar/range-calendar-head-cell.js +0 -34
  241. package/dist/lib/components/ui/range-calendar/range-calendar-header.js +0 -34
  242. package/dist/lib/components/ui/range-calendar/range-calendar-month-select.js +0 -61
  243. package/dist/lib/components/ui/range-calendar/range-calendar-month.js +0 -25
  244. package/dist/lib/components/ui/range-calendar/range-calendar-months.js +0 -25
  245. package/dist/lib/components/ui/range-calendar/range-calendar-nav.js +0 -25
  246. package/dist/lib/components/ui/range-calendar/range-calendar-next-button.js +0 -57
  247. package/dist/lib/components/ui/range-calendar/range-calendar-prev-button.js +0 -57
  248. package/dist/lib/components/ui/range-calendar/range-calendar-year-select.js +0 -59
  249. package/dist/lib/components/ui/range-calendar/range-calendar.js +0 -272
  250. package/dist/lib/data-chart/DataChart.js +0 -142
  251. package/dist/lib/map/Map.js +0 -14
  252. package/dist/lib/map/MapStyleDisplayOptions.js +0 -43
  253. package/dist/lib/map/Menu.js +0 -45
  254. package/dist/lib/monitors/components/MonitorClusterTooltip.js +0 -83
  255. package/dist/lib/monitors/components/MonitorSubscriptionManager.js +0 -104
  256. package/dist/lib/monitors/components/MonitorTooltip.js +0 -59
  257. package/dist/lib/monitors/components/MonitorWidgetModal.js +0 -40
  258. package/dist/lib/monitors/components/MonitorsDisplayOptions.js +0 -76
  259. package/dist/lib/node_modules/@internationalized/date/dist/private/CalendarDate.js +0 -122
  260. package/dist/lib/node_modules/@internationalized/date/dist/private/DateFormatter.js +0 -84
  261. package/dist/lib/node_modules/@internationalized/date/dist/private/calendars/GregorianCalendar.js +0 -91
  262. package/dist/lib/node_modules/@internationalized/date/dist/private/conversion.js +0 -104
  263. package/dist/lib/node_modules/@internationalized/date/dist/private/manipulation.js +0 -159
  264. package/dist/lib/node_modules/@internationalized/date/dist/private/queries.js +0 -32
  265. package/dist/lib/node_modules/@internationalized/date/dist/private/string.js +0 -37
  266. package/dist/lib/node_modules/@internationalized/date/dist/private/utils.js +0 -6
  267. package/dist/lib/node_modules/clsx/dist/clsx.js +0 -16
  268. package/dist/lib/node_modules/tailwind-merge/dist/bundle-mjs.js +0 -1723
  269. package/dist/lib/node_modules/tailwind-variants/dist/chunk-LQJYWU4O.js +0 -70
  270. package/dist/lib/node_modules/tailwind-variants/dist/chunk-RZF76H2U.js +0 -166
  271. package/dist/lib/node_modules/tailwind-variants/dist/index.js +0 -19
  272. package/dist/lib/node_modules/uplot/dist/uPlot.esm.js +0 -2147
  273. package/dist/lib/sjvair-air.avif +0 -0
  274. package/dist/lib/sjvair-air.png +0 -0
  275. package/dist/lib/sjvair-air.webp +0 -0
  276. package/dist/lib/sjvair-air2.avif +0 -0
  277. package/dist/lib/sjvair-air2.png +0 -0
  278. package/dist/lib/sjvair-air2.webp +0 -0
  279. package/dist/lib/sjvair-icon.avif +0 -0
  280. package/dist/lib/sjvair-icon.png +0 -0
  281. package/dist/lib/sjvair-icon.webp +0 -0
  282. package/dist/lib/sjvair-icon2.avif +0 -0
  283. package/dist/lib/sjvair-icon2.png +0 -0
  284. package/dist/lib/sjvair-icon2.webp +0 -0
  285. package/dist/lib/sjvair-sjv.avif +0 -0
  286. package/dist/lib/sjvair-sjv.png +0 -0
  287. package/dist/lib/sjvair-sjv.webp +0 -0
  288. package/dist/lib/sjvair-sjv2.avif +0 -0
  289. package/dist/lib/sjvair-sjv2.png +0 -0
  290. package/dist/lib/sjvair-sjv2.webp +0 -0
  291. package/dist/lib/src/MapView.js +0 -7
  292. package/dist/lib/src/MonitorDetailPanel.js +0 -169
  293. package/dist/lib/src/router.js +0 -9
  294. package/dist/monitor-map/MonitorDetailPanel.css +0 -1
  295. package/dist/monitor-map/assets/MonitorDetailPanel-BU_pXZjp.js +0 -15
  296. package/dist/monitor-map/assets/validate-routes-CgbRa8fT.js +0 -1
  297. package/dist/monitor-map/inter-cyrillic-ext-wght-normal.woff2 +0 -0
  298. package/dist/monitor-map/inter-cyrillic-wght-normal.woff2 +0 -0
  299. package/dist/monitor-map/inter-greek-ext-wght-normal.woff2 +0 -0
  300. package/dist/monitor-map/inter-greek-wght-normal.woff2 +0 -0
  301. package/dist/monitor-map/inter-latin-ext-wght-normal.woff2 +0 -0
  302. package/dist/monitor-map/inter-latin-wght-normal.woff2 +0 -0
  303. package/dist/monitor-map/inter-vietnamese-wght-normal.woff2 +0 -0
  304. package/dist/monitor-map/lungs.svg +0 -99
  305. package/dist/monitor-map/sjvair-air.avif +0 -0
  306. package/dist/monitor-map/sjvair-air.png +0 -0
  307. package/dist/monitor-map/sjvair-air.webp +0 -0
  308. package/dist/monitor-map/sjvair-air2.avif +0 -0
  309. package/dist/monitor-map/sjvair-air2.png +0 -0
  310. package/dist/monitor-map/sjvair-air2.webp +0 -0
  311. package/dist/monitor-map/sjvair-icon.avif +0 -0
  312. package/dist/monitor-map/sjvair-icon.png +0 -0
  313. package/dist/monitor-map/sjvair-icon.webp +0 -0
  314. package/dist/monitor-map/sjvair-icon2.avif +0 -0
  315. package/dist/monitor-map/sjvair-icon2.png +0 -0
  316. package/dist/monitor-map/sjvair-icon2.webp +0 -0
  317. package/dist/monitor-map/sjvair-sjv.avif +0 -0
  318. package/dist/monitor-map/sjvair-sjv.png +0 -0
  319. package/dist/monitor-map/sjvair-sjv.webp +0 -0
  320. package/dist/monitor-map/sjvair-sjv2.avif +0 -0
  321. package/dist/monitor-map/sjvair-sjv2.png +0 -0
  322. package/dist/monitor-map/sjvair-sjv2.webp +0 -0
  323. package/dist/monitor-map/sjvairMonitorMap.css +0 -1
  324. package/dist/monitor-map/sjvairMonitorMap.js +0 -4042
@@ -1,68 +1,39 @@
1
- import { route as e } from "../src/router.js";
2
- import * as t from "svelte/internal/client";
3
- import { getMonitors as n, getMonitorsLatest as r, getMonitorsMeta as i } from "@sjvair/sdk";
4
- import { XMap as a } from "@tstk/builtin-extensions";
5
- import { Interval as o } from "@tstk/utils";
6
- //#region src/lib/monitors/monitors.svelte.ts
7
- var s = class {
8
- autoUpdate = new o(async () => await this.update(), 120 * 1e3);
9
- #e = t.state(!1);
10
- get initialized() {
11
- return t.get(this.#e);
12
- }
13
- set initialized(e) {
14
- t.set(this.#e, e, !0);
15
- }
16
- #t = t.state(null);
17
- get latest() {
18
- return t.get(this.#t);
19
- }
20
- set latest(e) {
21
- t.set(this.#t, e, !0);
22
- }
23
- #n = t.state(null);
24
- get list() {
25
- return t.get(this.#n);
26
- }
27
- set list(e) {
28
- t.set(this.#n, e, !0);
29
- }
30
- #r = t.state(null);
31
- get meta() {
32
- return t.get(this.#r);
33
- }
34
- set meta(e) {
35
- t.set(this.#r, e, !0);
36
- }
37
- #i = t.state(null);
38
- get pollutant() {
39
- return t.get(this.#i);
40
- }
41
- set pollutant(e) {
42
- t.set(this.#i, e, !0);
43
- }
44
- #a = t.derived(() => this.meta?.entryType(this.pollutant ?? this.meta.default_pollutant).asIter.levels || null);
45
- get levels() {
46
- return t.get(this.#a);
47
- }
48
- set levels(e) {
49
- t.set(this.#a, e);
50
- }
51
- async init() {
52
- if (this.initialized) return;
53
- [this.list, this.meta] = await Promise.all([n(), i()]);
54
- let t = e.search.pollutant;
55
- this.pollutant = t === "pm25" || t === "o3" ? t : this.meta.default_pollutant, this.latest = await c(this.pollutant), this.autoUpdate.start(), this.initialized = !0;
56
- }
57
- async update() {
58
- this.initialized && ([this.list, this.latest] = await Promise.all([n(), c(this.pollutant || this.meta?.default_pollutant || "pm25")]));
59
- }
60
- };
61
- async function c(e) {
62
- let t = await r(e), n = new a();
63
- for (let e of t) n.set(e.id, e);
64
- return n;
1
+ import { getMonitors, getMonitorsLatest, getMonitorsMeta } from "@sjvair/sdk";
2
+ import { XMap } from "@tstk/builtin-extensions";
3
+ import { Interval } from "@tstk/utils";
4
+ class MonitorsManager {
5
+ autoUpdate = new Interval(async () => await this.update(), 2 * 60 * 1000);
6
+ initialized = $state(false);
7
+ latest = $state(null);
8
+ list = $state(null);
9
+ meta = $state(null);
10
+ pollutant = $state(null);
11
+ levels = $derived(this.meta?.entryType(this.pollutant ?? this.meta.default_pollutant).asIter.levels || null);
12
+ async init(urlPollutant) {
13
+ if (this.initialized)
14
+ return;
15
+ [this.list, this.meta] = await Promise.all([getMonitors(), getMonitorsMeta()]);
16
+ this.pollutant =
17
+ urlPollutant === "pm25" || urlPollutant === "o3" ? urlPollutant : this.meta.default_pollutant;
18
+ this.latest = await getMonitorsLatestMap(this.pollutant);
19
+ this.autoUpdate.start();
20
+ this.initialized = true;
21
+ }
22
+ async update() {
23
+ if (!this.initialized)
24
+ return;
25
+ [this.list, this.latest] = await Promise.all([
26
+ getMonitors(),
27
+ getMonitorsLatestMap(this.pollutant || this.meta?.default_pollutant || "pm25")
28
+ ]);
29
+ }
65
30
  }
66
- var l = new s();
67
- //#endregion
68
- export { l as monitorsManager };
31
+ async function getMonitorsLatestMap(pollutant) {
32
+ const monitors = await getMonitorsLatest(pollutant);
33
+ const latest = new XMap();
34
+ for (const monitor of monitors) {
35
+ latest.set(monitor.id, monitor);
36
+ }
37
+ return latest;
38
+ }
39
+ export const monitorsManager = new MonitorsManager();
@@ -0,0 +1,26 @@
1
+ import type { Feature, Geometry } from "geojson";
2
+ import type { MonitorType } from "@sjvair/sdk";
3
+ import type { MapGeoJSONFeature } from "@maptiler/sdk";
4
+ export type MonitorMapFeature = Feature<Geometry, MonitorMarkerProperties>;
5
+ export interface MonitorClusterMapFeature extends MapGeoJSONFeature {
6
+ properties: MonitorClusterMarkerProperties;
7
+ }
8
+ export interface MonitorMarkerProperties {
9
+ icon: string;
10
+ id: string;
11
+ is_active: boolean;
12
+ is_sjvair?: boolean;
13
+ location: string;
14
+ name: string;
15
+ order: number;
16
+ type: MonitorType;
17
+ value: string;
18
+ }
19
+ export interface MonitorClusterMarkerProperties {
20
+ cluster: true;
21
+ cluster_id: number;
22
+ point_count: number;
23
+ point_count_abbreviated: string | number;
24
+ sumValues: number;
25
+ countValues: number;
26
+ }
@@ -0,0 +1 @@
1
+ export {};
File without changes
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ //class ReactiveState<T> {
3
+ // private internalValue?: T = $state();
4
+ //
5
+ // constructor(initialValue?: T) {
6
+ // this.internalValue = initialValue;
7
+ // }
8
+ // get value(): T | undefined {
9
+ // return this.internalValue;
10
+ // }
11
+ //
12
+ // set value(newValue: T) {
13
+ // // Perform any validation or side effects here
14
+ // this.internalValue = newValue; // Update the reactive state
15
+ // }
16
+ //}
17
+ //
18
+ //class ShallowReactiveState<T> {
19
+ // private internalValue?: T = $state.raw();
20
+ //
21
+ // constructor(initialValue?: T) {
22
+ // this.internalValue = initialValue;
23
+ // }
24
+ // get value(): T | undefined {
25
+ // return this.internalValue;
26
+ // }
27
+ //
28
+ // set value(newValue: T) {
29
+ // // Perform any validation or side effects here
30
+ // this.internalValue = newValue; // Update the reactive state
31
+ // }
32
+ //}
33
+ //
34
+ //
35
+ //class DerivedReactiveState<T> {
36
+ // private internalValue?: T;
37
+ //
38
+ // constructor(expression: () => T) {
39
+ // this.internalValue = $derived.by(expression);
40
+ // }
41
+ // get value(): T | undefined {
42
+ // return this.internalValue;
43
+ // }
44
+ // set value(newValue: T) {
45
+ // this.internalValue = newValue;
46
+ // }
47
+ //}
48
+ //
49
+ //export function Derived<V>(value: () => V) {
50
+ // let ref: DerivedReactiveState<V> = new DerivedReactiveState<V>(value);
51
+ // return function <V, T = unknown>(
52
+ // _target: ClassAccessorDecoratorTarget<T, V>,
53
+ // _ctx: ClassAccessorDecoratorContext,
54
+ // ): ClassAccessorDecoratorResult<T, V> {
55
+ //
56
+ // return {
57
+ // get() {
58
+ // return ref.value as V;
59
+ // },
60
+ // };
61
+ // }
62
+ //}
63
+ //export function Reactive(shallow?: boolean) {
64
+ // return function <V, T = unknown>(
65
+ // _target: ClassAccessorDecoratorTarget<T, V>,
66
+ // _ctx: ClassAccessorDecoratorContext,
67
+ // ): ClassAccessorDecoratorResult<T, V> {
68
+ // let ref = shallow ? new ShallowReactiveState<V>() : new ReactiveState<V>();
69
+ //
70
+ // return {
71
+ // get(): V {
72
+ // return ref.value as V;
73
+ // },
74
+ // set(newValue): void {
75
+ // ref.value = newValue;
76
+ // },
77
+ // init(initialValue: V): V {
78
+ // ref.value = initialValue;
79
+ // return ref.value as V;
80
+ // }
81
+ // };
82
+ // };
83
+ //}
@@ -0,0 +1,27 @@
1
+ import type { ConstructUrlOptions, Navigation, NavigateOptions, RouterApi, Routes } from "sv-router";
2
+ export declare const ROUTER_KEY: unique symbol;
3
+ export interface MonitorMapRouterApi {
4
+ route: RouterApi<Routes>["route"];
5
+ /**
6
+ * Loosely typed against `string` rather than sv-router's literal-checked `Path<T>` union:
7
+ * internal calls prefix paths with `basePath` (a runtime string), which can't satisfy a
8
+ * template literal type checked against the host app's full route tree.
9
+ */
10
+ navigate(path: string, options?: NavigateOptions & {
11
+ params?: Record<string, string>;
12
+ }): Promise<Navigation>;
13
+ p(path: string, options?: ConstructUrlOptions & {
14
+ params?: Record<string, string>;
15
+ }): string;
16
+ isActive: {
17
+ (path: string, params?: Record<string, string>): boolean;
18
+ startsWith(path: string, params?: Record<string, string>): boolean;
19
+ };
20
+ /**
21
+ * Prefix under which monitorMapRoutes is mounted in the host app's router,
22
+ * e.g. "" at the app root, or "/my-map" when nested under a host route.
23
+ */
24
+ basePath: string;
25
+ }
26
+ export declare function provideMonitorMapRouter(api: MonitorMapRouterApi): void;
27
+ export declare function useMonitorMapRouter(): MonitorMapRouterApi;
@@ -0,0 +1,13 @@
1
+ import { getContext, setContext } from "svelte";
2
+ export const ROUTER_KEY = Symbol("monitor-map-router");
3
+ export function provideMonitorMapRouter(api) {
4
+ setContext(ROUTER_KEY, api);
5
+ }
6
+ export function useMonitorMapRouter() {
7
+ const api = getContext(ROUTER_KEY);
8
+ if (!api) {
9
+ throw new Error("monitor-map router context not found. Wrap your app root with " +
10
+ "provideMonitorMapRouter(...) before rendering monitor-map components.");
11
+ }
12
+ return api;
13
+ }
@@ -0,0 +1,2 @@
1
+ import type { Routes } from "sv-router";
2
+ export declare const monitorMapRoutes: Routes;
@@ -0,0 +1,11 @@
1
+ import MonitorMapLayout from "./MonitorMapLayout.svelte";
2
+ import MainMapView from "./MainMapView.svelte";
3
+ // Explicitly typed as sv-router's own `Routes` so declaration emission doesn't
4
+ // need to name svelte2tsx's internal per-component prop types (see
5
+ // MonitorMapLayout/MainMapView.svelte) and so this stays assignable to
6
+ // `createRouter`'s `Routes`-constrained parameter in a host app's router.ts.
7
+ export const monitorMapRoutes = {
8
+ layout: MonitorMapLayout,
9
+ "/": MainMapView,
10
+ "/monitor/:id": () => import("./MonitorDetailPanel.svelte")
11
+ };
@@ -0,0 +1,189 @@
1
+ <script lang="ts">
2
+ import { onDestroy } from "svelte";
3
+ import { Marker } from "@maptiler/sdk";
4
+ import { SearchIcon } from "@lucide/svelte";
5
+ import { useMonitorMapRouter } from "../router-context";
6
+ import { mapManager } from "../map/map.svelte";
7
+ import { debounce } from "../utils";
8
+ import { monitorSearch, geocode, type SearchResult } from "./service";
9
+ import { monitorsMapIntegration } from "../monitors/monitors-map-integration.svelte";
10
+
11
+ const { navigate, basePath } = useMonitorMapRouter();
12
+
13
+ let collapsed = $state(true);
14
+ let searchText = $state("");
15
+ let results: SearchResult[] = $state([]);
16
+ let marker: Marker | null = $state.raw(null);
17
+ let inputEl: HTMLInputElement | null = $state(null);
18
+
19
+ function clickOutside(node: HTMLElement) {
20
+ function handler(e: MouseEvent) {
21
+ if (!collapsed && !node.contains(e.target as Node)) {
22
+ collapsed = true;
23
+ searchText = "";
24
+ results = [];
25
+ }
26
+ }
27
+ document.addEventListener("click", handler, true);
28
+ return {
29
+ destroy() {
30
+ document.removeEventListener("click", handler, true);
31
+ }
32
+ };
33
+ }
34
+
35
+ async function openSearch() {
36
+ if (collapsed) {
37
+ collapsed = false;
38
+ inputEl?.focus();
39
+ }
40
+ }
41
+
42
+ function clearSearch() {
43
+ searchText = "";
44
+ results = [];
45
+ marker?.remove();
46
+ marker = null;
47
+ }
48
+
49
+ async function handleInput() {
50
+ const query = searchText;
51
+ if (!query) {
52
+ results = [];
53
+ marker?.remove();
54
+ marker = null;
55
+ return;
56
+ }
57
+ const monitorResults = await monitorSearch(query);
58
+ if (searchText !== query) return;
59
+ if (monitorResults.length) {
60
+ results = monitorResults;
61
+ } else if (query.length > 4) {
62
+ const geo = await geocode(query);
63
+ if (searchText !== query) return;
64
+ results = geo;
65
+ } else {
66
+ results = [];
67
+ }
68
+ }
69
+
70
+ const debouncedSearch = debounce(handleInput, 500);
71
+
72
+ async function selectMonitor(result: Extract<SearchResult, { type: "monitor" }>) {
73
+ collapsed = true;
74
+ searchText = "";
75
+ results = [];
76
+ marker?.remove();
77
+ marker = null;
78
+ if (mapManager.map && result.monitor.position) {
79
+ const { coordinates } = result.monitor.position;
80
+ const center: [number, number] = [coordinates[0], coordinates[1]];
81
+ mapManager.map.flyTo({
82
+ center,
83
+ zoom: 12
84
+ });
85
+ }
86
+ await navigate(`${basePath}/monitor/:id`, { params: { id: result.monitor.id } });
87
+ monitorsMapIntegration.selectedMonitorId = result.monitor.id;
88
+ }
89
+
90
+ function selectGeocode(result: Extract<SearchResult, { type: "geocode" }>) {
91
+ const { feature } = result;
92
+ marker?.remove();
93
+ marker = null;
94
+ if (mapManager.map) {
95
+ const center: [number, number] = [feature.center[0], feature.center[1]];
96
+ marker = new Marker().setLngLat(center).addTo(mapManager.map);
97
+ const isAddress = feature.place_type?.[0] === "address";
98
+ mapManager.map.flyTo({
99
+ center,
100
+ ...(isAddress && { zoom: 16 })
101
+ });
102
+ }
103
+ results = [];
104
+ collapsed = true;
105
+ }
106
+
107
+ onDestroy(() => {
108
+ marker?.remove();
109
+ });
110
+ </script>
111
+
112
+ <div
113
+ class={[
114
+ "flex flex-col bg-white shadow-md overflow-hidden transition-all duration-300 select-none",
115
+ collapsed ? "w-12 h-12 rounded-full" : "w-90 rounded-3xl",
116
+ !collapsed && results.length ? "max-h-90" : "max-h-12"
117
+ ]}
118
+ use:clickOutside
119
+ >
120
+ <div class="flex items-center w-full h-12 shrink-0">
121
+ <button
122
+ class="w-12 h-12 shrink-0 flex items-center justify-center rounded-full bg-brand border-4 border-white"
123
+ onclick={openSearch}
124
+ aria-label="Open search"
125
+ >
126
+ <SearchIcon size="24" color="#FFFFFF" />
127
+ </button>
128
+ <div class="overflow-hidden w-full h-full flex items-center">
129
+ <input
130
+ bind:this={inputEl}
131
+ bind:value={searchText}
132
+ oninput={debouncedSearch}
133
+ type="text"
134
+ placeholder="Search monitors or locations..."
135
+ class="h-full px-2 text-sm bg-transparent border-none outline-none w-full"
136
+ tabindex={collapsed ? -1 : 0}
137
+ />
138
+ {#if searchText && !collapsed}
139
+ <button
140
+ onclick={clearSearch}
141
+ class="px-2 text-gray-400 hover:text-gray-600 text-xl leading-none cursor-pointer"
142
+ aria-label="Clear search">×</button
143
+ >
144
+ {/if}
145
+ </div>
146
+ </div>
147
+ <div
148
+ class={[
149
+ "overflow-y-auto transition-all duration-300 divide-y divide-gray-100",
150
+ !collapsed ? "max-h-80" : "max-h-0"
151
+ ]}
152
+ >
153
+ {#each results as result (result.type === "monitor" ? result.monitor.id : result.feature.place_name)}
154
+ {#if result.type === "monitor"}
155
+ <button
156
+ onclick={() => selectMonitor(result)}
157
+ class="flex items-center w-full h-12 px-4 hover:brightness-95 bg-white text-left"
158
+ >
159
+ {#if result.logo.url}
160
+ <img
161
+ src={result.logo.url}
162
+ alt={result.logo.alt}
163
+ class="w-10 h-10 object-contain mr-3 shrink-0"
164
+ />
165
+ {/if}
166
+ <span class="text-sm truncate">{result.monitor.name}</span>
167
+ </button>
168
+ {:else}
169
+ {@const comma = result.feature.place_name.indexOf(",")}
170
+ <button
171
+ onclick={() => selectGeocode(result)}
172
+ class="flex items-center w-full h-12 px-4 hover:brightness-95 bg-white text-left"
173
+ >
174
+ <span class="svg-icon location-on bg-brand w-6 h-6 shrink-0 mr-3"></span>
175
+ <div class="min-w-0">
176
+ <p class="text-sm font-medium truncate">
177
+ {result.feature.place_name.substring(0, comma < 0 ? undefined : comma)}
178
+ </p>
179
+ {#if comma >= 0}
180
+ <p class="text-xs text-muted-foreground truncate">
181
+ {result.feature.place_name.substring(comma + 1).trim()}
182
+ </p>
183
+ {/if}
184
+ </div>
185
+ </button>
186
+ {/if}
187
+ {/each}
188
+ </div>
189
+ </div>
@@ -0,0 +1,3 @@
1
+ declare const Search: import("svelte").Component<Record<string, never>, {}, "">;
2
+ type Search = ReturnType<typeof Search>;
3
+ export default Search;
@@ -0,0 +1,17 @@
1
+ import { type GeocodingFeature } from "@maptiler/sdk";
2
+ import type { MonitorLatestType } from "@sjvair/sdk";
3
+ export type MonitorResult = {
4
+ type: "monitor";
5
+ monitor: MonitorLatestType<"pm25" | "o3">;
6
+ logo: {
7
+ url: string;
8
+ alt: string;
9
+ };
10
+ };
11
+ export type GeocodeResult = {
12
+ type: "geocode";
13
+ feature: GeocodingFeature;
14
+ };
15
+ export type SearchResult = MonitorResult | GeocodeResult;
16
+ export declare function monitorSearch(query: string): Promise<SearchResult[]>;
17
+ export declare function geocode(query: string): Promise<SearchResult[]>;
@@ -0,0 +1,80 @@
1
+ import { geocoding } from "@maptiler/sdk";
2
+ import { monitorsManager } from "../monitors/monitors.svelte";
3
+ import AirGradientLogo from "../assets/logos/airgradient-blue.svg";
4
+ import AirNowLogo from "../assets/logos/airnow-compact.jpg";
5
+ import CarbLogo from "../assets/logos/carb-compact.jpg";
6
+ import PurpleairLogo from "../assets/logos/purpleair-compact.png";
7
+ import SJVAirLogo from "../assets/logos/sjvair.svg";
8
+ const SJV_CENTER = [-119.8, 36.76];
9
+ function getMonitorLogo(monitor) {
10
+ switch (monitor.data_source.name) {
11
+ case "AQview":
12
+ return { url: CarbLogo, alt: "AQview" };
13
+ case "AirNow.gov":
14
+ return { url: AirNowLogo, alt: "AirNow.gov" };
15
+ case "PurpleAir":
16
+ return { url: PurpleairLogo, alt: "PurpleAir" };
17
+ case "Central California Asthma Collaborative":
18
+ return { url: SJVAirLogo, alt: "Central California Asthma Collaborative" };
19
+ case "AirGradient":
20
+ return { url: AirGradientLogo, alt: "AirGradient" };
21
+ default:
22
+ console.warn(`[search] Unknown data source: ${monitor.data_source.name}`);
23
+ return { url: "", alt: "" };
24
+ }
25
+ }
26
+ let proximityCache = null;
27
+ function getProximity() {
28
+ return (proximityCache ??= resolveProximity());
29
+ }
30
+ function resolveProximity() {
31
+ return new Promise((resolve) => {
32
+ if (!navigator.geolocation) {
33
+ resolve(SJV_CENTER);
34
+ return;
35
+ }
36
+ const timeout = setTimeout(() => resolve(SJV_CENTER), 3000);
37
+ navigator.geolocation.getCurrentPosition((pos) => {
38
+ clearTimeout(timeout);
39
+ resolve([pos.coords.longitude, pos.coords.latitude]);
40
+ }, () => {
41
+ clearTimeout(timeout);
42
+ resolve(SJV_CENTER);
43
+ });
44
+ });
45
+ }
46
+ export async function monitorSearch(query) {
47
+ if (!monitorsManager.latest)
48
+ return [];
49
+ const normalized = query.toLowerCase();
50
+ const exact = [];
51
+ const prefix = [];
52
+ const substr = [];
53
+ for (const monitor of monitorsManager.latest.values()) {
54
+ const name = monitor.name.toLowerCase();
55
+ if (name === normalized)
56
+ exact.push(monitor);
57
+ else if (name.startsWith(normalized))
58
+ prefix.push(monitor);
59
+ else if (name.includes(normalized))
60
+ substr.push(monitor);
61
+ }
62
+ return [...exact, ...prefix, ...substr]
63
+ .slice(0, 4)
64
+ .map((monitor) => ({ type: "monitor", monitor, logo: getMonitorLogo(monitor) }));
65
+ }
66
+ export async function geocode(query) {
67
+ const proximity = await getProximity();
68
+ try {
69
+ const result = await geocoding.forward(query, {
70
+ country: ["us"],
71
+ fuzzyMatch: true,
72
+ limit: 4,
73
+ proximity
74
+ });
75
+ return result.features.map((feature) => ({ type: "geocode", feature }));
76
+ }
77
+ catch {
78
+ return [];
79
+ }
80
+ }
@@ -0,0 +1,13 @@
1
+ import { type ClassValue } from "clsx";
2
+ export declare function cn(...inputs: ClassValue[]): string;
3
+ export type WithoutChild<T> = T extends {
4
+ child?: any;
5
+ } ? Omit<T, "child"> : T;
6
+ export type WithoutChildren<T> = T extends {
7
+ children?: any;
8
+ } ? Omit<T, "children"> : T;
9
+ export type WithoutChildrenOrChild<T> = WithoutChildren<WithoutChild<T>>;
10
+ export type WithElementRef<T, U extends HTMLElement = HTMLElement> = T & {
11
+ ref?: U | null;
12
+ };
13
+ export declare function debounce<T extends (...args: unknown[]) => void>(fn: T, wait: number): (...args: Parameters<T>) => void;
package/dist/lib/utils.js CHANGED
@@ -1,8 +1,12 @@
1
- import e from "./node_modules/clsx/dist/clsx.js";
2
- import { twMerge as t } from "./node_modules/tailwind-merge/dist/bundle-mjs.js";
3
- //#region src/lib/utils.ts
4
- function n(...n) {
5
- return t(e(n));
1
+ import { clsx } from "clsx";
2
+ import { twMerge } from "tailwind-merge";
3
+ export function cn(...inputs) {
4
+ return twMerge(clsx(inputs));
5
+ }
6
+ export function debounce(fn, wait) {
7
+ let timer;
8
+ return (...args) => {
9
+ clearTimeout(timer);
10
+ timer = setTimeout(() => fn(...args), wait);
11
+ };
6
12
  }
7
- //#endregion
8
- export { n as cn };
@@ -0,0 +1 @@
1
+ export declare function fetchTempByCoords(coords: [number, number] | Array<number>): Promise<number>;
@@ -1,8 +1,12 @@
1
- //#region src/lib/weather.ts
2
- async function e(e) {
3
- if (e.length !== 2) throw Error("Invalid coordinates provided for fetching temperature");
4
- let t = `https://api.weather.gov/points/${e.toReversed().join(",")}`;
5
- return fetch(t).then((e) => e.json()).then(async (e) => (await fetch(e.properties.forecastHourly).then((e) => e.json())).properties.periods[0].temperature);
1
+ export async function fetchTempByCoords(coords) {
2
+ if (coords.length !== 2) {
3
+ throw new Error("Invalid coordinates provided for fetching temperature");
4
+ }
5
+ const url = `https://api.weather.gov/points/${coords.toReversed().join(",")}`;
6
+ return fetch(url)
7
+ .then((res) => res.json())
8
+ .then(async (data) => {
9
+ const forecast = await fetch(data.properties.forecastHourly).then((res) => res.json());
10
+ return forecast.properties.periods[0].temperature;
11
+ });
6
12
  }
7
- //#endregion
8
- export { e as fetchTempByCoords };
@@ -0,0 +1,10 @@
1
+ import { Map as MaptilerMap } from "@maptiler/sdk";
2
+ import { MapLayerIntegration } from "../map/integrations/map-layer-integration.svelte.ts";
3
+ declare class WindMapIntegration extends MapLayerIntegration {
4
+ referenceId: string;
5
+ beforeLayer: string;
6
+ enabled: boolean;
7
+ mapLayer: Parameters<MaptilerMap["addLayer"]>[0];
8
+ }
9
+ export declare const windMapIntegration: WindMapIntegration;
10
+ export type { WindMapIntegration };