@g9tm/lynxcontrols 1.5.0 → 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.
@@ -1 +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 { inflate, placeBubble, placePointer, scrimBands } from './placement';\nimport { formatGuideText, 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 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}\n\ninterface ConfirmState extends G9ConfirmRequest {\n readonly resolve: (ok: boolean) => void;\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 /** Asks the person to confirm a write: the changes, the source, a countdown on the confirm button. */\n confirm(request: G9ConfirmRequest): Promise<boolean>;\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\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): 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 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 confirmation.get()?.resolve(false);\n return new Promise<boolean>((resolve) => {\n const state: ConfirmState = {\n ...request,\n resolve: (ok) => {\n if (confirmation.get() === state) confirmation.set(null);\n resolve(ok);\n },\n };\n confirmation.set(state);\n });\n },\n };\n (service as unknown as { __end: typeof end }).__end = end;\n (service as unknown as Settable).__settings = (next) => {\n settings = next;\n };\n (service as { dispose?: () => void }).dispose = () => {\n offRegistry();\n for (const key of Array.from(marks.keys())) end(key, 'unmount');\n confirmation.get()?.resolve(false);\n };\n host.attachFeature(FEATURE, service);\n host.registerLayerItem('guide', { key: FEATURE, element: <GuideLayer service={service} /> });\n // Back ends the guide's confirmation first, then any mark (never a journey's place behind it).\n host.back.push(\n () => {\n const c = confirmation.get();\n if (c) {\n c.resolve(false);\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));\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 confirmation = useSyncExternalStore(\n (l) => service.confirmation.subscribe(l),\n () => service.confirmation.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 || confirmation !== null;\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 or confirmation: it is always newer than the sheet.\n const generation = `${marks.map((m) => m.key).join('|')}#${confirmation ? 'c' : ''}`;\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 {confirmation ? <ConfirmCard request={confirmation as ConfirmState} service={service} /> : null}\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\nfunction ConfirmCard(props: { readonly request: ConfirmState; readonly service: G9GuideService }): ReactNode {\n const { request, service } = props;\n const texts = service.settings.texts;\n const rtl = useG9Direction() === 'rtl';\n const [left, setLeft] = useState(request.seconds);\n useEffect(() => {\n setLeft(request.seconds);\n let n = request.seconds;\n let timer: unknown = null;\n const tick = () => {\n n -= 1;\n setLeft(n);\n if (n > 0) timer = g9RuntimeTimers.setTimeout(tick, 1000);\n };\n timer = g9RuntimeTimers.setTimeout(tick, 1000);\n return () => g9RuntimeTimers.clearTimeout(timer);\n }, [request]);\n const align = { textAlign: rtl ? ('right' as const) : ('left' as const) };\n const ready = left <= 0;\n return (\n <view className=\"g9-guide__confirm-scrim\" catchtap={() => undefined}>\n <view\n className=\"g9-guide__confirm\"\n style={{ direction: rtl ? 'rtl' : 'ltr' }}\n accessibility-element\n accessibility-label={request.title}\n >\n <text className=\"g9-guide__confirm-title\" style={align}>\n {request.title}\n </text>\n <text className=\"g9-guide__confirm-source\" style={align}>\n {texts.sources[request.source]}\n </text>\n {request.source === 'link' ? (\n <text className=\"g9-guide__confirm-warning\" style={align}>\n {texts.linkWarning}\n </text>\n ) : null}\n <text className=\"g9-guide__confirm-heading\" style={align}>\n {texts.changesTitle}\n </text>\n <view className=\"g9-guide__confirm-lines\">\n {(request.changes.length > 0\n ? request.changes\n : [{ action: 'other' as const, subject: texts.undescribed }]\n ).map((c, i) => (\n <view\n key={`c${i}`}\n className=\"g9-guide__confirm-line\"\n style={{ flexDirection: rtl ? 'row-reverse' : 'row', direction: 'ltr' }}\n >\n <text className={`g9-guide__confirm-verb g9-guide__confirm-verb--${c.action}`}>\n {texts.actions[c.action]}\n </text>\n <view className=\"g9-guide__confirm-line-body\">\n <text className=\"g9-guide__confirm-subject\" style={align}>\n {c.field ? `${c.subject} · ${c.field}` : c.subject}\n </text>\n {c.from !== undefined || c.to !== undefined ? (\n <text className=\"g9-guide__confirm-value\" style={align}>\n {`${c.from ?? '—'} → ${c.to ?? '—'}`}\n </text>\n ) : null}\n {c.note ? (\n <text className=\"g9-guide__confirm-note\" style={align}>\n {c.note}\n </text>\n ) : null}\n </view>\n </view>\n ))}\n </view>\n <view\n className=\"g9-guide__confirm-actions\"\n style={{ flexDirection: rtl ? 'row-reverse' : 'row', direction: 'ltr' }}\n >\n <view\n className=\"g9-guide__confirm-button g9-guide__confirm-button--cancel\"\n bindtap={() => request.resolve(false)}\n >\n <text className=\"g9-guide__confirm-button-text g9-guide__confirm-button-text--cancel\">{texts.cancel}</text>\n </view>\n <view\n className={`g9-guide__confirm-button${request.destructive ? ' g9-guide__confirm-button--danger' : ''}${ready ? '' : ' g9-guide__confirm-button--waiting'}`}\n bindtap={() => (ready ? request.resolve(true) : undefined)}\n accessibility-element\n accessibility-label={ready ? texts.confirm : formatGuideText(texts.confirmIn, left)}\n >\n <text className=\"g9-guide__confirm-button-text\">\n {ready ? texts.confirm : formatGuideText(texts.confirmIn, left)}\n </text>\n </view>\n </view>\n </view>\n </view>\n );\n}\n"],"names":["FEATURE","store","initial","value","listeners","Set","v","l","Array","isRect","t","sameRect","a","b","Math","createGuideService","host","anchors","settings","marks","Map","view1","confirmation","seq","tracking","publish","m","measure","target","anchorRect","end","key","outcome","g9RuntimeTimers","track","rect","offRegistry","service","spec","_spec_key","settle","result","Promise","r","mark","undefined","revealAnchor","text1","options","_options_gesture","step","h","request","_confirmation_get","resolve","state","ok","next","GuideLayer","c","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","provided","resolved","useMemo","useSyncExternalStore","node","useRef","frame","setFrame","useState","visible","useEffect","measureNode","_service_dispose","local","viewRect","generation","view","e","_e_detail","_e_detail1","w","f","MarkView","ConfirmCard","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","left","setLeft","timer","tick","align","ready","_c_from","_c_to","formatGuideText"],"mappings":";;;;;;;;;;AAyHA,MAAMA,UAAU;AAEhB,SAASC,MAASC,OAAU;IAC1B,IAAIC,QAAQD;IACZ,MAAME,YAAY,IAAIC;IACtB,OAAO;QACL,KAAK,IAAMF;QACX,KAAIG,CAAI;YACNH,QAAQG;YACR,KAAK,MAAMC,KAAKC,MAAM,IAAI,CAACJ,WAAYG;QACzC;QACA,WAAUA,CAAa;YACrBH,UAAU,GAAG,CAACG;YACd,OAAO;gBACLH,UAAU,MAAM,CAACG;YACnB;QACF;IACF;AACF;AAEA,MAAME,SAAS,CAACC,IAAwC,AAAa,YAAb,OAAOA,KAAkB,WAAWA;AAC5F,MAAMC,WAAW,CAACC,GAAwBC,IACxCD,MAAMC,KACL,CAAC,CAACD,KACD,CAAC,CAACC,KACFC,KAAK,GAAG,CAACF,EAAE,CAAC,GAAGC,EAAE,CAAC,IAAI,OACtBC,KAAK,GAAG,CAACF,EAAE,CAAC,GAAGC,EAAE,CAAC,IAAI,OACtBC,KAAK,GAAG,CAACF,EAAE,KAAK,GAAGC,EAAE,KAAK,IAAI,OAC9BC,KAAK,GAAG,CAACF,EAAE,MAAM,GAAGC,EAAE,MAAM,IAAI;AAEpC,SAASE,mBAAmBC,IAAkB,EAAEd,OAAgC;IAC9E,MAAMe,UAAUD,KAAK,OAAO;IAG5B,IAAIE,WAAWhB;IACf,MAAMiB,QAAQ,IAAIC;IAClB,MAAMC,QAAOpB,MAAmC,EAAE;IAClD,MAAMqB,eAAerB,MAA2B;IAChD,IAAIsB,MAAM;IACV,IAAIC,WAAoB;IAExB,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O,CAAC,QAChC;YACC,CAAC0F,KAAK,UAAU,uEAAuElC,MAAM,MAAM,GAAGkC,KAAK;UAC7G,EAAE5C,KAAK;UACP,CAACA,KACC,WAAW,CAAC,wBAAwB,EAAE9C,QAAQ,WAAW,GAAG,sCAAsC,KAAK2G,QAAQ,KAAK,sCAAsC,EAC1J,SAAS,IAAOA,QAAQ3G,QAAQ,OAAO,CAAC,QAAQP,QAChD,sBACA,qBAAqBkH,QAAQnD,MAAM,OAAO,GAAGsD,gBAAgBtD,MAAM,SAAS,EAAE8C,OAC/E;YACC,CAACZ,KAAK,UAAU,gCAAgC;cAC9C,CAACiB,QAAQnD,MAAM,OAAO,GAAGsD,gBAAgBtD,MAAM,SAAS,EAAE8C,MAAM;YAClE,EAAEZ,KAAK;UACT,EAAE5C,KAAK;QACT,EAAEA,KAAK;MACT,EAAEA,KAAK;IACT,EAAEA;AAEN"}
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,SAASC,MAASC,OAAU;IAC1B,IAAIC,QAAQD;IACZ,MAAME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sH;YAAAA,CAAAA,iBAAClH,QAA0E,KAAK,AAAD,KAA/EkH,eAAAA,IAAAA,CAAClH,SAAkFL,KAAKC;AAC1F"}
@@ -1,4 +1,5 @@
1
1
  import { type G9ConfirmTiming, type G9JourneySource } from '@g9tm/lynxcontrols-foundation';
