wovvmap-webview-bridge 1.0.29 → 1.0.39

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 (74) hide show
  1. package/README.md +1563 -228
  2. package/dist/handlers/WebBridgeHandlers.d.ts +3 -15
  3. package/dist/handlers/WebBridgeHandlers.d.ts.map +1 -1
  4. package/dist/handlers/WebBridgeHandlers.js +94 -53
  5. package/dist/index.d.ts +19 -3
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +19 -3
  8. package/dist/types/types.d.ts +277 -316
  9. package/dist/types/types.d.ts.map +1 -1
  10. package/dist/web.d.ts +19 -3
  11. package/dist/web.d.ts.map +1 -1
  12. package/dist/web.js +19 -3
  13. package/dist/webviewBridge/BridgeService.d.ts +34 -17
  14. package/dist/webviewBridge/BridgeService.d.ts.map +1 -1
  15. package/dist/webviewBridge/BridgeService.js +227 -51
  16. package/dist/webviewBridge/WebViewBridgeRef.d.ts +3 -3
  17. package/dist/webviewBridge/WebViewBridgeRef.d.ts.map +1 -1
  18. package/dist/webviewBridge/WebViewBridgeRef.js +1 -1
  19. package/dist/webviewBridge/WebViewScreen.d.ts.map +1 -1
  20. package/dist/webviewBridge/services/DirectionBridgeService.d.ts +32 -0
  21. package/dist/webviewBridge/services/DirectionBridgeService.d.ts.map +1 -0
  22. package/dist/webviewBridge/services/DirectionBridgeService.js +72 -0
  23. package/dist/webviewBridge/services/FloorBridgeService.d.ts +4 -0
  24. package/dist/webviewBridge/services/FloorBridgeService.d.ts.map +1 -0
  25. package/dist/webviewBridge/services/FloorBridgeService.js +11 -0
  26. package/dist/webviewBridge/services/SelectionBridgeService.d.ts +10 -0
  27. package/dist/webviewBridge/services/SelectionBridgeService.d.ts.map +1 -0
  28. package/dist/webviewBridge/services/SelectionBridgeService.js +43 -0
  29. package/dist/webviewBridge/services/StepNavigationBridgeService.d.ts +7 -0
  30. package/dist/webviewBridge/services/StepNavigationBridgeService.d.ts.map +1 -0
  31. package/dist/webviewBridge/services/StepNavigationBridgeService.js +15 -0
  32. package/dist/webviewBridge/services/ViewerBridgeService.d.ts +8 -0
  33. package/dist/webviewBridge/services/ViewerBridgeService.d.ts.map +1 -0
  34. package/dist/webviewBridge/services/ViewerBridgeService.js +20 -0
  35. package/dist/webviewBridge/services/ZoomBridgeService.d.ts +5 -0
  36. package/dist/webviewBridge/services/ZoomBridgeService.d.ts.map +1 -0
  37. package/dist/webviewBridge/services/ZoomBridgeService.js +9 -0
  38. package/dist/webviewBridge/store/useAmenityStore.d.ts +20 -0
  39. package/dist/webviewBridge/store/useAmenityStore.d.ts.map +1 -0
  40. package/dist/webviewBridge/store/useAmenityStore.js +6 -0
  41. package/dist/webviewBridge/store/useBridgeStorage.d.ts +14 -0
  42. package/dist/webviewBridge/store/useBridgeStorage.d.ts.map +1 -0
  43. package/dist/webviewBridge/store/useBridgeStorage.js +13 -0
  44. package/dist/webviewBridge/store/useCategoryStore.d.ts +20 -0
  45. package/dist/webviewBridge/store/useCategoryStore.d.ts.map +1 -0
  46. package/dist/webviewBridge/store/useCategoryStore.js +6 -0
  47. package/dist/webviewBridge/store/useDirectionStore.d.ts +55 -0
  48. package/dist/webviewBridge/store/useDirectionStore.d.ts.map +1 -0
  49. package/dist/webviewBridge/store/useDirectionStore.js +35 -0
  50. package/dist/webviewBridge/store/useDirectionsRouteRequestStore.d.ts +14 -0
  51. package/dist/webviewBridge/store/useDirectionsRouteRequestStore.d.ts.map +1 -0
  52. package/dist/webviewBridge/store/useDirectionsRouteRequestStore.js +25 -0
  53. package/dist/webviewBridge/store/useFloorStore.d.ts +18 -0
  54. package/dist/webviewBridge/store/useFloorStore.d.ts.map +1 -0
  55. package/dist/webviewBridge/store/useFloorStore.js +8 -0
  56. package/dist/webviewBridge/store/useNavigationStore.d.ts +23 -0
  57. package/dist/webviewBridge/store/useNavigationStore.d.ts.map +1 -0
  58. package/dist/webviewBridge/store/useNavigationStore.js +18 -0
  59. package/dist/webviewBridge/store/useNodePointStore.d.ts +42 -0
  60. package/dist/webviewBridge/store/useNodePointStore.d.ts.map +1 -0
  61. package/dist/webviewBridge/store/useNodePointStore.js +19 -0
  62. package/dist/webviewBridge/store/useSelectionStore.d.ts +35 -0
  63. package/dist/webviewBridge/store/useSelectionStore.d.ts.map +1 -0
  64. package/dist/webviewBridge/store/useSelectionStore.js +32 -0
  65. package/dist/webviewBridge/store/useSubCategoryStore.d.ts +20 -0
  66. package/dist/webviewBridge/store/useSubCategoryStore.d.ts.map +1 -0
  67. package/dist/webviewBridge/store/useSubCategoryStore.js +6 -0
  68. package/dist/webviewBridge/store/useViewerStore.d.ts +35 -0
  69. package/dist/webviewBridge/store/useViewerStore.d.ts.map +1 -0
  70. package/dist/webviewBridge/store/useViewerStore.js +35 -0
  71. package/dist/webviewBridge/useBridgeStorage.d.ts +45 -0
  72. package/dist/webviewBridge/useBridgeStorage.d.ts.map +1 -0
  73. package/dist/webviewBridge/useBridgeStorage.js +43 -0
  74. package/package.json +1 -1
