@uniai-fe/uds-templates 0.5.28 → 0.6.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.
- package/README.md +3 -6
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/cctv/styles/variables.scss +1 -1
- package/src/weather/_legacy/apis/index.ts +4 -0
- package/src/weather/_legacy/data/response.ts +36 -0
- package/src/weather/_legacy/hooks/index.ts +5 -0
- package/src/weather/{hooks → _legacy/hooks}/useOpenWeatherMap.ts +1 -1
- package/src/weather/{hooks → _legacy/hooks}/useWeatherKorea.ts +4 -7
- package/src/weather/{hooks → _legacy/hooks}/useWeatherKoreaAlert.ts +2 -4
- package/src/weather/_legacy/types/api.ts +221 -0
- package/src/weather/_legacy/types/base.ts +70 -0
- package/src/weather/_legacy/types/index.ts +4 -0
- package/src/weather/_legacy/utils/index.ts +5 -0
- package/src/weather/_legacy/utils/locale.ts +28 -0
- package/src/weather/_legacy/utils/location.ts +139 -0
- package/src/weather/_legacy/utils/weather.ts +460 -0
- package/src/weather/apis/client.ts +339 -0
- package/src/weather/apis/index.ts +2 -4
- package/src/weather/apis/server.ts +264 -0
- package/src/weather/components/icon/Address.tsx +7 -0
- package/src/weather/components/icon/Weather.tsx +7 -6
- package/src/weather/components/page-header/Address.tsx +14 -0
- package/src/weather/components/page-header/Alert.tsx +17 -13
- package/src/weather/components/page-header/Container.tsx +12 -19
- package/src/weather/components/page-header/Forecast.tsx +21 -28
- package/src/weather/components/page-header/NextDays.tsx +10 -0
- package/src/weather/components/page-header/Today.tsx +86 -158
- package/src/weather/components/page-header/index.ts +5 -0
- package/src/weather/data/response.ts +4 -23
- package/src/weather/hooks/index.ts +3 -3
- package/src/weather/hooks/useWeather.ts +52 -0
- package/src/weather/hooks/useWeatherAlert.ts +35 -0
- package/src/weather/index.tsx +2 -2
- package/src/weather/jotai/coordinate.ts +4 -0
- package/src/weather/jotai/farm-idx.ts +4 -0
- package/src/weather/types/api.ts +393 -114
- package/src/weather/types/base.ts +15 -32
- package/src/weather/types/index.ts +0 -3
- package/src/weather/types/page-header.ts +118 -68
- package/src/weather/utils/index.ts +6 -4
- package/src/weather/utils/locale.ts +7 -69
- package/src/weather/utils/location.ts +6 -141
- package/src/weather/utils/weather.ts +53 -456
- package/src/weather/data/alert-regions-meta.json +0 -1286
- package/src/weather/data/weather-regions-meta.json +0 -9833
- package/src/weather/types/provider.ts +0 -34
- package/src/weather/utils/alert.ts +0 -30
- /package/src/weather/{apis → _legacy/apis}/korea/client.ts +0 -0
- /package/src/weather/{apis → _legacy/apis}/korea/server.ts +0 -0
- /package/src/weather/{apis → _legacy/apis}/open-weather-map/client.ts +0 -0
- /package/src/weather/{apis → _legacy/apis}/open-weather-map/server.ts +0 -0
- /package/src/weather/{types → _legacy/types}/korea.ts +0 -0
- /package/src/weather/{types → _legacy/types}/open-weather-map.ts +0 -0
- /package/src/weather/{utils → _legacy/utils}/date-time.ts +0 -0
- /package/src/weather/{utils → _legacy/utils}/validate.ts +0 -0
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Weather Provider; provider 식별자
|
|
3
|
-
* @desc 현재 확정된 provider만 나열하고, 국가별 상세 API 체계는 후속 결정에서 확장한다.
|
|
4
|
-
*/
|
|
5
|
-
export type WeatherProviderKey = "kma" | "openWeatherMap";
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Weather Provider; provider별 지원 기능
|
|
9
|
-
* @property {boolean} now 현재 날씨 지원 여부
|
|
10
|
-
* @property {boolean} forecast 예보 날씨 지원 여부
|
|
11
|
-
* @property {boolean} alert 특보 지원 여부
|
|
12
|
-
*/
|
|
13
|
-
export interface WeatherProviderCapability {
|
|
14
|
-
/**
|
|
15
|
-
* 현재 날씨 지원 여부
|
|
16
|
-
*/
|
|
17
|
-
now: boolean;
|
|
18
|
-
/**
|
|
19
|
-
* 예보 날씨 지원 여부
|
|
20
|
-
*/
|
|
21
|
-
forecast: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* 특보 지원 여부
|
|
24
|
-
*/
|
|
25
|
-
alert: boolean;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Weather Provider; provider capability registry
|
|
30
|
-
*/
|
|
31
|
-
export type WeatherProviderCapabilityRegistry = Record<
|
|
32
|
-
WeatherProviderKey,
|
|
33
|
-
WeatherProviderCapability
|
|
34
|
-
>;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 특보 도구; 지역 ID 추출
|
|
3
|
-
* @param {Array} params
|
|
4
|
-
* @param {Array<{ lat:number; lon:number; regId:string; }>} params.regions - 지역 목록
|
|
5
|
-
* @param {[number, number]} params.coordinate - [위도, 경도]
|
|
6
|
-
*/
|
|
7
|
-
export const getRegId = ({
|
|
8
|
-
regions,
|
|
9
|
-
coordinate,
|
|
10
|
-
}: {
|
|
11
|
-
regions: Array<{
|
|
12
|
-
[dataKey: string]: unknown;
|
|
13
|
-
lat: number;
|
|
14
|
-
lon: number;
|
|
15
|
-
regId: string;
|
|
16
|
-
}>;
|
|
17
|
-
coordinate: [number, number];
|
|
18
|
-
}): string | null => {
|
|
19
|
-
const [lat, lng] = coordinate;
|
|
20
|
-
let bestId: string | null = null;
|
|
21
|
-
let min = Infinity;
|
|
22
|
-
for (const z of regions) {
|
|
23
|
-
const d = Math.hypot(lat - z.lat, lng - z.lon);
|
|
24
|
-
if (d < min) {
|
|
25
|
-
min = d;
|
|
26
|
-
bestId = z.regId;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
return bestId;
|
|
30
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|