@omnic/widget-locations 1.1.82 → 1.1.84
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 +0 -1
- package/dist/lib/app/App.d.ts +2 -1
- package/dist/lib/context/MapKeyProvider/MapKeyApiProvider.d.ts +18 -0
- package/dist/lib/context/WidgetLocations/WidgetLocations.d.ts +1 -1
- package/dist/lib/context/WidgetLocations/type.d.ts +1 -1
- package/dist/lib/hooks/usePlaceAutocomplete.d.ts +2 -0
- package/dist/lib/types/config.d.ts +0 -1
- package/dist/lib/widget.cjs.js +28 -28
- package/dist/lib/widget.esm.js +2475 -2449
- package/package.json +2 -2
- package/dist/lib/components/MapApiProvider/MapApiProvider.d.ts +0 -5
- package/dist/lib/components/MapApiProvider/index.d.ts +0 -1
- package/dist/lib/context/MapKeyProvider/MapKeyProvider.d.ts +0 -11
package/README.md
CHANGED
|
@@ -183,7 +183,6 @@ Then `OMNIC_WIDGET_LOCATIONS_CONFIG` has the following structure:
|
|
|
183
183
|
| regionName | string | used for points loading |
|
|
184
184
|
| cityName | string | used for points loading |
|
|
185
185
|
| warehouseSelection | boolean | enable/disable select a warehouse on the map |
|
|
186
|
-
| disableGoogleInit | boolean | If true, widget won't load Google Maps API (e.g. when maps are loaded elsewhere) |
|
|
187
186
|
| onWarehouseSelect | function | Callback that will be called when user select on a warehouse on the map. |
|
|
188
187
|
| onSamePointsClusterClick | function | Callback that will be called when user clicks on a cluster of same-location points. Receives `LocationPoint[]` |
|
|
189
188
|
|
package/dist/lib/app/App.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { FC } from "react";
|
|
2
2
|
import type { WidgetConfig, WidgetOptions } from '../types/config';
|
|
3
3
|
export interface WidgetProps {
|
|
4
4
|
config?: WidgetConfig;
|
|
5
5
|
options?: WidgetOptions;
|
|
6
|
+
withGlobalProvider?: boolean;
|
|
6
7
|
}
|
|
7
8
|
export declare const App: FC<WidgetProps>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { FC, ReactNode } from "react";
|
|
2
|
+
import type { WidgetConfig } from '../../types/config';
|
|
3
|
+
interface Props {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
gMapId: WidgetConfig["gMapId"];
|
|
6
|
+
gMapKey: WidgetConfig["gMapKey"];
|
|
7
|
+
mapTheme: WidgetConfig["mapTheme"];
|
|
8
|
+
locale: WidgetConfig["locale"];
|
|
9
|
+
asGlobalProvider?: boolean;
|
|
10
|
+
}
|
|
11
|
+
interface MapKeyApiContextValue {
|
|
12
|
+
mapKey: string;
|
|
13
|
+
mapId: string;
|
|
14
|
+
isFetching: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare const MapKeyApiProvider: FC<Props>;
|
|
17
|
+
export declare const useMapKeyApiContext: () => MapKeyApiContextValue;
|
|
18
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { WidgetLocationsContextProps, WidgetLocationsContextValue } from "./type";
|
|
2
|
-
export declare const WidgetLocationsProvider: ({ children }: WidgetLocationsContextProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const WidgetLocationsProvider: ({ children, launchConfig: initialLaunchConfig, }: WidgetLocationsContextProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export declare function useWidgetLocationsContext(): WidgetLocationsContextValue;
|
|
@@ -11,10 +11,10 @@ export type MapPlaceholderConfig = Pick<WidgetConfig, "cityName" | "country" | "
|
|
|
11
11
|
export interface WidgetLocationsContextValue {
|
|
12
12
|
widgetOutHolderRef: React.RefObject<HTMLDivElement>;
|
|
13
13
|
widgetLocationsRef: React.RefObject<HTMLDivElement>;
|
|
14
|
-
launchWidget: (params: LaunchConfig) => void;
|
|
15
14
|
setLocale: (locale: Locale) => void;
|
|
16
15
|
setMapPlaceholderConfig: (config: MapPlaceholderConfig | undefined) => void;
|
|
17
16
|
}
|
|
18
17
|
export interface WidgetLocationsContextProps {
|
|
19
18
|
children: React.ReactNode;
|
|
19
|
+
launchConfig: LaunchConfig;
|
|
20
20
|
}
|
|
@@ -9,6 +9,8 @@ export interface UsePlaceAutocompleteOptions {
|
|
|
9
9
|
types?: string[];
|
|
10
10
|
debounceMs?: number;
|
|
11
11
|
onPlaceSelect?: (place: google.maps.places.PlaceResult) => void;
|
|
12
|
+
country?: string;
|
|
13
|
+
globalSearch?: boolean;
|
|
12
14
|
}
|
|
13
15
|
export interface UsePlaceAutocompleteReturn {
|
|
14
16
|
value: string;
|
|
@@ -80,7 +80,6 @@ export interface WidgetConfig {
|
|
|
80
80
|
cityName?: string;
|
|
81
81
|
globalSearch?: boolean;
|
|
82
82
|
warehouseSelection?: boolean;
|
|
83
|
-
disableGoogleInit?: boolean;
|
|
84
83
|
onPointClick?: PointClickHandler;
|
|
85
84
|
onLocationSelect?: LocationSelectHandler;
|
|
86
85
|
onWarehouseSelect?: (point: WarehousePoint) => void;
|