@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/journey.jsx","sources":["../../src/guide/journey.ts"],"sourcesContent":["import {\n confirmSeconds,\n type G9AnchorRisk,\n type G9GuideEffectSpec,\n type G9Journey,\n type G9JourneySource,\n type G9JourneyStep,\n type G9Snapshot,\n type G9StepAuthority,\n type G9Until,\n type G9WaitFor,\n g9RuntimeTimers,\n journeyAuthority,\n matchesAddress,\n textIn,\n tryParseAddress,\n} from '@g9tm/lynxcontrols-foundation';\nimport { windowRect } from '../anchor/measure';\nimport type { G9AnchorEntry } from '../anchor/registry';\nimport { revealAnchor } from '../anchor/scroll';\nimport type { G9Router } from '../route/router';\nimport type { G9GuideHandle, G9GuideOutcome, G9GuideService, G9GuideSpec } from './service';\n\n// Runs a journey on screen. Who may do what is the SOURCE policy (foundation `journeyAuthority`), read with the CALLER's\n// source — a journey cannot raise its own rights: navigation, showing and filling a form are the engine's; pressing a\n// control that saves or deletes waits for the person's confirmation behind a countdown, with every change listed; a\n// step the policy keeps from the engine falls to the person (the finger points, the guide waits). Every step ends with\n// a result; a failure stops the journey with its reason (no retries, no loops). Back ends the journey.\n\n/** What a journey runs with: the trusted source, the language, the guide and the router. */\nexport interface G9JourneyRunOptions {\n /** Who started it (trusted: the app decides, never the journey). */\n readonly source: G9JourneySource;\n readonly language: 'fa' | 'en';\n readonly guide: G9GuideService;\n readonly router?: G9Router | null;\n /** Make the policy stricter for a step (an app may never make it looser). */\n readonly authority?: (step: G9JourneyStep, risk: G9AnchorRisk) => G9StepAuthority | null;\n /** How long a person's step may take before the journey stops (ms). Default 120000. */\n readonly personTimeoutMs?: number;\n}\n\n/** The phase of a running journey. */\nexport type G9JourneyStatus = 'running' | 'waiting' | 'done' | 'failed' | 'cancelled';\n\n/** Where a running journey is. */\nexport interface G9JourneyState {\n readonly index: number;\n readonly status: G9JourneyStatus;\n /** Steps the policy gave to the person instead of the engine. */\n readonly downgraded: readonly number[];\n}\n\n/** How a journey ended: `ok`, or the step it stopped at and why. */\nexport interface G9JourneyResult {\n readonly ok: boolean;\n readonly failedAt?: number;\n readonly reason?: string;\n readonly message?: string;\n}\n\n/** A running journey: its state, «next» for a manual pace, cancel, and its result. */\nexport interface G9JourneyRun {\n readonly journey: G9Journey;\n readonly state: { get(): G9JourneyState; subscribe(l: () => void): () => void };\n /** The «next» of a manual journey (or of the bubble). */\n next(): void;\n cancel(): void;\n readonly result: Promise<G9JourneyResult>;\n}\n\nclass Stopped extends Error {\n constructor(\n readonly reason: string,\n message: string,\n ) {\n super(message);\n }\n}\n\nconst sleep = (ms: number) => new Promise<void>((r) => g9RuntimeTimers.setTimeout(r, ms));\nconst RANK: Readonly<Record<G9StepAuthority, number>> = { engine: 0, 'engine-confirm': 1, user: 2 };\n\n/** Starts a journey (validate untrusted JSON with `validateJourney` first). */\nexport function runJourney(journey: G9Journey, options: G9JourneyRunOptions): G9JourneyRun {\n const { guide, router, language, source } = options;\n const anchors = guide.anchors;\n const personTimeout = options.personTimeoutMs ?? 120000;\n let state: G9JourneyState = { index: 0, status: 'running', downgraded: [] };\n const listeners = new Set<() => void>();\n const set = (patch: Partial<G9JourneyState>) => {\n state = { ...state, ...patch };\n for (const l of Array.from(listeners)) l();\n };\n let cancelled = false;\n let nextWaiter: (() => void) | null = null;\n const marks = new Set<G9GuideHandle>();\n const cancelHooks = new Set<() => void>();\n\n const show = (spec: G9GuideSpec): G9GuideHandle => {\n const h = guide.show({ language, ...spec });\n marks.add(h);\n void h.result.then(() => marks.delete(h));\n return h;\n };\n const text = (t: Parameters<typeof textIn>[0] | undefined) => (t === undefined ? '' : textIn(t, language));\n const check = () => {\n if (cancelled) throw new Stopped('cancelled', 'cancelled');\n };\n\n /** Resolves on the first of: a condition met (polled), the run's «next», a cancel, a timeout. */\n const until = (\n condition: (() => boolean | Promise<boolean>) | null,\n timeoutMs: number,\n mark: G9GuideHandle | null,\n ): Promise<'met' | 'next' | 'timeout' | 'cancelled' | G9GuideOutcome> =>\n new Promise((resolve) => {\n let done = false;\n let poll: unknown = null;\n const finish = (why: 'met' | 'next' | 'timeout' | 'cancelled' | G9GuideOutcome) => {\n if (done) return;\n done = true;\n g9RuntimeTimers.clearTimeout(timer);\n if (poll !== null) g9RuntimeTimers.clearTimeout(poll);\n cancelHooks.delete(onCancel);\n if (nextWaiter === onNext) nextWaiter = null;\n resolve(why);\n };\n const onCancel = () => finish('cancelled');\n const onNext = () => finish('next');\n cancelHooks.add(onCancel);\n nextWaiter = onNext;\n const timer = g9RuntimeTimers.setTimeout(() => finish('timeout'), timeoutMs);\n void mark?.result.then((o) =>\n o === 'next' || o === 'done' || o === 'skip' || o === 'tapped'\n ? finish('next')\n : o === 'target-lost'\n ? finish('target-lost')\n : // Hidden by someone else (Android back ends the guide), or the host went away: the journey stops.\n o === 'hidden' || o === 'unmount'\n ? finish('cancelled')\n : undefined,\n );\n if (condition) {\n const tick = async () => {\n poll = null;\n if (done) return;\n let met = false;\n try {\n met = await condition();\n } catch {\n met = false;\n }\n if (met) finish('met');\n else if (!done) poll = g9RuntimeTimers.setTimeout(() => void tick(), 250);\n };\n void tick();\n }\n });\n\n const anchorFor = async (id: string): Promise<G9AnchorEntry> => {\n const r = await revealAnchor(anchors, id, { smooth: true });\n if (!r.anchor) throw new Stopped('not-found', `The control \"${id}\" is not on screen.`);\n return r.anchor;\n };\n\n const routeMet = (pattern: string) => () => {\n const here = router?.where().unique ?? '';\n return here === pattern || (tryParseAddress(here).ok && safeMatch(here, pattern));\n };\n\n const valueMet = (target: string, equals: string | undefined, start: string | null | undefined) => () => {\n const v = anchors.find(target)?.info().capabilities?.getValue?.();\n return equals === undefined ? v !== start : v === equals;\n };\n\n const untilOf = async (u: G9Until | undefined, mark: G9GuideHandle | null, fallbackNext: boolean) => {\n if (u === undefined || u === 'next' || u === 'tap') return until(null, personTimeout, mark);\n if ('ms' in u) {\n await sleep(u.ms);\n return 'met';\n }\n if ('route' in u) return until(routeMet(u.route), personTimeout, fallbackNext ? mark : null);\n const start = anchors.find(u.value.target)?.info().capabilities?.getValue?.();\n return until(valueMet(u.value.target, u.value.equals, start), personTimeout, fallbackNext ? mark : null);\n };\n\n const authorityOf = (\n step: G9JourneyStep,\n action: 'navigate' | 'fill' | 'press',\n risk: G9AnchorRisk,\n ): G9StepAuthority => {\n const base = journeyAuthority(source, action, risk);\n const app = options.authority?.(step, risk) ?? null;\n return app && RANK[app] > RANK[base] ? app : base;\n };\n\n const point = (target: string, words: string, gesture: 'tap' | 'longPress' = 'tap') =>\n show({\n target,\n effects: [\n { type: 'spotlight' },\n { type: 'highlight', pulse: true, opacity: 0.08 },\n { type: 'pointer', gesture },\n ...(words ? [{ type: 'caption' as const, text: words }] : []),\n ],\n buttons: ['next'],\n });\n\n const steps: Record<G9JourneyStep['do'], (step: never, index: number) => Promise<void>> = {\n go: async (step: Extract<G9JourneyStep, { do: 'go' }>) => {\n if (!router) throw new Stopped('no-router', 'There is no router to go with.');\n const by = step.by ?? 'jump';\n const r =\n by === 'jump'\n ? await router.go(step.to, {\n source: source === 'link' ? 'link' : source === 'assistant' ? 'assistant' : 'user',\n })\n : await router.walk(step.to, { by, presenter: guide.presenter() }).result;\n if (!r.ok) throw new Stopped(r.reason, r.message);\n },\n show: async (step: Extract<G9JourneyStep, { do: 'show' }>) => {\n const effects: G9GuideEffectSpec[] = step.effects\n ? step.effects.slice()\n : [{ type: 'spotlight' }, { type: 'highlight', pulse: true, opacity: 0.08 }];\n if (step.text && !effects.some((e) => e.type === 'caption')) effects.push({ type: 'caption', text: step.text });\n const m = show({ target: step.target, effects, buttons: ['next'] });\n const why = await untilOf(step.until, m, true);\n m.hide();\n if (why === 'cancelled') throw new Stopped('cancelled', 'cancelled');\n if (why === 'timeout' || why === 'target-lost')\n throw new Stopped(\n why,\n `\"${step.target}\" ${why === 'timeout' ? 'was not reached in time' : 'left the screen'}.`,\n );\n },\n say: async (step: Extract<G9JourneyStep, { do: 'say' }>) => {\n const w = windowRect();\n const m = show({\n target: { x: w.width / 2 - 1, y: w.height * 0.42, width: 2, height: 2 },\n effects: [{ type: 'caption', text: step.text, placement: 'below' }],\n buttons: ['next'],\n reveal: false,\n });\n const why = await untilOf(step.until, m, true);\n m.hide();\n if (why === 'cancelled') throw new Stopped('cancelled', 'cancelled');\n if (why === 'timeout') throw new Stopped('timeout', 'No answer in time.');\n },\n fill: async (step: Extract<G9JourneyStep, { do: 'fill' }>, index: number) => {\n const anchor = await anchorFor(step.target);\n const caps = anchor.info().capabilities;\n if (step.by === 'user' || !caps?.setValue) {\n if (step.by !== 'user') set({ downgraded: [...state.downgraded, index] });\n const m = point(step.target, step.value);\n const why = await until(valueMet(step.target, step.value, null), personTimeout, m);\n m.hide();\n if (why === 'cancelled') throw new Stopped('cancelled', 'cancelled');\n if (why === 'timeout') throw new Stopped('timeout', `\"${step.target}\" was not filled in time.`);\n return;\n }\n const m = show({ target: step.target, effects: [{ type: 'highlight', pulse: true }], reveal: false });\n try {\n await caps.focus?.();\n const chars = Array.from(step.value);\n const per = Math.min(guide.settings.typeMsPerChar, chars.length > 0 ? 1200 / chars.length : 0);\n if (per > 0) {\n for (let i = 1; i < chars.length; i++) {\n check();\n await caps.setValue(chars.slice(0, i).join(''));\n await sleep(per);\n }\n }\n check();\n await caps.setValue(step.value);\n } finally {\n m.hide();\n }\n const read = caps.getValue?.();\n if (read !== undefined && read !== null && read !== step.value)\n throw new Stopped('failed', `\"${step.target}\" holds \"${read}\", not the value given.`);\n },\n select: async (step: Extract<G9JourneyStep, { do: 'select' }>, index: number) => {\n const anchor = await anchorFor(step.target);\n const caps = anchor.info().capabilities;\n const has = () => (caps?.getValue?.() ?? '').split(',').indexOf(step.item) >= 0;\n if (step.by === 'user' || !caps?.selectItem) {\n if (step.by !== 'user') set({ downgraded: [...state.downgraded, index] });\n const m = point(step.target, '');\n const why = await until(has, personTimeout, m);\n m.hide();\n if (why === 'cancelled') throw new Stopped('cancelled', 'cancelled');\n if (why === 'timeout') throw new Stopped('timeout', `\"${step.item}\" was not picked in time.`);\n return;\n }\n await caps.selectItem(step.item);\n if (caps.getValue && !has()) throw new Stopped('failed', `\"${step.target}\" did not take \"${step.item}\".`);\n },\n press: async (step: Extract<G9JourneyStep, { do: 'press' }>, index: number) => {\n const anchor = await anchorFor(step.target);\n const info = anchor.info();\n const risk = info.risk ?? 'none';\n const authority = authorityOf(step, 'press', risk);\n const label = text(step.text) || info.label?.() || step.target;\n const byPerson = step.by === 'user' || authority === 'user' || !info.capabilities?.activate;\n if (byPerson) {\n if (step.by === 'engine') set({ downgraded: [...state.downgraded, index] });\n const before = router?.where().revision ?? -1;\n const m = point(step.target, label);\n const why = await until(\n () => (router ? router.where().revision !== before : false) || !anchors.find(step.target),\n personTimeout,\n m,\n );\n m.hide();\n if (why === 'cancelled') throw new Stopped('cancelled', 'cancelled');\n if (why === 'timeout') throw new Stopped('timeout', `\"${label}\" was not pressed in time.`);\n return;\n }\n if (authority === 'engine-confirm' && risk !== 'none') {\n const changes = info.changes?.() ?? lastPlaceChanges(router) ?? [];\n const seconds = confirmSeconds(source, risk, changes.length > 0, guide.settings.confirm);\n const hl = show({ target: step.target, effects: [{ type: 'highlight', pulse: true }], reveal: false });\n let ok = false;\n try {\n ok = await guide.confirm({ title: label, source, changes, seconds, destructive: risk === 'destructive' });\n } finally {\n hl.hide();\n }\n if (!ok) throw new Stopped('declined', 'The person did not confirm.');\n }\n check();\n show({ target: step.target, effects: [{ type: 'ripple' }], timeoutMs: 600, reveal: false });\n await info.capabilities?.activate?.();\n },\n wait: async (step: Extract<G9JourneyStep, { do: 'wait' }>) => {\n const f: G9WaitFor = step.for;\n const conditions: Array<() => boolean> = [];\n if (f.route) conditions.push(routeMet(f.route));\n if (f.anchor) {\n const id = f.anchor;\n conditions.push(() => !!anchors.find(id));\n }\n if (f.value)\n conditions.push(\n valueMet(f.value.target, f.value.equals, anchors.find(f.value.target)?.info().capabilities?.getValue?.()),\n );\n if (f.ms !== undefined && conditions.length === 0) {\n await sleep(f.ms);\n return;\n }\n const why = await until(() => conditions.some((c) => c()), step.timeoutMs ?? 30000, null);\n if (why === 'cancelled') throw new Stopped('cancelled', 'cancelled');\n if (why === 'timeout') throw new Stopped('timeout', 'What the journey waited for did not happen.');\n },\n back: async () => {\n if (!router || !origin) throw new Stopped('no-router', 'There is nowhere to come back to.');\n const r = await router.restore(origin);\n if (!r.ok) throw new Stopped(r.reason, r.message);\n },\n };\n\n let origin: G9Snapshot | null = null;\n const result = (async (): Promise<G9JourneyResult> => {\n try {\n if (router && journey.steps.some((s) => s.do === 'back')) origin = await router.snapshotWithScroll();\n for (let i = 0; i < journey.steps.length; i++) {\n check();\n set({ index: i, status: 'running' });\n const step = journey.steps[i] as G9JourneyStep;\n await (steps[step.do] as (s: G9JourneyStep, i: number) => Promise<void>)(step, i);\n if (journey.pace === 'manual' && i < journey.steps.length - 1) {\n set({ status: 'waiting' });\n const why = await until(null, personTimeout, null);\n if (why === 'cancelled') throw new Stopped('cancelled', 'cancelled');\n }\n }\n set({ status: 'done' });\n return { ok: true };\n } catch (error) {\n const stopped =\n error instanceof Stopped ? error : new Stopped('failed', String((error as Error)?.message ?? error));\n set({ status: stopped.reason === 'cancelled' ? 'cancelled' : 'failed' });\n return { ok: false, failedAt: state.index, reason: stopped.reason, message: stopped.message };\n } finally {\n for (const m of Array.from(marks)) m.hide();\n }\n })();\n\n return {\n journey,\n state: {\n get: () => state,\n subscribe(l) {\n listeners.add(l);\n return () => {\n listeners.delete(l);\n };\n },\n },\n next() {\n nextWaiter?.();\n },\n cancel() {\n cancelled = true;\n for (const h of Array.from(cancelHooks)) h();\n for (const m of Array.from(marks)) m.hide();\n },\n result,\n };\n}\n\nfunction safeMatch(address: string, pattern: string): boolean {\n try {\n return matchesAddress(address, pattern);\n } catch {\n return false;\n }\n}\n\nfunction lastPlaceChanges(router: G9Router | null | undefined) {\n if (!router) return null;\n const n = router.where().segments.length;\n for (let i = n - 1; i >= 0; i--) {\n const d = router.placeAt(i)?.describeChanges?.();\n if (d && d.length > 0) return d;\n }\n return null;\n}\n"],"names":["Stopped","Error","reason","message","sleep","ms","Promise","r","g9RuntimeTimers","RANK","runJourney","journey","options","_options_personTimeoutMs","guide","router","language","source","anchors","personTimeout","state","listeners","Set","set","patch","l","Array","cancelled","nextWaiter","marks","cancelHooks","show","spec","h","text","t","undefined","textIn","check","until","condition","timeoutMs","mark","resolve","done","poll","finish","why","timer","onCancel","onNext","o","tick","met","anchorFor","id","revealAnchor","routeMet","pattern","here","tryParseAddress","safeMatch","valueMet","target","equals","start","_anchors_find_info_capabilities","v","untilOf","u","fallbackNext","authorityOf","step","action","risk","base","journeyAuthority","app","point","words","gesture","steps","_step_by","by","effects","e","m","w","windowRect","index","caps","anchor","chars","per","Math","i","read","has","_info_risk","info","_info_capabilities","_info_capabilities1","authority","label","byPerson","before","_ref1","changes","lastPlaceChanges","seconds","confirmSeconds","hl","ok","_step_timeoutMs","f","conditions","c","origin","result","s","error","stopped","String","address","matchesAddress","n","_router_placeAt","d"],"mappings":";;;;;;;;;;;;;AAuEA,MAAMA,gBAAgBC;IACpB,YACWC,MAAc,EACvBC,OAAe,CACf;QACA,KAAK,CAACA,UAAAA,iBAAAA,IAAAA,EAAAA,UAAAA,KAAAA,IAAAA,IAAAA,CAHGD,MAAM,GAANA;IAIX;AACF;AAEA,MAAME,QAAQ,CAACC,KAAe,IAAIC,QAAc,CAACC,IAAMC,gBAAgB,UAAU,CAACD,GAAGF;AACrF,MAAMI,OAAkD;IAAE,QAAQ;IAAG,kBAAkB;IAAG,MAAM;AAAE;AAG3F,SAASC,WAAWC,OAAkB,EAAEC,OAA4B;QAGnDC;IAFtB,MAAM,EAAEC,KAAK,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,MAAM,EAAE,GAAGL;IAC5C,MAAMM,UAAUJ,MAAM,OAAO;IAC7B,MAAMK,gBAAgB,QAAAN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G,QAAQ,MAAM;gBAAE,SAASA,QAAQ,OAAO;YAAC;QAC9F,SAAU;YACR,KAAK,MAAMnC,KAAK5D,MAAM,IAAI,CAACG,OAAQyD,EAAE,IAAI;QAC3C;IACF;IAEA,OAAO;QACL3E;QACA,OAAO;YACL,KAAK,IAAMS;YACX,WAAUK,CAAC;gBACTJ,UAAU,GAAG,CAACI;gBACd,OAAO;oBACLJ,UAAU,MAAM,CAACI;gBACnB;YACF;QACF;QACA;YACEG,QAAAA,cAAAA;QACF;QACA;YACED,YAAY;YACZ,KAAK,MAAMM,KAAKP,MAAM,IAAI,CAACI,aAAcG;YACzC,KAAK,MAAMqD,KAAK5D,MAAM,IAAI,CAACG,OAAQyD,EAAE,IAAI;QAC3C;QACAgC;IACF;AACF;AAEA,SAASzD,UAAU8D,OAAe,EAAEjE,OAAe;IACjD,IAAI;QACF,OAAOkE,eAAeD,SAASjE;IACjC,EAAE,OAAM;QACN,OAAO;IACT;AACF;AAEA,SAASkD,iBAAiB7F,MAAmC;IAC3D,IAAI,CAACA,QAAQ,OAAO;IACpB,MAAM8G,IAAI9G,OAAO,KAAK,GAAG,QAAQ,CAAC,MAAM;IACxC,IAAK,IAAIgF,IAAI8B,IAAI,GAAG9B,KAAK,GAAGA,IAAK;YACrB+B,iCAAAA;QAAV,MAAMC,IAAI,QAAAD,CAAAA,kBAAAA,OAAO,OAAO,CAAC/B,EAAC,IAAhB+B,KAAAA,IAAAA,QAAAA,CAAAA,kCAAAA,gBAAmB,eAAe,AAAD,IAAjCA,KAAAA,IAAAA,gCAAAA,IAAAA,CAAAA;QACV,IAAIC,KAAKA,EAAE,MAAM,GAAG,GAAG,OAAOA;IAChC;IACA,OAAO;AACT"}
1
+ {"version":3,"file":"guide/journey.jsx","sources":["../../src/guide/journey.ts"],"sourcesContent":["import {\n confirmSeconds,\n type G9AnchorRisk,\n type G9GuideEffectSpec,\n type G9Journey,\n type G9JourneySource,\n type G9JourneyStep,\n type G9Snapshot,\n type G9StepAuthority,\n type G9Until,\n type G9WaitFor,\n g9RuntimeTimers,\n journeyAuthority,\n matchesAddress,\n textIn,\n tryParseAddress,\n} from '@g9tm/lynxcontrols-foundation';\nimport { windowRect } from '../anchor/measure';\nimport type { G9AnchorEntry } from '../anchor/registry';\nimport { revealAnchor } from '../anchor/scroll';\nimport type { G9Router } from '../route/router';\nimport type { G9GuideHandle, G9GuideOutcome, G9GuideService, G9GuideSpec } from './service';\n\n// Runs a journey on screen. Who may do what is the SOURCE policy (foundation `journeyAuthority`), read with the CALLER's\n// source — a journey cannot raise its own rights: navigation, showing and filling a form are the engine's; pressing a\n// control that saves or deletes waits for the person's confirmation behind a countdown, with every change listed; a\n// step the policy keeps from the engine falls to the person (the finger points, the guide waits). Every step ends with\n// a result; a failure stops the journey with its reason (no retries, no loops). Back ends the journey.\n\n/** What a journey runs with: the trusted source, the language, the guide and the router. */\nexport interface G9JourneyRunOptions {\n /** Who started it (trusted: the app decides, never the journey). */\n readonly source: G9JourneySource;\n readonly language: 'fa' | 'en';\n readonly guide: G9GuideService;\n readonly router?: G9Router | null;\n /** Make the policy stricter for a step (an app may never make it looser). */\n readonly authority?: (step: G9JourneyStep, risk: G9AnchorRisk) => G9StepAuthority | null;\n /** How long a person's step may take before the journey stops (ms). Default 120000. */\n readonly personTimeoutMs?: number;\n}\n\n/** The phase of a running journey. */\nexport type G9JourneyStatus = 'running' | 'waiting' | 'done' | 'failed' | 'cancelled';\n\n/** Where a running journey is. */\nexport interface G9JourneyState {\n readonly index: number;\n readonly status: G9JourneyStatus;\n /** Steps the policy gave to the person instead of the engine. */\n readonly downgraded: readonly number[];\n}\n\n/** How a journey ended: `ok`, or the step it stopped at and why. */\nexport interface G9JourneyResult {\n readonly ok: boolean;\n readonly failedAt?: number;\n readonly reason?: string;\n readonly message?: string;\n}\n\n/** A running journey: its state, «next» for a manual pace, cancel, and its result. */\nexport interface G9JourneyRun {\n readonly journey: G9Journey;\n readonly state: { get(): G9JourneyState; subscribe(l: () => void): () => void };\n /** The «next» of a manual journey (or of the bubble). */\n next(): void;\n cancel(): void;\n readonly result: Promise<G9JourneyResult>;\n}\n\nclass Stopped extends Error {\n constructor(\n readonly reason: string,\n message: string,\n ) {\n super(message);\n }\n}\n\nconst sleep = (ms: number) => new Promise<void>((r) => g9RuntimeTimers.setTimeout(r, ms));\nconst RANK: Readonly<Record<G9StepAuthority, number>> = { engine: 0, 'engine-confirm': 1, user: 2 };\n\n/** Starts a journey (validate untrusted JSON with `validateJourney` first). */\nexport function runJourney(journey: G9Journey, options: G9JourneyRunOptions): G9JourneyRun {\n const { guide, router, language, source } = options;\n const anchors = guide.anchors;\n const personTimeout = options.personTimeoutMs ?? 120000;\n let state: G9JourneyState = { index: 0, status: 'running', downgraded: [] };\n const listeners = new Set<() => void>();\n const set = (patch: Partial<G9JourneyState>) => {\n state = { ...state, ...patch };\n for (const l of Array.from(listeners)) l();\n };\n let cancelled = false;\n let nextWaiter: (() => void) | null = null;\n const marks = new Set<G9GuideHandle>();\n const cancelHooks = new Set<() => void>();\n\n const show = (spec: G9GuideSpec): G9GuideHandle => {\n const h = guide.show({ language, ...spec });\n marks.add(h);\n void h.result.then(() => marks.delete(h));\n return h;\n };\n const text = (t: Parameters<typeof textIn>[0] | undefined) => (t === undefined ? '' : textIn(t, language));\n const check = () => {\n if (cancelled) throw new Stopped('cancelled', 'cancelled');\n };\n\n /** Resolves on the first of: a condition met (polled), the run's «next», a cancel, a timeout. */\n const until = (\n condition: (() => boolean | Promise<boolean>) | null,\n timeoutMs: number,\n mark: G9GuideHandle | null,\n ): Promise<'met' | 'next' | 'timeout' | 'cancelled' | G9GuideOutcome> =>\n new Promise((resolve) => {\n let done = false;\n let poll: unknown = null;\n const finish = (why: 'met' | 'next' | 'timeout' | 'cancelled' | G9GuideOutcome) => {\n if (done) return;\n done = true;\n g9RuntimeTimers.clearTimeout(timer);\n if (poll !== null) g9RuntimeTimers.clearTimeout(poll);\n cancelHooks.delete(onCancel);\n if (nextWaiter === onNext) nextWaiter = null;\n resolve(why);\n };\n const onCancel = () => finish('cancelled');\n const onNext = () => finish('next');\n cancelHooks.add(onCancel);\n nextWaiter = onNext;\n const timer = g9RuntimeTimers.setTimeout(() => finish('timeout'), timeoutMs);\n void mark?.result.then((o) =>\n o === 'next' || o === 'done' || o === 'skip' || o === 'tapped'\n ? finish('next')\n : o === 'target-lost'\n ? finish('target-lost')\n : // Hidden by someone else (Android back ends the guide), or the host went away: the journey stops.\n o === 'hidden' || o === 'unmount'\n ? finish('cancelled')\n : undefined,\n );\n if (condition) {\n const tick = async () => {\n poll = null;\n if (done) return;\n let met = false;\n try {\n met = await condition();\n } catch {\n met = false;\n }\n if (met) finish('met');\n else if (!done) poll = g9RuntimeTimers.setTimeout(() => void tick(), 250);\n };\n void tick();\n }\n });\n\n const anchorFor = async (id: string): Promise<G9AnchorEntry> => {\n const r = await revealAnchor(anchors, id, { smooth: true });\n if (!r.anchor) throw new Stopped('not-found', `The control \"${id}\" is not on screen.`);\n return r.anchor;\n };\n\n const routeMet = (pattern: string) => () => {\n const here = router?.where().unique ?? '';\n return here === pattern || (tryParseAddress(here).ok && safeMatch(here, pattern));\n };\n\n const valueMet = (target: string, equals: string | undefined, start: string | null | undefined) => () => {\n const v = anchors.find(target)?.info().capabilities?.getValue?.();\n return equals === undefined ? v !== start : v === equals;\n };\n\n const untilOf = async (u: G9Until | undefined, mark: G9GuideHandle | null, fallbackNext: boolean) => {\n if (u === undefined || u === 'next' || u === 'tap') return until(null, personTimeout, mark);\n if ('ms' in u) {\n await sleep(u.ms);\n return 'met';\n }\n if ('route' in u) return until(routeMet(u.route), personTimeout, fallbackNext ? mark : null);\n const start = anchors.find(u.value.target)?.info().capabilities?.getValue?.();\n return until(valueMet(u.value.target, u.value.equals, start), personTimeout, fallbackNext ? mark : null);\n };\n\n const authorityOf = (\n step: G9JourneyStep,\n action: 'navigate' | 'fill' | 'press',\n risk: G9AnchorRisk,\n ): G9StepAuthority => {\n const base = journeyAuthority(source, action, risk);\n const app = options.authority?.(step, risk) ?? null;\n return app && RANK[app] > RANK[base] ? app : base;\n };\n\n const point = (target: string, words: string, gesture: 'tap' | 'longPress' = 'tap') =>\n show({\n target,\n effects: [\n { type: 'spotlight' },\n { type: 'highlight', pulse: true, opacity: 0.08 },\n { type: 'pointer', gesture },\n ...(words ? [{ type: 'caption' as const, text: words }] : []),\n ],\n buttons: ['next'],\n });\n\n const steps: Record<G9JourneyStep['do'], (step: never, index: number) => Promise<void>> = {\n go: async (step: Extract<G9JourneyStep, { do: 'go' }>) => {\n if (!router) throw new Stopped('no-router', 'There is no router to go with.');\n const by = step.by ?? 'jump';\n const r =\n by === 'jump'\n ? await router.go(step.to, {\n source: source === 'link' ? 'link' : source === 'assistant' ? 'assistant' : 'user',\n })\n : await router.walk(step.to, { by, presenter: guide.presenter() }).result;\n if (!r.ok) throw new Stopped(r.reason, r.message);\n },\n show: async (step: Extract<G9JourneyStep, { do: 'show' }>) => {\n const effects: G9GuideEffectSpec[] = step.effects\n ? step.effects.slice()\n : [{ type: 'spotlight' }, { type: 'highlight', pulse: true, opacity: 0.08 }];\n if (step.text && !effects.some((e) => e.type === 'caption')) effects.push({ type: 'caption', text: step.text });\n const m = show({ target: step.target, effects, buttons: ['next'] });\n const why = await untilOf(step.until, m, true);\n m.hide();\n if (why === 'cancelled') throw new Stopped('cancelled', 'cancelled');\n if (why === 'timeout' || why === 'target-lost')\n throw new Stopped(\n why,\n `\"${step.target}\" ${why === 'timeout' ? 'was not reached in time' : 'left the screen'}.`,\n );\n },\n say: async (step: Extract<G9JourneyStep, { do: 'say' }>) => {\n const w = windowRect();\n const m = show({\n target: { x: w.width / 2 - 1, y: w.height * 0.42, width: 2, height: 2 },\n effects: [{ type: 'caption', text: step.text, placement: 'below' }],\n buttons: ['next'],\n reveal: false,\n });\n const why = await untilOf(step.until, m, true);\n m.hide();\n if (why === 'cancelled') throw new Stopped('cancelled', 'cancelled');\n if (why === 'timeout') throw new Stopped('timeout', 'No answer in time.');\n },\n fill: async (step: Extract<G9JourneyStep, { do: 'fill' }>, index: number) => {\n const anchor = await anchorFor(step.target);\n const caps = anchor.info().capabilities;\n if (step.by === 'user' || !caps?.setValue) {\n if (step.by !== 'user') set({ downgraded: [...state.downgraded, index] });\n const m = point(step.target, step.value);\n const why = await until(valueMet(step.target, step.value, null), personTimeout, m);\n m.hide();\n if (why === 'cancelled') throw new Stopped('cancelled', 'cancelled');\n if (why === 'timeout') throw new Stopped('timeout', `\"${step.target}\" was not filled in time.`);\n return;\n }\n const m = show({ target: step.target, effects: [{ type: 'highlight', pulse: true }], reveal: false });\n try {\n await caps.focus?.();\n const chars = Array.from(step.value);\n const per = Math.min(guide.settings.typeMsPerChar, chars.length > 0 ? 1200 / chars.length : 0);\n if (per > 0) {\n for (let i = 1; i < chars.length; i++) {\n check();\n await caps.setValue(chars.slice(0, i).join(''));\n await sleep(per);\n }\n }\n check();\n await caps.setValue(step.value);\n } finally {\n m.hide();\n }\n const read = caps.getValue?.();\n if (read !== undefined && read !== null && read !== step.value)\n throw new Stopped('failed', `\"${step.target}\" holds \"${read}\", not the value given.`);\n },\n select: async (step: Extract<G9JourneyStep, { do: 'select' }>, index: number) => {\n const anchor = await anchorFor(step.target);\n const caps = anchor.info().capabilities;\n const has = () => (caps?.getValue?.() ?? '').split(',').indexOf(step.item) >= 0;\n if (step.by === 'user' || !caps?.selectItem) {\n if (step.by !== 'user') set({ downgraded: [...state.downgraded, index] });\n const m = point(step.target, '');\n const why = await until(has, personTimeout, m);\n m.hide();\n if (why === 'cancelled') throw new Stopped('cancelled', 'cancelled');\n if (why === 'timeout') throw new Stopped('timeout', `\"${step.item}\" was not picked in time.`);\n return;\n }\n await caps.selectItem(step.item);\n if (caps.getValue && !has()) throw new Stopped('failed', `\"${step.target}\" did not take \"${step.item}\".`);\n },\n press: async (step: Extract<G9JourneyStep, { do: 'press' }>, index: number) => {\n const anchor = await anchorFor(step.target);\n const info = anchor.info();\n const risk = info.risk ?? 'none';\n const authority = authorityOf(step, 'press', risk);\n const label = text(step.text) || info.label?.() || step.target;\n const byPerson = step.by === 'user' || authority === 'user' || !info.capabilities?.activate;\n if (byPerson) {\n if (step.by === 'engine') set({ downgraded: [...state.downgraded, index] });\n const before = router?.where().revision ?? -1;\n const m = point(step.target, label);\n const why = await until(\n () => (router ? router.where().revision !== before : false) || !anchors.find(step.target),\n personTimeout,\n m,\n );\n m.hide();\n if (why === 'cancelled') throw new Stopped('cancelled', 'cancelled');\n if (why === 'timeout') throw new Stopped('timeout', `\"${label}\" was not pressed in time.`);\n return;\n }\n if (authority === 'engine-confirm' && risk !== 'none') {\n const changes = info.changes?.() ?? lastPlaceChanges(router) ?? [];\n const seconds = confirmSeconds(source, risk, changes.length > 0, guide.settings.confirm);\n // No highlight on the control while its confirmation is open: the guide's layer paints above every sheet, so a\n // pulsing ring on a footer button stood over the confirmation's own buttons (seen on a device, 2026-11-12). The\n // sheet names the action in its title; the ripple after a yes shows where the guide pressed.\n // A journey that presses more than one control says which press this is («2 of 3»): a person who confirms the\n // first of three writes should know two more are coming.\n const presses = journey.steps.filter((s) => s.do === 'press').length;\n const progress = {\n index: journey.steps.slice(0, index + 1).filter((s) => s.do === 'press').length,\n total: presses,\n };\n const dismiss = () => guide.dismissConfirmation();\n cancelHooks.add(dismiss);\n let ok = false;\n try {\n ok = await guide.confirm({\n title: label,\n source,\n changes,\n seconds,\n destructive: risk === 'destructive',\n progress,\n });\n } finally {\n cancelHooks.delete(dismiss);\n }\n if (!ok) throw new Stopped('declined', 'The person did not confirm.');\n }\n check();\n show({ target: step.target, effects: [{ type: 'ripple' }], timeoutMs: 600, reveal: false });\n await info.capabilities?.activate?.();\n },\n wait: async (step: Extract<G9JourneyStep, { do: 'wait' }>) => {\n const f: G9WaitFor = step.for;\n const conditions: Array<() => boolean> = [];\n if (f.route) conditions.push(routeMet(f.route));\n if (f.anchor) {\n const id = f.anchor;\n conditions.push(() => !!anchors.find(id));\n }\n if (f.value)\n conditions.push(\n valueMet(f.value.target, f.value.equals, anchors.find(f.value.target)?.info().capabilities?.getValue?.()),\n );\n if (f.ms !== undefined && conditions.length === 0) {\n await sleep(f.ms);\n return;\n }\n const why = await until(() => conditions.some((c) => c()), step.timeoutMs ?? 30000, null);\n if (why === 'cancelled') throw new Stopped('cancelled', 'cancelled');\n if (why === 'timeout') throw new Stopped('timeout', 'What the journey waited for did not happen.');\n },\n back: async () => {\n if (!router || !origin) throw new Stopped('no-router', 'There is nowhere to come back to.');\n const r = await router.restore(origin);\n if (!r.ok) throw new Stopped(r.reason, r.message);\n },\n };\n\n let origin: G9Snapshot | null = null;\n const result = (async (): Promise<G9JourneyResult> => {\n try {\n if (router && journey.steps.some((s) => s.do === 'back')) origin = await router.snapshotWithScroll();\n for (let i = 0; i < journey.steps.length; i++) {\n check();\n set({ index: i, status: 'running' });\n const step = journey.steps[i] as G9JourneyStep;\n await (steps[step.do] as (s: G9JourneyStep, i: number) => Promise<void>)(step, i);\n if (journey.pace === 'manual' && i < journey.steps.length - 1) {\n set({ status: 'waiting' });\n const why = await until(null, personTimeout, null);\n if (why === 'cancelled') throw new Stopped('cancelled', 'cancelled');\n }\n }\n set({ status: 'done' });\n return { ok: true };\n } catch (error) {\n const stopped =\n error instanceof Stopped ? error : new Stopped('failed', String((error as Error)?.message ?? error));\n set({ status: stopped.reason === 'cancelled' ? 'cancelled' : 'failed' });\n return { ok: false, failedAt: state.index, reason: stopped.reason, message: stopped.message };\n } finally {\n for (const m of Array.from(marks)) m.hide();\n }\n })();\n\n return {\n journey,\n state: {\n get: () => state,\n subscribe(l) {\n listeners.add(l);\n return () => {\n listeners.delete(l);\n };\n },\n },\n next() {\n nextWaiter?.();\n },\n cancel() {\n cancelled = true;\n for (const h of Array.from(cancelHooks)) h();\n for (const m of Array.from(marks)) m.hide();\n },\n result,\n };\n}\n\nfunction safeMatch(address: string, pattern: string): boolean {\n try {\n return matchesAddress(address, pattern);\n } catch {\n return false;\n }\n}\n\nfunction lastPlaceChanges(router: G9Router | null | undefined) {\n if (!router) return null;\n const n = router.where().segments.length;\n for (let i = n - 1; i >= 0; i--) {\n const d = router.placeAt(i)?.describeChanges?.();\n if (d && d.length > 0) return d;\n }\n return null;\n}\n"],"names":["Stopped","Error","reason","message","sleep","ms","Promise","r","g9RuntimeTimers","RANK","runJourney","journey","options","_options_personTimeoutMs","guide","router","language","source","anchors","personTimeout","state","listeners","Set","set","patch","l","Array","cancelled","nextWaiter","marks","cancelHooks","show","spec","h","text","t","undefined","textIn","check","until","condition","timeoutMs","mark","resolve","done","poll","finish","why","timer","onCancel","onNext","o","tick","met","anchorFor","id","revealAnchor","routeMet","pattern","here","tryParseAddress","safeMatch","valueMet","target","equals","start","_anchors_find_info_capabilities","v","untilOf","u","fallbackNext","authorityOf","step","action","risk","base","journeyAuthority","app","point","words","gesture","steps","_step_by","by","effects","e","m","w","windowRect","index","caps","anchor","chars","per","Math","i","read","has","_info_risk","info","_info_capabilities","_info_capabilities1","authority","label","byPerson","before","_ref1","changes","lastPlaceChanges","seconds","confirmSeconds","presses","s","progress","dismiss","ok","_step_timeoutMs","f","conditions","c","origin","result","error","stopped","String","address","matchesAddress","n","_router_placeAt","d"],"mappings":";;;;;;;;;;;;;AAuEA,MAAMA,gBAAgBC;IACpB,YACWC,MAAc,EACvBC,OAAe,CACf;QACA,KAAK,CAACA,UAAAA,iBAAAA,IAAAA,EAAAA,UAAAA,KAAAA,IAAAA,IAAAA,CAHGD,MAAM,GAANA;IAIX;AACF;AAEA,MAAME,QAAQ,CAACC,KAAe,IAAIC,QAAc,CAACC,IAAMC,gBAAgB,UAAU,CAACD,GAAGF;AACrF,MAAMI,OAAkD;IAAE,QAAQ;IAAG,kBAAkB;IAAG,MAAM;AAAE;AAG3F,SAASC,WAAWC,OAAkB,EAAEC,OAA4B;QAGnDC;IAFtB,MAAM,EAAEC,KAAK,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,MAAM,EAAE,GAAGL;IAC5C,MAAMM,UAAUJ,MAAM,OAAO;IAC7B,MAAM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AE,MAAM,GAAG,GAAG,OAAOA;IAChC;IACA,OAAO;AACT"}
@@ -46,6 +46,11 @@ export interface G9ConfirmRequest {
46
46
  readonly changes: readonly G9ChangeLine[];
47
47
  readonly seconds: number;
48
48
  readonly destructive: boolean;
49
+ /** Where this press stands in a journey that presses more than one control (shown when `total` > 1). */
50
+ readonly progress?: {
51
+ readonly index: number;
52
+ readonly total: number;
53
+ };
49
54
  }
