@unisim/sdk 0.228.0 → 0.230.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +180 -5
- package/dist/TuneSync.d.ts +2 -0
- package/dist/TuneSync.d.ts.map +1 -0
- package/dist/TuneSync.js +182 -0
- package/dist/TuneSync.js.map +1 -0
- package/dist/defaultView.d.ts +11 -0
- package/dist/defaultView.d.ts.map +1 -1
- package/dist/defaultView.js +69 -12
- package/dist/defaultView.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/phone/SwipeRow.d.ts +62 -0
- package/dist/phone/SwipeRow.d.ts.map +1 -0
- package/dist/phone/SwipeRow.js +192 -0
- package/dist/phone/SwipeRow.js.map +1 -0
- package/dist/phone/TabReorder.d.ts +125 -0
- package/dist/phone/TabReorder.d.ts.map +1 -0
- package/dist/phone/TabReorder.js +245 -0
- package/dist/phone/TabReorder.js.map +1 -0
- package/dist/phone/hold.d.ts +87 -0
- package/dist/phone/hold.d.ts.map +1 -0
- package/dist/phone/hold.js +250 -0
- package/dist/phone/hold.js.map +1 -0
- package/dist/phone/index.d.ts +12 -0
- package/dist/phone/index.d.ts.map +1 -1
- package/dist/phone/index.js +12 -0
- package/dist/phone/index.js.map +1 -1
- package/dist/phone/listCopy.d.ts +28 -0
- package/dist/phone/listCopy.d.ts.map +1 -0
- package/dist/phone/listCopy.js +115 -0
- package/dist/phone/listCopy.js.map +1 -0
- package/dist/phone/listStyles.d.ts +4 -0
- package/dist/phone/listStyles.d.ts.map +1 -0
- package/dist/phone/listStyles.js +105 -0
- package/dist/phone/listStyles.js.map +1 -0
- package/dist/phone/swipeGeometry.d.ts +62 -0
- package/dist/phone/swipeGeometry.d.ts.map +1 -0
- package/dist/phone/swipeGeometry.js +96 -0
- package/dist/phone/swipeGeometry.js.map +1 -0
- package/dist/phone/tabOrder.d.ts +19 -0
- package/dist/phone/tabOrder.d.ts.map +1 -0
- package/dist/phone/tabOrder.js +46 -0
- package/dist/phone/tabOrder.js.map +1 -0
- package/dist/provider.d.ts +8 -0
- package/dist/provider.d.ts.map +1 -1
- package/dist/provider.js +10 -2
- package/dist/provider.js.map +1 -1
- package/dist/themeStore.d.ts +8 -0
- package/dist/themeStore.d.ts.map +1 -1
- package/dist/themeStore.js +21 -1
- package/dist/themeStore.js.map +1 -1
- package/dist/tuneSyncCore.d.ts +52 -0
- package/dist/tuneSyncCore.d.ts.map +1 -0
- package/dist/tuneSyncCore.js +162 -0
- package/dist/tuneSyncCore.js.map +1 -0
- package/dist/userPrefs.d.ts.map +1 -1
- package/dist/userPrefs.js +28 -15
- package/dist/userPrefs.js.map +1 -1
- package/package.json +3 -1
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
// Tabs reorder: hold and drag (BRANDING.md ▸ "Tabs reorder: hold and drag",
|
|
4
|
+
// owner rules 2026-10-25 and 2026-10-26). Hold a tab ~0.5 s (a light haptic)
|
|
5
|
+
// and drag it along the bar; let go to drop it. A tab that Tune can switch off
|
|
6
|
+
// can be dropped on a bin that rises above the bar instead, which switches it
|
|
7
|
+
// off (with Undo). Tune this app stays last, and its Tab order list is the
|
|
8
|
+
// same order for the website, the keyboard and anybody who cannot drag.
|
|
9
|
+
//
|
|
10
|
+
// Moved here in 0.230.0 from Universal BlackBook (`src/native/NativeApp.tsx`,
|
|
11
|
+
// the bar; `TabOrderPreference.tsx`, the list), the first and fullest of three
|
|
12
|
+
// copies — Universal Jukebox and Workplace Assess (`native/TabBar.jsx`) built
|
|
13
|
+
// the same hold-and-drag without the bin.
|
|
14
|
+
//
|
|
15
|
+
// - useTabReorder() the bar's gesture: the live order while dragging,
|
|
16
|
+
// which tab is lifted, whether the finger is over the
|
|
17
|
+
// bin. The app keeps its own bar and its own tap.
|
|
18
|
+
// - <TabBin> the bin, in the SDK's words (or the app's).
|
|
19
|
+
// - useTabOrderList() Tune ▸ Tab order, headless: grips and Move up / down.
|
|
20
|
+
// - <TabOrderList> the same, drawn.
|
|
21
|
+
import { useEffect, useInsertionEffect, useRef, useState, } from 'react';
|
|
22
|
+
import { useOptionalLanguage } from '../provider.js';
|
|
23
|
+
import { phoneListCopy } from './listCopy.js';
|
|
24
|
+
import { injectPhoneListStyles } from './listStyles.js';
|
|
25
|
+
import { cx } from './styles.js';
|
|
26
|
+
import { moveTab } from './tabOrder.js';
|
|
27
|
+
/** How long a tab is held before it lifts, ms. */
|
|
28
|
+
export const TAB_HOLD_MS = 500;
|
|
29
|
+
/** Movement before that which makes it a scroll or a tap instead, px. */
|
|
30
|
+
const TAB_HOLD_SLOP_PX = 10;
|
|
31
|
+
/** The bin counts a finger this close as over it, px. */
|
|
32
|
+
const BIN_PAD_PX = 18;
|
|
33
|
+
function useLang(language) {
|
|
34
|
+
const fromProvider = useOptionalLanguage();
|
|
35
|
+
return language ?? fromProvider ?? (typeof document !== 'undefined' ? document.documentElement.lang || null : null);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Hold a tab and drag it along the bar. While one is lifted, `order` is where
|
|
39
|
+
* it would land; letting go calls `onReorder` (if it moved) or `onBin` (over
|
|
40
|
+
* the bin). The click the lifting finger makes on the bar is swallowed, so a
|
|
41
|
+
* hold is never a tap (nor half of a double tap); a quick tap elsewhere — an
|
|
42
|
+
* Undo — still counts.
|
|
43
|
+
*
|
|
44
|
+
* const r = useTabReorder({ tabs: shown, onReorder: (o) => save(withShownOrder(all, o)), onBin: hide })
|
|
45
|
+
* <nav ref={r.barRef}>{[...r.order, 'tune'].map((t) => <button {...(t === 'tune' ? {} : r.tabProps(t))} … />)}</nav>
|
|
46
|
+
* {r.showBin && <TabBin binRef={r.binRef} over={r.overBin} />}
|
|
47
|
+
*/
|
|
48
|
+
export function useTabReorder({ tabs, onReorder, onBin, canBin, holdMs = TAB_HOLD_MS, enabled = true, }) {
|
|
49
|
+
const [drag, setDrag] = useState(null);
|
|
50
|
+
const barRef = useRef(null);
|
|
51
|
+
const binRef = useRef(null);
|
|
52
|
+
const hold = useRef(null);
|
|
53
|
+
const live = useRef({ drag, tabs, onReorder, onBin, canBin });
|
|
54
|
+
live.current = { drag, tabs, onReorder, onBin, canBin };
|
|
55
|
+
const binnable = (tab) => Boolean(live.current.onBin) && live.current.tabs.length > 1 && (live.current.canBin?.(tab) ?? true);
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
const move = (e) => {
|
|
58
|
+
const h = hold.current;
|
|
59
|
+
if (!h)
|
|
60
|
+
return;
|
|
61
|
+
const t0 = e.touches[0];
|
|
62
|
+
if (!h.active) {
|
|
63
|
+
if (!t0 || Math.hypot(t0.clientX - h.x0, t0.clientY - h.y0) > TAB_HOLD_SLOP_PX) {
|
|
64
|
+
clearTimeout(h.timer);
|
|
65
|
+
hold.current = null;
|
|
66
|
+
}
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
if (e.cancelable)
|
|
70
|
+
e.preventDefault();
|
|
71
|
+
const d = live.current.drag;
|
|
72
|
+
if (!d || !t0)
|
|
73
|
+
return;
|
|
74
|
+
// Over the bin (with a finger's width to spare): the order holds still.
|
|
75
|
+
const b = binnable(d.tab) ? binRef.current?.getBoundingClientRect() : undefined;
|
|
76
|
+
const overBin = Boolean(b &&
|
|
77
|
+
t0.clientX >= b.left - BIN_PAD_PX &&
|
|
78
|
+
t0.clientX <= b.right + BIN_PAD_PX &&
|
|
79
|
+
t0.clientY >= b.top - BIN_PAD_PX &&
|
|
80
|
+
t0.clientY <= b.bottom + BIN_PAD_PX);
|
|
81
|
+
if (overBin !== d.bin) {
|
|
82
|
+
navigator.vibrate?.(8);
|
|
83
|
+
const next = { ...d, bin: overBin };
|
|
84
|
+
live.current.drag = next;
|
|
85
|
+
setDrag(next);
|
|
86
|
+
}
|
|
87
|
+
if (overBin)
|
|
88
|
+
return;
|
|
89
|
+
// Which slot the finger is over, among the tabs that can move.
|
|
90
|
+
const slots = [...(barRef.current?.querySelectorAll('[data-reorder-tab]') ?? [])];
|
|
91
|
+
const at = slots.findIndex((el) => {
|
|
92
|
+
const r = el.getBoundingClientRect();
|
|
93
|
+
return t0.clientX >= r.left && t0.clientX <= r.right;
|
|
94
|
+
});
|
|
95
|
+
if (at < 0)
|
|
96
|
+
return;
|
|
97
|
+
const order = moveTab(d.order, d.tab, at);
|
|
98
|
+
if (order.join('\u0000') !== d.order.join('\u0000')) {
|
|
99
|
+
const next = { tab: d.tab, order, bin: false };
|
|
100
|
+
live.current.drag = next;
|
|
101
|
+
setDrag(next);
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
const end = () => {
|
|
105
|
+
const h = hold.current;
|
|
106
|
+
hold.current = null;
|
|
107
|
+
if (!h)
|
|
108
|
+
return;
|
|
109
|
+
clearTimeout(h.timer);
|
|
110
|
+
if (!h.active)
|
|
111
|
+
return;
|
|
112
|
+
// The lift is not a tap: its click must not switch tabs or count toward
|
|
113
|
+
// a double tap. Only on the bar: a quick tap on the bin's Undo counts.
|
|
114
|
+
const swallow = (ev) => {
|
|
115
|
+
if (!barRef.current?.contains(ev.target))
|
|
116
|
+
return;
|
|
117
|
+
ev.preventDefault();
|
|
118
|
+
ev.stopPropagation();
|
|
119
|
+
};
|
|
120
|
+
document.addEventListener('click', swallow, { capture: true, once: true });
|
|
121
|
+
setTimeout(() => document.removeEventListener('click', swallow, { capture: true }), 600);
|
|
122
|
+
const d = live.current.drag;
|
|
123
|
+
live.current.drag = null;
|
|
124
|
+
setDrag(null);
|
|
125
|
+
if (!d)
|
|
126
|
+
return;
|
|
127
|
+
if (d.bin && binnable(d.tab)) {
|
|
128
|
+
live.current.onBin?.(d.tab);
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
if (d.order.join('\u0000') !== live.current.tabs.join('\u0000'))
|
|
132
|
+
live.current.onReorder(d.order);
|
|
133
|
+
};
|
|
134
|
+
document.addEventListener('touchmove', move, { passive: false, capture: true });
|
|
135
|
+
document.addEventListener('touchend', end, true);
|
|
136
|
+
document.addEventListener('touchcancel', end, true);
|
|
137
|
+
return () => {
|
|
138
|
+
if (hold.current)
|
|
139
|
+
clearTimeout(hold.current.timer);
|
|
140
|
+
hold.current = null;
|
|
141
|
+
document.removeEventListener('touchmove', move, { capture: true });
|
|
142
|
+
document.removeEventListener('touchend', end, true);
|
|
143
|
+
document.removeEventListener('touchcancel', end, true);
|
|
144
|
+
};
|
|
145
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
146
|
+
}, []);
|
|
147
|
+
const tabProps = (tab) => ({
|
|
148
|
+
'data-reorder-tab': tab,
|
|
149
|
+
...(drag?.tab === tab ? { 'data-reorder-lifted': '' } : {}),
|
|
150
|
+
onTouchStart: (e) => {
|
|
151
|
+
if (!enabled || e.touches.length !== 1 || live.current.tabs.length < 2)
|
|
152
|
+
return;
|
|
153
|
+
const t0 = e.touches[0];
|
|
154
|
+
if (hold.current)
|
|
155
|
+
clearTimeout(hold.current.timer);
|
|
156
|
+
const h = {
|
|
157
|
+
x0: t0.clientX,
|
|
158
|
+
y0: t0.clientY,
|
|
159
|
+
active: false,
|
|
160
|
+
timer: setTimeout(() => {
|
|
161
|
+
h.active = true;
|
|
162
|
+
navigator.vibrate?.(12);
|
|
163
|
+
const next = { tab, order: [...live.current.tabs], bin: false };
|
|
164
|
+
live.current.drag = next;
|
|
165
|
+
setDrag(next);
|
|
166
|
+
}, holdMs),
|
|
167
|
+
};
|
|
168
|
+
hold.current = h;
|
|
169
|
+
},
|
|
170
|
+
// A held finger brings up no system menu.
|
|
171
|
+
onContextMenu: (e) => e.preventDefault(),
|
|
172
|
+
});
|
|
173
|
+
return {
|
|
174
|
+
order: drag?.order ?? [...tabs],
|
|
175
|
+
dragging: drag?.tab ?? null,
|
|
176
|
+
overBin: Boolean(drag?.bin),
|
|
177
|
+
showBin: Boolean(drag && binnable(drag.tab)),
|
|
178
|
+
barRef,
|
|
179
|
+
binRef,
|
|
180
|
+
tabProps,
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
const BinIcon = () => (_jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: _jsx("path", { d: "M4 7h16M10 11v6M14 11v6M6 7l1 12a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-12M9 7V4h6v3" }) }));
|
|
184
|
+
/**
|
|
185
|
+
* The bin a held tab can be dropped on, to hide it. Show it while
|
|
186
|
+
* `showBin`. Fixed above the foot of the screen; `className` moves it.
|
|
187
|
+
*/
|
|
188
|
+
export function TabBin({ binRef, over, hint, drop, icon, language, className }) {
|
|
189
|
+
useInsertionEffect(() => injectPhoneListStyles(), []);
|
|
190
|
+
const copy = phoneListCopy(useLang(language));
|
|
191
|
+
return (_jsxs("div", { ref: binRef, className: cx('unisim-tab-bin', className), "data-over": over ? '' : undefined, "aria-hidden": true, children: [icon ?? _jsx(BinIcon, {}), _jsx("span", { children: over ? (drop ?? copy.binDrop) : (hint ?? copy.binHint) })] }));
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Tune this app ▸ Tab order, without the drawing: a grip per row to drag (the
|
|
195
|
+
* row under the pointer takes the tab's place) and `move` for the Move up /
|
|
196
|
+
* Move down buttons. `order` is the whole order, hidden tabs included, so a
|
|
197
|
+
* tab switched back on returns to its place.
|
|
198
|
+
*/
|
|
199
|
+
export function useTabOrderList(order, onChange) {
|
|
200
|
+
const listRef = useRef(null);
|
|
201
|
+
const [held, setHeld] = useState(null);
|
|
202
|
+
const move = (tab, to) => onChange(moveTab(order, tab, to));
|
|
203
|
+
return {
|
|
204
|
+
held,
|
|
205
|
+
listRef,
|
|
206
|
+
move,
|
|
207
|
+
gripProps: (tab) => ({
|
|
208
|
+
onPointerDown: (e) => {
|
|
209
|
+
e.preventDefault();
|
|
210
|
+
e.currentTarget.setPointerCapture?.(e.pointerId);
|
|
211
|
+
setHeld(tab);
|
|
212
|
+
},
|
|
213
|
+
onPointerMove: (e) => {
|
|
214
|
+
if (held !== tab)
|
|
215
|
+
return;
|
|
216
|
+
const rows = [...(listRef.current?.children ?? [])];
|
|
217
|
+
const at = rows.findIndex((r) => {
|
|
218
|
+
const b = r.getBoundingClientRect();
|
|
219
|
+
return e.clientY >= b.top && e.clientY <= b.bottom;
|
|
220
|
+
});
|
|
221
|
+
if (at >= 0 && order[at] !== tab)
|
|
222
|
+
move(tab, at);
|
|
223
|
+
},
|
|
224
|
+
onPointerUp: () => setHeld(null),
|
|
225
|
+
onPointerCancel: () => setHeld(null),
|
|
226
|
+
}),
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
const Arrow = ({ down }) => (_jsx("svg", { viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.75", "aria-hidden": true, style: down ? { transform: 'rotate(180deg)' } : undefined, children: _jsx("path", { d: "M8 13V3M4 7l4-4 4 4", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
230
|
+
const Grip = () => (_jsxs("svg", { viewBox: "0 0 16 16", fill: "currentColor", "aria-hidden": true, children: [_jsx("circle", { cx: "5.5", cy: "4", r: "1.2" }), _jsx("circle", { cx: "10.5", cy: "4", r: "1.2" }), _jsx("circle", { cx: "5.5", cy: "8", r: "1.2" }), _jsx("circle", { cx: "10.5", cy: "8", r: "1.2" }), _jsx("circle", { cx: "5.5", cy: "12", r: "1.2" }), _jsx("circle", { cx: "10.5", cy: "12", r: "1.2" })] }));
|
|
231
|
+
/**
|
|
232
|
+
* Tune this app ▸ Tab order: the tab bar's order as a list, each row with a
|
|
233
|
+
* grip to drag and Move up / Move down buttons — the accessible way to do
|
|
234
|
+
* what a hold and a drag do on the bar. Reset to defaults is the app's (it
|
|
235
|
+
* puts its stored order back).
|
|
236
|
+
*/
|
|
237
|
+
export function TabOrderList({ order, onChange, label, hidden, title, note, language, className }) {
|
|
238
|
+
useInsertionEffect(() => injectPhoneListStyles(), []);
|
|
239
|
+
const copy = phoneListCopy(useLang(language));
|
|
240
|
+
const list = useTabOrderList(order, onChange);
|
|
241
|
+
const heading = title ?? copy.tabOrder;
|
|
242
|
+
const line = note === undefined ? copy.tabOrderNote : note;
|
|
243
|
+
return (_jsxs("fieldset", { className: cx('unisim-tab-order', className), children: [_jsx("legend", { style: { position: 'absolute', width: 1, height: 1, overflow: 'hidden', clip: 'rect(0 0 0 0)' }, children: heading }), _jsx("p", { "aria-hidden": true, className: "unisim-tab-order-title", children: heading }), line && _jsx("p", { className: "unisim-tab-order-note", children: line }), _jsx("ol", { ref: list.listRef, children: order.map((tab, i) => (_jsxs("li", { "data-tab": tab, "data-held": list.held === tab ? '' : undefined, children: [_jsx("span", { ...list.gripProps(tab), "aria-hidden": true, className: "unisim-tab-order-grip", children: _jsx(Grip, {}) }), _jsxs("span", { className: "unisim-tab-order-name", children: [label(tab), hidden?.(tab) && _jsxs("span", { className: "unisim-tab-order-hidden", children: ["(", copy.hidden, ")"] })] }), _jsx("button", { type: "button", className: "unisim-tab-order-move", "aria-label": copy.moveEarlier.replace('{name}', label(tab)), disabled: i === 0, onClick: () => list.move(tab, i - 1), children: _jsx(Arrow, {}) }), _jsx("button", { type: "button", className: "unisim-tab-order-move", "aria-label": copy.moveLater.replace('{name}', label(tab)), disabled: i === order.length - 1, onClick: () => list.move(tab, i + 1), children: _jsx(Arrow, { down: true }) })] }, tab))) })] }));
|
|
244
|
+
}
|
|
245
|
+
//# sourceMappingURL=TabReorder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TabReorder.js","sourceRoot":"","sources":["../../src/phone/TabReorder.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,4EAA4E;AAC5E,6EAA6E;AAC7E,+EAA+E;AAC/E,8EAA8E;AAC9E,2EAA2E;AAC3E,wEAAwE;AACxE,EAAE;AACF,8EAA8E;AAC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,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,aACxE,kBAAU,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,uBAAc,SAAS,EAAC,uBAAuB,YAC1E,KAAC,IAAI,KAAG,GACH,EACP,gBAAM,SAAS,EAAC,uBAAuB,aACpC,KAAK,CAAC,GAAG,CAAC,EACV,MAAM,EAAE,CAAC,GAAG,CAAC,IAAI,gBAAM,SAAS,EAAC,yBAAyB,kBAAG,IAAI,CAAC,MAAM,SAAS,IAC7E,EACP,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,uBAAuB,gBACrB,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,EAC1D,QAAQ,EAAE,CAAC,KAAK,CAAC,EACjB,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,YAEpC,KAAC,KAAK,KAAG,GACF,EACT,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,uBAAuB,gBACrB,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,EACxD,QAAQ,EAAE,CAAC,KAAK,KAAK,CAAC,MAAM,GAAG,CAAC,EAChC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,YAEpC,KAAC,KAAK,IAAC,IAAI,SAAG,GACP,KAzBF,GAAG,CA0BP,CACN,CAAC,GACC,IACI,CACZ,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { type TouchEvent as ReactTouchEvent } from 'react';
|
|
2
|
+
/** How long a finger stays still to count as a hold, ms. */
|
|
3
|
+
export declare const HOLD_MS = 450;
|
|
4
|
+
/** How far it may wander and still be holding, px. */
|
|
5
|
+
export declare const HOLD_SLOP_PX = 8;
|
|
6
|
+
/**
|
|
7
|
+
* Eat the next click, wherever it lands, if it comes before the finger lifts
|
|
8
|
+
* or within 0.4 s of it — the click that ends a hold, so it neither opens the
|
|
9
|
+
* row nor presses what has just slid in under the finger. Call it the moment
|
|
10
|
+
* the hold fires, while the finger is still down. `swallowed` runs if a click
|
|
11
|
+
* was eaten. From Universal Jukebox.
|
|
12
|
+
*/
|
|
13
|
+
export declare function swallowReleaseClick(swallowed?: () => void): void;
|
|
14
|
+
export interface HoldOptions {
|
|
15
|
+
/** How long the finger stays still, ms. Default 450. */
|
|
16
|
+
ms?: number;
|
|
17
|
+
/** A haptic as it fires (`navigator.vibrate`, Android). Default true. */
|
|
18
|
+
vibrate?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The hold itself. Spread `holdStart(id)` as a row's `onTouchStart`: a still
|
|
22
|
+
* finger for 0.45 s calls `onHold(id)`. Movement first (the row's swipe, the
|
|
23
|
+
* list's scroll), the finger lifting, or a second finger cancels it. The click
|
|
24
|
+
* the lifting finger makes is swallowed ({@link swallowReleaseClick}).
|
|
25
|
+
*
|
|
26
|
+
* const holdStart = useHold((id) => startSelecting(id))
|
|
27
|
+
* <li onTouchStart={selecting ? undefined : holdStart(row.id)}>…
|
|
28
|
+
*
|
|
29
|
+
* Touch only: the website ticks with its tick boxes.
|
|
30
|
+
*/
|
|
31
|
+
export declare function useHold(onHold: (id: string) => void, options?: HoldOptions): (id: string) => (e: ReactTouchEvent) => void;
|
|
32
|
+
/**
|
|
33
|
+
* Selection mode is left the phone's ways as well as by its Done button:
|
|
34
|
+
* Android's back gesture (a layer on the SDK's stack while `selecting`, so
|
|
35
|
+
* Back takes selection mode away rather than the page) and a swipe in from
|
|
36
|
+
* the left edge. `enabled: false` (the website) turns both off.
|
|
37
|
+
*/
|
|
38
|
+
export declare function useLeaveSelection(selecting: boolean, leave: () => void, options?: {
|
|
39
|
+
enabled?: boolean;
|
|
40
|
+
}): void;
|
|
41
|
+
/** What {@link useHoldSelect} returns: selection mode for one list. */
|
|
42
|
+
export interface HoldSelect {
|
|
43
|
+
/** In selection mode (a hold started it, or a Select button). */
|
|
44
|
+
selecting: boolean;
|
|
45
|
+
isSelected: (id: string) => boolean;
|
|
46
|
+
/** The ticked ids still in the list, in the list's order. */
|
|
47
|
+
picked: string[];
|
|
48
|
+
/** Into selection mode, with this one ticked if given. */
|
|
49
|
+
start: (id?: string) => void;
|
|
50
|
+
/** Tick or untick one; `range` (Shift-click) ticks the run from the last one. */
|
|
51
|
+
toggle: (id: string, range?: boolean) => void;
|
|
52
|
+
/** Everything, or nothing if everything was ticked. */
|
|
53
|
+
all: () => void;
|
|
54
|
+
/** Out of selection mode. */
|
|
55
|
+
done: () => void;
|
|
56
|
+
/** Spread `holdStart(id)` as each row's `onTouchStart`. */
|
|
57
|
+
holdStart: (id: string) => (e: ReactTouchEvent) => void;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Selection mode for one list, started by a hold ({@link useHold}) and left
|
|
61
|
+
* by Done, Android's back or an edge swipe ({@link useLeaveSelection}).
|
|
62
|
+
* `ids` are the rows on screen, in order. Pair it with your own bar (the
|
|
63
|
+
* count, Select all, the list's bulk actions, Done) shown while `selecting`.
|
|
64
|
+
*
|
|
65
|
+
* const sel = useHoldSelect(rows.map((r) => r.id), { gestures: isPhoneApp })
|
|
66
|
+
*
|
|
67
|
+
* `gestures: false` keeps Back and the edge swipe out of it (a website).
|
|
68
|
+
*/
|
|
69
|
+
export declare function useHoldSelect(ids: readonly string[], options?: {
|
|
70
|
+
gestures?: boolean;
|
|
71
|
+
} & HoldOptions): HoldSelect;
|
|
72
|
+
/**
|
|
73
|
+
* Delete now, Undo for a while (six seconds by default): what was deleted and
|
|
74
|
+
* the way to put it back. The rule's "Delete offers Undo". Show your own
|
|
75
|
+
* toast while `item` is set; From Universal BlackBook.
|
|
76
|
+
*/
|
|
77
|
+
export declare function useUndo<T>(restore: (item: T) => void | Promise<void>, ms?: number): {
|
|
78
|
+
/** What can still be put back, or null. */
|
|
79
|
+
item: T | null;
|
|
80
|
+
/** Something was deleted: offer it back for `ms`. */
|
|
81
|
+
deleted: (x: T) => void;
|
|
82
|
+
/** Put it back. */
|
|
83
|
+
undo: () => Promise<void>;
|
|
84
|
+
/** Forget it without restoring (the toast was dismissed). */
|
|
85
|
+
dismiss: () => void;
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=hold.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hold.d.ts","sourceRoot":"","sources":["../../src/phone/hold.ts"],"names":[],"mappings":"AAqBA,OAAO,EAA+B,KAAK,UAAU,IAAI,eAAe,EAAE,MAAM,OAAO,CAAA;AAIvF,4DAA4D;AAC5D,eAAO,MAAM,OAAO,MAAM,CAAA;AAC1B,sDAAsD;AACtD,eAAO,MAAM,YAAY,IAAI,CAAA;AAI7B;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,CAAC,EAAE,MAAM,IAAI,GAAG,IAAI,CAoBhE;AAED,MAAM,WAAW,WAAW;IAC1B,wDAAwD;IACxD,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,yEAAyE;IACzE,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,EAC5B,OAAO,GAAE,WAAgB,GACxB,CAAC,EAAE,EAAE,MAAM,KAAK,CAAC,CAAC,EAAE,eAAe,KAAK,IAAI,CA2C9C;AAOD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,IAAI,EAAE,OAAO,GAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,IAAI,CA2BlH;AAED,uEAAuE;AACvE,MAAM,WAAW,UAAU;IACzB,iEAAiE;IACjE,SAAS,EAAE,OAAO,CAAA;IAClB,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAA;IACnC,6DAA6D;IAC7D,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,0DAA0D;IAC1D,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAC5B,iFAAiF;IACjF,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,KAAK,IAAI,CAAA;IAC7C,uDAAuD;IACvD,GAAG,EAAE,MAAM,IAAI,CAAA;IACf,6BAA6B;IAC7B,IAAI,EAAE,MAAM,IAAI,CAAA;IAChB,2DAA2D;IAC3D,SAAS,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,CAAC,CAAC,EAAE,eAAe,KAAK,IAAI,CAAA;CACxD;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,EAAE,OAAO,GAAE;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,WAAgB,GAAG,UAAU,CA4CpH;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,SAAO;IAK5E,2CAA2C;;IAE3C,qDAAqD;iBACxC,CAAC;IAKd,mBAAmB;;IAOnB,6DAA6D;;EAMhE"}
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
// Press and hold selects (BRANDING.md ▸ "A deletable row swipes" ▸ "Press and
|
|
3
|
+
// hold selects", owner rule 2026-10-25: "a tap and hold should select the
|
|
4
|
+
// item"): hold a row still and it is ticked and the list goes into selection
|
|
5
|
+
// mode; Done, Android's back or a swipe in from the left edge leaves. A hold
|
|
6
|
+
// never fires the row's own tap, and the lifting finger never presses what
|
|
7
|
+
// slides in under it (the selection bar).
|
|
8
|
+
//
|
|
9
|
+
// Moved here in 0.230.0 from three copies:
|
|
10
|
+
// - Universal BlackBook `useHold` / `useLeaveSelection` / `useHoldSelect`
|
|
11
|
+
// (`src/components/SwipeActions.tsx`, the rule's reference): document-wide
|
|
12
|
+
// cancel on movement, Shift-click ticks a run, the phone's ways out.
|
|
13
|
+
// - Universal PDF `useHold` / `useLeaveSelection` (`src/native/parts.tsx`),
|
|
14
|
+
// a copy of BlackBook's that also clears its timer on unmount — kept.
|
|
15
|
+
// - Universal Jukebox `swallowReleaseClick` (`src/native/listDefaults.ts`):
|
|
16
|
+
// the release's click is eaten only until just after the finger lifts.
|
|
17
|
+
// BlackBook and PDF kept the trap armed for 1.5 s, so a quick real tap
|
|
18
|
+
// after a hold that made no click of its own was eaten instead (PDF) or
|
|
19
|
+
// needed a second flag to tell them apart (BlackBook). Jukebox's is kept.
|
|
20
|
+
import { useEffect, useRef, useState } from 'react';
|
|
21
|
+
import { EDGE_SWIPE_START_PX } from './edgeSwipe.js';
|
|
22
|
+
import { usePhoneLayer } from './layers.js';
|
|
23
|
+
/** How long a finger stays still to count as a hold, ms. */
|
|
24
|
+
export const HOLD_MS = 450;
|
|
25
|
+
/** How far it may wander and still be holding, px. */
|
|
26
|
+
export const HOLD_SLOP_PX = 8;
|
|
27
|
+
/** How long after the finger lifts its click is still eaten, ms. */
|
|
28
|
+
const RELEASE_GRACE_MS = 400;
|
|
29
|
+
/**
|
|
30
|
+
* Eat the next click, wherever it lands, if it comes before the finger lifts
|
|
31
|
+
* or within 0.4 s of it — the click that ends a hold, so it neither opens the
|
|
32
|
+
* row nor presses what has just slid in under the finger. Call it the moment
|
|
33
|
+
* the hold fires, while the finger is still down. `swallowed` runs if a click
|
|
34
|
+
* was eaten. From Universal Jukebox.
|
|
35
|
+
*/
|
|
36
|
+
export function swallowReleaseClick(swallowed) {
|
|
37
|
+
if (typeof window === 'undefined')
|
|
38
|
+
return;
|
|
39
|
+
const eat = (e) => {
|
|
40
|
+
e.stopPropagation();
|
|
41
|
+
e.preventDefault();
|
|
42
|
+
swallowed?.();
|
|
43
|
+
};
|
|
44
|
+
window.addEventListener('click', eat, { capture: true, once: true });
|
|
45
|
+
let disarmed = false;
|
|
46
|
+
const disarm = () => {
|
|
47
|
+
if (disarmed)
|
|
48
|
+
return;
|
|
49
|
+
disarmed = true;
|
|
50
|
+
window.setTimeout(() => window.removeEventListener('click', eat, { capture: true }), RELEASE_GRACE_MS);
|
|
51
|
+
};
|
|
52
|
+
// Whichever says first that the finger is up.
|
|
53
|
+
for (const type of ['pointerup', 'pointercancel', 'touchend', 'touchcancel']) {
|
|
54
|
+
window.addEventListener(type, disarm, { capture: true, once: true });
|
|
55
|
+
}
|
|
56
|
+
// A finger that never reports lifting (the page went away) stops the trap anyway.
|
|
57
|
+
window.setTimeout(disarm, 10_000);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* The hold itself. Spread `holdStart(id)` as a row's `onTouchStart`: a still
|
|
61
|
+
* finger for 0.45 s calls `onHold(id)`. Movement first (the row's swipe, the
|
|
62
|
+
* list's scroll), the finger lifting, or a second finger cancels it. The click
|
|
63
|
+
* the lifting finger makes is swallowed ({@link swallowReleaseClick}).
|
|
64
|
+
*
|
|
65
|
+
* const holdStart = useHold((id) => startSelecting(id))
|
|
66
|
+
* <li onTouchStart={selecting ? undefined : holdStart(row.id)}>…
|
|
67
|
+
*
|
|
68
|
+
* Touch only: the website ticks with its tick boxes.
|
|
69
|
+
*/
|
|
70
|
+
export function useHold(onHold, options = {}) {
|
|
71
|
+
const hold = useRef(null);
|
|
72
|
+
const cb = useRef(onHold);
|
|
73
|
+
cb.current = onHold;
|
|
74
|
+
const opts = useRef(options);
|
|
75
|
+
opts.current = options;
|
|
76
|
+
useEffect(() => {
|
|
77
|
+
const cancel = (e) => {
|
|
78
|
+
const h = hold.current;
|
|
79
|
+
if (!h)
|
|
80
|
+
return;
|
|
81
|
+
const t0 = e.touches[0];
|
|
82
|
+
if (e.type !== 'touchmove' || !t0 || e.touches.length > 1 || Math.hypot(t0.clientX - h.x, t0.clientY - h.y) > HOLD_SLOP_PX) {
|
|
83
|
+
clearTimeout(h.timer);
|
|
84
|
+
hold.current = null;
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
document.addEventListener('touchmove', cancel, { passive: true });
|
|
88
|
+
document.addEventListener('touchend', cancel);
|
|
89
|
+
document.addEventListener('touchcancel', cancel);
|
|
90
|
+
return () => {
|
|
91
|
+
if (hold.current)
|
|
92
|
+
clearTimeout(hold.current.timer);
|
|
93
|
+
hold.current = null;
|
|
94
|
+
document.removeEventListener('touchmove', cancel);
|
|
95
|
+
document.removeEventListener('touchend', cancel);
|
|
96
|
+
document.removeEventListener('touchcancel', cancel);
|
|
97
|
+
};
|
|
98
|
+
}, []);
|
|
99
|
+
return (id) => (e) => {
|
|
100
|
+
if (hold.current)
|
|
101
|
+
clearTimeout(hold.current.timer);
|
|
102
|
+
hold.current = null;
|
|
103
|
+
if (e.touches.length !== 1)
|
|
104
|
+
return;
|
|
105
|
+
const t0 = e.touches[0];
|
|
106
|
+
hold.current = {
|
|
107
|
+
x: t0.clientX,
|
|
108
|
+
y: t0.clientY,
|
|
109
|
+
timer: setTimeout(() => {
|
|
110
|
+
hold.current = null;
|
|
111
|
+
swallowReleaseClick();
|
|
112
|
+
if (opts.current.vibrate !== false)
|
|
113
|
+
navigator.vibrate?.(12);
|
|
114
|
+
cb.current(id);
|
|
115
|
+
}, opts.current.ms ?? HOLD_MS),
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
/** How far right a swipe from the left edge must travel to leave selection mode, px. */
|
|
120
|
+
const LEAVE_SWIPE_PX = 70;
|
|
121
|
+
/** …while wandering up or down less than this. */
|
|
122
|
+
const LEAVE_SWIPE_DRIFT_PX = 50;
|
|
123
|
+
/**
|
|
124
|
+
* Selection mode is left the phone's ways as well as by its Done button:
|
|
125
|
+
* Android's back gesture (a layer on the SDK's stack while `selecting`, so
|
|
126
|
+
* Back takes selection mode away rather than the page) and a swipe in from
|
|
127
|
+
* the left edge. `enabled: false` (the website) turns both off.
|
|
128
|
+
*/
|
|
129
|
+
export function useLeaveSelection(selecting, leave, options = {}) {
|
|
130
|
+
const on = selecting && options.enabled !== false;
|
|
131
|
+
const cb = useRef(leave);
|
|
132
|
+
cb.current = leave;
|
|
133
|
+
usePhoneLayer('page', () => cb.current(), { open: on, lockScroll: false });
|
|
134
|
+
useEffect(() => {
|
|
135
|
+
if (!on)
|
|
136
|
+
return;
|
|
137
|
+
let from = null;
|
|
138
|
+
const down = (e) => {
|
|
139
|
+
const t0 = e.touches[0];
|
|
140
|
+
from = t0 && t0.clientX < EDGE_SWIPE_START_PX ? { x: t0.clientX, y: t0.clientY } : null;
|
|
141
|
+
};
|
|
142
|
+
const move = (e) => {
|
|
143
|
+
const t0 = e.touches[0];
|
|
144
|
+
if (!from || !t0)
|
|
145
|
+
return;
|
|
146
|
+
if (t0.clientX - from.x > LEAVE_SWIPE_PX && Math.abs(t0.clientY - from.y) < LEAVE_SWIPE_DRIFT_PX) {
|
|
147
|
+
from = null;
|
|
148
|
+
cb.current();
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
document.addEventListener('touchstart', down, { passive: true });
|
|
152
|
+
document.addEventListener('touchmove', move, { passive: true });
|
|
153
|
+
return () => {
|
|
154
|
+
document.removeEventListener('touchstart', down);
|
|
155
|
+
document.removeEventListener('touchmove', move);
|
|
156
|
+
};
|
|
157
|
+
}, [on]);
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Selection mode for one list, started by a hold ({@link useHold}) and left
|
|
161
|
+
* by Done, Android's back or an edge swipe ({@link useLeaveSelection}).
|
|
162
|
+
* `ids` are the rows on screen, in order. Pair it with your own bar (the
|
|
163
|
+
* count, Select all, the list's bulk actions, Done) shown while `selecting`.
|
|
164
|
+
*
|
|
165
|
+
* const sel = useHoldSelect(rows.map((r) => r.id), { gestures: isPhoneApp })
|
|
166
|
+
*
|
|
167
|
+
* `gestures: false` keeps Back and the edge swipe out of it (a website).
|
|
168
|
+
*/
|
|
169
|
+
export function useHoldSelect(ids, options = {}) {
|
|
170
|
+
const [selected, setSelected] = useState(null);
|
|
171
|
+
const idsRef = useRef(ids);
|
|
172
|
+
idsRef.current = ids;
|
|
173
|
+
const last = useRef(null);
|
|
174
|
+
const selecting = selected !== null;
|
|
175
|
+
useLeaveSelection(selecting, () => setSelected(null), { enabled: options.gestures !== false });
|
|
176
|
+
function start(id) {
|
|
177
|
+
last.current = id ?? null;
|
|
178
|
+
setSelected((s) => {
|
|
179
|
+
const next = new Set(s ?? []);
|
|
180
|
+
if (id)
|
|
181
|
+
next.add(id);
|
|
182
|
+
return next;
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
const holdStart = useHold((id) => start(id), options);
|
|
186
|
+
return {
|
|
187
|
+
selecting,
|
|
188
|
+
isSelected: (id) => Boolean(selected?.has(id)),
|
|
189
|
+
picked: selected ? idsRef.current.filter((id) => selected.has(id)) : [],
|
|
190
|
+
start,
|
|
191
|
+
toggle: (id, range = false) => {
|
|
192
|
+
// Read now, not inside the updater: React may run that after the line
|
|
193
|
+
// below has already moved `last` on (BlackBook's copy did, and a
|
|
194
|
+
// Shift-click then ticked one row instead of the run).
|
|
195
|
+
const from = last.current;
|
|
196
|
+
setSelected((s) => {
|
|
197
|
+
const next = new Set(s ?? []);
|
|
198
|
+
const order = idsRef.current;
|
|
199
|
+
if (range && from && order.includes(from)) {
|
|
200
|
+
const [a, b] = [order.indexOf(from), order.indexOf(id)].sort((x, y) => x - y);
|
|
201
|
+
for (const x of order.slice(a, b + 1))
|
|
202
|
+
next.add(x);
|
|
203
|
+
}
|
|
204
|
+
else if (next.has(id))
|
|
205
|
+
next.delete(id);
|
|
206
|
+
else
|
|
207
|
+
next.add(id);
|
|
208
|
+
return next;
|
|
209
|
+
});
|
|
210
|
+
last.current = id;
|
|
211
|
+
},
|
|
212
|
+
all: () => setSelected((s) => (s && s.size === idsRef.current.length ? new Set() : new Set(idsRef.current))),
|
|
213
|
+
done: () => setSelected(null),
|
|
214
|
+
holdStart,
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Delete now, Undo for a while (six seconds by default): what was deleted and
|
|
219
|
+
* the way to put it back. The rule's "Delete offers Undo". Show your own
|
|
220
|
+
* toast while `item` is set; From Universal BlackBook.
|
|
221
|
+
*/
|
|
222
|
+
export function useUndo(restore, ms = 6000) {
|
|
223
|
+
const [item, setItem] = useState(null);
|
|
224
|
+
const timer = useRef(undefined);
|
|
225
|
+
useEffect(() => () => clearTimeout(timer.current), []);
|
|
226
|
+
return {
|
|
227
|
+
/** What can still be put back, or null. */
|
|
228
|
+
item,
|
|
229
|
+
/** Something was deleted: offer it back for `ms`. */
|
|
230
|
+
deleted: (x) => {
|
|
231
|
+
setItem(x);
|
|
232
|
+
clearTimeout(timer.current);
|
|
233
|
+
timer.current = setTimeout(() => setItem(null), ms);
|
|
234
|
+
},
|
|
235
|
+
/** Put it back. */
|
|
236
|
+
undo: async () => {
|
|
237
|
+
if (item === null)
|
|
238
|
+
return;
|
|
239
|
+
clearTimeout(timer.current);
|
|
240
|
+
await restore(item);
|
|
241
|
+
setItem(null);
|
|
242
|
+
},
|
|
243
|
+
/** Forget it without restoring (the toast was dismissed). */
|
|
244
|
+
dismiss: () => {
|
|
245
|
+
clearTimeout(timer.current);
|
|
246
|
+
setItem(null);
|
|
247
|
+
},
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
//# sourceMappingURL=hold.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hold.js","sourceRoot":"","sources":["../../src/phone/hold.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,8EAA8E;AAC9E,0EAA0E;AAC1E,6EAA6E;AAC7E,6EAA6E;AAC7E,2EAA2E;AAC3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CAAC,CAAA;IAC9D,SAAS,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAA;IACtD,OAAO;QACL,2CAA2C;QAC3C,IAAI;QACJ,qDAAqD;QACrD,OAAO,EAAE,CAAC,CAAI,EAAE,EAAE;YAChB,OAAO,CAAC,CAAC,CAAC,CAAA;YACV,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;YAC3B,KAAK,CAAC,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAA;QACrD,CAAC;QACD,mBAAmB;QACnB,IAAI,EAAE,KAAK,IAAI,EAAE;YACf,IAAI,IAAI,KAAK,IAAI;gBAAE,OAAM;YACzB,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;YAC3B,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;YACnB,OAAO,CAAC,IAAI,CAAC,CAAA;QACf,CAAC;QACD,6DAA6D;QAC7D,OAAO,EAAE,GAAG,EAAE;YACZ,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;YAC3B,OAAO,CAAC,IAAI,CAAC,CAAA;QACf,CAAC;KACF,CAAA;AACH,CAAC"}
|
package/dist/phone/index.d.ts
CHANGED
|
@@ -13,4 +13,16 @@ export { useScrollHint, SCROLL_HINT_FADE_PX } from './scrollHint.js';
|
|
|
13
13
|
export type { ScrollHint } from './scrollHint.js';
|
|
14
14
|
export { injectPhoneStyles, PHONE_STYLE_ID } from './styles.js';
|
|
15
15
|
export type { PhoneTheme } from './styles.js';
|
|
16
|
+
export { SwipeRow, SwipeGroup } from './SwipeRow.js';
|
|
17
|
+
export type { SwipeRowProps, SwipeAction } from './SwipeRow.js';
|
|
18
|
+
export { SWIPE_ACTION_WIDTH, SWIPE_AXIS_SLOP, SWIPE_FIRE_DISTANCE, SWIPE_FIRE_TRAVEL, decideSwipeAxis, swipeDragOffset, swipeSettles, swipeRestingOffset, swipeFiresOnRelease, swipeDragOffsetFromOpen, } from './swipeGeometry.js';
|
|
19
|
+
export type { SwipeAxis, SwipeSide, SwipeWidths } from './swipeGeometry.js';
|
|
20
|
+
export { useHold, useLeaveSelection, useHoldSelect, useUndo, swallowReleaseClick, HOLD_MS, HOLD_SLOP_PX } from './hold.js';
|
|
21
|
+
export type { HoldOptions, HoldSelect } from './hold.js';
|
|
22
|
+
export { useTabReorder, TabBin, useTabOrderList, TabOrderList, TAB_HOLD_MS } from './TabReorder.js';
|
|
23
|
+
export type { TabReorderOptions, TabReorder, TabBinProps, TabOrderListState, TabOrderListProps } from './TabReorder.js';
|
|
24
|
+
export { moveTab, normaliseTabOrder, isDefaultTabOrder, withShownOrder } from './tabOrder.js';
|
|
25
|
+
export { phoneListCopy, PHONE_LIST_COPY } from './listCopy.js';
|
|
26
|
+
export type { PhoneListCopy } from './listCopy.js';
|
|
27
|
+
export { injectPhoneListStyles, PHONE_LIST_STYLE_ID } from './listStyles.js';
|
|
16
28
|
//# sourceMappingURL=index.d.ts.map
|