2
+ import type { G9SheetOptions } from '../sheet/options.js';
2
3
  /** The guide's words (the app gives them in the person's language; defaults are English). */
3
4
  export interface G9GuideTexts {
4
5
  readonly next: string;
@@ -18,6 +19,11 @@ export interface G9GuideTexts {
18
19
  readonly undescribed: string;
19
20
  /** Added to a link's confirmation. */
20
21
  readonly linkWarning: string;
22
+ /**
23
+ * Where a press stands in a journey that presses more than one control: `{0}` = this press, `{1}` = how many the
24
+ * journey presses.
25
+ */
26
+ readonly confirmProgress: string;
21
27
  }
22
28
  /** App-wide guide settings (`G9Settings.guide`). */
23
29
  /** The guide's words an app supplies (any subset). */
@@ -35,6 +41,15 @@ export interface G9GuideSettings {
35
41
  readonly trackMs?: number;
36
42
  /** Per character of a value the guide types in front of the person (ms). Default 30, capped at 1200 per field. */
37
43
  readonly typeMsPerChar?: number;
44
+ /**
45
+ * The confirmation sheet's options over the guide's own (a fit-to-content sheet up to 75 % of the screen, the title in
46
+ * the header, the close button): an app gives its own sheet look here — a background, the close icon. The title, the
47
+ * footer buttons and the body are the guide's. A function is read at every confirmation (a colour that follows the
48
+ * theme).
49
+ */
50
+ readonly confirmSheet?: G9SheetOptions | (() => G9SheetOptions);
51
+ /** The text size of the confirmation's two footer buttons (the app's footer buttons). Default the hero button's. */
52
+ readonly confirmButtonFontSize?: number;
38
53
  }
39
54
  /** The guide settings with every default filled in. */
40
55
  export interface G9ResolvedGuideSettings {
@@ -42,9 +57,12 @@ export interface G9ResolvedGuideSettings {
42
57
  readonly confirm: G9ConfirmTiming;
43
58
  readonly trackMs: number;
44
59
  readonly typeMsPerChar: number;
60
+ /** The app's sheet options for the confirmation, read when one opens. */
61
+ readonly confirmSheet: () => G9SheetOptions;
62
+ readonly confirmButtonFontSize: number | null;
45
63
  }
46
64
  /** The guide settings with their defaults. */
47
65
  export declare function resolveGuideSettings(s: G9GuideSettings | undefined): G9ResolvedGuideSettings;
48
- /** `{0}` replaced. */
49
- export declare function formatGuideText(template: string, value: string | number): string;
66
+ /** `{0}`, `{1}`… replaced by the values in order. */
67
+ export declare function formatGuideText(template: string, ...values: ReadonlyArray<string | number>): string;
50
68
  //# sourceMappingURL=settings.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/guide/settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,eAAe,EAA2B,MAAM,+BAA+B,CAAC;AAEpH,6FAA6F;AAC7F,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,oEAAoE;IACpE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,mDAAmD;IACnD,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,CAAC;IAC5D,uCAAuC;IACvC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;IAC9F,yDAAyD;IACzD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,sCAAsC;IACtC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAA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This request came from outside the app. Confirm only if you expected it.'
26
+ linkWarning: 'This request came from outside the app. Confirm only if you expected it.',
27
+ confirmProgress: 'Press {0} of {1} in this journey'
27
28
  };
28
29
  function resolveGuideSettings(s) {
29
30
  const source = null == s ? void 0 : s.texts;
@@ -49,11 +50,16 @@ function resolveGuideSettings(s) {
49
50
  ...null == s ? void 0 : s.confirm
50
51
  },
51
52
  trackMs: (null == s ? void 0 : s.trackMs) && s.trackMs > 0 ? s.trackMs : 250,
52
- typeMsPerChar: (null == s ? void 0 : s.typeMsPerChar) !== void 0 && s.typeMsPerChar >= 0 ? s.typeMsPerChar : 30
53
+ typeMsPerChar: (null == s ? void 0 : s.typeMsPerChar) !== void 0 && s.typeMsPerChar >= 0 ? s.typeMsPerChar : 30,
54
+ confirmSheet: (()=>{
55
+ const own = null == s ? void 0 : s.confirmSheet;
56
+ return 'function' == typeof own ? own : ()=>null != own ? own : {};
57
+ })(),
58
+ confirmButtonFontSize: (null == s ? void 0 : s.confirmButtonFontSize) !== void 0 && s.confirmButtonFontSize > 0 ? s.confirmButtonFontSize : null
53
59
  };
54
60
  }