50
55
  /** The guide of one host: marks, ready-made combinations, the walk presenter and the countdown confirmation. */
51
56
  export interface G9GuideService {
@@ -67,8 +72,13 @@ export interface G9GuideService {
67
72
  hint(target: G9GuideTarget): G9GuideHandle;
68
73
  /** The presenter a router walk draws its steps with. */
69
74
  presenter(): G9WalkPresenter;
70
- /** Asks the person to confirm a write: the changes, the source, a countdown on the confirm button. */
75
+ /**
76
+ * Asks the person to confirm a write in a sheet: the changes, the source, a countdown on the confirm button. Resolves
77
+ * once the sheet has gone: true only for the unlocked confirm. A newer request declines the open one.
78
+ */
71
79
  confirm(request: G9ConfirmRequest): Promise<boolean>;
80
+ /** Declines the open confirmation, if any (a journey that is cancelled). */
81
+ dismissConfirmation(): void;
72
82
  readonly confirmation: {
73
83
  get(): G9ConfirmRequest | null;
74
84
  subscribe(l: () => void): () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/guide/service.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EAGrB,MAAM,+BAA+B,CAAC;AAIvC,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,OAAO,EAAmB,KAAK,uBAAuB,EAAwB,MAAM,YAAY,CAAC;AACjG,OAAO,aAAa,CAAC;A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,uBAAuB,CAAC;IAC3C,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC;CACpC;AA0QD,iDAAiD;AACjD,wBAAgB,cAAc,CAAC,IAAI,EAAE,YAAY,EAAE,QAAQ,CAAC,EAAE,uBAAuB,GAAG,cAAc,CAIrG;AAED,qCAAqC;AACrC,wBAAgB,UAAU,IAAI,cAAc,CAG3C;AAED,wFAAwF;AACxF,wBAAgB,OAAO,IAAI,cAAc,CAExC"}
@@ -5,10 +5,12 @@ import { revealAnchor } from "../anchor/scroll.jsx";
5
5
  import { useG9Host } from "../host/hooks.jsx";
6
6
  import { g9Hosts } from "../host/registry.jsx";
7
7
  import { useG9Direction, useG9Settings } from "../provider/hooks.jsx";
8
+ import { presentConfirmSheet } from "./confirm-sheet.jsx";
8
9
  import { inflate, placeBubble, placePointer, scrimBands } from "./placement.jsx";
9
- import { formatGuideText, resolveGuideSettings } from "./settings.jsx";
10
+ import { resolveGuideSettings } from "./settings.jsx";
10
11
  import "./guide.css";
11
12
  const FEATURE = 'g9-guide';
13
+ const SETTINGS_WAIT_MS = 500;
12
14
  function store(initial) {
13
15
  let value = initial;
14
16
  const listeners = new Set();
@@ -28,9 +30,20 @@ function store(initial) {
28
30
  }
29
31
  const isRect = (t)=>'object' == typeof t && 'width' in t;
30
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;
31
- function createGuideService(host, initial) {
33
+ function createGuideService(host, initial, provided) {
32
34
  const anchors = host.anchors;
33
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
+ });
34
47
  const marks = new Map();
35
48
  const view1 = store([]);
36
49
  const confirmation = store(null);
@@ -227,29 +240,49 @@ function createGuideService(host, initial) {
227
240
  };
228
241
  },
229
242
  confirm (request) {
230
- var _confirmation_get;
231
- null == (_confirmation_get = confirmation.get()) || _confirmation_get.resolve(false);
243
+ service.dismissConfirmation();
232
244
  return new Promise((resolve)=>{
245
+ let done = false;
233
246
  const state = {
234
247
  ...request,
248
+ sheet: null,
235
249
  resolve: (ok)=>{
250
+ if (done) return;
251
+ done = true;
236
252
  if (confirmation.get() === state) confirmation.set(null);
237
253
  resolve(ok);
238
254
  }
239
255
  };
240
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);
241
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();
242
271
  }
243
272
  };
244
273
  service.__end = end;
245
274
  service.__settings = (next)=>{
246
275
  settings = next;
276
+ settingsProvided = true;
277
+ for (const w of Array.from(settingsWaiters))w();
247
278
  };
248
279
  service.dispose = ()=>{
249
- var _confirmation_get;
280
+ var _open_sheet;
250
281
  offRegistry();
251
282
  for (const key of Array.from(marks.keys()))end(key, 'unmount');
252
- null == (_confirmation_get = confirmation.get()) || _confirmation_get.resolve(false);
283
+ const open = confirmation.get();
284
+ null == open || null == (_open_sheet = open.sheet) || _open_sheet.dismiss();
285
+ null == open || open.resolve(false);
253
286
  };
254
287
  host.attachFeature(FEATURE, service);
255
288
  host.registerLayerItem('guide', {
@@ -257,9 +290,8 @@ function createGuideService(host, initial) {
257
290
  element: <GuideLayer service={service}/>
258
291
  });
259
292
  host.back.push(()=>{
260
- const c = confirmation.get();
261
- if (c) {
262
- c.resolve(false);
293
+ if (confirmation.get()) {
294
+ service.dismissConfirmation();
263
295
  return 'handled';
264
296
  }
265
297
  if (marks.size > 0) {
@@ -276,7 +308,7 @@ function guideServiceOf(host, settings) {
276
308
  var _existing___settings;
277
309
  const existing = host.getFeature(FEATURE);
278
310
  if (existing && settings) null == (_existing___settings = existing.__settings) || _existing___settings.call(existing, settings);
279
- return null != existing ? existing : createGuideService(host, null != settings ? settings : resolveGuideSettings(void 0));
311
+ return null != existing ? existing : createGuideService(host, null != settings ? settings : resolveGuideSettings(void 0), void 0 !== settings);
280
312
  }
281
313
  function useG9Guide() {
282
314
  const settings = useG9Settings();
@@ -310,7 +342,6 @@ function GuideLayer(props) {
310
342
  ]);
311
343
  null == (_service___settings = service.__settings) || _service___settings.call(service, resolved);
312
344
  const marks = useSyncExternalStore((l)=>service.marks.subscribe(l), ()=>service.marks.get());
313
- const confirmation = useSyncExternalStore((l)=>service.confirmation.subscribe(l), ()=>service.confirmation.get());
314
345
  const node = useRef(null);
315
346
  const [frame, setFrame] = useState({
316
347
  x: 0,
@@ -318,7 +349,7 @@ function GuideLayer(props) {
318
349
  width: 0,
319
350
  height: 0
320
351
  });
321
- const visible = marks.length > 0 || null !== confirmation;
352
+ const visible = marks.length > 0;
322
353
  useEffect(()=>{
323
354
  if (!visible) return;
324
355
  measureNode(node.current).then((r)=>{
@@ -347,7 +378,7 @@ function GuideLayer(props) {
347
378
  width: frame.width,
348
379
  height: frame.height
349
380
  };
350
- const generation = `${marks.map((m)=>m.key).join('|')}#${confirmation ? 'c' : ''}`;
381
+ const generation = marks.map((m)=>m.key).join('|');
351
382
  return <view key={generation} className="g9-guide" flatten={false} ref={(n)=>{
352
383
  node.current = n;
353
384
  }} bindlayoutchange={(e)=>{
@@ -362,7 +393,6 @@ function GuideLayer(props) {
362
393
  }));
363
394
  }}>
364
395
  {marks.map((m)=>m.rect ? <MarkView key={m.key} mark={m} rect={local(m.rect)} view={viewRect} service={service}/> : null)}
365
- {confirmation ? <ConfirmCard request={confirmation} service={service}/> : null}
366
396
  </view>;
367
397
  }
368
398
  function MarkView(props) {
@@ -531,90 +561,6 @@ function endMark(service, key, outcome) {
531
561
  var _service___end;
532
562
  null == (_service___end = service.__end) || _service___end.call(service, key, outcome);
533
563
  }
534
- function ConfirmCard(props) {
535
- const { request, service } = props;
536
- const texts = service.settings.texts;
537
- const rtl = 'rtl' === useG9Direction();
538
- const [left, setLeft] = useState(request.seconds);
539
- useEffect(()=>{
540
- setLeft(request.seconds);
541
- let n = request.seconds;
542
- let timer = null;
543
- const tick = ()=>{
544
- n -= 1;
545
- setLeft(n);
546
- if (n > 0) timer = g9RuntimeTimers.setTimeout(tick, 1000);
547
- };
548
- timer = g9RuntimeTimers.setTimeout(tick, 1000);
549
- return ()=>g9RuntimeTimers.clearTimeout(timer);
550
- }, [
551
- request
552
- ]);
553
- const align = {
554
- textAlign: rtl ? 'right' : 'left'
555
- };
556
- const ready = left <= 0;
557
- return <view className="g9-guide__confirm-scrim" catchtap={()=>void 0}>
558
- <view className="g9-guide__confirm" style={{
559
- direction: rtl ? 'rtl' : 'ltr'
560
- }} accessibility-element accessibility-label={request.title}>
561
- <text className="g9-guide__confirm-title" style={align}>
562
- {request.title}
563
- </text>
564
- <text className="g9-guide__confirm-source" style={align}>
565
- {texts.sources[request.source]}
566
- </text>
567
- {'link' === request.source ? <text className="g9-guide__confirm-warning" style={align}>
568
- {texts.linkWarning}
569
- </text> : null}
570
- <text className="g9-guide__confirm-heading" style={align}>
571
- {texts.changesTitle}
572
- </text>
573
- <view className="g9-guide__confirm-lines">
574
- {(request.changes.length > 0 ? request.changes : [
575
- {
576
- action: 'other',
577
- subject: texts.undescribed
578
- }
579
- ]).map((c, i)=>{
580
- var _c_from, _c_to;
581
- return <view key={`c${i}`} className="g9-guide__confirm-line" style={{
582
- flexDirection: rtl ? 'row-reverse' : 'row',
583
- direction: 'ltr'
584
- }}>
585
- <text className={`g9-guide__confirm-verb g9-guide__confirm-verb--${c.action}`}>
586
- {texts.actions[c.action]}
587
- </text>
588
- <view className="g9-guide__confirm-line-body">
589
- <text className="g9-guide__confirm-subject" style={align}>
590
- {c.field ? `${c.subject} · ${c.field}` : c.subject}
591
- </text>
592
- {void 0 !== c.from || void 0 !== c.to ? <text className="g9-guide__confirm-value" style={align}>
593
- {`${null != (_c_from = c.from) ? _c_from : '—'} → ${null != (_c_to = c.to) ? _c_to : '—'}`}
594
- </text> : null}
595
- {c.note ? <text className="g9-guide__confirm-note" style={align}>
596
- {c.note}
597
- </text> : null}
598
- </view>
599
- </view>;
600
- })}
601
- </view>
602
- <view className="g9-guide__confirm-actions" style={{
603
- flexDirection: rtl ? 'row-reverse' : 'row',
604
- direction: 'ltr'
605
- }}>
606
- <view className="g9-guide__confirm-button g9-guide__confirm-button--cancel" bindtap={()=>request.resolve(false)}>
607
- <text className="g9-guide__confirm-button-text g9-guide__confirm-button-text--cancel">{texts.cancel}</text>
608
- </view>
609
- <view className={`g9-guide__confirm-button${request.destructive ? ' g9-guide__confirm-button--danger' : ''}${ready ? '' : ' g9-guide__confirm-button--waiting'}`} bindtap={()=>ready ? request.resolve(true) : void 0} accessibility-element accessibility-label={ready ? texts.confirm : formatGuideText(texts.confirmIn, left)}>
610
- <text className="g9-guide__confirm-button-text">
611
- {ready ? texts.confirm : formatGuideText(texts.confirmIn, left)}
612
- </text>
613
- </view>
614
- </view>
615
- </view>
616
- </view>;
617
- }
618
564
  export { g9Guide, guideServiceOf, useG9Guide };
619
565
 
620
566
  //# sourceMappingURL=service.jsx.map