@g9tm/lynxcontrols 1.7.3 → 2.2.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/countdown.d.ts +36 -0
- package/dist/effects/countdown.d.ts.map +1 -0
- package/dist/effects/countdown.jsx +93 -0
- 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 +3 -0
- package/dist/effects/index.d.ts.map +1 -0
- package/dist/effects/index.jsx +2 -0
- package/dist/expander/expander.d.ts +1 -0
- package/dist/expander/expander.d.ts.map +1 -1
- package/dist/expander/expander.jsx +22 -23
- package/dist/fields/dictation.jsx +0 -2
- package/dist/fields/editor.jsx +2 -4
- package/dist/fields/extra-entries.css +133 -0
- package/dist/fields/extra-entries.css.map +1 -0
- package/dist/fields/extra-entries.d.ts +98 -0
- package/dist/fields/extra-entries.d.ts.map +1 -0
- package/dist/fields/extra-entries.jsx +323 -0
- package/dist/fields/fields.css +4 -0
- package/dist/fields/fields.css.map +1 -1
- package/dist/fields/index.d.ts +4 -3
- package/dist/fields/index.d.ts.map +1 -1
- package/dist/fields/index.jsx +1 -0
- package/dist/fields/input-policy.jsx +0 -2
- package/dist/fields/notch.jsx +0 -2
- package/dist/fields/outlined-field.d.ts +9 -0
- package/dist/fields/outlined-field.d.ts.map +1 -1
- package/dist/fields/outlined-field.jsx +10 -8
- package/dist/fields/pin-entry.d.ts.map +1 -1
- package/dist/fields/pin-entry.jsx +11 -13
- package/dist/fields/search-entry.jsx +2 -4
- package/dist/fields/slot-layout.jsx +0 -2
- package/dist/fields/text-entry.jsx +2 -4
- package/dist/fields/use-dictation.jsx +0 -2
- package/dist/fields/use-text-input.d.ts +1 -1
- package/dist/fields/use-text-input.jsx +0 -2
- package/dist/fields/validator.jsx +0 -2
- package/dist/guide/confirm-sheet.d.ts +1 -1
- package/dist/guide/confirm-sheet.d.ts.map +1 -1
- package/dist/guide/confirm-sheet.jsx +6 -26
- 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 +66 -0
- package/dist/orb/orb.d.ts.map +1 -0
- package/dist/orb/orb.jsx +189 -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.d.ts.map +1 -1
- package/dist/selection/selection-sheet.jsx +31 -4
- 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
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fields/notch.jsx","sources":["../../src/fields/notch.ts"],"sourcesContent":["// The floated label's notch colour (no stylesheet import: sheets and popups set it without pulling fields.css).\n\n/** The CSS variable a container sets to the colour behind its fields (the floated label's notch paints it). */\nexport const g9FieldNotchBackgroundVariable = '--g9-field-notch-background';\n\n/**\n * Inline style for a container whose background is not `--g9-background` (a card, a sheet, a popup): the floated\n * label of every field inside it hides the outline with `color`, so no box of another colour shows behind the label.\n * Pass a colour literal (a `var()` inside a custom property is not resolved on every engine). G9 sheets and popups set\n * it themselves. Needs the app's `pluginG9Lynx()` (inline CSS variables).\n */\nexport function g9FieldNotchStyle(color: string): Readonly<Record<string, string>> {\n return { [g9FieldNotchBackgroundVariable]: color };\n}\n"],"names":["g9FieldNotchBackgroundVariable","g9FieldNotchStyle","color"],"mappings":"AAGO,MAAMA,iCAAiC;AAQvC,SAASC,kBAAkBC,KAAa;IAC7C,OAAO;QAAE,CAACF,+BAA+B,EAAEE;IAAM;AACnD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fields/outlined-field.jsx","sources":["../../src/fields/outlined-field.tsx"],"sourcesContent":["import './fields.css';\nimport { G9FilledValueHighlight, type G9ImageSource, G9Metrics } from '@g9tm/lynxcontrols-foundation';\nimport { type ReactNode, useState } from '@lynx-js/react';\nimport { useG9Anchor } from '../anchor/hooks';\nimport type { G9AnchorInfo } from '../anchor/registry';\nimport { g9RowStyle } from '../base/control';\nimport { g9KeyboardTargetProps } from '../host/keyboard';\nimport type { G9IconInput } from '../icon/icon';\nimport { G9IconSlot, hasIconSlot } from '../icon/slot';\nimport { useG9Direction, useG9Settings } from '../provider/hooks';\nimport { type G9PhysicalPadding, resolveFieldSlotLayout } from './slot-layout';\n\n// MAUI `G9OutlinedFieldBase` (Controls/Shared/G9OutlinedFieldBase.cs) as composition (plan/specs/03 §5): the\n// props every outlined input shares, a pure state resolver, `useOutlinedField`, and the `<G9OutlinedField>` frame the\n// inputs put their element into.\n\n/** Props every outlined field shares (the public members of MAUI `G9OutlinedFieldBase`). */\nexport interface G9OutlinedFieldProps {\n /**\n * Element `id` of the field root (MAUI `AutomationId`; automation taps its bounds to focus it). Used verbatim: keep\n * it to `[A-Za-z0-9_-]`.\n */\n readonly id?: string;\n /**\n * What the field is and can do as an anchor (`@g9tm/lynxcontrols/anchor`); the text inputs pass their value paths.\n * Registered only with an `id`.\n */\n readonly anchor?: G9AnchorInfo;\n /** Floating label. Without it the placeholder is the label (MAUI `Label ?? Placeholder`). */\n readonly label?: string | null;\n /** Placeholder; shown as the label when `label` is not set. */\n readonly placeholder?: string | null;\n /** Helper line under the field; replaced by `errorText` while the field has an error. */\n readonly helperText?: string | null;\n /** Error message, shown (in the error colour) while `hasError`. */\n readonly errorText?: string | null;\n /** Error state: error outline, label and helper colour. Validation can also set it (`validate()`). Default false. */\n readonly hasError?: boolean;\n /**\n * Keep the label floated even when empty and unfocused. Default false. With a `label` AND a `placeholder` the\n * placeholder is then drawn inside the empty box under the floated label (MAUI 1.4.9: «عنوان» floated with «عنوان کار\n * را وارد کنید» inside).\n */\n readonly alwaysFloat?: boolean;\n /**\n * The `placeholder` is the box's own hint (MAUI 1.4.9 `PlaceholderInside`): inside while the field is empty, gone with\n * a value, never lifted into the notch as a label — a chat composer's «یادداشت خود را بنویسید...». A `label`, if set,\n * still floats as usual. Default false: without a label the placeholder is the floating label's text.\n */\n readonly placeholderInside?: boolean;\n /** Value visible and selectable but not editable (MAUI `IsReadOnly`). Default false. */\n readonly readOnly?: boolean;\n /** Not interactive and dimmed (MAUI `IsEnabled = false`). Default false. */\n readonly disabled?: boolean;\n /** Maximum characters; `-1` (default) or `0` means unlimited. */\n readonly maxLength?: number;\n /** Show the `n / max` counter (only when `maxLength > 0`). Default false. */\n readonly showCharacterCounter?: boolean;\n /** Status colour (any CSS colour or `g9Token(...)`); used while `useStatusColor`. Default the primary colour. */\n readonly statusColor?: string | null;\n /** Draw the outline in `statusColor` (emphasised) whatever the focus. Default false. */\n readonly useStatusColor?: boolean;\n /** Soft inner halo while focused (no error, no status colour). Default false. */\n readonly showFocusHalo?: boolean;\n /** Filled-value accent of this field; `'inherit'` (default) takes `settings.fields.highlightFilledValue`. */\n readonly filledValueHighlight?: G9FilledValueHighlight;\n readonly leadingEmoji?: string | null;\n readonly leadingIcon?: G9IconInput;\n readonly leadingImagePath?: string | null;\n readonly leadingImage?: G9ImageSource | null;\n readonly trailingEmoji?: string | null;\n readonly trailingIcon?: G9IconInput;\n readonly trailingImagePath?: string | null;\n readonly trailingImage?: G9ImageSource | null;\n /** Spinner in the trailing slot (wins over every trailing icon). Default false. */\n readonly isTrailingBusy?: boolean;\n /** Keep the trailing icon on the physical right in RTL too. Default false. */\n readonly forceTrailingIconRight?: boolean;\n /** Keep the leading icon on the physical left in RTL too. Default false. */\n readonly forceLeadingIconLeft?: boolean;\n /** Box height; `0` (default) uses `G9Metrics.ControlHeight` (52). */\n readonly fieldHeight?: number;\n /** Reserve the floated label's overhang above the box (MAUI `FloatingLabelClearance`, 6). Default false. */\n readonly reserveFloatingLabelClearance?: boolean;\n /** Leading icon tap (MAUI `LeadingCommand` + `CommandParameter`). Makes the icon actionable. */\n readonly onLeadingPress?: () => void;\n /** Trailing icon tap when no built-in affordance claims it (MAUI `TrailingCommand`). */\n readonly onTrailingPress?: () => void;\n /** Extra padding of the inner content (MAUI `InnerContentPadding`), physical sides. */\n readonly innerContentPadding?: Partial<G9PhysicalPadding>;\n /** Class of the root element. */\n readonly className?: string;\n}\n\n/** What {@link resolveOutlinedFieldState} needs besides the props. */\nexport interface G9OutlinedFieldStateInput {\n readonly focused: boolean;\n readonly hasValue: boolean;\n /** A value the field shows without text (a picker's selection): floats the label like a value. */\n readonly valueFloated?: boolean;\n /** App-wide filled-value accent (`settings.fields.highlightFilledValue`). */\n readonly highlightFilledValue: boolean;\n /** Characters of the value, for the counter. */\n readonly textLength: number;\n /** Resting chrome tone: `'outline'` (default) or `'placeholder'` (search). */\n readonly restingTone?: 'outline' | 'placeholder';\n}\n\n/** The resolved look of an outlined field (colours are CSS colour values). */\nexport interface G9OutlinedFieldState {\n readonly floated: boolean;\n /** Outline, floated label and trailing icon colour. */\n readonly stateColor: string;\n readonly labelColor: string;\n /** Leading icon and resting label colour. */\n readonly restingContentColor: string;\n readonly labelText: string;\n /** Helper line text (`errorText` while in error), `''` when hidden. */\n readonly helperText: string;\n readonly helperColor: string;\n /** Counter text (`'n / max'`), `''` when hidden. */\n readonly counterText: string;\n readonly footerVisible: boolean;\n readonly strokeWidth: number;\n /** Focus halo thickness, 0 when off. */\n readonly haloWidth: number;\n readonly fieldHeight: number;\n}\n\nconst v = (token: string): string => `var(--g9-${token})`;\nconst blank = (s: string | null | undefined): boolean => s == null || s.trim() === '';\n\n/**\n * The hint a field draws INSIDE its box while it is empty, or `null` (MAUI 1.4.9 `RestingPlaceholder`). Without a `label`\n * (or with `placeholderInside`) it is the `placeholder`. With a label it is drawn only when `alwaysFloat` keeps the label\n * up in the notch — otherwise the resting label sits where the hint would be — and never when it repeats the label.\n */\nexport function resolveRestingPlaceholder(\n props: Pick<G9OutlinedFieldProps, 'label' | 'placeholder' | 'alwaysFloat' | 'placeholderInside'>,\n): string | null {\n if (blank(props.placeholder)) return null;\n const placeholder = props.placeholder as string;\n if (props.placeholderInside === true || blank(props.label)) return placeholder;\n return props.alwaysFloat === true && props.label !== placeholder ? placeholder : null;\n}\n\n/**\n * The hint a TEXT input draws itself (MAUI 1.4.9 `G9TextEntry` / `G9Editor`): only while the field owns it — a label is\n * set, or `placeholderInside` — since without a label the floating label already is the placeholder.\n */\nexport function resolveInnerHint(\n props: Pick<G9OutlinedFieldProps, 'label' | 'placeholder' | 'alwaysFloat' | 'placeholderInside'>,\n): string | null {\n const owns = props.placeholderInside === true || !blank(props.label);\n return owns ? resolveRestingPlaceholder(props) : null;\n}\n\n/**\n * Resolves the field's state colours and footer (MAUI `ResolveStateColor`, `ResolveFloatingLabelColor`, the footer\n * part of `Refresh`). Precedence: error > status colour > focus > accented filled value > resting.\n */\nexport function resolveOutlinedFieldState(\n props: G9OutlinedFieldProps,\n input: G9OutlinedFieldStateInput,\n): G9OutlinedFieldState {\n const hasError = props.hasError === true;\n const useStatus = props.useStatusColor === true;\n const filled = input.hasValue || input.valueFloated === true;\n const highlight = props.filledValueHighlight ?? G9FilledValueHighlight.Inherit;\n const accentFilled =\n highlight === G9FilledValueHighlight.Accent\n ? true\n : highlight === G9FilledValueHighlight.Neutral\n ? false\n : input.highlightFilledValue;\n const placeholderTone = input.restingTone === 'placeholder';\n const restingOutline = placeholderTone ? v('input-placeholder') : v('outline');\n const restingContentColor = placeholderTone ? v('input-placeholder') : v('text-tertiary');\n let stateColor: string;\n if (hasError) stateColor = v('error');\n else if (useStatus) stateColor = props.statusColor ?? v('primary');\n else if (input.focused) stateColor = v('primary');\n else stateColor = filled && accentFilled ? v('primary') : restingOutline;\n\n const floated = props.alwaysFloat === true || input.valueFloated === true || input.focused || input.hasValue;\n const neutralFilledRest = filled && !input.focused && !hasError && !useStatus && !accentFilled;\n const labelColor = floated && !neutralFilledRest ? stateColor : restingContentColor;\n\n const helperRaw = hasError ? (props.errorText ?? '') : (props.helperText ?? '');\n const helperText = helperRaw.trim() === '' ? '' : helperRaw;\n const maxLength = props.maxLength ?? -1;\n const counterText = props.showCharacterCounter === true && maxLength > 0 ? `${input.textLength} / ${maxLength}` : '';\n const emphasis = input.focused || hasError || useStatus;\n const halo = props.showFocusHalo === true && input.focused && !hasError && !useStatus;\n // MAUI 1.4.9: `Label ?? (PlaceholderInside ? null : Placeholder)` — a placeholder inside the box never floats.\n const labelRaw = props.label ?? (props.placeholderInside === true ? null : props.placeholder) ?? '';\n return {\n floated,\n stateColor,\n labelColor,\n restingContentColor,\n labelText: labelRaw.trim() === '' ? '' : labelRaw,\n helperText,\n helperColor: hasError ? v('error') : v('text-tertiary'),\n counterText,\n footerVisible: helperText !== '' || counterText !== '',\n strokeWidth: emphasis ? G9Metrics.OutlinedFieldEmphasisStrokeThickness : G9Metrics.OutlinedFieldStrokeThickness,\n haloWidth: halo ? G9Metrics.OutlinedFieldFocusHaloThickness : 0,\n fieldHeight: props.fieldHeight && props.fieldHeight > 0 ? props.fieldHeight : G9Metrics.ControlHeight,\n };\n}\n\n/** {@link resolveOutlinedFieldState} with the app-wide settings read from the provider. */\nexport function useOutlinedField(\n props: G9OutlinedFieldProps,\n input: Omit<G9OutlinedFieldStateInput, 'highlightFilledValue'>,\n): G9OutlinedFieldState {\n const settings = useG9Settings();\n return resolveOutlinedFieldState(props, { ...input, highlightFilledValue: settings.fields.highlightFilledValue });\n}\n\n/** A built-in trailing affordance an input puts in the trailing slot (password eye, microphone, clear). */\nexport interface G9TrailingAffordance {\n /** What it shows. */\n readonly icon: G9IconInput;\n /** Icon colour; default the state colour. */\n readonly color?: string;\n /** Accessibility label. */\n readonly label?: string;\n /** Stable key (MAUI `ResolveTrailingIconSignature`): the slot is rebuilt only when it changes. */\n readonly signature: string;\n readonly onPress: () => void;\n}\n\n/** Props of {@link G9OutlinedField}: the shared props plus what the composing input supplies. */\nexport interface G9OutlinedFieldFrameProps extends G9OutlinedFieldProps {\n readonly focused: boolean;\n readonly hasValue: boolean;\n readonly valueFloated?: boolean;\n readonly textLength?: number;\n /** The input element (or any content) inside the box. */\n readonly children?: ReactNode;\n /** A built-in trailing affordance; replaces the trailing icon props (busy still wins). */\n readonly trailingAffordance?: G9TrailingAffordance | null;\n /** Tapping the box (outside the icons) focuses the content (MAUI `FocusTarget`). */\n readonly onFocusRequest?: () => void;\n /** Resting tone (`'placeholder'` for search, MAUI `ResolveRestingOutlineColor` override). */\n readonly restingTone?: 'outline' | 'placeholder';\n /** Vertical placement of the icons and the resting label: centred (entries) or top/bottom (editor). */\n readonly multiline?: boolean;\n /** Accessibility label of the box (defaults to the label text). */\n readonly accessibilityLabel?: string;\n /**\n * A hint the frame draws over the content while the field is empty (`resolveInnerHint`, MAUI 1.4.9): text inputs pass\n * it; the pickers draw their own value text. TextTertiary, the input's 15 px, never taking a touch.\n */\n readonly hint?: string | null;\n /**\n * Multi-line only: the content's own top padding, so the hint starts on the content's first line (G9Editor's textarea\n * keeps the floated label's clearance above its text). Default 0.\n */\n readonly hintTopInset?: number;\n}\n\nfunction physicalSide(column: 0 | 2): 'left' | 'right' {\n return column === 0 ? 'left' : 'right';\n}\n\n/**\n * The outlined field frame (MAUI `G9OutlinedFieldBase`): outline with a notched floating label, leading and\n * trailing icon slots, helper/error line and counter. Inputs (`G9TextEntry`, `G9Editor`, `G9SearchEntry`, the pickers)\n * put their element in `children`. Direction is set on the root from the culture (labels, icons, helper follow it;\n * the input decides its own text direction). A tap on an icon never focuses the content; a tap elsewhere on the box\n * calls `onFocusRequest`.\n *\n * Look: colours come from the theme variables (`--g9-primary`, `--g9-outline`, `--g9-error`, …). The floated label\n * sits on the outline with the background `--g9-field-notch-background` (default `--g9-background`; set it on a\n * container of another colour with `g9FieldNotchStyle`, G9 sheets and popups do), which hides the\n * outline under it.\n */\nexport function G9OutlinedField(props: G9OutlinedFieldFrameProps): ReactNode {\n const anchorHandle = useG9Anchor(\n props.id,\n props.anchor ?? { kind: 'entry', label: () => props.label ?? props.placeholder, enabled: () => !props.disabled },\n props.id ? { domId: props.id } : {},\n );\n const direction = useG9Direction();\n const isRtl = direction === 'rtl';\n const state = useOutlinedField(props, {\n focused: props.focused,\n hasValue: props.hasValue,\n valueFloated: props.valueFloated ?? false,\n textLength: props.textLength ?? 0,\n restingTone: props.restingTone ?? 'outline',\n });\n const leading = {\n emoji: props.leadingEmoji ?? null,\n icon: props.leadingIcon,\n imagePath: props.leadingImagePath ?? null,\n image: props.leadingImage ?? null,\n };\n const trailing = {\n emoji: props.trailingEmoji ?? null,\n icon: props.trailingIcon,\n imagePath: props.trailingImagePath ?? null,\n image: props.trailingImage ?? null,\n };\n const busy = props.isTrailingBusy === true;\n const affordance = props.trailingAffordance ?? null;\n const hasLeading = hasIconSlot(leading);\n const hasTrailing = busy || affordance !== null || hasIconSlot(trailing);\n const pad = props.innerContentPadding ?? {};\n const slot = resolveFieldSlotLayout(\n {\n hasLeadingIcon: hasLeading,\n hasTrailingIcon: hasTrailing,\n isRtl,\n forceTrailingIconRight: props.forceTrailingIconRight === true,\n forceLeadingIconLeft: props.forceLeadingIconLeft === true,\n },\n { left: pad.left ?? 0, top: pad.top ?? 0, right: pad.right ?? 0, bottom: pad.bottom ?? 0 },\n );\n const disabled = props.disabled === true;\n const leadingActionable = props.onLeadingPress !== undefined;\n const trailingActionable = affordance !== null || props.onTrailingPress !== undefined;\n const onLeadingTap = () => {\n if (disabled || !leadingActionable) return;\n props.onLeadingPress?.();\n };\n const onTrailingTap = () => {\n if (disabled || busy || !trailingActionable) return;\n if (affordance) affordance.onPress();\n else props.onTrailingPress?.();\n };\n const onBoxTap = () => {\n if (!disabled) props.onFocusRequest?.();\n };\n\n const multiline = props.multiline === true;\n const labelHeight = G9Metrics.FloatingLabelHeight;\n // MAUI rests the label in the middle of the box's MEASURED height (ResolveFieldHeight → _box.Height): an empty\n // editor of 110 dp shows «شرح» halfway down it, not on its first line. Before the first layout: the control height.\n const [boxHeight, setBoxHeight] = useState(0);\n const restTop =\n ((multiline && boxHeight > 8 ? boxHeight : multiline ? G9Metrics.ControlHeight : state.fieldHeight) - labelHeight) /\n 2;\n const labelX = slot.labelRestX + (state.floated ? slot.labelFloatedX : 0);\n const labelAnchor = isRtl ? 'right' : 'left';\n const iconSize = G9Metrics.InputIconSize;\n const slotStyle = (column: 0 | 2, width: number, bottomAligned: boolean) => ({\n [physicalSide(column)]: '0px',\n width: `${width}px`,\n ...(bottomAligned\n ? { bottom: '0px', height: `${G9Metrics.EditorTrailingSlotHeight}px` }\n : { top: '0px', bottom: '0px' }),\n });\n\n const trailingContent = busy ? (\n <view className=\"g9-field__busy\" style={{ borderColor: state.stateColor, borderTopColor: 'transparent' }} />\n ) : affordance ? (\n <G9IconSlot icon={affordance.icon} color={affordance.color ?? state.stateColor} size={iconSize} />\n ) : (\n <G9IconSlot {...trailing} color={state.stateColor} size={iconSize} />\n );\n\n return (\n <view\n className={`g9-field g9-dir-${direction}${disabled ? ' g9-field--disabled' : ''}${props.className ? ` ${props.className}` : ''}`}\n {...anchorHandle.props}\n >\n <view\n {...g9KeyboardTargetProps}\n className={`g9-field__box${state.floated ? ' g9-field__box--floated' : ''}${props.focused ? ' g9-field__box--focused' : ''}`}\n accessibility-element={false}\n style={{\n height: multiline ? undefined : `${state.fieldHeight}px`,\n minHeight: multiline ? `${state.fieldHeight}px` : undefined,\n marginTop: props.reserveFloatingLabelClearance ? `${G9Metrics.FloatingLabelClearance}px` : '0px',\n }}\n bindtap={onBoxTap}\n {...(multiline\n ? {\n bindlayoutchange: (e: { detail?: { height?: number } }) => {\n const h = e.detail?.height ?? 0;\n if (Math.abs(h - boxHeight) > 0.5) setBoxHeight(h);\n },\n }\n : {})}\n >\n {/* The outline is its own view (MAUI paints it on a canvas): a stroke change never moves the content, and a\n disabled field dims it without an opacity layer on the box, which clipped the floated label on Android. */}\n <view\n className=\"g9-field__outline\"\n style={{\n borderColor: state.stateColor,\n borderWidth: `${state.strokeWidth}px`,\n borderRadius: `${G9Metrics.RadiusMd}px`,\n }}\n />\n {state.haloWidth > 0 ? (\n <view\n className=\"g9-field__halo\"\n style={{\n borderColor: state.stateColor,\n borderWidth: `${state.haloWidth}px`,\n opacity: G9Metrics.FocusRingOpacity,\n borderRadius: `${G9Metrics.RadiusMd}px`,\n }}\n />\n ) : null}\n <view\n className=\"g9-field__content\"\n style={{\n paddingLeft: `${slot.innerPadding.left + (hasLeading && slot.leadingColumn === 0 ? G9Metrics.LeadingIconSlotWidth : 0) + (hasTrailing && slot.trailingColumn === 0 ? G9Metrics.TrailingIconSlotWidth : 0)}px`,\n paddingRight: `${slot.innerPadding.right + (hasLeading && slot.leadingColumn === 2 ? G9Metrics.LeadingIconSlotWidth : 0) + (hasTrailing && slot.trailingColumn === 2 ? G9Metrics.TrailingIconSlotWidth : 0)}px`,\n paddingTop: `${slot.innerPadding.top}px`,\n paddingBottom: `${slot.innerPadding.bottom}px`,\n }}\n >\n {props.children}\n {props.hint && !props.hasValue && props.valueFloated !== true ? (\n <view\n className={`g9-field__hint${multiline ? ' g9-field__hint--multiline' : ''}`}\n user-interaction-enabled={false}\n style={{\n left: `${slot.innerPadding.left + (hasLeading && slot.leadingColumn === 0 ? G9Metrics.LeadingIconSlotWidth : 0) + (hasTrailing && slot.trailingColumn === 0 ? G9Metrics.TrailingIconSlotWidth : 0)}px`,\n right: `${slot.innerPadding.right + (hasLeading && slot.leadingColumn === 2 ? G9Metrics.LeadingIconSlotWidth : 0) + (hasTrailing && slot.trailingColumn === 2 ? G9Metrics.TrailingIconSlotWidth : 0)}px`,\n ...(multiline ? { top: `${slot.innerPadding.top + (props.hintTopInset ?? 0)}px` } : {}),\n }}\n >\n <text\n className=\"g9-field__hint-text\"\n {...(multiline ? {} : { 'text-maxline': '1' })}\n style={{\n textAlign: isRtl ? 'right' : 'left',\n color: disabled ? 'var(--g9-text-disabled)' : 'var(--g9-text-tertiary)',\n }}\n >\n {props.hint}\n </text>\n </view>\n ) : null}\n </view>\n {hasLeading ? (\n <view\n className=\"g9-field__slot g9-field__slot--leading\"\n style={slotStyle(slot.leadingColumn, G9Metrics.LeadingIconSlotWidth, false)}\n catchtap={onLeadingTap}\n {...(leadingActionable ? { 'accessibility-element': true, 'accessibility-traits': 'button' } : {})}\n >\n <G9IconSlot {...leading} color={state.restingContentColor} size={iconSize} />\n </view>\n ) : null}\n {hasTrailing ? (\n <view\n key={busy ? 'busy' : affordance ? affordance.signature : 'icon'}\n className=\"g9-field__slot g9-field__slot--trailing\"\n style={slotStyle(slot.trailingColumn, G9Metrics.TrailingIconSlotWidth, multiline && !busy)}\n catchtap={onTrailingTap}\n {...(trailingActionable\n ? {\n 'accessibility-element': true,\n 'accessibility-traits': 'button',\n ...(affordance?.label ? { 'accessibility-label': affordance.label } : {}),\n }\n : {})}\n >\n {trailingContent}\n </view>\n ) : null}\n {state.labelText ? (\n <text\n className={`g9-field__label${state.floated ? ' g9-field__label--floated' : ''}`}\n style={{\n [labelAnchor]: `${G9Metrics.InputHorizontalPadding}px`,\n top: `${state.floated ? G9Metrics.FloatingLabelFloatedY : restTop}px`,\n fontSize: `${state.floated ? G9Metrics.FloatingLabelFontSizeFloat : G9Metrics.FloatingLabelFontSizeRest}px`,\n color: disabled ? 'var(--g9-text-disabled)' : state.labelColor,\n transform: `translateX(${labelX}px)`,\n }}\n >\n {state.labelText}\n </text>\n ) : null}\n </view>\n {state.footerVisible ? (\n <view className=\"g9-field__footer\" style={g9RowStyle(direction)}>\n {state.helperText ? (\n <text\n className=\"g9-field__helper\"\n style={{ color: state.helperColor, textAlign: isRtl ? 'right' : 'left' }}\n >\n {state.helperText}\n </text>\n ) : (\n <view className=\"g9-field__helper\" />\n )}\n {/* RLM first in a right-to-left field: «0 / 4000» has no strong letter, so it would lay out left-to-right; MAUI's\n label inherits the RTL flow and reads «۴۰۰۰ / ۰». */}\n {state.counterText ? (\n <text className=\"g9-field__counter\">{`${isRtl ? '\\u200F' : ''}${state.counterText}`}</text>\n ) : null}\n </view>\n ) : null}\n </view>\n );\n}\n"],"names":["v","token","blank","s","resolveRestingPlaceholder","props","placeholder","resolveInnerHint","owns","resolveOutlinedFieldState","input","_props_filledValueHighlight","_props_statusColor","_props_errorText","_props_helperText","_props_maxLength","_ref","hasError","useStatus","filled","highlight","G9FilledValueHighlight","accentFilled","placeholderTone","restingOutline","restingContentColor","stateColor","floated","neutralFilledRest","labelColor","helperRaw","helperText","maxLength","counterText","emphasis","halo","labelRaw","G9Metrics","useOutlinedField","settings","useG9Settings","physicalSide","column","G9OutlinedField","_props_anchor","_props_valueFloated","_props_textLength","_props_restingTone","_props_leadingEmoji","_props_leadingImagePath","_props_leadingImage","_props_trailingEmoji","_props_trailingImagePath","_props_trailingImage","_props_trailingAffordance","_props_innerContentPadding","_pad_left","_pad_top","_pad_right","_pad_bottom","_affordance_color","_props_hintTopInset","anchorHandle","useG9Anchor","_props_label","direction","useG9Direction","isRtl","state","leading","trailing","busy","affordance","hasLeading","hasIconSlot","hasTrailing","pad","slot","resolveFieldSlotLayout","disabled","leadingActionable","undefined","trailingActionable","onLeadingTap","onTrailingTap","onBoxTap","multiline","labelHeight","boxHeight","setBoxHeight","useState","restTop","labelX","labelAnchor","iconSize","slotStyle","width","bottomAligned","trailingContent","view","G9IconSlot","g9KeyboardTargetProps","e","_e_detail","h","Math","text","g9RowStyle"],"mappings":";;;;;;;;;AAiIA,MAAMA,IAAI,CAACC,QAA0B,CAAC,SAAS,EAAEA,MAAM,CAAC,CAAC;AACzD,MAAMC,QAAQ,CAACC,IAA0CA,AAAK,QAALA,KAAaA,AAAa,OAAbA,EAAE,IAA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EAAEsC,SAEDP,KAAK,UAAU,qBAChB;UACF,EACyD;UACzD,CAAC/B,MAAM,WAAW,IACfsC,KAAK,UAAU,qBAAqB,GAAGvC,QAAQ,WAAW,KAAKC,MAAM,WAAW,EAAE,GAAGsC,QACpF,KAAK;QACX,EAAEP,QACA,KAAK;IACX,EAAEA;AAEN"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fields/pin-entry.jsx","sources":["../../src/fields/pin-entry.tsx"],"sourcesContent":["import { g9IdProps } from '../base/control';\nimport './fields.css';\nimport { G9Metrics, G9PinEntryType, normalizeToAscii } from '@g9tm/lynxcontrols-foundation';\nimport { KeyboardAwareTriggerContext } from '@lynx-js/lynx-ui-input';\nimport {\n forwardRef,\n type ReactNode,\n useContext,\n useEffect,\n useImperativeHandle,\n useRef,\n useState,\n} from '@lynx-js/react';\nimport type { NodesRef } from '@lynx-js/types';\nimport { startTimer } from '../base/timers';\nimport { useControllableState } from '../base/use-controllable-state';\nimport { g9KeyboardTargetProps } from '../host/keyboard';\nimport { invokeNode, invokeNodeWhenReady } from './use-text-input';\n\n/** Props of {@link G9PinEntry} (MAUI `G9PinEntry`). */\nexport interface G9PinEntryProps {\n /** Element `id` of the root (MAUI `AutomationId`). Used verbatim: keep it to `[A-Za-z0-9_-]`. */\n readonly id?: string;\n /** Number of cells when `groupSizes` is not set (at least 1). Default 4. */\n readonly length?: number;\n /** The code (controlled; MAUI `Value`). */\n readonly value?: string;\n /** Initial code while uncontrolled. Default `''`. */\n readonly defaultValue?: string;\n /** Once per change of the code (MAUI `ValueChanged`): typing, paste, `clear()`, a re-filter after a type change. */\n readonly onValueChange?: (value: string) => void;\n /** Once each time the code becomes complete (MAUI `Completed`); not for a complete value the parent pushes in. */\n readonly onComplete?: (value: string) => void;\n /** Accepted characters; `'password'` is digits shown masked. Default `'number'`. */\n readonly type?: G9PinEntryType;\n /** Filler glyph of an empty cell. Default none. */\n readonly placeholder?: string | null;\n /** Glyph of a masked cell. Default `'●'`. */\n readonly maskCharacter?: string;\n /** Cell groups such as `'4-4-4-4'`; when set, their sum is the cell count and `separator` sits between groups. */\n readonly groupSizes?: string | null;\n /** Text between groups. Default `'-'`. */\n readonly separator?: string | null;\n /** Cell width. Default 44 (`G9Metrics.PinCellWidth`). */\n readonly cellWidth?: number;\n /** Cell height. Default 52 (`G9Metrics.PinCellHeight`). */\n readonly cellHeight?: number;\n /** Focus once when mounted. Default false. */\n readonly autoFocus?: boolean;\n readonly disabled?: boolean;\n /** Accessibility label of the row (the progress `n / total` is always announced). */\n readonly accessibilityLabel?: string;\n readonly className?: string;\n}\n\n/** Imperative handle of {@link G9PinEntry}. */\nexport interface G9PinEntryHandle {\n /** Focuses the hidden input; typing appends after the last character (MAUI `FocusFirstEmpty`). */\n focusFirstEmpty(): void;\n /** Empties every cell (MAUI `Clear`). */\n clear(): void;\n /** Every cell is filled (MAUI `IsComplete`). */\n readonly isComplete: boolean;\n}\n\n/** Parses `'4-3-3-2'` into positive group sizes; blanks and non-numbers are skipped (MAUI `ParseGroupSizes`). */\nexport function parsePinGroupSizes(raw: string | null | undefined): number[] {\n if (raw == null || raw.trim() === '') return [];\n const out: number[] = [];\n for (const part of raw.split('-')) {\n const trimmed = part.trim();\n if (!/^[+]?\\d+$/.test(trimmed)) continue;\n const n = Number(trimmed);\n if (n > 0) out.push(n);\n }\n return out;\n}\n\n/** Cell count: the groups' sum, else `max(1, length)`. */\nexport function pinCellCount(length: number, groups: readonly number[]): number {\n return groups.length > 0 ? groups.reduce((a, b) => a + b, 0) : Math.max(1, length);\n}\n\n// Lynx's JavaScript engine rejects Unicode property escapes (`/\\p{Nd}/u`), so `char.IsDigit` / `char.IsLetter` are\n// spelled out: the zero code points of every BMP decimal-digit block (Unicode category Nd), and \"letter\" as a cased\n// character or one of the uncased letter blocks forms meet (Arabic/Persian, Hebrew, Indic, Thai, CJK, kana, Hangul).\nconst digitZeros = [\n 0x30, 0x660, 0x6f0, 0x7c0, 0x966, 0x9e6, 0xa66, 0xae6, 0xb66, 0xbe6, 0xc66, 0xce6, 0xd66, 0xde6, 0xe50, 0xed0, 0xf20,\n 0x1040, 0x1090, 0x17e0, 0x1810, 0x1946, 0x19d0, 0x1a80, 0x1a90, 0x1b50, 0x1bb0, 0x1c40, 0x1c50, 0xa620, 0xa8d0,\n 0xa900, 0xa9d0, 0xa9f0, 0xaa50, 0xabf0, 0xff10,\n];\nconst uncasedLetterRanges: ReadonlyArray<readonly [number, number]> = [\n [0x5d0, 0x5ea],\n [0x620, 0x64a],\n [0x66e, 0x6d3],\n [0x6fa, 0x6ff],\n [0x904, 0x939],\n [0xe01, 0xe30],\n [0x3041, 0x30ff],\n [0x3400, 0x4dbf],\n [0x4e00, 0x9fff],\n [0xac00, 0xd7a3],\n];\n\nfunction isUnicodeDigit(ch: string): boolean {\n const c = ch.charCodeAt(0);\n for (const zero of digitZeros) if (c >= zero && c <= zero + 9) return true;\n return false;\n}\n\nfunction isUnicodeLetter(ch: string): boolean {\n if (ch.toLowerCase() !== ch.toUpperCase()) return true;\n const c = ch.charCodeAt(0);\n for (const [from, to] of uncasedLetterRanges) if (c >= from && c <= to) return true;\n return false;\n}\n\n/** Whether the PIN type accepts a character (MAUI `IsAllowed`: `char.IsDigit` / `IsLetter` / `IsLetterOrDigit`). */\nexport function isPinCharAllowed(type: G9PinEntryType, ch: string): boolean {\n switch (type) {\n case G9PinEntryType.Letters:\n return isUnicodeLetter(ch);\n case G9PinEntryType.Alphanumeric:\n return isUnicodeLetter(ch) || isUnicodeDigit(ch);\n default:\n return isUnicodeDigit(ch);\n }\n}\n\n/**\n * Filters and clamps a code (MAUI `FilterAndClamp`): Persian and Arabic-Indic digits become ASCII, disallowed\n * characters are dropped, the rest is cut to `cells`.\n */\nexport function filterPin(raw: string | null | undefined, type: G9PinEntryType, cells: number): string {\n if (!raw) return '';\n let out = '';\n for (const typed of Array.from(raw)) {\n if (Array.from(out).length >= cells) break;\n const ch = normalizeToAscii(typed);\n if (isPinCharAllowed(type, ch)) out += ch;\n }\n return out;\n}\n\nconst hiddenInputStyle = {\n position: 'absolute',\n top: '0px',\n left: '0px',\n width: '1px',\n height: '1px',\n padding: '0px',\n borderWidth: '0px',\n opacity: 0,\n color: 'transparent',\n caretColor: 'transparent',\n backgroundColor: 'transparent',\n} as const;\n\n/**\n * One-time-code / PIN entry (MAUI `G9PinEntry`): a row of cells over one hidden `<input>` (the lynx-ui `InputOTP`\n * pattern). Append-only: typing fills the next cell, backspace empties the last, a tap anywhere focuses the end.\n * Paste is filtered and clamped. Digits are stored as ASCII whatever keyboard produced them. Masked with\n * `type: 'password'`. Requires the host's `xelement-input` registration.\n */\nexport const G9PinEntry = forwardRef<G9PinEntryHandle, G9PinEntryProps>(function G9PinEntry(props, ref): ReactNode {\n const keyboardAware = useContext(KeyboardAwareTriggerContext);\n const type = props.type ?? G9PinEntryType.Number;\n const groups = parsePinGroupSizes(props.groupSizes);\n const cells = pinCellCount(props.length ?? 4, groups);\n const [value, setValue] = useControllableState<string>({\n value: props.value,\n defaultValue: props.defaultValue ?? '',\n onChange: props.onValueChange,\n name: 'G9PinEntry.value',\n });\n const clean = filterPin(value, type, cells);\n const chars = Array.from(clean);\n const complete = chars.length === cells;\n const [focused, setFocused] = useState(false);\n const inputRef = useRef<NodesRef | null>(null);\n const native = useRef('');\n const completedFired = useRef(complete);\n const latest = useRef(clean);\n latest.current = clean;\n const [, bump] = useState(0);\n\n // A pushed value the filter rejects is replaced once; a pushed complete value never fires `onComplete`.\n const refiltered = useRef<string | null>(null);\n useEffect(() => {\n if (clean !== value && refiltered.current !== value) {\n refiltered.current = value;\n setValue(clean);\n }\n });\n const lastSeen = useRef(clean);\n if (lastSeen.current !== clean) {\n lastSeen.current = clean;\n if (!complete) completedFired.current = false;\n }\n const retries = useRef(0);\n const sync = () => {\n const current = latest.current;\n if (native.current === current) return;\n if (invokeNode(inputRef, 'setValue', { value: current })) {\n native.current = current;\n retries.current = 0;\n } else if (inputRef.current && retries.current < 5) {\n retries.current += 1;\n startTimer(() => syncRef.current(), 0);\n }\n };\n const syncRef = useRef(sync);\n syncRef.current = sync;\n const attach = useRef((node: NodesRef | null) => {\n inputRef.current = node;\n if (node) syncRef.current();\n }).current;\n useEffect(() => {\n sync();\n });\n\n const focus = () => {\n if (props.disabled) return;\n invokeNode(inputRef, 'focus');\n invokeNode(inputRef, 'setSelectionRange', { selectionStart: chars.length, selectionEnd: chars.length });\n };\n const clear = () => {\n latest.current = '';\n completedFired.current = false;\n setValue('');\n bump((n) => n + 1);\n };\n useImperativeHandle(ref, () => ({\n focusFirstEmpty: focus,\n clear,\n get isComplete() {\n return Array.from(latest.current).length === cells;\n },\n }));\n\n const autoFocused = useRef(false);\n useEffect(() => {\n if (props.autoFocus && !autoFocused.current && !props.disabled) {\n autoFocused.current = true;\n invokeNodeWhenReady(inputRef, 'focus');\n }\n });\n\n const onInput = (event: { detail?: { value?: string } }) => {\n const raw = event.detail?.value ?? '';\n native.current = raw;\n const next = filterPin(raw, type, cells);\n latest.current = next;\n lastSeen.current = next;\n setValue(next);\n const ready = Array.from(next).length === cells;\n if (ready && !completedFired.current) {\n completedFired.current = true;\n props.onComplete?.(next);\n } else if (!ready) {\n completedFired.current = false;\n }\n bump((n) => n + 1);\n };\n\n const cellWidth = props.cellWidth && props.cellWidth > 0 ? props.cellWidth : G9Metrics.PinCellWidth;\n const cellHeight = props.cellHeight && props.cellHeight > 0 ? props.cellHeight : G9Metrics.PinCellHeight;\n const active = focused ? Math.min(chars.length, cells - 1) : -1;\n const separator = props.separator ?? '';\n const row: ReactNode[] = [];\n let groupIndex = 0;\n let inGroup = 0;\n for (let i = 0; i < cells; i++) {\n const ch = chars[i];\n const state = i === active ? 'active' : ch !== undefined ? 'filled' : 'empty';\n row.push(\n <view\n key={`c${i}`}\n className={`g9-pin__cell g9-pin__cell--${state}`}\n style={{ width: `${cellWidth}px`, height: `${cellHeight}px` }}\n >\n <text className={ch !== undefined ? 'g9-pin__char' : 'g9-pin__placeholder'}>\n {ch !== undefined\n ? type === G9PinEntryType.Password\n ? (props.maskCharacter ?? '●')\n : ch\n : (props.placeholder ?? '')}\n </text>\n </view>,\n );\n inGroup++;\n if (groups.length > 0 && groupIndex < groups.length - 1 && inGroup === groups[groupIndex]) {\n if (separator !== '') {\n row.push(\n <text key={`s${groupIndex}`} className=\"g9-pin__separator\">\n {separator}\n </text>,\n );\n }\n groupIndex++;\n inGroup = 0;\n }\n }\n\n return (\n <view\n {...g9KeyboardTargetProps}\n className={`g9-pin g9-dir-ltr${props.disabled ? ' g9-pin--disabled' : ''}${complete ? ' g9-pin--complete' : ''}${props.className ? ` ${props.className}` : ''}`}\n {...g9IdProps(props.id)}\n accessibility-element={true}\n accessibility-label={`${props.accessibilityLabel ? `${props.accessibilityLabel}, ` : ''}${chars.length} / ${cells}`}\n bindtap={focus}\n >\n {row}\n <input\n {...g9KeyboardTargetProps}\n ref={attach}\n className=\"g9-pin__input\"\n android-fullscreen-mode={false}\n ignore-focus={true}\n confirm-type=\"done\"\n disabled={props.disabled === true}\n maxlength={cells}\n ios-auto-correct={false}\n ios-spell-check={false}\n type={type === G9PinEntryType.Number || type === G9PinEntryType.Password ? 'number' : 'text'}\n style={hiddenInputStyle}\n bindinput={onInput}\n bindfocus={() => {\n setFocused(true);\n keyboardAware.onInputFocused?.();\n }}\n bindblur={() => {\n setFocused(false);\n keyboardAware.onInputBlurred?.();\n }}\n />\n </view>\n );\n});\n"],"names":["parsePinGroupSizes","raw","out","part","trimmed","n","Number","pinCellCount","length","groups","a","b","Math","digitZeros","uncasedLetterRanges","isUnicodeDigit","ch","c","zero","isUnicodeLetter","from","to","isPinCharAllowed","type","G9PinEntryType","filterPin","cells","typed","Array","normalizeToAscii","hiddenInputStyle","G9PinEntry","forwardRef","props","ref","_props_type","_props_length","_props_defaultValue","_props_separator","keyboardAware","useContext","KeyboardAwareTriggerContext","value","setValue","useControllableState","clean","chars","complete","focused","setFocused","useState","inputRef","useRef","native","completedFired","latest","bump","refiltered","useEffect","lastSeen","retries","sync","current","invokeNode","startTimer","syncRef","attach","node","focus","clear","useImperativeHandle","autoFocused","invokeNodeWhenReady","onInput","event","_event_detail","next","ready","cellWidth","G9Metrics","cellHeight","active","separator","row","groupIndex","inGroup","i","_props_maskCharacter","_props_placeholder","state","undefined","view","text","g9KeyboardTargetProps","g9IdProps","input"],"mappings":";;;;;;;;;AAkEO,SAASA,mBAAmBC,GAA8B;IAC/D,IAAIA,AAAO,QAAPA,OAAeA,AAAe,OAAfA,IAAI,IAAI,IAAW,OAAO,EAAE;IAC/C,MAAMC,MAAgB,EAAE;IACxB,KAAK,MAAMC,QAAQF,IAAI,KAAK,CAAC,KAAM;QACjC,MAAMG,UAAUD,KAAK,IAAI;QACzB,IAAI,CAAC,YAAY,IAAI,CAACC,UAAU;QAChC,MAAMC,IAAIC,OAAOF;QACjB,IAAIC,IAAI,GAAGH,IAAI,IAAI,CAACG;IACtB;IACA,OAAOH;AACT;AAGO,SAASK,aAAaC,MAAc,EAAEC,MAAyB;IACpE,OAAOA,OAAO,MAAM,GAAG,IAAIA,OAAO,MAAM,CAAC,CAACC,GAAGC,IAAMD,IAAIC,GAAG,KAAKC,KAAK,GAAG,CAAC,GAAGJ;AAC7E;AAKA,MAAMK,aAAa;IACjB;IAAM;IAAO;IAAO;IAAO;IAAO;IAAO;IAAO;IAAO;IAAO;IAAO;IAAO;IAAO;IAAO;IAAO;IAAO;IAAO;IAC/G;IAAQ;IAAQ;IAAQ;IAAQ;IAAQ;IAAQ;IAAQ;IAAQ;IAAQ;IAAQ;IAAQ;IAAQ;IAAQ;IACxG;IAAQ;IAAQ;IAAQ;IAAQ;IAAQ;CACzC;AACD,MAAMC,sBAAgE;IACpE;QAAC;QAAO;KAAM;IACd;QAAC;QAAO;KAAM;IACd;QAAC;QAAO;KAAM;IACd;QAAC;QAAO;KAAM;IACd;QAAC;QAAO;KAAM;IACd;QAAC;QAAO;KAAM;IACd;QAAC;QAAQ;KAAO;IAChB;QAAC;QAAQ;KA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G,WAAW,QACtF,OAAOM,kBACP,WAAW2C,SACX,WAAW;YAETlC;QADAU,WAAW;gBACXV,CAAAA,gCAAAA,cAAc,cAAc,AAAD,KAA3BA,8BAAAA,IAAAA,CAAAA;IACF,GACA,UAAU;YAERA;QADAU,WAAW;gBACXV,CAAAA,gCAAAA,cAAc,cAAc,AAAD,KAA3BA,8BAAAA,IAAAA,CAAAA;IACF,IACA;IACJ,EAAEoD;AAEN"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fields/search-entry.jsx","sources":["../../src/fields/search-entry.tsx"],"sourcesContent":["import {\n createAbortController,\n type G9AbortController,\n type G9AbortSignal,\n G9StringKey,\n isAbortError,\n} from '@g9tm/lynxcontrols-foundation';\nimport { forwardRef, type ReactNode, useEffect, useImperativeHandle, useRef, useState } from '@lynx-js/react';\nimport { type G9TimerHandle, startTimer, stopTimer } from '../base/timers';\nimport { useControllableState } from '../base/use-controllable-state';\nimport { useG9Diagnostics, useG9Settings, useG9Strings } from '../provider/hooks';\nimport { type G9EntryVariant, type G9TextEntryHandle, type G9TextEntryProps, TextEntryBody } from './text-entry';\nimport type { G9ValueChangeDetails } from './use-text-input';\n\n/** Context of one search (`onSearch`). */\nexport interface G9SearchContext {\n /** Aborted when a newer query fires or the field unmounts: drop this query's results. */\n readonly signal: G9AbortSignal;\n /** Increases with every fired query; compare to discard a stale result. */\n readonly version: number;\n}\n\n/**\n * Props of {@link G9SearchEntry} (MAUI `G9SearchEntry`).\n *\n * `value` WITHOUT `onValueChange` is the query the parent knows (it learns the typing through `onSearch`, MAUI's two-way\n * `Text` binding): the field keeps what is typed itself and follows `value` whenever the parent changes it (a reset, a\n * restored filter). With `onValueChange` it is an ordinary controlled field.\n */\nexport interface G9SearchEntryProps extends G9TextEntryProps {\n /** Quiet time after the last change before the query fires; `0` fires on every change. Default 250. */\n readonly debounceMs?: number;\n /** The debounced text (MAUI `DebouncedTextChanged`). */\n readonly onDebouncedValueChange?: (value: string) => void;\n /**\n * Runs the search (MAUI `SearchCommand`): after the debounce, on the keyboard's search key and on `submit()`.\n * A newer query aborts the previous one's signal (query versioning). A thrown error or rejected promise (other\n * than an abort) goes to the provider's diagnostics.\n */\n readonly onSearch?: (query: string, context: G9SearchContext) => unknown;\n}\n\n/** Imperative handle of {@link G9SearchEntry}. */\nexport interface G9SearchEntryHandle extends G9TextEntryHandle {\n /** Fires the current text now, skipping the debounce (MAUI `Submit`). */\n submit(): void;\n}\n\n/**\n * Search field (MAUI `G9SearchEntry`): a `G9TextEntry` with a leading search glyph, the clear button, dictation on,\n * the localized `search` placeholder, the floating-label clearance reserved, the keyboard's search key, and a\n * debounced query. Every change of the text (typing, dictation, clear, a new `value` from the parent) restarts the\n * debounce; the search key and `submit()` fire at once. Pending queries never fire after unmount.\n */\nexport const G9SearchEntry = forwardRef<G9SearchEntryHandle, G9SearchEntryProps>(\n function G9SearchEntry(props, ref): ReactNode {\n const glyphs = useG9Settings().glyphs;\n const strings = useG9Strings();\n const diagnostics = useG9Diagnostics();\n // `value` without `onValueChange`: the parent hears the typing only through `onSearch`. Held as a controlled value\n // the field showed the parent's old text after every keystroke — nothing could be typed into AgriPad's five search\n // fields on a phone (2026-11-12; QA set the value directly and never noticed).\n const follows = props.value !== undefined && props.onValueChange === undefined;\n const [controllable, setControllable] = useControllableState<string, [G9ValueChangeDetails]>({\n value: follows ? undefined : props.value,\n defaultValue: props.defaultValue ?? '',\n onChange: props.onValueChange,\n name: 'G9SearchEntry.value',\n });\n const [typed, setTyped] = useState(props.value ?? '');\n useEffect(() => {\n if (follows && props.value !== undefined) setTyped(props.value);\n }, [props.value]);\n const text = follows ? typed : controllable;\n const setText = (value: string, details: G9ValueChangeDetails) => {\n if (follows) setTyped(value);\n else setControllable(value, details);\n };\n const latest = useRef({ text, props });\n latest.current = { text, props };\n const timer = useRef<G9TimerHandle | null>(null);\n const current = useRef<G9AbortController | null>(null);\n const version = useRef(0);\n const inner = useRef<G9TextEntryHandle | null>(null);\n\n const stopDebounce = () => {\n if (timer.current !== null) {\n stopTimer(timer.current);\n timer.current = null;\n }\n };\n const report = (error: unknown) => {\n if (isAbortError(error)) return;\n diagnostics.log({ level: 'error', message: 'G9SearchEntry.onSearch failed.', source: 'G9SearchEntry', error });\n };\n const fire = (value: string) => {\n const p = latest.current.props;\n current.current?.abort();\n const controller = createAbortController();\n current.current = controller;\n version.current += 1;\n try {\n p.onDebouncedValueChange?.(value);\n const result = p.onSearch?.(value, { signal: controller.signal, version: version.current });\n if (result && typeof (result as PromiseLike<unknown>).then === 'function') {\n (result as PromiseLike<unknown>).then(undefined, report);\n }\n } catch (error) {\n report(error);\n }\n };\n const submit = () => {\n stopDebounce();\n fire(latest.current.text);\n };\n\n const first = useRef(true);\n useEffect(() => {\n if (first.current) {\n first.current = false;\n return;\n }\n const ms = latest.current.props.debounceMs ?? 250;\n stopDebounce();\n if (ms <= 0) {\n fire(text);\n return;\n }\n timer.current = startTimer(() => {\n timer.current = null;\n fire(latest.current.text);\n }, ms);\n }, [text]);\n\n useEffect(\n () => () => {\n stopDebounce();\n current.current?.abort();\n },\n [],\n );\n\n useImperativeHandle(ref, () => {\n const base = inner.current as G9TextEntryHandle;\n return {\n focus: () => base.focus(),\n blur: () => base.blur(),\n validate: () => base.validate(),\n get isListening() {\n return base.isListening;\n },\n toggleVoice: () => base.toggleVoice(),\n startVoice: () => base.startVoice(),\n stopVoice: () => base.stopVoice(),\n get element() {\n return base.element;\n },\n submit,\n };\n });\n\n const variant: G9EntryVariant = {\n name: 'G9SearchEntry.value',\n restingTone: 'placeholder',\n confirmType: 'search',\n onConfirm: submit,\n };\n return (\n <TextEntryBody\n {...props}\n leadingIcon={props.leadingIcon === undefined ? glyphs.search : props.leadingIcon}\n clearButton={props.clearButton ?? true}\n voiceEnabled={props.voiceEnabled ?? true}\n placeholder={props.placeholder === undefined ? strings.get(G9StringKey.Search) : props.placeholder}\n reserveFloatingLabelClearance={props.reserveFloatingLabelClearance ?? true}\n value={text}\n onValueChange={(value, details) => setText(value, details)}\n variant={variant}\n ref={inner}\n />\n );\n },\n);\n"],"names":["G9SearchEntry","forwardRef","props","ref","_props_defaultValue","_props_value","_props_clearButton","_props_voiceEnabled","_props_reserveFloatingLabelClearance","glyphs","useG9Settings","strings","useG9Strings","diagnostics","useG9Diagnostics","follows","undefined","controllable","setControllable","useControllableState","typed","setTyped","useState","useEffect","text","setText","value","details","latest","useRef","timer","current","version","inner","stopDebounce","stopTimer","report","error","isAbortError","fire","_current_current","p","controller","createAbortController","result","submit","first","_latest_current_props_debounceMs","ms","startTimer","useImperativeHandle","base","variant","TextEntryBody","G9StringKey"],"mappings":";;;;;;AAsDO,MAAMA,6BAAgBC,WAC3B,SAAuBC,KAAK,EAAEC,GAAG;QAUfC,qBAImBC,cAsGlBC,oBACCC,qBAEiBC;IAtHnC,MAAMC,SAASC,gBAAgB,MAAM;IACrC,MAAMC,UAAUC;IAChB,MAAMC,cAAcC;IAIpB,MAAMC,UAAUb,AAAgBc,WAAhBd,MAAM,KAAK,IAAkBA,AAAwBc,WAAxBd,MAAM,aAAa;IAChE,MAAM,CAACe,cAAcC,gBAAgB,GAAGC,qBAAqD;QAC3F,OAAOJ,UAAUC,SAAYd,MAAM,KAAK;QACxC,cAAc,QAAAE,CAAAA,sBAAAA,MAAM,YAAY,AAAD,IAAjBA,sBAAsB;QACpC,UAAUF,MAAM,aAAa;QAC7B,MAAM;IACR;IACA,MAAM,CAACkB,OAAOC,SAAS,GAAGC,SAAS,QAAAjB,CAAAA,eAAAA,MAAM,KAAK,AAAD,IAAVA,eAAe;IAClDkB,UAAU;QACR,IAAIR,WAAWb,AAAgBc,WAAhBd,MAAM,KAAK,EAAgBmB,SAASnB,MAAM,KAAK;IAChE,GAAG;QAACA,MAAM,KAAK;KAAC;IAChB,MAAMsB,OAAOT,UAAUK,QAAQH;IAC/B,MAAMQ,UAAU,CAACC,OAAeC;QAC9B,IAAIZ,SAASM,SAASK;aACjBR,gBAAgBQ,OAAOC;IAC9B;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,YAAY,MAAM,IAAIpD,MAAM,WAAW,EAClG,+BAA+B,QAAAM,CAAAA,uCAAAA,MAAM,6BAA6B,AAAD,IAAlCA,uCAAuC,MACtE,OAAOgB,MACP,eAAe,CAACE,OAAOC,UAAYF,QAAQC,OAAOC,UAClD,SAASyB,SACT,KAAKnB;AAGX"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fields/slot-layout.jsx","sources":["../../src/fields/slot-layout.ts"],"sourcesContent":["import { G9Metrics } from '@g9tm/lynxcontrols-foundation';\n\n// MAUI `G9FieldSlotLayout` (Controls/Shared/G9FieldSlotLayout.cs): where an outlined field's icons sit and how far\n// its inner content and floating label move. Columns are PHYSICAL (0 = left, 2 = right), as in MAUI.\n\n/** Inputs of the slot layout. */\nexport interface G9FieldSlotLayoutInput {\n readonly hasLeadingIcon: boolean;\n readonly hasTrailingIcon: boolean;\n readonly isRtl: boolean;\n /** Pin the trailing icon to the physical right in both directions. */\n readonly forceTrailingIconRight: boolean;\n /** Pin the leading icon to the physical left in both directions. */\n readonly forceLeadingIconLeft: boolean;\n}\n\n/** Physical padding (logical pixels). */\nexport interface G9PhysicalPadding {\n readonly left: number;\n readonly top: number;\n readonly right: number;\n readonly bottom: number;\n}\n\n/** Everything the field derives from {@link G9FieldSlotLayoutInput}. */\nexport interface G9FieldSlotLayout {\n /** Physical column of the leading icon: 0 (left) or 2 (right). */\n readonly leadingColumn: 0 | 2;\n /** Physical column of the trailing icon: 0 (left) or 2 (right). */\n readonly trailingColumn: 0 | 2;\n /** Inner content padding: 0 on a side with an icon, `InputHorizontalPadding` otherwise, plus the control's own. */\n readonly innerPadding: G9PhysicalPadding;\n /** Label X translation at rest (physical pixels; negative is left). */\n readonly labelRestX: number;\n /** Extra label X translation when floated. */\n readonly labelFloatedX: number;\n}\n\nconst zero: G9PhysicalPadding = Object.freeze({ left: 0, top: 0, right: 0, bottom: 0 });\n\n/** Resolves the slot layout (MAUI `ResolvePhysical*Column`, `ResolveInnerPadding`, `ResolveLabel*TranslationX`). */\nexport function resolveFieldSlotLayout(\n input: G9FieldSlotLayoutInput,\n perControlPadding: G9PhysicalPadding = zero,\n): G9FieldSlotLayout {\n const leadingColumn: 0 | 2 = input.forceLeadingIconLeft ? 0 : input.isRtl ? 2 : 0;\n const trailingColumn: 0 | 2 = input.forceTrailingIconRight ? 2 : input.isRtl ? 0 : 2;\n const iconLeft = (input.hasLeadingIcon && leadingColumn === 0) || (input.hasTrailingIcon && trailingColumn === 0);\n const iconRight = (input.hasLeadingIcon && leadingColumn === 2) || (input.hasTrailingIcon && trailingColumn === 2);\n const pad = G9Metrics.InputHorizontalPadding;\n let labelRestX = 0;\n if (input.hasLeadingIcon) {\n if (!(input.isRtl && input.forceLeadingIconLeft)) {\n labelRestX = input.isRtl ? -G9Metrics.InputLabelLeadingIconOffset : G9Metrics.InputLabelLeadingIconOffset;\n }\n } else if (input.isRtl && input.forceTrailingIconRight && input.hasTrailingIcon) {\n labelRestX = -(G9Metrics.TrailingIconSlotWidth - pad);\n }\n return {\n leadingColumn,\n trailingColumn,\n innerPadding: {\n left: (iconLeft ? 0 : pad) + perControlPadding.left,\n top: perControlPadding.top,\n right: (iconRight ? 0 : pad) + perControlPadding.right,\n bottom: perControlPadding.bottom,\n },\n labelRestX,\n labelFloatedX: input.isRtl ? -G9Metrics.FloatingLabelFloatedExtraX : G9Metrics.FloatingLabelFloatedExtraX,\n };\n}\n"],"names":["zero","Object","resolveFieldSlotLayout","input","perControlPadding","leadingColumn","trailingColumn","iconLeft","iconRight","pad","G9Metrics","labelRestX"],"mappings":";AAsCA,MAAMA,OAA0BC,OAAO,MAAM,CAAC;IAAE,MAAM;IAAG,KAAK;IAAG,OAAO;IAAG,QAAQ;AAAE;AAG9E,SAASC,uBACdC,KAA6B,EAC7BC,oBAAuCJ,IAAI;IAE3C,MAAMK,gBAAuBF,MAAM,oBAAoB,GAAG,IAAIA,MAAM,KAAK,GAAG,IAAI;IAChF,MAAMG,iBAAwBH,MAAM,sBAAsB,GAAG,IAAIA,MAAM,KAAK,GAAG,IAAI;IACnF,MAAMI,WAAYJ,MAAM,cAAc,IAAIE,AAAkB,MAAlBA,iBAAyBF,MAAM,eAAe,IAAIG,AAAmB,MAAnBA;IAC5F,MAAME,YAAaL,MAAM,cAAc,IAAIE,AAAkB,MAAlBA,iBAAyBF,MAAM,eAAe,IAAIG,AAAmB,MAAnBA;IAC7F,MAAMG,MAAMC,UAAU,sBAAsB;IAC5C,IAAIC,aAAa;IACjB,IAAIR,MAAM,cAAc,EACtB;QAAA,IAAI,CAAEA,CAAAA,MAAM,KAAK,IAAIA,MAAM,oBAAmB,GAC5CQ,aAAaR,MAAM,KAAK,GAAG,CAACO,UAAU,2BAA2B,GAAGA,UAAU,2BAA2B;IAC3G,OACK,IAAIP,MAAM,KAAK,IAAIA,MAAM,sBAAsB,IAAIA,MAAM,eAAe,EAC7EQ,aAAa,CAAED,CAAAA,UAAU,qBAAqB,GAAGD,GAAE;IAErD,OAAO;QACLJ;QACAC;QACA,cAAc;YACZ,MAAOC,AAAAA,CAAAA,WAAW,IAAIE,GAAE,IAAKL,kBAAkB,IAAI;YACnD,KAAKA,kBAAkB,GAAG;YAC1B,OAAQI,AAAAA,CAAAA,YAAY,IAAIC,GAAE,IAAKL,kBAAkB,KAAK;YACtD,QAAQA,kBAAkB,MAAM;QAClC;QACAO;QACA,eAAeR,MAAM,KAAK,GAAG,CAACO,UAAU,0BAA0B,GAAGA,UAAU,0BAA0B;IAC3G;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fields/text-entry.jsx","sources":["../../src/fields/text-entry.tsx"],"sourcesContent":["import { G9KeyboardType, G9StringKey } from '@g9tm/lynxcontrols-foundation';\nimport { forwardRef, type ReactNode, useImperativeHandle } from '@lynx-js/react';\nimport { useG9Settings, useG9Strings } from '../provider/hooks';\nimport { resolveEffectiveKeyboard, resolveInputElementType } from './input-policy';\nimport { G9OutlinedField, type G9TrailingAffordance, resolveInnerHint } from './outlined-field';\nimport { type G9TextInputHandle, type G9TextInputProps, useTextInput } from './use-text-input';\nimport type { G9TextValidator } from './validator';\n\n/** Props of {@link G9TextEntry} (MAUI `G9TextEntry`). */\nexport interface G9TextEntryProps extends G9TextInputProps {\n /** Eye toggle in the trailing slot while there is a value; pins the trailing icon right. Default false. */\n readonly passwordToggle?: boolean;\n /** Mask the value (until the eye reveals it); the text is pinned LTR. Default false. */\n readonly isPassword?: boolean;\n /** Clear (×) button in the trailing slot while there is a value. Default false. */\n readonly clearButton?: boolean;\n /** Extra validation, run before the input-type rule (on blur, `validateOnTextChanged`, `validate()`). */\n readonly validator?: G9TextValidator | null;\n /** Validate on every change, not only on blur. Default false. */\n readonly validateOnTextChanged?: boolean;\n /** Keyboard confirm key. Default `'done'`. */\n readonly confirmType?: 'send' | 'search' | 'go' | 'done' | 'next';\n /** iOS spell checking (`ios-spell-check`; Android has no attribute). Default true. */\n readonly isSpellCheckEnabled?: boolean;\n /** iOS auto-correct / prediction (`ios-auto-correct`). Default true. */\n readonly isTextPredictionEnabled?: boolean;\n}\n\n/** Imperative handle of {@link G9TextEntry}. */\nexport type G9TextEntryHandle = G9TextInputHandle;\n\n/**\n * Whether the trailing slot shows the microphone (MAUI `ShouldShowVoiceMic`): dictation available, not while the\n * password eye owns the slot, and only on an empty field or during a session (the clear button owns a filled field).\n */\nexport function shouldShowEntryMic(state: {\n readonly available: boolean;\n readonly listening: boolean;\n readonly hasValue: boolean;\n readonly passwordToggle: boolean;\n}): boolean {\n return state.available && !(state.passwordToggle && state.hasValue) && (state.listening || !state.hasValue);\n}\n\n/** What `G9SearchEntry` changes in the entry (internal). */\nexport interface G9EntryVariant {\n readonly name: string;\n readonly restingTone?: 'outline' | 'placeholder';\n readonly confirmType?: G9TextEntryProps['confirmType'];\n readonly onConfirm?: (value: string) => void;\n}\n\ninterface BodyProps extends G9TextEntryProps {\n readonly variant: G9EntryVariant;\n}\n\n/**\n * The entry body shared by `G9TextEntry` and `G9SearchEntry` (internal). The inner name must differ from the binding\n * (E20, scripts/check-dist-jsx.mjs): `G9TextEntry` renders it in this module.\n */\nexport const TextEntryBody = forwardRef<G9TextEntryHandle, BodyProps>(\n function TextEntryBodyRender(props, ref): ReactNode {\n const glyphs = useG9Settings().glyphs;\n const strings = useG9Strings();\n const passwordToggle = props.passwordToggle === true;\n const core = useTextInput(\n { ...props, ...(props.variant.onConfirm ? { onConfirm: props.variant.onConfirm } : {}) },\n {\n name: props.variant.name,\n validator: props.validator ?? null,\n validateOnTextChanged: props.validateOnTextChanged === true,\n isPassword: props.isPassword === true,\n showMic: (s) => shouldShowEntryMic({ ...s, passwordToggle }),\n },\n );\n useImperativeHandle(ref, () => core.handle);\n\n let affordance: G9TrailingAffordance | null = null;\n if (passwordToggle && core.hasValue) {\n affordance = {\n icon: core.passwordVisible ? glyphs.eyeClosed : glyphs.eyeOpen,\n signature: core.passwordVisible ? 'eye-closed' : 'eye-open',\n onPress: () => core.setPasswordVisible(!core.passwordVisible),\n };\n } else if (core.showMic) {\n affordance = {\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 } else if (props.clearButton === true && core.hasValue) {\n affordance = {\n icon: glyphs.clear,\n label: strings.get(G9StringKey.Clear),\n signature: 'clear',\n onPress: () => core.setText('', { source: 'clear' }),\n };\n }\n\n const masked = props.isPassword === true && !core.passwordVisible;\n const keyboard = resolveEffectiveKeyboard(core.inputType, props.keyboardType ?? G9KeyboardType.Default);\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 hasError={core.hasError}\n errorText={core.errorText ?? null}\n forceTrailingIconRight={props.forceTrailingIconRight === true || passwordToggle}\n focused={core.focused}\n hasValue={core.hasValue}\n textLength={core.text.length}\n trailingAffordance={affordance}\n restingTone={props.variant.restingTone ?? 'outline'}\n onFocusRequest={core.focus}\n >\n {/* A read-only (unmasked) field shows its value as text: nobody types into it, and a native read-only\n EditText ignored the value pushed into it (a scan-only barcode field stayed blank). */}\n {props.readOnly === true && !masked ? (\n <text\n className=\"g9-field__input g9-field__input--readonly\"\n text-maxline=\"1\"\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 }}\n >\n {core.text}\n </text>\n ) : (\n <input\n {...core.elementProps}\n className=\"g9-field__input\"\n type={resolveInputElementType(core.inputType, keyboard, masked)}\n confirm-type={props.variant.confirmType ?? props.confirmType ?? 'done'}\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 }}\n />\n )}\n </G9OutlinedField>\n );\n },\n);\n\nconst entryVariant: G9EntryVariant = { name: 'G9TextEntry.value' };\n\n/**\n * Single-line outlined text field (MAUI `G9TextEntry`): floating label, input-type keyboard/filter/validation,\n * password eye, clear button, optional dictation (`voiceEnabled` + `services.speech`).\n *\n * - Value: `value`/`defaultValue`/`onValueChange(value, { source })`; one call per change.\n * - Validation: on blur when there is a rule (`validator`, email/url, custom pattern), on every change with\n * `validateOnTextChanged`, or through the handle's `validate()`. An error set through `hasError`/`errorText`\n * survives blur on a field without a rule.\n * - Requires the host's `xelement-input` registration (plan/specs/02 §2). Keyboard avoidance: put the form inside\n * lynx-ui `KeyboardAwareRoot`/`KeyboardAwareResponder`; the field reports focus to it.\n */\nexport const G9TextEntry = forwardRef<G9TextEntryHandle, G9TextEntryProps>(function G9TextEntry(props, ref) {\n return <TextEntryBody {...props} variant={entryVariant} ref={ref} />;\n});\n"],"names":["shouldShowEntryMic","state","TextEntryBody","forwardRef","props","ref","_props_validator","_props_keyboardType","_core_errorText","_props_variant_restingTone","_ref","glyphs","useG9Settings","strings","useG9Strings","passwordToggle","core","useTextInput","s","useImperativeHandle","affordance","G9StringKey","masked","keyboard","resolveEffectiveKeyboard","G9KeyboardType","G9OutlinedField","_props_label","v","resolveInnerHint","text","input","resolveInputElementType","entryVariant","G9TextEntry"],"mappings":";;;;;;AAmCO,SAASA,mBAAmBC,KAKlC;IACC,OAAOA,MAAM,SAAS,IAAI,CAAEA,CAAAA,MAAM,cAAc,IAAIA,MAAM,QAAO,KAAOA,CAAAA,MAAM,SAAS,IAAI,CAACA,MAAM,QAAO;AAC3G;AAkBO,MAAMC,gBAAgBC,WAC3B,SAA6BC,KAAK,EAAEC,GAAG;QAQtBC,kBAgC2CC,qBAkB3CC,iBAMEC,4BAuBKC,MAAAA;IAtFtB,MAAMC,SAASC,gBAAgB,MAAM;IACrC,MAAMC,UAAUC;IAChB,MAAMC,iBAAiBX,AAAyB,SAAzBA,MAAM,cAAc;IAC3C,MAAMY,OAAOC,aACX;QAAE,GAAGb,KAAK;QAAE,GAAIA,MAAM,OAAO,CAAC,SAAS,GAAG;YAAE,WAAWA,MAAM,OAAO,CAAC,SAAS;QAAC,IAAI,CAAC,CAAC;IAAE,GACvF;QACE,MAAMA,MAAM,OAAO,CAAC,IAAI;QACxB,WAAW,QAAAE,CAAAA,mBAAAA,MAAM,SAAS,AAAD,IAAdA,mBAAmB;QAC9B,uBAAuBF,AAAgC,SAAhCA,MAAM,qBAAqB;QAClD,YAAYA,AAAqB,SAArBA,MAAM,UAAU;QAC5B,SAAS,CAACc,IAAMlB,mBAAmB;gBAAE,GAAGkB,CAAC;gBAAEH;YAAe;IAC5D;IAEFI,oBAAoBd,KAAK,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AAI;QAAC,IAAI,CAAC,CAAC;QAC9C,OAAOZ,MAAM,QAAQ,GAAG,4BAA4B;IACtD,KAEF;MACJ,EAAEsB;AAEN;AAGF,MAAMO,eAA+B;IAAE,MAAM;AAAoB;AAa1D,MAAMC,yBAAc/B,WAAgD,SAAqBC,KAAK,EAAEC,GAAG;IACxG,QAAQH,eAAe,GAAGE,KAAK,EAAE,SAAS6B,cAAc,KAAK5B;AAC/D"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fields/use-dictation.jsx","sources":["../../src/fields/use-dictation.ts"],"sourcesContent":["import { useEffect, useRef, useState } from '@lynx-js/react';\nimport { useG9Culture, useG9OptionalService, useG9Strings } from '../provider/hooks';\nimport { G9VoiceDictation } from './dictation';\n\n/** Options of {@link useDictation}. */\nexport interface G9DictationOptions {\n /** Whether the field offers dictation at all (`voiceEnabled`). Availability is not checked while `false`. */\n readonly enabled: boolean;\n /** Locale to recognise; `null`/`undefined` follows the active culture (MAUI `VoiceCulture`). */\n readonly locale?: string | null;\n /** The field's current text. */\n readonly readText: () => string;\n /** Writes recognised text (the field filters it like typed text). */\n readonly writeText: (text: string) => void;\n readonly onListeningStarted?: () => void;\n readonly onListeningEnded?: () => void;\n readonly onFailed?: (message: string) => void;\n}\n\n/** What {@link useDictation} returns. */\nexport interface G9DictationState {\n /** `services.speech` exists, the field enabled dictation and the recogniser reported this locale available. */\n readonly available: boolean;\n /** A session is listening. */\n readonly listening: boolean;\n /** A session exists (listening or waiting for the permission prompt). */\n readonly active: boolean;\n start(): Promise<void>;\n stop(): Promise<void>;\n toggle(): Promise<void>;\n}\n\n/**\n * The dictation session owner shared by `G9TextEntry`, `G9Editor` and `G9SearchEntry` (MAUI `G9VoiceDictation` +\n * `G9Speech.IsAvailable`). Optional service: without `services.speech` the microphone is never shown. Availability\n * is asked once per locale (`isAvailable(locale)`, no prompt); a stale answer for a previous locale is ignored.\n * Permission is requested on every start, from the tap. A running session stops when the field unmounts.\n */\nexport function useDictation(options: G9DictationOptions): G9DictationState {\n const speech = useG9OptionalService('speech');\n const culture = useG9Culture();\n const strings = useG9Strings();\n const locale = options.locale ?? culture.locale;\n const [, setVersion] = useState(0);\n const [available, setAvailable] = useState(false);\n const latest = useRef({ options, strings, locale, speech });\n latest.current = { options, strings, locale, speech };\n\n const dictation = useRef<G9VoiceDictation | null>(null);\n if (!dictation.current) {\n dictation.current = new G9VoiceDictation({\n get speech() {\n return latest.current.speech;\n },\n readText: () => latest.current.options.readText(),\n writeText: (text) => latest.current.options.writeText(text),\n onStateChanged: () => setVersion((n) => n + 1),\n strings: () => latest.current.strings,\n locale: () => latest.current.locale,\n onListeningStarted: () => latest.current.options.onListeningStarted?.(),\n onListeningEnded: () => latest.current.options.onListeningEnded?.(),\n onFailed: (message) => latest.current.options.onFailed?.(message),\n });\n }\n const session = dictation.current;\n\n useEffect(() => {\n if (!options.enabled || !speech) {\n setAvailable(false);\n return;\n }\n let current = true;\n speech.isAvailable(locale).then(\n (ok) => {\n if (current) setAvailable(ok === true);\n },\n () => {\n if (current) setAvailable(false);\n },\n );\n return () => {\n current = false;\n };\n }, [options.enabled, speech, locale]);\n\n useEffect(\n () => () => {\n void session.stop();\n },\n [session],\n );\n\n return {\n available: options.enabled && speech !== undefined && available,\n listening: session.isListening,\n active: session.hasSession,\n start: () => session.start(),\n stop: () => session.stop(),\n toggle: () => session.toggle(),\n };\n}\n"],"names":["useDictation","options","_options_locale","speech","useG9OptionalService","culture","useG9Culture","strings","useG9Strings","locale","setVersion","useState","available","setAvailable","latest","useRef","dictation","G9VoiceDictation","text","n","_latest_current_options","message","session","useEffect","current","ok","undefined"],"mappings":";;;AAsCO,SAASA,aAAaC,OAA2B;QAIvCC;IAHf,MAAMC,SAASC,qBAAqB;IACpC,MAAMC,UAAUC;IAChB,MAAMC,UAAUC;IAChB,MAAMC,SAAS,QAAAP,CAAAA,kBAAAA,QAAQ,MAAM,AAAD,IAAbA,kBAAkBG,QAAQ,MAAM;IAC/C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O,IAAI,CAACE,QAAQ,YAC/BU,aAAa;QAGf,IAAIW,UAAU;QACdrB,OAAO,WAAW,CAACM,QAAQ,IAAI,CAC7B,CAACgB;YACC,IAAID,SAASX,aAAaY,AAAO,SAAPA;QAC5B,GACA;YACE,IAAID,SAASX,aAAa;QAC5B;QAEF,OAAO;YACLW,UAAU;QACZ;IACF,GAAG;QAACvB,QAAQ,OAAO;QAAEE;QAAQM;KAAO;IAEpCc,UACE,IAAM;YACCD,QAAQ,IAAI;QACnB,GACA;QAACA;KAAQ;IAGX,OAAO;QACL,WAAWrB,QAAQ,OAAO,IAAIE,AAAWuB,WAAXvB,UAAwBS;QACtD,WAAWU,QAAQ,WAAW;QAC9B,QAAQA,QAAQ,UAAU;QAC1B,OAAO,IAAMA,QAAQ,KAAK;QAC1B,MAAM,IAAMA,QAAQ,IAAI;QACxB,QAAQ,IAAMA,QAAQ,MAAM;IAC9B;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fields/use-text-input.jsx","sources":["../../src/fields/use-text-input.ts"],"sourcesContent":["import {\n G9InputType,\n type G9KeyboardType,\n G9NumberingSystem,\n G9TextInputDirection,\n} from '@g9tm/lynxcontrols-foundation';\nimport { KeyboardAwareTriggerContext } from '@lynx-js/lynx-ui-input';\nimport { useContext, useEffect, useRef, useState } from '@lynx-js/react';\nimport type { NodesRef } from '@lynx-js/types';\nimport { startTimer } from '../base/timers';\nimport { useControllableState } from '../base/use-controllable-state';\nimport { g9KeyboardTargetProps } from '../host/keyboard';\nimport { useG9Culture, useG9Strings } from '../provider/hooks';\nimport {\n inputTypeHasValidationRule,\n inputTypePrefersLeftToRight,\n sanitizeInputText,\n validateInputText,\n} from './input-policy';\nimport type { G9OutlinedFieldProps } from './outlined-field';\nimport { useDictation } from './use-dictation';\nimport { type G9TextValidator, runTextValidator } from './validator';\n\n/** Where a value change came from (plan/specs/03 §3). */\nexport type G9ValueChangeSource = 'user' | 'dictation' | 'clear' | 'programmatic';\n\n/** Payload of `onValueChange`. */\nexport interface G9ValueChangeDetails {\n readonly source: G9ValueChangeSource;\n}\n\n/** Props the text inputs (`G9TextEntry`, `G9Editor`, `G9SearchEntry`) share on top of the outlined-field props. */\nexport interface G9TextInputProps extends G9OutlinedFieldProps {\n /** The text (controlled; MAUI `Text`). Present, the caller owns it and must apply `onValueChange`. */\n readonly value?: string;\n /** Initial text while uncontrolled. Default `''`. */\n readonly defaultValue?: string;\n /**\n * Once per change of the field's value, with where it came from: `'user'` (typing, paste), `'dictation'`,\n * `'clear'` (the clear button) or `'programmatic'` (the field re-filtered a value it was given, e.g. after an\n * `inputType` change). Never for a value the parent pushed in that needed no filtering.\n */\n readonly onValueChange?: (value: string, details: G9ValueChangeDetails) => void;\n /** On-screen keyboard; used when `inputType` is `'default'` (any other type picks its own). Default `'default'`. */\n readonly keyboardType?: G9KeyboardType;\n /** Semantic input type: keyboard, live filter and blur validation. Default `'default'`. */\n readonly inputType?: G9InputType;\n /** Per-character filter regex (a single character class) for `inputType: 'custom'`. */\n readonly allowedCharsPattern?: string | null;\n /** Blur validation regex for `inputType: 'custom'`. An invalid pattern fails closed. */\n readonly validationPattern?: string | null;\n /** Message for a failed type validation; default the culture's `invalidEmail` / `invalidUrl` / `invalidValue`. */\n readonly validationErrorText?: string | null;\n /** Direction of the entered text; `'matchParent'` (default) pins numbers, phone, email, URL and passwords LTR. */\n readonly inputTextDirection?: G9TextInputDirection;\n /** Font family of the entered text; default the culture's font. */\n readonly customFont?: string | null;\n /** Offer dictation through `services.speech` (hidden without the service or recogniser). Default false. */\n readonly voiceEnabled?: boolean;\n /** Locale to recognise (MAUI `VoiceCulture`); default the active culture. */\n readonly voiceLocale?: string | null;\n readonly onVoiceListeningStarted?: () => void;\n readonly onVoiceListeningEnded?: () => void;\n /** Dictation could not run or finish; a localized message for a toast. */\n readonly onVoiceFailed?: (message: string) => void;\n /** Validation ran (blur, `validateOnTextChanged` or `validate()`): the message, or `null` when valid. */\n readonly onValidationChange?: (message: string | null) => void;\n readonly onFocus?: () => void;\n readonly onBlur?: () => void;\n /** The keyboard's confirm key was pressed. */\n readonly onConfirm?: (value: string) => void;\n /** Element id of the inner `<input>`/`<textarea>`. */\n readonly inputId?: string;\n}\n\n/** Imperative handle of the text inputs (MAUI public methods). */\nexport interface G9TextInputHandle {\n /** Focuses the inner element (raises the keyboard). */\n focus(): void;\n /** Removes focus (hides the keyboard). */\n blur(): void;\n /** Runs the validator and the type rule now; sets or clears the error; `true` when valid (MAUI `Validate`). */\n validate(): boolean;\n /** `true` while dictating (MAUI `IsListening`). */\n readonly isListening: boolean;\n /** MAUI `ToggleVoiceAsync`. */\n toggleVoice(): Promise<void>;\n /** MAUI `StartVoiceAsync`. */\n startVoice(): Promise<void>;\n /** MAUI `StopVoiceAsync`; safe when nothing runs. */\n stopVoice(): Promise<void>;\n /** The inner element's node ref (MAUI `InnerEntry` / `InnerEditor`), for `invoke` calls G9 does not wrap. */\n readonly element: G9NodeRef | null;\n}\n\n/** The Lynx node ref of a field's inner element. */\nexport type G9NodeRef = NodesRef;\n\n/** Lynx input event detail. */\ninterface InputDetail {\n readonly value?: string;\n readonly isComposing?: boolean;\n}\n\n/** Resolves the entered text's direction (MAUI `ResolveInputFlowDirection`). */\nexport function resolveInputTextDirection(\n inputTextDirection: G9TextInputDirection,\n inputType: G9InputType,\n isPassword: boolean,\n cultureDirection: 'ltr' | 'rtl',\n): 'ltr' | 'rtl' {\n if (inputTextDirection === G9TextInputDirection.LeftToRight) return 'ltr';\n if (inputTextDirection === G9TextInputDirection.RightToLeft) return 'rtl';\n if (inputTypePrefersLeftToRight(inputType) || isPassword) return 'ltr';\n return cultureDirection;\n}\n\n/** What the native field draws for its ASCII digits: `g9-digits` / `g9-decimal-separator` (lynxcontrols-native). */\nexport interface G9FieldDigits {\n readonly system: G9NumberingSystem;\n readonly decimalSeparator: string;\n}\n\n/**\n * The digits a field DRAWS (MAUI: the culture's FaNum font draws «15» as «۱۵» in every entry): the culture's numbering\n * system, and «٫» for the '.' of a decimal field. The text stays ASCII — what is typed, the value events and what is\n * stored never change (AgriPad owner, 2026-11-02). A custom font or a password draws ASCII, as in MAUI.\n */\nexport function resolveFieldDigits(\n numberingSystem: G9NumberingSystem,\n inputType: G9InputType,\n hasCustomFont: boolean,\n isPassword: boolean,\n): G9FieldDigits {\n if (hasCustomFont || isPassword || numberingSystem === G9NumberingSystem.Latin) {\n return { system: G9NumberingSystem.Latin, decimalSeparator: '' };\n }\n const decimal = inputType === G9InputType.Decimal || inputType === G9InputType.SignedDecimal;\n return { system: numberingSystem, decimalSeparator: decimal ? '٫' : '' };\n}\n\n/** Calls a UI method on a node; a missing node or a failing call is ignored (the element is gone). */\nexport function invokeNode(\n ref: { current: G9NodeRef | null },\n method: string,\n params?: Record<string, unknown>,\n): boolean {\n const node = ref.current;\n if (!node) return false;\n try {\n node\n .invoke({\n method,\n ...(params ? { params } : {}),\n success: () => {},\n fail: () => {},\n })\n .exec();\n } catch {\n // The element was unmounted between the call and its execution.\n return false;\n }\n return true;\n}\n\n/**\n * {@link invokeNode}, retried on the next ticks (up to `attempts` times) while the element is not created natively\n * yet, e.g. a focus requested during the first commit.\n */\nexport function invokeNodeWhenReady(\n ref: { current: G9NodeRef | null },\n method: string,\n params?: Record<string, unknown>,\n attempts = 5,\n): void {\n if (invokeNode(ref, method, params) || attempts <= 0) return;\n startTimer(() => invokeNodeWhenReady(ref, method, params, attempts - 1), 0);\n}\n\ninterface ValidationResult {\n readonly message: string | null;\n // The external error props this result overrides; new props from the parent win again.\n readonly hasError: boolean | undefined;\n readonly errorText: string | null | undefined;\n}\n\n/** Options of {@link useTextInput}. */\nexport interface G9TextInputCoreOptions {\n /** Name for the controlled/uncontrolled diagnostic, e.g. `'G9TextEntry.value'`. */\n readonly name: string;\n /** Whether the microphone is shown, given the dictation and value state. */\n readonly showMic: (state: { available: boolean; listening: boolean; hasValue: boolean }) => boolean;\n /** Extra validator (`G9TextEntry.validator`; the editor has none). */\n readonly validator?: G9TextValidator | null;\n /** Validate on every change (`G9TextEntry.validateOnTextChanged`). */\n readonly validateOnTextChanged?: boolean;\n /** A password field (its text is pinned LTR). */\n readonly isPassword?: boolean;\n}\n\n/**\n * The state machine behind the text inputs: value ownership, the live filter, the native element sync, focus,\n * validation and dictation. Returns what the input element and the outlined frame need.\n */\nexport function useTextInput(props: G9TextInputProps, options: G9TextInputCoreOptions) {\n const culture = useG9Culture();\n const strings = useG9Strings();\n const keyboardAware = useContext(KeyboardAwareTriggerContext);\n const inputType = props.inputType ?? G9InputType.Default;\n // The decimal separator the FIELD holds is always the ASCII '.', whatever the culture: Lynx's native `digit` input\n // accepts only ASCII digits and '.', and silently dropped the Persian '٫' — 1.6 showed (and would be edited) as 16\n // (AgriPad's harvest weights, 2026-11-02). A typed '٫' still normalises to '.' (filterDecimal); the digits themselves\n // are drawn Persian by the app's font. decimalSeparatorFor stays for callers that format text for display.\n const separator = '.';\n const sanitize = (raw: string) => sanitizeInputText(inputType, raw, props.allowedCharsPattern, separator);\n\n const [text, setText] = useControllableState<string, [G9ValueChangeDetails]>({\n value: props.value,\n defaultValue: props.defaultValue ?? '',\n onChange: props.onValueChange,\n name: options.name,\n });\n const display = sanitize(text);\n const latestText = useRef(display);\n latestText.current = display;\n\n const elementRef = useRef<NodesRef | null>(null);\n const native = useRef('');\n /** The last native input event was an IME composition (its commit may repeat the composed text). */\n const composingRef = useRef(false);\n /**\n * The field's value while the keyboard composes. A re-render that still shows it must not write it over the native text:\n * that wiped what was being typed. A keyboard with suggestions keeps a whole word, even «4041234», composing until the\n * focus moves, and moving the focus re-renders the form. The sign-in fields emptied themselves on a real phone (AgriPad,\n * 2026-11-12). `adb input text` never composes, so an emulator could not show it.\n */\n const composedFrom = useRef<string | null>(null);\n const [focused, setFocused] = useState(false);\n const focusedRef = useRef(false);\n const [passwordVisible, setPasswordVisible] = useState(false);\n const [, bump] = useState(0);\n const [validation, setValidation] = useState<ValidationResult | null>(null);\n const hasValue = display !== '';\n\n const runValidation = (value: string): boolean => {\n const message =\n runTextValidator(options.validator, value) ??\n validateInputText(inputType, value, props.validationPattern, props.validationErrorText, strings);\n setValidation({ message, hasError: props.hasError, errorText: props.errorText });\n props.onValidationChange?.(message);\n return message === null;\n };\n const hasRule = options.validator != null || inputTypeHasValidationRule(inputType, props.validationPattern);\n\n const dictation = useDictation({\n enabled: props.voiceEnabled === true,\n locale: props.voiceLocale ?? null,\n readText: () => latestText.current,\n writeText: (value) => {\n setText(sanitize(value), { source: 'dictation' });\n },\n ...(props.onVoiceListeningStarted ? { onListeningStarted: props.onVoiceListeningStarted } : {}),\n ...(props.onVoiceListeningEnded ? { onListeningEnded: props.onVoiceListeningEnded } : {}),\n ...(props.onVoiceFailed ? { onFailed: props.onVoiceFailed } : {}),\n });\n\n // A value the field was given that its filter rejects is replaced once (MAUI OnTextChanged writes it back).\n const refiltered = useRef<string | null>(null);\n useEffect(() => {\n if (display !== text && refiltered.current !== text) {\n refiltered.current = text;\n setText(display, { source: 'programmatic' });\n }\n });\n\n // Keep the native element showing the field's value (lynx-ui pattern: `invoke('setValue')`). The node ref can\n // attach after the first effect, so attaching syncs too.\n const retries = useRef(0);\n const sync = () => {\n const value = latestText.current;\n if (native.current === value) return;\n // Mid-composition the native text is the truth: only a NEW value (a clear, a parent's change) is written over it.\n if (composingRef.current && composedFrom.current === value) return;\n if (invokeNode(elementRef, 'setValue', { value })) {\n native.current = value;\n retries.current = 0;\n } else if (elementRef.current && retries.current < 5) {\n // The element is not created natively yet (first commit): try again on the next tick.\n retries.current += 1;\n startTimer(() => syncRef.current(), 0);\n }\n };\n const syncRef = useRef(sync);\n syncRef.current = sync;\n const attach = useRef((node: NodesRef | null) => {\n elementRef.current = node;\n if (node) syncRef.current();\n }).current;\n useEffect(() => {\n sync();\n });\n\n // Clearing the value re-masks a revealed password (MAUI OnTextChanged).\n useEffect(() => {\n if (!hasValue && passwordVisible) setPasswordVisible(false);\n }, [hasValue, passwordVisible]);\n\n // New external error props win over an earlier validation result.\n const validationCurrent =\n validation !== null && validation.hasError === props.hasError && validation.errorText === props.errorText;\n const hasError = validationCurrent ? validation.message !== null : props.hasError === true;\n const errorText = validationCurrent && validation.message !== null ? validation.message : props.errorText;\n\n const onInput = (event: { detail?: InputDetail }) => {\n const raw = event.detail?.value ?? '';\n // Not an edit: the native element reports what it already holds (Android emits an empty `input` when a read-only\n // field is created, before `setValue` lands), or the user cannot type here at all. Forwarding it would wipe a\n // controlled value (a barcode field opened on an existing code came up empty).\n if (props.readOnly === true) {\n // Nobody types here: the native element drifted (Android clears a read-only input it just created) — show the\n // field's value again.\n native.current = raw;\n if (raw !== latestText.current) syncRef.current();\n return;\n }\n const composing = event.detail?.isComposing === true;\n const echo = !composing && !composingRef.current && raw === native.current;\n composingRef.current = composing;\n if (echo) return;\n native.current = raw;\n if (composing) {\n // The text so far is the field's value: reported as typed when the filter keeps it as it is (MAUI's Entry reports\n // composing text too). Text the filter would change waits for the commit: writing it back now would interrupt the\n // keyboard.\n const kept = sanitize(raw) === raw;\n if (kept) {\n latestText.current = raw;\n setText(raw, { source: 'user' });\n if (options.validateOnTextChanged) runValidation(raw);\n }\n composedFrom.current = latestText.current;\n bump((n) => n + 1);\n return;\n }\n composedFrom.current = null;\n const clean = sanitize(raw);\n latestText.current = clean;\n setText(clean, { source: 'user' });\n if (options.validateOnTextChanged) runValidation(clean);\n bump((n) => n + 1);\n };\n const onFocus = () => {\n focusedRef.current = true;\n setFocused(true);\n keyboardAware.onInputFocused?.();\n // Tapping the field while dictating means typing: end the session (ADR-0024).\n if (dictation.listening) void dictation.stop();\n props.onFocus?.();\n };\n const onBlur = () => {\n focusedRef.current = false;\n setFocused(false);\n // A keyboard that ends the composition without a final input event: what it shows is what was typed.\n if (composingRef.current) {\n composingRef.current = false;\n composedFrom.current = null;\n const clean = sanitize(native.current);\n if (clean !== latestText.current) {\n latestText.current = clean;\n setText(clean, { source: 'user' });\n }\n bump((n) => n + 1);\n }\n keyboardAware.onInputBlurred?.();\n // Only fields with a rule validate on blur, so an externally set error survives.\n if (hasRule && latestText.current !== '') runValidation(latestText.current);\n props.onBlur?.();\n };\n const onConfirm = () => props.onConfirm?.(latestText.current);\n\n const focus = () => {\n if (props.disabled) return;\n invokeNode(elementRef, 'focus');\n };\n const blur = () => invokeNode(elementRef, 'blur');\n\n const showMic = options.showMic({ available: dictation.available, listening: dictation.listening, hasValue });\n const pressMic = () => {\n // The microphone never focuses the field, and starting takes the keyboard down (ADR-0024).\n if (!dictation.listening && focusedRef.current) blur();\n void dictation.toggle();\n };\n\n const direction = resolveInputTextDirection(\n props.inputTextDirection ?? G9TextInputDirection.MatchParent,\n inputType,\n options.isPassword === true,\n culture.direction,\n );\n const font =\n props.customFont && props.customFont.trim() !== ''\n ? props.customFont\n : culture.direction === 'rtl'\n ? culture.rtlFontFamily\n : culture.ltrFontFamily;\n\n const digits = resolveFieldDigits(\n culture.numberingSystem,\n inputType,\n Boolean(props.customFont && props.customFont.trim() !== ''),\n options.isPassword === true,\n );\n\n const handle: G9TextInputHandle = {\n focus,\n blur,\n validate: () => runValidation(latestText.current),\n get isListening() {\n return dictation.listening;\n },\n toggleVoice: () => dictation.toggle(),\n startVoice: () => dictation.start(),\n stopVoice: () => dictation.stop(),\n get element() {\n return elementRef.current;\n },\n };\n\n return {\n text: display,\n setText,\n hasValue,\n focused,\n hasError,\n errorText,\n passwordVisible,\n setPasswordVisible,\n dictation,\n showMic,\n pressMic,\n focus,\n blur,\n handle,\n inputType,\n /** Element attributes and handlers shared by `<input>` and `<textarea>`. */\n elementProps: {\n ...g9KeyboardTargetProps,\n ref: attach,\n ...(props.inputId ? { id: props.inputId } : {}),\n 'ignore-focus': true,\n readonly: props.readOnly === true,\n disabled: props.disabled === true,\n maxlength: props.maxLength !== undefined && props.maxLength > 0 ? props.maxLength : 2147483647,\n bindinput: onInput,\n bindfocus: onFocus,\n bindblur: onBlur,\n bindconfirm: onConfirm,\n 'g9-digits': digits.system,\n 'g9-decimal-separator': digits.decimalSeparator,\n },\n textDirection: direction,\n font,\n };\n}\n"],"names":["resolveInputTextDirection","inputTextDirection","inputType","isPassword","cultureDirection","G9TextInputDirection","inputTypePrefersLeftToRight","resolveFieldDigits","numberingSystem","hasCustomFont","G9NumberingSystem","decimal","G9InputType","invokeNode","ref","method","params","node","invokeNodeWhenReady","attempts","startTimer","useTextInput","props","options","_props_inputType","_props_defaultValue","_props_voiceLocale","_props_inputTextDirection","culture","useG9Culture","strings","useG9Strings","keyboardAware","useContext","KeyboardAwareTriggerContext","separator","sanitize","raw","sanitizeInputText","text","setText","useControllableState","display","latestText","useRef","elementRef","native","composingRef","composedFrom","focused","setFocused","useState","focusedRef","passwordVisible","setPasswordVisible","bump","validation","setValidation","hasValue","runValidation","value","_runTextValidator","message","validateInputText","hasRule","inputTypeHasValidationRule","dictation","useDictation","refiltered","useEffect","retries","sync","syncRef","attach","validationCurrent","hasError","errorText","onInput","event","_event_detail","_event_detail1","composing","echo","kept","n","clean","onFocus","onBlur","onConfirm","focus","blur","showMic","pressMic","direction","font","digits","Boolean","handle","g9KeyboardTargetProps","undefined"],"mappings":";;;;;;;;;;AAyGO,SAASA,0BACdC,kBAAwC,EACxCC,SAAsB,EACtBC,UAAmB,EACnBC,gBAA+B;IAE/B,IAAIH,uBAAuBI,qBAAqB,WAAW,EAAE,OAAO;IACpE,IAAIJ,uBAAuBI,qBAAqB,WAAW,EAAE,OAAO;IACpE,IAAIC,4BAA4BJ,cAAcC,YAAY,OAAO;IACjE,OAAOC;AACT;AAaO,SAASG,mBACdC,eAAkC,EAClCN,SAAsB,EACtBO,aAAsB,EACtBN,UAAmB;IAEnB,IAAIM,iBAAiBN,cAAcK,oBAAoBE,kBAAkB,KAAK,EAC5E,OAAO;QAAE,QAAQA,kBAAkB,KAAK;QAAE,kBAAkB;IAAG;IAEjE,MAAMC,UAAUT,cAAcU,YAAY,OAAO,IAAIV,cAAcU,YAAY,aAAa;IAC5F,OAAO;QAAE,QAAQJ;QAAiB,kBAAkBG,UAAU,M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G;YACpF,WAAWuD;YACX,WAAWS;YACX,UAAUC;YACV,aAAaC;YACb,aAAaO,OAAO,MAAM;YAC1B,wBAAwBA,OAAO,gBAAgB;QACjD;QACA,eAAeF;QACfC;IACF;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fields/validator.jsx","sources":["../../src/fields/validator.ts"],"sourcesContent":["/**\n * A field validator (MAUI `IG9TextValidator`): returns the error message for a value, or `null`/`undefined` when it\n * is valid. Either an object with `validate` (MAUI shape) or a plain function.\n */\nexport type G9TextValidator =\n | { validate(text: string | null): string | null | undefined }\n | ((text: string | null) => string | null | undefined);\n\n/** Runs a {@link G9TextValidator}; a blank message counts as valid (MAUI `string.IsNullOrWhiteSpace`). */\nexport function runTextValidator(validator: G9TextValidator | null | undefined, text: string | null): string | null {\n if (!validator) return null;\n const message = typeof validator === 'function' ? validator(text) : validator.validate(text);\n return message == null || message.trim() === '' ? null : message;\n}\n\n/** Validators for common rules, composable with {@link combineValidators}. */\nexport function requiredValidator(message: string): G9TextValidator {\n return (text) => (text == null || text.trim() === '' ? message : null);\n}\n\n/** The first message any validator returns, in order. */\nexport function combineValidators(...validators: ReadonlyArray<G9TextValidator>): G9TextValidator {\n return (text) => {\n for (const validator of validators) {\n const message = runTextValidator(validator, text);\n if (message) return message;\n }\n return null;\n };\n}\n"],"names":["runTextValidator","validator","text","message","requiredValidator","combineValidators","validators"],"mappings":"AASO,SAASA,iBAAiBC,SAA6C,EAAEC,IAAmB;IACjG,IAAI,CAACD,WAAW,OAAO;IACvB,MAAME,UAAU,AAAqB,cAArB,OAAOF,YAA2BA,UAAUC,QAAQD,UAAU,QAAQ,CAACC;IACvF,OAAOC,AAAW,QAAXA,WAAmBA,AAAmB,OAAnBA,QAAQ,IAAI,KAAY,OAAOA;AAC3D;AAGO,SAASC,kBAAkBD,OAAe;IAC/C,OAAO,CAACD,OAAUA,AAAQ,QAARA,QAAgBA,AAAgB,OAAhBA,KAAK,IAAI,KAAYC,UAAU;AACnE;AAGO,SAASE,kBAAkB,GAAGC,UAA0C;IAC7E,OAAO,CAACJ;QACN,KAAK,MAAMD,aAAaK,WAAY;YAClC,MAAMH,UAAUH,iBAAiBC,WAAWC;YAC5C,IAAIC,SAAS,OAAOA;QACtB;QACA,OAAO;IACT;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"guide/confirm-sheet.jsx","sources":["../../src/guide/confirm-sheet.tsx"],"sourcesContent":["import { type G9ChangeLine, type G9JourneySource, g9RuntimeTimers } from '@g9tm/lynxcontrols-foundation';\nimport { type ReactNode, useSyncExternalStore } from '@lynx-js/react';\nimport { G9Button } from '../button/button';\nimport type { G9HostHandle } from '../host/registry';\nimport { useG9Direction, useG9Settings } from '../provider/hooks';\nimport type { G9SheetOptions } from '../sheet/options';\nimport { sheetServiceOf } from '../sheet/service';\nimport type { G9SheetHandle } from '../sheet/stack';\nimport { formatGuideText, type G9GuideTexts, type G9ResolvedGuideSettings } from './settings';\n\n// The guided-save confirmation as the app's own kind of sheet (owner, 2026-11-12): a fit-to-content G9 sheet that grows\n// with what it lists up to 75 % of the screen and is smaller when there is less; the title fixed in the header, the body\n// (who asked, the link warning, every change) scrolling with a visible thumb once it is taller than the sheet allows; the\n// two G9 buttons fixed in the footer — the safe one leading (under the right thumb in Persian), the confirm one counting\n// down. It replaced a hand-drawn card whose buttons were not the app's and that had no height limit: a long list of\n// changes pushed its buttons off the screen.\n//\n// ⛔ The buttons carry no element id: an id makes a control an anchor, and an anchor is something a journey can press —\n// the confirm button must only ever be pressed by the person.\n\n/** What the sheet shows (the guide's `G9ConfirmRequest`). */\nexport interface G9ConfirmSheetRequest {\n readonly title: string;\n readonly source: G9JourneySource;\n readonly changes: readonly G9ChangeLine[];\n readonly seconds: number;\n readonly destructive: boolean;\n readonly progress?: { readonly index: number; readonly total: number };\n}\n\n/** An open confirmation: closes it as declined. */\nexport interface G9ConfirmSheetPresentation {\n dismiss(): void;\n}\n\ninterface Countdown {\n get(): number;\n subscribe(l: () => void): () => void;\n}\n\n/**\n * Opens the confirmation sheet on the host's sheet stack (stacked over an open sheet, never throttled). `decide` is\n * called exactly once, after the sheet has left the screen: true only for the unlocked confirm; the other button, the\n * header's close, a tap on the dim and Android back all decline (a fit sheet is never draggable).\n */\nexport function presentConfirmSheet(\n host: G9HostHandle,\n settings: G9ResolvedGuideSettings,\n request: G9ConfirmSheetRequest,\n decide: (ok: boolean) => void,\n): G9ConfirmSheetPresentation {\n let left = Math.max(0, Math.round(request.seconds));\n const listeners = new Set<() => void>();\n const countdown: Countdown = {\n get: () => left,\n subscribe(l) {\n listeners.add(l);\n return () => {\n listeners.delete(l);\n };\n },\n };\n let timer: unknown = null;\n const tick = () => {\n left = Math.max(0, left - 1);\n timer = left > 0 ? g9RuntimeTimers.setTimeout(tick, 1000) : null;\n for (const l of Array.from(listeners)) l();\n };\n if (left > 0) timer = g9RuntimeTimers.setTimeout(tick, 1000);\n const stop = () => {\n if (timer !== null) g9RuntimeTimers.clearTimeout(timer);\n timer = null;\n };\n\n // The answer: set once by a button (a second press, or one after the sheet started closing, is ignored), reported\n // once the sheet has left the screen. A close that no button made — the header, the dim, back — declines.\n let chosen: boolean | null = null;\n let handle: G9SheetHandle | null = null;\n const choose = (ok: boolean) => {\n // The confirm button is disabled while counting; this holds even for a press that reached it some other way.\n if (chosen !== null || handle?.isOpen === false || (ok && left > 0)) return;\n chosen = ok;\n stop();\n handle?.close();\n };\n\n const texts = settings.texts;\n const fontSize = settings.confirmButtonFontSize;\n const options: G9SheetOptions = {\n sizeMode: 'fitToContent',\n maxFitToContentHeightRatio: 0.75,\n isCancelable: true,\n isDraggable: true,\n hasHandle: true,\n deferContent: false,\n showToolbar: true,\n showCloseButton: true,\n headerTitlePlacement: 'center',\n scrollIndicator: 'always',\n automationId: 'G9GuideConfirm',\n ...settings.confirmSheet(),\n title: request.title,\n footerButtons: [\n <G9Button\n key=\"cancel\"\n text={texts.cancel}\n variant=\"outline\"\n size=\"hero\"\n {...(fontSize !== null ? { fontSize } : {})}\n onPress={() => choose(false)}\n />,\n <ConfirmButton\n key=\"confirm\"\n countdown={countdown}\n texts={texts}\n destructive={request.destructive}\n fontSize={fontSize}\n onPress={() => choose(true)}\n />,\n ],\n };\n handle = sheetServiceOf(host).stack.show(<ConfirmBody request={request} texts={texts} />, options, false);\n const settle = () => {\n stop();\n decide(chosen === true);\n };\n // No sheet (the host's stack is gone): nothing was asked, nothing is confirmed.\n if (handle) void handle.result.then(settle);\n else settle();\n return { dismiss: () => choose(false) };\n}\n\nfunction ConfirmButton(props: {\n readonly countdown: Countdown;\n readonly texts: G9GuideTexts;\n readonly destructive: boolean;\n readonly fontSize: number | null;\n readonly onPress: () => void;\n}): ReactNode {\n const left = useSyncExternalStore(\n (l) => props.countdown.subscribe(l),\n () => props.countdown.get(),\n );\n const ready = left <= 0;\n return (\n <G9Button\n text={ready ? props.texts.confirm : formatGuideText(props.texts.confirmIn, left)}\n variant={props.destructive ? 'error' : 'primary'}\n size=\"hero\"\n {...(props.fontSize !== null ? { fontSize: props.fontSize } : {})}\n disabled={!ready}\n onPress={props.onPress}\n />\n );\n}\n\n/** Who asked, the link's warning, then every change — the part that scrolls. */\nfunction ConfirmBody(props: { readonly request: G9ConfirmSheetRequest; readonly texts: G9GuideTexts }): ReactNode {\n const { request, texts } = props;\n const rtl = useG9Direction() === 'rtl';\n // The header's own side spacing (MAUI EdgeSpacing, an app may scale it): the body lines up under the title.\n const edge = useG9Settings().sheets.headerEdgeSpacing;\n const align = { textAlign: rtl ? ('right' as const) : ('left' as const) };\n const row = { flexDirection: rtl ? ('row-reverse' as const) : ('row' as const), direction: 'ltr' as const };\n const lines: readonly G9ChangeLine[] =\n request.changes.length > 0 ? request.changes : [{ action: 'other', subject: texts.undescribed }];\n const progress = request.progress && request.progress.total > 1 ? request.progress : null;\n return (\n <view\n className=\"g9-guide-confirm\"\n style={{ paddingLeft: `${edge}px`, paddingRight: `${edge}px`, direction: rtl ? 'rtl' : 'ltr' }}\n >\n <view className=\"g9-guide-confirm__meta\" style={row}>\n <text className=\"g9-guide-confirm__source\" style={align}>\n {texts.sources[request.source]}\n </text>\n {progress ? (\n <text className=\"g9-guide-confirm__progress\">\n {formatGuideText(texts.confirmProgress, progress.index, progress.total)}\n </text>\n ) : null}\n </view>\n {request.source === 'link' ? (\n <view className=\"g9-guide-confirm__warning\">\n <text className=\"g9-guide-confirm__warning-text\" style={align}>\n {texts.linkWarning}\n </text>\n </view>\n ) : null}\n <text className=\"g9-guide-confirm__heading\" style={align}>\n {lines.length > 1 ? `${texts.changesTitle} (${lines.length})` : texts.changesTitle}\n </text>\n <view className=\"g9-guide-confirm__lines\">\n {lines.map((c, i) => (\n <view\n key={`c${i}`}\n className={`g9-guide-confirm__line${i === 0 ? ' g9-guide-confirm__line--first' : ''}`}\n style={row}\n >\n <view className={`g9-guide-confirm__verb g9-guide-confirm__verb--${c.action}`}>\n <text className={`g9-guide-confirm__verb-text g9-guide-confirm__verb-text--${c.action}`}>\n {texts.actions[c.action]}\n </text>\n </view>\n <view className=\"g9-guide-confirm__line-body\">\n <text className=\"g9-guide-confirm__subject\" style={align}>\n {c.field ? `${c.subject} · ${c.field}` : c.subject}\n </text>\n {c.from !== undefined || c.to !== undefined ? (\n <text className=\"g9-guide-confirm__value\" style={align}>\n {/* The arrow points from the old value to the new one in the reading direction (→ drawn in a\n right-to-left line pointed back at the old value). */}\n {`${c.from ?? '—'} ${rtl ? '←' : '→'} ${c.to ?? '—'}`}\n </text>\n ) : null}\n {c.note ? (\n <text className=\"g9-guide-confirm__note\" style={align}>\n {c.note}\n </text>\n ) : null}\n </view>\n </view>\n ))}\n </view>\n </view>\n );\n}\n"],"names":["presentConfirmSheet","host","settings","request","decide","left","Math","listeners","Set","countdown","l","timer","tick","g9RuntimeTimers","Array","stop","chosen","handle","choose","ok","texts","fontSize","options","G9Button","ConfirmButton","sheetServiceOf","ConfirmBody","settle","props","useSyncExternalStore","ready","formatGuideText","rtl","useG9Direction","edge","useG9Settings","align","row","lines","progress","view","text","c","i","_c_from","_c_to","undefined"],"mappings":";;;;;;AA6CO,SAASA,oBACdC,IAAkB,EAClBC,QAAiC,EACjCC,OAA8B,EAC9BC,MAA6B;IAE7B,IAAIC,OAAOC,KAAK,GAAG,CAAC,GAAGA,KAAK,KAAK,CAACH,QAAQ,OAAO;IACjD,MAAMI,YAAY,IAAIC;IACtB,MAAMC,YAAuB;QAC3B,KAAK,IAAMJ;QACX,WAAUK,CAAC;YACTH,UAAU,GAAG,CAACG;YACd,OAAO;gBACLH,UAAU,MAAM,CAACG;YACnB;QACF;IACF;IACA,IAAIC,QAAiB;IACrB,MAAMC,OAAO;QACXP,OAAOC,KAAK,GAAG,CAAC,GAAGD,OAAO;QAC1BM,QAAQN,OAAO,IAAIQ,gBAAgB,UAAU,CAACD,MAAM,QAAQ;QAC5D,KAAK,MAAMF,KAAKI,MAAM,IAAI,CAACP,WAAYG;IACzC;IACA,IAAIL,OAAO,GAAGM,QAAQE,gBAAgB,UAAU,CAACD,MAAM;IACvD,MAAMG,OAAO;QACX,IAAIJ,AAAU,SAAVA,OAAgBE,gBAAgB,YAAY,CAACF;QACjDA,QAAQ;IACV;IAIA,IAAIK,SAAyB;IAC7B,IAAIC,SAA+B;IACnC,MAAMC,SAAS,CAACC;QAEd,IAAIH,AAAW,SAAXA,UAAmBC,AAAAA,CAAAA,QAAAA,SAAAA,KAAAA,IAAAA,OAAQ,MAAM,AAAD,MAAM,SAAUE,MAAMd,OAAO,GAAI;QACrEW,SAASG;QACTJ;QACAE,QAAAA,UAAAA,OAAQ,KAAK;IACf;IAEA,MAAMG,QAAQlB,SAAS,KAAK;IAC5B,MAAMmB,WAAWnB,SAAS,qBAAqB;IAC/C,MAAMoB,UAA0B;QAC9B,UAAU;QACV,4BAA4B;QAC5B,cAAc;QACd,aAAa;QACb,WAAW;QACX,cAAc;QACd,aAAa;QACb,iBAAiB;QACjB,sBAAsB;QACtB,iBAAiB;QACjB,cAAc;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0 @@
|
|
|
1
|
-
{"version":3,"file":"guide/journey.jsx","sources":["../../src/guide/journey.ts"],"sourcesContent":["import {\n confirmSeconds,\n type G9AnchorRisk,\n type G9GuideEffectSpec,\n type G9Journey,\n type G9JourneySource,\n type G9JourneyStep,\n type G9Snapshot,\n type G9StepAuthority,\n type G9Until,\n type G9WaitFor,\n g9RuntimeTimers,\n journeyAuthority,\n matchesAddress,\n textIn,\n tryParseAddress,\n} from '@g9tm/lynxcontrols-foundation';\nimport { windowRect } from '../anchor/measure';\nimport type { G9AnchorEntry } from '../anchor/registry';\nimport { revealAnchor } from '../anchor/scroll';\nimport type { G9Router } from '../route/router';\nimport type { G9GuideHandle, G9GuideOutcome, G9GuideService, G9GuideSpec } from './service';\n\n// Runs a journey on screen. Who may do what is the SOURCE policy (foundation `journeyAuthority`), read with the CALLER's\n// source — a journey cannot raise its own rights: navigation, showing and filling a form are the engine's; pressing a\n// control that saves or deletes waits for the person's confirmation behind a countdown, with every change listed; a\n// step the policy keeps from the engine falls to the person (the finger points, the guide waits). Every step ends with\n// a result; a failure stops the journey with its reason (no retries, no loops). Back ends the journey.\n\n/** What a journey runs with: the trusted source, the language, the guide and the router. */\nexport interface G9JourneyRunOptions {\n /** Who started it (trusted: the app decides, never the journey). */\n readonly source: G9JourneySource;\n readonly language: 'fa' | 'en';\n readonly guide: G9GuideService;\n readonly router?: G9Router | null;\n /** Make the policy stricter for a step (an app may never make it looser). */\n readonly authority?: (step: G9JourneyStep, risk: G9AnchorRisk) => G9StepAuthority | null;\n /** How long a person's step may take before the journey stops (ms). Default 120000. */\n readonly personTimeoutMs?: number;\n}\n\n/** The phase of a running journey. */\nexport type G9JourneyStatus = 'running' | 'waiting' | 'done' | 'failed' | 'cancelled';\n\n/** Where a running journey is. */\nexport interface G9JourneyState {\n readonly index: number;\n readonly status: G9JourneyStatus;\n /** Steps the policy gave to the person instead of the engine. */\n readonly downgraded: readonly number[];\n}\n\n/** How a journey ended: `ok`, or the step it stopped at and why. */\nexport interface G9JourneyResult {\n readonly ok: boolean;\n readonly failedAt?: number;\n readonly reason?: string;\n readonly message?: string;\n}\n\n/** A running journey: its state, «next» for a manual pace, cancel, and its result. */\nexport interface G9JourneyRun {\n readonly journey: G9Journey;\n readonly state: { get(): G9JourneyState; subscribe(l: () => void): () => void };\n /** The «next» of a manual journey (or of the bubble). */\n next(): void;\n cancel(): void;\n readonly result: Promise<G9JourneyResult>;\n}\n\nclass Stopped extends Error {\n constructor(\n readonly reason: string,\n message: string,\n ) {\n super(message);\n }\n}\n\nconst sleep = (ms: number) => new Promise<void>((r) => g9RuntimeTimers.setTimeout(r, ms));\nconst RANK: Readonly<Record<G9StepAuthority, number>> = { engine: 0, 'engine-confirm': 1, user: 2 };\n\n/** Starts a journey (validate untrusted JSON with `validateJourney` first). */\nexport function runJourney(journey: G9Journey, options: G9JourneyRunOptions): G9JourneyRun {\n const { guide, router, language, source } = options;\n const anchors = guide.anchors;\n const personTimeout = options.personTimeoutMs ?? 120000;\n let state: G9JourneyState = { index: 0, status: 'running', downgraded: [] };\n const listeners = new Set<() => void>();\n const set = (patch: Partial<G9JourneyState>) => {\n state = { ...state, ...patch };\n for (const l of Array.from(listeners)) l();\n };\n let cancelled = false;\n let nextWaiter: (() => void) | null = null;\n const marks = new Set<G9GuideHandle>();\n const cancelHooks = new Set<() => void>();\n\n const show = (spec: G9GuideSpec): G9GuideHandle => {\n const h = guide.show({ language, ...spec });\n marks.add(h);\n void h.result.then(() => marks.delete(h));\n return h;\n };\n const text = (t: Parameters<typeof textIn>[0] | undefined) => (t === undefined ? '' : textIn(t, language));\n const check = () => {\n if (cancelled) throw new Stopped('cancelled', 'cancelled');\n };\n\n /** Resolves on the first of: a condition met (polled), the run's «next», a cancel, a timeout. */\n const until = (\n condition: (() => boolean | Promise<boolean>) | null,\n timeoutMs: number,\n mark: G9GuideHandle | null,\n ): Promise<'met' | 'next' | 'timeout' | 'cancelled' | G9GuideOutcome> =>\n new Promise((resolve) => {\n let done = false;\n let poll: unknown = null;\n const finish = (why: 'met' | 'next' | 'timeout' | 'cancelled' | G9GuideOutcome) => {\n if (done) return;\n done = true;\n g9RuntimeTimers.clearTimeout(timer);\n if (poll !== null) g9RuntimeTimers.clearTimeout(poll);\n cancelHooks.delete(onCancel);\n if (nextWaiter === onNext) nextWaiter = null;\n resolve(why);\n };\n const onCancel = () => finish('cancelled');\n const onNext = () => finish('next');\n cancelHooks.add(onCancel);\n nextWaiter = onNext;\n const timer = g9RuntimeTimers.setTimeout(() => finish('timeout'), timeoutMs);\n void mark?.result.then((o) =>\n o === 'next' || o === 'done' || o === 'skip' || o === 'tapped'\n ? finish('next')\n : o === 'target-lost'\n ? finish('target-lost')\n : // Hidden by someone else (Android back ends the guide), or the host went away: the journey stops.\n o === 'hidden' || o === 'unmount'\n ? finish('cancelled')\n : undefined,\n );\n if (condition) {\n const tick = async () => {\n poll = null;\n if (done) return;\n let met = false;\n try {\n met = await condition();\n } catch {\n met = false;\n }\n if (met) finish('met');\n else if (!done) poll = g9RuntimeTimers.setTimeout(() => void tick(), 250);\n };\n void tick();\n }\n });\n\n const anchorFor = async (id: string): Promise<G9AnchorEntry> => {\n const r = await revealAnchor(anchors, id, { smooth: true });\n if (!r.anchor) throw new Stopped('not-found', `The control \"${id}\" is not on screen.`);\n return r.anchor;\n };\n\n const routeMet = (pattern: string) => () => {\n const here = router?.where().unique ?? '';\n return here === pattern || (tryParseAddress(here).ok && safeMatch(here, pattern));\n };\n\n const valueMet = (target: string, equals: string | undefined, start: string | null | undefined) => () => {\n const v = anchors.find(target)?.info().capabilities?.getValue?.();\n return equals === undefined ? v !== start : v === equals;\n };\n\n const untilOf = async (u: G9Until | undefined, mark: G9GuideHandle | null, fallbackNext: boolean) => {\n if (u === undefined || u === 'next' || u === 'tap') return until(null, personTimeout, mark);\n if ('ms' in u) {\n await sleep(u.ms);\n return 'met';\n }\n if ('route' in u) return until(routeMet(u.route), personTimeout, fallbackNext ? mark : null);\n const start = anchors.find(u.value.target)?.info().capabilities?.getValue?.();\n return until(valueMet(u.value.target, u.value.equals, start), personTimeout, fallbackNext ? mark : null);\n };\n\n const authorityOf = (\n step: G9JourneyStep,\n action: 'navigate' | 'fill' | 'press',\n risk: G9AnchorRisk,\n ): G9StepAuthority => {\n const base = journeyAuthority(source, action, risk);\n const app = options.authority?.(step, risk) ?? null;\n return app && RANK[app] > RANK[base] ? app : base;\n };\n\n const point = (target: string, words: string, gesture: 'tap' | 'longPress' = 'tap') =>\n show({\n target,\n effects: [\n { type: 'spotlight' },\n { type: 'highlight', pulse: true, opacity: 0.08 },\n { type: 'pointer', gesture },\n ...(words ? [{ type: 'caption' as const, text: words }] : []),\n ],\n buttons: ['next'],\n });\n\n const steps: Record<G9JourneyStep['do'], (step: never, index: number) => Promise<void>> = {\n go: async (step: Extract<G9JourneyStep, { do: 'go' }>) => {\n if (!router) throw new Stopped('no-router', 'There is no router to go with.');\n const by = step.by ?? 'jump';\n const r =\n by === 'jump'\n ? await router.go(step.to, {\n source: source === 'link' ? 'link' : source === 'assistant' ? 'assistant' : 'user',\n })\n : await router.walk(step.to, { by, presenter: guide.presenter() }).result;\n if (!r.ok) throw new Stopped(r.reason, r.message);\n },\n show: async (step: Extract<G9JourneyStep, { do: 'show' }>) => {\n const effects: G9GuideEffectSpec[] = step.effects\n ? step.effects.slice()\n : [{ type: 'spotlight' }, { type: 'highlight', pulse: true, opacity: 0.08 }];\n if (step.text && !effects.some((e) => e.type === 'caption')) effects.push({ type: 'caption', text: step.text });\n const m = show({ target: step.target, effects, buttons: ['next'] });\n const why = await untilOf(step.until, m, true);\n m.hide();\n if (why === 'cancelled') throw new Stopped('cancelled', 'cancelled');\n if (why === 'timeout' || why === 'target-lost')\n throw new Stopped(\n why,\n `\"${step.target}\" ${why === 'timeout' ? 'was not reached in time' : 'left the screen'}.`,\n );\n },\n say: async (step: Extract<G9JourneyStep, { do: 'say' }>) => {\n const w = windowRect();\n const m = show({\n target: { x: w.width / 2 - 1, y: w.height * 0.42, width: 2, height: 2 },\n effects: [{ type: 'caption', text: step.text, placement: 'below' }],\n buttons: ['next'],\n reveal: false,\n });\n const why = await untilOf(step.until, m, true);\n m.hide();\n if (why === 'cancelled') throw new Stopped('cancelled', 'cancelled');\n if (why === 'timeout') throw new Stopped('timeout', 'No answer in time.');\n },\n fill: async (step: Extract<G9JourneyStep, { do: 'fill' }>, index: number) => {\n const anchor = await anchorFor(step.target);\n const caps = anchor.info().capabilities;\n if (step.by === 'user' || !caps?.setValue) {\n if (step.by !== 'user') set({ downgraded: [...state.downgraded, index] });\n const m = point(step.target, step.value);\n const why = await until(valueMet(step.target, step.value, null), personTimeout, m);\n m.hide();\n if (why === 'cancelled') throw new Stopped('cancelled', 'cancelled');\n if (why === 'timeout') throw new Stopped('timeout', `\"${step.target}\" was not filled in time.`);\n return;\n }\n const m = show({ target: step.target, effects: [{ type: 'highlight', pulse: true }], reveal: false });\n try {\n await caps.focus?.();\n const chars = Array.from(step.value);\n const per = Math.min(guide.settings.typeMsPerChar, chars.length > 0 ? 1200 / chars.length : 0);\n if (per > 0) {\n for (let i = 1; i < chars.length; i++) {\n check();\n await caps.setValue(chars.slice(0, i).join(''));\n await sleep(per);\n }\n }\n check();\n await caps.setValue(step.value);\n } finally {\n m.hide();\n }\n const read = caps.getValue?.();\n if (read !== undefined && read !== null && read !== step.value)\n throw new Stopped('failed', `\"${step.target}\" holds \"${read}\", not the value given.`);\n },\n select: async (step: Extract<G9JourneyStep, { do: 'select' }>, index: number) => {\n const anchor = await anchorFor(step.target);\n const caps = anchor.info().capabilities;\n const has = () => (caps?.getValue?.() ?? '').split(',').indexOf(step.item) >= 0;\n if (step.by === 'user' || !caps?.selectItem) {\n if (step.by !== 'user') set({ downgraded: [...state.downgraded, index] });\n const m = point(step.target, '');\n const why = await until(has, personTimeout, m);\n m.hide();\n if (why === 'cancelled') throw new Stopped('cancelled', 'cancelled');\n if (why === 'timeout') throw new Stopped('timeout', `\"${step.item}\" was not picked in time.`);\n return;\n }\n await caps.selectItem(step.item);\n if (caps.getValue && !has()) throw new Stopped('failed', `\"${step.target}\" did not take \"${step.item}\".`);\n },\n press: async (step: Extract<G9JourneyStep, { do: 'press' }>, index: number) => {\n const anchor = await anchorFor(step.target);\n const info = anchor.info();\n const risk = info.risk ?? 'none';\n const authority = authorityOf(step, 'press', risk);\n const label = text(step.text) || info.label?.() || step.target;\n const byPerson = step.by === 'user' || authority === 'user' || !info.capabilities?.activate;\n if (byPerson) {\n if (step.by === 'engine') set({ downgraded: [...state.downgraded, index] });\n const before = router?.where().revision ?? -1;\n const m = point(step.target, label);\n const why = await until(\n () => (router ? router.where().revision !== before : false) || !anchors.find(step.target),\n personTimeout,\n m,\n );\n m.hide();\n if (why === 'cancelled') throw new Stopped('cancelled', 'cancelled');\n if (why === 'timeout') throw new Stopped('timeout', `\"${label}\" was not pressed in time.`);\n return;\n }\n if (authority === 'engine-confirm' && risk !== 'none') {\n const changes = info.changes?.() ?? lastPlaceChanges(router) ?? [];\n const seconds = confirmSeconds(source, risk, changes.length > 0, guide.settings.confirm);\n // No highlight on the control while its confirmation is open: the guide's layer paints above every sheet, so a\n // pulsing ring on a footer button stood over the confirmation's own buttons (seen on a device, 2026-11-12). The\n // sheet names the action in its title; the ripple after a yes shows where the guide pressed.\n // A journey that presses more than one control says which press this is («2 of 3»): a person who confirms the\n // first of three writes should know two more are coming.\n const presses = journey.steps.filter((s) => s.do === 'press').length;\n const progress = {\n index: journey.steps.slice(0, index + 1).filter((s) => s.do === 'press').length,\n total: presses,\n };\n const dismiss = () => guide.dismissConfirmation();\n cancelHooks.add(dismiss);\n let ok = false;\n try {\n ok = await guide.confirm({\n title: label,\n source,\n changes,\n seconds,\n destructive: risk === 'destructive',\n progress,\n });\n } finally {\n cancelHooks.delete(dismiss);\n }\n if (!ok) throw new Stopped('declined', 'The person did not confirm.');\n }\n check();\n show({ target: step.target, effects: [{ type: 'ripple' }], timeoutMs: 600, reveal: false });\n await info.capabilities?.activate?.();\n },\n wait: async (step: Extract<G9JourneyStep, { do: 'wait' }>) => {\n const f: G9WaitFor = step.for;\n const conditions: Array<() => boolean> = [];\n if (f.route) conditions.push(routeMet(f.route));\n if (f.anchor) {\n const id = f.anchor;\n conditions.push(() => !!anchors.find(id));\n }\n if (f.value)\n conditions.push(\n valueMet(f.value.target, f.value.equals, anchors.find(f.value.target)?.info().capabilities?.getValue?.()),\n );\n if (f.ms !== undefined && conditions.length === 0) {\n await sleep(f.ms);\n return;\n }\n const why = await until(() => conditions.some((c) => c()), step.timeoutMs ?? 30000, null);\n if (why === 'cancelled') throw new Stopped('cancelled', 'cancelled');\n if (why === 'timeout') throw new Stopped('timeout', 'What the journey waited for did not happen.');\n },\n back: async () => {\n if (!router || !origin) throw new Stopped('no-router', 'There is nowhere to come back to.');\n const r = await router.restore(origin);\n if (!r.ok) throw new Stopped(r.reason, r.message);\n },\n };\n\n let origin: G9Snapshot | null = null;\n const result = (async (): Promise<G9JourneyResult> => {\n try {\n if (router && journey.steps.some((s) => s.do === 'back')) origin = await router.snapshotWithScroll();\n for (let i = 0; i < journey.steps.length; i++) {\n check();\n set({ index: i, status: 'running' });\n const step = journey.steps[i] as G9JourneyStep;\n await (steps[step.do] as (s: G9JourneyStep, i: number) => Promise<void>)(step, i);\n if (journey.pace === 'manual' && i < journey.steps.length - 1) {\n set({ status: 'waiting' });\n const why = await until(null, personTimeout, null);\n if (why === 'cancelled') throw new Stopped('cancelled', 'cancelled');\n }\n }\n set({ status: 'done' });\n return { ok: true };\n } catch (error) {\n const stopped =\n error instanceof Stopped ? error : new Stopped('failed', String((error as Error)?.message ?? error));\n set({ status: stopped.reason === 'cancelled' ? 'cancelled' : 'failed' });\n return { ok: false, failedAt: state.index, reason: stopped.reason, message: stopped.message };\n } finally {\n for (const m of Array.from(marks)) m.hide();\n }\n })();\n\n return {\n journey,\n state: {\n get: () => state,\n subscribe(l) {\n listeners.add(l);\n return () => {\n listeners.delete(l);\n };\n },\n },\n next() {\n nextWaiter?.();\n },\n cancel() {\n cancelled = true;\n for (const h of Array.from(cancelHooks)) h();\n for (const m of Array.from(marks)) m.hide();\n },\n result,\n };\n}\n\nfunction safeMatch(address: string, pattern: string): boolean {\n try {\n return matchesAddress(address, pattern);\n } catch {\n return false;\n }\n}\n\nfunction lastPlaceChanges(router: G9Router | null | undefined) {\n if (!router) return null;\n const n = router.where().segments.length;\n for (let i = n - 1; i >= 0; i--) {\n const d = router.placeAt(i)?.describeChanges?.();\n if (d && d.length > 0) return d;\n }\n return null;\n}\n"],"names":["Stopped","Error","reason","message","sleep","ms","Promise","r","g9RuntimeTimers","RANK","runJourney","journey","options","_options_personTimeoutMs","guide","router","language","source","anchors","personTimeout","state","listeners","Set","set","patch","l","Array","cancelled","nextWaiter","marks","cancelHooks","show","spec","h","text","t","undefined","textIn","check","until","condition","timeoutMs","mark","resolve","done","poll","finish","why","timer","onCancel","onNext","o","tick","met","anchorFor","id","revealAnchor","routeMet","pattern","here","tryParseAddress","safeMatch","valueMet","target","equals","start","_anchors_find_info_capabilities","v","untilOf","u","fallbackNext","authorityOf","step","action","risk","base","journeyAuthority","app","point","words","gesture","steps","_step_by","by","effects","e","m","w","windowRect","index","caps","anchor","chars","per","Math","i","read","has","_info_risk","info","_info_capabilities","_info_capabilities1","authority","label","byPerson","before","_ref1","changes","lastPlaceChanges","seconds","confirmSeconds","presses","s","progress","dismiss","ok","_step_timeoutMs","f","conditions","c","origin","result","error","stopped","String","address","matchesAddress","n","_router_placeAt","d"],"mappings":";;;;;;;;;;;;;AAuEA,MAAMA,gBAAgBC;IACpB,YACWC,MAAc,EACvBC,OAAe,CACf;QACA,KAAK,CAACA,UAAAA,iBAAAA,IAAAA,EAAAA,UAAAA,KAAAA,IAAAA,IAAAA,CAHGD,MAAM,GAANA;IAIX;AACF;AAEA,MAAME,QAAQ,CAACC,KAAe,IAAIC,QAAc,CAACC,IAAMC,gBAAgB,UAAU,CAACD,GAAGF;AACrF,MAAMI,OAAkD;IAAE,QAAQ;IAAG,kBAAkB;IAAG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C,IAAI,QAAAD,CAAAA,kBAAAA,OAAO,OAAO,CAACjC,EAAC,IAAhBiC,KAAAA,IAAAA,QAAAA,CAAAA,kCAAAA,gBAAmB,eAAe,AAAD,IAAjCA,KAAAA,IAAAA,gCAAAA,IAAAA,CAAAA;QACV,IAAIC,KAAKA,EAAE,MAAM,GAAG,GAAG,OAAOA;IAChC;IACA,OAAO;AACT"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"guide/placement.jsx","sources":["../../src/guide/placement.ts"],"sourcesContent":["import type { G9AnchorRect } from '../anchor/registry';\n\n// Where a guide's bubble goes (pure): the first side that fits, in the reading-aware order below, then above, then the\n// end and the start side; flipped and clamped into the free area (the window minus the safe insets, the keyboard and\n// the tab bar the caller passes), never over the target when there is room elsewhere. The arrow points at the\n// target's centre, kept inside the bubble's rounded corners.\n\n/** Which side of the target a bubble sits on (`over` when none fits). */\nexport type G9BubbleSide = 'below' | 'above' | 'end' | 'start' | 'over';\n\n/** Where a guide bubble goes and where its arrow points. */\nexport interface G9BubblePlacement {\n readonly x: number;\n readonly y: number;\n readonly side: G9BubbleSide;\n /** The arrow's offset along the bubble edge that faces the target (px from the bubble's left or top). */\n readonly arrow: number;\n}\n\n/** The target, the bubble size and the free area a bubble is placed in. */\nexport interface G9BubbleRequest {\n readonly target: G9AnchorRect;\n readonly bubble: { readonly width: number; readonly height: number };\n /** The free area. */\n readonly view: G9AnchorRect;\n /** Gap between target and bubble. Default 12. */\n readonly gap?: number;\n /** Margin from the free area's edges. Default 12. */\n readonly margin?: number;\n readonly prefer?: 'auto' | 'above' | 'below' | 'start' | 'end';\n readonly rtl?: boolean;\n /** Corner radius the arrow stays clear of. Default 14. */\n readonly radius?: number;\n}\n\nconst clamp = (v: number, lo: number, hi: number) => (hi < lo ? lo : v < lo ? lo : v > hi ? hi : v);\n\n/** The bubble's place. */\nexport function placeBubble(r: G9BubbleRequest): G9BubblePlacement {\n const gap = r.gap ?? 12;\n const m = r.margin ?? 12;\n const radius = r.radius ?? 14;\n const { target: t, bubble: b, view: v } = r;\n const left = v.x + m;\n const top = v.y + m;\n const right = v.x + v.width - m;\n const bottom = v.y + v.height - m;\n const cx = t.x + t.width / 2;\n const cy = t.y + t.height / 2;\n const endIsRight = !r.rtl;\n\n const room = {\n below: bottom - (t.y + t.height + gap),\n above: t.y - gap - top,\n right: right - (t.x + t.width + gap),\n left: t.x - gap - left,\n };\n const fits = (side: G9BubbleSide): boolean => {\n switch (side) {\n case 'below':\n return room.below >= b.height;\n case 'above':\n return room.above >= b.height;\n case 'end':\n return (endIsRight ? room.right : room.left) >= b.width;\n case 'start':\n return (endIsRight ? room.left : room.right) >= b.width;\n default:\n return true;\n }\n };\n const order: G9BubbleSide[] = ['below', 'above', 'end', 'start'];\n const prefer = r.prefer && r.prefer !== 'auto' ? r.prefer : null;\n if (prefer) {\n order.splice(order.indexOf(prefer), 1);\n order.unshift(prefer);\n }\n const side = order.find(fits) ?? 'over';\n\n if (side === 'below' || side === 'above' || side === 'over') {\n const x = clamp(cx - b.width / 2, left, right - b.width);\n let y: number;\n if (side === 'below') y = t.y + t.height + gap;\n else if (side === 'above') y = t.y - gap - b.height;\n else y = clamp(room.below >= room.above ? bottom - b.height : top, top, bottom - b.height);\n const arrow = clamp(cx - x, radius, b.width - radius);\n return { x, y, side, arrow };\n }\n const onRight = (side === 'end') === endIsRight;\n const x = onRight ? t.x + t.width + gap : t.x - gap - b.width;\n const y = clamp(cy - b.height / 2, top, bottom - b.height);\n const arrow = clamp(cy - y, radius, b.height - radius);\n return { x, y, side, arrow };\n}\n\n/**\n * Where the pointing finger goes: the fingertip of the glyph (at 11.5 / 6 of its 24-unit box) on the target's centre,\n * the hand hanging below it — so it never hides the label of a button above it.\n */\nexport function placePointer(target: G9AnchorRect, size = 44): { readonly x: number; readonly y: number } {\n const unit = size / 24;\n return { x: target.x + target.width / 2 - 11.5 * unit, y: target.y + target.height / 2 - 6 * unit };\n}\n\n/** The four rects of a scrim around a hole (top, bottom, start, end bands), none negative. */\nexport function scrimBands(hole: G9AnchorRect, view: G9AnchorRect): readonly G9AnchorRect[] {\n const hx = clamp(hole.x, view.x, view.x + view.width);\n const hy = clamp(hole.y, view.y, view.y + view.height);\n const hr = clamp(hole.x + hole.width, hx, view.x + view.width);\n const hb = clamp(hole.y + hole.height, hy, view.y + view.height);\n return [\n { x: view.x, y: view.y, width: view.width, height: hy - view.y },\n { x: view.x, y: hb, width: view.width, height: view.y + view.height - hb },\n { x: view.x, y: hy, width: hx - view.x, height: hb - hy },\n { x: hr, y: hy, width: view.x + view.width - hr, height: hb - hy },\n ];\n}\n\n/** A rect grown by `pad` on every side. */\nexport function inflate(r: G9AnchorRect, pad: number): G9AnchorRect {\n return { x: r.x - pad, y: r.y - pad, width: r.width + 2 * pad, height: r.height + 2 * pad };\n}\n"],"names":["clamp","v","lo","hi","placeBubble","r","_r_gap","_r_margin","_r_radius","_order_find","gap","m","radius","t","b","left","top","right","bottom","cx","cy","endIsRight","room","fits","side","order","prefer","x","y","arrow","onRight","placePointer","target","size","unit","scrimBands","hole","view","hx","hy","hr","hb","inflate","pad"],"mappings":"AAmCA,MAAMA,QAAQ,CAACC,GAAWC,IAAYC,KAAgBA,KAAKD,KAAKA,KAAKD,IAAIC,KAAKA,KAAKD,IAAIE,KAAKA,KAAKF;AAG1F,SAASG,YAAYC,CAAkB;QAChCC,QACFC,WACKC,WAoCFC;IAtCb,MAAMC,MAAM,QAAAJ,CAAAA,SAAAA,EAAE,GAAG,AAAD,IAAJA,SAAS;IACrB,MAAMK,IAAI,QAAAJ,CAAAA,YAAAA,EAAE,MAAM,AAAD,IAAPA,YAAY;IACtB,MAAMK,SAAS,QAAAJ,CAAAA,YAAAA,EAAE,MAAM,AAAD,IAAPA,YAAY;IAC3B,MAAM,EAAE,QAAQK,CAAC,EAAE,QAAQC,CAAC,EAAE,MAAMb,CAAC,EAAE,GAAGI;IAC1C,MAAMU,OAAOd,EAAE,CAAC,GAAGU;IACnB,MAAMK,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