@g9tm/lynxcontrols 1.6.1 → 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/range-slider/index.d.ts +1 -1
  3. package/dist/range-slider/index.d.ts.map +1 -1
  4. package/dist/range-slider/range-slider.css +7 -0
  5. package/dist/range-slider/range-slider.css.map +1 -1
  6. package/dist/range-slider/range-slider.d.ts +17 -0
  7. package/dist/range-slider/range-slider.d.ts.map +1 -1
  8. package/dist/range-slider/range-slider.jsx +21 -3
  9. package/dist/range-slider/range-slider.jsx.map +1 -1
  10. package/dist/sheet/frame.d.ts.map +1 -1
  11. package/dist/sheet/frame.jsx +25 -6
  12. package/dist/sheet/frame.jsx.map +1 -1
  13. package/dist/sheet/motion.d.ts +1 -1
  14. package/dist/sheet/motion.d.ts.map +1 -1
  15. package/dist/sheet/motion.jsx +1 -1
  16. package/dist/sheet/motion.jsx.map +1 -1
  17. package/dist/sheet/options.d.ts +6 -2
  18. package/dist/sheet/options.d.ts.map +1 -1
  19. package/dist/sheet/options.jsx.map +1 -1
  20. package/dist/sheet/sheet.css +12 -0
  21. package/dist/sheet/sheet.css.map +1 -1
  22. package/dist/sheet/sizing.d.ts +1 -1
  23. package/dist/sheet/sizing.d.ts.map +1 -1
  24. package/dist/sheet/sizing.jsx +3 -3
  25. package/dist/sheet/sizing.jsx.map +1 -1
  26. package/dist/sheet/stack.d.ts +13 -0
  27. package/dist/sheet/stack.d.ts.map +1 -1
  28. package/dist/sheet/stack.jsx +20 -2
  29. package/dist/sheet/stack.jsx.map +1 -1
  30. package/dist/swipe/index.d.ts +1 -1
  31. package/dist/swipe/index.d.ts.map +1 -1
  32. package/dist/swipe/index.jsx +1 -1
  33. package/dist/swipe/model.d.ts +9 -0
  34. package/dist/swipe/model.d.ts.map +1 -1
  35. package/dist/swipe/model.jsx +8 -1
  36. package/dist/swipe/model.jsx.map +1 -1
  37. package/dist/swipe/swipe-view.d.ts.map +1 -1
  38. package/dist/swipe/swipe-view.jsx +8 -2
  39. package/dist/swipe/swipe-view.jsx.map +1 -1
  40. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"sheet/stack.jsx","sources":["../../src/sheet/stack.ts"],"sourcesContent":["import type { ReactNode } from '@lynx-js/react';\nimport type { G9SheetBackAction, G9SheetBackSource, G9SheetOptions } from './options';\n\n// The sheet stack (MAUI G9BottomSheetHelper's stacking, replace, hand-off, back routing and lifecycle), independent\n// of rendering so it can be model-tested. The frame component reports motion ends (`markOpened`, `markClosed`); timer\n// fallbacks make every transition finish even when no motion event arrives.\n\n/** Why a sheet's result settled. Every sheet settles exactly once. */\nexport type G9SheetCloseReason =\n /** `handle.close()` / `closeAsync()`. */\n | 'closed'\n /** `closeAll()` (MAUI `CloseG9BottomSheet`). */\n | 'closeAll'\n /** The header back/close button or `closeTop()`. */\n | 'toolbarButton'\n /** Hardware back / desktop Escape. */\n | 'hardwareButton'\n /** A tap on the scrim. */\n | 'overlayTap'\n /** Dragged closed. */\n | 'drag'\n /** Replaced in place or handed off to a successor. */\n | 'replaced'\n /** A queued request displaced by a newer one before it opened. */\n | 'displaced'\n /** The host unmounted. */\n | 'unmount';\n\n/** The result of one sheet. */\nexport interface G9SheetResult {\n readonly reason: G9SheetCloseReason;\n}\n\n/** What a sheet shows: a node, or a factory built after the open motion (deferred content). */\nexport type G9SheetContent = ReactNode | (() => ReactNode);\n\n/** Lifecycle status of an entry. */\nexport type G9SheetStatus = 'queued' | 'opening' | 'open' | 'closing' | 'closed';\n\n/** One sheet of the stack (read-only snapshot for rendering). */\nexport interface G9SheetEntry {\n readonly id: number;\n /** Identity of the rendered frame; kept by an in-place replace. */\n readonly frameKey: number;\n readonly content: G9SheetContent;\n readonly options: G9SheetOptions;\n readonly status: G9SheetStatus;\n /** Bumped by an in-place replace (the frame cross-fades its body). */\n readonly version: number;\n /** The sheet above this one recedes it. */\n readonly receded: boolean;\n /** Close motion runs at half duration (replace fallback). */\n readonly quickClose: boolean;\n /** The entry is handing its dim to a successor (its scrim is transparent). */\n readonly handingOff: boolean;\n /** Closing without a visible motion (whole-stack teardown keeps recede links static). */\n readonly reason: G9SheetCloseReason | null;\n}\n\n/** A handle to one sheet (MAUI `IG9BottomSheetHandle`, sheet-scoped). */\nexport interface G9SheetHandle {\n readonly id: number;\n /** Settles once with the close reason, after the sheet left the screen. */\n readonly result: Promise<G9SheetResult>;\n /** `true` until the sheet started closing. */\n readonly isOpen: boolean;\n /** Closes this sheet (MAUI owned-handle `Close`). */\n close(): void;\n /** Closes this sheet and resolves when it is gone (MAUI `CloseAsync`). */\n closeAsync(): Promise<void>;\n /** Opens another sheet on top (MAUI `Show`, auto-stacking). */\n show(content: G9SheetContent, options?: G9SheetOptions): G9SheetHandle | null;\n /** Back-routes the top sheet (MAUI `CloseTop`). */\n closeTop(): void;\n}\n\n/** Timing and policy the stack needs from its host. */\nexport interface G9SheetStackConfig {\n /** Monotonic ms. */\n now(): number;\n setTimer(callback: () => void, ms: number): unknown;\n clearTimer(handle: unknown): void;\n /** Open/close durations (ms) for an entry's fallback timers. */\n durations(options: G9SheetOptions): { open: number; close: number };\n /** Hand-off needs the staged pipeline (`settings.stageBeforeShow`). */\n stageBeforeShow(): boolean;\n /**\n * Longest a hand-off waits for its successor to report open before the predecessor closes anyway (ms; MAUI\n * `PreOpenMaxHoldMs`). Default: only the successor's open fallback timer bounds it.\n */\n preOpenMaxHoldMs?(): number;\n /** A lifecycle callback threw. */\n onError?(error: unknown): void;\n}\n\n/** MAUI `G9SafeCommand` throttle window shared by show and replace. */\nexport const g9SheetShowThrottleMs = 369;\n/** Grace after the close motion before cleanup (MAUI page-side reset). */\nexport const g9SheetCloseGraceMs = 48;\n\ninterface MutableEntry {\n id: number;\n frameKey: number;\n content: G9SheetContent;\n options: G9SheetOptions;\n status: G9SheetStatus;\n version: number;\n receded: boolean;\n quickClose: boolean;\n handingOff: boolean;\n reason: G9SheetCloseReason | null;\n settle: (result: G9SheetResult) => void;\n handle: G9SheetHandle;\n timer: unknown;\n successorOf: number | null;\n closingStarted: boolean;\n backBusy: boolean;\n}\n\n/** The stack of one host. */\nexport class G9SheetStack {\n private readonly config: G9SheetStackConfig;\n private entries: MutableEntry[] = [];\n private pending: MutableEntry | null = null;\n private lastShow = Number.NEGATIVE_INFINITY;\n private nextId = 1;\n private readonly listeners = new Set<() => void>();\n private snapshot: ReadonlyArray<G9SheetEntry> = [];\n private disposed = false;\n\n constructor(config: G9SheetStackConfig) {\n this.config = config;\n }\n\n // ---- observation ---------------------------------------------------------------------------------------------\n\n /** Entries bottom first (closing ones included until removed). The same array until something changes. */\n getSnapshot(): ReadonlyArray<G9SheetEntry> {\n return this.snapshot;\n }\n\n subscribe(listener: () => void): () => void {\n this.listeners.add(listener);\n return () => {\n this.listeners.delete(listener);\n };\n }\n\n /** Open sheets (MAUI `GetOpenSheetCount`): not closing, not queued. */\n openCount(): number {\n return this.entries.filter((e) => e.status === 'opening' || e.status === 'open').length;\n }\n\n /** The top open sheet, or `null`. */\n top(): G9SheetEntry | null {\n const open = this.live();\n return open.length > 0 ? this.view(open[open.length - 1] as MutableEntry) : null;\n }\n\n // ---- entry points (MAUI helper) ------------------------------------------------------------------------------\n\n /**\n * Shows a sheet (MAUI `ShowG9BottomSheet`): stacks on an open sheet, hands off with `replaceCurrentSheet`, queues\n * behind a closing primary (one pending request; a newer one displaces it), else opens as primary. Returns `null`\n * when throttled (a second show/replace within 369 ms).\n */\n show(content: G9SheetContent, options: G9SheetOptions = {}, throttle = true): G9SheetHandle | null {\n if (this.disposed) return null;\n if (throttle && !this.passThrottle()) return null;\n const entry = this.create(content, options);\n const live = this.live();\n if (options.replaceCurrentSheet && live.length === 1 && this.config.stageBeforeShow()) {\n const old = live[0] as MutableEntry;\n old.handingOff = true;\n entry.successorOf = old.id;\n this.push(entry);\n const hold = this.config.preOpenMaxHoldMs?.();\n if (hold !== undefined) {\n this.config.setTimer(() => {\n if (entry.successorOf === old.id && entry.status === 'opening') this.beginClose(old, 'replaced');\n }, hold);\n }\n return entry.handle;\n }\n if (live.length > 0) {\n this.push(entry);\n return entry.handle;\n }\n if (this.entries.some((e) => e.status === 'closing')) {\n if (this.pending) this.finish(this.pending, 'displaced', false);\n entry.status = 'queued';\n this.pending = entry;\n for (const e of this.entries) if (e.status === 'closing') this.hurry(e);\n this.emit();\n return entry.handle;\n }\n this.push(entry);\n return entry.handle;\n }\n\n /**\n * Replaces the open sheet (MAUI `ReplaceG9BottomSheet`): in place (same frame, body cross-fade, old lifecycle not\n * run) when one fit, modal sheet is open and the new one is fit and modal without a full-screen placeholder;\n * otherwise the top sheet quick-closes through its back route and the new one opens. Throttled like `show`.\n */\n replace(content: G9SheetContent, options: G9SheetOptions = {}): G9SheetHandle | null {\n if (this.disposed) return null;\n if (!this.passThrottle()) return null;\n const live = this.live();\n const current = live.length === 1 ? (live[0] as MutableEntry) : null;\n const fit = (o: G9SheetOptions) => o.sizeMode === 'fitToContent';\n const modal = (o: G9SheetOptions) => o.isModal !== false;\n if (\n current &&\n fit(current.options) &&\n modal(current.options) &&\n fit(options) &&\n modal(options) &&\n !options.useFullScreenLoadingPlaceholder\n ) {\n const entry = this.create(content, { ...options, deferContent: false });\n entry.frameKey = current.frameKey;\n entry.version = current.version + 1;\n entry.status = 'open';\n const index = this.entries.indexOf(current);\n this.entries[index] = entry;\n this.clearTimer(current);\n current.status = 'closed';\n current.settle({ reason: 'replaced' });\n this.emit();\n this.safe(() => options.onOpened?.());\n return entry.handle;\n }\n const top = live[live.length - 1];\n if (top) {\n top.quickClose = true;\n void this.requestBack(top.id, 'toolbarButton');\n }\n return this.show(content, options, false);\n }\n\n /** Back-routes the top sheet as the toolbar button would (MAUI `CloseTopG9BottomSheet`). */\n closeTop(): void {\n const top = this.live().pop();\n if (top) void this.requestBack(top.id, 'toolbarButton');\n }\n\n /** Closes every sheet, stacked ones first (MAUI `CloseG9BottomSheet`). */\n closeAll(): void {\n const live = this.live();\n for (let i = live.length - 1; i >= 0; i--) this.beginClose(live[i] as MutableEntry, 'closeAll');\n if (this.pending) this.finish(this.pending, 'displaced', false);\n this.pending = null;\n }\n\n /** Hardware back (MAUI `HandleHardwareBackPressed`): `false` when no sheet is open, else routes it and `true`. */\n handleHardwareBack(): boolean {\n const top = this.live().pop();\n if (!top) return false;\n void this.requestBack(top.id, 'hardwareButton');\n return true;\n }\n\n /**\n * A back request for one sheet (MAUI `HandleBackRequest`): an overlay tap on a non-cancelable sheet is ignored;\n * `onBackRequested` decides when set; otherwise hardware back closes only with `hardwareBackCloses`, every other\n * source closes. Resolves `true` when the sheet closes.\n */\n async requestBack(id: number, source: G9SheetBackSource): Promise<boolean> {\n const entry = this.entries.find((e) => e.id === id);\n if (!entry || (entry.status !== 'open' && entry.status !== 'opening') || entry.backBusy) return false;\n const o = entry.options;\n if ((source === 'overlayTap' || source === 'drag') && o.isCancelable === false) return false;\n let close: boolean;\n if (o.onBackRequested) {\n entry.backBusy = true;\n let action: G9SheetBackAction = 'doNothing';\n try {\n action = await o.onBackRequested(source);\n } catch (error) {\n this.config.onError?.(error);\n } finally {\n entry.backBusy = false;\n }\n close = action === 'close';\n } else {\n close = source !== 'hardwareButton' || o.hardwareBackCloses !== false;\n }\n if (!close) return false;\n const reason: G9SheetCloseReason =\n source === 'toolbarButton'\n ? 'toolbarButton'\n : source === 'hardwareButton'\n ? 'hardwareButton'\n : source === 'overlayTap'\n ? 'overlayTap'\n : 'drag';\n return this.beginClose(entry, reason);\n }\n\n /** Updates the content (and options) of an open sheet in place, without any transition (declarative sheets). */\n update(id: number, content: G9SheetContent, options?: G9SheetOptions): void {\n const entry = this.entries.find((e) => e.id === id);\n if (!entry || entry.status === 'closed') return;\n entry.content = content;\n if (options) entry.options = options;\n this.emit();\n }\n\n /** Closes one sheet (owned handle `Close`). */\n close(id: number, reason: G9SheetCloseReason = 'closed'): boolean {\n const entry = this.entries.find((e) => e.id === id) ?? (this.pending?.id === id ? this.pending : undefined);\n if (!entry) return false;\n if (entry === this.pending) {\n this.pending = null;\n this.finish(entry, reason, false);\n return true;\n }\n return this.beginClose(entry, reason);\n }\n\n // ---- frame reports ---------------------------------------------------------------------------------------------\n\n /** The frame finished its open motion. */\n markOpened(id: number): void {\n const entry = this.entries.find((e) => e.id === id);\n if (entry?.status !== 'opening') return;\n this.clearTimer(entry);\n entry.status = 'open';\n this.emit();\n this.safe(() => entry.options.onOpened?.());\n if (entry.successorOf !== null) {\n const old = this.entries.find((e) => e.id === entry.successorOf);\n if (old) this.beginClose(old, 'replaced');\n }\n }\n\n /** The frame finished its close motion. */\n markClosed(id: number): void {\n const entry = this.entries.find((e) => e.id === id);\n if (entry?.status !== 'closing') return;\n this.clearTimer(entry);\n entry.timer = this.config.setTimer(() => this.remove(entry), g9SheetCloseGraceMs);\n }\n\n /** Host unmount: every sheet settles with `'unmount'`; nothing opens afterwards. */\n dispose(): void {\n if (this.disposed) return;\n this.disposed = true;\n if (this.pending) this.finish(this.pending, 'unmount', false);\n this.pending = null;\n for (const entry of [...this.entries]) {\n this.clearTimer(entry);\n if (entry.status !== 'closed') {\n if (!entry.closingStarted) this.safe(() => entry.options.onClosing?.());\n this.finish(entry, entry.reason ?? 'unmount', true);\n }\n }\n this.entries = [];\n this.emit();\n }\n\n // ---- internals -------------------------------------------------------------------------------------------------\n\n private live(): MutableEntry[] {\n return this.entries.filter((e) => e.status === 'opening' || e.status === 'open');\n }\n\n private passThrottle(): boolean {\n const now = this.config.now();\n if (now - this.lastShow < g9SheetShowThrottleMs) return false;\n this.lastShow = now;\n return true;\n }\n\n private create(content: G9SheetContent, options: G9SheetOptions): MutableEntry {\n const id = this.nextId++;\n let settle!: (result: G9SheetResult) => void;\n const result = new Promise<G9SheetResult>((resolve) => {\n settle = resolve;\n });\n const entry: MutableEntry = {\n id,\n frameKey: id,\n content,\n options,\n status: 'opening',\n version: 0,\n receded: false,\n quickClose: false,\n handingOff: false,\n reason: null,\n settle,\n timer: null,\n successorOf: null,\n closingStarted: false,\n backBusy: false,\n handle: {\n id,\n result,\n get isOpen() {\n return entry.status === 'opening' || entry.status === 'open' || entry.status === 'queued';\n },\n close: () => {\n this.close(id);\n },\n closeAsync: async () => {\n this.close(id);\n await result;\n },\n show: (c, o) => this.show(c, o),\n closeTop: () => this.closeTop(),\n },\n };\n return entry;\n }\n\n private push(entry: MutableEntry): void {\n const parent = this.live().pop();\n if (\n parent &&\n entry.successorOf === null &&\n entry.options.recedeParentOnStack !== false &&\n !this.isFullScreen(parent)\n ) {\n parent.receded = true;\n }\n entry.status = 'opening';\n this.entries.push(entry);\n this.safe(() => entry.options.onOpening?.());\n entry.timer = this.config.setTimer(() => this.markOpened(entry.id), this.config.durations(entry.options).open);\n this.emit();\n }\n\n private isFullScreen(entry: MutableEntry): boolean {\n const states = entry.options.states;\n return entry.options.sizeMode !== 'fitToContent' && !!states && states.length === 1 && states[0] === 'large';\n }\n\n private beginClose(entry: MutableEntry, reason: G9SheetCloseReason): boolean {\n if (entry.status === 'closing' || entry.status === 'closed') return false;\n if (entry.status === 'queued') {\n this.finish(entry, reason, false);\n return true;\n }\n this.clearTimer(entry);\n entry.status = 'closing';\n entry.reason = reason;\n entry.closingStarted = true;\n this.safe(() => entry.options.onClosing?.());\n // A successor still staging hands the primary back.\n for (const e of this.entries) if (e.successorOf === entry.id && e.status !== 'closed') e.successorOf = null;\n entry.handingOff = false;\n const close = this.config.durations(entry.options).close * (entry.quickClose ? 0.5 : 1);\n entry.timer = this.config.setTimer(() => this.remove(entry), close + g9SheetCloseGraceMs);\n this.restoreParent(entry);\n this.emit();\n return true;\n }\n\n /** Quick close of an entry already closing: its removal comes at half the close duration from now. */\n private hurry(entry: MutableEntry): void {\n if (entry.quickClose) return;\n entry.quickClose = true;\n this.clearTimer(entry);\n const close = this.config.durations(entry.options).close * 0.5;\n entry.timer = this.config.setTimer(() => this.remove(entry), close + g9SheetCloseGraceMs);\n }\n\n private restoreParent(closing: MutableEntry): void {\n const index = this.entries.indexOf(closing);\n const parents = this.entries.slice(0, index).filter((e) => e.status === 'opening' || e.status === 'open');\n const parent = parents[parents.length - 1];\n const stillAbove = this.entries.slice(index + 1).some((e) => e.status === 'opening' || e.status === 'open');\n if (parent && !stillAbove) parent.receded = false;\n }\n\n private remove(entry: MutableEntry): void {\n this.clearTimer(entry);\n const index = this.entries.indexOf(entry);\n if (index >= 0) this.entries.splice(index, 1);\n this.finish(entry, entry.reason ?? 'closed', true);\n if (this.pending && !this.entries.some((e) => e.status === 'closing') && this.live().length === 0) {\n const next = this.pending;\n this.pending = null;\n this.push(next);\n return;\n }\n this.emit();\n }\n\n private finish(entry: MutableEntry, reason: G9SheetCloseReason, runClosed: boolean): void {\n if (entry.status === 'closed') return;\n entry.status = 'closed';\n entry.reason = entry.reason ?? reason;\n if (runClosed) this.safe(() => entry.options.onClosed?.());\n entry.settle({ reason: entry.reason });\n }\n\n private clearTimer(entry: MutableEntry): void {\n if (entry.timer !== null) this.config.clearTimer(entry.timer);\n entry.timer = null;\n }\n\n private safe(action: () => void): void {\n try {\n action();\n } catch (error) {\n this.config.onError?.(error);\n }\n }\n\n private view(entry: MutableEntry): G9SheetEntry {\n return {\n id: entry.id,\n frameKey: entry.frameKey,\n content: entry.content,\n options: entry.options,\n status: entry.status,\n version: entry.version,\n receded: entry.receded,\n quickClose: entry.quickClose,\n handingOff: entry.handingOff,\n reason: entry.reason,\n };\n }\n\n private emit(): void {\n this.snapshot = this.entries.map((e) => this.view(e));\n for (const listener of [...this.listeners]) listener();\n }\n\n /** The handle of an entry (frames inject it into their content). */\n handleOf(id: number): G9SheetHandle | null {\n return this.entries.find((e) => e.id === id)?.handle ?? null;\n }\n}\n"],"names":["g9SheetShowThrottleMs","g9SheetCloseGraceMs","G9SheetStack","listener","e","open","content","options","throttle","entry","live","_this_config","old","hold","undefined","current","fit","o","modal","index","top","i","id","source","close","action","error","reason","_this_entries_find","_this_pending","_entry_options","_entry_reason","now","settle","result","Promise","resolve","c","parent","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E,KAAKkB,GAAE,IAApCM,KAAAA,IAAAA,mBAAuC,MAAM,AAAD,IAAC,OAAI;IAC1D;IArZA,YAAYiB,MAA0B,CAAE;QATxC,uBAAiB,UAAjB;QACA,uBAAQ,WAA0B,EAAE;QACpC,uBAAQ,WAA+B;QACvC,uBAAQ,YAAWC,MAAwB;QAC3C,uBAAQ,UAAS;QACjB,uBAAiB,aAAY,IAAIC;QACjC,uBAAQ,YAAwC,EAAE;QAClD,uBAAQ,YAAW;QAGjB,IAAI,CAAC,MAAM,GAAGF;IAChB;AAoZF"}
