@g9tm/lynxcontrols 1.7.3 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -5
- package/dist/.tsbuildinfo +1 -1
- package/dist/anchor/context.jsx +0 -2
- package/dist/anchor/hooks.d.ts.map +1 -1
- package/dist/anchor/hooks.jsx +6 -4
- package/dist/anchor/measure.jsx +0 -2
- package/dist/anchor/registry.d.ts +12 -2
- package/dist/anchor/registry.d.ts.map +1 -1
- package/dist/anchor/registry.jsx +11 -3
- package/dist/anchor/scroll.jsx +0 -2
- package/dist/base/control.d.ts +18 -2
- package/dist/base/control.d.ts.map +1 -1
- package/dist/base/control.jsx +16 -9
- package/dist/base/corner-badge.jsx +0 -2
- package/dist/base/disposer.jsx +0 -2
- package/dist/base/index.d.ts +3 -2
- package/dist/base/index.d.ts.map +1 -1
- package/dist/base/index.jsx +3 -2
- package/dist/base/press.css +83 -0
- package/dist/base/press.css.map +1 -0
- package/dist/base/press.d.ts +13 -2
- package/dist/base/press.d.ts.map +1 -1
- package/dist/base/press.jsx +49 -5
- package/dist/base/pressable.d.ts +10 -1
- package/dist/base/pressable.d.ts.map +1 -1
- package/dist/base/pressable.jsx +13 -8
- package/dist/base/selection-item.jsx +0 -2
- package/dist/base/timers.jsx +0 -2
- package/dist/base/tone.d.ts +15 -0
- package/dist/base/tone.d.ts.map +1 -0
- package/dist/base/tone.jsx +71 -0
- package/dist/base/use-controllable-state.jsx +0 -2
- package/dist/base/use-stable-callback.jsx +0 -2
- package/dist/button/button-variants.css +236 -0
- package/dist/button/button-variants.css.map +1 -0
- package/dist/button/button.css +21 -0
- package/dist/button/button.css.map +1 -1
- package/dist/button/button.d.ts +13 -1
- package/dist/button/button.d.ts.map +1 -1
- package/dist/button/button.jsx +51 -38
- package/dist/button/header-action-button.d.ts +1 -0
- package/dist/button/header-action-button.d.ts.map +1 -1
- package/dist/button/header-action-button.jsx +6 -7
- package/dist/button/icon-button.d.ts +11 -1
- package/dist/button/icon-button.d.ts.map +1 -1
- package/dist/button/icon-button.jsx +21 -17
- package/dist/button/nav-card.d.ts +1 -0
- package/dist/button/nav-card.d.ts.map +1 -1
- package/dist/button/nav-card.jsx +6 -7
- package/dist/button/safe-tap.jsx +0 -2
- package/dist/button/safe.jsx +3 -5
- package/dist/button/variant-css.d.ts +8 -0
- package/dist/button/variant-css.d.ts.map +1 -0
- package/dist/button/variant-css.jsx +47 -0
- package/dist/button/vertical-icon-text-button.d.ts.map +1 -1
- package/dist/button/vertical-icon-text-button.jsx +1 -3
- package/dist/button/visuals.d.ts +7 -1
- package/dist/button/visuals.d.ts.map +1 -1
- package/dist/button/visuals.jsx +5 -5
- package/dist/cascade/cascade-panel.jsx +0 -2
- package/dist/cascade/model.jsx +0 -2
- package/dist/commands/commands.css +167 -0
- package/dist/commands/commands.css.map +1 -0
- package/dist/commands/index.d.ts +3 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.jsx +2 -0
- package/dist/commands/keys.d.ts +22 -0
- package/dist/commands/keys.d.ts.map +1 -0
- package/dist/commands/keys.jsx +119 -0
- package/dist/commands/palette.d.ts +62 -0
- package/dist/commands/palette.d.ts.map +1 -0
- package/dist/commands/palette.jsx +175 -0
- package/dist/deferred/deferred-content.jsx +2 -4
- package/dist/deferred/readiness-signal.jsx +0 -2
- package/dist/display/activity-indicator.jsx +0 -2
- package/dist/display/culture-date-time-label.jsx +1 -3
- package/dist/display/extras.css +117 -0
- package/dist/display/extras.css.map +1 -0
- package/dist/display/extras.d.ts +65 -0
- package/dist/display/extras.d.ts.map +1 -0
- package/dist/display/extras.jsx +118 -0
- package/dist/display/figures-index.d.ts +3 -0
- package/dist/display/figures-index.d.ts.map +1 -0
- package/dist/display/figures-index.jsx +2 -0
- package/dist/display/figures.css +249 -0
- package/dist/display/figures.css.map +1 -0
- package/dist/display/figures.d.ts +132 -0
- package/dist/display/figures.d.ts.map +1 -0
- package/dist/display/figures.jsx +223 -0
- package/dist/display/image.css +46 -0
- package/dist/display/image.css.map +1 -0
- package/dist/display/image.d.ts +32 -0
- package/dist/display/image.d.ts.map +1 -0
- package/dist/display/image.jsx +49 -0
- package/dist/display/index.d.ts +6 -0
- package/dist/display/index.d.ts.map +1 -1
- package/dist/display/index.jsx +6 -0
- package/dist/display/keycap.css +32 -0
- package/dist/display/keycap.css.map +1 -0
- package/dist/display/keycap.d.ts +20 -0
- package/dist/display/keycap.d.ts.map +1 -0
- package/dist/display/keycap.jsx +17 -0
- package/dist/display/motion-figures.css +168 -0
- package/dist/display/motion-figures.css.map +1 -0
- package/dist/display/motion-figures.d.ts +155 -0
- package/dist/display/motion-figures.d.ts.map +1 -0
- package/dist/display/motion-figures.jsx +246 -0
- package/dist/display/progress-bar.jsx +1 -3
- package/dist/display/separator.d.ts.map +1 -1
- package/dist/display/separator.jsx +2 -4
- package/dist/display/shimmer.jsx +0 -2
- package/dist/display/skeleton.css +72 -0
- package/dist/display/skeleton.css.map +1 -0
- package/dist/display/status.css +111 -0
- package/dist/display/status.css.map +1 -0
- package/dist/display/status.d.ts +67 -0
- package/dist/display/status.d.ts.map +1 -0
- package/dist/display/status.jsx +117 -0
- package/dist/display/theme-preview.css +244 -0
- package/dist/display/theme-preview.css.map +1 -0
- package/dist/display/theme-preview.d.ts +19 -0
- package/dist/display/theme-preview.d.ts.map +1 -0
- package/dist/display/theme-preview.jsx +89 -0
- package/dist/display/title-with-line.d.ts.map +1 -1
- package/dist/display/title-with-line.jsx +2 -4
- package/dist/edge-panel/edge-panel.jsx +0 -2
- package/dist/edge-panel/helper.jsx +0 -2
- package/dist/edge-panel/types.jsx +0 -2
- package/dist/effects/effects.css +94 -0
- package/dist/effects/effects.css.map +1 -0
- package/dist/effects/effects.d.ts +83 -0
- package/dist/effects/effects.d.ts.map +1 -0
- package/dist/effects/effects.jsx +183 -0
- package/dist/effects/index.d.ts +2 -0
- package/dist/effects/index.d.ts.map +1 -0
- package/dist/effects/index.jsx +1 -0
- package/dist/expander/expander.d.ts +1 -0
- package/dist/expander/expander.d.ts.map +1 -1
- package/dist/expander/expander.jsx +22 -23
- package/dist/fields/dictation.jsx +0 -2
- package/dist/fields/editor.jsx +2 -4
- package/dist/fields/extra-entries.css +133 -0
- package/dist/fields/extra-entries.css.map +1 -0
- package/dist/fields/extra-entries.d.ts +98 -0
- package/dist/fields/extra-entries.d.ts.map +1 -0
- package/dist/fields/extra-entries.jsx +323 -0
- package/dist/fields/fields.css +4 -0
- package/dist/fields/fields.css.map +1 -1
- package/dist/fields/index.d.ts +4 -3
- package/dist/fields/index.d.ts.map +1 -1
- package/dist/fields/index.jsx +1 -0
- package/dist/fields/input-policy.jsx +0 -2
- package/dist/fields/notch.jsx +0 -2
- package/dist/fields/outlined-field.d.ts +9 -0
- package/dist/fields/outlined-field.d.ts.map +1 -1
- package/dist/fields/outlined-field.jsx +10 -8
- package/dist/fields/pin-entry.d.ts.map +1 -1
- package/dist/fields/pin-entry.jsx +11 -13
- package/dist/fields/search-entry.jsx +2 -4
- package/dist/fields/slot-layout.jsx +0 -2
- package/dist/fields/text-entry.jsx +2 -4
- package/dist/fields/use-dictation.jsx +0 -2
- package/dist/fields/use-text-input.d.ts +1 -1
- package/dist/fields/use-text-input.jsx +0 -2
- package/dist/fields/validator.jsx +0 -2
- package/dist/guide/confirm-sheet.jsx +0 -2
- package/dist/guide/journey.jsx +0 -2
- package/dist/guide/placement.jsx +0 -2
- package/dist/guide/service.jsx +0 -2
- package/dist/guide/settings.jsx +0 -2
- package/dist/header/app-bar.d.ts +35 -0
- package/dist/header/app-bar.d.ts.map +1 -0
- package/dist/header/app-bar.jsx +64 -0
- package/dist/header/header.css +79 -0
- package/dist/header/header.css.map +1 -0
- package/dist/header/index.d.ts +2 -0
- package/dist/header/index.d.ts.map +1 -0
- package/dist/header/index.jsx +1 -0
- package/dist/host/back.jsx +0 -2
- package/dist/host/hooks.jsx +0 -2
- package/dist/host/host.css +1 -0
- package/dist/host/host.css.map +1 -1
- package/dist/host/host.d.ts.map +1 -1
- package/dist/host/host.jsx +50 -17
- package/dist/host/keyboard.jsx +0 -2
- package/dist/host/layers.jsx +0 -2
- package/dist/host/page-loading-overlay.jsx +0 -2
- package/dist/host/readiness.jsx +0 -2
- package/dist/host/registry.d.ts +9 -0
- package/dist/host/registry.d.ts.map +1 -1
- package/dist/host/registry.jsx +0 -2
- package/dist/icon/icon.d.ts +16 -0
- package/dist/icon/icon.d.ts.map +1 -1
- package/dist/icon/icon.jsx +53 -14
- package/dist/icon/index.d.ts +1 -1
- package/dist/icon/index.d.ts.map +1 -1
- package/dist/icon/index.jsx +1 -1
- package/dist/icon/slot.jsx +0 -2
- package/dist/icon/swatch.jsx +0 -2
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/layout/containers.d.ts +113 -0
- package/dist/layout/containers.d.ts.map +1 -0
- package/dist/layout/containers.jsx +195 -0
- package/dist/layout/index.d.ts +4 -0
- package/dist/layout/index.d.ts.map +1 -0
- package/dist/layout/index.jsx +3 -0
- package/dist/layout/layout.css +361 -0
- package/dist/layout/layout.css.map +1 -0
- package/dist/layout/scroll-spy.d.ts +18 -0
- package/dist/layout/scroll-spy.d.ts.map +1 -0
- package/dist/layout/scroll-spy.jsx +38 -0
- package/dist/layout/scrollers.d.ts +96 -0
- package/dist/layout/scrollers.d.ts.map +1 -0
- package/dist/layout/scrollers.jsx +208 -0
- package/dist/list/gestures.d.ts +40 -0
- package/dist/list/gestures.d.ts.map +1 -0
- package/dist/list/gestures.jsx +142 -0
- package/dist/list/index.d.ts +4 -0
- package/dist/list/index.d.ts.map +1 -0
- package/dist/list/index.jsx +3 -0
- package/dist/list/list.css +194 -0
- package/dist/list/list.css.map +1 -0
- package/dist/list/rows.d.ts +69 -0
- package/dist/list/rows.d.ts.map +1 -0
- package/dist/list/rows.jsx +105 -0
- package/dist/list/virtual-list.d.ts +94 -0
- package/dist/list/virtual-list.d.ts.map +1 -0
- package/dist/list/virtual-list.jsx +159 -0
- package/dist/orb/hold-button.d.ts +26 -0
- package/dist/orb/hold-button.d.ts.map +1 -0
- package/dist/orb/hold-button.jsx +33 -0
- package/dist/orb/hold.d.ts +36 -0
- package/dist/orb/hold.d.ts.map +1 -0
- package/dist/orb/hold.jsx +76 -0
- package/dist/orb/index.d.ts +5 -0
- package/dist/orb/index.d.ts.map +1 -0
- package/dist/orb/index.jsx +4 -0
- package/dist/orb/model.d.ts +42 -0
- package/dist/orb/model.d.ts.map +1 -0
- package/dist/orb/model.jsx +42 -0
- package/dist/orb/orb.css +81 -0
- package/dist/orb/orb.css.map +1 -0
- package/dist/orb/orb.d.ts +61 -0
- package/dist/orb/orb.d.ts.map +1 -0
- package/dist/orb/orb.jsx +171 -0
- package/dist/pickers/combo-box.jsx +0 -2
- package/dist/pickers/date-time-picker.jsx +0 -2
- package/dist/pickers/date-time.jsx +0 -2
- package/dist/pickers/day-stepper.css +43 -0
- package/dist/pickers/day-stepper.css.map +1 -0
- package/dist/pickers/day-stepper.d.ts +31 -0
- package/dist/pickers/day-stepper.d.ts.map +1 -0
- package/dist/pickers/day-stepper.jsx +60 -0
- package/dist/pickers/index.d.ts +1 -0
- package/dist/pickers/index.d.ts.map +1 -1
- package/dist/pickers/index.jsx +1 -0
- package/dist/pickers/picker-sheet.jsx +0 -2
- package/dist/pickers/picker.d.ts +11 -0
- package/dist/pickers/picker.d.ts.map +1 -1
- package/dist/pickers/picker.jsx +53 -9
- package/dist/pickers/timespan-picker.jsx +0 -2
- package/dist/pickers/timespan.jsx +0 -2
- package/dist/pickers/trigger.jsx +0 -2
- package/dist/pickers/wheel-column.jsx +0 -2
- package/dist/plus-button/model.jsx +0 -2
- package/dist/plus-button/plus-button.jsx +0 -2
- package/dist/popover/index.d.ts +3 -0
- package/dist/popover/index.d.ts.map +1 -0
- package/dist/popover/index.jsx +2 -0
- package/dist/popover/popover.css +183 -0
- package/dist/popover/popover.css.map +1 -0
- package/dist/popover/popover.d.ts +139 -0
- package/dist/popover/popover.d.ts.map +1 -0
- package/dist/popover/popover.jsx +291 -0
- package/dist/popover/position.d.ts +35 -0
- package/dist/popover/position.d.ts.map +1 -0
- package/dist/popover/position.jsx +53 -0
- package/dist/popup/frame.jsx +0 -2
- package/dist/popup/input-form.jsx +0 -2
- package/dist/popup/input.jsx +0 -2
- package/dist/popup/popup-view.jsx +0 -2
- package/dist/popup/queue.jsx +0 -2
- package/dist/popup/service.jsx +0 -2
- package/dist/popup/types.jsx +0 -2
- package/dist/provider/activity.d.ts +13 -0
- package/dist/provider/activity.d.ts.map +1 -0
- package/dist/provider/activity.jsx +55 -0
- package/dist/provider/contexts.d.ts +32 -1
- package/dist/provider/contexts.d.ts.map +1 -1
- package/dist/provider/contexts.jsx +7 -3
- package/dist/provider/global-events.jsx +0 -2
- package/dist/provider/hooks.d.ts +16 -2
- package/dist/provider/hooks.d.ts.map +1 -1
- package/dist/provider/hooks.jsx +35 -7
- package/dist/provider/index.d.ts +4 -2
- package/dist/provider/index.d.ts.map +1 -1
- package/dist/provider/index.jsx +3 -1
- package/dist/provider/keep-alive.css +19 -0
- package/dist/provider/keep-alive.css.map +1 -0
- package/dist/provider/keep-alive.d.ts +23 -0
- package/dist/provider/keep-alive.d.ts.map +1 -0
- package/dist/provider/keep-alive.jsx +9 -0
- package/dist/provider/provider.css +1 -1
- package/dist/provider/provider.css.map +1 -1
- package/dist/provider/provider.d.ts +13 -1
- package/dist/provider/provider.d.ts.map +1 -1
- package/dist/provider/provider.jsx +128 -15
- package/dist/provider/settings.d.ts +23 -0
- package/dist/provider/settings.d.ts.map +1 -1
- package/dist/provider/settings.jsx +5 -4
- package/dist/provider/theme-css.d.ts +1 -1
- package/dist/provider/theme-css.d.ts.map +1 -1
- package/dist/provider/theme-css.jsx +21 -10
- package/dist/provider/theme-root.d.ts.map +1 -1
- package/dist/provider/theme-root.jsx +7 -5
- package/dist/provider/theme.css +72 -0
- package/dist/provider/theme.css.map +1 -1
- package/dist/range-slider/index.d.ts +1 -0
- package/dist/range-slider/index.d.ts.map +1 -1
- package/dist/range-slider/index.jsx +1 -0
- package/dist/range-slider/math.jsx +0 -2
- package/dist/range-slider/range-slider.css +82 -0
- package/dist/range-slider/range-slider.css.map +1 -1
- package/dist/range-slider/range-slider.jsx +0 -2
- package/dist/range-slider/step-slider.d.ts +18 -0
- package/dist/range-slider/step-slider.d.ts.map +1 -0
- package/dist/range-slider/step-slider.jsx +55 -0
- package/dist/route/hooks.jsx +0 -2
- package/dist/route/router.jsx +0 -2
- package/dist/selection/model.jsx +0 -2
- package/dist/selection/selection-sheet.jsx +0 -2
- package/dist/selection/use-selection-model.jsx +0 -2
- package/dist/selection/window.jsx +0 -2
- package/dist/sheet/backdrop-scope.d.ts +14 -0
- package/dist/sheet/backdrop-scope.d.ts.map +1 -0
- package/dist/sheet/backdrop-scope.jsx +25 -0
- package/dist/sheet/context.d.ts +22 -0
- package/dist/sheet/context.d.ts.map +1 -0
- package/dist/sheet/context.jsx +7 -0
- package/dist/sheet/frame.d.ts +2 -17
- package/dist/sheet/frame.d.ts.map +1 -1
- package/dist/sheet/frame.jsx +23 -19
- package/dist/sheet/gesture.jsx +1 -3
- package/dist/sheet/handoff.jsx +0 -2
- package/dist/sheet/header.jsx +3 -3
- package/dist/sheet/height-memo.jsx +0 -2
- package/dist/sheet/index.d.ts +2 -0
- package/dist/sheet/index.d.ts.map +1 -1
- package/dist/sheet/index.jsx +2 -0
- package/dist/sheet/loadable.jsx +0 -2
- package/dist/sheet/motion.jsx +0 -2
- package/dist/sheet/options.d.ts +17 -0
- package/dist/sheet/options.d.ts.map +1 -1
- package/dist/sheet/options.jsx +2 -3
- package/dist/sheet/panel-frame.css +204 -0
- package/dist/sheet/panel-frame.css.map +1 -0
- package/dist/sheet/panel-frame.d.ts +16 -0
- package/dist/sheet/panel-frame.d.ts.map +1 -0
- package/dist/sheet/panel-frame.jsx +103 -0
- package/dist/sheet/processing.jsx +0 -2
- package/dist/sheet/scroll-indicator.jsx +0 -2
- package/dist/sheet/scroll-region.d.ts +19 -0
- package/dist/sheet/scroll-region.d.ts.map +1 -0
- package/dist/sheet/scroll-region.jsx +58 -0
- package/dist/sheet/service.d.ts.map +1 -1
- package/dist/sheet/service.jsx +23 -9
- package/dist/sheet/sheet.css +33 -0
- package/dist/sheet/sheet.css.map +1 -1
- package/dist/sheet/sheet.jsx +0 -2
- package/dist/sheet/sizing.d.ts +3 -3
- package/dist/sheet/sizing.jsx +0 -2
- package/dist/sheet/stack.jsx +0 -2
- package/dist/shell/index.d.ts +2 -0
- package/dist/shell/index.d.ts.map +1 -0
- package/dist/shell/index.jsx +1 -0
- package/dist/shell/shell.css +342 -0
- package/dist/shell/shell.css.map +1 -0
- package/dist/shell/shell.d.ts +121 -0
- package/dist/shell/shell.d.ts.map +1 -0
- package/dist/shell/shell.jsx +214 -0
- package/dist/survey/index.d.ts +2 -0
- package/dist/survey/index.d.ts.map +1 -0
- package/dist/survey/index.jsx +1 -0
- package/dist/survey/survey.css +204 -0
- package/dist/survey/survey.css.map +1 -0
- package/dist/survey/survey.d.ts +76 -0
- package/dist/survey/survey.d.ts.map +1 -0
- package/dist/survey/survey.jsx +205 -0
- package/dist/swipe/model.jsx +0 -2
- package/dist/swipe/swipe-view.jsx +0 -2
- package/dist/tab-bar/metrics.jsx +20 -22
- package/dist/tab-bar/model.d.ts +2 -0
- package/dist/tab-bar/model.d.ts.map +1 -1
- package/dist/tab-bar/model.jsx +10 -6
- package/dist/tab-bar/tab-bar.css +74 -0
- package/dist/tab-bar/tab-bar.css.map +1 -1
- package/dist/tab-bar/tab-bar.d.ts +7 -0
- package/dist/tab-bar/tab-bar.d.ts.map +1 -1
- package/dist/tab-bar/tab-bar.jsx +51 -17
- package/dist/tabs/model.jsx +0 -2
- package/dist/tabs/tab-view.d.ts +1 -0
- package/dist/tabs/tab-view.d.ts.map +1 -1
- package/dist/tabs/tab-view.jsx +6 -5
- package/dist/tabs/tabs.css +1 -0
- package/dist/tabs/tabs.css.map +1 -1
- package/dist/toast/service.d.ts.map +1 -1
- package/dist/toast/service.jsx +34 -16
- package/dist/toast/store.jsx +0 -2
- package/dist/toggle/checkbox-math.jsx +0 -2
- package/dist/toggle/checkbox.d.ts.map +1 -1
- package/dist/toggle/checkbox.jsx +10 -12
- package/dist/toggle/chip-group.d.ts.map +1 -1
- package/dist/toggle/chip-group.jsx +8 -7
- package/dist/toggle/choice.css +254 -0
- package/dist/toggle/choice.css.map +1 -0
- package/dist/toggle/choice.d.ts +125 -0
- package/dist/toggle/choice.d.ts.map +1 -0
- package/dist/toggle/choice.jsx +367 -0
- package/dist/toggle/index.d.ts +2 -1
- package/dist/toggle/index.d.ts.map +1 -1
- package/dist/toggle/index.jsx +1 -0
- package/dist/toggle/switch.d.ts.map +1 -1
- package/dist/toggle/switch.jsx +8 -11
- package/package.json +126 -16
- package/tailwind/index.d.ts +13 -0
- package/tailwind/index.mjs +87 -0
- package/tailwind/index.test.mjs +24 -0
- package/tailwind/tokens.mjs +98 -0
- package/dist/anchor/context.jsx.map +0 -1
- package/dist/anchor/hooks.jsx.map +0 -1
- package/dist/anchor/measure.jsx.map +0 -1
- package/dist/anchor/registry.jsx.map +0 -1
- package/dist/anchor/scroll.jsx.map +0 -1
- package/dist/base/control.jsx.map +0 -1
- package/dist/base/corner-badge.jsx.map +0 -1
- package/dist/base/disposer.jsx.map +0 -1
- package/dist/base/press.jsx.map +0 -1
- package/dist/base/pressable.jsx.map +0 -1
- package/dist/base/selection-item.jsx.map +0 -1
- package/dist/base/timers.jsx.map +0 -1
- package/dist/base/use-controllable-state.jsx.map +0 -1
- package/dist/base/use-stable-callback.jsx.map +0 -1
- package/dist/button/button.jsx.map +0 -1
- package/dist/button/header-action-button.jsx.map +0 -1
- package/dist/button/icon-button.jsx.map +0 -1
- package/dist/button/nav-card.jsx.map +0 -1
- package/dist/button/safe-tap.jsx.map +0 -1
- package/dist/button/safe.jsx.map +0 -1
- package/dist/button/vertical-icon-text-button.jsx.map +0 -1
- package/dist/button/visuals.jsx.map +0 -1
- package/dist/cascade/cascade-panel.jsx.map +0 -1
- package/dist/cascade/model.jsx.map +0 -1
- package/dist/deferred/deferred-content.jsx.map +0 -1
- package/dist/deferred/readiness-signal.jsx.map +0 -1
- package/dist/display/activity-indicator.jsx.map +0 -1
- package/dist/display/culture-date-time-label.jsx.map +0 -1
- package/dist/display/progress-bar.jsx.map +0 -1
- package/dist/display/separator.jsx.map +0 -1
- package/dist/display/shimmer.jsx.map +0 -1
- package/dist/display/title-with-line.jsx.map +0 -1
- package/dist/edge-panel/edge-panel.jsx.map +0 -1
- package/dist/edge-panel/helper.jsx.map +0 -1
- package/dist/edge-panel/types.jsx.map +0 -1
- package/dist/expander/expander.jsx.map +0 -1
- package/dist/fields/dictation.jsx.map +0 -1
- package/dist/fields/editor.jsx.map +0 -1
- package/dist/fields/input-policy.jsx.map +0 -1
- package/dist/fields/notch.jsx.map +0 -1
- package/dist/fields/outlined-field.jsx.map +0 -1
- package/dist/fields/pin-entry.jsx.map +0 -1
- package/dist/fields/search-entry.jsx.map +0 -1
- package/dist/fields/slot-layout.jsx.map +0 -1
- package/dist/fields/text-entry.jsx.map +0 -1
- package/dist/fields/use-dictation.jsx.map +0 -1
- package/dist/fields/use-text-input.jsx.map +0 -1
- package/dist/fields/validator.jsx.map +0 -1
- package/dist/guide/confirm-sheet.jsx.map +0 -1
- package/dist/guide/journey.jsx.map +0 -1
- package/dist/guide/placement.jsx.map +0 -1
- package/dist/guide/service.jsx.map +0 -1
- package/dist/guide/settings.jsx.map +0 -1
- package/dist/host/back.jsx.map +0 -1
- package/dist/host/hooks.jsx.map +0 -1
- package/dist/host/host.jsx.map +0 -1
- package/dist/host/keyboard.jsx.map +0 -1
- package/dist/host/layers.jsx.map +0 -1
- package/dist/host/page-loading-overlay.jsx.map +0 -1
- package/dist/host/readiness.jsx.map +0 -1
- package/dist/host/registry.jsx.map +0 -1
- package/dist/icon/icon.jsx.map +0 -1
- package/dist/icon/slot.jsx.map +0 -1
- package/dist/icon/swatch.jsx.map +0 -1
- package/dist/pickers/combo-box.jsx.map +0 -1
- package/dist/pickers/date-time-picker.jsx.map +0 -1
- package/dist/pickers/date-time.jsx.map +0 -1
- package/dist/pickers/picker-sheet.jsx.map +0 -1
- package/dist/pickers/picker.jsx.map +0 -1
- package/dist/pickers/timespan-picker.jsx.map +0 -1
- package/dist/pickers/timespan.jsx.map +0 -1
- package/dist/pickers/trigger.jsx.map +0 -1
- package/dist/pickers/wheel-column.jsx.map +0 -1
- package/dist/plus-button/model.jsx.map +0 -1
- package/dist/plus-button/plus-button.jsx.map +0 -1
- package/dist/popup/frame.jsx.map +0 -1
- package/dist/popup/input-form.jsx.map +0 -1
- package/dist/popup/input.jsx.map +0 -1
- package/dist/popup/popup-view.jsx.map +0 -1
- package/dist/popup/queue.jsx.map +0 -1
- package/dist/popup/service.jsx.map +0 -1
- package/dist/popup/types.jsx.map +0 -1
- package/dist/provider/contexts.jsx.map +0 -1
- package/dist/provider/global-events.jsx.map +0 -1
- package/dist/provider/hooks.jsx.map +0 -1
- package/dist/provider/provider.jsx.map +0 -1
- package/dist/provider/settings.jsx.map +0 -1
- package/dist/provider/theme-css.jsx.map +0 -1
- package/dist/provider/theme-root.jsx.map +0 -1
- package/dist/range-slider/math.jsx.map +0 -1
- package/dist/range-slider/range-slider.jsx.map +0 -1
- package/dist/route/hooks.jsx.map +0 -1
- package/dist/route/router.jsx.map +0 -1
- package/dist/selection/model.jsx.map +0 -1
- package/dist/selection/selection-sheet.jsx.map +0 -1
- package/dist/selection/use-selection-model.jsx.map +0 -1
- package/dist/selection/window.jsx.map +0 -1
- package/dist/sheet/frame.jsx.map +0 -1
- package/dist/sheet/gesture.jsx.map +0 -1
- package/dist/sheet/handoff.jsx.map +0 -1
- package/dist/sheet/header.jsx.map +0 -1
- package/dist/sheet/height-memo.jsx.map +0 -1
- package/dist/sheet/loadable.jsx.map +0 -1
- package/dist/sheet/motion.jsx.map +0 -1
- package/dist/sheet/options.jsx.map +0 -1
- package/dist/sheet/processing.jsx.map +0 -1
- package/dist/sheet/scroll-indicator.jsx.map +0 -1
- package/dist/sheet/service.jsx.map +0 -1
- package/dist/sheet/sheet.jsx.map +0 -1
- package/dist/sheet/sizing.jsx.map +0 -1
- package/dist/sheet/stack.jsx.map +0 -1
- package/dist/swipe/model.jsx.map +0 -1
- package/dist/swipe/swipe-view.jsx.map +0 -1
- package/dist/tab-bar/metrics.jsx.map +0 -1
- package/dist/tab-bar/model.jsx.map +0 -1
- package/dist/tab-bar/tab-bar.jsx.map +0 -1
- package/dist/tabs/model.jsx.map +0 -1
- package/dist/tabs/tab-view.jsx.map +0 -1
- package/dist/toast/service.jsx.map +0 -1
- package/dist/toast/store.jsx.map +0 -1
- package/dist/toggle/checkbox-math.jsx.map +0 -1
- package/dist/toggle/checkbox.jsx.map +0 -1
- package/dist/toggle/chip-group.jsx.map +0 -1
- package/dist/toggle/switch.jsx.map +0 -1
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import "./popover.css";
|
|
2
|
+
import { g9Haptic } from "@g9tm/lynxcontrols-foundation";
|
|
3
|
+
import { memo, useEffect, useMemo, useRef, useState } from "@lynx-js/react";
|
|
4
|
+
import { useG9Anchor } from "../anchor/hooks.jsx";
|
|
5
|
+
import { anchorRect, measureNode, windowRect } from "../anchor/measure.jsx";
|
|
6
|
+
import { g9ChildId, g9IdProps, g9RowStyle } from "../base/control.jsx";
|
|
7
|
+
import { useG9Keys } from "../commands/keys.jsx";
|
|
8
|
+
import { G9Keycap } from "../display/keycap.jsx";
|
|
9
|
+
import { useG9Back, useG9LayerItem } from "../host/hooks.jsx";
|
|
10
|
+
import { G9Icon } from "../icon/icon.jsx";
|
|
11
|
+
import { useG9Core, useG9Direction, useG9Layout } from "../provider/hooks.jsx";
|
|
12
|
+
import { computePopoverPosition } from "./position.jsx";
|
|
13
|
+
function G9OverlayRoot(props) {
|
|
14
|
+
const anchor = useG9Anchor(props.id, {
|
|
15
|
+
kind: 'view',
|
|
16
|
+
label: ()=>{
|
|
17
|
+
var _props_label;
|
|
18
|
+
return null != (_props_label = props.label) ? _props_label : null;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
return <view {...props.attrs} {...anchor.props}>
|
|
22
|
+
{props.children}
|
|
23
|
+
</view>;
|
|
24
|
+
}
|
|
25
|
+
const popover_open = new Map();
|
|
26
|
+
const listeners = new Set();
|
|
27
|
+
let snapshot = [];
|
|
28
|
+
const changed = ()=>{
|
|
29
|
+
snapshot = [
|
|
30
|
+
...popover_open.values()
|
|
31
|
+
];
|
|
32
|
+
for (const l of Array.from(listeners))l();
|
|
33
|
+
};
|
|
34
|
+
const g9Popovers = Object.freeze({
|
|
35
|
+
getSnapshot: ()=>snapshot,
|
|
36
|
+
subscribe (listener) {
|
|
37
|
+
listeners.add(listener);
|
|
38
|
+
return ()=>void listeners.delete(listener);
|
|
39
|
+
},
|
|
40
|
+
closeAll () {
|
|
41
|
+
for (const p of [
|
|
42
|
+
...popover_open.values()
|
|
43
|
+
])p.close();
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
function useG9OpenOverlay(key, kind, active, close) {
|
|
47
|
+
useRegisterOpen(key, kind, active, close);
|
|
48
|
+
}
|
|
49
|
+
function useRegisterOpen(key, kind, active, close) {
|
|
50
|
+
const latest = useRef(close);
|
|
51
|
+
latest.current = close;
|
|
52
|
+
useEffect(()=>{
|
|
53
|
+
if (!active) return;
|
|
54
|
+
popover_open.set(key, {
|
|
55
|
+
key,
|
|
56
|
+
kind,
|
|
57
|
+
close: ()=>latest.current()
|
|
58
|
+
});
|
|
59
|
+
changed();
|
|
60
|
+
return ()=>{
|
|
61
|
+
popover_open.delete(key);
|
|
62
|
+
changed();
|
|
63
|
+
};
|
|
64
|
+
}, [
|
|
65
|
+
key,
|
|
66
|
+
kind,
|
|
67
|
+
active
|
|
68
|
+
]);
|
|
69
|
+
}
|
|
70
|
+
let seq = 0;
|
|
71
|
+
function G9Popover(props) {
|
|
72
|
+
var _props_kind;
|
|
73
|
+
const core = useG9Core();
|
|
74
|
+
const dir = useG9Direction();
|
|
75
|
+
const key = useMemo(()=>`g9-popover-${++seq}`, []);
|
|
76
|
+
const [anchor, setAnchor] = useState(null);
|
|
77
|
+
const [size, setSize] = useState(null);
|
|
78
|
+
const close = props.onClose;
|
|
79
|
+
useRegisterOpen(key, null != (_props_kind = props.kind) ? _props_kind : 'popover', props.open, close);
|
|
80
|
+
useG9Back(()=>{
|
|
81
|
+
close();
|
|
82
|
+
return true;
|
|
83
|
+
}, {
|
|
84
|
+
enabled: props.open,
|
|
85
|
+
layer: 'popups'
|
|
86
|
+
});
|
|
87
|
+
useG9Keys((e)=>'Escape' === e.key ? (close(), true) : false, {
|
|
88
|
+
enabled: props.open,
|
|
89
|
+
field: true
|
|
90
|
+
});
|
|
91
|
+
useEffect(()=>{
|
|
92
|
+
if (!props.open) {
|
|
93
|
+
setAnchor(null);
|
|
94
|
+
setSize(null);
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
if (props.anchorRect) return void setAnchor(props.anchorRect);
|
|
98
|
+
let alive = true;
|
|
99
|
+
const entry = props.anchorId ? core.anchors.find(props.anchorId) : null;
|
|
100
|
+
const measure = entry ? anchorRect(entry) : props.anchorNode ? measureNode(props.anchorNode) : Promise.resolve(null);
|
|
101
|
+
measure.then((r)=>{
|
|
102
|
+
if (alive) setAnchor(null != r ? r : {
|
|
103
|
+
x: windowRect().width / 2,
|
|
104
|
+
y: windowRect().height / 3,
|
|
105
|
+
width: 0,
|
|
106
|
+
height: 0
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
return ()=>{
|
|
110
|
+
alive = false;
|
|
111
|
+
};
|
|
112
|
+
}, [
|
|
113
|
+
props.open,
|
|
114
|
+
props.anchorId,
|
|
115
|
+
props.anchorRect,
|
|
116
|
+
props.anchorNode,
|
|
117
|
+
core.anchors
|
|
118
|
+
]);
|
|
119
|
+
const pos = anchor && size ? computePopoverPosition({
|
|
120
|
+
anchor,
|
|
121
|
+
size,
|
|
122
|
+
viewport: windowRect(),
|
|
123
|
+
...props.placement ? {
|
|
124
|
+
placement: props.placement
|
|
125
|
+
} : {},
|
|
126
|
+
...void 0 !== props.offset ? {
|
|
127
|
+
offset: props.offset
|
|
128
|
+
} : {},
|
|
129
|
+
rtl: 'rtl' === dir,
|
|
130
|
+
...props.matchWidth ? {
|
|
131
|
+
matchWidth: true
|
|
132
|
+
} : {}
|
|
133
|
+
}) : null;
|
|
134
|
+
const element = props.open ? <view className="g9-popover-layer" key={key}>
|
|
135
|
+
{props.passive ? null : <view className="g9-popover-backdrop" bindtap={false === props.closeOnOutside ? void 0 : close}/>}
|
|
136
|
+
<G9OverlayRoot id={props.id} label={props.accessibilityLabel} attrs={{
|
|
137
|
+
className: `g9-popover${pos ? ' g9-popover--shown' : ''}${props.className ? ` ${props.className}` : ''}`,
|
|
138
|
+
'accessibility-element': false,
|
|
139
|
+
style: {
|
|
140
|
+
...pos ? {
|
|
141
|
+
left: `${pos.x}px`,
|
|
142
|
+
top: `${pos.y}px`,
|
|
143
|
+
width: `${pos.width}px`,
|
|
144
|
+
maxHeight: `${pos.maxHeight}px`,
|
|
145
|
+
transformOrigin: pos.placement.startsWith('top') ? 'bottom' : 'top'
|
|
146
|
+
} : {
|
|
147
|
+
left: '0px',
|
|
148
|
+
top: '0px'
|
|
149
|
+
},
|
|
150
|
+
...props.matchWidth && anchor ? {
|
|
151
|
+
width: `${anchor.width}px`
|
|
152
|
+
} : {},
|
|
153
|
+
...props.style
|
|
154
|
+
},
|
|
155
|
+
bindlayoutchange: (e)=>{
|
|
156
|
+
const next = {
|
|
157
|
+
width: Math.ceil(e.detail.width),
|
|
158
|
+
height: Math.ceil(e.detail.height)
|
|
159
|
+
};
|
|
160
|
+
if (!size || Math.abs(size.width - next.width) > 1 || Math.abs(size.height - next.height) > 1) setSize(next);
|
|
161
|
+
}
|
|
162
|
+
}}>
|
|
163
|
+
<scroll-view className="g9-popover__scroll" scroll-orientation="vertical" style={pos ? {
|
|
164
|
+
maxHeight: `${pos.maxHeight}px`
|
|
165
|
+
} : {}}>
|
|
166
|
+
{props.children}
|
|
167
|
+
</scroll-view>
|
|
168
|
+
</G9OverlayRoot>
|
|
169
|
+
</view> : null;
|
|
170
|
+
useG9LayerItem('popups', key, element, {
|
|
171
|
+
enabled: props.open
|
|
172
|
+
});
|
|
173
|
+
return null;
|
|
174
|
+
}
|
|
175
|
+
const G9MenuList = memo(function(props) {
|
|
176
|
+
const dir = useG9Direction();
|
|
177
|
+
const tall = 'sheet' === props.density;
|
|
178
|
+
return <view className="g9-menu-list" {...g9IdProps(props.id)}>
|
|
179
|
+
{props.items.map((item)=><view key={item.key} className="g9-menu-list__group">
|
|
180
|
+
{item.separatorBefore ? <view className="g9-menu-list__separator"/> : null}
|
|
181
|
+
<view className={`g9-menu-item${item.disabled ? ' g9-menu-item--disabled' : ''}`} {...g9IdProps(g9ChildId(props.id, item.key))} style={{
|
|
182
|
+
...g9RowStyle(dir),
|
|
183
|
+
minHeight: `${tall ? 52 : 40}px`
|
|
184
|
+
}} accessibility-element={true} accessibility-traits="button" accessibility-label={item.label} {...item.checked ? {
|
|
185
|
+
'accessibility-status': 'selected'
|
|
186
|
+
} : {}} {...item.disabled ? {} : {
|
|
187
|
+
bindtap: ()=>{
|
|
188
|
+
g9Haptic('select');
|
|
189
|
+
props.onSelect(item.key);
|
|
190
|
+
}
|
|
191
|
+
}}>
|
|
192
|
+
{item.icon ? <G9Icon icon={item.icon} size={18} color={item.danger ? 'var(--g9-error)' : 'var(--g9-text-secondary)'}/> : null}
|
|
193
|
+
<view className="g9-menu-item__text">
|
|
194
|
+
<text className={`g9-menu-item__label${item.danger ? ' g9-menu-item__label--danger' : ''}`}>
|
|
195
|
+
{item.label}
|
|
196
|
+
</text>
|
|
197
|
+
{item.description ? <text className="g9-menu-item__description">{item.description}</text> : null}
|
|
198
|
+
</view>
|
|
199
|
+
{item.shortcut ? <G9Keycap combo={item.shortcut}/> : null}
|
|
200
|
+
{item.checked ? <G9Icon icon="check" size={16} color="var(--g9-primary)"/> : null}
|
|
201
|
+
</view>
|
|
202
|
+
</view>)}
|
|
203
|
+
</view>;
|
|
204
|
+
});
|
|
205
|
+
function G9Menu(props) {
|
|
206
|
+
const { wide } = useG9Layout();
|
|
207
|
+
const sheet = 'sheet' === props.mode || 'popover' !== props.mode && !wide;
|
|
208
|
+
const select = (k)=>{
|
|
209
|
+
props.onClose();
|
|
210
|
+
props.onSelect(k);
|
|
211
|
+
};
|
|
212
|
+
if (sheet) return <G9ActionSheet open={props.open} onClose={props.onClose} {...props.title ? {
|
|
213
|
+
title: props.title
|
|
214
|
+
} : {}} {...props.cancelText ? {
|
|
215
|
+
cancelText: props.cancelText
|
|
216
|
+
} : {}} {...props.id ? {
|
|
217
|
+
id: props.id
|
|
218
|
+
} : {}}>
|
|
219
|
+
<G9MenuList items={props.items} onSelect={select} density="sheet" {...props.id ? {
|
|
220
|
+
id: `${props.id}_List`
|
|
221
|
+
} : {}}/>
|
|
222
|
+
</G9ActionSheet>;
|
|
223
|
+
const { items: _i, onSelect: _s, title: _t, mode: _m, cancelText: _c, ...pop } = props;
|
|
224
|
+
return <G9Popover {...pop} kind="menu">
|
|
225
|
+
<G9MenuList items={props.items} onSelect={select} {...props.id ? {
|
|
226
|
+
id: `${props.id}_List`
|
|
227
|
+
} : {}}/>
|
|
228
|
+
</G9Popover>;
|
|
229
|
+
}
|
|
230
|
+
function G9ActionSheet(props) {
|
|
231
|
+
const key = useMemo(()=>`g9-action-sheet-${++seq}`, []);
|
|
232
|
+
useRegisterOpen(key, 'actionSheet', props.open, props.onClose);
|
|
233
|
+
useG9Back(()=>{
|
|
234
|
+
props.onClose();
|
|
235
|
+
return true;
|
|
236
|
+
}, {
|
|
237
|
+
enabled: props.open,
|
|
238
|
+
layer: 'popups'
|
|
239
|
+
});
|
|
240
|
+
useG9Keys((e)=>'Escape' === e.key ? (props.onClose(), true) : false, {
|
|
241
|
+
enabled: props.open,
|
|
242
|
+
field: true
|
|
243
|
+
});
|
|
244
|
+
const element = props.open ? <view className="g9-popover-layer" key={key}>
|
|
245
|
+
<view className="g9-action-sheet__scrim" bindtap={props.onClose}/>
|
|
246
|
+
<G9OverlayRoot id={props.id} label={props.title} attrs={{
|
|
247
|
+
className: 'g9-action-sheet'
|
|
248
|
+
}}>
|
|
249
|
+
<view className="g9-action-sheet__grab"/>
|
|
250
|
+
{props.title ? <text className="g9-action-sheet__title">{props.title}</text> : null}
|
|
251
|
+
<scroll-view className="g9-action-sheet__body" scroll-orientation="vertical">
|
|
252
|
+
{props.children}
|
|
253
|
+
</scroll-view>
|
|
254
|
+
{props.cancelText ? <view className="g9-action-sheet__cancel" {...g9IdProps(g9ChildId(props.id, 'Cancel'))} bindtap={props.onClose} accessibility-element={true} accessibility-traits="button" accessibility-label={props.cancelText}>
|
|
255
|
+
<text className="g9-action-sheet__cancel-text">{props.cancelText}</text>
|
|
256
|
+
</view> : null}
|
|
257
|
+
</G9OverlayRoot>
|
|
258
|
+
</view> : null;
|
|
259
|
+
useG9LayerItem('popups', key, element, {
|
|
260
|
+
enabled: props.open
|
|
261
|
+
});
|
|
262
|
+
return null;
|
|
263
|
+
}
|
|
264
|
+
function G9ContextMenu(props) {
|
|
265
|
+
const [isOpen, setOpen] = useState(false);
|
|
266
|
+
const [rect, setRect] = useState(null);
|
|
267
|
+
const node = useRef(null);
|
|
268
|
+
return <view className="g9-context-menu" {...g9IdProps(props.id)} ref={(r)=>{
|
|
269
|
+
node.current = r;
|
|
270
|
+
}} {...props.disabled ? {} : {
|
|
271
|
+
bindlongpress: ()=>{
|
|
272
|
+
g9Haptic('impact');
|
|
273
|
+
measureNode(node.current).then((r)=>{
|
|
274
|
+
var _props_onOpen;
|
|
275
|
+
setRect(r);
|
|
276
|
+
setOpen(true);
|
|
277
|
+
null == (_props_onOpen = props.onOpen) || _props_onOpen.call(props);
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
}}>
|
|
281
|
+
{props.children}
|
|
282
|
+
<G9Menu open={isOpen} onClose={()=>setOpen(false)} items={props.items} onSelect={props.onSelect} {...rect ? {
|
|
283
|
+
anchorRect: rect
|
|
284
|
+
} : {}} {...props.title ? {
|
|
285
|
+
title: props.title
|
|
286
|
+
} : {}} {...props.id ? {
|
|
287
|
+
id: `${props.id}_Menu`
|
|
288
|
+
} : {}}/>
|
|
289
|
+
</view>;
|
|
290
|
+
}
|
|
291
|
+
export { G9ActionSheet, G9ContextMenu, G9Menu, G9MenuList, G9OverlayRoot, G9Popover, g9Popovers, useG9OpenOverlay };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { G9AnchorRect } from '../anchor/registry.js';
|
|
2
|
+
/** The side and the alignment along it. `start`/`end` follow the reading direction. */
|
|
3
|
+
export type G9Placement = 'bottom-start' | 'bottom' | 'bottom-end' | 'top-start' | 'top' | 'top-end' | 'start' | 'end';
|
|
4
|
+
/** What {@link computePopoverPosition} needs: the anchor rectangle, the panel size, the window and the wished placement. */
|
|
5
|
+
export interface G9PopoverPositionInput {
|
|
6
|
+
readonly anchor: G9AnchorRect;
|
|
7
|
+
/** The panel's measured size. */
|
|
8
|
+
readonly size: {
|
|
9
|
+
readonly width: number;
|
|
10
|
+
readonly height: number;
|
|
11
|
+
};
|
|
12
|
+
/** The window (or the area panels may use). */
|
|
13
|
+
readonly viewport: G9AnchorRect;
|
|
14
|
+
readonly placement?: G9Placement;
|
|
15
|
+
/** Gap between anchor and panel. Default 8. */
|
|
16
|
+
readonly offset?: number;
|
|
17
|
+
/** Keep this far from the viewport edges. Default 8. */
|
|
18
|
+
readonly margin?: number;
|
|
19
|
+
readonly rtl?: boolean;
|
|
20
|
+
/** The panel takes the anchor's width (a select's dropdown). */
|
|
21
|
+
readonly matchWidth?: boolean;
|
|
22
|
+
}
|
|
23
|
+
/** Where {@link computePopoverPosition} put the panel: its rectangle and the placement it ended on (after flipping). */
|
|
24
|
+
export interface G9PopoverPosition {
|
|
25
|
+
readonly x: number;
|
|
26
|
+
readonly y: number;
|
|
27
|
+
readonly width: number;
|
|
28
|
+
/** Height cap when the panel is taller than the room on the chosen side (it scrolls inside). */
|
|
29
|
+
readonly maxHeight: number;
|
|
30
|
+
/** The placement actually used (after a flip). */
|
|
31
|
+
readonly placement: G9Placement;
|
|
32
|
+
}
|
|
33
|
+
/** The panel's position for `input`. */
|
|
34
|
+
export declare function computePopoverPosition(input: G9PopoverPositionInput): G9PopoverPosition;
|
|
35
|
+
//# sourceMappingURL=position.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"position.d.ts","sourceRoot":"","sources":["../../src/popover/position.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,uFAAuF;AACvF,MAAM,MAAM,WAAW,GAAG,cAAc,GAAG,QAAQ,GAAG,YAAY,GAAG,WAAW,GAAG,KAAK,GAAG,SAAS,GAAG,OAAO,GAAG,KAAK,CAAC;AAEvH,4HAA4H;AAC5H,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,iCAAiC;IACjC,QAAQ,CAAC,IAAI,EAAE;QAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACnE,+CAA+C;IAC/C,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;IAChC,QAAQ,CAAC,SAAS,CAAC,EAAE,WAAW,CAAC;IACjC,+CAA+C;IAC/C,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,wDAAwD;IACxD,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC;IACvB,gEAAgE;IAChE,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,wHAAwH;AACxH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,gGAAgG;IAChG,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,kDAAkD;IAClD,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC;CACjC;AAkBD,wCAAwC;AACxC,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,sBAAsB,GAAG,iBAAiB,CAwCvF"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
function side(p) {
|
|
2
|
+
return p.startsWith('top') ? 'top' : p.startsWith('bottom') ? 'bottom' : p;
|
|
3
|
+
}
|
|
4
|
+
function align(p) {
|
|
5
|
+
return p.endsWith('-start') ? 'start' : p.endsWith('-end') ? 'end' : 'center';
|
|
6
|
+
}
|
|
7
|
+
const flip = (p)=>p.startsWith('top') ? p.replace('top', 'bottom') : p.startsWith('bottom') ? p.replace('bottom', 'top') : 'start' === p ? 'end' : 'start';
|
|
8
|
+
const clamp = (v, lo, hi)=>Math.max(lo, Math.min(hi, v));
|
|
9
|
+
function computePopoverPosition(input) {
|
|
10
|
+
var _input_offset, _input_margin, _input_placement;
|
|
11
|
+
const { anchor: a, viewport: vp } = input;
|
|
12
|
+
const offset = null != (_input_offset = input.offset) ? _input_offset : 8;
|
|
13
|
+
const margin = null != (_input_margin = input.margin) ? _input_margin : 8;
|
|
14
|
+
const rtl = true === input.rtl;
|
|
15
|
+
const width = Math.min(input.matchWidth ? a.width : input.size.width, vp.width - 2 * margin);
|
|
16
|
+
let placement = null != (_input_placement = input.placement) ? _input_placement : 'bottom-start';
|
|
17
|
+
const h = input.size.height;
|
|
18
|
+
const room = {
|
|
19
|
+
top: a.y - vp.y - offset - margin,
|
|
20
|
+
bottom: vp.y + vp.height - (a.y + a.height) - offset - margin,
|
|
21
|
+
start: (rtl ? vp.x + vp.width - (a.x + a.width) : a.x - vp.x) - offset - margin,
|
|
22
|
+
end: (rtl ? a.x - vp.x : vp.x + vp.width - (a.x + a.width)) - offset - margin
|
|
23
|
+
};
|
|
24
|
+
const s = side(placement);
|
|
25
|
+
const other = side(flip(placement));
|
|
26
|
+
const need = 'top' === s || 'bottom' === s ? h : width;
|
|
27
|
+
if (room[s] < need && room[other] > room[s]) placement = flip(placement);
|
|
28
|
+
const finalSide = side(placement);
|
|
29
|
+
let x;
|
|
30
|
+
let y;
|
|
31
|
+
let maxHeight = vp.height - 2 * margin;
|
|
32
|
+
if ('top' === finalSide || 'bottom' === finalSide) {
|
|
33
|
+
maxHeight = Math.max(48, room[finalSide]);
|
|
34
|
+
const height = Math.min(h, maxHeight);
|
|
35
|
+
y = 'bottom' === finalSide ? a.y + a.height + offset : a.y - offset - height;
|
|
36
|
+
const al = align(placement);
|
|
37
|
+
x = 'center' === al ? a.x + a.width / 2 - width / 2 : 'start' === al !== rtl ? a.x : a.x + a.width - width;
|
|
38
|
+
} else {
|
|
39
|
+
const toRight = 'end' === finalSide !== rtl;
|
|
40
|
+
x = toRight ? a.x + a.width + offset : a.x - offset - width;
|
|
41
|
+
y = a.y + a.height / 2 - h / 2;
|
|
42
|
+
}
|
|
43
|
+
x = clamp(x, vp.x + margin, vp.x + vp.width - margin - width);
|
|
44
|
+
y = clamp(y, vp.y + margin, vp.y + vp.height - margin - Math.min(h, maxHeight));
|
|
45
|
+
return {
|
|
46
|
+
x: Math.round(x),
|
|
47
|
+
y: Math.round(y),
|
|
48
|
+
width: Math.round(width),
|
|
49
|
+
maxHeight: Math.round(maxHeight),
|
|
50
|
+
placement
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export { computePopoverPosition };
|
package/dist/popup/frame.jsx
CHANGED
package/dist/popup/input.jsx
CHANGED
|
@@ -172,5 +172,3 @@ function validatePopupForm(fields, state, messages) {
|
|
|
172
172
|
};
|
|
173
173
|
}
|
|
174
174
|
export { G9PopupInputFieldType, g9PopupInputField, g9PopupInputResult, initialPopupFormState, isPopupEmailValid, popupCheckBoxOptions, popupFieldKeyboard, popupInputOption, popupInputOptions, validatePopupForm };
|
|
175
|
-
|
|
176
|
-
//# sourceMappingURL=input.jsx.map
|
package/dist/popup/queue.jsx
CHANGED
package/dist/popup/service.jsx
CHANGED
package/dist/popup/types.jsx
CHANGED
|
@@ -214,5 +214,3 @@ function popupScrimOpacity(mode, opacity, blur) {
|
|
|
214
214
|
return Math.min(1, opacity + extra);
|
|
215
215
|
}
|
|
216
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,13 @@
|
|
|
1
|
+
import { type ReactNode } from '@lynx-js/react';
|
|
2
|
+
import { type G9ActivityStore } from './contexts.js';
|
|
3
|
+
/** Props of {@link G9Activity}. */
|
|
4
|
+
export interface G9ActivityProps {
|
|
5
|
+
/** `'hidden'` defers the region's theme-driven renders until it is `'visible'` again. */
|
|
6
|
+
readonly mode: 'visible' | 'hidden';
|
|
7
|
+
readonly children?: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
/** Marks a kept-mounted region as shown or hidden (nested regions are hidden when any ancestor is). */
|
|
10
|
+
export declare function G9Activity(props: G9ActivityProps): ReactNode;
|
|
11
|
+
/** Subscribes `listener` to the theme store and the activity at once (for useSyncExternalStore). */
|
|
12
|
+
export declare function subscribeThemeAndActivity(subscribeTheme: (l: () => void) => () => void, activity: G9ActivityStore): (listener: () => void) => () => void;
|
|
13
|
+
//# sourceMappingURL=activity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activity.d.ts","sourceRoot":"","sources":["../../src/provider/activity.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAmC,MAAM,gBAAgB,CAAC;AAEjF,OAAO,EAAqB,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAErE,mCAAmC;AACnC,MAAM,WAAW,eAAe;IAC9B,yFAAyF;IACzF,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,QAAQ,CAAC;IACpC,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;CAC/B;AAgCD,uGAAuG;AACvG,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,SAAS,CAa5D;AAED,oGAAoG;AACpG,wBAAgB,yBAAyB,CAAC,cAAc,EAAE,CAAC,CAAC,EAAE,MAAM,IAAI,KAAK,MAAM,IAAI,EAAE,QAAQ,EAAE,eAAe,IACxG,UAAU,MAAM,IAAI,gBAQ7B"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { useContext, useEffect, useState } from "@lynx-js/react";
|
|
2
|
+
import { G9AnchorRegistryContext } from "../anchor/context.jsx";
|
|
3
|
+
import { G9ActivityContext } from "./contexts.jsx";
|
|
4
|
+
function createActivityStore(parent, own) {
|
|
5
|
+
const listeners = new Set();
|
|
6
|
+
let mine = own;
|
|
7
|
+
let shown = parent.visible() && mine;
|
|
8
|
+
const update = ()=>{
|
|
9
|
+
const next = parent.visible() && mine;
|
|
10
|
+
if (next === shown) return;
|
|
11
|
+
shown = next;
|
|
12
|
+
for (const l of Array.from(listeners))l();
|
|
13
|
+
};
|
|
14
|
+
return {
|
|
15
|
+
update,
|
|
16
|
+
visible: ()=>shown,
|
|
17
|
+
subscribe (listener) {
|
|
18
|
+
listeners.add(listener);
|
|
19
|
+
return ()=>void listeners.delete(listener);
|
|
20
|
+
},
|
|
21
|
+
set (own) {
|
|
22
|
+
mine = own;
|
|
23
|
+
update();
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function G9Activity(props) {
|
|
28
|
+
const parent = useContext(G9ActivityContext);
|
|
29
|
+
const [store] = useState(()=>createActivityStore(parent, 'visible' === props.mode));
|
|
30
|
+
const anchors = useContext(G9AnchorRegistryContext);
|
|
31
|
+
useEffect(()=>{
|
|
32
|
+
store.set('visible' === props.mode);
|
|
33
|
+
null == anchors || anchors.refresh();
|
|
34
|
+
}, [
|
|
35
|
+
props.mode,
|
|
36
|
+
store,
|
|
37
|
+
anchors
|
|
38
|
+
]);
|
|
39
|
+
useEffect(()=>parent.subscribe(store.update), [
|
|
40
|
+
parent,
|
|
41
|
+
store
|
|
42
|
+
]);
|
|
43
|
+
return <G9ActivityContext.Provider value={store}>{props.children}</G9ActivityContext.Provider>;
|
|
44
|
+
}
|
|
45
|
+
function subscribeThemeAndActivity(subscribeTheme, activity) {
|
|
46
|
+
return (listener)=>{
|
|
47
|
+
const a = subscribeTheme(listener);
|
|
48
|
+
const b = activity.subscribe(listener);
|
|
49
|
+
return ()=>{
|
|
50
|
+
a();
|
|
51
|
+
b();
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
export { G9Activity, subscribeThemeAndActivity };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { G9Capabilities, G9Culture, G9CultureStore, G9Diagnostics, G9Preferences, G9SafeExecutor, G9SafeInsets, G9Strings, G9ThemeStore } from '@g9tm/lynxcontrols-foundation';
|
|
1
|
+
import type { G9Breakpoints, G9Capabilities, G9Culture, G9CultureStore, G9Diagnostics, G9LayoutClass, G9Preferences, G9SafeExecutor, G9SafeInsets, G9ShapeSet, G9Strings, G9ThemeStore } from '@g9tm/lynxcontrols-foundation';
|
|
2
2
|
import type { G9AnchorRegistry } from '../anchor/registry.js';
|
|
3
3
|
import type { G9ResolvedSettings } from './settings.js';
|
|
4
4
|
/** What `useG9Culture` and `useG9Strings` read: the snapshot and the strings built for it. */
|
|
@@ -21,6 +21,23 @@ export interface G9WindowState {
|
|
|
21
21
|
readonly width: number;
|
|
22
22
|
readonly height: number;
|
|
23
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* The layout class (`useG9Layout`): changes only when the class, `wide` or the orientation changes — never on a
|
|
26
|
+
* pixel of resize — so a responsive control re-renders once per breakpoint crossing.
|
|
27
|
+
*/
|
|
28
|
+
export interface G9LayoutInfo {
|
|
29
|
+
readonly layout: G9LayoutClass;
|
|
30
|
+
/** Overlays present as dialogs / side panels. */
|
|
31
|
+
readonly wide: boolean;
|
|
32
|
+
readonly landscape: boolean;
|
|
33
|
+
readonly breakpoints: G9Breakpoints;
|
|
34
|
+
}
|
|
35
|
+
/** The live shape (radii, type roles, heights) and its listeners; the design registry and the provider write it. */
|
|
36
|
+
export interface G9ShapeStore {
|
|
37
|
+
get(): G9ShapeSet;
|
|
38
|
+
set(shape: G9ShapeSet): void;
|
|
39
|
+
subscribe(listener: () => void): () => void;
|
|
40
|
+
}
|
|
24
41
|
/** Everything a provider shares that never changes identity while it is mounted. */
|
|
25
42
|
export interface G9ProviderCore {
|
|
26
43
|
readonly services: G9Capabilities;
|
|
@@ -32,13 +49,27 @@ export interface G9ProviderCore {
|
|
|
32
49
|
readonly rootId: string;
|
|
33
50
|
/** Every anchor of this LynxView (`@g9tm/lynxcontrols/anchor`): the controls a guide or an automation can reach. */
|
|
34
51
|
readonly anchors: G9AnchorRegistry;
|
|
52
|
+
/** The live shape. */
|
|
53
|
+
readonly shape: G9ShapeStore;
|
|
35
54
|
}
|
|
36
55
|
export declare const G9CoreContext: import("react").Context<G9ProviderCore | null>;
|
|
56
|
+
/**
|
|
57
|
+
* Whether the region is shown ({@link G9Activity}): a stable store, so flipping a tab re-renders only what actually
|
|
58
|
+
* changed while it was hidden (a context VALUE change re-rendered every icon of both pages: tab switch 50 → 200 ms on
|
|
59
|
+
* a Galaxy A21s).
|
|
60
|
+
*/
|
|
61
|
+
export interface G9ActivityStore {
|
|
62
|
+
visible(): boolean;
|
|
63
|
+
subscribe(listener: () => void): () => void;
|
|
64
|
+
}
|
|
65
|
+
/** The enclosing activity (always visible outside any {@link G9Activity}). */
|
|
66
|
+
export declare const G9ActivityContext: import("react").Context<G9ActivityStore>;
|
|
37
67
|
export declare const G9CultureContext: import("react").Context<G9CultureContextValue | null>;
|
|
38
68
|
export declare const G9SettingsContext: import("react").Context<G9ResolvedSettings | null>;
|
|
39
69
|
export declare const G9KeyboardContext: import("react").Context<G9KeyboardState | null>;
|
|
40
70
|
export declare const G9WindowContext: import("react").Context<G9WindowState | null>;
|
|
41
71
|
export declare const G9InsetsContext: import("react").Context<G9SafeInsets | null>;
|
|
72
|
+
export declare const G9LayoutContext: import("react").Context<G9LayoutInfo | null>;
|
|
42
73
|
/** The provider's diagnostics hub, or `null` outside a provider (base hooks fall back to `console`). */
|
|
43
74
|
export declare const G9DiagnosticsContext: import("react").Context<G9Diagnostics | null>;
|
|
44
75
|
//# sourceMappingURL=contexts.d.ts.map
|
|
@@ -1 +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,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,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;IACxB,oHAAoH;IACpH,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"contexts.d.ts","sourceRoot":"","sources":["../../src/provider/contexts.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,SAAS,EACT,cAAc,EACd,aAAa,EACb,aAAa,EACb,aAAa,EACb,cAAc,EACd,YAAY,EACZ,UAAU,EACV,SAAS,EACT,YAAY,EACb,MAAM,+BAA+B,CAAC;AAEvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,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;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,iDAAiD;IACjD,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,aAAa,CAAC;CACrC;AAED,oHAAoH;AACpH,MAAM,WAAW,YAAY;IAC3B,GAAG,IAAI,UAAU,CAAC;IAClB,GAAG,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;IAC7B,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;CAC7C;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;IACxB,oHAAoH;IACpH,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC;IACnC,sBAAsB;IACtB,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;CAC9B;AAED,eAAO,MAAM,aAAa,gDAA6C,CAAC;AACxE;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,OAAO,IAAI,OAAO,CAAC;IACnB,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;CAC7C;AAID,8EAA8E;AAC9E,eAAO,MAAM,iBAAiB,0CAAiD,CAAC;AAChF,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,eAAO,MAAM,eAAe,8CAA2C,CAAC;AACxE,wGAAwG;AACxG,eAAO,MAAM,oBAAoB,+CAA4C,CAAC"}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { createContext } from "@lynx-js/react";
|
|
2
2
|
const G9CoreContext = createContext(null);
|
|
3
|
+
const ALWAYS_VISIBLE = Object.freeze({
|
|
4
|
+
visible: ()=>true,
|
|
5
|
+
subscribe: ()=>()=>void 0
|
|
6
|
+
});
|
|
7
|
+
const G9ActivityContext = createContext(ALWAYS_VISIBLE);
|
|
3
8
|
const G9CultureContext = createContext(null);
|
|
4
9
|
const G9SettingsContext = createContext(null);
|
|
5
10
|
const G9KeyboardContext = createContext(null);
|
|
6
11
|
const G9WindowContext = createContext(null);
|
|
7
12
|
const G9InsetsContext = createContext(null);
|
|
13
|
+
const G9LayoutContext = createContext(null);
|
|
8
14
|
const G9DiagnosticsContext = createContext(null);
|
|
9
|
-
export { G9CoreContext, G9CultureContext, G9DiagnosticsContext, G9InsetsContext, G9KeyboardContext, G9SettingsContext, G9WindowContext };
|
|
10
|
-
|
|
11
|
-
//# sourceMappingURL=contexts.jsx.map
|
|
15
|
+
export { G9ActivityContext, G9CoreContext, G9CultureContext, G9DiagnosticsContext, G9InsetsContext, G9KeyboardContext, G9LayoutContext, G9SettingsContext, G9WindowContext };
|
package/dist/provider/hooks.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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';
|
|
1
|
+
import { type G9Capabilities, type G9CapabilityName, type G9Culture, type G9CultureStore, type G9DesignRegistry, type G9Diagnostics, type G9Direction, type G9Preferences, type G9ResolvedTheme, type G9SafeExecutor, type G9SafeInsets, type G9ShapeSet, type G9Strings, type G9ThemeStore } from '@g9tm/lynxcontrols-foundation';
|
|
2
|
+
import { type G9KeyboardState, type G9LayoutInfo, type G9ProviderCore, type G9WindowState } from './contexts.js';
|
|
3
3
|
import type { G9ResolvedSettings } from './settings.js';
|
|
4
4
|
/** The provider's shared core (services, stores, executor). Throws `provider-missing` outside a provider. */
|
|
5
5
|
export declare function useG9Core(): G9ProviderCore;
|
|
@@ -16,6 +16,8 @@ export declare function useG9CultureStore(): G9CultureStore;
|
|
|
16
16
|
* else follows through CSS variables.
|
|
17
17
|
*/
|
|
18
18
|
export declare function useG9Theme(): G9ResolvedTheme;
|
|
19
|
+
/** True unless inside a hidden {@link G9Activity}: a component that does work for what is on screen may skip it. */
|
|
20
|
+
export declare function useG9ActivityVisible(): boolean;
|
|
19
21
|
/** The theme store, to switch mode or palettes (MAUI `G9Theme.ChangeTheme`). Does not re-render. */
|
|
20
22
|
export declare function useG9ThemeStore(): G9ThemeStore;
|
|
21
23
|
/** The app-wide settings with defaults filled in. */
|
|
@@ -46,4 +48,16 @@ export interface G9WindowInfo extends G9WindowState {
|
|
|
46
48
|
export declare function useG9Window(): G9WindowInfo;
|
|
47
49
|
/** The platform safe-area insets from the host service; re-renders when they change. */
|
|
48
50
|
export declare function useG9SafeInsets(): G9SafeInsets;
|
|
51
|
+
/**
|
|
52
|
+
* The layout class (phone / tablet / desktop), whether overlays present wide, the orientation and the breakpoints.
|
|
53
|
+
* Re-renders only when one of those changes — the cheap way to be responsive (use `useG9Window` for pixels).
|
|
54
|
+
*/
|
|
55
|
+
export declare function useG9Layout(): G9LayoutInfo;
|
|
56
|
+
/** The live shape (radii, type roles, control heights); re-renders when it changes. Most controls read the CSS variables instead. */
|
|
57
|
+
export declare function useG9Shape(): G9ShapeSet;
|
|
58
|
+
/**
|
|
59
|
+
* This provider's theme and shape as a live design registry, the shape G9AppPilot's `installDesign(registry)` takes
|
|
60
|
+
* (test builds: `useEffect(() => installDesign(registry), [registry])`). Stable for the provider's life.
|
|
61
|
+
*/
|
|
62
|
+
export declare function useG9DesignRegistry(): G9DesignRegistry;
|
|
49
63
|
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/provider/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/provider/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,WAAW,EAEhB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,YAAY,EAGlB,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EAML,KAAK,eAAe,EAEpB,KAAK,YAAY,EACjB,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,CAa5C;AAED,oHAAoH;AACpH,wBAAgB,oBAAoB,IAAI,OAAO,CAG9C;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;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,YAAY,CAE1C;AAED,qIAAqI;AACrI,wBAAgB,UAAU,IAAI,UAAU,CAGvC;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,gBAAgB,CAMtD"}
|