55
- function formatGuideText(template, value) {
56
- return template.split('{0}').join(String(value));
61
+ function formatGuideText(template, ...values) {
62
+ return values.reduce((t, v, i)=>t.split(`{${i}}`).join(String(v)), template);
57
63
  }
58
64
  export { formatGuideText, resolveGuideSettings };
59
65
 
@@ -1 +1 @@
1
- {"version":3,"file":"guide/settings.jsx","sources":["../../src/guide/settings.ts"],"sourcesContent":["import { type G9ConfirmTiming, type G9JourneySource, g9ConfirmTimingDefaults } from '@g9tm/lynxcontrols-foundation';\n\n/** The guide's words (the app gives them in the person's language; defaults are English). */\nexport interface G9GuideTexts {\n readonly next: string;\n readonly done: string;\n readonly skip: string;\n readonly endGuide: string;\n readonly cancel: string;\n /** The confirm button while counting down: `{0}` = seconds left. */\n readonly confirmIn: string;\n readonly confirm: string;\n readonly changesTitle: string;\n /** Who asked for the change, by journey source. */\n readonly sources: Readonly<Record<G9JourneySource, string>>;\n /** A change line's verb, by action. */\n readonly actions: Readonly<Record<'create' | 'update' | 'delete' | 'send' | 'other', string>>;\n /** Shown when a place could not say what will change. */\n readonly undescribed: string;\n /** Added to a link's confirmation. */\n readonly linkWarning: string;\n}\n\n/** App-wide guide settings (`G9Settings.guide`). */\n/** The guide's words an app supplies (any subset). */\nexport type G9GuideTextOverrides = Partial<Omit<G9GuideTexts, 'sources' | 'actions'>> & {\n readonly sources?: Partial<G9GuideTexts['sources']>;\n readonly actions?: Partial<G9GuideTexts['actions']>;\n};\n\n/** App-wide guide settings (`G9Settings.guide`): words, countdowns, tracking and typing speed. */\nexport interface G9GuideSettings {\n /** The words, or a function read at every render (so a language switch shows at once). */\n readonly texts?: G9GuideTextOverrides | (() => G9GuideTextOverrides);\n /** Countdown lengths of the guided-save confirmation. */\n readonly confirm?: Partial<G9ConfirmTiming>;\n /** How often a shown mark re-measures its target while nothing else told it to (ms). Default 250. */\n readonly trackMs?: number;\n /** Per character of a value the guide types in front of the person (ms). Default 30, capped at 1200 per field. */\n readonly typeMsPerChar?: number;\n}\n\n/** The guide settings with every default filled in. */\nexport interface G9ResolvedGuideSettings {\n readonly texts: G9GuideTexts;\n readonly confirm: G9ConfirmTiming;\n readonly trackMs: number;\n readonly typeMsPerChar: number;\n}\n\nconst ENGLISH: G9GuideTexts = {\n next: 'Next',\n done: 'Done',\n skip: 'Skip',\n endGuide: 'End guide',\n cancel: 'Cancel',\n confirmIn: 'Confirm ({0})',\n confirm: 'Confirm',\n changesTitle: 'What will change',\n sources: {\n bundled: 'The app’s guide',\n assistant: 'The assistant',\n link: 'A link from outside the app',\n tester: 'A test',\n qa: 'Automation',\n },\n actions: { create: 'New', update: 'Change', delete: 'Delete', send: 'Send', other: 'Other' },\n undescribed: 'The changes of this form will be saved.',\n linkWarning: 'This request came from outside the app. Confirm only if you expected it.',\n};\n\n/** The guide settings with their defaults. */\nexport function resolveGuideSettings(s: G9GuideSettings | undefined): G9ResolvedGuideSettings {\n const source = s?.texts;\n const merge = (t: G9GuideTextOverrides): G9GuideTexts => ({\n ...ENGLISH,\n ...t,\n sources: { ...ENGLISH.sources, ...t.sources },\n actions: { ...ENGLISH.actions, ...t.actions },\n });\n const fixed = typeof source === 'function' ? null : merge(source ?? {});\n return {\n get texts() {\n return fixed ?? merge((source as () => G9GuideTextOverrides)());\n },\n confirm: { ...g9ConfirmTimingDefaults, ...s?.confirm },\n trackMs: s?.trackMs && s.trackMs > 0 ? s.trackMs : 250,\n typeMsPerChar: s?.typeMsPerChar !== undefined && s.typeMsPerChar >= 0 ? s.typeMsPerChar : 30,\n };\n}\n\n/** `{0}` replaced. */\nexport function formatGuideText(template: string, value: string | number): string {\n return template.split('{0}').join(String(value));\n}\n"],"names":["ENGLISH","resolveGuideSettings","s","source","merge","t","fixed","g9ConfirmTimingDefaults","undefined","formatGuideText","template","value","String"],"mappings":";AAkDA,MAAMA,UAAwB;IAC5B,MAAM;IACN,MAAM;IACN,MAAM;IACN,UAAU;IACV,QAAQ;IACR,WAAW;IACX,SAAS;IACT,cAAc;IACd,SAAS;QACP,SAAS;QACT,WAAW;QACX,MAAM;QACN,QAAQ;QACR,IAAI;IACN;IACA,SAAS;QAAE,QAAQ;QAAO,QAAQ;QAAU,QAAQ;QAAU,MAAM;QAAQ,OAAO;IAAQ;IAC3F,aAAa;IACb,aAAa;AACf;AAGO,SAASC,qBAAqBC,CAA8B;IACjE,MAAMC,SAASD,QAAAA,IAAAA,KAAAA,IAAAA,EAAG,KAAK;IACvB,MAAME,QAAQ,CAACC,IAA2C;YACxD,GAAGL,OAAO;YACV,GAAGK,CAAC;YACJ,SAAS;gBAAE,GAAGL,QAAQ,OAAO;gBAAE,GAAGK,EAAE,OAAO;YAAC;YAC5C,SAAS;gBAAE,GAAGL,QAAQ,OAAO;gBAAE,GAAGK,EAAE,OAAO;YAAC;QAC9C;IACA,MAAMC,QAAQ,AAAkB,cAAlB,OAAOH,SAAwB,OAAOC,MAAMD,QAAAA,SAAAA,SAAU,CAAC;IACrE,OAAO;QACL,IAAI;YACF,OAAOG,QAAAA,QAAAA,QAASF,MAAOD;QACzB;QACA,SAAS;YAAE,GAAGI,uBAAuB;eAAKL,QAAAA,IAAAA,KAAAA,IAAAA,EAAG,OAAN;QAAc;QACrD,SAASA,AAAAA,CAAAA,QAAAA,IAAAA,KAAAA,IAAAA,EAAG,OAAO,AAAD,KAAKA,EAAE,OAAO,GAAG,IAAIA,EAAE,OAAO,GAAG;QACnD,eAAeA,AAAAA,CAAAA,QAAAA,IAAAA,KAAAA,IAAAA,EAAG,aAAa,AAAD,MAAMM,UAAaN,EAAE,aAAa,IAAI,IAAIA,EAAE,aAAa,GAAG;IAC5F;AACF;AAGO,SAASO,gBAAgBC,QAAgB,EAAEC,KAAsB;IACtE,OAAOD,SAAS,KAAK,CAAC,OAAO,IAAI,CAACE,OAAOD;AAC3C"}
1
+ {"version":3,"file":"guide/settings.jsx","sources":["../../src/guide/settings.ts"],"sourcesContent":["import { type G9ConfirmTiming, type G9JourneySource, g9ConfirmTimingDefaults } from '@g9tm/lynxcontrols-foundation';\nimport type { G9SheetOptions } from '../sheet/options';\n\n/** The guide's words (the app gives them in the person's language; defaults are English). */\nexport interface G9GuideTexts {\n readonly next: string;\n readonly done: string;\n readonly skip: string;\n readonly endGuide: string;\n readonly cancel: string;\n /** The confirm button while counting down: `{0}` = seconds left. */\n readonly confirmIn: string;\n readonly confirm: string;\n readonly changesTitle: string;\n /** Who asked for the change, by journey source. */\n readonly sources: Readonly<Record<G9JourneySource, string>>;\n /** A change line's verb, by action. */\n readonly actions: Readonly<Record<'create' | 'update' | 'delete' | 'send' | 'other', string>>;\n /** Shown when a place could not say what will change. */\n readonly undescribed: string;\n /** Added to a link's confirmation. */\n readonly linkWarning: string;\n /**\n * Where a press stands in a journey that presses more than one control: `{0}` = this press, `{1}` = how many the\n * journey presses.\n */\n readonly confirmProgress: string;\n}\n\n/** App-wide guide settings (`G9Settings.guide`). */\n/** The guide's words an app supplies (any subset). */\nexport type G9GuideTextOverrides = Partial<Omit<G9GuideTexts, 'sources' | 'actions'>> & {\n readonly sources?: Partial<G9GuideTexts['sources']>;\n readonly actions?: Partial<G9GuideTexts['actions']>;\n};\n\n/** App-wide guide settings (`G9Settings.guide`): words, countdowns, tracking and typing speed. */\nexport interface G9GuideSettings {\n /** The words, or a function read at every render (so a language switch shows at once). */\n readonly texts?: G9GuideTextOverrides | (() => G9GuideTextOverrides);\n /** Countdown lengths of the guided-save confirmation. */\n readonly confirm?: Partial<G9ConfirmTiming>;\n /** How often a shown mark re-measures its target while nothing else told it to (ms). Default 250. */\n readonly trackMs?: number;\n /** Per character of a value the guide types in front of the person (ms). Default 30, capped at 1200 per field. */\n readonly typeMsPerChar?: number;\n /**\n * The confirmation sheet's options over the guide's own (a fit-to-content sheet up to 75 % of the screen, the title in\n * the header, the close button): an app gives its own sheet look here — a background, the close icon. The title, the\n * footer buttons and the body are the guide's. A function is read at every confirmation (a colour that follows the\n * theme).\n */\n readonly confirmSheet?: G9SheetOptions | (() => G9SheetOptions);\n /** The text size of the confirmation's two footer buttons (the app's footer buttons). Default the hero button's. */\n readonly confirmButtonFontSize?: number;\n}\n\n/** The guide settings with every default filled in. */\nexport interface G9ResolvedGuideSettings {\n readonly texts: G9GuideTexts;\n readonly confirm: G9ConfirmTiming;\n readonly trackMs: number;\n readonly typeMsPerChar: number;\n /** The app's sheet options for the confirmation, read when one opens. */\n readonly confirmSheet: () => G9SheetOptions;\n readonly confirmButtonFontSize: number | null;\n}\n\nconst ENGLISH: G9GuideTexts = {\n next: 'Next',\n done: 'Done',\n skip: 'Skip',\n endGuide: 'End guide',\n cancel: 'Cancel',\n confirmIn: 'Confirm ({0})',\n confirm: 'Confirm',\n changesTitle: 'What will change',\n sources: {\n bundled: 'The app’s guide',\n assistant: 'The assistant',\n link: 'A link from outside the app',\n tester: 'A test',\n qa: 'Automation',\n },\n actions: { create: 'New', update: 'Change', delete: 'Delete', send: 'Send', other: 'Other' },\n undescribed: 'The changes of this form will be saved.',\n linkWarning: 'This request came from outside the app. Confirm only if you expected it.',\n confirmProgress: 'Press {0} of {1} in this journey',\n};\n\n/** The guide settings with their defaults. */\nexport function resolveGuideSettings(s: G9GuideSettings | undefined): G9ResolvedGuideSettings {\n const source = s?.texts;\n const merge = (t: G9GuideTextOverrides): G9GuideTexts => ({\n ...ENGLISH,\n ...t,\n sources: { ...ENGLISH.sources, ...t.sources },\n actions: { ...ENGLISH.actions, ...t.actions },\n });\n const fixed = typeof source === 'function' ? null : merge(source ?? {});\n return {\n get texts() {\n return fixed ?? merge((source as () => G9GuideTextOverrides)());\n },\n confirm: { ...g9ConfirmTimingDefaults, ...s?.confirm },\n trackMs: s?.trackMs && s.trackMs > 0 ? s.trackMs : 250,\n typeMsPerChar: s?.typeMsPerChar !== undefined && s.typeMsPerChar >= 0 ? s.typeMsPerChar : 30,\n confirmSheet: (() => {\n const own = s?.confirmSheet;\n return typeof own === 'function' ? own : () => own ?? {};\n })(),\n confirmButtonFontSize:\n s?.confirmButtonFontSize !== undefined && s.confirmButtonFontSize > 0 ? s.confirmButtonFontSize : null,\n };\n}\n\n/** `{0}`, `{1}`… replaced by the values in order. */\nexport function formatGuideText(template: string, ...values: ReadonlyArray<string | number>): string {\n return values.reduce<string>((t, v, i) => t.split(`{${i}}`).join(String(v)), template);\n}\n"],"names":["ENGLISH","resolveGuideSettings","s","source","merge","t","fixed","g9ConfirmTimingDefaults","undefined","own","formatGuideText","template","values","v","i","String"],"mappings":";AAoEA,MAAMA,UAAwB;IAC5B,MAAM;IACN,MAAM;IACN,MAAM;IACN,UAAU;IACV,QAAQ;IACR,WAAW;IACX,SAAS;IACT,cAAc;IACd,SAAS;QACP,SAAS;QACT,WAAW;QACX,MAAM;QACN,QAAQ;QACR,IAAI;IACN;IACA,SAAS;QAAE,QAAQ;QAAO,QAAQ;QAAU,QAAQ;QAAU,MAAM;QAAQ,OAAO;IAAQ;IAC3F,aAAa;IACb,aAAa;IACb,iBAAiB;AACnB;A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AMT,EAAE,KAAK,CAAC,CAAC,CAAC,EAAES,EAAE,CAAC,CAAC,EAAE,IAAI,CAACC,OAAOF,KAAKF;AAC/E"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@g9tm/lynxcontrols",
3
- "version": "1.5.0",
3
+ "version": "1.6.0",
4
4
  "description": "ReactLynx controls and overlay infrastructure: provider/host, sheets, popups, toasts, fields, buttons, pickers, tab view, tab bar, edge panel, swipe rows.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -152,7 +152,7 @@
152
152
  "build": "rslib build"
153
153
  },
154
154
  "dependencies": {
155
- "@g9tm/lynxcontrols-foundation": "1.5.0",
155
+ "@g9tm/lynxcontrols-foundation": "1.6.0",
156
156
  "@lynx-js/lynx-ui-common": "3.139.0",
157
157
  "@lynx-js/lynx-ui-deferred-component": "3.139.0",
158
158
  "@lynx-js/lynx-ui-draggable": "3.139.0",