@g9tm/lynxcontrols 1.7.2 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -5
- package/dist/.tsbuildinfo +1 -1
- package/dist/anchor/context.jsx +0 -2
- package/dist/anchor/hooks.d.ts.map +1 -1
- package/dist/anchor/hooks.jsx +6 -4
- package/dist/anchor/measure.jsx +0 -2
- package/dist/anchor/registry.d.ts +12 -2
- package/dist/anchor/registry.d.ts.map +1 -1
- package/dist/anchor/registry.jsx +11 -3
- package/dist/anchor/scroll.jsx +0 -2
- package/dist/base/control.d.ts +18 -2
- package/dist/base/control.d.ts.map +1 -1
- package/dist/base/control.jsx +16 -9
- package/dist/base/corner-badge.jsx +0 -2
- package/dist/base/disposer.jsx +0 -2
- package/dist/base/index.d.ts +3 -2
- package/dist/base/index.d.ts.map +1 -1
- package/dist/base/index.jsx +3 -2
- package/dist/base/press.css +83 -0
- package/dist/base/press.css.map +1 -0
- package/dist/base/press.d.ts +13 -2
- package/dist/base/press.d.ts.map +1 -1
- package/dist/base/press.jsx +49 -5
- package/dist/base/pressable.d.ts +10 -1
- package/dist/base/pressable.d.ts.map +1 -1
- package/dist/base/pressable.jsx +13 -8
- package/dist/base/selection-item.jsx +0 -2
- package/dist/base/timers.jsx +0 -2
- package/dist/base/tone.d.ts +15 -0
- package/dist/base/tone.d.ts.map +1 -0
- package/dist/base/tone.jsx +71 -0
- package/dist/base/use-controllable-state.jsx +0 -2
- package/dist/base/use-stable-callback.jsx +0 -2
- package/dist/button/button-variants.css +236 -0
- package/dist/button/button-variants.css.map +1 -0
- package/dist/button/button.css +21 -0
- package/dist/button/button.css.map +1 -1
- package/dist/button/button.d.ts +13 -1
- package/dist/button/button.d.ts.map +1 -1
- package/dist/button/button.jsx +51 -38
- package/dist/button/header-action-button.d.ts +1 -0
- package/dist/button/header-action-button.d.ts.map +1 -1
- package/dist/button/header-action-button.jsx +6 -7
- package/dist/button/icon-button.d.ts +11 -1
- package/dist/button/icon-button.d.ts.map +1 -1
- package/dist/button/icon-button.jsx +21 -17
- package/dist/button/nav-card.d.ts +1 -0
- package/dist/button/nav-card.d.ts.map +1 -1
- package/dist/button/nav-card.jsx +6 -7
- package/dist/button/safe-tap.jsx +0 -2
- package/dist/button/safe.jsx +3 -5
- package/dist/button/variant-css.d.ts +8 -0
- package/dist/button/variant-css.d.ts.map +1 -0
- package/dist/button/variant-css.jsx +47 -0
- package/dist/button/vertical-icon-text-button.d.ts.map +1 -1
- package/dist/button/vertical-icon-text-button.jsx +1 -3
- package/dist/button/visuals.d.ts +7 -1
- package/dist/button/visuals.d.ts.map +1 -1
- package/dist/button/visuals.jsx +5 -5
- package/dist/cascade/cascade-panel.jsx +0 -2
- package/dist/cascade/model.jsx +0 -2
- package/dist/commands/commands.css +167 -0
- package/dist/commands/commands.css.map +1 -0
- package/dist/commands/index.d.ts +3 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.jsx +2 -0
- package/dist/commands/keys.d.ts +22 -0
- package/dist/commands/keys.d.ts.map +1 -0
- package/dist/commands/keys.jsx +119 -0
- package/dist/commands/palette.d.ts +62 -0
- package/dist/commands/palette.d.ts.map +1 -0
- package/dist/commands/palette.jsx +175 -0
- package/dist/deferred/deferred-content.jsx +2 -4
- package/dist/deferred/readiness-signal.jsx +0 -2
- package/dist/display/activity-indicator.jsx +0 -2
- package/dist/display/culture-date-time-label.jsx +1 -3
- package/dist/display/extras.css +117 -0
- package/dist/display/extras.css.map +1 -0
- package/dist/display/extras.d.ts +65 -0
- package/dist/display/extras.d.ts.map +1 -0
- package/dist/display/extras.jsx +118 -0
- package/dist/display/figures-index.d.ts +3 -0
- package/dist/display/figures-index.d.ts.map +1 -0
- package/dist/display/figures-index.jsx +2 -0
- package/dist/display/figures.css +249 -0
- package/dist/display/figures.css.map +1 -0
- package/dist/display/figures.d.ts +132 -0
- package/dist/display/figures.d.ts.map +1 -0
- package/dist/display/figures.jsx +223 -0
- package/dist/display/image.css +46 -0
- package/dist/display/image.css.map +1 -0
- package/dist/display/image.d.ts +32 -0
- package/dist/display/image.d.ts.map +1 -0
- package/dist/display/image.jsx +49 -0
- package/dist/display/index.d.ts +6 -0
- package/dist/display/index.d.ts.map +1 -1
- package/dist/display/index.jsx +6 -0
- package/dist/display/keycap.css +32 -0
- package/dist/display/keycap.css.map +1 -0
- package/dist/display/keycap.d.ts +20 -0
- package/dist/display/keycap.d.ts.map +1 -0
- package/dist/display/keycap.jsx +17 -0
- package/dist/display/motion-figures.css +168 -0
- package/dist/display/motion-figures.css.map +1 -0
- package/dist/display/motion-figures.d.ts +155 -0
- package/dist/display/motion-figures.d.ts.map +1 -0
- package/dist/display/motion-figures.jsx +246 -0
- package/dist/display/progress-bar.jsx +1 -3
- package/dist/display/separator.d.ts.map +1 -1
- package/dist/display/separator.jsx +2 -4
- package/dist/display/shimmer.jsx +0 -2
- package/dist/display/skeleton.css +72 -0
- package/dist/display/skeleton.css.map +1 -0
- package/dist/display/status.css +111 -0
- package/dist/display/status.css.map +1 -0
- package/dist/display/status.d.ts +67 -0
- package/dist/display/status.d.ts.map +1 -0
- package/dist/display/status.jsx +117 -0
- package/dist/display/theme-preview.css +244 -0
- package/dist/display/theme-preview.css.map +1 -0
- package/dist/display/theme-preview.d.ts +19 -0
- package/dist/display/theme-preview.d.ts.map +1 -0
- package/dist/display/theme-preview.jsx +89 -0
- package/dist/display/title-with-line.d.ts.map +1 -1
- package/dist/display/title-with-line.jsx +2 -4
- package/dist/edge-panel/edge-panel.jsx +0 -2
- package/dist/edge-panel/helper.jsx +0 -2
- package/dist/edge-panel/types.jsx +0 -2
- package/dist/effects/effects.css +94 -0
- package/dist/effects/effects.css.map +1 -0
- package/dist/effects/effects.d.ts +83 -0
- package/dist/effects/effects.d.ts.map +1 -0
- package/dist/effects/effects.jsx +183 -0
- package/dist/effects/index.d.ts +2 -0
- package/dist/effects/index.d.ts.map +1 -0
- package/dist/effects/index.jsx +1 -0
- package/dist/expander/expander.d.ts +1 -0
- package/dist/expander/expander.d.ts.map +1 -1
- package/dist/expander/expander.jsx +22 -23
- package/dist/fields/dictation.jsx +0 -2
- package/dist/fields/editor.d.ts.map +1 -1
- package/dist/fields/editor.jsx +5 -6
- package/dist/fields/extra-entries.css +133 -0
- package/dist/fields/extra-entries.css.map +1 -0
- package/dist/fields/extra-entries.d.ts +98 -0
- package/dist/fields/extra-entries.d.ts.map +1 -0
- package/dist/fields/extra-entries.jsx +323 -0
- package/dist/fields/fields.css +4 -0
- package/dist/fields/fields.css.map +1 -1
- package/dist/fields/index.d.ts +4 -3
- package/dist/fields/index.d.ts.map +1 -1
- package/dist/fields/index.jsx +1 -0
- package/dist/fields/input-policy.jsx +0 -2
- package/dist/fields/notch.jsx +0 -2
- package/dist/fields/outlined-field.d.ts +14 -0
- package/dist/fields/outlined-field.d.ts.map +1 -1
- package/dist/fields/outlined-field.jsx +12 -10
- package/dist/fields/pin-entry.d.ts.map +1 -1
- package/dist/fields/pin-entry.jsx +11 -13
- package/dist/fields/search-entry.jsx +2 -4
- package/dist/fields/slot-layout.jsx +0 -2
- package/dist/fields/text-entry.jsx +2 -4
- package/dist/fields/use-dictation.jsx +0 -2
- package/dist/fields/use-text-input.d.ts +1 -1
- package/dist/fields/use-text-input.jsx +0 -2
- package/dist/fields/validator.jsx +0 -2
- package/dist/guide/confirm-sheet.jsx +0 -2
- package/dist/guide/journey.jsx +0 -2
- package/dist/guide/placement.jsx +0 -2
- package/dist/guide/service.jsx +0 -2
- package/dist/guide/settings.jsx +0 -2
- package/dist/header/app-bar.d.ts +35 -0
- package/dist/header/app-bar.d.ts.map +1 -0
- package/dist/header/app-bar.jsx +64 -0
- package/dist/header/header.css +79 -0
- package/dist/header/header.css.map +1 -0
- package/dist/header/index.d.ts +2 -0
- package/dist/header/index.d.ts.map +1 -0
- package/dist/header/index.jsx +1 -0
- package/dist/host/back.jsx +0 -2
- package/dist/host/hooks.jsx +0 -2
- package/dist/host/host.css +1 -0
- package/dist/host/host.css.map +1 -1
- package/dist/host/host.d.ts.map +1 -1
- package/dist/host/host.jsx +50 -17
- package/dist/host/keyboard.jsx +0 -2
- package/dist/host/layers.jsx +0 -2
- package/dist/host/page-loading-overlay.jsx +0 -2
- package/dist/host/readiness.jsx +0 -2
- package/dist/host/registry.d.ts +9 -0
- package/dist/host/registry.d.ts.map +1 -1
- package/dist/host/registry.jsx +0 -2
- package/dist/icon/icon.d.ts +16 -0
- package/dist/icon/icon.d.ts.map +1 -1
- package/dist/icon/icon.jsx +53 -14
- package/dist/icon/index.d.ts +1 -1
- package/dist/icon/index.d.ts.map +1 -1
- package/dist/icon/index.jsx +1 -1
- package/dist/icon/slot.jsx +0 -2
- package/dist/icon/swatch.jsx +0 -2
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/layout/containers.d.ts +113 -0
- package/dist/layout/containers.d.ts.map +1 -0
- package/dist/layout/containers.jsx +195 -0
- package/dist/layout/index.d.ts +4 -0
- package/dist/layout/index.d.ts.map +1 -0
- package/dist/layout/index.jsx +3 -0
- package/dist/layout/layout.css +361 -0
- package/dist/layout/layout.css.map +1 -0
- package/dist/layout/scroll-spy.d.ts +18 -0
- package/dist/layout/scroll-spy.d.ts.map +1 -0
- package/dist/layout/scroll-spy.jsx +38 -0
- package/dist/layout/scrollers.d.ts +96 -0
- package/dist/layout/scrollers.d.ts.map +1 -0
- package/dist/layout/scrollers.jsx +208 -0
- package/dist/list/gestures.d.ts +40 -0
- package/dist/list/gestures.d.ts.map +1 -0
- package/dist/list/gestures.jsx +142 -0
- package/dist/list/index.d.ts +4 -0
- package/dist/list/index.d.ts.map +1 -0
- package/dist/list/index.jsx +3 -0
- package/dist/list/list.css +194 -0
- package/dist/list/list.css.map +1 -0
- package/dist/list/rows.d.ts +69 -0
- package/dist/list/rows.d.ts.map +1 -0
- package/dist/list/rows.jsx +105 -0
- package/dist/list/virtual-list.d.ts +94 -0
- package/dist/list/virtual-list.d.ts.map +1 -0
- package/dist/list/virtual-list.jsx +159 -0
- package/dist/orb/hold-button.d.ts +26 -0
- package/dist/orb/hold-button.d.ts.map +1 -0
- package/dist/orb/hold-button.jsx +33 -0
- package/dist/orb/hold.d.ts +36 -0
- package/dist/orb/hold.d.ts.map +1 -0
- package/dist/orb/hold.jsx +76 -0
- package/dist/orb/index.d.ts +5 -0
- package/dist/orb/index.d.ts.map +1 -0
- package/dist/orb/index.jsx +4 -0
- package/dist/orb/model.d.ts +42 -0
- package/dist/orb/model.d.ts.map +1 -0
- package/dist/orb/model.jsx +42 -0
- package/dist/orb/orb.css +81 -0
- package/dist/orb/orb.css.map +1 -0
- package/dist/orb/orb.d.ts +61 -0
- package/dist/orb/orb.d.ts.map +1 -0
- package/dist/orb/orb.jsx +171 -0
- package/dist/pickers/combo-box.jsx +0 -2
- package/dist/pickers/date-time-picker.jsx +0 -2
- package/dist/pickers/date-time.jsx +0 -2
- package/dist/pickers/day-stepper.css +43 -0
- package/dist/pickers/day-stepper.css.map +1 -0
- package/dist/pickers/day-stepper.d.ts +31 -0
- package/dist/pickers/day-stepper.d.ts.map +1 -0
- package/dist/pickers/day-stepper.jsx +60 -0
- package/dist/pickers/index.d.ts +1 -0
- package/dist/pickers/index.d.ts.map +1 -1
- package/dist/pickers/index.jsx +1 -0
- package/dist/pickers/picker-sheet.jsx +0 -2
- package/dist/pickers/picker.d.ts +11 -0
- package/dist/pickers/picker.d.ts.map +1 -1
- package/dist/pickers/picker.jsx +53 -9
- package/dist/pickers/timespan-picker.jsx +0 -2
- package/dist/pickers/timespan.jsx +0 -2
- package/dist/pickers/trigger.jsx +0 -2
- package/dist/pickers/wheel-column.jsx +0 -2
- package/dist/plus-button/model.jsx +0 -2
- package/dist/plus-button/plus-button.jsx +0 -2
- package/dist/popover/index.d.ts +3 -0
- package/dist/popover/index.d.ts.map +1 -0
- package/dist/popover/index.jsx +2 -0
- package/dist/popover/popover.css +183 -0
- package/dist/popover/popover.css.map +1 -0
- package/dist/popover/popover.d.ts +139 -0
- package/dist/popover/popover.d.ts.map +1 -0
- package/dist/popover/popover.jsx +291 -0
- package/dist/popover/position.d.ts +35 -0
- package/dist/popover/position.d.ts.map +1 -0
- package/dist/popover/position.jsx +53 -0
- package/dist/popup/frame.jsx +0 -2
- package/dist/popup/input-form.jsx +0 -2
- package/dist/popup/input.jsx +0 -2
- package/dist/popup/popup-view.jsx +0 -2
- package/dist/popup/queue.jsx +0 -2
- package/dist/popup/service.jsx +0 -2
- package/dist/popup/types.jsx +0 -2
- package/dist/provider/activity.d.ts +13 -0
- package/dist/provider/activity.d.ts.map +1 -0
- package/dist/provider/activity.jsx +55 -0
- package/dist/provider/contexts.d.ts +32 -1
- package/dist/provider/contexts.d.ts.map +1 -1
- package/dist/provider/contexts.jsx +7 -3
- package/dist/provider/global-events.jsx +0 -2
- package/dist/provider/hooks.d.ts +16 -2
- package/dist/provider/hooks.d.ts.map +1 -1
- package/dist/provider/hooks.jsx +35 -7
- package/dist/provider/index.d.ts +4 -2
- package/dist/provider/index.d.ts.map +1 -1
- package/dist/provider/index.jsx +3 -1
- package/dist/provider/keep-alive.css +19 -0
- package/dist/provider/keep-alive.css.map +1 -0
- package/dist/provider/keep-alive.d.ts +23 -0
- package/dist/provider/keep-alive.d.ts.map +1 -0
- package/dist/provider/keep-alive.jsx +9 -0
- package/dist/provider/provider.css +1 -1
- package/dist/provider/provider.css.map +1 -1
- package/dist/provider/provider.d.ts +13 -1
- package/dist/provider/provider.d.ts.map +1 -1
- package/dist/provider/provider.jsx +128 -15
- package/dist/provider/settings.d.ts +23 -0
- package/dist/provider/settings.d.ts.map +1 -1
- package/dist/provider/settings.jsx +5 -4
- package/dist/provider/theme-css.d.ts +1 -1
- package/dist/provider/theme-css.d.ts.map +1 -1
- package/dist/provider/theme-css.jsx +21 -10
- package/dist/provider/theme-root.d.ts.map +1 -1
- package/dist/provider/theme-root.jsx +7 -5
- package/dist/provider/theme.css +72 -0
- package/dist/provider/theme.css.map +1 -1
- package/dist/range-slider/index.d.ts +1 -0
- package/dist/range-slider/index.d.ts.map +1 -1
- package/dist/range-slider/index.jsx +1 -0
- package/dist/range-slider/math.jsx +0 -2
- package/dist/range-slider/range-slider.css +82 -0
- package/dist/range-slider/range-slider.css.map +1 -1
- package/dist/range-slider/range-slider.jsx +0 -2
- package/dist/range-slider/step-slider.d.ts +18 -0
- package/dist/range-slider/step-slider.d.ts.map +1 -0
- package/dist/range-slider/step-slider.jsx +55 -0
- package/dist/route/hooks.jsx +0 -2
- package/dist/route/router.jsx +0 -2
- package/dist/selection/model.jsx +0 -2
- package/dist/selection/selection-sheet.jsx +0 -2
- package/dist/selection/use-selection-model.jsx +0 -2
- package/dist/selection/window.jsx +0 -2
- package/dist/sheet/backdrop-scope.d.ts +14 -0
- package/dist/sheet/backdrop-scope.d.ts.map +1 -0
- package/dist/sheet/backdrop-scope.jsx +25 -0
- package/dist/sheet/context.d.ts +22 -0
- package/dist/sheet/context.d.ts.map +1 -0
- package/dist/sheet/context.jsx +7 -0
- package/dist/sheet/frame.d.ts +2 -17
- package/dist/sheet/frame.d.ts.map +1 -1
- package/dist/sheet/frame.jsx +23 -19
- package/dist/sheet/gesture.jsx +1 -3
- package/dist/sheet/handoff.jsx +0 -2
- package/dist/sheet/header.jsx +3 -3
- package/dist/sheet/height-memo.jsx +0 -2
- package/dist/sheet/index.d.ts +2 -0
- package/dist/sheet/index.d.ts.map +1 -1
- package/dist/sheet/index.jsx +2 -0
- package/dist/sheet/loadable.jsx +0 -2
- package/dist/sheet/motion.jsx +0 -2
- package/dist/sheet/options.d.ts +17 -0
- package/dist/sheet/options.d.ts.map +1 -1
- package/dist/sheet/options.jsx +2 -3
- package/dist/sheet/panel-frame.css +204 -0
- package/dist/sheet/panel-frame.css.map +1 -0
- package/dist/sheet/panel-frame.d.ts +16 -0
- package/dist/sheet/panel-frame.d.ts.map +1 -0
- package/dist/sheet/panel-frame.jsx +103 -0
- package/dist/sheet/processing.jsx +0 -2
- package/dist/sheet/scroll-indicator.jsx +0 -2
- package/dist/sheet/scroll-region.d.ts +19 -0
- package/dist/sheet/scroll-region.d.ts.map +1 -0
- package/dist/sheet/scroll-region.jsx +58 -0
- package/dist/sheet/service.d.ts.map +1 -1
- package/dist/sheet/service.jsx +23 -9
- package/dist/sheet/sheet.css +33 -0
- package/dist/sheet/sheet.css.map +1 -1
- package/dist/sheet/sheet.jsx +0 -2
- package/dist/sheet/sizing.d.ts +3 -3
- package/dist/sheet/sizing.jsx +0 -2
- package/dist/sheet/stack.jsx +0 -2
- package/dist/shell/index.d.ts +2 -0
- package/dist/shell/index.d.ts.map +1 -0
- package/dist/shell/index.jsx +1 -0
- package/dist/shell/shell.css +342 -0
- package/dist/shell/shell.css.map +1 -0
- package/dist/shell/shell.d.ts +121 -0
- package/dist/shell/shell.d.ts.map +1 -0
- package/dist/shell/shell.jsx +214 -0
- package/dist/survey/index.d.ts +2 -0
- package/dist/survey/index.d.ts.map +1 -0
- package/dist/survey/index.jsx +1 -0
- package/dist/survey/survey.css +204 -0
- package/dist/survey/survey.css.map +1 -0
- package/dist/survey/survey.d.ts +76 -0
- package/dist/survey/survey.d.ts.map +1 -0
- package/dist/survey/survey.jsx +205 -0
- package/dist/swipe/model.jsx +0 -2
- package/dist/swipe/swipe-view.jsx +0 -2
- package/dist/tab-bar/metrics.jsx +20 -22
- package/dist/tab-bar/model.d.ts +2 -0
- package/dist/tab-bar/model.d.ts.map +1 -1
- package/dist/tab-bar/model.jsx +10 -6
- package/dist/tab-bar/tab-bar.css +74 -0
- package/dist/tab-bar/tab-bar.css.map +1 -1
- package/dist/tab-bar/tab-bar.d.ts +7 -0
- package/dist/tab-bar/tab-bar.d.ts.map +1 -1
- package/dist/tab-bar/tab-bar.jsx +51 -17
- package/dist/tabs/model.jsx +0 -2
- package/dist/tabs/tab-view.d.ts +1 -0
- package/dist/tabs/tab-view.d.ts.map +1 -1
- package/dist/tabs/tab-view.jsx +6 -5
- package/dist/tabs/tabs.css +1 -0
- package/dist/tabs/tabs.css.map +1 -1
- package/dist/toast/service.d.ts.map +1 -1
- package/dist/toast/service.jsx +34 -16
- package/dist/toast/store.jsx +0 -2
- package/dist/toggle/checkbox-math.jsx +0 -2
- package/dist/toggle/checkbox.d.ts.map +1 -1
- package/dist/toggle/checkbox.jsx +10 -12
- package/dist/toggle/chip-group.d.ts.map +1 -1
- package/dist/toggle/chip-group.jsx +8 -7
- package/dist/toggle/choice.css +254 -0
- package/dist/toggle/choice.css.map +1 -0
- package/dist/toggle/choice.d.ts +125 -0
- package/dist/toggle/choice.d.ts.map +1 -0
- package/dist/toggle/choice.jsx +367 -0
- package/dist/toggle/index.d.ts +2 -1
- package/dist/toggle/index.d.ts.map +1 -1
- package/dist/toggle/index.jsx +1 -0
- package/dist/toggle/switch.d.ts.map +1 -1
- package/dist/toggle/switch.jsx +8 -11
- package/package.json +126 -16
- package/tailwind/index.d.ts +13 -0
- package/tailwind/index.mjs +87 -0
- package/tailwind/index.test.mjs +24 -0
- package/tailwind/tokens.mjs +98 -0
- package/dist/anchor/context.jsx.map +0 -1
- package/dist/anchor/hooks.jsx.map +0 -1
- package/dist/anchor/measure.jsx.map +0 -1
- package/dist/anchor/registry.jsx.map +0 -1
- package/dist/anchor/scroll.jsx.map +0 -1
- package/dist/base/control.jsx.map +0 -1
- package/dist/base/corner-badge.jsx.map +0 -1
- package/dist/base/disposer.jsx.map +0 -1
- package/dist/base/press.jsx.map +0 -1
- package/dist/base/pressable.jsx.map +0 -1
- package/dist/base/selection-item.jsx.map +0 -1
- package/dist/base/timers.jsx.map +0 -1
- package/dist/base/use-controllable-state.jsx.map +0 -1
- package/dist/base/use-stable-callback.jsx.map +0 -1
- package/dist/button/button.jsx.map +0 -1
- package/dist/button/header-action-button.jsx.map +0 -1
- package/dist/button/icon-button.jsx.map +0 -1
- package/dist/button/nav-card.jsx.map +0 -1
- package/dist/button/safe-tap.jsx.map +0 -1
- package/dist/button/safe.jsx.map +0 -1
- package/dist/button/vertical-icon-text-button.jsx.map +0 -1
- package/dist/button/visuals.jsx.map +0 -1
- package/dist/cascade/cascade-panel.jsx.map +0 -1
- package/dist/cascade/model.jsx.map +0 -1
- package/dist/deferred/deferred-content.jsx.map +0 -1
- package/dist/deferred/readiness-signal.jsx.map +0 -1
- package/dist/display/activity-indicator.jsx.map +0 -1
- package/dist/display/culture-date-time-label.jsx.map +0 -1
- package/dist/display/progress-bar.jsx.map +0 -1
- package/dist/display/separator.jsx.map +0 -1
- package/dist/display/shimmer.jsx.map +0 -1
- package/dist/display/title-with-line.jsx.map +0 -1
- package/dist/edge-panel/edge-panel.jsx.map +0 -1
- package/dist/edge-panel/helper.jsx.map +0 -1
- package/dist/edge-panel/types.jsx.map +0 -1
- package/dist/expander/expander.jsx.map +0 -1
- package/dist/fields/dictation.jsx.map +0 -1
- package/dist/fields/editor.jsx.map +0 -1
- package/dist/fields/input-policy.jsx.map +0 -1
- package/dist/fields/notch.jsx.map +0 -1
- package/dist/fields/outlined-field.jsx.map +0 -1
- package/dist/fields/pin-entry.jsx.map +0 -1
- package/dist/fields/search-entry.jsx.map +0 -1
- package/dist/fields/slot-layout.jsx.map +0 -1
- package/dist/fields/text-entry.jsx.map +0 -1
- package/dist/fields/use-dictation.jsx.map +0 -1
- package/dist/fields/use-text-input.jsx.map +0 -1
- package/dist/fields/validator.jsx.map +0 -1
- package/dist/guide/confirm-sheet.jsx.map +0 -1
- package/dist/guide/journey.jsx.map +0 -1
- package/dist/guide/placement.jsx.map +0 -1
- package/dist/guide/service.jsx.map +0 -1
- package/dist/guide/settings.jsx.map +0 -1
- package/dist/host/back.jsx.map +0 -1
- package/dist/host/hooks.jsx.map +0 -1
- package/dist/host/host.jsx.map +0 -1
- package/dist/host/keyboard.jsx.map +0 -1
- package/dist/host/layers.jsx.map +0 -1
- package/dist/host/page-loading-overlay.jsx.map +0 -1
- package/dist/host/readiness.jsx.map +0 -1
- package/dist/host/registry.jsx.map +0 -1
- package/dist/icon/icon.jsx.map +0 -1
- package/dist/icon/slot.jsx.map +0 -1
- package/dist/icon/swatch.jsx.map +0 -1
- package/dist/pickers/combo-box.jsx.map +0 -1
- package/dist/pickers/date-time-picker.jsx.map +0 -1
- package/dist/pickers/date-time.jsx.map +0 -1
- package/dist/pickers/picker-sheet.jsx.map +0 -1
- package/dist/pickers/picker.jsx.map +0 -1
- package/dist/pickers/timespan-picker.jsx.map +0 -1
- package/dist/pickers/timespan.jsx.map +0 -1
- package/dist/pickers/trigger.jsx.map +0 -1
- package/dist/pickers/wheel-column.jsx.map +0 -1
- package/dist/plus-button/model.jsx.map +0 -1
- package/dist/plus-button/plus-button.jsx.map +0 -1
- package/dist/popup/frame.jsx.map +0 -1
- package/dist/popup/input-form.jsx.map +0 -1
- package/dist/popup/input.jsx.map +0 -1
- package/dist/popup/popup-view.jsx.map +0 -1
- package/dist/popup/queue.jsx.map +0 -1
- package/dist/popup/service.jsx.map +0 -1
- package/dist/popup/types.jsx.map +0 -1
- package/dist/provider/contexts.jsx.map +0 -1
- package/dist/provider/global-events.jsx.map +0 -1
- package/dist/provider/hooks.jsx.map +0 -1
- package/dist/provider/provider.jsx.map +0 -1
- package/dist/provider/settings.jsx.map +0 -1
- package/dist/provider/theme-css.jsx.map +0 -1
- package/dist/provider/theme-root.jsx.map +0 -1
- package/dist/range-slider/math.jsx.map +0 -1
- package/dist/range-slider/range-slider.jsx.map +0 -1
- package/dist/route/hooks.jsx.map +0 -1
- package/dist/route/router.jsx.map +0 -1
- package/dist/selection/model.jsx.map +0 -1
- package/dist/selection/selection-sheet.jsx.map +0 -1
- package/dist/selection/use-selection-model.jsx.map +0 -1
- package/dist/selection/window.jsx.map +0 -1
- package/dist/sheet/frame.jsx.map +0 -1
- package/dist/sheet/gesture.jsx.map +0 -1
- package/dist/sheet/handoff.jsx.map +0 -1
- package/dist/sheet/header.jsx.map +0 -1
- package/dist/sheet/height-memo.jsx.map +0 -1
- package/dist/sheet/loadable.jsx.map +0 -1
- package/dist/sheet/motion.jsx.map +0 -1
- package/dist/sheet/options.jsx.map +0 -1
- package/dist/sheet/processing.jsx.map +0 -1
- package/dist/sheet/scroll-indicator.jsx.map +0 -1
- package/dist/sheet/service.jsx.map +0 -1
- package/dist/sheet/sheet.jsx.map +0 -1
- package/dist/sheet/sizing.jsx.map +0 -1
- package/dist/sheet/stack.jsx.map +0 -1
- package/dist/swipe/model.jsx.map +0 -1
- package/dist/swipe/swipe-view.jsx.map +0 -1
- package/dist/tab-bar/metrics.jsx.map +0 -1
- package/dist/tab-bar/model.jsx.map +0 -1
- package/dist/tab-bar/tab-bar.jsx.map +0 -1
- package/dist/tabs/model.jsx.map +0 -1
- package/dist/tabs/tab-view.jsx.map +0 -1
- package/dist/toast/service.jsx.map +0 -1
- package/dist/toast/store.jsx.map +0 -1
- package/dist/toggle/checkbox-math.jsx.map +0 -1
- package/dist/toggle/checkbox.jsx.map +0 -1
- package/dist/toggle/chip-group.jsx.map +0 -1
- package/dist/toggle/switch.jsx.map +0 -1
package/dist/button/safe.jsx.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"button/safe.jsx","sources":["../../src/button/safe.tsx"],"sourcesContent":["import {\n createAbortController,\n type G9AbortController,\n type G9AbortSignal,\n type G9ButtonVariant,\n type G9SafeRunContext,\n type G9SafeRunResult,\n} from '@g9tm/lynxcontrols-foundation';\nimport { forwardRef, type ReactNode, useEffect, useImperativeHandle, useRef, useState } from '@lynx-js/react';\nimport { useG9Executor } from '../provider/hooks';\nimport { G9Button, type G9ButtonProps } from './button';\nimport { G9IconButton, type G9IconButtonProps } from './icon-button';\n\n/** MAUI `G9SafeButtonType`: a subset of the button variants. */\nexport const G9SafeButtonType = {\n Primary: 'primary',\n Default: 'default',\n Secondary: 'secondary',\n Info: 'info',\n Success: 'success',\n Warning: 'warning',\n Error: 'error',\n Surface: 'surface',\n Outline: 'outline',\n} as const;\nexport type G9SafeButtonType = (typeof G9SafeButtonType)[keyof typeof G9SafeButtonType];\n\n/** The guarded action: `onExecute` (specs/03 §4). */\nexport type G9SafeExecuteHandler = (context: G9SafeRunContext) => unknown;\n\n/** Options of the guarded execution shared by the safe buttons (MAUI `G9SafeExecution`). */\nexport interface G9SafeExecutionProps {\n /** The guarded action (MAUI `SafeCommand` / `SafeClickedCallbackAsync` / `SafeClickedAsync`). */\n readonly onExecute?: G9SafeExecuteHandler;\n /** More guarded handlers, awaited in order after `onExecute` (MAUI `SafeClickedAsync` subscribers). */\n readonly onExecuteHandlers?: ReadonlyArray<G9SafeExecuteHandler>;\n /** Guarded execution on; false: a tap only calls `onPress`. Default true. */\n readonly enableSafeExecution?: boolean;\n /** Block presses (dim 0.38) while busy. Default true. */\n readonly disableWhileLoading?: boolean;\n /** Show the spinner while busy. Default true. */\n readonly showSpinnerWhileLoading?: boolean;\n /** Diagnostics source. Default `'G9SafeButton'` / `'G9SafeIconButton'`. */\n readonly source?: string;\n /** Error popup message for an unexpected error. Default the localized `unexpectedError`. */\n readonly errorMessage?: string;\n /** Error popup title. Default the localized `error`. */\n readonly errorTitle?: string;\n /** Show the error popup. Default true. */\n readonly showErrorPopup?: boolean;\n /** Double-tap throttle. Default true. */\n readonly enableThrottle?: boolean;\n /** Throttle/concurrency key. Default one per instance. */\n readonly throttleKey?: string;\n /** Throttle interval. Default 369 ms. */\n readonly throttleIntervalMs?: number;\n /** Delay before the action starts (and before busy shows). Default 0. */\n readonly busyDelayMs?: number;\n /** `false` blocks the button and dims it (MAUI `Command.CanExecute`). Default true. */\n readonly canExecute?: boolean;\n /** Each guarded run's result (completed, skipped, cancelled, failed). */\n readonly onResult?: (result: G9SafeRunResult<unknown>) => void;\n}\n\n/** Imperative handle of the safe buttons. */\nexport interface G9SafeButtonHandle {\n /** MAUI `SetLoadingState`: drives the spinner (when shown) and the block (when `disableWhileLoading`). */\n setLoadingState(loading: boolean): void;\n /** Runs the guarded action as a tap would (without `onPress`). */\n execute(): Promise<G9SafeRunResult<unknown> | null>;\n}\n\nlet instanceCounter = 0;\n\n/** The guarded execution state machine of the safe buttons (one shared executor, specs/03 §4). */\nexport function useSafeExecution(props: G9SafeExecutionProps, defaultSource: string) {\n const executor = useG9Executor();\n const [busy, setBusy] = useState(false);\n const key = useRef<string | null>(null);\n if (key.current === null) key.current = `${defaultSource}:${++instanceCounter}`;\n const mount = useRef<G9AbortController | null>(null);\n if (mount.current === null) mount.current = createAbortController();\n const executing = useRef(false);\n const latest = useRef(props);\n latest.current = props;\n useEffect(() => {\n const controller = mount.current as G9AbortController;\n return () => controller.abort();\n }, []);\n\n const showSpinner = props.showSpinnerWhileLoading !== false;\n const blocked = (busy && props.disableWhileLoading !== false) || props.canExecute === false;\n const execute = async (): Promise<G9SafeRunResult<unknown> | null> => {\n const p = latest.current;\n if (p.enableSafeExecution === false || executing.current) return null;\n const handlers = [...(p.onExecute ? [p.onExecute] : []), ...(p.onExecuteHandlers ?? [])];\n if (handlers.length === 0) return null;\n executing.current = true;\n try {\n const result = await executor.run(\n async (context) => {\n for (const handler of handlers) await handler(context);\n },\n {\n throttleKey: p.throttleKey ?? (key.current as string),\n enableThrottle: p.enableThrottle !== false,\n ...(p.throttleIntervalMs !== undefined ? { throttleIntervalMs: p.throttleIntervalMs } : {}),\n ...(p.busyDelayMs !== undefined ? { busyDelayMs: p.busyDelayMs } : {}),\n ...(p.errorMessage !== undefined ? { errorMessage: p.errorMessage } : {}),\n ...(p.errorTitle !== undefined ? { errorTitle: p.errorTitle } : {}),\n source: p.source ?? defaultSource,\n showErrorPopup: p.showErrorPopup !== false,\n setBusy: (b) => {\n if (!(mount.current as G9AbortController).signal.aborted) setBusy(b);\n },\n signal: (mount.current as G9AbortController).signal as G9AbortSignal,\n },\n );\n p.onResult?.(result);\n return result;\n } finally {\n executing.current = false;\n }\n };\n return {\n busy,\n loading: busy && showSpinner,\n blocked,\n execute,\n setLoadingState: (loading: boolean) => setBusy(loading),\n };\n}\n\n/** Props of {@link G9SafeButton} (MAUI `G9SafeButton`). */\nexport interface G9SafeButtonProps extends G9ButtonProps, G9SafeExecutionProps {\n /** Variant through the MAUI enum; when unset, `variant` (default primary) applies, as MAUI's never-applied default. */\n readonly buttonType?: G9SafeButtonType;\n}\n\n/**\n * Button with guarded execution (MAUI `G9SafeButton`): a tap calls `onPress`, then runs `onExecute` (and\n * `onExecuteHandlers`) through the provider's safe executor: throttle (369 ms per key), one run at a time, optional\n * delay, busy spinner + block while running, errors to diagnostics and the error popup, never thrown into the UI.\n * Unmounting cancels the run.\n */\nexport const G9SafeButton = forwardRef<G9SafeButtonHandle, G9SafeButtonProps>(\n function G9SafeButton(props, ref): ReactNode {\n const safe = useSafeExecution(props, 'G9SafeButton');\n useImperativeHandle(ref, () => ({ setLoadingState: safe.setLoadingState, execute: safe.execute }));\n const variant: G9ButtonVariant = props.buttonType ?? props.variant ?? 'primary';\n const onPress = () => {\n props.onPress?.();\n void safe.execute();\n };\n return (\n <G9Button\n {...props}\n variant={variant}\n isLoading={props.isLoading === true || safe.loading}\n blocked={props.blocked === true || safe.blocked}\n onPress={onPress}\n />\n );\n },\n);\n\n/** Props of {@link G9SafeIconButton} (MAUI `G9SafeIconButton`). */\nexport interface G9SafeIconButtonProps extends G9IconButtonProps, G9SafeExecutionProps {}\n\n/** Icon button with guarded execution (MAUI `G9SafeIconButton`); see {@link G9SafeButton}. */\nexport const G9SafeIconButton = forwardRef<G9SafeButtonHandle, G9SafeIconButtonProps>(\n function G9SafeIconButton(props, ref): ReactNode {\n const safe = useSafeExecution(props, 'G9SafeIconButton');\n useImperativeHandle(ref, () => ({ setLoadingState: safe.setLoadingState, execute: safe.execute }));\n return (\n <G9IconButton\n {...props}\n isLoading={props.isLoading === true || safe.loading}\n blocked={props.blocked === true || safe.blocked}\n onPress={() => {\n props.onPress?.();\n void safe.execute();\n }}\n />\n );\n },\n);\n"],"names":["G9SafeButtonType","instanceCounter","useSafeExecution","props","defaultSource","executor","useG9Executor","busy","setBusy","useState","key","useRef","mount","createAbortController","executing","latest","useEffect","controller","showSpinner","blocked","execute","_p_onExecuteHandlers","p","handlers","_p_throttleKey","_p_source","result","context","handler","undefined","b","loading","G9SafeButton","forwardRef","ref","_ref","safe","useImperativeHandle","variant","onPress","G9Button","G9SafeIconButton","G9IconButton"],"mappings":";;;;;AAcO,MAAMA,mBAAmB;IAC9B,SAAS;IACT,SAAS;IACT,WAAW;IACX,MAAM;IACN,SAAS;IACT,SAAS;IACT,OAAO;IACP,SAAS;IACT,SAAS;AACX;AAgDA,IAAIC,kBAAkB;AAGf,SAASC,iBAAiBC,KAA2B,EAAEC,aAAqB;IACjF,MAAMC,WAAWC;IACjB,MAAM,CAACC,MAAMC,QAAQ,GAAGC,SAAS;IACjC,MAAMC,MAAMC,OAAsB;IAClC,IAAID,AAAgB,SAAhBA,IAAI,OAAO,EAAWA,IAAI,OAAO,GAAG,GAAGN,cAAc,CAAC,EAAE,EAAEH,iBAAiB;IAC/E,MAAMW,QAAQD,OAAiC;IAC/C,IAAIC,AAAkB,SAAlBA,MAAM,OAAO,EAAWA,MAAM,OAAO,GAAGC;IAC5C,MAAMC,YAAYH,OAAO;IACzB,MAAMI,SAASJ,OAAOR;IACtBY,OAAO,OAAO,GAAGZ;IACjBa,UAAU;QACR,MAAMC,aAAaL,MAAM,OAAO;QAChC,OAAO,IAAMK,WAAW,KAAK;IAC/B,GAAG,EAAE;IAEL,MAAMC,cAAcf,AAAkC,UAAlCA,MAAM,uBAAuB;IACjD,MAAMgB,UAAWZ,QAAQJ,AAA8B,UAA9BA,MAAM,mBAAmB,IAAeA,AAAqB,UAArBA,MAAM,UAAU;IACjF,MAAMiB,UAAU;YAG+CC;QAF7D,MAAMC,IAAIP,OAAO,OAAO;QACxB,IAAIO,AAA0B,UAA1BA,EAAE,mBAAmB,IAAcR,UAAU,OAAO,EAAE,OAAO;QACjE,MAAMS,WAAW;eAAKD,EAAE,SAAS,GAAG;gBAACA,EAAE,SAAS;aAAC,GAAG,EAAE;uBAAOD,CAAAA,uBAAAA,EAAE,iBAAiB,AAAD,IAAlBA,uBAAuB,EAAE;SAAE;Q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x"],"sourcesContent":["import './button.css';\nimport type { G9ImageSource } from '@g9tm/lynxcontrols-foundation';\nimport type { ReactNode } from '@lynx-js/react';\nimport { type G9ControlBaseProps, useG9Control } from '../base/control';\nimport { useG9Press } from '../base/press';\nimport { G9IconSlot } from '../icon/slot';\n\n/** Props of {@link G9VerticalIconTextButton} (MAUI `G9VerticalIconTextButton`). */\nexport interface G9VerticalIconTextButtonProps extends G9ControlBaseProps {\n readonly image?: G9ImageSource | null;\n readonly text?: string | null;\n /** Image box size. Default 32. */\n readonly imageSize?: number;\n readonly onPress?: () => void;\n}\n\n/**\n * Image over a centred label in a bordered tile (MAUI `G9VerticalIconTextButton`). Unlike MAUI (its image and label\n * took the touch), the press is on the root and honours `disabled` and the 300 ms guard.\n */\nexport function G9VerticalIconTextButton(props: G9VerticalIconTextButtonProps): ReactNode {\n const control = useG9Control(props, 'g9-vertical-button', {\n kind: 'button',\n label: () => props.accessibilityLabel ?? props.text,\n capabilities: { activate: () => press() },\n });\n const press = useG9Press(props.onPress, { blocked: control.disabled, source: 'G9VerticalIconTextButton' });\n return (\n <view\n className={control.className}\n {...control.idProps}\n accessibility-element={true}\n accessibility-traits=\"button\"\n {...((props.accessibilityLabel ?? props.text)\n ? { 'accessibility-label': props.accessibilityLabel ?? props.text ?? '' }\n : {})}\n bindtap={press}\n >\n {props.image ? <G9IconSlot image={props.image} size={props.imageSize ?? 32} /> : null}\n {props.text ? <text className=\"g9-vertical-button__text\">{props.text}</text> : null}\n </view>\n );\n}\n"],"names":["G9VerticalIconTextButton","props","_props_accessibilityLabel","_ref","_props_imageSize","control","useG9Control","press","useG9Press","view","G9IconSlot","text"],"mappings":";;;;AAoBO,SAASA,yBAAyBC,KAAoC;QAajEC,2BACuBC,MAAAA,4BAIwBC;IAjBzD,MAAMC,UAAUC,aAAaL,OAAO,sBAAsB;QACxD,MAAM;QACN,OAAO;gBAAMC;2BAAAA,CAAAA,4BAAAA,MAAM,kBAAkB,AAAD,IAAvBA,4BAA4BD,MAAM,IAAI;;QACnD,cAAc;YAAE,UAAU,IAAMM;QAAQ;IAC1C;IACA,MAAMA,QAAQC,WAAWP,MAAM,OAAO,EAAE;QAAE,SAASI,QAAQ,QAAQ;QAAE,QAAQ;IAA2B;IACxG,QACGI,KACC,WAAWJ,QAAQ,SAAS,GAC3B,GAAGA,QAAQ,OAAO,EACnB,uBAAuB,MACvB,qBAAqB,UACpB,GAAI,AAAC,SAAAH,CAAAA,4BAAAA,MAAM,kBAAkB,AAAD,IAAvBA,4BAA4BD,MAAM,IAAI,AAAD,IACvC;QAAE,uBAAuB,QAAAE,CAAAA,OAAAA,QAAAA,CAAAA,6BAAAA,MAAM,kBAAkB,AAAD,IAAvBA,6BAA4BF,MAAM,IAAI,AAAD,IAArCE,OAA0C;IAAG,IACtE,CAAC,CAAC,EACN,SAASI,OACV;MACC,CAACN,MAAM,KAAK,IAAIS,WAAW,OAAOT,MAAM,KAAK,EAAE,MAAM,QAAAG,CAAAA,mBAAAA,MAAM,SAAS,AAAD,IAAdA,mBAAmB,QAAS,KAAK;MACtF,CAACH,MAAM,IAAI,IAAIU,KAAK,UAAU,4BAA4BV,MAAM,IAAI,GAAGU,QAAQ,KAAK;IACtF,EAAEF;AAEN"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"button/visuals.jsx","sources":["../../src/button/visuals.ts"],"sourcesContent":["import {\n buildSolidOrGradient,\n createBorderColor,\n fillToCss,\n formatColor,\n type G9ButtonVariant,\n type G9ControlSize,\n G9Metrics,\n type G9PaletteValues,\n getContrastingTextColor,\n resolveButtonVariant,\n toRgba,\n tryParseColor,\n} from '@g9tm/lynxcontrols-foundation';\n\n/** What a button paints (MAUI `G9Visuals.ButtonVisualResult` + the stroke/opacity rules of G9Button/G9IconButton). */\nexport interface G9ButtonPaint {\n /** CSS `background` (a colour or a vertical gradient). */\n readonly background: string;\n readonly text: string;\n readonly stroke: string;\n readonly strokeWidth: number;\n /** 0.38 when not effectively enabled, 0.70 while loading, else 1. */\n readonly opacity: number;\n}\n\n/** Inputs of {@link resolveButtonPaint}. */\nexport interface G9ButtonPaintInput {\n readonly variant: G9ButtonVariant;\n readonly palette: G9PaletteValues;\n /** `IsEnabled && !blocked`. */\n readonly enabled: boolean;\n readonly loading: boolean;\n readonly baseBackgroundColor?: string | null | undefined;\n readonly textColor?: string | null | undefined;\n /** `'button'`: tonal has a 1.5 stroke; `'icon'`: only outline/text do (MAUI G9IconButton). */\n readonly kind: 'button' | 'icon';\n}\n\n/**\n * Resolves the paint of a button (MAUI `G9Button.OnApplyVisuals` / `G9IconButton.OnApplyVisuals`):\n * - variant colours from `resolveButtonVariant`; the gradient only while enabled and not loading;\n * - `baseBackgroundColor`: fully transparent → no fill, no border; otherwise a flat fill, contrasting text and a\n * darkened border (stroke 1 when visible);\n * - `textColor` always wins for text/icon/spinner;\n * - stroke 1.5 for outline/text (and tonal on `G9Button`), else 0.\n * A colour that is not a parseable literal (e.g. a `var(--…)` token) is used as given: flat fill, the variant's text\n * colour unless `textColor` is set, and no derived border.\n */\nexport function resolveButtonPaint(input: G9ButtonPaintInput): G9ButtonPaint {\n const variant = resolveButtonVariant(input.variant, input.palette);\n const opacity = !input.enabled ? 0.38 : input.loading ? 0.7 : 1;\n const base = input.baseBackgroundColor;\n if (base != null) {\n const parsed = tryParseColor(base);\n if (parsed && parsed.a === 0) {\n return {\n background: 'transparent',\n text: input.textColor ?? variant.text,\n stroke: 'transparent',\n strokeWidth: 0,\n opacity,\n };\n }\n if (!parsed) {\n return {\n background: base,\n text: input.textColor ?? variant.text,\n stroke: 'transparent',\n strokeWidth: 0,\n opacity,\n };\n }\n const stroke = createBorderColor(parsed);\n return {\n background: formatColor(parsed),\n text: input.textColor ?? formatColor(getContrastingTextColor(parsed)),\n stroke: formatColor(stroke),\n strokeWidth: toRgba(stroke).a > 0 ? 1 : 0,\n opacity,\n };\n }\n const outlined =\n input.variant === 'outline' || input.variant === 'text' || (input.kind === 'button' && input.variant === 'tonal');\n return {\n background: fillToCss(\n buildSolidOrGradient(variant.background, variant.usesGradient && input.enabled && !input.loading),\n ),\n text: input.textColor ?? variant.text,\n stroke: variant.stroke,\n strokeWidth: outlined ? 1.5 : 0,\n opacity,\n };\n}\n\n/** Size preset of `G9Button` (MAUI `ApplySizePreset`). */\nexport interface G9ButtonSizePreset {\n readonly height: number;\n readonly paddingHorizontal: number;\n readonly paddingVertical: number;\n readonly fontSize: number;\n /** Hero buttons fill the width. */\n readonly fill: boolean;\n}\n\n/** MAUI G9Button size presets: small 36 / medium 44 / large 48 / hero 52. */\nexport function buttonSizePreset(size: G9ControlSize): G9ButtonSizePreset {\n switch (size) {\n case 'small':\n return {\n height: G9Metrics.ButtonHeightSmall,\n paddingHorizontal: 12,\n paddingVertical: 8,\n fontSize: G9Metrics.ButtonFontSmall,\n fill: false,\n };\n case 'large':\n return {\n height: G9Metrics.ButtonHeightLarge,\n paddingHorizontal: 20,\n paddingVertical: 14,\n fontSize: G9Metrics.ButtonFontLarge,\n fill: false,\n };\n case 'hero':\n // 52 tall with 12 above and below the text row, not 16 (MAUI 1.4.11): 16 left a 16 px label 20 px of height and cut\n // a Persian descender off («ج» of «خروج» on AgriPad's sign-out button, TR-0035).\n return {\n height: G9Metrics.ButtonHeightHero,\n paddingHorizontal: 16,\n paddingVertical: 12,\n fontSize: G9Metrics.ButtonFontHero,\n fill: true,\n };\n default:\n return {\n height: G9Metrics.ButtonHeightMedium,\n paddingHorizontal: 16,\n paddingVertical: 12,\n fontSize: G9Metrics.ButtonFontMedium,\n fill: false,\n };\n }\n}\n\n/** MAUI `FontAttributes`. */\nexport type G9FontAttributes = 'none' | 'bold' | 'italic' | 'boldItalic';\n\n/** CSS for {@link G9FontAttributes}. */\nexport function fontAttributesStyle(attributes: G9FontAttributes): {\n fontWeight: 'bold' | 'normal';\n fontStyle: 'italic' | 'normal';\n} {\n return {\n fontWeight: attributes === 'bold' || attributes === 'boldItalic' ? 'bold' : 'normal',\n fontStyle: attributes === 'italic' || attributes === 'boldItalic' ? 'italic' : 'normal',\n };\n}\n"],"names":["resolveButtonPaint","input","_input_textColor","variant","resolveButtonVariant","opacity","base","_input_textColor1","parsed","tryParseColor","_input_textColor2","_input_textColor3","stroke","createBorderColor","formatColor","getContrastingTextColor","toRgba","outlined","fillToCss","buildSolidOrGradient","buttonSizePreset","size","G9Metrics","fontAttributesStyle","attributes"],"mappings":";AAiDO,SAASA,mBAAmBC,KAAyB;QAuClDC;IAtCR,MAAMC,UAAUC,qBAAqBH,MAAM,OAAO,EAAEA,MAAM,OAAO;IACjE,MAAMI,UAAU,AAACJ,MAAM,OAAO,GAAUA,MAAM,OAAO,GAAG,MAAM,IAA7B;IACjC,MAAMK,OAAOL,MAAM,mBAAmB;IACtC,IAAIK,AAAQ,QAARA,MAAc;YAuBRC;QAtBR,MAAMC,SAASC,cAAcH;QAC7B,IAAIE,UAAUA,AAAa,MAAbA,OAAO,CAAC,EAAQ;gBAGpBE;YAFR,OAAO;gBACL,YAAY;gBACZ,MAAM,QAAAA,CAAAA,oBAAAA,MAAM,SAAS,AAAD,IAAdA,oBAAmBP,QAAQ,IAAI;gBACrC,QAAQ;gBACR,aAAa;gBACbE;YACF;QACF;QACA,IAAI,CAACG,QAAQ;gBAGHG;YAFR,OAAO;gBACL,YAAYL;gBACZ,MAAM,QAAAK,CAAAA,oBAAAA,MAAM,SAAS,AAAD,IAAdA,oBAAmBR,QAAQ,IAAI;gBACrC,QAAQ;gBACR,aAAa;gBACbE;YACF;QACF;QACA,MAAMO,SAASC,kBAAkBL;QACjC,OAAO;YACL,YAAYM,YAAYN;YACxB,MAAM,QAAAD,CAAAA,oBAAAA,MAAM,SAAS,AAAD,IAAdA,oBAAmBO,YAAYC,wBAAwBP;YAC7D,QAAQM,YAAYF;YACpB,aAAaI,OAAOJ,QAAQ,CAAC,GAAG,IAAI,IAAI;YACxCP;QACF;IACF;IACA,MAAMY,WACJhB,AAAkB,cAAlBA,MAAM,OAAO,IAAkBA,AAAkB,WAAlBA,MAAM,OAAO,IAAgBA,AAAe,aAAfA,MAAM,IAAI,IAAiBA,AAAkB,YAAlBA,MAAM,OAAO;IACtG,OAAO;QACL,YAAYiB,UACVC,qBAAqBhB,QAAQ,UAAU,EAAEA,QAAQ,YAAY,IAAIF,MAAM,OAAO,IAAI,CAACA,MAAM,OAAO;QAElG,MAAM,QAAAC,CAAAA,mBAAAA,MAAM,SAAS,AAAD,IAAdA,mBAAmBC,QAAQ,IAAI;QACrC,QAAQA,QAAQ,MAAM;QACtB,aAAac,WAAW,MAAM;QAC9BZ;IACF;AACF;AAaO,SAASe,iBAAiBC,IAAmB;IAClD,OAAQA;QACN,KAAK;YACH,OAAO;gBACL,QAAQC,UAAU,iBAAiB;gBACnC,mBAAmB;gBACnB,iBAAiB;gBACjB,UAAUA,UAAU,eAAe;gBACnC,MAAM;YACR;QACF,KAAK;YACH,OAAO;gBACL,QAAQA,UAAU,iBAAiB;gBACnC,mBAAmB;gBACnB,iBAAiB;gBACjB,UAAUA,UAAU,eAAe;gBACnC,MAAM;YACR;QACF,KAAK;YAGH,OAAO;gBACL,QAAQA,UAAU,gBAAgB;gBAClC,mBAAmB;gBACnB,iBAAiB;gBACjB,UAAUA,UAAU,cAAc;gBAClC,MAAM;YACR;QACF;YACE,OAAO;gBACL,QAAQA,UAAU,kBAAkB;gBACpC,mBAAmB;gBACnB,iBAAiB;gBACjB,UAAUA,UAAU,gBAAgB;gBACpC,MAAM;YACR;IACJ;AACF;AAMO,SAASC,oBAAoBC,UAA4B;IAI9D,OAAO;QACL,YAAYA,AAAe,WAAfA,cAAyBA,AAAe,iBAAfA,aAA8B,SAAS;QAC5E,WAAWA,AAAe,aAAfA,cAA2BA,AAAe,iBAAfA,aAA8B,WAAW;IACjF;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cascade/cascade-panel.jsx","sources":["../../src/cascade/cascade-panel.tsx"],"sourcesContent":["import './cascade.css';\nimport { G9CascadeDirection, G9CascadeTransition, G9StringKey, g9Ms } from '@g9tm/lynxcontrols-foundation';\nimport { type ReactNode, useEffect, useRef, useState, useSyncExternalStore } from '@lynx-js/react';\nimport { useG9Press } from '../base/press';\nimport { startTimer, stopTimer } from '../base/timers';\nimport { G9ActivityIndicator } from '../display/activity-indicator';\nimport { G9IconSlot } from '../icon/slot';\nimport { useG9Direction, useG9Settings, useG9Strings } from '../provider/hooks';\nimport { type G9CascadeContent, type G9CascadePanelEntry, type G9CascadePushOptions, G9CascadeStack } from './model';\n\n/** Slide duration (MAUI `G9Metrics.CascadePanelAnimationMs`). */\nexport const g9CascadeAnimationMs = 280;\n/** How far a covered panel parallaxes (share of the slide) and how much it dims, in `overlay` mode. */\nexport const g9CascadeParallax = Object.freeze({ shift: 0.3, dim: 0.12 });\n\n/** Imperative API of a cascade panel (MAUI `G9CascadePanel` methods), from {@link useCascadePanel}. */\nexport interface G9CascadeController {\n /** Push a built view, or a factory built after the slide (spinner meanwhile). Resolves when it slid in. */\n push(content: G9CascadeContent, options?: G9CascadePushOptions): Promise<boolean>;\n /** Pop the top panel (no-op at the root). Resolves when it slid out. */\n pop(): Promise<boolean>;\n /** Pop every panel back to the root (after a slide in flight). */\n popToRoot(): Promise<boolean>;\n /** Current nesting depth; 0 = only the root. */\n readonly depth: number;\n /** @internal the stack the panel renders */\n readonly stack: G9CascadeStack;\n}\n\ninterface ControllerState {\n durationMs: number;\n onPushed?: ((depth: number) => void) | undefined;\n onPopped?: ((depth: number) => void) | undefined;\n}\n\n/** Creates a cascade controller outside React (tests, view models). */\nexport function createCascadeController(): G9CascadeController & { readonly state: ControllerState } {\n const state: ControllerState = { durationMs: g9CascadeAnimationMs };\n const stack = new G9CascadeStack({\n setTimer: (cb, ms) => startTimer(cb, ms),\n clearTimer: (h) => stopTimer(h as never),\n durationMs: () => state.durationMs,\n onPushed: (d) => state.onPushed?.(d),\n onPopped: (d) => state.onPopped?.(d),\n });\n return {\n state,\n stack,\n push: (content, options) => stack.push(content, options),\n pop: () => stack.pop(),\n popToRoot: () => stack.popToRoot(),\n get depth() {\n return stack.depth;\n },\n };\n}\n\n/** A stable controller for a `G9CascadePanel` (pass it as `controller`). */\nexport function useCascadePanel(): G9CascadeController {\n const ref = useRef<G9CascadeController | null>(null);\n if (ref.current === null) ref.current = createCascadeController();\n return ref.current;\n}\n\n/** Props of {@link G9CascadePanel}. */\nexport interface G9CascadePanelProps {\n readonly controller?: G9CascadeController;\n /** The view at depth 0; swapping it replaces the root without touching the nested stack. */\n readonly rootContent?: ReactNode;\n /** Lazy root (used when `rootContent` is absent): spinner, then built one tick after mount. */\n readonly rootContentFactory?: (() => ReactNode) | null;\n readonly rootTitle?: string | null;\n /** Default entry direction; `'auto'` follows the reading direction (L→R in LTR, R→L in RTL). */\n readonly direction?: G9CascadeDirection;\n /** `'overlay'` (default) slides over a stationary base; `'push'` slides the base out. */\n readonly transition?: G9CascadeTransition;\n /** Fade the root in on first appearance. Default false. */\n readonly animateRoot?: boolean;\n /** Back + title header on nested panels. Default true. */\n readonly showHeader?: boolean;\n /** A (back-less) header on the root too. Default false. */\n readonly showRootHeader?: boolean;\n /** Default 280. */\n readonly animationDurationMs?: number;\n /** Overlay mode: the covered panel parallaxes and dims. Default true. */\n readonly enableParallax?: boolean;\n /** Default 16 (MAUI `RadiusLg`). */\n readonly cornerRadius?: number;\n /** After a panel slid in, with the new depth (MAUI `PanelPushed`). */\n readonly onPanelPushed?: (depth: number) => void;\n /** After a panel slid out, with the new depth (MAUI `PanelPopped`). */\n readonly onPanelPopped?: (depth: number) => void;\n readonly className?: string;\n}\n\ntype Physical = 'leftToRight' | 'rightToLeft' | 'topToBottom' | 'bottomToTop';\n\n/** Resolves `'auto'` to the reading direction. */\nexport function resolveCascadeDirection(direction: G9CascadeDirection | null | undefined, rtl: boolean): Physical {\n if (!direction || direction === G9CascadeDirection.Auto) return rtl ? 'rightToLeft' : 'leftToRight';\n return direction;\n}\n\n/** The transform of a panel `amount` (0…1) of the way off-screen against its entry direction. */\nexport function cascadeOffset(direction: Physical, amount: number): string {\n const pct = `${Math.round(amount * 1000) / 10}%`;\n const neg = `-${pct}`;\n switch (direction) {\n case 'leftToRight':\n return `translateX(${amount === 0 ? '0%' : neg})`;\n case 'rightToLeft':\n return `translateX(${pct})`;\n case 'topToBottom':\n return `translateY(${amount === 0 ? '0%' : neg})`;\n default:\n return `translateY(${pct})`;\n }\n}\n\nfunction Header(props: { readonly title: string | null; readonly onBack: (() => void) | null }): ReactNode {\n const rtl = useG9Direction() === 'rtl';\n const glyphs = useG9Settings().glyphs;\n const strings = useG9Strings();\n const back = useG9Press(() => props.onBack?.(), { source: 'G9CascadePanel', guardMs: 0 });\n return (\n <view className={`g9-cascade__header g9-dir-${rtl ? 'rtl' : 'ltr'}`}>\n {props.onBack ? (\n <view\n className=\"g9-cascade__back\"\n accessibility-element={true}\n accessibility-traits=\"button\"\n accessibility-label={strings.get(G9StringKey.Back)}\n bindtap={back}\n >\n <G9IconSlot icon={rtl ? glyphs.chevronForward : glyphs.chevronBack} size={24} color=\"var(--g9-on-surface)\" />\n </view>\n ) : null}\n <text className=\"g9-cascade__title\" text-maxline=\"1\">\n {props.title ?? ''}\n </text>\n </view>\n );\n}\n\nfunction Body(props: {\n readonly content: G9CascadeContent;\n readonly wrap: boolean;\n readonly ready: boolean;\n}): ReactNode {\n const lazy = typeof props.content === 'function';\n const node = lazy ? (props.ready ? (props.content as () => ReactNode)() : null) : (props.content as ReactNode);\n const inner =\n lazy && !props.ready ? (\n <view className=\"g9-cascade__loading\">\n <G9ActivityIndicator running size={32} />\n </view>\n ) : (\n node\n );\n return props.wrap ? (\n <scroll-view className=\"g9-cascade__body\" scroll-orientation=\"vertical\">\n {inner}\n </scroll-view>\n ) : (\n <view className=\"g9-cascade__body\">{inner}</view>\n );\n}\n\n/**\n * In-place drill-down navigation (MAUI `G9CascadePanel`): `controller.push(view, { title })` slides a panel in over\n * the current one from any edge, `pop()` slides it back; panels stack to any depth inside whatever container holds the\n * panel (clipped to its bounds, opaque `Surface` panels). `overlay` keeps the base still (parallax + dim with\n * `enableParallax`); `push` slides it out. Lazy panels show a spinner and build after the slide. One slide runs at a\n * time: same-kind repeats are dropped, the other kind waits (see `G9CascadeStack`).\n */\nexport function G9CascadePanel(props: G9CascadePanelProps): ReactNode {\n const own = useCascadePanel();\n const controller = (props.controller ?? own) as ReturnType<typeof createCascadeController>;\n const duration = g9Ms(props.animationDurationMs ?? g9CascadeAnimationMs);\n controller.state.durationMs = duration;\n controller.state.onPushed = props.onPanelPushed;\n controller.state.onPopped = props.onPanelPopped;\n const stack = controller.stack;\n const panels = useSyncExternalStore(\n (l) => stack.subscribe(l),\n () => stack.getSnapshot(),\n );\n const rtl = useG9Direction() === 'rtl';\n const overlay = (props.transition ?? G9CascadeTransition.Overlay) === G9CascadeTransition.Overlay;\n const parallax = props.enableParallax !== false;\n useEffect(() => () => stack.dispose(), [stack]);\n\n // Lazy root: built one tick after mount. Root fade: visible after the first frame.\n const [rootReady, setRootReady] = useState(false);\n const [rootShown, setRootShown] = useState(props.animateRoot !== true);\n useEffect(() => {\n const t = startTimer(() => {\n setRootReady(true);\n setRootShown(true);\n }, 16);\n return () => stopTimer(t);\n }, []);\n\n const topIndex = (id: number | 'root') => (id === 'root' ? 0 : panels.findIndex((p) => p.id === id) + 1);\n // The panel that covers a given level, if any, and how far it is in.\n const coverOf = (level: number): { entry: G9CascadePanelEntry; amount: number } | null => {\n const above = panels[level];\n if (!above) return null;\n const amount = above.status === 'entering' || above.status === 'shown' ? 1 : 0;\n return { entry: above, amount };\n };\n const style = (level: number, entry: G9CascadePanelEntry | null) => {\n const own = entry ? resolveCascadeDirection(entry.direction ?? props.direction, rtl) : null;\n // Own slide: off-screen while staged/leaving, in place otherwise.\n const out = entry && (entry.status === 'staged' || entry.status === 'leaving');\n let transform = own && out ? cascadeOffset(own, 1) : 'translateX(0%)';\n let dim = 0;\n const cover = coverOf(level);\n if (cover && !out) {\n const dir = resolveCascadeDirection(cover.entry.direction ?? props.direction, rtl);\n // A covered level moves the other way: by the parallax share (overlay) or all the way (push).\n const opposite: Record<Physical, Physical> = {\n leftToRight: 'rightToLeft',\n rightToLeft: 'leftToRight',\n topToBottom: 'bottomToTop',\n bottomToTop: 'topToBottom',\n };\n const amount = cover.amount * (overlay ? (parallax ? g9CascadeParallax.shift : 0) : 1);\n transform = cascadeOffset(opposite[dir], amount);\n dim = overlay && parallax ? cover.amount * g9CascadeParallax.dim : 0;\n }\n return {\n transform,\n transition: entry?.status === 'staged' ? 'none' : `transform ${duration}ms ease-out, opacity ${duration}ms`,\n zIndex: level,\n ...(dim > 0 ? { opacity: 1 - dim } : { opacity: level === 0 && !rootShown ? 0 : 1 }),\n };\n };\n\n const rootContent = props.rootContent ?? props.rootContentFactory ?? null;\n return (\n <view\n className={`g9-cascade${props.className ? ` ${props.className}` : ''}`}\n style={{ borderRadius: `${props.cornerRadius ?? 16}px` }}\n >\n <view className=\"g9-cascade__panel\" style={style(0, null)}>\n {props.showRootHeader ? <Header title={props.rootTitle ?? null} onBack={null} /> : null}\n <Body content={rootContent} wrap ready={rootReady} />\n </view>\n {panels.map((entry) => (\n <view\n key={entry.id}\n className={`g9-cascade__panel g9-cascade__panel--${entry.status}`}\n style={style(topIndex(entry.id), entry)}\n >\n {props.showHeader !== false ? <Header title={entry.title} onBack={() => void stack.pop()} /> : null}\n <Body\n content={entry.content}\n wrap={entry.wrap}\n ready={entry.status === 'shown' || entry.status === 'leaving'}\n />\n </view>\n ))}\n </view>\n );\n}\n"],"names":["g9CascadeAnimationMs","g9CascadeParallax","Object","createCascadeController","state","stack","G9CascadeStack","cb","ms","startTimer","h","stopTimer","d","content","options","useCascadePanel","ref","useRef","resolveCascadeDirection","direction","rtl","G9CascadeDirection","cascadeOffset","amount","pct","Math","neg","Header","props","_props_title","useG9Direction","glyphs","useG9Settings","strings","useG9Strings","back","useG9Press","view","G9StringKey","G9IconSlot","text","Body","lazy","node","inner","G9ActivityIndicator","scroll-view","G9CascadePanel","_props_controller","_props_animationDurationMs","_props_transition","_ref","_props_cornerRadius","_props_rootTitle","own","controller","duration","g9Ms","panels","useSyncExternalStore","l","overlay","G9CascadeTransition","parallax","useEffect","rootReady","setRootReady","useState","rootShown","setRootShown","t","topIndex","id","p","coverOf","level","above","style","entry","_entry_direction","out","transform","dim","cover","_cover_entry_direction","dir","opposite","rootContent"],"mappings":";;;;;;;;;AAWO,MAAMA,uBAAuB;AAE7B,MAAMC,oBAAoBC,OAAO,MAAM,CAAC;IAAE,OAAO;IAAK,KAAK;AAAK;AAuBhE,SAASC;IACd,MAAMC,QAAyB;QAAE,YAAYJ;IAAqB;IAClE,MAAMK,QAAQ,IAAIC,eAAe;QAC/B,UAAU,CAACC,IAAIC,KAAOC,WAAWF,IAAIC;QACrC,YAAY,CAACE,IAAMC,UAAUD;QAC7B,YAAY,IAAMN,MAAM,UAAU;QAClC,UAAU,CAACQ;gBAAMR;2BAAAA,CAAAA,kBAAAA,MAAM,QAAQ,AAAD,IAAbA,KAAAA,IAAAA,gBAAAA,IAAAA,CAAAA,OAAiBQ;;QAClC,UAAU,CAACA;gBAAMR;2BAAAA,CAAAA,kBAAAA,MAAM,QAAQ,AAAD,IAAbA,KAAAA,IAAAA,gBAAAA,IAAAA,CAAAA,OAAiBQ;;IACpC;IACA,OAAO;QACLR;QACAC;QACA,MAAM,CAACQ,SAASC,UAAYT,MAAM,IAAI,CAACQ,SAASC;QAChD,KAAK,IAAMT,MAAM,GAAG;QACpB,WAAW,IAAMA,MAAM,SAAS;QAChC,IAAI;YACF,OAAOA,MAAM,KAAK;QACpB;IACF;AACF;AAGO,SAASU;IACd,MAAMC,MAAMC,OAAmC;IAC/C,IAAID,AAAgB,SAAhBA,IAAI,OAAO,EAAWA,IAAI,OAAO,GAAGb;IACxC,OAAOa,IAAI,OAAO;AACpB;AAoCO,SAASE,wBAAwBC,SAAgD,EAAEC,GAAY;IACpG,IAAI,CAACD,aAAaA,cAAcE,mBAAmB,IAAI,EAAE,OAAOD,MAAM,gBAAg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G,CAAC,CAACoB,SACVzC,KACC,KAAKyC,MAAM,EAAE,EACb,WAAW,CAAC,qCAAqC,EAAEA,MAAM,MAAM,EAAE,EACjE,OAAOD,MAAMN,SAASO,MAAM,EAAE,GAAGA,QAClC;UACC,CAAClD,AAAqB,UAArBA,MAAM,UAAU,IAAcD,OAAO,OAAOmD,MAAM,KAAK,EAAE,QAAQ,IAAM,KAAKzE,MAAM,GAAG,QAAS,KAAK;UACpG,CAACoC,KACC,SAASqC,MAAM,OAAO,EACtB,MAAMA,MAAM,IAAI,EAChB,OAAOA,AAAiB,YAAjBA,MAAM,MAAM,IAAgBA,AAAiB,cAAjBA,MAAM,MAAM,GAC/C;QACJ,EAAEzC,OACD;IACL,EAAEA;AAEN"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cascade/model.jsx","sources":["../../src/cascade/model.ts"],"sourcesContent":["import type { G9CascadeDirection } from '@g9tm/lynxcontrols-foundation';\nimport type { ReactNode } from '@lynx-js/react';\n\n// The drill-down stack of `G9CascadePanel` (MAUI `G9CascadePanel` push/pop logic), as a pure model: the view renders\n// its snapshot; timers come from the caller so tests drive time.\n\n/** A nested panel's content: built, or built lazily after its slide (spinner meanwhile). */\nexport type G9CascadeContent = ReactNode | (() => ReactNode);\n\n/** Options of one push (MAUI `Push(content, title, direction, wrapInScrollView)`). */\nexport interface G9CascadePushOptions {\n readonly title?: string | null;\n /** Entry direction of this panel; default the panel's `direction`. */\n readonly direction?: G9CascadeDirection;\n /** Wrap the content in a vertical scroll view (false for content that scrolls itself, e.g. a list). Default true. */\n readonly wrapInScrollView?: boolean;\n}\n\n/** Where a panel is in its life. `staged` = mounted off-screen for one frame so the slide can start from there. */\nexport type G9CascadePanelStatus = 'staged' | 'entering' | 'shown' | 'leaving';\n\n/** One nested panel (depth ≥ 1). */\nexport interface G9CascadePanelEntry {\n readonly id: number;\n readonly content: G9CascadeContent;\n readonly title: string | null;\n readonly direction: G9CascadeDirection | null;\n readonly wrap: boolean;\n readonly status: G9CascadePanelStatus;\n}\n\n/** Timing and callbacks of the stack. */\nexport interface G9CascadeConfig {\n setTimer(callback: () => void, ms: number): unknown;\n clearTimer(handle: unknown): void;\n durationMs(): number;\n onPushed?(depth: number): void;\n onPopped?(depth: number): void;\n}\n\ntype Op =\n | { kind: 'push'; content: G9CascadeContent; options: G9CascadePushOptions; done: (ok: boolean) => void }\n | {\n kind: 'pop';\n done: (ok: boolean) => void;\n };\n\n/**\n * One slide at a time (MAUI re-entrancy guard): a second operation of the SAME kind during a slide is dropped (two\n * taps never push two panels or pop two levels); one of the OTHER kind is parked and runs when the slide ends (a newer\n * parked one replaces it). `popToRoot` waits out a slide in flight. Every operation resolves `true` when its slide\n * finished, `false` when it was dropped, displaced or had nothing to do.\n */\nexport class G9CascadeStack {\n private panels: G9CascadePanelEntry[] = [];\n private nextId = 1;\n private running: Op['kind'] | null = null;\n private parked: Op | null = null;\n private timers = new Set<unknown>();\n private readonly listeners = new Set<() => void>();\n private snapshot: ReadonlyArray<G9CascadePanelEntry> = [];\n private disposed = false;\n\n constructor(private readonly config: G9CascadeConfig) {}\n\n /** Nested depth: 0 = only the root (MAUI `Depth`); a leaving panel no longer counts. */\n get depth(): number {\n return this.panels.filter((p) => p.status !== 'leaving').length;\n }\n\n getSnapshot(): ReadonlyArray<G9CascadePanelEntry> {\n return this.snapshot;\n }\n\n subscribe(listener: () => void): () => void {\n this.listeners.add(listener);\n return () => this.listeners.delete(listener);\n }\n\n /** Pushes a panel; resolves when it slid in (MAUI `PushAsync`). */\n push(content: G9CascadeContent, options: G9CascadePushOptions = {}): Promise<boolean> {\n return new Promise((done) => this.request({ kind: 'push', content, options, done }));\n }\n\n /** Pops the top panel; resolves when it slid out. No-op at the root (MAUI `PopAsync`). */\n pop(): Promise<boolean> {\n return new Promise((done) => this.request({ kind: 'pop', done }));\n }\n\n /** Pops every panel back to the root, after a slide in flight (MAUI `PopToRootAsync`). */\n async popToRoot(): Promise<boolean> {\n while (this.running) await new Promise<void>((r) => this.later(r, this.config.durationMs()));\n if (this.depth === 0) return false;\n // The intermediate levels go at once; the top one slides out over the root.\n const top = this.panels[this.panels.length - 1] as G9CascadePanelEntry;\n this.panels = [top];\n this.emit();\n return this.pop();\n }\n\n /** Cancels every timer; pending operations resolve `false`. */\n dispose(): void {\n this.disposed = true;\n for (const t of this.timers) this.config.clearTimer(t);\n this.timers.clear();\n this.parked?.done(false);\n this.parked = null;\n }\n\n private request(op: Op): void {\n if (this.disposed) {\n op.done(false);\n return;\n }\n if (this.running) {\n if (this.running === op.kind) {\n op.done(false);\n return;\n }\n this.parked?.done(false);\n this.parked = op;\n return;\n }\n this.start(op);\n }\n\n private start(op: Op): void {\n if (op.kind === 'pop') {\n const top = [...this.panels].reverse().find((p) => p.status !== 'leaving');\n if (!top) {\n op.done(false);\n return;\n }\n this.running = 'pop';\n this.set(top.id, 'leaving');\n this.later(() => {\n this.panels = this.panels.filter((p) => p.id !== top.id);\n this.emit();\n this.finish(op, () => this.config.onPopped?.(this.depth));\n }, this.config.durationMs());\n return;\n }\n this.running = 'push';\n const entry: G9CascadePanelEntry = {\n id: this.nextId++,\n content: op.content,\n title: op.options.title ?? null,\n direction: op.options.direction ?? null,\n wrap: op.options.wrapInScrollView !== false,\n status: 'staged',\n };\n this.panels = [...this.panels, entry];\n this.emit();\n // One frame off-screen, then the slide (MAUI parks the panel once it has a size, then animates).\n this.later(() => {\n this.set(entry.id, 'entering');\n this.later(() => {\n this.set(entry.id, 'shown');\n this.finish(op, () => this.config.onPushed?.(this.depth));\n }, this.config.durationMs());\n }, 16);\n }\n\n private finish(op: Op, report: () => void): void {\n this.running = null;\n try {\n report();\n } finally {\n op.done(true);\n const parked = this.parked;\n this.parked = null;\n if (parked && !this.disposed) this.start(parked);\n }\n }\n\n private set(id: number, status: G9CascadePanelStatus): void {\n this.panels = this.panels.map((p) => (p.id === id ? { ...p, status } : p));\n this.emit();\n }\n\n private later(callback: () => void, ms: number): void {\n const handle = this.config.setTimer(() => {\n this.timers.delete(handle);\n if (!this.disposed) callback();\n }, ms);\n this.timers.add(handle);\n }\n\n private emit(): void {\n this.snapshot = this.panels;\n for (const l of this.listeners) l();\n }\n}\n"],"names":["G9CascadeStack","p","listener","content","options","Promise","done","r","top","_this_parked","t","op","_op_options_title","_op_options_direction","_this_config","entry","report","parked","id","status","callback","ms","handle","l","config","Set"],"mappings":";;;;;;;;;;AAqDO,MAAMA;IAaX,IAAI,QAAgB;QAClB,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAACC,IAAMA,AAAa,cAAbA,EAAE,MAAM,EAAgB,MAAM;IACjE;IAEA,cAAkD;QAChD,OAAO,IAAI,CAAC,QAAQ;IACtB;IAEA,UAAUC,QAAoB,EAAc;QAC1C,IAAI,CAAC,SAAS,CAAC,GAAG,CAACA;QACnB,OAAO,IAAM,IAAI,CAAC,SAAS,CAAC,MAAM,CAACA;IACrC;IAGA,KAAKC,OAAyB,EAAEC,UAAgC,CAAC,CAAC,EAAoB;QACpF,OAAO,IAAIC,QAAQ,CAACC,OAAS,IAAI,CAAC,OAAO,CAAC;gBAAE,MAAM;gBAAQH;gBAASC;gBAASE;YAAK;IACnF;IAGA,MAAwB;QACtB,OAAO,IAAID,QAAQ,CAACC,OAAS,IAAI,CAAC,OAAO,CAAC;gBAAE,MAAM;gBAAOA;YAAK;IAChE;IAGA,MAAM,YAA8B;QAClC,MAAO,IAAI,CAAC,OAAO,CAAE,MAAM,IAAID,QAAc,CAACE,IAAM,IAAI,CAAC,KAAK,CAACA,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU;QACxF,IAAI,AAAe,MAAf,IAAI,CAAC,KAAK,EAAQ,OAAO;QAE7B,MAAMC,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,EAAE;QAC/C,IAAI,CAAC,MAAM,GAAG;YAACA;SAAI;QACnB,IAAI,CAAC,IAAI;QACT,OAAO,IAAI,CAAC,GAAG;IACj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GAAG;YACd,IAAIA,UAAU,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAACA;QAC3C;IACF;IAEQ,IAAIC,EAAU,EAAEC,MAA4B,EAAQ;QAC1D,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAClB,IAAOA,EAAE,EAAE,KAAKiB,KAAK;gBAAE,GAAGjB,CAAC;gBAAEkB;YAAO,IAAIlB;QACvE,IAAI,CAAC,IAAI;IACX;IAEQ,MAAMmB,QAAoB,EAAEC,EAAU,EAAQ;QACpD,MAAMC,SAAS,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;YAClC,IAAI,CAAC,MAAM,CAAC,MAAM,CAACA;YACnB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAEF;QACtB,GAAGC;QACH,IAAI,CAAC,MAAM,CAAC,GAAG,CAACC;IAClB;IAEQ,OAAa;QACnB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM;QAC3B,KAAK,MAAMC,KAAK,IAAI,CAAC,SAAS,CAAEA;IAClC;IAhIA,YAA6BC,MAAuB,CAAE;;QATtD,uBAAQ,UAAR;QACA,uBAAQ,UAAR;QACA,uBAAQ,WAAR;QACA,uBAAQ,UAAR;QACA,uBAAQ,UAAR;QACA,uBAAiB,aAAjB;QACA,uBAAQ,YAAR;QACA,uBAAQ,YAAR;aAE6BA,MAAM,GAANA;aATrB,MAAM,GAA0B,EAAE;aAClC,MAAM,GAAG;aACT,OAAO,GAAsB;aAC7B,MAAM,GAAc;aACpB,MAAM,GAAG,IAAIC;aACJ,SAAS,GAAG,IAAIA;aACzB,QAAQ,GAAuC,EAAE;aACjD,QAAQ,GAAG;IAEoC;AAiIzD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deferred/deferred-content.jsx","sources":["../../src/deferred/deferred-content.tsx"],"sourcesContent":["import {\n createAbortController,\n type G9AbortSignal,\n type G9ActivityScope,\n g9LayoutMetrics,\n} from '@g9tm/lynxcontrols-foundation';\nimport { DeferredComponent } from '@lynx-js/lynx-ui-deferred-component';\nimport {\n createContext,\n type ForwardedRef,\n forwardRef,\n type ReactNode,\n useContext,\n useEffect,\n useErrorBoundary,\n useImperativeHandle,\n useRef,\n useState,\n} from '@lynx-js/react';\nimport type { CSSProperties } from '@lynx-js/types';\nimport { useDisposer } from '../base/disposer';\nimport { useStableCallback } from '../base/use-stable-callback';\nimport { useG9Core } from '../provider/hooks';\nimport { createReadinessSignal, type G9ReadinessSignal } from './readiness-signal';\nimport './deferred.css';\n\n/** Default delay before the content is built (MAUI `DeferredContentView.DefaultLoadDelayMs`, the layout metric, 369). */\nexport const g9DeferredLoadDelayMs: number = g9LayoutMetrics.DeferredContentLoadDelayMs;\n/** Default cap of the covered reveal's settle window (MAUI `FadeRevealDelayMs`). */\nexport const g9DeferredFadeRevealDelayMs = 220;\n/** Default frames the covered content gets after its first layout (MAUI `RevealSettleFrames`). */\nexport const g9DeferredRevealSettleFrames = 2;\n/** Longest the covered reveal waits for readiness signals (MAUI `ContentReadinessTimeoutMs`). */\nexport const g9DeferredReadinessTimeoutMs = 5000;\n/** The cover's fade-out (MAUI: `FadeToAsync(0, 160, CubicIn)`). */\nexport const g9DeferredCoverFadeMs = 160;\n\n/** Imperative handle of {@link G9DeferredContent} (via `ref`). */\nexport interface G9DeferredContentHandle {\n /**\n * Starts the load now (MAUI `LoadContentAsync`): waits `loadDelayMs`, builds the content, reveals it. A second call\n * while a load is claimed returns at once. Aborting `signal` (or unmounting) before the content is built releases\n * the claim so a later call loads again. Settles when the content is mounted (not when the reveal settles).\n */\n load(signal?: G9AbortSignal): Promise<void>;\n /** The load has been claimed (MAUI `IsContentLoaded`): a re-entrancy latch, `true` from the start of a load. */\n readonly isContentLoaded: boolean;\n /** The final content is the only visual (MAUI `IsRevealSettled`); also `true` after a failure. */\n readonly isRevealSettled: boolean;\n}\n\n/** Props of {@link G9DeferredContent}. */\nexport interface G9DeferredContentProps {\n /** Builds the content after the delay (MAUI `ContentFactory`): preferred when building is expensive. */\n readonly render?: () => ReactNode;\n /** Already-built content to swap in after the delay (MAUI `DeferredContent`); used when `render` is absent. */\n readonly children?: ReactNode;\n /** The placeholder (MAUI `LoadingView`). Default: a full-fill themed background with a centred 42 px spinner. */\n readonly placeholder?: ReactNode;\n /** Start loading on mount (MAUI `AutoLoad`). Default `true`; otherwise call `ref.load()`. */\n readonly autoLoad?: boolean;\n /** Delay before the content is built (MAUI `LoadDelayMs`). Default {@link g9DeferredLoadDelayMs}. */\n readonly loadDelayMs?: number;\n /**\n * Reveal under the opaque placeholder and fade it out once the content settled (MAUI `FadeContentIn`): first\n * layout + `revealSettleFrames` frames (capped by `fadeRevealDelayMs`), then every readiness gate\n * (`useG9DeferredReadiness`, at most 5 s), then a 160 ms fade. Default `false` (instant swap).\n */\n readonly fadeContentIn?: boolean;\n /** Cap of the settle window (MAUI `FadeRevealDelayMs`); `0` skips it. Default 220. */\n readonly fadeRevealDelayMs?: number;\n /** Frames after the content's first layout (MAUI `RevealSettleFrames`). Default 2. */\n readonly revealSettleFrames?: number;\n /** Called right after the content was built, before it is shown (MAUI `OnContentCreated`). */\n readonly onContentCreated?: () => void;\n /** The content is mounted (MAUI `ContentLoaded`); with `fadeContentIn` it is still covered. */\n readonly onContentLoaded?: () => void;\n /** The content is the only visual, or the load failed (MAUI `RevealSettled`): re-measure here. */\n readonly onRevealSettled?: () => void;\n /**\n * What to show after a failure: the build threw, or the content threw while rendering. Default: the placeholder\n * stays (MAUI). The error has already gone to diagnostics and the executor's popup; `retry` loads again.\n */\n readonly renderError?: (error: unknown, retry: () => void) => ReactNode;\n /** Names the load in diagnostics (`deferred:<name>`). Default `'G9DeferredContent'`. */\n readonly name?: string;\n readonly className?: string;\n readonly style?: CSSProperties;\n}\n\ntype Phase = 'placeholder' | 'revealing' | 'fading' | 'settled' | 'failed';\n\n/** Readiness gates registered by the content of the nearest {@link G9DeferredContent}. */\nconst G9DeferredReadinessContext = createContext<{ register(signal: G9ReadinessSignal): () => void } | null>(null);\n\n/**\n * Opts the calling content into the covered reveal's readiness gate (MAUI `IDeferredContentReadiness` /\n * `GateContentReadiness`): the placeholder stays until the returned signal's `markReady()` runs (bounded by 5 s), so\n * work applied after the first layout (a data fill, a scroll-to-selection) is never seen re-rendering. Call\n * `markReady()` on every path, including failures. Outside a fading `G9DeferredContent` nothing waits for it.\n */\nexport function useG9DeferredReadiness(): G9ReadinessSignal {\n const [signal] = useState(createReadinessSignal);\n const registry = useContext(G9DeferredReadinessContext);\n useEffect(() => registry?.register(signal), [registry, signal]);\n return signal;\n}\n\nfunction DefaultPlaceholder(): ReactNode {\n return (\n <view className=\"g9-deferred__placeholder\">\n <view className=\"g9-deferred__spinner\" />\n </view>\n );\n}\n\nfunction SettleProbe(props: { readonly onSettled: () => void }): ReactNode {\n const { onSettled } = props;\n useEffect(() => onSettled(), [onSettled]);\n return null;\n}\n\nfunction ContentBoundary(props: { readonly onError: (error: unknown) => void; readonly children?: ReactNode }) {\n const [error] = useErrorBoundary(props.onError);\n return error ? null : props.children;\n}\n\nfunction waitFor(\n ms: number,\n signals: ReadonlyArray<G9AbortSignal | undefined>,\n schedule: (callback: () => void, ms: number) => () => void,\n): Promise<boolean> {\n return new Promise<boolean>((resolve) => {\n const live = signals.filter((signal): signal is G9AbortSignal => signal !== undefined);\n if (live.some((signal) => signal.aborted)) return resolve(false);\n let cancel = () => {};\n const onAbort = () => finish(false);\n function finish(ok: boolean) {\n cancel();\n for (const signal of live) signal.removeEventListener('abort', onAbort);\n resolve(ok);\n }\n for (const signal of live) signal.addEventListener('abort', onAbort);\n if (ms > 0) cancel = schedule(() => finish(true), ms);\n else void Promise.resolve().then(() => finish(!live.some((signal) => signal.aborted)));\n });\n}\n\n/**\n * Shows a placeholder first and the real content after the host's open animation (MAUI `DeferredContentView`), so an\n * expensive body never blocks the animation and the user sees motion, not a blank host. The build runs through the\n * provider's safe executor (errors go to diagnostics and the popup), holds a busy activity `deferred:<name>` until the\n * reveal settles, is cancelled by unmount, and can be retried. Built on lynx-ui `DeferredComponent` for the\n * frame-counted settle window of the covered reveal. Must be inside `G9Provider`.\n */\nexport const G9DeferredContent = forwardRef(function G9DeferredContent(\n props: G9DeferredContentProps,\n ref: ForwardedRef<G9DeferredContentHandle>,\n): ReactNode {\n const core = useG9Core();\n const disposer = useDisposer();\n const latest = useRef(props);\n latest.current = props;\n const name = props.name ?? 'G9DeferredContent';\n const fade = props.fadeContentIn ?? false;\n const settleCap = props.fadeRevealDelayMs ?? g9DeferredFadeRevealDelayMs;\n\n const [phase, setPhase] = useState<Phase>('placeholder');\n const [content, setContent] = useState<{ readonly node: ReactNode; readonly attempt: number } | null>(null);\n const [failure, setFailure] = useState<{ readonly error: unknown } | null>(null);\n const [coverFading, setCoverFading] = useState(false);\n const [session] = useState(() => ({\n claimed: false,\n settled: false,\n attempt: 0,\n unmount: createAbortController(),\n activity: null as G9ActivityScope | null,\n gates: new Set<G9ReadinessSignal>(),\n }));\n const [registry] = useState(() => ({\n register(signal: G9ReadinessSignal) {\n session.gates.add(signal);\n return () => {\n session.gates.delete(signal);\n };\n },\n }));\n\n const endActivity = () => {\n session.activity?.dispose();\n session.activity = null;\n };\n\n const fail = useStableCallback((error: unknown) => {\n // MAUI: release the latch, stop claiming to be loading (hosts holding their size let go), report the failure.\n session.claimed = false;\n session.settled = true;\n endActivity();\n setFailure({ error });\n setPhase('failed');\n latest.current.onRevealSettled?.();\n });\n\n const reportRenderError = useStableCallback((error: unknown) => {\n void core.executor.run(\n () => {\n throw error;\n },\n { source: name, throttleKey: `${name}.render`, enableThrottle: false, preventConcurrentExecution: false },\n );\n fail(error);\n });\n\n const load = useStableCallback(async (signal?: G9AbortSignal) => {\n if (session.claimed || session.unmount.signal.aborted) return;\n session.claimed = true;\n session.settled = false;\n session.activity ??= core.diagnostics.activity(`deferred:${name}`);\n let built = false;\n const result = await core.executor.run(\n async (context) => {\n const delay = latest.current.loadDelayMs ?? g9DeferredLoadDelayMs;\n const due = await waitFor(delay, [context.signal, session.unmount.signal, signal], disposer.setTimeout);\n if (!due) return;\n const current = latest.current;\n const node = current.render ? current.render() : current.children;\n current.onContentCreated?.();\n session.attempt += 1;\n built = true;\n setFailure(null);\n setCoverFading(false);\n setContent({ node, attempt: session.attempt });\n setPhase(fade ? 'revealing' : 'settled');\n },\n {\n source: name,\n throttleKey: `${name}.load`,\n enableThrottle: false,\n preventConcurrentExecution: false,\n ...(signal ? { signal } : {}),\n },\n );\n if (result.status === 'failed') {\n fail(result.error);\n return;\n }\n if (!built) {\n // Cancelled before the content was built: a cancelled load must be repeatable (MAUI).\n session.claimed = false;\n endActivity();\n }\n });\n\n const retry = useStableCallback(() => {\n void load();\n });\n\n useImperativeHandle(\n ref,\n () => ({\n load: (signal) => load(signal) as Promise<void>,\n get isContentLoaded() {\n return session.claimed;\n },\n get isRevealSettled() {\n return session.settled;\n },\n }),\n [load, session],\n );\n\n // Auto load on mount; unmount cancels a pending load and ends the activity.\n useEffect(() => {\n if (latest.current.autoLoad ?? true) void load();\n return () => {\n session.unmount.abort();\n endActivity();\n };\n }, [load, session]);\n\n // Instant swap: loaded and settled together. Covered reveal: loaded now, settled after the fade.\n useEffect(() => {\n if (phase === 'revealing') {\n latest.current.onContentLoaded?.();\n if (settleCap <= 0) setPhase('fading');\n else return disposer.setTimeout(() => setPhase((p) => (p === 'revealing' ? 'fading' : p)), settleCap);\n }\n if (phase === 'settled' && !session.settled) {\n session.settled = true;\n endActivity();\n if (!fade) latest.current.onContentLoaded?.();\n latest.current.onRevealSettled?.();\n }\n return undefined;\n }, [phase, fade, settleCap, disposer, session]);\n\n // The settle window ended: hold the cover for the readiness gates (bounded), then fade it out.\n useEffect(() => {\n if (phase !== 'fading') return;\n let done = false;\n const unsubscribes: Array<() => void> = [];\n const startFade = () => {\n if (done) return;\n done = true;\n for (const unsubscribe of unsubscribes) unsubscribe();\n setCoverFading(true);\n disposer.setTimeout(() => setPhase('settled'), g9DeferredCoverFadeMs);\n };\n const pending = Array.from(session.gates).filter((gate) => !gate.isReady);\n if (pending.length === 0) {\n startFade();\n return;\n }\n let remaining = pending.length;\n for (const gate of pending) {\n unsubscribes.push(\n gate.subscribe(() => {\n remaining -= 1;\n if (remaining === 0) startFade();\n }),\n );\n }\n unsubscribes.push(disposer.setTimeout(startFade, g9DeferredReadinessTimeoutMs));\n return () => {\n done = true;\n for (const unsubscribe of unsubscribes) unsubscribe();\n };\n }, [phase, disposer, session]);\n\n const onSettleProbe = useStableCallback(() => {\n setPhase((p) => (p === 'revealing' ? 'fading' : p));\n });\n\n const placeholder = props.placeholder ?? <DefaultPlaceholder />;\n const covering = phase === 'revealing' || phase === 'fading';\n const showContent = content !== null && (covering || phase === 'settled');\n return (\n <view\n className={`g9-deferred${props.className ? ` ${props.className}` : ''}`}\n {...(props.style ? { style: props.style } : {})}\n >\n {showContent ? (\n <G9DeferredReadinessContext.Provider value={registry}>\n <view className=\"g9-deferred__content\">\n <ContentBoundary key={content.attempt} onError={reportRenderError}>\n {content.node}\n </ContentBoundary>\n </view>\n </G9DeferredReadinessContext.Provider>\n ) : null}\n {covering ? (\n <view className={`g9-deferred__cover${coverFading ? ' g9-deferred__cover--fading' : ''}`}>\n {placeholder}\n {phase === 'revealing' ? (\n <DeferredComponent\n delayFrames={latest.current.revealSettleFrames ?? g9DeferredRevealSettleFrames}\n estimatedStyle={{ position: 'absolute', width: '0px', height: '0px' }}\n >\n <SettleProbe onSettled={onSettleProbe} />\n </DeferredComponent>\n ) : null}\n </view>\n ) : null}\n {phase === 'placeholder' ? placeholder : null}\n {phase === 'failed' ? (props.renderError ? props.renderError(failure?.error, retry) : placeholder) : null}\n </view>\n );\n});\n"],"names":["g9DeferredLoadDelayMs","g9LayoutMetrics","g9DeferredFadeRevealDelayMs","g9DeferredRevealSettleFrames","g9DeferredReadinessTimeoutMs","g9DeferredCoverFadeMs","G9DeferredReadinessContext","createContext","useG9DeferredReadiness","signal","useState","createReadinessSignal","registry","useContext","useEffect","DefaultPlaceholder","view","SettleProbe","props","onSettled","ContentBoundary","error","useErrorBoundary","waitFor","ms","signals","schedule","Promise","resolve","live","undefined","cancel","onAbort","finish","ok","G9DeferredContent","forwardRef","ref","_props_name","_props_fadeContentIn","_props_fadeRevealDelayMs","_props_placeholder","_latest_current_revealSettleFrames","core","useG9Core","disposer","useDisposer","latest","useRef","name","fade","settleCap","phase","setPhase","content","setContent","failure","setFailure","coverFading","setCoverFading","session","createAbortController","Set","endActivity","_session_activity","fail","useStableCallback","_latest_current","reportRenderError","load","_session","built","result","context","_latest_current_loadDelayMs","current","delay","due","node","retry","useImperativeHandle","_latest_current_autoLoad","p","_latest_current1","_latest_current2","done","unsubscribes","startFade","unsubscribe","pending","Array","gate","remaining","onSettleProbe","placeholder","covering","showContent","DeferredComponent"],"mappings":";;;;;;;;AA2BO,MAAMA,wBAAgCC,gBAAgB,0BAA0B;AAEhF,MAAMC,8BAA8B;AAEpC,MAAMC,+BAA+B;AAErC,MAAMC,+BAA+B;AAErC,MAAMC,wBAAwB;AA0DrC,MAAMC,6BAA6BC,cAA0E;AAQtG,SAASC;IACd,MAAM,CAACC,OAAO,GAAGC,SAASC;IAC1B,MAAMC,WAAWC,WAAWP;IAC5BQ,UAAU,IAAMF,QAAAA,WAAAA,KAAAA,IAAAA,SAAU,QAAQ,CAACH,SAAS;QAACG;QAAUH;KAAO;IAC9D,OAAOA;AACT;AAEA,SAASM;IACP,QACGC,KAAK,UAAU,2BAA2B;MACzC,CAACA,KAAK,UAAU,wBAAyB;IAC3C,EAAEA;AAEN;AAEA,SAASC,YAAYC,KAAyC;IAC5D,MAAM,EAAEC,SAAS,EAAE,GAAGD;IACtBJ,UAAU,IAAMK,aAAa;QAACA;KAAU;IACxC,OAAO;AACT;AAEA,SAASC,gBAAgBF,KAAoF;IAC3G,MAAM,CAACG,MAAM,GAAGC,iBAAiBJ,MAAM,OAAO;IAC9C,OAAOG,QAAQ,OAAOH,MAAM,QAAQ;AACtC;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ACT,EAAEV,2BAA2B,YAC3B,KAAK;MACT,CAACyF,YACE/E,KAAK,WAAW,CAAC,kBAAkB,EAAE0C,cAAc,gCAAgC,IAAI,EAAE;UACxF,CAACoC,YAAY;UACb,CAAC1C,AAAU,gBAAVA,SACE6C,kBACC,aAAa,QAAAvD,CAAAA,qCAAAA,OAAO,OAAO,CAAC,kBAAkB,AAAD,IAAhCA,qCAAqCvC,8BAClD,gBAAgB;QAAE,UAAU;QAAY,OAAO;QAAO,QAAQ;IAAM,GACrE;cACC,CAACc,YAAY,WAAW4E,gBAAiB;YAC3C,EAAEI,qBACA,KAAK;QACX,EAAEjF,QACA,KAAK;MACT,CAACoC,AAAU,kBAAVA,QAA0B0C,cAAc,KAAK;MAC9C,CAAC1C,AAAU,aAAVA,QAAsBlC,MAAM,WAAW,GAAGA,MAAM,WAAW,CAACsC,QAAAA,UAAAA,KAAAA,IAAAA,QAAS,KAAK,EAAEuB,SAASe,cAAe,KAAK;IAC5G,EAAE9E;AAEN"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deferred/readiness-signal.jsx","sources":["../../src/deferred/readiness-signal.ts"],"sourcesContent":["/**\n * A latched \"the visual is settled\" flag with a one-shot notification (MAUI `DeferredContentReadinessSignal`, the\n * backing of `IDeferredContentReadiness`). Subscribing after it fired calls the listener at once, so a late\n * subscriber can never miss it.\n */\nexport interface G9ReadinessSignal {\n /** `true` once {@link G9ReadinessSignal.markReady} ran. Never goes back. */\n readonly isReady: boolean;\n /** Calls `listener` once when ready (at once if already ready). Returns an unsubscribe function. */\n subscribe(listener: () => void): () => void;\n /** Flips the flag and notifies; idempotent. */\n markReady(): void;\n}\n\n/** Creates a {@link G9ReadinessSignal}. */\nexport function createReadinessSignal(): G9ReadinessSignal {\n let ready = false;\n let listeners = new Set<() => void>();\n return {\n get isReady() {\n return ready;\n },\n subscribe(listener) {\n if (ready) {\n listener();\n return () => {};\n }\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n },\n markReady() {\n if (ready) return;\n ready = true;\n const pending = listeners;\n listeners = new Set();\n for (const listener of Array.from(pending)) listener();\n },\n };\n}\n"],"names":["createReadinessSignal","ready","listeners","Set","listener","pending","Array"],"mappings":"AAeO,SAASA;IACd,IAAIC,QAAQ;IACZ,IAAIC,YAAY,IAAIC;IACpB,OAAO;QACL,IAAI;YACF,OAAOF;QACT;QACA,WAAUG,QAAQ;YAChB,IAAIH,OAAO;gBACTG;gBACA,OAAO,KAAO;YAChB;YACAF,UAAU,GAAG,CAACE;YACd,OAAO;gBACLF,UAAU,MAAM,CAACE;YACnB;QACF;QACA;YACE,IAAIH,OAAO;YACXA,QAAQ;YACR,MAAMI,UAAUH;YAChBA,YAAY,IAAIC;YAChB,KAAK,MAAMC,YAAYE,MAAM,IAAI,CAACD,SAAUD;QAC9C;IACF;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"display/activity-indicator.jsx","sources":["../../src/display/activity-indicator.tsx"],"sourcesContent":["import './display.css';\nimport type { ReactNode } from '@lynx-js/react';\n\n/** Props of {@link G9ActivityIndicator} (MAUI `G9ActivityIndicator` = MAUI `ActivityIndicator`). */\nexport interface G9ActivityIndicatorProps {\n /** Spinning and visible (MAUI `IsRunning`). Default false: the box keeps its size but shows nothing. */\n readonly running?: boolean;\n /** Ring colour (MAUI `Color`). Default `var(--g9-primary)`. */\n readonly color?: string;\n /** Box size in logical pixels. Default 20. */\n readonly size?: number;\n /** Ring thickness. Default `max(2, size / 10)`. */\n readonly thickness?: number;\n readonly className?: string;\n readonly accessibilityLabel?: string;\n}\n\n/**\n * A spinner: a ring with a transparent quarter rotating once per 800 ms (CSS keyframes, no JavaScript per frame).\n * Not running → an empty box of the same size (so layouts do not jump).\n */\nexport function G9ActivityIndicator(props: G9ActivityIndicatorProps): ReactNode {\n const size = props.size ?? 20;\n const thickness = props.thickness ?? Math.max(2, size / 10);\n const running = props.running === true;\n const color = props.color ?? 'var(--g9-primary)';\n return (\n <view\n className={`g9-activity${running ? ' g9-activity--running' : ''}${props.className ? ` ${props.className}` : ''}`}\n style={{\n width: `${size}px`,\n height: `${size}px`,\n borderRadius: `${size / 2}px`,\n borderWidth: `${thickness}px`,\n borderColor: running ? color : 'transparent',\n borderTopColor: 'transparent',\n }}\n {...(props.accessibilityLabel\n ? { 'accessibility-element': true, 'accessibility-label': props.accessibilityLabel }\n : {})}\n />\n );\n}\n"],"names":["G9ActivityIndicator","props","_props_size","_props_thickness","_props_color","size","thickness","Math","running","color","view"],"mappings":";AAqBO,SAASA,oBAAoBC,KAA+B;QACpDC,aACKC,kBAEJC;IAHd,MAAMC,OAAO,QAAAH,CAAAA,cAAAA,MAAM,IAAI,AAAD,IAATA,cAAc;IAC3B,MAAMI,YAAY,QAAAH,CAAAA,mBAAAA,MAAM,SAAS,AAAD,IAAdA,mBAAmBI,KAAK,GAAG,CAAC,GAAGF,OAAO;IACxD,MAAMG,UAAUP,AAAkB,SAAlBA,MAAM,OAAO;IAC7B,MAAMQ,QAAQ,QAAAL,CAAAA,eAAAA,MAAM,KAAK,AAAD,IAAVA,eAAe;IAC7B,QACGM,KACC,WAAW,CAAC,WAAW,EAAEF,UAAU,0BAA0B,KAAKP,MAAM,SAAS,GAAG,CAAC,CAAC,EAAEA,MAAM,SAAS,EAAE,GAAG,IAAI,EAChH,OAAO;QACL,OAAO,GAAGI,KAAK,EAAE,CAAC;QAClB,QAAQ,GAAGA,KAAK,EAAE,CAAC;QACnB,cAAc,GAAGA,OAAO,EAAE,EAAE,CAAC;QAC7B,aAAa,GAAGC,UAAU,EAAE,CAAC;QAC7B,aAAaE,UAAUC,QAAQ;QAC/B,gBAAgB;IAClB,IACC,GAAIR,MAAM,kBAAkB,GACzB;QAAE,yBAAyB;QAAM,uBAAuBA,MAAM,kBAAkB;IAAC,IACjF,CAAC,CAAC;AAGZ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"display/culture-date-time-label.jsx","sources":["../../src/display/culture-date-time-label.tsx"],"sourcesContent":["import './display.css';\nimport {\n formatAgo,\n formatLocalDateTime,\n type G9Culture,\n type G9LocalDateTime,\n G9StringKey,\n type G9Strings,\n isPersianLanguage,\n isSupportedByPersianCalendar,\n localDateTimeFromEpochMs,\n localDateTimeToEpochMs,\n toEpochDays,\n} from '@g9tm/lynxcontrols-foundation';\nimport type { ReactNode } from '@lynx-js/react';\nimport { type G9ControlBaseProps, useG9Control } from '../base/control';\nimport { useG9Core, useG9Culture, useG9Strings } from '../provider/hooks';\n\n/**\n * What the label shows (MAUI `G9CultureDateTimeDisplayMode`). `relativeDay` (MAUI 1.4.0) is a due-date style: «امروز،\n * 18:00» / \"Today, 18:00\", and the `tomorrow` / `yesterday` words, when the value falls on one of those three days;\n * otherwise exactly `dateTime` (`date` for a midnight value, which almost always means \"a date with no time\").\n */\nexport const G9CultureDateTimeDisplayMode = {\n DateTime: 'dateTime',\n Date: 'date',\n Time: 'time',\n Relative: 'relative',\n RelativeDay: 'relativeDay',\n} as const;\nexport type G9CultureDateTimeDisplayMode =\n (typeof G9CultureDateTimeDisplayMode)[keyof typeof G9CultureDateTimeDisplayMode];\n\n/** Inputs of {@link formatCultureDateTime}. */\nexport interface G9CultureDateTimeFormatInput {\n readonly value: G9LocalDateTime;\n readonly mode: G9CultureDateTimeDisplayMode;\n readonly culture: G9Culture;\n readonly strings: G9Strings;\n /** Now (epoch ms), for the relative mode. */\n readonly nowMs: number;\n /** UTC offset of `value`'s wall clock, for the relative modes. */\n readonly utcOffsetMinutes: number;\n /**\n * The wall-clock \"now\" `relativeDay` measures today against (MAUI `G9CultureDateTimeLabel.RelativeDayNow()`).\n * Default: `nowMs` at `utcOffsetMinutes`, i.e. today in the value's own zone.\n */\n readonly relativeDayNow?: G9LocalDateTime;\n}\n\nconst dayWords: Readonly<Record<string, G9StringKey>> = Object.freeze({\n '0': G9StringKey.Today,\n '1': G9StringKey.Tomorrow,\n '-1': G9StringKey.Yesterday,\n});\n\nconst isMidnight = (value: G9LocalDateTime) =>\n value.hour === 0 && value.minute === 0 && value.second === 0 && value.millisecond === 0;\n\n/**\n * MAUI `G9CultureDateTimeLabel.Format`: Jalali for `fa` cultures (Gregorian outside the Persian range), else\n * Gregorian; `yyyy/MM/dd`, `HH:mm`, `date - time`, or `ago - HH:mm`; Latin digits (as the MAUI code). Absolute text in\n * an RTL culture is wrapped in LRE…PDF so it reads left to right. `relativeDay` writes the day word («امروز، 18:00»,\n * \"Today, 18:00\", the word alone at midnight) in the culture's own direction, never embedded, and falls back to the\n * absolute date (with its time only when it has one) outside today, tomorrow and yesterday.\n */\nexport function formatCultureDateTime(input: G9CultureDateTimeFormatInput): string {\n const { value, culture } = input;\n const time = formatLocalDateTime(value, 'HH:mm', culture, { calendar: 'gregorian', numberingSystem: 'latin' });\n let mode = input.mode;\n if (mode === 'relativeDay') {\n const now = input.relativeDayNow ?? localDateTimeFromEpochMs(input.nowMs, input.utcOffsetMinutes);\n const word = dayWords[String(toEpochDays(value) - toEpochDays(now))];\n if (word !== undefined) {\n const text = input.strings.get(word);\n // The Persian comma under fa (the design's «امروز، ۱۸:۰۰»), a Latin one elsewhere.\n return isMidnight(value) ? text : `${text}${isPersianLanguage(culture) ? '، ' : ', '}${time}`;\n }\n mode = isMidnight(value) ? 'date' : 'dateTime';\n }\n if (mode === 'relative') {\n const ago = formatAgo(localDateTimeToEpochMs(value, input.utcOffsetMinutes), {\n now: input.nowMs,\n strings: input.strings,\n });\n return `${ago} - ${time}`;\n }\n const calendar = culture.language === 'fa' && isSupportedByPersianCalendar(value) ? 'persian' : 'gregorian';\n const date = formatLocalDateTime(value, 'yyyy/MM/dd', culture, { calendar, numberingSystem: 'latin' });\n const text = mode === 'date' ? date : mode === 'time' ? time : `${date} - ${time}`;\n return culture.direction === 'rtl' ? `${text}` : text;\n}\n\n/** Props of {@link G9CultureDateTimeLabel}. */\nexport interface G9CultureDateTimeLabelProps extends G9ControlBaseProps {\n /** The wall-clock value; `null` shows `emptyText`. */\n readonly value?: G9LocalDateTime | null;\n /** Default `'dateTime'`. */\n readonly displayMode?: G9CultureDateTimeDisplayMode;\n /** Default `''`. */\n readonly emptyText?: string | null;\n /** UTC offset of `value` (relative modes). Default 0. */\n readonly utcOffsetMinutes?: number;\n /**\n * The clock `relativeDay` measures \"today\" against (MAUI static `G9CultureDateTimeLabel.RelativeDayNow`, here per\n * label). Default: the provider's clock at `utcOffsetMinutes`. Point it at a fixed wall clock (a server zone) so a\n * value stamped \"today\" there never reads as \"yesterday\" on a device in another zone.\n */\n readonly relativeDayNow?: () => G9LocalDateTime;\n}\n\n/**\n * A culture-aware date/time text (MAUI `G9CultureDateTimeLabel`); re-renders on culture changes. The relative texts\n * (`relative`, `relativeDay`) do not refresh by themselves (as MAUI); re-render to update them.\n */\nexport function G9CultureDateTimeLabel(props: G9CultureDateTimeLabelProps): ReactNode {\n const control = useG9Control(props, 'g9-date-label');\n const culture = useG9Culture();\n const strings = useG9Strings();\n const clock = useG9Core().services.clock;\n const text =\n props.value == null\n ? (props.emptyText ?? '')\n : formatCultureDateTime({\n value: props.value,\n mode: props.displayMode ?? 'dateTime',\n culture,\n strings,\n nowMs: clock.now(),\n utcOffsetMinutes: props.utcOffsetMinutes ?? 0,\n ...(props.displayMode === 'relativeDay' && props.relativeDayNow\n ? { relativeDayNow: props.relativeDayNow() }\n : {}),\n });\n return (\n <text className={control.className} {...control.idProps}>\n {text}\n </text>\n );\n}\n"],"names":["G9CultureDateTimeDisplayMode","dayWords","Object","G9StringKey","isMidnight","value","formatCultureDateTime","input","culture","time","formatLocalDateTime","mode","_input_relativeDayNow","now","localDateTimeFromEpochMs","word","String","toEpochDays","undefined","text1","isPersianLanguage","ago","formatAgo","localDateTimeToEpochMs","calendar","isSupportedByPersianCalendar","date","G9CultureDateTimeLabel","props","_props_emptyText","_props_displayMode","_props_utcOffsetMinutes","control","useG9Control","useG9Culture","strings","useG9Strings","clock","useG9Core","text"],"mappings":";;;;AAuBO,MAAMA,+BAA+B;IAC1C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AQ,QAAQ,IAAaiB,6BAA6BpB,SAAS,YAAY;IAChG,MAAMqB,OAAOhB,oBAAoBL,OAAO,cAAcG,SAAS;QAAEgB;QAAU,iBAAiB;IAAQ;IACpG,MAAML,QAAOR,AAAS,WAATA,OAAkBe,OAAOf,AAAS,WAATA,OAAkBF,OAAO,GAAGiB,KAAK,GAAG,EAAEjB,MAAM;IAClF,OAAOD,AAAsB,UAAtBA,QAAQ,SAAS,GAAa,CAAC,CAAC,EAAEW,MAAK,CAAC,CAAC,GAAGA;AACrD;AAwBO,SAASQ,uBAAuBC,KAAkC;QAOhEC,kBAGOC,oBAIYC;IAb1B,MAAMC,UAAUC,aAAaL,OAAO;IACpC,MAAMpB,UAAU0B;IAChB,MAAMC,UAAUC;IAChB,MAAMC,QAAQC,YAAY,QAAQ,CAAC,KAAK;IACxC,MAAMnB,QACJS,AAAe,QAAfA,MAAM,KAAK,GAAI,QACVC,CAAAA,mBAAAA,MAAM,SAAS,AAAD,IAAdA,mBAAmB,KACpBvB,sBAAsB;QACpB,OAAOsB,MAAM,KAAK;QAClB,MAAM,QAAAE,CAAAA,qBAAAA,MAAM,WAAW,AAAD,IAAhBA,qBAAqB;QAC3BtB;QACA2B;QACA,OAAOE,MAAM,GAAG;QAChB,kBAAkB,QAAAN,CAAAA,0BAAAA,MAAM,gBAAgB,AAAD,IAArBA,0BAA0B;QAC5C,GAAIH,AAAsB,kBAAtBA,MAAM,WAAW,IAAsBA,MAAM,cAAc,GAC3D;YAAE,gBAAgBA,MAAM,cAAc;QAAG,IACzC,CAAC,CAAC;IACR;IACN,QACGW,KAAK,WAAWP,QAAQ,SAAS,GAAG,GAAGA,QAAQ,OAAO,EAAE;MACvD,CAACb,MAAK;IACR,EAAEoB;AAEN"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"display/progress-bar.jsx","sources":["../../src/display/progress-bar.tsx"],"sourcesContent":["import './display.css';\nimport {\n formatColor,\n type G9ProgressLabelPlacement,\n type G9ProgressType,\n lighten,\n resolveProgressColor,\n} from '@g9tm/lynxcontrols-foundation';\nimport type { ReactNode } from '@lynx-js/react';\nimport { type G9ControlBaseProps, useG9Control } from '../base/control';\nimport { useG9Theme } from '../provider/hooks';\n\n/** Props of {@link G9ProgressBar} (MAUI `G9ProgressBar`). */\nexport interface G9ProgressBarProps extends G9ControlBaseProps {\n /** 0–1; only the display is clamped. Changes animate over 300 ms. Default 0. */\n readonly value?: number;\n /** Default `var(--g9-surface-variant)`. */\n readonly trackColor?: string | null;\n /** Fill and label colour; default the `progressType` colour. Must be a colour literal (it is lightened). */\n readonly progressColor?: string | null;\n /** Capped at half the bar height. Default 999 (pill). */\n readonly cornerRadius?: number;\n /** Default 10. */\n readonly barHeight?: number;\n /** `'above'` and `'end'` both show `NN%` above the bar, end-aligned (as MAUI). Default `'none'`. */\n readonly labelPlacement?: G9ProgressLabelPlacement;\n /** A 20 % segment sweeps left to right (≈ 1.33 s) instead of a fill. Default false. */\n readonly isIndeterminate?: boolean;\n /** Four dots at 1/5 … 4/5. Default false. */\n readonly showSegments?: boolean;\n /** Default `'primary'`. */\n readonly progressType?: G9ProgressType;\n /** Freezes the sweep and hides the stripes; disabled behaves as paused. Default false. */\n readonly isPaused?: boolean;\n}\n\n/** The progress label: `round(clamp(value) × 100)%`, Latin digits (MAUI formats with .NET, which keeps them). */\nexport function progressLabel(value: number): string {\n return `${Math.round(clampProgress(value) * 100)}%`;\n}\n\n/** Clamps a progress value to [0, 1]; NaN is 0. */\nexport function clampProgress(value: number): number {\n if (!(value > 0)) return 0;\n return value > 1 ? 1 : value;\n}\n\n/**\n * Linear progress (MAUI `G9ProgressBar`): gradient fill (colour → 24 % lighter), diagonal stripes while running,\n * optional segments and label, indeterminate sweep. All motion is CSS (transition on the width, keyframes for the\n * sweep and the stripes); the stored value is never changed.\n */\nexport function G9ProgressBar(props: G9ProgressBarProps): ReactNode {\n const control = useG9Control(props, 'g9-progress');\n const palette = useG9Theme().palette;\n const height = props.barHeight ?? 10;\n const radius = Math.min(props.cornerRadius ?? 999, height / 2);\n const color = props.progressColor ?? resolveProgressColor(props.progressType ?? 'primary', palette);\n const fill = `linear-gradient(to right, ${color}, ${formatColor(lighten(color, 0.24))})`;\n const paused = props.isPaused === true || control.disabled;\n const indeterminate = props.isIndeterminate === true;\n const placement = props.labelPlacement ?? 'none';\n const value = clampProgress(props.value ?? 0);\n return (\n <view className={control.className} {...control.idProps}>\n {placement !== 'none' ? (\n <text className=\"g9-progress__label\" style={{ color }}>\n {progressLabel(value)}\n </text>\n ) : null}\n <view\n className=\"g9-progress__track g9-dir-ltr\"\n style={{\n height: `${height}px`,\n borderRadius: `${radius}px`,\n backgroundColor: props.trackColor ?? palette.SurfaceVariant,\n }}\n accessibility-element={true}\n {...(props.accessibilityLabel ? { 'accessibility-label': props.accessibilityLabel } : {})}\n accessibility-value={indeterminate ? '' : progressLabel(value)}\n >\n <view\n className={`g9-progress__fill${indeterminate ? ' g9-progress__fill--indeterminate' : ''}${indeterminate && !paused ? ' g9-progress__fill--sweep' : ''}`}\n style={{ width: indeterminate ? '20%' : `${value * 100}%`, borderRadius: `${radius}px`, background: fill }}\n >\n {!paused ? <view className=\"g9-progress__stripes\" /> : null}\n </view>\n {props.showSegments\n ? [1, 2, 3, 4].map((i) => <view key={i} className=\"g9-progress__segment\" style={{ left: `${i * 20}%` }} />)\n : null}\n </view>\n </view>\n );\n}\n"],"names":["progressLabel","value","Math","clampProgress","G9ProgressBar","props","_props_barHeight","_props_cornerRadius","_props_progressColor","_props_progressType","_props_labelPlacement","_props_value","_props_trackColor","control","useG9Control","palette","useG9Theme","height","radius","color","resolveProgressColor","fill","formatColor","lighten","paused","indeterminate","placement","view","text","i"],"mappings":";;;;AAqCO,SAASA,cAAcC,KAAa;IACzC,OAAO,GAAGC,KAAK,KAAK,CAACC,AAAuB,MAAvBA,cAAcF,QAAc,CAAC,CAAC;AACrD;AAGO,SAASE,cAAcF,KAAa;IACzC,IAAI,CAAEA,CAAAA,QA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EAAE,CAAC;QAC3B,iBAAiB,QAAAN,CAAAA,oBAAAA,MAAM,UAAU,AAAD,IAAfA,oBAAoBG,QAAQ,cAAc;IAC7D,GACA,uBAAuB,OACtB,GAAIV,MAAM,kBAAkB,GAAG;QAAE,uBAAuBA,MAAM,kBAAkB;IAAC,IAAI,CAAC,CAAC,EACxF,qBAAqBoB,gBAAgB,KAAKzB,cAAcC,QACzD;QACC,CAAC0B,KACC,WAAW,CAAC,iBAAiB,EAAEF,gBAAgB,sCAAsC,KAAKA,iBAAiB,CAACD,SAAS,8BAA8B,IAAI,EACvJ,OAAO;QAAE,OAAOC,gBAAgB,QAAQ,GAAGxB,AAAQ,MAARA,MAAY,CAAC,CAAC;QAAE,cAAc,GAAGiB,OAAO,EAAE,CAAC;QAAE,YAAYG;IAAK,GAC1G;UACC,CAAC,CAACG,UAAUG,KAAK,UAAU,2BAA4B,KAAK;QAC9D,EAAEA,KAAK;QACP,CAACtB,MAAM,YAAY,GACf;QAAC;QAAG;QAAG;QAAG;KAAE,CAAC,GAAG,CAAC,CAACwB,KAAOF,KAAK,KAAKE,GAAG,UAAU,uBAAuB,OAAO;YAAE,MAAM,GAAGA,AAAI,KAAJA,EAAO,CAAC,CAAC;QAAC,QACnG,KAAK;MACX,EAAEF,KAAK;IACT,EAAEA;AAEN"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"display/separator.jsx","sources":["../../src/display/separator.tsx"],"sourcesContent":["import './display.css';\nimport type { G9ImageSource, G9SeparatorTitleAlignment } from '@g9tm/lynxcontrols-foundation';\nimport type { ReactNode } from '@lynx-js/react';\nimport { type G9ControlBaseProps, useG9Control } from '../base/control';\nimport type { G9IconInput } from '../icon/icon';\nimport { G9IconSlot, hasIconSlot } from '../icon/slot';\n\n/** Props of {@link G9Separator} (MAUI `G9Separator`). */\nexport interface G9SeparatorProps extends G9ControlBaseProps {\n /** Upper-cased bold 10 label; empty = one full-width line. */\n readonly title?: string | null;\n /** `'auto'` (default) is start. */\n readonly titleAlignment?: G9SeparatorTitleAlignment;\n /** Title and icon colour. Default `var(--g9-text-tertiary)`. */\n readonly titleColor?: string | null;\n /** Default `var(--g9-divider)`. */\n readonly lineColor?: string | null;\n /** Line thickness. Default 1. */\n readonly thickness?: number;\n readonly iconEmoji?: string | null;\n readonly icon?: G9IconInput;\n readonly iconPath?: string | null;\n readonly iconImage?: G9ImageSource | null;\n}\n\n/** Upper-cases a separator title without `Intl` (Lynx has none): the runtime's default `toUpperCase`. */\nexport function separatorTitleText(title: string): string {\n return title.toUpperCase();\n}\n\n/**\n * Section separator (MAUI `G9Separator`): a line, or a title with lines at the start, end or both sides (reading\n * order: start/end swap in RTL). Padding 14 top, 8 bottom; 10 px between title and line.\n */\nexport function G9Separator(props: G9SeparatorProps): ReactNode {\n const control = useG9Control(props, 'g9-separator');\n const thickness = props.thickness ?? 1;\n const line = (key: string) => (\n <view\n key={key}\n className=\"g9-separator__line\"\n style={{ height: `${thickness}px`, backgroundColor: props.lineColor ?? 'var(--g9-divider)' }}\n />\n );\n const title = props.title && props.title.trim() !== '' ? props.title : null;\n if (!title) {\n return (\n <view className={control.className} {...control.idProps} accessibility-element={false}>\n {line('only')}\n </view>\n );\n }\n const color = props.titleColor ?? 'var(--g9-text-tertiary)';\n const icon = { emoji: props.iconEmoji, icon: props.icon, imagePath: props.iconPath, image: props.iconImage };\n const label = (\n <view key=\"title\" className=\"g9-separator__title\">\n {hasIconSlot(icon) ? <G9IconSlot {...icon} size={12} color={color} /> : null}\n <text className=\"g9-separator__text\" style={{ color }}>\n {separatorTitleText(title)}\n </text>\n </view>\n );\n const alignment = props.titleAlignment ?? 'auto';\n const children =\n alignment === 'center'\n ? [line('a'), label, line('b')]\n : alignment === 'end'\n ? [line('a'), label]\n : [label, line('b')];\n return (\n <view className={control.className} {...control.idProps} accessibility-element={true} accessibility-label={title}>\n {children}\n </view>\n );\n}\n"],"names":["separatorTitleText","title","G9Separator","props","_props_thickness","_props_titleColor","_props_titleAlignment","control","useG9Control","thickness","line","key","_props_lineColor","view","color","icon","label","hasIconSlot","G9IconSlot","text","alignment","children"],"mappings":";;;AA0BO,SAASA,mBAAmBC,KAAa;IAC9C,OAAOA,MAAM,WAAW;AAC1B;AAMO,SAASC,YAAYC,KAAuB;QAE/BC,kBAgBJC,mBAUIC;IA3BlB,MAAMC,UAAUC,aAAaL,OAAO;IACpC,MAAMM,YAAY,QAAAL,CAAAA,mBAAAA,MAAM,SAAS,AAAD,IAAdA,mBAAmB;IACrC,MAAMM,OAAO,CAACC;YAI0CC;gBAHrDC,KACC,KAAKF,KACL,UAAU,qBACV,OAAO;YAAE,QAAQ,GAAGF,UAAU,EAAE,CAAC;YAAE,iBAAiB,QAAAG,CAAAA,mBAAAA,MAAM,SAAS,AAAD,IAAdA,mBAAmB;QAAoB;;IAG/F,MAAMX,QAAQE,MAAM,KAAK,IAAIA,AAAuB,OAAvBA,MAAM,KAAK,CAAC,IAAI,KAAYA,MAAM,KAAK,GAAG;IACvE,IAAI,CAACF,OACH,QACGY,KAAK,WAAWN,QAAQ,SAAS,GAAG,GAAGA,QAAQ,OAAO,EAAE,uBAAuB,OAAO;QACrF,CAACG,KAAK,QAAQ;MAChB,EAAEG;IAGN,MAAMC,QAAQ,QAAAT,CAAAA,oBAAAA,MAAM,UAAU,AAAD,IAAfA,oBAAoB;IAClC,MAAMU,OAAO;QAAE,OAAOZ,MAAM,SAAS;QAAE,MAAMA,MAAM,IAAI;QAAE,WAAWA,MAAM,QAAQ;QAAE,OAAOA,MAAM,SAAS;IAAC;IAC3G,MAAMa,SACHH,KAAK,IAAI,QAAQ,UAAU,sBAAsB;MAChD,CAACI,YAAYF,SAASG,YAAY,GAAGH,IAAI,EAAE,MAAM,IAAI,OAAOD,WAAY,KAAK;MAC7E,CAACK,KAAK,UAAU,qBAAqB,OAAO;QAAEL;IAAM,GAAG;QACrD,CAACd,mBAAmBC,OAAO;MAC7B,EAAEkB,KAAK;IACT,EAAEN;IAEJ,MAAMO,YAAY,QAAAd,CAAAA,wBAAAA,MAAM,cAAc,AAAD,IAAnBA,wBAAwB;IAC1C,MAAMe,WACJD,AAAc,aAAdA,YACI;QAACV,KAAK;QAAMM;QAAON,KAAK;KAAK,GAC7BU,AAAc,UAAdA,YACE;QAACV,KAAK;QAAMM;KAAM,GAClB;QAACA;QAAON,KAAK;KAAK;IAC1B,QACGG,KAAK,WAAWN,QAAQ,SAAS,GAAG,GAAGA,QAAQ,OAAO,EAAE,uBAAuB,MAAM,qBAAqBN,OAAO;MAChH,CAACoB,SAAS;IACZ,EAAER;AAEN"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"display/shimmer.jsx","sources":["../../src/display/shimmer.tsx"],"sourcesContent":["import './display.css';\nimport type { ReactNode } from '@lynx-js/react';\nimport { useG9Theme } from '../provider/hooks';\n\n/** Shape of a sheet's loading placeholder (MAUI `G9BottomSheetLoadingSkeleton`; sheets use it in WP05). */\nexport const G9BottomSheetLoadingSkeleton = {\n /** No skeleton: the sheet shows its spinner. */\n None: 'none',\n /** Field-shaped bars (48 high). */\n FormFields: 'formFields',\n /** List rows: a circle and a bar (52 high). */\n ListRows: 'listRows',\n} as const;\nexport type G9BottomSheetLoadingSkeleton =\n (typeof G9BottomSheetLoadingSkeleton)[keyof typeof G9BottomSheetLoadingSkeleton];\n\n/** Props of {@link G9ShimmerBand}. */\nexport interface G9ShimmerBandProps {\n /** Sweeping; false stops the animation (hidden content does no work). Default true. */\n readonly active?: boolean;\n}\n\n/**\n * The highlight band that sweeps over skeleton shapes (MAUI `G9ShimmerBandView`): left to right every 1100 ms, white\n * (peak 0.38) in light themes and black (peak 0.20) in dark ones, input-transparent. CSS keyframes only: no work on\n * the JavaScript threads, and none at all when inactive or unmounted.\n */\nexport function G9ShimmerBand(props: G9ShimmerBandProps): ReactNode {\n const dark = useG9Theme().scheme === 'dark';\n const peak = dark ? 'rgba(0,0,0,0.2)' : 'rgba(255,255,255,0.38)';\n const clear = dark ? 'rgba(0,0,0,0)' : 'rgba(255,255,255,0)';\n const active = props.active !== false;\n return (\n <view className=\"g9-shimmer__band-host\">\n {active ? (\n <view\n className=\"g9-shimmer__band\"\n style={{ background: `linear-gradient(to right, ${clear} 35%, ${peak} 50%, ${clear} 65%)` }}\n />\n ) : null}\n </view>\n );\n}\n\n/** Rows of a sheet skeleton: `rowCount` > 0, else 4 (form fields) or 5; clamped to 2–10. */\nexport function sheetSkeletonRowCount(skeleton: G9BottomSheetLoadingSkeleton, rowCount: number): number {\n const n = rowCount > 0 ? rowCount : skeleton === 'formFields' ? 4 : 5;\n return Math.min(10, Math.max(2, Math.floor(n)));\n}\n\n/** Props of {@link G9SheetSkeleton}. */\nexport interface G9SheetSkeletonProps {\n readonly skeleton: G9BottomSheetLoadingSkeleton;\n /** Rows; ≤ 0 → the default for the shape. */\n readonly rowCount?: number;\n /** Opaque background. Default `var(--g9-background)`. */\n readonly backgroundColor?: string | null;\n /** Sweep the band. Default true. */\n readonly active?: boolean;\n}\n\n/**\n * A sheet's loading skeleton with the shimmer band (MAUI `G9Shimmer.CreateSheetSkeleton`): form-field bars, or list\n * rows (`'none'` renders list rows too, as MAUI). Fills its parent, input-transparent.\n */\nexport function G9SheetSkeleton(props: G9SheetSkeletonProps): ReactNode {\n const rows = sheetSkeletonRowCount(props.skeleton, props.rowCount ?? 0);\n const form = props.skeleton === 'formFields';\n const items: ReactNode[] = [];\n for (let i = 0; i < rows; i++) {\n items.push(\n form ? (\n <view key={i} className=\"g9-skeleton__bar g9-skeleton__field\" />\n ) : (\n <view key={i} className=\"g9-skeleton__row\">\n <view className=\"g9-skeleton__circle\" />\n <view className=\"g9-skeleton__bar g9-skeleton__line\" />\n </view>\n ),\n );\n }\n return (\n <view className=\"g9-skeleton\" style={{ backgroundColor: props.backgroundColor ?? 'var(--g9-background)' }}>\n <view className={`g9-skeleton__rows${form ? ' g9-skeleton__rows--form' : ''}`}>{items}</view>\n <G9ShimmerBand active={props.active !== false} />\n </view>\n );\n}\n"],"names":["G9BottomSheetLoadingSkeleton","G9ShimmerBand","props","dark","useG9Theme","peak","clear","active","view","sheetSkeletonRowCount","skeleton","rowCount","n","Math","G9SheetSkeleton","_props_rowCount","_props_backgroundColor","rows","form","items","i"],"mappings":";;AAKO,MAAMA,+BAA+B;IAE1C,MAAM;IAEN,YAAY;IAEZ,UAAU;AACZ;AAeO,SAASC,cAAcC,KAAyB;IACrD,MAAMC,OAAOC,AAAwB,WAAxBA,aAAa,MAAM;IAChC,MAAMC,OAAOF,OAAO,oBAAoB;IACxC,MAAMG,QAAQH,OAAO,kBAAkB;IACvC,MAAMI,SAASL,AAAiB,UAAjBA,MAAM,MAAM;IAC3B,QACGM,KAAK,UAAU,wBAAwB;MACtC,CAACD,UACEC,KACC,UAAU,mBACV,OAAO;QAAE,YAAY,CAAC,0BAA0B,EAAEF,MAAM,MAAM,EAAED,KAAK,MAAM,EAAEC,MAAM,KAAK,CAAC;IAAC,OAE1F,KAAK;IACX,EAAEE;AAEN;AAGO,SAASC,sBAAsBC,QAAsC,EAAEC,QAAgB;IAC5F,MAAMC,IAAID,WAAW,IAAIA,WAAWD,AAAa,iBAAbA,WAA4B,IAAI;IACpE,OAAOG,KAAK,GAAG,CAAC,IAAIA,KAAK,GAAG,CAAC,GAAGA,KAAK,KAAK,CAACD;AAC7C;AAiBO,SAASE,gBAAgBZ,KAA2B;QACNa,iBAgBOC;IAhB1D,MAAMC,OAAOR,sBAAsBP,MAAM,QAAQ,EAAE,QAAAa,CAAAA,kBAAAA,MAAM,QAAQ,AAAD,IAAbA,kBAAkB;IACrE,MAAMG,OAAOhB,AAAmB,iBAAnBA,MAAM,QAAQ;IAC3B,MAAMiB,QAAqB,EAAE;IAC7B,IAAK,IAAIC,IAAI,GAAGA,IAAIH,MAAMG,IACxBD,MAAM,IAAI,CACRD,QACGV,KAAK,KAAKY,GAAG,UAAU,2CAEvBZ,KAAK,KAAKY,GAAG,UAAU,mBAAmB;UACzC,CAACZ,KAAK,UAAU,uBAAwB;UACxC,CAACA,KAAK,UAAU,sCAAuC;QACzD,EAAEA;IAIR,QACGA,KAAK,UAAU,cAAc,OAAO;QAAE,iBAAiB,QAAAQ,CAAAA,yBAAAA,MAAM,eAAe,AAAD,IAApBA,yBAAyB;IAAuB,GAAG;MACzG,CAACR,KAAK,WAAW,CAAC,iBAAiB,EAAEU,OAAO,6BAA6B,IAAI,GAAGC,QAAQX,KAAK;MAC7F,CAACP,cAAc,QAAQC,AAAiB,UAAjBA,MAAM,MAAM,GAAc;IACnD,EAAEM;AAEN"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"display/title-with-line.jsx","sources":["../../src/display/title-with-line.tsx"],"sourcesContent":["import './display.css';\nimport type { ReactNode } from '@lynx-js/react';\nimport { type G9ControlBaseProps, useG9Control } from '../base/control';\n\n/** Props of {@link G9TitleWithLine} (MAUI `G9TitleWithLine`). */\nexport interface G9TitleWithLineProps extends G9ControlBaseProps {\n /** Default `'ابزار'` (MAUI's hard-coded Persian \"tools\"). */\n readonly text?: string;\n /** Padding `[left, top, right, bottom]`. Default `[18, 3, 18, 0]`. */\n readonly padding?: readonly [number, number, number, number];\n}\n\n/** A 16 px title over a 1 px line (MAUI `G9TitleWithLine`). */\nexport function G9TitleWithLine(props: G9TitleWithLineProps): ReactNode {\n const control = useG9Control(props, 'g9-title-line');\n const [l, t, r, b] = props.padding ?? [18, 3, 18, 0];\n return (\n <view className={control.className} {...control.idProps} style={{ padding: `${t}px ${r}px ${b}px ${l}px` }}>\n <text className=\"g9-title-line__text\">{props.text ?? 'ابزار'}</text>\n <view className=\"g9-title-line__line\" />\n </view>\n );\n}\n"],"names":["G9TitleWithLine","props","_props_padding","_props_text","control","useG9Control","l","t","r","b","view","text"],"mappings":";;AAaO,SAASA,gBAAgBC,KAA2B;QAEpCC,gBAGsBC;IAJ3C,MAAMC,UAAUC,aAAaJ,OAAO;IACpC,MAAM,CAACK,GAAGC,GAAGC,GAAGC,EAAE,GAAG,QAAAP,CAAAA,iBAAAA,MAAM,OAAO,AAAD,IAAZA,iBAAiB;QAAC;QAAI;QAAG;QAAI;KAAE;IACpD,QACGQ,KAAK,WAAWN,QAAQ,SAAS,GAAG,GAAGA,QAAQ,OAAO,EAAE,OAAO;QAAE,SAAS,GAAGG,EAAE,GAAG,EAAEC,EAAE,GAAG,EAAEC,EAAE,GAAG,EAAEH,EAAE,EAAE,CAAC;IAAC,GAAG;MAC1G,CAACK,KAAK,UAAU,uBAAuB,QAAAR,CAAAA,cAAAA,MAAM,IAAI,AAAD,IAATA,cAAc,UAAUQ,KAAK;MACpE,CAACD,KAAK,UAAU,uBAAwB;IAC1C,EAAEA;AAEN"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"edge-panel/edge-panel.jsx","sources":["../../src/edge-panel/edge-panel.tsx"],"sourcesContent":["import './edge-panel.css';\nimport { G9StringKey, g9Ms } from '@g9tm/lynxcontrols-foundation';\nimport { type ReactNode, useEffect, useMemo, useRef, useState } from '@lynx-js/react';\nimport { g9RowStyle, g9TextStart } from '../base/control';\nimport { startTimer, stopTimer } from '../base/timers';\nimport { useControllableState } from '../base/use-controllable-state';\nimport { useG9Back, useG9LayerItem } from '../host/hooks';\nimport type { G9IconInput } from '../icon/icon';\nimport { G9IconSlot } from '../icon/slot';\nimport {\n useG9Core,\n useG9Diagnostics,\n useG9Direction,\n useG9Settings,\n useG9Strings,\n useG9Window,\n} from '../provider/hooks';\nimport {\n type G9EdgeCloseButtonPlacement,\n type G9EdgeMenuHeader,\n type G9EdgeMenuHeaderAlignment,\n type G9EdgeMenuItem,\n G9EdgeMenuNavigator,\n type G9EdgePanelContentDirection,\n type G9EdgeSide,\n isEdgeMenuHeaderEmpty,\n g9EdgePanelMetrics as M,\n resolveEdgePanelMaxHeight,\n} from './types';\n\n/** Imperative handle of an edge panel (MAUI `G9EdgePanel` methods), from {@link useEdgePanel} or the helper. */\nexport interface G9EdgePanelController {\n open(): void;\n close(): void;\n toggle(): void;\n readonly isOpen: boolean;\n /** Closes an open panel and reports whether the press was consumed (MAUI `HandleHardwareBackPressed`). */\n handleHardwareBackPressed(): boolean;\n navigateToSubList(items: readonly G9EdgeMenuItem[], header?: G9EdgeMenuHeader | null): void;\n navigateToRoot(): void;\n refreshMenuItems(): void;\n /** `true` while a panel is mounted on this controller. */\n readonly isMounted: boolean;\n /** @internal set by the mounted panel */\n bind(target: G9EdgePanelTarget): () => void;\n}\n\ninterface G9EdgePanelTarget {\n setOpen(open: boolean): void;\n isOpen(): boolean;\n navigator: G9EdgeMenuNavigator;\n renderNav(): void;\n}\n\n/** Creates a controller outside React. */\nexport function createEdgePanelController(): G9EdgePanelController {\n let target: G9EdgePanelTarget | null = null;\n return {\n open: () => target?.setOpen(true),\n close: () => target?.setOpen(false),\n toggle: () => target?.setOpen(!target.isOpen()),\n get isOpen() {\n return target ? target.isOpen() : false;\n },\n get isMounted() {\n return target !== null;\n },\n handleHardwareBackPressed() {\n if (!target?.isOpen()) return false;\n target.setOpen(false);\n return true;\n },\n navigateToSubList(items, header = null) {\n if (!target) return;\n target.navigator.navigateToSubList(items, header);\n target.renderNav();\n },\n navigateToRoot() {\n if (!target) return;\n target.navigator.navigateToRoot();\n target.renderNav();\n },\n refreshMenuItems() {\n if (!target) return;\n target.navigator.refresh();\n target.renderNav();\n },\n bind(next) {\n target = next;\n return () => {\n if (target === next) target = null;\n };\n },\n };\n}\n\n/** A stable controller for a `G9EdgePanel`. */\nexport function useEdgePanel(): G9EdgePanelController {\n const ref = useRef<G9EdgePanelController | null>(null);\n if (ref.current === null) ref.current = createEdgePanelController();\n return ref.current;\n}\n\n/** Props of {@link G9EdgePanel} (MAUI bindable properties and events). */\nexport interface G9EdgePanelProps {\n /** Absolute edge (MAUI `Side`). Default `'left'`. */\n readonly side?: G9EdgeSide;\n /** Panel width as a share of the host width (MAUI `WidthRatio`). Default 0.35. */\n readonly widthRatio?: number;\n /** Distance from the top (MAUI `TopGap`). Default 112. */\n readonly topGap?: number;\n /** Absolute height cap; 0 = none (MAUI `MaxPanelHeight`). */\n readonly maxPanelHeight?: number;\n /** Height cap as a share of the host height (MAUI `MaxPanelHeightRatio`). Default 0.69. */\n readonly maxPanelHeightRatio?: number;\n /** Controlled open state (MAUI `IsOpen`, two-way). */\n readonly open?: boolean;\n readonly defaultOpen?: boolean;\n readonly onOpenChange?: (open: boolean) => void;\n /** Custom content (MAUI `PanelContent`); wins over `menuItems`. */\n readonly panelContent?: ReactNode;\n /** A navigable list menu (MAUI `MenuItems`). */\n readonly menuItems?: readonly G9EdgeMenuItem[] | null;\n readonly panelBackgroundColor?: string | null;\n readonly tabBackgroundColor?: string | null;\n /** Icon of the collapsed tab. Default: a chevron pointing into the screen. */\n readonly collapsedTabIcon?: G9IconInput;\n /** Sets both durations (MAUI `AnimationDuration`); the specific ones win. */\n readonly animationDuration?: number;\n /** Slide-in duration (MAUI `OpenAnimationDuration`). Default 450. */\n readonly openAnimationDuration?: number;\n /** Slide-out duration (MAUI `CloseAnimationDuration`). Default 450. */\n readonly closeAnimationDuration?: number;\n /** A backdrop tap closes the panel (needs `useBackdrop`). Default true. */\n readonly enableOutsideTapToClose?: boolean;\n /** Modal: a dimmed backdrop takes every tap outside the panel. Default true. Off = non-modal: only the panel and its tab take touches. */\n readonly useBackdrop?: boolean;\n /** Show the peek tab while closed. Default false. */\n readonly showCollapsedTab?: boolean;\n readonly contentFlowDirection?: G9EdgePanelContentDirection;\n readonly menuHeader?: G9EdgeMenuHeader | null;\n readonly menuHeaderAlignment?: G9EdgeMenuHeaderAlignment;\n readonly closeButtonPlacement?: G9EdgeCloseButtonPlacement;\n /** After the open slide (MAUI `Opened`). */\n readonly onOpened?: () => void;\n /** When the close slide starts (MAUI `Closing`). */\n readonly onClosing?: () => void;\n /** After the close slide (MAUI `Closed`). */\n readonly onClosed?: () => void;\n readonly controller?: G9EdgePanelController;\n}\n\nlet panelSequence = 0;\n\ntype Phase = 'closed' | 'entering' | 'opening' | 'open' | 'closing';\n\n/**\n * A panel that slides in from a screen edge (MAUI `G9EdgePanel`), mounted in the host's `edgePanel` layer whatever\n * its place in the tree. Modal by default (a dimmed backdrop that closes on tap); with `useBackdrop={false}` it is\n * non-modal: the page stays interactive and only the panel and its tab receive touches. Content is a custom view or a\n * list menu with nested levels (Back row, per-level header). Hardware back closes it.\n */\nexport function G9EdgePanel(props: G9EdgePanelProps): ReactNode {\n const keyRef = useRef<string | null>(null);\n if (keyRef.current === null) {\n panelSequence += 1;\n keyRef.current = `g9-edge-panel-${panelSequence}`;\n }\n const key = keyRef.current;\n const [isOpen, setOpen] = useControllableState<boolean>({\n value: props.open,\n defaultValue: props.defaultOpen ?? false,\n onChange: props.onOpenChange,\n name: 'G9EdgePanel.open',\n });\n const openMs = g9Ms(props.openAnimationDuration ?? props.animationDuration ?? M.defaultOpenAnimationDurationMs);\n const closeMs = g9Ms(props.closeAnimationDuration ?? props.animationDuration ?? M.defaultCloseAnimationDurationMs);\n const [phase, setPhase] = useState<Phase>(isOpen ? 'entering' : 'closed');\n const latest = useRef(props);\n latest.current = props;\n const openRef = useRef(isOpen);\n openRef.current = isOpen;\n\n useEffect(() => {\n if (isOpen) {\n setPhase((p) => (p === 'closed' ? 'entering' : 'opening'));\n const enter = startTimer(() => setPhase('opening'), 16);\n const done = startTimer(() => {\n setPhase('open');\n latest.current.onOpened?.();\n }, openMs + 16);\n return () => {\n stopTimer(enter);\n stopTimer(done);\n };\n }\n if (phase === 'closed') return;\n latest.current.onClosing?.();\n setPhase('closing');\n const done = startTimer(() => {\n setPhase('closed');\n latest.current.onClosed?.();\n }, closeMs);\n return () => stopTimer(done);\n }, [isOpen]);\n\n // List navigation: a new menuItems list or header resets to the root level.\n const navigator = useMemo(() => new G9EdgeMenuNavigator(), []);\n const [, setNavVersion] = useState(0);\n const renderNav = () => setNavVersion(navigator.version);\n const rootHeader = props.menuHeader ?? null;\n useMemo(() => navigator.setRoot(props.menuItems, rootHeader), [props.menuItems, rootHeader]);\n useEffect(\n () =>\n props.controller?.bind({\n setOpen: (open) => setOpen(open),\n isOpen: () => openRef.current,\n navigator,\n renderNav,\n }),\n [props.controller],\n );\n\n useG9Back(\n () => {\n setOpen(false);\n return true;\n },\n { enabled: isOpen, layer: 'edgePanel' },\n );\n\n // Shared debounce for tab and backdrop taps (MAUI InteractionDebounceMs: one physical tap can reach both).\n const core = useG9Core();\n const lastInteraction = useRef(Number.NEGATIVE_INFINITY);\n const accept = () => {\n const now = core.services.clock.monotonicNow();\n if (now - lastInteraction.current < M.interactionDebounceMs) return false;\n lastInteraction.current = now;\n return true;\n };\n const animating = phase === 'entering' || phase === 'opening' || phase === 'closing';\n const onTab = () => {\n if (animating || !accept()) return;\n setOpen(!openRef.current);\n };\n const useBackdrop = props.useBackdrop ?? true;\n const onBackdrop = () => {\n if (!accept()) return;\n if (useBackdrop && (props.enableOutsideTapToClose ?? true) && openRef.current) setOpen(false);\n };\n\n const overlay = (\n <EdgePanelOverlay\n props={props}\n phase={phase}\n openMs={openMs}\n closeMs={closeMs}\n navigator={navigator}\n navVersion={navigator.version}\n onTab={onTab}\n onBackdrop={onBackdrop}\n onNavigate={renderNav}\n onClose={() => setOpen(false)}\n />\n );\n const visible = phase !== 'closed' || props.showCollapsedTab === true;\n useG9LayerItem('edgePanel', key, overlay, { enabled: visible });\n return null;\n}\n\ninterface OverlayProps {\n readonly props: G9EdgePanelProps;\n readonly phase: Phase;\n readonly openMs: number;\n readonly closeMs: number;\n readonly navigator: G9EdgeMenuNavigator;\n readonly navVersion: number;\n readonly onTab: () => void;\n readonly onBackdrop: () => void;\n readonly onNavigate: () => void;\n readonly onClose: () => void;\n}\n\nfunction EdgePanelOverlay(o: OverlayProps): ReactNode {\n const p = o.props;\n const win = useG9Window();\n const appRtl = useG9Direction() === 'rtl';\n const glyphs = useG9Settings().glyphs;\n const left = (p.side ?? 'left') === 'left';\n const direction = p.contentFlowDirection ?? 'matchApplication';\n const contentRtl = direction === 'matchApplication' ? appRtl : direction === 'rightToLeft';\n const width = Math.max(win.width * (p.widthRatio ?? M.defaultWidthRatio), 0);\n const topGap = p.topGap ?? M.defaultTopGap;\n const maxHeight = resolveEdgePanelMaxHeight(\n win.height,\n topGap,\n p.maxPanelHeight ?? 0,\n p.maxPanelHeightRatio ?? M.defaultMaxPanelHeightRatio,\n );\n const shown = o.phase === 'opening' || o.phase === 'open';\n const cardRendered = o.phase !== 'closed';\n const hiddenOffset = (width + M.collapsedExtraOffset) * (left ? -1 : 1);\n const edge = left ? 'left' : 'right';\n const far = left ? 'right' : 'left';\n const useBackdrop = p.useBackdrop ?? true;\n const placement = p.closeButtonPlacement ?? 'inset';\n\n const closeStyle =\n placement === 'onCorner'\n ? { top: `${topGap - M.tabExpandedSize / 2}px`, [edge]: `${width - M.tabExpandedSize / 2}px` }\n : { top: `${topGap + M.tabTopInset}px`, [edge]: `${width - M.tabTopInset - M.tabExpandedSize}px` };\n const tabIcon = p.collapsedTabIcon ?? (left ? glyphs.chevronForward : glyphs.chevronBack);\n\n return (\n <view className=\"g9-edge-panel\">\n {useBackdrop && cardRendered ? (\n <view\n className=\"g9-edge-panel__backdrop\"\n style={{\n opacity: shown ? 1 : 0,\n transition: `opacity ${shown ? o.openMs : o.closeMs}ms ease-out`,\n backgroundColor: `rgba(0, 0, 0, ${M.backdropAlpha})`,\n }}\n bindtap={o.onBackdrop}\n />\n ) : null}\n {cardRendered ? (\n <view\n className={`g9-edge-panel__card g9-edge-panel__card--${edge}`}\n style={{\n [edge]: `${-M.wallOverlap}px`,\n top: `${topGap}px`,\n width: `${width + M.wallOverlap}px`,\n maxHeight: `${maxHeight}px`,\n backgroundColor: p.panelBackgroundColor ?? 'var(--g9-surface-container-high)',\n transform: `translateX(${shown ? 0 : hiddenOffset}px)`,\n transition:\n o.phase === 'entering'\n ? 'none'\n : `transform ${shown ? o.openMs : o.closeMs}ms ${shown ? 'cubic-bezier(0.215, 0.61, 0.355, 1)' : 'cubic-bezier(0.55, 0.055, 0.675, 0.19)'}`,\n }}\n >\n <PanelBody o={o} contentRtl={contentRtl} closeOnFar={far} />\n </view>\n ) : null}\n {cardRendered ? (\n <view\n className={`g9-edge-panel__close g9-edge-panel__close--${placement}`}\n style={{\n ...closeStyle,\n opacity: shown ? 1 : 0,\n transition: `opacity ${g9Ms(M.tabEntranceDurationMs)}ms ease-out`,\n backgroundColor: p.tabBackgroundColor ?? 'var(--g9-surface-container-highest)',\n }}\n accessibility-element\n accessibility-traits=\"button\"\n bindtap={o.onTab}\n >\n <G9IconSlot icon={glyphs.clear} size={M.tabIconSize} color=\"var(--g9-on-surface)\" />\n </view>\n ) : p.showCollapsedTab ? (\n <view\n className={`g9-edge-panel__tab g9-edge-panel__tab--${edge}`}\n style={{\n [edge]: '0px',\n top: `${topGap + M.tabTopInset}px`,\n backgroundColor: p.tabBackgroundColor ?? 'var(--g9-surface-container-highest)',\n }}\n accessibility-element\n accessibility-traits=\"button\"\n bindtap={o.onTab}\n >\n <G9IconSlot icon={tabIcon} size={M.tabIconSize} color=\"var(--g9-on-surface)\" />\n </view>\n ) : null}\n </view>\n );\n}\n\nfunction headerText(header: G9EdgeMenuHeader, resolve: (key: string) => string | null): string {\n if (header.text) return header.text;\n const key = header.localizationKey as string;\n return resolve(key) ?? key;\n}\n\nfunction PanelBody(props: {\n readonly o: OverlayProps;\n readonly contentRtl: boolean;\n readonly closeOnFar: string;\n}): ReactNode {\n const { o, contentRtl } = props;\n const p = o.props;\n const strings = useG9Strings();\n const diagnostics = useG9Diagnostics();\n const glyphs = useG9Settings().glyphs;\n const resolve = (key: string) => strings.resolve(key);\n const nav = o.navigator;\n const frame = nav.frame;\n const header = p.panelContent != null ? (p.menuHeader ?? null) : (frame?.header ?? null);\n const alignment = p.menuHeaderAlignment ?? 'auto';\n const textAlign =\n alignment === 'center'\n ? 'center'\n : alignment === 'leftToRight'\n ? 'left'\n : alignment === 'rightToLeft'\n ? 'right'\n : contentRtl\n ? 'right'\n : 'left';\n const footprint = M.tabExpandedSize + M.tabTopInset;\n const headerPadding =\n alignment === 'center'\n ? { paddingLeft: `${footprint}px`, paddingRight: `${footprint}px` }\n : { [props.closeOnFar === 'right' ? 'paddingRight' : 'paddingLeft']: `${footprint}px` };\n\n // Directional entry of a new menu level (MAUI menu content slide, 220 ms).\n const [entered, setEntered] = useState(true);\n const version = o.navVersion;\n useEffect(() => {\n if (nav.transition === 'none') return;\n setEntered(false);\n const t = startTimer(() => setEntered(true), 16);\n return () => stopTimer(t);\n }, [version]);\n const sign = (nav.transition === 'forward' ? 1 : -1) * (contentRtl ? -1 : 1);\n\n const onRow = (item: G9EdgeMenuItem) => {\n if (item.isEnabled === false) return;\n try {\n item.onClick?.(item);\n item.command?.(item.commandParameter);\n } catch (error) {\n diagnostics.log({\n level: 'error',\n message: 'G9EdgePanel: menu item handler failed.',\n source: 'G9EdgePanel',\n error,\n });\n }\n if (item.nextList && item.nextList.length > 0) {\n nav.navigateToSubList(item.nextList, item.subMenuHeader ?? null);\n o.onNavigate();\n } else if (item.closeAfterClick) {\n o.onClose();\n }\n };\n\n const content =\n p.panelContent != null ? (\n p.panelContent\n ) : frame ? (\n <view\n key={`level-${version}`}\n className=\"g9-edge-panel__menu\"\n style={{\n transform: `translateX(${entered ? 0 : 24 * sign}px)`,\n opacity: entered ? 1 : 0,\n transition: entered\n ? `transform ${g9Ms(M.menuTransitionDurationMs)}ms ease-out, opacity ${g9Ms(M.menuTransitionDurationMs)}ms ease-out`\n : 'none',\n }}\n >\n {nav.isRoot ? null : (\n <view\n className=\"g9-edge-panel__back\"\n style={g9RowStyle(contentRtl ? 'rtl' : 'ltr')}\n accessibility-element\n accessibility-traits=\"button\"\n bindtap={() => {\n nav.back();\n o.onNavigate();\n }}\n >\n <G9IconSlot\n icon={contentRtl ? glyphs.chevronForward : glyphs.chevronBack}\n size={M.menuItemIconSize}\n color=\"var(--g9-on-surface)\"\n />\n <text className=\"g9-edge-panel__back-text\">{strings.get(G9StringKey.Back)}</text>\n </view>\n )}\n {frame.items.map((item, i) => (\n <view key={`${version}-${i}`} className=\"g9-edge-panel__row-wrap\">\n <view\n className={`g9-edge-panel__row${item.isEnabled === false ? ' g9-edge-panel__row--disabled' : ''}`}\n {...(item.automationId ? { id: item.automationId } : {})}\n style={{\n ...g9RowStyle(contentRtl ? 'rtl' : 'ltr'),\n backgroundColor: item.backgroundColor ?? 'transparent',\n opacity: item.isEnabled === false ? 0.5 : 1,\n }}\n accessibility-element\n accessibility-traits=\"button\"\n bindtap={item.isEnabled === false ? undefined : () => onRow(item)}\n >\n <G9IconSlot\n emoji={item.emoji}\n icon={item.icon}\n imagePath={item.imageSource}\n image={item.image}\n size={item.icon ? M.menuItemIconSize : item.emoji ? M.menuItemEmojiSize : M.menuItemImageSize}\n color={item.iconColor ?? 'var(--g9-on-surface-variant)'}\n />\n <text\n className=\"g9-edge-panel__row-text\"\n text-maxline=\"1\"\n style={{ color: item.textColor ?? 'var(--g9-on-surface)', ...g9TextStart(contentRtl ? 'rtl' : 'ltr') }}\n >\n {item.text ?? (item.localizedTextKey ? (resolve(item.localizedTextKey) ?? item.localizedTextKey) : '')}\n </text>\n {item.nextList && item.nextList.length > 0 ? (\n <G9IconSlot\n icon={contentRtl ? glyphs.chevronBack : glyphs.chevronForward}\n size={18}\n color=\"var(--g9-on-surface-variant)\"\n />\n ) : null}\n </view>\n {item.showDividerBelow ? <view className=\"g9-edge-panel__divider\" /> : null}\n </view>\n ))}\n </view>\n ) : null;\n\n return (\n <view className=\"g9-edge-panel__body\" style={{ direction: contentRtl ? 'rtl' : 'ltr' }}>\n {!isEdgeMenuHeaderEmpty(header) ? (\n <view className=\"g9-edge-panel__header\" style={headerPadding}>\n {(header as G9EdgeMenuHeader).view != null ? (\n (header as G9EdgeMenuHeader).view\n ) : (\n <text className=\"g9-edge-panel__title\" style={{ textAlign }}>\n {headerText(header as G9EdgeMenuHeader, resolve)}\n </text>\n )}\n </view>\n ) : null}\n <scroll-view className=\"g9-edge-panel__scroll\" scroll-orientation=\"vertical\">\n {content}\n </scroll-view>\n </view>\n );\n}\n"],"names":["createEdgePanelController","target","items","header","next","useEdgePanel","ref","useRef","panelSequence","G9EdgePanel","props","_props_defaultOpen","_ref","_ref1","_props_menuHeader","_props_useBackdrop","keyRef","key","isOpen","setOpen","useControllableState","openMs","g9Ms","M","closeMs","phase","setPhase","useState","latest","openRef","useEffect","_latest_current","p","enter","startTimer","done","stopTimer","navigator","useMemo","G9EdgeMenuNavigator","setNavVersion","renderNav","rootHeader","_props_controller","open","useG9Back","core","useG9Core","lastInteraction","Number","accept","now","animating","onTab","useBackdrop","onBackdrop","_props_enableOutsideTapToClose","overlay","EdgePanelOverlay","visible","useG9LayerItem","o","_p_side","_p_contentFlowDirection","_p_widthRatio","_p_topGap","_p_maxPanelHeight","_p_maxPanelHeightRatio","_p_useBackdrop","_p_closeButtonPlacement","_p_collapsedTabIcon","_p_panelBackgroundColor","_p_tabBackgroundColor","_p_tabBackgroundColor1","win","useG9Window","appRtl","useG9Direction","glyphs","useG9Settings","left","direction","contentRtl","width","Math","topGap","maxHeight","resolveEdgePanelMaxHeight","shown","cardRendered","hiddenOffset","edge","far","placement","closeStyle","tabIcon","view","PanelBody","G9IconSlot","headerText","resolve","_resolve","_p_menuHeader","_p_menuHeaderAlignment","strings","useG9Strings","diagnostics","useG9Diagnostics","nav","frame","alignment","textAlign","footprint","headerPadding","entered","setEntered","version","t","sign","onRow","item","error","_item_subMenuHeader","content","g9RowStyle","text","G9StringKey","i","_item_backgroundColor","_item_iconColor","_item_textColor","_item_text","undefined","g9TextStart","isEdgeMenuHeaderEmpty","scroll-view"],"mappings":";;;;;;;;;;AAuDO,SAASA;IACd,IAAIC,SAAmC;IACvC,OAAO;QACL,MAAM,IAAMA,QAAAA,SAAAA,KAAAA,IAAAA,OAAQ,OAAO,CAAC;QAC5B,OAAO,IAAMA,QAAAA,SAAAA,KAAAA,IAAAA,OAAQ,OAAO,CAAC;QAC7B,QAAQ,IAAMA,QAAAA,SAAAA,KAAAA,IAAAA,OAAQ,OAAO,CAA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AACwB,KAAK,gBAAgB,IAAIxB,KAAK,UAAU,6BAA8B,KAAK;UAC9E,EAAEA;OACD;MACL,EAAEA,QACA;IAEN,QACGA,KAAK,UAAU,sBAAsB,OAAO;QAAE,WAAWd,aAAa,QAAQ;IAAM,GAAG;MACtF,CAAC,CAACoD,sBAAsBnI,WACrB6F,KAAK,UAAU,wBAAwB,OAAOiB,eAAe;UAC5D,CAAE9G,AAAoC,QAApCA,OAA4B,IAAI,GAC/BA,OAA4B,IAAI,IAEhC0H,KAAK,UAAU,uBAAuB,OAAO;QAAEd;IAAU,GAAG;cAC3D,CAACZ,WAAWhG,QAA4BiG,SAAS;YACnD,EAAEyB,MACF;QACJ,EAAE7B,QACA,KAAK;MACT,CAACuC,YAAY,UAAU,wBAAwB,mBAAmB,WAAW;QAC3E,CAACZ,QAAQ;MACX,EAAEY,YAAY;IAChB,EAAEvC;AAEN"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"edge-panel/helper.jsx","sources":["../../src/edge-panel/helper.tsx"],"sourcesContent":["import './edge-panel.css';\nimport { type ReactNode, useSyncExternalStore } from '@lynx-js/react';\nimport { startTimer } from '../base/timers';\nimport { useG9Host } from '../host/hooks';\nimport { type G9HostHandle, g9Hosts } from '../host/registry';\nimport {\n createEdgePanelController,\n G9EdgePanel,\n type G9EdgePanelController,\n type G9EdgePanelProps,\n} from './edge-panel';\nimport { type G9EdgeMenuItem, type G9EdgePanelOptions, g9EdgePanelMetrics } from './types';\n\n/** The helper-managed panel service of a host (MAUI `G9EdgePanelHelper`). One helper panel at a time. */\nexport interface G9EdgePanelService {\n /** Attaches a panel with custom content; only the peek tab shows unless `autoOpen` (MAUI `ShowCustomView`). */\n showCustomView(content: ReactNode, options?: G9EdgePanelOptions): G9EdgePanelController;\n /** Attaches a panel with a navigable list menu (MAUI `ShowListMenu`). */\n showListMenu(items: readonly G9EdgeMenuItem[], options?: G9EdgePanelOptions): G9EdgePanelController;\n /** Slides the active panel closed, then removes it (MAUI `Dismiss`). */\n dismiss(): void;\n /** The active helper panel, or `null` (MAUI `ActivePanel`). */\n readonly activePanel: G9EdgePanelController | null;\n /** Closes an open, mounted helper panel; `true` when the press was consumed (MAUI `HandleHardwareBackPressed`). */\n handleHardwareBackPressed(): boolean;\n}\n\ninterface Active {\n readonly id: number;\n readonly controller: G9EdgePanelController;\n readonly props: G9EdgePanelProps;\n}\n\ninterface State {\n active: Active | null;\n sequence: number;\n readonly listeners: Set<() => void>;\n service: G9EdgePanelService;\n}\n\nconst FEATURE = 'g9.edgePanels';\n\n/** Maps helper options onto panel props (MAUI `CreatePanel`): unset options keep the panel defaults. */\nexport function edgePanelPropsFromOptions(options: G9EdgePanelOptions = {}): G9EdgePanelProps {\n const o = options;\n const out: Record<string, unknown> = {\n showCollapsedTab: o.showCollapsedTab ?? true,\n defaultOpen: o.autoOpen ?? false,\n };\n const copy: Array<keyof G9EdgePanelOptions & keyof G9EdgePanelProps> = [\n 'side',\n 'widthRatio',\n 'topGap',\n 'maxPanelHeight',\n 'maxPanelHeightRatio',\n 'animationDuration',\n 'openAnimationDuration',\n 'closeAnimationDuration',\n 'enableOutsideTapToClose',\n 'useBackdrop',\n 'panelBackgroundColor',\n 'tabBackgroundColor',\n 'contentFlowDirection',\n 'menuHeader',\n 'menuHeaderAlignment',\n 'collapsedTabIcon',\n 'closeButtonPlacement',\n ];\n for (const key of copy) if (o[key] !== undefined && o[key] !== null) out[key] = o[key];\n return out as G9EdgePanelProps;\n}\n\nfunction HelperLayer(props: { readonly state: State }): ReactNode {\n const active = useSyncExternalStore(\n (listener) => {\n props.state.listeners.add(listener);\n return () => props.state.listeners.delete(listener);\n },\n () => props.state.active,\n );\n if (!active) return null;\n return <G9EdgePanel key={active.id} {...active.props} controller={active.controller} />;\n}\n\nfunction createService(host: G9HostHandle): State {\n const state: State = { active: null, sequence: 0, listeners: new Set(), service: null as never };\n const publish = (active: Active | null) => {\n state.active = active;\n for (const listener of Array.from(state.listeners)) listener();\n };\n const attach = (props: G9EdgePanelProps): G9EdgePanelController => {\n state.sequence += 1;\n const controller = createEdgePanelController();\n publish({ id: state.sequence, controller, props });\n return controller;\n };\n state.service = {\n showCustomView: (content, options) => attach({ ...edgePanelPropsFromOptions(options), panelContent: content }),\n showListMenu: (items, options) => attach({ ...edgePanelPropsFromOptions(options), menuItems: items }),\n dismiss() {\n const active = state.active;\n if (!active) return;\n active.controller.close();\n const close =\n active.props.closeAnimationDuration ??\n active.props.animationDuration ??\n g9EdgePanelMetrics.defaultCloseAnimationDurationMs;\n startTimer(() => {\n if (state.active === active) publish(null);\n }, close);\n },\n get activePanel() {\n return state.active?.controller ?? null;\n },\n handleHardwareBackPressed() {\n const controller = state.active?.controller;\n if (!controller?.isMounted || host.released) return false;\n return controller.handleHardwareBackPressed();\n },\n };\n host.attachFeature(FEATURE, state);\n host.registerLayerItem('edgePanel', { key: FEATURE, element: <HelperLayer state={state} />, order: 1 });\n return state;\n}\n\n/** The helper panel service of a host (created once as a host feature). */\nexport function edgePanelServiceOf(host: G9HostHandle): G9EdgePanelService {\n const existing = host.getFeature(FEATURE) as State | undefined;\n return (existing ?? createService(host)).service;\n}\n\n/** The helper panels of the nearest `G9Host`. */\nexport function useG9EdgePanels(): G9EdgePanelService {\n return edgePanelServiceOf(useG9Host());\n}\n\n/** The helper panels of the active host, for code outside components. Throws `host-missing` without a host. */\nexport function g9EdgePanels(): G9EdgePanelService {\n return edgePanelServiceOf(g9Hosts.require());\n}\n"],"names":["FEATURE","edgePanelPropsFromOptions","options","_o_showCollapsedTab","_o_autoOpen","o","out","copy","key","undefined","HelperLayer","props","active","useSyncExternalStore","listener","G9EdgePanel","createService","host","state","Set","publish","Array","attach","controller","createEdgePanelController","content","items","_ref","close","g9EdgePanelMetrics","startTimer","_state_active","edgePanelServiceOf","existing","useG9EdgePanels","useG9Host","g9EdgePanels","g9Hosts"],"mappings":";;;;;;;AAwCA,MAAMA,UAAU;AAGT,SAASC,0BAA0BC,UAA8B,CAAC,CA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,KAAI,EAAG,OAAO;AAClD;AAGO,SAASiB;IACd,OAAOF,mBAAmBG;AAC5B;AAGO,SAASC;IACd,OAAOJ,mBAAmBK,QAAQ,OAAO;AAC3C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"edge-panel/types.jsx","sources":["../../src/edge-panel/types.ts"],"sourcesContent":["import type { G9ImageSource } from '@g9tm/lynxcontrols-foundation';\nimport type { ReactNode } from '@lynx-js/react';\nimport type { G9IconInput } from '../icon/icon';\n\n/** The screen edge a panel attaches to (MAUI `G9EdgeSide`): an absolute edge, never flipped by RTL. */\nexport type G9EdgeSide = 'left' | 'right';\n/** Where the open panel's close button sits (MAUI `G9EdgeCloseButtonPlacement`). */\nexport type G9EdgeCloseButtonPlacement = 'inset' | 'onCorner';\n/** Title alignment (MAUI `G9EdgeMenuHeaderAlignment`): `auto` = the content direction's leading edge. */\nexport type G9EdgeMenuHeaderAlignment = 'auto' | 'leftToRight' | 'rightToLeft' | 'center';\n/** Direction of the panel's content (MAUI `G9EdgePanelContentDirection`). */\nexport type G9EdgePanelContentDirection = 'matchApplication' | 'leftToRight' | 'rightToLeft';\n\n/** The title above the menu rows (MAUI `G9EdgeMenuHeader`): exactly one of text, a string key, or a view. */\nexport interface G9EdgeMenuHeader {\n readonly text?: string | null;\n /** Resolved through the app's string provider (`strings.resolve`); the key itself when there is no entry. */\n readonly localizationKey?: string | null;\n /** A custom header view (takes precedence). */\n readonly view?: ReactNode;\n}\n\n/** Header factories (MAUI `G9EdgeMenuHeader.FromText` / `FromDictionaryKey` / `FromView`). */\nexport const g9EdgeMenuHeader = Object.freeze({\n fromText: (text: string): G9EdgeMenuHeader => ({ text }),\n fromDictionaryKey: (localizationKey: string): G9EdgeMenuHeader => ({ localizationKey }),\n fromView: (view: ReactNode): G9EdgeMenuHeader => ({ view }),\n});\n\n/** `true` when the header shows nothing (MAUI `IsEmpty`). */\nexport function isEdgeMenuHeaderEmpty(header: G9EdgeMenuHeader | null | undefined): boolean {\n if (!header) return true;\n return header.view == null && !header.text && !header.localizationKey;\n}\n\n/** One row of the panel's list menu (MAUI `G9EdgeMenuItem`). */\nexport interface G9EdgeMenuItem {\n readonly icon?: G9IconInput;\n /** Image path (`http(s)://…` is a URI, else a bundled asset). */\n readonly imageSource?: string | null;\n readonly image?: G9ImageSource | null;\n /** Emoji, used when no icon or image is set. */\n readonly emoji?: string | null;\n /** Display text; wins over `localizedTextKey`. */\n readonly text?: string | null;\n /** String key resolved through the app's provider when `text` is unset. */\n readonly localizedTextKey?: string | null;\n /** A nested list: tapping the row shows it, with a Back row on top. */\n readonly nextList?: readonly G9EdgeMenuItem[] | null;\n /** Header shown while `nextList` is displayed. */\n readonly subMenuHeader?: G9EdgeMenuHeader | null;\n readonly backgroundColor?: string | null;\n readonly textColor?: string | null;\n readonly iconColor?: string | null;\n /** Runs first on a tap (MAUI `Clicked`). */\n readonly onClick?: (item: G9EdgeMenuItem) => void;\n /** Runs after `onClick` (MAUI `Command` / `CommandParameter`). */\n readonly command?: (parameter: unknown) => void;\n readonly commandParameter?: unknown;\n /** Test identifier, set as the row's `id` (MAUI `AutomationId`). */\n readonly automationId?: string;\n readonly showDividerBelow?: boolean;\n /** Disabled rows are dimmed (0.5) and ignore taps. Default true. */\n readonly isEnabled?: boolean;\n /** Close the panel after the row's callbacks (leaf rows only; a `nextList` row navigates instead). */\n readonly closeAfterClick?: boolean;\n}\n\n/** Builds a row (MAUI `new G9EdgeMenuItem()`, `(text)`, `(text, icon)`). */\nexport function g9EdgeMenuItem(text?: string, icon?: G9IconInput, extra: Partial<G9EdgeMenuItem> = {}): G9EdgeMenuItem {\n return { ...(text !== undefined ? { text } : {}), ...(icon !== undefined ? { icon } : {}), ...extra };\n}\n\n/** Panel options (MAUI `G9EdgePanelOptions`): every field optional; unset fields keep the panel defaults. */\nexport interface G9EdgePanelOptions {\n readonly side?: G9EdgeSide;\n readonly widthRatio?: number;\n readonly topGap?: number;\n readonly maxPanelHeight?: number;\n readonly maxPanelHeightRatio?: number;\n /** Sets both durations; the specific ones below win. */\n readonly animationDuration?: number;\n readonly openAnimationDuration?: number;\n readonly closeAnimationDuration?: number;\n readonly enableOutsideTapToClose?: boolean;\n readonly useBackdrop?: boolean;\n /** Default true for helper panels (false for a declared panel). */\n readonly showCollapsedTab?: boolean;\n /** Open right away instead of showing only the collapsed tab. Default false. */\n readonly autoOpen?: boolean;\n readonly panelBackgroundColor?: string | null;\n readonly tabBackgroundColor?: string | null;\n readonly contentFlowDirection?: G9EdgePanelContentDirection;\n readonly menuHeader?: G9EdgeMenuHeader | null;\n readonly menuHeaderAlignment?: G9EdgeMenuHeaderAlignment;\n readonly collapsedTabIcon?: G9IconInput;\n readonly closeButtonPlacement?: G9EdgeCloseButtonPlacement;\n}\n\n/** Sizing constants (MAUI `G9EdgePanelMetrics`). */\nexport const g9EdgePanelMetrics = Object.freeze({\n tabCollapsedWidth: 48,\n tabCollapsedHeight: 64,\n tabExpandedSize: 40,\n tabCornerRadius: 18,\n defaultWidthRatio: 0.35,\n defaultTopGap: 112,\n defaultMaxPanelHeightRatio: 0.69,\n defaultMaxPanelHeightAbsolute: 560,\n panelCornerRadius: 24,\n panelStrokeThickness: 1,\n defaultOpenAnimationDurationMs: 450,\n defaultCloseAnimationDurationMs: 450,\n tabEntranceDurationMs: 320,\n collapsedExtraOffset: 10,\n wallOverlap: 2,\n interactionDebounceMs: 220,\n expandedTabInset: 56,\n tabTopInset: 12,\n tabIconSize: 20,\n menuItemHeight: 52,\n menuItemIconSize: 22,\n menuItemEmojiSize: 20,\n menuItemImageSize: 28,\n menuItemSpacing: 8,\n menuItemCornerRadius: 12,\n backItemHeight: 44,\n menuTransitionDurationMs: 220,\n panelHeightAnimationDurationMs: 240,\n backdropAlpha: 0.18,\n edgeSpacing: 16,\n});\n\n/** The panel's height cap (MAUI `ResolveMaxPanelHeight`): min(ratio × host, absolute cap, room below `topGap`). */\nexport function resolveEdgePanelMaxHeight(\n hostHeight: number,\n topGap: number,\n maxPanelHeight: number,\n maxPanelHeightRatio: number,\n): number {\n const m = g9EdgePanelMetrics;\n let available = hostHeight - topGap - m.edgeSpacing;\n if (!Number.isFinite(available) || available <= 0) {\n available = hostHeight > 0 ? hostHeight * m.defaultMaxPanelHeightRatio : m.defaultMaxPanelHeightAbsolute;\n }\n const ratio =\n Number.isFinite(maxPanelHeightRatio) && maxPanelHeightRatio > 0 && maxPanelHeightRatio <= 1\n ? maxPanelHeightRatio\n : m.defaultMaxPanelHeightRatio;\n const fromAbsolute = maxPanelHeight > 0 ? maxPanelHeight : Number.POSITIVE_INFINITY;\n const cap = Math.min(hostHeight * ratio, fromAbsolute, available);\n return Math.max(m.tabCollapsedHeight, cap);\n}\n\n/** One level of the list menu. */\nexport interface G9EdgeMenuFrame {\n readonly items: readonly G9EdgeMenuItem[];\n readonly header: G9EdgeMenuHeader | null;\n}\n\n/** Direction the menu content slides when the level changes (MAUI `G9MenuTransitionDirection`). */\nexport type G9EdgeMenuTransition = 'forward' | 'back' | 'none';\n\n/**\n * The nested list navigation of a panel (MAUI `_menuStack` + `ShowMenuList`): the visible level, the parents to go\n * back to, and a version that bumps on every change so a view re-renders (`refresh` after in-place item edits).\n */\nexport class G9EdgeMenuNavigator {\n private stack: G9EdgeMenuFrame[] = [];\n private current: G9EdgeMenuFrame | null = null;\n private transitionValue: G9EdgeMenuTransition = 'none';\n private versionValue = 0;\n\n /** Shows `root` as the root level (a new `menuItems` list or header resets the stack). */\n setRoot(items: readonly G9EdgeMenuItem[] | null | undefined, header: G9EdgeMenuHeader | null): void {\n this.stack = [];\n this.current = items && items.length > 0 ? { items, header } : null;\n this.bump('none');\n }\n\n /** Pushes the visible level and shows `items` (MAUI `NavigateToSubList`). */\n navigateToSubList(items: readonly G9EdgeMenuItem[], header: G9EdgeMenuHeader | null = null): void {\n if (this.current) this.stack.push(this.current);\n this.current = { items, header };\n this.bump('forward');\n }\n\n /** Back one level; `false` at the root. */\n back(): boolean {\n const frame = this.stack.pop();\n if (!frame) return false;\n this.current = frame;\n this.bump('back');\n return true;\n }\n\n /** Straight back to the root level (MAUI `NavigateToRoot`). */\n navigateToRoot(): void {\n if (this.stack.length === 0) return;\n this.current = this.stack[0] as G9EdgeMenuFrame;\n this.stack = [];\n this.bump('back');\n }\n\n /** Re-renders the visible level (MAUI `RefreshMenuItems`). */\n refresh(): void {\n if (this.current) this.bump('none');\n }\n\n get frame(): G9EdgeMenuFrame | null {\n return this.current;\n }\n\n get isRoot(): boolean {\n return this.stack.length === 0;\n }\n\n get depth(): number {\n return this.stack.length;\n }\n\n get transition(): G9EdgeMenuTransition {\n return this.transitionValue;\n }\n\n get version(): number {\n return this.versionValue;\n }\n\n private bump(transition: G9EdgeMenuTransition): void {\n this.transitionValue = transition;\n this.versionValue += 1;\n }\n}\n"],"names":["g9EdgeMenuHeader","Object","text","localizationKey","view","isEdgeMenuHeaderEmpty","header","g9EdgeMenuItem","icon","extra","undefined","g9EdgePanelMetrics","resolveEdgePanelMaxHeight","hostHeight","topGap","maxPanelHeight","maxPanelHeightRatio","m","available","Number","ratio","fromAbsolute","cap","Math","G9EdgeMenuNavigator","items","frame","transition"],"mappings":";;;;;;;;;;AAuBO,MAAMA,mBAAmBC,OAAO,MAAM,CAAC;IAC5C,UAAU,CAACC,OAAoC;YAAEA;QAAK;IACtD,mBAAmB,CAACC,kBAA+C;YAAEA;QAAgB;IACrF,UAAU,CAACC,OAAuC;YAAEA;QAAK;AAC3D;AAGO,SAASC,sBAAsBC,MAA2C;IAC/E,IAAI,CAACA,QAAQ,OAAO;IACpB,OAAOA,AAAe,QAAfA,OAAO,IAAI,IAAY,CAACA,OAAO,IAAI,IAAI,CAACA,OAAO,eAAe;AACvE;AAoCO,SAASC,eAAeL,IAAa,EAAEM,IAAkB,EAAEC,QAAiC,CAAC,CAAC;IACnG,OAAO;QAAE,GAAIP,AAASQ,WAATR,OAAqB;YAAEA;QAAK,IAAI,CAAC,CAAC;QAAG,GAAIM,AAASE,WAATF,OAAqB;YAAEA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uBAAQ,gBAAe;;AA8DzB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"expander/expander.jsx","sources":["../../src/expander/expander.tsx"],"sourcesContent":["import './expander.css';\nimport type { G9ImageSource } from '@g9tm/lynxcontrols-foundation';\nimport { g9Ms } from '@g9tm/lynxcontrols-foundation';\nimport { forwardRef, type ReactNode, useEffect, useImperativeHandle, useRef, useState } from '@lynx-js/react';\nimport { type G9ControlBaseProps, g9ChildId, g9IdProps, g9RowStyle, useG9Control } from '../base/control';\nimport { useG9Press, usePressVisual } from '../base/press';\nimport { type G9TimerHandle, startTimer, stopTimer } from '../base/timers';\nimport { useControllableState } from '../base/use-controllable-state';\nimport { g9FieldNotchStyle } from '../fields/notch';\nimport type { G9IconInput } from '../icon/icon';\nimport { G9IconSlot, hasIconSlot } from '../icon/slot';\nimport { useG9Settings, useG9Theme } from '../provider/hooks';\n\n/** Expand/collapse duration (MAUI `G9Metrics` expander 220 ms). */\nexport const g9ExpanderDurationMs = 220;\n\n/** Props of {@link G9Expander} (MAUI `G9Expander`). */\nexport interface G9ExpanderProps extends G9ControlBaseProps {\n readonly title?: string | null;\n /** Default `var(--g9-text-primary)`. */\n readonly titleColor?: string | null;\n readonly iconEmoji?: string | null;\n readonly icon?: G9IconInput;\n readonly iconPath?: string | null;\n readonly iconImage?: G9ImageSource | null;\n /** Default `var(--g9-text-primary)`. */\n readonly iconColor?: string | null;\n /** Default `var(--g9-text-secondary)`. */\n readonly chevronColor?: string | null;\n /** Controlled open state (MAUI `IsExpanded`). */\n readonly expanded?: boolean;\n readonly defaultExpanded?: boolean;\n /** Once per change made by the expander (header tap, `toggle()`); never for pushed values. */\n readonly onExpandedChange?: (expanded: boolean) => void;\n /** Card look: surface, 1 px outline, 16 px corners, 14 × 12 padding. Default false. */\n readonly showFrame?: boolean;\n /** Minimum header height. Default 48. */\n readonly headerHeight?: number;\n /** Content padding `[left, top, right, bottom]` (an 8 px top gap is always added). Default 0. */\n readonly contentPadding?: readonly [number, number, number, number];\n /** The content (MAUI `ExpanderContent`): mounted at once and kept, hidden while collapsed. */\n readonly children?: ReactNode;\n}\n\n/** Imperative handle of {@link G9Expander}. */\nexport interface G9ExpanderHandle {\n /** Same as a header tap (MAUI `Toggle`). */\n toggle(): void;\n}\n\ntype Phase = 'open' | 'opening' | 'closing' | 'closed';\n\n/**\n * Collapsible section (MAUI `G9Expander`): only the header toggles; the chevron turns 180° and the content height\n * animates over 220 ms (CSS transition on the measured height; instant when it cannot be measured). The first render\n * does not animate. The content stays mounted.\n */\nexport const G9Expander = forwardRef<G9ExpanderHandle, G9ExpanderProps>(function G9Expander(props, ref): ReactNode {\n const control = useG9Control(props, 'g9-expander', {\n kind: 'view',\n label: () => props.accessibilityLabel ?? props.title,\n capabilities: {\n activate: () => press(),\n getValue: () => String(expanded),\n expand: (open) => {\n if (open !== expanded) press();\n },\n },\n });\n const glyphs = useG9Settings().glyphs;\n // A framed expander is a Surface card: fields inside notch their floated label with it.\n const palette = useG9Theme().palette;\n const [expanded, setExpanded] = useControllableState<boolean>({\n value: props.expanded,\n defaultValue: props.defaultExpanded ?? false,\n onChange: props.onExpandedChange,\n name: 'G9Expander.expanded',\n });\n const [phase, setPhase] = useState<Phase>(expanded ? 'open' : 'closed');\n const [measured, setMeasured] = useState(0);\n const timer = useRef<G9TimerHandle | null>(null);\n const first = useRef(true);\n useEffect(() => {\n if (first.current) {\n first.current = false;\n return;\n }\n if (timer.current !== null) stopTimer(timer.current);\n if (measured <= 0) {\n setPhase(expanded ? 'open' : 'closed');\n return;\n }\n setPhase(expanded ? 'opening' : 'closing');\n timer.current = startTimer(() => {\n timer.current = null;\n setPhase(expanded ? 'open' : 'closed');\n }, g9Ms(g9ExpanderDurationMs));\n }, [expanded]);\n useEffect(\n () => () => {\n if (timer.current !== null) stopTimer(timer.current);\n },\n [],\n );\n\n const toggle = () => {\n if (!control.disabled) setExpanded((v) => !v);\n };\n useImperativeHandle(ref, () => ({ toggle }));\n const press = useG9Press(toggle, { blocked: control.disabled, source: 'G9Expander', guardMs: 0 });\n const visual = usePressVisual({ property: 'scale', rest: 1, pressed: 0.99, inMs: 60, outMs: 90 }, control.disabled);\n const icon = { emoji: props.iconEmoji, icon: props.icon, imagePath: props.iconPath, image: props.iconImage };\n const [pl, pt, pr, pb] = props.contentPadding ?? [0, 0, 0, 0];\n const height = phase === 'open' ? undefined : phase === 'opening' ? `${measured}px` : '0px';\n return (\n <view\n className={`${control.className}${props.showFrame ? ' g9-expander--frame' : ''}`}\n {...control.idProps}\n style={props.showFrame ? g9FieldNotchStyle(palette.Surface) : {}}\n >\n <view\n className=\"g9-expander__header\"\n {...g9IdProps(g9ChildId(props.id, 'Header'))}\n style={{ minHeight: `${props.headerHeight ?? 48}px`, ...g9RowStyle(control.direction) }}\n accessibility-element={true}\n accessibility-traits=\"button\"\n {...(props.title ? { 'accessibility-label': props.title } : {})}\n bindtap={press}\n {...visual}\n >\n <view className=\"g9-expander__lead\" style={g9RowStyle(control.direction)}>\n {hasIconSlot(icon) ? (\n <G9IconSlot {...icon} size={20} color={props.iconColor ?? 'var(--g9-text-primary)'} />\n ) : null}\n {props.title ? (\n <text\n className=\"g9-expander__title\"\n text-maxline=\"1\"\n style={{ color: props.titleColor ?? 'var(--g9-text-primary)' }}\n >\n {props.title}\n </text>\n ) : null}\n </view>\n <view className={`g9-expander__chevron${expanded ? ' g9-expander__chevron--open' : ''}`}>\n <G9IconSlot icon={glyphs.chevron} size={22} color={props.chevronColor ?? 'var(--g9-text-secondary)'} />\n </view>\n </view>\n <view className={`g9-expander__clip g9-expander__clip--${phase}`} style={height === undefined ? {} : { height }}>\n <view\n className=\"g9-expander__content\"\n style={{ padding: `${pt + 8}px ${pr}px ${pb}px ${pl}px` }}\n bindlayoutchange={(e: { detail?: { height?: number } }) => {\n const h = e.detail?.height ?? 0;\n if (h > 0 && h !== measured) setMeasured(h);\n }}\n >\n {props.children}\n </view>\n </view>\n </view>\n );\n});\n"],"names":["g9ExpanderDurationMs","G9Expander","forwardRef","props","ref","_props_defaultExpanded","_props_contentPadding","_props_headerHeight","_props_iconColor","_props_titleColor","_props_chevronColor","control","useG9Control","_props_accessibilityLabel","press","String","expanded","open","glyphs","useG9Settings","palette","useG9Theme","setExpanded","useControllableState","phase","setPhase","useState","measured","setMeasured","timer","useRef","first","useEffect","stopTimer","startTimer","g9Ms","toggle","v","useImperativeHandle","useG9Press","visual","usePressVisual","icon","pl","pt","pr","pb","height","undefined","view","g9FieldNotchStyle","g9IdProps","g9ChildId","g9RowStyle","hasIconSlot","G9IconSlot","text","e","_e_detail","h"],"mappings":";;;;;;;;;;AAcO,MAAMA,uBAAuB;AA2C7B,MAAMC,sBAAaC,WAA8C,SAAoBC,KAAK,EAAEC,GAAG;QAiBpFC,wBAsCSC,uBAWIC,qBASoBC,kBAMrBC,mBAO+BC;IAvF3D,MAAMC,UAAUC,aAAaT,OAAO,eAAe;QACjD,MAAM;QACN,OAAO;gBAAMU;2BAAAA,CAAAA,4BAAAA,MAAM,kBAAkB,AAAD,IAAvBA,4BAA4BV,MAAM,KAAK;;QACpD,cAAc;YACZ,UAAU,IAAMW;YAChB,UAAU,IAAMC,OAAOC;YACvB,QAAQ,CAACC;gBACP,IAAIA,SAASD,UAAUF;YACzB;QACF;IACF;IACA,MAAMI,SAASC,gBAAgB,MAAM;IAErC,MAAMC,UAAUC,aAAa,OAAO;IACpC,MAAM,CAACL,UAAUM,YAAY,GAAGC,qBAA8B;QAC5D,OAAOpB,MAAM,QAAQ;QACrB,cAAc,QAAAE,CAAAA,yBAAAA,MAAM,eAAe,AAAD,IAApBA,yBAAyB;QACvC,UAAUF,MAAM,gBAAgB;QAChC,MAAM;IACR;IACA,MAAM,CAACqB,OAAOC,SAAS,GAAGC,SAAgBV,WAAW,SAAS;IAC9D,MAAM,CAACW,UAAUC,YAAY,GAAGF,SAAS;IACzC,MAAMG,QAAQC,OAA6B;IAC3C,MAAMC,QAAQD,OAAO;IACrBE,UAAU;QACR,IAAID,M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B,AAAWC,WAAXD,SAAuB,CAAC,IAAI;QAAEA;IAAO,GAAG;QAC/G,CAACE,KACC,UAAU,uBACV,OAAO;QAAE,SAAS,GAAGL,KAAK,EAAE,GAAG,EAAEC,GAAG,GAAG,EAAEC,GAAG,GAAG,EAAEH,GAAG,EAAE,CAAC;IAAC,GACxD,kBAAkB,CAACc;;YACPC;QAAV,MAAMC,IAAI,QAAJA,CAAAA,OAAAA,QAAID,CAAAA,YAAAA,EAAE,MAAM,AAAD,IAAPA,KAAAA,IAAAA,UAAU,MAAM,AAAD,IAAC,OAAI;QAC9B,IAAIC,IAAI,KAAKA,MAAMhC,UAAUC,YAAY+B;IAC3C,GACD;UACC,CAACxD,MAAM,QAAQ,CAAC;QAClB,EAAE8C,KAAK;MACT,EAAEA,KAAK;IACT,EAAEA;AAEN"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fields/dictation.jsx","sources":["../../src/fields/dictation.ts"],"sourcesContent":["import {\n createAbortController,\n type G9AbortController,\n type G9SpeechToText,\n G9StringKey,\n type G9Strings,\n} from '@g9tm/lynxcontrols-foundation';\n\n// MAUI `G9VoiceDictation` (Localization/G9VoiceDictation.cs): one dictation session per field. Everything a session\n// owns (its base text and its cancellation) lives on one object, and every path that writes or ends for a session\n// first checks it is still the current one: a second tap while the permission prompt is up cannot start a second\n// session over the first, and a partial result delivered after its session ended is dropped.\n\n/** What a {@link G9VoiceDictation} reads and writes. */\nexport interface G9VoiceDictationOptions {\n /** The recogniser (`services.speech`); `undefined` makes every start fail with `speechRecognitionUnavailable`. */\n readonly speech: G9SpeechToText | undefined;\n /** Reads the field's current text (the session's base text). */\n readonly readText: () => string | null | undefined;\n /** Writes recognised text into the field (`base + ' ' + transcript`). */\n readonly writeText: (text: string) => void;\n /** Called whenever `isListening` or the session changes (re-render). */\n readonly onStateChanged?: () => void;\n /** Strings for the failure messages. */\n readonly strings: () => Pick<G9Strings, 'get' | 'format'>;\n /** The locale to listen for (MAUI `Culture ?? G9Culture.CurrentCulture`). */\n readonly locale: () => string;\n readonly onListeningStarted?: () => void;\n readonly onListeningEnded?: () => void;\n /** A failure message the user should see (unavailable, permission denied, recogniser error). */\n readonly onFailed?: (message: string) => void;\n}\n\ninterface Session {\n readonly controller: G9AbortController;\n baseText: string;\n}\n\n/** A field's dictation session owner (MAUI `G9VoiceDictation`). Create one per field; see `useDictation`. */\nexport class G9VoiceDictation {\n private session: Session | null = null;\n private listening = false;\n private options: G9VoiceDictationOptions;\n\n constructor(options: G9VoiceDictationOptions) {\n this.options = options;\n }\n\n /** Replaces the callbacks (the hook passes the latest props on every render). */\n update(options: G9VoiceDictationOptions): void {\n this.options = options;\n }\n\n /** `true` while a session is listening (not while it waits for permission). */\n get isListening(): boolean {\n return this.listening;\n }\n\n /** `true` from a start until its session ends, the permission prompt included. */\n get hasSession(): boolean {\n return this.session !== null;\n }\n\n /** Stops a running session, starts one otherwise. */\n toggle(): Promise<void> {\n return this.listening ? this.stop() : this.start();\n }\n\n /** Starts a session. A second start while one exists (listening or awaiting permission) is ignored. */\n async start(): Promise<void> {\n if (this.session) return;\n const o = this.options;\n const speech = o.speech;\n if (!speech) {\n o.onFailed?.(o.strings().get(G9StringKey.SpeechRecognitionUnavailable));\n return;\n }\n const session: Session = { controller: createAbortController(), baseText: '' };\n this.session = session;\n o.onStateChanged?.();\n try {\n // Always re-checked: the permission may have been revoked between sessions.\n const status = await speech.requestPermission();\n if (status !== 'granted') {\n if (this.session === session) this.options.onFailed?.(this.text(G9StringKey.MicrophonePermissionDenied));\n this.end(session);\n return;\n }\n } catch (error) {\n if (this.session === session) {\n this.options.onFailed?.(this.options.strings().format(G9StringKey.PermissionErrorFormat, messageOf(error)));\n }\n this.end(session);\n return;\n }\n // Stopped (or replaced) while the prompt was up.\n if (this.session !== session) return;\n\n this.listening = true;\n session.baseText = this.options.readText() ?? '';\n this.options.onListeningStarted?.();\n this.options.onStateChanged?.();\n try {\n const result = await speech.listen({\n locale: this.options.locale(),\n signal: session.controller.signal,\n onPartialResult: (text) => this.apply(session, text),\n });\n if (this.session === session) {\n if (result.status === 'recognized') {\n if (result.text) this.apply(session, result.text);\n } else if (result.status === 'denied') {\n this.options.onFailed?.(this.text(G9StringKey.MicrophonePermissionDenied));\n } else if (result.status === 'no-match') {\n this.options.onFailed?.(this.text(G9StringKey.VoiceRecognitionFailed));\n }\n }\n } catch (error) {\n // A stop aborts the session; the recogniser may reject for that. Not a failure.\n if (this.session === session && !session.controller.signal.aborted) this.options.onFailed?.(messageOf(error));\n } finally {\n this.end(session);\n }\n }\n\n /** Stops the current session (cancels the prompt or the recogniser). Best effort; always ends the session. */\n async stop(): Promise<void> {\n const session = this.session;\n if (!session) return;\n try {\n session.controller.abort();\n } catch {\n // A listener that throws on abort must not leave the field stuck in its listening visual.\n }\n this.end(session);\n }\n\n private text(key: G9StringKey): string {\n return this.options.strings().get(key);\n }\n\n private apply(session: Session, transcript: string): void {\n if (this.session !== session) return;\n const base = session.baseText;\n this.options.writeText(base ? `${base} ${transcript}`.replace(/\\s+$/, '') : transcript);\n }\n\n private end(session: Session): void {\n if (this.session !== session) return;\n this.session = null;\n const wasListening = this.listening;\n this.listening = false;\n if (wasListening) this.options.onListeningEnded?.();\n this.options.onStateChanged?.();\n }\n}\n\nfunction messageOf(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n"],"names":["G9VoiceDictation","options","_this_options_readText","o","_this_options","_this_options1","speech","G9StringKey","session","createAbortController","status","_this_options2","error","_this_options3","messageOf","result","text","_this_options4","_this_options5","_this_options6","key","transcript","base","wasListening","Error","String"],"mappings":";;;;;;;;;;;AAuCO,MAAMA;IAUX,OAAOC,OAAgC,EAAQ;QAC7C,IAAI,CAAC,OAAO,GAAGA;IACjB;IAGA,IAAI,cAAuB;QACzB,OAAO,IAAI,CAAC,SAAS;IACvB;IAGA,IAAI,aAAsB;QACxB,OAAO,AAAiB,SAAjB,IAAI,CAAC,OAAO;IACrB;IAGA,SAAwB;QACtB,OAAO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AAgB,AAAD,KAA5BA,+BAAAA,IAAAA,CAAAA;gBAClBC,CAAAA,+BAAAA,AAAAA,CAAAA,iBAAAA,IAAI,CAAC,OAAO,AAAD,EAAE,cAAc,AAAD,KAA1BA,6BAAAA,IAAAA,CAAAA;IACF;IA9GA,YAAYJ,OAAgC,CAAE;QAJ9C,uBAAQ,WAA0B;QAClC,uBAAQ,aAAY;QACpB,uBAAQ,WAAR;QAGE,IAAI,CAAC,OAAO,GAAGA;IACjB;AA6GF;AAEA,SAASa,UAAUF,KAAc;IAC/B,OAAOA,iBAAiBY,QAAQZ,MAAM,OAAO,GAAGa,OAAOb;AACzD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fields/editor.jsx","sources":["../../src/fields/editor.tsx"],"sourcesContent":["import { G9Metrics } from '@g9tm/lynxcontrols-foundation';\nimport { forwardRef, type ReactNode, useImperativeHandle } from '@lynx-js/react';\nimport { useG9Settings } from '../provider/hooks';\nimport { G9OutlinedField, type G9TrailingAffordance, resolveInnerHint } from './outlined-field';\nimport { type G9TextInputHandle, type G9TextInputProps, useTextInput } from './use-text-input';\n\n/** How the editor grows (MAUI `EditorAutoSizeOption`). */\nexport type G9EditorAutoSize = 'disabled' | 'textChanges';\n\n/** Props of {@link G9Editor} (MAUI `G9Editor`). */\nexport interface G9EditorProps extends G9TextInputProps {\n /** Minimum height of the text area. Default 96. */\n readonly minimumEditorHeight?: number;\n /** Maximum height while growing; `0` (default) means unbounded. */\n readonly maxEditorHeight?: number;\n /** `'textChanges'` (default) grows with the text; `'disabled'` keeps `minimumEditorHeight`. */\n readonly autoSize?: G9EditorAutoSize;\n /** Spell checking (iOS `ios-spell-check`). Default true. */\n readonly isSpellCheckEnabled?: boolean;\n /** Word prediction / autocorrect (iOS `ios-auto-correct`). Default true. */\n readonly isTextPredictionEnabled?: boolean;\n}\n\n/** Imperative handle of {@link G9Editor}. */\nexport type G9EditorHandle = G9TextInputHandle;\n\n/**\n * Multi-line outlined text area (MAUI `G9Editor`): the text-entry behaviour on a `<textarea>`, a microphone pinned to\n * the bottom-end corner whenever dictation is available, height from `minimumEditorHeight`/`maxEditorHeight`/\n * `autoSize`. Validates on blur only for email/url/custom types (no `validator`, as in MAUI). Requires the host's\n * `xelement-input` registration.\n */\nexport const G9Editor = forwardRef<G9EditorHandle, G9EditorProps>(function G9Editor(props, ref): ReactNode {\n const glyphs = useG9Settings().glyphs;\n const core = useTextInput(props, { name: 'G9Editor.value', showMic: (s) => s.available });\n useImperativeHandle(ref, () => core.handle);\n const affordance: G9TrailingAffordance | null = core.showMic\n ? {\n icon: core.dictation.listening ? glyphs.micOff : glyphs.mic,\n color: core.dictation.listening ? 'var(--g9-error)' : 'var(--g9-primary)',\n signature: 'voice',\n onPress: core.pressMic,\n }\n : null;\n const min = props.minimumEditorHeight ?? 96;\n const max = props.maxEditorHeight ?? 0;\n const autoSize = props.autoSize ?? 'textChanges';\n return (\n <G9OutlinedField\n anchor={{\n kind: 'entry',\n label: () => props.label ?? props.placeholder,\n enabled: () => !props.disabled,\n capabilities: {\n getValue: () => core.text,\n setValue: (v: string) => {\n core.setText(v, { source: 'programmatic' });\n },\n focus: () => core.focus(),\n },\n }}\n {...props}\n hint={resolveInnerHint(props)}\n multiline\n hasError={core.hasError}\n errorText={core.errorText ?? null}\n focused={core.focused}\n hasValue={core.hasValue}\n textLength={core.text.length}\n trailingAffordance={affordance}\n onFocusRequest={core.focus}\n >\n <textarea\n {...core.elementProps}\n className=\"g9-field__textarea\"\n ios-spell-check={props.isSpellCheckEnabled !== false}\n ios-auto-correct={props.isTextPredictionEnabled !== false}\n style={{\n direction: core.textDirection,\n textAlign: core.textDirection === 'rtl' ? 'right' : 'left',\n ...(core.font ? { fontFamily: core.font } : {}),\n color: props.disabled ? 'var(--g9-text-disabled)' : 'var(--g9-text-primary)',\n ...(autoSize === 'disabled'\n ? { height: `${min}px` }\n : { minHeight: `${min}px`, ...(max > 0 ? { maxHeight: `${Math.max(min, max)}px` } : {}) }),\n paddingTop: `${G9Metrics.FloatingLabelClearance + 8}px`,\n paddingBottom: '8px',\n }}\n />\n </G9OutlinedField>\n );\n});\n"],"names":["G9Editor","forwardRef","props","ref","_props_minimumEditorHeight","_props_maxEditorHeight","_props_autoSize","_core_errorText","glyphs","useG9Settings","core","useTextInput","s","useImperativeHandle","affordance","min","max","autoSize","G9OutlinedField","_props_label","v","resolveInnerHint","textarea","Math","G9Metrics"],"mappings":";;;;;AAgCO,MAAMA,kBAAWC,WAA0C,SAAkBC,KAAK,EAAEC,GAAG;QAYhFC,4BACAC,wBACKC,iBAmBFC;IAhCf,MAAMC,SAASC,gBAAgB,MAAM;IACrC,MAAMC,OAAOC,aAAaT,OAAO;QAAE,MAAM;QAAkB,SAAS,CAACU,IAAMA,EAAE,SAAS;IAAC;IACvFC,oBAAoBV,KAAK,IAAMO,KAAK,MAAM;IAC1C,MAAMI,aAA0CJ,KAAK,OAAO,GACxD;QACE,MAAMA,KAAK,SAAS,CAAC,SAAS,GAAGF,OAAO,MAAM,GAAGA,OAAO,GAAG;QAC3D,OAAOE,KAAK,SAAS,CAAC,SAAS,GAAG,oBAAoB;QACtD,WAAW;QACX,SAASA,KAAK,QAAQ;IACxB,IACA;IACJ,MAAMK,MAAM,QAAAX,CAAAA,6BAAAA,MAAM,mBAAmB,AAAD,IAAxBA,6BAA6B;IACzC,MAAMY,MAAM,QAAAX,CAAAA,yBAAAA,MAAM,eAAe,AAAD,IAApBA,yBAAyB;IACrC,MAAMY,WAAW,QAAAX,CAAAA,kBAAAA,MAAM,QAAQ,AAAD,IAAbA,kBAAkB;IACnC,QACGY,gBACC,QAAQ;QACN,MAAM;QACN,OAAO;gBAAMC;2BAAAA,CAAAA,eAAAA,MAAM,KAAK,AAAD,IAAVA,eAAejB,MAAM,WAAW;;QAC7C,SAAS,IAAM,CAACA,MAAM,QAAQ;QAC9B,cAAc;YACZ,UAAU,IAAMQ,KAAK,IAAI;YACzB,UAAU,CAACU;gBACTV,KAAK,OAAO,CAACU,GAAG;oBAAE,QAAQ;gBAAe;YAC3C;YACA,OAAO,IAAMV,KAAK,KAAK;QACzB;IACF,IACC,GAAGR,KAAK,EACT,MAAMmB,iBAAiBnB,QACvB,UACA,UAAUQ,KAAK,QAAQ,EACvB,WAAW,QAAAH,CAAAA,kBAAAA,KAAK,SAAS,AAAD,IAAbA,kBAAkB,MAC7B,SAASG,KAAK,OAAO,EACrB,UAAUA,KAAK,QAAQ,EACvB,YAAYA,KAAK,IAAI,CAAC,MAAM,EAC5B,oBAAoBI,YACpB,gBAAgBJ,KAAK,KAAK,EAC3B;MACC,CAACY,UACE,GAAGZ,KAAK,YAAY,EACrB,UAAU,qBACV,iBAAiBR,AAA8B,UAA9BA,MAAM,mBAAmB,EAC1C,kBAAkBA,AAAkC,UAAlCA,MAAM,uBAAuB,EAC/C,OAAO;QACL,WAAWQ,KAAK,aAAa;QAC7B,WAAWA,AAAuB,UAAvBA,KAAK,aAAa,GAAa,UAAU;QACpD,GAAIA,KAAK,IAAI,GAAG;YAAE,YAAYA,KAAK,IAAI;QAAC,IAAI,CAAC,CAAC;QAC9C,OAAOR,MAAM,QAAQ,GAAG,4BAA4B;QACpD,GAAIe,AAAa,eAAbA,WACA;YAAE,QAAQ,GAAGF,IAAI,EAAE,CAAC;QAAC,IACrB;YAAE,WAAW,GAAGA,IAAI,EAAE,CAAC;YAAE,GAAIC,MAAM,IAAI;gBAAE,WAAW,GAAGO,KAAK,GAAG,CAACR,KAAKC,KAAK,EAAE,CAAC;YAAC,IAAI,CAAC,CAAC;QAAE,CAAC;QAC3F,YAAY,GAAGQ,UAAU,sBAAsB,GAAG,EAAE,EAAE,CAAC;QACvD,eAAe;IACjB,IACA;IACJ,EAAEN;AAEN"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fields/input-policy.jsx","sources":["../../src/fields/input-policy.ts"],"sourcesContent":["import {\n G9InputType,\n G9KeyboardType,\n type G9NumberingSystem,\n G9StringKey,\n type G9Strings,\n getNumberSymbols,\n normalizeToAscii,\n} from '@g9tm/lynxcontrols-foundation';\n\n// MAUI `G9InputTypePolicy` (Controls/Shared/G9InputType.cs): one input type drives the keyboard, the live keystroke\n// filter and the blur validation. Pure functions; the fields call them, tests pin them.\n\n/** `<input type>` values the Lynx `<input>` element accepts. */\nexport type G9LynxInputElementType = 'text' | 'number' | 'digit' | 'password' | 'tel' | 'email';\n\nconst ltrTypes: ReadonlySet<G9InputType> = new Set<G9InputType>([\n G9InputType.Number,\n G9InputType.Decimal,\n G9InputType.SignedNumber,\n G9InputType.SignedDecimal,\n G9InputType.Phone,\n G9InputType.Email,\n G9InputType.Url,\n]);\n\nconst asciiDigitOnlyTypes: ReadonlySet<G9InputType> = new Set<G9InputType>([\n G9InputType.Number,\n G9InputType.Decimal,\n G9InputType.SignedNumber,\n G9InputType.SignedDecimal,\n G9InputType.Phone,\n G9InputType.LettersAndNumbers,\n G9InputType.LettersNumbersSpace,\n]);\n\n/**\n * Whether values of this type are written left-to-right whatever the culture (numbers, phone numbers, email\n * addresses, URLs). Only the entered value and its caret are pinned; label, outline and icons follow the culture.\n */\nexport function inputTypePrefersLeftToRight(inputType: G9InputType): boolean {\n return ltrTypes.has(inputType);\n}\n\n/** The on-screen keyboard an input type implies (MAUI `G9InputTypePolicy.ResolveKeyboard`). */\nexport function resolveKeyboardForInputType(inputType: G9InputType): G9KeyboardType {\n switch (inputType) {\n case G9InputType.Number:\n case G9InputType.Decimal:\n case G9InputType.SignedNumber:\n case G9InputType.SignedDecimal:\n return G9KeyboardType.Number;\n case G9InputType.Phone:\n return G9KeyboardType.Phone;\n case G9InputType.Email:\n return G9KeyboardType.Email;\n case G9InputType.Url:\n return G9KeyboardType.Url;\n default:\n return G9KeyboardType.Default;\n }\n}\n\n/**\n * The keyboard a field shows: the input type's keyboard, or, for `'default'` input, the field's own `keyboardType`\n * (MAUI ignored `KeyboardType` for every input type; here it works for `'default'` and `'custom'`).\n * `'password'` maps to the default keyboard, as in MAUI.\n */\nexport function resolveEffectiveKeyboard(inputType: G9InputType, keyboardType: G9KeyboardType): G9KeyboardType {\n const ownKeyboard = inputType === G9InputType.Default || inputType === G9InputType.Custom;\n const resolved = ownKeyboard ? keyboardType : resolveKeyboardForInputType(inputType);\n return resolved === G9KeyboardType.Password ? G9KeyboardType.Default : resolved;\n}\n\n/**\n * The Lynx `<input type>` for a keyboard (the `G9InputType` → element mapping table in `docs/fields.md`). Lynx has no\n * URL keyboard, so `'url'` uses `'text'`; decimal and signed types use `'digit'` (a numeric pad with a separator).\n * A masked password is always `'password'`.\n */\nexport function resolveInputElementType(\n inputType: G9InputType,\n keyboard: G9KeyboardType,\n masked: boolean,\n): G9LynxInputElementType {\n if (masked) return 'password';\n switch (keyboard) {\n case G9KeyboardType.Number:\n return inputType === G9InputType.Number ? 'number' : 'digit';\n case G9KeyboardType.Phone:\n return 'tel';\n case G9KeyboardType.Email:\n return 'email';\n default:\n return 'text';\n }\n}\n\nconst isAsciiDigit = (c: string): boolean => c >= '0' && c <= '9';\nconst isLatinLetter = (c: string): boolean => (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');\nconst isPersianLetter = (c: string): boolean =>\n c >= '' && c <= 'ۿ' && !(c >= '٠' && c <= '٩') && !(c >= '۰' && c <= '۹');\nconst isPersianOrAsciiDigit = (c: string): boolean =>\n isAsciiDigit(c) || (c >= '٠' && c <= '٩') || (c >= '۰' && c <= '۹');\nconst isPhoneChar = (c: string): boolean =>\n isAsciiDigit(c) || c === '+' || c === '-' || c === ' ' || c === '(' || c === ')';\nconst isWhiteSpace = (c: string): boolean => /\\s/.test(c);\nconst isMultilingual = (c: string): boolean =>\n isLatinLetter(c) || isPersianLetter(c) || isPersianOrAsciiDigit(c) || c === ' ';\n\nfunction filterChars(s: string, keep: (c: string) => boolean): string {\n let out = '';\n let changed = false;\n for (let i = 0; i < s.length; i++) {\n const c = s.charAt(i);\n if (keep(c)) out += c;\n else changed = true;\n }\n return changed ? out : s;\n}\n\nfunction filterSignedInteger(s: string): string {\n let out = '';\n for (let i = 0; i < s.length; i++) {\n const c = s.charAt(i);\n if ((i === 0 && c === '-') || isAsciiDigit(c)) out += c;\n }\n return out;\n}\n\nfunction filterDecimal(s: string, allowSign: boolean, separator: string): string {\n let out = '';\n let sawSeparator = false;\n for (let i = 0; i < s.length; i++) {\n const c = s.charAt(i);\n if ((allowSign && i === 0 && c === '-') || isAsciiDigit(c)) {\n out += c;\n } else if (!sawSeparator && (c === separator || c === '.' || c === '٫')) {\n out += separator;\n sawSeparator = true;\n }\n }\n return out;\n}\n\n/** Most distinct custom patterns kept compiled (MAUI `CustomPatternCacheLimit`). */\nexport const g9CustomPatternCacheLimit = 64;\nconst patternCache = new Map<string, RegExp | null>();\n\nfunction compilePattern(pattern: string): RegExp | null {\n const cached = patternCache.get(pattern);\n if (cached !== undefined) return cached;\n let compiled: RegExp | null;\n try {\n compiled = new RegExp(pattern);\n } catch {\n compiled = null;\n }\n if (patternCache.size >= g9CustomPatternCacheLimit) patternCache.clear();\n patternCache.set(pattern, compiled);\n return compiled;\n}\n\n/** Number of compiled custom patterns currently cached (for tests). */\nexport function customPatternCacheSize(): number {\n return patternCache.size;\n}\n\nfunction filterByCustomPattern(s: string, pattern: string | null | undefined): string {\n if (pattern == null || pattern.trim() === '') return s;\n const rx = compilePattern(pattern);\n // An invalid pattern passes the text through so the field stays usable; blur validation surfaces it.\n if (!rx) return s;\n return filterChars(s, (c) => {\n rx.lastIndex = 0;\n return rx.test(c);\n });\n}\n\n/** The decimal separator `Decimal`/`SignedDecimal` normalise to: the culture numbering system's (`.` or `٫`). */\nexport function decimalSeparatorFor(numberingSystem: G9NumberingSystem): string {\n return getNumberSymbols(numberingSystem).decimal;\n}\n\n/**\n * Strips every character the input type rejects (MAUI `G9InputTypePolicy.SanitizeText`). Types that accept ASCII\n * digits only see Persian and Arabic-Indic digits as ASCII first. Returns `raw` itself when nothing changes, so a\n * caller can compare by identity. The decimal types keep one separator, normalised to `decimalSeparator`.\n */\nexport function sanitizeInputText(\n inputType: G9InputType,\n raw: string,\n allowedCharsPattern?: string | null,\n decimalSeparator = '.',\n): string {\n if (!raw) return raw;\n const text = asciiDigitOnlyTypes.has(inputType) ? normalizeToAscii(raw) : raw;\n switch (inputType) {\n case G9InputType.Number:\n return filterChars(text, isAsciiDigit);\n case G9InputType.Decimal:\n return filterDecimal(text, false, decimalSeparator);\n case G9InputType.SignedNumber:\n return filterSignedInteger(text);\n case G9InputType.SignedDecimal:\n return filterDecimal(text, true, decimalSeparator);\n case G9InputType.Phone:\n return filterChars(text, isPhoneChar);\n case G9InputType.Email:\n case G9InputType.Url:\n return filterChars(text, (c) => !isWhiteSpace(c));\n case G9InputType.Letters:\n return filterChars(text, isLatinLetter);\n case G9InputType.LettersAndNumbers:\n return filterChars(text, (c) => isLatinLetter(c) || isAsciiDigit(c));\n case G9InputType.LettersNumbersSpace:\n return filterChars(text, (c) => isLatinLetter(c) || isAsciiDigit(c) || c === ' ');\n case G9InputType.PersianLetters:\n return filterChars(text, (c) => isPersianLetter(c) || c === ' ');\n case G9InputType.PersianLettersAndNumbers:\n return filterChars(text, (c) => isPersianLetter(c) || isPersianOrAsciiDigit(c) || c === ' ');\n case G9InputType.MultilingualLettersAndNumbers:\n case G9InputType.NoSpecialChars:\n return filterChars(text, isMultilingual);\n case G9InputType.Custom:\n return filterByCustomPattern(text, allowedCharsPattern);\n default:\n return text;\n }\n}\n\nconst emailPattern = /^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$/;\nconst hierarchicalSchemes: ReadonlySet<string> = new Set(['http', 'https', 'ftp', 'ws', 'wss', 'file', 'net.tcp']);\n\n/**\n * An absolute URI in the sense of .NET `Uri.TryCreate(value, UriKind.Absolute)` for the cases forms meet: a scheme,\n * then, for the hierarchical web schemes, `//` and a non-empty host; no whitespace; a Windows drive path counts.\n */\nexport function isAbsoluteUri(value: string): boolean {\n if (/\\s/.test(value.trim()) || value.trim() === '') return false;\n const v = value.trim();\n if (/^[A-Za-z]:[\\\\/]/.test(v)) return true;\n const match = /^([A-Za-z][A-Za-z0-9+.-]*):(.*)$/.exec(v);\n if (!match) return false;\n const scheme = (match[1] as string).toLowerCase();\n const rest = match[2] as string;\n if (hierarchicalSchemes.has(scheme)) {\n const authority = /^\\/\\/([^/?#]*)/.exec(rest);\n if (!authority) return false;\n return scheme === 'file' || (authority[1] as string).replace(/^[^@]*@/, '') !== '';\n }\n return rest !== '';\n}\n\n/**\n * Validates a final value (MAUI `G9InputTypePolicy.Validate`): `null` when acceptable, else the message —\n * `customMessage` when given, else the culture's `invalidEmail` / `invalidUrl` / `invalidValue`. Empty values pass.\n * `Custom` checks `validationPattern`; a pattern that does not compile fails closed.\n */\nexport function validateInputText(\n inputType: G9InputType,\n value: string | null | undefined,\n validationPattern: string | null | undefined,\n customMessage: string | null | undefined,\n strings: Pick<G9Strings, 'get'>,\n): string | null {\n if (!value) return null;\n switch (inputType) {\n case G9InputType.Email:\n return emailPattern.test(value) ? null : (customMessage ?? strings.get(G9StringKey.InvalidEmail));\n case G9InputType.Url:\n return isAbsoluteUri(value) ? null : (customMessage ?? strings.get(G9StringKey.InvalidUrl));\n case G9InputType.Custom: {\n if (!validationPattern) return null;\n let ok: boolean;\n try {\n ok = new RegExp(validationPattern).test(value);\n } catch {\n ok = false;\n }\n return ok ? null : (customMessage ?? strings.get(G9StringKey.InvalidValue));\n }\n default:\n return null;\n }\n}\n\n/** Whether the type (with its pattern) has a blur-time rule (part of MAUI `ShouldAutoValidate`). */\nexport function inputTypeHasValidationRule(\n inputType: G9InputType,\n validationPattern: string | null | undefined,\n): boolean {\n if (inputType === G9InputType.Email || inputType === G9InputType.Url) return true;\n return inputType === G9InputType.Custom && !!validationPattern;\n}\n"],"names":["ltrTypes","Set","G9InputType","asciiDigitOnlyTypes","inputTypePrefersLeftToRight","inputType","resolveKeyboardForInputType","G9KeyboardType","resolveEffectiveKeyboard","keyboardType","ownKeyboard","resolved","resolveInputElementType","keyboard","masked","isAsciiDigit","c","isLatinLetter","isPersianLetter","isPersianOrAsciiDigit","isPhoneChar","isWhiteSpace","isMultilingual","filterChars","s","keep","out","changed","i","filterSignedInteger","filterDecimal","allowSign","separator","sawSeparator","g9CustomPatternCacheLimit","patternCache","Map","compilePattern","pattern","cached","undefined","compiled","RegExp","customPatternCacheSize","filterByCustomPattern","rx","decimalSeparatorFor","numberingSystem","getNumberSymbols","sanitizeInputText","raw","allowedCharsPattern","decimalSeparator","text","normalizeToAscii","emailPattern","hierarchicalSchemes","isAbsoluteUri","value","v","match","scheme","rest","authority","validateInputText","validationPattern","customMessage","strings","G9StringKey","ok","inputTypeHasValidationRule"],"mappings":";AAgBA,MAAMA,WAAqC,IAAIC,IAAiB;IAC9DC,YAAY,MAAM;IAClBA,YAAY,OAAO;IACnBA,YAAY,YAAY;IACxBA,YAAY,aAAa;IACzBA,YAAY,KAAK;IACjBA,YAAY,KAAK;IACjBA,YAAY,GAAG;CAChB;AAED,MAAMC,sBAAgD,IAAIF,IAAiB;IACzEC,YAAY,MAAM;IAClBA,YAAY,OAAO;IACnBA,YAAY,YAAY;IACxBA,YAAY,aAAa;IACzBA,YAAY,KAAK;IACjBA,YAAY,iBAAiB;IAC7BA,YAAY,mBAAmB;CAChC;AAMM,SAASE,4BAA4BC,SAAsB;IAChE,OAAOL,SAAS,GAAG,CAACK;AACtB;AAGO,SAASC,4BAA4BD,SAAsB;IAChE,OAAQA;QACN,KAAKH,YAAY,MAAM;QACvB,KAAKA,YAAY,OAAO;QACxB,KAAKA,YAAY,YAAY;QAC7B,KAAKA,YAAY,aAAa;YAC5B,OAAOK,eAAe,MAAM;QAC9B,KAAKL,YAAY,KAAK;YACpB,OAAOK,eAAe,KAAK;QAC7B,KAAKL,YAAY,KAAK;YACpB,OAAOK,eAAe,KAAK;QAC7B,KAAKL,YAAY,GAAG;YAClB,OAAOK,eAAe,GAAG;QAC3B;YACE,OAAOA,eAAe,OAAO;IACjC;AACF;AAOO,SAASC,yBAAyBH,SAAsB,EAAEI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