@wovvmap/ui-headless 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.
- package/README.md +24 -2
- package/dist/HeaderInfoController.d.ts +44 -0
- package/dist/HeaderInfoController.d.ts.map +1 -0
- package/dist/HeaderInfoController.js +112 -0
- package/dist/appearance.d.ts +26 -0
- package/dist/appearance.d.ts.map +1 -0
- package/dist/appearance.js +117 -0
- package/dist/classic/ClassicController.d.ts +124 -0
- package/dist/classic/ClassicController.d.ts.map +1 -0
- package/dist/classic/ClassicController.js +1131 -0
- package/dist/classic/classic.types.d.ts +111 -0
- package/dist/classic/classic.types.d.ts.map +1 -0
- package/dist/classic/classic.types.js +1 -0
- package/dist/classic/index.d.ts +3 -0
- package/dist/classic/index.d.ts.map +1 -0
- package/dist/classic/index.js +2 -0
- package/dist/components.d.ts +253 -0
- package/dist/components.d.ts.map +1 -0
- package/dist/components.js +30 -0
- package/dist/directions/DirectionController.d.ts +76 -0
- package/dist/directions/DirectionController.d.ts.map +1 -0
- package/dist/directions/DirectionController.js +467 -0
- package/dist/directions/direction.types.d.ts +81 -0
- package/dist/directions/direction.types.d.ts.map +1 -0
- package/dist/directions/direction.types.js +1 -0
- package/dist/directions/directionPresentation.d.ts +17 -0
- package/dist/directions/directionPresentation.d.ts.map +1 -0
- package/dist/directions/directionPresentation.js +34 -0
- package/dist/flow/DiscoveryFlowController.d.ts +36 -0
- package/dist/flow/DiscoveryFlowController.d.ts.map +1 -0
- package/dist/flow/DiscoveryFlowController.js +162 -0
- package/dist/flow/FlowHistoryController.d.ts +14 -0
- package/dist/flow/FlowHistoryController.d.ts.map +1 -0
- package/dist/flow/FlowHistoryController.js +31 -0
- package/dist/flow/index.d.ts +3 -0
- package/dist/flow/index.d.ts.map +1 -0
- package/dist/flow/index.js +2 -0
- package/dist/gallery/PromotionGalleryController.d.ts +32 -0
- package/dist/gallery/PromotionGalleryController.d.ts.map +1 -0
- package/dist/gallery/PromotionGalleryController.js +80 -0
- package/dist/gallery/index.d.ts +2 -0
- package/dist/gallery/index.d.ts.map +1 -0
- package/dist/gallery/index.js +1 -0
- package/dist/headerInfo.d.ts +27 -0
- package/dist/headerInfo.d.ts.map +1 -0
- package/dist/headerInfo.js +70 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +24 -0
- package/dist/presentation.d.ts +49 -0
- package/dist/presentation.d.ts.map +1 -0
- package/dist/presentation.js +116 -0
- package/dist/routes/RoutePreviewController.d.ts +61 -0
- package/dist/routes/RoutePreviewController.d.ts.map +1 -0
- package/dist/routes/RoutePreviewController.js +321 -0
- package/dist/routes/playback/RoutePlaybackController.d.ts +26 -0
- package/dist/routes/playback/RoutePlaybackController.d.ts.map +1 -0
- package/dist/routes/playback/RoutePlaybackController.js +115 -0
- package/dist/routes/routePlayback.types.d.ts +38 -0
- package/dist/routes/routePlayback.types.d.ts.map +1 -0
- package/dist/routes/routePlayback.types.js +1 -0
- package/dist/routes/routePreview.types.d.ts +71 -0
- package/dist/routes/routePreview.types.d.ts.map +1 -0
- package/dist/routes/routePreview.types.js +1 -0
- package/dist/routes/routePreviewPresentation.d.ts +8 -0
- package/dist/routes/routePreviewPresentation.d.ts.map +1 -0
- package/dist/routes/routePreviewPresentation.js +26 -0
- package/dist/routes/routeStepIcons.d.ts +15 -0
- package/dist/routes/routeStepIcons.d.ts.map +1 -0
- package/dist/routes/routeStepIcons.js +102 -0
- package/dist/routes/routeStepPresentation.d.ts +5 -0
- package/dist/routes/routeStepPresentation.d.ts.map +1 -0
- package/dist/routes/routeStepPresentation.js +15 -0
- package/dist/routes/routeSteps.types.d.ts +51 -0
- package/dist/routes/routeSteps.types.d.ts.map +1 -0
- package/dist/routes/routeSteps.types.js +1 -0
- package/dist/routes/steps/RouteStepsController.d.ts +49 -0
- package/dist/routes/steps/RouteStepsController.d.ts.map +1 -0
- package/dist/routes/steps/RouteStepsController.js +312 -0
- package/dist/saved-routes/SavedRoutesController.d.ts +76 -0
- package/dist/saved-routes/SavedRoutesController.d.ts.map +1 -0
- package/dist/saved-routes/SavedRoutesController.js +366 -0
- package/dist/storeHours.d.ts +19 -0
- package/dist/storeHours.d.ts.map +1 -0
- package/dist/storeHours.js +155 -0
- package/dist/storeList.d.ts +19 -0
- package/dist/storeList.d.ts.map +1 -0
- package/dist/storeList.js +21 -0
- package/dist/theme.d.ts +42 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +56 -0
- package/package.json +32 -3
|
@@ -0,0 +1,467 @@
|
|
|
1
|
+
import { SavedRoutesController } from '../saved-routes/SavedRoutesController.js';
|
|
2
|
+
import { toViewerCommandError, freezeEndpointState, } from '@wovvmap/contracts';
|
|
3
|
+
import { RoutePreviewController } from '../routes/RoutePreviewController.js';
|
|
4
|
+
/** One direction-input presentation owner; accepted choices use the shared explicit focus capability.
|
|
5
|
+
* Hinglish: Dono platforms ka input flow same; endpoint/route rules yahan nahi, focus SDK action se ho. */
|
|
6
|
+
export class DirectionController {
|
|
7
|
+
viewer;
|
|
8
|
+
flow;
|
|
9
|
+
savedRoutes;
|
|
10
|
+
routes;
|
|
11
|
+
origin;
|
|
12
|
+
destination;
|
|
13
|
+
listeners = new Set();
|
|
14
|
+
snapshot;
|
|
15
|
+
map = null;
|
|
16
|
+
identity = null;
|
|
17
|
+
ready = false;
|
|
18
|
+
opened = false;
|
|
19
|
+
active = null;
|
|
20
|
+
pending = false;
|
|
21
|
+
error = null;
|
|
22
|
+
members = null;
|
|
23
|
+
request = 0;
|
|
24
|
+
memberRequest = 0;
|
|
25
|
+
connection = 0;
|
|
26
|
+
constructor(viewer, flow) {
|
|
27
|
+
this.viewer = viewer;
|
|
28
|
+
this.flow = flow;
|
|
29
|
+
this.routes = viewer.routes
|
|
30
|
+
? new RoutePreviewController({ ...viewer.routes, getEndpoints: viewer.getEndpoints }, true)
|
|
31
|
+
: null;
|
|
32
|
+
this.savedRoutes = viewer.offlineRoutes
|
|
33
|
+
? new SavedRoutesController(viewer.offlineRoutes, () => {
|
|
34
|
+
this.opened = true;
|
|
35
|
+
this.active = null;
|
|
36
|
+
this.routes?.viewRoute();
|
|
37
|
+
this.publish();
|
|
38
|
+
})
|
|
39
|
+
: null;
|
|
40
|
+
this.origin = viewer.discovery.getChannel('origin', 'stores');
|
|
41
|
+
this.destination = viewer.discovery.getChannel('destination', 'stores');
|
|
42
|
+
this.snapshot = this.readSnapshot();
|
|
43
|
+
}
|
|
44
|
+
getSnapshot = () => this.snapshot;
|
|
45
|
+
subscribe = (listener) => {
|
|
46
|
+
this.listeners.add(listener);
|
|
47
|
+
return () => this.listeners.delete(listener);
|
|
48
|
+
};
|
|
49
|
+
/** Lifetime binding only; immediate StrictMode reconnect retains committed drafts and queries.
|
|
50
|
+
* Hinglish: Hook sirf lifetime jode; StrictMode replay query/endpoint dobara na chalaye. */
|
|
51
|
+
connect = () => {
|
|
52
|
+
const connection = ++this.connection;
|
|
53
|
+
const unsubs = [
|
|
54
|
+
...(this.savedRoutes
|
|
55
|
+
? [this.savedRoutes.subscribe(this.publish), this.savedRoutes.connect()]
|
|
56
|
+
: []),
|
|
57
|
+
this.origin.subscribe(this.publish),
|
|
58
|
+
this.destination.subscribe(this.publish),
|
|
59
|
+
...(this.routes ? [this.routes.subscribe(this.publish), this.routes.connect()] : []),
|
|
60
|
+
];
|
|
61
|
+
return () => {
|
|
62
|
+
unsubs.forEach((off) => off());
|
|
63
|
+
queueMicrotask(() => {
|
|
64
|
+
if (connection === this.connection) {
|
|
65
|
+
this.ready = false;
|
|
66
|
+
this.close();
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
syncMap = (map, ready) => {
|
|
72
|
+
this.ready = ready && map !== null;
|
|
73
|
+
if (map !== this.map) {
|
|
74
|
+
this.close();
|
|
75
|
+
this.map = map;
|
|
76
|
+
this.identity = null;
|
|
77
|
+
this.origin.reset('stores');
|
|
78
|
+
this.destination.reset('stores');
|
|
79
|
+
}
|
|
80
|
+
this.captureIdentity();
|
|
81
|
+
this.routes?.syncMap(map, this.ready);
|
|
82
|
+
this.publish();
|
|
83
|
+
};
|
|
84
|
+
handleEndpointsChanged = () => {
|
|
85
|
+
this.captureIdentity();
|
|
86
|
+
this.routes?.handleEndpointsChanged();
|
|
87
|
+
this.publish();
|
|
88
|
+
};
|
|
89
|
+
open = (destination) => {
|
|
90
|
+
if (!this.ready)
|
|
91
|
+
return;
|
|
92
|
+
void this.command(async (context) => {
|
|
93
|
+
if (destination)
|
|
94
|
+
return await this.viewer.setDestination(destination, context);
|
|
95
|
+
}, async (context) => {
|
|
96
|
+
const request = this.request;
|
|
97
|
+
const map = this.map;
|
|
98
|
+
if (this.flow && !(await this.flow.enter()))
|
|
99
|
+
return;
|
|
100
|
+
if (request !== this.request || map !== this.map || !this.ready)
|
|
101
|
+
return;
|
|
102
|
+
this.opened = true;
|
|
103
|
+
if (!this.viewer.getEndpoints()?.origin)
|
|
104
|
+
this.activate('origin');
|
|
105
|
+
else {
|
|
106
|
+
this.active = null;
|
|
107
|
+
this.publish();
|
|
108
|
+
}
|
|
109
|
+
if (destination)
|
|
110
|
+
void this.focus('destination', context);
|
|
111
|
+
});
|
|
112
|
+
};
|
|
113
|
+
close = () => {
|
|
114
|
+
this.savedRoutes?.close();
|
|
115
|
+
++this.request;
|
|
116
|
+
++this.memberRequest;
|
|
117
|
+
this.pending = false;
|
|
118
|
+
this.error = null;
|
|
119
|
+
this.opened = false;
|
|
120
|
+
this.active = null;
|
|
121
|
+
this.members = null;
|
|
122
|
+
this.origin.cancel();
|
|
123
|
+
this.destination.cancel();
|
|
124
|
+
this.publish();
|
|
125
|
+
};
|
|
126
|
+
/** Shared history owns Back; close() remains presentation-only for lifecycle and replacement actions.
|
|
127
|
+
* Hinglish: Back domain/history restore kare; close sirf panel band kare aur commands replay na kare. */
|
|
128
|
+
back = () => {
|
|
129
|
+
if (!this.ready || !this.opened || this.pending)
|
|
130
|
+
return;
|
|
131
|
+
const flow = this.flow;
|
|
132
|
+
if (!flow && !this.viewer.routes)
|
|
133
|
+
return this.close();
|
|
134
|
+
void this.command(async (context) => {
|
|
135
|
+
// Legacy Back clears the active path before restoring history; UI unmount remains presentation-only.
|
|
136
|
+
// Hinglish: Explicit Back pe route clear ho, endpoint/history ka existing rule same rahe.
|
|
137
|
+
if (this.viewer.routes) {
|
|
138
|
+
this.routes?.dismissFeedback();
|
|
139
|
+
await this.viewer.routes.clearRoute(context);
|
|
140
|
+
}
|
|
141
|
+
await flow?.back(context);
|
|
142
|
+
}, () => this.close());
|
|
143
|
+
};
|
|
144
|
+
/** Restore overlay presentation only, after the shared SDK has accepted the complete history state.
|
|
145
|
+
* Hinglish: Valid Back ke baad panel restore ho; setter, query ya camera dobara na chale. */
|
|
146
|
+
restorePresentation(open) {
|
|
147
|
+
this.close();
|
|
148
|
+
if (open && this.ready) {
|
|
149
|
+
this.opened = true;
|
|
150
|
+
this.publish();
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
activate = (field) => {
|
|
154
|
+
if (!this.ready || !this.opened)
|
|
155
|
+
return;
|
|
156
|
+
if (this.active === field && this.channel(field).getSnapshot().status !== 'idle')
|
|
157
|
+
return;
|
|
158
|
+
++this.request;
|
|
159
|
+
this.pending = false;
|
|
160
|
+
this.active = field;
|
|
161
|
+
this.members = null;
|
|
162
|
+
++this.memberRequest;
|
|
163
|
+
this.error = null;
|
|
164
|
+
this.query(field, this.viewer.getEndpoints()?.[field]?.name ?? this.channel(field).getSnapshot().query, true);
|
|
165
|
+
};
|
|
166
|
+
/** Focus loss dismisses editing, but never retires an endpoint command awaiting its ACK.
|
|
167
|
+
* Hinglish: Blur se list band ho; pending selection ya doosre field ka naya focus cancel na ho. */
|
|
168
|
+
deactivate = (field) => {
|
|
169
|
+
if (!this.ready || this.active !== field)
|
|
170
|
+
return;
|
|
171
|
+
this.dismissSearch();
|
|
172
|
+
};
|
|
173
|
+
changeQuery = (field, query) => {
|
|
174
|
+
if (!this.ready || !this.opened)
|
|
175
|
+
return;
|
|
176
|
+
++this.request;
|
|
177
|
+
this.pending = false;
|
|
178
|
+
this.active = field;
|
|
179
|
+
this.members = null;
|
|
180
|
+
++this.memberRequest;
|
|
181
|
+
this.error = null;
|
|
182
|
+
this.query(field, query);
|
|
183
|
+
};
|
|
184
|
+
cancelSearch = () => {
|
|
185
|
+
++this.request;
|
|
186
|
+
this.pending = false;
|
|
187
|
+
this.dismissSearch();
|
|
188
|
+
};
|
|
189
|
+
dismissSearch() {
|
|
190
|
+
this.active = null;
|
|
191
|
+
this.members = null;
|
|
192
|
+
++this.memberRequest;
|
|
193
|
+
this.origin.cancel();
|
|
194
|
+
this.destination.cancel();
|
|
195
|
+
this.publish();
|
|
196
|
+
}
|
|
197
|
+
clear = (field) => {
|
|
198
|
+
if (!this.ready || !this.opened)
|
|
199
|
+
return;
|
|
200
|
+
void this.command(async (context) => {
|
|
201
|
+
return await this.setter(field)(null, context);
|
|
202
|
+
}, () => {
|
|
203
|
+
this.channel(field).reset('stores');
|
|
204
|
+
this.activate(field);
|
|
205
|
+
});
|
|
206
|
+
};
|
|
207
|
+
swap = () => {
|
|
208
|
+
if (!this.ready || !this.opened)
|
|
209
|
+
return;
|
|
210
|
+
void this.command(async (context) => {
|
|
211
|
+
return await this.viewer.swapEndpoints(context);
|
|
212
|
+
}, () => this.cancelSearch());
|
|
213
|
+
};
|
|
214
|
+
selectRow = (row, results) => {
|
|
215
|
+
if (!this.ready ||
|
|
216
|
+
!this.opened ||
|
|
217
|
+
!this.active ||
|
|
218
|
+
this.channel(this.active).getSnapshot().isLoading)
|
|
219
|
+
return;
|
|
220
|
+
if (results && results !== this.channel(this.active).getSnapshot())
|
|
221
|
+
return;
|
|
222
|
+
const reference = row.kind === 'store'
|
|
223
|
+
? { kind: 'node', key: row.node.key }
|
|
224
|
+
: {
|
|
225
|
+
kind: 'group',
|
|
226
|
+
request: this.channel(this.active).getGroupSelectionRequest(row.group.groupId),
|
|
227
|
+
};
|
|
228
|
+
this.select(reference);
|
|
229
|
+
};
|
|
230
|
+
selectMember = (node, members) => {
|
|
231
|
+
if (members && members !== this.members)
|
|
232
|
+
return;
|
|
233
|
+
this.select({ kind: 'node', key: node.key });
|
|
234
|
+
};
|
|
235
|
+
toggleGroup = (row, index, results) => {
|
|
236
|
+
if (!this.ready || !this.opened || !this.active || row.kind !== 'group')
|
|
237
|
+
return;
|
|
238
|
+
if (results && results !== this.channel(this.active).getSnapshot())
|
|
239
|
+
return;
|
|
240
|
+
++this.memberRequest;
|
|
241
|
+
if (this.members?.request.groupId === row.group.groupId && this.members.index === index)
|
|
242
|
+
this.members = null;
|
|
243
|
+
else {
|
|
244
|
+
this.members = {
|
|
245
|
+
request: this.channel(this.active).getGroupSelectionRequest(row.group.groupId),
|
|
246
|
+
index,
|
|
247
|
+
items: [],
|
|
248
|
+
loading: false,
|
|
249
|
+
error: null,
|
|
250
|
+
hasMore: false,
|
|
251
|
+
nextOffset: 0,
|
|
252
|
+
};
|
|
253
|
+
void this.readMembers(0);
|
|
254
|
+
}
|
|
255
|
+
this.publish();
|
|
256
|
+
};
|
|
257
|
+
loadMore = () => {
|
|
258
|
+
if (this.ready && this.active)
|
|
259
|
+
void this.channel(this.active).loadMore();
|
|
260
|
+
};
|
|
261
|
+
retry = () => {
|
|
262
|
+
if (this.ready && this.active)
|
|
263
|
+
void this.channel(this.active).retry();
|
|
264
|
+
};
|
|
265
|
+
loadMoreMembers = () => {
|
|
266
|
+
if (this.members?.hasMore && this.members.nextOffset !== null)
|
|
267
|
+
void this.readMembers(this.members.nextOffset);
|
|
268
|
+
};
|
|
269
|
+
retryMembers = () => {
|
|
270
|
+
if (this.members)
|
|
271
|
+
void this.readMembers(this.members.nextOffset ?? 0);
|
|
272
|
+
};
|
|
273
|
+
select(reference) {
|
|
274
|
+
if (!this.ready || !this.opened || !this.active)
|
|
275
|
+
return;
|
|
276
|
+
const field = this.active;
|
|
277
|
+
void this.command(async (context) => {
|
|
278
|
+
return await this.setter(field)(reference, context);
|
|
279
|
+
}, (context) => {
|
|
280
|
+
this.cancelSearch();
|
|
281
|
+
void this.focus(field, context);
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
channel(field) {
|
|
285
|
+
return field === 'origin' ? this.origin : this.destination;
|
|
286
|
+
}
|
|
287
|
+
setter(field) {
|
|
288
|
+
return field === 'origin' ? this.viewer.setOrigin : this.viewer.setDestination;
|
|
289
|
+
}
|
|
290
|
+
query(field, query, immediate = false) {
|
|
291
|
+
void this.channel(field).execute({
|
|
292
|
+
target: 'stores',
|
|
293
|
+
mode: 'search',
|
|
294
|
+
query,
|
|
295
|
+
pageSize: 20,
|
|
296
|
+
sortBy: 'paid_promotion_floor',
|
|
297
|
+
floorSecondarySortBy: 'asc',
|
|
298
|
+
}, { immediate });
|
|
299
|
+
this.publish();
|
|
300
|
+
}
|
|
301
|
+
async command(action, accepted) {
|
|
302
|
+
if (this.pending)
|
|
303
|
+
return;
|
|
304
|
+
const state = this.viewer.getEndpoints();
|
|
305
|
+
if (!state ||
|
|
306
|
+
!this.ready ||
|
|
307
|
+
state.mallId !== this.identity?.mallId ||
|
|
308
|
+
state.revision !== this.identity.revision)
|
|
309
|
+
return;
|
|
310
|
+
const request = ++this.request;
|
|
311
|
+
const map = this.map;
|
|
312
|
+
let failureState = state;
|
|
313
|
+
this.pending = true;
|
|
314
|
+
this.error = null;
|
|
315
|
+
this.publish();
|
|
316
|
+
try {
|
|
317
|
+
// Pending subscribers can synchronously close or replace this intent before dispatch.
|
|
318
|
+
// Hinglish: Pending notification par panel/map badle to purana command bhejna hi nahi hai.
|
|
319
|
+
if (request !== this.request || map !== this.map || !this.ready)
|
|
320
|
+
return;
|
|
321
|
+
const result = await action({ mallId: state.mallId, expectedRevision: state.revision });
|
|
322
|
+
const current = this.viewer.getEndpoints();
|
|
323
|
+
// A late ACK may describe an older accepted pair than the latest event-derived state.
|
|
324
|
+
// Hinglish: External action ne pair badal diya ho to purana ACK panel khole/focus na chalaye.
|
|
325
|
+
const matches = result === undefined ||
|
|
326
|
+
result === current ||
|
|
327
|
+
(current && freezeEndpointState(result, current) === current);
|
|
328
|
+
if (matches && request === this.request && map === this.map && this.ready) {
|
|
329
|
+
failureState = current ?? state;
|
|
330
|
+
await accepted({ mallId: state.mallId, expectedRevision: state.revision });
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
catch (error) {
|
|
334
|
+
const publicError = toViewerCommandError(error);
|
|
335
|
+
if (request === this.request &&
|
|
336
|
+
map === this.map &&
|
|
337
|
+
publicError &&
|
|
338
|
+
this.viewer.getEndpoints() === failureState)
|
|
339
|
+
this.error = publicError.message;
|
|
340
|
+
}
|
|
341
|
+
finally {
|
|
342
|
+
if (request === this.request) {
|
|
343
|
+
this.pending = false;
|
|
344
|
+
this.publish();
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
/** Selection acceptance and camera presentation are separate; a failed focus never rolls back endpoints.
|
|
349
|
+
* Hinglish: Selection pehle accept ho; camera fail ho to selected endpoint na hate aur UI blocked na rahe. */
|
|
350
|
+
async focus(role, context) {
|
|
351
|
+
if (!this.viewer.focusEndpoint)
|
|
352
|
+
return;
|
|
353
|
+
const request = this.request;
|
|
354
|
+
const map = this.map;
|
|
355
|
+
// A later route intent can legitimately cancel this endpoint tween without changing endpoints.
|
|
356
|
+
// Hinglish: Generate/Start/Clear camera le le to purane focus ka error form mein na aaye.
|
|
357
|
+
const routePresentation = this.routes?.getSnapshot();
|
|
358
|
+
const summary = this.viewer.getEndpoints()?.[role];
|
|
359
|
+
if (!summary)
|
|
360
|
+
return;
|
|
361
|
+
try {
|
|
362
|
+
const completed = await this.viewer.focusEndpoint(role, context);
|
|
363
|
+
if (!completed &&
|
|
364
|
+
request === this.request &&
|
|
365
|
+
map === this.map &&
|
|
366
|
+
this.routes?.getSnapshot() === routePresentation &&
|
|
367
|
+
this.ready &&
|
|
368
|
+
this.viewer.getEndpoints()?.[role] === summary) {
|
|
369
|
+
this.error = 'Location selected, but camera focus was unavailable or interrupted.';
|
|
370
|
+
this.publish();
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
catch (error) {
|
|
374
|
+
const publicError = toViewerCommandError(error);
|
|
375
|
+
if (publicError &&
|
|
376
|
+
publicError.code !== 'CANCELLED' &&
|
|
377
|
+
request === this.request &&
|
|
378
|
+
map === this.map &&
|
|
379
|
+
this.routes?.getSnapshot() === routePresentation &&
|
|
380
|
+
this.ready &&
|
|
381
|
+
this.viewer.getEndpoints()?.[role] === summary) {
|
|
382
|
+
this.error = publicError.message;
|
|
383
|
+
this.publish();
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
// A loaded-map revision is a request guard, not a second endpoint store; old UI intents cannot target a replacement map.
|
|
388
|
+
// Hinglish: Loaded revision sirf stale-click guard hai; old panel naye map ke same key ko select na kare.
|
|
389
|
+
captureIdentity() {
|
|
390
|
+
const state = this.viewer.getEndpoints();
|
|
391
|
+
if (!this.identity && state && state.mallId === this.map?.mallId)
|
|
392
|
+
this.identity = { mallId: state.mallId, revision: state.revision };
|
|
393
|
+
}
|
|
394
|
+
async readMembers(offset) {
|
|
395
|
+
if (!this.ready || !this.active || !this.members || this.members.loading)
|
|
396
|
+
return;
|
|
397
|
+
const request = ++this.memberRequest;
|
|
398
|
+
const channel = this.channel(this.active);
|
|
399
|
+
const group = this.members;
|
|
400
|
+
this.members = { ...group, loading: true, error: null };
|
|
401
|
+
this.publish();
|
|
402
|
+
try {
|
|
403
|
+
const page = await channel.getGroupMembers({
|
|
404
|
+
...group.request,
|
|
405
|
+
pagination: { offset, limit: 20 },
|
|
406
|
+
});
|
|
407
|
+
if (request !== this.memberRequest)
|
|
408
|
+
return;
|
|
409
|
+
if (!page)
|
|
410
|
+
throw new Error('These locations are no longer available');
|
|
411
|
+
this.members = {
|
|
412
|
+
...group,
|
|
413
|
+
items: offset ? [...group.items, ...page.items] : page.items,
|
|
414
|
+
loading: false,
|
|
415
|
+
error: null,
|
|
416
|
+
hasMore: page.hasMore,
|
|
417
|
+
nextOffset: page.nextOffset,
|
|
418
|
+
};
|
|
419
|
+
}
|
|
420
|
+
catch (error) {
|
|
421
|
+
if (request === this.memberRequest)
|
|
422
|
+
this.members = {
|
|
423
|
+
...group,
|
|
424
|
+
loading: false,
|
|
425
|
+
error: error instanceof Error ? error.message : 'Unable to load locations',
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
finally {
|
|
429
|
+
if (request === this.memberRequest)
|
|
430
|
+
this.publish();
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
readSnapshot() {
|
|
434
|
+
const endpoints = this.viewer.getEndpoints();
|
|
435
|
+
return {
|
|
436
|
+
routePreview: this.routes?.getSnapshot(),
|
|
437
|
+
...(this.savedRoutes ? { savedRoutes: this.savedRoutes.getSnapshot() } : {}),
|
|
438
|
+
open: this.opened,
|
|
439
|
+
ready: this.ready,
|
|
440
|
+
activeField: this.active,
|
|
441
|
+
pending: this.pending,
|
|
442
|
+
error: this.error,
|
|
443
|
+
endpoints,
|
|
444
|
+
origin: this.active === 'origin'
|
|
445
|
+
? this.origin.getSnapshot().query
|
|
446
|
+
: (endpoints?.origin?.name ?? ''),
|
|
447
|
+
destination: this.active === 'destination'
|
|
448
|
+
? this.destination.getSnapshot().query
|
|
449
|
+
: (endpoints?.destination?.name ?? ''),
|
|
450
|
+
results: this.active ? this.channel(this.active).getSnapshot() : null,
|
|
451
|
+
members: this.members,
|
|
452
|
+
conflictMessage: endpoints?.conflict === 'SAME_LOCATION'
|
|
453
|
+
? 'Choose different starting and destination locations.'
|
|
454
|
+
: endpoints?.conflict === 'OVERLAPPING_LOCATIONS'
|
|
455
|
+
? 'Starting and destination locations overlap. Choose a specific different location.'
|
|
456
|
+
: null,
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
publish = () => {
|
|
460
|
+
this.routes?.setVisible(this.opened && !this.active);
|
|
461
|
+
const next = this.readSnapshot();
|
|
462
|
+
if (Object.entries(next).every(([key, value]) => Object.is(this.snapshot[key], value)))
|
|
463
|
+
return;
|
|
464
|
+
this.snapshot = next;
|
|
465
|
+
this.listeners.forEach((listener) => listener());
|
|
466
|
+
};
|
|
467
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { SavedRoutesController, SavedRoutesBindings, SavedRoutesSnapshot } from '../saved-routes/SavedRoutesController.js';
|
|
2
|
+
import type { CatalogStoreRow, DiscoveryChannelSnapshot, EndpointReference, EndpointState, NodeGroupSelectionRequest, PublicNodeData } from '@wovvmap/contracts';
|
|
3
|
+
import type { ViewerDiscoveryCoordinator, ViewerUIOperations } from '@wovvmap/runtime-core';
|
|
4
|
+
import type { DirectionField, UIBaseProps } from '../components.js';
|
|
5
|
+
import type { RoutePreviewBindings, RoutePreviewSnapshot, RoutePreviewActions } from '../routes/routePreview.types.js';
|
|
6
|
+
/** Narrow SDK binding; endpoints stay authoritative in navigation, queries in existing channels.
|
|
7
|
+
* Hinglish: Endpoint ka naya store/search index nahi; UI sirf existing SDK capabilities jodti hai. */
|
|
8
|
+
export interface DirectionViewerBindings extends Pick<ViewerUIOperations, 'setOrigin' | 'setDestination' | 'swapEndpoints'> {
|
|
9
|
+
/** Optional camera capability for custom/read-only compositions.
|
|
10
|
+
* Hinglish: Host camera na de tab bhi endpoint form kaam kare. */
|
|
11
|
+
focusEndpoint?: ViewerUIOperations['focusEndpoint'];
|
|
12
|
+
discovery: Pick<ViewerDiscoveryCoordinator, 'getChannel'>;
|
|
13
|
+
getEndpoints: () => EndpointState | null;
|
|
14
|
+
offlineRoutes?: SavedRoutesBindings;
|
|
15
|
+
routes?: Omit<RoutePreviewBindings, 'getEndpoints'>;
|
|
16
|
+
}
|
|
17
|
+
/** Only the expanded, bounded public member page is retained for presentation.
|
|
18
|
+
* Hinglish: Sirf khule group ke loaded public members hain; complete node/group database nahi. */
|
|
19
|
+
export interface DirectionMembers {
|
|
20
|
+
readonly request: NodeGroupSelectionRequest;
|
|
21
|
+
readonly index: number;
|
|
22
|
+
readonly items: readonly PublicNodeData[];
|
|
23
|
+
readonly loading: boolean;
|
|
24
|
+
readonly error: string | null;
|
|
25
|
+
readonly hasMore: boolean;
|
|
26
|
+
readonly nextOffset: number | null;
|
|
27
|
+
}
|
|
28
|
+
/** Cached presentation projection; committed labels and drafts have separate owners.
|
|
29
|
+
* Hinglish: Label SDK endpoint se aur typing channel query se aaye; dono mix na hon. */
|
|
30
|
+
export interface DirectionSnapshot {
|
|
31
|
+
readonly savedRoutes?: SavedRoutesSnapshot;
|
|
32
|
+
readonly routePreview?: RoutePreviewSnapshot;
|
|
33
|
+
readonly open: boolean;
|
|
34
|
+
readonly ready: boolean;
|
|
35
|
+
readonly activeField: DirectionField | null;
|
|
36
|
+
readonly origin: string;
|
|
37
|
+
readonly destination: string;
|
|
38
|
+
readonly endpoints: EndpointState | null;
|
|
39
|
+
readonly pending: boolean;
|
|
40
|
+
readonly error: string | null;
|
|
41
|
+
readonly conflictMessage: string | null;
|
|
42
|
+
readonly results: Readonly<DiscoveryChannelSnapshot<'stores'>> | null;
|
|
43
|
+
readonly members: DirectionMembers | null;
|
|
44
|
+
}
|
|
45
|
+
/** Platform views emit named intents; no effect-driven endpoint/route writes.
|
|
46
|
+
* Hinglish: Click/typing ke named actions hain; renderer ya effect endpoints set nahi karega. */
|
|
47
|
+
export interface DirectionActions {
|
|
48
|
+
readonly savedRoutes?: SavedRoutesController | null;
|
|
49
|
+
readonly routes?: RoutePreviewActions | null;
|
|
50
|
+
open: (destination?: EndpointReference) => void;
|
|
51
|
+
close: () => void;
|
|
52
|
+
back?: () => void;
|
|
53
|
+
activate: (field: DirectionField) => void;
|
|
54
|
+
deactivate?: (field: DirectionField) => void;
|
|
55
|
+
changeQuery: (field: DirectionField, query: string) => void;
|
|
56
|
+
cancelSearch: () => void;
|
|
57
|
+
clear: (field: DirectionField) => void;
|
|
58
|
+
swap: () => void;
|
|
59
|
+
selectRow: (row: CatalogStoreRow, results?: DirectionSnapshot['results']) => void;
|
|
60
|
+
toggleGroup: (row: CatalogStoreRow, index: number, results?: DirectionSnapshot['results']) => void;
|
|
61
|
+
selectMember: (node: PublicNodeData, members?: DirectionMembers | null) => void;
|
|
62
|
+
loadMore: () => void;
|
|
63
|
+
retry: () => void;
|
|
64
|
+
loadMoreMembers: () => void;
|
|
65
|
+
retryMembers: () => void;
|
|
66
|
+
}
|
|
67
|
+
/** Shared view props; layout and keyboard presentation belong to each platform.
|
|
68
|
+
* Hinglish: Actions/model same hain; layout aur keyboard platform manage karega. */
|
|
69
|
+
export interface DirectionContentProps extends UIBaseProps {
|
|
70
|
+
/** Hide only the default selector; programmatic SDK preferences remain available.
|
|
71
|
+
* Hinglish: Template apni UI rakh sake; hide se routing capability off nahi hoti. */
|
|
72
|
+
showRoutePreferences?: boolean;
|
|
73
|
+
showControls?: boolean;
|
|
74
|
+
showPlaybackControls?: boolean;
|
|
75
|
+
model: DirectionSnapshot;
|
|
76
|
+
actions: DirectionActions;
|
|
77
|
+
/** Keyboard dismissal follows intent capture so blur cannot discard the clicked row before its ACK.
|
|
78
|
+
* Hinglish: Pehle result capture ho, phir keyboard band ho; blur se selection miss na ho. */
|
|
79
|
+
onBeforeSelect?: () => void;
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=direction.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"direction.types.d.ts","sourceRoot":"","sources":["../../src/directions/direction.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,uCAAuC,CAAA;AAC9C,OAAO,KAAK,EACV,eAAe,EACf,wBAAwB,EACxB,iBAAiB,EACjB,aAAa,EACb,yBAAyB,EACzB,cAAc,EACf,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,0BAA0B,EAAE,kBAAkB,EAAE,MAAM,uBAA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K,IAAI,CAAA;IACjF,WAAW,EAAE,CAAC,GAAG,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,CAAC,SAAS,CAAC,KAAK,IAAI,CAAA;IAClG,YAAY,EAAE,CAAC,IAAI,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,IAAI,KAAK,IAAI,CAAA;IAC/E,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,KAAK,EAAE,MAAM,IAAI,CAAA;IACjB,eAAe,EAAE,MAAM,IAAI,CAAA;IAC3B,YAAY,EAAE,MAAM,IAAI,CAAA;CACzB;AAED;oFACoF;AACpF,MAAM,WAAW,qBAAsB,SAAQ,WAAW;IACxD;yFACqF;IACrF,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,KAAK,EAAE,iBAAiB,CAAA;IACxB,OAAO,EAAE,gBAAgB,CAAA;IACzB;iGAC6F;IAC7F,cAAc,CAAC,EAAE,MAAM,IAAI,CAAA;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { DirectionActions, DirectionSnapshot } from './direction.types.js';
|
|
2
|
+
/** Name the shared screen states once; views never infer navigation from nested JSX conditions.
|
|
3
|
+
* Hinglish: Screen ke readable naam yahan hain; UI mein route/field ki condition baar-baar na likhein. */
|
|
4
|
+
export declare function getDirectionPresentation(model: DirectionSnapshot): {
|
|
5
|
+
hasSearchFocus: boolean;
|
|
6
|
+
isSearching: boolean;
|
|
7
|
+
isInstructionReview: boolean;
|
|
8
|
+
isMapVisible: boolean;
|
|
9
|
+
isSingleRoutePreview: boolean;
|
|
10
|
+
isGuidanceActive: boolean;
|
|
11
|
+
showInputs: boolean;
|
|
12
|
+
canReturnToInstructions: boolean;
|
|
13
|
+
};
|
|
14
|
+
/** Full-screen Back returns one presentation step; it never generates a new route.
|
|
15
|
+
* Hinglish: Search se form, guidance se preview, single preview se list; Generate dobara nahi. */
|
|
16
|
+
export declare function getDirectionBackAction(model: DirectionSnapshot, actions: DirectionActions): () => void;
|
|
17
|
+
//# sourceMappingURL=directionPresentation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"directionPresentation.d.ts","sourceRoot":"","sources":["../../src/directions/directionPresentation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAE5E;0GAC0G;AAC1G,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,iBAAiB;;;;;;;;;EAqBhE;AAED;kGACkG;AAClG,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,iBAAiB,EAAE,OAAO,EAAE,gBAAgB,cAOzF"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** Name the shared screen states once; views never infer navigation from nested JSX conditions.
|
|
2
|
+
* Hinglish: Screen ke readable naam yahan hain; UI mein route/field ki condition baar-baar na likhein. */
|
|
3
|
+
export function getDirectionPresentation(model) {
|
|
4
|
+
const route = model.routePreview?.route;
|
|
5
|
+
const hasSearchFocus = model.activeField !== null;
|
|
6
|
+
const hasAcceptedRoute = !!route?.routeSet;
|
|
7
|
+
const isInstructionReview = !!model.routePreview?.reviewing;
|
|
8
|
+
const isMapVisible = hasAcceptedRoute && !hasSearchFocus && !isInstructionReview;
|
|
9
|
+
const isSingleRoutePreview = isMapVisible &&
|
|
10
|
+
route?.routeSet?.options.length === 1 &&
|
|
11
|
+
(route.stage === 'preview' || route.stage === 'starting');
|
|
12
|
+
return {
|
|
13
|
+
hasSearchFocus,
|
|
14
|
+
isSearching: hasSearchFocus && !!model.results,
|
|
15
|
+
isInstructionReview,
|
|
16
|
+
isMapVisible,
|
|
17
|
+
isSingleRoutePreview,
|
|
18
|
+
isGuidanceActive: route?.stage === 'guiding',
|
|
19
|
+
showInputs: hasSearchFocus || isInstructionReview || !hasAcceptedRoute,
|
|
20
|
+
canReturnToInstructions: isSingleRoutePreview && route?.stage === 'preview' && !!model.routePreview?.steps?.enabled,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/** Full-screen Back returns one presentation step; it never generates a new route.
|
|
24
|
+
* Hinglish: Search se form, guidance se preview, single preview se list; Generate dobara nahi. */
|
|
25
|
+
export function getDirectionBackAction(model, actions) {
|
|
26
|
+
const screen = getDirectionPresentation(model);
|
|
27
|
+
if (screen.hasSearchFocus)
|
|
28
|
+
return actions.cancelSearch;
|
|
29
|
+
if (screen.isGuidanceActive && actions.routes)
|
|
30
|
+
return actions.routes.stop;
|
|
31
|
+
if (screen.canReturnToInstructions && actions.routes?.reviewRoute)
|
|
32
|
+
return actions.routes.reviewRoute;
|
|
33
|
+
return actions.back ?? actions.close;
|
|
34
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type ViewerInteractionState, type RestoreInteractionOptions } from '@wovvmap/contracts';
|
|
2
|
+
import { FlowHistoryController } from './FlowHistoryController.js';
|
|
3
|
+
export interface DiscoveryFlowFrame<T> {
|
|
4
|
+
readonly interaction: ViewerInteractionState;
|
|
5
|
+
readonly context: T;
|
|
6
|
+
}
|
|
7
|
+
export interface DiscoveryFlowPort {
|
|
8
|
+
getInteractionState(): Promise<ViewerInteractionState | null>;
|
|
9
|
+
restoreInteractionState(state: ViewerInteractionState, options?: RestoreInteractionOptions): Promise<ViewerInteractionState>;
|
|
10
|
+
}
|
|
11
|
+
/** Accepted action/Back ordering shared by every template; hosts never maintain a second history.
|
|
12
|
+
* Hinglish: Latest accepted action hi history banaye; Native aur WebView double push na karein. */
|
|
13
|
+
export declare class DiscoveryFlowController<T> {
|
|
14
|
+
private readonly port;
|
|
15
|
+
private readonly equalContext;
|
|
16
|
+
readonly history: FlowHistoryController<DiscoveryFlowFrame<T>>;
|
|
17
|
+
private sequence;
|
|
18
|
+
private pending?;
|
|
19
|
+
private current?;
|
|
20
|
+
private restoring;
|
|
21
|
+
constructor(port: DiscoveryFlowPort, equalContext: (a: T, b: T) => boolean);
|
|
22
|
+
get isRestoring(): boolean;
|
|
23
|
+
get isPending(): boolean;
|
|
24
|
+
get size(): number;
|
|
25
|
+
begin(context: T, mapClick?: boolean): number;
|
|
26
|
+
accept(id: number, getContext: () => T): Promise<boolean>;
|
|
27
|
+
/** Enter an overlay after settling an earlier accepted preview, using the same bounded history.
|
|
28
|
+
* Hinglish: Detail ka pending preview pehle capture ho; direction overlay doosri stack na banaye. */
|
|
29
|
+
enter(context: T, next: () => T): Promise<boolean>;
|
|
30
|
+
reject(id: number): Promise<T | null>;
|
|
31
|
+
/** A failed Back keeps its entry; restoration never creates a new history entry.
|
|
32
|
+
* Hinglish: Restore fail ho to entry wahi rahe; Back khud nayi entry na banaye. */
|
|
33
|
+
back(validate: (context: T) => void, apply: (context: T) => void, options?: RestoreInteractionOptions): Promise<boolean>;
|
|
34
|
+
reset(): void;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=DiscoveryFlowController.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DiscoveryFlowController.d.ts","sourceRoot":"","sources":["../../src/flow/DiscoveryFlowController.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC/B,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAE/D,MAAM,WAAW,kBAAkB,CAAC,CAAC;IACnC,QAAQ,CAAC,WAAW,EAAE,sBAAsB,CAAA;IAC5C,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAA;CACpB;AACD,MAAM,WAAW,iBAAiB;IAChC,mBAAmB,IAAI,OAAO,CAAC,sBAAsB,GAAG,IAAI,CAAC,CAAA;IAC7D,uBAAuB,CACrB,KAAK,EAAE,sBAAs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