@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,218 @@
|
|
|
1
|
+
import { g9Token } from "@g9tm/lynxcontrols-foundation";
|
|
2
|
+
const G9PopupType = {
|
|
3
|
+
Information: 'information',
|
|
4
|
+
Success: 'success',
|
|
5
|
+
Warning: 'warning',
|
|
6
|
+
Error: 'error',
|
|
7
|
+
Custom: 'custom'
|
|
8
|
+
};
|
|
9
|
+
const G9PopupAnimationType = {
|
|
10
|
+
None: 'none',
|
|
11
|
+
FadeIn: 'fadeIn',
|
|
12
|
+
SlideUp: 'slideUp',
|
|
13
|
+
Bounce: 'bounce',
|
|
14
|
+
ZoomIn: 'zoomIn',
|
|
15
|
+
DropIn: 'dropIn'
|
|
16
|
+
};
|
|
17
|
+
const G9PopupAnimationEasing = {
|
|
18
|
+
Linear: 'linear',
|
|
19
|
+
SinIn: 'sinIn',
|
|
20
|
+
SinOut: 'sinOut',
|
|
21
|
+
SinInOut: 'sinInOut',
|
|
22
|
+
CubicOut: 'cubicOut',
|
|
23
|
+
BounceOut: 'bounceOut'
|
|
24
|
+
};
|
|
25
|
+
const G9PopupFooterButtonLayout = {
|
|
26
|
+
Row: 'row',
|
|
27
|
+
Stacked: 'stacked'
|
|
28
|
+
};
|
|
29
|
+
const G9PopupAutoSizeMode = {
|
|
30
|
+
Both: 'both',
|
|
31
|
+
Height: 'height',
|
|
32
|
+
Width: 'width',
|
|
33
|
+
None: 'none'
|
|
34
|
+
};
|
|
35
|
+
const G9PopupOverlayMode = {
|
|
36
|
+
Transparent: 'transparent',
|
|
37
|
+
Blur: 'blur',
|
|
38
|
+
None: 'none'
|
|
39
|
+
};
|
|
40
|
+
const G9PopupBlurIntensity = {
|
|
41
|
+
None: 'none',
|
|
42
|
+
Light: 'light',
|
|
43
|
+
ExtraLight: 'extraLight',
|
|
44
|
+
Dark: 'dark',
|
|
45
|
+
ExtraDark: 'extraDark'
|
|
46
|
+
};
|
|
47
|
+
const G9PopupRelativePosition = {
|
|
48
|
+
AlignTop: 'alignTop',
|
|
49
|
+
AlignBottom: 'alignBottom',
|
|
50
|
+
AlignLeft: 'alignLeft',
|
|
51
|
+
AlignRight: 'alignRight',
|
|
52
|
+
AlignTopLeft: 'alignTopLeft',
|
|
53
|
+
AlignTopRight: 'alignTopRight',
|
|
54
|
+
AlignBottomLeft: 'alignBottomLeft',
|
|
55
|
+
AlignBottomRight: 'alignBottomRight',
|
|
56
|
+
AlignToLeftOf: 'alignToLeftOf',
|
|
57
|
+
AlignToRightOf: 'alignToRightOf',
|
|
58
|
+
AlignToTopOf: 'alignToTopOf',
|
|
59
|
+
AlignToBottomOf: 'alignToBottomOf'
|
|
60
|
+
};
|
|
61
|
+
const G9PopupResultAction = {
|
|
62
|
+
Close: 'close',
|
|
63
|
+
DoNothing: 'doNothing',
|
|
64
|
+
ShowNext: 'showNext'
|
|
65
|
+
};
|
|
66
|
+
const g9PopupResult = Object.freeze({
|
|
67
|
+
close: (afterClose)=>({
|
|
68
|
+
action: 'close',
|
|
69
|
+
nextPopup: null,
|
|
70
|
+
afterClose: null != afterClose ? afterClose : null
|
|
71
|
+
}),
|
|
72
|
+
noAction: ()=>({
|
|
73
|
+
action: 'doNothing',
|
|
74
|
+
nextPopup: null,
|
|
75
|
+
afterClose: null
|
|
76
|
+
}),
|
|
77
|
+
showNext: (descriptor)=>({
|
|
78
|
+
action: 'showNext',
|
|
79
|
+
nextPopup: descriptor,
|
|
80
|
+
afterClose: null
|
|
81
|
+
})
|
|
82
|
+
});
|
|
83
|
+
function closePopupButton(text) {
|
|
84
|
+
return {
|
|
85
|
+
text,
|
|
86
|
+
isPrimary: true
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
function createDefaultPopupSettings() {
|
|
90
|
+
return {
|
|
91
|
+
closeOnBackgroundClick: false,
|
|
92
|
+
closeOnBackButton: true,
|
|
93
|
+
animationDuration: 240,
|
|
94
|
+
animation: 'slideUp',
|
|
95
|
+
animationEasing: 'sinOut',
|
|
96
|
+
overlayMode: 'transparent',
|
|
97
|
+
autoCloseDuration: 0,
|
|
98
|
+
showHeader: true,
|
|
99
|
+
showFooter: true,
|
|
100
|
+
showCloseButton: false,
|
|
101
|
+
footerButtonLayout: 'row',
|
|
102
|
+
autoSizeMode: 'height',
|
|
103
|
+
padding: [
|
|
104
|
+
20,
|
|
105
|
+
16,
|
|
106
|
+
20,
|
|
107
|
+
12
|
|
108
|
+
],
|
|
109
|
+
cornerRadius: 16,
|
|
110
|
+
overlayOpacity: 0.45
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
function mergePopupSettings(settings, defaults) {
|
|
114
|
+
const out = {
|
|
115
|
+
...defaults
|
|
116
|
+
};
|
|
117
|
+
for (const [k, v] of Object.entries(null != settings ? settings : {}))if (null != v) out[k] = v;
|
|
118
|
+
return out;
|
|
119
|
+
}
|
|
120
|
+
function resolvePopupSettings(descriptor, defaults) {
|
|
121
|
+
var _ref, _ref1, _ref2;
|
|
122
|
+
var _descriptor_settings;
|
|
123
|
+
const merged = mergePopupSettings(descriptor.settings, defaults);
|
|
124
|
+
const animation = null != (_ref = null != (_ref1 = null != (_ref2 = null == (_descriptor_settings = descriptor.settings) ? void 0 : _descriptor_settings.animation) ? _ref2 : descriptor.animation) ? _ref1 : defaults.animation) ? _ref : 'slideUp';
|
|
125
|
+
return {
|
|
126
|
+
...merged,
|
|
127
|
+
animation
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
function presetPopup(type, message, title, buttons, settings, animation = null) {
|
|
131
|
+
return {
|
|
132
|
+
type,
|
|
133
|
+
title: null != title ? title : null,
|
|
134
|
+
message,
|
|
135
|
+
content: null,
|
|
136
|
+
buttons: null != buttons ? buttons : [],
|
|
137
|
+
settings: null != settings ? settings : null,
|
|
138
|
+
animation
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
function customPopup(content, title, buttons, settings, animation = null, type = 'custom') {
|
|
142
|
+
return {
|
|
143
|
+
type,
|
|
144
|
+
title: null != title ? title : null,
|
|
145
|
+
message: null,
|
|
146
|
+
content,
|
|
147
|
+
buttons: null != buttons ? buttons : [],
|
|
148
|
+
settings: null != settings ? settings : null,
|
|
149
|
+
animation
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
const ACCENT = {
|
|
153
|
+
information: [
|
|
154
|
+
'Info',
|
|
155
|
+
'OnInfo'
|
|
156
|
+
],
|
|
157
|
+
success: [
|
|
158
|
+
'Success',
|
|
159
|
+
'OnSuccess'
|
|
160
|
+
],
|
|
161
|
+
warning: [
|
|
162
|
+
'Warning',
|
|
163
|
+
'OnWarning'
|
|
164
|
+
],
|
|
165
|
+
error: [
|
|
166
|
+
'Error',
|
|
167
|
+
'OnError'
|
|
168
|
+
],
|
|
169
|
+
custom: [
|
|
170
|
+
'Info',
|
|
171
|
+
'OnInfo'
|
|
172
|
+
]
|
|
173
|
+
};
|
|
174
|
+
function createPopupVisualProfile(descriptor, settings, glyphs, semantic) {
|
|
175
|
+
var _settings_iconOverride, _settings_cardBackgroundColor, _settings_borderColor, _settings_titleColor, _settings_messageColor, _settings_overlayColor, _settings_overlayOpacity, _settings_width, _settings_height, _settings_cornerRadius, _settings_padding, _ref, _settings_animation, _settings_animationDuration;
|
|
176
|
+
const [accent, onAccent] = ACCENT[descriptor.type];
|
|
177
|
+
const icon = null != (_settings_iconOverride = settings.iconOverride) ? _settings_iconOverride : 'success' === descriptor.type ? glyphs.success : 'warning' === descriptor.type ? glyphs.warning : 'error' === descriptor.type ? glyphs.error : glyphs.info;
|
|
178
|
+
const kind = 'custom' === descriptor.type ? 'information' : descriptor.type;
|
|
179
|
+
return {
|
|
180
|
+
iconColor: g9Token(accent),
|
|
181
|
+
cardBackground: null != (_settings_cardBackgroundColor = settings.cardBackgroundColor) ? _settings_cardBackgroundColor : g9Token('Surface'),
|
|
182
|
+
borderColor: null != (_settings_borderColor = settings.borderColor) ? _settings_borderColor : g9Token('Surface'),
|
|
183
|
+
titleColor: null != (_settings_titleColor = settings.titleColor) ? _settings_titleColor : g9Token(accent),
|
|
184
|
+
messageColor: null != (_settings_messageColor = settings.messageColor) ? _settings_messageColor : g9Token('OnSurface'),
|
|
185
|
+
buttonBackground: g9Token(accent),
|
|
186
|
+
buttonTextColor: g9Token(onAccent),
|
|
187
|
+
overlayColor: null != (_settings_overlayColor = settings.overlayColor) ? _settings_overlayColor : g9Token('Scrim'),
|
|
188
|
+
overlayOpacity: null != (_settings_overlayOpacity = settings.overlayOpacity) ? _settings_overlayOpacity : 0.45,
|
|
189
|
+
width: null != (_settings_width = settings.width) ? _settings_width : null,
|
|
190
|
+
height: null != (_settings_height = settings.height) ? _settings_height : null,
|
|
191
|
+
cornerRadius: null != (_settings_cornerRadius = settings.cornerRadius) ? _settings_cornerRadius : 16,
|
|
192
|
+
padding: null != (_settings_padding = settings.padding) ? _settings_padding : [
|
|
193
|
+
20,
|
|
194
|
+
16,
|
|
195
|
+
20,
|
|
196
|
+
12
|
|
197
|
+
],
|
|
198
|
+
icon,
|
|
199
|
+
animation: null != (_ref = null != (_settings_animation = settings.animation) ? _settings_animation : descriptor.animation) ? _ref : 'slideUp',
|
|
200
|
+
animationDuration: null != (_settings_animationDuration = settings.animationDuration) ? _settings_animationDuration : 300,
|
|
201
|
+
semanticIconDescription: semantic(kind)
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
function popupScrimOpacity(mode, opacity, blur) {
|
|
205
|
+
if ('none' === mode) return 0;
|
|
206
|
+
if ('blur' !== mode) return opacity;
|
|
207
|
+
const extra = {
|
|
208
|
+
none: 0,
|
|
209
|
+
light: 0.05,
|
|
210
|
+
extraLight: 0.1,
|
|
211
|
+
dark: 0.15,
|
|
212
|
+
extraDark: 0.2
|
|
213
|
+
}[blur];
|
|
214
|
+
return Math.min(1, opacity + extra);
|
|
215
|
+
}
|
|
216
|
+
export { G9PopupAnimationEasing, G9PopupAnimationType, G9PopupAutoSizeMode, G9PopupBlurIntensity, G9PopupFooterButtonLayout, G9PopupOverlayMode, G9PopupRelativePosition, G9PopupResultAction, G9PopupType, closePopupButton, createDefaultPopupSettings, createPopupVisualProfile, customPopup, g9PopupResult, mergePopupSettings, popupScrimOpacity, presetPopup, resolvePopupSettings };
|
|
217
|
+
|
|
218
|
+
//# sourceMappingURL=types.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popup/types.jsx","sources":["../../src/popup/types.ts"],"sourcesContent":["import type { G9ImageSource } from '@g9tm/lynxcontrols-foundation';\nimport { type G9ColorToken, g9Token } from '@g9tm/lynxcontrols-foundation';\nimport type { ReactNode } from '@lynx-js/react';\nimport type { G9IconInput } from '../icon/icon';\n\n// Popup data types (MAUI `G9PopupType`, `G9PopupButton`, `G9PopupResult`, `G9PopupDescriptor`, `G9PopupSettings`,\n// `G9PopupVisualProfile` and the G9PopupView enums).\n\n/** Popup kind (MAUI `G9PopupType`): the accent, icon and semantics. */\nexport const G9PopupType = {\n Information: 'information',\n Success: 'success',\n Warning: 'warning',\n Error: 'error',\n Custom: 'custom',\n} as const;\nexport type G9PopupType = (typeof G9PopupType)[keyof typeof G9PopupType];\n\n/** Card motion (MAUI `G9PopupAnimationType`). */\nexport const G9PopupAnimationType = {\n None: 'none',\n FadeIn: 'fadeIn',\n SlideUp: 'slideUp',\n Bounce: 'bounce',\n ZoomIn: 'zoomIn',\n DropIn: 'dropIn',\n} as const;\nexport type G9PopupAnimationType = (typeof G9PopupAnimationType)[keyof typeof G9PopupAnimationType];\n\n/** Easing of the card motion (MAUI `G9PopupViewAnimationEasing`). */\nexport const G9PopupAnimationEasing = {\n Linear: 'linear',\n SinIn: 'sinIn',\n SinOut: 'sinOut',\n SinInOut: 'sinInOut',\n CubicOut: 'cubicOut',\n BounceOut: 'bounceOut',\n} as const;\nexport type G9PopupAnimationEasing = (typeof G9PopupAnimationEasing)[keyof typeof G9PopupAnimationEasing];\n\n/** Footer arrangement (MAUI `G9PopupFooterButtonLayout`). */\nexport const G9PopupFooterButtonLayout = { Row: 'row', Stacked: 'stacked' } as const;\nexport type G9PopupFooterButtonLayout = (typeof G9PopupFooterButtonLayout)[keyof typeof G9PopupFooterButtonLayout];\n\n/** Card sizing (MAUI `G9PopupViewAutoSizeMode`). */\nexport const G9PopupAutoSizeMode = { Both: 'both', Height: 'height', Width: 'width', None: 'none' } as const;\nexport type G9PopupAutoSizeMode = (typeof G9PopupAutoSizeMode)[keyof typeof G9PopupAutoSizeMode];\n\n/** Scrim (MAUI `G9PopupViewOverlayMode`); `'none'` = non-modal (taps pass through to the page). */\nexport const G9PopupOverlayMode = { Transparent: 'transparent', Blur: 'blur', None: 'none' } as const;\nexport type G9PopupOverlayMode = (typeof G9PopupOverlayMode)[keyof typeof G9PopupOverlayMode];\n\n/** Blur strength (MAUI `G9PopupViewBlurIntensity`); G9 has no blur: it darkens the scrim (MAUI's fallback). */\nexport const G9PopupBlurIntensity = {\n None: 'none',\n Light: 'light',\n ExtraLight: 'extraLight',\n Dark: 'dark',\n ExtraDark: 'extraDark',\n} as const;\nexport type G9PopupBlurIntensity = (typeof G9PopupBlurIntensity)[keyof typeof G9PopupBlurIntensity];\n\n/** Card placement against an anchor (MAUI `G9PopupViewRelativePosition`). */\nexport const G9PopupRelativePosition = {\n AlignTop: 'alignTop',\n AlignBottom: 'alignBottom',\n AlignLeft: 'alignLeft',\n AlignRight: 'alignRight',\n AlignTopLeft: 'alignTopLeft',\n AlignTopRight: 'alignTopRight',\n AlignBottomLeft: 'alignBottomLeft',\n AlignBottomRight: 'alignBottomRight',\n AlignToLeftOf: 'alignToLeftOf',\n AlignToRightOf: 'alignToRightOf',\n AlignToTopOf: 'alignToTopOf',\n AlignToBottomOf: 'alignToBottomOf',\n} as const;\nexport type G9PopupRelativePosition = (typeof G9PopupRelativePosition)[keyof typeof G9PopupRelativePosition];\n\n/** What happens after a button callback (MAUI `G9PopupResultAction`). */\nexport const G9PopupResultAction = { Close: 'close', DoNothing: 'doNothing', ShowNext: 'showNext' } as const;\nexport type G9PopupResultAction = (typeof G9PopupResultAction)[keyof typeof G9PopupResultAction];\n\n/** A button callback's answer (MAUI `G9PopupResult`). */\nexport interface G9PopupResult {\n readonly action: G9PopupResultAction;\n /** With `showNext`: the popup shown right after this one closes. */\n readonly nextPopup: G9PopupDescriptor | null;\n /** Runs after the close motion; the queue does not wait for it (a popup it requests shows at once). */\n readonly afterClose: (() => unknown) | null;\n}\n\n/** Builders of {@link G9PopupResult} (MAUI `G9PopupResult.Close/NoAction/ShowNext`). */\nexport const g9PopupResult = Object.freeze({\n close: (afterClose?: (() => unknown) | null): G9PopupResult => ({\n action: 'close',\n nextPopup: null,\n afterClose: afterClose ?? null,\n }),\n noAction: (): G9PopupResult => ({ action: 'doNothing', nextPopup: null, afterClose: null }),\n showNext: (descriptor: G9PopupDescriptor): G9PopupResult => ({\n action: 'showNext',\n nextPopup: descriptor,\n afterClose: null,\n }),\n});\n\n/** Abort state handed to a callback; `aborted` turns true when the popup was dismissed while it ran. */\nexport interface G9PopupCallbackContext {\n readonly aborted: boolean;\n}\n\n/** A footer button (MAUI `G9PopupButton`). */\nexport interface G9PopupButton {\n readonly text: string;\n /** Runs once per tap (the footer gate); returning nothing closes the popup. */\n readonly callback?: // biome-ignore lint/suspicious/noConfusingVoidType: a callback may return nothing (= close)\n ((context: G9PopupCallbackContext) => G9PopupResult | void | Promise<G9PopupResult | void>) | null;\n /** Filled accent button; false = outline. Default true (MAUI). */\n readonly isPrimary?: boolean;\n readonly icon?: G9IconInput;\n readonly iconImage?: G9ImageSource | null;\n readonly textColor?: string | null;\n readonly backgroundColor?: string | null;\n /** Test/automation id (MAUI `AutomationId`). */\n readonly testId?: string | null;\n}\n\n/** A plain close button (MAUI `G9PopupButton.CloseButton(text)`). */\nexport function closePopupButton(text: string): G9PopupButton {\n return { text, isPrimary: true };\n}\n\n/** Per-popup settings; every field optional, merged over the app defaults (MAUI `G9PopupSettings`). */\nexport interface G9PopupSettings {\n readonly closeOnBackgroundClick?: boolean;\n readonly closeOnBackButton?: boolean;\n readonly animationDuration?: number;\n readonly animation?: G9PopupAnimationType;\n readonly animationEasing?: G9PopupAnimationEasing;\n readonly autoSizeMode?: G9PopupAutoSizeMode;\n readonly overlayMode?: G9PopupOverlayMode;\n /** Close after this many ms (0 = never). */\n readonly autoCloseDuration?: number;\n readonly showHeader?: boolean;\n readonly showFooter?: boolean;\n readonly footerButtonLayout?: G9PopupFooterButtonLayout;\n /** × in the header corner. */\n readonly showCloseButton?: boolean;\n readonly width?: number | null;\n readonly height?: number | null;\n /** `[left, top, right, bottom]` (physical, like MAUI `Thickness`). */\n readonly padding?: readonly [number, number, number, number];\n readonly cornerRadius?: number;\n readonly overlayOpacity?: number;\n readonly overlayColor?: string | null;\n readonly cardBackgroundColor?: string | null;\n readonly borderColor?: string | null;\n readonly titleColor?: string | null;\n readonly messageColor?: string | null;\n readonly iconOverride?: G9IconInput;\n readonly blurIntensity?: G9PopupBlurIntensity;\n}\n\n/** The library defaults (MAUI `G9PopupSettings.CreateDefault`). */\nexport function createDefaultPopupSettings(): Required<\n Omit<\n G9PopupSettings,\n | 'width'\n | 'height'\n | 'overlayColor'\n | 'cardBackgroundColor'\n | 'borderColor'\n | 'titleColor'\n | 'messageColor'\n | 'iconOverride'\n | 'blurIntensity'\n >\n> &\n G9PopupSettings {\n return {\n closeOnBackgroundClick: false,\n closeOnBackButton: true,\n animationDuration: 240,\n animation: 'slideUp',\n animationEasing: 'sinOut',\n overlayMode: 'transparent',\n autoCloseDuration: 0,\n showHeader: true,\n showFooter: true,\n showCloseButton: false,\n footerButtonLayout: 'row',\n autoSizeMode: 'height',\n padding: [20, 16, 20, 12],\n cornerRadius: 16,\n overlayOpacity: 0.45,\n };\n}\n\n/** Field by field, `settings` wins over `defaults` (MAUI `WithDefaults`). */\nexport function mergePopupSettings(\n settings: G9PopupSettings | null | undefined,\n defaults: G9PopupSettings,\n): G9PopupSettings {\n const out: Record<string, unknown> = { ...defaults };\n for (const [k, v] of Object.entries(settings ?? {})) if (v !== undefined && v !== null) out[k] = v;\n return out as G9PopupSettings;\n}\n\n/**\n * The effective settings of a popup (MAUI `ResolveSettings`): per-call settings over the app defaults; the motion is\n * the per-call setting, else the descriptor's, else the app default (MAUI ignored a configured default animation\n * because every helper passed SlideUp explicitly; here it applies).\n */\nexport function resolvePopupSettings(descriptor: G9PopupDescriptor, defaults: G9PopupSettings): G9PopupSettings {\n const merged = mergePopupSettings(descriptor.settings, defaults);\n const animation = descriptor.settings?.animation ?? descriptor.animation ?? defaults.animation ?? 'slideUp';\n return { ...merged, animation };\n}\n\n/** Popup body: a message or any content (MAUI `CustomView`). */\nexport interface G9PopupDescriptor {\n readonly type: G9PopupType;\n readonly title: string | null;\n readonly message: string | null;\n /** Custom body (built once per show; a factory is called when the card mounts). */\n readonly content: ReactNode | (() => ReactNode) | null;\n readonly buttons: ReadonlyArray<G9PopupButton>;\n readonly settings: G9PopupSettings | null;\n /** Motion of this popup; `null` = the settings' (per call, then app default). */\n readonly animation: G9PopupAnimationType | null;\n}\n\n/** A preset popup (MAUI `G9PopupDescriptor.ForPreset`). */\nexport function presetPopup(\n type: G9PopupType,\n message: string,\n title?: string | null,\n buttons?: ReadonlyArray<G9PopupButton> | null,\n settings?: G9PopupSettings | null,\n animation: G9PopupAnimationType | null = null,\n): G9PopupDescriptor {\n return {\n type,\n title: title ?? null,\n message,\n content: null,\n buttons: buttons ?? [],\n settings: settings ?? null,\n animation,\n };\n}\n\n/** A custom-content popup (MAUI `G9PopupDescriptor.ForCustom`). */\nexport function customPopup(\n content: ReactNode | (() => ReactNode),\n title?: string | null,\n buttons?: ReadonlyArray<G9PopupButton> | null,\n settings?: G9PopupSettings | null,\n animation: G9PopupAnimationType | null = null,\n type: G9PopupType = 'custom',\n): G9PopupDescriptor {\n return {\n type,\n title: title ?? null,\n message: null,\n content,\n buttons: buttons ?? [],\n settings: settings ?? null,\n animation,\n };\n}\n\n/** Resolved look of one popup (MAUI `G9PopupVisualProfile`). */\nexport interface G9PopupVisualProfile {\n readonly iconColor: string;\n readonly cardBackground: string;\n readonly borderColor: string;\n readonly titleColor: string;\n readonly messageColor: string;\n readonly buttonBackground: string;\n readonly buttonTextColor: string;\n readonly overlayColor: string;\n readonly overlayOpacity: number;\n readonly width: number | null;\n readonly height: number | null;\n readonly cornerRadius: number;\n readonly padding: readonly [number, number, number, number];\n readonly icon: G9IconInput;\n readonly animation: G9PopupAnimationType;\n readonly animationDuration: number;\n /** Localizable accessibility name of the type (`'Information'`, …). */\n readonly semanticIconDescription: string;\n}\n\nconst ACCENT: Record<G9PopupType, [G9ColorToken, G9ColorToken]> = {\n information: ['Info', 'OnInfo'],\n success: ['Success', 'OnSuccess'],\n warning: ['Warning', 'OnWarning'],\n error: ['Error', 'OnError'],\n custom: ['Info', 'OnInfo'],\n};\n\n/**\n * Resolves a popup's look (MAUI `G9PopupVisualProfile.Create`): each type takes its own semantic accent (never\n * Primary) for icon, title and the filled button, the button text takes the matching `On*` token, the scrim is the\n * `Scrim` token at `overlayOpacity`. Settings override colours, icon, size, radius, padding and motion.\n */\nexport function createPopupVisualProfile(\n descriptor: G9PopupDescriptor,\n settings: G9PopupSettings,\n glyphs: {\n readonly info: G9IconInput;\n readonly success: G9IconInput;\n readonly warning: G9IconInput;\n readonly error: G9IconInput;\n },\n semantic: (type: 'information' | 'success' | 'warning' | 'error') => string,\n): G9PopupVisualProfile {\n const [accent, onAccent] = ACCENT[descriptor.type];\n const icon =\n settings.iconOverride ??\n (descriptor.type === 'success'\n ? glyphs.success\n : descriptor.type === 'warning'\n ? glyphs.warning\n : descriptor.type === 'error'\n ? glyphs.error\n : glyphs.info);\n const kind = descriptor.type === 'custom' ? 'information' : descriptor.type;\n return {\n iconColor: g9Token(accent),\n cardBackground: settings.cardBackgroundColor ?? g9Token('Surface'),\n borderColor: settings.borderColor ?? g9Token('Surface'),\n titleColor: settings.titleColor ?? g9Token(accent),\n messageColor: settings.messageColor ?? g9Token('OnSurface'),\n buttonBackground: g9Token(accent),\n buttonTextColor: g9Token(onAccent),\n overlayColor: settings.overlayColor ?? g9Token('Scrim'),\n overlayOpacity: settings.overlayOpacity ?? 0.45,\n width: settings.width ?? null,\n height: settings.height ?? null,\n cornerRadius: settings.cornerRadius ?? 16,\n padding: settings.padding ?? [20, 16, 20, 12],\n icon,\n animation: settings.animation ?? descriptor.animation ?? 'slideUp',\n animationDuration: settings.animationDuration ?? 300,\n semanticIconDescription: semantic(kind),\n };\n}\n\n/** The scrim opacity of a mode (MAUI `Blur` fallback: a darker scrim by intensity; `none` = no scrim). */\nexport function popupScrimOpacity(mode: G9PopupOverlayMode, opacity: number, blur: G9PopupBlurIntensity): number {\n if (mode === 'none') return 0;\n if (mode !== 'blur') return opacity;\n const extra = { none: 0, light: 0.05, extraLight: 0.1, dark: 0.15, extraDark: 0.2 }[blur];\n return Math.min(1, opacity + extra);\n}\n"],"names":["G9PopupType","G9PopupAnimationType","G9PopupAnimationEasing","G9PopupFooterButtonLayout","G9PopupAutoSizeMode","G9PopupOverlayMode","G9PopupBlurIntensity","G9PopupRelativePosition","G9PopupResultAction","g9PopupResult","Object","afterClose","descriptor","closePopupButton","text","createDefaultPopupSettings","mergePopupSettings","settings","defaults","out","k","v","resolvePopupSettings","_ref","merged","animation","presetPopup","type","message","title","buttons","customPopup","content","ACCENT","createPopupVisualProfile","glyphs","semantic","_settings_iconOverride","_settings_cardBackgroundColor","_settings_borderColor","_settings_titleColor","_settings_messageColor","_settings_overlayColor","_settings_overlayOpacity","_settings_width","_settings_height","_settings_cornerRadius","_settings_padding","_settings_animationDuration","accent","onAccent","icon","kind","g9Token","popupScrimOpacity","mode","opacity","blur","extra","Math"],"mappings":"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"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { G9Capabilities, G9Culture, G9CultureStore, G9Diagnostics, G9Preferences, G9SafeExecutor, G9SafeInsets, G9Strings, G9ThemeStore } from '@g9tm/lynxcontrols-foundation';
|
|
2
|
+
import type { G9ResolvedSettings } from './settings.js';
|
|
3
|
+
/** What `useG9Culture` and `useG9Strings` read: the snapshot and the strings built for it. */
|
|
4
|
+
export interface G9CultureContextValue {
|
|
5
|
+
readonly culture: G9Culture;
|
|
6
|
+
readonly strings: G9Strings;
|
|
7
|
+
readonly store: G9CultureStore;
|
|
8
|
+
}
|
|
9
|
+
/** Soft-keyboard state (plan/specs/02 §4 `keyboardstatuschanged`). Heights are in the units the platform reports. */
|
|
10
|
+
export interface G9KeyboardState {
|
|
11
|
+
/** `true` between a `'on'` and the next `'off'`. */
|
|
12
|
+
readonly visible: boolean;
|
|
13
|
+
/** Keyboard height; `0` while hidden. */
|
|
14
|
+
readonly height: number;
|
|
15
|
+
/** The platform's compatibility height (Lynx `compatHeight`); `0` while hidden or when not reported. */
|
|
16
|
+
readonly compatHeight: number;
|
|
17
|
+
}
|
|
18
|
+
/** Window size in logical pixels (MAUI `G9ScreenHelper.WidthInDip` / `HeightInDip`). */
|
|
19
|
+
export interface G9WindowState {
|
|
20
|
+
readonly width: number;
|
|
21
|
+
readonly height: number;
|
|
22
|
+
}
|
|
23
|
+
/** Everything a provider shares that never changes identity while it is mounted. */
|
|
24
|
+
export interface G9ProviderCore {
|
|
25
|
+
readonly services: G9Capabilities;
|
|
26
|
+
readonly themeStore: G9ThemeStore;
|
|
27
|
+
readonly preferences: G9Preferences;
|
|
28
|
+
readonly diagnostics: G9Diagnostics;
|
|
29
|
+
readonly executor: G9SafeExecutor;
|
|
30
|
+
/** Id of the provider's root `<view>` (the element carrying the theme variables). */
|
|
31
|
+
readonly rootId: string;
|
|
32
|
+
}
|
|
33
|
+
export declare const G9CoreContext: import("react").Context<G9ProviderCore | null>;
|
|
34
|
+
export declare const G9CultureContext: import("react").Context<G9CultureContextValue | null>;
|
|
35
|
+
export declare const G9SettingsContext: import("react").Context<G9ResolvedSettings | null>;
|
|
36
|
+
export declare const G9KeyboardContext: import("react").Context<G9KeyboardState | null>;
|
|
37
|
+
export declare const G9WindowContext: import("react").Context<G9WindowState | null>;
|
|
38
|
+
export declare const G9InsetsContext: import("react").Context<G9SafeInsets | null>;
|
|
39
|
+
/** The provider's diagnostics hub, or `null` outside a provider (base hooks fall back to `console`). */
|
|
40
|
+
export declare const G9DiagnosticsContext: import("react").Context<G9Diagnostics | null>;
|
|
41
|
+
//# sourceMappingURL=contexts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contexts.d.ts","sourceRoot":"","sources":["../../src/provider/contexts.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,cAAc,EACd,SAAS,EACT,cAAc,EACd,aAAa,EACb,aAAa,EACb,cAAc,EACd,YAAY,EACZ,SAAS,EACT,YAAY,EACb,MAAM,+BAA+B,CAAC;AAEvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD,8FAA8F;AAC9F,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;CAChC;AAED,qHAAqH;AACrH,MAAM,WAAW,eAAe;IAC9B,oDAAoD;IACpD,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,yCAAyC;IACzC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,wGAAwG;IACxG,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAED,wFAAwF;AACxF,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,oFAAoF;AACpF,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;IAClC,QAAQ,CAAC,UAAU,EAAE,YAAY,CAAC;IAClC,QAAQ,CAAC,WAAW,EAAE,aAAa,CAAC;IACpC,QAAQ,CAAC,WAAW,EAAE,aAAa,CAAC;IACpC,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;IAClC,qFAAqF;IACrF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,eAAO,MAAM,aAAa,gDAA6C,CAAC;AACxE,eAAO,MAAM,gBAAgB,uDAAoD,CAAC;AAClF,eAAO,MAAM,iBAAiB,oDAAiD,CAAC;AAChF,eAAO,MAAM,iBAAiB,iDAA8C,CAAC;AAC7E,eAAO,MAAM,eAAe,+CAA4C,CAAC;AACzE,eAAO,MAAM,eAAe,8CAA2C,CAAC;AACxE,wGAAwG;AACxG,eAAO,MAAM,oBAAoB,+CAA4C,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createContext } from "@lynx-js/react";
|
|
2
|
+
const G9CoreContext = createContext(null);
|
|
3
|
+
const G9CultureContext = createContext(null);
|
|
4
|
+
const G9SettingsContext = createContext(null);
|
|
5
|
+
const G9KeyboardContext = createContext(null);
|
|
6
|
+
const G9WindowContext = createContext(null);
|
|
7
|
+
const G9InsetsContext = createContext(null);
|
|
8
|
+
const G9DiagnosticsContext = createContext(null);
|
|
9
|
+
export { G9CoreContext, G9CultureContext, G9DiagnosticsContext, G9InsetsContext, G9KeyboardContext, G9SettingsContext, G9WindowContext };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=contexts.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider/contexts.jsx","sources":["../../src/provider/contexts.ts"],"sourcesContent":["// React contexts behind G9Provider. One context per kind of change, so a consumer re-renders only for what it reads:\n// the theme store and services never change identity, culture changes re-render culture readers, keyboard and window\n// changes re-render only their readers (plan/specs/01 §5).\n\nimport type {\n G9Capabilities,\n G9Culture,\n G9CultureStore,\n G9Diagnostics,\n G9Preferences,\n G9SafeExecutor,\n G9SafeInsets,\n G9Strings,\n G9ThemeStore,\n} from '@g9tm/lynxcontrols-foundation';\nimport { createContext } from '@lynx-js/react';\nimport type { G9ResolvedSettings } from './settings';\n\n/** What `useG9Culture` and `useG9Strings` read: the snapshot and the strings built for it. */\nexport interface G9CultureContextValue {\n readonly culture: G9Culture;\n readonly strings: G9Strings;\n readonly store: G9CultureStore;\n}\n\n/** Soft-keyboard state (plan/specs/02 §4 `keyboardstatuschanged`). Heights are in the units the platform reports. */\nexport interface G9KeyboardState {\n /** `true` between a `'on'` and the next `'off'`. */\n readonly visible: boolean;\n /** Keyboard height; `0` while hidden. */\n readonly height: number;\n /** The platform's compatibility height (Lynx `compatHeight`); `0` while hidden or when not reported. */\n readonly compatHeight: number;\n}\n\n/** Window size in logical pixels (MAUI `G9ScreenHelper.WidthInDip` / `HeightInDip`). */\nexport interface G9WindowState {\n readonly width: number;\n readonly height: number;\n}\n\n/** Everything a provider shares that never changes identity while it is mounted. */\nexport interface G9ProviderCore {\n readonly services: G9Capabilities;\n readonly themeStore: G9ThemeStore;\n readonly preferences: G9Preferences;\n readonly diagnostics: G9Diagnostics;\n readonly executor: G9SafeExecutor;\n /** Id of the provider's root `<view>` (the element carrying the theme variables). */\n readonly rootId: string;\n}\n\nexport const G9CoreContext = createContext<G9ProviderCore | null>(null);\nexport const G9CultureContext = createContext<G9CultureContextValue | null>(null);\nexport const G9SettingsContext = createContext<G9ResolvedSettings | null>(null);\nexport const G9KeyboardContext = createContext<G9KeyboardState | null>(null);\nexport const G9WindowContext = createContext<G9WindowState | null>(null);\nexport const G9InsetsContext = createContext<G9SafeInsets | null>(null);\n/** The provider's diagnostics hub, or `null` outside a provider (base hooks fall back to `console`). */\nexport const G9DiagnosticsContext = createContext<G9Diagnostics | null>(null);\n"],"names":["G9CoreContext","createContext","G9CultureContext","G9SettingsContext","G9KeyboardContext","G9WindowContext","G9InsetsContext","G9DiagnosticsContext"],"mappings":";AAoDO,MAAMA,gBAAgBC,cAAqC;AAC3D,MAAMC,mBAAmBD,cAA4C;AACrE,MAAME,oBAAoBF,cAAyC;AACnE,MAAMG,oBAAoBH,cAAsC;AAChE,MAAMI,kBAAkBJ,cAAoC;AAC5D,MAAMK,kBAAkBL,cAAmC;AAE3D,MAAMM,uBAAuBN,cAAoC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adds a global event listener; returns the function that removes exactly it. A host that cannot provide the event
|
|
3
|
+
* does not take the app down: the Lynx core enables keyboard detection through a native module when a
|
|
4
|
+
* `keyboardstatuschanged` listener is added, and a windowless Lynxtron has no such module (it throws). Then
|
|
5
|
+
* `onUnavailable` is told and the event simply never arrives.
|
|
6
|
+
*/
|
|
7
|
+
export declare function addGlobalListener<TArgs extends unknown[]>(name: string, listener: (...args: TArgs) => void, onUnavailable?: (error: unknown) => void): () => void;
|
|
8
|
+
//# sourceMappingURL=global-events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global-events.d.ts","sourceRoot":"","sources":["../../src/provider/global-events.ts"],"names":[],"mappings":"AAYA;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,SAAS,OAAO,EAAE,EACvD,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,KAAK,IAAI,EAClC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GACvC,MAAM,IAAI,CAUZ"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
function emitter() {
|
|
2
|
+
return lynx.getJSModule('GlobalEventEmitter');
|
|
3
|
+
}
|
|
4
|
+
function addGlobalListener(name, listener, onUnavailable) {
|
|
5
|
+
const target = emitter();
|
|
6
|
+
const handler = listener;
|
|
7
|
+
try {
|
|
8
|
+
target.addListener(name, handler);
|
|
9
|
+
} catch (error) {
|
|
10
|
+
null == onUnavailable || onUnavailable(error);
|
|
11
|
+
return ()=>{};
|
|
12
|
+
}
|
|
13
|
+
return ()=>target.removeListener(name, handler);
|
|
14
|
+
}
|
|
15
|
+
export { addGlobalListener };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=global-events.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider/global-events.jsx","sources":["../../src/provider/global-events.ts"],"sourcesContent":["// Lynx global events (plan/specs/02 §4): `keyboardstatuschanged`, `onWindowResize`, and the host's back event arrive\n// through the `GlobalEventEmitter` JS module on the background thread.\n\ninterface GlobalEventEmitter {\n addListener(name: string, listener: (...args: never[]) => void): void;\n removeListener(name: string, listener: (...args: never[]) => void): void;\n}\n\nfunction emitter(): GlobalEventEmitter {\n return lynx.getJSModule('GlobalEventEmitter') as unknown as GlobalEventEmitter;\n}\n\n/**\n * Adds a global event listener; returns the function that removes exactly it. A host that cannot provide the event\n * does not take the app down: the Lynx core enables keyboard detection through a native module when a\n * `keyboardstatuschanged` listener is added, and a windowless Lynxtron has no such module (it throws). Then\n * `onUnavailable` is told and the event simply never arrives.\n */\nexport function addGlobalListener<TArgs extends unknown[]>(\n name: string,\n listener: (...args: TArgs) => void,\n onUnavailable?: (error: unknown) => void,\n): () => void {\n const target = emitter();\n const handler = listener as unknown as (...args: never[]) => void;\n try {\n target.addListener(name, handler);\n } catch (error) {\n onUnavailable?.(error);\n return () => {};\n }\n return () => target.removeListener(name, handler);\n}\n"],"names":["emitter","lynx","addGlobalListener","name","listener","onUnavailable","target","handler","error"],"mappings":"AAQA,SAASA;IACP,OAAOC,KAAK,WAAW,CAAC;AAC1B;AAQO,SAASC,kBACdC,IAAY,EACZC,QAAkC,EAClCC,aAAwC;IAExC,MAAMC,SAASN;IACf,MAAMO,UAAUH;IAChB,IAAI;QACFE,OAAO,WAAW,CAACH,MAAMI;IAC3B,EAAE,OAAOC,OAAO;QACdH,QAAAA,iBAAAA,cAAgBG;QAChB,OAAO,KAAO;IAChB;IACA,OAAO,IAAMF,OAAO,cAAc,CAACH,MAAMI;AAC3C"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type G9Capabilities, type G9CapabilityName, type G9Culture, type G9CultureStore, type G9Diagnostics, type G9Direction, type G9Preferences, type G9ResolvedTheme, type G9SafeExecutor, type G9SafeInsets, type G9Strings, type G9ThemeStore } from '@g9tm/lynxcontrols-foundation';
|
|
2
|
+
import { type G9KeyboardState, type G9ProviderCore, type G9WindowState } from './contexts.js';
|
|
3
|
+
import type { G9ResolvedSettings } from './settings.js';
|
|
4
|
+
/** The provider's shared core (services, stores, executor). Throws `provider-missing` outside a provider. */
|
|
5
|
+
export declare function useG9Core(): G9ProviderCore;
|
|
6
|
+
/** The active culture (MAUI `G9Culture.CurrentCulture`). Re-renders when it changes. */
|
|
7
|
+
export declare function useG9Culture(): G9Culture;
|
|
8
|
+
/** The culture's layout direction; every G9 component root sets it explicitly (plan/specs/02 §2). */
|
|
9
|
+
export declare function useG9Direction(): G9Direction;
|
|
10
|
+
/** The strings of the active culture (MAUI `G9Strings`). Re-renders when culture or string settings change. */
|
|
11
|
+
export declare function useG9Strings(): G9Strings;
|
|
12
|
+
/** The culture store, to switch culture (MAUI `G9Culture.Configure` / `SetCulture`). Does not re-render. */
|
|
13
|
+
export declare function useG9CultureStore(): G9CultureStore;
|
|
14
|
+
/**
|
|
15
|
+
* The resolved theme (scheme and palette). Only components that call this re-render on a theme change; everything
|
|
16
|
+
* else follows through CSS variables.
|
|
17
|
+
*/
|
|
18
|
+
export declare function useG9Theme(): G9ResolvedTheme;
|
|
19
|
+
/** The theme store, to switch mode or palettes (MAUI `G9Theme.ChangeTheme`). Does not re-render. */
|
|
20
|
+
export declare function useG9ThemeStore(): G9ThemeStore;
|
|
21
|
+
/** The app-wide settings with defaults filled in. */
|
|
22
|
+
export declare function useG9Settings(): G9ResolvedSettings;
|
|
23
|
+
/**
|
|
24
|
+
* A service the component cannot work without (MAUI `G9ServiceProvider.GetService<T>`).
|
|
25
|
+
* @throws {G9CapabilityMissingError} naming it when the app did not supply it.
|
|
26
|
+
*/
|
|
27
|
+
export declare function useG9Service<K extends G9CapabilityName>(name: K): NonNullable<G9Capabilities[K]>;
|
|
28
|
+
/** An optional service, or `undefined` (MAUI `GetServiceNullable<T>`): features hide themselves without it. */
|
|
29
|
+
export declare function useG9OptionalService<K extends G9CapabilityName>(name: K): G9Capabilities[K] | undefined;
|
|
30
|
+
/** Whether the app supplied the capability. */
|
|
31
|
+
export declare function useG9Capability(name: G9CapabilityName): boolean;
|
|
32
|
+
/** The provider's diagnostics hub. */
|
|
33
|
+
export declare function useG9Diagnostics(): G9Diagnostics;
|
|
34
|
+
/** The provider's preferences (namespace `g9controls.`). */
|
|
35
|
+
export declare function useG9Preferences(): G9Preferences;
|
|
36
|
+
/** The provider's shared safe executor (MAUI `G9SafeCommand`): one throttle/concurrency table per app. */
|
|
37
|
+
export declare function useG9Executor(): G9SafeExecutor;
|
|
38
|
+
/** Soft-keyboard state `{ visible, height, compatHeight }`; re-renders only its readers. */
|
|
39
|
+
export declare function useG9Keyboard(): G9KeyboardState;
|
|
40
|
+
/** Window size and the MAUI `G9ScreenHelper.CanFit` test. */
|
|
41
|
+
export interface G9WindowInfo extends G9WindowState {
|
|
42
|
+
/** `true` when the window is at least `width` logical pixels wide. */
|
|
43
|
+
canFit(width: number): boolean;
|
|
44
|
+
}
|
|
45
|
+
/** The window size (MAUI `G9ScreenHelper`); re-renders on `onWindowResize`. */
|
|
46
|
+
export declare function useG9Window(): G9WindowInfo;
|
|
47
|
+
/** The platform safe-area insets from the host service; re-renders when they change. */
|
|
48
|
+
export declare function useG9SafeInsets(): G9SafeInsets;
|
|
49
|
+
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/provider/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,WAAW,EAEhB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,YAAY,EAGlB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAKL,KAAK,eAAe,EACpB,KAAK,cAAc,EAGnB,KAAK,aAAa,EACnB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAYrD,6GAA6G;AAC7G,wBAAgB,SAAS,IAAI,cAAc,CAE1C;AAED,wFAAwF;AACxF,wBAAgB,YAAY,IAAI,SAAS,CAExC;AAED,qGAAqG;AACrG,wBAAgB,cAAc,IAAI,WAAW,CAE5C;AAED,+GAA+G;AAC/G,wBAAgB,YAAY,IAAI,SAAS,CAExC;AAED,4GAA4G;AAC5G,wBAAgB,iBAAiB,IAAI,cAAc,CAElD;AAED;;;GAGG;AACH,wBAAgB,UAAU,IAAI,eAAe,CAG5C;AAED,oGAAoG;AACpG,wBAAgB,eAAe,IAAI,YAAY,CAE9C;AAED,qDAAqD;AACrD,wBAAgB,aAAa,IAAI,kBAAkB,CAElD;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,gBAAgB,EAAE,IAAI,EAAE,CAAC,GAAG,WAAW,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAEhG;AAED,+GAA+G;AAC/G,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,gBAAgB,EAAE,IAAI,EAAE,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,GAAG,SAAS,CAGvG;AAED,+CAA+C;AAC/C,wBAAgB,eAAe,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAE/D;AAED,sCAAsC;AACtC,wBAAgB,gBAAgB,IAAI,aAAa,CAEhD;AAED,4DAA4D;AAC5D,wBAAgB,gBAAgB,IAAI,aAAa,CAEhD;AAED,0GAA0G;AAC1G,wBAAgB,aAAa,IAAI,cAAc,CAE9C;AAED,4FAA4F;AAC5F,wBAAgB,aAAa,IAAI,eAAe,CAE/C;AAED,6DAA6D;AAC7D,MAAM,WAAW,YAAa,SAAQ,aAAa;IACjD,sEAAsE;IACtE,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;CAChC;AAED,+EAA+E;AAC/E,wBAAgB,WAAW,IAAI,YAAY,CAG1C;AAED,wFAAwF;AACxF,wBAAgB,eAAe,IAAI,YAAY,CAE9C"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { G9Error, hasCapability, requireCapability } from "@g9tm/lynxcontrols-foundation";
|
|
2
|
+
import { useContext, useSyncExternalStore } from "@lynx-js/react";
|
|
3
|
+
import { G9CoreContext, G9CultureContext, G9InsetsContext, G9KeyboardContext, G9SettingsContext, G9WindowContext } from "./contexts.jsx";
|
|
4
|
+
function missing(hook) {
|
|
5
|
+
return new G9Error('provider-missing', `${hook} must be used inside <G9Provider>.`);
|
|
6
|
+
}
|
|
7
|
+
function useRequired(context, hook) {
|
|
8
|
+
const value = useContext(context);
|
|
9
|
+
if (null === value) throw missing(hook);
|
|
10
|
+
return value;
|
|
11
|
+
}
|
|
12
|
+
function useG9Core() {
|
|
13
|
+
return useRequired(G9CoreContext, 'useG9Core');
|
|
14
|
+
}
|
|
15
|
+
function useG9Culture() {
|
|
16
|
+
return useRequired(G9CultureContext, 'useG9Culture').culture;
|
|
17
|
+
}
|
|
18
|
+
function useG9Direction() {
|
|
19
|
+
return useRequired(G9CultureContext, 'useG9Direction').culture.direction;
|
|
20
|
+
}
|
|
21
|
+
function useG9Strings() {
|
|
22
|
+
return useRequired(G9CultureContext, 'useG9Strings').strings;
|
|
23
|
+
}
|
|
24
|
+
function useG9CultureStore() {
|
|
25
|
+
return useRequired(G9CultureContext, 'useG9CultureStore').store;
|
|
26
|
+
}
|
|
27
|
+
function useG9Theme() {
|
|
28
|
+
const store = useRequired(G9CoreContext, 'useG9Theme').themeStore;
|
|
29
|
+
return useSyncExternalStore(store.subscribe, store.getSnapshot);
|
|
30
|
+
}
|
|
31
|
+
function useG9ThemeStore() {
|
|
32
|
+
return useRequired(G9CoreContext, 'useG9ThemeStore').themeStore;
|
|
33
|
+
}
|
|
34
|
+
function useG9Settings() {
|
|
35
|
+
return useRequired(G9SettingsContext, 'useG9Settings');
|
|
36
|
+
}
|
|
37
|
+
function useG9Service(name) {
|
|
38
|
+
return requireCapability(useG9Core().services, name);
|
|
39
|
+
}
|
|
40
|
+
function useG9OptionalService(name) {
|
|
41
|
+
const services = useG9Core().services;
|
|
42
|
+
return hasCapability(services, name) ? services[name] : void 0;
|
|
43
|
+
}
|
|
44
|
+
function useG9Capability(name) {
|
|
45
|
+
return hasCapability(useG9Core().services, name);
|
|
46
|
+
}
|
|
47
|
+
function useG9Diagnostics() {
|
|
48
|
+
return useG9Core().diagnostics;
|
|
49
|
+
}
|
|
50
|
+
function useG9Preferences() {
|
|
51
|
+
return useG9Core().preferences;
|
|
52
|
+
}
|
|
53
|
+
function useG9Executor() {
|
|
54
|
+
return useG9Core().executor;
|
|
55
|
+
}
|
|
56
|
+
function useG9Keyboard() {
|
|
57
|
+
return useRequired(G9KeyboardContext, 'useG9Keyboard');
|
|
58
|
+
}
|
|
59
|
+
function useG9Window() {
|
|
60
|
+
const window = useRequired(G9WindowContext, 'useG9Window');
|
|
61
|
+
return {
|
|
62
|
+
width: window.width,
|
|
63
|
+
height: window.height,
|
|
64
|
+
canFit: (width)=>window.width >= width
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
function useG9SafeInsets() {
|
|
68
|
+
return useRequired(G9InsetsContext, 'useG9SafeInsets');
|
|
69
|
+
}
|
|
70
|
+
export { useG9Capability, useG9Core, useG9Culture, useG9CultureStore, useG9Diagnostics, useG9Direction, useG9Executor, useG9Keyboard, useG9OptionalService, useG9Preferences, useG9SafeInsets, useG9Service, useG9Settings, useG9Strings, useG9Theme, useG9ThemeStore, useG9Window };
|
|
71
|
+
|
|
72
|
+
//# sourceMappingURL=hooks.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider/hooks.jsx","sources":["../../src/provider/hooks.ts"],"sourcesContent":["import {\n type G9Capabilities,\n type G9CapabilityName,\n type G9Culture,\n type G9CultureStore,\n type G9Diagnostics,\n type G9Direction,\n G9Error,\n type G9Preferences,\n type G9ResolvedTheme,\n type G9SafeExecutor,\n type G9SafeInsets,\n type G9Strings,\n type G9ThemeStore,\n hasCapability,\n requireCapability,\n} from '@g9tm/lynxcontrols-foundation';\nimport { type Context, useContext, useSyncExternalStore } from '@lynx-js/react';\nimport {\n G9CoreContext,\n G9CultureContext,\n G9InsetsContext,\n G9KeyboardContext,\n type G9KeyboardState,\n type G9ProviderCore,\n G9SettingsContext,\n G9WindowContext,\n type G9WindowState,\n} from './contexts';\nimport type { G9ResolvedSettings } from './settings';\n\nfunction missing(hook: string): G9Error {\n return new G9Error('provider-missing', `${hook} must be used inside <G9Provider>.`);\n}\n\nfunction useRequired<T>(context: Context<T | null>, hook: string): T {\n const value = useContext(context);\n if (value === null) throw missing(hook);\n return value;\n}\n\n/** The provider's shared core (services, stores, executor). Throws `provider-missing` outside a provider. */\nexport function useG9Core(): G9ProviderCore {\n return useRequired(G9CoreContext, 'useG9Core');\n}\n\n/** The active culture (MAUI `G9Culture.CurrentCulture`). Re-renders when it changes. */\nexport function useG9Culture(): G9Culture {\n return useRequired(G9CultureContext, 'useG9Culture').culture;\n}\n\n/** The culture's layout direction; every G9 component root sets it explicitly (plan/specs/02 §2). */\nexport function useG9Direction(): G9Direction {\n return useRequired(G9CultureContext, 'useG9Direction').culture.direction;\n}\n\n/** The strings of the active culture (MAUI `G9Strings`). Re-renders when culture or string settings change. */\nexport function useG9Strings(): G9Strings {\n return useRequired(G9CultureContext, 'useG9Strings').strings;\n}\n\n/** The culture store, to switch culture (MAUI `G9Culture.Configure` / `SetCulture`). Does not re-render. */\nexport function useG9CultureStore(): G9CultureStore {\n return useRequired(G9CultureContext, 'useG9CultureStore').store;\n}\n\n/**\n * The resolved theme (scheme and palette). Only components that call this re-render on a theme change; everything\n * else follows through CSS variables.\n */\nexport function useG9Theme(): G9ResolvedTheme {\n const store = useRequired(G9CoreContext, 'useG9Theme').themeStore;\n return useSyncExternalStore(store.subscribe, store.getSnapshot);\n}\n\n/** The theme store, to switch mode or palettes (MAUI `G9Theme.ChangeTheme`). Does not re-render. */\nexport function useG9ThemeStore(): G9ThemeStore {\n return useRequired(G9CoreContext, 'useG9ThemeStore').themeStore;\n}\n\n/** The app-wide settings with defaults filled in. */\nexport function useG9Settings(): G9ResolvedSettings {\n return useRequired(G9SettingsContext, 'useG9Settings');\n}\n\n/**\n * A service the component cannot work without (MAUI `G9ServiceProvider.GetService<T>`).\n * @throws {G9CapabilityMissingError} naming it when the app did not supply it.\n */\nexport function useG9Service<K extends G9CapabilityName>(name: K): NonNullable<G9Capabilities[K]> {\n return requireCapability(useG9Core().services, name);\n}\n\n/** An optional service, or `undefined` (MAUI `GetServiceNullable<T>`): features hide themselves without it. */\nexport function useG9OptionalService<K extends G9CapabilityName>(name: K): G9Capabilities[K] | undefined {\n const services = useG9Core().services;\n return hasCapability(services, name) ? services[name] : undefined;\n}\n\n/** Whether the app supplied the capability. */\nexport function useG9Capability(name: G9CapabilityName): boolean {\n return hasCapability(useG9Core().services, name);\n}\n\n/** The provider's diagnostics hub. */\nexport function useG9Diagnostics(): G9Diagnostics {\n return useG9Core().diagnostics;\n}\n\n/** The provider's preferences (namespace `g9controls.`). */\nexport function useG9Preferences(): G9Preferences {\n return useG9Core().preferences;\n}\n\n/** The provider's shared safe executor (MAUI `G9SafeCommand`): one throttle/concurrency table per app. */\nexport function useG9Executor(): G9SafeExecutor {\n return useG9Core().executor;\n}\n\n/** Soft-keyboard state `{ visible, height, compatHeight }`; re-renders only its readers. */\nexport function useG9Keyboard(): G9KeyboardState {\n return useRequired(G9KeyboardContext, 'useG9Keyboard');\n}\n\n/** Window size and the MAUI `G9ScreenHelper.CanFit` test. */\nexport interface G9WindowInfo extends G9WindowState {\n /** `true` when the window is at least `width` logical pixels wide. */\n canFit(width: number): boolean;\n}\n\n/** The window size (MAUI `G9ScreenHelper`); re-renders on `onWindowResize`. */\nexport function useG9Window(): G9WindowInfo {\n const window = useRequired(G9WindowContext, 'useG9Window');\n return { width: window.width, height: window.height, canFit: (width) => window.width >= width };\n}\n\n/** The platform safe-area insets from the host service; re-renders when they change. */\nexport function useG9SafeInsets(): G9SafeInsets {\n return useRequired(G9InsetsContext, 'useG9SafeInsets');\n}\n"],"names":["missing","hook","G9Error","useRequired","context","value","useContext","useG9Core","G9CoreContext","useG9Culture","G9CultureContext","useG9Direction","useG9Strings","useG9CultureStore","useG9Theme","store","useSyncExternalStore","useG9ThemeStore","useG9Settings","G9SettingsContext","useG9Service","name","requireCapability","useG9OptionalService","services","hasCapability","undefined","useG9Capability","useG9Diagnostics","useG9Preferences","useG9Executor","useG9Keyboard","G9KeyboardContext","useG9Window","window","G9WindowContext","width","useG9SafeInsets","G9InsetsContext"],"mappings":";;;AA+BA,SAASA,QAAQC,IAAY;IAC3B,OAAO,IAAIC,QAAQ,oBAAoB,GAAGD,KAAK,kCAAkC,CAAC;AACpF;AAEA,SAASE,YAAeC,OAA0B,EAAEH,IAAY;IAC9D,MAAMI,QAAQC,WAAWF;IACzB,IAAIC,AAAU,SAAVA,OAAgB,MAAML,QAAQC;IAClC,OAAOI;AACT;AAGO,SAASE;IACd,OAAOJ,YAAYK,eAAe;AACpC;AAGO,SAASC;IACd,OAAON,YAAYO,kBAAkB,gBAAgB,OAAO;AAC9D;AAGO,SAASC;IACd,OAAOR,YAAYO,kBAAkB,kBAAkB,OAAO,CAAC,SAAS;AAC1E;AAGO,SAASE;IACd,OAAOT,YAAYO,kBAAkB,gBAAgB,OAAO;AAC9D;AAGO,SAASG;IACd,OAAOV,YAAYO,kBAAkB,qBAAqB,KAAK;AACjE;AAMO,SAASI;IACd,MAAMC,QAAQZ,YAAYK,eAAe,cAAc,UAAU;IACjE,OAAOQ,qBAAqBD,MAAM,SAAS,EAAEA,MAAM,WAAW;AAChE;AAGO,SAASE;IACd,OAAOd,YAAYK,eAAe,mBAAmB,UAAU;AACjE;AAGO,SAASU;IACd,OAAOf,YAAYgB,mBAAmB;AACxC;AAMO,SAASC,aAAyCC,IAAO;IAC9D,OAAOC,kBAAkBf,YAAY,QAAQ,EAAEc;AACjD;AAGO,SAASE,qBAAiDF,IAAO;IACtE,MAAMG,WAAWjB,YAAY,QAAQ;IACrC,OAAOkB,cAAcD,UAAUH,QAAQG,QAAQ,CAACH,KAAK,GAAGK;AAC1D;AAGO,SAASC,gBAAgBN,IAAsB;IACpD,OAAOI,cAAclB,YAAY,QAAQ,EAAEc;AAC7C;AAGO,SAASO;IACd,OAAOrB,YAAY,WAAW;AAChC;AAGO,SAASsB;IACd,OAAOtB,YAAY,WAAW;AAChC;AAGO,SAASuB;IACd,OAAOvB,YAAY,QAAQ;AAC7B;AAGO,SAASwB;IACd,OAAO5B,YAAY6B,mBAAmB;AACxC;AASO,SAASC;IACd,MAAMC,SAAS/B,YAAYgC,iBAAiB;IAC5C,OAAO;QAAE,OAAOD,OAAO,KAAK;QAAE,QAAQA,OAAO,MAAM;QAAE,QAAQ,CAACE,QAAUF,OAAO,KAAK,IAAIE;IAAM;AAChG;AAGO,SAASC;IACd,OAAOlC,YAAYmC,iBAAiB;AACtC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type { G9CultureContextValue, G9KeyboardState, G9ProviderCore, G9WindowState } from './contexts.js';
|
|
2
|
+
export { type G9WindowInfo, useG9Capability, useG9Core, useG9Culture, useG9CultureStore, useG9Diagnostics, useG9Direction, useG9Executor, useG9Keyboard, useG9OptionalService, useG9Preferences, useG9SafeInsets, useG9Service, useG9Settings, useG9Strings, useG9Theme, useG9ThemeStore, useG9Window, } from './hooks.js';
|
|
3
|
+
export { G9Provider, type G9ProviderProps } from './provider.js';
|
|
4
|
+
export { type G9ExecutorSettings, type G9FieldSettings, type G9ImageRenderer, type G9PageLoadingSettings, type G9ResolvedSettings, type G9Settings, g9DefaultBackEventName, g9PageLoadingDismissDelayMs, g9PageLoadingSafetyTimeoutMs, resolveSettings, } from './settings.js';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/provider/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,qBAAqB,EAAE,eAAe,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACxG,OAAO,EACL,KAAK,YAAY,EACjB,eAAe,EACf,SAAS,EACT,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,aAAa,EACb,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,UAAU,EACV,eAAe,EACf,WAAW,GACZ,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAC9D,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,UAAU,EACf,sBAAsB,EACtB,2BAA2B,EAC3B,4BAA4B,EAC5B,eAAe,GAChB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { useG9Capability, useG9Core, useG9Culture, useG9CultureStore, useG9Diagnostics, useG9Direction, useG9Executor, useG9Keyboard, useG9OptionalService, useG9Preferences, useG9SafeInsets, useG9Service, useG9Settings, useG9Strings, useG9Theme, useG9ThemeStore, useG9Window } from "./hooks.jsx";
|
|
2
|
+
export { G9Provider } from "./provider.jsx";
|
|
3
|
+
export { g9DefaultBackEventName, g9PageLoadingDismissDelayMs, g9PageLoadingSafetyTimeoutMs, resolveSettings } from "./settings.jsx";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["webpack://./src/provider/provider.css"],"names":[],"mappings":"AACA;EAAE,sBAAsB;EACtB,OAAO;EACP,WAAW;EACX,YAAY;EACZ,aAAa;AACf;;AAIA;EADE,cAAc;AAChB;;AAIA;EADE,cAAc;AAChB","sourcesContent":["/* G9Provider root: fills the LynxView and carries the theme variables (set inline / with setProperty). */\n.g9-provider {\n display: flex;\n flex-direction: column;\n flex: 1;\n width: 100%;\n height: 100%;\n}\n\n/* direction does not inherit in Lynx (plan/specs/02 §2): every G9 root sets it; these are the provider's. */\n.g9-dir-ltr {\n direction: ltr;\n}\n\n.g9-dir-rtl {\n direction: rtl;\n}\n"],"sourceRoot":""}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { type G9Capabilities, type G9ColorScheme, type G9Culture, type G9CultureStore, type G9Diagnostics, type G9ThemeOptions, type G9ThemeStore } from '@g9tm/lynxcontrols-foundation';
|
|
2
|
+
import { type ReactNode } from '@lynx-js/react';
|
|
3
|
+
import { type G9Settings } from './settings.js';
|
|
4
|
+
import './provider.css';
|
|
5
|
+
import './theme.css';
|
|
6
|
+
/** Props of {@link G9Provider}. */
|
|
7
|
+
export interface G9ProviderProps {
|
|
8
|
+
/**
|
|
9
|
+
* The app's platform services (plan/specs/01 §8). `clock`, `preferences` and `host` are required: a missing one
|
|
10
|
+
* throws `G9CapabilityMissingError` naming it when the provider mounts. Pass a stable object.
|
|
11
|
+
*/
|
|
12
|
+
readonly services: Partial<G9Capabilities>;
|
|
13
|
+
/**
|
|
14
|
+
* The culture: a store the app drives (`createCultureStore`), or a culture value / locale tag the provider keeps in
|
|
15
|
+
* its own store (a new value switches it). Default `'en'`.
|
|
16
|
+
*/
|
|
17
|
+
readonly culture?: G9CultureStore | G9Culture | string;
|
|
18
|
+
/**
|
|
19
|
+
* The theme: a store the app drives (`createThemeStore`), or options for the provider's own store (changes to
|
|
20
|
+
* `mode`, `systemScheme`, `palettes`, `overrides` are applied to it). Default: system mode, stock palettes.
|
|
21
|
+
*/
|
|
22
|
+
readonly theme?: G9ThemeStore | G9ThemeOptions;
|
|
23
|
+
/** The platform's current colour scheme (MAUI `RequestedThemeChanged`); followed while the mode is `'system'`. */
|
|
24
|
+
readonly systemScheme?: G9ColorScheme;
|
|
25
|
+
/**
|
|
26
|
+
* Save the theme mode in preferences and restore it at mount (MAUI `G9Theme.ChangeTheme` / `Init`, key
|
|
27
|
+
* `g9controls.theme`, values 0 system, 1 light, 2 dark). Default `true`.
|
|
28
|
+
*/
|
|
29
|
+
readonly persistTheme?: boolean;
|
|
30
|
+
/** App-wide settings (plan/specs/03 §6). Validated at mount and on change. */
|
|
31
|
+
readonly settings?: G9Settings;
|
|
32
|
+
/** The diagnostics hub. Default: a hub the provider creates. */
|
|
33
|
+
readonly diagnostics?: G9Diagnostics;
|
|
34
|
+
readonly className?: string;
|
|
35
|
+
readonly children?: ReactNode;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The root every G9 component lives in (plan/specs/01 §5, MAUI `G9Theme`/`G9Culture`/`G9Strings` statics,
|
|
39
|
+
* `G9ServiceProvider`, `G9ScreenHelper`, `G9KeyboardHelper`): culture and strings, the theme as CSS variables on one
|
|
40
|
+
* root `<view>`, settings, services and capabilities, the diagnostics hub, the shared safe executor, keyboard, window
|
|
41
|
+
* and safe-area state, and the dispatch of the system back event to the active `G9Host`. Mount it once per LynxView.
|
|
42
|
+
*
|
|
43
|
+
* - A theme change updates the root's CSS variables with `setProperty`: nothing re-renders except `useG9Theme`
|
|
44
|
+
* readers. A culture change re-renders culture readers.
|
|
45
|
+
* - One `keyboardstatuschanged` and one `onWindowResize` listener for the whole tree.
|
|
46
|
+
* - The back event (`settings.backEventName`, default `g9:back`) goes to the active host's back stack; when nothing
|
|
47
|
+
* handles it, `services.host.exit()` runs (desktop hosts send the same event for Escape).
|
|
48
|
+
* - Unmounting removes every listener, subscription and timer it created.
|
|
49
|
+
*/
|
|
50
|
+
export declare function G9Provider(props: G9ProviderProps): ReactNode;
|
|
51
|
+
//# sourceMappingURL=provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/provider/provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,cAAc,EACnB,KAAK,aAAa,EAElB,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,aAAa,EAGlB,KAAK,cAAc,EACnB,KAAK,YAAY,EAIlB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,KAAK,SAAS,EAA8D,MAAM,gBAAgB,CAAC;AAgB5G,OAAO,EAAE,KAAK,UAAU,EAA4C,MAAM,YAAY,CAAC;AAEvF,OAAO,gBAAgB,CAAC;AACxB,OAAO,aAAa,CAAC;AAErB,mCAAmC;AACnC,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;IAC3C;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,SAAS,GAAG,MAAM,CAAC;IACvD;;;OAGG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,YAAY,GAAG,cAAc,CAAC;IAC/C,kHAAkH;IAClH,QAAQ,CAAC,YAAY,CAAC,EAAE,aAAa,CAAC;IACtC;;;OAGG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAChC,8EAA8E;IAC9E,QAAQ,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC;IAC/B,gEAAgE;IAChE,QAAQ,CAAC,WAAW,CAAC,EAAE,aAAa,CAAC;IACrC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;CAC/B;AA6BD;;;;;;;;;;;;GAYG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,SAAS,CA8N5D"}
|