@g9tm/lynxcontrols 1.4.11 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.tsbuildinfo +1 -1
- package/dist/anchor/context.d.ts +15 -0
- package/dist/anchor/context.d.ts.map +1 -0
- package/dist/anchor/context.jsx +10 -0
- package/dist/anchor/context.jsx.map +1 -0
- package/dist/anchor/hooks.d.ts +72 -0
- package/dist/anchor/hooks.d.ts.map +1 -0
- package/dist/anchor/hooks.jsx +147 -0
- package/dist/anchor/hooks.jsx.map +1 -0
- package/dist/anchor/index.d.ts +6 -0
- package/dist/anchor/index.d.ts.map +1 -0
- package/dist/anchor/index.jsx +5 -0
- package/dist/anchor/measure.d.ts +22 -0
- package/dist/anchor/measure.d.ts.map +1 -0
- package/dist/anchor/measure.jsx +110 -0
- package/dist/anchor/measure.jsx.map +1 -0
- package/dist/anchor/registry.d.ts +108 -0
- package/dist/anchor/registry.d.ts.map +1 -0
- package/dist/anchor/registry.jsx +142 -0
- package/dist/anchor/registry.jsx.map +1 -0
- package/dist/anchor/scroll.d.ts +34 -0
- package/dist/anchor/scroll.d.ts.map +1 -0
- package/dist/anchor/scroll.jsx +255 -0
- package/dist/anchor/scroll.jsx.map +1 -0
- package/dist/base/control.d.ts +10 -3
- package/dist/base/control.d.ts.map +1 -1
- package/dist/base/control.jsx +17 -2
- package/dist/base/control.jsx.map +1 -1
- package/dist/base/pressable.d.ts.map +1 -1
- package/dist/base/pressable.jsx +7 -1
- package/dist/base/pressable.jsx.map +1 -1
- package/dist/button/button.d.ts.map +1 -1
- package/dist/button/button.jsx +11 -1
- package/dist/button/button.jsx.map +1 -1
- package/dist/button/header-action-button.d.ts.map +1 -1
- package/dist/button/header-action-button.jsx +10 -1
- package/dist/button/header-action-button.jsx.map +1 -1
- package/dist/button/icon-button.d.ts.map +1 -1
- package/dist/button/icon-button.jsx +11 -1
- package/dist/button/icon-button.jsx.map +1 -1
- package/dist/button/nav-card.d.ts.map +1 -1
- package/dist/button/nav-card.jsx +10 -1
- package/dist/button/nav-card.jsx.map +1 -1
- package/dist/button/vertical-icon-text-button.d.ts.map +1 -1
- package/dist/button/vertical-icon-text-button.jsx +10 -1
- package/dist/button/vertical-icon-text-button.jsx.map +1 -1
- package/dist/expander/expander.d.ts.map +1 -1
- package/dist/expander/expander.jsx +14 -1
- package/dist/expander/expander.jsx.map +1 -1
- package/dist/fields/editor.d.ts.map +1 -1
- package/dist/fields/editor.jsx +17 -1
- package/dist/fields/editor.jsx.map +1 -1
- package/dist/fields/outlined-field.d.ts +6 -0
- package/dist/fields/outlined-field.d.ts.map +1 -1
- package/dist/fields/outlined-field.jsx +14 -3
- package/dist/fields/outlined-field.jsx.map +1 -1
- package/dist/fields/text-entry.d.ts.map +1 -1
- package/dist/fields/text-entry.jsx +17 -1
- package/dist/fields/text-entry.jsx.map +1 -1
- package/dist/guide/guide.css +453 -0
- package/dist/guide/guide.css.map +1 -0
- package/dist/guide/index.d.ts +5 -0
- package/dist/guide/index.d.ts.map +1 -0
- package/dist/guide/index.jsx +4 -0
- package/dist/guide/journey.d.ts +46 -0
- package/dist/guide/journey.d.ts.map +1 -0
- package/dist/guide/journey.jsx +464 -0
- package/dist/guide/journey.jsx.map +1 -0
- package/dist/guide/placement.d.ts +44 -0
- package/dist/guide/placement.d.ts.map +1 -0
- package/dist/guide/placement.jsx +119 -0
- package/dist/guide/placement.jsx.map +1 -0
- package/dist/guide/service.d.ts +85 -0
- package/dist/guide/service.d.ts.map +1 -0
- package/dist/guide/service.jsx +620 -0
- package/dist/guide/service.jsx.map +1 -0
- package/dist/guide/settings.d.ts +50 -0
- package/dist/guide/settings.d.ts.map +1 -0
- package/dist/guide/settings.jsx +60 -0
- package/dist/guide/settings.jsx.map +1 -0
- package/dist/host/host.d.ts +5 -1
- package/dist/host/host.d.ts.map +1 -1
- package/dist/host/host.jsx +12 -0
- package/dist/host/host.jsx.map +1 -1
- package/dist/host/layers.d.ts +3 -1
- package/dist/host/layers.d.ts.map +1 -1
- package/dist/host/layers.jsx +4 -2
- package/dist/host/layers.jsx.map +1 -1
- package/dist/host/registry.d.ts +3 -0
- package/dist/host/registry.d.ts.map +1 -1
- package/dist/host/registry.jsx.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/provider/contexts.d.ts +3 -0
- package/dist/provider/contexts.d.ts.map +1 -1
- package/dist/provider/contexts.jsx.map +1 -1
- package/dist/provider/provider.d.ts.map +1 -1
- package/dist/provider/provider.jsx +24 -17
- package/dist/provider/provider.jsx.map +1 -1
- package/dist/provider/settings.d.ts +4 -0
- package/dist/provider/settings.d.ts.map +1 -1
- package/dist/provider/settings.jsx +3 -2
- package/dist/provider/settings.jsx.map +1 -1
- package/dist/route/hooks.d.ts +34 -0
- package/dist/route/hooks.d.ts.map +1 -0
- package/dist/route/hooks.jsx +147 -0
- package/dist/route/hooks.jsx.map +1 -0
- package/dist/route/index.d.ts +3 -0
- package/dist/route/index.d.ts.map +1 -0
- package/dist/route/index.jsx +2 -0
- package/dist/route/router.d.ts +201 -0
- package/dist/route/router.d.ts.map +1 -0
- package/dist/route/router.jsx +810 -0
- package/dist/route/router.jsx.map +1 -0
- package/dist/sheet/frame.d.ts +3 -1
- package/dist/sheet/frame.d.ts.map +1 -1
- package/dist/sheet/frame.jsx +67 -25
- package/dist/sheet/frame.jsx.map +1 -1
- package/dist/sheet/options.d.ts +10 -0
- package/dist/sheet/options.d.ts.map +1 -1
- package/dist/sheet/options.jsx.map +1 -1
- package/dist/sheet/service.d.ts +5 -0
- package/dist/sheet/service.d.ts.map +1 -1
- package/dist/sheet/service.jsx +14 -2
- package/dist/sheet/service.jsx.map +1 -1
- package/dist/sheet/sheet.css +9 -0
- package/dist/sheet/sheet.css.map +1 -1
- package/dist/tabs/tab-view.d.ts +14 -0
- package/dist/tabs/tab-view.d.ts.map +1 -1
- package/dist/tabs/tab-view.jsx +59 -3
- package/dist/tabs/tab-view.jsx.map +1 -1
- package/dist/toggle/checkbox.d.ts.map +1 -1
- package/dist/toggle/checkbox.jsx +15 -1
- package/dist/toggle/checkbox.jsx.map +1 -1
- package/dist/toggle/chip-group.d.ts.map +1 -1
- package/dist/toggle/chip-group.jsx +12 -1
- package/dist/toggle/chip-group.jsx.map +1 -1
- package/dist/toggle/switch.d.ts.map +1 -1
- package/dist/toggle/switch.jsx +15 -1
- package/dist/toggle/switch.jsx.map +1 -1
- package/package.json +17 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/sheet/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAIhD,iGAAiG;AACjG,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AACxD,sEAAsE;AACtE,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,cAAc,CAAC;AACxD,sEAAsE;AACtE,MAAM,MAAM,2BAA2B,GAAG,QAAQ,GAAG,UAAU,CAAC;AAChE,8FAA8F;AAC9F,MAAM,MAAM,iBAAiB,GAAG,eAAe,GAAG,gBAAgB,GAAG,YAAY,GAAG,MAAM,CAAC;AAC3F,uEAAuE;AACvE,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,WAAW,CAAC;AACtD,0DAA0D;AAC1D,MAAM,MAAM,uBAAuB,GAAG,MAAM,GAAG,QAAQ,CAAC;AAExD,iEAAiE;AACjE,MAAM,WAAW,kBAAkB;IACjC,kBAAkB;IAClB,QAAQ,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC;IAC5B,oCAAoC;IACpC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,kHAAkH;IAClH,QAAQ,C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AoB,CAAC,QAAQ,EAAE,eAAe,GAAG,SAAS,GAAG,QAAQ,CAAC,eAAe,CAAC,CAsBrG;AAED,gGAAgG;AAChG,wBAAgB,mBAAmB,IAAI,cAAc,CAQpD;AAED,+FAA+F;AAC/F,wBAAgB,wBAAwB,IAAI,cAAc,CAEzD;AAED,+CAA+C;AAC/C,wBAAgB,mCAAmC,IAAI,cAAc,CASpE;AAED,+FAA+F;AAC/F,wBAAgB,2BAA2B,CACzC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,EACrB,eAAe,UAAO,EACtB,kBAAkB,UAAO,EACzB,YAAY,CAAC,EAAE,aAAa,CAAC,kBAAkB,CAAC,GAAG,IAAI,GACtD,cAAc,CAgBhB;AAED,yFAAyF;AACzF,wBAAgB,qCAAqC,CAAC,kBAAkB,UAAO,GAAG,cAAc,CAQ/F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sheet/options.jsx","sources":["../../src/sheet/options.ts"],"sourcesContent":["import type { ReactNode } from '@lynx-js/react';\nimport type { G9BottomSheetLoadingSkeleton } from '../display/shimmer';\nimport type { G9IconInput } from '../icon/icon';\n\n// MAUI `G9BottomSheetOptions` / `G9BottomSheetSettings` and their enums (BottomSheet/G9BottomSheetOptions.cs).\n\n/** Detents (MAUI `G9BottomSheetState`): peek (collapsed height), medium (half), large (full). */\nexport type G9SheetDetent = 'peek' | 'medium' | 'large';\n/** Detent sizing or fit-to-content (MAUI `G9BottomSheetSizeMode`). */\nexport type G9SheetSizeMode = 'states' | 'fitToContent';\n/** Header title anchor (MAUI `G9BottomSheetHeaderTitlePlacement`). */\nexport type G9SheetHeaderTitlePlacement = 'center' | 'nearBack';\n/** Where a back request came from (MAUI `G9BottomSheetBackRequestSource` + drag-to-close). */\nexport type G9SheetBackSource = 'toolbarButton' | 'hardwareButton' | 'overlayTap' | 'drag';\n/** What `onBackRequested` decides (MAUI `G9BottomSheetBackAction`). */\nexport type G9SheetBackAction = 'close' | 'doNothing';\n/** Content width (MAUI `G9SheetViewContentWidthMode`). */\nexport type G9SheetContentWidthMode = 'full' | 'custom';\n\n/** A header toolbar action (MAUI `G9BottomSheetToolbarItem`). */\nexport interface G9SheetToolbarItem {\n /** Glyph/icon. */\n readonly icon?: G9IconInput;\n /** Text (when there is no icon). */\n readonly text?: string;\n /** The action (MAUI `AsyncAction`/`Command`); a returned promise keeps the item busy while `disableWhileBusy`. */\n readonly onPress?: () => unknown;\n readonly isBusy?: boolean;\n /** Spinner while busy. Default false. */\n readonly showBusyIndicator?: boolean;\n readonly isActive?: boolean;\n /** Dot while active. Default false. */\n readonly showActiveBadge?: boolean;\n /**\n * A count on the action (MAUI 1.4.9 `BadgeText`: AgriPad's site filter shows its «۲» active filters): a small pill\n * with this text, shown whatever `showActiveBadge` / `isActive` say. Null / empty: the plain dot (or nothing).\n */\n readonly badgeText?: string | null;\n /** Ignore presses while busy. Default true. */\n readonly disableWhileBusy?: boolean;\n /** Default true. */\n readonly animatePress?: boolean;\n /** 0 → 24. */\n readonly iconSize?: number;\n readonly accessibilityLabel?: string;\n /** Element id of the item (default `${sheet automationId}_ToolbarItem_${key or index}` when the sheet has one). */\n readonly automationId?: string;\n /** Stable key (default the index). */\n readonly key?: string;\n}\n\n/** Lifecycle callbacks of one sheet (MAUI `Opening/Opened/Closing/ClosedCommand`). */\nexport interface G9SheetLifecycle {\n /** When the sheet starts opening. */\n readonly onOpening?: () => void;\n /** After the open motion (or its timer fallback). */\n readonly onOpened?: () => void;\n /** Once, when closing starts (not on an in-place replace). */\n readonly onClosing?: () => void;\n /** Once, at cleanup. */\n readonly onClosed?: () => void;\n /** The sheet came to rest at another detent (MAUI `G9SheetView.StateChanged`), with its height in px. */\n readonly onStateChanged?: (detent: G9SheetDetent | 'fit', heightPx: number) => void;\n}\n\n/** Everything a sheet can be opened with (MAUI `G9BottomSheetOptions`; 77 properties + presets). */\nexport interface G9SheetOptions extends G9SheetLifecycle {\n // State and sizing\n /** Initial detent. Default `'medium'`. */\n readonly currentState?: G9SheetDetent;\n /** Allowed detents. Default `['medium', 'large']`. */\n readonly states?: ReadonlyArray<G9SheetDetent>;\n /** Default `'states'`. */\n readonly sizeMode?: G9SheetSizeMode;\n /** Dim scrim that blocks the page. Default true. */\n readonly isModal?: boolean;\n /** Overlay tap / drag may close. Default true. */\n readonly isCancelable?: boolean;\n /** Default true. */\n readonly isDraggable?: boolean;\n /** Grabber. Default true. */\n readonly hasHandle?: boolean;\n /** Peek height (dp). Default 100 (with `collapsedHeight`). */\n readonly peekHeight?: number | null;\n /** Alias of `peekHeight` (MAUI `CollapsedHeight`); wins when both are set. */\n readonly collapsedHeight?: number | null;\n /** Medium = host × ratio (0.1–0.9). Default 0.5. */\n readonly halfExpandedRatio?: number | null;\n /** Large = host × ratio (0.1–1). Default 1. */\n readonly fullExpandedRatio?: number | null;\n /** Cap of a fit sheet (0.2–1). Default 0.75. */\n readonly maxFitToContentHeightRatio?: number;\n /** The largest detent is sized to the content (states mode). Default false. */\n readonly expandedFitsContent?: boolean;\n /**\n * Grabber on a draggable sheet with ONE detent, which (as in MAUI) has none by default. For a sheet that has one detent\n * only here — MAUI's peek of a short content followed it down to the content, so MAUI showed two detents of one height\n * and a grabber; lynx-ui resolves its detents once, so the host asks for one fit detent and keeps the grabber with this.\n * Default false.\n */\n readonly handleOnSingleDetent?: boolean;\n /** A drag on a scroller expands the sheet first. Default true. */\n readonly scrollingExpandsSheet?: boolean;\n /**\n * The body is a vertical scroller (default true). `false` for content that scrolls itself — a `<list>` page, a map:\n * the body becomes a flex column and the content fills it, so the content's own scroller gets a definite height (MAUI\n * puts the content in the body as is; a CollectionView body scrolls itself). Lynx-only, additive. Use it with a\n * detent-sized sheet (full screen / states); a fit-to-content sheet has no height to give.\n */\n readonly scrollBody?: boolean;\n /**\n * The body's scroll bar: `'system'` (default) — the platform's, shown while a finger scrolls, then faded; `'always'` —\n * a thin thumb in the body's side inset at the inline end, visible whenever the content is taller than the body and\n * moving with it (a menu of full-width cards whose last card is cut off says «more below»). Lynx-only, additive.\n */\n readonly scrollIndicator?: 'system' | 'always';\n /**\n * Called when the scrolling body comes within {@link scrollToEndThreshold} of its end — a body that renders a window\n * of a long list grows it here (the selection sheet's next page, MAUI 1.4.8 `OnItemsScrolled`). Not called for a\n * static body (`scrollBody: false`). Lynx-only, additive.\n */\n readonly onScrollToEnd?: () => void;\n /** Distance from the end (px) that counts as «at the end» for {@link onScrollToEnd}. Default 208 (four 52 px rows). */\n readonly scrollToEndThreshold?: number;\n /** Height memory key (needed for factory content). */\n readonly heightMemoKey?: string | null;\n // Visual\n /** Body padding. Default 0. */\n readonly padding?: number;\n /** 10 px gap under the header hairline. Default true. */\n readonly useStandardBodyTopGap?: boolean;\n /** Top corners. Default 12. */\n readonly cornerRadius?: number;\n /** Body background. Default `var(--g9-surface-container)`. */\n readonly backgroundColor?: string | null;\n /** Scrim colour; its alpha replaces the maximum opacity. */\n readonly windowBackgroundColor?: string | null;\n /** Default `'full'`. */\n readonly contentWidthMode?: G9SheetContentWidthMode;\n /** Width in `'custom'` mode (MAUI `G9BottomSheetContentWidth`). */\n readonly contentWidth?: number | null;\n /**\n * Full-screen sheets, and detent sheets resting at a `large` detent that reaches under the top inset, reserve the\n * top inset (MAUI state-aware top padding). Default true.\n */\n readonly useTopSafeAreaPadding?: boolean;\n /**\n * The surface reserves the host's bottom safe inset (a visible navigation bar or gesture handle) below the content\n * and footer. 0 on an immersive host. Default true.\n */\n readonly useBottomSafeAreaPadding?: boolean;\n /** Default 0. */\n readonly additionalTopSafeAreaPadding?: number;\n /** Replaces the top padding (0 = flush). */\n readonly topSafeAreaPaddingOverride?: number | null;\n /** Grabber on full-screen toolbar sheets. Default true. */\n readonly showFullScreenDragHandle?: boolean;\n /** Page recede behind a tall primary sheet. Default true. */\n readonly enableBackdropCardEffect?: boolean;\n /** Visible ratio where the recede starts. Default 0.75. */\n readonly backdropCardEffectThreshold?: number;\n // Animation and loading\n /** Per-sheet open duration (ms); default the settings value. */\n readonly openAnimationDurationMs?: number | null;\n readonly closeAnimationDurationMs?: number | null;\n /** Factory content builds after the open motion (spinner/skeleton first). Default true. */\n readonly deferContent?: boolean;\n /** Delay before deferred content swaps in. Default 369. */\n readonly loadDelayMs?: number;\n /** The placeholder uses the full height. Default false. */\n readonly useFullScreenLoadingPlaceholder?: boolean;\n /** Known final body height for the placeholder. */\n readonly deferredLoadingPlaceholderHeight?: number | null;\n /** Covered crossfade reveal of deferred content. Default true. */\n readonly fadeDeferredContentIn?: boolean;\n /** Placeholder shape. Default `'none'` (spinner). */\n readonly loadingSkeleton?: G9BottomSheetLoadingSkeleton;\n /** 0 → the shape's default. */\n readonly loadingSkeletonRowCount?: number;\n // Stack and replace\n /** The parent sinks and fades when this sheet stacks on it. Default true. */\n readonly recedeParentOnStack?: boolean;\n /** Hand-off: replaces the one open sheet once this one is ready. Default false. */\n readonly replaceCurrentSheet?: boolean;\n // Header and footer\n /** Three-slot header. Default false. */\n readonly showToolbar?: boolean;\n /** Leading back (or close) button. Default false. */\n readonly showCloseButton?: boolean;\n /** × instead of the back arrow. Default false. */\n readonly useCloseIcon?: boolean;\n /**\n * Automation id of the sheet (MAUI `AutomationId`): the surface gets it, the header's back/close button\n * `${id}_Back`, toolbar items `${id}_ToolbarItem_${key or index}` (see `g9ChildId`). Keep it to `[A-Za-z0-9_-]`.\n */\n readonly automationId?: string;\n readonly title?: string | null;\n readonly toolbarItems?: ReadonlyArray<G9SheetToolbarItem> | null;\n /** Items built from the content once it exists. */\n readonly toolbarItemsFactory?: (() => ReadonlyArray<G9SheetToolbarItem>) | null;\n /** Default `'center'`. */\n readonly headerTitlePlacement?: G9SheetHeaderTitlePlacement;\n /** Star/Auto/Star columns. Default true. */\n readonly reserveEmptyHeaderSlots?: boolean;\n readonly headerView?: ReactNode;\n readonly headerLeadingView?: ReactNode;\n readonly headerTitleView?: ReactNode;\n readonly headerTrailingView?: ReactNode;\n readonly headerLeadingAndTitleView?: ReactNode;\n readonly headerTitleAndTrailingView?: ReactNode;\n /**\n * A footer that draws its own band (usually a component rendering {@link G9SheetFooterBar}, or nothing) — for\n * buttons that come and go while the sheet is open. Wins over `footerView` and `footerButtons`.\n */\n readonly footerBand?: ReactNode;\n /** Custom footer inside the standard band; wins over `footerButtons`. */\n readonly footerView?: ReactNode;\n /** Equal-width footer buttons. */\n readonly footerButtons?: ReadonlyArray<ReactNode> | null;\n /** Default 3. */\n readonly footerMaxButtonsPerRow?: number;\n /** Hardware back closes. Default true. */\n readonly hardwareBackCloses?: boolean;\n /** Intercepts every back request (disables drag). */\n readonly onBackRequested?: ((source: G9SheetBackSource) => G9SheetBackAction | Promise<G9SheetBackAction>) | null;\n // Platform specific (accepted; applied where Lynx has an equivalent)\n /** Max sheet width on Android (px). */\n readonly androidMaxWidth?: number | null;\n /** Max sheet height on Android (px). */\n readonly androidMaxHeight?: number | null;\n /** Margin around the sheet on Android `[l, t, r, b]`. */\n readonly androidMargin?: readonly [number, number, number, number] | null;\n /** Android half-expanded ratio override. */\n readonly androidHalfExpandedRatio?: number | null;\n /** Square the expanded corners on Android. */\n readonly androidShouldRemoveExpandedCorners?: boolean | null;\n readonly windowsMaxWidth?: number | null;\n readonly windowsMaxHeight?: number | null;\n readonly windowsMinWidth?: number | null;\n readonly windowsMinHeight?: number | null;\n /** Animate the scrim colour on iOS. Default true. */\n readonly animateOverlayToColorOnIos?: boolean;\n}\n\n/** App-wide sheet settings (MAUI `G9BottomSheetSettings`), `<G9Provider settings={{ sheets }}>`. */\nexport interface G9SheetSettings {\n /** Default black. */\n readonly modalOverlayColor?: string;\n /** Dim at the smallest detent (0–1). Default 0.3. */\n readonly modalOverlayMinimumOpacity?: number;\n /** Dim at full screen (0–1). Default 0.9. */\n readonly modalOverlayMaximumOpacity?: number;\n /** Default 300. */\n readonly openAnimationDurationMs?: number;\n /** Default 300. */\n readonly closeAnimationDurationMs?: number;\n /** Partial traversals take a proportional slice. Default true. */\n readonly sizeScaledAnimationDuration?: boolean;\n /** Global switch of the page recede. Default true. */\n readonly enableBackdropCardEffect?: boolean;\n /**\n * The sheets rise above the soft keyboard (MAUI KeyboardInsetScope; G9MAUIControls 1.4.11 rule «every input in a bottom\n * sheet takes the keyboard shift»): while the keyboard is up the sheet layer ends at its top edge, so a fit sheet's field and\n * footer stay visible and a tall sheet gives up height. Only what the host has not already resized is lifted — a host that\n * pads its view by the IME inset (the gallery's `GalleryActivity`) shrinks the window itself. Default true.\n */\n readonly avoidKeyboard?: boolean;\n /** Colour behind the receded page. Default black. */\n readonly backdropCardColor?: string;\n /** Staged pipeline: a `replaceCurrentSheet` successor hands off once it is ready. Default true. */\n readonly stageBeforeShow?: boolean;\n /** Longest a hand-off waits for the successor to open before the old sheet closes anyway (0–5000). Default 250. */\n readonly preOpenMaxHoldMs?: number;\n /** Prebuilt (non-factory) content also waits behind the loading placeholder until after the open motion. Default false. */\n readonly deferPrebuiltContent?: boolean;\n /** `'platformNative'` (lynx-ui's motion) or `'timed'` (tween over the durations). Default platformNative. */\n readonly motionStyle?: 'platformNative' | 'timed';\n /** The app version the persisted sheet heights belong to; another version discards them. Default `'0'`. */\n readonly heightMemoVersion?: string;\n /**\n * Side padding of the header band (MAUI `G9LayoutMetrics.EdgeSpacing`, which an app may scale — AgriPad's 10 × 1.3\n * = 13). Default 16.\n */\n readonly headerEdgeSpacing?: number;\n}\n\nconst clamp = (v: number, lo: number, hi: number) => Math.min(hi, Math.max(lo, v));\nconst finite = (v: number | undefined, fallback: number) =>\n typeof v === 'number' && Number.isFinite(v) ? v : fallback;\n\n/** {@link G9SheetSettings} with defaults, clamped like MAUI `G9BottomSheetSettings.Normalize`. */\nexport function resolveSheetSettings(settings: G9SheetSettings | undefined): Required<G9SheetSettings> {\n const s = settings ?? {};\n let min = clamp(finite(s.modalOverlayMinimumOpacity, 0.3), 0, 1);\n let max = clamp(finite(s.modalOverlayMaximumOpacity, 0.9), 0, 1);\n if (min > max) [min, max] = [max, min];\n return Object.freeze({\n modalOverlayColor: s.modalOverlayColor ?? '#000000',\n modalOverlayMinimumOpacity: min,\n modalOverlayMaximumOpacity: max,\n openAnimationDurationMs: Math.max(0, finite(s.openAnimationDurationMs, 300)),\n closeAnimationDurationMs: Math.max(0, finite(s.closeAnimationDurationMs, 300)),\n sizeScaledAnimationDuration: s.sizeScaledAnimationDuration ?? true,\n enableBackdropCardEffect: s.enableBackdropCardEffect ?? true,\n avoidKeyboard: s.avoidKeyboard ?? true,\n backdropCardColor: s.backdropCardColor ?? '#000000',\n stageBeforeShow: s.stageBeforeShow ?? true,\n preOpenMaxHoldMs: clamp(finite(s.preOpenMaxHoldMs, 250), 0, 5000),\n deferPrebuiltContent: s.deferPrebuiltContent ?? false,\n motionStyle: s.motionStyle ?? 'platformNative',\n heightMemoVersion: s.heightMemoVersion ?? '0',\n headerEdgeSpacing: Math.max(0, finite(s.headerEdgeSpacing, 16)),\n });\n}\n\n/** MAUI `DefaultOptions()`: medium, `[medium, large]`, modal, cancelable, handle, draggable. */\nexport function defaultSheetOptions(): G9SheetOptions {\n return {\n currentState: 'medium',\n states: ['medium', 'large'],\n sizeMode: 'states',\n halfExpandedRatio: 0.5,\n fullExpandedRatio: 1,\n };\n}\n\n/** MAUI `FitToContentOptions()`: sized to a non-scrolling body, capped at 75 % of the host. */\nexport function fitToContentSheetOptions(): G9SheetOptions {\n return { sizeMode: 'fitToContent', isCancelable: true, hasHandle: true, isDraggable: true, deferContent: true };\n}\n\n/** MAUI `FullScreenWithoutHandleOptions()`. */\nexport function fullScreenWithoutHandleSheetOptions(): G9SheetOptions {\n return {\n currentState: 'large',\n states: ['large'],\n isCancelable: false,\n isDraggable: false,\n hasHandle: false,\n deferContent: true,\n };\n}\n\n/** MAUI `FullScreenModalOptions(title, showCloseButton, hardwareBackCloses, toolbarItems)`. */\nexport function fullScreenModalSheetOptions(\n title?: string | null,\n showCloseButton = true,\n hardwareBackCloses = true,\n toolbarItems?: ReadonlyArray<G9SheetToolbarItem> | null,\n): G9SheetOptions {\n return {\n currentState: 'large',\n states: ['large'],\n sizeMode: 'states',\n isCancelable: false,\n isDraggable: false,\n hasHandle: false,\n cornerRadius: 0,\n backgroundColor: 'var(--g9-background)',\n showToolbar: true,\n showCloseButton,\n title: title ?? null,\n toolbarItems: toolbarItems ?? null,\n hardwareBackCloses,\n };\n}\n\n/** MAUI `FullScreenEdgeToEdgeModalOptions(hardwareBackCloses)`: no header, flush top. */\nexport function fullScreenEdgeToEdgeModalSheetOptions(hardwareBackCloses = true): G9SheetOptions {\n return {\n ...fullScreenModalSheetOptions(null, false, hardwareBackCloses),\n showToolbar: false,\n useTopSafeAreaPadding: false,\n topSafeAreaPaddingOverride: 0,\n additionalTopSafeAreaPadding: 0,\n };\n}\n"],"names":["clamp","v","lo","hi","Math","finite","fallback","Number","resolveSheetSettings","settings","_s_modalOverlayColor","_s_sizeScaledAnimationDuration","_s_enableBackdropCardEffect","_s_avoidKeyboard","_s_backdropCardColor","_s_stageBeforeShow","_s_deferPrebuiltContent","_s_motionStyle","_s_heightMemoVersion","s","min","max","Object","defaultSheetOptions","fitToContentSheetOptions","fullScreenWithoutHandleSheetOptions","fullScreenModalSheetOptions","title","showCloseButton","hardwareBackCloses","toolbarItems","fullScreenEdgeToEdgeModalSheetOptions"],"mappings":"AA8RA,MAAMA,QAAQ,CAACC,GAAWC,IAAYC,KAAeC,KAAK,GAAG,CAACD,IAAIC,KAAK,GAAG,CAACF,IAAID;AAC/E,MAAMI,SAAS,CAACJ,GAAuBK,WACrC,AAAa,YAAb,OAAOL,KAAkBM,OAAO,QAAQ,CAACN,KAAKA,IAAIK;AAG7C,SAASE,qBAAqBC,QAAqC;QAMnDC,sBAKUC,gCACHC,6BACXC,kBACIC,sBACFC,oBAEKC,yBACTC,gBACMC;IAlBrB,MAAMC,IAAIV,QAAAA,WAAAA,WAAY,CAAC;IACvB,IAAIW,MAAMpB,MAAMK,OAAOc,EAAE,0BAA0B,EAAE,MAAM,GAAG;IAC9D,IAAIE,MAAMrB,MAAMK,OAAOc,EAAE,0BAA0B,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ACd,OAAO;QAAE,UAAU;QAAgB,cAAc;QAAM,WAAW;QAAM,aAAa;QAAM,cAAc;IAAK;AAChH;AAGO,SAASC;IACd,OAAO;QACL,cAAc;QACd,QAAQ;YAAC;SAAQ;QACjB,cAAc;QACd,aAAa;QACb,WAAW;QACX,cAAc;IAChB;AACF;AAGO,SAASC,4BACdC,KAAqB,EACrBC,kBAAkB,IAAI,EACtBC,qBAAqB,IAAI,EACzBC,YAAuD;IAEvD,OAAO;QACL,cAAc;QACd,QAAQ;YAAC;SAAQ;QACjB,UAAU;QACV,cAAc;QACd,aAAa;QACb,WAAW;QACX,cAAc;QACd,iBAAiB;QACjB,aAAa;QACbF;QACA,OAAOD,QAAAA,QAAAA,QAAS;QAChB,cAAcG,QAAAA,eAAAA,eAAgB;QAC9BD;IACF;AACF;AAGO,SAASE,sCAAsCF,qBAAqB,IAAI;IAC7E,OAAO;QACL,GAAGH,4BAA4B,MAAM,OAAOG,mBAAmB;QAC/D,aAAa;QACb,uBAAuB;QACvB,4BAA4B;QAC5B,8BAA8B;IAChC;AACF"}
|
|
1
|
+
{"version":3,"file":"sheet/options.jsx","sources":["../../src/sheet/options.ts"],"sourcesContent":["import type { G9PlaceDeclaration, G9SegmentInput } from '@g9tm/lynxcontrols-foundation';\nimport type { ReactNode } from '@lynx-js/react';\nimport type { G9BottomSheetLoadingSkeleton } from '../display/shimmer';\nimport type { G9IconInput } from '../icon/icon';\n\n// MAUI `G9BottomSheetOptions` / `G9BottomSheetSettings` and their enums (BottomSheet/G9BottomSheetOptions.cs).\n\n/**\n * The place a sheet is in the app's navigation (`@g9tm/lynxcontrols/route`): declared while the sheet is open, closed\n * through the sheet itself. Without it a sheet still shows in the address, as `sheet.<automation id>`.\n */\nexport interface G9SheetRoute extends Omit<G9PlaceDeclaration, 'segment' | 'layer' | 'order' | 'close'> {\n readonly segment: G9SegmentInput | (() => G9SegmentInput);\n}\n\n/** Detents (MAUI `G9BottomSheetState`): peek (collapsed height), medium (half), large (full). */\nexport type G9SheetDetent = 'peek' | 'medium' | 'large';\n/** Detent sizing or fit-to-content (MAUI `G9BottomSheetSizeMode`). */\nexport type G9SheetSizeMode = 'states' | 'fitToContent';\n/** Header title anchor (MAUI `G9BottomSheetHeaderTitlePlacement`). */\nexport type G9SheetHeaderTitlePlacement = 'center' | 'nearBack';\n/** Where a back request came from (MAUI `G9BottomSheetBackRequestSource` + drag-to-close). */\nexport type G9SheetBackSource = 'toolbarButton' | 'hardwareButton' | 'overlayTap' | 'drag';\n/** What `onBackRequested` decides (MAUI `G9BottomSheetBackAction`). */\nexport type G9SheetBackAction = 'close' | 'doNothing';\n/** Content width (MAUI `G9SheetViewContentWidthMode`). */\nexport type G9SheetContentWidthMode = 'full' | 'custom';\n\n/** A header toolbar action (MAUI `G9BottomSheetToolbarItem`). */\nexport interface G9SheetToolbarItem {\n /** Glyph/icon. */\n readonly icon?: G9IconInput;\n /** Text (when there is no icon). */\n readonly text?: string;\n /** The action (MAUI `AsyncAction`/`Command`); a returned promise keeps the item busy while `disableWhileBusy`. */\n readonly onPress?: () => unknown;\n readonly isBusy?: boolean;\n /** Spinner while busy. Default false. */\n readonly showBusyIndicator?: boolean;\n readonly isActive?: boolean;\n /** Dot while active. Default false. */\n readonly showActiveBadge?: boolean;\n /**\n * A count on the action (MAUI 1.4.9 `BadgeText`: AgriPad's site filter shows its «۲» active filters): a small pill\n * with this text, shown whatever `showActiveBadge` / `isActive` say. Null / empty: the plain dot (or nothing).\n */\n readonly badgeText?: string | null;\n /** Ignore presses while busy. Default true. */\n readonly disableWhileBusy?: boolean;\n /** Default true. */\n readonly animatePress?: boolean;\n /** 0 → 24. */\n readonly iconSize?: number;\n readonly accessibilityLabel?: string;\n /** Element id of the item (default `${sheet automationId}_ToolbarItem_${key or index}` when the sheet has one). */\n readonly automationId?: string;\n /** Stable key (default the index). */\n readonly key?: string;\n}\n\n/** Lifecycle callbacks of one sheet (MAUI `Opening/Opened/Closing/ClosedCommand`). */\nexport interface G9SheetLifecycle {\n /** When the sheet starts opening. */\n readonly onOpening?: () => void;\n /** After the open motion (or its timer fallback). */\n readonly onOpened?: () => void;\n /** Once, when closing starts (not on an in-place replace). */\n readonly onClosing?: () => void;\n /** Once, at cleanup. */\n readonly onClosed?: () => void;\n /** The sheet came to rest at another detent (MAUI `G9SheetView.StateChanged`), with its height in px. */\n readonly onStateChanged?: (detent: G9SheetDetent | 'fit', heightPx: number) => void;\n}\n\n/** Everything a sheet can be opened with (MAUI `G9BottomSheetOptions`; 77 properties + presets). */\nexport interface G9SheetOptions extends G9SheetLifecycle {\n // State and sizing\n /** Initial detent. Default `'medium'`. */\n readonly currentState?: G9SheetDetent;\n /** Allowed detents. Default `['medium', 'large']`. */\n readonly states?: ReadonlyArray<G9SheetDetent>;\n /** Default `'states'`. */\n readonly sizeMode?: G9SheetSizeMode;\n /** Dim scrim that blocks the page. Default true. */\n readonly isModal?: boolean;\n /** Overlay tap / drag may close. Default true. */\n readonly isCancelable?: boolean;\n /** Default true. */\n readonly isDraggable?: boolean;\n /** Grabber. Default true. */\n readonly hasHandle?: boolean;\n /** Peek height (dp). Default 100 (with `collapsedHeight`). */\n readonly peekHeight?: number | null;\n /** Alias of `peekHeight` (MAUI `CollapsedHeight`); wins when both are set. */\n readonly collapsedHeight?: number | null;\n /** Medium = host × ratio (0.1–0.9). Default 0.5. */\n readonly halfExpandedRatio?: number | null;\n /** Large = host × ratio (0.1–1). Default 1. */\n readonly fullExpandedRatio?: number | null;\n /** Cap of a fit sheet (0.2–1). Default 0.75. */\n readonly maxFitToContentHeightRatio?: number;\n /** The largest detent is sized to the content (states mode). Default false. */\n readonly expandedFitsContent?: boolean;\n /**\n * Grabber on a draggable sheet with ONE detent, which (as in MAUI) has none by default. For a sheet that has one detent\n * only here — MAUI's peek of a short content followed it down to the content, so MAUI showed two detents of one height\n * and a grabber; lynx-ui resolves its detents once, so the host asks for one fit detent and keeps the grabber with this.\n * Default false.\n */\n readonly handleOnSingleDetent?: boolean;\n /** A drag on a scroller expands the sheet first. Default true. */\n readonly scrollingExpandsSheet?: boolean;\n /**\n * The body is a vertical scroller (default true). `false` for content that scrolls itself — a `<list>` page, a map:\n * the body becomes a flex column and the content fills it, so the content's own scroller gets a definite height (MAUI\n * puts the content in the body as is; a CollectionView body scrolls itself). Lynx-only, additive. Use it with a\n * detent-sized sheet (full screen / states); a fit-to-content sheet has no height to give.\n */\n readonly scrollBody?: boolean;\n /**\n * The body's scroll bar: `'system'` (default) — the platform's, shown while a finger scrolls, then faded; `'always'` —\n * a thin thumb in the body's side inset at the inline end, visible whenever the content is taller than the body and\n * moving with it (a menu of full-width cards whose last card is cut off says «more below»). Lynx-only, additive.\n */\n readonly scrollIndicator?: 'system' | 'always';\n /**\n * Called when the scrolling body comes within {@link scrollToEndThreshold} of its end — a body that renders a window\n * of a long list grows it here (the selection sheet's next page, MAUI 1.4.8 `OnItemsScrolled`). Not called for a\n * static body (`scrollBody: false`). Lynx-only, additive.\n */\n readonly onScrollToEnd?: () => void;\n /** Distance from the end (px) that counts as «at the end» for {@link onScrollToEnd}. Default 208 (four 52 px rows). */\n readonly scrollToEndThreshold?: number;\n /** Height memory key (needed for factory content). */\n readonly heightMemoKey?: string | null;\n // Visual\n /** Body padding. Default 0. */\n readonly padding?: number;\n /** 10 px gap under the header hairline. Default true. */\n readonly useStandardBodyTopGap?: boolean;\n /** Top corners. Default 12. */\n readonly cornerRadius?: number;\n /** Body background. Default `var(--g9-surface-container)`. */\n readonly backgroundColor?: string | null;\n /** Scrim colour; its alpha replaces the maximum opacity. */\n readonly windowBackgroundColor?: string | null;\n /** Default `'full'`. */\n readonly contentWidthMode?: G9SheetContentWidthMode;\n /** Width in `'custom'` mode (MAUI `G9BottomSheetContentWidth`). */\n readonly contentWidth?: number | null;\n /**\n * Full-screen sheets, and detent sheets resting at a `large` detent that reaches under the top inset, reserve the\n * top inset (MAUI state-aware top padding). Default true.\n */\n readonly useTopSafeAreaPadding?: boolean;\n /**\n * The surface reserves the host's bottom safe inset (a visible navigation bar or gesture handle) below the content\n * and footer. 0 on an immersive host. Default true.\n */\n readonly useBottomSafeAreaPadding?: boolean;\n /** Default 0. */\n readonly additionalTopSafeAreaPadding?: number;\n /** Replaces the top padding (0 = flush). */\n readonly topSafeAreaPaddingOverride?: number | null;\n /** Grabber on full-screen toolbar sheets. Default true. */\n readonly showFullScreenDragHandle?: boolean;\n /** Page recede behind a tall primary sheet. Default true. */\n readonly enableBackdropCardEffect?: boolean;\n /** Visible ratio where the recede starts. Default 0.75. */\n readonly backdropCardEffectThreshold?: number;\n // Animation and loading\n /** Per-sheet open duration (ms); default the settings value. */\n readonly openAnimationDurationMs?: number | null;\n readonly closeAnimationDurationMs?: number | null;\n /** Factory content builds after the open motion (spinner/skeleton first). Default true. */\n readonly deferContent?: boolean;\n /** Delay before deferred content swaps in. Default 369. */\n readonly loadDelayMs?: number;\n /** The placeholder uses the full height. Default false. */\n readonly useFullScreenLoadingPlaceholder?: boolean;\n /** Known final body height for the placeholder. */\n readonly deferredLoadingPlaceholderHeight?: number | null;\n /** Covered crossfade reveal of deferred content. Default true. */\n readonly fadeDeferredContentIn?: boolean;\n /** Placeholder shape. Default `'none'` (spinner). */\n readonly loadingSkeleton?: G9BottomSheetLoadingSkeleton;\n /** 0 → the shape's default. */\n readonly loadingSkeletonRowCount?: number;\n // Stack and replace\n /** The parent sinks and fades when this sheet stacks on it. Default true. */\n readonly recedeParentOnStack?: boolean;\n /** Hand-off: replaces the one open sheet once this one is ready. Default false. */\n readonly replaceCurrentSheet?: boolean;\n // Header and footer\n /** Three-slot header. Default false. */\n readonly showToolbar?: boolean;\n /** Leading back (or close) button. Default false. */\n readonly showCloseButton?: boolean;\n /** × instead of the back arrow. Default false. */\n readonly useCloseIcon?: boolean;\n /**\n * Automation id of the sheet (MAUI `AutomationId`): the surface gets it, the header's back/close button\n * `${id}_Back`, toolbar items `${id}_ToolbarItem_${key or index}` (see `g9ChildId`). Keep it to `[A-Za-z0-9_-]`.\n */\n readonly automationId?: string;\n /** The sheet's place in the navigation address (see {@link G9SheetRoute}). */\n readonly route?: G9SheetRoute;\n readonly title?: string | null;\n readonly toolbarItems?: ReadonlyArray<G9SheetToolbarItem> | null;\n /** Items built from the content once it exists. */\n readonly toolbarItemsFactory?: (() => ReadonlyArray<G9SheetToolbarItem>) | null;\n /** Default `'center'`. */\n readonly headerTitlePlacement?: G9SheetHeaderTitlePlacement;\n /** Star/Auto/Star columns. Default true. */\n readonly reserveEmptyHeaderSlots?: boolean;\n readonly headerView?: ReactNode;\n readonly headerLeadingView?: ReactNode;\n readonly headerTitleView?: ReactNode;\n readonly headerTrailingView?: ReactNode;\n readonly headerLeadingAndTitleView?: ReactNode;\n readonly headerTitleAndTrailingView?: ReactNode;\n /**\n * A footer that draws its own band (usually a component rendering {@link G9SheetFooterBar}, or nothing) — for\n * buttons that come and go while the sheet is open. Wins over `footerView` and `footerButtons`.\n */\n readonly footerBand?: ReactNode;\n /** Custom footer inside the standard band; wins over `footerButtons`. */\n readonly footerView?: ReactNode;\n /** Equal-width footer buttons. */\n readonly footerButtons?: ReadonlyArray<ReactNode> | null;\n /** Default 3. */\n readonly footerMaxButtonsPerRow?: number;\n /** Hardware back closes. Default true. */\n readonly hardwareBackCloses?: boolean;\n /** Intercepts every back request (disables drag). */\n readonly onBackRequested?: ((source: G9SheetBackSource) => G9SheetBackAction | Promise<G9SheetBackAction>) | null;\n // Platform specific (accepted; applied where Lynx has an equivalent)\n /** Max sheet width on Android (px). */\n readonly androidMaxWidth?: number | null;\n /** Max sheet height on Android (px). */\n readonly androidMaxHeight?: number | null;\n /** Margin around the sheet on Android `[l, t, r, b]`. */\n readonly androidMargin?: readonly [number, number, number, number] | null;\n /** Android half-expanded ratio override. */\n readonly androidHalfExpandedRatio?: number | null;\n /** Square the expanded corners on Android. */\n readonly androidShouldRemoveExpandedCorners?: boolean | null;\n readonly windowsMaxWidth?: number | null;\n readonly windowsMaxHeight?: number | null;\n readonly windowsMinWidth?: number | null;\n readonly windowsMinHeight?: number | null;\n /** Animate the scrim colour on iOS. Default true. */\n readonly animateOverlayToColorOnIos?: boolean;\n}\n\n/** App-wide sheet settings (MAUI `G9BottomSheetSettings`), `<G9Provider settings={{ sheets }}>`. */\nexport interface G9SheetSettings {\n /** Default black. */\n readonly modalOverlayColor?: string;\n /** Dim at the smallest detent (0–1). Default 0.3. */\n readonly modalOverlayMinimumOpacity?: number;\n /** Dim at full screen (0–1). Default 0.9. */\n readonly modalOverlayMaximumOpacity?: number;\n /** Default 300. */\n readonly openAnimationDurationMs?: number;\n /** Default 300. */\n readonly closeAnimationDurationMs?: number;\n /** Partial traversals take a proportional slice. Default true. */\n readonly sizeScaledAnimationDuration?: boolean;\n /** Global switch of the page recede. Default true. */\n readonly enableBackdropCardEffect?: boolean;\n /**\n * The sheets rise above the soft keyboard (MAUI KeyboardInsetScope; G9MAUIControls 1.4.11 rule «every input in a bottom\n * sheet takes the keyboard shift»): while the keyboard is up the sheet layer ends at its top edge, so a fit sheet's field and\n * footer stay visible and a tall sheet gives up height. Only what the host has not already resized is lifted — a host that\n * pads its view by the IME inset (the gallery's `GalleryActivity`) shrinks the window itself. Default true.\n */\n readonly avoidKeyboard?: boolean;\n /** Colour behind the receded page. Default black. */\n readonly backdropCardColor?: string;\n /** Staged pipeline: a `replaceCurrentSheet` successor hands off once it is ready. Default true. */\n readonly stageBeforeShow?: boolean;\n /** Longest a hand-off waits for the successor to open before the old sheet closes anyway (0–5000). Default 250. */\n readonly preOpenMaxHoldMs?: number;\n /** Prebuilt (non-factory) content also waits behind the loading placeholder until after the open motion. Default false. */\n readonly deferPrebuiltContent?: boolean;\n /** `'platformNative'` (lynx-ui's motion) or `'timed'` (tween over the durations). Default platformNative. */\n readonly motionStyle?: 'platformNative' | 'timed';\n /** The app version the persisted sheet heights belong to; another version discards them. Default `'0'`. */\n readonly heightMemoVersion?: string;\n /**\n * Side padding of the header band (MAUI `G9LayoutMetrics.EdgeSpacing`, which an app may scale — AgriPad's 10 × 1.3\n * = 13). Default 16.\n */\n readonly headerEdgeSpacing?: number;\n}\n\nconst clamp = (v: number, lo: number, hi: number) => Math.min(hi, Math.max(lo, v));\nconst finite = (v: number | undefined, fallback: number) =>\n typeof v === 'number' && Number.isFinite(v) ? v : fallback;\n\n/** {@link G9SheetSettings} with defaults, clamped like MAUI `G9BottomSheetSettings.Normalize`. */\nexport function resolveSheetSettings(settings: G9SheetSettings | undefined): Required<G9SheetSettings> {\n const s = settings ?? {};\n let min = clamp(finite(s.modalOverlayMinimumOpacity, 0.3), 0, 1);\n let max = clamp(finite(s.modalOverlayMaximumOpacity, 0.9), 0, 1);\n if (min > max) [min, max] = [max, min];\n return Object.freeze({\n modalOverlayColor: s.modalOverlayColor ?? '#000000',\n modalOverlayMinimumOpacity: min,\n modalOverlayMaximumOpacity: max,\n openAnimationDurationMs: Math.max(0, finite(s.openAnimationDurationMs, 300)),\n closeAnimationDurationMs: Math.max(0, finite(s.closeAnimationDurationMs, 300)),\n sizeScaledAnimationDuration: s.sizeScaledAnimationDuration ?? true,\n enableBackdropCardEffect: s.enableBackdropCardEffect ?? true,\n avoidKeyboard: s.avoidKeyboard ?? true,\n backdropCardColor: s.backdropCardColor ?? '#000000',\n stageBeforeShow: s.stageBeforeShow ?? true,\n preOpenMaxHoldMs: clamp(finite(s.preOpenMaxHoldMs, 250), 0, 5000),\n deferPrebuiltContent: s.deferPrebuiltContent ?? false,\n motionStyle: s.motionStyle ?? 'platformNative',\n heightMemoVersion: s.heightMemoVersion ?? '0',\n headerEdgeSpacing: Math.max(0, finite(s.headerEdgeSpacing, 16)),\n });\n}\n\n/** MAUI `DefaultOptions()`: medium, `[medium, large]`, modal, cancelable, handle, draggable. */\nexport function defaultSheetOptions(): G9SheetOptions {\n return {\n currentState: 'medium',\n states: ['medium', 'large'],\n sizeMode: 'states',\n halfExpandedRatio: 0.5,\n fullExpandedRatio: 1,\n };\n}\n\n/** MAUI `FitToContentOptions()`: sized to a non-scrolling body, capped at 75 % of the host. */\nexport function fitToContentSheetOptions(): G9SheetOptions {\n return { sizeMode: 'fitToContent', isCancelable: true, hasHandle: true, isDraggable: true, deferContent: true };\n}\n\n/** MAUI `FullScreenWithoutHandleOptions()`. */\nexport function fullScreenWithoutHandleSheetOptions(): G9SheetOptions {\n return {\n currentState: 'large',\n states: ['large'],\n isCancelable: false,\n isDraggable: false,\n hasHandle: false,\n deferContent: true,\n };\n}\n\n/** MAUI `FullScreenModalOptions(title, showCloseButton, hardwareBackCloses, toolbarItems)`. */\nexport function fullScreenModalSheetOptions(\n title?: string | null,\n showCloseButton = true,\n hardwareBackCloses = true,\n toolbarItems?: ReadonlyArray<G9SheetToolbarItem> | null,\n): G9SheetOptions {\n return {\n currentState: 'large',\n states: ['large'],\n sizeMode: 'states',\n isCancelable: false,\n isDraggable: false,\n hasHandle: false,\n cornerRadius: 0,\n backgroundColor: 'var(--g9-background)',\n showToolbar: true,\n showCloseButton,\n title: title ?? null,\n toolbarItems: toolbarItems ?? null,\n hardwareBackCloses,\n };\n}\n\n/** MAUI `FullScreenEdgeToEdgeModalOptions(hardwareBackCloses)`: no header, flush top. */\nexport function fullScreenEdgeToEdgeModalSheetOptions(hardwareBackCloses = true): G9SheetOptions {\n return {\n ...fullScreenModalSheetOptions(null, false, hardwareBackCloses),\n showToolbar: false,\n useTopSafeAreaPadding: false,\n topSafeAreaPaddingOverride: 0,\n additionalTopSafeAreaPadding: 0,\n };\n}\n"],"names":["clamp","v","lo","hi","Math","finite","fallback","Number","resolveSheetSettings","settings","_s_modalOverlayColor","_s_sizeScaledAnimationDuration","_s_enableBackdropCardEffect","_s_avoidKeyboard","_s_backdropCardColor","_s_stageBeforeShow","_s_deferPrebuiltContent","_s_motionStyle","_s_heightMemoVersion","s","min","max","Object","defaultSheetOptions","fitToContentSheetOptions","fullScreenWithoutHandleSheetOptions","fullScreenModalSheetOptions","title","showCloseButton","hardwareBackCloses","toolbarItems","fullScreenEdgeToEdgeModalSheetOptions"],"mappings":"AAySA,MAAMA,QAAQ,CA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AE,MAAM,GAAG;QAC5D,sBAAsB,QAAAH,CAAAA,0BAAAA,EAAE,oBAAoB,AAAD,IAArBA,0BAA0B;QAChD,aAAa,QAAAC,CAAAA,iBAAAA,EAAE,WAAW,AAAD,IAAZA,iBAAiB;QAC9B,mBAAmB,QAAAC,CAAAA,uBAAAA,EAAE,iBAAiB,AAAD,IAAlBA,uBAAuB;QAC1C,mBAAmBd,KAAK,GAAG,CAAC,GAAGC,OAAOc,EAAE,iBAAiB,EAAE;IAC7D;AACF;AAGO,SAASI;IACd,OAAO;QACL,cAAc;QACd,QAAQ;YAAC;YAAU;SAAQ;QAC3B,UAAU;QACV,mBAAmB;QACnB,mBAAmB;IACrB;AACF;AAGO,SAASC;IACd,OAAO;QAAE,UAAU;QAAgB,cAAc;QAAM,WAAW;QAAM,aAAa;QAAM,cAAc;IAAK;AAChH;AAGO,SAASC;IACd,OAAO;QACL,cAAc;QACd,QAAQ;YAAC;SAAQ;QACjB,cAAc;QACd,aAAa;QACb,WAAW;QACX,cAAc;IAChB;AACF;AAGO,SAASC,4BACdC,KAAqB,EACrBC,kBAAkB,IAAI,EACtBC,qBAAqB,IAAI,EACzBC,YAAuD;IAEvD,OAAO;QACL,cAAc;QACd,QAAQ;YAAC;SAAQ;QACjB,UAAU;QACV,cAAc;QACd,aAAa;QACb,WAAW;QACX,cAAc;QACd,iBAAiB;QACjB,aAAa;QACbF;QACA,OAAOD,QAAAA,QAAAA,QAAS;QAChB,cAAcG,QAAAA,eAAAA,eAAgB;QAC9BD;IACF;AACF;AAGO,SAASE,sCAAsCF,qBAAqB,IAAI;IAC7E,OAAO;QACL,GAAGH,4BAA4B,MAAM,OAAOG,mBAAmB;QAC/D,aAAa;QACb,uBAAuB;QACvB,4BAA4B;QAC5B,8BAA8B;IAChC;AACF"}
|
package/dist/sheet/service.d.ts
CHANGED
|
@@ -40,6 +40,11 @@ export interface G9SheetService {
|
|
|
40
40
|
/** The stack (advanced: rendering, tests). */
|
|
41
41
|
readonly stack: G9SheetStack;
|
|
42
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* The height the sheets lay out in: the layer's measured box once it has one (it already excludes the lift, and a host's
|
|
45
|
+
* IME padding), else the window less the lift (the first frame).
|
|
46
|
+
*/
|
|
47
|
+
export declare function sheetHostHeight(measured: number, windowHeight: number, lift: number): number;
|
|
43
48
|
/**
|
|
44
49
|
* How far the sheet layer rises above the soft keyboard: its height, less what the host already took off the window
|
|
45
50
|
* (`baselineHeight` = the window while the keyboard was hidden). 0 while hidden; never negative; never more than the window.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/sheet/service.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,YAAY,EAAW,MAAM,kBAAkB,CAAC;AAU9D,OAAO,EAAyB,KAAK,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAC3G,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,eAAe,EAErB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,wBAAwB,EAA4B,MAAM,cAAc,CAAC;AAE/G,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEhF,0FAA0F;AAC1F,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,IAAI,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,aAAa,GAAG,IAAI,CAAC;IAC9E,iGAAiG;IACjG,SAAS,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC;IAC5F,uHAAuH;IACvH,OAAO,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,aAAa,GAAG,IAAI,CAAC;IACjF;;;;OAIG;IACH,cAAc,CACZ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IAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAChE,cAAc,EAAE,MAAM,EACtB,YAAY,EAAE,MAAM,GACnB,MAAM,CAIR;AAkED,yDAAyD;AACzD,wBAAgB,cAAc,CAC5B,IAAI,EAAE,YAAY,EAClB,QAAQ,CAAC,EAAE,QAAQ,CAAC,eAAe,CAAC,EACpC,WAAW,CAAC,EAAE,sBAAsB,GACnC,cAAc,CAIhB;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,cAAc,CAI5C;AAED;;;GAGG;AACH,wBAAgB,QAAQ,IAAI,cAAc,CAEzC"}
|
package/dist/sheet/service.jsx
CHANGED
|
@@ -21,6 +21,14 @@ function StackView(props) {
|
|
|
21
21
|
const baseline = useRef(win.height);
|
|
22
22
|
if (!keyboard.visible) baseline.current = win.height;
|
|
23
23
|
const lift = state.settings.avoidKeyboard ? keyboardLift(keyboard, baseline.current, win.height) : 0;
|
|
24
|
+
const [measured, setMeasured] = useState(0);
|
|
25
|
+
const onStackLayout = (e)=>{
|
|
26
|
+
var _e_detail;
|
|
27
|
+
const h = null == (_e_detail = e.detail) ? void 0 : _e_detail.height;
|
|
28
|
+
if ('number' == typeof h && Number.isFinite(h) && h > 0) setMeasured((current)=>Math.abs(current - h) < 0.5 ? current : h);
|
|
29
|
+
};
|
|
30
|
+
const hostHeight = sheetHostHeight(measured, win.height, lift);
|
|
31
|
+
const hostShrunk = measured > 0 && measured < win.height - lift - 1;
|
|
24
32
|
const stack = state.service.stack;
|
|
25
33
|
const entries = useSyncExternalStore((l)=>stack.subscribe(l), ()=>stack.getSnapshot());
|
|
26
34
|
const host = useG9Host();
|
|
@@ -58,12 +66,16 @@ function StackView(props) {
|
|
|
58
66
|
return <view className="g9-sheet-stack" style={{
|
|
59
67
|
bottom: `${lift}px`
|
|
60
68
|
}}>
|
|
61
|
-
|
|
69
|
+
<view className="g9-sheet-stack__probe" bindlayoutchange={onStackLayout}/>
|
|
70
|
+
{entries.map((entry)=><G9SheetFrame key={entry.frameKey} entry={entry} stack={stack} hostHeight={hostHeight} hostWidth={win.width} topInset={insets.top} bottomInset={lift > 0 || hostShrunk ? 0 : insets.bottom} settings={state.settings} memo={state.service.heightMemo} culture={culture.locale} isTop={entry === top} onRest={(heightPx)=>setRest({
|
|
62
71
|
id: entry.id,
|
|
63
72
|
heightPx
|
|
64
73
|
})}/>)}
|
|
65
74
|
</view>;
|
|
66
75
|
}
|
|
76
|
+
function sheetHostHeight(measured, windowHeight, lift) {
|
|
77
|
+
return measured > 0 ? measured : Math.max(0, windowHeight - lift);
|
|
78
|
+
}
|
|
67
79
|
function keyboardLift(keyboard, baselineHeight, windowHeight) {
|
|
68
80
|
if (!keyboard.visible || !(keyboard.height > 0)) return 0;
|
|
69
81
|
const resized = Math.max(0, baselineHeight - windowHeight);
|
|
@@ -149,6 +161,6 @@ function useG9Sheets() {
|
|
|
149
161
|
function g9Sheets() {
|
|
150
162
|
return sheetServiceOf(g9Hosts.require());
|
|
151
163
|
}
|
|
152
|
-
export { g9Sheets, keyboardLift, sheetServiceOf, useG9Sheets };
|
|
164
|
+
export { g9Sheets, keyboardLift, sheetHostHeight, sheetServiceOf, useG9Sheets };
|
|
153
165
|
|
|
154
166
|
//# sourceMappingURL=service.jsx.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sheet/service.jsx","sources":["../../src/sheet/service.tsx"],"sourcesContent":["import { type ReactNode, useEffect, useRef, useState, useSyncExternalStore } from '@lynx-js/react';\nimport { startTimer, stopTimer } from '../base/timers';\nimport { useG9Host, useG9HostInsets } from '../host/hooks';\nimport { type G9HostHandle, g9Hosts } from '../host/registry';\nimport {\n useG9Culture,\n useG9Keyboard,\n useG9Preferences,\n useG9Settings,\n useG9Theme,\n useG9Window,\n} from '../provider/hooks';\nimport { G9SheetFrame } from './frame';\nimport { createSheetHeightMemo, type G9SheetHeightMemo, type G9SheetMemoPreferences } from './height-memo';\nimport {\n fitToContentSheetOptions,\n fullScreenModalSheetOptions,\n type G9SheetOptions,\n type G9SheetSettings,\n resolveSheetSettings,\n} from './options';\nimport { type G9ProcessingBuild, type G9ProcessingErrorHandler, G9ProcessingSheetContent } from './processing';\nimport { backdropCardTransform, sheetVisibleRatio } from './sizing';\nimport { type G9SheetContent, type G9SheetHandle, G9SheetStack } from './stack';\n\n/** The sheet API of one host (MAUI `G9BottomSheetHelper` + `G9BottomSheetExtensions`). */\nexport interface G9SheetService {\n /**\n * Opens a sheet (MAUI `ShowG9BottomSheet`): auto-stacks over an open sheet, hands off with `replaceCurrentSheet`,\n * otherwise opens as primary. `content` may be a factory, built after the open motion (`deferContent`). Returns the\n * sheet-scoped handle, or `null` when throttled (a second show/replace within 369 ms).\n */\n show(content: G9SheetContent, options?: G9SheetOptions): G9SheetHandle | null;\n /** `show` as a promise (MAUI `ShowG9BottomSheetAsync`): resolves with the handle (or `null`). */\n showAsync(content: G9SheetContent, options?: G9SheetOptions): Promise<G9SheetHandle | null>;\n /** Replaces the open sheet in place when it can morph, else back-closes it and opens (MAUI `ReplaceG9BottomSheet`). */\n replace(content: G9SheetContent, options?: G9SheetOptions): G9SheetHandle | null;\n /**\n * Opens at once with a spinner, then builds the body (MAUI `ShowProcessingG9BottomSheet`): `build(handle, signal)`\n * returns the body (the sheet grows to fit), `null` (closes quietly) or throws (`onError`, else error popup + close).\n * Default options: fit to content, not deferred.\n */\n showProcessing(\n build: G9ProcessingBuild,\n options?: G9SheetOptions,\n onError?: G9ProcessingErrorHandler,\n loadingHeight?: number,\n ): G9SheetHandle | null;\n /** Full-screen modal sheet, not throttled (MAUI `ShowFullScreenAsync`). */\n showFullScreen(content: G9SheetContent, options?: G9SheetOptions): G9SheetHandle;\n /** Back-routes the top sheet (MAUI `CloseTopG9BottomSheet`). */\n closeTop(): void;\n /** Closes every sheet (MAUI `CloseG9BottomSheet`). */\n closeAll(): void;\n /** Open sheets (MAUI `GetOpenSheetCount`). */\n getOpenCount(): number;\n /** Routes hardware back to the top sheet; `false` when none is open (MAUI `HandleHardwareBackPressed`). */\n handleHardwareBack(): boolean;\n /** `true` while a hand-off successor is replacing this sheet (MAUI `IsBeingReplaced`). */\n isBeingReplaced(handle: G9SheetHandle | null | undefined): boolean;\n /** The scrim colour behind receded pages (MAUI `GetBackdropCardColor`). */\n getBackdropCardColor(): string;\n /** The height memory of this host's sheets. */\n readonly heightMemo: G9SheetHeightMemo;\n /** The stack (advanced: rendering, tests). */\n readonly stack: G9SheetStack;\n}\n\nconst FEATURE = 'g9.sheets';\n\ninterface ServiceState {\n readonly service: G9SheetService;\n settings: Required<G9SheetSettings>;\n}\n\nfunction StackView(props: { readonly state: ServiceState }): ReactNode {\n const { state } = props;\n state.settings = useG9Settings().sheets;\n const win = useG9Window();\n const insets = useG9HostInsets();\n const culture = useG9Culture();\n // The keyboard's lift (settings.avoidKeyboard): the window height while the keyboard was hidden is the baseline, so a host\n // that already shrank the window for the IME is not lifted twice.\n const keyboard = useG9Keyboard();\n const baseline = useRef(win.height);\n if (!keyboard.visible) baseline.current = win.height;\n const lift = state.settings.avoidKeyboard ? keyboardLift(keyboard, baseline.current, win.height) : 0;\n const stack = state.service.stack;\n const entries = useSyncExternalStore(\n (l) => stack.subscribe(l),\n () => stack.getSnapshot(),\n );\n const host = useG9Host();\n // Backdrop card: the page recedes behind a tall primary sheet (not fit, not stacked over) once its visible ratio\n // reaches `backdropCardEffectThreshold` (default 0.75): the opening detent first, then where the sheet came to rest.\n const [rest, setRest] = useState<{ readonly id: number; readonly heightPx: number } | null>(null);\n const primary = entries.find((e) => e.status === 'opening' || e.status === 'open');\n const card =\n state.settings.enableBackdropCardEffect &&\n primary !== undefined &&\n primary.options.enableBackdropCardEffect !== false &&\n primary.options.sizeMode !== 'fitToContent' &&\n backdropCardTransform(\n sheetVisibleRatio(primary.options, win.height, rest?.id === primary.id ? rest.heightPx : null),\n Math.min(0.99, Math.max(0.1, primary.options.backdropCardEffectThreshold ?? 0.75)),\n );\n const effectOn = card && card.scale < 1 ? card : null;\n const effect = effectOn\n ? {\n scale: Math.round(effectOn.scale * 1000) / 1000,\n translateY: Math.round(effectOn.translateY * 10) / 10,\n durationMs: state.settings.openAnimationDurationMs,\n backdropColor: state.settings.backdropCardColor,\n }\n : null;\n const effectKey = effect ? `${effect.scale}|${effect.translateY}|${effect.durationMs}|${effect.backdropColor}` : '';\n useEffect(() => {\n host.setContentEffect(effect);\n }, [effectKey]);\n useEffect(() => () => stack.dispose(), [stack]);\n // Learned heights belong to one look: a theme change re-measures (viewport and culture are part of the key).\n const scheme = useG9Theme().scheme;\n const lastScheme = useRef(scheme);\n useEffect(() => {\n if (lastScheme.current === scheme) return;\n lastScheme.current = scheme;\n state.service.heightMemo.invalidate();\n }, [scheme]);\n const top = [...entries].reverse().find((e) => e.status === 'opening' || e.status === 'open');\n return (\n <view className=\"g9-sheet-stack\" style={{ bottom: `${lift}px` }}>\n {entries.map((entry) => (\n <G9SheetFrame\n key={entry.frameKey}\n entry={entry}\n stack={stack}\n hostHeight={win.height - lift}\n hostWidth={win.width}\n topInset={insets.top}\n // The keyboard covers the bottom bar: no inset under a lifted sheet.\n bottomInset={lift > 0 ? 0 : insets.bottom}\n settings={state.settings}\n memo={state.service.heightMemo}\n culture={culture.locale}\n isTop={entry === top}\n onRest={(heightPx) => setRest({ id: entry.id, heightPx })}\n />\n ))}\n </view>\n );\n}\n\n/**\n * How far the sheet layer rises above the soft keyboard: its height, less what the host already took off the window\n * (`baselineHeight` = the window while the keyboard was hidden). 0 while hidden; never negative; never more than the window.\n */\nexport function keyboardLift(\n keyboard: { readonly visible: boolean; readonly height: number },\n baselineHeight: number,\n windowHeight: number,\n): number {\n if (!keyboard.visible || !(keyboard.height > 0)) return 0;\n const resized = Math.max(0, baselineHeight - windowHeight);\n return Math.round(Math.min(Math.max(0, windowHeight - 1), Math.max(0, keyboard.height - resized)));\n}\n\n/** Creates the sheet service of a host (attached once as a host feature). */\nfunction createSheetService(\n host: G9HostHandle,\n settings?: Required<G9SheetSettings>,\n preferences?: G9SheetMemoPreferences,\n): ServiceState {\n const clock = host.services.clock;\n const state = { settings: settings ?? resolveSheetSettings(undefined) } as ServiceState;\n const stack = new G9SheetStack({\n now: () => clock.monotonicNow(),\n setTimer: (cb, ms) => startTimer(cb, ms),\n clearTimer: (h) => stopTimer(h),\n durations: (o) => ({\n open: o.openAnimationDurationMs ?? state.settings.openAnimationDurationMs,\n close: o.closeAnimationDurationMs ?? state.settings.closeAnimationDurationMs,\n }),\n stageBeforeShow: () => state.settings.stageBeforeShow,\n preOpenMaxHoldMs: () => state.settings.preOpenMaxHoldMs,\n });\n const heightMemo = createSheetHeightMemo({\n ...(preferences ? { preferences } : {}),\n appVersion: state.settings.heightMemoVersion,\n setTimer: (cb, ms) => startTimer(cb, ms),\n clearTimer: (h) => stopTimer(h),\n });\n const service: G9SheetService = {\n stack,\n heightMemo,\n show: (content, options) => stack.show(content, options ?? {}),\n showAsync: (content, options) => Promise.resolve(stack.show(content, options ?? {})),\n replace: (content, options) => stack.replace(content, options ?? fitToContentSheetOptions()),\n showProcessing(build, options, onError, loadingHeight) {\n let handle: G9SheetHandle | null = null;\n const content = () => (\n <G9ProcessingSheetContent\n build={build}\n {...(onError ? { onError } : {})}\n loadingHeight={loadingHeight && loadingHeight > 0 ? loadingHeight : 160}\n handle={() => handle}\n />\n );\n handle = stack.show(content, { ...(options ?? fitToContentSheetOptions()), deferContent: false });\n return handle;\n },\n showFullScreen: (content, options) =>\n stack.show(content, options ?? fullScreenModalSheetOptions(), false) as G9SheetHandle,\n closeTop: () => stack.closeTop(),\n closeAll: () => stack.closeAll(),\n getOpenCount: () => stack.openCount(),\n handleHardwareBack: () => stack.handleHardwareBack(),\n isBeingReplaced: (handle) => {\n if (!handle) return false;\n const entry = stack.getSnapshot().find((e) => e.id === handle.id);\n return entry?.handingOff === true;\n },\n getBackdropCardColor: () => state.settings.backdropCardColor,\n };\n (state as { service: G9SheetService }).service = service;\n host.attachFeature(FEATURE, state);\n host.registerLayerItem('sheets', { key: FEATURE, element: <StackView state={state} />, order: 0 });\n host.back.push(() => (stack.handleHardwareBack() ? 'handled' : 'pass'), { layer: 'sheets' });\n return state;\n}\n\n/** The sheet service of a host, created on first use. */\nexport function sheetServiceOf(\n host: G9HostHandle,\n settings?: Required<G9SheetSettings>,\n preferences?: G9SheetMemoPreferences,\n): G9SheetService {\n const existing = host.getFeature(FEATURE) as ServiceState | undefined;\n if (existing && settings) existing.settings = settings;\n return (existing ?? createSheetService(host, settings, preferences)).service;\n}\n\n/**\n * The sheets of the nearest `G9Host` (MAUI `G9BottomSheetHelper` for that page). Sheets render in the host's\n * `sheets` layer; hardware back closes the top sheet first; the host's unmount settles every open sheet.\n */\nexport function useG9Sheets(): G9SheetService {\n const settings = useG9Settings().sheets;\n // Learned heights persist in the provider's preferences (key `g9controls.sheet-heights`).\n return sheetServiceOf(useG9Host(), settings, useG9Preferences());\n}\n\n/**\n * The sheets of the active host for code outside components (MAUI's static `G9BottomSheetHelper`): view models,\n * services. Throws `host-missing` when no host is mounted.\n */\nexport function g9Sheets(): G9SheetService {\n return sheetServiceOf(g9Hosts.require());\n}\n"],"names":["FEATURE","StackView","props","_primary_options_backdropCardEffectThreshold","state","useG9Settings","win","useG9Window","insets","useG9HostInsets","culture","useG9Culture","keyboard","useG9Keyboard","baseline","useRef","lift","keyboardLift","stack","entries","useSyncExternalStore","l","host","useG9Host","rest","setRest","useState","primary","e","card","undefined","backdropCardTransform","sheetVisibleRatio","Math","effectOn","effect","effectKey","useEffect","scheme","useG9Theme","lastScheme","top","view","entry","G9SheetFrame","heightPx","baselineHeight","windowHeight","resized","createSheetService","settings","preferences","clock","resolveSheetSettings","G9SheetStack","cb","ms","startTimer","h","stopTimer","o","_o_openAnimationDurationMs","_o_closeAnimationDurationMs","heightMemo","createSheetHeightMemo","service","content","options","Promise","fitToContentSheetOptions","build","onError","loadingHeight","handle","G9ProcessingSheetContent","fullScreenModalSheetOptions","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O;YACpB,MAAM9B,QAAQzB,MAAM,WAAW,GAAG,IAAI,CAAC,CAACU,IAAMA,EAAE,EAAE,KAAK6C,OAAO,EAAE;YAChE,OAAO9B,AAAAA,CAAAA,QAAAA,QAAAA,KAAAA,IAAAA,MAAO,UAAU,AAAD,MAAM;QAC/B;QACA,sBAAsB,IAAMvC,MAAM,QAAQ,CAAC,iBAAiB;IAC9D;IACCA,MAAsC,OAAO,GAAG6D;IACjD3C,KAAK,aAAa,CAACtB,SAASI;IAC5BkB,KAAK,iBAAiB,CAAC,UAAU;QAAE,KAAKtB;QAAS,UAAUC,UAAU,OAAOG;QAAW,OAAO;IAAE;IAChGkB,KAAK,IAAI,CAAC,IAAI,CAAC,IAAOJ,MAAM,kBAAkB,KAAK,YAAY,QAAS;QAAE,OAAO;IAAS;IAC1F,OAAOd;AACT;AAGO,SAASwE,eACdtD,IAAkB,EAClB4B,QAAoC,EACpCC,WAAoC;IAEpC,MAAM0B,WAAWvD,KAAK,UAAU,CAACtB;IACjC,IAAI6E,YAAY3B,UAAU2B,SAAS,QAAQ,GAAG3B;IAC9C,OAAO,AAAC2B,CAAAA,QAAAA,WAAAA,WAAY5B,mBAAmB3B,MAAM4B,UAAUC,YAAW,EAAG,OAAO;AAC9E;AAMO,SAAS2B;IACd,MAAM5B,WAAW7C,gBAAgB,MAAM;IAEvC,OAAOuE,eAAerD,aAAa2B,UAAU6B;AAC/C;AAMO,SAASC;IACd,OAAOJ,eAAeK,QAAQ,OAAO;AACvC"}
|
|
1
|
+
{"version":3,"file":"sheet/service.jsx","sources":["../../src/sheet/service.tsx"],"sourcesContent":["import { type ReactNode, useEffect, useRef, useState, useSyncExternalStore } from '@lynx-js/react';\nimport { startTimer, stopTimer } from '../base/timers';\nimport { useG9Host, useG9HostInsets } from '../host/hooks';\nimport { type G9HostHandle, g9Hosts } from '../host/registry';\nimport {\n useG9Culture,\n useG9Keyboard,\n useG9Preferences,\n useG9Settings,\n useG9Theme,\n useG9Window,\n} from '../provider/hooks';\nimport { G9SheetFrame } from './frame';\nimport { createSheetHeightMemo, type G9SheetHeightMemo, type G9SheetMemoPreferences } from './height-memo';\nimport {\n fitToContentSheetOptions,\n fullScreenModalSheetOptions,\n type G9SheetOptions,\n type G9SheetSettings,\n resolveSheetSettings,\n} from './options';\nimport { type G9ProcessingBuild, type G9ProcessingErrorHandler, G9ProcessingSheetContent } from './processing';\nimport { backdropCardTransform, sheetVisibleRatio } from './sizing';\nimport { type G9SheetContent, type G9SheetHandle, G9SheetStack } from './stack';\n\n/** The sheet API of one host (MAUI `G9BottomSheetHelper` + `G9BottomSheetExtensions`). */\nexport interface G9SheetService {\n /**\n * Opens a sheet (MAUI `ShowG9BottomSheet`): auto-stacks over an open sheet, hands off with `replaceCurrentSheet`,\n * otherwise opens as primary. `content` may be a factory, built after the open motion (`deferContent`). Returns the\n * sheet-scoped handle, or `null` when throttled (a second show/replace within 369 ms).\n */\n show(content: G9SheetContent, options?: G9SheetOptions): G9SheetHandle | null;\n /** `show` as a promise (MAUI `ShowG9BottomSheetAsync`): resolves with the handle (or `null`). */\n showAsync(content: G9SheetContent, options?: G9SheetOptions): Promise<G9SheetHandle | null>;\n /** Replaces the open sheet in place when it can morph, else back-closes it and opens (MAUI `ReplaceG9BottomSheet`). */\n replace(content: G9SheetContent, options?: G9SheetOptions): G9SheetHandle | null;\n /**\n * Opens at once with a spinner, then builds the body (MAUI `ShowProcessingG9BottomSheet`): `build(handle, signal)`\n * returns the body (the sheet grows to fit), `null` (closes quietly) or throws (`onError`, else error popup + close).\n * Default options: fit to content, not deferred.\n */\n showProcessing(\n build: G9ProcessingBuild,\n options?: G9SheetOptions,\n onError?: G9ProcessingErrorHandler,\n loadingHeight?: number,\n ): G9SheetHandle | null;\n /** Full-screen modal sheet, not throttled (MAUI `ShowFullScreenAsync`). */\n showFullScreen(content: G9SheetContent, options?: G9SheetOptions): G9SheetHandle;\n /** Back-routes the top sheet (MAUI `CloseTopG9BottomSheet`). */\n closeTop(): void;\n /** Closes every sheet (MAUI `CloseG9BottomSheet`). */\n closeAll(): void;\n /** Open sheets (MAUI `GetOpenSheetCount`). */\n getOpenCount(): number;\n /** Routes hardware back to the top sheet; `false` when none is open (MAUI `HandleHardwareBackPressed`). */\n handleHardwareBack(): boolean;\n /** `true` while a hand-off successor is replacing this sheet (MAUI `IsBeingReplaced`). */\n isBeingReplaced(handle: G9SheetHandle | null | undefined): boolean;\n /** The scrim colour behind receded pages (MAUI `GetBackdropCardColor`). */\n getBackdropCardColor(): string;\n /** The height memory of this host's sheets. */\n readonly heightMemo: G9SheetHeightMemo;\n /** The stack (advanced: rendering, tests). */\n readonly stack: G9SheetStack;\n}\n\nconst FEATURE = 'g9.sheets';\n\ninterface ServiceState {\n readonly service: G9SheetService;\n settings: Required<G9SheetSettings>;\n}\n\nfunction StackView(props: { readonly state: ServiceState }): ReactNode {\n const { state } = props;\n state.settings = useG9Settings().sheets;\n const win = useG9Window();\n const insets = useG9HostInsets();\n const culture = useG9Culture();\n // The keyboard's lift (settings.avoidKeyboard): the window height while the keyboard was hidden is the baseline, so a host\n // that already shrank the window for the IME is not lifted twice.\n const keyboard = useG9Keyboard();\n const baseline = useRef(win.height);\n if (!keyboard.visible) baseline.current = win.height;\n const lift = state.settings.avoidKeyboard ? keyboardLift(keyboard, baseline.current, win.height) : 0;\n // The layer's own height: a host that pads the page by the IME inset (the «IME inset as padding» host requirement)\n // shrinks THIS box, not the window — Lynx sends no onWindowResize for it — so a full-screen sheet sized from the window\n // stood a keyboard's height too tall and rose off the top of the screen (AgriPad Android, 2026-11-12).\n const [measured, setMeasured] = useState(0);\n // Measured on a childless probe that spans the layer: a sheet's own layout events (its body, its footer) can never\n // reach it, as they could the layer itself wherever layout events bubble.\n const onStackLayout = (e: { readonly detail?: { readonly height?: number } }) => {\n const h = e.detail?.height;\n if (typeof h === 'number' && Number.isFinite(h) && h > 0)\n setMeasured((current) => (Math.abs(current - h) < 0.5 ? current : h));\n };\n const hostHeight = sheetHostHeight(measured, win.height, lift);\n const hostShrunk = measured > 0 && measured < win.height - lift - 1;\n const stack = state.service.stack;\n const entries = useSyncExternalStore(\n (l) => stack.subscribe(l),\n () => stack.getSnapshot(),\n );\n const host = useG9Host();\n // Backdrop card: the page recedes behind a tall primary sheet (not fit, not stacked over) once its visible ratio\n // reaches `backdropCardEffectThreshold` (default 0.75): the opening detent first, then where the sheet came to rest.\n const [rest, setRest] = useState<{ readonly id: number; readonly heightPx: number } | null>(null);\n const primary = entries.find((e) => e.status === 'opening' || e.status === 'open');\n const card =\n state.settings.enableBackdropCardEffect &&\n primary !== undefined &&\n primary.options.enableBackdropCardEffect !== false &&\n primary.options.sizeMode !== 'fitToContent' &&\n backdropCardTransform(\n sheetVisibleRatio(primary.options, win.height, rest?.id === primary.id ? rest.heightPx : null),\n Math.min(0.99, Math.max(0.1, primary.options.backdropCardEffectThreshold ?? 0.75)),\n );\n const effectOn = card && card.scale < 1 ? card : null;\n const effect = effectOn\n ? {\n scale: Math.round(effectOn.scale * 1000) / 1000,\n translateY: Math.round(effectOn.translateY * 10) / 10,\n durationMs: state.settings.openAnimationDurationMs,\n backdropColor: state.settings.backdropCardColor,\n }\n : null;\n const effectKey = effect ? `${effect.scale}|${effect.translateY}|${effect.durationMs}|${effect.backdropColor}` : '';\n useEffect(() => {\n host.setContentEffect(effect);\n }, [effectKey]);\n useEffect(() => () => stack.dispose(), [stack]);\n // Learned heights belong to one look: a theme change re-measures (viewport and culture are part of the key).\n const scheme = useG9Theme().scheme;\n const lastScheme = useRef(scheme);\n useEffect(() => {\n if (lastScheme.current === scheme) return;\n lastScheme.current = scheme;\n state.service.heightMemo.invalidate();\n }, [scheme]);\n const top = [...entries].reverse().find((e) => e.status === 'opening' || e.status === 'open');\n return (\n <view className=\"g9-sheet-stack\" style={{ bottom: `${lift}px` }}>\n <view className=\"g9-sheet-stack__probe\" bindlayoutchange={onStackLayout} />\n {entries.map((entry) => (\n <G9SheetFrame\n key={entry.frameKey}\n entry={entry}\n stack={stack}\n hostHeight={hostHeight}\n hostWidth={win.width}\n topInset={insets.top}\n // The keyboard covers the bottom bar: no inset under a lifted sheet, nor under one the host shrank for it.\n bottomInset={lift > 0 || hostShrunk ? 0 : insets.bottom}\n settings={state.settings}\n memo={state.service.heightMemo}\n culture={culture.locale}\n isTop={entry === top}\n onRest={(heightPx) => setRest({ id: entry.id, heightPx })}\n />\n ))}\n </view>\n );\n}\n\n/**\n * The height the sheets lay out in: the layer's measured box once it has one (it already excludes the lift, and a host's\n * IME padding), else the window less the lift (the first frame).\n */\nexport function sheetHostHeight(measured: number, windowHeight: number, lift: number): number {\n return measured > 0 ? measured : Math.max(0, windowHeight - lift);\n}\n\n/**\n * How far the sheet layer rises above the soft keyboard: its height, less what the host already took off the window\n * (`baselineHeight` = the window while the keyboard was hidden). 0 while hidden; never negative; never more than the window.\n */\nexport function keyboardLift(\n keyboard: { readonly visible: boolean; readonly height: number },\n baselineHeight: number,\n windowHeight: number,\n): number {\n if (!keyboard.visible || !(keyboard.height > 0)) return 0;\n const resized = Math.max(0, baselineHeight - windowHeight);\n return Math.round(Math.min(Math.max(0, windowHeight - 1), Math.max(0, keyboard.height - resized)));\n}\n\n/** Creates the sheet service of a host (attached once as a host feature). */\nfunction createSheetService(\n host: G9HostHandle,\n settings?: Required<G9SheetSettings>,\n preferences?: G9SheetMemoPreferences,\n): ServiceState {\n const clock = host.services.clock;\n const state = { settings: settings ?? resolveSheetSettings(undefined) } as ServiceState;\n const stack = new G9SheetStack({\n now: () => clock.monotonicNow(),\n setTimer: (cb, ms) => startTimer(cb, ms),\n clearTimer: (h) => stopTimer(h),\n durations: (o) => ({\n open: o.openAnimationDurationMs ?? state.settings.openAnimationDurationMs,\n close: o.closeAnimationDurationMs ?? state.settings.closeAnimationDurationMs,\n }),\n stageBeforeShow: () => state.settings.stageBeforeShow,\n preOpenMaxHoldMs: () => state.settings.preOpenMaxHoldMs,\n });\n const heightMemo = createSheetHeightMemo({\n ...(preferences ? { preferences } : {}),\n appVersion: state.settings.heightMemoVersion,\n setTimer: (cb, ms) => startTimer(cb, ms),\n clearTimer: (h) => stopTimer(h),\n });\n const service: G9SheetService = {\n stack,\n heightMemo,\n show: (content, options) => stack.show(content, options ?? {}),\n showAsync: (content, options) => Promise.resolve(stack.show(content, options ?? {})),\n replace: (content, options) => stack.replace(content, options ?? fitToContentSheetOptions()),\n showProcessing(build, options, onError, loadingHeight) {\n let handle: G9SheetHandle | null = null;\n const content = () => (\n <G9ProcessingSheetContent\n build={build}\n {...(onError ? { onError } : {})}\n loadingHeight={loadingHeight && loadingHeight > 0 ? loadingHeight : 160}\n handle={() => handle}\n />\n );\n handle = stack.show(content, { ...(options ?? fitToContentSheetOptions()), deferContent: false });\n return handle;\n },\n showFullScreen: (content, options) =>\n stack.show(content, options ?? fullScreenModalSheetOptions(), false) as G9SheetHandle,\n closeTop: () => stack.closeTop(),\n closeAll: () => stack.closeAll(),\n getOpenCount: () => stack.openCount(),\n handleHardwareBack: () => stack.handleHardwareBack(),\n isBeingReplaced: (handle) => {\n if (!handle) return false;\n const entry = stack.getSnapshot().find((e) => e.id === handle.id);\n return entry?.handingOff === true;\n },\n getBackdropCardColor: () => state.settings.backdropCardColor,\n };\n (state as { service: G9SheetService }).service = service;\n host.attachFeature(FEATURE, state);\n host.registerLayerItem('sheets', { key: FEATURE, element: <StackView state={state} />, order: 0 });\n host.back.push(() => (stack.handleHardwareBack() ? 'handled' : 'pass'), { layer: 'sheets' });\n return state;\n}\n\n/** The sheet service of a host, created on first use. */\nexport function sheetServiceOf(\n host: G9HostHandle,\n settings?: Required<G9SheetSettings>,\n preferences?: G9SheetMemoPreferences,\n): G9SheetService {\n const existing = host.getFeature(FEATURE) as ServiceState | undefined;\n if (existing && settings) existing.settings = settings;\n return (existing ?? createSheetService(host, settings, preferences)).service;\n}\n\n/**\n * The sheets of the nearest `G9Host` (MAUI `G9BottomSheetHelper` for that page). Sheets render in the host's\n * `sheets` layer; hardware back closes the top sheet first; the host's unmount settles every open sheet.\n */\nexport function useG9Sheets(): G9SheetService {\n const settings = useG9Settings().sheets;\n // Learned heights persist in the provider's preferences (key `g9controls.sheet-heights`).\n return sheetServiceOf(useG9Host(), settings, useG9Preferences());\n}\n\n/**\n * The sheets of the active host for code outside components (MAUI's static `G9BottomSheetHelper`): view models,\n * services. Throws `host-missing` when no host is mounted.\n */\nexport function g9Sheets(): G9SheetService {\n return sheetServiceOf(g9Hosts.require());\n}\n"],"names":["FEATURE","StackView","props","_primary_options_backdropCardEffectThreshold","state","useG9Settings","win","useG9Window","insets","useG9HostInsets","culture","useG9Culture","keyboard","useG9Keyboard","baseline","useRef","lift","keyboardLift","measured","setMeasured","useState","onStackLayout","e","_e_detail","h","Number","current","Math","hostHeight","sheetHostHeight","hostShrunk","stack","entries","useSyncExternalStore","l","host","useG9Host","rest","setRest","primary","card","undefined","backdropCardTransform","sheetVisibleRatio","effectOn","effect","effectKey","useEffect","scheme","useG9Theme","lastScheme","top","view","entry","G9SheetFrame","heightPx","windowHeight","baselineHeight","resized","createSheetService","settings","preferences","clock","resolveSheetSettings","G9SheetStack","cb","ms","startTimer","stopTimer","o","_o_openAnimationDurationMs","_o_closeAnimationDurationMs","heightMemo","createSheetHeightMemo","service","content","options","Promise","fitToContentSheetOptions","build","onError","loadingHeight","handle","G9ProcessingSheetContent","fullScreenModalSheetOptions","sheetServiceOf","existing","useG9Sheets","useG9Preferences","g9Sheets","g9Hosts"],"mappings":";;;;;;;;;;;AAoEA,MAAMA,UAAU;AAOhB,SAASC,UAAUC,KAAuC;QA0CvBC;IAzCjC,MAAM,EAAEC,KAAK,EAAE,GAAGF;IAClBE,MAAM,QAAQ,GAAGC,gBAAgB,MAAM;IACvC,MAAMC,MAAMC;IACZ,MAAMC,SAASC;IACf,MAAMC,UAAUC;IAGhB,MAAMC,WAAWC;IACjB,MAAMC,WAAWC,OAAOT,IAAI,MAAM;IAClC,IAAI,CAACM,SAAS,OAAO,EAAEE,SAAS,OAAO,GAAGR,IAAI,MAAM;IACpD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css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack://./src/sheet/sheet.css"],"names":[],"mappings":"AACA;EAAE,oBAAoB;EACpB,kBAAkB;EAClB,MAAM;EACN,SAAS;EACT,OAAO;EACP,QAAQ;AACV;;AAIA;EADE,MAAM;EACN,SAAS;EACT,OAAO;EACP,QAAQ;AACV;;
|
|
1
|
+
{"version":3,"sources":["webpack://./src/sheet/sheet.css"],"names":[],"mappings":"AACA;EAAE,oBAAoB;EACpB,kBAAkB;EAClB,MAAM;EACN,SAAS;EACT,OAAO;EACP,QAAQ;AACV;;AAIA;EADE,oBAAoB;EACpB,QAAQ;EACR,kBAAkB;EAClB,MAAM;EACN,SAAS;EACT,OAAO;AACT;;AAKA;EAFE,MAAM;EACN,SAAS;EACT,OAAO;EACP,QAAQ;AACV;;AAMA;EAHE,oBAAoB;AACtB;;AAMA;EAHE,oBAAoB;AACtB;;AAMA;EAHE,oBAAoB;EACpB,sBAAsB;EACtB,aAAa;EACb,gBAAgB;AAClB;;AAOA;EAJE,sBAAsB;EACtB,YAAY;EACZ,cAAc;EACd,aAAa;EACb,kBAAkB;EAClB,iBAAiB;AACnB;;AAOA;EAJE,sBAAsB;EACtB,YAAY;EACZ,cAAc;EACd,aAAa;EACb,gBAAgB;AAClB;;AAQA;EALE,YAAY;EACZ,kBAAkB;EAClB,SAAS;EACT,OAAO;EACP,QAAQ;AACV;;AAQA;EALE,oBAAoB;EACpB,kBAAkB;EAClB,MAAM;EACN,SAAS;EACT,OAAO;EACP,QAAQ;AACV;;AAQA;EALE,oBAAoB;AACtB;;AAQA;EALE,uBAAuB;EACvB,mBAAmB;EACnB,YAAY;EACZ,aAAa;AACf;;AAQA;EALE,2CAA2C;EAC3C,mBAAmB;EACnB,WAAW;EACX,WAAW;AACb;;AASA;EANE,sBAAsB;EACtB,cAAc;EACd,aAAa;AACf;;AAUA;EAPE,wDAAwD;AAC1D;;AAUA;EAPE,cAAc;AAChB;;AAUA;E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sBAAsB;EACtB,cAAc;EACd,aAAa;AACf;;AAkBA;EAfE,uBAAuB;EACvB,qBAAqB;EACrB,2CAA2C;EAC3C,sBAAsB;EACtB,YAAY;EACZ,kBAAkB;EAClB,aAAa;AACf;;AAkBA;EAfE,mBAAmB;EACnB,eAAe;EACf,aAAa;AACf;;AAoBA;EAjBE,sBAAsB;EACtB,OAAO;EACP,aAAa;AACf","sourcesContent":["/* G9 sheets on lynx-ui Sheet (MAUI G9SheetView / header template). No shadows. */\n.g9-sheet-stack {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n pointer-events: none;\n}\n\n/* The layer's height, measured (service.tsx): a childless, zero-width, full-height box no sheet event passes through. */\n.g9-sheet-stack__probe {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n width: 0;\n pointer-events: none;\n}\n\n/* lynx-ui SheetView (position: fixed): the whole viewport, so the sheet rises from the bottom edge. */\n.g9-sheet__view {\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n}\n\n/* A non-modal sheet's view lets every touch it does not cover through to the page, native views included. */\n.g9-sheet__view--passthrough {\n pointer-events: none;\n}\n\n.g9-sheet__view--passthrough .g9-sheet {\n pointer-events: auto;\n}\n\n.g9-sheet {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n pointer-events: auto;\n}\n\n/* G9's own views inside lynx-ui's SheetContent (whose style a worklet owns): the frame recedes, the surface paints. */\n.g9-sheet__frame {\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n flex-shrink: 0;\n position: relative;\n overflow: visible;\n}\n\n.g9-sheet__surface {\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n flex-shrink: 0;\n overflow: hidden;\n}\n\n/* Paints below the surface for a drag past the top detent; outside the layout, so fit heights ignore it. */\n.g9-sheet__skirt {\n position: absolute;\n top: 100%;\n left: 0;\n right: 0;\n height: 50vh;\n}\n\n.g9-sheet__scrim {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n pointer-events: auto;\n}\n\n.g9-sheet__scrim--covered {\n pointer-events: none;\n}\n\n.g9-sheet__grabber-area {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 30px;\n}\n\n.g9-sheet__grabber {\n width: 32px;\n height: 4px;\n border-radius: 12px;\n background-color: var(--g9-outline-variant);\n}\n\n/* The grabber, header and body gap, measured as one: a fit sheet's cap includes them (MAUI). */\n.g9-sheet__chrome-top {\n display: flex;\n flex-direction: column;\n flex-shrink: 0;\n}\n\n/* MAUI UseStandardBodyTopGap: SheetHeaderVerticalGap under the header (10, or the app's scaled value). */\n.g9-sheet__body-gap {\n height: var(--g9-layout-sheet-header-vertical-gap, 10px);\n}\n\n.g9-sheet__body {\n flex-shrink: 1;\n}\n\n.g9-sheet__body--fill {\n flex: 1;\n}\n\n/* scrollIndicator: 'always' — the scroller and its thumb (scroll-indicator.tsx). The frame takes the body's place. */\n.g9-sheet__body-frame {\n display: flex;\n flex-direction: column;\n flex-shrink: 1;\n position: relative;\n}\n\n.g9-sheet__scroll-thumb {\n position: absolute;\n background-color: var(--g9-on-surface-variant);\n opacity: 0.45;\n pointer-events: none;\n}\n\n.g9-sheet__content {\n display: flex;\n flex-direction: column;\n position: relative;\n}\n\n/* scrollBody: false — the content scrolls itself and fills the body (longhands: a definite basis for its children). */\n.g9-sheet__body--static {\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n flex-shrink: 1;\n flex-basis: 0px;\n overflow: hidden;\n}\n\n.g9-sheet__content--fill {\n flex-grow: 1;\n flex-shrink: 1;\n flex-basis: 0px;\n}\n\n.g9-sheet__placeholder {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.g9-sheet__cover {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n background-color: var(--g9-surface-container);\n animation: g9-sheet-cover-out 220ms ease-out forwards;\n}\n\n@keyframes g9-sheet-cover-out {\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n}\n\n.g9-sheet-reveal {\n animation: g9-sheet-reveal-in 140ms ease-out;\n}\n\n@keyframes g9-sheet-reveal-in {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n\n.g9-sheet-loading,\n.g9-processing-sheet__loading {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.g9-sheet-header {\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 10px 16px;\n border-bottom-width: 1px;\n border-bottom-style: solid;\n border-bottom-color: rgba(121, 116, 126, 0.35);\n}\n\n.g9-sheet-header__side {\n display: flex;\n flex-direction: row;\n flex: 1;\n align-items: center;\n}\n\n.g9-sheet-header__start {\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n\n.g9-sheet-header__end {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: flex-end;\n}\n\n.g9-sheet-header__side.g9-sheet-header__end {\n justify-content: flex-end;\n}\n\n.g9-sheet-header__grow {\n display: flex;\n flex-direction: row;\n flex: 1;\n align-items: center;\n}\n\n.g9-sheet-header__title-near {\n padding: 0px 8px;\n}\n\n.g9-sheet-header__back {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n}\n\n.g9-sheet-header__title {\n font-weight: bold;\n color: var(--g9-secondary);\n text-overflow: ellipsis;\n}\n\n.g9-sheet-header__items {\n display: flex;\n flex-direction: row;\n column-gap: 8px;\n}\n\n/* Holds the footer (or nothing) so its height is measured with the body's for a fit sheet. */\n.g9-sheet__footer-slot {\n display: flex;\n flex-direction: column;\n flex-shrink: 0;\n}\n\n.g9-sheet-footer {\n display: flex;\n flex-direction: column;\n row-gap: 8px;\n padding: 12px 16px;\n border-top-width: 1px;\n border-top-style: solid;\n border-top-color: var(--g9-outline-variant);\n}\n\n.g9-sheet-footer__row {\n display: flex;\n flex-direction: row;\n column-gap: 8px;\n}\n\n/* A column: whatever a cell holds (a button, a wrapper around one) stretches to the cell's width, as MAUI's footer\n buttons fill their cell. */\n.g9-sheet-footer__cell {\n display: flex;\n flex-direction: column;\n flex: 1;\n}\n"],"sourceRoot":""}
|
package/dist/tabs/tab-view.d.ts
CHANGED
|
@@ -1,8 +1,22 @@
|
|
|
1
1
|
import './tabs.css';
|
|
2
|
+
import type { G9SegmentInput } from '@g9tm/lynxcontrols-foundation';
|
|
2
3
|
import { type ReactNode } from '@lynx-js/react';
|
|
3
4
|
import { type G9TabBarPosition, type G9TabItem, type G9TabMode, type G9TabStyle } from './model.js';
|
|
4
5
|
/** Props of {@link G9TabView}. */
|
|
5
6
|
export interface G9TabViewProps {
|
|
7
|
+
/**
|
|
8
|
+
* Element `id` of the tab view: it registers as an anchor (`@g9tm/lynxcontrols/anchor`) that lists and selects its tabs,
|
|
9
|
+
* and each tab cell as `${id}_Tab_${key}` (a guide can point at a tab, an automation can press it).
|
|
10
|
+
*/
|
|
11
|
+
readonly id?: string;
|
|
12
|
+
/**
|
|
13
|
+
* The navigation place of the selected tab (`@g9tm/lynxcontrols/route`): a segment for its key, or null when the tab is
|
|
14
|
+
* not a place of its own (the first tab of a header strip is often the page itself). Declared as an inner place; the
|
|
15
|
+
* router leaves it by selecting the first tab.
|
|
16
|
+
*/
|
|
17
|
+
readonly routeSegment?: (key: string) => G9SegmentInput | null;
|
|
18
|
+
/** The tab view is on screen (a kept-alive page passes its own `active`). Default true. */
|
|
19
|
+
readonly routeActive?: boolean;
|
|
6
20
|
/** The tabs (MAUI `Items`). Add, remove or reorder freely; give tabs a `key` so their bodies follow them. */
|
|
7
21
|
readonly items: readonly G9TabItem[];
|
|
8
22
|
/** Controlled selection (MAUI `SelectedIndex`, two-way). Out-of-range values show the nearest tab. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tab-view.d.ts","sourceRoot":"","sources":["../../src/tabs/tab-view.tsx"],"names":[],"mappings":"AAAA,OAAO,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"tab-view.d.ts","sourceRoot":"","sources":["../../src/tabs/tab-view.tsx"],"names":[],"mappings":"AAAA,OAAO,YAAY,CAAC;AACpB,OAAO,KAAK,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AAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B,uFAAuF;IACvF,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B,oFAAoF;IACpF,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IACpC,uHAAuH;IACvH,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC;IACrD,4GAA4G;IAC5G,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAChC,4FAA4F;IAC5F,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,SAAS,CA2L1D"}
|
package/dist/tabs/tab-view.jsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import "./tabs.css";
|
|
2
2
|
import { ViewPager } from "@lynx-js/lynx-ui-view-pager";
|
|
3
3
|
import { useEffect, useMemo, useRef, useState } from "@lynx-js/react";
|
|
4
|
+
import { useG9Anchor, useG9AnchorRegistry } from "../anchor/hooks.jsx";
|
|
4
5
|
import { g9RowStyle } from "../base/control.jsx";
|
|
5
6
|
import { startTimer, stopTimer } from "../base/timers.jsx";
|
|
6
7
|
import { useControllableState } from "../base/use-controllable-state.jsx";
|
|
@@ -8,9 +9,10 @@ import { G9ActivityIndicator } from "../display/activity-indicator.jsx";
|
|
|
8
9
|
import { invokeNodeWhenReady } from "../fields/use-text-input.jsx";
|
|
9
10
|
import { G9IconSlot } from "../icon/slot.jsx";
|
|
10
11
|
import { useG9Culture, useG9Direction } from "../provider/hooks.jsx";
|
|
12
|
+
import { useG9Place } from "../route/hooks.jsx";
|
|
11
13
|
import { G9TabRealizer, effectiveTabIndex, g9TabViewMetrics, tabBadge, tabContentSlideFrom, tabKey, tabVisualOrder, thicknessCss } from "./model.jsx";
|
|
12
14
|
function G9TabView(props) {
|
|
13
|
-
var _props_tabStyle, _props_mode, _props_barPosition, _props_tabHeight, _props_defaultSelectedIndex, _props_tabBarBackground, _props_indicatorColor, _props_frameCornerRadius, _props_contentPadding, _props_className;
|
|
15
|
+
var _props_tabStyle, _props_mode, _props_barPosition, _props_tabHeight, _props_defaultSelectedIndex, _props_routeActive, _props_tabBarBackground, _props_indicatorColor, _props_id, _props_frameCornerRadius, _props_contentPadding, _props_className;
|
|
14
16
|
const items = props.items;
|
|
15
17
|
const tabStyle = null != (_props_tabStyle = props.tabStyle) ? _props_tabStyle : 'underlined';
|
|
16
18
|
const mode = null != (_props_mode = props.mode) ? _props_mode : 'fixed';
|
|
@@ -77,6 +79,27 @@ function G9TabView(props) {
|
|
|
77
79
|
const select = (index)=>{
|
|
78
80
|
if (index !== effective) setSelected(index);
|
|
79
81
|
};
|
|
82
|
+
const anchor = useG9Anchor(props.id, {
|
|
83
|
+
kind: 'tab-view',
|
|
84
|
+
capabilities: {
|
|
85
|
+
itemKeys: ()=>keys,
|
|
86
|
+
getValue: ()=>activeKey,
|
|
87
|
+
selectItem: (key)=>{
|
|
88
|
+
const at = keys.indexOf(key);
|
|
89
|
+
if (at >= 0) select(at);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}, props.id ? {
|
|
93
|
+
domId: props.id
|
|
94
|
+
} : {});
|
|
95
|
+
const routeSegment = null !== activeKey && props.routeSegment ? props.routeSegment(activeKey) : null;
|
|
96
|
+
useG9Place(routeSegment ? {
|
|
97
|
+
segment: routeSegment,
|
|
98
|
+
layer: 'inner',
|
|
99
|
+
close: ()=>select(0)
|
|
100
|
+
} : null, {
|
|
101
|
+
active: null != (_props_routeActive = props.routeActive) ? _props_routeActive : true
|
|
102
|
+
});
|
|
80
103
|
const pager = useRef(null);
|
|
81
104
|
const swipe = true === props.swipeEnabled && !props.headerOnly;
|
|
82
105
|
const order = tabVisualOrder(count, rtl);
|
|
@@ -91,7 +114,7 @@ function G9TabView(props) {
|
|
|
91
114
|
visualIndex,
|
|
92
115
|
swipe
|
|
93
116
|
]);
|
|
94
|
-
const bar = <TabBarStrip items={items} order={order} effective={effective} tabStyle={tabStyle} mode={mode} tabHeight={tabHeight} background={null != (_props_tabBarBackground = props.tabBarBackground) ? _props_tabBarBackground : null} indicatorColor={null != (_props_indicatorColor = props.indicatorColor) ? _props_indicatorColor : null} numbering={culture.numberingSystem} onSelect={select}/>;
|
|
117
|
+
const bar = <TabBarStrip items={items} order={order} effective={effective} tabStyle={tabStyle} mode={mode} tabHeight={tabHeight} background={null != (_props_tabBarBackground = props.tabBarBackground) ? _props_tabBarBackground : null} indicatorColor={null != (_props_indicatorColor = props.indicatorColor) ? _props_indicatorColor : null} numbering={culture.numberingSystem} onSelect={select} anchorId={null != (_props_id = props.id) ? _props_id : null}/>;
|
|
95
118
|
const bodyOf = (index)=>{
|
|
96
119
|
const item = items[index];
|
|
97
120
|
const key = keys[index];
|
|
@@ -129,7 +152,7 @@ function G9TabView(props) {
|
|
|
129
152
|
{null !== pending && pending === activeKey ? <Spinner/> : null}
|
|
130
153
|
</>}
|
|
131
154
|
</view>;
|
|
132
|
-
return <view className={`g9-tabs g9-tabs--${tabStyle} g9-tabs--${barPosition}${props.headerOnly ? ' g9-tabs--header-only' : ''} ${null != (_props_className = props.className) ? _props_className : ''}`}>
|
|
155
|
+
return <view {...anchor.props} className={`g9-tabs g9-tabs--${tabStyle} g9-tabs--${barPosition}${props.headerOnly ? ' g9-tabs--header-only' : ''} ${null != (_props_className = props.className) ? _props_className : ''}`}>
|
|
133
156
|
{'bottom' === barPosition ? content : null}
|
|
134
157
|
{bar}
|
|
135
158
|
{'top' === barPosition ? content : null}
|
|
@@ -149,6 +172,39 @@ function TabBarStrip(props) {
|
|
|
149
172
|
const indicator = null != (_props_indicatorColor = props.indicatorColor) ? _props_indicatorColor : 'var(--g9-primary)';
|
|
150
173
|
const fixed = 'fixed' === mode;
|
|
151
174
|
const cellRefs = useRef([]);
|
|
175
|
+
const registry = useG9AnchorRegistry();
|
|
176
|
+
const latest = useRef(props);
|
|
177
|
+
latest.current = props;
|
|
178
|
+
const cellKeys = items.map((item, i)=>tabKey(item, i)).join('|');
|
|
179
|
+
useEffect(()=>{
|
|
180
|
+
const base = props.anchorId;
|
|
181
|
+
if (!registry || !base) return;
|
|
182
|
+
const offs = latest.current.items.map((item, index)=>registry.register(`${base}_Tab_${tabKey(item, index)}`, ()=>({
|
|
183
|
+
kind: 'tab',
|
|
184
|
+
label: ()=>{
|
|
185
|
+
var _ref;
|
|
186
|
+
var _latest_current_items_index;
|
|
187
|
+
return null != (_ref = null == (_latest_current_items_index = latest.current.items[index]) ? void 0 : _latest_current_items_index.text) ? _ref : null;
|
|
188
|
+
},
|
|
189
|
+
capabilities: {
|
|
190
|
+
activate: ()=>latest.current.onSelect(index)
|
|
191
|
+
}
|
|
192
|
+
}), {
|
|
193
|
+
node: ()=>{
|
|
194
|
+
var _cellRefs_current_index;
|
|
195
|
+
return null != (_cellRefs_current_index = cellRefs.current[index]) ? _cellRefs_current_index : null;
|
|
196
|
+
},
|
|
197
|
+
scrollerId: null,
|
|
198
|
+
layer: 'page'
|
|
199
|
+
}));
|
|
200
|
+
return ()=>{
|
|
201
|
+
for (const off of offs)off();
|
|
202
|
+
};
|
|
203
|
+
}, [
|
|
204
|
+
registry,
|
|
205
|
+
props.anchorId,
|
|
206
|
+
cellKeys
|
|
207
|
+
]);
|
|
152
208
|
useEffect(()=>{
|
|
153
209
|
var _cellRefs_current_effective;
|
|
154
210
|
if (fixed || effective < 0) return;
|