@oxyhq/bloom 0.54.0 → 0.55.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/lib/commonjs/tab-bar/TabBarBase.js +101 -16
- package/lib/commonjs/tab-bar/TabBarBase.js.map +1 -1
- package/lib/commonjs/tab-bar/shared.js +15 -1
- package/lib/commonjs/tab-bar/shared.js.map +1 -1
- package/lib/commonjs/toast/ToastRow.js +35 -10
- package/lib/commonjs/toast/ToastRow.js.map +1 -1
- package/lib/commonjs/toast/ToastSwipeHandler.js +15 -5
- package/lib/commonjs/toast/ToastSwipeHandler.js.map +1 -1
- package/lib/commonjs/toast/constants.js +18 -1
- package/lib/commonjs/toast/constants.js.map +1 -1
- package/lib/commonjs/toast/toast-store.js +39 -1
- package/lib/commonjs/toast/toast-store.js.map +1 -1
- package/lib/commonjs/toast/use-stack-hover.js +175 -0
- package/lib/commonjs/toast/use-stack-hover.js.map +1 -0
- package/lib/commonjs/toast/use-stack-hover.native.js +42 -0
- package/lib/commonjs/toast/use-stack-hover.native.js.map +1 -0
- package/lib/module/tab-bar/TabBarBase.js +103 -18
- package/lib/module/tab-bar/TabBarBase.js.map +1 -1
- package/lib/module/tab-bar/shared.js +14 -0
- package/lib/module/tab-bar/shared.js.map +1 -1
- package/lib/module/toast/ToastRow.js +35 -10
- package/lib/module/toast/ToastRow.js.map +1 -1
- package/lib/module/toast/ToastSwipeHandler.js +16 -4
- package/lib/module/toast/ToastSwipeHandler.js.map +1 -1
- package/lib/module/toast/constants.js +18 -1
- package/lib/module/toast/constants.js.map +1 -1
- package/lib/module/toast/toast-store.js +39 -1
- package/lib/module/toast/toast-store.js.map +1 -1
- package/lib/module/toast/use-stack-hover.js +168 -0
- package/lib/module/toast/use-stack-hover.js.map +1 -0
- package/lib/module/toast/use-stack-hover.native.js +35 -0
- package/lib/module/toast/use-stack-hover.native.js.map +1 -0
- package/lib/typescript/commonjs/tab-bar/TabBarBase.d.ts.map +1 -1
- package/lib/typescript/commonjs/tab-bar/shared.d.ts +13 -0
- package/lib/typescript/commonjs/tab-bar/shared.d.ts.map +1 -1
- package/lib/typescript/commonjs/tab-bar/types.d.ts +12 -0
- package/lib/typescript/commonjs/tab-bar/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/toast/ToastRow.d.ts.map +1 -1
- package/lib/typescript/commonjs/toast/ToastSwipeHandler.d.ts +4 -0
- package/lib/typescript/commonjs/toast/ToastSwipeHandler.d.ts.map +1 -1
- package/lib/typescript/commonjs/toast/constants.d.ts.map +1 -1
- package/lib/typescript/commonjs/toast/toast-store.d.ts +15 -0
- package/lib/typescript/commonjs/toast/toast-store.d.ts.map +1 -1
- package/lib/typescript/commonjs/toast/use-stack-hover.d.ts +55 -0
- package/lib/typescript/commonjs/toast/use-stack-hover.d.ts.map +1 -0
- package/lib/typescript/commonjs/toast/use-stack-hover.native.d.ts +26 -0
- package/lib/typescript/commonjs/toast/use-stack-hover.native.d.ts.map +1 -0
- package/lib/typescript/module/tab-bar/TabBarBase.d.ts.map +1 -1
- package/lib/typescript/module/tab-bar/shared.d.ts +13 -0
- package/lib/typescript/module/tab-bar/shared.d.ts.map +1 -1
- package/lib/typescript/module/tab-bar/types.d.ts +12 -0
- package/lib/typescript/module/tab-bar/types.d.ts.map +1 -1
- package/lib/typescript/module/toast/ToastRow.d.ts.map +1 -1
- package/lib/typescript/module/toast/ToastSwipeHandler.d.ts +4 -0
- package/lib/typescript/module/toast/ToastSwipeHandler.d.ts.map +1 -1
- package/lib/typescript/module/toast/constants.d.ts.map +1 -1
- package/lib/typescript/module/toast/toast-store.d.ts +15 -0
- package/lib/typescript/module/toast/toast-store.d.ts.map +1 -1
- package/lib/typescript/module/toast/use-stack-hover.d.ts +55 -0
- package/lib/typescript/module/toast/use-stack-hover.d.ts.map +1 -0
- package/lib/typescript/module/toast/use-stack-hover.native.d.ts +26 -0
- package/lib/typescript/module/toast/use-stack-hover.native.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/__tests__/TabBarNoSelection.test.tsx +458 -0
- package/src/__tests__/TabBarReanimatedDeps.test.ts +28 -4
- package/src/__tests__/Toaster.test.tsx +554 -0
- package/src/__tests__/animated-style-deps.test.ts +30 -6
- package/src/__tests__/toast-position-utils.test.ts +28 -0
- package/src/__tests__/toast-stack-hover.test.ts +92 -0
- package/src/__tests__/toast-store.test.ts +72 -0
- package/src/tab-bar/TabBar.stories.tsx +52 -1
- package/src/tab-bar/TabBarBase.tsx +113 -31
- package/src/tab-bar/shared.ts +12 -0
- package/src/tab-bar/types.ts +12 -0
- package/src/toast/Toast.stories.tsx +10 -0
- package/src/toast/ToastRow.tsx +33 -10
- package/src/toast/ToastSwipeHandler.tsx +14 -2
- package/src/toast/constants.ts +18 -1
- package/src/toast/toast-store.ts +39 -1
- package/src/toast/use-stack-hover.native.ts +34 -0
- package/src/toast/use-stack-hover.ts +182 -0
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Bloom-original — WEB/default. `use-stack-hover.native.ts` is the native no-op,
|
|
5
|
+
* filename-resolved by Metro exactly as `ToastHost.native.tsx` is, so `toast/`
|
|
6
|
+
* stays one universal engine with no `index.web` fork.
|
|
7
|
+
*
|
|
8
|
+
* sonner expands its stack on HOVER; sonner-native only has press, because a phone
|
|
9
|
+
* has no pointer. Bloom needs both: press is the touch and native affordance, hover
|
|
10
|
+
* is what a desktop user expects, and a touch-capable web device must not get a
|
|
11
|
+
* phantom hover from its own taps.
|
|
12
|
+
*
|
|
13
|
+
* THIS IS A TRIGGER, NOT A SECOND MECHANISM. It drives the store's existing
|
|
14
|
+
* `expand`/`collapse`, which already pause and resume the auto-close timers
|
|
15
|
+
* (`ToastStore.expand` calls `timers.pauseAll()`, `collapse` calls `resumeAll()`),
|
|
16
|
+
* so hovering to read a toast cannot let it expire under the cursor — no new
|
|
17
|
+
* pausing path, no new store state. With stacking OFF there is nothing to expand,
|
|
18
|
+
* so the pointer pauses the timers directly instead: the reason sonner pauses is
|
|
19
|
+
* that the pointer is over the toast, which has nothing to do with stacking.
|
|
20
|
+
*
|
|
21
|
+
* TWO THINGS ARE LOAD-BEARING:
|
|
22
|
+
*
|
|
23
|
+
* - `pointerType === 'mouse'`. Touch fires `pointerenter` before `pointerdown`
|
|
24
|
+
* and `pointerleave` after `pointerup` (the pointer ceases to exist), so
|
|
25
|
+
* without this guard every TAP on a touch-capable web device would expand then
|
|
26
|
+
* collapse the stack while the press toggle fired too — three handlers fighting
|
|
27
|
+
* over one tap. Hover is additive: pens and touch fall through to press.
|
|
28
|
+
* - THE LEAVE IS DEFERRED BY A FRAME-ISH GRACE PERIOD, and any enter cancels it.
|
|
29
|
+
* Rows are separate absolutely-positioned boxes with `gap` between them once
|
|
30
|
+
* expanded, so moving the pointer from one row to the next leaves the first
|
|
31
|
+
* before entering the second. Collapsing on that would snap the stack shut and
|
|
32
|
+
* reopen it on whatever row ends up under the pointer — a jitter loop, plus a
|
|
33
|
+
* resume/pause pair per crossing that re-banks each timer's remaining time.
|
|
34
|
+
*
|
|
35
|
+
* The state is module-level on purpose: there is ONE stack per document, the same
|
|
36
|
+
* reason `toastStore` is a module singleton. It is written and read only inside
|
|
37
|
+
* event handlers — never in render — so the React Compiler has nothing to freeze.
|
|
38
|
+
*/
|
|
39
|
+
import { useMemo } from 'react';
|
|
40
|
+
import { toastStore } from "./toast-store.js";
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* How long a leave waits for a neighbouring row to claim the pointer. One frame is
|
|
44
|
+
* enough for the same-tick leave/enter pair a row crossing produces; this is a
|
|
45
|
+
* little more so a slow frame cannot flash the stack shut. Exported so the suite
|
|
46
|
+
* asserts against the real value rather than a copy of it.
|
|
47
|
+
*/
|
|
48
|
+
export const HOVER_LEAVE_GRACE = 80;
|
|
49
|
+
|
|
50
|
+
/** The portal root every toast row lives under — see `portal/index.web.tsx`. */
|
|
51
|
+
const PORTAL_ROOT_ID = 'bloom-portal-root';
|
|
52
|
+
let hovered = false;
|
|
53
|
+
let leaveTimeout = null;
|
|
54
|
+
const isMouse = event => event.nativeEvent.pointerType === 'mouse';
|
|
55
|
+
const cancelPendingLeave = () => {
|
|
56
|
+
if (leaveTimeout !== null) {
|
|
57
|
+
clearTimeout(leaveTimeout);
|
|
58
|
+
leaveTimeout = null;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Whether the pointer is over the stack RIGHT NOW.
|
|
64
|
+
*
|
|
65
|
+
* Two sources, and both are load-bearing:
|
|
66
|
+
*
|
|
67
|
+
* - the `hovered` latch answers "a mouse entered and has not left", which is the
|
|
68
|
+
* only thing available where there is no DOM (jest runs on `testEnvironment:
|
|
69
|
+
* 'node'`), and is a cheap early-out.
|
|
70
|
+
* - the live `:hover` query answers "a row is under the pointer", which the latch
|
|
71
|
+
* CANNOT: a row can stop being hovered with no event whatsoever. Measured — a row
|
|
72
|
+
* culled by `visibleToasts` under a stationary cursor fires no `pointerleave`,
|
|
73
|
+
* `pointerout` or `mouseleave` at all, and the restack then slides the remaining
|
|
74
|
+
* rows out from under the pointer. A latch alone therefore sticks TRUE, which
|
|
75
|
+
* would disable the press toggle for the rest of the session and suppress every
|
|
76
|
+
* later auto-collapse.
|
|
77
|
+
*
|
|
78
|
+
* Requiring both means a stale latch is corrected by the DOM and a stray DOM match
|
|
79
|
+
* (a pen, a touch) is rejected by the latch.
|
|
80
|
+
*
|
|
81
|
+
* COVERAGE, stated plainly: jest cannot see the DOM half at all
|
|
82
|
+
* (`testEnvironment: 'node'`), and a browser cannot isolate it either — its two
|
|
83
|
+
* consequences are a press toggle standing down (unreachable with a mouse, which
|
|
84
|
+
* always hovers what it presses) and a suppressed auto-collapse (which the deferred
|
|
85
|
+
* leave below independently corrects the moment any boundary event fires). Both
|
|
86
|
+
* halves are kept because each is measurably more accurate than the other alone, not
|
|
87
|
+
* because a test proves the composite.
|
|
88
|
+
*
|
|
89
|
+
* `ToastRow` asks so a press does not TOGGLE what hover already opened, and
|
|
90
|
+
* `toastStore` asks before auto-collapsing a stack down to its last row. The press
|
|
91
|
+
* still runs the toast's own `onPress`; only the expansion toggle steps aside.
|
|
92
|
+
*/
|
|
93
|
+
export function isStackHovered() {
|
|
94
|
+
return hovered && rowUnderPointer() !== false;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* The live DOM answer, or `undefined` where there is no DOM to ask (jest runs on
|
|
99
|
+
* `testEnvironment: 'node'`). Deliberately tri-state: "unknowable" and "no" must not
|
|
100
|
+
* collapse into the same value, because the two callers want opposite defaults —
|
|
101
|
+
* `isStackHovered` trusts the latch when it cannot check, while the deferred leave
|
|
102
|
+
* only stands down on a positive "yes, still hovered".
|
|
103
|
+
*/
|
|
104
|
+
function rowUnderPointer() {
|
|
105
|
+
if (typeof document === 'undefined') {
|
|
106
|
+
return undefined;
|
|
107
|
+
}
|
|
108
|
+
return document.querySelector(`#${PORTAL_ROOT_ID} [aria-live]:hover`) !== null;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* A pointer resting on the stack HOLDS it open, so the store must not auto-collapse
|
|
113
|
+
* it out from under the cursor. Registered here rather than passed in because this
|
|
114
|
+
* file is the one that knows what hovering means; the store only knows that
|
|
115
|
+
* something says "not yet". Native's fork registers nothing.
|
|
116
|
+
*/
|
|
117
|
+
toastStore.setExpansionHold(isStackHovered);
|
|
118
|
+
export function useStackHover({
|
|
119
|
+
enableStacking
|
|
120
|
+
}) {
|
|
121
|
+
// Stable per outlet configuration: these land on the row box as props, and every
|
|
122
|
+
// row re-renders on each stack change.
|
|
123
|
+
return useMemo(() => ({
|
|
124
|
+
onPointerEnter: event => {
|
|
125
|
+
if (!isMouse(event)) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
cancelPendingLeave();
|
|
129
|
+
hovered = true;
|
|
130
|
+
if (enableStacking) {
|
|
131
|
+
// Pauses the timers as part of expanding.
|
|
132
|
+
toastStore.expand();
|
|
133
|
+
} else {
|
|
134
|
+
toastStore.pauseAllTimers();
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
onPointerLeave: event => {
|
|
138
|
+
if (!isMouse(event) || !hovered) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
cancelPendingLeave();
|
|
142
|
+
leaveTimeout = setTimeout(() => {
|
|
143
|
+
leaveTimeout = null;
|
|
144
|
+
// The rows may have moved rather than the pointer: an expand, a collapse
|
|
145
|
+
// or a restack slides them under a stationary cursor without firing a
|
|
146
|
+
// single pointer event, so re-ask the DOM before acting on a leave that
|
|
147
|
+
// fired 80ms ago. Only a positive "still hovered" stands the collapse down.
|
|
148
|
+
if (rowUnderPointer() === true) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
hovered = false;
|
|
152
|
+
if (enableStacking) {
|
|
153
|
+
// Resumes the timers as part of collapsing.
|
|
154
|
+
toastStore.collapse();
|
|
155
|
+
} else {
|
|
156
|
+
toastStore.resumeAllTimers();
|
|
157
|
+
}
|
|
158
|
+
}, HOVER_LEAVE_GRACE);
|
|
159
|
+
}
|
|
160
|
+
}), [enableStacking]);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/** Test-only reset: the module state outlives a render tree, so a suite must clear it. */
|
|
164
|
+
export function resetStackHoverForTests() {
|
|
165
|
+
cancelPendingLeave();
|
|
166
|
+
hovered = false;
|
|
167
|
+
}
|
|
168
|
+
//# sourceMappingURL=use-stack-hover.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useMemo","toastStore","HOVER_LEAVE_GRACE","PORTAL_ROOT_ID","hovered","leaveTimeout","isMouse","event","nativeEvent","pointerType","cancelPendingLeave","clearTimeout","isStackHovered","rowUnderPointer","document","undefined","querySelector","setExpansionHold","useStackHover","enableStacking","onPointerEnter","expand","pauseAllTimers","onPointerLeave","setTimeout","collapse","resumeAllTimers","resetStackHoverForTests"],"sourceRoot":"../../../src","sources":["toast/use-stack-hover.ts"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Bloom-original — NATIVE. Metro resolves this over `use-stack-hover.ts` on iOS and
|
|
5
|
+
* Android, the same filename split `ToastHost.native.tsx` uses.
|
|
6
|
+
*
|
|
7
|
+
* Native keeps PRESS as the only way to expand a stack, so this hands back no
|
|
8
|
+
* handlers at all. Two reasons it is a fork rather than a runtime `Platform` check:
|
|
9
|
+
* the web file's module-level hover state and its `setTimeout` have no business
|
|
10
|
+
* existing in a native bundle, and `onPointerEnter`/`onPointerLeave` DO fire on
|
|
11
|
+
* native for touch (RN's pointer events unify touch and mouse), which would make
|
|
12
|
+
* every tap expand-then-collapse while the press toggle fired as well.
|
|
13
|
+
*
|
|
14
|
+
* Keep the shape identical to the web file — `ToastSwipeHandler` spreads whatever
|
|
15
|
+
* this returns onto the row box, and `ToastRow` calls `isStackHovered()`
|
|
16
|
+
* unconditionally.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/** Parity with the web file's export; nothing here waits for anything. */
|
|
20
|
+
export const HOVER_LEAVE_GRACE = 0;
|
|
21
|
+
|
|
22
|
+
/** Nothing hovers on a touch screen. */
|
|
23
|
+
export function isStackHovered() {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** One frozen object, so spreading it never changes the row box's props. */
|
|
28
|
+
const NO_HOVER_PROPS = Object.freeze({});
|
|
29
|
+
export function useStackHover(_options) {
|
|
30
|
+
return NO_HOVER_PROPS;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** Parity with the web file so the shared suite can call it on either platform. */
|
|
34
|
+
export function resetStackHoverForTests() {}
|
|
35
|
+
//# sourceMappingURL=use-stack-hover.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["HOVER_LEAVE_GRACE","isStackHovered","NO_HOVER_PROPS","Object","freeze","useStackHover","_options","resetStackHoverForTests"],"sourceRoot":"../../../src","sources":["toast/use-stack-hover.native.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA,OAAO,MAAMA,iBAAiB,GAAG,CAAC;;AAElC;AACA,OAAO,SAASC,cAAcA,CAAA,EAAY;EACxC,OAAO,KAAK;AACd;;AAEA;AACA,MAAMC,cAA+B,GAAGC,MAAM,CAACC,MAAM,CAAC,CAAC,CAAC,CAAC;AAEzD,OAAO,SAASC,aAAaA,CAACC,QAAqC,EAAmB;EACpF,OAAOJ,cAAc;AACvB;;AAEA;AACA,OAAO,SAASK,uBAAuBA,CAAA,EAAS,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabBarBase.d.ts","sourceRoot":"","sources":["../../../../src/tab-bar/TabBarBase.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAOL,KAAK,aAAa,EACnB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TabBarBase.d.ts","sourceRoot":"","sources":["../../../../src/tab-bar/TabBarBase.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAOL,KAAK,aAAa,EACnB,MAAM,OAAO,CAAC;AAiBf,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEtE,OAAO,EAkBL,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACxB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAe,MAAM,SAAS,CAAC;AA4iB3E;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,aAAa,CAAC,kBAAkB,CAAC,EAC1C,IAAI,EAAE,aAAa,CAAC,oBAAoB,CAAC;YAElB,WAAW;;EAGnC;AAED,+EAA+E;AAC/E,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,aAAa,CAAC,gBAAgB,CAAC;YAC1C,iBAAiB;;EAG/C"}
|
|
@@ -44,6 +44,19 @@ export declare const SLIDE_SPRING: {
|
|
|
44
44
|
duration: number;
|
|
45
45
|
dampingRatio: number;
|
|
46
46
|
};
|
|
47
|
+
/**
|
|
48
|
+
* Fade for the highlight coming and going when the selection does — an
|
|
49
|
+
* `activeIndex` that names no tab (see `TabBarProps.activeIndex`).
|
|
50
|
+
*
|
|
51
|
+
* A timing, not a spring, and deliberately shorter than {@link SLIDE_SPRING}:
|
|
52
|
+
* appearing and disappearing is a change of STATE, not a movement, so it must
|
|
53
|
+
* not read as a second animation racing the slide. The capsule fades where it
|
|
54
|
+
* stands — moving it out of view instead would drag it the length of the bar on
|
|
55
|
+
* its way out and sweep the active tint across every tab it passed.
|
|
56
|
+
*/
|
|
57
|
+
export declare const HIGHLIGHT_FADE: {
|
|
58
|
+
duration: number;
|
|
59
|
+
};
|
|
47
60
|
/**
|
|
48
61
|
* How long a press must be held before `onIndexLongPress` fires.
|
|
49
62
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../src/tab-bar/shared.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAG7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAWvD,eAAO,MAAM,eAAe,KAAK,CAAC;AAClC,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,4EAA4E;AAC5E,eAAO,MAAM,eAAe,KAAK,CAAC;AAClC,qEAAqE;AACrE,eAAO,MAAM,UAAU,KAAK,CAAC;AAC7B,8DAA8D;AAC9D,eAAO,MAAM,SAAS,IAAI,CAAC;AAC3B,eAAO,MAAM,YAAY,KAAK,CAAC;AAC/B,eAAO,MAAM,SAAS,KAAK,CAAC;AAC5B;;;GAGG;AACH,eAAO,MAAM,QAAQ,IAAI,CAAC;AAC1B,eAAO,MAAM,WAAW,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,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG,WAAW,CAe5E;AAaD,MAAM,WAAW,kBAAkB;IACjC,yEAAyE;IACzE,KAAK,EAAE,WAAW,CAAC;IACnB;;;;;;;;;;;;OAYG;IACH,KAAK,EAAE,SAAS,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC;CAC5C;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,UAAU,CAAC;IACjB,4EAA4E;IAC5E,IAAI,EAAE,MAAM,CAAC;IACb,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;OAMG;IACH,MAAM,EAAE,OAAO,CAAC;CACjB"}
|
|
@@ -75,6 +75,18 @@ export type TabBarProps = ViewProps & {
|
|
|
75
75
|
* highlight and springs it here whenever this changes. Use this when there is
|
|
76
76
|
* no router in play; the router adapter uses the per-button `isFocused` path
|
|
77
77
|
* instead (see {@link TabBarButtonProps.isFocused}) and must NOT pass this.
|
|
78
|
+
*
|
|
79
|
+
* An index that names NO tab — negative, past the last tab, or fractional —
|
|
80
|
+
* means no selection: the highlight fades out where it stands and no tab is
|
|
81
|
+
* left tinted. Pass one whenever the current screen is not a tab; an index
|
|
82
|
+
* derived from the route (`TABS.findIndex(…)`) is `-1` on every such screen
|
|
83
|
+
* and is correct as-is. Returning to a real index fades the highlight back in
|
|
84
|
+
* AT that tab rather than sliding to it — while it was invisible there was no
|
|
85
|
+
* position to travel from — and scrubbing still arms it under the finger.
|
|
86
|
+
*
|
|
87
|
+
* OMITTING this prop is a different thing entirely and does not hide
|
|
88
|
+
* anything: that is the focus-driven path, where each button drives the
|
|
89
|
+
* highlight from its own `isFocused`.
|
|
78
90
|
*/
|
|
79
91
|
activeIndex?: number;
|
|
80
92
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/tab-bar/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ToastRow.d.ts","sourceRoot":"","sources":["../../../../src/toast/ToastRow.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA6B/B,OAAO,KAAK,EAEV,aAAa,EAEb,QAAQ,EACR,WAAW,EACZ,MAAM,SAAS,CAAC;AAwDjB,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAHR,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI;kCAuWzC,CAAC"}
|
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
* covers `toast.custom` JSX and `unstyled` rows too, which never reach that
|
|
15
15
|
* card. Every distance the gesture measures is a fraction of the capped
|
|
16
16
|
* `rowWidth`, not of the window — see the constant.
|
|
17
|
+
*
|
|
18
|
+
* W13 — being THE row box also makes it the hover target: `useStackHover`'s
|
|
19
|
+
* handlers go here so a pointer over ANY row counts as a pointer over the stack.
|
|
20
|
+
* The handlers are empty on native.
|
|
17
21
|
*/
|
|
18
22
|
import * as React from 'react';
|
|
19
23
|
import { type ViewStyle } from 'react-native';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToastSwipeHandler.d.ts","sourceRoot":"","sources":["../../../../src/toast/ToastSwipeHandler.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ToastSwipeHandler.d.ts","sourceRoot":"","sources":["../../../../src/toast/ToastSwipeHandler.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAIL,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAetB,OAAO,KAAK,E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;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,uBAAuB,EAAE,mBAAmB,CAAC;IAC7C,OAAO,EAAE,YAAY,GAAG,SAAS,CAAC;IAClC,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,UAAU,CAAC;IAClB,kBAAkB,EAAE,UAAU,CAAC;IAC/B,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,OAAO,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,OAAO,CAAC;CA+C3B,CAAC"}
|
|
@@ -20,10 +20,25 @@ declare class ToastStore {
|
|
|
20
20
|
private pendingPromises;
|
|
21
21
|
private collapseCooldown;
|
|
22
22
|
private collapseCooldownTimeout;
|
|
23
|
+
private expansionHold;
|
|
23
24
|
subscribe: (callback: Subscriber) => () => void;
|
|
24
25
|
/** Stable while nothing has changed — safe as a `useSyncExternalStore` snapshot. */
|
|
25
26
|
getSnapshot: () => ToastStoreState;
|
|
26
27
|
setConfig: (config: ToastStoreConfig) => void;
|
|
28
|
+
/**
|
|
29
|
+
* Something outside the store can HOLD an expanded stack open — on web, a pointer
|
|
30
|
+
* resting on it. Registered by the platform trigger (`use-stack-hover`) so this
|
|
31
|
+
* module stays pure JS with no DOM and no platform branch; native registers
|
|
32
|
+
* nothing and the predicate stays `null`.
|
|
33
|
+
*
|
|
34
|
+
* It is asked at DECISION time rather than tracked as state on purpose: a row can
|
|
35
|
+
* stop being under the pointer with no event at all — rows unmount under the
|
|
36
|
+
* cursor and move under a stationary one, and neither fires `pointerleave` —
|
|
37
|
+
* so any cached boolean goes stale. Nothing renders from this, so it is
|
|
38
|
+
* deliberately not part of the snapshot.
|
|
39
|
+
*/
|
|
40
|
+
setExpansionHold: (hold: (() => boolean) | null) => void;
|
|
41
|
+
private isHeldOpen;
|
|
27
42
|
private notify;
|
|
28
43
|
private cloneIndex;
|
|
29
44
|
private resolveDuration;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast-store.d.ts","sourceRoot":"","sources":["../../../../src/toast/toast-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EACV,UAAU,EACV,QAAQ,EACR,gBAAgB,EAChB,eAAe,EAChB,MAAM,SAAS,CAAC;AAEjB,KAAK,UAAU,GAAG,MAAM,IAAI,CAAC;AAK7B,cAAM,UAAU;IACd,OAAO,CAAC,KAAK,CAQX;IAEF,OAAO,CAAC,WAAW,CAAyB;IAC5C,OAAO,CAAC,MAAM,CAAwB;IACtC,OAAO,CAAC,MAAM,CAA4B;IAC1C,OAAO,CAAC,kBAAkB,CAA8C;IACxE,OAAO,CAAC,eAAe,CAA8B;IACrD,OAAO,CAAC,gBAAgB,CAAS;IACjC,OAAO,CAAC,uBAAuB,CAA8C;
|
|
1
|
+
{"version":3,"file":"toast-store.d.ts","sourceRoot":"","sources":["../../../../src/toast/toast-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EACV,UAAU,EACV,QAAQ,EACR,gBAAgB,EAChB,eAAe,EAChB,MAAM,SAAS,CAAC;AAEjB,KAAK,UAAU,GAAG,MAAM,IAAI,CAAC;AAK7B,cAAM,UAAU;IACd,OAAO,CAAC,KAAK,CAQX;IAEF,OAAO,CAAC,WAAW,CAAyB;IAC5C,OAAO,CAAC,MAAM,CAAwB;IACtC,OAAO,CAAC,MAAM,CAA4B;IAC1C,OAAO,CAAC,kBAAkB,CAA8C;IACxE,OAAO,CAAC,eAAe,CAA8B;IACrD,OAAO,CAAC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UAWnD;IAEF,MAAM,aAOJ;IAEF,QAAQ,aAiBN;IAEF,YAAY,aAUV;CACH;AAED,eAAO,MAAM,UAAU,YAAmB,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How long a leave waits for a neighbouring row to claim the pointer. One frame is
|
|
3
|
+
* enough for the same-tick leave/enter pair a row crossing produces; this is a
|
|
4
|
+
* little more so a slow frame cannot flash the stack shut. Exported so the suite
|
|
5
|
+
* asserts against the real value rather than a copy of it.
|
|
6
|
+
*/
|
|
7
|
+
export declare const HOVER_LEAVE_GRACE = 80;
|
|
8
|
+
type HoverEvent = {
|
|
9
|
+
nativeEvent: {
|
|
10
|
+
pointerType?: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Whether the pointer is over the stack RIGHT NOW.
|
|
15
|
+
*
|
|
16
|
+
* Two sources, and both are load-bearing:
|
|
17
|
+
*
|
|
18
|
+
* - the `hovered` latch answers "a mouse entered and has not left", which is the
|
|
19
|
+
* only thing available where there is no DOM (jest runs on `testEnvironment:
|
|
20
|
+
* 'node'`), and is a cheap early-out.
|
|
21
|
+
* - the live `:hover` query answers "a row is under the pointer", which the latch
|
|
22
|
+
* CANNOT: a row can stop being hovered with no event whatsoever. Measured — a row
|
|
23
|
+
* culled by `visibleToasts` under a stationary cursor fires no `pointerleave`,
|
|
24
|
+
* `pointerout` or `mouseleave` at all, and the restack then slides the remaining
|
|
25
|
+
* rows out from under the pointer. A latch alone therefore sticks TRUE, which
|
|
26
|
+
* would disable the press toggle for the rest of the session and suppress every
|
|
27
|
+
* later auto-collapse.
|
|
28
|
+
*
|
|
29
|
+
* Requiring both means a stale latch is corrected by the DOM and a stray DOM match
|
|
30
|
+
* (a pen, a touch) is rejected by the latch.
|
|
31
|
+
*
|
|
32
|
+
* COVERAGE, stated plainly: jest cannot see the DOM half at all
|
|
33
|
+
* (`testEnvironment: 'node'`), and a browser cannot isolate it either — its two
|
|
34
|
+
* consequences are a press toggle standing down (unreachable with a mouse, which
|
|
35
|
+
* always hovers what it presses) and a suppressed auto-collapse (which the deferred
|
|
36
|
+
* leave below independently corrects the moment any boundary event fires). Both
|
|
37
|
+
* halves are kept because each is measurably more accurate than the other alone, not
|
|
38
|
+
* because a test proves the composite.
|
|
39
|
+
*
|
|
40
|
+
* `ToastRow` asks so a press does not TOGGLE what hover already opened, and
|
|
41
|
+
* `toastStore` asks before auto-collapsing a stack down to its last row. The press
|
|
42
|
+
* still runs the toast's own `onPress`; only the expansion toggle steps aside.
|
|
43
|
+
*/
|
|
44
|
+
export declare function isStackHovered(): boolean;
|
|
45
|
+
export type StackHoverProps = {
|
|
46
|
+
onPointerEnter: (event: HoverEvent) => void;
|
|
47
|
+
onPointerLeave: (event: HoverEvent) => void;
|
|
48
|
+
};
|
|
49
|
+
export declare function useStackHover({ enableStacking, }: {
|
|
50
|
+
enableStacking: boolean;
|
|
51
|
+
}): StackHoverProps;
|
|
52
|
+
/** Test-only reset: the module state outlives a render tree, so a suite must clear it. */
|
|
53
|
+
export declare function resetStackHoverForTests(): void;
|
|
54
|
+
export {};
|
|
55
|
+
//# sourceMappingURL=use-stack-hover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-stack-hover.d.ts","sourceRoot":"","sources":["../../../../src/toast/use-stack-hover.ts"],"names":[],"mappings":"AAwCA;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,KAAK,CAAC;AAKpC,KAAK,UAAU,GAAG;IAAE,WAAW,EAAE;QAAE,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAAC;AAc5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,cAAc,IAAI,OAAO,CAExC;AAwBD,MAAM,MAAM,eAAe,GAAG;IAC5B,cAAc,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IAC5C,cAAc,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;CAC7C,CAAC;AAEF,wBAAgB,aAAa,CAAC,EAC5B,cAAc,GACf,EAAE;IACD,cAAc,EAAE,OAAO,CAAC;CACzB,GAAG,eAAe,CA4ClB;AAED,0FAA0F;AAC1F,wBAAgB,uBAAuB,IAAI,IAAI,CAG9C"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bloom-original — NATIVE. Metro resolves this over `use-stack-hover.ts` on iOS and
|
|
3
|
+
* Android, the same filename split `ToastHost.native.tsx` uses.
|
|
4
|
+
*
|
|
5
|
+
* Native keeps PRESS as the only way to expand a stack, so this hands back no
|
|
6
|
+
* handlers at all. Two reasons it is a fork rather than a runtime `Platform` check:
|
|
7
|
+
* the web file's module-level hover state and its `setTimeout` have no business
|
|
8
|
+
* existing in a native bundle, and `onPointerEnter`/`onPointerLeave` DO fire on
|
|
9
|
+
* native for touch (RN's pointer events unify touch and mouse), which would make
|
|
10
|
+
* every tap expand-then-collapse while the press toggle fired as well.
|
|
11
|
+
*
|
|
12
|
+
* Keep the shape identical to the web file — `ToastSwipeHandler` spreads whatever
|
|
13
|
+
* this returns onto the row box, and `ToastRow` calls `isStackHovered()`
|
|
14
|
+
* unconditionally.
|
|
15
|
+
*/
|
|
16
|
+
export type StackHoverProps = Record<string, never>;
|
|
17
|
+
/** Parity with the web file's export; nothing here waits for anything. */
|
|
18
|
+
export declare const HOVER_LEAVE_GRACE = 0;
|
|
19
|
+
/** Nothing hovers on a touch screen. */
|
|
20
|
+
export declare function isStackHovered(): boolean;
|
|
21
|
+
export declare function useStackHover(_options: {
|
|
22
|
+
enableStacking: boolean;
|
|
23
|
+
}): StackHoverProps;
|
|
24
|
+
/** Parity with the web file so the shared suite can call it on either platform. */
|
|
25
|
+
export declare function resetStackHoverForTests(): void;
|
|
26
|
+
//# sourceMappingURL=use-stack-hover.native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-stack-hover.native.d.ts","sourceRoot":"","sources":["../../../../src/toast/use-stack-hover.native.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAEpD,0EAA0E;AAC1E,eAAO,MAAM,iBAAiB,IAAI,CAAC;AAEnC,wCAAwC;AACxC,wBAAgB,cAAc,IAAI,OAAO,CAExC;AAKD,wBAAgB,aAAa,CAAC,QAAQ,EAAE;IAAE,cAAc,EAAE,OAAO,CAAA;CAAE,GAAG,eAAe,CAEpF;AAED,mFAAmF;AACnF,wBAAgB,uBAAuB,IAAI,IAAI,CAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabBarBase.d.ts","sourceRoot":"","sources":["../../../../src/tab-bar/TabBarBase.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAOL,KAAK,aAAa,EACnB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TabBarBase.d.ts","sourceRoot":"","sources":["../../../../src/tab-bar/TabBarBase.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAOL,KAAK,aAAa,EACnB,MAAM,OAAO,CAAC;AAiBf,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEtE,OAAO,EAkBL,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACxB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAe,MAAM,SAAS,CAAC;AA4iB3E;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,aAAa,CAAC,kBAAkB,CAAC,EAC1C,IAAI,EAAE,aAAa,CAAC,oBAAoB,CAAC;YAElB,WAAW;;EAGnC;AAED,+EAA+E;AAC/E,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,aAAa,CAAC,gBAAgB,CAAC;YAC1C,iBAAiB;;EAG/C"}
|
|
@@ -44,6 +44,19 @@ export declare const SLIDE_SPRING: {
|
|
|
44
44
|
duration: number;
|
|
45
45
|
dampingRatio: number;
|
|
46
46
|
};
|
|
47
|
+
/**
|
|
48
|
+
* Fade for the highlight coming and going when the selection does — an
|
|
49
|
+
* `activeIndex` that names no tab (see `TabBarProps.activeIndex`).
|
|
50
|
+
*
|
|
51
|
+
* A timing, not a spring, and deliberately shorter than {@link SLIDE_SPRING}:
|
|
52
|
+
* appearing and disappearing is a change of STATE, not a movement, so it must
|
|
53
|
+
* not read as a second animation racing the slide. The capsule fades where it
|
|
54
|
+
* stands — moving it out of view instead would drag it the length of the bar on
|
|
55
|
+
* its way out and sweep the active tint across every tab it passed.
|
|
56
|
+
*/
|
|
57
|
+
export declare const HIGHLIGHT_FADE: {
|
|
58
|
+
duration: number;
|
|
59
|
+
};
|
|
47
60
|
/**
|
|
48
61
|
* How long a press must be held before `onIndexLongPress` fires.
|
|
49
62
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../src/tab-bar/shared.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAG7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAWvD,eAAO,MAAM,eAAe,KAAK,CAAC;AAClC,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,4EAA4E;AAC5E,eAAO,MAAM,eAAe,KAAK,CAAC;AAClC,qEAAqE;AACrE,eAAO,MAAM,UAAU,KAAK,CAAC;AAC7B,8DAA8D;AAC9D,eAAO,MAAM,SAAS,IAAI,CAAC;AAC3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,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,WAAW,EACnB,SAAS,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,GAC/B,WAAW,CAQb;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG,WAAW,CAe5E;AAaD,MAAM,WAAW,kBAAkB;IACjC,yEAAyE;IACzE,KAAK,EAAE,WAAW,CAAC;IACnB;;;;;;;;;;;;OAYG;IACH,KAAK,EAAE,SAAS,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC;CAC5C;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,UAAU,CAAC;IACjB,4EAA4E;IAC5E,IAAI,EAAE,MAAM,CAAC;IACb,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;OAMG;IACH,MAAM,EAAE,OAAO,CAAC;CACjB"}
|
|
@@ -75,6 +75,18 @@ export type TabBarProps = ViewProps & {
|
|
|
75
75
|
* highlight and springs it here whenever this changes. Use this when there is
|
|
76
76
|
* no router in play; the router adapter uses the per-button `isFocused` path
|
|
77
77
|
* instead (see {@link TabBarButtonProps.isFocused}) and must NOT pass this.
|
|
78
|
+
*
|
|
79
|
+
* An index that names NO tab — negative, past the last tab, or fractional —
|
|
80
|
+
* means no selection: the highlight fades out where it stands and no tab is
|
|
81
|
+
* left tinted. Pass one whenever the current screen is not a tab; an index
|
|
82
|
+
* derived from the route (`TABS.findIndex(…)`) is `-1` on every such screen
|
|
83
|
+
* and is correct as-is. Returning to a real index fades the highlight back in
|
|
84
|
+
* AT that tab rather than sliding to it — while it was invisible there was no
|
|
85
|
+
* position to travel from — and scrubbing still arms it under the finger.
|
|
86
|
+
*
|
|
87
|
+
* OMITTING this prop is a different thing entirely and does not hide
|
|
88
|
+
* anything: that is the focus-driven path, where each button drives the
|
|
89
|
+
* highlight from its own `isFocused`.
|
|
78
90
|
*/
|
|
79
91
|
activeIndex?: number;
|
|
80
92
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/tab-bar/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9D,MAAM,MAAM,UAAU,GAAG;IACvB,yEAAyE;IACzE,IAAI,EAAE,MAAM,CAAC;IACb,4EAA4E;IAC5E,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;;;;;OAUG;IACH,IAAI,EAAE,SAAS,CAAC;IAChB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,0DAA0D;IAC1D,UAAU,EAAE,MAAM,CAAC;IACnB,4CAA4C;IAC5C,YAAY,EAAE,MAAM,CAAC;IACrB,oCAAoC;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,2DAA2D;IAC3D,SAAS,EAAE,MAAM,CAAC;IAClB,oEAAoE;IACpE,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG;IACpC
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/tab-bar/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9D,MAAM,MAAM,UAAU,GAAG;IACvB,yEAAyE;IACzE,IAAI,EAAE,MAAM,CAAC;IACb,4EAA4E;IAC5E,KAAK,EAAE,MAAM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;CACrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToastRow.d.ts","sourceRoot":"","sources":["../../../../src/toast/ToastRow.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ToastRow.d.ts","sourceRoot":"","sources":["../../../../src/toast/ToastRow.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA6B/B,OAAO,KAAK,EAEV,aAAa,EAEb,QAAQ,EACR,WAAW,EACZ,MAAM,SAAS,CAAC;AAwDjB,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAHR,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI;kCAuWzC,CAAC"}
|
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
* covers `toast.custom` JSX and `unstyled` rows too, which never reach that
|
|
15
15
|
* card. Every distance the gesture measures is a fraction of the capped
|
|
16
16
|
* `rowWidth`, not of the window — see the constant.
|
|
17
|
+
*
|
|
18
|
+
* W13 — being THE row box also makes it the hover target: `useStackHover`'s
|
|
19
|
+
* handlers go here so a pointer over ANY row counts as a pointer over the stack.
|
|
20
|
+
* The handlers are empty on native.
|
|
17
21
|
*/
|
|
18
22
|
import * as React from 'react';
|
|
19
23
|
import { type ViewStyle } from 'react-native';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToastSwipeHandler.d.ts","sourceRoot":"","sources":["../../../../src/toast/ToastSwipeHandler.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ToastSwipeHandler.d.ts","sourceRoot":"","sources":["../../../../src/toast/ToastSwipeHandler.tsx"],"names":[],"mappings":"AAA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,MAAM,CAAC;AAC/C,eAAO,MAAM,2BAA2B,MAAM,CAAC;AAE/C,eAAO,MAAM,aAAa,EAAE;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,aAAa,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,uBAAuB,EAAE,mBAAmB,CAAC;IAC7C,OAAO,EAAE,YAAY,GAAG,SAAS,CAAC;IAClC,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,UAAU,CAAC;IAClB,kBAAkB,EAAE,UAAU,CAAC;IAC/B,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,OAAO,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,OAAO,CAAC;CA+C3B,CAAC"}
|
|
@@ -20,10 +20,25 @@ declare class ToastStore {
|
|
|
20
20
|
private pendingPromises;
|
|
21
21
|
private collapseCooldown;
|
|
22
22
|
private collapseCooldownTimeout;
|
|
23
|
+
private expansionHold;
|
|
23
24
|
subscribe: (callback: Subscriber) => () => void;
|
|
24
25
|
/** Stable while nothing has changed — safe as a `useSyncExternalStore` snapshot. */
|
|
25
26
|
getSnapshot: () => ToastStoreState;
|
|
26
27
|
setConfig: (config: ToastStoreConfig) => void;
|
|
28
|
+
/**
|
|
29
|
+
* Something outside the store can HOLD an expanded stack open — on web, a pointer
|
|
30
|
+
* resting on it. Registered by the platform trigger (`use-stack-hover`) so this
|
|
31
|
+
* module stays pure JS with no DOM and no platform branch; native registers
|
|
32
|
+
* nothing and the predicate stays `null`.
|
|
33
|
+
*
|
|
34
|
+
* It is asked at DECISION time rather than tracked as state on purpose: a row can
|
|
35
|
+
* stop being under the pointer with no event at all — rows unmount under the
|
|
36
|
+
* cursor and move under a stationary one, and neither fires `pointerleave` —
|
|
37
|
+
* so any cached boolean goes stale. Nothing renders from this, so it is
|
|
38
|
+
* deliberately not part of the snapshot.
|
|
39
|
+
*/
|
|
40
|
+
setExpansionHold: (hold: (() => boolean) | null) => void;
|
|
41
|
+
private isHeldOpen;
|
|
27
42
|
private notify;
|
|
28
43
|
private cloneIndex;
|
|
29
44
|
private resolveDuration;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast-store.d.ts","sourceRoot":"","sources":["../../../../src/toast/toast-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EACV,UAAU,EACV,QAAQ,EACR,gBAAgB,EAChB,eAAe,EAChB,MAAM,SAAS,CAAC;AAEjB,KAAK,UAAU,GAAG,MAAM,IAAI,CAAC;AAK7B,cAAM,UAAU;IACd,OAAO,CAAC,KAAK,CAQX;IAEF,OAAO,CAAC,WAAW,CAAyB;IAC5C,OAAO,CAAC,MAAM,CAAwB;IACtC,OAAO,CAAC,MAAM,CAA4B;IAC1C,OAAO,CAAC,kBAAkB,CAA8C;IACxE,OAAO,CAAC,eAAe,CAA8B;IACrD,OAAO,CAAC,gBAAgB,CAAS;IACjC,OAAO,CAAC,uBAAuB,CAA8C;
|
|
1
|
+
{"version":3,"file":"toast-store.d.ts","sourceRoot":"","sources":["../../../../src/toast/toast-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EACV,UAAU,EACV,QAAQ,EACR,gBAAgB,EAChB,eAAe,EAChB,MAAM,SAAS,CAAC;AAEjB,KAAK,UAAU,GAAG,MAAM,IAAI,CAAC;AAK7B,cAAM,UAAU;IACd,OAAO,CAAC,KAAK,CAQX;IAEF,OAAO,CAAC,WAAW,CAAyB;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