@@ -0,0 +1,20 @@
1
+ import type { SubCategory } from '../../types/types';
2
+ interface SubCategoryStore {
3
+ subCategories: Record<string, SubCategory>;
4
+ /**
5
+ * @description Sets the subCategories collection into the store.
6
+ * @usecase Applies the full set of subCategories after parsing map JSON or retrieving from DB cache.
7
+ */
8
+ setSubCategories: (subCategories: Record<string, SubCategory>) => void;
9
+ }
10
+ export declare const useSubCategoryStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<SubCategoryStore>, "subscribe"> & {
11
+ subscribe: {
12
+ (listener: (selectedState: SubCategoryStore, previousSelectedState: SubCategoryStore) => void): () => void;
13
+ <U>(selector: (state: SubCategoryStore) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
14
+ equalityFn?: ((a: U, b: U) => boolean) | undefined;
15
+ fireImmediately?: boolean;
16
+ } | undefined): () => void;
17
+ };
18
+ }>;
19
+ export {};
20
+ //# sourceMappingURL=useSubCategoryStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSubCategoryStore.d.ts","sourceRoot":"","sources":["../../../src/webviewBridge/store/useSubCategoryStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,UAAU,gBAAgB;IACtB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAC3C;;;OAGG;IACH,gBAAgB,EAAE,CAAC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,KAAK,IAAI,CAAC;CAC1E;AAED,eAAO,MAAM,mBAAmB;;;;;;;;EAK/B,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { create } from 'zustand';
2
+ import { subscribeWithSelector } from 'zustand/middleware';
3
+ export const useSubCategoryStore = create()(subscribeWithSelector((set) => ({
4
+ subCategories: {},
5
+ setSubCategories: (subCategories) => set({ subCategories }),
6
+ })));
@@ -0,0 +1,35 @@
1
+ import type { CameraView, TextType, ViewMode, ViewerBridgeState } from "../../types/types";
2
+ export type ViewerConfig = {
3
+ apiVersion?: string;
4
+ viewMode?: ViewMode;
5
+ cameraView?: CameraView;
6
+ textType?: TextType;
7
+ show2DIcon?: boolean;
8
+ };
9
+ interface ViewerStore {
10
+ apiVersion: string;
11
+ viewMode: ViewMode;
12
+ cameraView: CameraView;
13
+ textType: TextType;
14
+ show2DIcon: boolean;
15
+ isMapParsed: boolean;
16
+ isLoading: boolean;
17
+ setApiVersion: (apiVersion: string) => void;
18
+ setViewMode: (viewMode: ViewMode) => void;
19
+ setCameraView: (cameraView: CameraView) => void;
20
+ setTextType: (textType: TextType) => void;
21
+ setShow2DIcon: (show2DIcon: boolean) => void;
22
+ setViewerConfig: (config: ViewerConfig) => void;
23
+ setViewerState: (state: ViewerBridgeState) => void;
24
+ }
25
+ export declare const useViewerStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<ViewerStore>, "subscribe"> & {
26
+ subscribe: {
27
+ (listener: (selectedState: ViewerStore, previousSelectedState: ViewerStore) => void): () => void;
28
+ <U>(selector: (state: ViewerStore) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
29
+ equalityFn?: ((a: U, b: U) => boolean) | undefined;
30
+ fireImmediately?: boolean;
31
+ } | undefined): () => void;
32
+ };
33
+ }>;
34
+ export {};
35
+ //# sourceMappingURL=useViewerStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useViewerStore.d.ts","sourceRoot":"","sources":["../../../src/webviewBridge/store/useViewerStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3F,MAAM,MAAM,YAAY,GAAG;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,UAAU,WAAW;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,UAAU,CAAC;IACvB,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IAEnB,aAAa,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,WAAW,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC;IAC1C,aAAa,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;IAChD,WAAW,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC;IAC1C,aAAa,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,eAAe,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAC;IAChD,cAAc,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;CACpD;AAED,eAAO,MAAM,cAAc;;;;;;;;EAkC1B,CAAC"}
@@ -0,0 +1,35 @@
1
+ import { create } from "zustand";
2
+ import { subscribeWithSelector } from "zustand/middleware";
3
+ export const useViewerStore = create()(subscribeWithSelector((set) => ({
4
+ apiVersion: "v2",
5
+ viewMode: "3D",
6
+ cameraView: "street",
7
+ textType: "3D",
8
+ show2DIcon: true,
9
+ isMapParsed: false,
10
+ isLoading: false,
11
+ setApiVersion: (apiVersion) => set({ apiVersion }),
12
+ setViewMode: (viewMode) => set({ viewMode }),
13
+ setCameraView: (cameraView) => set({ cameraView }),
14
+ setTextType: (textType) => set({ textType }),
15
+ setShow2DIcon: (show2DIcon) => set({ show2DIcon }),
16
+ setViewerConfig: (config) => set((state) => {
17
+ var _a, _b, _c, _d, _e;
18
+ return ({
19
+ apiVersion: (_a = config.apiVersion) !== null && _a !== void 0 ? _a : state.apiVersion,
20
+ viewMode: (_b = config.viewMode) !== null && _b !== void 0 ? _b : state.viewMode,
21
+ cameraView: (_c = config.cameraView) !== null && _c !== void 0 ? _c : state.cameraView,
22
+ textType: (_d = config.textType) !== null && _d !== void 0 ? _d : state.textType,
23
+ show2DIcon: (_e = config.show2DIcon) !== null && _e !== void 0 ? _e : state.show2DIcon,
24
+ });
25
+ }),
26
+ setViewerState: (state) => set({
27
+ apiVersion: state.apiVersion,
28
+ viewMode: state.viewMode,
29
+ cameraView: state.cameraView,
30
+ textType: state.textType,
31
+ show2DIcon: state.show2DIcon,
32
+ isMapParsed: state.isMapParsed,
33
+ isLoading: state.isLoading,
34
+ }),
35
+ })));
@@ -0,0 +1,45 @@
1
+ import type { NodePoint, Category, SubCategory, Amenity, OffersNodeMap, FloorImage } from '../types/types';
2
+ export interface BridgeStorageState {
3
+ isMapLoaded: boolean;
4
+ isBridgeLoaded: boolean;
5
+ searchablePoints: NodePoint[];
6
+ pointsByKey: Record<string, NodePoint>;
7
+ amenities: Record<string, Amenity>;
8
+ categories: Record<string, Category>;
9
+ subCategories: Record<string, SubCategory>;
10
+ offers: OffersNodeMap;
11
+ activeFloor: number | null;
12
+ floors: FloorImage[];
13
+ stepByStepList: any[];
14
+ pathSummary: any;
15
+ activeSelectionType: 'category' | 'subcategory' | 'amenity' | null;
16
+ activeSelectionId: string | number | null;
17
+ categoryId: string | null;
18
+ subCategoryId: string | null;
19
+ selectedStoreId: string | null;
20
+ imageBaseUrl: string | null;
21
+ setIsMapLoaded: (loaded: boolean) => void;
22
+ setIsBridgeLoaded: (loaded: boolean) => void;
23
+ setSearchablePoints: (points: NodePoint[]) => void;
24
+ setPointsByKey: (pointsByKey: Record<string, NodePoint>) => void;
25
+ setAmenities: (amenities: Record<string, Amenity>) => void;
26
+ setCategories: (categories: Record<string, Category>) => void;
27
+ setSubCategories: (subCategories: Record<string, SubCategory>) => void;
28
+ setOffers: (offers: OffersNodeMap) => void;
29
+ setActiveFloor: (activeFloor: number | null) => void;
30
+ setFloors: (floors: FloorImage[]) => void;
31
+ setStepByStepList: (list: any[]) => void;
32
+ setPathSummary: (summary: any) => void;
33
+ setActiveSelectionType: (type: 'category' | 'subcategory' | 'amenity' | null) => void;
34
+ setActiveSelectionId: (id: string | number | null) => void;
35
+ setCategoryId: (id: string | null) => void;
36
+ setSubCategoryId: (id: string | null) => void;
37
+ setSelectedStoreId: (id: string | null) => void;
38
+ setImageBaseUrl: (url: string | null) => void;
39
+ }
40
+ /**
41
+ * @description Zustand store for holding bridge states on the host application side.
42
+ * @usecase Exposes reactive states (like loaded state, floors, amenities) to the host UI.
43
+ */
44
+ export declare const useBridgeStorage: import("zustand").UseBoundStore<import("zustand").StoreApi<BridgeStorageState>>;
45
+ //# sourceMappingURL=useBridgeStorage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useBridgeStorage.d.ts","sourceRoot":"","sources":["../../src/webviewBridge/useBridg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+ /**
3
+ * @description Zustand store for holding bridge states on the host application side.
4
+ * @usecase Exposes reactive states (like loaded state, floors, amenities) to the host UI.
5
+ */
6
+ export const useBridgeStorage = create((set) => ({
7
+ isMapLoaded: false,
8
+ isBridgeLoaded: false,
9
+ searchablePoints: [],
10
+ pointsByKey: {},
11
+ amenities: {},
12
+ categories: {},
13
+ subCategories: {},
14
+ offers: {},
15
+ activeFloor: null,
16
+ floors: [],
17
+ stepByStepList: [],
18
+ pathSummary: null,
19
+ activeSelectionType: null,
20
+ activeSelectionId: null,
21
+ categoryId: null,
22
+ subCategoryId: null,
23
+ selectedStoreId: null,
24
+ imageBaseUrl: null,
25
+ setIsMapLoaded: (loaded) => set({ isMapLoaded: loaded }),
26
+ setIsBridgeLoaded: (loaded) => set({ isBridgeLoaded: loaded }),
27
+ setSearchablePoints: (points) => set({ searchablePoints: points }),
28
+ setPointsByKey: (pointsByKey) => set({ pointsByKey }),
29
+ setAmenities: (amenities) => set({ amenities }),
30
+ setCategories: (categories) => set({ categories }),
31
+ setSubCategories: (subCategories) => set({ subCategories }),
32
+ setOffers: (offers) => set({ offers }),
33
+ setActiveFloor: (activeFloor) => set({ activeFloor }),
34
+ setFloors: (floors) => set({ floors }),
35
+ setStepByStepList: (list) => set({ stepByStepList: list }),
36
+ setPathSummary: (summary) => set({ pathSummary: summary }),
37
+ setActiveSelectionType: (type) => set({ activeSelectionType: type }),
38
+ setActiveSelectionId: (id) => set({ activeSelectionId: id }),
39
+ setCategoryId: (id) => set({ categoryId: id }),
40
+ setSubCategoryId: (id) => set({ subCategoryId: id }),
41
+ setSelectedStoreId: (id) => set({ selectedStoreId: id }),
42
+ setImageBaseUrl: (url) => set({ imageBaseUrl: url }),
43
+ }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wovvmap-webview-bridge",
3
- "version": "1.0.29",
3
+ "version": "1.0.39",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "exports": {