@g9tm/lynxcontrols 0.0.0-stage → 1.4.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 +22 -2
- package/dist/.tsbuildinfo +1 -0
- package/dist/base/base.css +16 -0
- package/dist/base/base.css.map +1 -0
- package/dist/base/control.d.ts +44 -0
- package/dist/base/control.d.ts.map +1 -0
- package/dist/base/control.jsx +24 -0
- package/dist/base/control.jsx.map +1 -0
- package/dist/base/corner-badge.d.ts +35 -0
- package/dist/base/corner-badge.d.ts.map +1 -0
- package/dist/base/corner-badge.jsx +45 -0
- package/dist/base/corner-badge.jsx.map +1 -0
- package/dist/base/disposer.d.ts +28 -0
- package/dist/base/disposer.d.ts.map +1 -0
- package/dist/base/disposer.jsx +61 -0
- package/dist/base/disposer.jsx.map +1 -0
- package/dist/base/index.d.ts +10 -0
- package/dist/base/index.d.ts.map +1 -0
- package/dist/base/index.jsx +9 -0
- package/dist/base/press.d.ts +38 -0
- package/dist/base/press.d.ts.map +1 -0
- package/dist/base/press.jsx +73 -0
- package/dist/base/press.jsx.map +1 -0
- package/dist/base/pressable.d.ts +25 -0
- package/dist/base/pressable.d.ts.map +1 -0
- package/dist/base/pressable.jsx +38 -0
- package/dist/base/pressable.jsx.map +1 -0
- package/dist/base/selection-item.d.ts +29 -0
- package/dist/base/selection-item.d.ts.map +1 -0
- package/dist/base/selection-item.jsx +6 -0
- package/dist/base/selection-item.jsx.map +1 -0
- package/dist/base/timers.d.ts +7 -0
- package/dist/base/timers.d.ts.map +1 -0
- package/dist/base/timers.jsx +10 -0
- package/dist/base/timers.jsx.map +1 -0
- package/dist/base/use-controllable-state.d.ts +30 -0
- package/dist/base/use-controllable-state.d.ts.map +1 -0
- package/dist/base/use-controllable-state.jsx +49 -0
- package/dist/base/use-controllable-state.jsx.map +1 -0
- package/dist/base/use-stable-callback.d.ts +8 -0
- package/dist/base/use-stable-callback.d.ts.map +1 -0
- package/dist/base/use-stable-callback.jsx +12 -0
- package/dist/base/use-stable-callback.jsx.map +1 -0
- package/dist/button/button.css +162 -0
- package/dist/button/button.css.map +1 -0
- package/dist/button/button.d.ts +52 -0
- package/dist/button/button.d.ts.map +1 -0
- package/dist/button/button.jsx +87 -0
- package/dist/button/button.jsx.map +1 -0
- package/dist/button/header-action-button.d.ts +34 -0
- package/dist/button/header-action-button.d.ts.map +1 -0
- package/dist/button/header-action-button.jsx +51 -0
- package/dist/button/header-action-button.jsx.map +1 -0
- package/dist/button/icon-button.d.ts +46 -0
- package/dist/button/icon-button.d.ts.map +1 -0
- package/dist/button/icon-button.jsx +69 -0
- package/dist/button/icon-button.jsx.map +1 -0
- package/dist/button/index.d.ts +9 -0
- package/dist/button/index.d.ts.map +1 -0
- package/dist/button/index.jsx +8 -0
- package/dist/button/nav-card.d.ts +58 -0
- package/dist/button/nav-card.d.ts.map +1 -0
- package/dist/button/nav-card.jsx +95 -0
- package/dist/button/nav-card.jsx.map +1 -0
- package/dist/button/safe-tap.d.ts +27 -0
- package/dist/button/safe-tap.d.ts.map +1 -0
- package/dist/button/safe-tap.jsx +46 -0
- package/dist/button/safe-tap.jsx.map +1 -0
- package/dist/button/safe.d.ts +84 -0
- package/dist/button/safe.d.ts.map +1 -0
- package/dist/button/safe.jsx +116 -0
- package/dist/button/safe.jsx.map +1 -0
- package/dist/button/vertical-icon-text-button.d.ts +18 -0
- package/dist/button/vertical-icon-text-button.d.ts.map +1 -0
- package/dist/button/vertical-icon-text-button.jsx +21 -0
- package/dist/button/vertical-icon-text-button.jsx.map +1 -0
- package/dist/button/visuals.d.ts +53 -0
- package/dist/button/visuals.d.ts.map +1 -0
- package/dist/button/visuals.jsx +92 -0
- package/dist/button/visuals.jsx.map +1 -0
- package/dist/cascade/cascade-panel.d.ts +80 -0
- package/dist/cascade/cascade-panel.d.ts.map +1 -0
- package/dist/cascade/cascade-panel.jsx +179 -0
- package/dist/cascade/cascade-panel.jsx.map +1 -0
- package/dist/cascade/cascade.css +70 -0
- package/dist/cascade/cascade.css.map +1 -0
- package/dist/cascade/index.d.ts +3 -0
- package/dist/cascade/index.d.ts.map +1 -0
- package/dist/cascade/index.jsx +2 -0
- package/dist/cascade/model.d.ts +68 -0
- package/dist/cascade/model.d.ts.map +1 -0
- package/dist/cascade/model.jsx +161 -0
- package/dist/cascade/model.jsx.map +1 -0
- package/dist/deferred/deferred-content.d.ts +82 -0
- package/dist/deferred/deferred-content.d.ts.map +1 -0
- package/dist/deferred/deferred-content.jsx +263 -0
- package/dist/deferred/deferred-content.jsx.map +1 -0
- package/dist/deferred/deferred.css +62 -0
- package/dist/deferred/deferred.css.map +1 -0
- package/dist/deferred/index.d.ts +3 -0
- package/dist/deferred/index.d.ts.map +1 -0
- package/dist/deferred/index.jsx +2 -0
- package/dist/deferred/readiness-signal.d.ts +16 -0
- package/dist/deferred/readiness-signal.d.ts.map +1 -0
- package/dist/deferred/readiness-signal.jsx +29 -0
- package/dist/deferred/readiness-signal.jsx.map +1 -0
- package/dist/display/activity-indicator.d.ts +21 -0
- package/dist/display/activity-indicator.d.ts.map +1 -0
- package/dist/display/activity-indicator.jsx +22 -0
- package/dist/display/activity-indicator.jsx.map +1 -0
- package/dist/display/culture-date-time-label.d.ts +64 -0
- package/dist/display/culture-date-time-label.d.ts.map +1 -0
- package/dist/display/culture-date-time-label.jsx +71 -0
- package/dist/display/culture-date-time-label.jsx.map +1 -0
- package/dist/display/display.css +217 -0
- package/dist/display/display.css.map +1 -0
- package/dist/display/index.d.ts +7 -0
- package/dist/display/index.d.ts.map +1 -0
- package/dist/display/index.jsx +6 -0
- package/dist/display/progress-bar.d.ts +38 -0
- package/dist/display/progress-bar.d.ts.map +1 -0
- package/dist/display/progress-bar.jsx +57 -0
- package/dist/display/progress-bar.jsx.map +1 -0
- package/dist/display/separator.d.ts +30 -0
- package/dist/display/separator.d.ts.map +1 -0
- package/dist/display/separator.jsx +55 -0
- package/dist/display/separator.jsx.map +1 -0
- package/dist/display/shimmer.d.ts +41 -0
- package/dist/display/shimmer.d.ts.map +1 -0
- package/dist/display/shimmer.jsx +41 -0
- package/dist/display/shimmer.jsx.map +1 -0
- package/dist/display/title-with-line.d.ts +13 -0
- package/dist/display/title-with-line.d.ts.map +1 -0
- package/dist/display/title-with-line.jsx +21 -0
- package/dist/display/title-with-line.jsx.map +1 -0
- package/dist/edge-panel/edge-panel.css +132 -0
- package/dist/edge-panel/edge-panel.css.map +1 -0
- package/dist/edge-panel/edge-panel.d.ts +87 -0
- package/dist/edge-panel/edge-panel.d.ts.map +1 -0
- package/dist/edge-panel/edge-panel.jsx +326 -0
- package/dist/edge-panel/edge-panel.jsx.map +1 -0
- package/dist/edge-panel/helper.d.ts +27 -0
- package/dist/edge-panel/helper.d.ts.map +1 -0
- package/dist/edge-panel/helper.jsx +118 -0
- package/dist/edge-panel/helper.jsx.map +1 -0
- package/dist/edge-panel/index.d.ts +4 -0
- package/dist/edge-panel/index.d.ts.map +1 -0
- package/dist/edge-panel/index.jsx +3 -0
- package/dist/edge-panel/types.d.ts +155 -0
- package/dist/edge-panel/types.d.ts.map +1 -0
- package/dist/edge-panel/types.jsx +139 -0
- package/dist/edge-panel/types.jsx.map +1 -0
- package/dist/expander/expander.css +54 -0
- package/dist/expander/expander.css.map +1 -0
- package/dist/expander/expander.d.ts +46 -0
- package/dist/expander/expander.d.ts.map +1 -0
- package/dist/expander/expander.jsx +110 -0
- package/dist/expander/expander.jsx.map +1 -0
- package/dist/expander/index.d.ts +2 -0
- package/dist/expander/index.d.ts.map +1 -0
- package/dist/expander/index.jsx +1 -0
- package/dist/fields/dictation.d.ts +43 -0
- package/dist/fields/dictation.d.ts.map +1 -0
- package/dist/fields/dictation.jsx +124 -0
- package/dist/fields/dictation.jsx.map +1 -0
- package/dist/fields/editor.d.ts +26 -0
- package/dist/fields/editor.d.ts.map +1 -0
- package/dist/fields/editor.jsx +46 -0
- package/dist/fields/editor.jsx.map +1 -0
- package/dist/fields/fields.css +156 -0
- package/dist/fields/fields.css.map +1 -0
- package/dist/fields/index.d.ts +12 -0
- package/dist/fields/index.d.ts.map +1 -0
- package/dist/fields/index.jsx +11 -0
- package/dist/fields/input-policy.d.ts +48 -0
- package/dist/fields/input-policy.d.ts.map +1 -0
- package/dist/fields/input-policy.jsx +215 -0
- package/dist/fields/input-policy.jsx.map +1 -0
- package/dist/fields/outlined-field.d.ts +146 -0
- package/dist/fields/outlined-field.d.ts.map +1 -0
- package/dist/fields/outlined-field.jsx +196 -0
- package/dist/fields/outlined-field.jsx.map +1 -0
- package/dist/fields/pin-entry.d.ts +63 -0
- package/dist/fields/pin-entry.d.ts.map +1 -0
- package/dist/fields/pin-entry.jsx +293 -0
- package/dist/fields/pin-entry.jsx.map +1 -0
- package/dist/fields/search-entry.d.ts +35 -0
- package/dist/fields/search-entry.d.ts.map +1 -0
- package/dist/fields/search-entry.jsx +118 -0
- package/dist/fields/search-entry.jsx.map +1 -0
- package/dist/fields/slot-layout.d.ts +33 -0
- package/dist/fields/slot-layout.d.ts.map +1 -0
- package/dist/fields/slot-layout.jsx +33 -0
- package/dist/fields/slot-layout.jsx.map +1 -0
- package/dist/fields/text-entry.d.ts +62 -0
- package/dist/fields/text-entry.d.ts.map +1 -0
- package/dist/fields/text-entry.jsx +72 -0
- package/dist/fields/text-entry.jsx.map +1 -0
- package/dist/fields/use-dictation.d.ts +34 -0
- package/dist/fields/use-dictation.d.ts.map +1 -0
- package/dist/fields/use-dictation.jsx +80 -0
- package/dist/fields/use-dictation.jsx.map +1 -0
- package/dist/fields/use-text-input.d.ts +150 -0
- package/dist/fields/use-text-input.d.ts.map +1 -0
- package/dist/fields/use-text-input.jsx +237 -0
- package/dist/fields/use-text-input.jsx.map +1 -0
- package/dist/fields/validator.d.ts +14 -0
- package/dist/fields/validator.d.ts.map +1 -0
- package/dist/fields/validator.jsx +20 -0
- package/dist/fields/validator.jsx.map +1 -0
- package/dist/host/back.d.ts +42 -0
- package/dist/host/back.d.ts.map +1 -0
- package/dist/host/back.jsx +47 -0
- package/dist/host/back.jsx.map +1 -0
- package/dist/host/hooks.d.ts +85 -0
- package/dist/host/hooks.d.ts.map +1 -0
- package/dist/host/hooks.jsx +163 -0
- package/dist/host/hooks.jsx.map +1 -0
- package/dist/host/host.css +81 -0
- package/dist/host/host.css.map +1 -0
- package/dist/host/host.d.ts +70 -0
- package/dist/host/host.d.ts.map +1 -0
- package/dist/host/host.jsx +229 -0
- package/dist/host/host.jsx.map +1 -0
- package/dist/host/index.d.ts +9 -0
- package/dist/host/index.d.ts.map +1 -0
- package/dist/host/index.jsx +8 -0
- package/dist/host/keyboard.d.ts +24 -0
- package/dist/host/keyboard.d.ts.map +1 -0
- package/dist/host/keyboard.jsx +28 -0
- package/dist/host/keyboard.jsx.map +1 -0
- package/dist/host/layers.d.ts +69 -0
- package/dist/host/layers.d.ts.map +1 -0
- package/dist/host/layers.jsx +111 -0
- package/dist/host/layers.jsx.map +1 -0
- package/dist/host/page-loading-overlay.d.ts +17 -0
- package/dist/host/page-loading-overlay.d.ts.map +1 -0
- package/dist/host/page-loading-overlay.jsx +16 -0
- package/dist/host/page-loading-overlay.jsx.map +1 -0
- package/dist/host/readiness.d.ts +57 -0
- package/dist/host/readiness.d.ts.map +1 -0
- package/dist/host/readiness.jsx +138 -0
- package/dist/host/readiness.jsx.map +1 -0
- package/dist/host/registry.d.ts +106 -0
- package/dist/host/registry.d.ts.map +1 -0
- package/dist/host/registry.jsx +93 -0
- package/dist/host/registry.jsx.map +1 -0
- package/dist/icon/icon.css +39 -0
- package/dist/icon/icon.css.map +1 -0
- package/dist/icon/icon.d.ts +57 -0
- package/dist/icon/icon.d.ts.map +1 -0
- package/dist/icon/icon.jsx +115 -0
- package/dist/icon/icon.jsx.map +1 -0
- package/dist/icon/index.d.ts +4 -0
- package/dist/icon/index.d.ts.map +1 -0
- package/dist/icon/index.jsx +3 -0
- package/dist/icon/slot.d.ts +45 -0
- package/dist/icon/slot.d.ts.map +1 -0
- package/dist/icon/slot.jsx +61 -0
- package/dist/icon/slot.jsx.map +1 -0
- package/dist/icon/swatch.d.ts +29 -0
- package/dist/icon/swatch.d.ts.map +1 -0
- package/dist/icon/swatch.jsx +25 -0
- package/dist/icon/swatch.jsx.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.jsx +1 -0
- package/dist/pickers/combo-box.d.ts +42 -0
- package/dist/pickers/combo-box.d.ts.map +1 -0
- package/dist/pickers/combo-box.jsx +129 -0
- package/dist/pickers/combo-box.jsx.map +1 -0
- package/dist/pickers/date-time-picker.d.ts +63 -0
- package/dist/pickers/date-time-picker.d.ts.map +1 -0
- package/dist/pickers/date-time-picker.jsx +141 -0
- package/dist/pickers/date-time-picker.jsx.map +1 -0
- package/dist/pickers/date-time.d.ts +82 -0
- package/dist/pickers/date-time.d.ts.map +1 -0
- package/dist/pickers/date-time.jsx +130 -0
- package/dist/pickers/date-time.jsx.map +1 -0
- package/dist/pickers/index.d.ts +10 -0
- package/dist/pickers/index.d.ts.map +1 -0
- package/dist/pickers/index.jsx +9 -0
- package/dist/pickers/picker-sheet.d.ts +21 -0
- package/dist/pickers/picker-sheet.d.ts.map +1 -0
- package/dist/pickers/picker-sheet.jsx +61 -0
- package/dist/pickers/picker-sheet.jsx.map +1 -0
- package/dist/pickers/picker.d.ts +32 -0
- package/dist/pickers/picker.d.ts.map +1 -0
- package/dist/pickers/picker.jsx +72 -0
- package/dist/pickers/picker.jsx.map +1 -0
- package/dist/pickers/pickers.css +219 -0
- package/dist/pickers/pickers.css.map +1 -0
- package/dist/pickers/timespan-picker.d.ts +36 -0
- package/dist/pickers/timespan-picker.d.ts.map +1 -0
- package/dist/pickers/timespan-picker.jsx +99 -0
- package/dist/pickers/timespan-picker.jsx.map +1 -0
- package/dist/pickers/timespan.d.ts +38 -0
- package/dist/pickers/timespan.d.ts.map +1 -0
- package/dist/pickers/timespan.jsx +49 -0
- package/dist/pickers/timespan.jsx.map +1 -0
- package/dist/pickers/trigger.d.ts +34 -0
- package/dist/pickers/trigger.d.ts.map +1 -0
- package/dist/pickers/trigger.jsx +77 -0
- package/dist/pickers/trigger.jsx.map +1 -0
- package/dist/pickers/wheel-column.d.ts +32 -0
- package/dist/pickers/wheel-column.d.ts.map +1 -0
- package/dist/pickers/wheel-column.jsx +99 -0
- package/dist/pickers/wheel-column.jsx.map +1 -0
- package/dist/plus-button/index.d.ts +3 -0
- package/dist/plus-button/index.d.ts.map +1 -0
- package/dist/plus-button/index.jsx +2 -0
- package/dist/plus-button/model.d.ts +65 -0
- package/dist/plus-button/model.d.ts.map +1 -0
- package/dist/plus-button/model.jsx +86 -0
- package/dist/plus-button/model.jsx.map +1 -0
- package/dist/plus-button/plus-button.css +67 -0
- package/dist/plus-button/plus-button.css.map +1 -0
- package/dist/plus-button/plus-button.d.ts +38 -0
- package/dist/plus-button/plus-button.d.ts.map +1 -0
- package/dist/plus-button/plus-button.jsx +155 -0
- package/dist/plus-button/plus-button.jsx.map +1 -0
- package/dist/popup/frame.d.ts +101 -0
- package/dist/popup/frame.d.ts.map +1 -0
- package/dist/popup/frame.jsx +244 -0
- package/dist/popup/frame.jsx.map +1 -0
- package/dist/popup/index.d.ts +8 -0
- package/dist/popup/index.d.ts.map +1 -0
- package/dist/popup/index.jsx +7 -0
- package/dist/popup/input-form.d.ts +35 -0
- package/dist/popup/input-form.d.ts.map +1 -0
- package/dist/popup/input-form.jsx +160 -0
- package/dist/popup/input-form.jsx.map +1 -0
- package/dist/popup/input.d.ts +175 -0
- package/dist/popup/input.d.ts.map +1 -0
- package/dist/popup/input.jsx +176 -0
- package/dist/popup/input.jsx.map +1 -0
- package/dist/popup/popup-view.d.ts +25 -0
- package/dist/popup/popup-view.d.ts.map +1 -0
- package/dist/popup/popup-view.jsx +67 -0
- package/dist/popup/popup-view.jsx.map +1 -0
- package/dist/popup/popup.css +203 -0
- package/dist/popup/popup.css.map +1 -0
- package/dist/popup/queue.d.ts +90 -0
- package/dist/popup/queue.d.ts.map +1 -0
- package/dist/popup/queue.jsx +309 -0
- package/dist/popup/queue.jsx.map +1 -0
- package/dist/popup/service.d.ts +60 -0
- package/dist/popup/service.d.ts.map +1 -0
- package/dist/popup/service.jsx +342 -0
- package/dist/popup/service.jsx.map +1 -0
- package/dist/popup/types.d.ts +211 -0
- package/dist/popup/types.d.ts.map +1 -0
- package/dist/popup/types.jsx +218 -0
- package/dist/popup/types.jsx.map +1 -0
- package/dist/provider/contexts.d.ts +41 -0
- package/dist/provider/contexts.d.ts.map +1 -0
- package/dist/provider/contexts.jsx +11 -0
- package/dist/provider/contexts.jsx.map +1 -0
- package/dist/provider/global-events.d.ts +8 -0
- package/dist/provider/global-events.d.ts.map +1 -0
- package/dist/provider/global-events.jsx +17 -0
- package/dist/provider/global-events.jsx.map +1 -0
- package/dist/provider/hooks.d.ts +49 -0
- package/dist/provider/hooks.d.ts.map +1 -0
- package/dist/provider/hooks.jsx +72 -0
- package/dist/provider/hooks.jsx.map +1 -0
- package/dist/provider/index.d.ts +5 -0
- package/dist/provider/index.d.ts.map +1 -0
- package/dist/provider/index.jsx +3 -0
- package/dist/provider/provider.css +18 -0
- package/dist/provider/provider.css.map +1 -0
- package/dist/provider/provider.d.ts +51 -0
- package/dist/provider/provider.d.ts.map +1 -0
- package/dist/provider/provider.jsx +290 -0
- package/dist/provider/provider.jsx.map +1 -0
- package/dist/provider/settings.d.ts +99 -0
- package/dist/provider/settings.d.ts.map +1 -0
- package/dist/provider/settings.jsx +45 -0
- package/dist/provider/settings.jsx.map +1 -0
- package/dist/provider/theme-css.d.ts +12 -0
- package/dist/provider/theme-css.d.ts.map +1 -0
- package/dist/provider/theme-css.jsx +19 -0
- package/dist/provider/theme-css.jsx.map +1 -0
- package/dist/provider/theme-root.d.ts +10 -0
- package/dist/provider/theme-root.d.ts.map +1 -0
- package/dist/provider/theme-root.jsx +24 -0
- package/dist/provider/theme-root.jsx.map +1 -0
- package/dist/provider/theme.css +473 -0
- package/dist/provider/theme.css.map +1 -0
- package/dist/range-slider/index.d.ts +3 -0
- package/dist/range-slider/index.d.ts.map +1 -0
- package/dist/range-slider/index.jsx +2 -0
- package/dist/range-slider/math.d.ts +23 -0
- package/dist/range-slider/math.d.ts.map +1 -0
- package/dist/range-slider/math.jsx +71 -0
- package/dist/range-slider/math.jsx.map +1 -0
- package/dist/range-slider/range-slider.css +90 -0
- package/dist/range-slider/range-slider.css.map +1 -0
- package/dist/range-slider/range-slider.d.ts +52 -0
- package/dist/range-slider/range-slider.d.ts.map +1 -0
- package/dist/range-slider/range-slider.jsx +159 -0
- package/dist/range-slider/range-slider.jsx.map +1 -0
- package/dist/selection/index.d.ts +5 -0
- package/dist/selection/index.d.ts.map +1 -0
- package/dist/selection/index.jsx +3 -0
- package/dist/selection/model.d.ts +53 -0
- package/dist/selection/model.d.ts.map +1 -0
- package/dist/selection/model.jsx +69 -0
- package/dist/selection/model.jsx.map +1 -0
- package/dist/selection/selection-sheet.d.ts +80 -0
- package/dist/selection/selection-sheet.d.ts.map +1 -0
- package/dist/selection/selection-sheet.jsx +362 -0
- package/dist/selection/selection-sheet.jsx.map +1 -0
- package/dist/selection/selection.css +75 -0
- package/dist/selection/selection.css.map +1 -0
- package/dist/selection/use-selection-model.d.ts +9 -0
- package/dist/selection/use-selection-model.d.ts.map +1 -0
- package/dist/selection/use-selection-model.jsx +22 -0
- package/dist/selection/use-selection-model.jsx.map +1 -0
- package/dist/sheet/frame.d.ts +45 -0
- package/dist/sheet/frame.d.ts.map +1 -0
- package/dist/sheet/frame.jsx +205 -0
- package/dist/sheet/frame.jsx.map +1 -0
- package/dist/sheet/header.d.ts +35 -0
- package/dist/sheet/header.d.ts.map +1 -0
- package/dist/sheet/header.jsx +145 -0
- package/dist/sheet/header.jsx.map +1 -0
- package/dist/sheet/height-memo.d.ts +47 -0
- package/dist/sheet/height-memo.d.ts.map +1 -0
- package/dist/sheet/height-memo.jsx +100 -0
- package/dist/sheet/height-memo.jsx.map +1 -0
- package/dist/sheet/index.d.ts +11 -0
- package/dist/sheet/index.d.ts.map +1 -0
- package/dist/sheet/index.jsx +10 -0
- package/dist/sheet/loadable.d.ts +35 -0
- package/dist/sheet/loadable.d.ts.map +1 -0
- package/dist/sheet/loadable.jsx +65 -0
- package/dist/sheet/loadable.jsx.map +1 -0
- package/dist/sheet/options.d.ts +220 -0
- package/dist/sheet/options.d.ts.map +1 -0
- package/dist/sheet/options.jsx +91 -0
- package/dist/sheet/options.jsx.map +1 -0
- package/dist/sheet/processing.d.ts +22 -0
- package/dist/sheet/processing.d.ts.map +1 -0
- package/dist/sheet/processing.jsx +66 -0
- package/dist/sheet/processing.jsx.map +1 -0
- package/dist/sheet/service.d.ts +55 -0
- package/dist/sheet/service.d.ts.map +1 -0
- package/dist/sheet/service.jsx +143 -0
- package/dist/sheet/service.jsx.map +1 -0
- package/dist/sheet/sheet.css +195 -0
- package/dist/sheet/sheet.css.map +1 -0
- package/dist/sheet/sheet.d.ts +19 -0
- package/dist/sheet/sheet.d.ts.map +1 -0
- package/dist/sheet/sheet.jsx +40 -0
- package/dist/sheet/sheet.jsx.map +1 -0
- package/dist/sheet/sizing.d.ts +69 -0
- package/dist/sheet/sizing.d.ts.map +1 -0
- package/dist/sheet/sizing.jsx +146 -0
- package/dist/sheet/sizing.jsx.map +1 -0
- package/dist/sheet/stack.d.ts +161 -0
- package/dist/sheet/stack.d.ts.map +1 -0
- package/dist/sheet/stack.jsx +378 -0
- package/dist/sheet/stack.jsx.map +1 -0
- package/dist/swipe/index.d.ts +3 -0
- package/dist/swipe/index.d.ts.map +1 -0
- package/dist/swipe/index.jsx +2 -0
- package/dist/swipe/model.d.ts +72 -0
- package/dist/swipe/model.d.ts.map +1 -0
- package/dist/swipe/model.jsx +66 -0
- package/dist/swipe/model.jsx.map +1 -0
- package/dist/swipe/swipe-view.d.ts +40 -0
- package/dist/swipe/swipe-view.d.ts.map +1 -0
- package/dist/swipe/swipe-view.jsx +163 -0
- package/dist/swipe/swipe-view.jsx.map +1 -0
- package/dist/swipe/swipe.css +34 -0
- package/dist/swipe/swipe.css.map +1 -0
- package/dist/tab-bar/index.d.ts +4 -0
- package/dist/tab-bar/index.d.ts.map +1 -0
- package/dist/tab-bar/index.jsx +3 -0
- package/dist/tab-bar/metrics.d.ts +230 -0
- package/dist/tab-bar/metrics.d.ts.map +1 -0
- package/dist/tab-bar/metrics.jsx +221 -0
- package/dist/tab-bar/metrics.jsx.map +1 -0
- package/dist/tab-bar/model.d.ts +170 -0
- package/dist/tab-bar/model.d.ts.map +1 -0
- package/dist/tab-bar/model.jsx +349 -0
- package/dist/tab-bar/model.jsx.map +1 -0
- package/dist/tab-bar/tab-bar.css +173 -0
- package/dist/tab-bar/tab-bar.css.map +1 -0
- package/dist/tab-bar/tab-bar.d.ts +56 -0
- package/dist/tab-bar/tab-bar.d.ts.map +1 -0
- package/dist/tab-bar/tab-bar.jsx +343 -0
- package/dist/tab-bar/tab-bar.jsx.map +1 -0
- package/dist/tabs/index.d.ts +3 -0
- package/dist/tabs/index.d.ts.map +1 -0
- package/dist/tabs/index.jsx +2 -0
- package/dist/tabs/model.d.ts +83 -0
- package/dist/tabs/model.d.ts.map +1 -0
- package/dist/tabs/model.jsx +113 -0
- package/dist/tabs/model.jsx.map +1 -0
- package/dist/tabs/tab-view.d.ts +47 -0
- package/dist/tabs/tab-view.d.ts.map +1 -0
- package/dist/tabs/tab-view.jsx +227 -0
- package/dist/tabs/tab-view.jsx.map +1 -0
- package/dist/tabs/tabs.css +182 -0
- package/dist/tabs/tabs.css.map +1 -0
- package/dist/toast/index.d.ts +3 -0
- package/dist/toast/index.d.ts.map +1 -0
- package/dist/toast/index.jsx +2 -0
- package/dist/toast/service.d.ts +48 -0
- package/dist/toast/service.d.ts.map +1 -0
- package/dist/toast/service.jsx +201 -0
- package/dist/toast/service.jsx.map +1 -0
- package/dist/toast/store.d.ts +174 -0
- package/dist/toast/store.d.ts.map +1 -0
- package/dist/toast/store.jsx +353 -0
- package/dist/toast/store.jsx.map +1 -0
- package/dist/toast/toast.css +152 -0
- package/dist/toast/toast.css.map +1 -0
- package/dist/toggle/checkbox-math.d.ts +52 -0
- package/dist/toggle/checkbox-math.d.ts.map +1 -0
- package/dist/toggle/checkbox-math.jsx +111 -0
- package/dist/toggle/checkbox-math.jsx.map +1 -0
- package/dist/toggle/checkbox.d.ts +56 -0
- package/dist/toggle/checkbox.d.ts.map +1 -0
- package/dist/toggle/checkbox.jsx +152 -0
- package/dist/toggle/checkbox.jsx.map +1 -0
- package/dist/toggle/chip-group.d.ts +50 -0
- package/dist/toggle/chip-group.d.ts.map +1 -0
- package/dist/toggle/chip-group.jsx +107 -0
- package/dist/toggle/chip-group.jsx.map +1 -0
- package/dist/toggle/index.d.ts +5 -0
- package/dist/toggle/index.d.ts.map +1 -0
- package/dist/toggle/index.jsx +4 -0
- package/dist/toggle/switch.d.ts +52 -0
- package/dist/toggle/switch.d.ts.map +1 -0
- package/dist/toggle/switch.jsx +192 -0
- package/dist/toggle/switch.jsx.map +1 -0
- package/dist/toggle/toggle.css +189 -0
- package/dist/toggle/toggle.css.map +1 -0
- package/package.json +155 -4
- package/rspeedy/index.d.ts +21 -0
- package/rspeedy/index.mjs +75 -0
- package/rspeedy/index.test.mjs +52 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { G9Error, createAbortController } from "@g9tm/lynxcontrols-foundation";
|
|
2
|
+
import { useContext, useEffect, useRef, useState, useSyncExternalStore } from "@lynx-js/react";
|
|
3
|
+
import { useStableCallback } from "../base/use-stable-callback.jsx";
|
|
4
|
+
import { useG9Core, useG9Settings } from "../provider/hooks.jsx";
|
|
5
|
+
import { G9HostContext, G9HostInsetsContext, G9HostReadinessContext } from "./host.jsx";
|
|
6
|
+
import { acquirePanSoftInputMode } from "./keyboard.jsx";
|
|
7
|
+
function hostMissing(hook) {
|
|
8
|
+
return new G9Error('host-missing', `${hook} must be used inside <G9Host>.`);
|
|
9
|
+
}
|
|
10
|
+
function useG9Host() {
|
|
11
|
+
const host = useContext(G9HostContext);
|
|
12
|
+
if (!host) throw hostMissing('useG9Host');
|
|
13
|
+
return host;
|
|
14
|
+
}
|
|
15
|
+
function useG9HostInsets() {
|
|
16
|
+
const insets = useContext(G9HostInsetsContext);
|
|
17
|
+
if (!insets) throw hostMissing('useG9HostInsets');
|
|
18
|
+
return insets;
|
|
19
|
+
}
|
|
20
|
+
function useG9HostReady() {
|
|
21
|
+
const readiness = useContext(G9HostReadinessContext);
|
|
22
|
+
if (!readiness) throw hostMissing('useG9HostReady');
|
|
23
|
+
const snapshot = useSyncExternalStore(readiness.subscribe, readiness.getSnapshot);
|
|
24
|
+
return {
|
|
25
|
+
...snapshot,
|
|
26
|
+
release: readiness.release,
|
|
27
|
+
whenDismissed: readiness.whenDismissed
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function useG9Back(handler, options = {}) {
|
|
31
|
+
var _options_enabled, _options_layer;
|
|
32
|
+
const host = useG9Host();
|
|
33
|
+
const stable = useStableCallback(handler);
|
|
34
|
+
const enabled = null != (_options_enabled = options.enabled) ? _options_enabled : true;
|
|
35
|
+
const layer = null != (_options_layer = options.layer) ? _options_layer : 'content';
|
|
36
|
+
useEffect(()=>enabled ? host.back.push(()=>stable(), {
|
|
37
|
+
layer
|
|
38
|
+
}) : void 0, [
|
|
39
|
+
host,
|
|
40
|
+
stable,
|
|
41
|
+
enabled,
|
|
42
|
+
layer
|
|
43
|
+
]);
|
|
44
|
+
}
|
|
45
|
+
function useG9LayerItem(layer, key, element, options = {}) {
|
|
46
|
+
var _options_enabled, _options_order;
|
|
47
|
+
const host = useG9Host();
|
|
48
|
+
const enabled = null != (_options_enabled = options.enabled) ? _options_enabled : true;
|
|
49
|
+
const order = null != (_options_order = options.order) ? _options_order : 0;
|
|
50
|
+
useEffect(()=>enabled ? host.registerLayerItem(layer, {
|
|
51
|
+
key,
|
|
52
|
+
element,
|
|
53
|
+
order
|
|
54
|
+
}) : void 0, [
|
|
55
|
+
host,
|
|
56
|
+
layer,
|
|
57
|
+
key,
|
|
58
|
+
element,
|
|
59
|
+
order,
|
|
60
|
+
enabled
|
|
61
|
+
]);
|
|
62
|
+
}
|
|
63
|
+
function useG9Activation(options) {
|
|
64
|
+
var _options_name;
|
|
65
|
+
const core = useG9Core();
|
|
66
|
+
const settings = useG9Settings();
|
|
67
|
+
const latest = useRef(options);
|
|
68
|
+
latest.current = options;
|
|
69
|
+
const name = null != (_options_name = options.name) ? _options_name : 'G9ActivatedView';
|
|
70
|
+
const [session] = useState(()=>({
|
|
71
|
+
firstDone: false,
|
|
72
|
+
controller: null,
|
|
73
|
+
suppression: null
|
|
74
|
+
}));
|
|
75
|
+
const deactivate = useStableCallback(()=>{
|
|
76
|
+
const controller = session.controller;
|
|
77
|
+
if (!controller) return;
|
|
78
|
+
session.controller = null;
|
|
79
|
+
const suppression = session.suppression;
|
|
80
|
+
session.suppression = null;
|
|
81
|
+
null == suppression || suppression();
|
|
82
|
+
controller.abort();
|
|
83
|
+
const onDeactivated = latest.current.onDeactivated;
|
|
84
|
+
if (onDeactivated) core.executor.run(()=>onDeactivated(), {
|
|
85
|
+
source: name,
|
|
86
|
+
throttleKey: `${name}.deactivate`,
|
|
87
|
+
enableThrottle: false,
|
|
88
|
+
preventConcurrentExecution: false
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
useEffect(()=>{
|
|
92
|
+
var _ref;
|
|
93
|
+
var _settings_backgroundWorkSuppression;
|
|
94
|
+
if (!options.active) return void deactivate();
|
|
95
|
+
if (session.controller) return;
|
|
96
|
+
const controller = createAbortController();
|
|
97
|
+
session.controller = controller;
|
|
98
|
+
if (latest.current.suppressesBackgroundWork) session.suppression = null != (_ref = null == (_settings_backgroundWorkSuppression = settings.backgroundWorkSuppression) ? void 0 : _settings_backgroundWorkSuppression.call(settings)) ? _ref : null;
|
|
99
|
+
core.executor.runSafe(async (context)=>{
|
|
100
|
+
var _latest_current_onActivated, _latest_current;
|
|
101
|
+
const signal = controller.signal;
|
|
102
|
+
if (!session.firstDone) {
|
|
103
|
+
var _latest_current_onFirstActivated, _latest_current1;
|
|
104
|
+
session.firstDone = true;
|
|
105
|
+
await (null == (_latest_current_onFirstActivated = (_latest_current1 = latest.current).onFirstActivated) ? void 0 : _latest_current_onFirstActivated.call(_latest_current1, {
|
|
106
|
+
signal
|
|
107
|
+
}));
|
|
108
|
+
if (signal.aborted || context.signal.aborted) return;
|
|
109
|
+
}
|
|
110
|
+
await (null == (_latest_current_onActivated = (_latest_current = latest.current).onActivated) ? void 0 : _latest_current_onActivated.call(_latest_current, {
|
|
111
|
+
signal
|
|
112
|
+
}));
|
|
113
|
+
}, {
|
|
114
|
+
source: name,
|
|
115
|
+
throttleKey: `${name}.activate`,
|
|
116
|
+
enableThrottle: false,
|
|
117
|
+
preventConcurrentExecution: false
|
|
118
|
+
});
|
|
119
|
+
}, [
|
|
120
|
+
options.active,
|
|
121
|
+
session,
|
|
122
|
+
core,
|
|
123
|
+
settings,
|
|
124
|
+
name,
|
|
125
|
+
deactivate
|
|
126
|
+
]);
|
|
127
|
+
useEffect(()=>()=>deactivate(), [
|
|
128
|
+
deactivate
|
|
129
|
+
]);
|
|
130
|
+
const host = useContext(G9HostContext);
|
|
131
|
+
const onBack = useStableCallback(()=>{
|
|
132
|
+
var _ref;
|
|
133
|
+
var _latest_current_onBack, _latest_current;
|
|
134
|
+
return null != (_ref = null == (_latest_current_onBack = (_latest_current = latest.current).onBack) ? void 0 : _latest_current_onBack.call(_latest_current)) ? _ref : 'pass';
|
|
135
|
+
});
|
|
136
|
+
const hasBack = void 0 !== options.onBack;
|
|
137
|
+
useEffect(()=>host && options.active && hasBack ? host.back.push(()=>{
|
|
138
|
+
var _onBack;
|
|
139
|
+
return null != (_onBack = onBack()) ? _onBack : 'pass';
|
|
140
|
+
}) : void 0, [
|
|
141
|
+
host,
|
|
142
|
+
options.active,
|
|
143
|
+
hasBack,
|
|
144
|
+
onBack
|
|
145
|
+
]);
|
|
146
|
+
return {
|
|
147
|
+
active: options.active
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
function useG9PanSoftInputMode(enabled = true) {
|
|
151
|
+
const host = useG9Core().services.host;
|
|
152
|
+
useEffect(()=>enabled ? acquirePanSoftInputMode(host) : void 0, [
|
|
153
|
+
enabled,
|
|
154
|
+
host
|
|
155
|
+
]);
|
|
156
|
+
}
|
|
157
|
+
function useG9HideKeyboard() {
|
|
158
|
+
const host = useG9Core().services.host;
|
|
159
|
+
return useStableCallback(()=>host.hideKeyboard());
|
|
160
|
+
}
|
|
161
|
+
export { useG9Activation, useG9Back, useG9HideKeyboard, useG9Host, useG9HostInsets, useG9HostReady, useG9LayerItem, useG9PanSoftInputMode };
|
|
162
|
+
|
|
163
|
+
//# sourceMappingURL=hooks.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host/hooks.jsx","sources":["../../src/host/hooks.ts"],"sourcesContent":["import {\n createAbortController,\n type G9AbortController,\n type G9AbortSignal,\n G9Error,\n} from '@g9tm/lynxcontrols-foundation';\nimport { type ReactNode, useContext, useEffect, useRef, useState, useSyncExternalStore } from '@lynx-js/react';\nimport { useStableCallback } from '../base/use-stable-callback';\nimport { useG9Core, useG9Settings } from '../provider/hooks';\nimport type { G9BackHandler, G9BackResult } from './back';\nimport { G9HostContext, G9HostInsetsContext, G9HostReadinessContext } from './host';\nimport { acquirePanSoftInputMode } from './keyboard';\nimport type { G9Layer, G9OverlayLayer } from './layers';\nimport type { G9HostReadinessSnapshot } from './readiness';\nimport type { G9HostHandle, G9HostInsets } from './registry';\n\nfunction hostMissing(hook: string): G9Error {\n return new G9Error('host-missing', `${hook} must be used inside <G9Host>.`);\n}\n\n/** The nearest `G9Host`. Throws `host-missing` outside one. */\nexport function useG9Host(): G9HostHandle {\n const host = useContext(G9HostContext);\n if (!host) throw hostMissing('useG9Host');\n return host;\n}\n\n/** Insets of the nearest host (MAUI `TopSafeAreaInset` … `BottomSafeAreaWithTabBar`). Re-renders when they change. */\nexport function useG9HostInsets(): G9HostInsets {\n const insets = useContext(G9HostInsetsContext);\n if (!insets) throw hostMissing('useG9HostInsets');\n return insets;\n}\n\n/** Readiness of the nearest host, plus `release` (MAUI `ReleasePageLoadingOverlay`) and `whenDismissed`. */\nexport interface G9HostReadyState extends G9HostReadinessSnapshot {\n release(): void;\n whenDismissed(): Promise<void>;\n}\n\n/**\n * The nearest host's ready state and loading cover (MAUI `ReleasePageLoadingOverlay`, `PageLoadingOverlayDismissed`,\n * `G9ContentViewBase.ReleaseHostPageLoadingOverlay`). A page with `manualRelease` calls `release()` when its first\n * meaningful frame is ready.\n */\nexport function useG9HostReady(): G9HostReadyState {\n const readiness = useContext(G9HostReadinessContext);\n if (!readiness) throw hostMissing('useG9HostReady');\n const snapshot = useSyncExternalStore(readiness.subscribe, readiness.getSnapshot);\n return { ...snapshot, release: readiness.release, whenDismissed: readiness.whenDismissed };\n}\n\n/** Options of {@link useG9Back}. */\nexport interface G9UseBackOptions {\n /** The layer the handler belongs to (overlays pass theirs so they are asked first). Default `'content'`. */\n readonly layer?: G9Layer;\n /** Register only while `true`. Default `true`. */\n readonly enabled?: boolean;\n}\n\n/**\n * Registers a back handler on the nearest host while mounted (and enabled). Handlers of higher layers run first, then\n * newest first; returning `'handled'` (or `true`) consumes the press, `'pass'` lets it continue. When nothing handles\n * it, the provider calls `services.host.exit()`. The latest `handler` is always called.\n */\nexport function useG9Back(handler: G9BackHandler, options: G9UseBackOptions = {}): void {\n const host = useG9Host();\n const stable = useStableCallback(handler);\n const enabled = options.enabled ?? true;\n const layer = options.layer ?? 'content';\n useEffect(\n () => (enabled ? host.back.push(() => stable() as G9BackResult | boolean, { layer }) : undefined),\n [host, stable, enabled, layer],\n );\n}\n\n/** Options of {@link useG9LayerItem}. */\nexport interface G9UseLayerItemOptions {\n /** Ordering inside the layer (lower paints below). Default 0. */\n readonly order?: number;\n /** Mount only while `true`. Default `true`. */\n readonly enabled?: boolean;\n}\n\n/**\n * Mounts `element` into an overlay layer of the nearest host while the calling component is mounted (and enabled),\n * keeping it in step with `element`. The key must be unique within the layer.\n */\nexport function useG9LayerItem(\n layer: G9OverlayLayer,\n key: string,\n element: ReactNode,\n options: G9UseLayerItemOptions = {},\n): void {\n const host = useG9Host();\n const enabled = options.enabled ?? true;\n const order = options.order ?? 0;\n useEffect(\n () => (enabled ? host.registerLayerItem(layer, { key, element, order }) : undefined),\n [host, layer, key, element, order, enabled],\n );\n}\n\n/** Inputs of {@link useG9Activation} (MAUI `G9ContentViewBase`). */\nexport interface G9ActivationOptions {\n /** Whether this view is the active one (MAUI `Activate` / `Deactivate`, driven by the hosting page). */\n readonly active: boolean;\n /** First activation only (MAUI `OnFirstActivatedAsync`): heavy one-shot setup. */\n readonly onFirstActivated?: (context: { readonly signal: G9AbortSignal }) => void | Promise<void>;\n /** Every activation, after the first-activation work (MAUI `OnActivatedAsync`). */\n readonly onActivated?: (context: { readonly signal: G9AbortSignal }) => void | Promise<void>;\n /** Every deactivation, after the activation signal was aborted (MAUI `OnDeactivated`). */\n readonly onDeactivated?: () => void;\n /** Ask the app to pause background work while active (MAUI `SuppressesBackgroundWork`). Default `false`. */\n readonly suppressesBackgroundWork?: boolean;\n /** Back handling while active (MAUI `OnHardwareBackPressed`); asked after overlays. */\n readonly onBack?: G9BackHandler;\n /** Names the view in diagnostics. Default `'G9ActivatedView'`. */\n readonly name?: string;\n}\n\n/**\n * Activation lifecycle of a view kept alive across tab switches (MAUI `G9ContentViewBase`): a fresh abort signal per\n * activation (aborted on deactivation and unmount), first-activation and every-activation work run through the\n * provider's safe executor, the app's background-work pause held while active\n * (`settings.backgroundWorkSuppression`), and back handling while active. Unmounting while active deactivates too\n * (MAUI handler teardown: signal aborted, pause released, `onDeactivated` called). Returns whether the view is active.\n */\nexport function useG9Activation(options: G9ActivationOptions): { readonly active: boolean } {\n const core = useG9Core();\n const settings = useG9Settings();\n const latest = useRef(options);\n latest.current = options;\n const name = options.name ?? 'G9ActivatedView';\n const [session] = useState(() => ({\n firstDone: false,\n controller: null as G9AbortController | null,\n suppression: null as (() => void) | null,\n }));\n\n const deactivate = useStableCallback(() => {\n const controller = session.controller;\n if (!controller) return;\n session.controller = null;\n const suppression = session.suppression;\n session.suppression = null;\n suppression?.();\n controller.abort();\n const onDeactivated = latest.current.onDeactivated;\n if (onDeactivated) {\n void core.executor.run(() => onDeactivated(), {\n source: name,\n throttleKey: `${name}.deactivate`,\n enableThrottle: false,\n preventConcurrentExecution: false,\n });\n }\n });\n\n useEffect(() => {\n if (!options.active) {\n deactivate();\n return;\n }\n if (session.controller) return;\n const controller = createAbortController();\n session.controller = controller;\n if (latest.current.suppressesBackgroundWork) session.suppression = settings.backgroundWorkSuppression?.() ?? null;\n core.executor.runSafe(\n async (context) => {\n const signal = controller.signal;\n if (!session.firstDone) {\n session.firstDone = true;\n await latest.current.onFirstActivated?.({ signal });\n if (signal.aborted || context.signal.aborted) return;\n }\n await latest.current.onActivated?.({ signal });\n },\n { source: name, throttleKey: `${name}.activate`, enableThrottle: false, preventConcurrentExecution: false },\n );\n }, [options.active, session, core, settings, name, deactivate]);\n\n // Unmount while active: MAUI's handler teardown ran the same deactivation (without hiding the view).\n useEffect(() => () => deactivate(), [deactivate]);\n\n const host = useContext(G9HostContext);\n const onBack = useStableCallback(() => latest.current.onBack?.() ?? 'pass');\n const hasBack = options.onBack !== undefined;\n useEffect(\n () => (host && options.active && hasBack ? host.back.push(() => onBack() ?? 'pass') : undefined),\n [host, options.active, hasBack, onBack],\n );\n return { active: options.active };\n}\n\n/**\n * Holds Android's pan soft-input mode while `enabled` (MAUI `G9KeyboardHelper.UseAndroidPanSoftInputMode` scoped to\n * a sheet or page); restores on disable and unmount.\n */\nexport function useG9PanSoftInputMode(enabled = true): void {\n const host = useG9Core().services.host;\n useEffect(() => (enabled ? acquirePanSoftInputMode(host) : undefined), [enabled, host]);\n}\n\n/** The keyboard dismiss path (MAUI `G9KeyboardHelper.HideKeyboardAndClearFocus`): `services.host.hideKeyboard`. */\nexport function useG9HideKeyboard(): () => void {\n const host = useG9Core().services.host;\n return useStableCallback(() => host.hideKeyboard()) as () => void;\n}\n"],"names":["hostMissing","hook","G9Error","useG9Host","host","useContext","G9HostContext","useG9HostInsets","insets","G9HostInsetsContext","useG9HostReady","readiness","G9HostReadinessContext","snapshot","useSyncExternalStore","useG9Back","handler","options","_options_enabled","_options_layer","stable","useStableCallback","enabled","layer","useEffect","undefined","useG9LayerItem","key","element","_options_order","order","useG9Activation","_options_name","core","useG9Core","settings","useG9Settings","latest","useRef","name","session","useState","deactivate","controller","suppression","onDeactivated","createAbortController","context","_latest_current","signal","_latest_current1","onBack","hasBack","_onBack","useG9PanSoftInputMode","acquirePanSoftInputMode","useG9HideKeyboard"],"mappings":";;;;;;AAgBA,SAASA,YAAYC,IAAY;IAC/B,OAAO,IAAIC,QAAQ,gBAAgB,GAAGD,KAAK,8BAA8B,CAAC;AAC5E;AAGO,SAASE;IACd,MAAMC,OAAOC,WAAWC;IACxB,IAAI,CAACF,MAAM,MAAMJ,YAAY;IAC7B,OAAOI;AACT;AAGO,SAASG;IACd,MAAMC,SAASH,WAAWI;IAC1B,IAAI,CAACD,QAAQ,MAAMR,YAAY;IAC/B,OAAOQ;AACT;AAaO,SAASE;IACd,MAAMC,YAAYN,WAAWO;IAC7B,IAAI,CAACD,WAAW,MAAMX,YAAY;IAClC,MAAMa,WAAWC,qBAAqBH,UAAU,SAAS,EAAEA,UAAU,WAAW;IAChF,OAAO;QAAE,GAAGE,QAAQ;QAAE,SAASF,UAAU,OAAO;QAAE,eAAeA,UAAU,aAAa;IAAC;AAC3F;AAeO,SAASI,UAAUC,OAAsB,EAAEC,UAA4B,CAAC,CAAC;QAG9DC,kBACFC;IAHd,MAAMf,OAAOD;IACb,MAAMiB,SAASC,kBAAkBL;IACjC,MAAMM,UAAU,QAAAJ,CAAAA,mBAAAA,QAAQ,OAAO,AAAD,IAAdA,mBAAmB;IACnC,MAAMK,QAAQ,QAAAJ,CAAAA,iBAAAA,QAAQ,KAAK,AAAD,IAAZA,iBAAiB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6C,SAAS9B,kBAAkB;;YAAM2B,wBAAAA;uCAAAA,CAAAA,yBAAAA,AAAAA,CAAAA,kBAAAA,OAAO,OAAO,AAAD,EAAE,MAAM,AAAD,IAApBA,KAAAA,IAAAA,uBAAAA,IAAAA,CAAAA,gBAAAA,IAAAA,OAA6B;;IACpE,MAAMI,UAAUnC,AAAmBQ,WAAnBR,QAAQ,MAAM;IAC9BO,UACE,IAAOpB,QAAQa,QAAQ,MAAM,IAAImC,UAAUhD,KAAK,IAAI,CAAC,IAAI,CAAC;gBAAMiD;2BAAAA,CAAAA,UAAAA,QAAO,IAAPA,UAAY;aAAU5B,QACtF;QAACrB;QAAMa,QAAQ,MAAM;QAAEmC;QAASD;KAAO;IAEzC,OAAO;QAAE,QAAQlC,QAAQ,MAAM;IAAC;AAClC;AAMO,SAASqC,sBAAsBhC,UAAU,IAAI;IAClD,MAAMlB,OAAO8B,YAAY,QAAQ,CAAC,IAAI;IACtCV,UAAU,IAAOF,UAAUiC,wBAAwBnD,QAAQqB,QAAY;QAACH;QAASlB;KAAK;AACxF;AAGO,SAASoD;IACd,MAAMpD,OAAO8B,YAAY,QAAQ,CAAC,IAAI;IACtC,OAAOb,kBAAkB,IAAMjB,KAAK,YAAY;AAClD"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
.g9-host {
|
|
2
|
+
flex-direction: column;
|
|
3
|
+
flex: 1;
|
|
4
|
+
width: 100%;
|
|
5
|
+
height: 100%;
|
|
6
|
+
display: flex;
|
|
7
|
+
position: relative;
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.g9-host__backdrop {
|
|
12
|
+
pointer-events: none;
|
|
13
|
+
position: absolute;
|
|
14
|
+
top: 0;
|
|
15
|
+
bottom: 0;
|
|
16
|
+
left: 0;
|
|
17
|
+
right: 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.g9-host__content {
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
display: flex;
|
|
23
|
+
position: absolute;
|
|
24
|
+
top: 0;
|
|
25
|
+
bottom: 0;
|
|
26
|
+
left: 0;
|
|
27
|
+
right: 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.g9-host__layer {
|
|
31
|
+
pointer-events: none;
|
|
32
|
+
position: absolute;
|
|
33
|
+
top: 0;
|
|
34
|
+
bottom: 0;
|
|
35
|
+
left: 0;
|
|
36
|
+
right: 0;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.g9-page-loading {
|
|
40
|
+
opacity: 1;
|
|
41
|
+
justify-content: center;
|
|
42
|
+
align-items: center;
|
|
43
|
+
transition-property: opacity, transform;
|
|
44
|
+
transition-duration: .2s;
|
|
45
|
+
transition-timing-function: cubic-bezier(.55, .055, .675, .19);
|
|
46
|
+
display: flex;
|
|
47
|
+
position: absolute;
|
|
48
|
+
top: 0;
|
|
49
|
+
bottom: 0;
|
|
50
|
+
left: 0;
|
|
51
|
+
right: 0;
|
|
52
|
+
transform: scale(1);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.g9-page-loading--exiting {
|
|
56
|
+
opacity: 0;
|
|
57
|
+
transform: scale(.9);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.g9-page-loading__spinner {
|
|
61
|
+
border-style: solid;
|
|
62
|
+
border-width: 4px;
|
|
63
|
+
border-top-color: #0000;
|
|
64
|
+
border-radius: 24px;
|
|
65
|
+
width: 48px;
|
|
66
|
+
height: 48px;
|
|
67
|
+
animation: .9s linear infinite g9-spin;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@keyframes g9-spin {
|
|
71
|
+
from {
|
|
72
|
+
transform: rotate(0);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
to {
|
|
76
|
+
transform: rotate(360deg);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
/*# sourceMappingURL=host.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["webpack://./src/host/host.css"],"names":[],"mappings":"AACA;EAAE,sBAAsB;EACtB,OAAO;EACP,WAAW;EACX,YAAY;EACZ,aAAa;EACb,kBAAkB;EAClB,gBAAgB;AAClB;;AAIA;EADE,oBAAoB;EACpB,kBAAkB;EAClB,MAAM;EACN,SAAS;EACT,OAAO;EACP,QAAQ;AACV;;AAIA;EADE,sBAAsB;EACtB,aAAa;EACb,kBAAkB;EAClB,MAAM;EACN,SAAS;EACT,OAAO;EACP,QAAQ;AACV;;AAKA;EAFE,oBAAoB;EACpB,kBAAkB;EAClB,MAAM;EACN,SAAS;EACT,OAAO;EACP,QAAQ;AACV;;AAMA;EAHE,UAAU;EACV,uBAAuB;EACvB,mBAAmB;EACnB,uCAAuC;EACvC,wBAAwB;EACxB,8DAA8D;EAC9D,aAAa;EACb,kBAAkB;EAClB,MAAM;EACN,SAAS;EACT,OAAO;EACP,QAAQ;EACR,mBAAmB;AACrB;;AAMA;EAHE,UAAU;EACV,oBAAoB;AACtB;;AAMA;EAHE,mBAAmB;EACnB,iBAAiB;EACjB,uBAAuB;EACvB,mBAAmB;EACnB,WAAW;EACX,YAAY;EACZ,sCAAsC;AACxC;;AAMA;EAHE;IACE,oBAAoB;EACtB;;EAEA;IACE,yBAAyB;EAC3B;AACF","sourcesContent":["/* G9Host: one page frame. Sibling order below is the z-order (MAUI G9PageTemplate.xaml); nothing uses z-index. */\n.g9-host {\n display: flex;\n flex-direction: column;\n position: relative;\n flex: 1;\n width: 100%;\n height: 100%;\n overflow: hidden;\n}\n\n/* MAUI BackdropHost: behind the content, input-transparent, visible only when a sheet recedes the page. */\n.g9-host__backdrop {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n pointer-events: none;\n}\n\n.g9-host__content {\n display: flex;\n flex-direction: column;\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n}\n\n/* Overlay layers: full-size and input-transparent; items opt back in (pointer-events does not inherit). */\n.g9-host__layer {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n pointer-events: none;\n}\n\n/* The page-loading cover: topmost, input-opaque, centred spinner. */\n.g9-page-loading {\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n opacity: 1;\n transform: scale(1);\n transition-property: opacity, transform;\n transition-duration: 200ms;\n transition-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);\n}\n\n.g9-page-loading--exiting {\n opacity: 0;\n transform: scale(0.9);\n}\n\n.g9-page-loading__spinner {\n width: 48px;\n height: 48px;\n border-width: 4px;\n border-style: solid;\n border-radius: 24px;\n border-top-color: transparent;\n animation: g9-spin 900ms linear infinite;\n}\n\n@keyframes g9-spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n"],"sourceRoot":""}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { type G9AbortSignal } from '@g9tm/lynxcontrols-foundation';
|
|
2
|
+
import { type ReactNode } from '@lynx-js/react';
|
|
3
|
+
import { type G9BackResult } from './back.js';
|
|
4
|
+
import { type G9OverlayLayer } from './layers.js';
|
|
5
|
+
import { type G9HostReadinessController } from './readiness.js';
|
|
6
|
+
import { type G9HostHandle, type G9HostInsets } from './registry.js';
|
|
7
|
+
import './host.css';
|
|
8
|
+
/** How a layer is mounted: in the page tree (default) or in a Lynx `<overlay>` above native views (maps, video). */
|
|
9
|
+
export type G9LayerContainer = 'tree' | 'overlay';
|
|
10
|
+
/** Props of {@link G9Host}. */
|
|
11
|
+
export interface G9HostProps {
|
|
12
|
+
readonly children?: ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Whether the page is on screen (MAUI `Loaded`/`Unloaded`, tab activation). Default `true`. An inactive host stays
|
|
15
|
+
* registered and becomes active again when set back to `true`; see `g9Hosts` for the resolution rule.
|
|
16
|
+
*/
|
|
17
|
+
readonly active?: boolean;
|
|
18
|
+
/** Names the page in diagnostics (the cover's busy activity is `page:<name>`). Default `'G9Host'`. */
|
|
19
|
+
readonly name?: string;
|
|
20
|
+
/**
|
|
21
|
+
* The page's appearing work (MAUI `OnAppearingAfterParentAsync`), run through the provider's safe executor each time
|
|
22
|
+
* the host becomes active; `signal` aborts when it stops being active or unmounts. On the first appearance the
|
|
23
|
+
* loading cover waits for it (unless `manualRelease`).
|
|
24
|
+
*/
|
|
25
|
+
readonly onAppearing?: (context: {
|
|
26
|
+
readonly signal: G9AbortSignal;
|
|
27
|
+
}) => void | Promise<void>;
|
|
28
|
+
/** Runs each time the host stops being active (MAUI `OnDisappearingAfterParentAsync`), guarded. */
|
|
29
|
+
readonly onDisappearing?: () => void | Promise<void>;
|
|
30
|
+
/** The page's own back handling (MAUI `TryHandleInAppBack`), asked after every overlay. */
|
|
31
|
+
readonly onBack?: () => G9BackResult | boolean;
|
|
32
|
+
/** Swallow every system back press before anything else runs (MAUI `IsHardwareBackSuppressed`). Default `false`. */
|
|
33
|
+
readonly backSuppressed?: boolean;
|
|
34
|
+
/** Show the page-loading cover until the page is ready (MAUI `G9PageLoadingOverlay`, always on). Default `true`. */
|
|
35
|
+
readonly loadingCover?: boolean;
|
|
36
|
+
/** The page releases the cover itself through `useG9HostReady().release()` (MAUI `PageLoadingManualRelease`). */
|
|
37
|
+
readonly manualRelease?: boolean;
|
|
38
|
+
/** Extra delay after ready (MAUI `PageLoadingDismissDelayMs`). Default `settings.pageLoading.dismissDelayMs` (369). */
|
|
39
|
+
readonly dismissDelayMs?: number;
|
|
40
|
+
/** Hard cap on the cover (MAUI `PageLoadingSafetyTimeoutMs`). Default `settings.pageLoading.safetyTimeoutMs` (5000). */
|
|
41
|
+
readonly safetyTimeoutMs?: number;
|
|
42
|
+
/** Dismiss the soft keyboard on a tap outside any keyboard target (MAUI `TapOutsideKeyboardDismisser`). Default `true`. */
|
|
43
|
+
readonly dismissKeyboardOnTapOutside?: boolean;
|
|
44
|
+
/** Per-layer container; a layer over a native view (map, video) needs `'overlay'`. Default `'tree'` for each. */
|
|
45
|
+
readonly layerContainers?: Partial<Record<G9OverlayLayer, G9LayerContainer>>;
|
|
46
|
+
/** MAUI `ComputeBottomSafeAreaWithTabBar`: the bottom inset plus the page's own tab bar. Default: the inset. */
|
|
47
|
+
readonly computeBottomSafeAreaWithTabBar?: (bottomInset: number) => number;
|
|
48
|
+
/** The page background (MAUI `ApplyThemedBackground`). Default `var(--g9-background)`. */
|
|
49
|
+
readonly background?: string;
|
|
50
|
+
/** The colour behind the content, shown when a sheet recedes the page (MAUI `BackdropHost`). Default black. */
|
|
51
|
+
readonly backdropColor?: string;
|
|
52
|
+
readonly className?: string;
|
|
53
|
+
}
|
|
54
|
+
/** The nearest host, for hooks. */
|
|
55
|
+
export declare const G9HostContext: import("react").Context<G9HostHandle | null>;
|
|
56
|
+
/** The nearest host's insets. */
|
|
57
|
+
export declare const G9HostInsetsContext: import("react").Context<G9HostInsets | null>;
|
|
58
|
+
/** The nearest host's readiness controller. */
|
|
59
|
+
export declare const G9HostReadinessContext: import("react").Context<G9HostReadinessController | null>;
|
|
60
|
+
/**
|
|
61
|
+
* The page frame (MAUI `G9PageBase` + `G9PageTemplate`): the content and the overlay layers in a fixed z-order
|
|
62
|
+
* (`content` → `edgePanel` → `sheets` → `popups` → `feedback` → `floating`, then the loading cover), the page's back
|
|
63
|
+
* stack, readiness and loading cover, safe-area insets, tap-outside keyboard dismissal, and its registration in
|
|
64
|
+
* `g9Hosts` for code outside the tree. One per page; hosts may nest. Must be inside `G9Provider`.
|
|
65
|
+
*
|
|
66
|
+
* Layers are input-transparent (`pointer-events: none`), so empty areas pass touches to the layers below while each
|
|
67
|
+
* item receives its own touches; an empty layer renders nothing.
|
|
68
|
+
*/
|
|
69
|
+
export declare function G9Host(props: G9HostProps): ReactNode;
|
|
70
|
+
//# sourceMappingURL=host.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../../src/host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E,OAAO,CAAC;IACjC,uHAAuH;IACvH,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,wHAAwH;IACxH,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,2HAA2H;IAC3H,QAAQ,CAAC,2BAA2B,CAAC,EAAE,OAAO,CAAC;IAC/C,iHAAiH;IACjH,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAC7E,gHAAgH;IAChH,QAAQ,CAAC,+BAA+B,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,MAAM,CAAC;IAC3E,0FAA0F;IAC1F,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,+GAA+G;IAC/G,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,mCAAmC;AACnC,eAAO,MAAM,aAAa,8CAA2C,CAAC;AACtE,iCAAiC;AACjC,eAAO,MAAM,mBAAmB,8CAA2C,CAAC;AAC5E,+CAA+C;AAC/C,eAAO,MAAM,sBAAsB,2DAAwD,CAAC;AA+B5F;;;;;;;;GAQG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,CAmNpD"}
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import { G9Error } from "@g9tm/lynxcontrols-foundation";
|
|
2
|
+
import { OverlayView } from "@lynx-js/lynx-ui-overlay";
|
|
3
|
+
import { Fragment, createContext, memo, useContext, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "@lynx-js/react";
|
|
4
|
+
import { useStableCallback } from "../base/use-stable-callback.jsx";
|
|
5
|
+
import { G9KeyboardContext } from "../provider/contexts.jsx";
|
|
6
|
+
import { useG9Core, useG9SafeInsets, useG9Settings } from "../provider/hooks.jsx";
|
|
7
|
+
import { createBackStack } from "./back.jsx";
|
|
8
|
+
import { isKeyboardTarget } from "./keyboard.jsx";
|
|
9
|
+
import { createLayerStore, g9LayerOrder } from "./layers.jsx";
|
|
10
|
+
import { G9PageLoadingOverlay } from "./page-loading-overlay.jsx";
|
|
11
|
+
import { createHostReadiness } from "./readiness.jsx";
|
|
12
|
+
import { hostRegistry } from "./registry.jsx";
|
|
13
|
+
import "./host.css";
|
|
14
|
+
const G9HostContext = createContext(null);
|
|
15
|
+
const G9HostInsetsContext = createContext(null);
|
|
16
|
+
const G9HostReadinessContext = createContext(null);
|
|
17
|
+
const OVERLAY_LAYERS = g9LayerOrder.filter((layer)=>'content' !== layer);
|
|
18
|
+
let hostSequence = 0;
|
|
19
|
+
const HostLayer = memo(function(props) {
|
|
20
|
+
const { hostId, store, layer, container } = props;
|
|
21
|
+
const entries = useSyncExternalStore((listener)=>store.subscribe(layer, listener), ()=>store.getSnapshot(layer));
|
|
22
|
+
if (0 === entries.length) return null;
|
|
23
|
+
const className = `g9-host__layer g9-host__layer--${layer}`;
|
|
24
|
+
const items = entries.map((entry)=><Fragment key={entry.key}>{entry.element}</Fragment>);
|
|
25
|
+
if ('overlay' === container) return <OverlayView container="window" className={className} id={`${hostId}-${layer}`}>
|
|
26
|
+
{items}
|
|
27
|
+
</OverlayView>;
|
|
28
|
+
return <view className={className}>{items}</view>;
|
|
29
|
+
});
|
|
30
|
+
function G9Host(props) {
|
|
31
|
+
var _props_active, _props_name, _props_layerContainers, _props_dismissKeyboardOnTapOutside, _ref, _ref1, _props_background, _ref2;
|
|
32
|
+
const core = useG9Core();
|
|
33
|
+
const settings = useG9Settings();
|
|
34
|
+
const parent = useContext(G9HostContext);
|
|
35
|
+
const keyboard = useContext(G9KeyboardContext);
|
|
36
|
+
const providerInsets = useG9SafeInsets();
|
|
37
|
+
const active = null != (_props_active = props.active) ? _props_active : true;
|
|
38
|
+
const name = null != (_props_name = props.name) ? _props_name : 'G9Host';
|
|
39
|
+
const latest = useRef(props);
|
|
40
|
+
latest.current = props;
|
|
41
|
+
const bottomWithTabBar = props.computeBottomSafeAreaWithTabBar ? props.computeBottomSafeAreaWithTabBar(providerInsets.bottom) : providerInsets.bottom;
|
|
42
|
+
const insets = useMemo(()=>Object.freeze({
|
|
43
|
+
...providerInsets,
|
|
44
|
+
bottomWithTabBar
|
|
45
|
+
}), [
|
|
46
|
+
providerInsets,
|
|
47
|
+
bottomWithTabBar
|
|
48
|
+
]);
|
|
49
|
+
const insetsRef = useRef(insets);
|
|
50
|
+
insetsRef.current = insets;
|
|
51
|
+
const [state] = useState(()=>{
|
|
52
|
+
var _props_loadingCover, _props_manualRelease, _props_dismissDelayMs, _props_safetyTimeoutMs;
|
|
53
|
+
hostSequence += 1;
|
|
54
|
+
const id = `g9-host-${hostSequence}`;
|
|
55
|
+
const layers = createLayerStore();
|
|
56
|
+
const back = createBackStack({
|
|
57
|
+
isSuppressed: ()=>true === latest.current.backSuppressed,
|
|
58
|
+
onHandlerError: (error)=>core.diagnostics.log({
|
|
59
|
+
level: 'error',
|
|
60
|
+
message: 'A back handler threw.',
|
|
61
|
+
source: name,
|
|
62
|
+
error
|
|
63
|
+
})
|
|
64
|
+
});
|
|
65
|
+
const features = new Map();
|
|
66
|
+
let released = false;
|
|
67
|
+
let contentEffect = null;
|
|
68
|
+
const effectListeners = new Set();
|
|
69
|
+
const readiness = createHostReadiness({
|
|
70
|
+
cover: null != (_props_loadingCover = props.loadingCover) ? _props_loadingCover : true,
|
|
71
|
+
manualRelease: null != (_props_manualRelease = props.manualRelease) ? _props_manualRelease : false,
|
|
72
|
+
dismissDelayMs: null != (_props_dismissDelayMs = props.dismissDelayMs) ? _props_dismissDelayMs : settings.pageLoading.dismissDelayMs,
|
|
73
|
+
safetyTimeoutMs: null != (_props_safetyTimeoutMs = props.safetyTimeoutMs) ? _props_safetyTimeoutMs : settings.pageLoading.safetyTimeoutMs,
|
|
74
|
+
startActivity: ()=>{
|
|
75
|
+
const scope = core.diagnostics.activity(`page:${name}`);
|
|
76
|
+
return ()=>scope.dispose();
|
|
77
|
+
},
|
|
78
|
+
runAppearing: async (signal)=>{
|
|
79
|
+
const onAppearing = latest.current.onAppearing;
|
|
80
|
+
if (!onAppearing) return;
|
|
81
|
+
await core.executor.run((context)=>onAppearing({
|
|
82
|
+
signal: context.signal
|
|
83
|
+
}), {
|
|
84
|
+
source: name,
|
|
85
|
+
throttleKey: `${id}.onAppearing`,
|
|
86
|
+
enableThrottle: false,
|
|
87
|
+
preventConcurrentExecution: false,
|
|
88
|
+
signal
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
const handle = {
|
|
93
|
+
id,
|
|
94
|
+
parent,
|
|
95
|
+
services: core.services,
|
|
96
|
+
layers,
|
|
97
|
+
registerLayerItem (layer, item) {
|
|
98
|
+
if (released) return ()=>{};
|
|
99
|
+
return layers.register(layer, item);
|
|
100
|
+
},
|
|
101
|
+
removeLayerItem: (layer, key)=>layers.remove(layer, key),
|
|
102
|
+
back,
|
|
103
|
+
getInsets: ()=>insetsRef.current,
|
|
104
|
+
readiness,
|
|
105
|
+
attachFeature (key, value) {
|
|
106
|
+
if (features.has(key)) throw new G9Error('host-feature', `Host feature '${String(key)}' is already attached.`);
|
|
107
|
+
features.set(key, value);
|
|
108
|
+
return ()=>{
|
|
109
|
+
if (features.get(key) === value) features.delete(key);
|
|
110
|
+
};
|
|
111
|
+
},
|
|
112
|
+
getFeature: (key)=>features.get(key),
|
|
113
|
+
get released () {
|
|
114
|
+
return released;
|
|
115
|
+
},
|
|
116
|
+
setContentEffect (effect) {
|
|
117
|
+
if (released || contentEffect === effect) return;
|
|
118
|
+
contentEffect = effect;
|
|
119
|
+
for (const listener of [
|
|
120
|
+
...effectListeners
|
|
121
|
+
])listener();
|
|
122
|
+
},
|
|
123
|
+
getContentEffect: ()=>contentEffect
|
|
124
|
+
};
|
|
125
|
+
const effectStore = {
|
|
126
|
+
subscribe (listener) {
|
|
127
|
+
effectListeners.add(listener);
|
|
128
|
+
return ()=>{
|
|
129
|
+
effectListeners.delete(listener);
|
|
130
|
+
};
|
|
131
|
+
},
|
|
132
|
+
getSnapshot: ()=>contentEffect
|
|
133
|
+
};
|
|
134
|
+
return {
|
|
135
|
+
handle,
|
|
136
|
+
readiness,
|
|
137
|
+
effectStore,
|
|
138
|
+
release () {
|
|
139
|
+
released = true;
|
|
140
|
+
features.clear();
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
});
|
|
144
|
+
const { handle, readiness, effectStore } = state;
|
|
145
|
+
useEffect(()=>()=>{
|
|
146
|
+
hostRegistry.remove(handle);
|
|
147
|
+
readiness.dispose();
|
|
148
|
+
handle.layers.clear();
|
|
149
|
+
handle.back.clear();
|
|
150
|
+
state.release();
|
|
151
|
+
}, [
|
|
152
|
+
handle,
|
|
153
|
+
readiness,
|
|
154
|
+
state
|
|
155
|
+
]);
|
|
156
|
+
const wasActive = useRef(null);
|
|
157
|
+
useEffect(()=>{
|
|
158
|
+
const previous = wasActive.current;
|
|
159
|
+
wasActive.current = active;
|
|
160
|
+
if (active) {
|
|
161
|
+
hostRegistry.activate(handle);
|
|
162
|
+
readiness.appear();
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
if (null === previous) return void hostRegistry.register(handle);
|
|
166
|
+
hostRegistry.markOffScreen(handle);
|
|
167
|
+
readiness.disappear();
|
|
168
|
+
const onDisappearing = latest.current.onDisappearing;
|
|
169
|
+
if (onDisappearing) core.executor.runSafe(()=>onDisappearing(), {
|
|
170
|
+
source: name,
|
|
171
|
+
throttleKey: `${handle.id}.onDisappearing`,
|
|
172
|
+
enableThrottle: false,
|
|
173
|
+
preventConcurrentExecution: false
|
|
174
|
+
});
|
|
175
|
+
}, [
|
|
176
|
+
active,
|
|
177
|
+
handle,
|
|
178
|
+
readiness,
|
|
179
|
+
core,
|
|
180
|
+
name
|
|
181
|
+
]);
|
|
182
|
+
const hasOnBack = void 0 !== props.onBack;
|
|
183
|
+
useEffect(()=>hasOnBack ? handle.back.push(()=>{
|
|
184
|
+
var _ref;
|
|
185
|
+
var _latest_current_onBack, _latest_current;
|
|
186
|
+
return null != (_ref = null == (_latest_current_onBack = (_latest_current = latest.current).onBack) ? void 0 : _latest_current_onBack.call(_latest_current)) ? _ref : 'pass';
|
|
187
|
+
}) : void 0, [
|
|
188
|
+
hasOnBack,
|
|
189
|
+
handle
|
|
190
|
+
]);
|
|
191
|
+
const keyboardVisible = useRef(false);
|
|
192
|
+
keyboardVisible.current = (null == keyboard ? void 0 : keyboard.visible) === true;
|
|
193
|
+
const onCaptureTap = useStableCallback((event)=>{
|
|
194
|
+
if (!keyboardVisible.current || isKeyboardTarget(event.target)) return;
|
|
195
|
+
core.services.host.hideKeyboard();
|
|
196
|
+
});
|
|
197
|
+
const cover = useSyncExternalStore(readiness.subscribe, readiness.getSnapshot).cover;
|
|
198
|
+
const effect = useSyncExternalStore(effectStore.subscribe, effectStore.getSnapshot);
|
|
199
|
+
const containers = null != (_props_layerContainers = props.layerContainers) ? _props_layerContainers : {};
|
|
200
|
+
const tapOutside = null != (_props_dismissKeyboardOnTapOutside = props.dismissKeyboardOnTapOutside) ? _props_dismissKeyboardOnTapOutside : true;
|
|
201
|
+
return <G9HostContext.Provider value={handle}>
|
|
202
|
+
<G9HostInsetsContext.Provider value={insets}>
|
|
203
|
+
<G9HostReadinessContext.Provider value={readiness}>
|
|
204
|
+
<view className={`g9-host${props.className ? ` ${props.className}` : ''}`} {...tapOutside ? {
|
|
205
|
+
'capture-bindtap': onCaptureTap
|
|
206
|
+
} : {}}>
|
|
207
|
+
<view className="g9-host__backdrop" style={{
|
|
208
|
+
backgroundColor: null != (_ref = null != (_ref1 = null == effect ? void 0 : effect.backdropColor) ? _ref1 : props.backdropColor) ? _ref : '#000000'
|
|
209
|
+
}}/>
|
|
210
|
+
<view className="g9-host__content" style={{
|
|
211
|
+
backgroundColor: null != (_props_background = props.background) ? _props_background : 'var(--g9-background)',
|
|
212
|
+
transform: effect ? `translateY(${effect.translateY}px) scale(${effect.scale})` : 'translateY(0px) scale(1)',
|
|
213
|
+
transition: `transform ${null != (_ref2 = null == effect ? void 0 : effect.durationMs) ? _ref2 : 300}ms ease-out`
|
|
214
|
+
}}>
|
|
215
|
+
{props.children}
|
|
216
|
+
</view>
|
|
217
|
+
{OVERLAY_LAYERS.map((layer)=>{
|
|
218
|
+
var _containers_layer;
|
|
219
|
+
return <HostLayer key={layer} hostId={handle.id} store={handle.layers} layer={layer} container={null != (_containers_layer = containers[layer]) ? _containers_layer : 'tree'}/>;
|
|
220
|
+
})}
|
|
221
|
+
{'hidden' === cover ? null : <G9PageLoadingOverlay exiting={'exiting' === cover} backgroundColor={settings.pageLoading.backgroundColor} spinnerColor={settings.pageLoading.spinnerColor}/>}
|
|
222
|
+
</view>
|
|
223
|
+
</G9HostReadinessContext.Provider>
|
|
224
|
+
</G9HostInsetsContext.Provider>
|
|
225
|
+
</G9HostContext.Provider>;
|
|
226
|
+
}
|
|
227
|
+
export { G9Host, G9HostContext, G9HostInsetsContext, G9HostReadinessContext };
|
|
228
|
+
|
|
229
|
+
//# sourceMappingURL=host.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host/host.jsx","sources":["../../src/host/host.tsx"],"sourcesContent":["import { type G9AbortSignal, G9Error } from '@g9tm/lynxcontrols-foundation';\nimport { OverlayView } from '@lynx-js/lynx-ui-overlay';\nimport {\n createContext,\n Fragment,\n memo,\n type ReactNode,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n useSyncExternalStore,\n} from '@lynx-js/react';\nimport { useStableCallback } from '../base/use-stable-callback';\nimport { G9KeyboardContext } from '../provider/contexts';\nimport { useG9Core, useG9SafeInsets, useG9Settings } from '../provider/hooks';\nimport { createBackStack, type G9BackResult } from './back';\nimport { isKeyboardTarget } from './keyboard';\nimport { createLayerStore, type G9LayerStore, type G9OverlayLayer, g9LayerOrder } from './layers';\nimport { G9PageLoadingOverlay } from './page-loading-overlay';\nimport { createHostReadiness, type G9HostReadinessController } from './readiness';\nimport { type G9HostContentEffect, type G9HostHandle, type G9HostInsets, hostRegistry } from './registry';\nimport './host.css';\n\n/** How a layer is mounted: in the page tree (default) or in a Lynx `<overlay>` above native views (maps, video). */\nexport type G9LayerContainer = 'tree' | 'overlay';\n\n/** Props of {@link G9Host}. */\nexport interface G9HostProps {\n readonly children?: ReactNode;\n /**\n * Whether the page is on screen (MAUI `Loaded`/`Unloaded`, tab activation). Default `true`. An inactive host stays\n * registered and becomes active again when set back to `true`; see `g9Hosts` for the resolution rule.\n */\n readonly active?: boolean;\n /** Names the page in diagnostics (the cover's busy activity is `page:<name>`). Default `'G9Host'`. */\n readonly name?: string;\n /**\n * The page's appearing work (MAUI `OnAppearingAfterParentAsync`), run through the provider's safe executor each time\n * the host becomes active; `signal` aborts when it stops being active or unmounts. On the first appearance the\n * loading cover waits for it (unless `manualRelease`).\n */\n readonly onAppearing?: (context: { readonly signal: G9AbortSignal }) => void | Promise<void>;\n /** Runs each time the host stops being active (MAUI `OnDisappearingAfterParentAsync`), guarded. */\n readonly onDisappearing?: () => void | Promise<void>;\n /** The page's own back handling (MAUI `TryHandleInAppBack`), asked after every overlay. */\n readonly onBack?: () => G9BackResult | boolean;\n /** Swallow every system back press before anything else runs (MAUI `IsHardwareBackSuppressed`). Default `false`. */\n readonly backSuppressed?: boolean;\n /** Show the page-loading cover until the page is ready (MAUI `G9PageLoadingOverlay`, always on). Default `true`. */\n readonly loadingCover?: boolean;\n /** The page releases the cover itself through `useG9HostReady().release()` (MAUI `PageLoadingManualRelease`). */\n readonly manualRelease?: boolean;\n /** Extra delay after ready (MAUI `PageLoadingDismissDelayMs`). Default `settings.pageLoading.dismissDelayMs` (369). */\n readonly dismissDelayMs?: number;\n /** Hard cap on the cover (MAUI `PageLoadingSafetyTimeoutMs`). Default `settings.pageLoading.safetyTimeoutMs` (5000). */\n readonly safetyTimeoutMs?: number;\n /** Dismiss the soft keyboard on a tap outside any keyboard target (MAUI `TapOutsideKeyboardDismisser`). Default `true`. */\n readonly dismissKeyboardOnTapOutside?: boolean;\n /** Per-layer container; a layer over a native view (map, video) needs `'overlay'`. Default `'tree'` for each. */\n readonly layerContainers?: Partial<Record<G9OverlayLayer, G9LayerContainer>>;\n /** MAUI `ComputeBottomSafeAreaWithTabBar`: the bottom inset plus the page's own tab bar. Default: the inset. */\n readonly computeBottomSafeAreaWithTabBar?: (bottomInset: number) => number;\n /** The page background (MAUI `ApplyThemedBackground`). Default `var(--g9-background)`. */\n readonly background?: string;\n /** The colour behind the content, shown when a sheet recedes the page (MAUI `BackdropHost`). Default black. */\n readonly backdropColor?: string;\n readonly className?: string;\n}\n\n/** The nearest host, for hooks. */\nexport const G9HostContext = createContext<G9HostHandle | null>(null);\n/** The nearest host's insets. */\nexport const G9HostInsetsContext = createContext<G9HostInsets | null>(null);\n/** The nearest host's readiness controller. */\nexport const G9HostReadinessContext = createContext<G9HostReadinessController | null>(null);\n\nconst OVERLAY_LAYERS = g9LayerOrder.filter((layer): layer is G9OverlayLayer => layer !== 'content');\nlet hostSequence = 0;\n\n// The inner name must differ from the binding: rslib renames `const X = memo(function X…)` with a module prefix and the\n// in-module `<X>` then compiles as an unknown intrinsic element (E20; scripts/check-dist-jsx.mjs).\nconst HostLayer = memo(function HostLayerRender(props: {\n readonly hostId: string;\n readonly store: G9LayerStore;\n readonly layer: G9OverlayLayer;\n readonly container: G9LayerContainer;\n}): ReactNode {\n const { hostId, store, layer, container } = props;\n const entries = useSyncExternalStore(\n (listener) => store.subscribe(layer, listener),\n () => store.getSnapshot(layer),\n );\n if (entries.length === 0) return null;\n const className = `g9-host__layer g9-host__layer--${layer}`;\n const items = entries.map((entry) => <Fragment key={entry.key}>{entry.element}</Fragment>);\n if (container === 'overlay') {\n return (\n <OverlayView container=\"window\" className={className} id={`${hostId}-${layer}`}>\n {items}\n </OverlayView>\n );\n }\n return <view className={className}>{items}</view>;\n});\n\n/**\n * The page frame (MAUI `G9PageBase` + `G9PageTemplate`): the content and the overlay layers in a fixed z-order\n * (`content` → `edgePanel` → `sheets` → `popups` → `feedback` → `floating`, then the loading cover), the page's back\n * stack, readiness and loading cover, safe-area insets, tap-outside keyboard dismissal, and its registration in\n * `g9Hosts` for code outside the tree. One per page; hosts may nest. Must be inside `G9Provider`.\n *\n * Layers are input-transparent (`pointer-events: none`), so empty areas pass touches to the layers below while each\n * item receives its own touches; an empty layer renders nothing.\n */\nexport function G9Host(props: G9HostProps): ReactNode {\n const core = useG9Core();\n const settings = useG9Settings();\n const parent = useContext(G9HostContext);\n const keyboard = useContext(G9KeyboardContext);\n const providerInsets = useG9SafeInsets();\n const active = props.active ?? true;\n const name = props.name ?? 'G9Host';\n\n const latest = useRef(props);\n latest.current = props;\n\n const bottomWithTabBar = props.computeBottomSafeAreaWithTabBar\n ? props.computeBottomSafeAreaWithTabBar(providerInsets.bottom)\n : providerInsets.bottom;\n const insets = useMemo<G9HostInsets>(\n () => Object.freeze({ ...providerInsets, bottomWithTabBar }),\n [providerInsets, bottomWithTabBar],\n );\n const insetsRef = useRef(insets);\n insetsRef.current = insets;\n\n const [state] = useState(() => {\n hostSequence += 1;\n const id = `g9-host-${hostSequence}`;\n const layers = createLayerStore();\n const back = createBackStack({\n isSuppressed: () => latest.current.backSuppressed === true,\n onHandlerError: (error) =>\n core.diagnostics.log({ level: 'error', message: 'A back handler threw.', source: name, error }),\n });\n const features = new Map<string, unknown>();\n let released = false;\n let contentEffect: G9HostContentEffect | null = null;\n const effectListeners = new Set<() => void>();\n const readiness = createHostReadiness({\n cover: props.loadingCover ?? true,\n manualRelease: props.manualRelease ?? false,\n dismissDelayMs: props.dismissDelayMs ?? settings.pageLoading.dismissDelayMs,\n safetyTimeoutMs: props.safetyTimeoutMs ?? settings.pageLoading.safetyTimeoutMs,\n startActivity: () => {\n const scope = core.diagnostics.activity(`page:${name}`);\n return () => scope.dispose();\n },\n runAppearing: async (signal) => {\n const onAppearing = latest.current.onAppearing;\n if (!onAppearing) return;\n await core.executor.run((context) => onAppearing({ signal: context.signal }), {\n source: name,\n throttleKey: `${id}.onAppearing`,\n enableThrottle: false,\n preventConcurrentExecution: false,\n signal,\n });\n },\n });\n const handle: G9HostHandle = {\n id,\n parent,\n services: core.services,\n layers,\n registerLayerItem(layer, item) {\n if (released) return () => {};\n return layers.register(layer, item);\n },\n removeLayerItem: (layer, key) => layers.remove(layer, key),\n back,\n getInsets: () => insetsRef.current,\n readiness,\n attachFeature(key, value) {\n if (features.has(key)) throw new G9Error('host-feature', `Host feature '${String(key)}' is already attached.`);\n features.set(key, value);\n return () => {\n if (features.get(key) === value) features.delete(key);\n };\n },\n getFeature: (key) => features.get(key) as never,\n get released() {\n return released;\n },\n setContentEffect(effect) {\n if (released || contentEffect === effect) return;\n contentEffect = effect;\n for (const listener of [...effectListeners]) listener();\n },\n getContentEffect: () => contentEffect,\n };\n const effectStore = {\n subscribe(listener: () => void) {\n effectListeners.add(listener);\n return () => {\n effectListeners.delete(listener);\n };\n },\n getSnapshot: () => contentEffect,\n };\n return {\n handle,\n readiness,\n effectStore,\n release() {\n released = true;\n features.clear();\n },\n };\n });\n const { handle, readiness, effectStore } = state;\n\n // Unmount: synchronous unregistration and release of everything the host owns.\n useEffect(\n () => () => {\n hostRegistry.remove(handle);\n readiness.dispose();\n handle.layers.clear();\n handle.back.clear();\n state.release();\n },\n [handle, readiness, state],\n );\n\n // Visibility drives the registry and the appearing/disappearing lifecycle.\n const wasActive = useRef<boolean | null>(null);\n useEffect(() => {\n const previous = wasActive.current;\n wasActive.current = active;\n if (active) {\n hostRegistry.activate(handle);\n readiness.appear();\n return;\n }\n if (previous === null) {\n hostRegistry.register(handle);\n return;\n }\n hostRegistry.markOffScreen(handle);\n readiness.disappear();\n const onDisappearing = latest.current.onDisappearing;\n if (onDisappearing) {\n core.executor.runSafe(() => onDisappearing(), {\n source: name,\n throttleKey: `${handle.id}.onDisappearing`,\n enableThrottle: false,\n preventConcurrentExecution: false,\n });\n }\n }, [active, handle, readiness, core, name]);\n\n // The page's own back handling sits in the content layer, below every overlay.\n const hasOnBack = props.onBack !== undefined;\n useEffect(\n () => (hasOnBack ? handle.back.push(() => latest.current.onBack?.() ?? 'pass') : undefined),\n [hasOnBack, handle],\n );\n\n const keyboardVisible = useRef(false);\n keyboardVisible.current = keyboard?.visible === true;\n const onCaptureTap = useStableCallback((event: { target?: { dataset?: Record<string, unknown> } }) => {\n if (!keyboardVisible.current || isKeyboardTarget(event.target)) return;\n core.services.host.hideKeyboard();\n });\n\n const cover = useSyncExternalStore(readiness.subscribe, readiness.getSnapshot).cover;\n const effect = useSyncExternalStore(effectStore.subscribe, effectStore.getSnapshot);\n const containers = props.layerContainers ?? {};\n const tapOutside = props.dismissKeyboardOnTapOutside ?? true;\n\n return (\n <G9HostContext.Provider value={handle}>\n <G9HostInsetsContext.Provider value={insets}>\n <G9HostReadinessContext.Provider value={readiness}>\n <view\n className={`g9-host${props.className ? ` ${props.className}` : ''}`}\n {...(tapOutside ? { 'capture-bindtap': onCaptureTap } : {})}\n >\n <view\n className=\"g9-host__backdrop\"\n style={{ backgroundColor: effect?.backdropColor ?? props.backdropColor ?? '#000000' }}\n />\n <view\n className=\"g9-host__content\"\n style={{\n backgroundColor: props.background ?? 'var(--g9-background)',\n transform: effect\n ? `translateY(${effect.translateY}px) scale(${effect.scale})`\n : 'translateY(0px) scale(1)',\n transition: `transform ${effect?.durationMs ?? 300}ms ease-out`,\n }}\n >\n {props.children}\n </view>\n {OVERLAY_LAYERS.map((layer) => (\n <HostLayer\n key={layer}\n hostId={handle.id}\n store={handle.layers}\n layer={layer}\n container={containers[layer] ?? 'tree'}\n />\n ))}\n {cover === 'hidden' ? null : (\n <G9PageLoadingOverlay\n exiting={cover === 'exiting'}\n backgroundColor={settings.pageLoading.backgroundColor}\n spinnerColor={settings.pageLoading.spinnerColor}\n />\n )}\n </view>\n </G9HostReadinessContext.Provider>\n </G9HostInsetsContext.Provider>\n </G9HostContext.Provider>\n );\n}\n"],"names":["G9HostContext","createContext","G9HostInsetsContext","G9HostReadinessContext","OVERLAY_LAYERS","g9LayerOrder","layer","hostSequence","HostLayer","memo","props","hostId","store","container","entries","useSyncExternalStore","listener","className","items","entry","Fragment","OverlayView","view","G9Host","_props_active","_props_name","_props_layerContainers","_props_dismissKeyboardOnTapOutside","_ref","_props_background","core","useG9Core","settings","useG9Settings","parent","useContext","keyboard","G9KeyboardContext","providerInsets","useG9SafeInsets","active","name","latest","useRef","bottomWithTabBar","insets","useMemo","Object","insetsRef","state","useState","_props_loadingCover","_props_manualRelease","_props_dismissDelayMs","_props_safetyTimeoutMs","id","layers","createLayerStore","back","createBackStack","error","features","Map","released","contentEffect","effectListeners","Set","readiness","createHostReadiness","scope","signal","onAppearing","context","handle","item","key","value","G9Error","String","effect","effectStore","useEffect","hostRegistry","wasActive","previous","onDisappearing","hasOnBack","undefined","_latest_current","keyboardVisible","onCaptureTap","useStableCallback","event","isKeyboardTarget","cover","containers","tapOutside","_containers_layer","G9PageLoadingOverlay"],"mappings":";;;;;;;;;;;;;AAwEO,MAAMA,gBAAgBC,cAAmC;AAEzD,MAAMC,sBAAsBD,cAAmC;AAE/D,MAAME,yBAAyBF,cAAgD;AAEtF,MAAMG,iBAAiBC,aAAa,MAAM,CAAC,CAACC,QAAmCA,AAAU,cAAVA;AAC/E,IAAIC,eAAe;AAInB,MAAMC,YAAYC,KAAK,SAAyBC,KAK/C;IACC,MAAM,EAAEC,MAAM,EAAEC,KAAK,EAAEN,KAAK,EAAEO,SAAS,EAAE,GAAGH;IAC5C,MAAMI,UAAUC,qBACd,CAACC,WAAaJ,MAAM,SAAS,CAACN,OAAOU,WACrC,IAAMJ,MAAM,WAAW,CAACN;IAE1B,IAAIQ,AAAmB,MAAnBA,QAAQ,MAAM,EAAQ,OAAO;IACjC,MAAMG,YAAY,CAAC,+BAA+B,EAAEX,OAAO;IAC3D,MAAMY,QAAQJ,QAAQ,GAAG,CAAC,CAACK,SAAWC,SAAS,KAAKD,MAAM,GAAG,GAAGA,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T,iBAAiB9D,SAAS,WAAW,CAAC,eAAe,EACrD,cAAcA,SAAS,WAAW,CAAC,YAAY,IAEjD;UACJ,EAAEV,KAAK;QACT,EAAEnB,uBAAuB,SAAS;MACpC,EAAED,oBAAoB,SAAS;IACjC,EAAEF,cAAc;AAEpB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { createBackStack, type G9BackHandler, type G9BackOptions, type G9BackResult, type G9BackStack, type G9BackStackOptions, } from './back.js';
|
|
2
|
+
export { type G9ActivationOptions, type G9HostReadyState, type G9UseBackOptions, type G9UseLayerItemOptions, useG9Activation, useG9Back, useG9HideKeyboard, useG9Host, useG9HostInsets, useG9HostReady, useG9LayerItem, useG9PanSoftInputMode, } from './hooks.js';
|
|
3
|
+
export { G9Host, type G9HostProps, type G9LayerContainer } from './host.js';
|
|
4
|
+
export { acquirePanSoftInputMode, g9KeyboardTargetProps, isKeyboardTarget } from './keyboard.js';
|
|
5
|
+
export { createLayerStore, G9Layer, type G9LayerEntry, type G9LayerItem, type G9LayerStore, type G9OverlayLayer, g9LayerOrder, layerRank, } from './layers.js';
|
|
6
|
+
export { G9PageLoadingOverlay, type G9PageLoadingOverlayProps } from './page-loading-overlay.js';
|
|
7
|
+
export { type G9HostReadiness, type G9HostReadinessSnapshot, g9PageLoadingExitMs, g9PageLoadingWatchdogMarginMs, } from './readiness.js';
|
|
8
|
+
export { type G9HostContentEffect, type G9HostFeatureKey, type G9HostFeatures, type G9HostHandle, type G9HostInsets, type G9HostListener, type G9HostRegistry, g9Hosts, } from './registry.js';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|