foldkit-primitives 0.15.4 → 0.16.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/dist/device/fullscreen.d.ts +28 -0
- package/dist/device/fullscreen.d.ts.map +1 -0
- package/dist/device/fullscreen.js +69 -0
- package/dist/device/fullscreen.js.map +1 -0
- package/dist/device/geolocation.d.ts +56 -0
- package/dist/device/geolocation.d.ts.map +1 -0
- package/dist/device/geolocation.js +87 -0
- package/dist/device/geolocation.js.map +1 -0
- package/dist/device/index.d.ts +5 -0
- package/dist/device/index.js +6 -0
- package/dist/device/media-devices.d.ts +88 -0
- package/dist/device/media-devices.d.ts.map +1 -0
- package/dist/device/media-devices.js +117 -0
- package/dist/device/media-devices.js.map +1 -0
- package/dist/device/media-stream.d.ts +93 -0
- package/dist/device/media-stream.d.ts.map +1 -0
- package/dist/device/media-stream.js +106 -0
- package/dist/device/media-stream.js.map +1 -0
- package/dist/device/permissions.d.ts +106 -0
- package/dist/device/permissions.d.ts.map +1 -0
- package/dist/device/permissions.js +143 -0
- package/dist/device/permissions.js.map +1 -0
- package/dist/dom/autofocus.d.ts +15 -0
- package/dist/dom/autofocus.d.ts.map +1 -0
- package/dist/dom/autofocus.js +22 -0
- package/dist/dom/autofocus.js.map +1 -0
- package/dist/dom/clipboard.d.ts +30 -0
- package/dist/dom/clipboard.d.ts.map +1 -0
- package/dist/dom/clipboard.js +50 -0
- package/dist/dom/clipboard.js.map +1 -0
- package/dist/dom/editable-text.d.ts +72 -0
- package/dist/dom/editable-text.d.ts.map +1 -0
- package/dist/dom/editable-text.js +232 -0
- package/dist/dom/editable-text.js.map +1 -0
- package/dist/dom/fluid-hover.d.ts +93 -0
- package/dist/dom/fluid-hover.d.ts.map +1 -0
- package/dist/dom/fluid-hover.js +294 -0
- package/dist/dom/fluid-hover.js.map +1 -0
- package/dist/dom/focus-scope.d.ts +21 -0
- package/dist/dom/focus-scope.d.ts.map +1 -0
- package/dist/dom/focus-scope.js +93 -0
- package/dist/dom/focus-scope.js.map +1 -0
- package/dist/dom/follow-tab-stop.d.ts +11 -0
- package/dist/dom/follow-tab-stop.d.ts.map +1 -0
- package/dist/dom/follow-tab-stop.js +54 -0
- package/dist/dom/follow-tab-stop.js.map +1 -0
- package/dist/dom/image-decode.d.ts +27 -0
- package/dist/dom/image-decode.d.ts.map +1 -0
- package/dist/dom/image-decode.js +50 -0
- package/dist/dom/image-decode.js.map +1 -0
- package/dist/dom/index.d.ts +24 -0
- package/dist/dom/index.js +25 -0
- package/dist/dom/input-mask.d.ts +35 -0
- package/dist/dom/input-mask.d.ts.map +1 -0
- package/dist/dom/input-mask.js +90 -0
- package/dist/dom/input-mask.js.map +1 -0
- package/dist/dom/keep-in-view.d.ts +16 -0
- package/dist/dom/keep-in-view.d.ts.map +1 -0
- package/dist/dom/keep-in-view.js +38 -0
- package/dist/dom/keep-in-view.js.map +1 -0
- package/dist/dom/keyboard-inset.d.ts +29 -0
- package/dist/dom/keyboard-inset.d.ts.map +1 -0
- package/dist/dom/keyboard-inset.js +45 -0
- package/dist/dom/keyboard-inset.js.map +1 -0
- package/dist/dom/layers.d.ts +6 -0
- package/dist/dom/layers.d.ts.map +1 -0
- package/dist/dom/layers.js +35 -0
- package/dist/dom/layers.js.map +1 -0
- package/dist/dom/measure.d.ts +42 -0
- package/dist/dom/measure.d.ts.map +1 -0
- package/dist/dom/measure.js +123 -0
- package/dist/dom/measure.js.map +1 -0
- package/dist/dom/move.d.ts +45 -0
- package/dist/dom/move.d.ts.map +1 -0
- package/dist/dom/move.js +96 -0
- package/dist/dom/move.js.map +1 -0
- package/dist/dom/pointed-links.d.ts +13 -0
- package/dist/dom/pointed-links.d.ts.map +1 -0
- package/dist/dom/pointed-links.js +59 -0
- package/dist/dom/pointed-links.js.map +1 -0
- package/dist/dom/pointer-drag.d.ts +132 -0
- package/dist/dom/pointer-drag.d.ts.map +1 -0
- package/dist/dom/pointer-drag.js +307 -0
- package/dist/dom/pointer-drag.js.map +1 -0
- package/dist/dom/pointer-position.d.ts +133 -0
- package/dist/dom/pointer-position.d.ts.map +1 -0
- package/dist/dom/pointer-position.js +173 -0
- package/dist/dom/pointer-position.js.map +1 -0
- package/dist/dom/script-loader.d.ts +12 -0
- package/dist/dom/script-loader.d.ts.map +1 -0
- package/dist/dom/script-loader.js +54 -0
- package/dist/dom/script-loader.js.map +1 -0
- package/dist/dom/scroll-bars.d.ts +52 -0
- package/dist/dom/scroll-bars.d.ts.map +1 -0
- package/dist/dom/scroll-bars.js +259 -0
- package/dist/dom/scroll-bars.js.map +1 -0
- package/dist/dom/scroll-settle.d.ts +33 -0
- package/dist/dom/scroll-settle.d.ts.map +1 -0
- package/dist/dom/scroll-settle.js +84 -0
- package/dist/dom/scroll-settle.js.map +1 -0
- package/dist/dom/scroll.d.ts +21 -0
- package/dist/dom/scroll.d.ts.map +1 -0
- package/dist/dom/scroll.js +141 -0
- package/dist/dom/scroll.js.map +1 -0
- package/dist/dom/share.d.ts +19 -0
- package/dist/dom/share.d.ts.map +1 -0
- package/dist/dom/share.js +41 -0
- package/dist/dom/share.js.map +1 -0
- package/dist/dom/swipe.d.ts +121 -0
- package/dist/dom/swipe.d.ts.map +1 -0
- package/dist/dom/swipe.js +291 -0
- package/dist/dom/swipe.js.map +1 -0
- package/dist/dom/targets.d.ts +45 -0
- package/dist/dom/targets.d.ts.map +1 -0
- package/dist/dom/targets.js +70 -0
- package/dist/dom/targets.js.map +1 -0
- package/dist/dom/track-box.d.ts +61 -0
- package/dist/dom/track-box.d.ts.map +1 -0
- package/dist/dom/track-box.js +131 -0
- package/dist/dom/track-box.js.map +1 -0
- package/dist/events/active-element.d.ts +15 -0
- package/dist/events/active-element.d.ts.map +1 -0
- package/dist/events/active-element.js +33 -0
- package/dist/events/active-element.js.map +1 -0
- package/dist/events/hotkeys.d.ts +22 -0
- package/dist/events/hotkeys.d.ts.map +1 -0
- package/dist/events/hotkeys.js +56 -0
- package/dist/events/hotkeys.js.map +1 -0
- package/dist/events/idle.d.ts +29 -0
- package/dist/events/idle.d.ts.map +1 -0
- package/dist/events/idle.js +51 -0
- package/dist/events/idle.js.map +1 -0
- package/dist/events/index.d.ts +9 -0
- package/dist/events/index.js +10 -0
- package/dist/{input-modality-l7InESYh.d.mts → events/input-modality.d.ts} +9 -10
- package/dist/events/input-modality.d.ts.map +1 -0
- package/dist/{input-modality-XwQOFLip.mjs → events/input-modality.js} +2 -2
- package/dist/events/input-modality.js.map +1 -0
- package/dist/events/keyboard.d.ts +30 -0
- package/dist/events/keyboard.d.ts.map +1 -0
- package/dist/events/keyboard.js +55 -0
- package/dist/events/keyboard.js.map +1 -0
- package/dist/events/pointer.d.ts +15 -0
- package/dist/events/pointer.d.ts.map +1 -0
- package/dist/events/pointer.js +28 -0
- package/dist/events/pointer.js.map +1 -0
- package/dist/events/scroll.d.ts +16 -0
- package/dist/events/scroll.d.ts.map +1 -0
- package/dist/events/scroll.js +29 -0
- package/dist/events/scroll.js.map +1 -0
- package/dist/events/visibility.d.ts +25 -0
- package/dist/events/visibility.d.ts.map +1 -0
- package/dist/events/visibility.js +28 -0
- package/dist/events/visibility.js.map +1 -0
- package/dist/events/window-size.d.ts +30 -0
- package/dist/events/window-size.d.ts.map +1 -0
- package/dist/events/window-size.js +63 -0
- package/dist/events/window-size.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +10 -0
- package/dist/interaction/bundle-behavior.d.ts +37 -0
- package/dist/interaction/bundle-behavior.d.ts.map +1 -0
- package/dist/interaction/bundle-behavior.js +34 -0
- package/dist/interaction/bundle-behavior.js.map +1 -0
- package/dist/interaction/dismiss-layer.d.ts +100 -0
- package/dist/interaction/dismiss-layer.d.ts.map +1 -0
- package/dist/interaction/dismiss-layer.js +140 -0
- package/dist/interaction/dismiss-layer.js.map +1 -0
- package/dist/interaction/editable-text.d.ts +13 -0
- package/dist/interaction/editable-text.d.ts.map +1 -0
- package/dist/interaction/editable-text.js +17 -0
- package/dist/interaction/editable-text.js.map +1 -0
- package/dist/interaction/focus-scope.d.ts +21 -0
- package/dist/interaction/focus-scope.d.ts.map +1 -0
- package/dist/interaction/focus-scope.js +25 -0
- package/dist/interaction/focus-scope.js.map +1 -0
- package/dist/interaction/focus-visible.d.ts +9 -0
- package/dist/interaction/focus-visible.d.ts.map +1 -0
- package/dist/interaction/focus-visible.js +10 -0
- package/dist/interaction/focus-visible.js.map +1 -0
- package/dist/interaction/grid-navigation.d.ts +73 -0
- package/dist/interaction/grid-navigation.d.ts.map +1 -0
- package/dist/interaction/grid-navigation.js +137 -0
- package/dist/interaction/grid-navigation.js.map +1 -0
- package/dist/interaction/index.d.ts +21 -0
- package/dist/interaction/index.js +21 -0
- package/dist/interaction/layers.d.ts +12 -0
- package/dist/interaction/layers.d.ts.map +1 -0
- package/dist/interaction/layers.js +14 -0
- package/dist/interaction/layers.js.map +1 -0
- package/dist/interaction/list-navigation.d.ts +105 -0
- package/dist/interaction/list-navigation.d.ts.map +1 -0
- package/dist/interaction/list-navigation.js +168 -0
- package/dist/interaction/list-navigation.js.map +1 -0
- package/dist/interaction/live-announce.d.ts +70 -0
- package/dist/interaction/live-announce.d.ts.map +1 -0
- package/dist/interaction/live-announce.js +115 -0
- package/dist/interaction/live-announce.js.map +1 -0
- package/dist/interaction/long-press.d.ts +102 -0
- package/dist/interaction/long-press.d.ts.map +1 -0
- package/dist/interaction/long-press.js +115 -0
- package/dist/interaction/long-press.js.map +1 -0
- package/dist/interaction/move.d.ts +10 -0
- package/dist/interaction/move.d.ts.map +1 -0
- package/dist/interaction/move.js +17 -0
- package/dist/interaction/move.js.map +1 -0
- package/dist/interaction/overlay.d.ts +45 -0
- package/dist/interaction/overlay.d.ts.map +1 -0
- package/dist/interaction/overlay.js +57 -0
- package/dist/interaction/overlay.js.map +1 -0
- package/dist/interaction/placing.d.ts +86 -0
- package/dist/interaction/placing.d.ts.map +1 -0
- package/dist/interaction/placing.js +239 -0
- package/dist/interaction/placing.js.map +1 -0
- package/dist/interaction/pointer-drag.d.ts +23 -0
- package/dist/interaction/pointer-drag.d.ts.map +1 -0
- package/dist/interaction/pointer-drag.js +21 -0
- package/dist/interaction/pointer-drag.js.map +1 -0
- package/dist/interaction/press.d.ts +152 -0
- package/dist/interaction/press.d.ts.map +1 -0
- package/dist/interaction/press.js +229 -0
- package/dist/interaction/press.js.map +1 -0
- package/dist/interaction/roving-tabindex.d.ts +85 -0
- package/dist/interaction/roving-tabindex.d.ts.map +1 -0
- package/dist/interaction/roving-tabindex.js +142 -0
- package/dist/interaction/roving-tabindex.js.map +1 -0
- package/dist/interaction/selection.d.ts +72 -0
- package/dist/interaction/selection.d.ts.map +1 -0
- package/dist/interaction/selection.js +129 -0
- package/dist/interaction/selection.js.map +1 -0
- package/dist/interaction/targets.d.ts +15 -0
- package/dist/interaction/targets.d.ts.map +1 -0
- package/dist/interaction/targets.js +20 -0
- package/dist/interaction/targets.js.map +1 -0
- package/dist/interaction/tree-navigation.d.ts +111 -0
- package/dist/interaction/tree-navigation.d.ts.map +1 -0
- package/dist/interaction/tree-navigation.js +207 -0
- package/dist/interaction/tree-navigation.js.map +1 -0
- package/dist/interaction/typeahead.d.ts +73 -0
- package/dist/interaction/typeahead.d.ts.map +1 -0
- package/dist/interaction/typeahead.js +113 -0
- package/dist/interaction/typeahead.js.map +1 -0
- package/dist/internal.d.ts +16 -0
- package/dist/internal.d.ts.map +1 -0
- package/dist/{internal-C4gHodLc.mjs → internal.js} +7 -5
- package/dist/internal.js.map +1 -0
- package/dist/media/breakpoints.d.ts +37 -0
- package/dist/media/breakpoints.d.ts.map +1 -0
- package/dist/media/breakpoints.js +64 -0
- package/dist/media/breakpoints.js.map +1 -0
- package/dist/media/index.d.ts +3 -0
- package/dist/media/index.js +4 -0
- package/dist/media/mediaquery.d.ts +40 -0
- package/dist/media/mediaquery.d.ts.map +1 -0
- package/dist/media/mediaquery.js +42 -0
- package/dist/media/mediaquery.js.map +1 -0
- package/dist/media/platform.d.ts +30 -0
- package/dist/media/platform.d.ts.map +1 -0
- package/dist/media/platform.js +50 -0
- package/dist/media/platform.js.map +1 -0
- package/dist/motion/index.d.ts +5 -0
- package/dist/motion/index.js +5 -0
- package/dist/motion/motion.d.ts +16 -0
- package/dist/motion/motion.d.ts.map +1 -0
- package/dist/motion/motion.js +25 -0
- package/dist/motion/motion.js.map +1 -0
- package/dist/motion/presence.d.ts +37 -0
- package/dist/motion/presence.d.ts.map +1 -0
- package/dist/motion/presence.js +65 -0
- package/dist/motion/presence.js.map +1 -0
- package/dist/motion/spring.d.ts +50 -0
- package/dist/motion/spring.d.ts.map +1 -0
- package/dist/motion/spring.js +92 -0
- package/dist/motion/spring.js.map +1 -0
- package/dist/motion/tween.d.ts +44 -0
- package/dist/motion/tween.d.ts.map +1 -0
- package/dist/motion/tween.js +65 -0
- package/dist/motion/tween.js.map +1 -0
- package/dist/net/broadcast.d.ts +39 -0
- package/dist/net/broadcast.d.ts.map +1 -0
- package/dist/net/broadcast.js +73 -0
- package/dist/net/broadcast.js.map +1 -0
- package/dist/net/index.d.ts +5 -0
- package/dist/net/index.js +6 -0
- package/dist/net/online.d.ts +24 -0
- package/dist/net/online.d.ts.map +1 -0
- package/dist/net/online.js +26 -0
- package/dist/net/online.js.map +1 -0
- package/dist/net/sharedHost.d.ts +64 -0
- package/dist/net/sharedHost.d.ts.map +1 -0
- package/dist/net/sharedHost.js +124 -0
- package/dist/net/sharedHost.js.map +1 -0
- package/dist/net/sse.d.ts +115 -0
- package/dist/net/sse.d.ts.map +1 -0
- package/dist/net/sse.js +138 -0
- package/dist/net/sse.js.map +1 -0
- package/dist/net/websocket.d.ts +172 -0
- package/dist/net/websocket.d.ts.map +1 -0
- package/dist/net/websocket.js +199 -0
- package/dist/net/websocket.js.map +1 -0
- package/dist/observers/bounds.d.ts +24 -0
- package/dist/observers/bounds.d.ts.map +1 -0
- package/dist/observers/bounds.js +51 -0
- package/dist/observers/bounds.js.map +1 -0
- package/dist/observers/index.d.ts +4 -0
- package/dist/observers/index.js +5 -0
- package/dist/observers/intersection.d.ts +18 -0
- package/dist/observers/intersection.d.ts.map +1 -0
- package/dist/observers/intersection.js +33 -0
- package/dist/observers/intersection.js.map +1 -0
- package/dist/observers/mutation.d.ts +25 -0
- package/dist/observers/mutation.d.ts.map +1 -0
- package/dist/observers/mutation.js +53 -0
- package/dist/observers/mutation.js.map +1 -0
- package/dist/observers/resize.d.ts +18 -0
- package/dist/observers/resize.d.ts.map +1 -0
- package/dist/observers/resize.js +33 -0
- package/dist/observers/resize.js.map +1 -0
- package/dist/state/history.d.ts +115 -0
- package/dist/state/history.d.ts.map +1 -0
- package/dist/state/history.js +167 -0
- package/dist/state/history.js.map +1 -0
- package/dist/state/index.d.ts +6 -0
- package/dist/state/index.js +7 -0
- package/dist/state/locale.d.ts +27 -0
- package/dist/state/locale.d.ts.map +1 -0
- package/dist/state/locale.js +25 -0
- package/dist/state/locale.js.map +1 -0
- package/dist/state/pagination.d.ts +53 -0
- package/dist/state/pagination.d.ts.map +1 -0
- package/dist/state/pagination.js +72 -0
- package/dist/state/pagination.js.map +1 -0
- package/dist/state/range.d.ts +9 -0
- package/dist/state/range.d.ts.map +1 -0
- package/dist/state/range.js +18 -0
- package/dist/state/range.js.map +1 -0
- package/dist/state/selection.d.ts +47 -0
- package/dist/state/selection.d.ts.map +1 -0
- package/dist/state/selection.js +39 -0
- package/dist/state/selection.js.map +1 -0
- package/dist/state/virtual.d.ts +201 -0
- package/dist/state/virtual.d.ts.map +1 -0
- package/dist/state/{index.mjs → virtual.js} +10 -306
- package/dist/state/virtual.js.map +1 -0
- package/dist/time/debounce.d.ts +43 -0
- package/dist/time/debounce.d.ts.map +1 -0
- package/dist/time/debounce.js +65 -0
- package/dist/time/debounce.js.map +1 -0
- package/dist/time/index.d.ts +6 -0
- package/dist/time/index.js +7 -0
- package/dist/time/interval.d.ts +37 -0
- package/dist/time/interval.d.ts.map +1 -0
- package/dist/time/interval.js +52 -0
- package/dist/time/interval.js.map +1 -0
- package/dist/time/relative.d.ts +8 -0
- package/dist/time/relative.d.ts.map +1 -0
- package/dist/time/relative.js +27 -0
- package/dist/time/relative.js.map +1 -0
- package/dist/time/throttle.d.ts +38 -0
- package/dist/time/throttle.d.ts.map +1 -0
- package/dist/time/throttle.js +39 -0
- package/dist/time/throttle.js.map +1 -0
- package/dist/time/ticks.d.ts +21 -0
- package/dist/time/ticks.d.ts.map +1 -0
- package/dist/time/ticks.js +30 -0
- package/dist/time/ticks.js.map +1 -0
- package/dist/time/timer.d.ts +32 -0
- package/dist/time/timer.d.ts.map +1 -0
- package/dist/time/timer.js +50 -0
- package/dist/time/timer.js.map +1 -0
- package/package.json +31 -31
- package/dist/device/index.d.mts +0 -335
- package/dist/device/index.d.mts.map +0 -1
- package/dist/device/index.mjs +0 -493
- package/dist/device/index.mjs.map +0 -1
- package/dist/dom/index.d.mts +0 -714
- package/dist/dom/index.d.mts.map +0 -1
- package/dist/dom/index.mjs +0 -1840
- package/dist/dom/index.mjs.map +0 -1
- package/dist/editable-text-Bg7vil7h.d.mts +0 -307
- package/dist/editable-text-Bg7vil7h.d.mts.map +0 -1
- package/dist/events/index.d.mts +0 -168
- package/dist/events/index.d.mts.map +0 -1
- package/dist/events/index.mjs +0 -307
- package/dist/events/index.mjs.map +0 -1
- package/dist/follow-tab-stop-DM5EI4Ci.mjs +0 -856
- package/dist/follow-tab-stop-DM5EI4Ci.mjs.map +0 -1
- package/dist/index-Bomdwb7e.d.mts +0 -142
- package/dist/index-Bomdwb7e.d.mts.map +0 -1
- package/dist/index.d.mts +0 -12
- package/dist/index.mjs +0 -12
- package/dist/input-modality-XwQOFLip.mjs.map +0 -1
- package/dist/input-modality-l7InESYh.d.mts.map +0 -1
- package/dist/interaction/index.d.mts +0 -1193
- package/dist/interaction/index.d.mts.map +0 -1
- package/dist/interaction/index.mjs +0 -1992
- package/dist/interaction/index.mjs.map +0 -1
- package/dist/internal-C4gHodLc.mjs.map +0 -1
- package/dist/media/index.d.mts +0 -103
- package/dist/media/index.d.mts.map +0 -1
- package/dist/media/index.mjs +0 -146
- package/dist/media/index.mjs.map +0 -1
- package/dist/motion/index.d.mts +0 -2
- package/dist/motion/index.mjs +0 -1
- package/dist/motion-BmlJCjn6.mjs +0 -236
- package/dist/motion-BmlJCjn6.mjs.map +0 -1
- package/dist/net/index.d.mts +0 -338
- package/dist/net/index.d.mts.map +0 -1
- package/dist/net/index.mjs +0 -530
- package/dist/net/index.mjs.map +0 -1
- package/dist/observers/index.d.mts +0 -76
- package/dist/observers/index.d.mts.map +0 -1
- package/dist/observers/index.mjs +0 -155
- package/dist/observers/index.mjs.map +0 -1
- package/dist/rolldown-runtime-D8jQpDG7.mjs +0 -12
- package/dist/state/index.d.mts +0 -432
- package/dist/state/index.d.mts.map +0 -1
- package/dist/state/index.mjs.map +0 -1
- package/dist/time/index.d.mts +0 -167
- package/dist/time/index.d.mts.map +0 -1
- package/dist/time/index.mjs +0 -236
- package/dist/time/index.mjs.map +0 -1
package/dist/dom/index.d.mts
DELETED
|
@@ -1,714 +0,0 @@
|
|
|
1
|
-
import { A as Moved, C as TargetPressed, D as Move, E as Fact, M as ScrollLock, N as FocusScope, O as MoveEnded, P as tabbableWithin, S as TargetHovered, T as targetOf, _ as HOLD_TO_DRAG_MS, a as TextEdited, b as zoneOf, c as DRAG_THRESHOLD, d as DragFact, f as DragPlace, g as HOLD_SLOP, h as DraggedOver, i as TextCommitted, j as HideOutside, k as MoveStarted, l as DragCancelled, m as DragZone, n as EditableText, o as TextFact, p as DragStarted, r as TextCancelled, s as textOf, t as EditAsked, u as DragDropped, v as PointerDrag, w as Targets, x as TargetFact, y as boxOf } from "../editable-text-Bg7vil7h.mjs";
|
|
2
|
-
import { Schema, Stream } from "effect";
|
|
3
|
-
import * as Mount from "foldkit/mount";
|
|
4
|
-
import { Url } from "foldkit/url";
|
|
5
|
-
import { Command } from "foldkit/command";
|
|
6
|
-
export declare const Focused: Schema.TaggedStruct<"Focused", {}>;
|
|
7
|
-
export type Focused = typeof Focused.Type;
|
|
8
|
-
/**
|
|
9
|
-
* Autofocus as a Mount: focuses the element on insert, then emits `Focused`.
|
|
10
|
-
* The message means focus was requested — a non-focusable element or a
|
|
11
|
-
* hidden tab may decline, and the browser does not report that. Plain
|
|
12
|
-
* `focus()`, no scroll options: scroll behavior stays the application's
|
|
13
|
-
* choice.
|
|
14
|
-
*/
|
|
15
|
-
export declare const Autofocus: Mount.MountDefinitionNoArgs<"Autofocus", {
|
|
16
|
-
readonly _tag: "Focused";
|
|
17
|
-
}>;
|
|
18
|
-
export declare const ClipboardMessage: import("foldkit/message").MessageUnion<{
|
|
19
|
-
readonly Copied: {};
|
|
20
|
-
readonly CopyFailed: {
|
|
21
|
-
message: Schema.String;
|
|
22
|
-
};
|
|
23
|
-
}>;
|
|
24
|
-
export type ClipboardMessage = typeof ClipboardMessage.Type;
|
|
25
|
-
export declare const ClipboardReadMessage: import("foldkit/message").MessageUnion<{
|
|
26
|
-
readonly Read: {
|
|
27
|
-
text: Schema.String;
|
|
28
|
-
};
|
|
29
|
-
readonly ReadFailed: {
|
|
30
|
-
message: Schema.String;
|
|
31
|
-
};
|
|
32
|
-
}>;
|
|
33
|
-
export type ClipboardReadMessage = typeof ClipboardReadMessage.Type;
|
|
34
|
-
/**
|
|
35
|
-
* Copies text to the clipboard. Without a clipboard API (SSR, insecure
|
|
36
|
-
* context, denied permission) the command yields `CopyFailed` instead of
|
|
37
|
-
* throwing, so `update` handles both outcomes as Messages.
|
|
38
|
-
*/
|
|
39
|
-
export declare const copyText: (text: string) => Command<ClipboardMessage, never, never>;
|
|
40
|
-
/**
|
|
41
|
-
* Reads the clipboard's text. The browser may ask the user first; a refusal,
|
|
42
|
-
* an insecure context or no clipboard API yields `ReadFailed`.
|
|
43
|
-
*/
|
|
44
|
-
export declare const readText: () => Command<ClipboardReadMessage, never, never>;
|
|
45
|
-
/** What `InputMask` reports after each edit: the masked text shown, and the characters typed. */
|
|
46
|
-
export declare const Input: Schema.TaggedStruct<"Input", {
|
|
47
|
-
readonly value: Schema.String;
|
|
48
|
-
readonly raw: Schema.String;
|
|
49
|
-
}>;
|
|
50
|
-
export type Input = typeof Input.Type;
|
|
51
|
-
/**
|
|
52
|
-
* The mask as a pure function: `#` takes a digit, `A` a letter, `*` either, and
|
|
53
|
-
* any other character of the pattern is written in once input reaches past it.
|
|
54
|
-
* Input that fits no placeholder is skipped. `masked` is what the field shows;
|
|
55
|
-
* `raw` is only the characters typed.
|
|
56
|
-
*/
|
|
57
|
-
export declare const applyMask: (value: string, pattern: string) => {
|
|
58
|
-
readonly masked: string;
|
|
59
|
-
readonly raw: string;
|
|
60
|
-
};
|
|
61
|
-
/**
|
|
62
|
-
* An input mask as a Mount plus a pure mask function. The pattern language
|
|
63
|
-
* is three placeholders — `#` digit, `A` letter, `*` either, all ASCII —
|
|
64
|
-
* with every other character literal. Literals appear only once a later placeholder
|
|
65
|
-
* consumes input, so partial values never dangle a separator. The Mount
|
|
66
|
-
* rewrites the field, restores the caret approximately, and emits `Input`
|
|
67
|
-
* with both the masked and raw values; the parent owns the state, like any
|
|
68
|
-
* controlled input.
|
|
69
|
-
*/
|
|
70
|
-
export declare const InputMask: Mount.MountDefinitionWithArgs<"InputMask", {
|
|
71
|
-
pattern: Schema.String;
|
|
72
|
-
}, {
|
|
73
|
-
readonly _tag: "Input";
|
|
74
|
-
readonly value: string;
|
|
75
|
-
readonly raw: string;
|
|
76
|
-
}>;
|
|
77
|
-
/**
|
|
78
|
-
* Keeps what is marked in view as a Mount: whenever an element in the mounted
|
|
79
|
-
* one's subtree newly matches `selector`, such as the row just selected in a
|
|
80
|
-
* list, it is scrolled into view the least amount that shows it (`nearest`).
|
|
81
|
-
* The element keeps its identity and its focus: nothing is redrawn to move it.
|
|
82
|
-
*
|
|
83
|
-
* It watches with a `MutationObserver` for as long as it is mounted, which is as
|
|
84
|
-
* long as the list or canvas that can change what is marked.
|
|
85
|
-
*/
|
|
86
|
-
export declare const KeepInView: Mount.MountDefinitionWithArgs<"KeepInView", {
|
|
87
|
-
/** What is marked, as a selector within the element: `[aria-selected="true"]`. */
|
|
88
|
-
selector: Schema.String;
|
|
89
|
-
}, never>;
|
|
90
|
-
export declare const ScriptMessage: import("foldkit/message").MessageUnion<{
|
|
91
|
-
readonly Loaded: {};
|
|
92
|
-
readonly LoadFailed: {
|
|
93
|
-
message: Schema.String;
|
|
94
|
-
};
|
|
95
|
-
}>;
|
|
96
|
-
export type ScriptMessage = typeof ScriptMessage.Type;
|
|
97
|
-
/** Loads a script by URL, once per URL. */
|
|
98
|
-
export declare const loadScript: (src: string) => Command<ScriptMessage, never, never>;
|
|
99
|
-
export declare const ShareData: Schema.Struct<{
|
|
100
|
-
readonly title: Schema.optional<Schema.String>;
|
|
101
|
-
readonly text: Schema.optional<Schema.String>;
|
|
102
|
-
readonly url: Schema.optional<Schema.String>;
|
|
103
|
-
}>;
|
|
104
|
-
export type ShareData = typeof ShareData.Type;
|
|
105
|
-
export declare const ShareMessage: import("foldkit/message").MessageUnion<{
|
|
106
|
-
readonly Shared: {};
|
|
107
|
-
readonly Dismissed: {};
|
|
108
|
-
readonly ShareFailed: {
|
|
109
|
-
message: Schema.String;
|
|
110
|
-
};
|
|
111
|
-
}>;
|
|
112
|
-
export type ShareMessage = typeof ShareMessage.Type;
|
|
113
|
-
/** Shares data through the platform sheet. */
|
|
114
|
-
export declare const share: (data: ShareData) => Command<ShareMessage, never, never>;
|
|
115
|
-
/** The custom properties `Measure` writes for a target named `name`. */
|
|
116
|
-
export declare const measured: (name: string) => {
|
|
117
|
-
readonly x: `--fk-${string}-x`;
|
|
118
|
-
readonly y: `--fk-${string}-y`;
|
|
119
|
-
readonly w: `--fk-${string}-w`;
|
|
120
|
-
readonly h: `--fk-${string}-h`;
|
|
121
|
-
readonly display: `--fk-${string}-display`;
|
|
122
|
-
/**
|
|
123
|
-
* `1` for the measure that finds the mark on another element than the
|
|
124
|
-
* last, `0` for any other (the layout moved or resized the same one, or
|
|
125
|
-
* it is the first found): an overlay that glides to a new mark scales its
|
|
126
|
-
* duration by it, so it keeps to its element as the layout settles.
|
|
127
|
-
*/
|
|
128
|
-
readonly moving: `--fk-${string}-moving`;
|
|
129
|
-
};
|
|
130
|
-
/**
|
|
131
|
-
* Measures marked elements as a Mount, for a view to draw something over them,
|
|
132
|
-
* such as an editor's selection outline, with no Message and no Model: where
|
|
133
|
-
* an element is, is presentation, known to the DOM and to no transition.
|
|
134
|
-
*
|
|
135
|
-
* For each named target, the first element in the mounted one's subtree that
|
|
136
|
-
* matches its selector is measured relative to the mounted element's scroll
|
|
137
|
-
* box, which is what an absolutely placed child of it is laid out in. The
|
|
138
|
-
* mounted element gets `--fk-<name>-x`, `-y`, `-w` and `-h` in pixels, and
|
|
139
|
-
* `--fk-<name>-display`: `block` while a target is found, `none` while none is,
|
|
140
|
-
* and `--fk-<name>-moving` (see `measured`).
|
|
141
|
-
*
|
|
142
|
-
* It measures again when the subtree changes (a selection moves) or the
|
|
143
|
-
* mounted element or a measured one changes size, in the frame the change is
|
|
144
|
-
* drawn in; and, at most once a frame, when the mounted element scrolls, the
|
|
145
|
-
* window resizes, an image or a font inside loads, and on every frame of a
|
|
146
|
-
* transition or an animation inside. What moves a target by any other way,
|
|
147
|
-
* such as a stylesheet added that shifts it without resizing it, is seen at
|
|
148
|
-
* the next of these.
|
|
149
|
-
*/
|
|
150
|
-
export declare const Measure: Mount.MountDefinitionWithArgs<"Measure", {
|
|
151
|
-
/** Each target by name, as a selector within the element: `{ selected: '[aria-selected="true"]' }`. */
|
|
152
|
-
targets: Schema.$Record<Schema.String, Schema.String>;
|
|
153
|
-
}, never>;
|
|
154
|
-
/**
|
|
155
|
-
* Keeps focus that is inside a container of roving tab stops on its stop, as a
|
|
156
|
-
* Mount: when a transition moves the stop (a row made current by a command the
|
|
157
|
-
* container did not see, such as a duplicate) or removes the focused
|
|
158
|
-
* descendant (a deleted row), focus goes to the descendant with
|
|
159
|
-
* `tabindex="0"`. It sends no Message. Focus outside the container is never
|
|
160
|
-
* taken, and focus the user moved away stays where it went.
|
|
161
|
-
*/
|
|
162
|
-
export declare const FollowTabStop: Mount.MountDefinitionNoArgs<"FollowTabStop", never>;
|
|
163
|
-
/** How `keepScroll` remembers and restores each history entry's offset. */
|
|
164
|
-
export interface KeepScrollOptions {
|
|
165
|
-
/** The `sessionStorage` key holding entry offsets. Default `'foldkit:scroll'`. */
|
|
166
|
-
readonly storageKey?: string | undefined;
|
|
167
|
-
/** Entries remembered at most: the oldest are forgotten first. Default 50. */
|
|
168
|
-
readonly kept?: number | undefined;
|
|
169
|
-
/**
|
|
170
|
-
* How long a restore holds its place while the next screen settles, in
|
|
171
|
-
* milliseconds. Default 2000.
|
|
172
|
-
*/
|
|
173
|
-
readonly patience?: number | undefined;
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* Keeps the window's scroll across same-document navigations: a pushed entry
|
|
177
|
-
* starts at the top, and Back, Forward or a reload return where that entry
|
|
178
|
-
* was. Without a window the stream is empty instead of throwing. Lift with
|
|
179
|
-
* `Subscription.persistentEntry`; the stream sends no Messages.
|
|
180
|
-
*/
|
|
181
|
-
export declare const keepScroll: (options?: KeepScrollOptions) => Stream.Stream<never>;
|
|
182
|
-
/**
|
|
183
|
-
* The address of the link a reader points at or tabs to, on the page's own
|
|
184
|
-
* origin: where they may go next, for a `Data.preload` before they go. Each
|
|
185
|
-
* link once while they stay on it, since crossing its text sends one event
|
|
186
|
-
* per element inside it. Without a document the stream is empty. Lift with
|
|
187
|
-
* `Subscription.persistentEntry`, mapping each address to a Message.
|
|
188
|
-
*/
|
|
189
|
-
export declare const pointedLinks: () => Stream.Stream<Url>;
|
|
190
|
-
/** The custom properties `FluidHover` writes on its container for a highlight named `name`. */
|
|
191
|
-
export declare const fluidHovered: (name: string) => {
|
|
192
|
-
readonly x: `--fk-${string}-x`;
|
|
193
|
-
readonly y: `--fk-${string}-y`;
|
|
194
|
-
readonly w: `--fk-${string}-w`;
|
|
195
|
-
readonly h: `--fk-${string}-h`;
|
|
196
|
-
/** `1` while an item is highlighted, `0` once the pointer and focus have left. */
|
|
197
|
-
readonly shown: `--fk-${string}-shown`;
|
|
198
|
-
/**
|
|
199
|
-
* `0` for the frame the highlight appears in, then `1`: a highlight's
|
|
200
|
-
* movement scales its duration by it, so it appears on its item rather
|
|
201
|
-
* than sliding in from where it last was.
|
|
202
|
-
*/
|
|
203
|
-
readonly moving: `--fk-${string}-moving`;
|
|
204
|
-
};
|
|
205
|
-
/**
|
|
206
|
-
* The attribute `FluidHover` sets on its container, to the highlight's name,
|
|
207
|
-
* while it runs: a stylist draws the highlight, and drops each item's own
|
|
208
|
-
* hover, only under it.
|
|
209
|
-
*/
|
|
210
|
-
export declare const FLUID_HOVER_ATTRIBUTE = "data-fluid-hover";
|
|
211
|
-
/** The attribute that names, inside an item, the control a press in a gap reaches. */
|
|
212
|
-
export declare const FLUID_PRESS_ATTRIBUTE = "data-fluid-press";
|
|
213
|
-
/** The attribute on the item the highlight is shown on, for what CSS draws beside it. */
|
|
214
|
-
export declare const FLUID_LIT_ATTRIBUTE = "data-fluid-lit";
|
|
215
|
-
/**
|
|
216
|
-
* The attribute `FluidHover` sets on its container, to the highlight's name,
|
|
217
|
-
* while the item that highlight is on is held. A stylist draws the press on
|
|
218
|
-
* the highlight (`data-fluid-held`) rather than on the item, whose own press
|
|
219
|
-
* is hidden under it; a press in a gap marks it too where `gapClick` sends
|
|
220
|
-
* that press to the lit item.
|
|
221
|
-
*/
|
|
222
|
-
export declare const FLUID_HELD_ATTRIBUTE = "data-fluid-held";
|
|
223
|
-
declare const Axis: Schema.Literals<readonly ["x", "y", "xy"]>;
|
|
224
|
-
export type FluidAxis = typeof Axis.Type;
|
|
225
|
-
/**
|
|
226
|
-
* One highlight that follows the pointer across a container's items, as a
|
|
227
|
-
* Mount, with no Message and no Model: which item the pointer is nearest is
|
|
228
|
-
* presentation, known to the DOM and to no transition.
|
|
229
|
-
*
|
|
230
|
-
* The item nearest the pointer is the one highlighted, so the pointer in a gap
|
|
231
|
-
* between two items still points at one, and the highlight moves from item to
|
|
232
|
-
* item instead of blinking off between them. On the `y` axis nearness is read
|
|
233
|
-
* vertically (a list), on `x` horizontally (a strip), on `xy` both (a grid). A
|
|
234
|
-
* disabled item (`aria-disabled="true"`, `data-disabled`, `:disabled`) is never
|
|
235
|
-
* highlighted. An item reached by the keyboard (`:focus-visible`) is
|
|
236
|
-
* highlighted too, and with `focused`, the item that selector finds from a
|
|
237
|
-
* focused element that is no item (a tree's row, from its focused
|
|
238
|
-
* `treeitem`, which also holds the rows beneath it); a touch highlights
|
|
239
|
-
* nothing, since there is no pointer to
|
|
240
|
-
* follow before the press.
|
|
241
|
-
*
|
|
242
|
-
* The container gets `--fk-<name>-x`, `-y`, `-w` and `-h` in pixels, relative
|
|
243
|
-
* to its scroll box like `Measure`'s, and `-shown` and `-moving` (see
|
|
244
|
-
* `fluidHovered`); a view draws the highlight as an absolutely placed child
|
|
245
|
-
* that reads them. With `gapClick`, a click in a gap presses the highlighted
|
|
246
|
-
* item: its descendant marked `data-fluid-press`, or the item itself; with
|
|
247
|
-
* `gapReach` too, only a click within that many pixels of it, as a grid of
|
|
248
|
-
* cards with wide gutters wants (Fluid Functionalism's uses 16). A popup
|
|
249
|
-
* measured before it has a layout box keeps its last complete place, and
|
|
250
|
-
* tries again for three frames, rather than drawing the highlight at zero.
|
|
251
|
-
* The item the highlight is shown on carries `data-fluid-lit`, so a style
|
|
252
|
-
* can change what sits beside it (a table hides the lines around the lit
|
|
253
|
-
* row); its container carries `data-fluid-held` while that item is pressed.
|
|
254
|
-
*
|
|
255
|
-
* `follows` names the item the highlight sits on while the pointer is not
|
|
256
|
-
* moving it: a menu marks the row its keys reach (`[data-active]`), and the
|
|
257
|
-
* highlight goes there whenever that mark moves, so the keys and the pointer
|
|
258
|
-
* light the same one. `from` names the item a fresh highlight grows out of,
|
|
259
|
-
* as a tab's hover leaves the chosen tab. A highlight always fades where it
|
|
260
|
-
* is: once the pointer leaves, nothing should move. It stays only for an item
|
|
261
|
-
* the keyboard reached (`:focus-visible`), not one a click focused.
|
|
262
|
-
*/
|
|
263
|
-
export declare const FluidHover: Mount.MountDefinitionWithArgs<"FluidHover", {
|
|
264
|
-
/** The highlight's name, which names the custom properties. */
|
|
265
|
-
name: Schema.String;
|
|
266
|
-
/** The selector of an item within the container. */
|
|
267
|
-
item: Schema.String;
|
|
268
|
-
axis: Schema.Literals<readonly ["x", "y", "xy"]>;
|
|
269
|
-
gapClick: Schema.Boolean;
|
|
270
|
-
/** How far from the highlighted item, in pixels, a click in a gap still presses it. */
|
|
271
|
-
gapReach: Schema.optional<Schema.Number>;
|
|
272
|
-
/** The selector of the item the highlight sits on while the pointer is not moving it. */
|
|
273
|
-
follows: Schema.optional<Schema.String>;
|
|
274
|
-
/** The selector of the item a fresh highlight grows out of. */
|
|
275
|
-
from: Schema.optional<Schema.String>;
|
|
276
|
-
/** The selector, run from a focused element outside any item, of the item it lights. */
|
|
277
|
-
focused: Schema.optional<Schema.String>;
|
|
278
|
-
}, never>;
|
|
279
|
-
/**
|
|
280
|
-
* The custom property `KeyboardInset` writes on its element: how much of the layout
|
|
281
|
-
* viewport's bottom the on-screen keyboard (or anything else the visual viewport leaves
|
|
282
|
-
* out) covers, in pixels.
|
|
283
|
-
*/
|
|
284
|
-
export declare const KEYBOARD_INSET = "--fk-keyboard-inset";
|
|
285
|
-
/**
|
|
286
|
-
* The part of the layout viewport's height below the visual viewport: what the on-screen
|
|
287
|
-
* keyboard covers. Rounded down, since a fraction of a pixel of zoom is no keyboard.
|
|
288
|
-
*/
|
|
289
|
-
export declare const keyboardInset: (view: {
|
|
290
|
-
readonly innerHeight: number;
|
|
291
|
-
readonly visualViewport: {
|
|
292
|
-
readonly height: number;
|
|
293
|
-
readonly offsetTop: number;
|
|
294
|
-
} | null;
|
|
295
|
-
}) => number;
|
|
296
|
-
/**
|
|
297
|
-
* The on-screen keyboard's height as a Mount, with no Message and no Model: where it is
|
|
298
|
-
* is the browser's. iOS Safari, and Chrome on Android unless the page asks otherwise,
|
|
299
|
-
* leave the layout viewport as it is when the keyboard opens, so a panel fixed to the
|
|
300
|
-
* screen keeps its height and its bottom under the keys. This writes `KEYBOARD_INSET` on
|
|
301
|
-
* the element, from the visual viewport's size and scroll, for a style to pad or shrink by
|
|
302
|
-
* (`var(--fk-keyboard-inset, 0px)`), and removes it when the element goes. Where there is
|
|
303
|
-
* no visual viewport it writes nothing.
|
|
304
|
-
*/
|
|
305
|
-
export declare const KeyboardInset: Mount.MountDefinitionWithArgs<"KeyboardInset", {}, never>;
|
|
306
|
-
/**
|
|
307
|
-
* The attribute that marks a bar beside a scroller `ScrollBars` runs on, set
|
|
308
|
-
* to the axis it shows: `block` (the up-and-down bar) or `inline`.
|
|
309
|
-
*/
|
|
310
|
-
export declare const SCROLL_BAR_ATTRIBUTE = "data-scroll-bar";
|
|
311
|
-
/**
|
|
312
|
-
* The attribute `ScrollBars` sets on its scroller while it draws the bars, so a
|
|
313
|
-
* style hides the native bar only then: with no Mount running (a coarse
|
|
314
|
-
* pointer, a page not yet hydrated) the browser's bar stays.
|
|
315
|
-
*/
|
|
316
|
-
export declare const SCROLL_OVERLAID_ATTRIBUTE = "data-scroll-overlaid";
|
|
317
|
-
/**
|
|
318
|
-
* The custom properties `ScrollBars` writes on each bar, in pixels, for its
|
|
319
|
-
* thumb to read: how far along the bar the thumb starts, and how long it is.
|
|
320
|
-
* Physical: an inline bar's offset is from its left edge in either direction.
|
|
321
|
-
*/
|
|
322
|
-
export declare const scrollThumb: {
|
|
323
|
-
readonly offset: '--fk-scroll-thumb-offset';
|
|
324
|
-
readonly size: '--fk-scroll-thumb-size';
|
|
325
|
-
};
|
|
326
|
-
/**
|
|
327
|
-
* An overlay scrollbar as a Mount, with no Message and no Model: where a
|
|
328
|
-
* scroller is scrolled is the browser's, and the bar only shows it.
|
|
329
|
-
*
|
|
330
|
-
* It runs on the scroller (or on an element holding it, named by `scroller`,
|
|
331
|
-
* when the scroller carries another Mount) and drives the bars drawn beside
|
|
332
|
-
* it: the scroller's parent's children marked `data-scroll-bar` (`block` or
|
|
333
|
-
* `inline`), which a style lays over the scroller's edge. Each bar gets `data-scrollable` while its axis has
|
|
334
|
-
* more to scroll, `data-shown` while the scroller scrolls or the pointer moves
|
|
335
|
-
* over it, until `idle` milliseconds pass with neither (or longer, while the
|
|
336
|
-
* pointer rests on a bar), and `data-dragging` while its thumb is dragged; and
|
|
337
|
-
* `--fk-scroll-thumb-offset` and `-size` (see `scrollThumb`). Pressing a bar
|
|
338
|
-
* off its thumb moves the thumb there, then drags it.
|
|
339
|
-
*
|
|
340
|
-
* It does nothing where the primary pointer is coarse or cannot hover, decided
|
|
341
|
-
* when it mounts: touch keeps the browser's bar and its physics. Otherwise the
|
|
342
|
-
* scroller gets `data-scroll-overlaid`, for a style to hide the native bar.
|
|
343
|
-
* How the bar looks, rests, widens and fades is the style's.
|
|
344
|
-
*/
|
|
345
|
-
export declare const ScrollBars: Mount.MountDefinitionWithArgs<"ScrollBars", {
|
|
346
|
-
/** How long, in milliseconds, the bars stay after the last scroll or move. Default 600. */
|
|
347
|
-
idle: Schema.optional<Schema.Number>;
|
|
348
|
-
/**
|
|
349
|
-
* The scroller, as a selector within the element, when it cannot hold this
|
|
350
|
-
* Mount itself (another component's, with a Mount of its own); looked for
|
|
351
|
-
* once, when it mounts. Default: the element is the scroller.
|
|
352
|
-
*/
|
|
353
|
-
scroller: Schema.optional<Schema.String>;
|
|
354
|
-
}, never>;
|
|
355
|
-
export declare const SwipeStarted: Schema.TaggedStruct<"SwipeStarted", {
|
|
356
|
-
readonly pointerId: Schema.Number;
|
|
357
|
-
readonly pointerType: Schema.String;
|
|
358
|
-
/** The border box of what `measure` names (the element itself by default), as the swipe starts. */
|
|
359
|
-
readonly width: Schema.Number;
|
|
360
|
-
readonly height: Schema.Number;
|
|
361
|
-
}>;
|
|
362
|
-
export type SwipeStarted = typeof SwipeStarted.Type;
|
|
363
|
-
export declare const Swiped: Schema.TaggedStruct<"Swiped", {
|
|
364
|
-
readonly pointerId: Schema.Number;
|
|
365
|
-
/** From where the pointer went down, in CSS pixels. */
|
|
366
|
-
readonly deltaX: Schema.Number;
|
|
367
|
-
readonly deltaY: Schema.Number;
|
|
368
|
-
}>;
|
|
369
|
-
export type Swiped = typeof Swiped.Type;
|
|
370
|
-
export declare const SwipeEnded: Schema.TaggedStruct<"SwipeEnded", {
|
|
371
|
-
readonly pointerId: Schema.Number;
|
|
372
|
-
/** From where the pointer went down to where it came up, in CSS pixels. */
|
|
373
|
-
readonly deltaX: Schema.Number;
|
|
374
|
-
readonly deltaY: Schema.Number;
|
|
375
|
-
/**
|
|
376
|
-
* How fast the pointer was moving as it came up, in pixels a millisecond,
|
|
377
|
-
* over the last `SWIPE_WINDOW` milliseconds: 0 when it rested there first.
|
|
378
|
-
*/
|
|
379
|
-
readonly velocityX: Schema.Number;
|
|
380
|
-
readonly velocityY: Schema.Number;
|
|
381
|
-
/** `false` when the pointer was cancelled or capture was lost. */
|
|
382
|
-
readonly completed: Schema.Boolean;
|
|
383
|
-
}>;
|
|
384
|
-
export type SwipeEnded = typeof SwipeEnded.Type;
|
|
385
|
-
export type SwipeFact = SwipeStarted | Swiped | SwipeEnded;
|
|
386
|
-
/** How far back, in milliseconds, the release velocity looks. */
|
|
387
|
-
export declare const SWIPE_WINDOW = 100;
|
|
388
|
-
/**
|
|
389
|
-
* What a swipe never starts on when its element `scrolls`: a field whose own
|
|
390
|
-
* drag selects text or moves a thumb, and anything marked `data-no-swipe`.
|
|
391
|
-
*/
|
|
392
|
-
export declare const NO_SWIPE = "input, textarea, select, [contenteditable=\"\"], [contenteditable=\"true\"], [data-no-swipe]";
|
|
393
|
-
interface Sample {
|
|
394
|
-
readonly at: number;
|
|
395
|
-
readonly x: number;
|
|
396
|
-
readonly y: number;
|
|
397
|
-
}
|
|
398
|
-
/**
|
|
399
|
-
* The velocity of the samples within `SWIPE_WINDOW` of the last: the way
|
|
400
|
-
* from the oldest of them to the last over the time between. A pointer that
|
|
401
|
-
* came to rest before the last sample has no recent way to measure, so 0.
|
|
402
|
-
*/
|
|
403
|
-
export declare const velocityOf: (samples: ReadonlyArray<Sample>) => {
|
|
404
|
-
x: number;
|
|
405
|
-
y: number;
|
|
406
|
-
};
|
|
407
|
-
/**
|
|
408
|
-
* Whether anything from `target` up to `root` can still scroll along `axis`
|
|
409
|
-
* the way a finger moving `along` (positive is down or right) pulls it: a
|
|
410
|
-
* finger going down scrolls content toward its start.
|
|
411
|
-
*/
|
|
412
|
-
export declare const canScroll: (target: Element, root: Element, axis: 'x' | 'y', along: number) => boolean;
|
|
413
|
-
/**
|
|
414
|
-
* `Move` with the speed of its release, for a gesture that a flick ends
|
|
415
|
-
* (a sheet dragged to dismiss, a card swiped away): a primary-button pointer
|
|
416
|
-
* down (or, given a `slop`, its first move past it) captures the pointer,
|
|
417
|
-
* each move reports the delta from where it was pressed, and up reports the
|
|
418
|
-
* last delta with the velocity over the last `SWIPE_WINDOW` milliseconds, by
|
|
419
|
-
* the events' own time stamps. Cancel or lost capture ends it incomplete.
|
|
420
|
-
* The start reports the size of what is moved, so a distance can be read as
|
|
421
|
-
* a share of it. What a delta or a speed means is the parent's `update`.
|
|
422
|
-
* Capture is released with the Mount.
|
|
423
|
-
*
|
|
424
|
-
* Given `scrolls`, the element holds content that scrolls (a sheet's panel),
|
|
425
|
-
* and a touch is followed by touch events, whose move can still refuse the
|
|
426
|
-
* browser's scroll once the touch is under way, where a pointer's cannot:
|
|
427
|
-
* past the slop, a touch that runs along the axis and finds nothing under it
|
|
428
|
-
* that can scroll further its way swipes, and the browser scrolls any other.
|
|
429
|
-
* A touch inside an element with a Swipe of its own (a handle in the panel)
|
|
430
|
-
* is that one's, and none starts on a field or on `data-no-swipe`
|
|
431
|
-
* (`NO_SWIPE`).
|
|
432
|
-
*/
|
|
433
|
-
export declare const Swipe: Mount.MountDefinitionWithArgs<"Swipe", {
|
|
434
|
-
/**
|
|
435
|
-
* The nearest ancestor matching this selector is measured as the swipe
|
|
436
|
-
* starts, for what the swipe moves (a sheet's panel, dragged by its
|
|
437
|
-
* handle). Default: the element itself.
|
|
438
|
-
*/
|
|
439
|
-
measure: Schema.optional<Schema.String>;
|
|
440
|
-
/**
|
|
441
|
-
* How far, in pixels, a press must move before it is a swipe. Until
|
|
442
|
-
* then nothing is captured or reported, so a press that stays put is
|
|
443
|
-
* still a click on whatever is under it (a tab inside a drag grip).
|
|
444
|
-
* Default 0: the press itself starts the swipe; with `scrolls`, the
|
|
445
|
-
* first move decides.
|
|
446
|
-
*/
|
|
447
|
-
slop: Schema.optional<Schema.Number>;
|
|
448
|
-
/** The axis the element's content scrolls along, which a touch yields to; see above. */
|
|
449
|
-
scrolls: Schema.optional<Schema.Literals<readonly ["x", "y"]>>;
|
|
450
|
-
/** Follows touches alone: a mouse or a pen is left to the page (and to a handle's own Swipe). */
|
|
451
|
-
touchOnly: Schema.optional<Schema.Boolean>;
|
|
452
|
-
}, {
|
|
453
|
-
readonly _tag: "SwipeStarted";
|
|
454
|
-
readonly pointerId: number;
|
|
455
|
-
readonly pointerType: string;
|
|
456
|
-
readonly width: number;
|
|
457
|
-
readonly height: number;
|
|
458
|
-
} | {
|
|
459
|
-
readonly _tag: "Swiped";
|
|
460
|
-
readonly pointerId: number;
|
|
461
|
-
readonly deltaX: number;
|
|
462
|
-
readonly deltaY: number;
|
|
463
|
-
} | {
|
|
464
|
-
readonly _tag: "SwipeEnded";
|
|
465
|
-
readonly pointerId: number;
|
|
466
|
-
readonly deltaX: number;
|
|
467
|
-
readonly deltaY: number;
|
|
468
|
-
readonly velocityX: number;
|
|
469
|
-
readonly velocityY: number;
|
|
470
|
-
readonly completed: boolean;
|
|
471
|
-
}>;
|
|
472
|
-
export declare const ScrollSettled: Schema.TaggedStruct<"ScrollSettled", {
|
|
473
|
-
/** The item whose start lies nearest the scroller's start, from 0. */
|
|
474
|
-
readonly index: Schema.Number;
|
|
475
|
-
}>;
|
|
476
|
-
export type ScrollSettled = typeof ScrollSettled.Type;
|
|
477
|
-
/** How long a scroll must be still to count as settled, where `scrollend` is missing. */
|
|
478
|
-
export declare const SETTLE_QUIET = 120;
|
|
479
|
-
/**
|
|
480
|
-
* Hears a scroller come to rest, as a Mount: after a swipe, a fling, a
|
|
481
|
-
* trackpad or a scroll a Command made, it reports which of its items starts
|
|
482
|
-
* nearest its own start (inside its `scroll-padding`), the start being the
|
|
483
|
-
* right edge right to left. A snapping carousel reads it as the slide shown.
|
|
484
|
-
*
|
|
485
|
-
* At insert it first scrolls, at once, to item `start` (the Mount's args are
|
|
486
|
-
* read only then, so this is where a redrawn or restored scroller begins),
|
|
487
|
-
* and reports where it lies, since a scroller drawn already at rest sends no
|
|
488
|
-
* `scrollend`. It listens for `scrollend` where the browser has it, and
|
|
489
|
-
* otherwise for a scroll that is quiet for `SETTLE_QUIET` milliseconds.
|
|
490
|
-
*/
|
|
491
|
-
export declare const ScrollSettle: Mount.MountDefinitionWithArgs<"ScrollSettle", {
|
|
492
|
-
/** Which children are the items; default every child. */
|
|
493
|
-
item: Schema.optional<Schema.String>;
|
|
494
|
-
/** Default `inline`, the row a carousel scrolls along. */
|
|
495
|
-
axis: Schema.optional<Schema.Literals<readonly ["inline", "block"]>>;
|
|
496
|
-
/** The item to scroll to at insert; default the first, which needs no scroll. */
|
|
497
|
-
start: Schema.optional<Schema.Number>;
|
|
498
|
-
}, {
|
|
499
|
-
readonly _tag: "ScrollSettled";
|
|
500
|
-
readonly index: number;
|
|
501
|
-
}>;
|
|
502
|
-
/**
|
|
503
|
-
* A place in an element's padding box, in CSS pixels from its top left
|
|
504
|
-
* corner, and the pointer's pressure there (0 to 1; a mouse reads 0.5 while
|
|
505
|
-
* a button is down). A captured pointer can be outside the box, so `x` and
|
|
506
|
-
* `y` can be negative or past its size.
|
|
507
|
-
*/
|
|
508
|
-
export declare const PointerPoint: Schema.Struct<{
|
|
509
|
-
readonly x: Schema.Number;
|
|
510
|
-
readonly y: Schema.Number;
|
|
511
|
-
readonly pressure: Schema.Number;
|
|
512
|
-
}>;
|
|
513
|
-
export type PointerPoint = typeof PointerPoint.Type;
|
|
514
|
-
export declare const PointerPressed: Schema.TaggedStruct<"PointerPressed", {
|
|
515
|
-
readonly width: Schema.Number;
|
|
516
|
-
readonly height: Schema.Number;
|
|
517
|
-
readonly point: Schema.Struct<{
|
|
518
|
-
readonly x: Schema.Number;
|
|
519
|
-
readonly y: Schema.Number;
|
|
520
|
-
readonly pressure: Schema.Number;
|
|
521
|
-
}>;
|
|
522
|
-
/** `mouse`, `pen` or `touch`, as the browser names it. */
|
|
523
|
-
readonly pointerType: Schema.String;
|
|
524
|
-
}>;
|
|
525
|
-
export type PointerPressed = typeof PointerPressed.Type;
|
|
526
|
-
export declare const PointerMoved: Schema.TaggedStruct<"PointerMoved", {
|
|
527
|
-
readonly width: Schema.Number;
|
|
528
|
-
readonly height: Schema.Number;
|
|
529
|
-
/** Where the pointer is now. */
|
|
530
|
-
readonly point: Schema.Struct<{
|
|
531
|
-
readonly x: Schema.Number;
|
|
532
|
-
readonly y: Schema.Number;
|
|
533
|
-
readonly pressure: Schema.Number;
|
|
534
|
-
}>;
|
|
535
|
-
/**
|
|
536
|
-
* Every place it passed since the last move, ending with `point`: the
|
|
537
|
-
* browser's coalesced events, so a fast stroke keeps its curve. Just
|
|
538
|
-
* `point` where the browser coalesces none.
|
|
539
|
-
*/
|
|
540
|
-
readonly points: Schema.$Array<Schema.Struct<{
|
|
541
|
-
readonly x: Schema.Number;
|
|
542
|
-
readonly y: Schema.Number;
|
|
543
|
-
readonly pressure: Schema.Number;
|
|
544
|
-
}>>;
|
|
545
|
-
}>;
|
|
546
|
-
export type PointerMoved = typeof PointerMoved.Type;
|
|
547
|
-
export declare const PointerReleased: Schema.TaggedStruct<"PointerReleased", {
|
|
548
|
-
/** `false` when the pointer was cancelled, lost its capture, or pressed again unreleased. */
|
|
549
|
-
readonly completed: Schema.Boolean;
|
|
550
|
-
}>;
|
|
551
|
-
export type PointerReleased = typeof PointerReleased.Type;
|
|
552
|
-
export type PointerFact = PointerPressed | PointerMoved | PointerReleased;
|
|
553
|
-
interface Sides {
|
|
554
|
-
readonly top: number;
|
|
555
|
-
readonly right: number;
|
|
556
|
-
readonly bottom: number;
|
|
557
|
-
readonly left: number;
|
|
558
|
-
}
|
|
559
|
-
export interface Rect {
|
|
560
|
-
readonly left: number;
|
|
561
|
-
readonly top: number;
|
|
562
|
-
readonly width: number;
|
|
563
|
-
readonly height: number;
|
|
564
|
-
}
|
|
565
|
-
/**
|
|
566
|
-
* The padding box of an element whose border box is `rect`: inside its
|
|
567
|
-
* border, padding included. An absolutely positioned child (a thumb, a
|
|
568
|
-
* stroke) is laid out against it, so a place read here is where that child
|
|
569
|
-
* sits, whatever padding a stylist adds.
|
|
570
|
-
*/
|
|
571
|
-
export declare const paddingBoxOf: (layout: {
|
|
572
|
-
readonly rect: Rect;
|
|
573
|
-
readonly border: Sides;
|
|
574
|
-
}) => Rect;
|
|
575
|
-
/**
|
|
576
|
-
* An element's padding box now, in the viewport, as `PointerPosition`
|
|
577
|
-
* measures it: for a size kept beside its places, which a `ResizeObserver`'s
|
|
578
|
-
* content box does not match once the element has padding. Read from the
|
|
579
|
-
* bounding rectangle and the computed border, since `clientWidth` and
|
|
580
|
-
* `clientLeft` round to whole pixels.
|
|
581
|
-
*/
|
|
582
|
-
export declare const measurePaddingBox: (element: Element) => Rect;
|
|
583
|
-
/**
|
|
584
|
-
* Where one pointer is inside an element, as a Mount, for a surface the
|
|
585
|
-
* pointer draws on or points into (a color area, a dial, a signature pad): a
|
|
586
|
-
* primary press, each move until the release, and the release, each with
|
|
587
|
-
* the place in the element's padding box and the box's size. The box is
|
|
588
|
-
* measured at each event, so an element that moved or resized is followed.
|
|
589
|
-
* Coordinates are raw, left to right and top down whatever the direction:
|
|
590
|
-
* what a place means (a share, an angle, a reading direction) is the parent's.
|
|
591
|
-
*
|
|
592
|
-
* The pointer is captured from press to release, so a drag that leaves the
|
|
593
|
-
* element is still heard, and the moves and the release are listened to only
|
|
594
|
-
* meanwhile. A press keeps the browser's own focus and text selection away,
|
|
595
|
-
* and a second pointer while one is down is ignored.
|
|
596
|
-
*/
|
|
597
|
-
export declare const PointerPosition: Mount.MountDefinitionWithArgs<"PointerPosition", {
|
|
598
|
-
/**
|
|
599
|
-
* A descendant to focus on a press, found by this selector (a thumb), so
|
|
600
|
-
* the keys go on from where the pointer left it.
|
|
601
|
-
*/
|
|
602
|
-
focus: Schema.optionalKey<Schema.String>;
|
|
603
|
-
}, {
|
|
604
|
-
readonly _tag: "PointerPressed";
|
|
605
|
-
readonly width: number;
|
|
606
|
-
readonly height: number;
|
|
607
|
-
readonly point: {
|
|
608
|
-
readonly x: number;
|
|
609
|
-
readonly y: number;
|
|
610
|
-
readonly pressure: number;
|
|
611
|
-
};
|
|
612
|
-
readonly pointerType: string;
|
|
613
|
-
} | {
|
|
614
|
-
readonly _tag: "PointerMoved";
|
|
615
|
-
readonly width: number;
|
|
616
|
-
readonly height: number;
|
|
617
|
-
readonly point: {
|
|
618
|
-
readonly x: number;
|
|
619
|
-
readonly y: number;
|
|
620
|
-
readonly pressure: number;
|
|
621
|
-
};
|
|
622
|
-
readonly points: readonly {
|
|
623
|
-
readonly x: number;
|
|
624
|
-
readonly y: number;
|
|
625
|
-
readonly pressure: number;
|
|
626
|
-
}[];
|
|
627
|
-
} | {
|
|
628
|
-
readonly _tag: "PointerReleased";
|
|
629
|
-
readonly completed: boolean;
|
|
630
|
-
}>;
|
|
631
|
-
/** The attribute on the mounted element naming the element `TrackBox` follows, by id. */
|
|
632
|
-
export declare const TRACK_TARGET_ATTRIBUTE = "data-target";
|
|
633
|
-
/** The custom properties `TrackBox` writes for `name`, as `measured` names `Measure`'s. */
|
|
634
|
-
export declare const trackedBox: (name: string) => {
|
|
635
|
-
readonly x: `--fk-${string}-x`;
|
|
636
|
-
readonly y: `--fk-${string}-y`;
|
|
637
|
-
readonly w: `--fk-${string}-w`;
|
|
638
|
-
readonly h: `--fk-${string}-h`;
|
|
639
|
-
readonly radius: `--fk-${string}-radius`;
|
|
640
|
-
};
|
|
641
|
-
/** Sent as the followed element changes: its id, and whether it is on the page. */
|
|
642
|
-
export declare const TrackedTarget: Schema.TaggedStruct<"TrackedTarget", {
|
|
643
|
-
readonly target: Schema.String;
|
|
644
|
-
readonly found: Schema.Boolean;
|
|
645
|
-
}>;
|
|
646
|
-
export type TrackedTarget = typeof TrackedTarget.Type;
|
|
647
|
-
/**
|
|
648
|
-
* The radius a box of `width` by `height` draws for a computed
|
|
649
|
-
* `border-top-left-radius` of `value` (`8px`, `50%`, `8px 4px`): its
|
|
650
|
-
* horizontal length in pixels, a share of the width for a percentage, and
|
|
651
|
-
* never more than half the shorter side, where the browser stops it.
|
|
652
|
-
*/
|
|
653
|
-
export declare const cornerRadius: (value: string, width: number, height: number) => number;
|
|
654
|
-
/**
|
|
655
|
-
* Follows another element's box, as a Mount: the element whose id is the
|
|
656
|
-
* mounted element's `data-target` (`TRACK_TARGET_ATTRIBUTE`). Its box in
|
|
657
|
-
* viewport pixels is written on the mounted element as `--fk-<name>-x`,
|
|
658
|
-
* `-y`, `-w` and `-h`, and with `radius`, its top left corner's radius as
|
|
659
|
-
* `--fk-<name>-radius` (`cornerRadius`), so a fixed overlay drawn from them
|
|
660
|
-
* (a tour's cutout, a coach mark's ring) sits over it. While nothing is
|
|
661
|
-
* followed they are removed, so a stylist's fallbacks apply.
|
|
662
|
-
*
|
|
663
|
-
* The box is read again on a scroll anywhere (heard on the way down, since
|
|
664
|
-
* `scroll` does not bubble), a window resize, the followed element's own
|
|
665
|
-
* resize, and any change to the document's elements, which is also how a
|
|
666
|
-
* target drawn anew under the same id is found. `data-target` is read again
|
|
667
|
-
* whenever it changes, so one element can glide from target to target
|
|
668
|
-
* without being drawn again, which a Mount's args, read once, could not do.
|
|
669
|
-
* What moves the target by any other way (a stylesheet added) is seen at the
|
|
670
|
-
* next of these.
|
|
671
|
-
*
|
|
672
|
-
* Whether a target is on the page is the parent's to act on (a tour shows
|
|
673
|
-
* the step in the middle instead), so each change of the target or of
|
|
674
|
-
* whether it is found sends `TrackedTarget`, starting with the first one.
|
|
675
|
-
* Since it sends a Message, a component may draw it by default: a Scene test
|
|
676
|
-
* resolves it with what the parent maps it to. An empty `data-target` follows
|
|
677
|
-
* nothing and sends nothing.
|
|
678
|
-
*/
|
|
679
|
-
export declare const TrackBox: Mount.MountDefinitionWithArgs<"TrackBox", {
|
|
680
|
-
/** The custom properties' prefix: `tour` writes `--fk-tour-x`. */
|
|
681
|
-
name: Schema.String;
|
|
682
|
-
/** Whether to write the target's corner radius too; it reads the target's computed style. */
|
|
683
|
-
radius: Schema.optional<Schema.Boolean>;
|
|
684
|
-
}, {
|
|
685
|
-
readonly _tag: "TrackedTarget";
|
|
686
|
-
readonly target: string;
|
|
687
|
-
readonly found: boolean;
|
|
688
|
-
}>;
|
|
689
|
-
export declare const ImageDecodeMessage: import("foldkit/message").MessageUnion<{
|
|
690
|
-
readonly Decoded: {
|
|
691
|
-
src: Schema.String;
|
|
692
|
-
};
|
|
693
|
-
readonly DecodeFailed: {
|
|
694
|
-
src: Schema.String;
|
|
695
|
-
message: Schema.String;
|
|
696
|
-
};
|
|
697
|
-
}>;
|
|
698
|
-
export type ImageDecodeMessage = typeof ImageDecodeMessage.Type;
|
|
699
|
-
/** What to decode: a URL, or an `img`'s candidates, so the browser decodes the one it would draw. */
|
|
700
|
-
export interface ImageSource {
|
|
701
|
-
readonly src: string;
|
|
702
|
-
readonly srcset?: string | undefined;
|
|
703
|
-
readonly sizes?: string | undefined;
|
|
704
|
-
}
|
|
705
|
-
/**
|
|
706
|
-
* Fetches and decodes `source` (`img.decode()`), yielding `Decoded` once it
|
|
707
|
-
* can be painted at once, or `DecodeFailed` when it cannot be fetched or read,
|
|
708
|
-
* or there is no document (a server render). Given `srcset` and `sizes`, as
|
|
709
|
-
* `foldkit-media`'s `Picture.Img` has them, the browser picks the candidate
|
|
710
|
-
* it would draw, so the decoded file is the one shown.
|
|
711
|
-
*/
|
|
712
|
-
export declare const decodeImage: (source: ImageSource) => Command<ImageDecodeMessage, never, never>;
|
|
713
|
-
export { DRAG_THRESHOLD, DragCancelled, DragDropped, DragFact, DragPlace, DragStarted, DragZone, DraggedOver, EditAsked, EditableText, Fact, FocusScope, HOLD_SLOP, HOLD_TO_DRAG_MS, HideOutside, Move, MoveEnded, MoveStarted, Moved, PointerDrag, ScrollLock, TargetFact, TargetHovered, TargetPressed, Targets, TextCancelled, TextCommitted, TextEdited, TextFact, boxOf, tabbableWithin, targetOf, textOf, zoneOf };
|
|
714
|
-
//# sourceMappingURL=index.d.mts.map
|