1
+ {"version":3,"file":"sheet/stack.jsx","sources":["../../src/sheet/stack.ts"],"sourcesContent":["import type { ReactNode } from '@lynx-js/react';\nimport type { G9SheetBackAction, G9SheetBackSource, G9SheetOptions } from './options';\n\n// The sheet stack (MAUI G9BottomSheetHelper's stacking, replace, hand-off, back routing and lifecycle), independent\n// of rendering so it can be model-tested. The frame component reports motion ends (`markOpened`, `markClosed`); timer\n// fallbacks make every transition finish even when no motion event arrives.\n\n/** Why a sheet's result settled. Every sheet settles exactly once. */\nexport type G9SheetCloseReason =\n /** `handle.close()` / `closeAsync()`. */\n | 'closed'\n /** `closeAll()` (MAUI `CloseG9BottomSheet`). */\n | 'closeAll'\n /** The header back/close button or `closeTop()`. */\n | 'toolbarButton'\n /** Hardware back / desktop Escape. */\n | 'hardwareButton'\n /** A tap on the scrim. */\n | 'overlayTap'\n /** Dragged closed. */\n | 'drag'\n /** Replaced in place or handed off to a successor. */\n | 'replaced'\n /** A queued request displaced by a newer one before it opened. */\n | 'displaced'\n /** The host unmounted. */\n | 'unmount';\n\n/** The result of one sheet. */\nexport interface G9SheetResult {\n readonly reason: G9SheetCloseReason;\n}\n\n/** What a sheet shows: a node, or a factory built after the open motion (deferred content). */\nexport type G9SheetContent = ReactNode | (() => ReactNode);\n\n/** Lifecycle status of an entry. */\nexport type G9SheetStatus = 'queued' | 'opening' | 'open' | 'closing' | 'closed';\n\n/** One sheet of the stack (read-only snapshot for rendering). */\nexport interface G9SheetEntry {\n readonly id: number;\n /** Identity of the rendered frame; kept by an in-place replace. */\n readonly frameKey: number;\n readonly content: G9SheetContent;\n readonly options: G9SheetOptions;\n readonly status: G9SheetStatus;\n /** Bumped by an in-place replace (the frame cross-fades its body). */\n readonly version: number;\n /** The sheet above this one recedes it. */\n readonly receded: boolean;\n /** Close motion runs at half duration (replace fallback). */\n readonly quickClose: boolean;\n /** The entry is handing its dim to a successor (its scrim is transparent). */\n readonly handingOff: boolean;\n /**\n * The entry took the dim over from the sheet before it (a hand-off, or a sheet shown right after another closed): while\n * it opens its dim stands at full strength from the first frame instead of fading in from nothing.\n */\n readonly inheritsDim: boolean;\n /** Closing without a visible motion (whole-stack teardown keeps recede links static). */\n readonly reason: G9SheetCloseReason | null;\n}\n\n/** A handle to one sheet (MAUI `IG9BottomSheetHandle`, sheet-scoped). */\nexport interface G9SheetHandle {\n readonly id: number;\n /** Settles once with the close reason, after the sheet left the screen. */\n readonly result: Promise<G9SheetResult>;\n /** `true` until the sheet started closing. */\n readonly isOpen: boolean;\n /** Closes this sheet (MAUI owned-handle `Close`). */\n close(): void;\n /** Closes this sheet and resolves when it is gone (MAUI `CloseAsync`). */\n closeAsync(): Promise<void>;\n /** Opens another sheet on top (MAUI `Show`, auto-stacking). */\n show(content: G9SheetContent, options?: G9SheetOptions): G9SheetHandle | null;\n /** Back-routes the top sheet (MAUI `CloseTop`). */\n closeTop(): void;\n}\n\n/** Timing and policy the stack needs from its host. */\nexport interface G9SheetStackConfig {\n /** Monotonic ms. */\n now(): number;\n setTimer(callback: () => void, ms: number): unknown;\n clearTimer(handle: unknown): void;\n /** Open/close durations (ms) for an entry's fallback timers. */\n durations(options: G9SheetOptions): { open: number; close: number };\n /** Hand-off needs the staged pipeline (`settings.stageBeforeShow`). */\n stageBeforeShow(): boolean;\n /**\n * Longest a hand-off waits for its successor to report open before the predecessor closes anyway (ms; MAUI\n * `PreOpenMaxHoldMs`). Default: only the successor's open fallback timer bounds it.\n */\n preOpenMaxHoldMs?(): number;\n /** A lifecycle callback threw. */\n onError?(error: unknown): void;\n}\n\n/** MAUI `G9SafeCommand` throttle window shared by show and replace. */\nexport const g9SheetShowThrottleMs = 369;\n/** Grace after the close motion before cleanup (MAUI page-side reset). */\nexport const g9SheetCloseGraceMs = 48;\n/**\n * A modal sheet shown this soon after another began closing takes its place at once (a successor) instead of waiting\n * for the close to end: «close the menu, open the chosen sheet» in one tap otherwise faded the page's dim out to nothing\n * and in again (AgriPad «فهرست‌ها» → «دانلود تصویر پهپاد», DOOGEE round 2026-11-12, TR-0062).\n */\nexport const g9SheetHandOffWindowMs = 120;\n/** How long the leaving sheet keeps its dim under a successor's newly created one (two frames at 60 Hz). */\nexport const g9SheetDimHandOverMs = 34;\n\ninterface MutableEntry {\n id: number;\n frameKey: number;\n content: G9SheetContent;\n options: G9SheetOptions;\n status: G9SheetStatus;\n version: number;\n receded: boolean;\n quickClose: boolean;\n handingOff: boolean;\n inheritsDim: boolean;\n closeStartedAt: number;\n reason: G9SheetCloseReason | null;\n settle: (result: G9SheetResult) => void;\n handle: G9SheetHandle;\n timer: unknown;\n successorOf: number | null;\n closingStarted: boolean;\n backBusy: boolean;\n}\n\n/** The stack of one host. */\nexport class G9SheetStack {\n private readonly config: G9SheetStackConfig;\n private entries: MutableEntry[] = [];\n private pending: MutableEntry | null = null;\n private lastShow = Number.NEGATIVE_INFINITY;\n private nextId = 1;\n private readonly listeners = new Set<() => void>();\n private snapshot: ReadonlyArray<G9SheetEntry> = [];\n private disposed = false;\n\n constructor(config: G9SheetStackConfig) {\n this.config = config;\n }\n\n // ---- observation ---------------------------------------------------------------------------------------------\n\n /** Entries bottom first (closing ones included until removed). The same array until something changes. */\n getSnapshot(): ReadonlyArray<G9SheetEntry> {\n return this.snapshot;\n }\n\n subscribe(listener: () => void): () => void {\n this.listeners.add(listener);\n return () => {\n this.listeners.delete(listener);\n };\n }\n\n /** Open sheets (MAUI `GetOpenSheetCount`): not closing, not queued. */\n openCount(): number {\n return this.entries.filter((e) => e.status === 'opening' || e.status === 'open').length;\n }\n\n /** The top open sheet, or `null`. */\n top(): G9SheetEntry | null {\n const open = this.live();\n return open.length > 0 ? this.view(open[open.length - 1] as MutableEntry) : null;\n }\n\n // ---- entry points (MAUI helper) ------------------------------------------------------------------------------\n\n /**\n * Shows a sheet (MAUI `ShowG9BottomSheet`): stacks on an open sheet, hands off with `replaceCurrentSheet`, queues\n * behind a closing primary (one pending request; a newer one displaces it), else opens as primary. Returns `null`\n * when throttled (a second show/replace within 369 ms).\n */\n show(content: G9SheetContent, options: G9SheetOptions = {}, throttle = true): G9SheetHandle | null {\n if (this.disposed) return null;\n if (throttle && !this.passThrottle()) return null;\n const entry = this.create(content, options);\n const live = this.live();\n if (options.replaceCurrentSheet && live.length === 1 && this.config.stageBeforeShow()) {\n const old = live[0] as MutableEntry;\n old.handingOff = true;\n entry.inheritsDim = old.options.isModal !== false && options.isModal !== false;\n entry.successorOf = old.id;\n this.push(entry);\n const hold = this.config.preOpenMaxHoldMs?.();\n if (hold !== undefined) {\n this.config.setTimer(() => {\n if (entry.successorOf === old.id && entry.status === 'opening') this.beginClose(old, 'replaced');\n }, hold);\n }\n return entry.handle;\n }\n if (live.length > 0) {\n this.push(entry);\n return entry.handle;\n }\n const leaving = this.entries.find(\n (e) =>\n e.status === 'closing' &&\n e.options.isModal !== false &&\n this.config.now() - e.closeStartedAt <= g9SheetHandOffWindowMs,\n );\n if (leaving && options.isModal !== false) {\n // The one that just began closing goes on underneath; its dim is handed over once the successor's is drawn — a\n // new frame needs a frame or two to exist, and dropping the old dim in the same render lit the page for one frame.\n entry.inheritsDim = true;\n this.push(entry);\n this.config.setTimer(() => {\n if (leaving.status !== 'closing') return;\n leaving.handingOff = true;\n this.emit();\n }, g9SheetDimHandOverMs);\n return entry.handle;\n }\n if (this.entries.some((e) => e.status === 'closing')) {\n if (this.pending) this.finish(this.pending, 'displaced', false);\n entry.status = 'queued';\n this.pending = entry;\n for (const e of this.entries) if (e.status === 'closing') this.hurry(e);\n this.emit();\n return entry.handle;\n }\n this.push(entry);\n return entry.handle;\n }\n\n /**\n * Replaces the open sheet (MAUI `ReplaceG9BottomSheet`): in place (same frame, body cross-fade, old lifecycle not\n * run) when one fit, modal sheet is open and the new one is fit and modal without a full-screen placeholder;\n * otherwise the top sheet quick-closes through its back route and the new one opens. Throttled like `show`.\n */\n replace(content: G9SheetContent, options: G9SheetOptions = {}): G9SheetHandle | null {\n if (this.disposed) return null;\n if (!this.passThrottle()) return null;\n const live = this.live();\n const current = live.length === 1 ? (live[0] as MutableEntry) : null;\n const fit = (o: G9SheetOptions) => o.sizeMode === 'fitToContent';\n const modal = (o: G9SheetOptions) => o.isModal !== false;\n if (\n current &&\n fit(current.options) &&\n modal(current.options) &&\n fit(options) &&\n modal(options) &&\n !options.useFullScreenLoadingPlaceholder\n ) {\n const entry = this.create(content, { ...options, deferContent: false });\n entry.frameKey = current.frameKey;\n entry.version = current.version + 1;\n entry.status = 'open';\n const index = this.entries.indexOf(current);\n this.entries[index] = entry;\n this.clearTimer(current);\n current.status = 'closed';\n current.settle({ reason: 'replaced' });\n this.emit();\n this.safe(() => options.onOpened?.());\n return entry.handle;\n }\n const top = live[live.length - 1];\n if (top) {\n top.quickClose = true;\n void this.requestBack(top.id, 'toolbarButton');\n }\n return this.show(content, options, false);\n }\n\n /** Back-routes the top sheet as the toolbar button would (MAUI `CloseTopG9BottomSheet`). */\n closeTop(): void {\n const top = this.live().pop();\n if (top) void this.requestBack(top.id, 'toolbarButton');\n }\n\n /** Closes every sheet, stacked ones first (MAUI `CloseG9BottomSheet`). */\n closeAll(): void {\n const live = this.live();\n for (let i = live.length - 1; i >= 0; i--) this.beginClose(live[i] as MutableEntry, 'closeAll');\n if (this.pending) this.finish(this.pending, 'displaced', false);\n this.pending = null;\n }\n\n /** Hardware back (MAUI `HandleHardwareBackPressed`): `false` when no sheet is open, else routes it and `true`. */\n handleHardwareBack(): boolean {\n const top = this.live().pop();\n if (!top) return false;\n void this.requestBack(top.id, 'hardwareButton');\n return true;\n }\n\n /**\n * A back request for one sheet (MAUI `HandleBackRequest`): an overlay tap on a non-cancelable sheet is ignored;\n * `onBackRequested` decides when set; otherwise hardware back closes only with `hardwareBackCloses`, every other\n * source closes. Resolves `true` when the sheet closes.\n */\n async requestBack(id: number, source: G9SheetBackSource): Promise<boolean> {\n const entry = this.entries.find((e) => e.id === id);\n if (!entry || (entry.status !== 'open' && entry.status !== 'opening') || entry.backBusy) return false;\n const o = entry.options;\n if ((source === 'overlayTap' || source === 'drag') && o.isCancelable === false) return false;\n let close: boolean;\n if (o.onBackRequested) {\n entry.backBusy = true;\n let action: G9SheetBackAction = 'doNothing';\n try {\n action = await o.onBackRequested(source);\n } catch (error) {\n this.config.onError?.(error);\n } finally {\n entry.backBusy = false;\n }\n close = action === 'close';\n } else {\n close = source !== 'hardwareButton' || o.hardwareBackCloses !== false;\n }\n if (!close) return false;\n const reason: G9SheetCloseReason =\n source === 'toolbarButton'\n ? 'toolbarButton'\n : source === 'hardwareButton'\n ? 'hardwareButton'\n : source === 'overlayTap'\n ? 'overlayTap'\n : 'drag';\n return this.beginClose(entry, reason);\n }\n\n /** Updates the content (and options) of an open sheet in place, without any transition (declarative sheets). */\n update(id: number, content: G9SheetContent, options?: G9SheetOptions): void {\n const entry = this.entries.find((e) => e.id === id);\n if (!entry || entry.status === 'closed') return;\n entry.content = content;\n if (options) entry.options = options;\n this.emit();\n }\n\n /** Closes one sheet (owned handle `Close`). */\n close(id: number, reason: G9SheetCloseReason = 'closed'): boolean {\n const entry = this.entries.find((e) => e.id === id) ?? (this.pending?.id === id ? this.pending : undefined);\n if (!entry) return false;\n if (entry === this.pending) {\n this.pending = null;\n this.finish(entry, reason, false);\n return true;\n }\n return this.beginClose(entry, reason);\n }\n\n // ---- frame reports ---------------------------------------------------------------------------------------------\n\n /** The frame finished its open motion. */\n markOpened(id: number): void {\n const entry = this.entries.find((e) => e.id === id);\n if (entry?.status !== 'opening') return;\n this.clearTimer(entry);\n entry.status = 'open';\n this.emit();\n this.safe(() => entry.options.onOpened?.());\n if (entry.successorOf !== null) {\n const old = this.entries.find((e) => e.id === entry.successorOf);\n if (old) this.beginClose(old, 'replaced');\n }\n }\n\n /** The frame finished its close motion. */\n markClosed(id: number): void {\n const entry = this.entries.find((e) => e.id === id);\n if (entry?.status !== 'closing') return;\n this.clearTimer(entry);\n entry.timer = this.config.setTimer(() => this.remove(entry), g9SheetCloseGraceMs);\n }\n\n /** Host unmount: every sheet settles with `'unmount'`; nothing opens afterwards. */\n dispose(): void {\n if (this.disposed) return;\n this.disposed = true;\n if (this.pending) this.finish(this.pending, 'unmount', false);\n this.pending = null;\n for (const entry of [...this.entries]) {\n this.clearTimer(entry);\n if (entry.status !== 'closed') {\n if (!entry.closingStarted) this.safe(() => entry.options.onClosing?.());\n this.finish(entry, entry.reason ?? 'unmount', true);\n }\n }\n this.entries = [];\n this.emit();\n }\n\n // ---- internals -------------------------------------------------------------------------------------------------\n\n private live(): MutableEntry[] {\n return this.entries.filter((e) => e.status === 'opening' || e.status === 'open');\n }\n\n private passThrottle(): boolean {\n const now = this.config.now();\n if (now - this.lastShow < g9SheetShowThrottleMs) return false;\n this.lastShow = now;\n return true;\n }\n\n private create(content: G9SheetContent, options: G9SheetOptions): MutableEntry {\n const id = this.nextId++;\n let settle!: (result: G9SheetResult) => void;\n const result = new Promise<G9SheetResult>((resolve) => {\n settle = resolve;\n });\n const entry: MutableEntry = {\n id,\n frameKey: id,\n content,\n options,\n status: 'opening',\n version: 0,\n receded: false,\n quickClose: false,\n handingOff: false,\n inheritsDim: false,\n closeStartedAt: Number.NEGATIVE_INFINITY,\n reason: null,\n settle,\n timer: null,\n successorOf: null,\n closingStarted: false,\n backBusy: false,\n handle: {\n id,\n result,\n get isOpen() {\n return entry.status === 'opening' || entry.status === 'open' || entry.status === 'queued';\n },\n close: () => {\n this.close(id);\n },\n closeAsync: async () => {\n this.close(id);\n await result;\n },\n show: (c, o) => this.show(c, o),\n closeTop: () => this.closeTop(),\n },\n };\n return entry;\n }\n\n private push(entry: MutableEntry): void {\n const parent = this.live().pop();\n if (\n parent &&\n entry.successorOf === null &&\n entry.options.recedeParentOnStack !== false &&\n !this.isFullScreen(parent)\n ) {\n parent.receded = true;\n }\n entry.status = 'opening';\n this.entries.push(entry);\n this.safe(() => entry.options.onOpening?.());\n entry.timer = this.config.setTimer(() => this.markOpened(entry.id), this.config.durations(entry.options).open);\n this.emit();\n }\n\n private isFullScreen(entry: MutableEntry): boolean {\n const states = entry.options.states;\n return entry.options.sizeMode !== 'fitToContent' && !!states && states.length === 1 && states[0] === 'large';\n }\n\n private beginClose(entry: MutableEntry, reason: G9SheetCloseReason): boolean {\n if (entry.status === 'closing' || entry.status === 'closed') return false;\n if (entry.status === 'queued') {\n this.finish(entry, reason, false);\n return true;\n }\n this.clearTimer(entry);\n entry.status = 'closing';\n entry.reason = reason;\n entry.closingStarted = true;\n entry.closeStartedAt = this.config.now();\n this.safe(() => entry.options.onClosing?.());\n // A successor still staging hands the primary back.\n for (const e of this.entries) if (e.successorOf === entry.id && e.status !== 'closed') e.successorOf = null;\n // A sheet closing because its successor took over keeps its dim handed over: clearing the flag here brought its\n // scrim back to full strength under the successor's for the whole close motion, then removed it — the page behind\n // went darker and lighter again on every hand-off (AgriPad «عملیات» → «گزارش جدید», TR-0062, 2026-11-12).\n if (reason !== 'replaced') entry.handingOff = false;\n const close = this.config.durations(entry.options).close * (entry.quickClose ? 0.5 : 1);\n entry.timer = this.config.setTimer(() => this.remove(entry), close + g9SheetCloseGraceMs);\n this.restoreParent(entry);\n this.emit();\n return true;\n }\n\n /** Quick close of an entry already closing: its removal comes at half the close duration from now. */\n private hurry(entry: MutableEntry): void {\n if (entry.quickClose) return;\n entry.quickClose = true;\n this.clearTimer(entry);\n const close = this.config.durations(entry.options).close * 0.5;\n entry.timer = this.config.setTimer(() => this.remove(entry), close + g9SheetCloseGraceMs);\n }\n\n private restoreParent(closing: MutableEntry): void {\n const index = this.entries.indexOf(closing);\n const parents = this.entries.slice(0, index).filter((e) => e.status === 'opening' || e.status === 'open');\n const parent = parents[parents.length - 1];\n const stillAbove = this.entries.slice(index + 1).some((e) => e.status === 'opening' || e.status === 'open');\n if (parent && !stillAbove) parent.receded = false;\n }\n\n private remove(entry: MutableEntry): void {\n this.clearTimer(entry);\n const index = this.entries.indexOf(entry);\n if (index >= 0) this.entries.splice(index, 1);\n this.finish(entry, entry.reason ?? 'closed', true);\n if (this.pending && !this.entries.some((e) => e.status === 'closing') && this.live().length === 0) {\n const next = this.pending;\n this.pending = null;\n this.push(next);\n return;\n }\n this.emit();\n }\n\n private finish(entry: MutableEntry, reason: G9SheetCloseReason, runClosed: boolean): void {\n if (entry.status === 'closed') return;\n entry.status = 'closed';\n entry.reason = entry.reason ?? reason;\n if (runClosed) this.safe(() => entry.options.onClosed?.());\n entry.settle({ reason: entry.reason });\n }\n\n private clearTimer(entry: MutableEntry): void {\n if (entry.timer !== null) this.config.clearTimer(entry.timer);\n entry.timer = null;\n }\n\n private safe(action: () => void): void {\n try {\n action();\n } catch (error) {\n this.config.onError?.(error);\n }\n }\n\n private view(entry: MutableEntry): G9SheetEntry {\n return {\n id: entry.id,\n frameKey: entry.frameKey,\n content: entry.content,\n options: entry.options,\n status: entry.status,\n version: entry.version,\n receded: entry.receded,\n quickClose: entry.quickClose,\n handingOff: entry.handingOff,\n inheritsDim: entry.inheritsDim,\n reason: entry.reason,\n };\n }\n\n private emit(): void {\n this.snapshot = this.entries.map((e) => this.view(e));\n for (const listener of [...this.listeners]) listener();\n }\n\n /** The handle of an entry (frames inject it into their content). */\n handleOf(id: number): G9SheetHandle | null {\n return this.entries.find((e) => e.id === id)?.handle ?? null;\n }\n}\n"],"names":["g9SheetShowThrottleMs","g9SheetCloseGraceMs","g9SheetHandOffWindowMs","g9SheetDimHandOverMs","G9SheetStack","listener","e","open","content","options","throttle","entry","live","_this_config","old","hold","undefined","leaving","current","fit","o","modal","index","top","i","id","source","close","action","error","reason","_this_entries_find","_this_pending","_entry_options","_entry_reason","now","settle","result","Promise","resolve","Number","c","parent","states","closing","parents","stillAbove","next","runClosed","config","Set"],"mappings":";;;;;;;;;;AAqGO,MAAMA,wBAAwB;AAE9B,MAAMC,sBAAsB;AAM5B,MAAMC,yBAAyB;AAE/B,MAAMC,uBAAuB;AAwB7B,MAAMC;IAiBX,cAA2C;QACzC,OAAO,IAAI,CAAC,QAAQ;IACtB;IAEA,UAAUC,QAAoB,EAAc;QAC1C,IAAI,CAAC,SAAS,CAAC,GAAG,CAACA;QACnB,OAAO;YACL,IAAI,CAAC,SAAS,CAAC,MAAM,CAACA;QACxB;IACF;IAGA,YAAoB;QAClB,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAACC,IAAMA,AAAa,cAAbA,EAAE,MAAM,IAAkBA,AAAa,WAAbA,EAAE,MAAM,EAAa,MAAM;IACzF;IAGA,MAA2B;QACzB,MAAMC,OAAO,IAAI,CAAC,IAAI;QACtB,OAAOA,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,IAAI,CAACA,IAAI,CAACA,KAAK,MAAM,GAAG,EAAE,IAAoB;IAC9E;IASA,KAAKC,OAAuB,EAAEC,UAA0B,CAAC,CAAC,EAAEC,WAAW,IAAI,EAAwB;QACjG,IAAI,IAAI,CAAC,QAAQ,EAAE,OAAO;QAC1B,IAAIA,YAAY,CAAC,IAAI,CAAC,YAAY,IAAI,OAAO;QAC7C,MAAMC,QAAQ,IAAI,CAAC,MAAM,CAACH,SAASC;QACnC,MAAMG,OAAO,IAAI,CAAC,IAAI;QACtB,IAAIH,QAAQ,mBAAmB,IAAIG,AAAgB,MAAhBA,KAAK,MAAM,IAAU,IAAI,CAAC,MAAM,CAAC,eAAe,IAAI;gBAMxEC,+BAAAA;YALb,MAAMC,MAAMF,IAAI,CAAC,EAAE;YACnBE,IAAI,UAAU,GAAG;YACjBH,MAAM,WAAW,GAAGG,AAAwB,UAAxBA,IAAI,OAAO,CA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@@ -1,3 +1,3 @@
1
- export { createSwipeGroup, type G9SwipeAction, type G9SwipeGroupStore, g9SwipeDefaultActionWidth, g9SwipeDefaultCornerRadius, g9SwipeSnapMs, swipeActionColors, swipePaneWidth, swipePhysicalWidths, swipeSnap, swipeSnapMT, } from './model.js';
1
+ export { createSwipeGroup, type G9SwipeAction, type G9SwipeGroupStore, g9SwipeDefaultActionWidth, g9SwipeDefaultCornerRadius, g9SwipeSnapMs, swipeActionColors, swipeDragTarget, swipeDragTargetMT, swipePaneWidth, swipePhysicalWidths, swipeSnap, swipeSnapMT, } from './model.js';
2
2
  export { G9SwipeGroup, G9SwipeView, type G9SwipeViewProps } from './swipe-view.js';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/swipe/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,yBAAyB,EACzB,0BAA0B,EAC1B,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,SAAS,EACT,WAAW,GACZ,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/swipe/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,yBAAyB,EACzB,0BAA0B,EAC1B,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,SAAS,EACT,WAAW,GACZ,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC"}
@@ -1,2 +1,2 @@
1
- export { createSwipeGroup, g9SwipeDefaultActionWidth, g9SwipeDefaultCornerRadius, g9SwipeSnapMs, swipeActionColors, swipePaneWidth, swipePhysicalWidths, swipeSnap, swipeSnapMT } from "./model.jsx";
1
+ export { createSwipeGroup, g9SwipeDefaultActionWidth, g9SwipeDefaultCornerRadius, g9SwipeSnapMs, swipeActionColors, swipeDragTarget, swipeDragTargetMT, swipePaneWidth, swipePhysicalWidths, swipeSnap, swipeSnapMT } from "./model.jsx";
2
2
  export { G9SwipeGroup, G9SwipeView } from "./swipe-view.jsx";
@@ -49,6 +49,15 @@ export declare function swipePhysicalWidths(leading: number, trailing: number, r
49
49
  * body's x offset; returns `leftWidth` (left pane open), `-rightWidth` (right pane open) or 0.
50
50
  */
51
51
  export declare function swipeSnap(translate: number, leftWidth: number, rightWidth: number): number;
52
+ /**
53
+ * Where a drag puts the body: inside [-rightWidth, leftWidth]. lynx-ui `Draggable` clamps the finger's DELTA to its bounds,
54
+ * not the resulting position, so with the pane widths as bounds a FULLY open row (at -84) could not be dragged back: every
55
+ * drag toward closed was a delta outside [-84, 0] (AgriPad TR-0070, ITCS-16237 — «once fully open it stays open»). The row
56
+ * gives `Draggable` the whole travel as its delta bounds and clamps the position here, every frame.
57
+ */
58
+ export declare function swipeDragTarget(x: number, leftWidth: number, rightWidth: number): number;
59
+ /** Main-thread twin of {@link swipeDragTarget}. */
60
+ export declare function swipeDragTargetMT(x: number, leftWidth: number, rightWidth: number): number;
52
61
  /** Main-thread twin of {@link swipeSnap} (plan/specs/02 §3). */
53
62
  export declare function swipeSnapMT(translate: number, leftWidth: number, rightWidth: number): number;
54
63
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/swipe/model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,mFAAmF;AACnF,eAAO,MAAM,yBAAyB,KAAK,CAAC;AAC5C,+EAA+E;AAC/E,eAAO,MAAM,0BAA0B,KAAK,CAAC;AA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AM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAEnD;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAI1F;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAExF;AAED,mDAAmD;AACnD,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAG1F;AAED,gEAAgE;AAChE,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAK5F;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,uDAAuD;IACvD,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;IAC5C,kEAAkE;IAClE,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,mCAAmC;IACnC,QAAQ,IAAI,IAAI,CAAC;IACjB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,iBAAiB,CAmBpD"}
@@ -31,6 +31,13 @@ function swipeSnap(translate, leftWidth, rightWidth) {
31
31
  if (translate < 0 && rightWidth > 0 && -translate > rightWidth / 2) return -rightWidth;
32
32
  return 0;
33
33
  }
34
+ function swipeDragTarget(x, leftWidth, rightWidth) {
35
+ return Math.min(Math.max(x, -rightWidth), leftWidth);
36
+ }
37
+ function swipeDragTargetMT(x, leftWidth, rightWidth) {
38
+ 'main thread';
39
+ return Math.min(Math.max(x, -rightWidth), leftWidth);
40
+ }
34
41
  function swipeSnapMT(translate, leftWidth, rightWidth) {
35
42
  'main thread';
36
43
  if (translate > 0 && leftWidth > 0 && translate > leftWidth / 2) return leftWidth;
@@ -61,6 +68,6 @@ function createSwipeGroup() {
61
68
  }
62
69
  };
63
70
  }
64
- export { createSwipeGroup, g9SwipeDefaultActionWidth, g9SwipeDefaultCornerRadius, g9SwipeSnapMs, swipeActionColors, swipePaneWidth, swipePhysicalWidths, swipeSnap, swipeSnapMT };
71
+ export { createSwipeGroup, g9SwipeDefaultActionWidth, g9SwipeDefaultCornerRadius, g9SwipeSnapMs, swipeActionColors, swipeDragTarget, swipeDragTargetMT, swipePaneWidth, swipePhysicalWidths, swipeSnap, swipeSnapMT };
65
72
 
66
73
  //# sourceMappingURL=model.jsx.map
@@ -1 +1 @@
1
- {"version":3,"file":"swipe/model.jsx","sources":["../../src/swipe/model.ts"],"sourcesContent":["import type { G9IconInput } from '../icon/icon';\n\n/** Pane width when an action sets none (MAUI `G9SwipeView.DefaultActionWidth`). */\nexport const g9SwipeDefaultActionWidth = 88;\n/** Outer card radius (MAUI `G9SwipeView.CornerRadius` default, `RadiusMd`). */\nexport const g9SwipeDefaultCornerRadius = 14;\n/** Snap animation after a release or a programmatic open / close. */\nexport const g9SwipeSnapMs = 200;\n\n/** One action pane of a swipe row (MAUI `G9SwipeAction`). Change a field and re-render to update it in place. */\nexport interface G9SwipeAction {\n /** Label under the icon; localize before assigning. */\n readonly text?: string | null;\n readonly icon?: G9IconInput;\n /** Pane fill. Default primary, or error when `isDestructive`. */\n readonly background?: string | null;\n /** Icon and label colour. Default on-primary, or on-error when `isDestructive`. */\n readonly foreground?: string | null;\n readonly isDestructive?: boolean;\n /** Hidden panes keep their place in the list but take no width. Default true. */\n readonly isVisible?: boolean;\n /** A disabled pane ignores taps without dimming. Default true. */\n readonly isEnabled?: boolean;\n /** Icon size. Default 22. */\n readonly iconSize?: number;\n /** Pane width. Default {@link g9SwipeDefaultActionWidth}. */\n readonly widthRequest?: number;\n /** Runs on a tap with `commandParameter`; an async command runs once until it settles (MAUI `Command`). */\n readonly command?: (parameter: unknown) => void | Promise<void>;\n readonly commandParameter?: unknown;\n /** Raised on a tap, before the command (MAUI `Invoked`). */\n readonly onInvoked?: (action: G9SwipeAction) => void;\n}\n\n/** Colours of a pane (MAUI theme resolution with the destructive shortcut; explicit colours win). */\nexport function swipeActionColors(action: G9SwipeAction): { readonly background: string; readonly foreground: string } {\n const destructive = action.isDestructive === true;\n return {\n background: action.background ?? (destructive ? 'var(--g9-error)' : 'var(--g9-primary)'),\n foreground: action.foreground ?? (destructive ? 'var(--g9-on-error)' : 'var(--g9-on-primary)'),\n };\n}\n\n/** Total width of the visible panes on one edge. */\nexport function swipePaneWidth(actions: readonly G9SwipeAction[] | null | undefined): number {\n let width = 0;\n for (const action of actions ?? []) {\n if (action.isVisible === false) continue;\n width += action.widthRequest ?? g9SwipeDefaultActionWidth;\n }\n return width;\n}\n\n/**\n * Physical pane widths: leading actions sit on the reading-start edge (left in LTR, right in RTL), so a positive\n * translation (body moved right) reveals the physical-left pane.\n */\nexport function swipePhysicalWidths(\n leading: number,\n trailing: number,\n rtl: boolean,\n): { readonly left: number; readonly right: number } {\n return rtl ? { left: trailing, right: leading } : { left: leading, right: trailing };\n}\n\n/**\n * Where a released body settles (MAUI Windows drag: past half the pane snaps open, else closed). `translate` is the\n * body's x offset; returns `leftWidth` (left pane open), `-rightWidth` (right pane open) or 0.\n */\nexport function swipeSnap(translate: number, leftWidth: number, rightWidth: number): number {\n if (translate > 0 && leftWidth > 0 && translate > leftWidth / 2) return leftWidth;\n if (translate < 0 && rightWidth > 0 && -translate > rightWidth / 2) return -rightWidth;\n return 0;\n}\n\n/** Main-thread twin of {@link swipeSnap} (plan/specs/02 §3). */\nexport function swipeSnapMT(translate: number, leftWidth: number, rightWidth: number): number {\n 'main thread';\n if (translate > 0 && leftWidth > 0 && translate > leftWidth / 2) return leftWidth;\n if (translate < 0 && rightWidth > 0 && -translate > rightWidth / 2) return -rightWidth;\n return 0;\n}\n\n/**\n * The single-open policy shared by the rows of a list (one open row at a time): opening a row closes the one open\n * before it. Rows use the nearest {@link G9SwipeGroup} context, else one default group.\n */\nexport interface G9SwipeGroupStore {\n /** Marks `id` open; closes the previously open row. */\n opened(id: string, close: () => void): void;\n /** Marks `id` closed (no-op when another row is the open one). */\n closed(id: string): void;\n /** Closes the open row, if any. */\n closeAll(): void;\n readonly openId: string | null;\n}\n\n/**\n * A swipe group: at most one row of the group is open; opening another closes the previous one (MAUI\n * `G9SwipeGroup`). `<G9SwipeGroup>` creates one; create your own to share it across lists.\n */\nexport function createSwipeGroup(): G9SwipeGroupStore {\n let open: { id: string; close: () => void } | null = null;\n return {\n opened(id, close) {\n if (open && open.id !== id) open.close();\n open = { id, close };\n },\n closed(id) {\n if (open?.id === id) open = null;\n },\n closeAll() {\n const current = open;\n open = null;\n current?.close();\n },\n get openId() {\n return open?.id ?? null;\n },\n };\n}\n"],"names":["g9SwipeDefaultActionWidth","g9SwipeDefaultCornerRadius","g9SwipeSnapMs","swipeActionColors","action","_action_background","_action_foreground","destructive","swipePaneWidth","actions","width","_action_widthRequest","swipePhysicalWidths","leading","trailing","rtl","swipeSnap","translate","leftWidth","rightWidth","swipeSnapMT","createSwipeGroup","open","id","close","current"],"mappings":"AAGO,MAAMA,4BAA4B;AAElC,MAAMC,6BAA6B;AAEnC,MAAMC,gBAAgB;AA4BtB,SAASC,kBAAkBC,MAAqB;QAGvCC,oBACAC;IAHd,MAAMC,cAAcH,AAAyB,SAAzBA,OAAO,aAAa;IACxC,OAAO;QACL,YAAY,QAAAC,CAAAA,qBAAAA,OAAO,UAAU,AAAD,IAAhBA,qBAAsBE,cAAc,oBAAoB;QACpE,YAAY,QAAAD,CAAAA,qBAAAA,OAAO,UAAU,AAAD,IAAhBA,qBAAsBC,cAAc,uBAAuB;IACzE;AACF;AAGO,SAASC,eAAeC,OAAoD;IACjF,IAAIC,QAAQ;IACZ,KAAK,MAAMN,U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IACF;AACF"}
1
+ {"version":3,"file":"swipe/model.jsx","sources":["../../src/swipe/model.ts"],"sourcesContent":["import type { G9IconInput } from '../icon/icon';\n\n/** Pane width when an action sets none (MAUI `G9SwipeView.DefaultActionWidth`). */\nexport const g9SwipeDefaultActionWidth = 88;\n/** Outer card radius (MAUI `G9SwipeView.CornerRadius` default, `RadiusMd`). */\nexport const g9SwipeDefaultCornerRadius = 14;\n/** Snap animation after a release or a programmatic open / close. */\nexport const g9SwipeSnapMs = 200;\n\n/** One action pane of a swipe row (MAUI `G9SwipeAction`). Change a field and re-render to update it in place. */\nexport interface G9SwipeAction {\n /** Label under the icon; localize before assigning. */\n readonly text?: string | null;\n readonly icon?: G9IconInput;\n /** Pane fill. Default primary, or error when `isDestructive`. */\n readonly background?: string | null;\n /** Icon and label colour. Default on-primary, or on-error when `isDestructive`. */\n readonly foreground?: string | null;\n readonly isDestructive?: boolean;\n /** Hidden panes keep their place in the list but take no width. Default true. */\n readonly isVisible?: boolean;\n /** A disabled pane ignores taps without dimming. Default true. */\n readonly isEnabled?: boolean;\n /** Icon size. Default 22. */\n readonly iconSize?: number;\n /** Pane width. Default {@link g9SwipeDefaultActionWidth}. */\n readonly widthRequest?: number;\n /** Runs on a tap with `commandParameter`; an async command runs once until it settles (MAUI `Command`). */\n readonly command?: (parameter: unknown) => void | Promise<void>;\n readonly commandParameter?: unknown;\n /** Raised on a tap, before the command (MAUI `Invoked`). */\n readonly onInvoked?: (action: G9SwipeAction) => void;\n}\n\n/** Colours of a pane (MAUI theme resolution with the destructive shortcut; explicit colours win). */\nexport function swipeActionColors(action: G9SwipeAction): { readonly background: string; readonly foreground: string } {\n const destructive = action.isDestructive === true;\n return {\n background: action.background ?? (destructive ? 'var(--g9-error)' : 'var(--g9-primary)'),\n foreground: action.foreground ?? (destructive ? 'var(--g9-on-error)' : 'var(--g9-on-primary)'),\n };\n}\n\n/** Total width of the visible panes on one edge. */\nexport function swipePaneWidth(actions: readonly G9SwipeAction[] | null | undefined): number {\n let width = 0;\n for (const action of actions ?? []) {\n if (action.isVisible === false) continue;\n width += action.widthRequest ?? g9SwipeDefaultActionWidth;\n }\n return width;\n}\n\n/**\n * Physical pane widths: leading actions sit on the reading-start edge (left in LTR, right in RTL), so a positive\n * translation (body moved right) reveals the physical-left pane.\n */\nexport function swipePhysicalWidths(\n leading: number,\n trailing: number,\n rtl: boolean,\n): { readonly left: number; readonly right: number } {\n return rtl ? { left: trailing, right: leading } : { left: leading, right: trailing };\n}\n\n/**\n * Where a released body settles (MAUI Windows drag: past half the pane snaps open, else closed). `translate` is the\n * body's x offset; returns `leftWidth` (left pane open), `-rightWidth` (right pane open) or 0.\n */\nexport function swipeSnap(translate: number, leftWidth: number, rightWidth: number): number {\n if (translate > 0 && leftWidth > 0 && translate > leftWidth / 2) return leftWidth;\n if (translate < 0 && rightWidth > 0 && -translate > rightWidth / 2) return -rightWidth;\n return 0;\n}\n\n/**\n * Where a drag puts the body: inside [-rightWidth, leftWidth]. lynx-ui `Draggable` clamps the finger's DELTA to its bounds,\n * not the resulting position, so with the pane widths as bounds a FULLY open row (at -84) could not be dragged back: every\n * drag toward closed was a delta outside [-84, 0] (AgriPad TR-0070, ITCS-16237 — «once fully open it stays open»). The row\n * gives `Draggable` the whole travel as its delta bounds and clamps the position here, every frame.\n */\nexport function swipeDragTarget(x: number, leftWidth: number, rightWidth: number): number {\n return Math.min(Math.max(x, -rightWidth), leftWidth);\n}\n\n/** Main-thread twin of {@link swipeDragTarget}. */\nexport function swipeDragTargetMT(x: number, leftWidth: number, rightWidth: number): number {\n 'main thread';\n return Math.min(Math.max(x, -rightWidth), leftWidth);\n}\n\n/** Main-thread twin of {@link swipeSnap} (plan/specs/02 §3). */\nexport function swipeSnapMT(translate: number, leftWidth: number, rightWidth: number): number {\n 'main thread';\n if (translate > 0 && leftWidth > 0 && translate > leftWidth / 2) return leftWidth;\n if (translate < 0 && rightWidth > 0 && -translate > rightWidth / 2) return -rightWidth;\n return 0;\n}\n\n/**\n * The single-open policy shared by the rows of a list (one open row at a time): opening a row closes the one open\n * before it. Rows use the nearest {@link G9SwipeGroup} context, else one default group.\n */\nexport interface G9SwipeGroupStore {\n /** Marks `id` open; closes the previously open row. */\n opened(id: string, close: () => void): void;\n /** Marks `id` closed (no-op when another row is the open one). */\n closed(id: string): void;\n /** Closes the open row, if any. */\n closeAll(): void;\n readonly openId: string | null;\n}\n\n/**\n * A swipe group: at most one row of the group is open; opening another closes the previous one (MAUI\n * `G9SwipeGroup`). `<G9SwipeGroup>` creates one; create your own to share it across lists.\n */\nexport function createSwipeGroup(): G9SwipeGroupStore {\n let open: { id: string; close: () => void } | null = null;\n return {\n opened(id, close) {\n if (open && open.id !== id) open.close();\n open = { id, close };\n },\n closed(id) {\n if (open?.id === id) open = null;\n },\n closeAll() {\n const current = open;\n open = null;\n current?.close();\n },\n get openId() {\n return open?.id ?? null;\n },\n };\n}\n"],"names":["g9SwipeDefaultActionWidth","g9SwipeDefaultCornerRadius","g9SwipeSnapMs","swipeActionColors","action","_action_background","_action_foreground","destructive","swipePaneWidth","actions","width","_action_widthRequest","swipePhysicalWidths","leading","trailing","rtl","swipeSnap","translate","leftWidth","rightWidth","swipeDragTarget","x","Math","swipeDragTargetMT","swipeSnapMT","createSwipeGroup","open","id","close","current"],"mappings":"AAGO,MAAMA,4BAA4B;AAElC,MAAMC,6BAA6B;AAEnC,MAAMC,gBAAgB;AA4BtB,SAASC,kBAAkBC,MAAqB;QAGvCC,oBACAC;IAHd,MAAMC,cAAcH,AAAyB,SAAzBA,OAAO,aAAa;IACxC,OAAO;QACL,YAAY,QAAAC,CAAAA,qBAAAA,OAAO,UAAU,AAAD,IAAhBA,qBAAsBE,cAAc,oBAAoB;QACpE,YAAY,QAAAD,CAAAA,qBAAAA,OAAO,UAAU,AAAD,IAAhBA,qBAAsBC,cAAc,uBAAuB;IACzE;AACF;AAGO,SAASC,eAAeC,OAAoD;IACjF,IAAIC,QAAQ;IACZ,KAAK,MAAMN,UAAUK,QAA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AAC,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IACtC;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACnC,gDAAgD;IAChD,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,GAAG,UAAU,GAAG,IAAI,KAAK,IAAI,CAAC;IACtE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,SAAS,CA+J9D"}
@@ -3,7 +3,7 @@ import { Draggable } from "@lynx-js/lynx-ui-draggable";
3
3
  import { createContext, runOnMainThread, useContext, useEffect, useMainThreadRef, useRef, useState } from "@lynx-js/react";
4
4
  import { G9Icon } from "../icon/icon.jsx";
5
5
  import { useG9Diagnostics, useG9Direction } from "../provider/hooks.jsx";
6
- import { createSwipeGroup, g9SwipeDefaultCornerRadius, g9SwipeSnapMs, swipeActionColors, swipePaneWidth, swipePhysicalWidths, swipeSnap, swipeSnapMT } from "./model.jsx";
6
+ import { createSwipeGroup, g9SwipeDefaultCornerRadius, g9SwipeSnapMs, swipeActionColors, swipeDragTargetMT, swipePaneWidth, swipePhysicalWidths, swipeSnap, swipeSnapMT } from "./model.jsx";
7
7
  const defaultGroup = createSwipeGroup();
8
8
  let rowSequence = 0;
9
9
  const SwipeGroupContext = createContext(defaultGroup);
@@ -76,6 +76,12 @@ function G9SwipeView(props) {
76
76
  transition: 'none'
77
77
  });
