@wovvmap/sdk-react 0.0.0-stage → 1.2.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.
Files changed (92) hide show
  1. package/README.md +191 -2
  2. package/dist/context/WovvMapContext.d.ts +3 -0
  3. package/dist/context/WovvMapContext.d.ts.map +1 -0
  4. package/dist/context/WovvMapContext.js +1 -0
  5. package/dist/context/index.d.ts +3 -0
  6. package/dist/context/index.d.ts.map +1 -0
  7. package/dist/context/index.js +1 -0
  8. package/dist/hooks/index.d.ts +5 -0
  9. package/dist/hooks/index.d.ts.map +1 -0
  10. package/dist/hooks/index.js +3 -0
  11. package/dist/hooks/types.d.ts +2 -0
  12. package/dist/hooks/types.d.ts.map +1 -0
  13. package/dist/hooks/types.js +1 -0
  14. package/dist/hooks/useCatalogSearch.d.ts +18 -0
  15. package/dist/hooks/useCatalogSearch.d.ts.map +1 -0
  16. package/dist/hooks/useCatalogSearch.js +17 -0
  17. package/dist/hooks/useMallData.d.ts +2 -0
  18. package/dist/hooks/useMallData.d.ts.map +1 -0
  19. package/dist/hooks/useMallData.js +1 -0
  20. package/dist/hooks/useMallList.d.ts +2 -0
  21. package/dist/hooks/useMallList.d.ts.map +1 -0
  22. package/dist/hooks/useMallList.js +1 -0
  23. package/dist/index.d.ts +26 -0
  24. package/dist/index.d.ts.map +1 -0
  25. package/dist/index.js +17 -0
  26. package/dist/types.d.ts +10 -0
  27. package/dist/types.d.ts.map +1 -0
  28. package/dist/types.js +8 -0
  29. package/dist/viewer/MapCamera.d.ts +9 -0
  30. package/dist/viewer/MapCamera.d.ts.map +1 -0
  31. package/dist/viewer/MapCamera.js +17 -0
  32. package/dist/viewer/MapCanvas.d.ts +10 -0
  33. package/dist/viewer/MapCanvas.d.ts.map +1 -0
  34. package/dist/viewer/MapCanvas.js +49 -0
  35. package/dist/viewer/MapFocusPadding.d.ts +5 -0
  36. package/dist/viewer/MapFocusPadding.d.ts.map +1 -0
  37. package/dist/viewer/MapFocusPadding.js +12 -0
  38. package/dist/viewer/MapImages.d.ts +10 -0
  39. package/dist/viewer/MapImages.d.ts.map +1 -0
  40. package/dist/viewer/MapImages.js +65 -0
  41. package/dist/viewer/MapLabels.d.ts +10 -0
  42. package/dist/viewer/MapLabels.d.ts.map +1 -0
  43. package/dist/viewer/MapLabels.js +101 -0
  44. package/dist/viewer/MapLights.d.ts +9 -0
  45. package/dist/viewer/MapLights.d.ts.map +1 -0
  46. package/dist/viewer/MapLights.js +38 -0
  47. package/dist/viewer/MapOrbitControl.d.ts +9 -0
  48. package/dist/viewer/MapOrbitControl.d.ts.map +1 -0
  49. package/dist/viewer/MapOrbitControl.js +51 -0
  50. package/dist/viewer/MapScene.d.ts +15 -0
  51. package/dist/viewer/MapScene.d.ts.map +1 -0
  52. package/dist/viewer/MapScene.js +39 -0
  53. package/dist/viewer/MapShapes.d.ts +10 -0
  54. package/dist/viewer/MapShapes.d.ts.map +1 -0
  55. package/dist/viewer/MapShapes.js +66 -0
  56. package/dist/viewer/MapViewerScope.d.ts +5 -0
  57. package/dist/viewer/MapViewerScope.d.ts.map +1 -0
  58. package/dist/viewer/MapViewerScope.js +14 -0
  59. package/dist/viewer/WovvMapView.d.ts +10 -0
  60. package/dist/viewer/WovvMapView.d.ts.map +1 -0
  61. package/dist/viewer/WovvMapView.js +218 -0
  62. package/dist/viewer/index.d.ts +21 -0
  63. package/dist/viewer/index.d.ts.map +1 -0
  64. package/dist/viewer/index.js +24 -0
  65. package/dist/viewer/mapViewerContext.types.d.ts +71 -0
  66. package/dist/viewer/mapViewerContext.types.d.ts.map +1 -0
  67. package/dist/viewer/mapViewerContext.types.js +1 -0
  68. package/dist/viewer/services/MapViewerLifecycleManager.d.ts +90 -0
  69. package/dist/viewer/services/MapViewerLifecycleManager.d.ts.map +1 -0
  70. package/dist/viewer/services/MapViewerLifecycleManager.js +247 -0
  71. package/dist/viewer/services/index.d.ts +2 -0
  72. package/dist/viewer/services/index.d.ts.map +1 -0
  73. package/dist/viewer/services/index.js +1 -0
  74. package/dist/viewer/store/index.d.ts +2 -0
  75. package/dist/viewer/store/index.d.ts.map +1 -0
  76. package/dist/viewer/store/index.js +1 -0
  77. package/dist/viewer/store/mapViewerStore.d.ts +85 -0
  78. package/dist/viewer/store/mapViewerStore.d.ts.map +1 -0
  79. package/dist/viewer/store/mapViewerStore.js +434 -0
  80. package/dist/viewer/useMapViewerContext.d.ts +8 -0
  81. package/dist/viewer/useMapViewerContext.d.ts.map +1 -0
  82. package/dist/viewer/useMapViewerContext.js +9 -0
  83. package/dist/viewer/viewer-ref/index.d.ts +2 -0
  84. package/dist/viewer/viewer-ref/index.d.ts.map +1 -0
  85. package/dist/viewer/viewer-ref/index.js +1 -0
  86. package/dist/viewer/viewer-ref/viewerRefs.d.ts +16 -0
  87. package/dist/viewer/viewer-ref/viewerRefs.d.ts.map +1 -0
  88. package/dist/viewer/viewer-ref/viewerRefs.js +19 -0
  89. package/dist/viewer/viewerScopeContext.d.ts +11 -0
  90. package/dist/viewer/viewerScopeContext.d.ts.map +1 -0
  91. package/dist/viewer/viewerScopeContext.js +2 -0
  92. package/package.json +46 -3
