@partbot/stockist-map 0.1.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/dist/StockistMap.d.ts +2 -0
- package/dist/StockistSearch.d.ts +6 -0
- package/dist/client.d.ts +9 -0
- package/dist/components/ui.d.ts +32 -0
- package/dist/distance.d.ts +3 -0
- package/dist/geolocation.d.ts +1 -0
- package/dist/index.d.ts +29 -0
- package/dist/links.d.ts +5 -0
- package/dist/search.d.ts +28 -0
- package/dist/stockist-map.js +46797 -0
- package/dist/stockist-map.umd.js +1044 -0
- package/dist/stockist-search.js +405 -0
- package/dist/stockist-search.umd.js +241 -0
- package/dist/types.d.ts +94 -0
- package/package.json +43 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
export type Coordinate = {
|
|
2
|
+
lat: number;
|
|
3
|
+
lng: number;
|
|
4
|
+
};
|
|
5
|
+
export type StockistMapTheme = {
|
|
6
|
+
primaryColor: string;
|
|
7
|
+
markerColor: string;
|
|
8
|
+
borderRadius: number;
|
|
9
|
+
radiusUnit: "km";
|
|
10
|
+
defaultZoom: number;
|
|
11
|
+
defaultCenter: Coordinate;
|
|
12
|
+
darkMode: boolean;
|
|
13
|
+
styleUrl: string;
|
|
14
|
+
mapPalette: "monotone" | "standard";
|
|
15
|
+
tileUrl: string;
|
|
16
|
+
tileAttribution: string;
|
|
17
|
+
};
|
|
18
|
+
export type StockistMapConfig = {
|
|
19
|
+
network: {
|
|
20
|
+
id: number;
|
|
21
|
+
name: string;
|
|
22
|
+
description?: string | null;
|
|
23
|
+
website?: string | null;
|
|
24
|
+
logo?: string | null;
|
|
25
|
+
};
|
|
26
|
+
theme: Partial<StockistMapTheme>;
|
|
27
|
+
search: {
|
|
28
|
+
url: string;
|
|
29
|
+
placeholder?: string;
|
|
30
|
+
categories?: string[];
|
|
31
|
+
categoryColors?: Record<string, string>;
|
|
32
|
+
categoryMarkers?: Record<string, {
|
|
33
|
+
url: string;
|
|
34
|
+
width?: number | null;
|
|
35
|
+
height?: number | null;
|
|
36
|
+
}>;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export type StockistHit = {
|
|
40
|
+
id: number;
|
|
41
|
+
stockist_id?: number;
|
|
42
|
+
stockist_network_id?: number;
|
|
43
|
+
name: string;
|
|
44
|
+
phone?: string;
|
|
45
|
+
email?: string;
|
|
46
|
+
website?: string;
|
|
47
|
+
address?: string;
|
|
48
|
+
suburb?: string;
|
|
49
|
+
state?: string;
|
|
50
|
+
postcode?: string;
|
|
51
|
+
country?: string;
|
|
52
|
+
category?: string;
|
|
53
|
+
categories?: string[];
|
|
54
|
+
postcode_only?: boolean;
|
|
55
|
+
directions_available?: boolean;
|
|
56
|
+
_geo: Coordinate;
|
|
57
|
+
distanceKm?: number;
|
|
58
|
+
};
|
|
59
|
+
export type SearchOptions = {
|
|
60
|
+
query?: string;
|
|
61
|
+
limit?: number;
|
|
62
|
+
center?: Coordinate | null;
|
|
63
|
+
radiusKm?: number | null;
|
|
64
|
+
category?: string | null;
|
|
65
|
+
locationSearch?: boolean;
|
|
66
|
+
};
|
|
67
|
+
export type StockistSearchResult = {
|
|
68
|
+
hits: StockistHit[];
|
|
69
|
+
estimatedTotalHits: number;
|
|
70
|
+
center?: Coordinate | null;
|
|
71
|
+
resolvedQuery?: {
|
|
72
|
+
status?: string;
|
|
73
|
+
label?: string | null;
|
|
74
|
+
source?: string;
|
|
75
|
+
} | null;
|
|
76
|
+
};
|
|
77
|
+
export type StockistMapProps = {
|
|
78
|
+
token?: string;
|
|
79
|
+
configUrl?: string;
|
|
80
|
+
config?: StockistMapConfig;
|
|
81
|
+
theme?: Partial<StockistMapTheme>;
|
|
82
|
+
initialQuery?: string;
|
|
83
|
+
initialRadiusKm?: number;
|
|
84
|
+
className?: string;
|
|
85
|
+
};
|
|
86
|
+
export type StockistSearchProps = {
|
|
87
|
+
token?: string;
|
|
88
|
+
configUrl?: string;
|
|
89
|
+
config?: StockistMapConfig;
|
|
90
|
+
theme?: Partial<StockistMapTheme>;
|
|
91
|
+
initialQuery?: string;
|
|
92
|
+
viewAllUrl?: string;
|
|
93
|
+
className?: string;
|
|
94
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@partbot/stockist-map",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"packageManager": "bun@1.3.13",
|
|
6
|
+
"main": "./dist/stockist-map.umd.js",
|
|
7
|
+
"module": "./dist/stockist-map.js",
|
|
8
|
+
"unpkg": "./dist/stockist-map.umd.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"files": [
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"import": "./dist/stockist-map.js",
|
|
17
|
+
"require": "./dist/stockist-map.umd.js"
|
|
18
|
+
},
|
|
19
|
+
"./search": {
|
|
20
|
+
"types": "./dist/search.d.ts",
|
|
21
|
+
"import": "./dist/stockist-search.js"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"scripts": {
|
|
25
|
+
"test": "bun test",
|
|
26
|
+
"build": "vite build && vite build --config vite.search.config.ts && vite build --config vite.search.umd.config.ts && tsc -p tsconfig.types.json"
|
|
27
|
+
},
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"react": "^18.3.0",
|
|
30
|
+
"react-dom": "^18.3.0"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@types/react": "^18.3.12",
|
|
34
|
+
"@types/react-dom": "^18.3.1",
|
|
35
|
+
"@vitejs/plugin-react-swc": "3.11.0",
|
|
36
|
+
"vite": "6.4.3",
|
|
37
|
+
"typescript": "^5.7.2"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@phosphor-icons/react": "^2.1.10",
|
|
41
|
+
"maplibre-gl": "^5.24.0"
|
|
42
|
+
}
|
|
43
|
+
}
|