@g9tm/lynxcontrols 1.7.2 → 2.1.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/README.md +12 -5
- package/dist/.tsbuildinfo +1 -1
- package/dist/anchor/context.jsx +0 -2
- package/dist/anchor/hooks.d.ts.map +1 -1
- package/dist/anchor/hooks.jsx +6 -4
- package/dist/anchor/measure.jsx +0 -2
- package/dist/anchor/registry.d.ts +12 -2
- package/dist/anchor/registry.d.ts.map +1 -1
- package/dist/anchor/registry.jsx +11 -3
- package/dist/anchor/scroll.jsx +0 -2
- package/dist/base/control.d.ts +18 -2
- package/dist/base/control.d.ts.map +1 -1
- package/dist/base/control.jsx +16 -9
- package/dist/base/corner-badge.jsx +0 -2
- package/dist/base/disposer.jsx +0 -2
- package/dist/base/index.d.ts +3 -2
- package/dist/base/index.d.ts.map +1 -1
- package/dist/base/index.jsx +3 -2
- package/dist/base/press.css +83 -0
- package/dist/base/press.css.map +1 -0
- package/dist/base/press.d.ts +13 -2
- package/dist/base/press.d.ts.map +1 -1
- package/dist/base/press.jsx +49 -5
- package/dist/base/pressable.d.ts +10 -1
- package/dist/base/pressable.d.ts.map +1 -1
- package/dist/base/pressable.jsx +13 -8
- package/dist/base/selection-item.jsx +0 -2
- package/dist/base/timers.jsx +0 -2
- package/dist/base/tone.d.ts +15 -0
- package/dist/base/tone.d.ts.map +1 -0
- package/dist/base/tone.jsx +71 -0
- package/dist/base/use-controllable-state.jsx +0 -2
- package/dist/base/use-stable-callback.jsx +0 -2
- package/dist/button/button-variants.css +236 -0
- package/dist/button/button-variants.css.map +1 -0
- package/dist/button/button.css +21 -0
- package/dist/button/button.css.map +1 -1
- package/dist/button/button.d.ts +13 -1
- package/dist/button/button.d.ts.map +1 -1
- package/dist/button/button.jsx +51 -38
- package/dist/button/header-action-button.d.ts +1 -0
- package/dist/button/header-action-button.d.ts.map +1 -1
- package/dist/button/header-action-button.jsx +6 -7
- package/dist/button/icon-button.d.ts +11 -1
- package/dist/button/icon-button.d.ts.map +1 -1
- package/dist/button/icon-button.jsx +21 -17
- package/dist/button/nav-card.d.ts +1 -0
- package/dist/button/nav-card.d.ts.map +1 -1
- package/dist/button/nav-card.jsx +6 -7
- package/dist/button/safe-tap.jsx +0 -2
- package/dist/button/safe.jsx +3 -5
- package/dist/button/variant-css.d.ts +8 -0
- package/dist/button/variant-css.d.ts.map +1 -0
- package/dist/button/variant-css.jsx +47 -0
- package/dist/button/vertical-icon-text-button.d.ts.map +1 -1
- package/dist/button/vertical-icon-text-button.jsx +1 -3
- package/dist/button/visuals.d.ts +7 -1
- package/dist/button/visuals.d.ts.map +1 -1
- package/dist/button/visuals.jsx +5 -5
- package/dist/cascade/cascade-panel.jsx +0 -2
- package/dist/cascade/model.jsx +0 -2
- package/dist/commands/commands.css +167 -0
- package/dist/commands/commands.css.map +1 -0
- package/dist/commands/index.d.ts +3 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.jsx +2 -0
- package/dist/commands/keys.d.ts +22 -0
- package/dist/commands/keys.d.ts.map +1 -0
- package/dist/commands/keys.jsx +119 -0
- package/dist/commands/palette.d.ts +62 -0
- package/dist/commands/palette.d.ts.map +1 -0
- package/dist/commands/palette.jsx +175 -0
- package/dist/deferred/deferred-content.jsx +2 -4
- package/dist/deferred/readiness-signal.jsx +0 -2
- package/dist/display/activity-indicator.jsx +0 -2
- package/dist/display/culture-date-time-label.jsx +1 -3
- package/dist/display/extras.css +117 -0
- package/dist/display/extras.css.map +1 -0
- package/dist/display/extras.d.ts +65 -0
- package/dist/display/extras.d.ts.map +1 -0
- package/dist/display/extras.jsx +118 -0
- package/dist/display/figures-index.d.ts +3 -0
- package/dist/display/figures-index.d.ts.map +1 -0
- package/dist/display/figures-index.jsx +2 -0
- package/dist/display/figures.css +249 -0
- package/dist/display/figures.css.map +1 -0
- package/dist/display/figures.d.ts +132 -0
- package/dist/display/figures.d.ts.map +1 -0
- package/dist/display/figures.jsx +223 -0
- package/dist/display/image.css +46 -0
- package/dist/display/image.css.map +1 -0
- package/dist/display/image.d.ts +32 -0
- package/dist/display/image.d.ts.map +1 -0
- package/dist/display/image.jsx +49 -0
- package/dist/display/index.d.ts +6 -0
- package/dist/display/index.d.ts.map +1 -1
- package/dist/display/index.jsx +6 -0
- package/dist/display/keycap.css +32 -0
- package/dist/display/keycap.css.map +1 -0
- package/dist/display/keycap.d.ts +20 -0
- package/dist/display/keycap.d.ts.map +1 -0
- package/dist/display/keycap.jsx +17 -0
- package/dist/display/motion-figures.css +168 -0
- package/dist/display/motion-figures.css.map +1 -0
- package/dist/display/motion-figures.d.ts +155 -0
- package/dist/display/motion-figures.d.ts.map +1 -0
- package/dist/display/motion-figures.jsx +246 -0
- package/dist/display/progress-bar.jsx +1 -3
- package/dist/display/separator.d.ts.map +1 -1
- package/dist/display/separator.jsx +2 -4
- package/dist/display/shimmer.jsx +0 -2
- package/dist/display/skeleton.css +72 -0
- package/dist/display/skeleton.css.map +1 -0
- package/dist/display/status.css +111 -0
- package/dist/display/status.css.map +1 -0
- package/dist/display/status.d.ts +67 -0
- package/dist/display/status.d.ts.map +1 -0
- package/dist/display/status.jsx +117 -0
- package/dist/display/theme-preview.css +244 -0
- package/dist/display/theme-preview.css.map +1 -0
- package/dist/display/theme-preview.d.ts +19 -0
- package/dist/display/theme-preview.d.ts.map +1 -0
- package/dist/display/theme-preview.jsx +89 -0
- package/dist/display/title-with-line.d.ts.map +1 -1
- package/dist/display/title-with-line.jsx +2 -4
- package/dist/edge-panel/edge-panel.jsx +0 -2
- package/dist/edge-panel/helper.jsx +0 -2
- package/dist/edge-panel/types.jsx +0 -2
- package/dist/effects/effects.css +94 -0
- package/dist/effects/effects.css.map +1 -0
- package/dist/effects/effects.d.ts +83 -0
- package/dist/effects/effects.d.ts.map +1 -0
- package/dist/effects/effects.jsx +183 -0
- package/dist/effects/index.d.ts +2 -0
- package/dist/effects/index.d.ts.map +1 -0
- package/dist/effects/index.jsx +1 -0
- package/dist/expander/expander.d.ts +1 -0
- package/dist/expander/expander.d.ts.map +1 -1
- package/dist/expander/expander.jsx +22 -23
- package/dist/fields/dictation.jsx +0 -2
- package/dist/fields/editor.d.ts.map +1 -1
- package/dist/fields/editor.jsx +5 -6
- package/dist/fields/extra-entries.css +133 -0
- package/dist/fields/extra-entries.css.map +1 -0
- package/dist/fields/extra-entries.d.ts +98 -0
- package/dist/fields/extra-entries.d.ts.map +1 -0
- package/dist/fields/extra-entries.jsx +323 -0
- package/dist/fields/fields.css +4 -0
- package/dist/fields/fields.css.map +1 -1
- package/dist/fields/index.d.ts +4 -3
- package/dist/fields/index.d.ts.map +1 -1
- package/dist/fields/index.jsx +1 -0
- package/dist/fields/input-policy.jsx +0 -2
- package/dist/fields/notch.jsx +0 -2
- package/dist/fields/outlined-field.d.ts +14 -0
- package/dist/fields/outlined-field.d.ts.map +1 -1
- package/dist/fields/outlined-field.jsx +12 -10
- package/dist/fields/pin-entry.d.ts.map +1 -1
- package/dist/fields/pin-entry.jsx +11 -13
- package/dist/fields/search-entry.jsx +2 -4
- package/dist/fields/slot-layout.jsx +0 -2
- package/dist/fields/text-entry.jsx +2 -4
- package/dist/fields/use-dictation.jsx +0 -2
- package/dist/fields/use-text-input.d.ts +1 -1
- package/dist/fields/use-text-input.jsx +0 -2
- package/dist/fields/validator.jsx +0 -2
- package/dist/guide/confirm-sheet.jsx +0 -2
- package/dist/guide/journey.jsx +0 -2
- package/dist/guide/placement.jsx +0 -2
- package/dist/guide/service.jsx +0 -2
- package/dist/guide/settings.jsx +0 -2
- package/dist/header/app-bar.d.ts +35 -0
- package/dist/header/app-bar.d.ts.map +1 -0
- package/dist/header/app-bar.jsx +64 -0
- package/dist/header/header.css +79 -0
- package/dist/header/header.css.map +1 -0
- package/dist/header/index.d.ts +2 -0
- package/dist/header/index.d.ts.map +1 -0
- package/dist/header/index.jsx +1 -0
- package/dist/host/back.jsx +0 -2
- package/dist/host/hooks.jsx +0 -2
- package/dist/host/host.css +1 -0
- package/dist/host/host.css.map +1 -1
- package/dist/host/host.d.ts.map +1 -1
- package/dist/host/host.jsx +50 -17
- package/dist/host/keyboard.jsx +0 -2
- package/dist/host/layers.jsx +0 -2
- package/dist/host/page-loading-overlay.jsx +0 -2
- package/dist/host/readiness.jsx +0 -2
- package/dist/host/registry.d.ts +9 -0
- package/dist/host/registry.d.ts.map +1 -1
- package/dist/host/registry.jsx +0 -2
- package/dist/icon/icon.d.ts +16 -0
- package/dist/icon/icon.d.ts.map +1 -1
- package/dist/icon/icon.jsx +53 -14
- package/dist/icon/index.d.ts +1 -1
- package/dist/icon/index.d.ts.map +1 -1
- package/dist/icon/index.jsx +1 -1
- package/dist/icon/slot.jsx +0 -2
- package/dist/icon/swatch.jsx +0 -2
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/layout/containers.d.ts +113 -0
- package/dist/layout/containers.d.ts.map +1 -0
- package/dist/layout/containers.jsx +195 -0
- package/dist/layout/index.d.ts +4 -0
- package/dist/layout/index.d.ts.map +1 -0
- package/dist/layout/index.jsx +3 -0
- package/dist/layout/layout.css +361 -0
- package/dist/layout/layout.css.map +1 -0
- package/dist/layout/scroll-spy.d.ts +18 -0
- package/dist/layout/scroll-spy.d.ts.map +1 -0
- package/dist/layout/scroll-spy.jsx +38 -0
- package/dist/layout/scrollers.d.ts +96 -0
- package/dist/layout/scrollers.d.ts.map +1 -0
- package/dist/layout/scrollers.jsx +208 -0
- package/dist/list/gestures.d.ts +40 -0
- package/dist/list/gestures.d.ts.map +1 -0
- package/dist/list/gestures.jsx +142 -0
- package/dist/list/index.d.ts +4 -0
- package/dist/list/index.d.ts.map +1 -0
- package/dist/list/index.jsx +3 -0
- package/dist/list/list.css +194 -0
- package/dist/list/list.css.map +1 -0
- package/dist/list/rows.d.ts +69 -0
- package/dist/list/rows.d.ts.map +1 -0
- package/dist/list/rows.jsx +105 -0
- package/dist/list/virtual-list.d.ts +94 -0
- package/dist/list/virtual-list.d.ts.map +1 -0
- package/dist/list/virtual-list.jsx +159 -0
- package/dist/orb/hold-button.d.ts +26 -0
- package/dist/orb/hold-button.d.ts.map +1 -0
- package/dist/orb/hold-button.jsx +33 -0
- package/dist/orb/hold.d.ts +36 -0
- package/dist/orb/hold.d.ts.map +1 -0
- package/dist/orb/hold.jsx +76 -0
- package/dist/orb/index.d.ts +5 -0
- package/dist/orb/index.d.ts.map +1 -0
- package/dist/orb/index.jsx +4 -0
- package/dist/orb/model.d.ts +42 -0
- package/dist/orb/model.d.ts.map +1 -0
- package/dist/orb/model.jsx +42 -0
- package/dist/orb/orb.css +81 -0
- package/dist/orb/orb.css.map +1 -0
- package/dist/orb/orb.d.ts +61 -0
- package/dist/orb/orb.d.ts.map +1 -0
- package/dist/orb/orb.jsx +171 -0
- package/dist/pickers/combo-box.jsx +0 -2
- package/dist/pickers/date-time-picker.jsx +0 -2
- package/dist/pickers/date-time.jsx +0 -2
- package/dist/pickers/day-stepper.css +43 -0
- package/dist/pickers/day-stepper.css.map +1 -0
- package/dist/pickers/day-stepper.d.ts +31 -0
- package/dist/pickers/day-stepper.d.ts.map +1 -0
- package/dist/pickers/day-stepper.jsx +60 -0
- package/dist/pickers/index.d.ts +1 -0
- package/dist/pickers/index.d.ts.map +1 -1
- package/dist/pickers/index.jsx +1 -0
- package/dist/pickers/picker-sheet.jsx +0 -2
- package/dist/pickers/picker.d.ts +11 -0
- package/dist/pickers/picker.d.ts.map +1 -1
- package/dist/pickers/picker.jsx +53 -9
- package/dist/pickers/timespan-picker.jsx +0 -2
- package/dist/pickers/timespan.jsx +0 -2
- package/dist/pickers/trigger.jsx +0 -2
- package/dist/pickers/wheel-column.jsx +0 -2
- package/dist/plus-button/model.jsx +0 -2
- package/dist/plus-button/plus-button.jsx +0 -2
- package/dist/popover/index.d.ts +3 -0
- package/dist/popover/index.d.ts.map +1 -0
- package/dist/popover/index.jsx +2 -0
- package/dist/popover/popover.css +183 -0
- package/dist/popover/popover.css.map +1 -0
- package/dist/popover/popover.d.ts +139 -0
- package/dist/popover/popover.d.ts.map +1 -0
- package/dist/popover/popover.jsx +291 -0
- package/dist/popover/position.d.ts +35 -0
- package/dist/popover/position.d.ts.map +1 -0
- package/dist/popover/position.jsx +53 -0
- package/dist/popup/frame.jsx +0 -2
- package/dist/popup/input-form.jsx +0 -2
- package/dist/popup/input.jsx +0 -2
- package/dist/popup/popup-view.jsx +0 -2
- package/dist/popup/queue.jsx +0 -2
- package/dist/popup/service.jsx +0 -2
- package/dist/popup/types.jsx +0 -2
- package/dist/provider/activity.d.ts +13 -0
- package/dist/provider/activity.d.ts.map +1 -0
- package/dist/provider/activity.jsx +55 -0
- package/dist/provider/contexts.d.ts +32 -1
- package/dist/provider/contexts.d.ts.map +1 -1
- package/dist/provider/contexts.jsx +7 -3
- package/dist/provider/global-events.jsx +0 -2
- package/dist/provider/hooks.d.ts +16 -2
- package/dist/provider/hooks.d.ts.map +1 -1
- package/dist/provider/hooks.jsx +35 -7
- package/dist/provider/index.d.ts +4 -2
- package/dist/provider/index.d.ts.map +1 -1
- package/dist/provider/index.jsx +3 -1
- package/dist/provider/keep-alive.css +19 -0
- package/dist/provider/keep-alive.css.map +1 -0
- package/dist/provider/keep-alive.d.ts +23 -0
- package/dist/provider/keep-alive.d.ts.map +1 -0
- package/dist/provider/keep-alive.jsx +9 -0
- package/dist/provider/provider.css +1 -1
- package/dist/provider/provider.css.map +1 -1
- package/dist/provider/provider.d.ts +13 -1
- package/dist/provider/provider.d.ts.map +1 -1
- package/dist/provider/provider.jsx +128 -15
- package/dist/provider/settings.d.ts +23 -0
- package/dist/provider/settings.d.ts.map +1 -1
- package/dist/provider/settings.jsx +5 -4
- package/dist/provider/theme-css.d.ts +1 -1
- package/dist/provider/theme-css.d.ts.map +1 -1
- package/dist/provider/theme-css.jsx +21 -10
- package/dist/provider/theme-root.d.ts.map +1 -1
- package/dist/provider/theme-root.jsx +7 -5
- package/dist/provider/theme.css +72 -0
- package/dist/provider/theme.css.map +1 -1
- package/dist/range-slider/index.d.ts +1 -0
- package/dist/range-slider/index.d.ts.map +1 -1
- package/dist/range-slider/index.jsx +1 -0
- package/dist/range-slider/math.jsx +0 -2
- package/dist/range-slider/range-slider.css +82 -0
- package/dist/range-slider/range-slider.css.map +1 -1
- package/dist/range-slider/range-slider.jsx +0 -2
- package/dist/range-slider/step-slider.d.ts +18 -0
- package/dist/range-slider/step-slider.d.ts.map +1 -0
- package/dist/range-slider/step-slider.jsx +55 -0
- package/dist/route/hooks.jsx +0 -2
- package/dist/route/router.jsx +0 -2
- package/dist/selection/model.jsx +0 -2
- package/dist/selection/selection-sheet.jsx +0 -2
- package/dist/selection/use-selection-model.jsx +0 -2
- package/dist/selection/window.jsx +0 -2
- package/dist/sheet/backdrop-scope.d.ts +14 -0
- package/dist/sheet/backdrop-scope.d.ts.map +1 -0
- package/dist/sheet/backdrop-scope.jsx +25 -0
- package/dist/sheet/context.d.ts +22 -0
- package/dist/sheet/context.d.ts.map +1 -0
- package/dist/sheet/context.jsx +7 -0
- package/dist/sheet/frame.d.ts +2 -17
- package/dist/sheet/frame.d.ts.map +1 -1
- package/dist/sheet/frame.jsx +23 -19
- package/dist/sheet/gesture.jsx +1 -3
- package/dist/sheet/handoff.jsx +0 -2
- package/dist/sheet/header.jsx +3 -3
- package/dist/sheet/height-memo.jsx +0 -2
- package/dist/sheet/index.d.ts +2 -0
- package/dist/sheet/index.d.ts.map +1 -1
- package/dist/sheet/index.jsx +2 -0
- package/dist/sheet/loadable.jsx +0 -2
- package/dist/sheet/motion.jsx +0 -2
- package/dist/sheet/options.d.ts +17 -0
- package/dist/sheet/options.d.ts.map +1 -1
- package/dist/sheet/options.jsx +2 -3
- package/dist/sheet/panel-frame.css +204 -0
- package/dist/sheet/panel-frame.css.map +1 -0
- package/dist/sheet/panel-frame.d.ts +16 -0
- package/dist/sheet/panel-frame.d.ts.map +1 -0
- package/dist/sheet/panel-frame.jsx +103 -0
- package/dist/sheet/processing.jsx +0 -2
- package/dist/sheet/scroll-indicator.jsx +0 -2
- package/dist/sheet/scroll-region.d.ts +19 -0
- package/dist/sheet/scroll-region.d.ts.map +1 -0
- package/dist/sheet/scroll-region.jsx +58 -0
- package/dist/sheet/service.d.ts.map +1 -1
- package/dist/sheet/service.jsx +23 -9
- package/dist/sheet/sheet.css +33 -0
- package/dist/sheet/sheet.css.map +1 -1
- package/dist/sheet/sheet.jsx +0 -2
- package/dist/sheet/sizing.d.ts +3 -3
- package/dist/sheet/sizing.jsx +0 -2
- package/dist/sheet/stack.jsx +0 -2
- package/dist/shell/index.d.ts +2 -0
- package/dist/shell/index.d.ts.map +1 -0
- package/dist/shell/index.jsx +1 -0
- package/dist/shell/shell.css +342 -0
- package/dist/shell/shell.css.map +1 -0
- package/dist/shell/shell.d.ts +121 -0
- package/dist/shell/shell.d.ts.map +1 -0
- package/dist/shell/shell.jsx +214 -0
- package/dist/survey/index.d.ts +2 -0
- package/dist/survey/index.d.ts.map +1 -0
- package/dist/survey/index.jsx +1 -0
- package/dist/survey/survey.css +204 -0
- package/dist/survey/survey.css.map +1 -0
- package/dist/survey/survey.d.ts +76 -0
- package/dist/survey/survey.d.ts.map +1 -0
- package/dist/survey/survey.jsx +205 -0
- package/dist/swipe/model.jsx +0 -2
- package/dist/swipe/swipe-view.jsx +0 -2
- package/dist/tab-bar/metrics.jsx +20 -22
- package/dist/tab-bar/model.d.ts +2 -0
- package/dist/tab-bar/model.d.ts.map +1 -1
- package/dist/tab-bar/model.jsx +10 -6
- package/dist/tab-bar/tab-bar.css +74 -0
- package/dist/tab-bar/tab-bar.css.map +1 -1
- package/dist/tab-bar/tab-bar.d.ts +7 -0
- package/dist/tab-bar/tab-bar.d.ts.map +1 -1
- package/dist/tab-bar/tab-bar.jsx +51 -17
- package/dist/tabs/model.jsx +0 -2
- package/dist/tabs/tab-view.d.ts +1 -0
- package/dist/tabs/tab-view.d.ts.map +1 -1
- package/dist/tabs/tab-view.jsx +6 -5
- package/dist/tabs/tabs.css +1 -0
- package/dist/tabs/tabs.css.map +1 -1
- package/dist/toast/service.d.ts.map +1 -1
- package/dist/toast/service.jsx +34 -16
- package/dist/toast/store.jsx +0 -2
- package/dist/toggle/checkbox-math.jsx +0 -2
- package/dist/toggle/checkbox.d.ts.map +1 -1
- package/dist/toggle/checkbox.jsx +10 -12
- package/dist/toggle/chip-group.d.ts.map +1 -1
- package/dist/toggle/chip-group.jsx +8 -7
- package/dist/toggle/choice.css +254 -0
- package/dist/toggle/choice.css.map +1 -0
- package/dist/toggle/choice.d.ts +125 -0
- package/dist/toggle/choice.d.ts.map +1 -0
- package/dist/toggle/choice.jsx +367 -0
- package/dist/toggle/index.d.ts +2 -1
- package/dist/toggle/index.d.ts.map +1 -1
- package/dist/toggle/index.jsx +1 -0
- package/dist/toggle/switch.d.ts.map +1 -1
- package/dist/toggle/switch.jsx +8 -11
- package/package.json +126 -16
- package/tailwind/index.d.ts +13 -0
- package/tailwind/index.mjs +87 -0
- package/tailwind/index.test.mjs +24 -0
- package/tailwind/tokens.mjs +98 -0
- package/dist/anchor/context.jsx.map +0 -1
- package/dist/anchor/hooks.jsx.map +0 -1
- package/dist/anchor/measure.jsx.map +0 -1
- package/dist/anchor/registry.jsx.map +0 -1
- package/dist/anchor/scroll.jsx.map +0 -1
- package/dist/base/control.jsx.map +0 -1
- package/dist/base/corner-badge.jsx.map +0 -1
- package/dist/base/disposer.jsx.map +0 -1
- package/dist/base/press.jsx.map +0 -1
- package/dist/base/pressable.jsx.map +0 -1
- package/dist/base/selection-item.jsx.map +0 -1
- package/dist/base/timers.jsx.map +0 -1
- package/dist/base/use-controllable-state.jsx.map +0 -1
- package/dist/base/use-stable-callback.jsx.map +0 -1
- package/dist/button/button.jsx.map +0 -1
- package/dist/button/header-action-button.jsx.map +0 -1
- package/dist/button/icon-button.jsx.map +0 -1
- package/dist/button/nav-card.jsx.map +0 -1
- package/dist/button/safe-tap.jsx.map +0 -1
- package/dist/button/safe.jsx.map +0 -1
- package/dist/button/vertical-icon-text-button.jsx.map +0 -1
- package/dist/button/visuals.jsx.map +0 -1
- package/dist/cascade/cascade-panel.jsx.map +0 -1
- package/dist/cascade/model.jsx.map +0 -1
- package/dist/deferred/deferred-content.jsx.map +0 -1
- package/dist/deferred/readiness-signal.jsx.map +0 -1
- package/dist/display/activity-indicator.jsx.map +0 -1
- package/dist/display/culture-date-time-label.jsx.map +0 -1
- package/dist/display/progress-bar.jsx.map +0 -1
- package/dist/display/separator.jsx.map +0 -1
- package/dist/display/shimmer.jsx.map +0 -1
- package/dist/display/title-with-line.jsx.map +0 -1
- package/dist/edge-panel/edge-panel.jsx.map +0 -1
- package/dist/edge-panel/helper.jsx.map +0 -1
- package/dist/edge-panel/types.jsx.map +0 -1
- package/dist/expander/expander.jsx.map +0 -1
- package/dist/fields/dictation.jsx.map +0 -1
- package/dist/fields/editor.jsx.map +0 -1
- package/dist/fields/input-policy.jsx.map +0 -1
- package/dist/fields/notch.jsx.map +0 -1
- package/dist/fields/outlined-field.jsx.map +0 -1
- package/dist/fields/pin-entry.jsx.map +0 -1
- package/dist/fields/search-entry.jsx.map +0 -1
- package/dist/fields/slot-layout.jsx.map +0 -1
- package/dist/fields/text-entry.jsx.map +0 -1
- package/dist/fields/use-dictation.jsx.map +0 -1
- package/dist/fields/use-text-input.jsx.map +0 -1
- package/dist/fields/validator.jsx.map +0 -1
- package/dist/guide/confirm-sheet.jsx.map +0 -1
- package/dist/guide/journey.jsx.map +0 -1
- package/dist/guide/placement.jsx.map +0 -1
- package/dist/guide/service.jsx.map +0 -1
- package/dist/guide/settings.jsx.map +0 -1
- package/dist/host/back.jsx.map +0 -1
- package/dist/host/hooks.jsx.map +0 -1
- package/dist/host/host.jsx.map +0 -1
- package/dist/host/keyboard.jsx.map +0 -1
- package/dist/host/layers.jsx.map +0 -1
- package/dist/host/page-loading-overlay.jsx.map +0 -1
- package/dist/host/readiness.jsx.map +0 -1
- package/dist/host/registry.jsx.map +0 -1
- package/dist/icon/icon.jsx.map +0 -1
- package/dist/icon/slot.jsx.map +0 -1
- package/dist/icon/swatch.jsx.map +0 -1
- package/dist/pickers/combo-box.jsx.map +0 -1
- package/dist/pickers/date-time-picker.jsx.map +0 -1
- package/dist/pickers/date-time.jsx.map +0 -1
- package/dist/pickers/picker-sheet.jsx.map +0 -1
- package/dist/pickers/picker.jsx.map +0 -1
- package/dist/pickers/timespan-picker.jsx.map +0 -1
- package/dist/pickers/timespan.jsx.map +0 -1
- package/dist/pickers/trigger.jsx.map +0 -1
- package/dist/pickers/wheel-column.jsx.map +0 -1
- package/dist/plus-button/model.jsx.map +0 -1
- package/dist/plus-button/plus-button.jsx.map +0 -1
- package/dist/popup/frame.jsx.map +0 -1
- package/dist/popup/input-form.jsx.map +0 -1
- package/dist/popup/input.jsx.map +0 -1
- package/dist/popup/popup-view.jsx.map +0 -1
- package/dist/popup/queue.jsx.map +0 -1
- package/dist/popup/service.jsx.map +0 -1
- package/dist/popup/types.jsx.map +0 -1
- package/dist/provider/contexts.jsx.map +0 -1
- package/dist/provider/global-events.jsx.map +0 -1
- package/dist/provider/hooks.jsx.map +0 -1
- package/dist/provider/provider.jsx.map +0 -1
- package/dist/provider/settings.jsx.map +0 -1
- package/dist/provider/theme-css.jsx.map +0 -1
- package/dist/provider/theme-root.jsx.map +0 -1
- package/dist/range-slider/math.jsx.map +0 -1
- package/dist/range-slider/range-slider.jsx.map +0 -1
- package/dist/route/hooks.jsx.map +0 -1
- package/dist/route/router.jsx.map +0 -1
- package/dist/selection/model.jsx.map +0 -1
- package/dist/selection/selection-sheet.jsx.map +0 -1
- package/dist/selection/use-selection-model.jsx.map +0 -1
- package/dist/selection/window.jsx.map +0 -1
- package/dist/sheet/frame.jsx.map +0 -1
- package/dist/sheet/gesture.jsx.map +0 -1
- package/dist/sheet/handoff.jsx.map +0 -1
- package/dist/sheet/header.jsx.map +0 -1
- package/dist/sheet/height-memo.jsx.map +0 -1
- package/dist/sheet/loadable.jsx.map +0 -1
- package/dist/sheet/motion.jsx.map +0 -1
- package/dist/sheet/options.jsx.map +0 -1
- package/dist/sheet/processing.jsx.map +0 -1
- package/dist/sheet/scroll-indicator.jsx.map +0 -1
- package/dist/sheet/service.jsx.map +0 -1
- package/dist/sheet/sheet.jsx.map +0 -1
- package/dist/sheet/sizing.jsx.map +0 -1
- package/dist/sheet/stack.jsx.map +0 -1
- package/dist/swipe/model.jsx.map +0 -1
- package/dist/swipe/swipe-view.jsx.map +0 -1
- package/dist/tab-bar/metrics.jsx.map +0 -1
- package/dist/tab-bar/model.jsx.map +0 -1
- package/dist/tab-bar/tab-bar.jsx.map +0 -1
- package/dist/tabs/model.jsx.map +0 -1
- package/dist/tabs/tab-view.jsx.map +0 -1
- package/dist/toast/service.jsx.map +0 -1
- package/dist/toast/store.jsx.map +0 -1
- package/dist/toggle/checkbox-math.jsx.map +0 -1
- package/dist/toggle/checkbox.jsx.map +0 -1
- package/dist/toggle/chip-group.jsx.map +0 -1
- package/dist/toggle/switch.jsx.map +0 -1
package/dist/sheet/frame.jsx.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sheet/frame.jsx","sources":["../../src/sheet/frame.tsx"],"sourcesContent":["import './sheet.css';\nimport {\n createAbortController,\n formatColor,\n type G9AbortController,\n type G9AbortSignal,\n g9Ms,\n resolveThemeColor,\n tryParseColor,\n withAlpha,\n} from '@g9tm/lynxcontrols-foundation';\nimport { SheetBackdrop, SheetContent, SheetRoot, type SheetRootRef, SheetView } from '@lynx-js/lynx-ui-sheet';\nimport { createContext, type ReactNode, useContext, useEffect, useMemo, useRef, useState } from '@lynx-js/react';\nimport { G9AnchorLayerContext } from '../anchor/context';\nimport { g9IdProps } from '../base/control';\nimport { type G9TimerHandle, startTimer, stopTimer } from '../base/timers';\nimport { G9ActivityIndicator } from '../display/activity-indicator';\nimport { G9SheetSkeleton } from '../display/shimmer';\nimport { g9FieldNotchStyle } from '../fields/notch';\nimport { useG9Theme } from '../provider/hooks';\nimport { sheetSegmentOf, useG9Place } from '../route/hooks';\nimport { G9SheetGestureFrame, useSheetBodyGesture, useSheetGestureRefs } from './gesture';\nimport { G9SheetFooter, G9SheetHeader } from './header';\nimport type { G9SheetHeightMemo } from './height-memo';\nimport { resolveSheetMotion } from './motion';\nimport type { G9SheetDetent, G9SheetSettings } from './options';\nimport { G9SheetScrollIndicator, G9SheetScrollModel } from './scroll-indicator';\nimport {\n clampFitHeight,\n currentPlatform,\n g9SheetDragCloseThreshold,\n g9SheetFitLoadingMinHeight,\n g9SheetFitMinHeight,\n g9SheetScrollToEndThreshold,\n parentRecedeOffset,\n platformSheetConstraints,\n resolveSheetLayout,\n sheetOverlayOpacity,\n sheetSurfaceBottomPadding,\n sheetSurfaceTopPadding,\n} from './sizing';\nimport type { G9SheetEntry, G9SheetHandle, G9SheetStack } from './stack';\n\n/** What content inside a sheet can read (MAUI `IG9BottomSheetAwareView` + deferred load signals). */\nexport interface G9SheetContextValue {\n /** The sheet-scoped handle: `close()` closes only this sheet. */\n readonly handle: G9SheetHandle;\n /** Aborted when the sheet starts closing (cancel loads with it). */\n readonly signal: G9AbortSignal;\n /** The open motion has finished. */\n readonly opened: boolean;\n /** The sheet is closing. */\n readonly closing: boolean;\n /** Resting body cap of a fit sheet (px), else `null`. */\n readonly maxBodyHeight: number | null;\n}\n\nconst SheetContext = createContext<G9SheetContextValue | null>(null);\n\n/** The enclosing sheet, or `null` outside one. */\nexport function useG9SheetContext(): G9SheetContextValue | null {\n return useContext(SheetContext);\n}\n\n/** Props of {@link G9SheetFrame}. */\nexport interface G9SheetFrameProps {\n readonly entry: G9SheetEntry;\n readonly stack: G9SheetStack;\n /** Host height (px): percentage detents and caps resolve against it. */\n readonly hostHeight: number;\n readonly hostWidth: number;\n readonly topInset: number;\n /** The host's bottom safe inset (a visible navigation bar); the surface pads by it. Default 0. */\n readonly bottomInset?: number;\n readonly settings: Required<G9SheetSettings>;\n readonly memo: G9SheetHeightMemo | null;\n /** Culture tag of the memo key. */\n readonly culture: string;\n /** The sheet is the top of the stack (receives scrim input). */\n readonly isTop: boolean;\n /** The sheet came to rest at a new height (px); drives the page recede threshold. */\n readonly onRest?: (heightPx: number) => void;\n}\n\n/** Takes a touch-move so it does not bubble to the page under a modal sheet's dim. */\nconst noop = (): void => {};\n\nfunction scrimColor(entry: G9SheetEntry, settings: Required<G9SheetSettings>, opacity: number): string {\n const explicit = entry.options.windowBackgroundColor;\n const parsed = tryParseColor(explicit ?? settings.modalOverlayColor);\n if (!parsed) return explicit ?? settings.modalOverlayColor;\n return formatColor(withAlpha(parsed, explicit ? parsed.a : opacity));\n}\n\n/** lynx-ui's inner view lays G9's frame out as a column (its default `linear` layout ignores `flex`). */\nconst sheetInnerStyle = { display: 'flex', flexDirection: 'column' } as const;\n\n/** The receded parent sinks and fades over 220 ms (MAUI `StackParentRecedeDurationMs`, CubicOut). */\nconst g9SheetRecedeTransition = (): string => `transform ${g9Ms(220)}ms ease-out, opacity ${g9Ms(220)}ms ease-out`;\n\n/** The sheet's detents, small to large (the order of lynx-ui's snap points). */\nfunction orderedDetents(o: G9SheetEntry['options']): G9SheetDetent[] {\n const requested = o.states && o.states.length > 0 ? o.states : (['medium', 'large'] as const);\n return (['peek', 'medium', 'large'] as const).filter((d) => requested.includes(d));\n}\n\n/** The lynx-ui snap index of where a sheet rests: 0 for a fit sheet, else its detent's place (0 when it is unknown). */\nexport function restingSnapIndex(\n resting: G9SheetDetent | 'fit',\n fit: boolean,\n detents: readonly G9SheetDetent[],\n): number {\n if (fit || resting === 'fit') return 0;\n return Math.max(0, detents.indexOf(resting));\n}\n\n/** The detent a sheet opens at (`'fit'` for fit-to-content). */\nfunction initialDetent(o: G9SheetEntry['options'], fit: boolean): G9SheetDetent | 'fit' {\n if (fit) return 'fit';\n const ordered = orderedDetents(o);\n const current = o.currentState ?? 'medium';\n return ordered.includes(current) ? current : (ordered[0] ?? 'medium');\n}\n\n/**\n * One sheet of the stack on lynx-ui `SheetRoot` (motion, drag, snap points from lynx-ui; G9 adds detent mapping,\n * scrim, header/footer, deferred content, recede and results). Rendered by the sheet service in the host's sheets\n * layer; use `useG9Sheets()` to open sheets.\n */\nexport function G9SheetFrame(props: G9SheetFrameProps): ReactNode {\n const { entry, stack, settings } = props;\n const palette = useG9Theme().palette;\n\n const gesture = useSheetGestureRefs();\n const bodyGesture = useSheetBodyGesture(gesture);\n const o = entry.options;\n // The sheet's place in the navigation: declared from the moment it opens until it starts closing.\n const placeOpen = entry.status === 'opening' || entry.status === 'open';\n useG9Place(\n {\n ...(o.route ?? {}),\n segment: o.route?.segment ?? sheetSegmentOf(o.automationId),\n layer: 'sheet',\n order: entry.id,\n ...(o.route?.title\n ? {}\n : typeof o.title === 'string' && o.title.trim()\n ? { title: () => (typeof o.title === 'string' ? o.title : null) }\n : {}),\n close: () => {\n stack.close(entry.id);\n },\n },\n { active: placeOpen },\n );\n const layout = resolveSheetLayout(o, props.hostHeight);\n const showing = entry.status === 'opening' || entry.status === 'open';\n const closing = entry.status === 'closing';\n const handle = stack.handleOf(entry.id) as G9SheetHandle;\n\n const controller = useRef<G9AbortController | null>(null);\n if (controller.current === null) controller.current = createAbortController();\n useEffect(() => {\n if (closing || entry.status === 'closed') controller.current?.abort();\n }, [closing, entry.status]);\n useEffect(() => () => controller.current?.abort(), []);\n\n // Deferred (factory) content: placeholder until the open motion ended + loadDelayMs, then the body.\n const factory = typeof entry.content === 'function';\n const deferred = (factory || settings.deferPrebuiltContent) && o.deferContent !== false;\n const [revealed, setRevealed] = useState(!deferred);\n const [covering, setCovering] = useState(false);\n const timer = useRef<G9TimerHandle | null>(null);\n const coverTimer = useRef<G9TimerHandle | null>(null);\n useEffect(\n () => () => {\n if (coverTimer.current !== null) stopTimer(coverTimer.current);\n },\n [],\n );\n useEffect(() => {\n if (!deferred || revealed || entry.status !== 'open') return;\n const delay = layout.fullScreen\n ? Math.max(o.loadDelayMs ?? 369, settings.openAnimationDurationMs + 32)\n : (o.loadDelayMs ?? 369);\n timer.current = startTimer(() => {\n setRevealed(true);\n if (o.fadeDeferredContentIn !== false) {\n setCovering(true);\n coverTimer.current = startTimer(() => setCovering(false), g9Ms(220));\n }\n }, delay);\n return () => {\n if (timer.current !== null) stopTimer(timer.current);\n };\n }, [deferred, revealed, entry.status]);\n\n const memoKey = o.heightMemoKey ? `${o.heightMemoKey}|w${Math.round(props.hostWidth)}|${props.culture}|fs1` : null;\n const placeholderHeight = o.useFullScreenLoadingPlaceholder\n ? props.hostHeight\n : (o.deferredLoadingPlaceholderHeight ??\n (memoKey ? props.memo?.lookup(memoKey) : undefined) ??\n g9SheetFitLoadingMinHeight);\n\n const [bodyHeight, setBodyHeight] = useState(0);\n // The footer can come and go after the open (a `footerBand` whose buttons wait for data): it counts for the fit too.\n const [footerHeight, setFooterHeight] = useState(0);\n // The grabber, header and body gap above the body: part of the chrome a fit sheet's cap includes.\n const [chromeTopHeight, setChromeTopHeight] = useState(0);\n const onChromeTopLayout = (e: { detail?: { height?: number } }) =>\n setChromeTopHeight(Math.max(0, e.detail?.height ?? 0));\n const onFooterLayout = (e: { detail?: { height?: number } }) => setFooterHeight(Math.max(0, e.detail?.height ?? 0));\n // `scrollIndicator: 'always'` (./scroll-indicator.tsx): the thumb's own store, fed by the body and its content.\n const indicator = useRef<G9SheetScrollModel | null>(null);\n if (o.scrollIndicator === 'always' && o.scrollBody !== false && !indicator.current)\n indicator.current = new G9SheetScrollModel();\n const onBodyLayout = (e: { detail?: { height?: number } }) => {\n const h = e.detail?.height ?? 0;\n // The scroller's range is the content plus the body's padding on both sides.\n indicator.current?.setContent(h > 0 ? h + 2 * (o.padding ?? 0) : 0);\n if (h <= 0) return;\n setBodyHeight(h);\n if (memoKey && revealed && !covering) props.memo?.record(memoKey, h);\n };\n\n const placeholder =\n o.loadingSkeleton && o.loadingSkeleton !== 'none' ? (\n <view className=\"g9-sheet__placeholder\" style={{ height: `${placeholderHeight}px` }}>\n <G9SheetSkeleton skeleton={o.loadingSkeleton} rowCount={o.loadingSkeletonRowCount ?? 0} />\n </view>\n ) : (\n <view\n className=\"g9-sheet__placeholder g9-sheet__placeholder--spinner\"\n style={{ height: `${placeholderHeight}px` }}\n >\n <G9ActivityIndicator running size={32} />\n </view>\n );\n const body = revealed ? (factory ? (entry.content as () => ReactNode)() : (entry.content as ReactNode)) : null;\n\n // Scrim: the resting dim of the detent (one detent → max; several → interpolated at the initial detent). A fit sheet\n // ranges from its content height to full screen (MAUI ResolveModalOverlayOpacity), so at rest it dims at the\n // MINIMUM — unless its content fills the screen (MAUI's single-state range).\n const ratios = layout.snapPoints.map((p) =>\n typeof p === 'number' ? p / Math.max(1, props.hostHeight) : p === 'fit' ? 0.5 : Number.parseFloat(p) / 100,\n );\n const restingRatio = ratios[layout.initialSnap] ?? 1;\n // The share of the screen the sheet SHOWS: a fit sheet stops at its cap, so content taller than the cap (a long list\n // scrolling inside it) does not \"fill the screen\" — measured on the full content height, AgriPad's block sheet dimmed\n // at the maximum once its harvest list grew (0.69 where MAUI keeps 0.3).\n const shown = layout.fitMaxHeight !== null ? Math.min(bodyHeight, layout.fitMaxHeight) : bodyHeight;\n const contentRatio = bodyHeight > 0 ? Math.min(1, shown / Math.max(1, props.hostHeight)) : 0.5;\n const opacity = entry.handingOff\n ? 0\n : layout.fit\n ? contentRatio >= 0.99\n ? settings.modalOverlayMaximumOpacity\n : settings.modalOverlayMinimumOpacity\n : sheetOverlayOpacity(\n restingRatio,\n ratios,\n settings.modalOverlayMinimumOpacity,\n settings.modalOverlayMaximumOpacity,\n );\n const modal = o.isModal !== false;\n // The receded parent sinks and fades (MAUI stack recede). This runs on G9's own frame view, never on lynx-ui's\n // SheetContent view: lynx-ui moves that one from a main-thread worklet, and an inline style written over it from\n // here put the parent back at its closed offset when the child closed (the parent vanished, its scrim stayed).\n const recede = entry.receded\n ? { transform: `translateY(${parentRecedeOffset(bodyHeight || props.hostHeight * 0.5)}px)`, opacity: 0 }\n : { transform: 'translateY(0px)', opacity: 1 };\n const [resting, setResting] = useState<G9SheetDetent | 'fit'>(() => initialDetent(o, layout.fit));\n\n // A fit sheet whose body grows or shrinks AFTER it opened (rows that load later, a spinner replaced by content):\n // lynx-ui re-measures the 'fit' snap point on layout but leaves the sheet where it was, so a taller body ran off the\n // bottom of the screen (its footer unreachable). Re-snap to the new fit while the sheet rests there.\n const rootRef = useRef<SheetRootRef | null>(null);\n const lastFitBody = useRef(0);\n useEffect(() => {\n if (!layout.fit || bodyHeight <= 0 || entry.status !== 'open' || resting !== 'fit') return;\n // Also right after the open motion: the body may have grown while the sheet was still sliding in.\n const fitHeight = bodyHeight + footerHeight;\n if (Math.abs(lastFitBody.current - fitHeight) < 1) return;\n lastFitBody.current = fitHeight;\n rootRef.current?.snapTo(0, { animate: true });\n }, [bodyHeight, footerHeight, entry.status, resting, layout.fit]);\n // The host's height changed while the sheet was up — the soft keyboard on a host that pads the page by its inset (AgriPad\n // Android, 2026-11-12): lynx-ui keeps the open offset it computed for the OLD height, so a full-screen sheet opened at\n // 760 and squeezed to 463 stood 297 above the screen's top, its footer mid-screen and a band of page under it. Snap\n // again to where it rests, without motion, so the offset is computed for the new height.\n const lastHostHeight = useRef(props.hostHeight);\n useEffect(() => {\n if (Math.abs(lastHostHeight.current - props.hostHeight) < 1) return;\n lastHostHeight.current = props.hostHeight;\n if (entry.status !== 'open') return;\n rootRef.current?.snapTo(restingSnapIndex(resting, layout.fit, orderedDetents(o)), { animate: false });\n }, [props.hostHeight, entry.status]);\n const topPadding = sheetSurfaceTopPadding(o, layout, resting, props.topInset, props.hostHeight);\n const bottomPadding = sheetSurfaceBottomPadding(o, props.bottomInset ?? 0);\n // MAUI caps the WHOLE fit sheet at MaxFitToContentHeightRatio of the screen (the helper's chrome — header band, body\n // gap, footer — is part of the natural height it clamps); the body gets what is left. Capping only the body let a long\n // fit sheet stand ~65 dp taller than MAUI's (its header and gap on top of a 75 % body).\n const maxBody =\n layout.fitMaxHeight === null\n ? null\n : Math.max(\n g9SheetFitMinHeight,\n layout.fitMaxHeight - chromeTopHeight - footerHeight - topPadding - bottomPadding,\n );\n const anchorLayer = useMemo(() => ({ layer: 'sheet' as const, sheetId: props.entry.id }), [props.entry.id]);\n const contextValue: G9SheetContextValue = {\n handle,\n signal: (controller.current as G9AbortController).signal,\n opened: entry.status === 'open',\n closing,\n maxBodyHeight: maxBody,\n };\n const platform = currentPlatform();\n // The body reports its scroll offset to the gesture routing on the main thread (./gesture.tsx) on the phones only:\n // Lynxtron (desktop) drops the WHOLE sheet, no element of it is created, when the body's scroll-view carries\n // `main-thread:bindscroll` (the gallery smoke, Azure build 614). On the desktop a wheel scrolls the body.\n const phone = platform === 'android' || platform === 'ios';\n // A body that renders a window of a long list grows it when the scroll nears the end (options.onScrollToEnd).\n const endProps = o.onScrollToEnd\n ? { 'lower-threshold': o.scrollToEndThreshold ?? g9SheetScrollToEndThreshold, bindscrolltolower: o.onScrollToEnd }\n : {};\n const openMs = o.openAnimationDurationMs ?? settings.openAnimationDurationMs;\n const closeMs = o.closeAnimationDurationMs ?? settings.closeAnimationDurationMs;\n const corner =\n platform === 'android' && o.androidShouldRemoveExpandedCorners === true && layout.fullScreen\n ? 0\n : (o.cornerRadius ?? 12);\n const surface = o.backgroundColor ?? 'var(--g9-surface-container)';\n // Fields in the sheet hide their outline under a floated label with the sheet's colour, not the page's.\n const notch = g9FieldNotchStyle(resolveThemeColor(surface, palette));\n // Motion (MAUI G9SheetMotionModel, ./motion.ts): Material's settle on Android, the UIKit spring on iOS, or the timed\n // cubic; the travel is the share of the host the sheet covers where it rests (a fit sheet: its measured body).\n const detents = orderedDetents(o);\n const restIndex = layout.fit ? 0 : Math.max(0, detents.indexOf(resting as G9SheetDetent));\n const fitRatio =\n bodyHeight > 0 ? Math.min(1, (bodyHeight + topPadding + bottomPadding) / Math.max(1, props.hostHeight)) : 0.4;\n const openRatio = layout.fit ? fitRatio : (ratios[restIndex] ?? restingRatio);\n const motion = resolveSheetMotion({\n style: settings.motionStyle,\n platform,\n openRatio,\n snapRatio: ratios.length > 1 ? Math.max(...ratios) - Math.min(...ratios) : openRatio,\n openMs,\n closeMs,\n perSheetOpen: o.openAnimationDurationMs != null,\n perSheetClose: o.closeAnimationDurationMs != null,\n sizeScaled: settings.sizeScaledAnimationDuration,\n });\n // The body's content; inside a scroller by default, or filling a static body (`scrollBody: false`).\n const content = (\n <view\n className={`g9-sheet__content${o.scrollBody === false ? ' g9-sheet__content--fill' : ''}`}\n key={entry.version}\n bindlayoutchange={onBodyLayout}\n >\n {body}\n {!revealed ? placeholder : null}\n {covering ? (\n <view\n className=\"g9-sheet__cover\"\n style={{ height: `${clampFitHeight(placeholderHeight, props.hostHeight, true)}px` }}\n >\n {placeholder}\n </view>\n ) : null}\n </view>\n );\n return (\n <SheetRoot\n ref={rootRef}\n show={showing}\n snapPoints={layout.snapPoints}\n initialSnap={layout.initialSnap}\n screenHeight={props.hostHeight}\n dragDisabled={layout.dragDisabled}\n enableDragToClose={layout.enableDragToClose}\n dismissThreshold={g9SheetDragCloseThreshold}\n // G9 routes every touch itself (./gesture.tsx: drag vs. body scroll, N-028); lynx-ui's content handlers stay off.\n handleOnly\n onShowChange={(open) => {\n if (!open) void stack.requestBack(entry.id, 'drag');\n }}\n onSnapChange={(index, value) => {\n const detent = layout.fit ? 'fit' : (detents[index] ?? 'large');\n setResting(detent);\n props.onRest?.(value);\n o.onStateChanged?.(detent, value);\n }}\n onOpen={() => stack.markOpened(entry.id)}\n onClose={() => stack.markClosed(entry.id)}\n >\n {/* The view is `position: fixed` without a size; lynx-ui places the sheet at its `top: 100%` and the backdrop at\n its 100 %. Unsized it is 0 × 0 (Lynxtron), so the sheet slid in above the screen: give it the viewport.\n event-through lets taps reach the page around a modal sheet's scrim-less parts; the scrim and the sheet take theirs.\n A non-modal sheet's view is also `pointer-events: none`: with event-through alone the Lynx view handed a tap\n on it to what lies under the whole Lynx view, so a NATIVE element of the page under the sheet (a map's own\n MotionEvents) never got it. (A native window `container` would do it too, but needs the overlay XElement.) */}\n <SheetView\n className={`g9-sheet__view${modal ? '' : ' g9-sheet__view--passthrough'}`}\n nativeProps={{ 'event-through': modal }}\n >\n {modal && entry.inheritsDim && entry.status === 'opening' ? (\n // A successor's dim while it opens (TR-0062): already at full strength, a plain view — lynx-ui's backdrop would\n // fade it in from nothing under a page that was dimmed a frame ago. Once open, the backdrop takes over at the\n // same strength (its progress is then 1) and follows a drag and the close as every other sheet's does.\n <view\n className=\"g9-sheet__scrim\"\n style={{ backgroundColor: scrimColor(entry, settings, opacity) }}\n bindtap={noop}\n >\n <view\n className=\"g9-sheet__scrim-catch\"\n flatten={false}\n event-through={false}\n consume-slide-event={[[-180, 180]]}\n catchtouchmove={noop}\n />\n </view>\n ) : modal ? (\n // The dim is lynx-ui's backdrop (since 1.7.0, AgriPad TR-0052): its opacity is the sheet's PROGRESS, written on the\n // main thread every frame of the open, the close and a drag — it fades in with the sheet, out as it leaves, and\n // follows a finger — instead of a fixed colour that appeared and vanished at once. The colour carries the\n // resting dim (`opacity` below); the backdrop multiplies it by the progress.\n <SheetBackdrop\n clickToClose={false}\n className={`g9-sheet__scrim${props.isTop && !closing ? '' : ' g9-sheet__scrim--covered'}`}\n style={{\n backgroundColor: scrimColor(entry, settings, opacity),\n // A sheet handing off drops its dim at once: the successor's scrim, a newer fixed view at the same place,\n // already covers the page, so a fade here only stacked two dims for its length (TR-0062).\n transition:\n entry.handingOff || (platform === 'ios' && o.animateOverlayToColorOnIos === false)\n ? 'none'\n : `background-color ${closing ? closeMs : openMs}ms`,\n }}\n onClick={() => {\n // A tap on the dim closes a cancelable sheet only once it has OPENED: a tap while it rises belongs to the\n // burst that opened it — nine taps on a secret target, where a tenth landed on the rising sheet's dim,\n // closed AgriPad's Admin Diagnostics before it was up (a real phone, 2026-11-12).\n if (!layout.closeOnOverlayTap || entry.status !== 'open') return;\n void stack.requestBack(entry.id, 'overlayTap');\n }}\n >\n {/* The dim is modal for a DRAG too (TR-0052): a slide that starts on it moved the page behind (the profile list\n scrolled under an open sheet) because only a tap was taken. `consume-slide-event` stops the platform's\n slide gestures at any angle here; never flattened — a flattened view is painted on the Lynx root canvas,\n which a native SurfaceView (a map) covers. */}\n <view\n className=\"g9-sheet__scrim-catch\"\n flatten={false}\n event-through={false}\n consume-slide-event={[[-180, 180]]}\n catchtouchmove={noop}\n />\n </SheetBackdrop>\n ) : null}\n {/* SheetContent's own view is lynx-ui's: a worklet writes its transform every motion frame, so its style is\n set once and never changes (a later inline-style write replaces the worklet's transform). Everything that\n changes (recede, paddings, colour) lives on G9's frame and surface inside it. */}\n <SheetContent\n className={`g9-sheet g9-sheet--${entry.status}${layout.fit ? ' g9-sheet--fit' : ''}`}\n style={platformSheetConstraints(o)}\n innerStyle={sheetInnerStyle}\n {...motion}\n >\n <G9SheetGestureFrame\n refs={gesture}\n canDrag={!layout.dragDisabled}\n bodyDrags={o.scrollingExpandsSheet !== false}\n className=\"g9-sheet__frame\"\n style={{ ...recede, transition: g9SheetRecedeTransition() }}\n >\n {/* The surface takes every touch that lands on it (AgriPad TR-0074, ITCS-16241): the sheet layer is event-through\n (a touch beside a non-modal sheet reaches the page), and Lynx INHERITS it — a drag on a part of the body with\n no handler of its own (a label, a card, the space between rows) went through the sheet and scrolled the page\n behind it. */}\n <view\n className=\"g9-sheet__surface\"\n event-through={false}\n {...g9IdProps(o.automationId)}\n style={{\n backgroundColor: surface,\n borderTopLeftRadius: `${corner}px`,\n borderTopRightRadius: `${corner}px`,\n paddingTop: `${topPadding}px`,\n paddingBottom: `${bottomPadding}px`,\n ...notch,\n }}\n >\n <SheetContext.Provider value={contextValue}>\n <G9AnchorLayerContext.Provider value={anchorLayer}>\n {/* The handle, the title and the footer are the sheet's parts with NO scroller of their own: a vertical drag\n that starts on them went past the sheet to a native scroller behind (TR-0074: the Profile page scrolled\n under «دقت موقعیتیابی» — the body's own scroll-view keeps its drags). They are real views that stop the\n platform's slide gestures (as the dim does). ⛔ Never on the surface or the body: `consume-slide-event`\n there stopped the body's own list from scrolling (the site picker, DOOGEE 2026-11-13). */}\n <view\n className=\"g9-sheet__chrome-top\"\n flatten={false}\n consume-slide-event={[[-180, 180]]}\n bindlayoutchange={onChromeTopLayout}\n >\n {layout.showHandle ||\n (layout.fullScreen &&\n o.showToolbar &&\n o.showFullScreenDragHandle !== false &&\n !layout.dragDisabled) ? (\n <view className=\"g9-sheet__grabber-area\">\n <view className=\"g9-sheet__grabber\" />\n </view>\n ) : null}\n <G9SheetHeader options={o} onBack={() => void stack.requestBack(entry.id, 'toolbarButton')} />\n {o.showToolbar && o.useStandardBodyTopGap !== false ? (\n // MAUI UseStandardBodyTopGap: G9LayoutMetrics.SheetHeaderVerticalGap, which an app scales (AgriPad ×\n // 1.3 = 13) — read from the app's --g9-layout-* variable; g9SheetHeaderMetrics.bodyTopGap is the default.\n <view className=\"g9-sheet__body-gap\" />\n ) : null}\n </view>\n {o.scrollBody === false ? (\n <view\n className={`g9-sheet__body g9-sheet__body--static${layout.fillBody ? ' g9-sheet__body--fill' : ''}`}\n style={{ padding: `${o.padding ?? 0}px` }}\n >\n {content}\n </view>\n ) : indicator.current ? (\n // The thumb's frame: the scroller and the thumb over its inline end (only with scrollIndicator).\n <view className={`g9-sheet__body-frame${layout.fillBody ? ' g9-sheet__body--fill' : ''}`}>\n <scroll-view\n className={`g9-sheet__body${layout.fillBody ? ' g9-sheet__body--fill' : ''}`}\n scroll-orientation=\"vertical\"\n main-thread:ref={gesture.body}\n main-thread:bindscroll={phone ? bodyGesture.onScrollMT : undefined}\n main-thread:bindtouchstart={bodyGesture.onTouchStartMT}\n scroll-event-throttle={16}\n {...endProps}\n bindscroll={(e: { detail?: { scrollTop?: number } }) =>\n indicator.current?.setTop(e.detail?.scrollTop ?? 0)\n }\n bindlayoutchange={(e: { detail?: { height?: number } }) =>\n indicator.current?.setViewport(e.detail?.height ?? 0)\n }\n style={{\n padding: `${o.padding ?? 0}px`,\n ...(maxBody !== null ? { maxHeight: `${maxBody}px` } : {}),\n }}\n >\n {content}\n </scroll-view>\n <G9SheetScrollIndicator model={indicator.current} />\n </view>\n ) : (\n <scroll-view\n className={`g9-sheet__body${layout.fillBody ? ' g9-sheet__body--fill' : ''}`}\n scroll-orientation=\"vertical\"\n main-thread:ref={gesture.body}\n main-thread:bindscroll={phone ? bodyGesture.onScrollMT : undefined}\n main-thread:bindtouchstart={bodyGesture.onTouchStartMT}\n {...endProps}\n style={{\n padding: `${o.padding ?? 0}px`,\n ...(maxBody !== null ? { maxHeight: `${maxBody}px` } : {}),\n }}\n >\n {content}\n </scroll-view>\n )}\n <view\n className=\"g9-sheet__footer-slot\"\n flatten={false}\n consume-slide-event={[[-180, 180]]}\n bindlayoutchange={onFooterLayout}\n >\n <G9SheetFooter options={o} />\n </view>\n </G9AnchorLayerContext.Provider>\n </SheetContext.Provider>\n </view>\n {/* Below the surface, so a drag past the top detent (rubber band) never shows the page under it. */}\n <view className=\"g9-sheet__skirt\" style={{ backgroundColor: surface }} />\n </G9SheetGestureFrame>\n </SheetContent>\n </SheetView>\n </SheetRoot>\n );\n}\n"],"names":["SheetContext","createContext","useG9SheetContext","useContext","noop","scrimColor","entry","settings","opacity","explicit","parsed","tryParseColor","formatColor","withAlpha","sheetInnerStyle","g9SheetRecedeTransition","g9Ms","orderedDetents","o","requested","d","restingSnapIndex","resting","fit","detents","Math","initialDetent","_o_currentState","_ordered_","ordered","current","G9SheetFrame","props","_o_route","_ref1","_o_loadingSkeletonRowCount","_ratios_layout_initialSnap","_props_bottomInset","_o_scrollToEndThreshold","_o_openAnimationDurationMs","_o_closeAnimationDurationMs","_o_cornerRadius","_o_backgroundColor","_ratios_restIndex","_o_padding","_o_padding1","_o_padding2","_o_route1","_o_route2","_props_memo","stack","palette","useG9Theme","gesture","useSheetGestureRefs","bodyGesture","useSheetBodyGesture","placeOpen","useG9Place","sheetSegmentOf","layout","resolveSheetLayout","showing","closing","handle","controller","useRef","createAbortController","useEffect","_controller_current","factory","deferred","revealed","setRevealed","useState","covering","setCovering","timer","coverTimer","stopTimer","_o_loadDelayMs","_o_loadDelayMs1","delay","startTimer","memoKey","placeholderHeight","undefined","g9SheetFitLoadingMinHeight","bodyHeight","setBodyHeight","footerHeight","setFooterHeight","chromeTopHeight","setChromeTopHeight","onChromeTopLayout","e","_e_detail","onFooterLayout","indicator","G9SheetScrollModel","onBodyLayout","_indicator_current","h","placeholder","view","G9SheetSkeleton","G9ActivityIndicator","body","ratios","p","Number","restingRatio","shown","contentRatio","sheetOverlayOpacity","modal","recede","parentRecedeOffset","setResting","rootRef","lastFitBody","_rootRef_current","fitHeight","lastHostHeight","topPadding","sheetSurfaceTopPadding","bottomPadding","sheetSurfaceBottomPadding","maxBody","g9SheetFitMinHeight","anchorLayer","useMemo","contextValue","platform","currentPlatform","phone","endProps","g9SheetScrollToEndThreshold","openMs","closeMs","corner","surface","notch","g9FieldNotchStyle","resolveThemeColor","restIndex","fitRatio","openRatio","motion","resolveSheetMotion","content","clampFitHeight","SheetRoot","g9SheetDragCloseThreshold","open","index","value","_detents_index","detent","SheetView","SheetBackdrop","SheetContent","platformSheetConstraints","G9SheetGestureFrame","g9IdProps","G9AnchorLayerContext","G9SheetHeader","scroll-view","G9SheetScrollIndicator","G9SheetFooter"],"mappings":";;;;;;;;;;;;;;;;;AAyDA,MAAMA,eAAeC,cAA0C;AAGxD,SAASC;IACd,OAAOC,WAAWH;AACpB;AAuBA,MAAMI,OAAO,KAAa;AAE1B,SAASC,WAAWC,KAAmB,EAAEC,QAAmC,EAAEC,OAAe;IAC3F,MAAMC,WAAWH,MAAM,OAAO,CAAC,qBAAqB;IACpD,MAAMI,SAASC,cAAcF,QAAAA,WAAAA,WAAYF,SAAS,iBAAiB;IACnE,IAAI,CAACG,QAAQ,OAAOD,QAAAA,WAAAA,WAAYF,SAAS,iBAAiB;IAC1D,OAAOK,YAAYC,UAAUH,QAAQD,WAAWC,OAAO,CAAC,GAAGF;AAC7D;AAGA,MAAMM,kBAAkB;IAAE,SAAS;IAAQ,eAAe;AAAS;AAGnE,MAAMC,0BAA0B,IAAc,CAAC,UAAU,EAAEC,KAAK,KAAK,qBAAqB,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,AAAY,SAAZA,UAAmB;YAAE,WAAW,GAAGA,QAAQ,EAAE,CAAC;QAAC,IAAI,CAAC,CAAC;IAC3D,GACD;sBACC,CAACsB,QAAQ;oBACX,EAAEiB,aACF;kBACF,CAAC/D,KACC,UAAU,wBACV,SAAS,OACT,qBAAqB;QAAC;YAAC;YAAM;SAAI;KAAC,EAClC,kBAAkBP,gBACnB;oBACC,CAACwE,cAAc,SAASvJ,IAAK;kBAC/B,EAAEsF,KAAK;gBACT,EAAE6D,qBAAqB,SAAS;cAClC,EAAErK,aAAa,SAAS;YAC1B,EAAEwG,KAAK;YACP,EAAqG;YACrG,CAACA,KAAK,UAAU,kBAAkB,OAAO;QAAE,iBAAiBqC;IAAQ,IAAK;UAC3E,EAAEsB,oBAAoB;QACxB,EAAEF,aAAa;MACjB,EAAEF,UAAU;IACd,EAAEP;AAEN"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sheet/gesture.jsx","sources":["../../src/sheet/gesture.tsx"],"sourcesContent":["// The sheet's own gesture routing (ledger N-028): G9 owns every touch on the sheet and forwards to lynx-ui's drag\n// handlers only when the sheet owns the gesture (./handoff.ts has the rule and its tests). lynx-ui's SheetContent runs\n// with `handleOnly`, so its content handlers are off and nothing drags twice.\n//\n// lynx-ui 3.139 keeps the drag handlers and the sheet progress in contexts its package index does not export; they are\n// read from the module SheetContent itself imports (`dist/context`), so they are the same context objects.\nimport { SheetDragContext, useSheetContext } from '@lynx-js/lynx-ui-sheet/dist/context/index.jsx';\nimport { type MainThreadRef, type ReactNode, useContext, useMainThreadRef } from '@lynx-js/react';\nimport type { MainThread } from '@lynx-js/types';\nimport { decideSheetGestureMT, type G9SheetGestureMode, scrollHandsOffToSheetMT } from './handoff';\n\nfunction noTouchMT(_e: MainThread.TouchEvent): void {\n 'main thread';\n}\n\n/** Main-thread state shared by the gesture frame, the grabber and the scrolling body of one sheet. */\nexport interface G9SheetGestureRefs {\n readonly mode: MainThreadRef<G9SheetGestureMode>;\n readonly start: MainThreadRef<{ x: number; y: number }>;\n readonly lastY: MainThreadRef<number>;\n /** The body's scroll offset (from its `scroll` event). */\n readonly scrollTop: MainThreadRef<number>;\n /** The current touch started inside the body. */\n readonly inBody: MainThreadRef<boolean>;\n /** The body's scroll view (its `enable-scroll` is turned off while the sheet owns a gesture that began in it). */\n readonly body: MainThreadRef<MainThread.Element | null>;\n}\n\n/** Creates the refs of one sheet's gesture routing. */\nexport function useSheetGestureRefs(): G9SheetGestureRefs {\n return {\n mode: useMainThreadRef<G9SheetGestureMode>('ignore'),\n start: useMainThreadRef({ x: 0, y: 0 }),\n lastY: useMainThreadRef(0),\n scrollTop: useMainThreadRef(0),\n inBody: useMainThreadRef(false),\n body: useMainThreadRef<MainThread.Element | null>(null),\n };\n}\n\n/** Main-thread handlers for the sheet body's `<scroll-view>` (its offset, and touches that start in it). */\nexport interface G9SheetBodyGesture {\n readonly onScrollMT: (e: { detail?: { scrollTop?: number } }) => void;\n readonly onTouchStartMT: () => void;\n}\n\n/**\n * The body's side of the routing: bind `main-thread:ref={refs.body}`, `main-thread:bindscroll={onScrollMT}` and\n * `main-thread:bindtouchstart={onTouchStartMT}` on the body's `<scroll-view>`.\n */\nexport function useSheetBodyGesture(refs: G9SheetGestureRefs): G9SheetBodyGesture {\n const { scrollTop, inBody } = refs;\n function onScrollMT(e: { detail?: { scrollTop?: number } }) {\n 'main thread';\n scrollTop.current = e.detail?.scrollTop ?? 0;\n }\n function onTouchStartMT() {\n 'main thread';\n inBody.current = true;\n }\n return { onScrollMT, onTouchStartMT };\n}\n\n/** Props of {@link G9SheetGestureFrame}. */\nexport interface G9SheetGestureFrameProps {\n readonly refs: G9SheetGestureRefs;\n /** The sheet can be dragged (draggable and not intercepted by `onBackRequested`). */\n readonly canDrag: boolean;\n /** `scrollingExpandsSheet` (default true): a drag that starts in the body may move the sheet. */\n readonly bodyDrags: boolean;\n readonly className: string;\n readonly style: Record<string, string | number>;\n readonly children?: ReactNode;\n}\n\n/**\n * The view that receives every touch on a sheet and routes it: to lynx-ui's drag (the sheet moves), to the body's\n * native scrolling, or to neither (a horizontal gesture). Rendered inside lynx-ui `SheetContent`.\n */\nexport function G9SheetGestureFrame(props: G9SheetGestureFrameProps): ReactNode {\n // Worklets capture what they read when they are created, so nothing here may be undefined: an absent lynx-ui\n // context (outside SheetContent) falls back to no-op handlers and an \"at the top\" progress.\n const handlers = useContext(SheetDragContext)?.dragHandlers;\n const startDrag = handlers?.handleTouchStartMT ?? noTouchMT;\n const moveDrag = handlers?.handleTouchMoveMT ?? noTouchMT;\n const endDrag = handlers?.handleTouchEndMT ?? noTouchMT;\n const noProgress = useMainThreadRef<{ get(): number } | null>(null);\n const progress = useSheetContext().sheetProgress ?? noProgress;\n const { mode, start, lastY, scrollTop, inBody, body } = props.refs;\n const canDrag = props.canDrag;\n const bodyDrags = props.bodyDrags;\n\n function atTopMT(): boolean {\n 'main thread';\n const value = progress.current;\n return !value || value.get() >= 0.995;\n }\n function setBodyScrollMT(enabled: boolean) {\n 'main thread';\n body.current?.setAttribute('enable-scroll', enabled);\n }\n function onStartMT(e: MainThread.TouchEvent) {\n 'main thread';\n start.current = { x: e.detail.x, y: e.detail.y };\n lastY.current = e.detail.y;\n mode.current = 'pending';\n if (canDrag) startDrag(e);\n }\n function onMoveMT(e: MainThread.TouchEvent) {\n 'main thread';\n const y = e.detail.y;\n const step = y - lastY.current;\n lastY.current = y;\n if (mode.current === 'pending') {\n const decided = decideSheetGestureMT({\n dx: e.detail.x - start.current.x,\n dy: y - start.current.y,\n atTop: atTopMT(),\n scrollTop: scrollTop.current,\n inBody: inBody.current,\n canDrag,\n bodyDrags,\n });\n if (decided === 'pending') return;\n mode.current = decided;\n if (decided === 'sheet' && inBody.current) setBodyScrollMT(false);\n } else if (\n mode.current === 'scroll' &&\n scrollHandsOffToSheetMT(atTopMT(), scrollTop.current, step, canDrag, bodyDrags)\n ) {\n // The body reached its top while the finger pulls down: the sheet takes the rest of the gesture.\n mode.current = 'sheet';\n setBodyScrollMT(false);\n startDrag(e);\n }\n if (mode.current === 'sheet') moveDrag(e);\n }\n function onEndMT(e: MainThread.TouchEvent) {\n 'main thread';\n if (mode.current === 'sheet') endDrag(e);\n if (inBody.current) setBodyScrollMT(true);\n mode.current = 'ignore';\n inBody.current = false;\n }\n return (\n <view\n className={props.className}\n style={props.style}\n main-thread:bindtouchstart={onStartMT}\n main-thread:bindtouchmove={onMoveMT}\n main-thread:bindtouchend={onEndMT}\n main-thread:bindtouchcancel={onEndMT}\n >\n {props.children}\n </view>\n );\n}\n"],"names":["noTouchMT","_e","useSheetGestureRefs","useMainThreadRef","useSheetBodyGesture","refs","scrollTop","inBody","onScrollMT","e","_e_detail","onTouchStartMT","G9SheetGestureFrame","props","_useSheetContext_sheetProgress","_useContext","handlers","SheetDragContext","startDrag","moveDrag","endDrag","noProgress","progress","mode","start","lastY","body","canDrag","bodyDrags","atTopMT","value","setBodyScrollMT","enabled","_body_current","onStartMT","onMoveMT","y","step","decided","decideSheetGestureMT","scrollHandsOffToSheetMT","onEndMT","view"],"mappings":";;;AAWA,SAASA,UAAUC,EAAyB;IAC1C;AACF;AAgBO,SAASC;IACd,OAAO;QACL,MAAMC,iBAAqC;QAC3C,OAAOA,iBAAiB;YAAE,GAAG;YAAG,GAAG;QAAE;QACrC,OAAOA,iBAAiB;QACxB,WAAWA,iBAAiB;QAC5B,QAAQA,iBAAiB;QACzB,MAAMA,iBAA4C;IACpD;AACF;AAYO,SAASC,oBAAoBC,IAAwB;IAC1D,MAAM,EAAEC,SAAS,EAAEC,MAAM,EAAE,GAAGF;IAC9B,SAASG,WAAWC,CAAsC;;QACxD;YACoBC;QAApBJ,UAAU,OAAO,GAAG,QAAH,gBAAGI,CAAAA,YAAAA,EAAE,MAAM,AAAD,IAAPA,KAAAA,IAAAA,UAAU,SAAS,AAAD,IAAC,OAAI;IAC7C;IACA,SAASC;QACP;QACAJ,OAAO,OAAO,GAAG;IACnB;IACA,OAAO;QAAEC;QAAYG;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
|
1
|
-
{"version":3,"file":"sheet/handoff.jsx","sources":["../../src/sheet/handoff.ts"],"sourcesContent":["// Nested scroll hand-off between a sheet and its scrolling body (ledger N-028; MAUI G9SheetView nested scrolling).\n//\n// lynx-ui's SheetContent drags the sheet on every vertical move inside it and knows nothing of the scroll view in\n// the body, so a list in a `medium` sheet scrolled AND dragged the sheet at once. G9 decides per gesture instead, on\n// the main thread (frame.tsx forwards to lynx-ui's drag handlers only when the sheet owns the gesture):\n// • below the top detent, a vertical drag in the body moves the sheet (it expands first) and the body stays put;\n// • at the top detent, the body scrolls; pulling down with the body at its top hands the gesture to the sheet\n// (it collapses or closes), also in the middle of a scroll that reaches the top;\n// • a touch outside the body (grabber, header, footer) always drags the sheet; `scrollingExpandsSheet: false` limits\n// dragging to those; horizontal gestures (swipe rows, sliders, chips) are never taken.\n\n/** Finger travel before a gesture is classified (lynx-ui's `GESTURE_THRESHOLD`). */\nexport const g9SheetGestureSlop = 8;\n\n/** Who owns a gesture that started on a sheet. */\nexport type G9SheetGestureMode = 'pending' | 'sheet' | 'scroll' | 'ignore';\n\n/** What the classification needs, as plain numbers and flags (main-thread friendly). */\nexport interface G9SheetGestureInput {\n /** Finger travel since the touch started (px); positive `dy` = downwards. */\n readonly dx: number;\n readonly dy: number;\n /** The sheet rests at (or above) its top detent. */\n readonly atTop: boolean;\n /** The body's scroll offset (px); ≤ 0 = at its top. */\n readonly scrollTop: number;\n /** The touch started inside the scrolling body (not on the grabber, header or footer). */\n readonly inBody: boolean;\n /** The sheet can be dragged at all (draggable, not intercepted). */\n readonly canDrag: boolean;\n /** `scrollingExpandsSheet` (default true): a drag in the body may move the sheet. */\n readonly bodyDrags: boolean;\n}\n\n/** Classifies a gesture once it travelled past the slop (else `'pending'`). See the module comment. */\nexport function decideSheetGesture(input: G9SheetGestureInput): G9SheetGestureMode {\n const { dx, dy } = input;\n if (Math.sqrt(dx * dx + dy * dy) <= g9SheetGestureSlop) return 'pending';\n if (Math.abs(dy) < Math.abs(dx)) return 'ignore';\n if (!input.canDrag) return input.inBody ? 'scroll' : 'ignore';\n if (!input.inBody) return 'sheet';\n if (!input.bodyDrags) return 'scroll';\n if (!input.atTop) return 'sheet';\n return dy > 0 && input.scrollTop <= 0 ? 'sheet' : 'scroll';\n}\n\n/** Main-thread twin of {@link decideSheetGesture}. */\nexport function decideSheetGestureMT(input: G9SheetGestureInput): G9SheetGestureMode {\n 'main thread';\n const dx = input.dx;\n const dy = input.dy;\n if (Math.sqrt(dx * dx + dy * dy) <= 8) return 'pending';\n if (Math.abs(dy) < Math.abs(dx)) return 'ignore';\n if (!input.canDrag) return input.inBody ? 'scroll' : 'ignore';\n if (!input.inBody) return 'sheet';\n if (!input.bodyDrags) return 'scroll';\n if (!input.atTop) return 'sheet';\n return dy > 0 && input.scrollTop <= 0 ? 'sheet' : 'scroll';\n}\n\n/**\n * Mid-scroll hand-off: a body scroll at the top detent becomes a sheet drag once the body is at its top and the finger\n * moves down (MAUI nested scrolling). `stepDy` is the travel since the previous move.\n */\nexport function scrollHandsOffToSheet(\n atTop: boolean,\n scrollTop: number,\n stepDy: number,\n canDrag: boolean,\n bodyDrags: boolean,\n): boolean {\n return canDrag && bodyDrags && atTop && scrollTop <= 0 && stepDy > 0;\n}\n\n/** Main-thread twin of {@link scrollHandsOffToSheet}. */\nexport function scrollHandsOffToSheetMT(\n atTop: boolean,\n scrollTop: number,\n stepDy: number,\n canDrag: boolean,\n bodyDrags: boolean,\n): boolean {\n 'main thread';\n return canDrag && bodyDrags && atTop && scrollTop <= 0 && stepDy > 0;\n}\n"],"names":["g9SheetGestureSlop","decideSheetGesture","input","dx","dy","Math","decideSheetGestureMT","scrollHandsOffToSheet","atTop","scrollTop","stepDy","canDrag","bodyDrags","scrollHandsOffToSheetMT"],"mappings":"AAYO,MAAMA,qBAAqB;AAuB3B,SAASC,mBAAmBC,KAA0B;IAC3D,MAAM,EAAEC,EAAE,EAAEC,EAAE,EAAE,GAAGF;IACnB,IAAIG,KAAK,IAAI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../src/sheet/header.tsx"],"sourcesContent":["import { formatColor, G9StringKey, withAlpha } from '@g9tm/lynxcontrols-foundation';\nimport { type ReactNode, useState } from '@lynx-js/react';\nimport { g9ChildId, g9IdProps, g9RowStyle, g9SafeId } from '../base/control';\nimport { useG9Press } from '../base/press';\nimport { G9HeaderActionButton } from '../button/header-action-button';\nimport { G9IconSlot } from '../icon/slot';\nimport { useG9Direction, useG9Settings, useG9Strings, useG9Theme } from '../provider/hooks';\nimport type { G9SheetOptions, G9SheetToolbarItem } from './options';\n\n/** Header metrics (MAUI `G9LayoutMetrics` sheet header values). */\nexport const g9SheetHeaderMetrics = Object.freeze({\n minHeight: 64,\n verticalGap: 10,\n bodyTopGap: 10,\n backButton: 30,\n backGlyph: 24,\n backHitSlop: 7,\n titleSize: 16.2,\n footerMaxButtonsPerRow: 3,\n});\n\nfunction ToolbarItemButton(props: { readonly item: G9SheetToolbarItem; readonly id: string | undefined }): ReactNode {\n const { item } = props;\n const [running, setRunning] = useState(false);\n const busy = item.isBusy === true || running;\n const onPress = () => {\n if (busy && item.disableWhileBusy !== false) return;\n const result = item.onPress?.();\n if (result && typeof (result as PromiseLike<unknown>).then === 'function') {\n setRunning(true);\n (result as PromiseLike<unknown>).then(\n () => setRunning(false),\n () => setRunning(false),\n );\n }\n };\n return (\n <G9HeaderActionButton\n // MAUI ApplyVisualState: an icon wins and the text is not shown (it stays the accessibility label).\n {...(item.icon !== undefined ? { icon: item.icon } : item.text ? { buttonText: item.text } : {})}\n isBusy={busy && item.showBusyIndicator === true}\n isActive={item.isActive === true}\n showActiveBadge={item.showActiveBadge === true && !item.badgeText}\n {...(item.badgeText ? { badgeText: item.badgeText } : {})}\n animatePress={item.animatePress !== false}\n {...(item.iconSize ? { iconSize: item.iconSize } : {})}\n {...(item.accessibilityLabel || item.text ? { accessibilityLabel: item.accessibilityLabel ?? item.text } : {})}\n {...g9IdProps(props.id)}\n disabled={busy && item.disableWhileBusy !== false && item.showBusyIndicator !== true}\n onPress={onPress}\n />\n );\n}\n\n/** Props of {@link G9SheetHeader}. */\nexport interface G9SheetHeaderProps {\n readonly options: G9SheetOptions;\n /** The leading button (MAUI back request with source `toolbarButton`). */\n readonly onBack: () => void;\n}\n\n/**\n * The three-slot sheet header (MAUI header template): leading back/close button (RTL-aware arrow, or × with\n * `useCloseIcon`), the title (centre or near the back button), the trailing toolbar items; slot overrides\n * `headerView` > `headerLeadingAndTitleView` > `headerTitleAndTrailingView` > per-slot views > defaults. A hairline\n * closes the band. Rendered only with `showToolbar`.\n */\nexport function G9SheetHeader(props: G9SheetHeaderProps): ReactNode {\n const o = props.options;\n const direction = useG9Direction();\n const settings = useG9Settings();\n const glyphs = settings.glyphs;\n const palette = useG9Theme().palette;\n const strings = useG9Strings();\n const back = useG9Press(props.onBack, { source: 'G9SheetHeader' });\n if (o.showToolbar !== true) return null;\n if (o.headerView !== undefined && o.headerView !== null) {\n return <view className=\"g9-sheet-header g9-sheet-header--custom\">{o.headerView}</view>;\n }\n const m = g9SheetHeaderMetrics;\n const leading =\n o.headerLeadingView ??\n (o.showCloseButton ? (\n <view\n className=\"g9-sheet-header__back\"\n {...g9IdProps(g9ChildId(o.automationId, 'Back'))}\n // MAUI: the glyph sits at the reading START of its 30 dp box (HorizontalOptions.Start), not centred.\n style={{ width: `${m.backButton}px`, height: `${m.backButton}px`, ...g9RowStyle(direction) }}\n accessibility-element={true}\n accessibility-traits=\"button\"\n accessibility-label={o.useCloseIcon ? strings.get(G9StringKey.Close) : strings.get(G9StringKey.Back)}\n hit-slop={{\n top: `${m.backHitSlop}px`,\n left: `${m.backHitSlop}px`,\n right: `${m.backHitSlop}px`,\n bottom: `${m.backHitSlop}px`,\n }}\n bindtap={back}\n >\n <G9IconSlot\n icon={o.useCloseIcon ? glyphs.clear : direction === 'rtl' ? glyphs.arrowForward : glyphs.arrowBack}\n size={m.backGlyph}\n color=\"var(--g9-secondary)\"\n />\n </view>\n ) : null);\n const title =\n o.headerTitleView ??\n (o.title ? (\n <text className=\"g9-sheet-header__title\" text-maxline=\"1\" style={{ fontSize: `${m.titleSize}px` }}>\n {o.title}\n </text>\n ) : null);\n const items = o.toolbarItems ?? o.toolbarItemsFactory?.() ?? [];\n const trailing =\n o.headerTrailingView ??\n (items.length > 0 ? (\n <view className=\"g9-sheet-header__items\" style={g9RowStyle(direction)}>\n {items.map((item, i) => (\n <ToolbarItemButton\n key={item.key ?? String(i)}\n item={item}\n id={\n item.automationId\n ? g9SafeId(item.automationId)\n : g9ChildId(o.automationId, `ToolbarItem_${item.key ?? i}`)\n }\n />\n ))}\n </view>\n ) : null);\n const spanned = o.headerLeadingAndTitleView != null || o.headerTitleAndTrailingView != null;\n const center = (o.headerTitlePlacement ?? 'center') === 'center' && o.reserveEmptyHeaderSlots !== false && !spanned;\n let slots: ReactNode;\n if (o.headerLeadingAndTitleView != null) {\n slots = [\n <view key=\"lt\" className=\"g9-sheet-header__grow\" style={g9RowStyle(direction)}>\n {o.headerLeadingAndTitleView}\n </view>,\n <view key=\"t\" className=\"g9-sheet-header__end\">\n {trailing}\n </view>,\n ];\n } else if (o.headerTitleAndTrailingView != null) {\n slots = [\n <view key=\"l\" className=\"g9-sheet-header__start\">\n {leading}\n </view>,\n <view key=\"tt\" className=\"g9-sheet-header__grow\" style={g9RowStyle(direction)}>\n {o.headerTitleAndTrailingView}\n </view>,\n ];\n } else if (center) {\n slots = [\n // The side slots follow the reading direction too: in RTL the back button sits at the right EDGE, the trailing\n // items at the left edge (MAUI) — not against the centred title.\n <view key=\"l\" className=\"g9-sheet-header__side g9-sheet-header__start\" style={g9RowStyle(direction)}>\n {leading}\n </view>,\n <view key=\"t\" className=\"g9-sheet-header__title-slot\">\n {title}\n </view>,\n <view key=\"r\" className=\"g9-sheet-header__side g9-sheet-header__end\" style={g9RowStyle(direction)}>\n {trailing}\n </view>,\n ];\n } else {\n slots = [\n <view key=\"l\" className=\"g9-sheet-header__start\">\n {leading}\n </view>,\n // The grow slot follows the reading direction: in RTL a near-back title hugs the back button (right edge).\n <view key=\"t\" className=\"g9-sheet-header__grow g9-sheet-header__title-near\" style={g9RowStyle(direction)}>\n {title}\n </view>,\n <view key=\"r\" className=\"g9-sheet-header__end\">\n {trailing}\n </view>,\n ];\n }\n return (\n <view\n className={`g9-sheet-header g9-dir-${direction}`}\n style={{\n // The 64 dp band, then MAUI's 1 dp divider UNDER it (OutlineVariant @ 35 %), not inside it.\n minHeight: `${m.minHeight + 1}px`,\n paddingLeft: `${settings.sheets.headerEdgeSpacing}px`,\n paddingRight: `${settings.sheets.headerEdgeSpacing}px`,\n borderBottomColor: formatColor(withAlpha(palette.OutlineVariant, 0.35)),\n ...g9RowStyle(direction),\n }}\n >\n {slots}\n </view>\n );\n}\n\n/** Props of {@link G9SheetFooter}. */\nexport interface G9SheetFooterProps {\n readonly options: G9SheetOptions;\n}\n\n/** Rows of footer buttons: equal-width columns, wrapping every `perRow` (MAUI footer template). */\nexport function footerRows<T>(buttons: ReadonlyArray<T>, perRow: number): T[][] {\n const n = Math.max(1, Math.floor(perRow));\n const rows: T[][] = [];\n for (let i = 0; i < buttons.length; i += n) rows.push(buttons.slice(i, i + n));\n return rows;\n}\n\n/** The sheet footer: `footerBand`, else `footerView` in the band, else `footerButtons` in equal columns (3 per row by default), with a divider. */\nexport function G9SheetFooter(props: G9SheetFooterProps): ReactNode {\n const o = props.options;\n if (o.footerBand != null) return o.footerBand;\n if (o.footerView != null) return <view className=\"g9-sheet-footer\">{o.footerView}</view>;\n return (\n <G9SheetFooterBar\n buttons={o.footerButtons ?? []}\n {...(o.footerMaxButtonsPerRow !== undefined ? { maxButtonsPerRow: o.footerMaxButtonsPerRow } : {})}\n />\n );\n}\n\n/** Props of {@link G9SheetFooterBar}. */\nexport interface G9SheetFooterBarProps {\n readonly buttons: ReadonlyArray<ReactNode>;\n /** Default 3. */\n readonly maxButtonsPerRow?: number;\n}\n\n/**\n * The footer band (divider, padding, equal-width button columns); nothing at all without buttons (MAUI\n * `SheetFooterBar` hides with no visible button). Render it from a `footerBand` whose buttons come and go.\n */\nexport function G9SheetFooterBar(props: G9SheetFooterBarProps): ReactNode {\n const direction = useG9Direction();\n if (props.buttons.length === 0) return null;\n return (\n <view className=\"g9-sheet-footer\">\n {footerRows(props.buttons, props.maxButtonsPerRow ?? g9SheetHeaderMetrics.footerMaxButtonsPerRow).map(\n (row, r) => (\n <view key={r} className=\"g9-sheet-footer__row\" style={g9RowStyle(direction)}>\n {row.map((button, i) => (\n <view key={i} className=\"g9-sheet-footer__cell\">\n {button}\n </view>\n ))}\n </view>\n ),\n )}\n </view>\n );\n}\n"],"names":["g9SheetHeaderMetrics","Object","ToolbarItemButton","props","_item_accessibilityLabel","item","running","setRunning","useState","busy","onPress","result","G9HeaderActionButton","undefined","g9IdProps","G9SheetHeader","_o_headerLeadingView","_o_headerTitleView","_ref","_o_headerTrailingView","_o_headerTitlePlacement","o","direction","useG9Direction","settings","useG9Settings","glyphs","palette","useG9Theme","strings","useG9Strings","back","useG9Press","view","m","leading","g9ChildId","g9RowStyle","G9StringKey","G9IconSlot","title","text","items","trailing","i","_item_key","_item_key1","String","g9SafeId","spanned","center","slots","formatColor","withAlpha","footerRows","buttons","perRow","n","Math","rows","G9SheetFooter","_o_footerButtons","G9SheetFooterBar","_props_maxButtonsPerRow","row","r","button"],"mappings":";;;;;;;AAUO,MAAMA,uBAAuBC,OAAO,MAAM,CAAC;IAChD,WAAW;IACX,aAAa;IACb,YAAY;IACZ,YAAY;IACZ,WAAW;IACX,aAAa;IACb,WAAW;IACX,wBAAwB;AAC1B;AAEA,SAASC,kBAAkBC,KAA6E;QAyBhCC;IAxBtE,MAAM,EAAEC,IAAI,EAAE,GAAGF;IACjB,MAAM,CAACG,SAASC,WAAW,GAAGC,SAAS;IACvC,MAAMC,OAAOJ,AAAgB,SAAhBA,KAAK,MAAM,IAAaC;IACrC,MAAMI,UAAU;YAECL;QADf,IAAII,QAAQJ,AAA0B,UAA1BA,KAAK,gBAAgB,EAAY;QAC7C,MAAMM,SAAS,Q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QAAQtB,KACfX,KAAK,KAAKW,GAAG,UAAU,wBAAwB;gBAC9C,CAACsB,OAAO;cACV,EAAEjC,OACD;UACL,EAAEA,OAEJ;IACJ,EAAEA;AAEN"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sheet/height-memo.jsx","sources":["../../src/sheet/height-memo.ts"],"sourcesContent":["// MAUI `G9BottomSheetHeightSeeds` + `G9BottomSheetHeightMemoStore`: first-open body heights for deferred sheets.\n// Keys are `{identity}|w{width}|{culture}|fs{fontScale}`, so a viewport, language or font-size change misses and\n// re-measures; `invalidate()` clears the learned heights (theme or font change).\n\n/** Most learned heights kept (MAUI 64). */\nexport const g9SheetHeightMemoLimit = 64;\n/** Preference key of the persisted memo. */\nexport const g9SheetHeightMemoPreferenceKey = 'sheet-heights';\n\n/** The memo key of a sheet body. */\nexport function sheetHeightMemoKey(identity: string, width: number, culture: string, fontScale: number): string {\n return `${identity}|w${Math.round(width)}|${culture}|fs${fontScale}`;\n}\n\n/** Compiled-in first-open heights (MAUI `G9BottomSheetHeightSeeds`); never persisted. */\nexport interface G9SheetHeightSeeds {\n /** Sets (or replaces) the seed of a memo key or bare identity; blank keys and heights ≤ 0 are ignored. */\n seed(key: string, bodyHeight: number): void;\n /** Exact key first, then the identity alone (the last three `|` segments stripped). */\n tryGet(key: string): number | undefined;\n reset(): void;\n}\n\n/** Creates a seed table. */\nexport function createSheetHeightSeeds(): G9SheetHeightSeeds {\n const seeds = new Map<string, number>();\n return {\n seed(key, bodyHeight) {\n if (!key || key.trim() === '' || !(bodyHeight > 0)) return;\n seeds.set(key, bodyHeight);\n },\n tryGet(key) {\n const exact = seeds.get(key);\n if (exact !== undefined) return exact;\n const parts = key.split('|');\n if (parts.length < 4) return undefined;\n return seeds.get(parts.slice(0, parts.length - 3).join('|'));\n },\n reset() {\n seeds.clear();\n },\n };\n}\n\n/** The learned heights (MAUI `G9BottomSheetHeightMemoStore`). */\nexport interface G9SheetHeightMemo {\n /** Learned height, else the seed. */\n lookup(key: string): number | undefined;\n /** Records a real body measurement; ≤ 0 is ignored, a change < 0.5 is skipped; the oldest key is evicted at 64. */\n record(key: string, bodyHeight: number): void;\n /** Forgets every learned height (theme/font change). */\n invalidate(): void;\n readonly size: number;\n /** Writes the memo to preferences now. */\n flush(): void;\n}\n\n/** The synchronous preference reads/writes the memo needs (`useG9Preferences()` provides them). */\nexport interface G9SheetMemoPreferences {\n getString(key: string, defaultValue?: string | null): string | null;\n setString(key: string, value: string): unknown;\n}\n\n/** Options of {@link createSheetHeightMemo}. */\nexport interface G9SheetHeightMemoOptions {\n readonly seeds?: G9SheetHeightSeeds;\n /** Persists under {@link g9SheetHeightMemoPreferenceKey}; a different `appVersion` discards the stored memo. */\n readonly preferences?: G9SheetMemoPreferences;\n readonly appVersion?: string;\n /** Debounced flush (ms). Default 3000. */\n readonly flushDelayMs?: number;\n readonly setTimer?: (callback: () => void, ms: number) => unknown;\n readonly clearTimer?: (handle: unknown) => void;\n}\n\n/** Creates a height memo (lazy load from preferences on first use, debounced flush). */\nexport function createSheetHeightMemo(options: G9SheetHeightMemoOptions = {}): G9SheetHeightMemo {\n const entries = new Map<string, number>();\n const header = `v1\\t${options.appVersion ?? '0'}`;\n let loaded = false;\n let timer: unknown = null;\n const prefs = options.preferences;\n const load = () => {\n if (loaded) return;\n loaded = true;\n if (!prefs) return;\n const blob = prefs.getString(g9SheetHeightMemoPreferenceKey, '') ?? '';\n const lines = blob.split('\\n');\n if (lines[0] !== header) return;\n for (const line of lines.slice(1)) {\n const tab = line.lastIndexOf('\\t');\n if (tab <= 0) continue;\n const height = Number(line.slice(tab + 1));\n if (height > 0) entries.set(line.slice(0, tab), height);\n }\n };\n const flush = () => {\n if (timer !== null) options.clearTimer?.(timer);\n timer = null;\n if (!prefs) return;\n const body = [...entries].map(([k, h]) => `${k}\\t${Math.round(h * 10) / 10}`);\n prefs.setString(g9SheetHeightMemoPreferenceKey, [header, ...body].join('\\n'));\n };\n const schedule = () => {\n if (!prefs || !options.setTimer) return;\n if (timer !== null) options.clearTimer?.(timer);\n timer = options.setTimer(flush, options.flushDelayMs ?? 3000);\n };\n return {\n lookup(key) {\n load();\n return entries.get(key) ?? options.seeds?.tryGet(key);\n },\n record(key, bodyHeight) {\n load();\n if (!(bodyHeight > 0)) return;\n const old = entries.get(key);\n if (old !== undefined && Math.abs(old - bodyHeight) < 0.5) return;\n if (old === undefined && entries.size >= g9SheetHeightMemoLimit) {\n const first = entries.keys().next().value as string;\n entries.delete(first);\n }\n entries.set(key, bodyHeight);\n schedule();\n },\n invalidate() {\n load();\n entries.clear();\n schedule();\n },\n get size() {\n load();\n return entries.size;\n },\n flush,\n };\n}\n"],"names":["g9SheetHeightMemoLimit","g9SheetHeightMemoPreferenceKey","sheetHeightMemoKey","identity","width","culture","fontScale","Math","createSheetHeightSeeds","seeds","Map","key","bodyHeight","exact","undefined","parts","createSheetHeightMemo","options","_options_appVersion","entries","header","loaded","timer","prefs","load","_prefs_getString","blob","lines","line","tab","height","Number","flush","body","k","h","schedule","_options_flushDelayMs","_entries_get","_options_seeds","old","first"],"mappings":"AAKO,MAAMA,yBAAyB;AAE/B,MAAMC,iCAAiC;AAGvC,SAASC,mBAAmBC,QAAgB,EAAEC,KAAa,EAAEC,OAAe,EAAEC,SAAiB;IACpG,OAAO,GAAGH,SAAS,EAAE,EAAEI,KAAK,KAAK,CAACH,OAAO,CAAC,EAAEC,QAAQ,GAAG,EAAEC,WAAW;AACtE;AAYO,SAASE;IACd,MAAMC,QAAQ,IAAIC;IAClB,OAAO;QACL,MAAKC,GAAG,EAAEC,UAAU;YAClB,IAAI,CAACD,OAAOA,AAAe,OAAfA,IAAI,IAAI,MAAa,CAAEC,CAAAA,aAAa,IAAI;YACpDH,MAAM,GAAG,CAACE,KAAKC;QACjB;QACA,QAAOD,GAAG;YACR,MAAME,QAAQJ,MAAM,GAAG,CAACE;YACxB,IAAIE,AAAUC,WAAVD,OAAqB,OAAOA;YAChC,MAAME,QAAQJ,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{"version":3,"file":"sheet/loadable.jsx","sources":["../../src/sheet/loadable.tsx"],"sourcesContent":["import { createAbortController } from '@g9tm/lynxcontrols-foundation';\nimport { type ReactNode, useEffect, useRef, useState } from '@lynx-js/react';\nimport { G9ActivityIndicator } from '../display/activity-indicator';\nimport { type G9BottomSheetLoadingSkeleton, G9SheetSkeleton } from '../display/shimmer';\nimport { useG9Diagnostics } from '../provider/hooks';\nimport { useG9SheetContext } from './frame';\n\n/** Props of {@link G9LoadableSheetContent} (MAUI `LoadableSheetContentView<TData>`). */\nexport interface G9LoadableSheetContentProps<TData> {\n /** Loads the data once per open, after the open motion (open-then-fill); `signal` aborts on close. */\n readonly load: (signal: import('@g9tm/lynxcontrols-foundation').G9AbortSignal) => Promise<TData | null | undefined>;\n /** Renders the loaded data (MAUI `ApplyLoadedData`). Never called after the sheet closed. */\n readonly children: (data: TData) => ReactNode;\n /** The loader returned nothing (MAUI `OnLoadReturnedNull`). Default: nothing rendered. */\n readonly renderEmpty?: () => ReactNode;\n /** The loader threw (MAUI `OnLoadFailed`); the error is also logged. */\n readonly onLoadFailed?: (error: unknown) => void;\n /** What a failure shows. Default nothing. */\n readonly renderError?: (error: unknown) => ReactNode;\n /** Height of the loading state (fills the seeded height). Default 180. */\n readonly loadingHeight?: number;\n /** Skeleton instead of the spinner. Default `'none'`. */\n readonly skeleton?: G9BottomSheetLoadingSkeleton;\n /**\n * Load while the sheet is still staged (MAUI `LoadWhileStaged`): start at once instead of after the open motion.\n * For on-device data only. Default false.\n */\n readonly loadWhileStaged?: boolean;\n /** Fade the body in over 140 ms once loaded (MAUI `RevealLoadedContentAsync`). Default true. */\n readonly reveal?: boolean;\n /** Told when loading starts/ends (MAUI `IsLoading`). */\n readonly onLoadingChange?: (loading: boolean) => void;\n}\n\ntype LoadState<T> = { s: 'loading' } | { s: 'loaded'; data: T } | { s: 'empty' } | { s: 'failed'; error: unknown };\n\n/**\n * Open-then-fill sheet body (MAUI `LoadableSheetContentView`): shows a loading state that fills the sheet's seeded\n * height, loads once after the open motion (or at once with `loadWhileStaged`), cancels on close, and never applies\n * results after the sheet closed. Outside a sheet it loads on mount.\n */\nexport function G9LoadableSheetContent<TData>(props: G9LoadableSheetContentProps<TData>): ReactNode {\n const sheet = useG9SheetContext();\n const diagnostics = useG9Diagnostics();\n const [state, setState] = useState<LoadState<TData>>({ s: 'loading' });\n const started = useRef(false);\n const latest = useRef(props);\n latest.current = props;\n const ready = !sheet || sheet.opened || props.loadWhileStaged === true;\n useEffect(() => {\n if (started.current || !ready) return;\n started.current = true;\n const signal = sheet?.signal;\n latest.current.onLoadingChange?.(true);\n latest.current.load(signal ?? createAbortController().signal).then(\n (data) => {\n if (signal?.aborted) return;\n setState(data === null || data === undefined ? { s: 'empty' } : { s: 'loaded', data });\n latest.current.onLoadingChange?.(false);\n },\n (error) => {\n if (signal?.aborted) return;\n diagnostics.log({\n level: 'error',\n message: 'Sheet content failed to load.',\n source: 'G9LoadableSheetContent',\n error,\n });\n latest.current.onLoadFailed?.(error);\n setState({ s: 'failed', error });\n latest.current.onLoadingChange?.(false);\n },\n );\n }, [ready]);\n if (state.s === 'loaded') {\n return <view className={props.reveal === false ? '' : 'g9-sheet-reveal'}>{props.children(state.data)}</view>;\n }\n if (state.s === 'empty') return props.renderEmpty?.() ?? null;\n if (state.s === 'failed') return props.renderError?.(state.error) ?? null;\n return (\n <view className=\"g9-sheet-loading\" style={{ height: `${props.loadingHeight ?? 180}px` }}>\n {props.skeleton && props.skeleton !== 'none' ? (\n <G9SheetSkeleton skeleton={props.skeleton} />\n ) : (\n <G9ActivityIndicator running size={32} />\n )}\n </view>\n );\n}\n"],"names":["G9LoadableSheetContent","props","_props_loadingHeight","sheet","useG9SheetContext","diagnostics","useG9Diagnostics","state","setState","useState","started","useRef","latest","ready","useEffect","_latest_current","signal","createAbortController","data","error","_latest_current1","view","G9SheetSkeleton","G9ActivityIndicator"],"mappings":";;;;;;AAyCO,SAASA,uBAA8BC,KAAyC;qBAuC5BC;QAH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AA,CAAAA,iBAA8BI;YAC9BX,SAAS;gBAAE,GAAG;gBAAUW;YAAM;oBAC9BC,CAAAA,kCAAAA,AAAAA,CAAAA,mBAAAA,OAAO,OAAO,AAAD,EAAE,eAAe,AAAD,KAA7BA,gCAAAA,IAAAA,CAAAA,kBAAiC;QACnC;IAEJ,GAAG;QAACP;KAAM;IACV,IAAIN,AAAY,aAAZA,MAAM,CAAC,EACT,QAAQc,KAAK,WAAWpB,AAAiB,UAAjBA,MAAM,MAAM,GAAa,KAAK,oBAAoBA,MAAM,QAAQ,CAACM,MAAM,IAAI,IAAIc;IAEzG,IAAId,AAAY,YAAZA,MAAM,CAAC,EAAc,OAAO,QAAP,gBAAON,CAAAA,qBAAAA,MAAM,WAAW,AAAD,IAAhBA,KAAAA,IAAAA,mBAAAA,IAAAA,CAAAA,MAAK,IAALA,OAAyB;IACzD,IAAIM,AAAY,aAAZA,MAAM,CAAC,EAAe,OAAO,QAAP,iBAAON,CAAAA,qBAAAA,MAAM,WAAW,AAAD,IAAhBA,KAAAA,IAAAA,mBAAAA,IAAAA,CAAAA,OAAoBM,MAAM,KAAK,aAAK;IACrE,QACGc,KAAK,UAAU,mBAAmB,OAAO;QAAE,QAAQ,GAAG,QAAAnB,CAAAA,uBAAAA,MAAM,aAAa,AAAD,IAAlBA,uBAAuB,IAAI,EAAE,CAAC;IAAC,GAAG;MACvF,CAACD,MAAM,QAAQ,IAAIA,AAAmB,WAAnBA,MAAM,QAAQ,IAC9BqB,gBAAgB,UAAUrB,MAAM,QAAQ,OAExCsB,oBAAoB,QAAQ,MAAM,MACnC;IACJ,EAAEF;AAEN"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sheet/motion.jsx","sources":["../../src/sheet/motion.ts"],"sourcesContent":["// How a G9 sheet moves on lynx-ui: the open, close and snap configs handed to lynx-ui `SheetContent`.\n//\n// MAUI `G9SheetMotionModel` (G9MAUIControls 1.4.0, BottomSheet/G9SheetView/G9SheetMotionModel.cs) is the reference:\n// • platformNative on Android (and Windows): Material's settle, androidx ViewDragHelper — a quintic ease-out\n// `(t − 1)^5 + 1` lasting `(distance / range + 1) × 256 ms`, at most 600 ms (256 ms for a nudge, 512 ms for the\n// whole screen; 90 % of the way is covered in the first 37 % of the time);\n// • platformNative on iOS / macOS: UIKit's default transition spring as Core Animation runs it, critically damped,\n// ω₀ = √(1000 / 3) — mass 1, stiffness ω₀², damping 2ω₀ for lynx-ui's spring;\n// • timed: the configured duration (size-scaled when enabled) on a cubic ease-out.\n// Before this module the port gave platformNative lynx-ui's default spring (stiffness 200, damping 60, mass 1): an\n// over-damped spring (ζ ≈ 2.1) that takes ~1.3 s to come to rest, a sluggish tail no AgriPad user had seen.\n//\n// lynx-ui runs the curve inside a main-thread worklet, so the curve must be a `'main thread'` function: a plain\n// background function cannot be called there (plan/specs/02 §3). Each\n// curve is a twin: `x` (background, tests, durations) and `xMT` (the worklet), asserted equal.\n\nimport { g9MotionScale, g9Ms } from '@g9tm/lynxcontrols-foundation';\nimport type { currentPlatform } from './sizing';\n\n/** ViewDragHelper `BASE_SETTLE_DURATION` (ms). */\nexport const g9MaterialBaseSettleMs = 256;\n/** ViewDragHelper `MAX_SETTLE_DURATION` (ms). */\nexport const g9MaterialMaxSettleMs = 600;\n/** UIKit's default transition spring, critically damped as Core Animation runs it: ω₀ = √(1000 / 3) rad/s. */\nexport const g9CupertinoOmega = Math.sqrt(1000 / 3);\n\n/** Material settle duration (ms) for a programmatic move over `distanceRatio` of the host height. */\nexport function materialSettleDurationMs(distanceRatio: number): number {\n const ratio = Number.isFinite(distanceRatio) ? Math.min(1, Math.max(0, distanceRatio)) : 1;\n return Math.min(g9MaterialMaxSettleMs, Math.round((ratio + 1) * g9MaterialBaseSettleMs));\n}\n\n/** ViewDragHelper's `sInterpolator`: `(t − 1)^5 + 1`. */\nexport function materialSettle(t: number): number {\n const u = t - 1;\n return u * u * u * u * u + 1;\n}\n\n/** Main-thread twin of {@link materialSettle} (the curve lynx-ui calls every frame). */\nexport function materialSettleMT(t: number): number {\n 'main thread';\n const u = t - 1;\n return u * u * u * u * u + 1;\n}\n\n/** The timed style's curve (MAUI `Easing.CubicOut`). */\nexport function easeOutCubic(t: number): number {\n const u = 1 - t;\n return 1 - u * u * u;\n}\n\n/** Main-thread twin of {@link easeOutCubic}. */\nexport function easeOutCubicMT(t: number): number {\n 'main thread';\n const u = 1 - t;\n return 1 - u * u * u;\n}\n\n/** A lynx-ui sheet transition. */\nexport type G9SheetTransition =\n | {\n readonly type: 'tween' /** milliseconds (lynx-ui's unit) */;\n readonly duration: number;\n readonly ease: (t: number) => number;\n }\n | { readonly type: 'spring'; readonly stiffness: number; readonly damping: number; readonly mass: number };\n\n/** The lynx-ui motion of one sheet: `SheetContent`'s `enterAnimation`, `exitAnimation`, `snapAnimation`. */\nexport interface G9SheetMotion {\n readonly enterAnimation: G9SheetTransition;\n readonly exitAnimation: G9SheetTransition;\n readonly snapAnimation: G9SheetTransition;\n}\n\n/** What {@link resolveSheetMotion} needs; ratios are shares of the host height (0–1). */\nexport interface G9SheetMotionInput {\n readonly style: 'platformNative' | 'cupertino' | 'timed';\n readonly platform: ReturnType<typeof currentPlatform>;\n /** Share of the host the sheet covers where it opens and from where it closes. */\n readonly openRatio: number;\n /** Share of the host between the smallest and the largest detent (snap travel). */\n readonly snapRatio: number;\n /** Settings or per-sheet open duration (ms); used by `timed`, and by `platformNative` when `perSheetOpen`. */\n readonly openMs: number;\n readonly closeMs: number;\n /** A per-sheet `openAnimationDurationMs` / `closeAnimationDurationMs` was set: it sets the time, the curve stays. */\n readonly perSheetOpen: boolean;\n readonly perSheetClose: boolean;\n /** `timed` only: partial travel takes the matching slice of the duration (`sizeScaledAnimationDuration`). */\n readonly sizeScaled: boolean;\n}\n\n// lynx-ui-sheet takes a tween's duration in MILLISECONDS (useSnap: `animate(…, { duration: (duration ?? 400) / 1000 })`).\n// This used to convert to seconds first, so a 199 ms open ran for 0.2 ms: every sheet jumped into place, no motion.\nconst tween = (ms: number, ease: (t: number) => number): G9SheetTransition => ({\n type: 'tween',\n duration: Math.max(0, ms),\n ease,\n});\n\nconst scaled = (ms: number, ratio: number, sizeScaled: boolean) =>\n ms <= 0 ? 0 : sizeScaled ? Math.max(1, Math.round(ms * Math.min(1, Math.max(0, ratio)))) : ms;\n\n/**\n * The lynx-ui motion for a sheet (MAUI `ResolveSheetMotion`). `platformNative`: Material settle tweens on Android,\n * Windows and unknown hosts (durations from the travel), the critically damped UIKit spring on iOS and macOS; a\n * per-sheet duration replaces the time for its direction and keeps the platform curve (a quintic tween). `timed`: the\n * configured durations on a cubic ease-out, size-scaled when enabled; snapping keeps the full open duration.\n */\nexport function resolveSheetMotion(input: G9SheetMotionInput): G9SheetMotion {\n const designed = resolveDesignedSheetMotion(input);\n // The motion scale (foundation g9Ms): a tween's time scales; at 0 a spring becomes an instant tween too.\n if (g9MotionScale() === 1) return designed;\n const at = (t: G9SheetTransition): G9SheetTransition =>\n t.type === 'tween' ? { ...t, duration: g9Ms(t.duration) } : g9MotionScale() === 0 ? tween(0, materialSettleMT) : t;\n return {\n enterAnimation: at(designed.enterAnimation),\n exitAnimation: at(designed.exitAnimation),\n snapAnimation: at(designed.snapAnimation),\n };\n}\n\nfunction resolveDesignedSheetMotion(input: G9SheetMotionInput): G9SheetMotion {\n if (input.style === 'timed') {\n return {\n enterAnimation: tween(scaled(input.openMs, input.openRatio, input.sizeScaled), easeOutCubicMT),\n exitAnimation: tween(scaled(input.closeMs, input.openRatio, input.sizeScaled), easeOutCubicMT),\n snapAnimation: tween(input.openMs, easeOutCubicMT),\n };\n }\n if (input.style === 'cupertino' || input.platform === 'ios' || input.platform === 'macos') {\n const spring: G9SheetTransition = {\n type: 'spring',\n stiffness: g9CupertinoOmega * g9CupertinoOmega,\n damping: 2 * g9CupertinoOmega,\n mass: 1,\n };\n return {\n enterAnimation: input.perSheetOpen ? tween(input.openMs, materialSettleMT) : spring,\n exitAnimation: input.perSheetClose ? tween(input.closeMs, materialSettleMT) : spring,\n snapAnimation: spring,\n };\n }\n return {\n enterAnimation: tween(\n input.perSheetOpen ? input.openMs : materialSettleDurationMs(input.openRatio),\n materialSettleMT,\n ),\n exitAnimation: tween(\n input.perSheetClose ? input.closeMs : materialSettleDurationMs(input.openRatio),\n materialSettleMT,\n ),\n snapAnimation: tween(materialSettleDurationMs(input.snapRatio), materialSettleMT),\n };\n}\n"],"names":["g9MaterialBaseSettleMs","g9MaterialMaxSettleMs","g9CupertinoOmega","Math","materialSettleDurationMs","distanceRatio","ratio","Number","materialSettle","t","u","materialSettleMT","easeOutCubic","easeOutCubicMT","tween","ms","ease","scaled","sizeScaled","resolveSheetMotion","input","designed","resolveDesignedSheetMotion","g9MotionScale","at","g9Ms","spring"],"mappings":";AAoBO,MAAMA,yBAAyB;AAE/B,MAAMC,wBAAwB;AAE9B,MAAMC,mBAAmBC,KAAK,IAAI,CAAC,OAAO;AAG1C,SAASC,yBAAyBC,aAAqB;IAC5D,MAAMC,QAAQC,OAAO,QAAQ,CAACF,iBAAiBF,KAAK,GAAG,CAAC,GAAGA,KAAK,GAAG,CAAC,GAAGE,kBAAkB;IACzF,OAAOF,KAAK,GAAG,CAACF,uBAAuBE,KAAK,KAAK,CAAEG,AAAAA,CAAAA,QAAQ,KAAKN;AAClE;AAGO,SAASQ,eAAeC,CAAS;IACtC,MAAMC,IAAID,IAAI;IACd,OAAOC,IAAIA,IAAIA,IAAIA,IAAIA,IAAI;AAC7B;AAGO,SAASC,iBAAiBF,CAAS;IACxC;IACA,MAAMC,IAAID,IAAI;IACd,OAAOC,IAAIA,IAAIA,IAAIA,IAAIA,IAAI;AAC7B;AAGO,SAASE,aAAaH,CAAS;IACpC,MAAMC,IAAI,IAAID;IACd,OAAO,IAAIC,IAAIA,IAAIA;AACrB;AAGO,SAASG,eAAeJ,CAAS;IACtC;IACA,MAAMC,IAAI,IAAID;IACd,OAAO,IAAIC,IAAIA,IAAIA;AACrB;AAsCA,MAAMI,QAAQ,CAACC,IAAY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AAM,MAAM,EAAET,oBAAoBe;YAC7E,eAAeN,MAAM,aAAa,GAAGN,MAAMM,MAAM,OAAO,EAAET,oBAAoBe;YAC9E,eAAeA;QACjB;IACF;IACA,OAAO;QACL,gBAAgBZ,MACdM,MAAM,YAAY,GAAGA,MAAM,MAAM,GAAGhB,yBAAyBgB,MAAM,SAAS,GAC5ET;QAEF,eAAeG,MACbM,MAAM,aAAa,GAAGA,MAAM,OAAO,GAAGhB,yBAAyBgB,MAAM,SAAS,GAC9ET;QAEF,eAAeG,MAAMV,yBAAyBgB,MAAM,SAAS,GAAGT;IAClE;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
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 /**\n * `'platformNative'` (Material's settle on Android, UIKit's spring on iOS), `'cupertino'` (UIKit's spring on EVERY\n * platform — an app that wants its sheets to move like iOS everywhere; since 1.7.0) or `'timed'` (a tween over the\n * durations). Default platformNative.\n */\n readonly motionStyle?: 'platformNative' | 'cupertino' | '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":"AA6SA,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,CAAC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C9B,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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sheet/processing.jsx","sources":["../../src/sheet/processing.tsx"],"sourcesContent":["import { G9StringKey } from '@g9tm/lynxcontrols-foundation';\nimport { type ReactNode, useEffect, useRef, useState } from '@lynx-js/react';\nimport { G9ActivityIndicator } from '../display/activity-indicator';\nimport { useG9Executor, useG9Strings } from '../provider/hooks';\nimport { useG9SheetContext } from './frame';\nimport type { G9SheetHandle } from './stack';\n\n/** Builds the body of a processing sheet: the node, or `null` to close quietly. Called once, after opening. */\nexport type G9ProcessingBuild = (\n handle: G9SheetHandle,\n signal: import('@g9tm/lynxcontrols-foundation').G9AbortSignal,\n) => Promise<ReactNode | null> | ReactNode | null;\n/** Handles a build failure (the sheet stays open unless it closes it). */\nexport type G9ProcessingErrorHandler = (error: unknown, handle: G9SheetHandle) => unknown;\n\n/** Props of {@link G9ProcessingSheetContent}. */\nexport interface G9ProcessingSheetContentProps {\n readonly build: G9ProcessingBuild;\n readonly onError?: G9ProcessingErrorHandler;\n /** Spinner box height. Default 160. */\n readonly loadingHeight?: number;\n /** The sheet handle (for content created before the handle existed). Default the enclosing sheet's. */\n readonly handle?: () => G9SheetHandle | null;\n}\n\n/**\n * The body of a processing sheet (MAUI `ProcessingSheetContentView`): a 42 px spinner in a `loadingHeight` box, then\n * the built body swapped in at once. A failure is always logged (no popup); then `onError` runs, or the error popup\n * shows and the sheet closes. `null` closes the sheet quietly. A close cancels the build (`signal`).\n */\nexport function G9ProcessingSheetContent(props: G9ProcessingSheetContentProps): ReactNode {\n const sheet = useG9SheetContext();\n const executor = useG9Executor();\n const strings = useG9Strings();\n const [built, setBuilt] = useState<{ node: ReactNode } | null>(null);\n const started = useRef(false);\n const latest = useRef(props);\n latest.current = props;\n useEffect(() => {\n if (started.current || !sheet) return;\n started.current = true;\n const handle = props.handle?.() ?? sheet.handle;\n const signal = sheet.signal;\n const run = async () => {\n try {\n const node = await latest.current.build(handle, signal);\n if (signal.aborted) return;\n if (node === null || node === undefined) {\n handle.close();\n return;\n }\n setBuilt({ node });\n } catch (error) {\n if (signal.aborted) return;\n await executor.run(\n () => {\n throw error;\n },\n {\n source: 'G9ProcessingSheet',\n showErrorPopup: false,\n enableThrottle: false,\n preventConcurrentExecution: false,\n },\n );\n const onError = latest.current.onError;\n if (onError) {\n try {\n await onError(error, handle);\n } catch {\n // A failing error handler must not take the sheet down.\n }\n return;\n }\n await executor.showOperationError(strings.get(G9StringKey.UnexpectedError), {\n title: strings.get(G9StringKey.Error),\n });\n handle.close();\n }\n };\n void run();\n }, [sheet]);\n if (built) return <view className=\"g9-processing-sheet\">{built.node}</view>;\n return (\n <view className=\"g9-processing-sheet__loading\" style={{ height: `${props.loadingHeight ?? 160}px` }}>\n <G9ActivityIndicator running size={42} />\n </view>\n );\n}\n"],"names":["G9ProcessingSheetContent","props","_props_loadingHeight","sheet","useG9SheetContext","executor","useG9Executor","strings","useG9Strings","built","setBuilt","useState","started","useRef","latest","useEffect","handle","signal","run","node","error","onError","G9StringKey","view","G9ActivityIndicator"],"mappings":";;;;;AA8BO,SAASA,yBAAyBC,KAAoC;QAsDNC;IArDrE,MAAMC,QAAQC;IACd,MAAMC,WAAWC;IACjB,MAAMC,UAAUC;IAChB,MAAM,CAACC,OAAOC,SAAS,GAAGC,SAAqC;IAC/D,MAAMC,UAAUC,OAAO;IACvB,MAAMC,SAASD,OAAOZ;IACtBa,OAAO,OAAO,GAAGb;IACjBc,UAAU;;YAGOd;QAFf,IAAIW,QAAQ,OAAO,IAAI,CAACT,OAAO;QAC/BS,QAAQ,OAAO,GAAG;QAClB,MAAMI,SAAS,QAATA,CAAAA,OAAAA,QAASf,CAAAA,gBAAAA,MAAM,MAAM,AAAD,IAAXA,KAAAA,IAAAA,cAAAA,IAAAA,CAAAA,MAAK,IAALA,OAAoBE,MAAM,MAAM;QAC/C,MAAMc,SAASd,MAAM,MAAM;QAC3B,MAAMe,MAAM;YACV,IAAI;gBACF,MAAMC,OAAO,MAAML,OAAO,OAAO,CAAC,KAAK,CAACE,QAAQC;gBAChD,IAAIA,OAAO,OAAO,EAAE;gBACpB,IAAIE,QAAAA,MAAqC,YACvCH,OAAO,KAAK;gBAGdN,SAAS;oBAAES;gBAAK;YAClB,EAAE,OAAOC,OAAO;gBACd,IAAIH,OAAO,OAAO,EAAE;gBACpB,MAAMZ,SAAS,GAAG,CAChB;oBACE,MAAMe;gBACR,GACA;oBACE,QAAQ;oBACR,gBAAgB;oBAChB,gBAAgB;oBAChB,4BAA4B;gBAC9B;gBAEF,MAAMC,UAAUP,OAAO,OAAO,CAAC,OAAO;gBACtC,IAAIO,SAAS;oBACX,IAAI;wBACF,MAAMA,QAAQD,OAAOJ;oBACvB,EAAE,OAAM,CAER;oBACA;gBACF;gBACA,MAAMX,SAAS,kBAAkB,CAACE,QAAQ,GAAG,CAACe,YAAY,eAAe,GAAG;oBAC1E,OAAOf,QAAQ,GAAG,CAACe,YAAY,KAAK;gBACtC;gBACAN,OAAO,KAAK;YACd;QACF;QACKE;IACP,GAAG;QAACf;KAAM;IACV,IAAIM,OAAO,QAAQc,KAAK,UAAU,uBAAuBd,MAAM,IAAI,GAAGc;IACtE,QACGA,KAAK,UAAU,+BAA+B,OAAO;QAAE,QAAQ,GAAG,QAAArB,CAAAA,uBAAAA,MAAM,aAAa,AAAD,IAAlBA,uBAAuB,IAAI,EAAE,CAAC;IAAC,GAAG;MACnG,CAACsB,oBAAoB,QAAQ,MAAM,KAAM;IAC3C,EAAED;AAEN"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sheet/scroll-indicator.jsx","sources":["../../src/sheet/scroll-indicator.tsx"],"sourcesContent":["// The sheet body's always-visible scroll indicator (`scrollIndicator: 'always'`). A sheet menu of full-width cards whose\n// last card is cut off does not say «more below»; the platform's own bar (Lynx `scroll-bar-enable`) only shows while a\n// finger scrolls and then fades. This thumb is drawn in the body's side inset, never over the content, only while the\n// content is taller than the body, and moves with the scroll. Its own small store: a scroll event repaints the thumb,\n// never the sheet.\nimport { type ReactNode, useSyncExternalStore } from '@lynx-js/react';\nimport { useG9Direction } from '../provider/hooks';\n\n/** The thumb's smallest length (dp), so a very long content still has something to see. */\nexport const SHEET_THUMB_MIN = 24;\n/** The thumb's width and its gap to the body's edge (dp). */\nexport const SHEET_THUMB_WIDTH = 3;\nexport const SHEET_THUMB_INSET = 3;\n\n/** Where the thumb is: its length and its offset from the body's top (dp), or null when nothing overflows. */\nexport function sheetThumb(\n viewport: number,\n content: number,\n scrollTop: number,\n): { readonly length: number; readonly offset: number } | null {\n if (!(viewport > 0) || !(content > viewport + 1)) return null;\n const length = Math.min(viewport, Math.max(SHEET_THUMB_MIN, (viewport * viewport) / content));\n const travel = content - viewport;\n const share = Math.min(1, Math.max(0, scrollTop / travel));\n return { length, offset: (viewport - length) * share };\n}\n\ninterface IndicatorState {\n readonly viewport: number;\n readonly content: number;\n readonly top: number;\n}\n\n/** What the frame feeds (the body's height, the content's height, the scroll offset) and the thumb reads. */\nexport class G9SheetScrollModel {\n private state: IndicatorState = { viewport: 0, content: 0, top: 0 };\n private readonly listeners = new Set<() => void>();\n\n readonly get = (): IndicatorState => this.state;\n\n readonly subscribe = (listener: () => void): (() => void) => {\n this.listeners.add(listener);\n return () => this.listeners.delete(listener);\n };\n\n setViewport(height: number): void {\n this.update({ viewport: height });\n }\n\n setContent(height: number): void {\n this.update({ content: height });\n }\n\n setTop(top: number): void {\n this.update({ top });\n }\n\n private update(patch: Partial<IndicatorState>): void {\n const next = { ...this.state, ...patch };\n if (next.viewport === this.state.viewport && next.content === this.state.content && next.top === this.state.top)\n return;\n this.state = next;\n for (const l of this.listeners) l();\n }\n}\n\n/** The thumb at the body's inline END (left in a right-to-left sheet), in the side inset; touches pass through. */\nexport function G9SheetScrollIndicator(props: { readonly model: G9SheetScrollModel }): ReactNode {\n const rtl = useG9Direction() === 'rtl';\n const s = useSyncExternalStore(props.model.subscribe, props.model.get, props.model.get);\n const thumb = sheetThumb(s.viewport, s.content, s.top);\n if (!thumb) return null;\n return (\n <view\n className=\"g9-sheet__scroll-thumb\"\n style={{\n top: `${thumb.offset}px`,\n height: `${thumb.length}px`,\n width: `${SHEET_THUMB_WIDTH}px`,\n borderRadius: `${SHEET_THUMB_WIDTH / 2}px`,\n ...(rtl ? { left: `${SHEET_THUMB_INSET}px` } : { right: `${SHEET_THUMB_INSET}px` }),\n }}\n />\n );\n}\n"],"names":["SHEET_THUMB_MIN","SHEET_THUMB_WIDTH","SHEET_THUMB_INSET","sheetThumb","viewport","content","scrollTop","length","Math","travel","share","G9SheetScrollModel","height","top","patch","next","l","Set","listener","G9SheetScrollIndicator","props","rtl","useG9Direction","s","useSyncExternalStore","thumb","view"],"mappings":";;;;;;;;;;;;AASO,MAAMA,kBAAkB;AAExB,MAAMC,oBAAoB;AAC1B,MAAMC,oBAAoB;AAG1B,SAASC,WACdC,QAAgB,EAChBC,OAAe,EACfC,SAAiB;IAEjB,IAAI,CAAEF,CAAAA,WAAW,MAAM,CAAEC,CAAAA,UAAUD,WAAW,IAAI,OAAO;IACzD,MAAMG,SAASC,KAAK,GAAG,CAACJ,UAAUI,KAAK,GAAG,CAACR,iBAAkBI,WAAWA,WAAYC;IACpF,MAAMI,SAASJ,UAAUD;IACzB,MAAMM,QAAQF,KAAK,GAAG,CAAC,GAAGA,KAAK,GAAG,CAAC,GAAGF,YAAYG;IAClD,OAAO;QAAEF;QAAQ,QAASH,AAAAA,CAAAA,WAAWG,MAAK,IAAKG;IAAM;AACvD;AASO,MAAMC;IAWX,YAAYC,MAAc,EAAQ;QAChC,IAAI,CAAC,MAAM,CAAC;YAAE,UAAUA;QAAO;IACjC;IAEA,WAAWA,MAAc,EAAQ;QAC/B,IAAI,CAAC,MAAM,CAAC;YAAE,SAASA;QAAO;IAChC;IAEA,OAAOC,GAAW,EAAQ;QACxB,IAAI,CAAC,MAAM,CAAC;YAAEA;QAAI;IACpB;IAEQ,OAAOC,KAA8B,EAAQ;QACnD,MAAMC,OAAO;YAAE,GAAG,IAAI,CAAC,KAAK;YAAE,GAAGD,KAAK;QAAC;QACvC,IAAIC,KAAK,QAAQ,KAAK,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAIA,KAAK,OAAO,KAAK,IAAI,CAAC,KAAK,CAAC,OAAO,IAAIA,KAAK,GAAG,KAAK,IAAI,CAAC,KAAK,CAAC,GAAG,EAC7G;QACF,IAAI,CAAC,KAAK,GAAGA;QACb,KAAK,MAAMC,KAAK,IAAI,CAAC,SAAS,CAAEA;IAClC;;QA5BA,uBAAQ,SAAwB;YAAE,UAAU;YAAG,SAAS;YAAG,KAAK;QAAE;QAClE,uBAAiB,aAAY,IAAIC;QAEjC,uBAAS,OAAM,IAAsB,IAAI,CAAC,KAAK;QAE/C,uBAAS,aAAY,CAACC;YACpB,IAAI,CAAC,SAAS,CAAC,GAAG,CAACA;YACnB,OAAO,IAAM,IAAI,CAAC,SAAS,CAAC,MAAM,CAACA;QACrC;;AAqBF;AAGO,SAASC,uBAAuBC,KAA6C;IAClF,MAAMC,MAAMC,AAAqB,UAArBA;IACZ,MAAMC,IAAIC,qBAAqBJ,MAAM,KAAK,CAAC,SAAS,EAAEA,MAAM,KAAK,CAAC,GAAG,EAAEA,MAAM,KAAK,CAAC,GAAG;IACtF,MAAMK,QAAQtB,WAAWoB,EAAE,QAAQ,EAAEA,EAAE,OAAO,EAAEA,EAAE,GAAG;IACrD,IAAI,CAACE,OAAO,OAAO;IACnB,QACGC,KACC,UAAU,yBACV,OAAO;QACL,KAAK,GAAGD,MAAM,MAAM,CAAC,EAAE,CAAC;QACxB,QAAQ,GAAGA,MAAM,MAAM,CAAC,EAAE,CAAC;QAC3B,OAAO,GAAGxB,kBAAkB,EAAE,CAAC;QAC/B,cAAc,GAAGA,oBAAoB,EAAE,EAAE,CAAC;QAC1C,GAAIoB,MAAM;YAAE,MAAM,GAAGnB,kBAAkB,EAAE,CAAC;QAAC,IAAI;YAAE,OAAO,GAAGA,kBAAkB,EAAE,CAAC;QAAC,CAAC;IACpF;AAGN"}
|
|
@@ -1 +0,0 @@
|
|
|
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,IA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QAAQ,OAAO;AACvC"}
|
package/dist/sheet/sheet.jsx.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sheet/sheet.jsx","sources":["../../src/sheet/sheet.tsx"],"sourcesContent":["import { type ReactNode, useEffect, useRef } from '@lynx-js/react';\nimport type { G9SheetOptions } from './options';\nimport { useG9Sheets } from './service';\nimport type { G9SheetCloseReason, G9SheetHandle } from './stack';\n\n/** Props of {@link G9Sheet}. */\nexport interface G9SheetProps {\n /** Controlled visibility. */\n readonly open: boolean;\n /** Told `false` once with the reason when the sheet closes by itself (back, overlay tap, drag, toolbar). */\n readonly onOpenChange?: (open: boolean, reason: G9SheetCloseReason) => void;\n readonly options?: G9SheetOptions;\n readonly children?: ReactNode;\n}\n\n/**\n * Declarative sheet (the `G9Sheet` adapter): mounts the children as a sheet of the nearest host while `open`, keeps\n * them live (re-renders update the sheet in place), and reports closes the sheet made itself through\n * `onOpenChange(false, reason)`. Use `useG9Sheets()` for the imperative MAUI API.\n */\nexport function G9Sheet(props: G9SheetProps): ReactNode {\n const sheets = useG9Sheets();\n const handle = useRef<G9SheetHandle | null>(null);\n const latest = useRef(props);\n latest.current = props;\n useEffect(() => {\n if (props.open && !handle.current) {\n const h = sheets.stack.show(props.children ?? null, props.options ?? {}, false);\n handle.current = h;\n void h?.result.then((result) => {\n if (handle.current !== h) return;\n handle.current = null;\n if (result.reason !== 'closed' && result.reason !== 'unmount')\n latest.current.onOpenChange?.(false, result.reason);\n });\n } else if (!props.open && handle.current) {\n const h = handle.current;\n handle.current = null;\n h.close();\n }\n }, [props.open]);\n useEffect(() => {\n if (handle.current) sheets.stack.update(handle.current.id, props.children ?? null, props.options);\n });\n useEffect(\n () => () => {\n handle.current?.close();\n handle.current = null;\n },\n [],\n );\n return null;\n}\n"],"names":["G9Sheet","props","sheets","useG9Sheets","handle","useRef","latest","useEffect","_props_children","_props_options","h","result","_latest_current","_handle_current"],"mappings":";;AAoBO,SAASA,QAAQC,KAAmB;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BT,OAAO,OAAO,GAAG;QACnB,GACA,EAAE;IAEJ,OAAO;AACT"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sheet/sizing.jsx","sources":["../../src/sheet/sizing.ts"],"sourcesContent":["import type { G9SheetDetent, G9SheetOptions } from './options';\n\n// Pure sizing rules of the G9 sheet (MAUI G9SheetView + G9BottomSheetHelper sizing; guide 650–980, ADR-0019/0026).\n\n/** MAUI `G9SheetView.MinimizedHeight`: default peek height. */\nexport const g9SheetDefaultPeekHeight = 100;\n/** Absolute minimum of an authoritative fit height (MAUI helper :81). */\nexport const g9SheetFitMinHeight = 80;\n/** Default `scrollToEndThreshold`: four 52 px rows from the end (MAUI 1.4.8 selection sheet, `OnItemsScrolled`). */\nexport const g9SheetScrollToEndThreshold = 208;\n/** Floor while the height is unknown (loading window). */\nexport const g9SheetFitLoadingMinHeight = 180;\n/** Finger travel at release that requests a close (MAUI `DragCloseThreshold`). */\nexport const g9SheetDragCloseThreshold = 72;\n/**\n * Gap between the top safe-area inset and a full-screen sheet's header. MAUI reserves the inset alone\n * (`ResolveFullScreenSheetTopPadding`), but its Android inset is the status-bar band, a few dp below the cutout an\n * immersive Lynx host reports: measured side by side on a Pixel 9 Pro XL (2026-10-10), MAUI's header sat 3 dp lower.\n * (It was 8, which put every full-screen header 5 dp below MAUI's.)\n */\nexport const g9SheetTopSafeAreaBaseGap = 3;\n\nconst clamp = (v: number, lo: number, hi: number) => Math.min(hi, Math.max(lo, v));\n\n/** The platform the app runs on (Lynx `SystemInfo.platform`), lower-cased; `'unknown'` outside Lynx. */\nexport function currentPlatform(): 'android' | 'ios' | 'windows' | 'macos' | 'unknown' {\n const info = (globalThis as { SystemInfo?: { platform?: string } }).SystemInfo;\n const p = (info?.platform ?? '').toLowerCase();\n if (p === 'android') return 'android';\n if (p === 'ios') return 'ios';\n if (p.startsWith('win')) return 'windows';\n if (p === 'macos' || p === 'mac' || p === 'osx') return 'macos';\n return 'unknown';\n}\n\n/** What the adapter passes to lynx-ui `SheetRoot` and how the frame behaves. */\nexport interface G9SheetLayout {\n /** lynx-ui snap points, small to large: pixels, `'NN%'` of the host, or `'fit'`. */\n readonly snapPoints: Array<number | string>;\n readonly initialSnap: number;\n /** One detent, or fit-to-content (MAUI \"fixed\"): no detent to move between (a fit sheet may still be dragged to close). */\n readonly fixed: boolean;\n readonly fit: boolean;\n /** Grabber visible (`hasHandle && isDraggable && (!fixed || handleOnSingleDetent)`). */\n readonly showHandle: boolean;\n readonly dragDisabled: boolean;\n /** Drag past the lowest detent may request a close. */\n readonly enableDragToClose: boolean;\n /** Backdrop tap requests a close. */\n readonly closeOnOverlayTap: boolean;\n /** The resting body cap for a fit sheet (`maxFitToContentHeightRatio × host`), else `null`. */\n readonly fitMaxHeight: number | null;\n /** Whether the sheet's largest detent is full screen. */\n readonly fullScreen: boolean;\n /**\n * The body fills the surface, so the footer rests at the sheet's bottom edge: a full-screen sheet, or one fixed detent\n * (`states: ['large']` with `fullExpandedRatio: 0.9`) — its surface has a definite height. A sheet that can move between\n * detents or fits its content keeps a body as tall as the content.\n */\n readonly fillBody: boolean;\n}\n\nconst pct = (ratio: number) => `${Math.round(ratio * 10000) / 100}%`;\n\n/**\n * Maps G9 options to a lynx-ui layout (the agreed mapping of MAUI `ApplyOptions`): fit → `['fit']` capped at\n * `maxFitToContentHeightRatio`; states → peek pixels / half ratio / full ratio for the allowed detents, the initial\n * detent from `currentState`. The MAUI quirks (a hidden 100 dp detent under `[medium, large]`, a peek-only sheet that\n * may expand) are not carried over: the detents are exactly `states` (docs/sheets.md \"deliberate differences\").\n */\nexport function resolveSheetLayout(\n options: G9SheetOptions,\n hostHeight: number,\n platform = currentPlatform(),\n): G9SheetLayout {\n const fit = options.sizeMode === 'fitToContent';\n const draggable = options.isDraggable !== false;\n const cancelable = options.isCancelable !== false;\n const intercepted = options.onBackRequested != null;\n if (fit) {\n const ratio = clamp(options.maxFitToContentHeightRatio ?? 0.75, 0.2, 1);\n return {\n snapPoints: ['fit'],\n initialSnap: 0,\n fixed: true,\n fit: true,\n // Since 1.7.0 (AgriPad TR-0052, the owner: «standard, like iOS»): a fit sheet follows the finger and closes on a\n // drag down when it may be dragged and cancelled — its one detent is where it springs back to. It used to be fixed\n // (MAUI's «fixed» sheets), so the app's `isDraggable: true` on every fit sheet did nothing. The grabber shows when\n // asked for (`hasHandle: true`), as on iOS.\n showHandle: options.hasHandle === true && draggable,\n dragDisabled: !draggable || intercepted,\n enableDragToClose: cancelable && draggable && !intercepted,\n closeOnOverlayTap: cancelable,\n fitMaxHeight: Math.max(g9SheetFitMinHeight, Math.floor(hostHeight * ratio)),\n fullScreen: false,\n fillBody: false,\n };\n }\n const order: G9SheetDetent[] = ['peek', 'medium', 'large'];\n const requested = options.states && options.states.length > 0 ? options.states : ['medium', 'large'];\n const states = order.filter((d) => requested.includes(d));\n const androidHalf = platform === 'android' ? options.androidHalfExpandedRatio : null;\n const half = clamp(androidHalf ?? options.halfExpandedRatio ?? 0.5, 0.1, 0.9);\n const full = clamp(options.fullExpandedRatio ?? 1, 0.1, 1);\n const peek = Math.max(1, options.collapsedHeight ?? options.peekHeight ?? g9SheetDefaultPeekHeight);\n const snap = (d: G9SheetDetent): number | string =>\n d === 'peek' ? Math.min(peek, Math.max(1, hostHeight)) : d === 'medium' ? pct(half) : pct(full);\n const snapPoints = states.map(snap);\n if (options.expandedFitsContent && snapPoints.length > 0) snapPoints[snapPoints.length - 1] = 'fit';\n const current = options.currentState ?? 'medium';\n const index = states.indexOf(current);\n const fixed = states.length <= 1;\n return {\n snapPoints,\n initialSnap: index >= 0 ? index : 0,\n fixed,\n fit: false,\n showHandle: options.hasHandle !== false && draggable && (!fixed || options.handleOnSingleDetent === true),\n dragDisabled: !draggable || intercepted,\n enableDragToClose: cancelable && draggable && !intercepted,\n closeOnOverlayTap: cancelable,\n fitMaxHeight: options.expandedFitsContent\n ? Math.max(\n g9SheetFitMinHeight,\n Math.floor(hostHeight * clamp(options.maxFitToContentHeightRatio ?? 0.75, 0.2, 1)),\n )\n : null,\n // One 'large' detent sized to its content is not full screen (no status-bar padding above a short sheet).\n fullScreen: states.length === 1 && states[0] === 'large' && full >= 1 && options.expandedFitsContent !== true,\n fillBody: fixed && !options.expandedFitsContent,\n };\n}\n\n/** Clamps a measured fit body height: `[80, cap]`, or `[180, cap]` while loading (MAUI fit engine). */\nexport function clampFitHeight(natural: number, cap: number, loading: boolean): number {\n const min = loading ? g9SheetFitLoadingMinHeight : g9SheetFitMinHeight;\n if (!(natural > 0)) return Math.min(min, cap);\n return clamp(natural, Math.min(min, cap), cap);\n}\n\n/**\n * Scrim opacity for a visible ratio (MAUI helper overlay rule): between the smallest and the largest detent it runs\n * from `min` to `max`; a single detent uses `max`; below the smallest detent it fades with the ratio.\n */\nexport function sheetOverlayOpacity(\n visibleRatio: number,\n detentRatios: ReadonlyArray<number>,\n min: number,\n max: number,\n): number {\n if (detentRatios.length === 0) return max;\n const lo = Math.min(...detentRatios);\n const hi = Math.max(...detentRatios);\n if (visibleRatio < lo) return (detentRatios.length === 1 ? max : min) * clamp(visibleRatio / lo, 0, 1);\n if (hi === lo) return max;\n return min + (max - min) * clamp((visibleRatio - lo) / (hi - lo), 0, 1);\n}\n\n/** The page recede behind a tall primary sheet (MAUI backdrop card): scale 1 → 0.93, translateY 0 → 12. */\nexport function backdropCardTransform(visibleRatio: number, threshold = 0.75): { scale: number; translateY: number } {\n const raw = clamp((visibleRatio - threshold) / Math.max(1e-6, 1 - threshold), 0, 1);\n const progress = raw <= 0 ? 0 : 1 - (1 - raw) ** (1 / 3);\n return { scale: 1 - 0.07 * progress, translateY: 12 * progress };\n}\n\n/**\n * The visible share of the host a detent sheet covers: its resting height when known, else its opening detent\n * (peek = peek height, medium = half ratio, large = full ratio; `expandedFitsContent` large counts as the fit cap).\n */\nexport function sheetVisibleRatio(\n options: G9SheetOptions,\n hostHeight: number,\n restingHeightPx: number | null,\n platform = currentPlatform(),\n): number {\n const host = Math.max(1, hostHeight);\n if (restingHeightPx != null) return clamp(restingHeightPx / host, 0, 1);\n const layout = resolveSheetLayout(options, host, platform);\n const point = layout.snapPoints[layout.initialSnap];\n if (typeof point === 'number') return clamp(point / host, 0, 1);\n if (point === 'fit' || point === undefined) return (layout.fitMaxHeight ?? 0) / host;\n return clamp(Number.parseFloat(point) / 100, 0, 1);\n}\n\n/** How far a receded parent sheet sinks: `max(24, visible × 0.25)` (MAUI stack recede). */\nexport function parentRecedeOffset(visibleHeight: number): number {\n return Math.max(24, visibleHeight * 0.25);\n}\n\n/** Top padding of a full-screen sheet (MAUI safe-area rule). */\nexport function sheetTopPadding(options: G9SheetOptions, topInset: number): number {\n if (options.topSafeAreaPaddingOverride != null) return Math.max(0, options.topSafeAreaPaddingOverride);\n const inset = options.useTopSafeAreaPadding === false ? 0 : Math.max(0, topInset);\n return inset + g9SheetTopSafeAreaBaseGap + Math.max(0, options.additionalTopSafeAreaPadding ?? 0);\n}\n\n/**\n * Top padding of the sheet surface where it rests. A full-screen sheet always reserves {@link sheetTopPadding}. A\n * detent sheet resting at its `large` detent reserves it too when that detent reaches under the top inset (MAUI\n * state-aware top padding, `G9BottomSheetHelper.ApplyStateAwareTopPadding`): its content never sits under the status\n * bar or the camera cutout. Opted out like MAUI: `useTopSafeAreaPadding: false` with no additional/override padding.\n */\nexport function sheetSurfaceTopPadding(\n options: G9SheetOptions,\n layout: Pick<G9SheetLayout, 'fullScreen' | 'fit'>,\n resting: G9SheetDetent | 'fit',\n topInset: number,\n hostHeight: number,\n): number {\n if (layout.fullScreen) return sheetTopPadding(options, topInset);\n if (layout.fit || resting !== 'large') return 0;\n const opted =\n options.useTopSafeAreaPadding !== false ||\n (options.additionalTopSafeAreaPadding ?? 0) > 0 ||\n (options.topSafeAreaPaddingOverride ?? 0) > 0;\n if (!opted) return 0;\n const full = clamp(options.fullExpandedRatio ?? 1, 0.1, 1);\n const top = Math.max(0, hostHeight) * (1 - full);\n return top < Math.max(0, topInset) + g9SheetTopSafeAreaBaseGap ? sheetTopPadding(options, topInset) : 0;\n}\n\n/**\n * Bottom padding of the sheet surface: the host's bottom safe inset (a visible navigation bar or gesture handle), so\n * the last row and the footer stay above it. `useBottomSafeAreaPadding: false` lets content run under it. An\n * immersive host (system bars hidden, as the AgriPad MAUI app) reports 0 and nothing changes.\n */\nexport function sheetSurfaceBottomPadding(options: G9SheetOptions, bottomInset: number): number {\n return options.useBottomSafeAreaPadding === false ? 0 : Math.max(0, bottomInset);\n}\n\n/**\n * Size-scaled animation duration (MAUI `SizeScaledAnimationDuration`): a partial traversal takes the matching slice\n * of the full duration (at least 1 ms unless the duration is 0).\n */\nexport function scaledSheetDuration(durationMs: number, traversedRatio: number, sizeScaled: boolean): number {\n if (durationMs <= 0) return 0;\n if (!sizeScaled) return durationMs;\n return Math.max(1, Math.round(durationMs * clamp(traversedRatio, 0, 1)));\n}\n\n/** Platform size constraints of the sheet surface (MAUI Android/Windows options, applied where they belong). */\nexport function platformSheetConstraints(\n options: G9SheetOptions,\n platform = currentPlatform(),\n): Record<string, string> {\n const px = (n: number) => `${n}px`;\n const style: Record<string, string> = {};\n if (platform === 'android') {\n if (options.androidMaxWidth != null) style.maxWidth = px(options.androidMaxWidth);\n if (options.androidMaxHeight != null) style.maxHeight = px(options.androidMaxHeight);\n if (options.androidMargin) {\n const [l, t, r, b] = options.androidMargin;\n style.margin = `${t}px ${r}px ${b}px ${l}px`;\n }\n }\n if (platform === 'windows') {\n if (options.windowsMaxWidth != null) style.maxWidth = px(options.windowsMaxWidth);\n if (options.windowsMaxHeight != null) style.maxHeight = px(options.windowsMaxHeight);\n if (options.windowsMinWidth != null) style.minWidth = px(options.windowsMinWidth);\n if (options.windowsMinHeight != null) style.minHeight = px(options.windowsMinHeight);\n }\n if (options.contentWidthMode === 'custom') {\n style.width = px(options.contentWidth ?? 300);\n style.alignSelf = 'center';\n }\n return style;\n}\n"],"names":["g9SheetDefaultPeekHeight","g9SheetFitMinHeight","g9SheetScrollToEndThreshold","g9SheetFitLoadingMinHeight","g9SheetDragCloseThreshold","g9SheetTopSafeAreaBaseGap","clamp","v","lo","hi","Math","currentPlatform","info","globalThis","p","pct","ratio","resolveSheetLayout","options","hostHeight","platform","_ref","_options_fullExpandedRatio","_ref1","_options_currentState","_options_maxFitToContentHeightRatio","fit","draggable","cancelable","intercepted","_options_maxFitToContentHeightRatio1","order","requested","states","d","androidHalf","half","full","peek","snap","snapPoints","current","index","fixed","clampFitHeight","natural","cap","loading","min","sheetOverlayOpacity","visibleRatio","detentRatios","max","backdropCardTransform","threshold","raw","progress","sheetVisibleRatio","restingHeightPx","_layout_fitMaxHeight","host","layout","point","undefined","Number","parentRecedeOffset","visibleHeight","sheetTopPadding","topInset","_options_additionalTopSafeAreaPadding","inset","sheetSurfaceTopPadding","resting","_options_topSafeAreaPaddingOverride","opted","top","sheetSurfaceBottomPadding","bottomInset","scaledSheetDuration","durationMs","traversedRatio","sizeScaled","platformSheetConstraints","px","n","style","l","t","r","b","_options_contentWidth"],"mappings":"AAKO,MAAMA,2BAA2B;AAEjC,MAAMC,sBAAsB;AAE5B,MAAMC,8BAA8B;AAEpC,MAAMC,6BAA6B;AAEnC,MAAMC,4BAA4B;AAOlC,MAAMC,4BAA4B;AAEzC,MAAMC,QAAQ,CAACC,GAAWC,IAAYC,KAAeC,KAAK,GAAG,CAACD,IAAIC,KAAK,GAAG,CAACF,IAAID;AAGxE,SAASI;;IACd,MAAMC,OAAQC,WAAsD,UAAU;IAC9E,MAAMC,IAAI,AAAC,SAAD,QAACF,QAAAA,OAAAA,KAAAA,IAAAA,KAAM,QAAQ,AAAD,IAAC,OAAI,EAAC,EAAG,WAAW;IAC5C,IAAIE,AAAM,cAANA,GAAiB,OAAO;IAC5B,IAAIA,AAAM,UAANA,GAAa,OAAO;IACxB,IAAIA,EAAE,UAAU,CAAC,QAAQ,OAAO;IAChC,IAAIA,AAAM,YAANA,KAAiBA,AAAM,UAANA,KAAeA,AAAM,UAANA,GAAa,OAAO;IACxD,OAAO;AACT;AA6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