78
78
  };
79
+ const onMTSDragging = (translate)=>{
80
+ 'main thread';
81
+ var _dragRef_current;
82
+ const x = swipeDragTargetMT(translate.x, leftWidth, rightWidth);
83
+ if (x !== translate.x) null == (_dragRef_current = dragRef.current) || _dragRef_current.MTSSetTransform(x, 0);
84
+ };
79
85
  const onMTSDragEnd = (translate)=>{
80
86
  'main thread';
81
87
  var _dragRef_current, _dragRef_current1;
@@ -151,7 +157,7 @@ function G9SwipeView(props) {
151
157
  <Draggable className="g9-swipe__body" MTSRef={dragRef} trigger="immediate" allowedDirection={[
152
158
  'left',
153
159
  'right'
154
- ]} enableDragging={leftWidth > 0 || rightWidth > 0} minTranslateX={-rightWidth} maxTranslateX={leftWidth} minTranslateY={0} maxTranslateY={0} resetOnEnd={false} onMTSDragStart={onMTSDragStart} onMTSDragEnd={onMTSDragEnd} onDragEnd={onDragEnd} draggableProps={{
160
+ ]} enableDragging={leftWidth > 0 || rightWidth > 0} minTranslateX={-(leftWidth + rightWidth)} maxTranslateX={leftWidth + rightWidth} minTranslateY={0} maxTranslateY={0} resetOnEnd={false} onMTSDragStart={onMTSDragStart} onMTSDragging={onMTSDragging} onMTSDragEnd={onMTSDragEnd} onDragEnd={onDragEnd} draggableProps={{
155
161
  bindtap: 0 !== offset ? ()=>settle(0, true, false) : void 0
156
162
  }}>
157
163
  {null != (_props_cardContent = props.cardContent) ? _props_cardContent : props.children}
@@ -1 +1 @@
1
- {"version":3,"file":"swipe/swipe-view.jsx","sources":["../../src/swipe/swipe-view.tsx"],"sourcesContent":["import './swipe.css';\nimport { Draggable, type DraggableRef } from '@lynx-js/lynx-ui-draggable';\nimport {\n createContext,\n type ReactNode,\n runOnMainThread,\n useContext,\n useEffect,\n useMainThreadRef,\n useRef,\n useState,\n} from '@lynx-js/react';\nimport { G9Icon } from '../icon/icon';\nimport { useG9Diagnostics, useG9Direction } from '../provider/hooks';\nimport {\n createSwipeGroup,\n type G9SwipeAction,\n type G9SwipeGroupStore,\n g9SwipeDefaultCornerRadius,\n g9SwipeSnapMs,\n swipeActionColors,\n swipePaneWidth,\n swipePhysicalWidths,\n swipeSnap,\n swipeSnapMT,\n} from './model';\n\nconst defaultGroup = createSwipeGroup();\nlet rowSequence = 0;\nconst SwipeGroupContext = createContext<G9SwipeGroupStore>(defaultGroup);\n\n/** Scopes the one-open-row policy to a list (rows outside any group share one default group). */\nexport function G9SwipeGroup(props: { readonly group?: G9SwipeGroupStore; readonly children?: ReactNode }): ReactNode {\n const own = useRef<G9SwipeGroupStore | null>(null);\n if (own.current === null) own.current = props.group ?? createSwipeGroup();\n return <SwipeGroupContext.Provider value={props.group ?? own.current}>{props.children}</SwipeGroupContext.Provider>;\n}\n\n/** Props of {@link G9SwipeView} (MAUI bindable properties). */\nexport interface G9SwipeViewProps {\n /** Revealed on the leading edge: left in LTR, right in RTL (MAUI `LeftActions`). */\n readonly leftActions?: readonly G9SwipeAction[];\n /** Revealed on the trailing edge: right in LTR, left in RTL (MAUI `RightActions`). */\n readonly rightActions?: readonly G9SwipeAction[];\n /** The card body (MAUI `CardContent`); `children` works too. Give it an opaque, square, strokeless fill. */\n readonly cardContent?: ReactNode;\n readonly children?: ReactNode;\n /** Outer card radius; the panes are clipped to it. Default 14. */\n readonly cornerRadius?: number;\n readonly cardBackground?: string | null;\n readonly cardStroke?: string | null;\n readonly cardStrokeThickness?: number;\n /**\n * The item this row shows. When it changes (a recycled `<list>` row rebound to another item) the row closes\n * instantly, so a reused row never shows the previous item's open pane.\n */\n readonly itemKey?: string | number;\n /** Told when the row opens a side or closes. */\n readonly onOpenChange?: (side: 'leading' | 'trailing' | null) => void;\n readonly className?: string;\n}\n\n/**\n * A card row with swipe-to-reveal action panes on both edges (MAUI `G9SwipeView`). The panes sit behind the body, so\n * the body must be opaque (MAUI's \"flat but opaque\" rule). The drag lives in lynx-ui\n * `Draggable` (touch and mouse, so desktop works like MAUI's Windows drag); release snaps open past half a pane, else\n * closed (`swipeSnapMT` on the main thread, `swipeSnap` on the background, the same rule). One open row at a time per\n * {@link G9SwipeGroup}; a tap on a pane runs its action once and closes; a tap on an open body closes it.\n */\nexport function G9SwipeView(props: G9SwipeViewProps): ReactNode {\n const idRef = useRef<string | null>(null);\n if (idRef.current === null) {\n rowSequence += 1;\n idRef.current = `g9-swipe-${rowSequence}`;\n }\n const id = idRef.current;\n const group = useContext(SwipeGroupContext);\n const diagnostics = useG9Diagnostics();\n const rtl = useG9Direction() === 'rtl';\n const leading = (props.leftActions ?? []).filter((a) => a.isVisible !== false);\n const trailing = (props.rightActions ?? []).filter((a) => a.isVisible !== false);\n const widths = swipePhysicalWidths(swipePaneWidth(leading), swipePaneWidth(trailing), rtl);\n const leftActions = rtl ? trailing : leading;\n const rightActions = rtl ? leading : trailing;\n const [offset, setOffset] = useState(0);\n const offsetRef = useRef(0);\n offsetRef.current = offset;\n const dragRef = useMainThreadRef<DraggableRef | null>(null);\n const running = useRef(new Set<G9SwipeAction>());\n const latest = useRef(props);\n latest.current = props;\n\n const moveMT = (x: number, animated: boolean) => {\n 'main thread';\n dragRef.current?.MTSSetOtherStyles({ transition: animated ? `transform ${g9SwipeSnapMs}ms ease-out` : 'none' });\n dragRef.current?.MTSSetTransform(x, 0);\n };\n const report = (next: number) => {\n const side = next === 0 ? null : next > 0 !== rtl ? 'leading' : 'trailing';\n latest.current.onOpenChange?.(side);\n };\n const settle = (next: number, animated: boolean, fromDrag: boolean) => {\n if (!fromDrag) void runOnMainThread(moveMT)(next, animated);\n if (next === offsetRef.current) return;\n offsetRef.current = next;\n setOffset(next);\n if (next === 0) group.closed(id);\n else group.opened(id, () => settle(0, true, false));\n report(next);\n };\n\n // A recycled row bound to another item starts closed, without animation.\n const boundKey = useRef(props.itemKey);\n useEffect(() => {\n if (boundKey.current === props.itemKey) return;\n boundKey.current = props.itemKey;\n settle(0, false, false);\n }, [props.itemKey]);\n useEffect(() => () => group.closed(id), []);\n\n const leftWidth = widths.left;\n const rightWidth = widths.right;\n const onMTSDragStart = () => {\n 'main thread';\n dragRef.current?.MTSSetOtherStyles({ transition: 'none' });\n };\n const onMTSDragEnd = (translate: { x: number }) => {\n 'main thread';\n const target = swipeSnapMT(translate.x, leftWidth, rightWidth);\n dragRef.current?.MTSSetOtherStyles({ transition: `transform ${g9SwipeSnapMs}ms ease-out` });\n dragRef.current?.MTSSetTransform(target, 0);\n };\n const onDragEnd = (translate: { x: number }) => {\n settle(swipeSnap(translate.x, leftWidth, rightWidth), true, true);\n };\n\n const invoke = (action: G9SwipeAction) => {\n if (action.isEnabled === false || running.current.has(action)) return;\n settle(0, true, false);\n try {\n action.onInvoked?.(action);\n const result = action.command?.(action.commandParameter);\n if (result && typeof (result as Promise<void>).then === 'function') {\n running.current.add(action);\n (result as Promise<void>).then(\n () => running.current.delete(action),\n (error: unknown) => {\n running.current.delete(action);\n diagnostics.log({ level: 'error', message: 'G9SwipeView: action failed.', source: 'G9SwipeView', error });\n },\n );\n }\n } catch (error) {\n diagnostics.log({ level: 'error', message: 'G9SwipeView: action failed.', source: 'G9SwipeView', error });\n }\n };\n\n const pane = (actions: readonly G9SwipeAction[], side: 'left' | 'right') =>\n actions.length > 0 ? (\n <view className={`g9-swipe__pane g9-swipe__pane--${side}`} style={{ [side]: '0px' }}>\n {actions.map((action, i) => {\n const colors = swipeActionColors(action);\n return (\n <view\n key={`${side}-${i}`}\n className=\"g9-swipe__action\"\n style={{ width: `${action.widthRequest ?? 88}px`, backgroundColor: colors.background }}\n accessibility-element\n accessibility-traits=\"button\"\n accessibility-label={action.text ?? ''}\n bindtap={() => invoke(action)}\n >\n {action.icon ? (\n <G9Icon icon={action.icon} size={action.iconSize ?? 22} color={colors.foreground} />\n ) : null}\n {action.text ? (\n <text className=\"g9-swipe__action-text\" text-maxline=\"1\" style={{ color: colors.foreground }}>\n {action.text}\n </text>\n ) : null}\n </view>\n );\n })}\n </view>\n ) : null;\n\n const radius = props.cornerRadius ?? g9SwipeDefaultCornerRadius;\n const thickness = props.cardStrokeThickness ?? 0;\n return (\n <view\n className={`g9-swipe${offset !== 0 ? ' g9-swipe--open' : ''} ${props.className ?? ''}`}\n style={{\n borderRadius: `${radius}px`,\n backgroundColor: props.cardBackground ?? 'transparent',\n ...(props.cardStroke && thickness > 0\n ? { borderWidth: `${thickness}px`, borderStyle: 'solid', borderColor: props.cardStroke }\n : {}),\n }}\n >\n {pane(leftActions, 'left')}\n {pane(rightActions, 'right')}\n <Draggable\n className=\"g9-swipe__body\"\n MTSRef={dragRef}\n trigger=\"immediate\"\n allowedDirection={['left', 'right']}\n enableDragging={leftWidth > 0 || rightWidth > 0}\n minTranslateX={-rightWidth}\n maxTranslateX={leftWidth}\n minTranslateY={0}\n maxTranslateY={0}\n resetOnEnd={false}\n onMTSDragStart={onMTSDragStart}\n onMTSDragEnd={onMTSDragEnd}\n onDragEnd={onDragEnd}\n draggableProps={{ bindtap: offset !== 0 ? () => settle(0, true, false) : undefined }}\n >\n {props.cardContent ?? props.children}\n </Draggable>\n </view>\n );\n}\n"],"names":["defaultGroup","createSwipeGroup","rowSequence","SwipeGroupContext","createContext","G9SwipeGroup","props","_props_group","_props_group1","own","useRef","G9SwipeView","_props_leftActions","_props_rightActions","_props_cornerRadius","_props_cardStrokeThickness","_props_className","_props_cardBackground","_props_cardContent","idRef","id","group","useContext","diagnostics","useG9Diagnostics","rtl","useG9Direction","leading","a","trailing","widths","swipePhysicalWidths","swipePaneWidth","leftActions","rightActions","offset","setOffset","useState","offsetRef","dragRef","useMainThreadRef","running","Set","latest","moveMT","x","animated","_dragRef_current","_dragRef_current1","g9SwipeSnapMs","report","next","_latest_current","side","settle","fromDrag","runOnMainThread","boundKey","useEffect","leftWidth","rightWidth","onMTSDragStart","onMTSDragEnd","translate","target","swipeSnapMT","onDragEnd","swipeSnap","invoke","action","result","error","pane","actions","view","i","_action_widthRequest","_action_text","_action_iconSize","colors","swipeActionColors","G9Icon","text","radius","g9SwipeDefaultCornerRadius","thickness","Draggable","undefined"],"mappings":";;;;;;AA2BA,MAAMA,eAAeC;AACrB,IAAIC,cAAc;AAClB,MAAMC,oBAAoBC,cAAiCJ;AAGpD,SAASK,aAAaC,KAA4E;QAE/DC,cACEC;IAF1C,MAAMC,MAAMC,OAAiC;IAC7C,IAAID,AAAgB,SAAhBA,IAAI,OAAO,EAAWA,IAAI,OAAO,GAAG,QAAAF,CAAAA,eAAAA,MAAM,KAAK,A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CAAAA,mBAAAA,MAAM,SAAS,AAAD,IAAdA,mBAAmB,IAAI,EACtF,OAAO;QACL,cAAc,GAAGmE,OAAO,EAAE,CAAC;QAC3B,iBAAiB,QAAAlE,CAAAA,wBAAAA,MAAM,cAAc,AAAD,IAAnBA,wBAAwB;QACzC,GAAIX,MAAM,UAAU,IAAI+E,YAAY,IAChC;YAAE,aAAa,GAAGA,UAAU,EAAE,CAAC;YAAE,aAAa;YAAS,aAAa/E,MAAM,UAAU;QAAC,IACrF,CAAC,CAAC;IACR,GACD;MACC,CAACkE,KAAKvC,aAAa,QAAQ;MAC3B,CAACuC,KAAKtC,cAAc,SAAS;MAC7B,CAACoD,UACC,UAAU,iBACV,QAAQ/C,SACR,QAAQ,YACR,kBAAkB;QAAC;QAAQ;KAAQ,EACnC,gBAAgBoB,YAAY,KAAKC,aAAa,GAC9C,eAAe,CAACA,YAChB,eAAeD,WACf,eAAe,GACf,eAAe,GACf,YAAY,OACZ,gBAAgBE,gBAChB,cAAcC,cACd,WAAWI,WACX,gBAAgB;QAAE,SAAS/B,AAAW,MAAXA,SAAe,IAAMmB,OAAO,GAAG,MAAM,SAASiC;IAAU,GACpF;QACC,CAAC,QAAArE,CAAAA,qBAAAA,MAAM,WAAW,AAAD,IAAhBA,qBAAqBZ,MAAM,QAAQ,CAAC;MACvC,EAAEgF,UAAU;IACd,EAAEZ;AAEN"}
1
+ {"version":3,"file":"swipe/swipe-view.jsx","sources":["../../src/swipe/swipe-view.tsx"],"sourcesContent":["import './swipe.css';\nimport { Draggable, type DraggableRef } from '@lynx-js/lynx-ui-draggable';\nimport {\n createContext,\n type ReactNode,\n runOnMainThread,\n useContext,\n useEffect,\n useMainThreadRef,\n useRef,\n useState,\n} from '@lynx-js/react';\nimport { G9Icon } from '../icon/icon';\nimport { useG9Diagnostics, useG9Direction } from '../provider/hooks';\nimport {\n createSwipeGroup,\n type G9SwipeAction,\n type G9SwipeGroupStore,\n g9SwipeDefaultCornerRadius,\n g9SwipeSnapMs,\n swipeActionColors,\n swipeDragTargetMT,\n swipePaneWidth,\n swipePhysicalWidths,\n swipeSnap,\n swipeSnapMT,\n} from './model';\n\nconst defaultGroup = createSwipeGroup();\nlet rowSequence = 0;\nconst SwipeGroupContext = createContext<G9SwipeGroupStore>(defaultGroup);\n\n/** Scopes the one-open-row policy to a list (rows outside any group share one default group). */\nexport function G9SwipeGroup(props: { readonly group?: G9SwipeGroupStore; readonly children?: ReactNode }): ReactNode {\n const own = useRef<G9SwipeGroupStore | null>(null);\n if (own.current === null) own.current = props.group ?? createSwipeGroup();\n return <SwipeGroupContext.Provider value={props.group ?? own.current}>{props.children}</SwipeGroupContext.Provider>;\n}\n\n/** Props of {@link G9SwipeView} (MAUI bindable properties). */\nexport interface G9SwipeViewProps {\n /** Revealed on the leading edge: left in LTR, right in RTL (MAUI `LeftActions`). */\n readonly leftActions?: readonly G9SwipeAction[];\n /** Revealed on the trailing edge: right in LTR, left in RTL (MAUI `RightActions`). */\n readonly rightActions?: readonly G9SwipeAction[];\n /** The card body (MAUI `CardContent`); `children` works too. Give it an opaque, square, strokeless fill. */\n readonly cardContent?: ReactNode;\n readonly children?: ReactNode;\n /** Outer card radius; the panes are clipped to it. Default 14. */\n readonly cornerRadius?: number;\n readonly cardBackground?: string | null;\n readonly cardStroke?: string | null;\n readonly cardStrokeThickness?: number;\n /**\n * The item this row shows. When it changes (a recycled `<list>` row rebound to another item) the row closes\n * instantly, so a reused row never shows the previous item's open pane.\n */\n readonly itemKey?: string | number;\n /** Told when the row opens a side or closes. */\n readonly onOpenChange?: (side: 'leading' | 'trailing' | null) => void;\n readonly className?: string;\n}\n\n/**\n * A card row with swipe-to-reveal action panes on both edges (MAUI `G9SwipeView`). The panes sit behind the body, so\n * the body must be opaque (MAUI's \"flat but opaque\" rule). The drag lives in lynx-ui\n * `Draggable` (touch and mouse, so desktop works like MAUI's Windows drag); release snaps open past half a pane, else\n * closed (`swipeSnapMT` on the main thread, `swipeSnap` on the background, the same rule). One open row at a time per\n * {@link G9SwipeGroup}; a tap on a pane runs its action once and closes; a tap on an open body closes it.\n */\nexport function G9SwipeView(props: G9SwipeViewProps): ReactNode {\n const idRef = useRef<string | null>(null);\n if (idRef.current === null) {\n rowSequence += 1;\n idRef.current = `g9-swipe-${rowSequence}`;\n }\n const id = idRef.current;\n const group = useContext(SwipeGroupContext);\n const diagnostics = useG9Diagnostics();\n const rtl = useG9Direction() === 'rtl';\n const leading = (props.leftActions ?? []).filter((a) => a.isVisible !== false);\n const trailing = (props.rightActions ?? []).filter((a) => a.isVisible !== false);\n const widths = swipePhysicalWidths(swipePaneWidth(leading), swipePaneWidth(trailing), rtl);\n const leftActions = rtl ? trailing : leading;\n const rightActions = rtl ? leading : trailing;\n const [offset, setOffset] = useState(0);\n const offsetRef = useRef(0);\n offsetRef.current = offset;\n const dragRef = useMainThreadRef<DraggableRef | null>(null);\n const running = useRef(new Set<G9SwipeAction>());\n const latest = useRef(props);\n latest.current = props;\n\n const moveMT = (x: number, animated: boolean) => {\n 'main thread';\n dragRef.current?.MTSSetOtherStyles({ transition: animated ? `transform ${g9SwipeSnapMs}ms ease-out` : 'none' });\n dragRef.current?.MTSSetTransform(x, 0);\n };\n const report = (next: number) => {\n const side = next === 0 ? null : next > 0 !== rtl ? 'leading' : 'trailing';\n latest.current.onOpenChange?.(side);\n };\n const settle = (next: number, animated: boolean, fromDrag: boolean) => {\n if (!fromDrag) void runOnMainThread(moveMT)(next, animated);\n if (next === offsetRef.current) return;\n offsetRef.current = next;\n setOffset(next);\n if (next === 0) group.closed(id);\n else group.opened(id, () => settle(0, true, false));\n report(next);\n };\n\n // A recycled row bound to another item starts closed, without animation.\n const boundKey = useRef(props.itemKey);\n useEffect(() => {\n if (boundKey.current === props.itemKey) return;\n boundKey.current = props.itemKey;\n settle(0, false, false);\n }, [props.itemKey]);\n useEffect(() => () => group.closed(id), []);\n\n const leftWidth = widths.left;\n const rightWidth = widths.right;\n const onMTSDragStart = () => {\n 'main thread';\n dragRef.current?.MTSSetOtherStyles({ transition: 'none' });\n };\n // The position stays on the card's travel (see swipeDragTarget): Draggable set start + delta, this pulls it back in.\n const onMTSDragging = (translate: { x: number }) => {\n 'main thread';\n const x = swipeDragTargetMT(translate.x, leftWidth, rightWidth);\n if (x !== translate.x) dragRef.current?.MTSSetTransform(x, 0);\n };\n const onMTSDragEnd = (translate: { x: number }) => {\n 'main thread';\n const target = swipeSnapMT(translate.x, leftWidth, rightWidth);\n dragRef.current?.MTSSetOtherStyles({ transition: `transform ${g9SwipeSnapMs}ms ease-out` });\n dragRef.current?.MTSSetTransform(target, 0);\n };\n const onDragEnd = (translate: { x: number }) => {\n settle(swipeSnap(translate.x, leftWidth, rightWidth), true, true);\n };\n\n const invoke = (action: G9SwipeAction) => {\n if (action.isEnabled === false || running.current.has(action)) return;\n settle(0, true, false);\n try {\n action.onInvoked?.(action);\n const result = action.command?.(action.commandParameter);\n if (result && typeof (result as Promise<void>).then === 'function') {\n running.current.add(action);\n (result as Promise<void>).then(\n () => running.current.delete(action),\n (error: unknown) => {\n running.current.delete(action);\n diagnostics.log({ level: 'error', message: 'G9SwipeView: action failed.', source: 'G9SwipeView', error });\n },\n );\n }\n } catch (error) {\n diagnostics.log({ level: 'error', message: 'G9SwipeView: action failed.', source: 'G9SwipeView', error });\n }\n };\n\n const pane = (actions: readonly G9SwipeAction[], side: 'left' | 'right') =>\n actions.length > 0 ? (\n <view className={`g9-swipe__pane g9-swipe__pane--${side}`} style={{ [side]: '0px' }}>\n {actions.map((action, i) => {\n const colors = swipeActionColors(action);\n return (\n <view\n key={`${side}-${i}`}\n className=\"g9-swipe__action\"\n style={{ width: `${action.widthRequest ?? 88}px`, backgroundColor: colors.background }}\n accessibility-element\n accessibility-traits=\"button\"\n accessibility-label={action.text ?? ''}\n bindtap={() => invoke(action)}\n >\n {action.icon ? (\n <G9Icon icon={action.icon} size={action.iconSize ?? 22} color={colors.foreground} />\n ) : null}\n {action.text ? (\n <text className=\"g9-swipe__action-text\" text-maxline=\"1\" style={{ color: colors.foreground }}>\n {action.text}\n </text>\n ) : null}\n </view>\n );\n })}\n </view>\n ) : null;\n\n const radius = props.cornerRadius ?? g9SwipeDefaultCornerRadius;\n const thickness = props.cardStrokeThickness ?? 0;\n return (\n <view\n className={`g9-swipe${offset !== 0 ? ' g9-swipe--open' : ''} ${props.className ?? ''}`}\n style={{\n borderRadius: `${radius}px`,\n backgroundColor: props.cardBackground ?? 'transparent',\n ...(props.cardStroke && thickness > 0\n ? { borderWidth: `${thickness}px`, borderStyle: 'solid', borderColor: props.cardStroke }\n : {}),\n }}\n >\n {pane(leftActions, 'left')}\n {pane(rightActions, 'right')}\n <Draggable\n className=\"g9-swipe__body\"\n MTSRef={dragRef}\n trigger=\"immediate\"\n allowedDirection={['left', 'right']}\n enableDragging={leftWidth > 0 || rightWidth > 0}\n minTranslateX={-(leftWidth + rightWidth)}\n maxTranslateX={leftWidth + rightWidth}\n minTranslateY={0}\n maxTranslateY={0}\n resetOnEnd={false}\n onMTSDragStart={onMTSDragStart}\n onMTSDragging={onMTSDragging}\n onMTSDragEnd={onMTSDragEnd}\n onDragEnd={onDragEnd}\n draggableProps={{ bindtap: offset !== 0 ? () => settle(0, true, false) : undefined }}\n >\n {props.cardContent ?? props.children}\n </Draggable>\n </view>\n );\n}\n"],"names":["defaultGroup","createSwipeGroup","rowSequence","SwipeGroupContext","createContext","G9SwipeGroup","props","_props_group","_props_group1","own","useRef","G9SwipeView","_props_leftActions","_props_rightActions","_props_cornerRadius","_props_cardStrokeThickness","_props_className","_props_cardBackground","_props_cardContent","idRef","id","group","useContext","diagnostics","useG9Diagnostics","rtl","useG9Direction","leading","a","trailing","widths","swipePhysicalWidths","swipePaneWidth","leftActions","rightActions","offset","setOffset","useState","offsetRef","dragRef","useMainThreadRef","running","Set","latest","moveMT","x","animated","_dragRef_current","_dragRef_current1","g9SwipeSnapMs","report","next","_latest_current","side","settle","fromDrag","runOnMainThread","boundKey","useEffect","leftWidth","rightWidth","onMTSDragStart","onMTSDragging","translate","swipeDragTargetMT","onMTSDragEnd","target","swipeSnapMT","onDragEnd","swipeSnap","invoke","action","result","error","pane","actions","view","i","_action_widthRequest","_action_text","_action_iconSize","colors","swipeActionColors","G9Icon","text","radius","g9SwipeDefaultCornerRadius","thickness","Draggable","undefined"],"mappings":";;;;;;AA4BA,MAAMA,eAAeC;AACrB,IAAIC,cAAc;AAClB,MAAMC,oBAAoBC,cAAiCJ;AAGpD,SAASK,aAAaC,KAA4E;QAE/DC,cACEC;IAF1C,MAAMC,MAAMC,OAAiC;IAC7C,IAAID,AAAgB,SAAhBA,IAAI,OAAO,EAAWA,IAAI,OAAO,GAAG,QAAAF,CAAAA,eAAAA,MAAM,KAAK,AAAD,IAAVA,eAAeN;IACvD,QAAQE,kBAAkB,SAAS,OAAO,QAAAK,CAAAA,gBAAAA,MAAM,KAAK,AAAD,IAAVA,gBAAeC,IAAI,OAAO,GAAGH,MAAM,QAAQ,GAAGH,kBAAkB;AAC5G;AAiCO,SAASQ,YAAYL,KAAuB;QAUhCM,oBACCC,qBAgHHC,qBACGC,4BAGiDC,kBAG5CC,uBAyBhBC;IA1JP,MAAMC,QAAQT,OAAsB;IACpC,IAAIS,AAAkB,SAAlBA,MAAM,OAAO,EAAW;QAC1BjB,eAAe;QACfiB,MAAM,OAAO,GAAG,CAAC,SAAS,EAAEjB,aAAa;IAC3C;IACA,MAAMkB,KAAKD,MAAM,OAAO;IACxB,MAAME,QAAQC,WAAWnB;IACzB,MAAMoB,cAAcC;IACpB,MAAMC,MAAMC,AAAqB,UAArBA;IACZ,MAAMC,UAAU,AAAC,SAAAf,CAAAA,qBAAAA,MAAM,WAAW,AAAD,IAAhBA,qBAAqB,EAAE,AAAD,EAAG,MAAM,CAAC,CAACgB,IAAMA,AAAgB,UAAhBA,EAAE,SAAS;IACnE,MAAMC,WAAW,AAAC,SAAAhB,CAAAA,sBAAAA,MAAM,YAAY,AAAD,IAAjBA,sBAAsB,EAAE,AAAD,EAAG,MAAM,CAA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GACtC,eAAeD,YAAYC,YAC3B,eAAe,GACf,eAAe,GACf,YAAY,OACZ,gBAAgBC,gBAChB,eAAeC,eACf,cAAcG,cACd,WAAWG,WACX,gBAAgB;QAAE,SAASjC,AAAW,MAAXA,SAAe,IAAMmB,OAAO,GAAG,MAAM,SAASmC;IAAU,GACpF;QACC,CAAC,QAAAvE,CAAAA,qBAAAA,MAAM,WAAW,AAAD,IAAhBA,qBAAqBZ,MAAM,QAAQ,CAAC;MACvC,EAAEkF,UAAU;IACd,EAAEZ;AAEN"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@g9tm/lynxcontrols",
3
- "version": "1.6.1",
3
+ "version": "1.7.1",
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.6.1",
155
+ "@g9tm/lynxcontrols-foundation": "1.7.1",
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",