@unisim/sdk 0.229.0 → 0.230.1
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 +122 -1
- package/dist/DevelopmentRibbon.d.ts.map +1 -1
- package/dist/DevelopmentRibbon.js +39 -2
- package/dist/DevelopmentRibbon.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/package.json +2 -1
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
// A row that swipes (BRANDING.md ▸ "A deletable row swipes: delete one way, a
|
|
4
|
+
// second action the other", owner rule 2026-10-25): swipe LEFT to uncover the
|
|
5
|
+
// action on the right edge (Delete, with Undo), swipe RIGHT for the list's
|
|
6
|
+
// second action on the left edge (Pin, Select, Edit…).
|
|
7
|
+
//
|
|
8
|
+
// Moved here in 0.230.0 from Universal BlackBook (`SwipeRow.tsx` +
|
|
9
|
+
// `lib/swipe.ts` + `SwipeGroup`, the rule's reference), reconciled with
|
|
10
|
+
// Universal PDF's `SwipeRow` (`src/native/parts.tsx`) and Workplace Assess's
|
|
11
|
+
// `native/swipe.jsx`. Kept from each:
|
|
12
|
+
// - BlackBook: a first swipe only REVEALS; a second swipe the same way on a
|
|
13
|
+
// row already open runs it (owner ask 2026-11-11), as a tap on the button
|
|
14
|
+
// does. The buttons are drawn only while the row is off its rest (drawn
|
|
15
|
+
// under a resting card, their colour bled through its round corners). The
|
|
16
|
+
// click a drag leaves behind is swallowed wherever it lands, and a tap on
|
|
17
|
+
// an open row closes it instead of opening the row. Rows of one list sit
|
|
18
|
+
// in a <SwipeGroup>: opening one closes the other.
|
|
19
|
+
// - PDF / Workplace: one row open at a time even with no group (a module-
|
|
20
|
+
// level "the open one"); `data-swipe-open` on the row for tests and CSS.
|
|
21
|
+
// New here: the actions as buttons that show on focus (VoiceOver, TalkBack,
|
|
22
|
+
// keyboard: the rule's "accessible equivalent"), on by default; an action's
|
|
23
|
+
// tone ('danger' | 'accent' | 'neutral') or the app's own class; reduced
|
|
24
|
+
// motion settles at once.
|
|
25
|
+
//
|
|
26
|
+
// ⚠️ Touch only. A horizontal drag with a mouse is a text selection everywhere
|
|
27
|
+
// else on the web, so every action here must also exist somewhere a finger is
|
|
28
|
+
// not needed — which `focusActions` and the website's own buttons are.
|
|
29
|
+
//
|
|
30
|
+
// ⚠️ `touch-action: pan-y` on the row is load-bearing: vertical scrolling stays
|
|
31
|
+
// the browser's, horizontal panning is ours. React's touchmove is passive, so
|
|
32
|
+
// preventDefault() there could not stop a scroll.
|
|
33
|
+
import { createContext, useContext, useEffect, useInsertionEffect, useRef, useState, } from 'react';
|
|
34
|
+
import { injectPhoneListStyles } from './listStyles.js';
|
|
35
|
+
import { cx } from './styles.js';
|
|
36
|
+
import { SWIPE_ACTION_WIDTH, decideSwipeAxis, swipeDragOffsetFromOpen, swipeFiresOnRelease, swipeRestingOffset, swipeSettles, } from './swipeGeometry.js';
|
|
37
|
+
const Group = createContext(null);
|
|
38
|
+
/**
|
|
39
|
+
* One list's rows: at most one swiped open at a time. Wrap the list, and give
|
|
40
|
+
* each <SwipeRow> an `id`.
|
|
41
|
+
*/
|
|
42
|
+
export function SwipeGroup({ children }) {
|
|
43
|
+
const [open, set] = useState(null);
|
|
44
|
+
return _jsx(Group.Provider, { value: { open, set }, children: children });
|
|
45
|
+
}
|
|
46
|
+
// Rows outside any group: still one open at a time, across the page.
|
|
47
|
+
let closeLoose = null;
|
|
48
|
+
const reduced = () => typeof window !== 'undefined' && typeof window.matchMedia === 'function' && window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
49
|
+
/**
|
|
50
|
+
* A row that swipes sideways to uncover an action. A first swipe only
|
|
51
|
+
* uncovers it; a tap on it, or a second swipe the same way, runs it (and
|
|
52
|
+
* closes the row). A short swipe settles back. The click a swipe leaves behind
|
|
53
|
+
* never opens the row, and a tap on an open row closes it.
|
|
54
|
+
*/
|
|
55
|
+
export function SwipeRow({ left, right, id, open: openProp, onOpenChange, fireOnSecondSwipe = true, focusActions = true, disabled = false, actionWidth = SWIPE_ACTION_WIDTH, className, frontClassName, children, }) {
|
|
56
|
+
useInsertionEffect(() => injectPhoneListStyles(), []);
|
|
57
|
+
const group = useContext(Group);
|
|
58
|
+
const [own, setOwn] = useState(null);
|
|
59
|
+
const controlled = openProp !== undefined;
|
|
60
|
+
const grouped = !controlled && group !== null && id !== undefined;
|
|
61
|
+
const open = controlled ? openProp : grouped ? (group.open?.id === id ? group.open.side : null) : own;
|
|
62
|
+
const changeRef = useRef(onOpenChange);
|
|
63
|
+
changeRef.current = onOpenChange;
|
|
64
|
+
const shut = useRef(null);
|
|
65
|
+
if (!shut.current)
|
|
66
|
+
shut.current = () => setOwn(null);
|
|
67
|
+
useEffect(() => () => {
|
|
68
|
+
if (closeLoose === shut.current)
|
|
69
|
+
closeLoose = null;
|
|
70
|
+
}, []);
|
|
71
|
+
const setOpen = (side) => {
|
|
72
|
+
if (grouped)
|
|
73
|
+
group.set(side ? { id, side } : null);
|
|
74
|
+
else if (!controlled) {
|
|
75
|
+
setOwn(side);
|
|
76
|
+
if (side) {
|
|
77
|
+
if (closeLoose && closeLoose !== shut.current)
|
|
78
|
+
closeLoose();
|
|
79
|
+
closeLoose = shut.current;
|
|
80
|
+
}
|
|
81
|
+
else if (closeLoose === shut.current)
|
|
82
|
+
closeLoose = null;
|
|
83
|
+
}
|
|
84
|
+
changeRef.current?.(side);
|
|
85
|
+
};
|
|
86
|
+
const widths = { left: left ? actionWidth : 0, right: right ? actionWidth : 0 };
|
|
87
|
+
const [offset, setOffset] = useState(0);
|
|
88
|
+
const [dragging, setDragging] = useState(false);
|
|
89
|
+
const start = useRef({ x: 0, y: 0, base: 0, open: null });
|
|
90
|
+
const travel = useRef(0);
|
|
91
|
+
const axis = useRef('none');
|
|
92
|
+
// Set when a drag moved the row; read by the click the browser fires after.
|
|
93
|
+
// Until a moment after the finger lifts, not until the next click: a swipe
|
|
94
|
+
// makes no click of its own, and a later real one (a keyboard's, a focus
|
|
95
|
+
// button's) must not be eaten in its place.
|
|
96
|
+
const swiped = useRef(false);
|
|
97
|
+
const swallowUntil = useRef(0);
|
|
98
|
+
// Follow the open side — including "another row opened, so close". Skipped
|
|
99
|
+
// mid-drag, where the finger is the truth.
|
|
100
|
+
useEffect(() => {
|
|
101
|
+
if (!dragging)
|
|
102
|
+
setOffset(swipeRestingOffset(open, widths));
|
|
103
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
104
|
+
}, [open, dragging, widths.left, widths.right]);
|
|
105
|
+
useEffect(() => {
|
|
106
|
+
if (disabled && open)
|
|
107
|
+
setOpen(null);
|
|
108
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
109
|
+
}, [disabled]);
|
|
110
|
+
const run = (a) => {
|
|
111
|
+
setOffset(0);
|
|
112
|
+
setOpen(null);
|
|
113
|
+
a.onAction();
|
|
114
|
+
};
|
|
115
|
+
const onTouchStart = (e) => {
|
|
116
|
+
if (disabled || e.touches.length !== 1)
|
|
117
|
+
return;
|
|
118
|
+
const t = e.touches[0];
|
|
119
|
+
start.current = { x: t.clientX, y: t.clientY, base: swipeRestingOffset(open, widths), open };
|
|
120
|
+
travel.current = 0;
|
|
121
|
+
axis.current = 'none';
|
|
122
|
+
swiped.current = false;
|
|
123
|
+
setDragging(true);
|
|
124
|
+
};
|
|
125
|
+
const onTouchMove = (e) => {
|
|
126
|
+
if (!dragging)
|
|
127
|
+
return;
|
|
128
|
+
const t = e.touches[0];
|
|
129
|
+
if (!t)
|
|
130
|
+
return;
|
|
131
|
+
const dx = t.clientX - start.current.x;
|
|
132
|
+
const dy = t.clientY - start.current.y;
|
|
133
|
+
if (axis.current === 'none')
|
|
134
|
+
axis.current = decideSwipeAxis(dx, dy);
|
|
135
|
+
if (axis.current !== 'x')
|
|
136
|
+
return;
|
|
137
|
+
swiped.current = true;
|
|
138
|
+
travel.current = dx;
|
|
139
|
+
setOffset(swipeDragOffsetFromOpen(start.current.open, start.current.base, dx, widths));
|
|
140
|
+
};
|
|
141
|
+
const end = () => {
|
|
142
|
+
if (!dragging)
|
|
143
|
+
return;
|
|
144
|
+
setDragging(false);
|
|
145
|
+
if (axis.current !== 'x')
|
|
146
|
+
return;
|
|
147
|
+
swallowUntil.current = Date.now() + 400;
|
|
148
|
+
const fire = fireOnSecondSwipe ? swipeFiresOnRelease(start.current.open, travel.current, widths) : null;
|
|
149
|
+
const action = fire === 'right' ? right : fire === 'left' ? left : undefined;
|
|
150
|
+
if (action) {
|
|
151
|
+
navigator.vibrate?.(12);
|
|
152
|
+
run(action);
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
const next = swipeSettles(offset, widths);
|
|
156
|
+
setOffset(swipeRestingOffset(next, widths));
|
|
157
|
+
if (next !== open)
|
|
158
|
+
setOpen(next);
|
|
159
|
+
};
|
|
160
|
+
const focusList = focusActions === false
|
|
161
|
+
? []
|
|
162
|
+
: [
|
|
163
|
+
...(Array.isArray(focusActions) ? focusActions : []),
|
|
164
|
+
...[left, right].filter((a) => Boolean(a)).map((a) => ({ label: a.label, onClick: () => run(a) })),
|
|
165
|
+
];
|
|
166
|
+
const button = (a, side) => {
|
|
167
|
+
const isOpen = open === side;
|
|
168
|
+
return (_jsx("div", { className: "unisim-swipe-action", "data-side": side, children: _jsxs("button", { type: "button", onClick: () => run(a), "aria-label": a.label,
|
|
169
|
+
// Behind the card while closed: not a tab stop and not announced.
|
|
170
|
+
tabIndex: isOpen ? 0 : -1, "aria-hidden": !isOpen, "data-tone": a.tone ?? 'accent', className: a.className,
|
|
171
|
+
// Grows with a second swipe past the open edge, so no gap opens up.
|
|
172
|
+
style: { width: Math.max(actionWidth, Math.abs(offset)) }, children: [a.icon, a.text] }) }));
|
|
173
|
+
};
|
|
174
|
+
return (_jsxs("div", { className: cx('unisim-swipe', className), "data-swipe-x": "", "data-swipe-open": open ?? undefined, "data-swipe-dragging": dragging && axis.current === 'x' ? '' : undefined, onTouchStart: onTouchStart, onTouchMove: onTouchMove, onTouchEnd: end, onTouchCancel: end, onClickCapture: (e) => {
|
|
175
|
+
// The click a drag leaves behind, wherever it lands.
|
|
176
|
+
if (!swiped.current || Date.now() > swallowUntil.current)
|
|
177
|
+
return;
|
|
178
|
+
e.preventDefault();
|
|
179
|
+
e.stopPropagation();
|
|
180
|
+
swiped.current = false;
|
|
181
|
+
if (open)
|
|
182
|
+
setOpen(null);
|
|
183
|
+
}, children: [left && (offset > 0 || open === 'left') && button(left, 'left'), right && (offset < 0 || open === 'right') && button(right, 'right'), _jsxs("div", { className: cx('unisim-swipe-front', frontClassName), style: { transform: offset ? `translateX(${offset}px)` : undefined, transition: reduced() ? 'none' : undefined }, onClickCapture: (e) => {
|
|
184
|
+
// A tap on a row that is open closes it rather than opening the row.
|
|
185
|
+
if (!open)
|
|
186
|
+
return;
|
|
187
|
+
e.preventDefault();
|
|
188
|
+
e.stopPropagation();
|
|
189
|
+
setOpen(null);
|
|
190
|
+
}, children: [children, focusList.map((a) => (_jsx("button", { type: "button", className: "unisim-swipe-focus", onClick: a.onClick, children: a.label }, a.label)))] })] }));
|
|
191
|
+
}
|
|
192
|
+
//# sourceMappingURL=SwipeRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SwipeRow.js","sourceRoot":"","sources":["../../src/phone/SwipeRow.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,8EAA8E;AAC9E,8EAA8E;AAC9E,2EAA2E;AAC3E,uDAAuD;AACvD,EAAE;AACF,mEAAmE;AACnE,wEAAwE;AACxE,6EAA6E;AAC7E,sCAAsC;AACtC,6EAA6E;AAC7E,6EAA6E;AAC7E,2EAA2E;AAC3E,6EAA6E;AAC7E,6EAA6E;AAC7E,4EAA4E;AAC5E,sDAAsD;AACtD,2EAA2E;AAC3E,4EAA4E;AAC5E,4EAA4E;AAC5E,4EAA4E;AAC5E,yEAAyE;AACzE,0BAA0B;AAC1B,EAAE;AACF,+EAA+E;AAC/E,8EAA8E;AAC9E,uEAAuE;AACvE,EAAE;AACF,gFAAgF;AAChF,8EAA8E;AAC9E,kDAAkD;AAElD,OAAO,EACL,aAAa,EACb,UAAU,EACV,SAAS,EACT,kBAAkB,EAClB,MAAM,EACN,QAAQ,GAGT,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,qBAAqB,EAAE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,CAAC,IAAI;wBAAE,OAAM;oBACjB,CAAC,CAAC,cAAc,EAAE,CAAA;oBAClB,CAAC,CAAC,eAAe,EAAE,CAAA;oBACnB,OAAO,CAAC,IAAI,CAAC,CAAA;gBACf,CAAC,aAEA,QAAQ,EACR,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CACpB,iBAAsB,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,oBAAoB,EAAC,OAAO,EAAE,CAAC,CAAC,OAAO,YAClF,CAAC,CAAC,KAAK,IADG,CAAC,CAAC,KAAK,CAEX,CACV,CAAC,IACE,IACF,CACP,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { type MouseEvent as ReactMouseEvent, type PointerEvent as ReactPointerEvent, type ReactNode, type RefObject, type TouchEvent as ReactTouchEvent } from 'react';
|
|
2
|
+
/** How long a tab is held before it lifts, ms. */
|
|
3
|
+
export declare const TAB_HOLD_MS = 500;
|
|
4
|
+
export interface TabReorderOptions<T extends string> {
|
|
5
|
+
/**
|
|
6
|
+
* The tabs on the bar that can move, in order — not Tune this app, which
|
|
7
|
+
* stays last and is never given `tabProps`.
|
|
8
|
+
*/
|
|
9
|
+
tabs: readonly T[];
|
|
10
|
+
/**
|
|
11
|
+
* Let go somewhere new: the moved tabs, in their new order. Write it back
|
|
12
|
+
* with `withShownOrder(fullOrder, order)` if the bar hides some tabs.
|
|
13
|
+
*/
|
|
14
|
+
onReorder: (order: T[]) => void;
|
|
15
|
+
/**
|
|
16
|
+
* Dropped on the bin: switch this tab off (and offer Undo). Without it
|
|
17
|
+
* there is no bin.
|
|
18
|
+
*/
|
|
19
|
+
onBin?: (tab: T) => void;
|
|
20
|
+
/** Which tabs may be binned. Default: every tab, while `onBin` is given. Never the last one shown. */
|
|
21
|
+
canBin?: (tab: T) => boolean;
|
|
22
|
+
/** Hold time, ms. Default 500. */
|
|
23
|
+
holdMs?: number;
|
|
24
|
+
/** Off (e.g. on the website, which drags with the mouse). Default true. */
|
|
25
|
+
enabled?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface TabReorder<T extends string> {
|
|
28
|
+
/** The tabs in the order to draw them: the live order while one is lifted. */
|
|
29
|
+
order: T[];
|
|
30
|
+
/** The tab being dragged, or null. */
|
|
31
|
+
dragging: T | null;
|
|
32
|
+
/** The finger is over the bin. */
|
|
33
|
+
overBin: boolean;
|
|
34
|
+
/** Show the bin: a tab that may be binned is lifted. */
|
|
35
|
+
showBin: boolean;
|
|
36
|
+
/** On the bar (`<nav ref={barRef}>`): the lifting finger's click is swallowed only there. */
|
|
37
|
+
barRef: RefObject<HTMLElement>;
|
|
38
|
+
/** On the bin (<TabBin> takes it as `binRef`). */
|
|
39
|
+
binRef: RefObject<HTMLDivElement>;
|
|
40
|
+
/**
|
|
41
|
+
* Spread on each movable tab's button: its touch start, no system menu on
|
|
42
|
+
* a hold, `data-reorder-tab`, and `data-reorder-lifted` while it is dragged
|
|
43
|
+
* (the SDK draws it raised; the app's own CSS may restyle it).
|
|
44
|
+
*/
|
|
45
|
+
tabProps: (tab: T) => {
|
|
46
|
+
'data-reorder-tab': T;
|
|
47
|
+
'data-reorder-lifted'?: '';
|
|
48
|
+
onTouchStart: (e: ReactTouchEvent) => void;
|
|
49
|
+
onContextMenu: (e: ReactMouseEvent) => void;
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Hold a tab and drag it along the bar. While one is lifted, `order` is where
|
|
54
|
+
* it would land; letting go calls `onReorder` (if it moved) or `onBin` (over
|
|
55
|
+
* the bin). The click the lifting finger makes on the bar is swallowed, so a
|
|
56
|
+
* hold is never a tap (nor half of a double tap); a quick tap elsewhere — an
|
|
57
|
+
* Undo — still counts.
|
|
58
|
+
*
|
|
59
|
+
* const r = useTabReorder({ tabs: shown, onReorder: (o) => save(withShownOrder(all, o)), onBin: hide })
|
|
60
|
+
* <nav ref={r.barRef}>{[...r.order, 'tune'].map((t) => <button {...(t === 'tune' ? {} : r.tabProps(t))} … />)}</nav>
|
|
61
|
+
* {r.showBin && <TabBin binRef={r.binRef} over={r.overBin} />}
|
|
62
|
+
*/
|
|
63
|
+
export declare function useTabReorder<T extends string>({ tabs, onReorder, onBin, canBin, holdMs, enabled, }: TabReorderOptions<T>): TabReorder<T>;
|
|
64
|
+
export interface TabBinProps {
|
|
65
|
+
/** From {@link useTabReorder}. */
|
|
66
|
+
binRef: RefObject<HTMLDivElement>;
|
|
67
|
+
/** The finger is over it: red, "Let go to hide". */
|
|
68
|
+
over: boolean;
|
|
69
|
+
/** The words, if not the SDK's ("Drop here to hide" / "Let go to hide"). */
|
|
70
|
+
hint?: string;
|
|
71
|
+
drop?: string;
|
|
72
|
+
icon?: ReactNode;
|
|
73
|
+
language?: string;
|
|
74
|
+
/** Its place, if not just above the tab bar. */
|
|
75
|
+
className?: string;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* The bin a held tab can be dropped on, to hide it. Show it while
|
|
79
|
+
* `showBin`. Fixed above the foot of the screen; `className` moves it.
|
|
80
|
+
*/
|
|
81
|
+
export declare function TabBin({ binRef, over, hint, drop, icon, language, className }: TabBinProps): import("react/jsx-runtime").JSX.Element;
|
|
82
|
+
export interface TabOrderListState<T extends string> {
|
|
83
|
+
/** The tab whose grip is held, or null. */
|
|
84
|
+
held: T | null;
|
|
85
|
+
/** On the list (`<ol ref={listRef}>`); its children are the rows, in order. */
|
|
86
|
+
listRef: RefObject<HTMLOListElement>;
|
|
87
|
+
/** Spread on a row's grip: drag it (mouse or finger) up and down the list. */
|
|
88
|
+
gripProps: (tab: T) => {
|
|
89
|
+
onPointerDown: (e: ReactPointerEvent<HTMLElement>) => void;
|
|
90
|
+
onPointerMove: (e: ReactPointerEvent<HTMLElement>) => void;
|
|
91
|
+
onPointerUp: () => void;
|
|
92
|
+
onPointerCancel: () => void;
|
|
93
|
+
};
|
|
94
|
+
/** Move one tab to an index (Move up: `move(tab, i - 1)`). */
|
|
95
|
+
move: (tab: T, to: number) => void;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Tune this app ▸ Tab order, without the drawing: a grip per row to drag (the
|
|
99
|
+
* row under the pointer takes the tab's place) and `move` for the Move up /
|
|
100
|
+
* Move down buttons. `order` is the whole order, hidden tabs included, so a
|
|
101
|
+
* tab switched back on returns to its place.
|
|
102
|
+
*/
|
|
103
|
+
export declare function useTabOrderList<T extends string>(order: readonly T[], onChange: (order: T[]) => void): TabOrderListState<T>;
|
|
104
|
+
export interface TabOrderListProps<T extends string> {
|
|
105
|
+
/** The whole order, hidden tabs included. */
|
|
106
|
+
order: readonly T[];
|
|
107
|
+
onChange: (order: T[]) => void;
|
|
108
|
+
/** A tab's name, in the app's language. */
|
|
109
|
+
label: (tab: T) => string;
|
|
110
|
+
/** Tabs switched off just now: listed, marked "hidden". */
|
|
111
|
+
hidden?: (tab: T) => boolean;
|
|
112
|
+
/** The heading and the line under it, if not the SDK's. `note={null}` drops the line. */
|
|
113
|
+
title?: string;
|
|
114
|
+
note?: string | null;
|
|
115
|
+
language?: string;
|
|
116
|
+
className?: string;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Tune this app ▸ Tab order: the tab bar's order as a list, each row with a
|
|
120
|
+
* grip to drag and Move up / Move down buttons — the accessible way to do
|
|
121
|
+
* what a hold and a drag do on the bar. Reset to defaults is the app's (it
|
|
122
|
+
* puts its stored order back).
|
|
123
|
+
*/
|
|
124
|
+
export declare function TabOrderList<T extends string>({ order, onChange, label, hidden, title, note, language, className }: TabOrderListProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
125
|
+
//# sourceMappingURL=TabReorder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TabReorder.d.ts","sourceRoot":"","sources":["../../src/phone/TabReorder.tsx"],"names":[],"mappings":"AAqBA,OAAO,EAKL,KAAK,UAAU,IAAI,eAAe,EAClC,KAAK,YAAY,IAAI,iBAA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D,IAAI,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;CACnC;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,IAAI,GAAG,iBAAiB,CAAC,CAAC,CAAC,CA2B3H;AAED,MAAM,WAAW,iBAAiB,CAAC,CAAC,SAAS,MAAM;IACjD,6CAA6C;IAC7C,KAAK,EAAE,SAAS,CAAC,EAAE,CAAA;IACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,IAAI,CAAA;IAC9B,2CAA2C;IAC3C,KAAK,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,MAAM,CAAA;IACzB,2DAA2D;IAC3D,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,OAAO,CAAA;IAC5B,yFAAyF;IACzF,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAkBD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,MAAM,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,iBAAiB,CAAC,CAAC,CAAC,2CA8CxI"}
|
|
@@ -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;AAC9E,+EAA+E;AAC/E,8EAA8E;AAC9E,0CAA0C;AAC1C,EAAE;AACF,2EAA2E;AAC3E,6EAA6E;AAC7E,yEAAyE;AACzE,qEAAqE;AACrE,+EAA+E;AAC/E,0CAA0C;AAE1C,OAAO,EACL,SAAS,EACT,kBAAkB,EAClB,MAAM,EACN,QAAQ,GAMT,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAA;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAEvC,kDAAkD;AAClD,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAAA;AAC9B,yEAAyE;AACzE,MAAM,gBAAgB,GAAG,EAAE,CAAA;AAC3B,yDAAyD;AACzD,MAAM,UAAU,GAAG,EAAE,CAAA;AAErB,SAAS,OAAO,CAAC,QAAwB;IACvC,MAAM,YAAY,GAAG,mB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