@synopackageland/ui 0.23.3 → 0.23.5
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/CHANGELOG.md +22 -0
- package/dist/components/app/app-layout/hideOnScroll.d.ts +27 -14
- package/dist/index.d.ts +2 -2
- package/dist/index.js +13098 -12922
- package/dist/interaction/index.d.ts +1 -0
- package/dist/interaction/velocity.d.ts +65 -0
- package/dist/json-preview/preview.js +9320 -9161
- package/dist/lib/scroll.d.ts +6 -2
- package/dist/reka-runtime.json +1 -1
- package/dist/theme.css +1 -1
- package/dist/themes/dsm7-embedded-reset.css +1 -1
- package/dist/themes/dsm7-embedded-theme.css +1 -1
- package/dist/themes/dsm7-embedded.css +1 -1
- package/dist/themes/dsm7.css +1 -1
- package/docs/mobile-native.md +174 -18
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { IGNORE_OUTSIDE_ATTR, IGNORE_OUTSIDE_SELECTOR, outsideLayerCount, registerOutsideLayer, swallowNextClick, type OutsideLayer, type OutsideLayerOptions, type OutsideResult, } from './outside';
|
|
2
2
|
export { COMPOSITION_END_GRACE_MS, createCompositionGuard, isComposingKey, isPrintableKey, type CompositionGuard, } from './ime';
|
|
3
3
|
export { DRAG_THRESHOLD_PX, dropIndexAt, trackPointerGesture, type GestureAxis, type GestureCancelReason, type PointerGesture, type PointerGestureOptions, type PointerGestureState, } from './gesture';
|
|
4
|
+
export { GESTURE_THRESHOLDS, swipeCommits, VELOCITY_MAX_SAMPLES, VELOCITY_REVERSAL_PX, VELOCITY_WINDOW_MS, VelocityEstimator, velocityDuration, type VelocitySample, } from './velocity';
|
|
4
5
|
export { DIALOG_SELECTOR, createFocusOwner, focusSync, isInForeignDialog, pathInForeignDialog, type FocusOwner, } from './focus';
|
|
5
6
|
export { createEditSession, editSessionOutside, type EditCommitResult, type EditSession, type EditSessionOptions, type EditSessionState, } from './editSession';
|
|
6
7
|
export { useEditSession, useOutsideLayer, usePointerGesture } from './vue';
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/** How far back samples count, in ms. */
|
|
2
|
+
export declare const VELOCITY_WINDOW_MS = 100;
|
|
3
|
+
/** At most this many samples are kept (a burst of coalesced events cannot dominate). */
|
|
4
|
+
export declare const VELOCITY_MAX_SAMPLES = 20;
|
|
5
|
+
/** A movement smaller than this (CSS px) is not a change of direction. */
|
|
6
|
+
export declare const VELOCITY_REVERSAL_PX = 0.5;
|
|
7
|
+
/**
|
|
8
|
+
* The thresholds every gesture decision uses, in CSS px and px/s.
|
|
9
|
+
* - `flick`: a decisive flick (hide or show the phone bars at once).
|
|
10
|
+
* - `swipe`: a swipe that commits however short it was (pop a pushed page,
|
|
11
|
+
* move to the next image), once it has moved past `slop`.
|
|
12
|
+
* - `swipeDistance`: a swipe that commits however slow it was (the next
|
|
13
|
+
* image in a lightbox).
|
|
14
|
+
* - `hideDistance` / `showDistance`: a slow scroll hides the bars after this
|
|
15
|
+
* much travel down and shows them after this much up (hysteresis, so a
|
|
16
|
+
* slow or wobbly drag does not flicker them).
|
|
17
|
+
* - `slop`: travel before a touch counts as a gesture with a direction.
|
|
18
|
+
*/
|
|
19
|
+
export declare const GESTURE_THRESHOLDS: Readonly<{
|
|
20
|
+
flick: 1000;
|
|
21
|
+
swipe: 500;
|
|
22
|
+
swipeDistance: 48;
|
|
23
|
+
hideDistance: 48;
|
|
24
|
+
showDistance: 24;
|
|
25
|
+
slop: 6;
|
|
26
|
+
}>;
|
|
27
|
+
export interface VelocitySample {
|
|
28
|
+
/** Position along one axis in CSS px (scrollTop, clientX, clientY). */
|
|
29
|
+
position: number;
|
|
30
|
+
/** Timestamp in ms (event.timeStamp or performance.now()). */
|
|
31
|
+
time: number;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Velocity along one axis from a least-squares line through the samples of
|
|
35
|
+
* the last {@link VELOCITY_WINDOW_MS}. A reversal starts a new fit from the
|
|
36
|
+
* turning point, a gap longer than the window starts over, and a fit older
|
|
37
|
+
* than the window reads 0 (the finger or the scroll has stopped). Out-of-order
|
|
38
|
+
* samples are ignored; a sample with the same timestamp replaces the last.
|
|
39
|
+
*/
|
|
40
|
+
export declare class VelocityEstimator {
|
|
41
|
+
private samples;
|
|
42
|
+
private direction;
|
|
43
|
+
/** Add a sample; returns the velocity (px/s) at its time. */
|
|
44
|
+
add(position: number, time: number): number;
|
|
45
|
+
/** Velocity in px/s at `now` (the newest sample's time when omitted); 0 when stale or unknown. */
|
|
46
|
+
velocity(now?: number): number;
|
|
47
|
+
/** The samples in the fit, oldest first (for tests and diagnostics). */
|
|
48
|
+
get size(): number;
|
|
49
|
+
/** Forget everything: a new gesture. */
|
|
50
|
+
reset(): void;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* A motion's duration scaled to the gesture that set it off: a flick at
|
|
54
|
+
* {@link GESTURE_THRESHOLDS}.flick or faster finishes in 60% of `baseMs`
|
|
55
|
+
* (never under 120ms), anything slower takes `baseMs`. Reduced motion is
|
|
56
|
+
* the stylesheet's (motion.css finishes every transition at once).
|
|
57
|
+
*/
|
|
58
|
+
export declare function velocityDuration(velocity: number, baseMs: number): number;
|
|
59
|
+
/**
|
|
60
|
+
* Whether a released swipe commits: past `distance` (px) in its direction, or
|
|
61
|
+
* past the slop and at least {@link GESTURE_THRESHOLDS}.swipe px/s that way.
|
|
62
|
+
* `travel` and `velocity` are signed along the swipe's direction (positive
|
|
63
|
+
* means toward committing).
|
|
64
|
+
*/
|
|
65
|
+
export declare function swipeCommits(travel: number, velocity: number, distance: number): boolean;
|