@ixnode/geo-sphere
Advanced tools
Comparing version
@@ -29,2 +29,3 @@ import { TypeTranslation } from "./_types/types"; | ||
population: number | null; | ||
altitude?: number | null; | ||
translation: TypeTranslation; | ||
@@ -31,0 +32,0 @@ size: TypeCitySize; |
import React from 'react'; | ||
import { CountryData, PlaceData } from "./config/interfaces"; | ||
import { TypeLanguagesSupported } from "../../config/types"; | ||
import { TypeLanguagesSupported, TypeLanguagesSupportedStorybook } from "../../config/types"; | ||
import { TypeDataSource } from "./types/types"; | ||
@@ -30,2 +30,28 @@ import './WorldMap.scss'; | ||
} | ||
export interface WorldMapProps { | ||
dataSource?: TypeDataSource; | ||
country?: string | null; | ||
width?: number; | ||
height?: number; | ||
onClickCountry?: ((data: CountryData) => void) | null; | ||
onClickPlace?: ((data: PlaceData) => void) | null; | ||
onHoverCountry?: ((data: CountryData) => void) | null; | ||
onHoverPlace?: ((data: PlaceData) => void) | null; | ||
language?: TypeLanguagesSupported; | ||
debug?: boolean; | ||
logo?: boolean; | ||
} | ||
export interface WorldMapPropsStorybook { | ||
dataSource?: TypeDataSource; | ||
country?: string | null; | ||
width?: number; | ||
height?: number; | ||
onClickCountry?: ((data: CountryData) => void) | null; | ||
onClickPlace?: ((data: PlaceData) => void) | null; | ||
onHoverCountry?: ((data: CountryData) => void) | null; | ||
onHoverPlace?: ((data: PlaceData) => void) | null; | ||
language?: TypeLanguagesSupportedStorybook; | ||
debug?: boolean; | ||
logo?: boolean; | ||
} | ||
/** | ||
@@ -39,1 +65,2 @@ * WorldMap component. | ||
export declare const WorldMap: React.FC<WorldMapProps>; | ||
export declare const WorldMapStorybook: (props: WorldMapPropsStorybook) => void; |
import type { Meta, StoryObj } from '@storybook/react'; | ||
import { WorldMap } from './WorldMap'; | ||
import { WorldMap, WorldMapStorybook } from './WorldMap'; | ||
declare const meta: Meta<typeof WorldMap>; | ||
export default meta; | ||
type Story = StoryObj<typeof WorldMap>; | ||
type Story = StoryObj<typeof WorldMapStorybook>; | ||
export declare const Default: Story; |
@@ -1,3 +0,5 @@ | ||
import { TypeLanguagesSupported } from "./types"; | ||
import { TypeLanguagesSupported, TypeLanguagesSupportedStorybook } from "./types"; | ||
export declare const defaultCountry = "de"; | ||
export declare const defaultCountryStorybook = "Germany"; | ||
export declare const defaultLanguage: TypeLanguagesSupported; | ||
export declare const defaultLanguageStorybook: TypeLanguagesSupportedStorybook; |
import i18n from 'i18next'; | ||
export { i18n }; | ||
export declare const defaultLanguageOptions: { | ||
readonly Croatian: "hr"; | ||
readonly Czech: "cz"; | ||
readonly English: "en"; | ||
readonly French: "fr"; | ||
readonly German: "de"; | ||
readonly Italian: "it"; | ||
readonly Polish: "pl"; | ||
readonly Spanish: "es"; | ||
readonly Swedish: "sv"; | ||
}; |
@@ -1,1 +0,3 @@ | ||
export type TypeLanguagesSupported = 'cz' | 'de' | 'en' | 'es' | 'fr' | 'hr' | 'it' | 'pl' | 'sv'; | ||
import { defaultLanguageOptions } from "./i18n"; | ||
export type TypeLanguagesSupported = typeof defaultLanguageOptions[keyof typeof defaultLanguageOptions]; | ||
export type TypeLanguagesSupportedStorybook = keyof typeof defaultLanguageOptions; |
{ | ||
"name": "@ixnode/geo-sphere", | ||
"version": "0.1.41", | ||
"version": "0.1.42", | ||
"description": "A Node.js package for rendering interactive world maps with Mercator projection, customizable languages, and advanced interactivity features such as zoom, pan, and click events.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.cjs", |
@@ -35,2 +35,5 @@ /* Import types. */ | ||
/* Zoom bounding box for Czechia */ | ||
cz: [.5, .5], | ||
/* Zoom bounding box for Liechtenstein. */ | ||
@@ -37,0 +40,0 @@ li: [20., 20.], |
@@ -9,4 +9,6 @@ /* Import capitals. */ | ||
/* Import europa cities. */ | ||
import citiesEuropaCzech from './cities/europe/czechia.json'; | ||
import citiesEuropaFrance from './cities/europe/france.json'; | ||
import citiesEuropaGermany from './cities/europe/germany.json'; | ||
import citiesEuropaPoland from './cities/europe/poland.json'; | ||
import citiesEuropaSpain from './cities/europe/spain.json'; | ||
@@ -58,2 +60,3 @@ import citiesEuropaUnitedKingdom from './cities/europe/united-kingdom.json'; | ||
population: number|null; | ||
altitude?: number|null; | ||
@@ -91,4 +94,6 @@ /* Translations. */ | ||
/* Europa cities. */ | ||
...(citiesEuropaCzech.data as TypeCity[]), | ||
...(citiesEuropaFrance.data as TypeCity[]), | ||
...(citiesEuropaGermany.data as TypeCity[]), | ||
...(citiesEuropaPoland.data as TypeCity[]), | ||
...(citiesEuropaSpain.data as TypeCity[]), | ||
@@ -95,0 +100,0 @@ ...(citiesEuropaUnitedKingdom.data as TypeCity[]), |
@@ -59,2 +59,5 @@ { | ||
}, | ||
"altitude": { | ||
"type": ["number", "null"] | ||
}, | ||
"translation": { | ||
@@ -61,0 +64,0 @@ "type": "object", |
@@ -702,3 +702,3 @@ { | ||
"name": "Prag", | ||
"state": null, | ||
"state": "cz-20", | ||
"priority": 1, | ||
@@ -1135,3 +1135,3 @@ "size": "standard", | ||
"name": "Warschau", | ||
"state": null, | ||
"state": "pl-14", | ||
"priority": 1, | ||
@@ -1138,0 +1138,0 @@ "size": "standard", |
/* Import europa states. */ | ||
import statesEuropaCzechia from './states/europe/czechia.json'; | ||
import statesEuropaFrance from './states/europe/france.json'; | ||
import statesEuropaGermany from './states/europe/germany.json'; | ||
import statesEuropaPoland from './states/europe/poland.json'; | ||
import statesEuropaUnitedKingdom from './states/europe/united-kingdom.json'; | ||
@@ -56,4 +58,6 @@ | ||
/* Europa cities. */ | ||
...(statesEuropaCzechia.data as TypeState[]), | ||
...(statesEuropaFrance.data as TypeState[]), | ||
...(statesEuropaGermany.data as TypeState[]), | ||
...(statesEuropaPoland.data as TypeState[]), | ||
...(statesEuropaUnitedKingdom.data as TypeState[]), | ||
@@ -60,0 +64,0 @@ |
@@ -1,5 +0,9 @@ | ||
import {TypeLanguagesSupported} from "./types"; | ||
import {TypeLanguagesSupported, TypeLanguagesSupportedStorybook} from "./types"; | ||
export const defaultCountry = 'de'; | ||
export const defaultLanguage: TypeLanguagesSupported = 'en'; | ||
export const defaultCountryStorybook = 'Germany'; | ||
export const defaultLanguage: TypeLanguagesSupported = 'en'; | ||
export const defaultLanguageStorybook: TypeLanguagesSupportedStorybook = 'English'; |
@@ -44,2 +44,14 @@ import i18n from 'i18next'; | ||
i18n | ||
}; | ||
}; | ||
export const defaultLanguageOptions = { | ||
Croatian: 'hr', | ||
Czech: 'cz', | ||
English: 'en', | ||
French: 'fr', | ||
German: 'de', | ||
Italian: 'it', | ||
Polish: 'pl', | ||
Spanish: 'es', | ||
Swedish: 'sv', | ||
} as const; |
@@ -1,1 +0,6 @@ | ||
export type TypeLanguagesSupported = 'cz'|'de'|'en'|'es'|'fr'|'hr'|'it'|'pl'|'sv'; | ||
/* Import i18n. */ | ||
import {defaultLanguageOptions} from "./i18n"; | ||
export type TypeLanguagesSupported = typeof defaultLanguageOptions[keyof typeof defaultLanguageOptions]; | ||
export type TypeLanguagesSupportedStorybook = keyof typeof defaultLanguageOptions; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
52029147
0.22%131
4.8%56126
3.53%2
Infinity%