package/README.md CHANGED
@@ -1,3 +1,192 @@
1
- # Temporary Holding Version
1
+ # @wovvmap/sdk-react
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Official React hooks and context providers for WovVMap. Built on top of `@wovvmap/sdk-web`.
4
+
5
+ > **Hinglish**: WovVMap ka official React SDK. Yeh `@wovvmap/sdk-web` ko React hooks aur context me wrap karta hai, taaki React / Next.js apps me indoor map catalog aur viewer easily integrate ho sake.
6
+
7
+ ---
8
+
9
+ ## 🏛️ Architecture
10
+
11
+ Following the Mappedin React SDK pattern (`@mappedin/react-sdk`), `@wovvmap/sdk-react` provides React-idiomatic declarative bindings without modifying the underlying framework-neutral core:
12
+
13
+ ```text
14
+ packages/sdk-react/src/
15
+ ├── hooks/
16
+ │ ├── useMallList.ts <-- Active malls query, loading, error, refresh
17
+ │ ├── useMallData.ts <-- Single mall map data query, cache check, cancel
18
+ │ ├── types.ts <-- Hook options & return types
19
+ │ └── index.ts <-- Hooks facade
20
+ │
21
+ ├── context/
22
+ │ ├── WovvMapContext.tsx <-- Optional tree-level MallController provider
23
+ │ └── index.ts
24
+ │
25
+ ├── types.ts <-- Re-exports contracts from @wovvmap/sdk-web
26
+ └── index.ts <-- Public package facade
27
+ ```
28
+
29
+ ---
30
+
31
+ ## 🚀 Quick Start
32
+
33
+ ### 1. Installation
34
+
35
+ ```bash
36
+ pnpm add @wovvmap/sdk-react
37
+ ```
38
+
39
+ _(Note: Ensure peer dependencies `react` and `react-dom` are installed)._
40
+
41
+ ### 2. Listing Active Malls (`useMallList`)
42
+
43
+ ```tsx
44
+ import { useMallList } from '@wovvmap/sdk-react'
45
+
46
+ export function MallCatalog() {
47
+ const { mallsList, loading, error, refresh } = useMallList()
48
+
49
+ if (loading) return <div>Loading active malls...</div>
50
+ if (error)
51
+ return (
52
+ <div>
53
+ Error: {error} <button onClick={refresh}>Retry</button>
54
+ </div>
55
+ )
56
+
57
+ return (
58
+ <div>
59
+ <h2>Active Malls ({mallsList.length})</h2>
60
+ <div className="grid">
61
+ {mallsList.map((mall) => (
62
+ <div key={mall.mall_id} className="card">
63
+ <h3>{mall.mall_name}</h3>
64
+ <p>ID: {mall.mall_id}</p>
65
+ </div>
66
+ ))}
67
+ </div>
68
+ </div>
69
+ )
70
+ }
71
+ ```
72
+
73
+ ### 3. Fetching Full Mall Map Data (`useMallData`)
74
+
75
+ ```tsx
76
+ import { useMallData } from '@wovvmap/sdk-react'
77
+
78
+ export function MallViewer({ mallId }: { mallId: string }) {
79
+ const { mapData, loading, error, refresh } = useMallData(mallId)
80
+
81
+ if (loading) return <div>Loading mall map data...</div>
82
+ if (error) return <div>Error: {error}</div>
83
+ if (!mapData) return <div>Select a mall</div>
84
+
85
+ return (
86
+ <div>
87
+ <h1>{mapData.mall_name}</h1>
88
+ <p>Floors: {mapData.data_json?.FloorImg?.length ?? 0}</p>
89
+ </div>
90
+ )
91
+ }
92
+ ```
93
+
94
+ ---
95
+
96
+ ## 🧠 Cache & Metadata Freshness Architecture
97
+
98
+ Mall map JSON data typically weighs **5MB to 20MB+** (containing high-res floor plans, thousands of geometry coordinates, and shop nodes).
99
+
100
+ To balance **maximum speed** with **data freshness**, `useMallData` uses lightweight `updatedAt` metadata verification:
101
+
102
+ ```mermaid
103
+ sequenceDiagram
104
+ autonumber
105
+ actor Component as React (useMallData)
106
+ participant Service as MallService
107
+ participant Cache as MemoryMallMapCache
108
+ participant Backend as Strapi Backend (API)
109
+
110
+ Note over Component,Backend: 🟢 FIRST CALL (Cold Start / Cache Miss)
111
+ Component->>Service: getMallMapData('mall-123')
112
+ Service->>Backend: fetchMallMetadata('mall-123') [Only ~50 bytes: updatedAt]
113
+ Backend-->>Service: Return { updatedAt: '2026-09-25T10:00:00Z' }
114
+ Service->>Cache: get('mall:mall-123')
115
+ Cache-->>Service: null (Cache Miss)
116
+ Service->>Backend: fetchMallData('mall-123') [Full Payload: 5MB-20MB JSON]
117
+ Backend-->>Service: Return Full MallMapData
118
+ Service->>Cache: set('mall:mall-123', MallMapData)
119
+ Service-->>Component: Return Full MallMapData (Map renders)
120
+
121
+ Note over Component,Backend: ⚡ SECOND CALL (Warm / Metadata Match)
122
+ Component->>Service: getMallMapData('mall-123')
123
+ Service->>Backend: fetchMallMetadata('mall-123') [Lightweight ~50 bytes: updatedAt]
124
+ Backend-->>Service: Return { updatedAt: '2026-09-25T10:00:00Z' }
125
+ Service->>Cache: get('mall:mall-123')
126
+ Cache-->>Service: Cached MallMapData
127
+ Note over Service: Compare: cached.updatedAt === metadata.updatedAt (MATCH!)
128
+ Note over Service: 🚫 Full 10MB Download completely BYPASSED!
129
+ Service-->>Component: Return Instant Cached MapData (0ms payload download)
130
+
131
+ Note over Component,Backend: 🔄 IF ADMIN UPDATED MALL ON BACKEND
132
+ Component->>Service: getMallMapData('mall-123')
133
+ Service->>Backend: fetchMallMetadata('mall-123') [~50 bytes]
134
+ Backend-->>Service: Return { updatedAt: '2026-09-25T14:30:00Z' } (New timestamp!)
135
+ Service->>Cache: get('mall:mall-123')
136
+ Cache-->>Service: Stale Cached Data ('2026-09-25T10:00:00Z')
137
+ Note over Service: Compare: Timestamps MISMATCH!
138
+ Service->>Backend: fetchMallData('mall-123') [Fetch updated full payload]
139
+ Backend-->>Service: Return Updated MallMapData
140
+ Service->>Cache: set('mall:mall-123', UpdatedMallMapData)
141
+ Service-->>Component: Return Fresh MallMapData
142
+ ```
143
+
144
+ ### Summary of Rules
145
+
146
+ 1. **First Call**: Metadata (~50 bytes) fetch hoti hai -> Cache Miss -> Full (10MB) JSON download hota hai aur memory cache me save ho jata hai.
147
+ 2. **Second Call**: Sirf ~50 bytes metadata fetch hoti hai -> Timestamps match hone par **full 10MB download completely bypass** ho jata hai aur instant memory cache se data return hota hai!
148
+ 3. **Admin Update**: Agar backend par admin ne floor ya shop modify kiya hai, toh naya timestamp detect hote hi fresh full map automatically download hoke cache refresh ho jata hai.
149
+
150
+ ---
151
+
152
+ ## ⚙️ Tree-level Configuration (`WovvMapProvider`)
153
+
154
+ Agar aapko entire app me custom `baseUrl` ya staging environment use karna ho:
155
+
156
+ ```tsx
157
+ import { WovvMapProvider } from '@wovvmap/sdk-react'
158
+
159
+ export function App() {
160
+ return (
161
+ <WovvMapProvider
162
+ options={{
163
+ baseUrl: 'https://staging.wovvtech.site',
164
+ environment: 'sit',
165
+ }}
166
+ >
167
+ <MallCatalog />
168
+ </WovvMapProvider>
169
+ )
170
+ }
171
+ ```
172
+
173
+ ---
174
+
175
+ ## 🧪 Verification
176
+
177
+ ```bash
178
+ pnpm --filter @wovvmap/sdk-react build # Generates production ESM bundle & d.ts
179
+ pnpm --filter @wovvmap/sdk-react typecheck # Strict TypeScript verification
180
+ pnpm --filter @wovvmap/sdk-react lint # ESLint rules
181
+ ```
182
+
183
+ ## Saved-route commands and UI (8.O.5.4)
184
+
185
+ The default-off `offlineRoutes` capability provides Save/List/Restore/Remove through the shared
186
+ rendering viewer. Save/Remove finish through `offlineRouteChanged`; Restore resolves a fresh preview.
187
+ See [the common React and Native guide](../../docs/SAVED_ROUTES.md) for configuration, all six
188
+ commands, reusable controller/panels, cancellation and parent-map requirements. Private routing and
189
+ signing remain backend-only. CDN CORS and physical-device acceptance remain explicit pending gates.
190
+
191
+ Hinglish: Dono platforms ka flow same hai; opt-in aur trusted public keys/policy chahiye. Saved
192
+ preview par Start/Play explicit rahe. UI/commands ka exact setup linked guide mein hai.
@@ -0,0 +1,3 @@
1
+ export { WovvMapProvider, useWovvMapContext } from '@wovvmap/sdk-react-core';
2
+ export type { WovvMapProviderProps, WovvMapContextValue } from '@wovvmap/sdk-react-core';
3
+ //# sourceMappingURL=WovvMapContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WovvMapContext.d.ts","sourceRoot":"","sources":["../../src/context/WovvMapContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAC5E,YAAY,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA"}
@@ -0,0 +1 @@
1
+ export { WovvMapProvider, useWovvMapContext } from '@wovvmap/sdk-react-core';
@@ -0,0 +1,3 @@
1
+ export { WovvMapProvider, useWovvMapContext } from './WovvMapContext.js';
2
+ export type { WovvMapContextValue, WovvMapProviderProps } from './WovvMapContext.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/context/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAErE,YAAY,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA"}
@@ -0,0 +1 @@
1
+ export { WovvMapProvider, useWovvMapContext } from './WovvMapContext.js';
@@ -0,0 +1,5 @@
1
+ export { useMallList } from './useMallList.js';
2
+ export { useMallData } from './useMallData.js';
3
+ export { useCatalogSearch, type CatalogDiscoveryChannel, type DiscoveryChannelSnapshot, type DiscoveryQueryParams, type DiscoveryQueryStatus, type UseCatalogSearchOptions, type UseCatalogSearchResult, } from './useCatalogSearch.js';
4
+ export type { UseMallListOptions, UseMallListResult, UseMallDataOptions, UseMallDataResult, } from './types.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EACL,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,GAC5B,MAAM,oBAAoB,CAAA;AAE3B,YAAY,EACV,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,SAAS,CAAA"}
@@ -0,0 +1,3 @@
1
+ export { useMallList } from './useMallList.js';
2
+ export { useMallData } from './useMallData.js';
3
+ export { useCatalogSearch, } from './useCatalogSearch.js';
@@ -0,0 +1,2 @@
1
+ export type { UseMallDataOptions, UseMallDataResult, UseMallListOptions, UseMallListResult, } from '@wovvmap/sdk-react-core';
2
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/hooks/types.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,yBAAyB,CAAA"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @file useCatalogSearch.ts
3
+ * @description React Web catalog browse and search hook bound to the active viewer's discovery coordinator.
4
+ *
5
+ * Hinglish: React Web ke liye catalog browse aur search hook jo active viewer ke discovery coordinator se juda hai.
6
+ */
7
+ import { type CatalogDiscoveryChannel, type CatalogTarget, type DiscoveryChannelSnapshot, type DiscoveryQueryParams, type DiscoveryQueryStatus, type UseCatalogSearchOptions, type UseCatalogSearchResult } from '@wovvmap/sdk-react-core';
8
+ /**
9
+ * Channel-scoped catalog browse & search hook for `@wovvmap/sdk-react`.
10
+ * Supports isolated `general`, `origin`, and `destination` channels with debounce,
11
+ * out-of-order stale response rejection, pagination reset, `loadMore`, and `retry`.
12
+ *
13
+ * Hinglish: `@wovvmap/sdk-react` ke liye channel-scoped (`general`, `origin`, `destination`)
14
+ * catalog browse aur search hook.
15
+ */
16
+ export declare const useCatalogSearch: <TTarget extends CatalogTarget = 'stores'>(options?: UseCatalogSearchOptions<TTarget>) => UseCatalogSearchResult<TTarget>;
17
+ export type { CatalogDiscoveryChannel, DiscoveryChannelSnapshot, DiscoveryQueryParams, DiscoveryQueryStatus, UseCatalogSearchOptions, UseCatalogSearchResult, };
18
+ //# sourceMappingURL=useCatalogSearch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCatalogSearch.d.ts","sourceRoot":"","sources":["../../src/hooks/useCatalogSearch.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,aAAa,EAClB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC5B,MAAM,yBAAyB,CAAA;AAGhC;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,EAAE,CAAC,OAAO,SAAS,aAAa,GAAG,QAAQ,EACtE,OAAO,CAAC,EAAE,uBAAuB,CAAC,OAAO,CAAC,KACvC,sBAAsB,CAAC,OAAO,CAAiE,CAAA;AAEpG,YAAY,EACV,uBAAuB,EACvB,wBAAwB,EACxB,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,sBAAsB,GACvB,CAAA"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @file useCatalogSearch.ts
3
+ * @description React Web catalog browse and search hook bound to the active viewer's discovery coordinator.
4
+ *
5
+ * Hinglish: React Web ke liye catalog browse aur search hook jo active viewer ke discovery coordinator se juda hai.
6
+ */
7
+ import { createUseCatalogSearchHook, } from '@wovvmap/sdk-react-core';
8
+ import { useMapViewerStore } from '../viewer/store/index.js';
9
+ /**
10
+ * Channel-scoped catalog browse & search hook for `@wovvmap/sdk-react`.
11
+ * Supports isolated `general`, `origin`, and `destination` channels with debounce,
12
+ * out-of-order stale response rejection, pagination reset, `loadMore`, and `retry`.
13
+ *
14
+ * Hinglish: `@wovvmap/sdk-react` ke liye channel-scoped (`general`, `origin`, `destination`)
15
+ * catalog browse aur search hook.
16
+ */
17
+ export const useCatalogSearch = createUseCatalogSearchHook(useMapViewerStore);
@@ -0,0 +1,2 @@
1
+ export { useMallData } from '@wovvmap/sdk-react-core';
2
+ //# sourceMappingURL=useMallData.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMallData.d.ts","sourceRoot":"","sources":["../../src/hooks/useMallData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA"}
@@ -0,0 +1 @@
1
+ export { useMallData } from '@wovvmap/sdk-react-core';
@@ -0,0 +1,2 @@
1
+ export { useMallList } from '@wovvmap/sdk-react-core';
2
+ //# sourceMappingURL=useMallList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMallList.d.ts","sourceRoot":"","sources":["../../src/hooks/useMallList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA"}
@@ -0,0 +1 @@
1
+ export { useMallList } from '@wovvmap/sdk-react-core';
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @wovvmap/sdk-react
3
+ * React bindings, hooks, and declarative compound components for WovVMap.
4
+ */
5
+ export { WovvMapView, MapViewerScope, createMapViewerStore, useMapViewerStoreApi, MapCanvas, MapCamera, MapFocusPadding, MapOrbitControl, MapLights, MapScene, MapLabels, MapLabel, MapImages, MapImage, MapShapes, MapShape, useMapViewerStore, useMapViewerContext, MapViewerLifecycleManager, viewerContainerRef, viewerCanvasRef, } from './viewer/index.js';
6
+ export type { MapViewerStore, WovvMapViewProps, MapCanvasProps, MapCameraProps, MapOrbitControlProps, MapLightsProps, MapSceneProps, MapLabelsProps, MapLabelProps, MapImagesProps, MapImageProps, MapShapesProps, MapShapeProps, MapViewerState, LifecycleInitParams, } from './viewer/index.js';
7
+ export type { MapViewMode, DynamicDepthConfig, NodePoint, TextType, CameraFocusPadding, } from '@wovvmap/sdk-web';
8
+ export { ViewerCommands, ViewerEvents, ViewerCommandError } from '@wovvmap/sdk-web';
9
+ export type { NodeClickEvent, MapLoadedData, PublicNodeAssets, PublicNodeData, ViewerErrorData, StructuredCommandErrorData, CatalogTarget, CatalogSortMode, CatalogFilterInput, DiscoveryFilterRequest, DiscoveryState, CatalogPaginationInput, CatalogReadRequest, CatalogSearchQueryInput, CatalogGroupMembersRequest, CatalogGroupMembersPage, CatalogGroupReadOptions, AmenityAvailabilityReadOptions, CatalogPage, CatalogPageForTarget, CatalogSearchPage, CatalogTargetItemMap, CatalogStoreRow, CatalogSingleStoreRow, CatalogGroupStoreRow, PublicCategoryData, PublicSubCategoryData, PublicAmenityData, PublicNodeGroupData, NodeGroupSelectionRequest, NodeGroupSelectionData, PublicNodeGroupMemberSummary, PublicCatalogOfferItem, AmenityFloorAvailability, } from '@wovvmap/sdk-web';
10
+ export { NEXUS_LIGHT_THEME, NEXUS_DARK_THEME, resolveMapTheme, type MapTheme, type MapLightsThemeConfig, } from '@wovvmap/sdk-web';
11
+ export { useMallData, useMallList, useCatalogSearch } from './hooks/index.js';
12
+ export type { UseMallDataOptions, UseMallDataResult, UseMallListOptions, UseMallListResult, CatalogDiscoveryChannel, DiscoveryChannelSnapshot, DiscoveryQueryParams, DiscoveryQueryStatus, UseCatalogSearchOptions, UseCatalogSearchResult, } from './hooks/index.js';
13
+ export { WovvMapProvider, useWovvMapContext } from './context/index.js';
14
+ export type { WovvMapContextValue, WovvMapProviderProps } from './context/index.js';
15
+ export { DEFAULT_BASE_URL, DEFAULT_MALL_ENVIRONMENT, MallController, createMallController, } from './types.js';
16
+ export type { MallApiRequestOptions, MallApiVersion, MallControllerInit, MallDataInfo, MallEnvironment, MallListResponse, MallMapData, MallMetadataResponse, } from './types.js';
17
+ export type { ViewerInteractionState, EndpointReferences, RestoreInteractionOptions, } from '@wovvmap/sdk-web';
18
+ export type { EndpointReference, EndpointRole, EndpointContext, EndpointState, EndpointSummary, EndpointConflict, } from '@wovvmap/sdk-web';
19
+ export type { RouteState, RouteSelection, RouteSummary, RouteSetSummary, RoutePreferences, RouteOperations, RouteDeliveryConfig, RouteStepDetails, RouteStepPage, RouteStepPageRequest, RouteStepSelection, RoutePlaybackOptions, RoutePlaybackState, RoutePlaybackMode, RoutePlaybackSpeed, NavigationConfigInput, ResolvedNavigationConfig, } from '@wovvmap/sdk-web';
20
+ export { projectRoutePlaybackProgress } from '@wovvmap/sdk-web';
21
+ export type { RoutePlaybackProgress } from '@wovvmap/sdk-web';
22
+ export type { OfflineConfig, OfflineState, OfflineStatus, OfflineErrorCode, OfflineMapSummary, OfflineOperations, } from '@wovvmap/sdk-web';
23
+ export { parseViewerLink } from '@wovvmap/sdk-react-core';
24
+ export type { ViewerLinkRequest, ViewerLinkOptions } from '@wovvmap/sdk-react-core';
25
+ export type { OfflineRouteConfig, OfflineRouteFallbackMode, OfflineRouteState, OfflineRouteOperations, SavedRouteSummary, SavedRoutePreviewState, } from '@wovvmap/sdk-web';
26
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"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"}
package/dist/index.js ADDED
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @wovvmap/sdk-react
3
+ * React bindings, hooks, and declarative compound components for WovVMap.
4
+ */
5
+ // Declarative Compound Components & Zustand Store
6
+ export { WovvMapView, MapViewerScope, createMapViewerStore, useMapViewerStoreApi, MapCanvas, MapCamera, MapFocusPadding, MapOrbitControl, MapLights, MapScene, MapLabels, MapLabel, MapImages, MapImage, MapShapes, MapShape, useMapViewerStore, useMapViewerContext, MapViewerLifecycleManager, viewerContainerRef, viewerCanvasRef, } from './viewer/index.js';
7
+ export { ViewerCommands, ViewerEvents, ViewerCommandError } from '@wovvmap/sdk-web';
8
+ // Theme Contracts & Presets
9
+ export { NEXUS_LIGHT_THEME, NEXUS_DARK_THEME, resolveMapTheme, } from '@wovvmap/sdk-web';
10
+ // Hooks
11
+ export { useMallData, useMallList, useCatalogSearch } from './hooks/index.js';
12
+ // Context & Provider
13
+ export { WovvMapProvider, useWovvMapContext } from './context/index.js';
14
+ // Types & Core Re-exports
15
+ export { DEFAULT_BASE_URL, DEFAULT_MALL_ENVIRONMENT, MallController, createMallController, } from './types.js';
16
+ export { projectRoutePlaybackProgress } from '@wovvmap/sdk-web';
17
+ export { parseViewerLink } from '@wovvmap/sdk-react-core';
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @wovvmap/sdk-react - Types
3
+ * Shared types and re-exports from @wovvmap/sdk-react-core.
4
+ *
5
+ * English: Portable contracts and types for React components and hooks.
6
+ * Hinglish: React components aur hooks ke liye shared types aur contracts.
7
+ */
8
+ export { DEFAULT_BASE_URL, DEFAULT_MALL_ENVIRONMENT, MallController, createMallController, } from '@wovvmap/sdk-react-core';
9
+ export type { MallApiRequestOptions, MallApiVersion, MallControllerInit, MallDataInfo, MallEnvironment, MallListResponse, MallMapData, MallMetadataResponse, } from '@wovvmap/sdk-react-core';
10
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,gBAAgB,EAChB,wBAAwB,EACxB,cAAc,EACd,oBAAoB,GACrB,MAAM,yBAAyB,CAAA;AAEhC,YAAY,EACV,qBAAqB,EACrB,cAAc,EACd,kBAAkB,EAClB,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,oBAAoB,GACrB,MAAM,yBAAyB,CAAA"}
package/dist/types.js ADDED
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @wovvmap/sdk-react - Types
3
+ * Shared types and re-exports from @wovvmap/sdk-react-core.
4
+ *
5
+ * English: Portable contracts and types for React components and hooks.
6
+ * Hinglish: React components aur hooks ke liye shared types aur contracts.
7
+ */
8
+ export { DEFAULT_BASE_URL, DEFAULT_MALL_ENVIRONMENT, MallController, createMallController, } from '@wovvmap/sdk-react-core';
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @file MapCamera.tsx
3
+ * @description Declarative camera configuration compound component.
4
+ * Mount par Three.js camera options ek bar configure karta hai bina kisi dependency loop ke.
5
+ */
6
+ import { type FC } from 'react';
7
+ import type { MapCameraProps } from './mapViewerContext.types.js';
8
+ export declare const MapCamera: FC<MapCameraProps>;
9
+ //# sourceMappingURL=MapCamera.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MapCamera.d.ts","sourceRoot":"","sources":["../../src/viewer/MapCamera.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAa,KAAK,EAAE,EAAE,MAAM,OAAO,CAAA;AAE1C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAE9D,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CAWxC,CAAA"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @file MapCamera.tsx
3
+ * @description Declarative camera configuration compound component.
4
+ * Mount par Three.js camera options ek bar configure karta hai bina kisi dependency loop ke.
5
+ */
6
+ import { useEffect } from 'react';
7
+ import { useMapViewerStore } from './store/mapViewerStore.js';
8
+ export const MapCamera = (props) => {
9
+ const viewer = useMapViewerStore((s) => s.viewer);
10
+ const engine = useMapViewerStore((s) => s.engine);
11
+ useEffect(() => {
12
+ if (engine) {
13
+ engine.setupCamera(props);
14
+ }
15
+ }, [viewer, engine]);
16
+ return null;
17
+ };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @file MapCanvas.tsx
3
+ * @description Mounts HTML5 WebGL canvas with scoped refs and theme-aware background.
4
+ * English: Each scope owns its DOM targets; unscoped consumers retain the legacy refs.
5
+ * Hinglish: Har scope ka canvas alag; bina scope purane global refs ka use hota hai.
6
+ */
7
+ import { type FC } from 'react';
8
+ import type { MapCanvasProps } from './mapViewerContext.types.js';
9
+ export declare const MapCanvas: FC<MapCanvasProps>;
10
+ //# sourceMappingURL=MapCanvas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MapCanvas.d.ts","sourceRoot":"","sources":["../../src/viewer/MapCanvas.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAa,KAAK,EAAE,EAAE,MAAM,OAAO,CAAA;AAI1C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAE9D,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CA4DxC,CAAA"}
@@ -0,0 +1,49 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * @file MapCanvas.tsx
4
+ * @description Mounts HTML5 WebGL canvas with scoped refs and theme-aware background.
5
+ * English: Each scope owns its DOM targets; unscoped consumers retain the legacy refs.
6
+ * Hinglish: Har scope ka canvas alag; bina scope purane global refs ka use hota hai.
7
+ */
8
+ import { useEffect } from 'react';
9
+ import { resolveMapTheme } from '@wovvmap/sdk-web';
10
+ import { useMapViewerStore, useMapViewerStoreApi } from './store/mapViewerStore.js';
11
+ import { useViewerDomRefs } from './viewer-ref/viewerRefs.js';
12
+ export const MapCanvas = ({ className = 'relative w-full h-full min-h-[400px]', style, theme, gl, dpr, frameloop, children, }) => {
13
+ const storeApi = useMapViewerStoreApi();
14
+ const { viewerContainerRef, viewerCanvasRef } = useViewerDomRefs();
15
+ const storeTheme = useMapViewerStore((s) => s.theme);
16
+ const viewer = useMapViewerStore((s) => s.viewer);
17
+ const activeTheme = resolveMapTheme(theme ?? storeTheme);
18
+ // English: Serialize gl config to prevent re-attaching on new object references with equivalent properties.
19
+ // Hinglish: gl config ko serialize karein taaki equivalent object reference aane par repeat attach na chale.
20
+ const glKey = gl ? JSON.stringify(gl) : '';
21
+ useEffect(() => {
22
+ const store = storeApi.getState();
23
+ const container = viewerContainerRef.current || store.container;
24
+ const canvas = viewerCanvasRef.current || store.canvas;
25
+ if (container && canvas) {
26
+ store.setDomElements(container, canvas);
27
+ if (viewer && typeof viewer.attach === 'function') {
28
+ viewer.attach(container, canvas, {
29
+ glConfig: gl,
30
+ dpr,
31
+ frameloop,
32
+ });
33
+ // English: Synchronize store initialization state on successful canvas attachment.
34
+ // Hinglish: Successful canvas attachment ke sath store ka isInitialized status synchronize karein.
35
+ storeApi.getState().setIsInitialized(true);
36
+ }
37
+ }
38
+ return () => {
39
+ // English: Settle initialization flag when canvas unmounts.
40
+ // Hinglish: Canvas unmount hone par store ka initialization status settle karein.
41
+ storeApi.getState().setIsInitialized(false);
42
+ };
43
+ }, [viewer, storeApi, viewerContainerRef, viewerCanvasRef, glKey, dpr, frameloop]);
44
+ const hasExplicitBg = Boolean(className && /\bbg-/.test(className));
45
+ const finalClass = hasExplicitBg
46
+ ? className
47
+ : `${activeTheme.canvasClass ?? 'bg-gradient-to-br from-indigo-50 via-white to-slate-100'} ${className}`.trim();
48
+ return (_jsxs("div", { ref: viewerContainerRef, className: finalClass, style: { position: 'relative', overflow: 'hidden', ...style }, children: [_jsx("canvas", { ref: viewerCanvasRef, style: { display: 'block', width: '100%', height: '100%' } }), children] }));
49
+ };
@@ -0,0 +1,5 @@
1
+ import type { CameraFocusPadding } from '@wovvmap/sdk-web';
2
+ /** The same padding command as Native, with direct delivery and one declarative owner per viewer.
3
+ * Hinglish: Native wala hi command direct chale; ek viewer par padding ka ek owner rakhein. */
4
+ export declare function MapFocusPadding({ top, right, bottom, left }: CameraFocusPadding): null;
5
+ //# sourceMappingURL=MapFocusPadding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MapFocusPadding.d.ts","sourceRoot":"","sources":["../../src/viewer/MapFocusPadding.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAG1D;+FAC+F;AAC/F,wBAAgB,eAAe,CAAC,EAAE,GAAO,EAAE,KAAS,EAAE,MAAU,EAAE,IAAQ,EAAE,EAAE,kBAAkB,QAO/F"}
@@ -0,0 +1,12 @@
1
+ import { useEffect } from 'react';
2
+ import { useMapViewerStore } from './store/mapViewerStore.js';
3
+ /** The same padding command as Native, with direct delivery and one declarative owner per viewer.
4
+ * Hinglish: Native wala hi command direct chale; ek viewer par padding ka ek owner rakhein. */
5
+ export function MapFocusPadding({ top = 0, right = 0, bottom = 0, left = 0 }) {
6
+ const viewer = useMapViewerStore((state) => state.viewer);
7
+ useEffect(() => {
8
+ viewer?.setCameraFocusPadding({ top, right, bottom, left });
9
+ return () => viewer?.setCameraFocusPadding();
10
+ }, [viewer, top, right, bottom, left]);
11
+ return null;
12
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @file MapImages.tsx
3
+ * @description Declarative image and sprite component with granular sprite filters, background badge theming, and reset support.
4
+ * Declarative compound component jo store logos aur vertical transit/amenity icon sprites ko manage karta hai.
5
+ */
6
+ import { type FC } from 'react';
7
+ import type { MapImagesProps } from './mapViewerContext.types.js';
8
+ export declare const MapImages: FC<MapImagesProps>;
9
+ export declare const MapImage: FC<import("@wovvmap/contracts").MapImagesOptions>;
10
+ //# sourceMappingURL=MapImages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MapImages.d.ts","sourceRoot":"","sources":["../../src/viewer/MapImages.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAa,KAAK,EAAE,EAAE,MAAM,OAAO,CAAA;AAG1C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAE9D,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CA8DxC,CAAA;AAED,eAAO,MAAM,QAAQ,mDAAY,CAAA"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * @file MapImages.tsx
3
+ * @description Declarative image and sprite component with granular sprite filters, background badge theming, and reset support.
4
+ * Declarative compound component jo store logos aur vertical transit/amenity icon sprites ko manage karta hai.
5
+ */
6
+ import { useEffect } from 'react';
7
+ import { useMapViewerStore } from './store/mapViewerStore.js';
8
+ import { useInsideMapScene } from './MapScene.js';
9
+ export const MapImages = ({ visible = true, showSprites = true, showLogos = true, spriteBackgroundColor, spriteBackgroundColors, filterTypes, }) => {
10
+ const insideScene = useInsideMapScene();
11
+ const viewer = useMapViewerStore((s) => s.viewer);
12
+ const engine = useMapViewerStore((s) => s.engine);
13
+ // 1. Dedicated Unmount Reset: Runs strictly on unmount to restore base theme
14
+ useEffect(() => {
15
+ if (!insideScene)
16
+ return;
17
+ return () => {
18
+ if (engine) {
19
+ if (engine.imagesVisible && typeof engine.toggleImages === 'function')
20
+ engine.toggleImages(false);
21
+ if (typeof engine.updateSpriteThemes === 'function')
22
+ engine.updateSpriteThemes(undefined);
23
+ }
24
+ };
25
+ }, [insideScene, engine]);
26
+ // 2. Visibility and filter sync: ImageService handles idempotence
27
+ // English: Syncs visibility and filter options to engine; ImageService skips if unchanged.
28
+ // Hinglish: Images visibility aur filter engine ko pass karein; ImageService unchanged values par skip karta hai.
29
+ useEffect(() => {
30
+ if (!insideScene)
31
+ return;
32
+ if (engine && typeof engine.toggleImages === 'function') {
33
+ engine.toggleImages(visible, {
34
+ showSprites,
35
+ showLogos,
36
+ filterTypes,
37
+ });
38
+ }
39
+ }, [insideScene, viewer, engine, visible, showSprites, showLogos, filterTypes]);
40
+ // 3. Sprite colors sync: ImageService handles idempotence
41
+ // English: Syncs sprite theme colors to engine; ImageService skips if unchanged.
42
+ // Hinglish: Sprite background colors engine ko pass karein; ImageService unchanged values par skip karta hai.
43
+ useEffect(() => {
44
+ if (!insideScene || !engine)
45
+ return;
46
+ let effective;
47
+ if (spriteBackgroundColors) {
48
+ effective = {
49
+ ...(spriteBackgroundColor ? { default: spriteBackgroundColor } : {}),
50
+ ...spriteBackgroundColors,
51
+ };
52
+ }
53
+ else if (spriteBackgroundColor) {
54
+ effective = spriteBackgroundColor;
55
+ }
56
+ else {
57
+ effective = undefined;
58
+ }
59
+ if (typeof engine.updateSpriteThemes === 'function') {
60
+ engine.updateSpriteThemes(effective);
61
+ }
62
+ }, [insideScene, viewer, engine, spriteBackgroundColor, spriteBackgroundColors]);
63
+ return null;
64
+ };
65
+ export const MapImage = MapImages;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @file MapLabels.tsx
3
+ * @description Declarative store text labels overlay component supporting 2D DOM and 3D Troika mesh labels.
4
+ * Mount par labels enable karta hai, 2D/3D type sync karta hai, CSS variables update karta hai aur unmount par reset karta hai.
5
+ */
6
+ import { type FC } from 'react';
7
+ import type { MapLabelsProps } from './mapViewerContext.types.js';
8
+ export declare const MapLabels: FC<MapLabelsProps>;
9
+ export declare const MapLabel: FC<import("@wovvmap/contracts").MapLabelsOptions>;
10
+ //# sourceMappingURL=MapLabels.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MapLabels.d.ts","sourceRoot":"","sources":["../../src/viewer/MapLabels.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAa,KAAK,EAAE,EAAE,MAAM,OAAO,CAAA;AAG1C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAE9D,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CAuGxC,CAAA;AAED,eAAO,MAAM,QAAQ,mDAAY,CAAA"}