@g9tm/lynxcontrols 1.4.11 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.tsbuildinfo +1 -1
- package/dist/anchor/context.d.ts +15 -0
- package/dist/anchor/context.d.ts.map +1 -0
- package/dist/anchor/context.jsx +10 -0
- package/dist/anchor/context.jsx.map +1 -0
- package/dist/anchor/hooks.d.ts +72 -0
- package/dist/anchor/hooks.d.ts.map +1 -0
- package/dist/anchor/hooks.jsx +147 -0
- package/dist/anchor/hooks.jsx.map +1 -0
- package/dist/anchor/index.d.ts +6 -0
- package/dist/anchor/index.d.ts.map +1 -0
- package/dist/anchor/index.jsx +5 -0
- package/dist/anchor/measure.d.ts +22 -0
- package/dist/anchor/measure.d.ts.map +1 -0
- package/dist/anchor/measure.jsx +110 -0
- package/dist/anchor/measure.jsx.map +1 -0
- package/dist/anchor/registry.d.ts +108 -0
- package/dist/anchor/registry.d.ts.map +1 -0
- package/dist/anchor/registry.jsx +142 -0
- package/dist/anchor/registry.jsx.map +1 -0
- package/dist/anchor/scroll.d.ts +34 -0
- package/dist/anchor/scroll.d.ts.map +1 -0
- package/dist/anchor/scroll.jsx +255 -0
- package/dist/anchor/scroll.jsx.map +1 -0
- package/dist/base/control.d.ts +10 -3
- package/dist/base/control.d.ts.map +1 -1
- package/dist/base/control.jsx +17 -2
- package/dist/base/control.jsx.map +1 -1
- package/dist/base/pressable.d.ts.map +1 -1
- package/dist/base/pressable.jsx +7 -1
- package/dist/base/pressable.jsx.map +1 -1
- package/dist/button/button.d.ts.map +1 -1
- package/dist/button/button.jsx +11 -1
- package/dist/button/button.jsx.map +1 -1
- package/dist/button/header-action-button.d.ts.map +1 -1
- package/dist/button/header-action-button.jsx +10 -1
- package/dist/button/header-action-button.jsx.map +1 -1
- package/dist/button/icon-button.d.ts.map +1 -1
- package/dist/button/icon-button.jsx +11 -1
- package/dist/button/icon-button.jsx.map +1 -1
- package/dist/button/nav-card.d.ts.map +1 -1
- package/dist/button/nav-card.jsx +10 -1
- package/dist/button/nav-card.jsx.map +1 -1
- package/dist/button/vertical-icon-text-button.d.ts.map +1 -1
- package/dist/button/vertical-icon-text-button.jsx +10 -1
- package/dist/button/vertical-icon-text-button.jsx.map +1 -1
- package/dist/expander/expander.d.ts.map +1 -1
- package/dist/expander/expander.jsx +14 -1
- package/dist/expander/expander.jsx.map +1 -1
- package/dist/fields/editor.d.ts.map +1 -1
- package/dist/fields/editor.jsx +17 -1
- package/dist/fields/editor.jsx.map +1 -1
- package/dist/fields/outlined-field.d.ts +6 -0
- package/dist/fields/outlined-field.d.ts.map +1 -1
- package/dist/fields/outlined-field.jsx +14 -3
- package/dist/fields/outlined-field.jsx.map +1 -1
- package/dist/fields/text-entry.d.ts.map +1 -1
- package/dist/fields/text-entry.jsx +17 -1
- package/dist/fields/text-entry.jsx.map +1 -1
- package/dist/fields/use-text-input.d.ts +1 -1
- package/dist/guide/confirm-sheet.d.ts +26 -0
- package/dist/guide/confirm-sheet.d.ts.map +1 -0
- package/dist/guide/confirm-sheet.jsx +146 -0
- package/dist/guide/confirm-sheet.jsx.map +1 -0
- package/dist/guide/guide.css +428 -0
- package/dist/guide/guide.css.map +1 -0
- package/dist/guide/index.d.ts +5 -0
- package/dist/guide/index.d.ts.map +1 -0
- package/dist/guide/index.jsx +4 -0
- package/dist/guide/journey.d.ts +46 -0
- package/dist/guide/journey.d.ts.map +1 -0
- package/dist/guide/journey.jsx +462 -0
- package/dist/guide/journey.jsx.map +1 -0
- package/dist/guide/placement.d.ts +44 -0
- package/dist/guide/placement.d.ts.map +1 -0
- package/dist/guide/placement.jsx +119 -0
- package/dist/guide/placement.jsx.map +1 -0
- package/dist/guide/service.d.ts +95 -0
- package/dist/guide/service.d.ts.map +1 -0
- package/dist/guide/service.jsx +566 -0
- package/dist/guide/service.jsx.map +1 -0
- package/dist/guide/settings.d.ts +68 -0
- package/dist/guide/settings.d.ts.map +1 -0
- package/dist/guide/settings.jsx +66 -0
- package/dist/guide/settings.jsx.map +1 -0
- package/dist/host/host.d.ts +5 -1
- package/dist/host/host.d.ts.map +1 -1
- package/dist/host/host.jsx +12 -0
- package/dist/host/host.jsx.map +1 -1
- package/dist/host/layers.d.ts +3 -1
- package/dist/host/layers.d.ts.map +1 -1
- package/dist/host/layers.jsx +4 -2
- package/dist/host/layers.jsx.map +1 -1
- package/dist/host/registry.d.ts +3 -0
- package/dist/host/registry.d.ts.map +1 -1
- package/dist/host/registry.jsx.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/provider/contexts.d.ts +3 -0
- package/dist/provider/contexts.d.ts.map +1 -1
- package/dist/provider/contexts.jsx.map +1 -1
- package/dist/provider/provider.d.ts.map +1 -1
- package/dist/provider/provider.jsx +24 -17
- package/dist/provider/provider.jsx.map +1 -1
- package/dist/provider/settings.d.ts +4 -0
- package/dist/provider/settings.d.ts.map +1 -1
- package/dist/provider/settings.jsx +3 -2
- package/dist/provider/settings.jsx.map +1 -1
- package/dist/route/hooks.d.ts +34 -0
- package/dist/route/hooks.d.ts.map +1 -0
- package/dist/route/hooks.jsx +147 -0
- package/dist/route/hooks.jsx.map +1 -0
- package/dist/route/index.d.ts +3 -0
- package/dist/route/index.d.ts.map +1 -0
- package/dist/route/index.jsx +2 -0
- package/dist/route/router.d.ts +201 -0
- package/dist/route/router.d.ts.map +1 -0
- package/dist/route/router.jsx +810 -0
- package/dist/route/router.jsx.map +1 -0
- package/dist/sheet/frame.d.ts +3 -1
- package/dist/sheet/frame.d.ts.map +1 -1
- package/dist/sheet/frame.jsx +67 -25
- package/dist/sheet/frame.jsx.map +1 -1
- package/dist/sheet/options.d.ts +10 -0
- package/dist/sheet/options.d.ts.map +1 -1
- package/dist/sheet/options.jsx.map +1 -1
- package/dist/sheet/service.d.ts +5 -0
- package/dist/sheet/service.d.ts.map +1 -1
- package/dist/sheet/service.jsx +14 -2
- package/dist/sheet/service.jsx.map +1 -1
- package/dist/sheet/sheet.css +9 -0
- package/dist/sheet/sheet.css.map +1 -1
- package/dist/tabs/tab-view.d.ts +14 -0
- package/dist/tabs/tab-view.d.ts.map +1 -1
- package/dist/tabs/tab-view.jsx +59 -3
- package/dist/tabs/tab-view.jsx.map +1 -1
- package/dist/toggle/checkbox.d.ts.map +1 -1
- package/dist/toggle/checkbox.jsx +15 -1
- package/dist/toggle/checkbox.jsx.map +1 -1
- package/dist/toggle/chip-group.d.ts.map +1 -1
- package/dist/toggle/chip-group.jsx +12 -1
- package/dist/toggle/chip-group.jsx.map +1 -1
- package/dist/toggle/switch.d.ts.map +1 -1
- package/dist/toggle/switch.jsx +15 -1
- package/dist/toggle/switch.jsx.map +1 -1
- package/package.json +17 -2
|
@@ -0,0 +1,566 @@
|
|
|
1
|
+
import { g9RuntimeTimers, textIn } from "@g9tm/lynxcontrols-foundation";
|
|
2
|
+
import { useEffect, useMemo, useRef, useState, useSyncExternalStore } from "@lynx-js/react";
|
|
3
|
+
import { anchorRect, measureNode } from "../anchor/measure.jsx";
|
|
4
|
+
import { revealAnchor } from "../anchor/scroll.jsx";
|
|
5
|
+
import { useG9Host } from "../host/hooks.jsx";
|
|
6
|
+
import { g9Hosts } from "../host/registry.jsx";
|
|
7
|
+
import { useG9Direction, useG9Settings } from "../provider/hooks.jsx";
|
|
8
|
+
import { presentConfirmSheet } from "./confirm-sheet.jsx";
|
|
9
|
+
import { inflate, placeBubble, placePointer, scrimBands } from "./placement.jsx";
|
|
10
|
+
import { resolveGuideSettings } from "./settings.jsx";
|
|
11
|
+
import "./guide.css";
|
|
12
|
+
const FEATURE = 'g9-guide';
|
|
13
|
+
const SETTINGS_WAIT_MS = 500;
|
|
14
|
+
function store(initial) {
|
|
15
|
+
let value = initial;
|
|
16
|
+
const listeners = new Set();
|
|
17
|
+
return {
|
|
18
|
+
get: ()=>value,
|
|
19
|
+
set (v) {
|
|
20
|
+
value = v;
|
|
21
|
+
for (const l of Array.from(listeners))l();
|
|
22
|
+
},
|
|
23
|
+
subscribe (l) {
|
|
24
|
+
listeners.add(l);
|
|
25
|
+
return ()=>{
|
|
26
|
+
listeners.delete(l);
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
const isRect = (t)=>'object' == typeof t && 'width' in t;
|
|
32
|
+
const sameRect = (a, b)=>a === b || !!a && !!b && Math.abs(a.x - b.x) < 0.5 && Math.abs(a.y - b.y) < 0.5 && Math.abs(a.width - b.width) < 0.5 && Math.abs(a.height - b.height) < 0.5;
|
|
33
|
+
function createGuideService(host, initial, provided) {
|
|
34
|
+
const anchors = host.anchors;
|
|
35
|
+
let settings = initial;
|
|
36
|
+
let settingsProvided = provided;
|
|
37
|
+
const settingsWaiters = new Set();
|
|
38
|
+
const whenSettings = ()=>new Promise((resolve)=>{
|
|
39
|
+
const done = ()=>{
|
|
40
|
+
settingsWaiters.delete(done);
|
|
41
|
+
g9RuntimeTimers.clearTimeout(timer);
|
|
42
|
+
resolve();
|
|
43
|
+
};
|
|
44
|
+
const timer = g9RuntimeTimers.setTimeout(done, SETTINGS_WAIT_MS);
|
|
45
|
+
settingsWaiters.add(done);
|
|
46
|
+
});
|
|
47
|
+
const marks = new Map();
|
|
48
|
+
const view1 = store([]);
|
|
49
|
+
const confirmation = store(null);
|
|
50
|
+
let seq = 0;
|
|
51
|
+
let tracking = null;
|
|
52
|
+
const publish = ()=>view1.set(Array.from(marks.values()).map((m)=>m.state));
|
|
53
|
+
const measure = async (target)=>{
|
|
54
|
+
if ('string' == typeof target) {
|
|
55
|
+
const a = anchors.find(target);
|
|
56
|
+
return a ? anchorRect(a) : null;
|
|
57
|
+
}
|
|
58
|
+
return isRect(target) ? target : {
|
|
59
|
+
x: target.x - 1,
|
|
60
|
+
y: target.y - 1,
|
|
61
|
+
width: 2,
|
|
62
|
+
height: 2
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
const end = (key, outcome)=>{
|
|
66
|
+
const m = marks.get(key);
|
|
67
|
+
if (!m) return;
|
|
68
|
+
marks.delete(key);
|
|
69
|
+
if (null !== m.timer) g9RuntimeTimers.clearTimeout(m.timer);
|
|
70
|
+
publish();
|
|
71
|
+
m.settle(outcome);
|
|
72
|
+
if (0 === marks.size && null !== tracking) {
|
|
73
|
+
g9RuntimeTimers.clearTimeout(tracking);
|
|
74
|
+
tracking = null;
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
const track = async ()=>{
|
|
78
|
+
tracking = null;
|
|
79
|
+
for (const m of Array.from(marks.values())){
|
|
80
|
+
const rect = await measure(m.state.spec.target);
|
|
81
|
+
if (marks.has(m.state.key)) {
|
|
82
|
+
if (!rect || rect.width <= 0 || rect.height <= 0) {
|
|
83
|
+
m.misses += 1;
|
|
84
|
+
if (m.misses >= 2) end(m.state.key, 'target-lost');
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
m.misses = 0;
|
|
88
|
+
if (!sameRect(rect, m.state.rect)) {
|
|
89
|
+
m.state = {
|
|
90
|
+
...m.state,
|
|
91
|
+
rect
|
|
92
|
+
};
|
|
93
|
+
publish();
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
if (marks.size > 0 && null === tracking) tracking = g9RuntimeTimers.setTimeout(()=>void track(), settings.trackMs);
|
|
98
|
+
};
|
|
99
|
+
const offRegistry = anchors.subscribe(()=>{
|
|
100
|
+
if (marks.size > 0 && null === tracking) tracking = g9RuntimeTimers.setTimeout(()=>void track(), 0);
|
|
101
|
+
});
|
|
102
|
+
const service = {
|
|
103
|
+
get settings () {
|
|
104
|
+
return settings;
|
|
105
|
+
},
|
|
106
|
+
anchors,
|
|
107
|
+
marks: view1,
|
|
108
|
+
confirmation,
|
|
109
|
+
show (spec) {
|
|
110
|
+
var _spec_key;
|
|
111
|
+
const key = null != (_spec_key = spec.key) ? _spec_key : `g9-guide-${++seq}`;
|
|
112
|
+
if (marks.has(key)) end(key, 'replaced');
|
|
113
|
+
let settle;
|
|
114
|
+
const result = new Promise((r)=>{
|
|
115
|
+
settle = r;
|
|
116
|
+
});
|
|
117
|
+
const mark = {
|
|
118
|
+
state: {
|
|
119
|
+
key,
|
|
120
|
+
spec,
|
|
121
|
+
rect: null
|
|
122
|
+
},
|
|
123
|
+
settle,
|
|
124
|
+
misses: 0,
|
|
125
|
+
timer: null
|
|
126
|
+
};
|
|
127
|
+
marks.set(key, mark);
|
|
128
|
+
if (void 0 !== spec.timeoutMs) mark.timer = g9RuntimeTimers.setTimeout(()=>end(key, 'timeout'), spec.timeoutMs);
|
|
129
|
+
publish();
|
|
130
|
+
(async ()=>{
|
|
131
|
+
if ('string' == typeof spec.target && false !== spec.reveal) await revealAnchor(anchors, spec.target, {
|
|
132
|
+
smooth: true
|
|
133
|
+
});
|
|
134
|
+
if (!marks.has(key)) return;
|
|
135
|
+
const rect = await measure(spec.target);
|
|
136
|
+
if (!marks.has(key)) return;
|
|
137
|
+
if (!rect) return void end(key, 'target-lost');
|
|
138
|
+
mark.state = {
|
|
139
|
+
...mark.state,
|
|
140
|
+
rect
|
|
141
|
+
};
|
|
142
|
+
publish();
|
|
143
|
+
if (null === tracking) tracking = g9RuntimeTimers.setTimeout(()=>void track(), settings.trackMs);
|
|
144
|
+
})();
|
|
145
|
+
return {
|
|
146
|
+
key,
|
|
147
|
+
hide: ()=>end(key, 'hidden'),
|
|
148
|
+
result
|
|
149
|
+
};
|
|
150
|
+
},
|
|
151
|
+
hideAll () {
|
|
152
|
+
for (const key of Array.from(marks.keys()))end(key, 'hidden');
|
|
153
|
+
},
|
|
154
|
+
pointAt (target, text1, options = {}) {
|
|
155
|
+
var _options_gesture;
|
|
156
|
+
return service.show({
|
|
157
|
+
target,
|
|
158
|
+
effects: [
|
|
159
|
+
{
|
|
160
|
+
type: 'spotlight',
|
|
161
|
+
modal: true === options.modal
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
type: 'highlight',
|
|
165
|
+
ring: 2,
|
|
166
|
+
opacity: 0.08,
|
|
167
|
+
pulse: true
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
type: 'pointer',
|
|
171
|
+
gesture: null != (_options_gesture = options.gesture) ? _options_gesture : 'tap'
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
type: 'caption',
|
|
175
|
+
text: text1
|
|
176
|
+
}
|
|
177
|
+
],
|
|
178
|
+
...options.buttons ? {
|
|
179
|
+
buttons: options.buttons
|
|
180
|
+
} : {}
|
|
181
|
+
});
|
|
182
|
+
},
|
|
183
|
+
coach (target, text1) {
|
|
184
|
+
return service.show({
|
|
185
|
+
target,
|
|
186
|
+
effects: [
|
|
187
|
+
{
|
|
188
|
+
type: 'spotlight',
|
|
189
|
+
modal: true
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
type: 'caption',
|
|
193
|
+
text: text1
|
|
194
|
+
}
|
|
195
|
+
],
|
|
196
|
+
buttons: [
|
|
197
|
+
'done'
|
|
198
|
+
]
|
|
199
|
+
});
|
|
200
|
+
},
|
|
201
|
+
hint (target) {
|
|
202
|
+
return service.show({
|
|
203
|
+
target,
|
|
204
|
+
effects: [
|
|
205
|
+
{
|
|
206
|
+
type: 'beacon'
|
|
207
|
+
}
|
|
208
|
+
],
|
|
209
|
+
reveal: false
|
|
210
|
+
});
|
|
211
|
+
},
|
|
212
|
+
presenter () {
|
|
213
|
+
return {
|
|
214
|
+
show: (step)=>{
|
|
215
|
+
const h = service.pointAt(step.anchor, step.text, {
|
|
216
|
+
gesture: step.gesture
|
|
217
|
+
});
|
|
218
|
+
return {
|
|
219
|
+
hide: ()=>h.hide()
|
|
220
|
+
};
|
|
221
|
+
},
|
|
222
|
+
note: (text1)=>{
|
|
223
|
+
service.show({
|
|
224
|
+
target: {
|
|
225
|
+
x: 0,
|
|
226
|
+
y: 0,
|
|
227
|
+
width: 0.01,
|
|
228
|
+
height: 0.01
|
|
229
|
+
},
|
|
230
|
+
effects: [
|
|
231
|
+
{
|
|
232
|
+
type: 'caption',
|
|
233
|
+
text: text1
|
|
234
|
+
}
|
|
235
|
+
],
|
|
236
|
+
timeoutMs: 1600,
|
|
237
|
+
reveal: false
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
},
|
|
242
|
+
confirm (request) {
|
|
243
|
+
service.dismissConfirmation();
|
|
244
|
+
return new Promise((resolve)=>{
|
|
245
|
+
let done = false;
|
|
246
|
+
const state = {
|
|
247
|
+
...request,
|
|
248
|
+
sheet: null,
|
|
249
|
+
resolve: (ok)=>{
|
|
250
|
+
if (done) return;
|
|
251
|
+
done = true;
|
|
252
|
+
if (confirmation.get() === state) confirmation.set(null);
|
|
253
|
+
resolve(ok);
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
confirmation.set(state);
|
|
257
|
+
const present = ()=>{
|
|
258
|
+
if (confirmation.get() !== state) return void state.resolve(false);
|
|
259
|
+
state.sheet = presentConfirmSheet(host, settings, request, state.resolve);
|
|
260
|
+
};
|
|
261
|
+
if (settingsProvided) present();
|
|
262
|
+
else whenSettings().then(present);
|
|
263
|
+
});
|
|
264
|
+
},
|
|
265
|
+
dismissConfirmation () {
|
|
266
|
+
var _open_sheet;
|
|
267
|
+
const open = confirmation.get();
|
|
268
|
+
if (!open) return;
|
|
269
|
+
confirmation.set(null);
|
|
270
|
+
null == (_open_sheet = open.sheet) || _open_sheet.dismiss();
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
service.__end = end;
|
|
274
|
+
service.__settings = (next)=>{
|
|
275
|
+
settings = next;
|
|
276
|
+
settingsProvided = true;
|
|
277
|
+
for (const w of Array.from(settingsWaiters))w();
|
|
278
|
+
};
|
|
279
|
+
service.dispose = ()=>{
|
|
280
|
+
var _open_sheet;
|
|
281
|
+
offRegistry();
|
|
282
|
+
for (const key of Array.from(marks.keys()))end(key, 'unmount');
|
|
283
|
+
const open = confirmation.get();
|
|
284
|
+
null == open || null == (_open_sheet = open.sheet) || _open_sheet.dismiss();
|
|
285
|
+
null == open || open.resolve(false);
|
|
286
|
+
};
|
|
287
|
+
host.attachFeature(FEATURE, service);
|
|
288
|
+
host.registerLayerItem('guide', {
|
|
289
|
+
key: FEATURE,
|
|
290
|
+
element: <GuideLayer service={service}/>
|
|
291
|
+
});
|
|
292
|
+
host.back.push(()=>{
|
|
293
|
+
if (confirmation.get()) {
|
|
294
|
+
service.dismissConfirmation();
|
|
295
|
+
return 'handled';
|
|
296
|
+
}
|
|
297
|
+
if (marks.size > 0) {
|
|
298
|
+
service.hideAll();
|
|
299
|
+
return 'handled';
|
|
300
|
+
}
|
|
301
|
+
return 'pass';
|
|
302
|
+
}, {
|
|
303
|
+
layer: 'guide'
|
|
304
|
+
});
|
|
305
|
+
return service;
|
|
306
|
+
}
|
|
307
|
+
function guideServiceOf(host, settings) {
|
|
308
|
+
var _existing___settings;
|
|
309
|
+
const existing = host.getFeature(FEATURE);
|
|
310
|
+
if (existing && settings) null == (_existing___settings = existing.__settings) || _existing___settings.call(existing, settings);
|
|
311
|
+
return null != existing ? existing : createGuideService(host, null != settings ? settings : resolveGuideSettings(void 0), void 0 !== settings);
|
|
312
|
+
}
|
|
313
|
+
function useG9Guide() {
|
|
314
|
+
const settings = useG9Settings();
|
|
315
|
+
return guideServiceOf(useG9Host(), resolveGuideSettings(settings.guide));
|
|
316
|
+
}
|
|
317
|
+
function g9Guide() {
|
|
318
|
+
return guideServiceOf(g9Hosts.require());
|
|
319
|
+
}
|
|
320
|
+
const POINTER_SVG = (fill, stroke)=>`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="${fill}" stroke="${stroke}" stroke-width="0.9" stroke-linejoin="round" d="M9 11.24V7.5C9 6.12 10.12 5 11.5 5S14 6.12 14 7.5v3.74c1.21-.81 2-2.18 2-3.74C16 5.01 13.99 3 11.5 3S7 5.01 7 7.5c0 1.56.79 2.93 2 3.74zm9.84 4.63l-4.54-2.26c-.17-.07-.35-.11-.54-.11H13v-6c0-.83-.67-1.5-1.5-1.5S10 6.67 10 7.5v10.74l-3.43-.72c-.08-.01-.15-.03-.24-.03-.31 0-.59.13-.79.33l-.79.8 4.94 4.94c.27.27.65.44 1.06.44h6.79c.75 0 1.33-.55 1.44-1.28l.75-5.27c.01-.07.02-.14.02-.2 0-.62-.38-1.16-.91-1.38z"/></svg>`;
|
|
321
|
+
function rgba(hex, opacity, fallback) {
|
|
322
|
+
if (!hex) return fallback;
|
|
323
|
+
const h = hex.replace('#', '');
|
|
324
|
+
const n = Number.parseInt(h.slice(0, 6), 16);
|
|
325
|
+
if (!Number.isFinite(n)) return fallback;
|
|
326
|
+
const a = 8 === h.length ? Number.parseInt(h.slice(6, 8), 16) / 255 : opacity;
|
|
327
|
+
return `rgba(${n >> 16 & 255}, ${n >> 8 & 255}, ${255 & n}, ${Math.round(1000 * a) / 1000})`;
|
|
328
|
+
}
|
|
329
|
+
const px = (n)=>`${Math.round(10 * n) / 10}px`;
|
|
330
|
+
const box = (r)=>({
|
|
331
|
+
left: px(r.x),
|
|
332
|
+
top: px(r.y),
|
|
333
|
+
width: px(r.width),
|
|
334
|
+
height: px(r.height)
|
|
335
|
+
});
|
|
336
|
+
function GuideLayer(props) {
|
|
337
|
+
var _service___settings;
|
|
338
|
+
const { service } = props;
|
|
339
|
+
const provided = useG9Settings().guide;
|
|
340
|
+
const resolved = useMemo(()=>resolveGuideSettings(provided), [
|
|
341
|
+
provided
|
|
342
|
+
]);
|
|
343
|
+
null == (_service___settings = service.__settings) || _service___settings.call(service, resolved);
|
|
344
|
+
const marks = useSyncExternalStore((l)=>service.marks.subscribe(l), ()=>service.marks.get());
|
|
345
|
+
const node = useRef(null);
|
|
346
|
+
const [frame, setFrame] = useState({
|
|
347
|
+
x: 0,
|
|
348
|
+
y: 0,
|
|
349
|
+
width: 0,
|
|
350
|
+
height: 0
|
|
351
|
+
});
|
|
352
|
+
const visible = marks.length > 0;
|
|
353
|
+
useEffect(()=>{
|
|
354
|
+
if (!visible) return;
|
|
355
|
+
measureNode(node.current).then((r)=>{
|
|
356
|
+
if (r && r.width > 0 && r.height > 0 && !sameRect(r, frame)) setFrame(r);
|
|
357
|
+
});
|
|
358
|
+
}, [
|
|
359
|
+
visible,
|
|
360
|
+
marks
|
|
361
|
+
]);
|
|
362
|
+
useEffect(()=>()=>{
|
|
363
|
+
var _service_dispose;
|
|
364
|
+
return null == (_service_dispose = service.dispose) ? void 0 : _service_dispose.call(service);
|
|
365
|
+
}, [
|
|
366
|
+
service
|
|
367
|
+
]);
|
|
368
|
+
if (!visible) return null;
|
|
369
|
+
const local = (r)=>({
|
|
370
|
+
x: r.x - frame.x,
|
|
371
|
+
y: r.y - frame.y,
|
|
372
|
+
width: r.width,
|
|
373
|
+
height: r.height
|
|
374
|
+
});
|
|
375
|
+
const viewRect = {
|
|
376
|
+
x: 0,
|
|
377
|
+
y: 0,
|
|
378
|
+
width: frame.width,
|
|
379
|
+
height: frame.height
|
|
380
|
+
};
|
|
381
|
+
const generation = marks.map((m)=>m.key).join('|');
|
|
382
|
+
return <view key={generation} className="g9-guide" flatten={false} ref={(n)=>{
|
|
383
|
+
node.current = n;
|
|
384
|
+
}} bindlayoutchange={(e)=>{
|
|
385
|
+
var _ref, _ref1;
|
|
386
|
+
var _e_detail, _e_detail1;
|
|
387
|
+
const w = null != (_ref = null == (_e_detail = e.detail) ? void 0 : _e_detail.width) ? _ref : 0;
|
|
388
|
+
const h = null != (_ref1 = null == (_e_detail1 = e.detail) ? void 0 : _e_detail1.height) ? _ref1 : 0;
|
|
389
|
+
if (w > 0 && h > 0 && (Math.abs(w - frame.width) > 0.5 || Math.abs(h - frame.height) > 0.5)) setFrame((f)=>({
|
|
390
|
+
...f,
|
|
391
|
+
width: w,
|
|
392
|
+
height: h
|
|
393
|
+
}));
|
|
394
|
+
}}>
|
|
395
|
+
{marks.map((m)=>m.rect ? <MarkView key={m.key} mark={m} rect={local(m.rect)} view={viewRect} service={service}/> : null)}
|
|
396
|
+
</view>;
|
|
397
|
+
}
|
|
398
|
+
function MarkView(props) {
|
|
399
|
+
const { mark, rect, view: view1, service } = props;
|
|
400
|
+
const rtl = 'rtl' === useG9Direction();
|
|
401
|
+
const texts = service.settings.texts;
|
|
402
|
+
const [bubble, setBubble] = useState(null);
|
|
403
|
+
const finish = (outcome)=>endMark(service, mark.key, outcome);
|
|
404
|
+
const out = [];
|
|
405
|
+
for (const [i, effect] of mark.spec.effects.entries()){
|
|
406
|
+
const k = `${effect.type}-${i}`;
|
|
407
|
+
switch(effect.type){
|
|
408
|
+
case 'spotlight':
|
|
409
|
+
{
|
|
410
|
+
var _effect_padding;
|
|
411
|
+
const pad = null != (_effect_padding = effect.padding) ? _effect_padding : 6;
|
|
412
|
+
const hole = inflate(rect, pad);
|
|
413
|
+
const scrim = rgba(effect.scrim, 0.55, 'rgba(0, 0, 0, 0.55)');
|
|
414
|
+
const modal = true === effect.modal;
|
|
415
|
+
scrimBands(hole, view1).forEach((band, b)=>{
|
|
416
|
+
if (band.width <= 0 || band.height <= 0) return;
|
|
417
|
+
out.push(<view key={`${k}-band-${b}`} className={`g9-guide__scrim${modal ? ' g9-guide__scrim--modal' : ''}`} style={{
|
|
418
|
+
...box(band),
|
|
419
|
+
backgroundColor: scrim
|
|
420
|
+
}} {...modal ? {
|
|
421
|
+
bindtap: ()=>'tap-anywhere' === mark.spec.dismissOn ? finish('tapped') : void 0
|
|
422
|
+
} : {}}/>);
|
|
423
|
+
});
|
|
424
|
+
const radius = void 0 === effect.radius || 'auto' === effect.radius ? Math.min(4, hole.height / 2) : effect.radius;
|
|
425
|
+
out.push(<view key={`${k}-ring`} className="g9-guide__hole" style={{
|
|
426
|
+
...box(hole),
|
|
427
|
+
borderRadius: px(radius)
|
|
428
|
+
}}/>);
|
|
429
|
+
break;
|
|
430
|
+
}
|
|
431
|
+
case 'highlight':
|
|
432
|
+
{
|
|
433
|
+
var _effect_padding1, _effect_ring, _effect_color, _effect_opacity;
|
|
434
|
+
const pad = null != (_effect_padding1 = effect.padding) ? _effect_padding1 : 4;
|
|
435
|
+
const r = inflate(rect, pad);
|
|
436
|
+
const radius = void 0 === effect.radius || 'auto' === effect.radius ? Math.min(14, r.height / 2) : effect.radius;
|
|
437
|
+
out.push(<view key={k} className={`g9-guide__highlight${effect.pulse ? ' g9-guide__highlight--pulse' : ''}`} style={{
|
|
438
|
+
...box(r),
|
|
439
|
+
borderRadius: px(radius),
|
|
440
|
+
borderWidth: px(null != (_effect_ring = effect.ring) ? _effect_ring : 2),
|
|
441
|
+
borderColor: null != (_effect_color = effect.color) ? _effect_color : 'var(--g9-primary)',
|
|
442
|
+
backgroundColor: rgba(effect.color, null != (_effect_opacity = effect.opacity) ? _effect_opacity : 0.18, void 0 === effect.opacity ? 'rgba(46, 125, 50, 0.18)' : `rgba(46, 125, 50, ${effect.opacity})`)
|
|
443
|
+
}}/>);
|
|
444
|
+
break;
|
|
445
|
+
}
|
|
446
|
+
case 'pointer':
|
|
447
|
+
{
|
|
448
|
+
var _effect_gesture;
|
|
449
|
+
const size = 48;
|
|
450
|
+
const p = placePointer(rect, size);
|
|
451
|
+
const gesture = null != (_effect_gesture = effect.gesture) ? _effect_gesture : 'tap';
|
|
452
|
+
out.push(<view key={k} className={`g9-guide__pointer g9-guide__pointer--${gesture}`} style={{
|
|
453
|
+
left: px(p.x),
|
|
454
|
+
top: px(p.y),
|
|
455
|
+
width: px(size),
|
|
456
|
+
height: px(size)
|
|
457
|
+
}}>
|
|
458
|
+
<svg content={POINTER_SVG('#FFFFFF', '#1B1B1B')} style={{
|
|
459
|
+
width: px(size),
|
|
460
|
+
height: px(size)
|
|
461
|
+
}}/>
|
|
462
|
+
</view>);
|
|
463
|
+
break;
|
|
464
|
+
}
|
|
465
|
+
case 'beacon':
|
|
466
|
+
{
|
|
467
|
+
var _effect_corner, _effect_color1;
|
|
468
|
+
const corner = null != (_effect_corner = effect.corner) ? _effect_corner : 'top-end';
|
|
469
|
+
const atEnd = corner.endsWith('end') !== rtl;
|
|
470
|
+
const x = atEnd ? rect.x + rect.width - 6 : rect.x - 6;
|
|
471
|
+
const y = corner.startsWith('top') ? rect.y - 6 : rect.y + rect.height - 6;
|
|
472
|
+
out.push(<view key={k} className="g9-guide__beacon" style={{
|
|
473
|
+
left: px(x),
|
|
474
|
+
top: px(y),
|
|
475
|
+
backgroundColor: null != (_effect_color1 = effect.color) ? _effect_color1 : 'var(--g9-error)'
|
|
476
|
+
}}/>);
|
|
477
|
+
break;
|
|
478
|
+
}
|
|
479
|
+
case 'badge':
|
|
480
|
+
out.push(<view key={k} className="g9-guide__badge" style={{
|
|
481
|
+
left: px(rtl ? rect.x + rect.width - 11 : rect.x - 11),
|
|
482
|
+
top: px(rect.y - 11)
|
|
483
|
+
}}>
|
|
484
|
+
<text className="g9-guide__badge-text">{effect.text}</text>
|
|
485
|
+
</view>);
|
|
486
|
+
break;
|
|
487
|
+
case 'ripple':
|
|
488
|
+
out.push(<view key={k} className="g9-guide__ripple" style={{
|
|
489
|
+
left: px(rect.x + rect.width / 2 - 24),
|
|
490
|
+
top: px(rect.y + rect.height / 2 - 24)
|
|
491
|
+
}}/>);
|
|
492
|
+
break;
|
|
493
|
+
case 'caption':
|
|
494
|
+
{
|
|
495
|
+
var _mark_spec_language, _effect_placement, _mark_spec_buttons;
|
|
496
|
+
const language = null != (_mark_spec_language = mark.spec.language) ? _mark_spec_language : rtl ? 'fa' : 'en';
|
|
497
|
+
const text1 = textIn(effect.text, language);
|
|
498
|
+
const title = effect.title ? textIn(effect.title, language) : null;
|
|
499
|
+
const width = Math.min(300, Math.max(120, view1.width - 48));
|
|
500
|
+
const size = null != bubble ? bubble : {
|
|
501
|
+
width,
|
|
502
|
+
height: 64
|
|
503
|
+
};
|
|
504
|
+
const place = placeBubble({
|
|
505
|
+
target: rect,
|
|
506
|
+
bubble: size,
|
|
507
|
+
view: view1,
|
|
508
|
+
prefer: null != (_effect_placement = effect.placement) ? _effect_placement : 'auto',
|
|
509
|
+
rtl
|
|
510
|
+
});
|
|
511
|
+
const buttons = null != (_mark_spec_buttons = mark.spec.buttons) ? _mark_spec_buttons : [];
|
|
512
|
+
out.push(<view key={k} className="g9-guide__bubble" accessibility-element accessibility-label={title ? `${title}. ${text1}` : text1} style={{
|
|
513
|
+
left: px(place.x),
|
|
514
|
+
top: px(place.y),
|
|
515
|
+
width: px(width),
|
|
516
|
+
opacity: bubble ? 1 : 0,
|
|
517
|
+
direction: rtl ? 'rtl' : 'ltr'
|
|
518
|
+
}} bindlayoutchange={(e)=>{
|
|
519
|
+
var _ref, _ref1;
|
|
520
|
+
var _e_detail, _e_detail1;
|
|
521
|
+
const w = null != (_ref = null == (_e_detail = e.detail) ? void 0 : _e_detail.width) ? _ref : 0;
|
|
522
|
+
const h = null != (_ref1 = null == (_e_detail1 = e.detail) ? void 0 : _e_detail1.height) ? _ref1 : 0;
|
|
523
|
+
if (h > 0 && (!bubble || Math.abs(bubble.height - h) > 0.5)) setBubble({
|
|
524
|
+
width: w || width,
|
|
525
|
+
height: h
|
|
526
|
+
});
|
|
527
|
+
}}>
|
|
528
|
+
{title ? <text className="g9-guide__bubble-title" style={{
|
|
529
|
+
textAlign: rtl ? 'right' : 'left'
|
|
530
|
+
}}>
|
|
531
|
+
{title}
|
|
532
|
+
</text> : null}
|
|
533
|
+
<text className="g9-guide__bubble-text" style={{
|
|
534
|
+
textAlign: rtl ? 'right' : 'left'
|
|
535
|
+
}}>
|
|
536
|
+
{text1}
|
|
537
|
+
</text>
|
|
538
|
+
{buttons.length > 0 ? <view className="g9-guide__bubble-actions" style={{
|
|
539
|
+
flexDirection: rtl ? 'row-reverse' : 'row',
|
|
540
|
+
direction: 'ltr'
|
|
541
|
+
}}>
|
|
542
|
+
{buttons.map((b)=><view key={b} className={`g9-guide__bubble-button${'skip' === b ? ' g9-guide__bubble-button--quiet' : ''}`} bindtap={()=>finish(b)}>
|
|
543
|
+
<text className={`g9-guide__bubble-button-text${'skip' === b ? ' g9-guide__bubble-button-text--quiet' : ''}`}>
|
|
544
|
+
{'next' === b ? texts.next : 'skip' === b ? texts.skip : texts.done}
|
|
545
|
+
</text>
|
|
546
|
+
</view>)}
|
|
547
|
+
</view> : null}
|
|
548
|
+
<view className={`g9-guide__arrow g9-guide__arrow--${place.side}`} style={'below' === place.side || 'above' === place.side || 'over' === place.side ? {
|
|
549
|
+
left: px(place.arrow - 7)
|
|
550
|
+
} : {
|
|
551
|
+
top: px(place.arrow - 7)
|
|
552
|
+
}}/>
|
|
553
|
+
</view>);
|
|
554
|
+
break;
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
return <>{out}</>;
|
|
559
|
+
}
|
|
560
|
+
function endMark(service, key, outcome) {
|
|
561
|
+
var _service___end;
|
|
562
|
+
null == (_service___end = service.__end) || _service___end.call(service, key, outcome);
|
|
563
|
+
}
|
|
564
|
+
export { g9Guide, guideServiceOf, useG9Guide };
|
|
565
|
+
|
|
566
|
+
//# sourceMappingURL=service.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guide/service.jsx","sources":["../../src/guide/service.tsx"],"sourcesContent":["import {\n type G9ChangeLine,\n type G9GuideEffectSpec,\n type G9JourneySource,\n g9RuntimeTimers,\n textIn,\n} from '@g9tm/lynxcontrols-foundation';\nimport { type ReactNode, useEffect, useMemo, useRef, useState, useSyncExternalStore } from '@lynx-js/react';\nimport type { NodesRef } from '@lynx-js/types';\nimport { anchorRect, measureNode } from '../anchor/measure';\nimport type { G9AnchorRect, G9AnchorRegistry } from '../anchor/registry';\nimport { revealAnchor } from '../anchor/scroll';\nimport { useG9Host } from '../host/hooks';\nimport type { G9HostHandle } from '../host/registry';\nimport { g9Hosts } from '../host/registry';\nimport { useG9Direction, useG9Settings } from '../provider/hooks';\nimport type { G9WalkPresenter } from '../route/router';\nimport { type G9ConfirmSheetPresentation, presentConfirmSheet } from './confirm-sheet';\nimport { inflate, placeBubble, placePointer, scrimBands } from './placement';\nimport { type G9ResolvedGuideSettings, resolveGuideSettings } from './settings';\nimport './guide.css';\n\n// The guide: effects drawn over everything (its own host layer, above popups, toasts and the floating items) on any\n// anchor — a highlight in a colour with an opacity, a spotlight that dims all but the control, a finger that shows the\n// gesture, a bubble with text and buttons, a pulsing beacon, a step badge, a ripple where the guide taps — plus the\n// countdown confirmation a guided save waits behind (a G9 sheet of the host, ./confirm-sheet.tsx). A mark follows its target (scrolls, sheets, the keyboard) only\n// while it is shown; nothing animates or measures once the last mark is gone (an idle app does no frame work).\n\n/** What a mark points at: an anchor id (followed as it moves), a fixed rect, or a point. */\nexport type G9GuideTarget = string | G9AnchorRect | { readonly x: number; readonly y: number };\n\n/** One mark: its target, its effects and how it ends. */\nexport interface G9GuideSpec {\n readonly key?: string;\n readonly target: G9GuideTarget;\n readonly effects: readonly G9GuideEffectSpec[];\n /** Bring an anchor into view first (scrolling, mounting a list row). Default true. */\n readonly reveal?: boolean;\n /** Ends by itself after this long. */\n readonly timeoutMs?: number;\n /** What a touch on the guide's own surfaces does. Default `never` (only buttons end it). */\n readonly dismissOn?: 'tap-anywhere' | 'never';\n /** Buttons of the bubble. */\n readonly buttons?: ReadonlyArray<'next' | 'skip' | 'done'>;\n readonly language?: 'fa' | 'en';\n}\n\n/** How a mark ended (exactly once). */\nexport type G9GuideOutcome =\n | 'hidden'\n | 'tapped'\n | 'next'\n | 'skip'\n | 'done'\n | 'timeout'\n | 'target-lost'\n | 'replaced'\n | 'unmount';\n\n/** One shown mark: hide it, or await how it ended. */\nexport interface G9GuideHandle {\n readonly key: string;\n hide(): void;\n readonly result: Promise<G9GuideOutcome>;\n}\n\n/** A shown mark, as the layer draws it. */\nexport interface G9GuideMarkState {\n readonly key: string;\n readonly spec: G9GuideSpec;\n /** The target in LynxView coordinates, null while measuring. */\n readonly rect: G9AnchorRect | null;\n}\n\n/** A guided-save confirmation. */\nexport interface G9ConfirmRequest {\n readonly title: string;\n readonly source: G9JourneySource;\n readonly changes: readonly G9ChangeLine[];\n readonly seconds: number;\n readonly destructive: boolean;\n /** Where this press stands in a journey that presses more than one control (shown when `total` > 1). */\n readonly progress?: { readonly index: number; readonly total: number };\n}\n\ninterface ConfirmState extends G9ConfirmRequest {\n readonly resolve: (ok: boolean) => void;\n sheet: G9ConfirmSheetPresentation | null;\n}\n\n/** The guide of one host: marks, ready-made combinations, the walk presenter and the countdown confirmation. */\nexport interface G9GuideService {\n show(spec: G9GuideSpec): G9GuideHandle;\n hideAll(): void;\n readonly marks: { get(): readonly G9GuideMarkState[]; subscribe(l: () => void): () => void };\n /** A finger and a bubble on a control (the default step of a walk). */\n pointAt(\n target: G9GuideTarget,\n text: string,\n options?: {\n readonly modal?: boolean;\n readonly gesture?: 'tap' | 'longPress';\n readonly buttons?: G9GuideSpec['buttons'];\n },\n ): G9GuideHandle;\n /** A modal spotlight with a bubble and «done». */\n coach(target: G9GuideTarget, text: string): G9GuideHandle;\n /** A small pulsing dot on the control's corner. */\n hint(target: G9GuideTarget): G9GuideHandle;\n /** The presenter a router walk draws its steps with. */\n presenter(): G9WalkPresenter;\n /**\n * Asks the person to confirm a write in a sheet: the changes, the source, a countdown on the confirm button. Resolves\n * once the sheet has gone: true only for the unlocked confirm. A newer request declines the open one.\n */\n confirm(request: G9ConfirmRequest): Promise<boolean>;\n /** Declines the open confirmation, if any (a journey that is cancelled). */\n dismissConfirmation(): void;\n readonly confirmation: { get(): G9ConfirmRequest | null; subscribe(l: () => void): () => void };\n readonly settings: G9ResolvedGuideSettings;\n readonly anchors: G9AnchorRegistry;\n}\n\ninterface Mark {\n state: G9GuideMarkState;\n settle: (o: G9GuideOutcome) => void;\n misses: number;\n timer: unknown;\n}\n\nconst FEATURE = 'g9-guide';\n/** How long a confirmation waits for the provider's settings on a guide first reached outside the tree (ms). */\nconst SETTINGS_WAIT_MS = 500;\n\nfunction store<T>(initial: T) {\n let value = initial;\n const listeners = new Set<() => void>();\n return {\n get: () => value,\n set(v: T) {\n value = v;\n for (const l of Array.from(listeners)) l();\n },\n subscribe(l: () => void) {\n listeners.add(l);\n return () => {\n listeners.delete(l);\n };\n },\n };\n}\n\nconst isRect = (t: G9GuideTarget): t is G9AnchorRect => typeof t === 'object' && 'width' in t;\nconst sameRect = (a: G9AnchorRect | null, b: G9AnchorRect | null) =>\n a === b ||\n (!!a &&\n !!b &&\n Math.abs(a.x - b.x) < 0.5 &&\n Math.abs(a.y - b.y) < 0.5 &&\n Math.abs(a.width - b.width) < 0.5 &&\n Math.abs(a.height - b.height) < 0.5);\n\nfunction createGuideService(host: G9HostHandle, initial: G9ResolvedGuideSettings, provided: boolean): G9GuideService {\n const anchors = host.anchors;\n // The provider's settings win whoever created the service first (`g9Guide()` outside components has none): the\n // layer and the hook hand them in (`useProvidedSettings`).\n let settings = initial;\n // A guide first reached outside the tree (`g9Guide()`: QA, a link) has only the defaults until its layer renders and\n // hands in the provider's settings — a confirmation opened in that gap spoke English with the library's own look (seen\n // on a device, 2026-11-12). It waits for them (one render; at most `SETTINGS_WAIT_MS`).\n let settingsProvided = provided;\n const settingsWaiters = new Set<() => void>();\n const whenSettings = (): Promise<void> =>\n new Promise<void>((resolve) => {\n const done = () => {\n settingsWaiters.delete(done);\n g9RuntimeTimers.clearTimeout(timer);\n resolve();\n };\n const timer = g9RuntimeTimers.setTimeout(done, SETTINGS_WAIT_MS);\n settingsWaiters.add(done);\n });\n const marks = new Map<string, Mark>();\n const view = store<readonly G9GuideMarkState[]>([]);\n const confirmation = store<ConfirmState | null>(null);\n let seq = 0;\n let tracking: unknown = null;\n\n const publish = () => view.set(Array.from(marks.values()).map((m) => m.state));\n\n const measure = async (target: G9GuideTarget): Promise<G9AnchorRect | null> => {\n if (typeof target === 'string') {\n const a = anchors.find(target);\n return a ? anchorRect(a) : null;\n }\n return isRect(target) ? target : { x: target.x - 1, y: target.y - 1, width: 2, height: 2 };\n };\n\n const end = (key: string, outcome: G9GuideOutcome) => {\n const m = marks.get(key);\n if (!m) return;\n marks.delete(key);\n if (m.timer !== null) g9RuntimeTimers.clearTimeout(m.timer);\n publish();\n m.settle(outcome);\n if (marks.size === 0 && tracking !== null) {\n g9RuntimeTimers.clearTimeout(tracking);\n tracking = null;\n }\n };\n\n const track = async () => {\n tracking = null;\n for (const m of Array.from(marks.values())) {\n const rect = await measure(m.state.spec.target);\n if (!marks.has(m.state.key)) continue;\n if (!rect || rect.width <= 0 || rect.height <= 0) {\n m.misses += 1;\n if (m.misses >= 2) end(m.state.key, 'target-lost');\n continue;\n }\n m.misses = 0;\n if (!sameRect(rect, m.state.rect)) {\n m.state = { ...m.state, rect };\n publish();\n }\n }\n if (marks.size > 0 && tracking === null)\n tracking = g9RuntimeTimers.setTimeout(() => void track(), settings.trackMs);\n };\n\n const offRegistry = anchors.subscribe(() => {\n if (marks.size > 0 && tracking === null) tracking = g9RuntimeTimers.setTimeout(() => void track(), 0);\n });\n\n const service: G9GuideService = {\n get settings() {\n return settings;\n },\n anchors,\n marks: view,\n confirmation,\n show(spec) {\n const key = spec.key ?? `g9-guide-${++seq}`;\n if (marks.has(key)) end(key, 'replaced');\n let settle!: (o: G9GuideOutcome) => void;\n const result = new Promise<G9GuideOutcome>((r) => {\n settle = r;\n });\n const mark: Mark = { state: { key, spec, rect: null }, settle, misses: 0, timer: null };\n marks.set(key, mark);\n if (spec.timeoutMs !== undefined)\n mark.timer = g9RuntimeTimers.setTimeout(() => end(key, 'timeout'), spec.timeoutMs);\n publish();\n void (async () => {\n if (typeof spec.target === 'string' && spec.reveal !== false)\n await revealAnchor(anchors, spec.target, { smooth: true });\n if (!marks.has(key)) return;\n const rect = await measure(spec.target);\n if (!marks.has(key)) return;\n if (!rect) {\n end(key, 'target-lost');\n return;\n }\n mark.state = { ...mark.state, rect };\n publish();\n if (tracking === null) tracking = g9RuntimeTimers.setTimeout(() => void track(), settings.trackMs);\n })();\n return { key, hide: () => end(key, 'hidden'), result };\n },\n hideAll() {\n for (const key of Array.from(marks.keys())) end(key, 'hidden');\n },\n pointAt(target, text, options = {}) {\n return service.show({\n target,\n effects: [\n { type: 'spotlight', modal: options.modal === true },\n { type: 'highlight', ring: 2, opacity: 0.08, pulse: true },\n { type: 'pointer', gesture: options.gesture ?? 'tap' },\n { type: 'caption', text },\n ],\n ...(options.buttons ? { buttons: options.buttons } : {}),\n });\n },\n coach(target, text) {\n return service.show({\n target,\n effects: [\n { type: 'spotlight', modal: true },\n { type: 'caption', text },\n ],\n buttons: ['done'],\n });\n },\n hint(target) {\n return service.show({ target, effects: [{ type: 'beacon' }], reveal: false });\n },\n presenter() {\n return {\n show: (step) => {\n const h = service.pointAt(step.anchor, step.text, { gesture: step.gesture });\n return { hide: () => h.hide() };\n },\n note: (text) => {\n service.show({\n target: { x: 0, y: 0, width: 0.01, height: 0.01 },\n effects: [{ type: 'caption', text }],\n timeoutMs: 1600,\n reveal: false,\n });\n },\n };\n },\n confirm(request) {\n service.dismissConfirmation();\n return new Promise<boolean>((resolve) => {\n let done = false;\n const state: ConfirmState = {\n ...request,\n sheet: null,\n resolve: (ok) => {\n if (done) return;\n done = true;\n if (confirmation.get() === state) confirmation.set(null);\n resolve(ok);\n },\n };\n confirmation.set(state);\n const present = () => {\n // Declined (a newer request, back, a cancelled journey) while waiting: nothing to show.\n if (confirmation.get() !== state) {\n state.resolve(false);\n return;\n }\n state.sheet = presentConfirmSheet(host, settings, request, state.resolve);\n };\n if (settingsProvided) present();\n else void whenSettings().then(present);\n });\n },\n dismissConfirmation() {\n const open = confirmation.get();\n if (!open) return;\n // The sheet answers after it has left the screen; the request is over now (a newer one may follow at once). One\n // still waiting for the settings is answered when it would have opened.\n confirmation.set(null);\n open.sheet?.dismiss();\n },\n };\n (service as unknown as { __end: typeof end }).__end = end;\n (service as unknown as Settable).__settings = (next) => {\n settings = next;\n settingsProvided = true;\n for (const w of Array.from(settingsWaiters)) w();\n };\n (service as { dispose?: () => void }).dispose = () => {\n offRegistry();\n for (const key of Array.from(marks.keys())) end(key, 'unmount');\n const open = confirmation.get();\n open?.sheet?.dismiss();\n open?.resolve(false);\n };\n host.attachFeature(FEATURE, service);\n host.registerLayerItem('guide', { key: FEATURE, element: <GuideLayer service={service} /> });\n // Back declines the guide's confirmation first (its sheet closes), then ends any mark (never a journey's place behind it).\n host.back.push(\n () => {\n if (confirmation.get()) {\n service.dismissConfirmation();\n return 'handled';\n }\n if (marks.size > 0) {\n service.hideAll();\n return 'handled';\n }\n return 'pass';\n },\n { layer: 'guide' },\n );\n return service;\n}\n\ninterface Settable {\n __settings?: (settings: G9ResolvedGuideSettings) => void;\n}\n\n/** The guide of a host, created on first use. */\nexport function guideServiceOf(host: G9HostHandle, settings?: G9ResolvedGuideSettings): G9GuideService {\n const existing = host.getFeature(FEATURE) as G9GuideService | undefined;\n if (existing && settings) (existing as unknown as Settable).__settings?.(settings);\n return existing ?? createGuideService(host, settings ?? resolveGuideSettings(undefined), settings !== undefined);\n}\n\n/** The guide of the nearest host. */\nexport function useG9Guide(): G9GuideService {\n const settings = useG9Settings();\n return guideServiceOf(useG9Host(), resolveGuideSettings(settings.guide));\n}\n\n/** The guide of the active host, for code outside components. Throws without a host. */\nexport function g9Guide(): G9GuideService {\n return guideServiceOf(g9Hosts.require());\n}\n\n// ── drawing ─────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nconst POINTER_SVG = (fill: string, stroke: string) =>\n `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"${fill}\" stroke=\"${stroke}\" stroke-width=\"0.9\" stroke-linejoin=\"round\" d=\"M9 11.24V7.5C9 6.12 10.12 5 11.5 5S14 6.12 14 7.5v3.74c1.21-.81 2-2.18 2-3.74C16 5.01 13.99 3 11.5 3S7 5.01 7 7.5c0 1.56.79 2.93 2 3.74zm9.84 4.63l-4.54-2.26c-.17-.07-.35-.11-.54-.11H13v-6c0-.83-.67-1.5-1.5-1.5S10 6.67 10 7.5v10.74l-3.43-.72c-.08-.01-.15-.03-.24-.03-.31 0-.59.13-.79.33l-.79.8 4.94 4.94c.27.27.65.44 1.06.44h6.79c.75 0 1.33-.55 1.44-1.28l.75-5.27c.01-.07.02-.14.02-.2 0-.62-.38-1.16-.91-1.38z\"/></svg>`;\n\nfunction rgba(hex: string | undefined, opacity: number, fallback: string): string {\n if (!hex) return fallback;\n const h = hex.replace('#', '');\n const n = Number.parseInt(h.slice(0, 6), 16);\n if (!Number.isFinite(n)) return fallback;\n const a = h.length === 8 ? Number.parseInt(h.slice(6, 8), 16) / 255 : opacity;\n return `rgba(${(n >> 16) & 255}, ${(n >> 8) & 255}, ${n & 255}, ${Math.round(a * 1000) / 1000})`;\n}\n\nconst px = (n: number) => `${Math.round(n * 10) / 10}px`;\nconst box = (r: G9AnchorRect) => ({ left: px(r.x), top: px(r.y), width: px(r.width), height: px(r.height) });\n\nfunction GuideLayer(props: { readonly service: G9GuideService }): ReactNode {\n const { service } = props;\n const provided = useG9Settings().guide;\n const resolved = useMemo(() => resolveGuideSettings(provided), [provided]);\n (service as unknown as Settable).__settings?.(resolved);\n const marks = useSyncExternalStore(\n (l) => service.marks.subscribe(l),\n () => service.marks.get(),\n );\n const node = useRef<NodesRef | null>(null);\n const [frame, setFrame] = useState<G9AnchorRect>({ x: 0, y: 0, width: 0, height: 0 });\n const visible = marks.length > 0;\n useEffect(() => {\n if (!visible) return;\n void measureNode(node.current).then((r) => {\n // A root measured before its first layout answers 0×0: the frame it replaces is still the right one.\n if (r && r.width > 0 && r.height > 0 && !sameRect(r, frame)) setFrame(r);\n });\n }, [visible, marks]);\n // The host clears its layers when it unmounts: the guide lets go of the anchors and settles every mark then.\n useEffect(() => () => (service as { dispose?: () => void }).dispose?.(), [service]);\n if (!visible) return null;\n const local = (r: G9AnchorRect): G9AnchorRect => ({\n x: r.x - frame.x,\n y: r.y - frame.y,\n width: r.width,\n height: r.height,\n });\n const viewRect: G9AnchorRect = { x: 0, y: 0, width: frame.width, height: frame.height };\n // Fixed, like a popup: a G9 sheet is lynx-ui's `position: fixed` SheetView, which Lynx paints above every in-flow\n // node — an absolute guide layer drew UNDER an open sheet (measured 2026-11-12 on a device). Fixed elements paint in\n // creation order, so the root is re-created for each new mark: it is always newer than the sheet — the confirmation\n // sheet too, so no mark is drawn while one is open (journey.ts, `press`).\n const generation = marks.map((m) => m.key).join('|');\n return (\n <view\n key={generation}\n className=\"g9-guide\"\n flatten={false}\n ref={(n: NodesRef | null) => {\n node.current = n;\n }}\n bindlayoutchange={(e: { detail?: { width?: number; height?: number } }) => {\n const w = e.detail?.width ?? 0;\n const h = e.detail?.height ?? 0;\n if (w > 0 && h > 0 && (Math.abs(w - frame.width) > 0.5 || Math.abs(h - frame.height) > 0.5))\n setFrame((f) => ({ ...f, width: w, height: h }));\n }}\n >\n {marks.map((m) =>\n m.rect ? <MarkView key={m.key} mark={m} rect={local(m.rect)} view={viewRect} service={service} /> : null,\n )}\n </view>\n );\n}\n\nfunction MarkView(props: {\n readonly mark: G9GuideMarkState;\n readonly rect: G9AnchorRect;\n readonly view: G9AnchorRect;\n readonly service: G9GuideService;\n}): ReactNode {\n const { mark, rect, view, service } = props;\n const rtl = useG9Direction() === 'rtl';\n const texts = service.settings.texts;\n const [bubble, setBubble] = useState<{ width: number; height: number } | null>(null);\n const finish = (outcome: G9GuideOutcome) => endMark(service, mark.key, outcome);\n const out: ReactNode[] = [];\n for (const [i, effect] of mark.spec.effects.entries()) {\n const k = `${effect.type}-${i}`;\n switch (effect.type) {\n case 'spotlight': {\n const pad = effect.padding ?? 6;\n const hole = inflate(rect, pad);\n const scrim = rgba(effect.scrim, 0.55, 'rgba(0, 0, 0, 0.55)');\n const modal = effect.modal === true;\n scrimBands(hole, view).forEach((band, b) => {\n if (band.width <= 0 || band.height <= 0) return;\n out.push(\n <view\n key={`${k}-band-${b}`}\n className={`g9-guide__scrim${modal ? ' g9-guide__scrim--modal' : ''}`}\n style={{ ...box(band), backgroundColor: scrim }}\n {...(modal\n ? { bindtap: () => (mark.spec.dismissOn === 'tap-anywhere' ? finish('tapped') : undefined) }\n : {})}\n />,\n );\n });\n // The bands leave a RECTANGULAR hole (no even-odd fill in Lynx): a ring rounder than that shows bright corners\n // outside it (seen on a device, 2026-11-12) — `auto` stays nearly square.\n const radius =\n effect.radius === undefined || effect.radius === 'auto' ? Math.min(4, hole.height / 2) : effect.radius;\n out.push(\n <view key={`${k}-ring`} className=\"g9-guide__hole\" style={{ ...box(hole), borderRadius: px(radius) }} />,\n );\n break;\n }\n case 'highlight': {\n const pad = effect.padding ?? 4;\n const r = inflate(rect, pad);\n const radius =\n effect.radius === undefined || effect.radius === 'auto' ? Math.min(14, r.height / 2) : effect.radius;\n out.push(\n <view\n key={k}\n className={`g9-guide__highlight${effect.pulse ? ' g9-guide__highlight--pulse' : ''}`}\n style={{\n ...box(r),\n borderRadius: px(radius),\n borderWidth: px(effect.ring ?? 2),\n borderColor: effect.color ?? 'var(--g9-primary)',\n backgroundColor: rgba(\n effect.color,\n effect.opacity ?? 0.18,\n effect.opacity === undefined ? 'rgba(46, 125, 50, 0.18)' : `rgba(46, 125, 50, ${effect.opacity})`,\n ),\n }}\n />,\n );\n break;\n }\n case 'pointer': {\n const size = 48;\n const p = placePointer(rect, size);\n const gesture = effect.gesture ?? 'tap';\n out.push(\n <view\n key={k}\n className={`g9-guide__pointer g9-guide__pointer--${gesture}`}\n style={{ left: px(p.x), top: px(p.y), width: px(size), height: px(size) }}\n >\n <svg content={POINTER_SVG('#FFFFFF', '#1B1B1B')} style={{ width: px(size), height: px(size) }} />\n </view>,\n );\n break;\n }\n case 'beacon': {\n const corner = effect.corner ?? 'top-end';\n const atEnd = corner.endsWith('end') !== rtl;\n const x = atEnd ? rect.x + rect.width - 6 : rect.x - 6;\n const y = corner.startsWith('top') ? rect.y - 6 : rect.y + rect.height - 6;\n out.push(\n <view\n key={k}\n className=\"g9-guide__beacon\"\n style={{ left: px(x), top: px(y), backgroundColor: effect.color ?? 'var(--g9-error)' }}\n />,\n );\n break;\n }\n case 'badge':\n out.push(\n <view\n key={k}\n className=\"g9-guide__badge\"\n style={{ left: px(rtl ? rect.x + rect.width - 11 : rect.x - 11), top: px(rect.y - 11) }}\n >\n <text className=\"g9-guide__badge-text\">{effect.text}</text>\n </view>,\n );\n break;\n case 'ripple':\n out.push(\n <view\n key={k}\n className=\"g9-guide__ripple\"\n style={{ left: px(rect.x + rect.width / 2 - 24), top: px(rect.y + rect.height / 2 - 24) }}\n />,\n );\n break;\n case 'caption': {\n const language = mark.spec.language ?? (rtl ? 'fa' : 'en');\n const text = textIn(effect.text, language);\n const title = effect.title ? textIn(effect.title, language) : null;\n const width = Math.min(300, Math.max(120, view.width - 48));\n const size = bubble ?? { width, height: 64 };\n const place = placeBubble({ target: rect, bubble: size, view, prefer: effect.placement ?? 'auto', rtl });\n const buttons = mark.spec.buttons ?? [];\n out.push(\n <view\n key={k}\n className=\"g9-guide__bubble\"\n accessibility-element\n accessibility-label={title ? `${title}. ${text}` : text}\n style={{\n left: px(place.x),\n top: px(place.y),\n width: px(width),\n opacity: bubble ? 1 : 0,\n direction: rtl ? 'rtl' : 'ltr',\n }}\n bindlayoutchange={(e: { detail?: { width?: number; height?: number } }) => {\n const w = e.detail?.width ?? 0;\n const h = e.detail?.height ?? 0;\n if (h > 0 && (!bubble || Math.abs(bubble.height - h) > 0.5)) setBubble({ width: w || width, height: h });\n }}\n >\n {title ? (\n <text className=\"g9-guide__bubble-title\" style={{ textAlign: rtl ? 'right' : 'left' }}>\n {title}\n </text>\n ) : null}\n <text className=\"g9-guide__bubble-text\" style={{ textAlign: rtl ? 'right' : 'left' }}>\n {text}\n </text>\n {buttons.length > 0 ? (\n <view\n className=\"g9-guide__bubble-actions\"\n style={{ flexDirection: rtl ? 'row-reverse' : 'row', direction: 'ltr' }}\n >\n {buttons.map((b) => (\n <view\n key={b}\n className={`g9-guide__bubble-button${b === 'skip' ? ' g9-guide__bubble-button--quiet' : ''}`}\n bindtap={() => finish(b)}\n >\n <text\n className={`g9-guide__bubble-button-text${b === 'skip' ? ' g9-guide__bubble-button-text--quiet' : ''}`}\n >\n {b === 'next' ? texts.next : b === 'skip' ? texts.skip : texts.done}\n </text>\n </view>\n ))}\n </view>\n ) : null}\n <view\n className={`g9-guide__arrow g9-guide__arrow--${place.side}`}\n style={\n place.side === 'below' || place.side === 'above' || place.side === 'over'\n ? { left: px(place.arrow - 7) }\n : { top: px(place.arrow - 7) }\n }\n />\n </view>,\n );\n break;\n }\n }\n }\n return <>{out}</>;\n}\n\n/** Ends a mark with an outcome (the bubble's buttons, a tap on a modal scrim). */\nfunction endMark(service: G9GuideService, key: string, outcome: G9GuideOutcome): void {\n (service as unknown as { __end?: (k: string, o: G9GuideOutcome) => void }).__end?.(key, outcome);\n}\n"],"names":["FEATURE","SETTINGS_WAIT_MS","store","initial","value","listeners","Set","v","l","Array","isRect","t","sameRect","a","b","Math","createGuideService","host","provided","anchors","settings","settingsProvided","settingsWaiters","whenSettings","Promise","resolve","done","g9RuntimeTimers","timer","marks","Map","view1","confirmation","seq","tracking","publish","m","measure","target","anchorRect","end","key","outcome","track","rect","offRegistry","service","spec","_spec_key","settle","result","r","mark","undefined","revealAnchor","text1","options","_options_gesture","step","h","request","state","ok","present","presentConfirmSheet","_open_sheet","open","next","w","GuideLayer","guideServiceOf","_existing___settings","existing","resolveGuideSettings","useG9Guide","useG9Settings","useG9Host","g9Guide","g9Hosts","POINTER_SVG","fill","stroke","rgba","hex","opacity","fallback","n","Number","px","box","props","_service___settings","resolved","useMemo","useSyncExternalStore","node","useRef","frame","setFrame","useState","visible","useEffect","measureNode","_service_dispose","local","viewRect","generation","view","e","_e_detail","_e_detail1","f","MarkView","rtl","useG9Direction","texts","bubble","setBubble","finish","endMark","out","i","effect","k","_effect_padding","pad","hole","inflate","scrim","modal","scrimBands","band","radius","_effect_padding1","_effect_ring","_effect_color","_effect_opacity","_effect_gesture","size","p","placePointer","gesture","svg","_effect_corner","_effect_color1","corner","atEnd","x","y","text","_mark_spec_language","_effect_placement","_mark_spec_buttons","language","textIn","title","width","place","placeBubble","buttons","_service___end"],"mappings":";;;;;;;;;;;AAkIA,MAAMA,UAAU;AAEhB,MAAMC,mBAAmB;AAEzB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