@g9tm/lynxcontrols 0.0.0-stage → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -2
- package/dist/.tsbuildinfo +1 -0
- package/dist/base/base.css +16 -0
- package/dist/base/base.css.map +1 -0
- package/dist/base/control.d.ts +44 -0
- package/dist/base/control.d.ts.map +1 -0
- package/dist/base/control.jsx +24 -0
- package/dist/base/control.jsx.map +1 -0
- package/dist/base/corner-badge.d.ts +35 -0
- package/dist/base/corner-badge.d.ts.map +1 -0
- package/dist/base/corner-badge.jsx +45 -0
- package/dist/base/corner-badge.jsx.map +1 -0
- package/dist/base/disposer.d.ts +28 -0
- package/dist/base/disposer.d.ts.map +1 -0
- package/dist/base/disposer.jsx +61 -0
- package/dist/base/disposer.jsx.map +1 -0
- package/dist/base/index.d.ts +10 -0
- package/dist/base/index.d.ts.map +1 -0
- package/dist/base/index.jsx +9 -0
- package/dist/base/press.d.ts +38 -0
- package/dist/base/press.d.ts.map +1 -0
- package/dist/base/press.jsx +73 -0
- package/dist/base/press.jsx.map +1 -0
- package/dist/base/pressable.d.ts +25 -0
- package/dist/base/pressable.d.ts.map +1 -0
- package/dist/base/pressable.jsx +38 -0
- package/dist/base/pressable.jsx.map +1 -0
- package/dist/base/selection-item.d.ts +29 -0
- package/dist/base/selection-item.d.ts.map +1 -0
- package/dist/base/selection-item.jsx +6 -0
- package/dist/base/selection-item.jsx.map +1 -0
- package/dist/base/timers.d.ts +7 -0
- package/dist/base/timers.d.ts.map +1 -0
- package/dist/base/timers.jsx +10 -0
- package/dist/base/timers.jsx.map +1 -0
- package/dist/base/use-controllable-state.d.ts +30 -0
- package/dist/base/use-controllable-state.d.ts.map +1 -0
- package/dist/base/use-controllable-state.jsx +49 -0
- package/dist/base/use-controllable-state.jsx.map +1 -0
- package/dist/base/use-stable-callback.d.ts +8 -0
- package/dist/base/use-stable-callback.d.ts.map +1 -0
- package/dist/base/use-stable-callback.jsx +12 -0
- package/dist/base/use-stable-callback.jsx.map +1 -0
- package/dist/button/button.css +162 -0
- package/dist/button/button.css.map +1 -0
- package/dist/button/button.d.ts +52 -0
- package/dist/button/button.d.ts.map +1 -0
- package/dist/button/button.jsx +87 -0
- package/dist/button/button.jsx.map +1 -0
- package/dist/button/header-action-button.d.ts +34 -0
- package/dist/button/header-action-button.d.ts.map +1 -0
- package/dist/button/header-action-button.jsx +51 -0
- package/dist/button/header-action-button.jsx.map +1 -0
- package/dist/button/icon-button.d.ts +46 -0
- package/dist/button/icon-button.d.ts.map +1 -0
- package/dist/button/icon-button.jsx +69 -0
- package/dist/button/icon-button.jsx.map +1 -0
- package/dist/button/index.d.ts +9 -0
- package/dist/button/index.d.ts.map +1 -0
- package/dist/button/index.jsx +8 -0
- package/dist/button/nav-card.d.ts +58 -0
- package/dist/button/nav-card.d.ts.map +1 -0
- package/dist/button/nav-card.jsx +95 -0
- package/dist/button/nav-card.jsx.map +1 -0
- package/dist/button/safe-tap.d.ts +27 -0
- package/dist/button/safe-tap.d.ts.map +1 -0
- package/dist/button/safe-tap.jsx +46 -0
- package/dist/button/safe-tap.jsx.map +1 -0
- package/dist/button/safe.d.ts +84 -0
- package/dist/button/safe.d.ts.map +1 -0
- package/dist/button/safe.jsx +116 -0
- package/dist/button/safe.jsx.map +1 -0
- package/dist/button/vertical-icon-text-button.d.ts +18 -0
- package/dist/button/vertical-icon-text-button.d.ts.map +1 -0
- package/dist/button/vertical-icon-text-button.jsx +21 -0
- package/dist/button/vertical-icon-text-button.jsx.map +1 -0
- package/dist/button/visuals.d.ts +53 -0
- package/dist/button/visuals.d.ts.map +1 -0
- package/dist/button/visuals.jsx +92 -0
- package/dist/button/visuals.jsx.map +1 -0
- package/dist/cascade/cascade-panel.d.ts +80 -0
- package/dist/cascade/cascade-panel.d.ts.map +1 -0
- package/dist/cascade/cascade-panel.jsx +179 -0
- package/dist/cascade/cascade-panel.jsx.map +1 -0
- package/dist/cascade/cascade.css +70 -0
- package/dist/cascade/cascade.css.map +1 -0
- package/dist/cascade/index.d.ts +3 -0
- package/dist/cascade/index.d.ts.map +1 -0
- package/dist/cascade/index.jsx +2 -0
- package/dist/cascade/model.d.ts +68 -0
- package/dist/cascade/model.d.ts.map +1 -0
- package/dist/cascade/model.jsx +161 -0
- package/dist/cascade/model.jsx.map +1 -0
- package/dist/deferred/deferred-content.d.ts +82 -0
- package/dist/deferred/deferred-content.d.ts.map +1 -0
- package/dist/deferred/deferred-content.jsx +263 -0
- package/dist/deferred/deferred-content.jsx.map +1 -0
- package/dist/deferred/deferred.css +62 -0
- package/dist/deferred/deferred.css.map +1 -0
- package/dist/deferred/index.d.ts +3 -0
- package/dist/deferred/index.d.ts.map +1 -0
- package/dist/deferred/index.jsx +2 -0
- package/dist/deferred/readiness-signal.d.ts +16 -0
- package/dist/deferred/readiness-signal.d.ts.map +1 -0
- package/dist/deferred/readiness-signal.jsx +29 -0
- package/dist/deferred/readiness-signal.jsx.map +1 -0
- package/dist/display/activity-indicator.d.ts +21 -0
- package/dist/display/activity-indicator.d.ts.map +1 -0
- package/dist/display/activity-indicator.jsx +22 -0
- package/dist/display/activity-indicator.jsx.map +1 -0
- package/dist/display/culture-date-time-label.d.ts +64 -0
- package/dist/display/culture-date-time-label.d.ts.map +1 -0
- package/dist/display/culture-date-time-label.jsx +71 -0
- package/dist/display/culture-date-time-label.jsx.map +1 -0
- package/dist/display/display.css +217 -0
- package/dist/display/display.css.map +1 -0
- package/dist/display/index.d.ts +7 -0
- package/dist/display/index.d.ts.map +1 -0
- package/dist/display/index.jsx +6 -0
- package/dist/display/progress-bar.d.ts +38 -0
- package/dist/display/progress-bar.d.ts.map +1 -0
- package/dist/display/progress-bar.jsx +57 -0
- package/dist/display/progress-bar.jsx.map +1 -0
- package/dist/display/separator.d.ts +30 -0
- package/dist/display/separator.d.ts.map +1 -0
- package/dist/display/separator.jsx +55 -0
- package/dist/display/separator.jsx.map +1 -0
- package/dist/display/shimmer.d.ts +41 -0
- package/dist/display/shimmer.d.ts.map +1 -0
- package/dist/display/shimmer.jsx +41 -0
- package/dist/display/shimmer.jsx.map +1 -0
- package/dist/display/title-with-line.d.ts +13 -0
- package/dist/display/title-with-line.d.ts.map +1 -0
- package/dist/display/title-with-line.jsx +21 -0
- package/dist/display/title-with-line.jsx.map +1 -0
- package/dist/edge-panel/edge-panel.css +132 -0
- package/dist/edge-panel/edge-panel.css.map +1 -0
- package/dist/edge-panel/edge-panel.d.ts +87 -0
- package/dist/edge-panel/edge-panel.d.ts.map +1 -0
- package/dist/edge-panel/edge-panel.jsx +326 -0
- package/dist/edge-panel/edge-panel.jsx.map +1 -0
- package/dist/edge-panel/helper.d.ts +27 -0
- package/dist/edge-panel/helper.d.ts.map +1 -0
- package/dist/edge-panel/helper.jsx +118 -0
- package/dist/edge-panel/helper.jsx.map +1 -0
- package/dist/edge-panel/index.d.ts +4 -0
- package/dist/edge-panel/index.d.ts.map +1 -0
- package/dist/edge-panel/index.jsx +3 -0
- package/dist/edge-panel/types.d.ts +155 -0
- package/dist/edge-panel/types.d.ts.map +1 -0
- package/dist/edge-panel/types.jsx +139 -0
- package/dist/edge-panel/types.jsx.map +1 -0
- package/dist/expander/expander.css +54 -0
- package/dist/expander/expander.css.map +1 -0
- package/dist/expander/expander.d.ts +46 -0
- package/dist/expander/expander.d.ts.map +1 -0
- package/dist/expander/expander.jsx +110 -0
- package/dist/expander/expander.jsx.map +1 -0
- package/dist/expander/index.d.ts +2 -0
- package/dist/expander/index.d.ts.map +1 -0
- package/dist/expander/index.jsx +1 -0
- package/dist/fields/dictation.d.ts +43 -0
- package/dist/fields/dictation.d.ts.map +1 -0
- package/dist/fields/dictation.jsx +124 -0
- package/dist/fields/dictation.jsx.map +1 -0
- package/dist/fields/editor.d.ts +26 -0
- package/dist/fields/editor.d.ts.map +1 -0
- package/dist/fields/editor.jsx +46 -0
- package/dist/fields/editor.jsx.map +1 -0
- package/dist/fields/fields.css +156 -0
- package/dist/fields/fields.css.map +1 -0
- package/dist/fields/index.d.ts +12 -0
- package/dist/fields/index.d.ts.map +1 -0
- package/dist/fields/index.jsx +11 -0
- package/dist/fields/input-policy.d.ts +48 -0
- package/dist/fields/input-policy.d.ts.map +1 -0
- package/dist/fields/input-policy.jsx +215 -0
- package/dist/fields/input-policy.jsx.map +1 -0
- package/dist/fields/outlined-field.d.ts +146 -0
- package/dist/fields/outlined-field.d.ts.map +1 -0
- package/dist/fields/outlined-field.jsx +196 -0
- package/dist/fields/outlined-field.jsx.map +1 -0
- package/dist/fields/pin-entry.d.ts +63 -0
- package/dist/fields/pin-entry.d.ts.map +1 -0
- package/dist/fields/pin-entry.jsx +293 -0
- package/dist/fields/pin-entry.jsx.map +1 -0
- package/dist/fields/search-entry.d.ts +35 -0
- package/dist/fields/search-entry.d.ts.map +1 -0
- package/dist/fields/search-entry.jsx +118 -0
- package/dist/fields/search-entry.jsx.map +1 -0
- package/dist/fields/slot-layout.d.ts +33 -0
- package/dist/fields/slot-layout.d.ts.map +1 -0
- package/dist/fields/slot-layout.jsx +33 -0
- package/dist/fields/slot-layout.jsx.map +1 -0
- package/dist/fields/text-entry.d.ts +62 -0
- package/dist/fields/text-entry.d.ts.map +1 -0
- package/dist/fields/text-entry.jsx +72 -0
- package/dist/fields/text-entry.jsx.map +1 -0
- package/dist/fields/use-dictation.d.ts +34 -0
- package/dist/fields/use-dictation.d.ts.map +1 -0
- package/dist/fields/use-dictation.jsx +80 -0
- package/dist/fields/use-dictation.jsx.map +1 -0
- package/dist/fields/use-text-input.d.ts +150 -0
- package/dist/fields/use-text-input.d.ts.map +1 -0
- package/dist/fields/use-text-input.jsx +237 -0
- package/dist/fields/use-text-input.jsx.map +1 -0
- package/dist/fields/validator.d.ts +14 -0
- package/dist/fields/validator.d.ts.map +1 -0
- package/dist/fields/validator.jsx +20 -0
- package/dist/fields/validator.jsx.map +1 -0
- package/dist/host/back.d.ts +42 -0
- package/dist/host/back.d.ts.map +1 -0
- package/dist/host/back.jsx +47 -0
- package/dist/host/back.jsx.map +1 -0
- package/dist/host/hooks.d.ts +85 -0
- package/dist/host/hooks.d.ts.map +1 -0
- package/dist/host/hooks.jsx +163 -0
- package/dist/host/hooks.jsx.map +1 -0
- package/dist/host/host.css +81 -0
- package/dist/host/host.css.map +1 -0
- package/dist/host/host.d.ts +70 -0
- package/dist/host/host.d.ts.map +1 -0
- package/dist/host/host.jsx +229 -0
- package/dist/host/host.jsx.map +1 -0
- package/dist/host/index.d.ts +9 -0
- package/dist/host/index.d.ts.map +1 -0
- package/dist/host/index.jsx +8 -0
- package/dist/host/keyboard.d.ts +24 -0
- package/dist/host/keyboard.d.ts.map +1 -0
- package/dist/host/keyboard.jsx +28 -0
- package/dist/host/keyboard.jsx.map +1 -0
- package/dist/host/layers.d.ts +69 -0
- package/dist/host/layers.d.ts.map +1 -0
- package/dist/host/layers.jsx +111 -0
- package/dist/host/layers.jsx.map +1 -0
- package/dist/host/page-loading-overlay.d.ts +17 -0
- package/dist/host/page-loading-overlay.d.ts.map +1 -0
- package/dist/host/page-loading-overlay.jsx +16 -0
- package/dist/host/page-loading-overlay.jsx.map +1 -0
- package/dist/host/readiness.d.ts +57 -0
- package/dist/host/readiness.d.ts.map +1 -0
- package/dist/host/readiness.jsx +138 -0
- package/dist/host/readiness.jsx.map +1 -0
- package/dist/host/registry.d.ts +106 -0
- package/dist/host/registry.d.ts.map +1 -0
- package/dist/host/registry.jsx +93 -0
- package/dist/host/registry.jsx.map +1 -0
- package/dist/icon/icon.css +39 -0
- package/dist/icon/icon.css.map +1 -0
- package/dist/icon/icon.d.ts +57 -0
- package/dist/icon/icon.d.ts.map +1 -0
- package/dist/icon/icon.jsx +115 -0
- package/dist/icon/icon.jsx.map +1 -0
- package/dist/icon/index.d.ts +4 -0
- package/dist/icon/index.d.ts.map +1 -0
- package/dist/icon/index.jsx +3 -0
- package/dist/icon/slot.d.ts +45 -0
- package/dist/icon/slot.d.ts.map +1 -0
- package/dist/icon/slot.jsx +61 -0
- package/dist/icon/slot.jsx.map +1 -0
- package/dist/icon/swatch.d.ts +29 -0
- package/dist/icon/swatch.d.ts.map +1 -0
- package/dist/icon/swatch.jsx +25 -0
- package/dist/icon/swatch.jsx.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.jsx +1 -0
- package/dist/pickers/combo-box.d.ts +42 -0
- package/dist/pickers/combo-box.d.ts.map +1 -0
- package/dist/pickers/combo-box.jsx +129 -0
- package/dist/pickers/combo-box.jsx.map +1 -0
- package/dist/pickers/date-time-picker.d.ts +63 -0
- package/dist/pickers/date-time-picker.d.ts.map +1 -0
- package/dist/pickers/date-time-picker.jsx +141 -0
- package/dist/pickers/date-time-picker.jsx.map +1 -0
- package/dist/pickers/date-time.d.ts +82 -0
- package/dist/pickers/date-time.d.ts.map +1 -0
- package/dist/pickers/date-time.jsx +130 -0
- package/dist/pickers/date-time.jsx.map +1 -0
- package/dist/pickers/index.d.ts +10 -0
- package/dist/pickers/index.d.ts.map +1 -0
- package/dist/pickers/index.jsx +9 -0
- package/dist/pickers/picker-sheet.d.ts +21 -0
- package/dist/pickers/picker-sheet.d.ts.map +1 -0
- package/dist/pickers/picker-sheet.jsx +61 -0
- package/dist/pickers/picker-sheet.jsx.map +1 -0
- package/dist/pickers/picker.d.ts +32 -0
- package/dist/pickers/picker.d.ts.map +1 -0
- package/dist/pickers/picker.jsx +72 -0
- package/dist/pickers/picker.jsx.map +1 -0
- package/dist/pickers/pickers.css +219 -0
- package/dist/pickers/pickers.css.map +1 -0
- package/dist/pickers/timespan-picker.d.ts +36 -0
- package/dist/pickers/timespan-picker.d.ts.map +1 -0
- package/dist/pickers/timespan-picker.jsx +99 -0
- package/dist/pickers/timespan-picker.jsx.map +1 -0
- package/dist/pickers/timespan.d.ts +38 -0
- package/dist/pickers/timespan.d.ts.map +1 -0
- package/dist/pickers/timespan.jsx +49 -0
- package/dist/pickers/timespan.jsx.map +1 -0
- package/dist/pickers/trigger.d.ts +34 -0
- package/dist/pickers/trigger.d.ts.map +1 -0
- package/dist/pickers/trigger.jsx +77 -0
- package/dist/pickers/trigger.jsx.map +1 -0
- package/dist/pickers/wheel-column.d.ts +32 -0
- package/dist/pickers/wheel-column.d.ts.map +1 -0
- package/dist/pickers/wheel-column.jsx +99 -0
- package/dist/pickers/wheel-column.jsx.map +1 -0
- package/dist/plus-button/index.d.ts +3 -0
- package/dist/plus-button/index.d.ts.map +1 -0
- package/dist/plus-button/index.jsx +2 -0
- package/dist/plus-button/model.d.ts +65 -0
- package/dist/plus-button/model.d.ts.map +1 -0
- package/dist/plus-button/model.jsx +86 -0
- package/dist/plus-button/model.jsx.map +1 -0
- package/dist/plus-button/plus-button.css +67 -0
- package/dist/plus-button/plus-button.css.map +1 -0
- package/dist/plus-button/plus-button.d.ts +38 -0
- package/dist/plus-button/plus-button.d.ts.map +1 -0
- package/dist/plus-button/plus-button.jsx +155 -0
- package/dist/plus-button/plus-button.jsx.map +1 -0
- package/dist/popup/frame.d.ts +101 -0
- package/dist/popup/frame.d.ts.map +1 -0
- package/dist/popup/frame.jsx +244 -0
- package/dist/popup/frame.jsx.map +1 -0
- package/dist/popup/index.d.ts +8 -0
- package/dist/popup/index.d.ts.map +1 -0
- package/dist/popup/index.jsx +7 -0
- package/dist/popup/input-form.d.ts +35 -0
- package/dist/popup/input-form.d.ts.map +1 -0
- package/dist/popup/input-form.jsx +160 -0
- package/dist/popup/input-form.jsx.map +1 -0
- package/dist/popup/input.d.ts +175 -0
- package/dist/popup/input.d.ts.map +1 -0
- package/dist/popup/input.jsx +176 -0
- package/dist/popup/input.jsx.map +1 -0
- package/dist/popup/popup-view.d.ts +25 -0
- package/dist/popup/popup-view.d.ts.map +1 -0
- package/dist/popup/popup-view.jsx +67 -0
- package/dist/popup/popup-view.jsx.map +1 -0
- package/dist/popup/popup.css +203 -0
- package/dist/popup/popup.css.map +1 -0
- package/dist/popup/queue.d.ts +90 -0
- package/dist/popup/queue.d.ts.map +1 -0
- package/dist/popup/queue.jsx +309 -0
- package/dist/popup/queue.jsx.map +1 -0
- package/dist/popup/service.d.ts +60 -0
- package/dist/popup/service.d.ts.map +1 -0
- package/dist/popup/service.jsx +342 -0
- package/dist/popup/service.jsx.map +1 -0
- package/dist/popup/types.d.ts +211 -0
- package/dist/popup/types.d.ts.map +1 -0
- package/dist/popup/types.jsx +218 -0
- package/dist/popup/types.jsx.map +1 -0
- package/dist/provider/contexts.d.ts +41 -0
- package/dist/provider/contexts.d.ts.map +1 -0
- package/dist/provider/contexts.jsx +11 -0
- package/dist/provider/contexts.jsx.map +1 -0
- package/dist/provider/global-events.d.ts +8 -0
- package/dist/provider/global-events.d.ts.map +1 -0
- package/dist/provider/global-events.jsx +17 -0
- package/dist/provider/global-events.jsx.map +1 -0
- package/dist/provider/hooks.d.ts +49 -0
- package/dist/provider/hooks.d.ts.map +1 -0
- package/dist/provider/hooks.jsx +72 -0
- package/dist/provider/hooks.jsx.map +1 -0
- package/dist/provider/index.d.ts +5 -0
- package/dist/provider/index.d.ts.map +1 -0
- package/dist/provider/index.jsx +3 -0
- package/dist/provider/provider.css +18 -0
- package/dist/provider/provider.css.map +1 -0
- package/dist/provider/provider.d.ts +51 -0
- package/dist/provider/provider.d.ts.map +1 -0
- package/dist/provider/provider.jsx +290 -0
- package/dist/provider/provider.jsx.map +1 -0
- package/dist/provider/settings.d.ts +99 -0
- package/dist/provider/settings.d.ts.map +1 -0
- package/dist/provider/settings.jsx +45 -0
- package/dist/provider/settings.jsx.map +1 -0
- package/dist/provider/theme-css.d.ts +12 -0
- package/dist/provider/theme-css.d.ts.map +1 -0
- package/dist/provider/theme-css.jsx +19 -0
- package/dist/provider/theme-css.jsx.map +1 -0
- package/dist/provider/theme-root.d.ts +10 -0
- package/dist/provider/theme-root.d.ts.map +1 -0
- package/dist/provider/theme-root.jsx +24 -0
- package/dist/provider/theme-root.jsx.map +1 -0
- package/dist/provider/theme.css +473 -0
- package/dist/provider/theme.css.map +1 -0
- package/dist/range-slider/index.d.ts +3 -0
- package/dist/range-slider/index.d.ts.map +1 -0
- package/dist/range-slider/index.jsx +2 -0
- package/dist/range-slider/math.d.ts +23 -0
- package/dist/range-slider/math.d.ts.map +1 -0
- package/dist/range-slider/math.jsx +71 -0
- package/dist/range-slider/math.jsx.map +1 -0
- package/dist/range-slider/range-slider.css +90 -0
- package/dist/range-slider/range-slider.css.map +1 -0
- package/dist/range-slider/range-slider.d.ts +52 -0
- package/dist/range-slider/range-slider.d.ts.map +1 -0
- package/dist/range-slider/range-slider.jsx +159 -0
- package/dist/range-slider/range-slider.jsx.map +1 -0
- package/dist/selection/index.d.ts +5 -0
- package/dist/selection/index.d.ts.map +1 -0
- package/dist/selection/index.jsx +3 -0
- package/dist/selection/model.d.ts +53 -0
- package/dist/selection/model.d.ts.map +1 -0
- package/dist/selection/model.jsx +69 -0
- package/dist/selection/model.jsx.map +1 -0
- package/dist/selection/selection-sheet.d.ts +80 -0
- package/dist/selection/selection-sheet.d.ts.map +1 -0
- package/dist/selection/selection-sheet.jsx +362 -0
- package/dist/selection/selection-sheet.jsx.map +1 -0
- package/dist/selection/selection.css +75 -0
- package/dist/selection/selection.css.map +1 -0
- package/dist/selection/use-selection-model.d.ts +9 -0
- package/dist/selection/use-selection-model.d.ts.map +1 -0
- package/dist/selection/use-selection-model.jsx +22 -0
- package/dist/selection/use-selection-model.jsx.map +1 -0
- package/dist/sheet/frame.d.ts +45 -0
- package/dist/sheet/frame.d.ts.map +1 -0
- package/dist/sheet/frame.jsx +205 -0
- package/dist/sheet/frame.jsx.map +1 -0
- package/dist/sheet/header.d.ts +35 -0
- package/dist/sheet/header.d.ts.map +1 -0
- package/dist/sheet/header.jsx +145 -0
- package/dist/sheet/header.jsx.map +1 -0
- package/dist/sheet/height-memo.d.ts +47 -0
- package/dist/sheet/height-memo.d.ts.map +1 -0
- package/dist/sheet/height-memo.jsx +100 -0
- package/dist/sheet/height-memo.jsx.map +1 -0
- package/dist/sheet/index.d.ts +11 -0
- package/dist/sheet/index.d.ts.map +1 -0
- package/dist/sheet/index.jsx +10 -0
- package/dist/sheet/loadable.d.ts +35 -0
- package/dist/sheet/loadable.d.ts.map +1 -0
- package/dist/sheet/loadable.jsx +65 -0
- package/dist/sheet/loadable.jsx.map +1 -0
- package/dist/sheet/options.d.ts +220 -0
- package/dist/sheet/options.d.ts.map +1 -0
- package/dist/sheet/options.jsx +91 -0
- package/dist/sheet/options.jsx.map +1 -0
- package/dist/sheet/processing.d.ts +22 -0
- package/dist/sheet/processing.d.ts.map +1 -0
- package/dist/sheet/processing.jsx +66 -0
- package/dist/sheet/processing.jsx.map +1 -0
- package/dist/sheet/service.d.ts +55 -0
- package/dist/sheet/service.d.ts.map +1 -0
- package/dist/sheet/service.jsx +143 -0
- package/dist/sheet/service.jsx.map +1 -0
- package/dist/sheet/sheet.css +195 -0
- package/dist/sheet/sheet.css.map +1 -0
- package/dist/sheet/sheet.d.ts +19 -0
- package/dist/sheet/sheet.d.ts.map +1 -0
- package/dist/sheet/sheet.jsx +40 -0
- package/dist/sheet/sheet.jsx.map +1 -0
- package/dist/sheet/sizing.d.ts +69 -0
- package/dist/sheet/sizing.d.ts.map +1 -0
- package/dist/sheet/sizing.jsx +146 -0
- package/dist/sheet/sizing.jsx.map +1 -0
- package/dist/sheet/stack.d.ts +161 -0
- package/dist/sheet/stack.d.ts.map +1 -0
- package/dist/sheet/stack.jsx +378 -0
- package/dist/sheet/stack.jsx.map +1 -0
- package/dist/swipe/index.d.ts +3 -0
- package/dist/swipe/index.d.ts.map +1 -0
- package/dist/swipe/index.jsx +2 -0
- package/dist/swipe/model.d.ts +72 -0
- package/dist/swipe/model.d.ts.map +1 -0
- package/dist/swipe/model.jsx +66 -0
- package/dist/swipe/model.jsx.map +1 -0
- package/dist/swipe/swipe-view.d.ts +40 -0
- package/dist/swipe/swipe-view.d.ts.map +1 -0
- package/dist/swipe/swipe-view.jsx +163 -0
- package/dist/swipe/swipe-view.jsx.map +1 -0
- package/dist/swipe/swipe.css +34 -0
- package/dist/swipe/swipe.css.map +1 -0
- package/dist/tab-bar/index.d.ts +4 -0
- package/dist/tab-bar/index.d.ts.map +1 -0
- package/dist/tab-bar/index.jsx +3 -0
- package/dist/tab-bar/metrics.d.ts +230 -0
- package/dist/tab-bar/metrics.d.ts.map +1 -0
- package/dist/tab-bar/metrics.jsx +221 -0
- package/dist/tab-bar/metrics.jsx.map +1 -0
- package/dist/tab-bar/model.d.ts +170 -0
- package/dist/tab-bar/model.d.ts.map +1 -0
- package/dist/tab-bar/model.jsx +349 -0
- package/dist/tab-bar/model.jsx.map +1 -0
- package/dist/tab-bar/tab-bar.css +173 -0
- package/dist/tab-bar/tab-bar.css.map +1 -0
- package/dist/tab-bar/tab-bar.d.ts +56 -0
- package/dist/tab-bar/tab-bar.d.ts.map +1 -0
- package/dist/tab-bar/tab-bar.jsx +343 -0
- package/dist/tab-bar/tab-bar.jsx.map +1 -0
- package/dist/tabs/index.d.ts +3 -0
- package/dist/tabs/index.d.ts.map +1 -0
- package/dist/tabs/index.jsx +2 -0
- package/dist/tabs/model.d.ts +83 -0
- package/dist/tabs/model.d.ts.map +1 -0
- package/dist/tabs/model.jsx +113 -0
- package/dist/tabs/model.jsx.map +1 -0
- package/dist/tabs/tab-view.d.ts +47 -0
- package/dist/tabs/tab-view.d.ts.map +1 -0
- package/dist/tabs/tab-view.jsx +227 -0
- package/dist/tabs/tab-view.jsx.map +1 -0
- package/dist/tabs/tabs.css +182 -0
- package/dist/tabs/tabs.css.map +1 -0
- package/dist/toast/index.d.ts +3 -0
- package/dist/toast/index.d.ts.map +1 -0
- package/dist/toast/index.jsx +2 -0
- package/dist/toast/service.d.ts +48 -0
- package/dist/toast/service.d.ts.map +1 -0
- package/dist/toast/service.jsx +201 -0
- package/dist/toast/service.jsx.map +1 -0
- package/dist/toast/store.d.ts +174 -0
- package/dist/toast/store.d.ts.map +1 -0
- package/dist/toast/store.jsx +353 -0
- package/dist/toast/store.jsx.map +1 -0
- package/dist/toast/toast.css +152 -0
- package/dist/toast/toast.css.map +1 -0
- package/dist/toggle/checkbox-math.d.ts +52 -0
- package/dist/toggle/checkbox-math.d.ts.map +1 -0
- package/dist/toggle/checkbox-math.jsx +111 -0
- package/dist/toggle/checkbox-math.jsx.map +1 -0
- package/dist/toggle/checkbox.d.ts +56 -0
- package/dist/toggle/checkbox.d.ts.map +1 -0
- package/dist/toggle/checkbox.jsx +152 -0
- package/dist/toggle/checkbox.jsx.map +1 -0
- package/dist/toggle/chip-group.d.ts +50 -0
- package/dist/toggle/chip-group.d.ts.map +1 -0
- package/dist/toggle/chip-group.jsx +107 -0
- package/dist/toggle/chip-group.jsx.map +1 -0
- package/dist/toggle/index.d.ts +5 -0
- package/dist/toggle/index.d.ts.map +1 -0
- package/dist/toggle/index.jsx +4 -0
- package/dist/toggle/switch.d.ts +52 -0
- package/dist/toggle/switch.d.ts.map +1 -0
- package/dist/toggle/switch.jsx +192 -0
- package/dist/toggle/switch.jsx.map +1 -0
- package/dist/toggle/toggle.css +189 -0
- package/dist/toggle/toggle.css.map +1 -0
- package/package.json +155 -4
- package/rspeedy/index.d.ts +21 -0
- package/rspeedy/index.mjs +75 -0
- package/rspeedy/index.test.mjs +52 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cascade/model.jsx","sources":["../../src/cascade/model.ts"],"sourcesContent":["import type { G9CascadeDirection } from '@g9tm/lynxcontrols-foundation';\nimport type { ReactNode } from '@lynx-js/react';\n\n// The drill-down stack of `G9CascadePanel` (MAUI `G9CascadePanel` push/pop logic), as a pure model: the view renders\n// its snapshot; timers come from the caller so tests drive time.\n\n/** A nested panel's content: built, or built lazily after its slide (spinner meanwhile). */\nexport type G9CascadeContent = ReactNode | (() => ReactNode);\n\n/** Options of one push (MAUI `Push(content, title, direction, wrapInScrollView)`). */\nexport interface G9CascadePushOptions {\n readonly title?: string | null;\n /** Entry direction of this panel; default the panel's `direction`. */\n readonly direction?: G9CascadeDirection;\n /** Wrap the content in a vertical scroll view (false for content that scrolls itself, e.g. a list). Default true. */\n readonly wrapInScrollView?: boolean;\n}\n\n/** Where a panel is in its life. `staged` = mounted off-screen for one frame so the slide can start from there. */\nexport type G9CascadePanelStatus = 'staged' | 'entering' | 'shown' | 'leaving';\n\n/** One nested panel (depth ≥ 1). */\nexport interface G9CascadePanelEntry {\n readonly id: number;\n readonly content: G9CascadeContent;\n readonly title: string | null;\n readonly direction: G9CascadeDirection | null;\n readonly wrap: boolean;\n readonly status: G9CascadePanelStatus;\n}\n\n/** Timing and callbacks of the stack. */\nexport interface G9CascadeConfig {\n setTimer(callback: () => void, ms: number): unknown;\n clearTimer(handle: unknown): void;\n durationMs(): number;\n onPushed?(depth: number): void;\n onPopped?(depth: number): void;\n}\n\ntype Op =\n | { kind: 'push'; content: G9CascadeContent; options: G9CascadePushOptions; done: (ok: boolean) => void }\n | {\n kind: 'pop';\n done: (ok: boolean) => void;\n };\n\n/**\n * One slide at a time (MAUI re-entrancy guard): a second operation of the SAME kind during a slide is dropped (two\n * taps never push two panels or pop two levels); one of the OTHER kind is parked and runs when the slide ends (a newer\n * parked one replaces it). `popToRoot` waits out a slide in flight. Every operation resolves `true` when its slide\n * finished, `false` when it was dropped, displaced or had nothing to do.\n */\nexport class G9CascadeStack {\n private panels: G9CascadePanelEntry[] = [];\n private nextId = 1;\n private running: Op['kind'] | null = null;\n private parked: Op | null = null;\n private timers = new Set<unknown>();\n private readonly listeners = new Set<() => void>();\n private snapshot: ReadonlyArray<G9CascadePanelEntry> = [];\n private disposed = false;\n\n constructor(private readonly config: G9CascadeConfig) {}\n\n /** Nested depth: 0 = only the root (MAUI `Depth`); a leaving panel no longer counts. */\n get depth(): number {\n return this.panels.filter((p) => p.status !== 'leaving').length;\n }\n\n getSnapshot(): ReadonlyArray<G9CascadePanelEntry> {\n return this.snapshot;\n }\n\n subscribe(listener: () => void): () => void {\n this.listeners.add(listener);\n return () => this.listeners.delete(listener);\n }\n\n /** Pushes a panel; resolves when it slid in (MAUI `PushAsync`). */\n push(content: G9CascadeContent, options: G9CascadePushOptions = {}): Promise<boolean> {\n return new Promise((done) => this.request({ kind: 'push', content, options, done }));\n }\n\n /** Pops the top panel; resolves when it slid out. No-op at the root (MAUI `PopAsync`). */\n pop(): Promise<boolean> {\n return new Promise((done) => this.request({ kind: 'pop', done }));\n }\n\n /** Pops every panel back to the root, after a slide in flight (MAUI `PopToRootAsync`). */\n async popToRoot(): Promise<boolean> {\n while (this.running) await new Promise<void>((r) => this.later(r, this.config.durationMs()));\n if (this.depth === 0) return false;\n // The intermediate levels go at once; the top one slides out over the root.\n const top = this.panels[this.panels.length - 1] as G9CascadePanelEntry;\n this.panels = [top];\n this.emit();\n return this.pop();\n }\n\n /** Cancels every timer; pending operations resolve `false`. */\n dispose(): void {\n this.disposed = true;\n for (const t of this.timers) this.config.clearTimer(t);\n this.timers.clear();\n this.parked?.done(false);\n this.parked = null;\n }\n\n private request(op: Op): void {\n if (this.disposed) {\n op.done(false);\n return;\n }\n if (this.running) {\n if (this.running === op.kind) {\n op.done(false);\n return;\n }\n this.parked?.done(false);\n this.parked = op;\n return;\n }\n this.start(op);\n }\n\n private start(op: Op): void {\n if (op.kind === 'pop') {\n const top = [...this.panels].reverse().find((p) => p.status !== 'leaving');\n if (!top) {\n op.done(false);\n return;\n }\n this.running = 'pop';\n this.set(top.id, 'leaving');\n this.later(() => {\n this.panels = this.panels.filter((p) => p.id !== top.id);\n this.emit();\n this.finish(op, () => this.config.onPopped?.(this.depth));\n }, this.config.durationMs());\n return;\n }\n this.running = 'push';\n const entry: G9CascadePanelEntry = {\n id: this.nextId++,\n content: op.content,\n title: op.options.title ?? null,\n direction: op.options.direction ?? null,\n wrap: op.options.wrapInScrollView !== false,\n status: 'staged',\n };\n this.panels = [...this.panels, entry];\n this.emit();\n // One frame off-screen, then the slide (MAUI parks the panel once it has a size, then animates).\n this.later(() => {\n this.set(entry.id, 'entering');\n this.later(() => {\n this.set(entry.id, 'shown');\n this.finish(op, () => this.config.onPushed?.(this.depth));\n }, this.config.durationMs());\n }, 16);\n }\n\n private finish(op: Op, report: () => void): void {\n this.running = null;\n try {\n report();\n } finally {\n op.done(true);\n const parked = this.parked;\n this.parked = null;\n if (parked && !this.disposed) this.start(parked);\n }\n }\n\n private set(id: number, status: G9CascadePanelStatus): void {\n this.panels = this.panels.map((p) => (p.id === id ? { ...p, status } : p));\n this.emit();\n }\n\n private later(callback: () => void, ms: number): void {\n const handle = this.config.setTimer(() => {\n this.timers.delete(handle);\n if (!this.disposed) callback();\n }, ms);\n this.timers.add(handle);\n }\n\n private emit(): void {\n this.snapshot = this.panels;\n for (const l of this.listeners) l();\n }\n}\n"],"names":["G9CascadeStack","p","listener","content","options","Promise","done","r","top","_this_parked","t","op","_op_options_title","_op_options_direction","_this_config","entry","report","parked","id","status","callback","ms","handle","l","config","Set"],"mappings":";;;;;;;;;;AAqDO,MAAMA;IAaX,IAAI,QAAgB;QAClB,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAACC,IAAMA,AAAa,cAAbA,EAAE,MAAM,EAAgB,MAAM;IACjE;IAEA,cAAkD;QAChD,OAAO,IAAI,CAAC,QAAQ;IACtB;IAEA,UAAUC,QAAoB,EAAc;QAC1C,IAAI,CAAC,SAAS,CAAC,GAAG,CAACA;QACnB,OAAO,IAAM,IAAI,CAAC,SAAS,CAAC,MAAM,CAACA;IACrC;IAGA,KAAKC,OAAyB,EAAEC,UAAgC,CAAC,CAAC,EAAoB;QACpF,OAAO,IAAIC,QAAQ,CAACC,OAAS,IAAI,CAAC,OAAO,CAAC;gBAAE,MAAM;gBAAQH;gBAASC;gBAASE;YAAK;IACnF;IAGA,MAAwB;QACtB,OAAO,IAAID,QAAQ,CAACC,OAAS,IAAI,CAAC,OAAO,CAAC;gBAAE,MAAM;gBAAOA;YAAK;IAChE;IAGA,MAAM,YAA8B;QAClC,MAAO,IAAI,CAAC,OAAO,CAAE,MAAM,IAAID,QAAc,CAACE,IAAM,IAAI,CAAC,KAAK,CAACA,GAA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,MAAM,GAAc;aACpB,MAAM,GAAG,IAAIC;aACJ,SAAS,GAAG,IAAIA;aACzB,QAAQ,GAAuC,EAAE;aACjD,QAAQ,GAAG;IAEoC;AAiIzD"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { type G9AbortSignal } from '@g9tm/lynxcontrols-foundation';
|
|
2
|
+
import { type ReactNode } from '@lynx-js/react';
|
|
3
|
+
import type { CSSProperties } from '@lynx-js/types';
|
|
4
|
+
import { type G9ReadinessSignal } from './readiness-signal.js';
|
|
5
|
+
import './deferred.css';
|
|
6
|
+
/** Default delay before the content is built (MAUI `DeferredContentView.DefaultLoadDelayMs`, the layout metric, 369). */
|
|
7
|
+
export declare const g9DeferredLoadDelayMs: number;
|
|
8
|
+
/** Default cap of the covered reveal's settle window (MAUI `FadeRevealDelayMs`). */
|
|
9
|
+
export declare const g9DeferredFadeRevealDelayMs = 220;
|
|
10
|
+
/** Default frames the covered content gets after its first layout (MAUI `RevealSettleFrames`). */
|
|
11
|
+
export declare const g9DeferredRevealSettleFrames = 2;
|
|
12
|
+
/** Longest the covered reveal waits for readiness signals (MAUI `ContentReadinessTimeoutMs`). */
|
|
13
|
+
export declare const g9DeferredReadinessTimeoutMs = 5000;
|
|
14
|
+
/** The cover's fade-out (MAUI: `FadeToAsync(0, 160, CubicIn)`). */
|
|
15
|
+
export declare const g9DeferredCoverFadeMs = 160;
|
|
16
|
+
/** Imperative handle of {@link G9DeferredContent} (via `ref`). */
|
|
17
|
+
export interface G9DeferredContentHandle {
|
|
18
|
+
/**
|
|
19
|
+
* Starts the load now (MAUI `LoadContentAsync`): waits `loadDelayMs`, builds the content, reveals it. A second call
|
|
20
|
+
* while a load is claimed returns at once. Aborting `signal` (or unmounting) before the content is built releases
|
|
21
|
+
* the claim so a later call loads again. Settles when the content is mounted (not when the reveal settles).
|
|
22
|
+
*/
|
|
23
|
+
load(signal?: G9AbortSignal): Promise<void>;
|
|
24
|
+
/** The load has been claimed (MAUI `IsContentLoaded`): a re-entrancy latch, `true` from the start of a load. */
|
|
25
|
+
readonly isContentLoaded: boolean;
|
|
26
|
+
/** The final content is the only visual (MAUI `IsRevealSettled`); also `true` after a failure. */
|
|
27
|
+
readonly isRevealSettled: boolean;
|
|
28
|
+
}
|
|
29
|
+
/** Props of {@link G9DeferredContent}. */
|
|
30
|
+
export interface G9DeferredContentProps {
|
|
31
|
+
/** Builds the content after the delay (MAUI `ContentFactory`): preferred when building is expensive. */
|
|
32
|
+
readonly render?: () => ReactNode;
|
|
33
|
+
/** Already-built content to swap in after the delay (MAUI `DeferredContent`); used when `render` is absent. */
|
|
34
|
+
readonly children?: ReactNode;
|
|
35
|
+
/** The placeholder (MAUI `LoadingView`). Default: a full-fill themed background with a centred 42 px spinner. */
|
|
36
|
+
readonly placeholder?: ReactNode;
|
|
37
|
+
/** Start loading on mount (MAUI `AutoLoad`). Default `true`; otherwise call `ref.load()`. */
|
|
38
|
+
readonly autoLoad?: boolean;
|
|
39
|
+
/** Delay before the content is built (MAUI `LoadDelayMs`). Default {@link g9DeferredLoadDelayMs}. */
|
|
40
|
+
readonly loadDelayMs?: number;
|
|
41
|
+
/**
|
|
42
|
+
* Reveal under the opaque placeholder and fade it out once the content settled (MAUI `FadeContentIn`): first
|
|
43
|
+
* layout + `revealSettleFrames` frames (capped by `fadeRevealDelayMs`), then every readiness gate
|
|
44
|
+
* (`useG9DeferredReadiness`, at most 5 s), then a 160 ms fade. Default `false` (instant swap).
|
|
45
|
+
*/
|
|
46
|
+
readonly fadeContentIn?: boolean;
|
|
47
|
+
/** Cap of the settle window (MAUI `FadeRevealDelayMs`); `0` skips it. Default 220. */
|
|
48
|
+
readonly fadeRevealDelayMs?: number;
|
|
49
|
+
/** Frames after the content's first layout (MAUI `RevealSettleFrames`). Default 2. */
|
|
50
|
+
readonly revealSettleFrames?: number;
|
|
51
|
+
/** Called right after the content was built, before it is shown (MAUI `OnContentCreated`). */
|
|
52
|
+
readonly onContentCreated?: () => void;
|
|
53
|
+
/** The content is mounted (MAUI `ContentLoaded`); with `fadeContentIn` it is still covered. */
|
|
54
|
+
readonly onContentLoaded?: () => void;
|
|
55
|
+
/** The content is the only visual, or the load failed (MAUI `RevealSettled`): re-measure here. */
|
|
56
|
+
readonly onRevealSettled?: () => void;
|
|
57
|
+
/**
|
|
58
|
+
* What to show after a failure: the build threw, or the content threw while rendering. Default: the placeholder
|
|
59
|
+
* stays (MAUI). The error has already gone to diagnostics and the executor's popup; `retry` loads again.
|
|
60
|
+
*/
|
|
61
|
+
readonly renderError?: (error: unknown, retry: () => void) => ReactNode;
|
|
62
|
+
/** Names the load in diagnostics (`deferred:<name>`). Default `'G9DeferredContent'`. */
|
|
63
|
+
readonly name?: string;
|
|
64
|
+
readonly className?: string;
|
|
65
|
+
readonly style?: CSSProperties;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Opts the calling content into the covered reveal's readiness gate (MAUI `IDeferredContentReadiness` /
|
|
69
|
+
* `GateContentReadiness`): the placeholder stays until the returned signal's `markReady()` runs (bounded by 5 s), so
|
|
70
|
+
* work applied after the first layout (a data fill, a scroll-to-selection) is never seen re-rendering. Call
|
|
71
|
+
* `markReady()` on every path, including failures. Outside a fading `G9DeferredContent` nothing waits for it.
|
|
72
|
+
*/
|
|
73
|
+
export declare function useG9DeferredReadiness(): G9ReadinessSignal;
|
|
74
|
+
/**
|
|
75
|
+
* Shows a placeholder first and the real content after the host's open animation (MAUI `DeferredContentView`), so an
|
|
76
|
+
* expensive body never blocks the animation and the user sees motion, not a blank host. The build runs through the
|
|
77
|
+
* provider's safe executor (errors go to diagnostics and the popup), holds a busy activity `deferred:<name>` until the
|
|
78
|
+
* reveal settles, is cancelled by unmount, and can be retried. Built on lynx-ui `DeferredComponent` for the
|
|
79
|
+
* frame-counted settle window of the covered reveal. Must be inside `G9Provider`.
|
|
80
|
+
*/
|
|
81
|
+
export declare const G9DeferredContent: import("react").ForwardRefExoticComponent<G9DeferredContentProps & import("react").RefAttributes<G9DeferredContentHandle>>;
|
|
82
|
+
//# sourceMappingURL=deferred-content.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deferred-content.d.ts","sourceRoot":"","sources":["../../src/deferred/deferred-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,aAAa,EAGnB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAIL,KAAK,SAAS,EAOf,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAIpD,OAAO,EAAyB,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACnF,OAAO,gBAAgB,CAAC;AAExB,yHAAyH;AACzH,eAAO,MAAM,qBAAqB,EAAE,MAAmD,CAAC;AACxF,oFAAoF;AACpF,eAAO,MAAM,2BAA2B,MAAM,CAAC;AAC/C,kGAAkG;AAClG,eAAO,MAAM,4BAA4B,IAAI,CAAC;AAC9C,iGAAiG;AACjG,eAAO,MAAM,4BAA4B,OAAO,CAAC;AACjD,mEAAmE;AACnE,eAAO,MAAM,qBAAqB,MAAM,CAAC;AAEzC,kEAAkE;AAClE,MAAM,WAAW,uBAAuB;IACtC;;;;OAIG;IACH,IAAI,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5C,gHAAgH;IAChH,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;IAClC,kGAAkG;IAClG,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;CACnC;AAED,0CAA0C;AAC1C,MAAM,WAAW,sBAAsB;IACrC,wGAAwG;IACxG,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,SAAS,CAAC;IAClC,+GAA+G;IAC/G,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;IAC9B,iHAAiH;IACjH,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,CAAC;IACjC,6FAA6F;IAC7F,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,qGAAqG;IACrG,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B;;;;OAIG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IACjC,sFAAsF;IACtF,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IACpC,sFAAsF;IACtF,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IACrC,8FAA8F;IAC9F,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IACvC,+FAA+F;IAC/F,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IACtC,kGAAkG;IAClG,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IACtC;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,IAAI,KAAK,SAAS,CAAC;IACxE,wFAAwF;IACxF,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,aAAa,CAAC;CAChC;AAOD;;;;;GAKG;AACH,wBAAgB,sBAAsB,IAAI,iBAAiB,CAK1D;AA0CD;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,4HAoN5B,CAAC"}
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import { createAbortController, g9LayoutMetrics } from "@g9tm/lynxcontrols-foundation";
|
|
2
|
+
import { DeferredComponent } from "@lynx-js/lynx-ui-deferred-component";
|
|
3
|
+
import { createContext, forwardRef, useContext, useEffect, useErrorBoundary, useImperativeHandle, useRef, useState } from "@lynx-js/react";
|
|
4
|
+
import { useDisposer } from "../base/disposer.jsx";
|
|
5
|
+
import { useStableCallback } from "../base/use-stable-callback.jsx";
|
|
6
|
+
import { useG9Core } from "../provider/hooks.jsx";
|
|
7
|
+
import { createReadinessSignal } from "./readiness-signal.jsx";
|
|
8
|
+
import "./deferred.css";
|
|
9
|
+
const g9DeferredLoadDelayMs = g9LayoutMetrics.DeferredContentLoadDelayMs;
|
|
10
|
+
const g9DeferredFadeRevealDelayMs = 220;
|
|
11
|
+
const g9DeferredRevealSettleFrames = 2;
|
|
12
|
+
const g9DeferredReadinessTimeoutMs = 5000;
|
|
13
|
+
const g9DeferredCoverFadeMs = 160;
|
|
14
|
+
const G9DeferredReadinessContext = createContext(null);
|
|
15
|
+
function useG9DeferredReadiness() {
|
|
16
|
+
const [signal] = useState(createReadinessSignal);
|
|
17
|
+
const registry = useContext(G9DeferredReadinessContext);
|
|
18
|
+
useEffect(()=>null == registry ? void 0 : registry.register(signal), [
|
|
19
|
+
registry,
|
|
20
|
+
signal
|
|
21
|
+
]);
|
|
22
|
+
return signal;
|
|
23
|
+
}
|
|
24
|
+
function DefaultPlaceholder() {
|
|
25
|
+
return <view className="g9-deferred__placeholder">
|
|
26
|
+
<view className="g9-deferred__spinner"/>
|
|
27
|
+
</view>;
|
|
28
|
+
}
|
|
29
|
+
function SettleProbe(props) {
|
|
30
|
+
const { onSettled } = props;
|
|
31
|
+
useEffect(()=>onSettled(), [
|
|
32
|
+
onSettled
|
|
33
|
+
]);
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
function ContentBoundary(props) {
|
|
37
|
+
const [error] = useErrorBoundary(props.onError);
|
|
38
|
+
return error ? null : props.children;
|
|
39
|
+
}
|
|
40
|
+
function waitFor(ms, signals, schedule) {
|
|
41
|
+
return new Promise((resolve)=>{
|
|
42
|
+
const live = signals.filter((signal)=>void 0 !== signal);
|
|
43
|
+
if (live.some((signal)=>signal.aborted)) return resolve(false);
|
|
44
|
+
let cancel = ()=>{};
|
|
45
|
+
const onAbort = ()=>finish(false);
|
|
46
|
+
function finish(ok) {
|
|
47
|
+
cancel();
|
|
48
|
+
for (const signal of live)signal.removeEventListener('abort', onAbort);
|
|
49
|
+
resolve(ok);
|
|
50
|
+
}
|
|
51
|
+
for (const signal of live)signal.addEventListener('abort', onAbort);
|
|
52
|
+
if (ms > 0) cancel = schedule(()=>finish(true), ms);
|
|
53
|
+
else Promise.resolve().then(()=>finish(!live.some((signal)=>signal.aborted)));
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
const deferred_content_G9DeferredContent = forwardRef(function(props, ref) {
|
|
57
|
+
var _props_name, _props_fadeContentIn, _props_fadeRevealDelayMs, _props_placeholder, _latest_current_revealSettleFrames;
|
|
58
|
+
const core = useG9Core();
|
|
59
|
+
const disposer = useDisposer();
|
|
60
|
+
const latest = useRef(props);
|
|
61
|
+
latest.current = props;
|
|
62
|
+
const name = null != (_props_name = props.name) ? _props_name : 'G9DeferredContent';
|
|
63
|
+
const fade = null != (_props_fadeContentIn = props.fadeContentIn) ? _props_fadeContentIn : false;
|
|
64
|
+
const settleCap = null != (_props_fadeRevealDelayMs = props.fadeRevealDelayMs) ? _props_fadeRevealDelayMs : g9DeferredFadeRevealDelayMs;
|
|
65
|
+
const [phase, setPhase] = useState('placeholder');
|
|
66
|
+
const [content, setContent] = useState(null);
|
|
67
|
+
const [failure, setFailure] = useState(null);
|
|
68
|
+
const [coverFading, setCoverFading] = useState(false);
|
|
69
|
+
const [session] = useState(()=>({
|
|
70
|
+
claimed: false,
|
|
71
|
+
settled: false,
|
|
72
|
+
attempt: 0,
|
|
73
|
+
unmount: createAbortController(),
|
|
74
|
+
activity: null,
|
|
75
|
+
gates: new Set()
|
|
76
|
+
}));
|
|
77
|
+
const [registry] = useState(()=>({
|
|
78
|
+
register (signal) {
|
|
79
|
+
session.gates.add(signal);
|
|
80
|
+
return ()=>{
|
|
81
|
+
session.gates.delete(signal);
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
}));
|
|
85
|
+
const endActivity = ()=>{
|
|
86
|
+
var _session_activity;
|
|
87
|
+
null == (_session_activity = session.activity) || _session_activity.dispose();
|
|
88
|
+
session.activity = null;
|
|
89
|
+
};
|
|
90
|
+
const fail = useStableCallback((error)=>{
|
|
91
|
+
var _latest_current_onRevealSettled, _latest_current;
|
|
92
|
+
session.claimed = false;
|
|
93
|
+
session.settled = true;
|
|
94
|
+
endActivity();
|
|
95
|
+
setFailure({
|
|
96
|
+
error
|
|
97
|
+
});
|
|
98
|
+
setPhase('failed');
|
|
99
|
+
null == (_latest_current_onRevealSettled = (_latest_current = latest.current).onRevealSettled) || _latest_current_onRevealSettled.call(_latest_current);
|
|
100
|
+
});
|
|
101
|
+
const reportRenderError = useStableCallback((error)=>{
|
|
102
|
+
core.executor.run(()=>{
|
|
103
|
+
throw error;
|
|
104
|
+
}, {
|
|
105
|
+
source: name,
|
|
106
|
+
throttleKey: `${name}.render`,
|
|
107
|
+
enableThrottle: false,
|
|
108
|
+
preventConcurrentExecution: false
|
|
109
|
+
});
|
|
110
|
+
fail(error);
|
|
111
|
+
});
|
|
112
|
+
const load = useStableCallback(async (signal)=>{
|
|
113
|
+
var _session;
|
|
114
|
+
if (session.claimed || session.unmount.signal.aborted) return;
|
|
115
|
+
session.claimed = true;
|
|
116
|
+
session.settled = false;
|
|
117
|
+
null != (_session = session).activity || (_session.activity = core.diagnostics.activity(`deferred:${name}`));
|
|
118
|
+
let built = false;
|
|
119
|
+
const result = await core.executor.run(async (context)=>{
|
|
120
|
+
var _latest_current_loadDelayMs;
|
|
121
|
+
var _current_onContentCreated;
|
|
122
|
+
const delay = null != (_latest_current_loadDelayMs = latest.current.loadDelayMs) ? _latest_current_loadDelayMs : g9DeferredLoadDelayMs;
|
|
123
|
+
const due = await waitFor(delay, [
|
|
124
|
+
context.signal,
|
|
125
|
+
session.unmount.signal,
|
|
126
|
+
signal
|
|
127
|
+
], disposer.setTimeout);
|
|
128
|
+
if (!due) return;
|
|
129
|
+
const current = latest.current;
|
|
130
|
+
const node = current.render ? current.render() : current.children;
|
|
131
|
+
null == (_current_onContentCreated = current.onContentCreated) || _current_onContentCreated.call(current);
|
|
132
|
+
session.attempt += 1;
|
|
133
|
+
built = true;
|
|
134
|
+
setFailure(null);
|
|
135
|
+
setCoverFading(false);
|
|
136
|
+
setContent({
|
|
137
|
+
node,
|
|
138
|
+
attempt: session.attempt
|
|
139
|
+
});
|
|
140
|
+
setPhase(fade ? 'revealing' : 'settled');
|
|
141
|
+
}, {
|
|
142
|
+
source: name,
|
|
143
|
+
throttleKey: `${name}.load`,
|
|
144
|
+
enableThrottle: false,
|
|
145
|
+
preventConcurrentExecution: false,
|
|
146
|
+
...signal ? {
|
|
147
|
+
signal
|
|
148
|
+
} : {}
|
|
149
|
+
});
|
|
150
|
+
if ('failed' === result.status) return void fail(result.error);
|
|
151
|
+
if (!built) {
|
|
152
|
+
session.claimed = false;
|
|
153
|
+
endActivity();
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
const retry = useStableCallback(()=>{
|
|
157
|
+
load();
|
|
158
|
+
});
|
|
159
|
+
useImperativeHandle(ref, ()=>({
|
|
160
|
+
load: (signal)=>load(signal),
|
|
161
|
+
get isContentLoaded () {
|
|
162
|
+
return session.claimed;
|
|
163
|
+
},
|
|
164
|
+
get isRevealSettled () {
|
|
165
|
+
return session.settled;
|
|
166
|
+
}
|
|
167
|
+
}), [
|
|
168
|
+
load,
|
|
169
|
+
session
|
|
170
|
+
]);
|
|
171
|
+
useEffect(()=>{
|
|
172
|
+
var _latest_current_autoLoad;
|
|
173
|
+
if (null != (_latest_current_autoLoad = latest.current.autoLoad) ? _latest_current_autoLoad : true) load();
|
|
174
|
+
return ()=>{
|
|
175
|
+
session.unmount.abort();
|
|
176
|
+
endActivity();
|
|
177
|
+
};
|
|
178
|
+
}, [
|
|
179
|
+
load,
|
|
180
|
+
session
|
|
181
|
+
]);
|
|
182
|
+
useEffect(()=>{
|
|
183
|
+
if ('revealing' === phase) {
|
|
184
|
+
var _latest_current_onContentLoaded, _latest_current;
|
|
185
|
+
null == (_latest_current_onContentLoaded = (_latest_current = latest.current).onContentLoaded) || _latest_current_onContentLoaded.call(_latest_current);
|
|
186
|
+
if (!(settleCap <= 0)) return disposer.setTimeout(()=>setPhase((p)=>'revealing' === p ? 'fading' : p), settleCap);
|
|
187
|
+
else setPhase('fading');
|
|
188
|
+
}
|
|
189
|
+
if ('settled' === phase && !session.settled) {
|
|
190
|
+
var _latest_current_onContentLoaded1, _latest_current1, _latest_current_onRevealSettled, _latest_current2;
|
|
191
|
+
session.settled = true;
|
|
192
|
+
endActivity();
|
|
193
|
+
if (!fade) null == (_latest_current_onContentLoaded1 = (_latest_current1 = latest.current).onContentLoaded) || _latest_current_onContentLoaded1.call(_latest_current1);
|
|
194
|
+
null == (_latest_current_onRevealSettled = (_latest_current2 = latest.current).onRevealSettled) || _latest_current_onRevealSettled.call(_latest_current2);
|
|
195
|
+
}
|
|
196
|
+
}, [
|
|
197
|
+
phase,
|
|
198
|
+
fade,
|
|
199
|
+
settleCap,
|
|
200
|
+
disposer,
|
|
201
|
+
session
|
|
202
|
+
]);
|
|
203
|
+
useEffect(()=>{
|
|
204
|
+
if ('fading' !== phase) return;
|
|
205
|
+
let done = false;
|
|
206
|
+
const unsubscribes = [];
|
|
207
|
+
const startFade = ()=>{
|
|
208
|
+
if (done) return;
|
|
209
|
+
done = true;
|
|
210
|
+
for (const unsubscribe of unsubscribes)unsubscribe();
|
|
211
|
+
setCoverFading(true);
|
|
212
|
+
disposer.setTimeout(()=>setPhase('settled'), g9DeferredCoverFadeMs);
|
|
213
|
+
};
|
|
214
|
+
const pending = Array.from(session.gates).filter((gate)=>!gate.isReady);
|
|
215
|
+
if (0 === pending.length) return void startFade();
|
|
216
|
+
let remaining = pending.length;
|
|
217
|
+
for (const gate of pending)unsubscribes.push(gate.subscribe(()=>{
|
|
218
|
+
remaining -= 1;
|
|
219
|
+
if (0 === remaining) startFade();
|
|
220
|
+
}));
|
|
221
|
+
unsubscribes.push(disposer.setTimeout(startFade, g9DeferredReadinessTimeoutMs));
|
|
222
|
+
return ()=>{
|
|
223
|
+
done = true;
|
|
224
|
+
for (const unsubscribe of unsubscribes)unsubscribe();
|
|
225
|
+
};
|
|
226
|
+
}, [
|
|
227
|
+
phase,
|
|
228
|
+
disposer,
|
|
229
|
+
session
|
|
230
|
+
]);
|
|
231
|
+
const onSettleProbe = useStableCallback(()=>{
|
|
232
|
+
setPhase((p)=>'revealing' === p ? 'fading' : p);
|
|
233
|
+
});
|
|
234
|
+
const placeholder = null != (_props_placeholder = props.placeholder) ? _props_placeholder : <DefaultPlaceholder/>;
|
|
235
|
+
const covering = 'revealing' === phase || 'fading' === phase;
|
|
236
|
+
const showContent = null !== content && (covering || 'settled' === phase);
|
|
237
|
+
return <view className={`g9-deferred${props.className ? ` ${props.className}` : ''}`} {...props.style ? {
|
|
238
|
+
style: props.style
|
|
239
|
+
} : {}}>
|
|
240
|
+
{showContent ? <G9DeferredReadinessContext.Provider value={registry}>
|
|
241
|
+
<view className="g9-deferred__content">
|
|
242
|
+
<ContentBoundary key={content.attempt} onError={reportRenderError}>
|
|
243
|
+
{content.node}
|
|
244
|
+
</ContentBoundary>
|
|
245
|
+
</view>
|
|
246
|
+
</G9DeferredReadinessContext.Provider> : null}
|
|
247
|
+
{covering ? <view className={`g9-deferred__cover${coverFading ? ' g9-deferred__cover--fading' : ''}`}>
|
|
248
|
+
{placeholder}
|
|
249
|
+
{'revealing' === phase ? <DeferredComponent delayFrames={null != (_latest_current_revealSettleFrames = latest.current.revealSettleFrames) ? _latest_current_revealSettleFrames : g9DeferredRevealSettleFrames} estimatedStyle={{
|
|
250
|
+
position: 'absolute',
|
|
251
|
+
width: '0px',
|
|
252
|
+
height: '0px'
|
|
253
|
+
}}>
|
|
254
|
+
<SettleProbe onSettled={onSettleProbe}/>
|
|
255
|
+
</DeferredComponent> : null}
|
|
256
|
+
</view> : null}
|
|
257
|
+
{'placeholder' === phase ? placeholder : null}
|
|
258
|
+
{'failed' === phase ? props.renderError ? props.renderError(null == failure ? void 0 : failure.error, retry) : placeholder : null}
|
|
259
|
+
</view>;
|
|
260
|
+
});
|
|
261
|
+
export { deferred_content_G9DeferredContent as G9DeferredContent, g9DeferredCoverFadeMs, g9DeferredFadeRevealDelayMs, g9DeferredLoadDelayMs, g9DeferredReadinessTimeoutMs, g9DeferredRevealSettleFrames, useG9DeferredReadiness };
|
|
262
|
+
|
|
263
|
+
//# sourceMappingURL=deferred-content.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deferred/deferred-content.jsx","sources":["../../src/deferred/deferred-content.tsx"],"sourcesContent":["import {\n createAbortController,\n type G9AbortSignal,\n type G9ActivityScope,\n g9LayoutMetrics,\n} from '@g9tm/lynxcontrols-foundation';\nimport { DeferredComponent } from '@lynx-js/lynx-ui-deferred-component';\nimport {\n createContext,\n type ForwardedRef,\n forwardRef,\n type ReactNode,\n useContext,\n useEffect,\n useErrorBoundary,\n useImperativeHandle,\n useRef,\n useState,\n} from '@lynx-js/react';\nimport type { CSSProperties } from '@lynx-js/types';\nimport { useDisposer } from '../base/disposer';\nimport { useStableCallback } from '../base/use-stable-callback';\nimport { useG9Core } from '../provider/hooks';\nimport { createReadinessSignal, type G9ReadinessSignal } from './readiness-signal';\nimport './deferred.css';\n\n/** Default delay before the content is built (MAUI `DeferredContentView.DefaultLoadDelayMs`, the layout metric, 369). */\nexport const g9DeferredLoadDelayMs: number = g9LayoutMetrics.DeferredContentLoadDelayMs;\n/** Default cap of the covered reveal's settle window (MAUI `FadeRevealDelayMs`). */\nexport const g9DeferredFadeRevealDelayMs = 220;\n/** Default frames the covered content gets after its first layout (MAUI `RevealSettleFrames`). */\nexport const g9DeferredRevealSettleFrames = 2;\n/** Longest the covered reveal waits for readiness signals (MAUI `ContentReadinessTimeoutMs`). */\nexport const g9DeferredReadinessTimeoutMs = 5000;\n/** The cover's fade-out (MAUI: `FadeToAsync(0, 160, CubicIn)`). */\nexport const g9DeferredCoverFadeMs = 160;\n\n/** Imperative handle of {@link G9DeferredContent} (via `ref`). */\nexport interface G9DeferredContentHandle {\n /**\n * Starts the load now (MAUI `LoadContentAsync`): waits `loadDelayMs`, builds the content, reveals it. A second call\n * while a load is claimed returns at once. Aborting `signal` (or unmounting) before the content is built releases\n * the claim so a later call loads again. Settles when the content is mounted (not when the reveal settles).\n */\n load(signal?: G9AbortSignal): Promise<void>;\n /** The load has been claimed (MAUI `IsContentLoaded`): a re-entrancy latch, `true` from the start of a load. */\n readonly isContentLoaded: boolean;\n /** The final content is the only visual (MAUI `IsRevealSettled`); also `true` after a failure. */\n readonly isRevealSettled: boolean;\n}\n\n/** Props of {@link G9DeferredContent}. */\nexport interface G9DeferredContentProps {\n /** Builds the content after the delay (MAUI `ContentFactory`): preferred when building is expensive. */\n readonly render?: () => ReactNode;\n /** Already-built content to swap in after the delay (MAUI `DeferredContent`); used when `render` is absent. */\n readonly children?: ReactNode;\n /** The placeholder (MAUI `LoadingView`). Default: a full-fill themed background with a centred 42 px spinner. */\n readonly placeholder?: ReactNode;\n /** Start loading on mount (MAUI `AutoLoad`). Default `true`; otherwise call `ref.load()`. */\n readonly autoLoad?: boolean;\n /** Delay before the content is built (MAUI `LoadDelayMs`). Default {@link g9DeferredLoadDelayMs}. */\n readonly loadDelayMs?: number;\n /**\n * Reveal under the opaque placeholder and fade it out once the content settled (MAUI `FadeContentIn`): first\n * layout + `revealSettleFrames` frames (capped by `fadeRevealDelayMs`), then every readiness gate\n * (`useG9DeferredReadiness`, at most 5 s), then a 160 ms fade. Default `false` (instant swap).\n */\n readonly fadeContentIn?: boolean;\n /** Cap of the settle window (MAUI `FadeRevealDelayMs`); `0` skips it. Default 220. */\n readonly fadeRevealDelayMs?: number;\n /** Frames after the content's first layout (MAUI `RevealSettleFrames`). Default 2. */\n readonly revealSettleFrames?: number;\n /** Called right after the content was built, before it is shown (MAUI `OnContentCreated`). */\n readonly onContentCreated?: () => void;\n /** The content is mounted (MAUI `ContentLoaded`); with `fadeContentIn` it is still covered. */\n readonly onContentLoaded?: () => void;\n /** The content is the only visual, or the load failed (MAUI `RevealSettled`): re-measure here. */\n readonly onRevealSettled?: () => void;\n /**\n * What to show after a failure: the build threw, or the content threw while rendering. Default: the placeholder\n * stays (MAUI). The error has already gone to diagnostics and the executor's popup; `retry` loads again.\n */\n readonly renderError?: (error: unknown, retry: () => void) => ReactNode;\n /** Names the load in diagnostics (`deferred:<name>`). Default `'G9DeferredContent'`. */\n readonly name?: string;\n readonly className?: string;\n readonly style?: CSSProperties;\n}\n\ntype Phase = 'placeholder' | 'revealing' | 'fading' | 'settled' | 'failed';\n\n/** Readiness gates registered by the content of the nearest {@link G9DeferredContent}. */\nconst G9DeferredReadinessContext = createContext<{ register(signal: G9ReadinessSignal): () => void } | null>(null);\n\n/**\n * Opts the calling content into the covered reveal's readiness gate (MAUI `IDeferredContentReadiness` /\n * `GateContentReadiness`): the placeholder stays until the returned signal's `markReady()` runs (bounded by 5 s), so\n * work applied after the first layout (a data fill, a scroll-to-selection) is never seen re-rendering. Call\n * `markReady()` on every path, including failures. Outside a fading `G9DeferredContent` nothing waits for it.\n */\nexport function useG9DeferredReadiness(): G9ReadinessSignal {\n const [signal] = useState(createReadinessSignal);\n const registry = useContext(G9DeferredReadinessContext);\n useEffect(() => registry?.register(signal), [registry, signal]);\n return signal;\n}\n\nfunction DefaultPlaceholder(): ReactNode {\n return (\n <view className=\"g9-deferred__placeholder\">\n <view className=\"g9-deferred__spinner\" />\n </view>\n );\n}\n\nfunction SettleProbe(props: { readonly onSettled: () => void }): ReactNode {\n const { onSettled } = props;\n useEffect(() => onSettled(), [onSettled]);\n return null;\n}\n\nfunction ContentBoundary(props: { readonly onError: (error: unknown) => void; readonly children?: ReactNode }) {\n const [error] = useErrorBoundary(props.onError);\n return error ? null : props.children;\n}\n\nfunction waitFor(\n ms: number,\n signals: ReadonlyArray<G9AbortSignal | undefined>,\n schedule: (callback: () => void, ms: number) => () => void,\n): Promise<boolean> {\n return new Promise<boolean>((resolve) => {\n const live = signals.filter((signal): signal is G9AbortSignal => signal !== undefined);\n if (live.some((signal) => signal.aborted)) return resolve(false);\n let cancel = () => {};\n const onAbort = () => finish(false);\n function finish(ok: boolean) {\n cancel();\n for (const signal of live) signal.removeEventListener('abort', onAbort);\n resolve(ok);\n }\n for (const signal of live) signal.addEventListener('abort', onAbort);\n if (ms > 0) cancel = schedule(() => finish(true), ms);\n else void Promise.resolve().then(() => finish(!live.some((signal) => signal.aborted)));\n });\n}\n\n/**\n * Shows a placeholder first and the real content after the host's open animation (MAUI `DeferredContentView`), so an\n * expensive body never blocks the animation and the user sees motion, not a blank host. The build runs through the\n * provider's safe executor (errors go to diagnostics and the popup), holds a busy activity `deferred:<name>` until the\n * reveal settles, is cancelled by unmount, and can be retried. Built on lynx-ui `DeferredComponent` for the\n * frame-counted settle window of the covered reveal. Must be inside `G9Provider`.\n */\nexport const G9DeferredContent = forwardRef(function G9DeferredContent(\n props: G9DeferredContentProps,\n ref: ForwardedRef<G9DeferredContentHandle>,\n): ReactNode {\n const core = useG9Core();\n const disposer = useDisposer();\n const latest = useRef(props);\n latest.current = props;\n const name = props.name ?? 'G9DeferredContent';\n const fade = props.fadeContentIn ?? false;\n const settleCap = props.fadeRevealDelayMs ?? g9DeferredFadeRevealDelayMs;\n\n const [phase, setPhase] = useState<Phase>('placeholder');\n const [content, setContent] = useState<{ readonly node: ReactNode; readonly attempt: number } | null>(null);\n const [failure, setFailure] = useState<{ readonly error: unknown } | null>(null);\n const [coverFading, setCoverFading] = useState(false);\n const [session] = useState(() => ({\n claimed: false,\n settled: false,\n attempt: 0,\n unmount: createAbortController(),\n activity: null as G9ActivityScope | null,\n gates: new Set<G9ReadinessSignal>(),\n }));\n const [registry] = useState(() => ({\n register(signal: G9ReadinessSignal) {\n session.gates.add(signal);\n return () => {\n session.gates.delete(signal);\n };\n },\n }));\n\n const endActivity = () => {\n session.activity?.dispose();\n session.activity = null;\n };\n\n const fail = useStableCallback((error: unknown) => {\n // MAUI: release the latch, stop claiming to be loading (hosts holding their size let go), report the failure.\n session.claimed = false;\n session.settled = true;\n endActivity();\n setFailure({ error });\n setPhase('failed');\n latest.current.onRevealSettled?.();\n });\n\n const reportRenderError = useStableCallback((error: unknown) => {\n void core.executor.run(\n () => {\n throw error;\n },\n { source: name, throttleKey: `${name}.render`, enableThrottle: false, preventConcurrentExecution: false },\n );\n fail(error);\n });\n\n const load = useStableCallback(async (signal?: G9AbortSignal) => {\n if (session.claimed || session.unmount.signal.aborted) return;\n session.claimed = true;\n session.settled = false;\n session.activity ??= core.diagnostics.activity(`deferred:${name}`);\n let built = false;\n const result = await core.executor.run(\n async (context) => {\n const delay = latest.current.loadDelayMs ?? g9DeferredLoadDelayMs;\n const due = await waitFor(delay, [context.signal, session.unmount.signal, signal], disposer.setTimeout);\n if (!due) return;\n const current = latest.current;\n const node = current.render ? current.render() : current.children;\n current.onContentCreated?.();\n session.attempt += 1;\n built = true;\n setFailure(null);\n setCoverFading(false);\n setContent({ node, attempt: session.attempt });\n setPhase(fade ? 'revealing' : 'settled');\n },\n {\n source: name,\n throttleKey: `${name}.load`,\n enableThrottle: false,\n preventConcurrentExecution: false,\n ...(signal ? { signal } : {}),\n },\n );\n if (result.status === 'failed') {\n fail(result.error);\n return;\n }\n if (!built) {\n // Cancelled before the content was built: a cancelled load must be repeatable (MAUI).\n session.claimed = false;\n endActivity();\n }\n });\n\n const retry = useStableCallback(() => {\n void load();\n });\n\n useImperativeHandle(\n ref,\n () => ({\n load: (signal) => load(signal) as Promise<void>,\n get isContentLoaded() {\n return session.claimed;\n },\n get isRevealSettled() {\n return session.settled;\n },\n }),\n [load, session],\n );\n\n // Auto load on mount; unmount cancels a pending load and ends the activity.\n useEffect(() => {\n if (latest.current.autoLoad ?? true) void load();\n return () => {\n session.unmount.abort();\n endActivity();\n };\n }, [load, session]);\n\n // Instant swap: loaded and settled together. Covered reveal: loaded now, settled after the fade.\n useEffect(() => {\n if (phase === 'revealing') {\n latest.current.onContentLoaded?.();\n if (settleCap <= 0) setPhase('fading');\n else return disposer.setTimeout(() => setPhase((p) => (p === 'revealing' ? 'fading' : p)), settleCap);\n }\n if (phase === 'settled' && !session.settled) {\n session.settled = true;\n endActivity();\n if (!fade) latest.current.onContentLoaded?.();\n latest.current.onRevealSettled?.();\n }\n return undefined;\n }, [phase, fade, settleCap, disposer, session]);\n\n // The settle window ended: hold the cover for the readiness gates (bounded), then fade it out.\n useEffect(() => {\n if (phase !== 'fading') return;\n let done = false;\n const unsubscribes: Array<() => void> = [];\n const startFade = () => {\n if (done) return;\n done = true;\n for (const unsubscribe of unsubscribes) unsubscribe();\n setCoverFading(true);\n disposer.setTimeout(() => setPhase('settled'), g9DeferredCoverFadeMs);\n };\n const pending = Array.from(session.gates).filter((gate) => !gate.isReady);\n if (pending.length === 0) {\n startFade();\n return;\n }\n let remaining = pending.length;\n for (const gate of pending) {\n unsubscribes.push(\n gate.subscribe(() => {\n remaining -= 1;\n if (remaining === 0) startFade();\n }),\n );\n }\n unsubscribes.push(disposer.setTimeout(startFade, g9DeferredReadinessTimeoutMs));\n return () => {\n done = true;\n for (const unsubscribe of unsubscribes) unsubscribe();\n };\n }, [phase, disposer, session]);\n\n const onSettleProbe = useStableCallback(() => {\n setPhase((p) => (p === 'revealing' ? 'fading' : p));\n });\n\n const placeholder = props.placeholder ?? <DefaultPlaceholder />;\n const covering = phase === 'revealing' || phase === 'fading';\n const showContent = content !== null && (covering || phase === 'settled');\n return (\n <view\n className={`g9-deferred${props.className ? ` ${props.className}` : ''}`}\n {...(props.style ? { style: props.style } : {})}\n >\n {showContent ? (\n <G9DeferredReadinessContext.Provider value={registry}>\n <view className=\"g9-deferred__content\">\n <ContentBoundary key={content.attempt} onError={reportRenderError}>\n {content.node}\n </ContentBoundary>\n </view>\n </G9DeferredReadinessContext.Provider>\n ) : null}\n {covering ? (\n <view className={`g9-deferred__cover${coverFading ? ' g9-deferred__cover--fading' : ''}`}>\n {placeholder}\n {phase === 'revealing' ? (\n <DeferredComponent\n delayFrames={latest.current.revealSettleFrames ?? g9DeferredRevealSettleFrames}\n estimatedStyle={{ position: 'absolute', width: '0px', height: '0px' }}\n >\n <SettleProbe onSettled={onSettleProbe} />\n </DeferredComponent>\n ) : null}\n </view>\n ) : null}\n {phase === 'placeholder' ? placeholder : null}\n {phase === 'failed' ? (props.renderError ? props.renderError(failure?.error, retry) : placeholder) : null}\n </view>\n );\n});\n"],"names":["g9DeferredLoadDelayMs","g9LayoutMetrics","g9DeferredFadeRevealDelayMs","g9DeferredRevealSettleFrames","g9DeferredReadinessTimeoutMs","g9DeferredCoverFadeMs","G9DeferredReadinessContext","createContext","useG9DeferredReadiness","signal","useState","createReadinessSignal","registry","useContext","useEffect","DefaultPlaceholder","view","SettleProbe","props","onSettled","ContentBoundary","error","useErrorBoundary","waitFor","ms","signals","schedule","Promise","resolve","live","undefined","cancel","onAbort","finish","ok","G9DeferredContent","forwardRef","ref","_props_name","_props_fadeContentIn","_props_fadeRevealDelayMs","_props_placeholder","_latest_current_revealSettleFrames","core","useG9Core","disposer","useDisposer","latest","useRef","name","fade","settleCap","phase","setPhase","content","setContent","failure","setFailure","coverFading","setCoverFading","session","createAbortController","Set","endActivity","_session_activity","fail","useStableCallback","_latest_current","reportRenderError","load","_session","built","result","context","_latest_current_loadDelayMs","current","delay","due","node","retry","useImperativeHandle","_latest_current_autoLoad","p","_latest_current1","_latest_current2","done","unsubscribes","startFade","unsubscribe","pending","Array","gate","remaining","onSettleProbe","placeholder","covering","showContent","DeferredComponent"],"mappings":";;;;;;;;AA2BO,MAAMA,wBAAgCC,gBAAgB,0BAA0B;AAEhF,MAAMC,8BAA8B;AAEpC,MAAMC,+BAA+B;AAErC,MAAMC,+BAA+B;AAErC,MAAMC,wBAAwB;AA0DrC,MAAMC,6BAA6BC,cAA0E;AAQtG,SAASC;IACd,MAAM,CAACC,OAAO,GAAGC,SAASC;IAC1B,MAAMC,WAAWC,WAAWP;IAC5BQ,UAAU,IAAMF,QAAAA,WAAAA,KAAAA,IAAAA,SAAU,QAAQ,CA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,WAAW,CAAC,WAAW,EAAEE,MAAM,SAAS,GAAG,CAAC,CAAC,EAAEA,MAAM,SAAS,EAAE,GAAG,IAAI,GACtE,GAAIA,MAAM,KAAK,GAAG;QAAE,OAAOA,MAAM,KAAK;IAAC,IAAI,CAAC,CAAC,EAC/C;MACC,CAAC8E,eACE1F,2BAA2B,SAAS,OAAOM,UAAU;UACpD,CAACI,KAAK,UAAU,uBAAuB;YACrC,CAACI,gBAAgB,KAAKkC,QAAQ,OAAO,EAAE,SAASc,mBAAmB;cACjE,CAACd,QAAQ,IAAI,CAAC;YAChB,EAAElC,gBAAgB;UACpB,EAAEJ,KAAK;QACT,EAAEV,2BAA2B,YAC3B,KAAK;MACT,CAACyF,YACE/E,KAAK,WAAW,CAAC,kBAAkB,EAAE0C,cAAc,gCAAgC,IAAI,EAAE;UACxF,CAACoC,YAAY;UACb,CAAC1C,AAAU,gBAAVA,SACE6C,kBACC,aAAa,QAAAvD,CAAAA,qCAAAA,OAAO,OAAO,CAAC,kBAAkB,AAAD,IAAhCA,qCAAqCvC,8BAClD,gBAAgB;QAAE,UAAU;QAAY,OAAO;QAAO,QAAQ;IAAM,GACrE;cACC,CAACc,YAAY,WAAW4E,gBAAiB;YAC3C,EAAEI,qBACA,KAAK;QACX,EAAEjF,QACA,KAAK;MACT,CAACoC,AAAU,kBAAVA,QAA0B0C,cAAc,KAAK;MAC9C,CAAC1C,AAAU,aAAVA,QAAsBlC,MAAM,WAAW,GAAGA,MAAM,WAAW,CAACsC,QAAAA,UAAAA,KAAAA,IAAAA,QAAS,KAAK,EAAEuB,SAASe,cAAe,KAAK;IAC5G,EAAE9E;AAEN"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
.g9-deferred {
|
|
2
|
+
flex-direction: column;
|
|
3
|
+
flex: 1;
|
|
4
|
+
display: flex;
|
|
5
|
+
position: relative;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.g9-deferred__content {
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
flex: 1;
|
|
11
|
+
display: flex;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.g9-deferred__placeholder {
|
|
15
|
+
background-color: var(--g9-background);
|
|
16
|
+
flex: 1;
|
|
17
|
+
justify-content: center;
|
|
18
|
+
align-items: center;
|
|
19
|
+
display: flex;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.g9-deferred__spinner {
|
|
23
|
+
border-style: solid;
|
|
24
|
+
border-width: 4px;
|
|
25
|
+
border-color: var(--g9-primary);
|
|
26
|
+
border-top-color: #0000;
|
|
27
|
+
border-radius: 21px;
|
|
28
|
+
width: 42px;
|
|
29
|
+
height: 42px;
|
|
30
|
+
animation: .9s linear infinite g9-deferred-spin;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.g9-deferred__cover {
|
|
34
|
+
opacity: 1;
|
|
35
|
+
flex-direction: column;
|
|
36
|
+
transition-property: opacity;
|
|
37
|
+
transition-duration: .16s;
|
|
38
|
+
transition-timing-function: cubic-bezier(.55, .055, .675, .19);
|
|
39
|
+
display: flex;
|
|
40
|
+
position: absolute;
|
|
41
|
+
top: 0;
|
|
42
|
+
bottom: 0;
|
|
43
|
+
left: 0;
|
|
44
|
+
right: 0;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.g9-deferred__cover--fading {
|
|
48
|
+
opacity: 0;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@keyframes g9-deferred-spin {
|
|
52
|
+
from {
|
|
53
|
+
transform: rotate(0);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
to {
|
|
57
|
+
transform: rotate(360deg);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
/*# sourceMappingURL=deferred.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["webpack://./src/deferred/deferred.css"],"names":[],"mappings":"AACA;EAAE,sBAAsB;EACtB,OAAO;EACP,aAAa;EACb,kBAAkB;AACpB;;AAGA;EAAE,sBAAsB;EACtB,OAAO;EACP,aAAa;AACf;;AAIA;EADE,sCAAsC;EACtC,OAAO;EACP,uBAAuB;EACvB,mBAAmB;EACnB,aAAa;AACf;;AAIA;EADE,mBAAmB;EACnB,iBAAiB;EACjB,+BAA+B;EAC/B,uBAAuB;EACvB,mBAAmB;EACnB,WAAW;EACX,YAAY;EACZ,+CAA+C;AACjD;;AAKA;EAFE,UAAU;EACV,sBAAsB;EACtB,4BAA4B;EAC5B,yBAAyB;EACzB,8DAA8D;EAC9D,aAAa;EACb,kBAAkB;EAClB,MAAM;EACN,SAAS;EACT,OAAO;EACP,QAAQ;AACV;;AAKA;EAFE,UAAU;AACZ;;AAKA;EAFE;IACE,oBAAoB;EACtB;;EAEA;IACE,yBAAyB;EAC3B;AACF","sourcesContent":["/* G9DeferredContent: placeholder, content and the covering placeholder of the faded reveal. */\n.g9-deferred {\n display: flex;\n flex-direction: column;\n position: relative;\n flex: 1;\n}\n\n.g9-deferred__content {\n display: flex;\n flex-direction: column;\n flex: 1;\n}\n\n/* MAUI CreateDefaultLoadingView: a solid themed fill (a stacked sheet must not show what is under it), 42 px spinner. */\n.g9-deferred__placeholder {\n display: flex;\n align-items: center;\n justify-content: center;\n flex: 1;\n background-color: var(--g9-background);\n}\n\n.g9-deferred__spinner {\n width: 42px;\n height: 42px;\n border-width: 4px;\n border-style: solid;\n border-radius: 21px;\n border-color: var(--g9-primary);\n border-top-color: transparent;\n animation: g9-deferred-spin 900ms linear infinite;\n}\n\n/* The covered reveal: the opaque placeholder over the content until it settles, then a 160 ms cubic-in fade. */\n.g9-deferred__cover {\n display: flex;\n flex-direction: column;\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n opacity: 1;\n transition-property: opacity;\n transition-duration: 160ms;\n transition-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);\n}\n\n.g9-deferred__cover--fading {\n opacity: 0;\n}\n\n@keyframes g9-deferred-spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n"],"sourceRoot":""}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { G9DeferredContent, type G9DeferredContentHandle, type G9DeferredContentProps, g9DeferredCoverFadeMs, g9DeferredFadeRevealDelayMs, g9DeferredLoadDelayMs, g9DeferredReadinessTimeoutMs, g9DeferredRevealSettleFrames, useG9DeferredReadiness, } from './deferred-content.js';
|
|
2
|
+
export { createReadinessSignal, type G9ReadinessSignal } from './readiness-signal.js';
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/deferred/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,iBAAiB,EACjB,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,qBAAqB,EACrB,2BAA2B,EAC3B,qBAAqB,EACrB,4BAA4B,EAC5B,4BAA4B,EAC5B,sBAAsB,GACvB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,qBAAqB,EAAE,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { G9DeferredContent, g9DeferredCoverFadeMs, g9DeferredFadeRevealDelayMs, g9DeferredLoadDelayMs, g9DeferredReadinessTimeoutMs, g9DeferredRevealSettleFrames, useG9DeferredReadiness } from "./deferred-content.jsx";
|
|
2
|
+
export { createReadinessSignal } from "./readiness-signal.jsx";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A latched "the visual is settled" flag with a one-shot notification (MAUI `DeferredContentReadinessSignal`, the
|
|
3
|
+
* backing of `IDeferredContentReadiness`). Subscribing after it fired calls the listener at once, so a late
|
|
4
|
+
* subscriber can never miss it.
|
|
5
|
+
*/
|
|
6
|
+
export interface G9ReadinessSignal {
|
|
7
|
+
/** `true` once {@link G9ReadinessSignal.markReady} ran. Never goes back. */
|
|
8
|
+
readonly isReady: boolean;
|
|
9
|
+
/** Calls `listener` once when ready (at once if already ready). Returns an unsubscribe function. */
|
|
10
|
+
subscribe(listener: () => void): () => void;
|
|
11
|
+
/** Flips the flag and notifies; idempotent. */
|
|
12
|
+
markReady(): void;
|
|
13
|
+
}
|
|
14
|
+
/** Creates a {@link G9ReadinessSignal}. */
|
|
15
|
+
export declare function createReadinessSignal(): G9ReadinessSignal;
|
|
16
|
+
//# sourceMappingURL=readiness-signal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readiness-signal.d.ts","sourceRoot":"","sources":["../../src/deferred/readiness-signal.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,4EAA4E;IAC5E,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,oGAAoG;IACpG,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;IAC5C,+CAA+C;IAC/C,SAAS,IAAI,IAAI,CAAC;CACnB;AAED,2CAA2C;AAC3C,wBAAgB,qBAAqB,IAAI,iBAAiB,CAyBzD"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
function createReadinessSignal() {
|
|
2
|
+
let ready = false;
|
|
3
|
+
let listeners = new Set();
|
|
4
|
+
return {
|
|
5
|
+
get isReady () {
|
|
6
|
+
return ready;
|
|
7
|
+
},
|
|
8
|
+
subscribe (listener) {
|
|
9
|
+
if (ready) {
|
|
10
|
+
listener();
|
|
11
|
+
return ()=>{};
|
|
12
|
+
}
|
|
13
|
+
listeners.add(listener);
|
|
14
|
+
return ()=>{
|
|
15
|
+
listeners.delete(listener);
|
|
16
|
+
};
|
|
17
|
+
},
|
|
18
|
+
markReady () {
|
|
19
|
+
if (ready) return;
|
|
20
|
+
ready = true;
|
|
21
|
+
const pending = listeners;
|
|
22
|
+
listeners = new Set();
|
|
23
|
+
for (const listener of Array.from(pending))listener();
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export { createReadinessSignal };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=readiness-signal.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deferred/readiness-signal.jsx","sources":["../../src/deferred/readiness-signal.ts"],"sourcesContent":["/**\n * A latched \"the visual is settled\" flag with a one-shot notification (MAUI `DeferredContentReadinessSignal`, the\n * backing of `IDeferredContentReadiness`). Subscribing after it fired calls the listener at once, so a late\n * subscriber can never miss it.\n */\nexport interface G9ReadinessSignal {\n /** `true` once {@link G9ReadinessSignal.markReady} ran. Never goes back. */\n readonly isReady: boolean;\n /** Calls `listener` once when ready (at once if already ready). Returns an unsubscribe function. */\n subscribe(listener: () => void): () => void;\n /** Flips the flag and notifies; idempotent. */\n markReady(): void;\n}\n\n/** Creates a {@link G9ReadinessSignal}. */\nexport function createReadinessSignal(): G9ReadinessSignal {\n let ready = false;\n let listeners = new Set<() => void>();\n return {\n get isReady() {\n return ready;\n },\n subscribe(listener) {\n if (ready) {\n listener();\n return () => {};\n }\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n },\n markReady() {\n if (ready) return;\n ready = true;\n const pending = listeners;\n listeners = new Set();\n for (const listener of Array.from(pending)) listener();\n },\n };\n}\n"],"names":["createReadinessSignal","ready","listeners","Set","listener","pending","Array"],"mappings":"AAeO,SAASA;IACd,IAAIC,QAAQ;IACZ,IAAIC,YAAY,IAAIC;IACpB,OAAO;QACL,IAAI;YACF,OAAOF;QACT;QACA,WAAUG,QAAQ;YAChB,IAAIH,OAAO;gBACTG;gBACA,OAAO,KAAO;YAChB;YACAF,UAAU,GAAG,CAACE;YACd,OAAO;gBACLF,UAAU,MAAM,CAACE;YACnB;QACF;QACA;YACE,IAAIH,OAAO;YACXA,QAAQ;YACR,MAAMI,UAAUH;YAChBA,YAAY,IAAIC;YAChB,KAAK,MAAMC,YAAYE,MAAM,IAAI,CAACD,SAAUD;QAC9C;IACF;AACF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import './display.css';
|
|
2
|
+
import type { ReactNode } from '@lynx-js/react';
|
|
3
|
+
/** Props of {@link G9ActivityIndicator} (MAUI `G9ActivityIndicator` = MAUI `ActivityIndicator`). */
|
|
4
|
+
export interface G9ActivityIndicatorProps {
|
|
5
|
+
/** Spinning and visible (MAUI `IsRunning`). Default false: the box keeps its size but shows nothing. */
|
|
6
|
+
readonly running?: boolean;
|
|
7
|
+
/** Ring colour (MAUI `Color`). Default `var(--g9-primary)`. */
|
|
8
|
+
readonly color?: string;
|
|
9
|
+
/** Box size in logical pixels. Default 20. */
|
|
10
|
+
readonly size?: number;
|
|
11
|
+
/** Ring thickness. Default `max(2, size / 10)`. */
|
|
12
|
+
readonly thickness?: number;
|
|
13
|
+
readonly className?: string;
|
|
14
|
+
readonly accessibilityLabel?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A spinner: a ring with a transparent quarter rotating once per 800 ms (CSS keyframes, no JavaScript per frame).
|
|
18
|
+
* Not running → an empty box of the same size (so layouts do not jump).
|
|
19
|
+
*/
|
|
20
|
+
export declare function G9ActivityIndicator(props: G9ActivityIndicatorProps): ReactNode;
|
|
21
|
+
//# sourceMappingURL=activity-indicator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activity-indicator.d.ts","sourceRoot":"","sources":["../../src/display/activity-indicator.tsx"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,oGAAoG;AACpG,MAAM,WAAW,wBAAwB;IACvC,wGAAwG;IACxG,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,+DAA+D;IAC/D,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,8CAA8C;IAC9C,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,mDAAmD;IACnD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;CACtC;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,GAAG,SAAS,CAqB9E"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import "./display.css";
|
|
2
|
+
function G9ActivityIndicator(props) {
|
|
3
|
+
var _props_size, _props_thickness, _props_color;
|
|
4
|
+
const size = null != (_props_size = props.size) ? _props_size : 20;
|
|
5
|
+
const thickness = null != (_props_thickness = props.thickness) ? _props_thickness : Math.max(2, size / 10);
|
|
6
|
+
const running = true === props.running;
|
|
7
|
+
const color = null != (_props_color = props.color) ? _props_color : 'var(--g9-primary)';
|
|
8
|
+
return <view className={`g9-activity${running ? ' g9-activity--running' : ''}${props.className ? ` ${props.className}` : ''}`} style={{
|
|
9
|
+
width: `${size}px`,
|
|
10
|
+
height: `${size}px`,
|
|
11
|
+
borderRadius: `${size / 2}px`,
|
|
12
|
+
borderWidth: `${thickness}px`,
|
|
13
|
+
borderColor: running ? color : 'transparent',
|
|
14
|
+
borderTopColor: 'transparent'
|
|
15
|
+
}} {...props.accessibilityLabel ? {
|
|
16
|
+
'accessibility-element': true,
|
|
17
|
+
'accessibility-label': props.accessibilityLabel
|
|
18
|
+
} : {}}/>;
|
|
19
|
+
}
|
|
20
|
+
export { G9ActivityIndicator };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=activity-indicator.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"display/activity-indicator.jsx","sources":["../../src/display/activity-indicator.tsx"],"sourcesContent":["import './display.css';\nimport type { ReactNode } from '@lynx-js/react';\n\n/** Props of {@link G9ActivityIndicator} (MAUI `G9ActivityIndicator` = MAUI `ActivityIndicator`). */\nexport interface G9ActivityIndicatorProps {\n /** Spinning and visible (MAUI `IsRunning`). Default false: the box keeps its size but shows nothing. */\n readonly running?: boolean;\n /** Ring colour (MAUI `Color`). Default `var(--g9-primary)`. */\n readonly color?: string;\n /** Box size in logical pixels. Default 20. */\n readonly size?: number;\n /** Ring thickness. Default `max(2, size / 10)`. */\n readonly thickness?: number;\n readonly className?: string;\n readonly accessibilityLabel?: string;\n}\n\n/**\n * A spinner: a ring with a transparent quarter rotating once per 800 ms (CSS keyframes, no JavaScript per frame).\n * Not running → an empty box of the same size (so layouts do not jump).\n */\nexport function G9ActivityIndicator(props: G9ActivityIndicatorProps): ReactNode {\n const size = props.size ?? 20;\n const thickness = props.thickness ?? Math.max(2, size / 10);\n const running = props.running === true;\n const color = props.color ?? 'var(--g9-primary)';\n return (\n <view\n className={`g9-activity${running ? ' g9-activity--running' : ''}${props.className ? ` ${props.className}` : ''}`}\n style={{\n width: `${size}px`,\n height: `${size}px`,\n borderRadius: `${size / 2}px`,\n borderWidth: `${thickness}px`,\n borderColor: running ? color : 'transparent',\n borderTopColor: 'transparent',\n }}\n {...(props.accessibilityLabel\n ? { 'accessibility-element': true, 'accessibility-label': props.accessibilityLabel }\n : {})}\n />\n );\n}\n"],"names":["G9ActivityIndicator","props","_props_size","_props_thickness","_props_color","size","thickness","Math","running","color","view"],"mappings":";AAqBO,SAASA,oBAAoBC,KAA+B;QACpDC,aACKC,kBAEJC;IAHd,MAAMC,OAAO,QAAAH,CAAAA,cAAAA,MAAM,IAAI,AAAD,IAATA,cAAc;IAC3B,MAAMI,YAAY,QAAAH,CAAAA,mBAAAA,MAAM,SAAS,AAAD,IAAdA,mBAAmBI,KAAK,GAAG,CAAC,GAAGF,OAAO;IACxD,MAAMG,UAAUP,AAAkB,SAAlBA,MAAM,OAAO;IAC7B,MAAMQ,QAAQ,QAAAL,CAAAA,eAAAA,MAAM,KAAK,AAAD,IAAVA,eAAe;IAC7B,QACGM,KACC,WAAW,CAAC,WAAW,EAAEF,UAAU,0BAA0B,KAAKP,MAAM,SAAS,GAAG,CAAC,CAAC,EAAEA,MAAM,SAAS,EAAE,GAAG,IAAI,EAChH,OAAO;QACL,OAAO,GAAGI,KAAK,EAAE,CAAC;QAClB,QAAQ,GAAGA,KAAK,EAAE,CAAC;QACnB,cAAc,GAAGA,OAAO,EAAE,EAAE,CAAC;QAC7B,aAAa,GAAGC,UAAU,EAAE,CAAC;QAC7B,aAAaE,UAAUC,QAAQ;QAC/B,gBAAgB;IAClB,IACC,GAAIR,MAAM,kBAAkB,GACzB;QAAE,yBAAyB;QAAM,uBAAuBA,MAAM,kBAAkB;IAAC,IACjF,CAAC,CAAC;AAGZ"}
|