@ankhorage/zora 25.8.11 → 25.8.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.md +2 -1
- package/dist/features/grid-interactions/adapters/inbound/GridInteractions.d.ts.map +1 -1
- package/dist/features/grid-interactions/adapters/inbound/GridInteractions.js +11 -2
- package/dist/features/grid-interactions/adapters/inbound/GridInteractions.js.map +1 -1
- package/dist/features/grid-interactions/adapters/inbound/useGridInteractionScrollLock.d.ts +2 -0
- package/dist/features/grid-interactions/adapters/inbound/useGridInteractionScrollLock.d.ts.map +1 -0
- package/dist/features/grid-interactions/adapters/inbound/useGridInteractionScrollLock.js +2 -0
- package/dist/features/grid-interactions/adapters/inbound/useGridInteractionScrollLock.js.map +1 -0
- package/dist/features/grid-interactions/adapters/inbound/useGridInteractionScrollLock.native.d.ts +4 -0
- package/dist/features/grid-interactions/adapters/inbound/useGridInteractionScrollLock.native.d.ts.map +1 -0
- package/dist/features/grid-interactions/adapters/inbound/useGridInteractionScrollLock.native.js +11 -0
- package/dist/features/grid-interactions/adapters/inbound/useGridInteractionScrollLock.native.js.map +1 -0
- package/dist/features/grid-interactions/adapters/inbound/useGridInteractionScrollLock.web.d.ts +4 -0
- package/dist/features/grid-interactions/adapters/inbound/useGridInteractionScrollLock.web.d.ts.map +1 -0
- package/dist/features/grid-interactions/adapters/inbound/useGridInteractionScrollLock.web.js +9 -0
- package/dist/features/grid-interactions/adapters/inbound/useGridInteractionScrollLock.web.js.map +1 -0
- package/dist/features/grid-interactions/application/createGridInteractionScrollLock.d.ts +5 -0
- package/dist/features/grid-interactions/application/createGridInteractionScrollLock.d.ts.map +1 -0
- package/dist/features/grid-interactions/application/createGridInteractionScrollLock.js +14 -0
- package/dist/features/grid-interactions/application/createGridInteractionScrollLock.js.map +1 -0
- package/dist/features/grid-view/adapters/inbound/GridView.d.ts.map +1 -1
- package/dist/features/grid-view/adapters/inbound/GridView.js +34 -30
- package/dist/features/grid-view/adapters/inbound/GridView.js.map +1 -1
- package/dist/features/grid-view/application/createGridScrollSync.d.ts +7 -0
- package/dist/features/grid-view/application/createGridScrollSync.d.ts.map +1 -0
- package/dist/features/grid-view/application/createGridScrollSync.js +141 -0
- package/dist/features/grid-view/application/createGridScrollSync.js.map +1 -0
- package/dist/features/grid-view/application/resolveScrollEventSource.d.ts +4 -0
- package/dist/features/grid-view/application/resolveScrollEventSource.d.ts.map +1 -0
- package/dist/features/grid-view/application/resolveScrollEventSource.js +8 -0
- package/dist/features/grid-view/application/resolveScrollEventSource.js.map +1 -0
- package/dist/features/grid-view/constants/scroll.d.ts +7 -0
- package/dist/features/grid-view/constants/scroll.d.ts.map +1 -0
- package/dist/features/grid-view/constants/scroll.js +7 -0
- package/dist/features/grid-view/constants/scroll.js.map +1 -0
- package/dist/features/layout/adapters/inbound/ScrollGestureLockContext.d.ts +5 -0
- package/dist/features/layout/adapters/inbound/ScrollGestureLockContext.d.ts.map +1 -0
- package/dist/features/layout/adapters/inbound/ScrollGestureLockContext.js +4 -0
- package/dist/features/layout/adapters/inbound/ScrollGestureLockContext.js.map +1 -0
- package/dist/features/layout/adapters/inbound/ScrollView.d.ts.map +1 -1
- package/dist/features/layout/adapters/inbound/ScrollView.js +11 -3
- package/dist/features/layout/adapters/inbound/ScrollView.js.map +1 -1
- package/dist/features/layout/adapters/inbound/useScrollGestureLock.d.ts +4 -0
- package/dist/features/layout/adapters/inbound/useScrollGestureLock.d.ts.map +1 -0
- package/dist/features/layout/adapters/inbound/useScrollGestureLock.js +8 -0
- package/dist/features/layout/adapters/inbound/useScrollGestureLock.js.map +1 -0
- package/dist/features/layout/public.d.ts +2 -1
- package/dist/features/layout/public.d.ts.map +1 -1
- package/dist/features/layout/public.js +1 -0
- package/dist/features/layout/public.js.map +1 -1
- package/dist/features/layout/utils/createScrollGestureLock.d.ts +4 -0
- package/dist/features/layout/utils/createScrollGestureLock.d.ts.map +1 -0
- package/dist/features/layout/utils/createScrollGestureLock.js +18 -0
- package/dist/features/layout/utils/createScrollGestureLock.js.map +1 -0
- package/dist/types/grid-interactions.d.ts +5 -0
- package/dist/types/grid-interactions.d.ts.map +1 -1
- package/dist/types/grid-interactions.js.map +1 -1
- package/dist/types/grid-view.d.ts +40 -0
- package/dist/types/grid-view.d.ts.map +1 -1
- package/dist/types/grid-view.js.map +1 -1
- package/dist/types/layout.d.ts +5 -0
- package/dist/types/layout.d.ts.map +1 -1
- package/dist/types/layout.js.map +1 -1
- package/package.json +2 -2
- package/src/features/grid-interactions/adapters/inbound/GridInteractions.scrollLock.test.tsx +265 -0
- package/src/features/grid-interactions/adapters/inbound/GridInteractions.test.tsx +64 -0
- package/src/features/grid-interactions/adapters/inbound/GridInteractions.tsx +12 -4
- package/src/features/grid-interactions/adapters/inbound/useGridInteractionScrollLock.native.ts +17 -0
- package/src/features/grid-interactions/adapters/inbound/useGridInteractionScrollLock.ts +1 -0
- package/src/features/grid-interactions/adapters/inbound/useGridInteractionScrollLock.web.ts +11 -0
- package/src/features/grid-interactions/application/createGridInteractionScrollLock.test.ts +41 -0
- package/src/features/grid-interactions/application/createGridInteractionScrollLock.ts +18 -0
- package/src/features/grid-view/adapters/inbound/GridView.nativeScrollSync.test.tsx +186 -0
- package/src/features/grid-view/adapters/inbound/GridView.scrollSync.interaction.test.tsx +304 -0
- package/src/features/grid-view/adapters/inbound/GridView.tsx +49 -29
- package/src/features/grid-view/application/createGridScrollSync.test.ts +292 -0
- package/src/features/grid-view/application/createGridScrollSync.ts +169 -0
- package/src/features/grid-view/application/resolveScrollEventSource.test.ts +19 -0
- package/src/features/grid-view/application/resolveScrollEventSource.ts +12 -0
- package/src/features/grid-view/constants/scroll.ts +8 -0
- package/src/features/layout/adapters/inbound/ScrollGestureLockContext.ts +8 -0
- package/src/features/layout/adapters/inbound/ScrollView.test.tsx +234 -0
- package/src/features/layout/adapters/inbound/ScrollView.tsx +18 -2
- package/src/features/layout/adapters/inbound/useScrollGestureLock.ts +11 -0
- package/src/features/layout/public.ts +2 -0
- package/src/features/layout/utils/createScrollGestureLock.test.ts +34 -0
- package/src/features/layout/utils/createScrollGestureLock.ts +21 -0
- package/src/types/grid-interactions.ts +6 -0
- package/src/types/grid-view.ts +45 -0
- package/src/types/layout.ts +6 -0
- package/web-dist/chunks/{Accordion-v3rzy273.js → Accordion-11ej93t5.js} +3 -3
- package/web-dist/chunks/{Accordion-ddrn94v3.js → Accordion-1hbt9k69.js} +1 -1
- package/web-dist/chunks/{Accordion-wpk8dxqp.js → Accordion-26prtnm7.js} +1 -1
- package/web-dist/chunks/{Accordion-0q2wzjdd.js → Accordion-2jy53kzk.js} +2 -2
- package/web-dist/chunks/{Accordion-geah5s4f.js → Accordion-4yq92mxp.js} +1 -1
- package/web-dist/chunks/{Accordion-8pkw32q9.js → Accordion-5pr1wqe3.js} +1 -1
- package/web-dist/chunks/{Accordion-y3083394.js → Accordion-799z2zf6.js} +1 -1
- package/web-dist/chunks/{Accordion-hecpczme.js → Accordion-9aczb0k2.js} +2 -2
- package/web-dist/chunks/{Accordion-rctfgyfv.js → Accordion-a4pz3vjj.js} +1 -1
- package/web-dist/chunks/{Accordion-9jrxktne.js → Accordion-b337t2df.js} +1 -1
- package/web-dist/chunks/{Accordion-h4ekm5cp.js → Accordion-czcaf5x2.js} +1 -1
- package/web-dist/chunks/{Accordion-vbzjq3z8.js → Accordion-ep35792s.js} +44 -2
- package/web-dist/chunks/{Accordion-ts788t7b.js → Accordion-g08740h4.js} +1 -1
- package/web-dist/chunks/{Accordion-9ygakvwk.js → Accordion-g2aqhct0.js} +4 -4
- package/web-dist/chunks/{Accordion-p1ebrt17.js → Accordion-gn8ptzwb.js} +1 -1
- package/web-dist/chunks/{Accordion-sq7ya2ye.js → Accordion-h9brgsk8.js} +1 -1
- package/web-dist/chunks/{Accordion-ztw7zp6v.js → Accordion-m2hcc8g4.js} +2 -2
- package/web-dist/chunks/{Accordion-sdnzqktc.js → Accordion-m6mp8aea.js} +3 -3
- package/web-dist/chunks/{Accordion-vxg5sw01.js → Accordion-p7d5svfq.js} +1 -1
- package/web-dist/chunks/{Accordion-k9cxpg08.js → Accordion-rqhh2m5b.js} +3 -3
- package/web-dist/chunks/{Accordion-wcmrasqx.js → Accordion-rqr10gn4.js} +4 -4
- package/web-dist/chunks/{Accordion-hn43wt45.js → Accordion-t0k1cjca.js} +181 -29
- package/web-dist/chunks/{Accordion-w59y0jdf.js → Accordion-tyh8jj9d.js} +1 -1
- package/web-dist/chunks/{Accordion-dk0dtyc0.js → Accordion-vjcd5kxc.js} +1 -1
- package/web-dist/chunks/{Accordion-t5scffdr.js → Accordion-vkd002gw.js} +5 -5
- package/web-dist/chunks/{Accordion-r87xx7mg.js → Accordion-w87gvpbg.js} +1 -1
- package/web-dist/chunks/{Accordion-yexfbrzg.js → Accordion-wqyrrptg.js} +2 -2
- package/web-dist/chunks/{Accordion-c50pywj3.js → Accordion-y2pss5p0.js} +1 -1
- package/web-dist/components/accordion/Accordion.js +2 -2
- package/web-dist/components/accordion-item/AccordionItem.js +2 -2
- package/web-dist/components/app-bar/AppBar.js +4 -4
- package/web-dist/components/app-header/AppHeader.js +4 -4
- package/web-dist/components/app-shell/AppShell.js +1 -1
- package/web-dist/components/auth-screen/AuthScreen.js +6 -6
- package/web-dist/components/avatar/Avatar.js +2 -2
- package/web-dist/components/avatar-group/AvatarGroup.js +2 -2
- package/web-dist/components/barcode-scanner-view/BarcodeScannerView.js +6 -6
- package/web-dist/components/bottom-sheet/BottomSheet.js +2 -2
- package/web-dist/components/bottom-sheet-flat-list/BottomSheetFlatList.js +2 -2
- package/web-dist/components/bottom-sheet-scroll-view/BottomSheetScrollView.js +2 -2
- package/web-dist/components/bottom-sheet-section-list/BottomSheetSectionList.js +2 -2
- package/web-dist/components/bottom-sheet-view/BottomSheetView.js +2 -2
- package/web-dist/components/bottom-sheet-virtualized-list/BottomSheetVirtualizedList.js +2 -2
- package/web-dist/components/breadcrumbs/Breadcrumbs.js +2 -2
- package/web-dist/components/button/Button.js +2 -2
- package/web-dist/components/button-group/ButtonGroup.js +2 -2
- package/web-dist/components/camera-permission-view/CameraPermissionView.js +6 -6
- package/web-dist/components/card/Card.js +5 -5
- package/web-dist/components/chat-list-item/ChatListItem.js +3 -3
- package/web-dist/components/checkbox/Checkbox.js +2 -2
- package/web-dist/components/checkbox-group/CheckboxGroup.js +2 -2
- package/web-dist/components/chip/Chip.js +2 -2
- package/web-dist/components/chip-group/ChipGroup.js +2 -2
- package/web-dist/components/collection-editor/CollectionEditor.js +5 -5
- package/web-dist/components/content-rail/ContentRail.js +2 -2
- package/web-dist/components/data-table/DataTable.js +10 -10
- package/web-dist/components/date-picker/DatePicker.js +2 -2
- package/web-dist/components/dialog/Dialog.js +2 -2
- package/web-dist/components/divider/Divider.js +1 -1
- package/web-dist/components/empty-state/EmptyState.js +6 -6
- package/web-dist/components/explorer/Explorer.js +4 -4
- package/web-dist/components/field/Field.js +2 -2
- package/web-dist/components/file-explorer/FileExplorer.js +4 -4
- package/web-dist/components/flat-list/FlatList.js +3 -3
- package/web-dist/components/forgot-password-form/ForgotPasswordForm.js +6 -6
- package/web-dist/components/form/Form.js +4 -4
- package/web-dist/components/form-actions/FormActions.js +4 -4
- package/web-dist/components/form-error/FormError.js +4 -4
- package/web-dist/components/game/Game.js +2 -2
- package/web-dist/components/game-entity/GameEntity.js +2 -2
- package/web-dist/components/game-field/GameField.js +2 -2
- package/web-dist/components/game-input-zone/GameInputZone.js +2 -2
- package/web-dist/components/game-measurement-probe/GameMeasurementProbe.js +2 -2
- package/web-dist/components/game-overlay/GameOverlay.js +2 -2
- package/web-dist/components/gradient/Gradient.js +2 -2
- package/web-dist/components/gradient-renderer-provider/GradientRendererProvider.js +2 -2
- package/web-dist/components/grid/Grid.js +1 -1
- package/web-dist/components/grid-interactions/GridInteractions.js +24 -2
- package/web-dist/components/grid-view/GridView.js +1 -1
- package/web-dist/components/hero/Hero.js +5 -5
- package/web-dist/components/icon-button/IconButton.js +2 -2
- package/web-dist/components/image/Image.js +2 -2
- package/web-dist/components/list/List.js +3 -3
- package/web-dist/components/list-item/ListItem.js +3 -3
- package/web-dist/components/list-section/ListSection.js +3 -3
- package/web-dist/components/matrix-grid/MatrixGrid.js +1 -1
- package/web-dist/components/media-card/MediaCard.js +5 -5
- package/web-dist/components/media-explorer/MediaExplorer.js +4 -4
- package/web-dist/components/message-bubble/MessageBubble.js +3 -3
- package/web-dist/components/metric-card/MetricCard.js +5 -5
- package/web-dist/components/missing-element/MissingElement.js +1 -1
- package/web-dist/components/o-auth-provider-button/OAuthProviderButton.js +6 -6
- package/web-dist/components/o-auth-provider-list/OAuthProviderList.js +6 -6
- package/web-dist/components/otp-form/OtpForm.js +6 -6
- package/web-dist/components/pagination/Pagination.js +2 -2
- package/web-dist/components/palette-item/PaletteItem.js +5 -5
- package/web-dist/components/popover-menu/PopoverMenu.js +2 -2
- package/web-dist/components/post-card/PostCard.js +5 -5
- package/web-dist/components/product-card/ProductCard.js +5 -5
- package/web-dist/components/progress/Progress.js +2 -2
- package/web-dist/components/progress-ring/ProgressRing.js +2 -2
- package/web-dist/components/radio/Radio.js +2 -2
- package/web-dist/components/radio-group/RadioGroup.js +2 -2
- package/web-dist/components/rating/Rating.js +1 -1
- package/web-dist/components/reader/Reader.js +6 -6
- package/web-dist/components/scan-overlay/ScanOverlay.js +6 -6
- package/web-dist/components/screen/Screen.js +1 -1
- package/web-dist/components/screen-section/ScreenSection.js +2 -2
- package/web-dist/components/scroll-view/ScrollView.js +1 -1
- package/web-dist/components/search-input/SearchInput.js +3 -3
- package/web-dist/components/section-header/SectionHeader.js +2 -2
- package/web-dist/components/section-list/SectionList.js +3 -3
- package/web-dist/components/select/Select.js +2 -2
- package/web-dist/components/sign-in-form/SignInForm.js +6 -6
- package/web-dist/components/sign-up-form/SignUpForm.js +6 -6
- package/web-dist/components/skeleton/Skeleton.js +8 -8
- package/web-dist/components/skeleton-card/SkeletonCard.js +8 -8
- package/web-dist/components/skeleton-list/SkeletonList.js +8 -8
- package/web-dist/components/skeleton-text/SkeletonText.js +8 -8
- package/web-dist/components/spatial-grid/SpatialGrid.js +1 -1
- package/web-dist/components/text-input/TextInput.js +3 -3
- package/web-dist/components/tile-grid/TileGrid.js +1 -1
- package/web-dist/components/time-grid/TimeGrid.js +1 -1
- package/web-dist/components/time-picker/TimePicker.js +2 -2
- package/web-dist/components/timeline/Timeline.js +1 -1
- package/web-dist/components/toolbar/Toolbar.js +5 -5
- package/web-dist/components/tree-item/TreeItem.js +4 -4
- package/web-dist/components/uploader/Uploader.js +9 -9
- package/web-dist/components/view/View.js +1 -1
- package/web-dist/manifest.json +326 -326
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { ANIMATED_SCROLL_WINDOW_MS, IMMEDIATE_SCROLL_WINDOW_MS, SCROLL_POSITION_TOLERANCE, } from '../constants/scroll';
|
|
2
|
+
import { resolveScrollEventSource } from './resolveScrollEventSource';
|
|
3
|
+
const AXES = ['x', 'y'];
|
|
4
|
+
/***
|
|
5
|
+
* Arbitrates each native scroll axis between programmatic requests and the user,
|
|
6
|
+
* so echoes of GridView's own scrollTo calls never become viewport pans.
|
|
7
|
+
*/
|
|
8
|
+
export function createGridScrollSync({ scrollTo, onUserScroll, onProgrammaticScroll, now = Date.now, schedule = setTimeout, cancel = clearTimeout, }) {
|
|
9
|
+
let position = { x: 0, y: 0 };
|
|
10
|
+
const pending = new Map();
|
|
11
|
+
const inFlight = new Map();
|
|
12
|
+
// Keep ownership of late frames even after a stalled animation is reconciled.
|
|
13
|
+
const echoTails = new Map();
|
|
14
|
+
const timers = new Map();
|
|
15
|
+
const clearTimer = (axis) => {
|
|
16
|
+
const timer = timers.get(axis);
|
|
17
|
+
if (timer !== undefined)
|
|
18
|
+
cancel(timer);
|
|
19
|
+
timers.delete(axis);
|
|
20
|
+
};
|
|
21
|
+
const release = (axis) => {
|
|
22
|
+
clearTimer(axis);
|
|
23
|
+
pending.delete(axis);
|
|
24
|
+
inFlight.delete(axis);
|
|
25
|
+
};
|
|
26
|
+
const adopt = (axis, offset) => {
|
|
27
|
+
const displacement = offset - readAxis(position, axis);
|
|
28
|
+
position = withAxis(position, axis, offset);
|
|
29
|
+
if (displacement !== 0)
|
|
30
|
+
onUserScroll(axis, displacement);
|
|
31
|
+
};
|
|
32
|
+
const settle = (axis, finalOffset) => {
|
|
33
|
+
const pendingScroll = pending.get(axis);
|
|
34
|
+
const offset = finalOffset ?? inFlight.get(axis);
|
|
35
|
+
release(axis);
|
|
36
|
+
if (offset !== undefined) {
|
|
37
|
+
if (finalOffset === undefined &&
|
|
38
|
+
pendingScroll?.animated &&
|
|
39
|
+
!isSameOffset(offset, pendingScroll.target)) {
|
|
40
|
+
echoTails.set(axis, { lastOffset: offset, target: pendingScroll.target });
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
echoTails.delete(axis);
|
|
44
|
+
}
|
|
45
|
+
adopt(axis, offset);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
const scrolled = (axis, offset) => {
|
|
49
|
+
const tail = echoTails.get(axis);
|
|
50
|
+
if (tail) {
|
|
51
|
+
if (isContinuingProgrammaticEcho(tail, offset)) {
|
|
52
|
+
const displacement = offset - readAxis(position, axis);
|
|
53
|
+
position = withAxis(position, axis, offset);
|
|
54
|
+
if (displacement !== 0)
|
|
55
|
+
onProgrammaticScroll(axis, displacement);
|
|
56
|
+
if (isSameOffset(offset, tail.target))
|
|
57
|
+
echoTails.delete(axis);
|
|
58
|
+
else
|
|
59
|
+
tail.lastOffset = offset;
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
echoTails.delete(axis);
|
|
63
|
+
}
|
|
64
|
+
let pendingScroll = pending.get(axis);
|
|
65
|
+
if (pendingScroll?.animated && now() > pendingScroll.expiresAt) {
|
|
66
|
+
// A native scroll may deliver its first frame after the initial deadline.
|
|
67
|
+
// Without an explicit drag/end, that is still an echo of our scrollTo.
|
|
68
|
+
pendingScroll = { ...pendingScroll, expiresAt: now() + ANIMATED_SCROLL_WINDOW_MS };
|
|
69
|
+
pending.set(axis, pendingScroll);
|
|
70
|
+
}
|
|
71
|
+
const source = resolveScrollEventSource(pendingScroll, offset, now());
|
|
72
|
+
if (source === 'in-flight' && pendingScroll) {
|
|
73
|
+
clearTimer(axis);
|
|
74
|
+
inFlight.set(axis, offset);
|
|
75
|
+
// Native animation frames can pause longer than 120ms; only reconcile at the
|
|
76
|
+
// original request deadline, or earlier on an explicit drag/end/target echo.
|
|
77
|
+
timers.set(axis, schedule(() => settle(axis), Math.max(0, pendingScroll.expiresAt - now())));
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
release(axis);
|
|
81
|
+
if (source === 'user')
|
|
82
|
+
adopt(axis, offset);
|
|
83
|
+
};
|
|
84
|
+
return {
|
|
85
|
+
isCurrent: (next) => AXES.every((axis) => isSameOffset(readAxis(position, axis), readAxis(next, axis))),
|
|
86
|
+
request: (next, animated) => {
|
|
87
|
+
const windowMs = animated ? ANIMATED_SCROLL_WINDOW_MS : IMMEDIATE_SCROLL_WINDOW_MS;
|
|
88
|
+
const expiresAt = now() + windowMs;
|
|
89
|
+
for (const axis of AXES) {
|
|
90
|
+
const target = readAxis(next, axis);
|
|
91
|
+
if (isSameOffset(readAxis(position, axis), target))
|
|
92
|
+
continue;
|
|
93
|
+
release(axis);
|
|
94
|
+
echoTails.delete(axis);
|
|
95
|
+
pending.set(axis, { animated, expiresAt, target });
|
|
96
|
+
scrollTo(axis, target, animated);
|
|
97
|
+
}
|
|
98
|
+
position = next;
|
|
99
|
+
},
|
|
100
|
+
scrolled,
|
|
101
|
+
dragBegan: (axis, offset) => {
|
|
102
|
+
const hadTail = echoTails.delete(axis);
|
|
103
|
+
if (pending.has(axis) || inFlight.has(axis))
|
|
104
|
+
settle(axis, offset);
|
|
105
|
+
else if (hadTail)
|
|
106
|
+
adopt(axis, offset);
|
|
107
|
+
},
|
|
108
|
+
scrollEnded: (axis, offset) => {
|
|
109
|
+
scrolled(axis, offset);
|
|
110
|
+
echoTails.delete(axis);
|
|
111
|
+
if (pending.has(axis))
|
|
112
|
+
settle(axis, offset);
|
|
113
|
+
},
|
|
114
|
+
dispose: () => {
|
|
115
|
+
for (const axis of AXES)
|
|
116
|
+
release(axis);
|
|
117
|
+
echoTails.clear();
|
|
118
|
+
},
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
/*** Suppresses delayed monotonic frames toward the old programmatic target until an actual drag/end. */
|
|
122
|
+
function isContinuingProgrammaticEcho({ lastOffset, target }, offset) {
|
|
123
|
+
const step = offset - lastOffset;
|
|
124
|
+
if (Math.abs(step) <= SCROLL_POSITION_TOLERANCE)
|
|
125
|
+
return true;
|
|
126
|
+
return (Math.sign(step) === Math.sign(target - lastOffset) &&
|
|
127
|
+
Math.abs(target - offset) <= Math.abs(target - lastOffset) + SCROLL_POSITION_TOLERANCE);
|
|
128
|
+
}
|
|
129
|
+
/*** Reads one axis of a physical scroll position. */
|
|
130
|
+
function readAxis(value, axis) {
|
|
131
|
+
return axis === 'x' ? value.x : value.y;
|
|
132
|
+
}
|
|
133
|
+
/*** Replaces one axis of a physical scroll position. */
|
|
134
|
+
function withAxis(value, axis, offset) {
|
|
135
|
+
return axis === 'x' ? { ...value, x: offset } : { ...value, y: offset };
|
|
136
|
+
}
|
|
137
|
+
/*** Treats offsets within the native positioning tolerance as the same scroll offset. */
|
|
138
|
+
function isSameOffset(left, right) {
|
|
139
|
+
return Math.abs(left - right) <= SCROLL_POSITION_TOLERANCE;
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=createGridScrollSync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createGridScrollSync.js","sourceRoot":"","sources":["../../../../src/features/grid-view/application/createGridScrollSync.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,yBAAyB,EACzB,0BAA0B,EAC1B,yBAAyB,GAC1B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,wBAAwB,EAAE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AAI,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC;AAC1E,CAAC;AAED,yFAAyF;AACzF,SAAS,YAAY,CAAC,IAAY,EAAE,KAAa;IAC/C,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,yBAAyB,CAAC;AAC7D,CAAC","sourcesContent":["import type {\n GridPendingScroll,\n GridScrollAxis,\n GridScrollPosition,\n GridScrollSync,\n GridScrollSyncOptions,\n} from '../../../types/grid-view';\nimport {\n ANIMATED_SCROLL_WINDOW_MS,\n IMMEDIATE_SCROLL_WINDOW_MS,\n SCROLL_POSITION_TOLERANCE,\n} from '../constants/scroll';\nimport { resolveScrollEventSource } from './resolveScrollEventSource';\n\nconst AXES: readonly GridScrollAxis[] = ['x', 'y'];\ninterface EchoTail {\n lastOffset: number;\n target: number;\n}\n\n/***\n * Arbitrates each native scroll axis between programmatic requests and the user,\n * so echoes of GridView's own scrollTo calls never become viewport pans.\n */\nexport function createGridScrollSync({\n scrollTo,\n onUserScroll,\n onProgrammaticScroll,\n now = Date.now,\n schedule = setTimeout,\n cancel = clearTimeout,\n}: GridScrollSyncOptions): GridScrollSync {\n let position: GridScrollPosition = { x: 0, y: 0 };\n const pending = new Map<GridScrollAxis, GridPendingScroll>();\n const inFlight = new Map<GridScrollAxis, number>();\n // Keep ownership of late frames even after a stalled animation is reconciled.\n const echoTails = new Map<GridScrollAxis, EchoTail>();\n const timers = new Map<GridScrollAxis, ReturnType<typeof setTimeout>>();\n\n const clearTimer = (axis: GridScrollAxis) => {\n const timer = timers.get(axis);\n if (timer !== undefined) cancel(timer);\n timers.delete(axis);\n };\n const release = (axis: GridScrollAxis) => {\n clearTimer(axis);\n pending.delete(axis);\n inFlight.delete(axis);\n };\n const adopt = (axis: GridScrollAxis, offset: number) => {\n const displacement = offset - readAxis(position, axis);\n position = withAxis(position, axis, offset);\n if (displacement !== 0) onUserScroll(axis, displacement);\n };\n const settle = (axis: GridScrollAxis, finalOffset?: number) => {\n const pendingScroll = pending.get(axis);\n const offset = finalOffset ?? inFlight.get(axis);\n release(axis);\n if (offset !== undefined) {\n if (\n finalOffset === undefined &&\n pendingScroll?.animated &&\n !isSameOffset(offset, pendingScroll.target)\n ) {\n echoTails.set(axis, { lastOffset: offset, target: pendingScroll.target });\n } else {\n echoTails.delete(axis);\n }\n adopt(axis, offset);\n }\n };\n const scrolled = (axis: GridScrollAxis, offset: number) => {\n const tail = echoTails.get(axis);\n if (tail) {\n if (isContinuingProgrammaticEcho(tail, offset)) {\n const displacement = offset - readAxis(position, axis);\n position = withAxis(position, axis, offset);\n if (displacement !== 0) onProgrammaticScroll(axis, displacement);\n if (isSameOffset(offset, tail.target)) echoTails.delete(axis);\n else tail.lastOffset = offset;\n return;\n }\n echoTails.delete(axis);\n }\n let pendingScroll = pending.get(axis);\n if (pendingScroll?.animated && now() > pendingScroll.expiresAt) {\n // A native scroll may deliver its first frame after the initial deadline.\n // Without an explicit drag/end, that is still an echo of our scrollTo.\n pendingScroll = { ...pendingScroll, expiresAt: now() + ANIMATED_SCROLL_WINDOW_MS };\n pending.set(axis, pendingScroll);\n }\n const source = resolveScrollEventSource(pendingScroll, offset, now());\n if (source === 'in-flight' && pendingScroll) {\n clearTimer(axis);\n inFlight.set(axis, offset);\n // Native animation frames can pause longer than 120ms; only reconcile at the\n // original request deadline, or earlier on an explicit drag/end/target echo.\n timers.set(\n axis,\n schedule(() => settle(axis), Math.max(0, pendingScroll.expiresAt - now())),\n );\n return;\n }\n release(axis);\n if (source === 'user') adopt(axis, offset);\n };\n\n return {\n isCurrent: (next) =>\n AXES.every((axis) => isSameOffset(readAxis(position, axis), readAxis(next, axis))),\n request: (next, animated) => {\n const windowMs = animated ? ANIMATED_SCROLL_WINDOW_MS : IMMEDIATE_SCROLL_WINDOW_MS;\n const expiresAt = now() + windowMs;\n for (const axis of AXES) {\n const target = readAxis(next, axis);\n if (isSameOffset(readAxis(position, axis), target)) continue;\n release(axis);\n echoTails.delete(axis);\n pending.set(axis, { animated, expiresAt, target });\n scrollTo(axis, target, animated);\n }\n position = next;\n },\n scrolled,\n dragBegan: (axis, offset) => {\n const hadTail = echoTails.delete(axis);\n if (pending.has(axis) || inFlight.has(axis)) settle(axis, offset);\n else if (hadTail) adopt(axis, offset);\n },\n scrollEnded: (axis, offset) => {\n scrolled(axis, offset);\n echoTails.delete(axis);\n if (pending.has(axis)) settle(axis, offset);\n },\n dispose: () => {\n for (const axis of AXES) release(axis);\n echoTails.clear();\n },\n };\n}\n\n/*** Suppresses delayed monotonic frames toward the old programmatic target until an actual drag/end. */\nfunction isContinuingProgrammaticEcho({ lastOffset, target }: EchoTail, offset: number): boolean {\n const step = offset - lastOffset;\n if (Math.abs(step) <= SCROLL_POSITION_TOLERANCE) return true;\n return (\n Math.sign(step) === Math.sign(target - lastOffset) &&\n Math.abs(target - offset) <= Math.abs(target - lastOffset) + SCROLL_POSITION_TOLERANCE\n );\n}\n\n/*** Reads one axis of a physical scroll position. */\nfunction readAxis(value: GridScrollPosition, axis: GridScrollAxis): number {\n return axis === 'x' ? value.x : value.y;\n}\n\n/*** Replaces one axis of a physical scroll position. */\nfunction withAxis(\n value: GridScrollPosition,\n axis: GridScrollAxis,\n offset: number,\n): GridScrollPosition {\n return axis === 'x' ? { ...value, x: offset } : { ...value, y: offset };\n}\n\n/*** Treats offsets within the native positioning tolerance as the same scroll offset. */\nfunction isSameOffset(left: number, right: number): boolean {\n return Math.abs(left - right) <= SCROLL_POSITION_TOLERANCE;\n}\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { GridPendingScroll } from '../../../types/grid-view';
|
|
2
|
+
/*** Classifies a native scroll offset as a user gesture, the settled echo of a programmatic scroll, or an in-flight frame of one. */
|
|
3
|
+
export declare function resolveScrollEventSource(pending: GridPendingScroll | undefined, offset: number, now: number): 'in-flight' | 'settled' | 'user';
|
|
4
|
+
//# sourceMappingURL=resolveScrollEventSource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveScrollEventSource.d.ts","sourceRoot":"","sources":["../../../../src/features/grid-view/application/resolveScrollEventSource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAGlE,qIAAqI;AACrI,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,iBAAiB,GAAG,SAAS,EACtC,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,GACV,WAAW,GAAG,SAAS,GAAG,MAAM,CAGlC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SCROLL_POSITION_TOLERANCE } from '../constants/scroll';
|
|
2
|
+
/*** Classifies a native scroll offset as a user gesture, the settled echo of a programmatic scroll, or an in-flight frame of one. */
|
|
3
|
+
export function resolveScrollEventSource(pending, offset, now) {
|
|
4
|
+
if (pending === undefined || now > pending.expiresAt)
|
|
5
|
+
return 'user';
|
|
6
|
+
return Math.abs(offset - pending.target) <= SCROLL_POSITION_TOLERANCE ? 'settled' : 'in-flight';
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=resolveScrollEventSource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveScrollEventSource.js","sourceRoot":"","sources":["../../../../src/features/grid-view/application/resolveScrollEventSource.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAEhE,qIAAqI;AACrI,MAAM,UAAU,wBAAwB,CACtC,OAAsC,EACtC,MAAc,EACd,GAAW;IAEX,IAAI,OAAO,KAAK,SAAS,IAAI,GAAG,GAAG,OAAO,CAAC,SAAS;QAAE,OAAO,MAAM,CAAC;IACpE,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,yBAAyB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC;AAClG,CAAC","sourcesContent":["import type { GridPendingScroll } from '../../../types/grid-view';\nimport { SCROLL_POSITION_TOLERANCE } from '../constants/scroll';\n\n/*** Classifies a native scroll offset as a user gesture, the settled echo of a programmatic scroll, or an in-flight frame of one. */\nexport function resolveScrollEventSource(\n pending: GridPendingScroll | undefined,\n offset: number,\n now: number,\n): 'in-flight' | 'settled' | 'user' {\n if (pending === undefined || now > pending.expiresAt) return 'user';\n return Math.abs(offset - pending.target) <= SCROLL_POSITION_TOLERANCE ? 'settled' : 'in-flight';\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Largest native-versus-requested scroll offset difference, in pixels, still treated as the same position. */
|
|
2
|
+
export declare const SCROLL_POSITION_TOLERANCE = 1;
|
|
3
|
+
/** Upper bound for a native animated `scrollTo` to deliver its settled offset. */
|
|
4
|
+
export declare const ANIMATED_SCROLL_WINDOW_MS = 700;
|
|
5
|
+
/** Upper bound for an immediate `scrollTo` to deliver its settled offset. */
|
|
6
|
+
export declare const IMMEDIATE_SCROLL_WINDOW_MS = 120;
|
|
7
|
+
//# sourceMappingURL=scroll.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll.d.ts","sourceRoot":"","sources":["../../../../src/features/grid-view/constants/scroll.ts"],"names":[],"mappings":"AAAA,+GAA+G;AAC/G,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAE3C,kFAAkF;AAClF,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAE7C,6EAA6E;AAC7E,eAAO,MAAM,0BAA0B,MAAM,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Largest native-versus-requested scroll offset difference, in pixels, still treated as the same position. */
|
|
2
|
+
export const SCROLL_POSITION_TOLERANCE = 1;
|
|
3
|
+
/** Upper bound for a native animated `scrollTo` to deliver its settled offset. */
|
|
4
|
+
export const ANIMATED_SCROLL_WINDOW_MS = 700;
|
|
5
|
+
/** Upper bound for an immediate `scrollTo` to deliver its settled offset. */
|
|
6
|
+
export const IMMEDIATE_SCROLL_WINDOW_MS = 120;
|
|
7
|
+
//# sourceMappingURL=scroll.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll.js","sourceRoot":"","sources":["../../../../src/features/grid-view/constants/scroll.ts"],"names":[],"mappings":"AAAA,+GAA+G;AAC/G,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC;AAE3C,kFAAkF;AAClF,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,CAAC;AAE7C,6EAA6E;AAC7E,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAG,CAAC","sourcesContent":["/** Largest native-versus-requested scroll offset difference, in pixels, still treated as the same position. */\nexport const SCROLL_POSITION_TOLERANCE = 1;\n\n/** Upper bound for a native animated `scrollTo` to deliver its settled offset. */\nexport const ANIMATED_SCROLL_WINDOW_MS = 700;\n\n/** Upper bound for an immediate `scrollTo` to deliver its settled offset. */\nexport const IMMEDIATE_SCROLL_WINDOW_MS = 120;\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ScrollGestureLock } from '../../../../types/layout';
|
|
3
|
+
/*** Carries the nearest ZORA ScrollView gesture lock to descendant gesture surfaces. */
|
|
4
|
+
export declare const ScrollGestureLockContext: React.Context<ScrollGestureLock | undefined>;
|
|
5
|
+
//# sourceMappingURL=ScrollGestureLockContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScrollGestureLockContext.d.ts","sourceRoot":"","sources":["../../../../../src/features/layout/adapters/inbound/ScrollGestureLockContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAElE,wFAAwF;AACxF,eAAO,MAAM,wBAAwB,8CAEpC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScrollGestureLockContext.js","sourceRoot":"","sources":["../../../../../src/features/layout/adapters/inbound/ScrollGestureLockContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,wFAAwF;AACxF,MAAM,CAAC,MAAM,wBAAwB,GAAG,KAAK,CAAC,aAAa,CACzD,SAAS,CACV,CAAC","sourcesContent":["import React from 'react';\n\nimport type { ScrollGestureLock } from '../../../../types/layout';\n\n/*** Carries the nearest ZORA ScrollView gesture lock to descendant gesture surfaces. */\nexport const ScrollGestureLockContext = React.createContext<ScrollGestureLock | undefined>(\n undefined,\n);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScrollView.d.ts","sourceRoot":"","sources":["../../../../../src/features/layout/adapters/inbound/ScrollView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"ScrollView.d.ts","sourceRoot":"","sources":["../../../../../src/features/layout/adapters/inbound/ScrollView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAMhE,gFAAgF;AAChF,eAAO,MAAM,UAAU,uDAAsC,CAAC"}
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import { ScrollView as SurfaceScrollView } from '@ankhorage/surface';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { withZoraThemeScope } from '../../../theme/adapters/inbound/withZoraThemeScope';
|
|
4
|
+
import { createScrollGestureLock } from '../../utils/createScrollGestureLock';
|
|
5
|
+
import { ScrollGestureLockContext } from './ScrollGestureLockContext';
|
|
6
|
+
import { useScrollGestureLock } from './useScrollGestureLock';
|
|
4
7
|
/*** Adapts the token-aware Surface ScrollView primitive to ZORA theme scope. */
|
|
5
8
|
export const ScrollView = withZoraThemeScope(ScrollViewInner);
|
|
6
|
-
/*** Forwards ZORA scrolling props to the published Surface ScrollView boundary. */
|
|
7
|
-
function ScrollViewInner({ themeId: _themeId, mode: _mode, interactionPolicy: _interactionPolicy, ...props }) {
|
|
8
|
-
|
|
9
|
+
/*** Forwards ZORA scrolling props to the published Surface ScrollView boundary and yields scrolling to active descendant gestures. */
|
|
10
|
+
function ScrollViewInner({ themeId: _themeId, mode: _mode, interactionPolicy: _interactionPolicy, scrollEnabled = true, ...props }) {
|
|
11
|
+
const parentLock = useScrollGestureLock();
|
|
12
|
+
const [activeGestures, setActiveGestures] = React.useState(0);
|
|
13
|
+
const lock = React.useMemo(() => createScrollGestureLock(parentLock, (delta) => setActiveGestures((count) => count + delta)), [parentLock]);
|
|
14
|
+
return (<ScrollGestureLockContext.Provider value={lock}>
|
|
15
|
+
<SurfaceScrollView {...props} scrollEnabled={scrollEnabled && activeGestures === 0}/>
|
|
16
|
+
</ScrollGestureLockContext.Provider>);
|
|
9
17
|
}
|
|
10
18
|
//# sourceMappingURL=ScrollView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScrollView.js","sourceRoot":"","sources":["../../../../../src/features/layout/adapters/inbound/ScrollView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;
|
|
1
|
+
{"version":3,"file":"ScrollView.js","sourceRoot":"","sources":["../../../../../src/features/layout/adapters/inbound/ScrollView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;AACxF,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,gFAAgF;AAChF,MAAM,CAAC,MAAM,UAAU,GAAG,kBAAkB,CAAC,eAAe,CAAC,CAAC;AAE9D,sIAAsI;AACtI,SAAS,eAAe,CAAC,EACvB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,iBAAiB,EAAE,kBAAkB,EACrC,aAAa,GAAG,IAAI,EACpB,GAAG,KAAK,EACQ;IAChB,MAAM,UAAU,GAAG,oBAAoB,EAAE,CAAC;IAC1C,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC9D,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CACxB,GAAG,EAAE,CACH,uBAAuB,CAAC,UAAU,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,iBAAiB,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,EAC7F,CAAC,UAAU,CAAC,CACb,CAAC;IAEF,OAAO,CACL,CAAC,wBAAwB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAC7C;MAAA,CAAC,iBAAiB,CAAC,IAAI,KAAK,CAAC,CAAC,aAAa,CAAC,CAAC,aAAa,IAAI,cAAc,KAAK,CAAC,CAAC,EACrF;IAAA,EAAE,wBAAwB,CAAC,QAAQ,CAAC,CACrC,CAAC;AACJ,CAAC","sourcesContent":["import { ScrollView as SurfaceScrollView } from '@ankhorage/surface';\nimport React from 'react';\n\nimport type { ScrollViewProps } from '../../../../types/layout';\nimport { withZoraThemeScope } from '../../../theme/adapters/inbound/withZoraThemeScope';\nimport { createScrollGestureLock } from '../../utils/createScrollGestureLock';\nimport { ScrollGestureLockContext } from './ScrollGestureLockContext';\nimport { useScrollGestureLock } from './useScrollGestureLock';\n\n/*** Adapts the token-aware Surface ScrollView primitive to ZORA theme scope. */\nexport const ScrollView = withZoraThemeScope(ScrollViewInner);\n\n/*** Forwards ZORA scrolling props to the published Surface ScrollView boundary and yields scrolling to active descendant gestures. */\nfunction ScrollViewInner({\n themeId: _themeId,\n mode: _mode,\n interactionPolicy: _interactionPolicy,\n scrollEnabled = true,\n ...props\n}: ScrollViewProps) {\n const parentLock = useScrollGestureLock();\n const [activeGestures, setActiveGestures] = React.useState(0);\n const lock = React.useMemo(\n () =>\n createScrollGestureLock(parentLock, (delta) => setActiveGestures((count) => count + delta)),\n [parentLock],\n );\n\n return (\n <ScrollGestureLockContext.Provider value={lock}>\n <SurfaceScrollView {...props} scrollEnabled={scrollEnabled && activeGestures === 0} />\n </ScrollGestureLockContext.Provider>\n );\n}\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ScrollGestureLock } from '../../../../types/layout';
|
|
2
|
+
/*** Resolves the nearest ZORA ScrollView lock, or an inert lock when no scroll container exists. */
|
|
3
|
+
export declare function useScrollGestureLock(): ScrollGestureLock;
|
|
4
|
+
//# sourceMappingURL=useScrollGestureLock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useScrollGestureLock.d.ts","sourceRoot":"","sources":["../../../../../src/features/layout/adapters/inbound/useScrollGestureLock.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAKlE,oGAAoG;AACpG,wBAAgB,oBAAoB,IAAI,iBAAiB,CAExD"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ScrollGestureLockContext } from './ScrollGestureLockContext';
|
|
3
|
+
const unlockedScrollGesture = { acquire: () => () => undefined };
|
|
4
|
+
/*** Resolves the nearest ZORA ScrollView lock, or an inert lock when no scroll container exists. */
|
|
5
|
+
export function useScrollGestureLock() {
|
|
6
|
+
return React.useContext(ScrollGestureLockContext) ?? unlockedScrollGesture;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=useScrollGestureLock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useScrollGestureLock.js","sourceRoot":"","sources":["../../../../../src/features/layout/adapters/inbound/useScrollGestureLock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,MAAM,qBAAqB,GAAsB,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,SAAS,EAAE,CAAC;AAEpF,oGAAoG;AACpG,MAAM,UAAU,oBAAoB;IAClC,OAAO,KAAK,CAAC,UAAU,CAAC,wBAAwB,CAAC,IAAI,qBAAqB,CAAC;AAC7E,CAAC","sourcesContent":["import React from 'react';\n\nimport type { ScrollGestureLock } from '../../../../types/layout';\nimport { ScrollGestureLockContext } from './ScrollGestureLockContext';\n\nconst unlockedScrollGesture: ScrollGestureLock = { acquire: () => () => undefined };\n\n/*** Resolves the nearest ZORA ScrollView lock, or an inert lock when no scroll container exists. */\nexport function useScrollGestureLock(): ScrollGestureLock {\n return React.useContext(ScrollGestureLockContext) ?? unlockedScrollGesture;\n}\n"]}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export type { AppShellProps, DividerProps, GridProps, ScreenProps, ScrollViewProps, ViewProps, } from '../../types/layout';
|
|
1
|
+
export type { AppShellProps, DividerProps, GridProps, ScreenProps, ScrollGestureLock, ScrollViewProps, ViewProps, } from '../../types/layout';
|
|
2
2
|
export { AppShell } from './adapters/inbound/AppShell';
|
|
3
3
|
export { Divider } from './adapters/inbound/Divider';
|
|
4
4
|
export { Grid } from './adapters/inbound/Grid';
|
|
5
5
|
export { Screen } from './adapters/inbound/Screen';
|
|
6
6
|
export { ScrollView } from './adapters/inbound/ScrollView';
|
|
7
|
+
export { useScrollGestureLock } from './adapters/inbound/useScrollGestureLock';
|
|
7
8
|
export { View } from './adapters/inbound/View';
|
|
8
9
|
//# sourceMappingURL=public.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/features/layout/public.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,aAAa,EACb,YAAY,EACZ,SAAS,EACT,WAAW,EACX,eAAe,EACf,SAAS,GACV,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/features/layout/public.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,aAAa,EACb,YAAY,EACZ,SAAS,EACT,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,SAAS,GACV,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -3,5 +3,6 @@ export { Divider } from './adapters/inbound/Divider';
|
|
|
3
3
|
export { Grid } from './adapters/inbound/Grid';
|
|
4
4
|
export { Screen } from './adapters/inbound/Screen';
|
|
5
5
|
export { ScrollView } from './adapters/inbound/ScrollView';
|
|
6
|
+
export { useScrollGestureLock } from './adapters/inbound/useScrollGestureLock';
|
|
6
7
|
export { View } from './adapters/inbound/View';
|
|
7
8
|
//# sourceMappingURL=public.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/features/layout/public.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/features/layout/public.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC","sourcesContent":["export type {\n AppShellProps,\n DividerProps,\n GridProps,\n ScreenProps,\n ScrollGestureLock,\n ScrollViewProps,\n ViewProps,\n} from '../../types/layout';\nexport { AppShell } from './adapters/inbound/AppShell';\nexport { Divider } from './adapters/inbound/Divider';\nexport { Grid } from './adapters/inbound/Grid';\nexport { Screen } from './adapters/inbound/Screen';\nexport { ScrollView } from './adapters/inbound/ScrollView';\nexport { useScrollGestureLock } from './adapters/inbound/useScrollGestureLock';\nexport { View } from './adapters/inbound/View';\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ScrollGestureLock } from '../../../types/layout';
|
|
2
|
+
/*** Creates a lock that reports each held gesture to its scroll container and also suspends every ancestor container. */
|
|
3
|
+
export declare function createScrollGestureLock(parent: ScrollGestureLock, onActiveGesturesChange: (delta: 1 | -1) => void): ScrollGestureLock;
|
|
4
|
+
//# sourceMappingURL=createScrollGestureLock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createScrollGestureLock.d.ts","sourceRoot":"","sources":["../../../../src/features/layout/utils/createScrollGestureLock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,yHAAyH;AACzH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,iBAAiB,EACzB,sBAAsB,EAAE,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,IAAI,GAC9C,iBAAiB,CAcnB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*** Creates a lock that reports each held gesture to its scroll container and also suspends every ancestor container. */
|
|
2
|
+
export function createScrollGestureLock(parent, onActiveGesturesChange) {
|
|
3
|
+
return {
|
|
4
|
+
acquire: () => {
|
|
5
|
+
const releaseParent = parent.acquire();
|
|
6
|
+
let released = false;
|
|
7
|
+
onActiveGesturesChange(1);
|
|
8
|
+
return () => {
|
|
9
|
+
if (released)
|
|
10
|
+
return;
|
|
11
|
+
released = true;
|
|
12
|
+
onActiveGesturesChange(-1);
|
|
13
|
+
releaseParent();
|
|
14
|
+
};
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=createScrollGestureLock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createScrollGestureLock.js","sourceRoot":"","sources":["../../../../src/features/layout/utils/createScrollGestureLock.ts"],"names":[],"mappings":"AAEA,yHAAyH;AACzH,MAAM,UAAU,uBAAuB,CACrC,MAAyB,EACzB,sBAA+C;IAE/C,OAAO;QACL,OAAO,EAAE,GAAG,EAAE;YACZ,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;YACvC,IAAI,QAAQ,GAAG,KAAK,CAAC;YACrB,sBAAsB,CAAC,CAAC,CAAC,CAAC;YAC1B,OAAO,GAAG,EAAE;gBACV,IAAI,QAAQ;oBAAE,OAAO;gBACrB,QAAQ,GAAG,IAAI,CAAC;gBAChB,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC3B,aAAa,EAAE,CAAC;YAClB,CAAC,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { ScrollGestureLock } from '../../../types/layout';\n\n/*** Creates a lock that reports each held gesture to its scroll container and also suspends every ancestor container. */\nexport function createScrollGestureLock(\n parent: ScrollGestureLock,\n onActiveGesturesChange: (delta: 1 | -1) => void,\n): ScrollGestureLock {\n return {\n acquire: () => {\n const releaseParent = parent.acquire();\n let released = false;\n onActiveGesturesChange(1);\n return () => {\n if (released) return;\n released = true;\n onActiveGesturesChange(-1);\n releaseParent();\n };\n },\n };\n}\n"]}
|
|
@@ -55,4 +55,9 @@ export interface GridInteractionsController {
|
|
|
55
55
|
readonly keyDown: (key: string, pointer?: GridInteractionPointer) => boolean;
|
|
56
56
|
readonly update: (props: GridInteractionsControllerProps) => void;
|
|
57
57
|
}
|
|
58
|
+
/** Gesture-scoped ownership of ancestor scrolling for one interaction surface. */
|
|
59
|
+
export interface GridInteractionScrollLock {
|
|
60
|
+
readonly acquire: () => void;
|
|
61
|
+
readonly release: () => void;
|
|
62
|
+
}
|
|
58
63
|
//# sourceMappingURL=grid-interactions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grid-interactions.d.ts","sourceRoot":"","sources":["../../src/types/grid-interactions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,wBAAwB,EACxB,QAAQ,EACR,gBAAgB,EAChB,iBAAiB,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,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,sBAAsB,KAAK,IAAI,CAAC;IACzD,QAAQ,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,sBAAsB,KAAK,IAAI,CAAC;IACxD,QAAQ,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,sBAAsB,KAAK,OAAO,CAAC;IAC7E,QAAQ,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,+BAA+B,KAAK,IAAI,CAAC;CACnE;AAED,kFAAkF;AAClF,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;CAC9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grid-interactions.js","sourceRoot":"","sources":["../../src/types/grid-interactions.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n GridInteractionRectItem,\n GridMarqueeSelectionMode,\n GridRect,\n GridResizeHandle,\n GridSnapCandidate,\n GridViewport,\n} from '@ankhorage/grid-view';\nimport type React from 'react';\n\nimport type { ZoraBaseProps } from './base';\n\n/** A caller-owned world item accepted by the platform interaction adapter. */\nexport interface GridInteractionItem extends GridInteractionRectItem {\n readonly readOnly?: boolean;\n readonly passive?: boolean;\n}\n\n/** Caller-controlled snapping inputs for both world axes. */\nexport interface GridInteractionSnap {\n readonly enabled?: boolean;\n readonly tolerancePixels: number;\n readonly priorities: readonly GridSnapCandidate['kind'][];\n readonly x?: readonly GridSnapCandidate[];\n readonly y?: readonly GridSnapCandidate[];\n}\n\n/** Events emitted by the adapter; callers remain responsible for mutations. */\nexport interface GridInteractionIntent {\n readonly type: 'select' | 'move' | 'resize' | 'marquee' | 'pan';\n readonly itemIds: readonly string[];\n readonly rects?: readonly GridInteractionItem[];\n readonly marquee?: GridRect;\n readonly viewport?: GridViewport;\n}\n\n/** Public, controlled inputs for generic world-space grid interaction. */\nexport interface GridInteractionsProps extends ZoraBaseProps {\n readonly children: React.ReactNode;\n readonly viewport: GridViewport;\n readonly items: readonly GridInteractionItem[];\n readonly selectedIds?: readonly string[];\n readonly marqueeMode?: GridMarqueeSelectionMode;\n /** Identifies the resize handle represented by this interaction surface. */\n readonly resizeHandle?: GridResizeHandle;\n readonly snap?: GridInteractionSnap;\n readonly onIntent: (intent: GridInteractionIntent) => void;\n}\n\n/** The non-visual controlled contract consumed by the platform-neutral controller. */\nexport type GridInteractionsControllerProps = Omit<GridInteractionsProps, 'children'>;\n\n/** Pointer coordinates in viewport pixels, independent of native or web event shapes. */\nexport interface GridInteractionPointer {\n readonly x: number;\n readonly y: number;\n readonly shiftKey?: boolean;\n readonly metaKey?: boolean;\n readonly ctrlKey?: boolean;\n readonly altKey?: boolean;\n readonly spaceKey?: boolean;\n}\n\n/** Imperative handlers supplied to native responders or web pointer adapters. */\nexport interface GridInteractionsController {\n readonly begin: (pointer: GridInteractionPointer, handle?: GridResizeHandle) => void;\n readonly move: (pointer: GridInteractionPointer) => void;\n readonly end: (pointer: GridInteractionPointer) => void;\n readonly cancel: () => void;\n readonly keyDown: (key: string, pointer?: GridInteractionPointer) => boolean;\n readonly update: (props: GridInteractionsControllerProps) => void;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"grid-interactions.js","sourceRoot":"","sources":["../../src/types/grid-interactions.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n GridInteractionRectItem,\n GridMarqueeSelectionMode,\n GridRect,\n GridResizeHandle,\n GridSnapCandidate,\n GridViewport,\n} from '@ankhorage/grid-view';\nimport type React from 'react';\n\nimport type { ZoraBaseProps } from './base';\n\n/** A caller-owned world item accepted by the platform interaction adapter. */\nexport interface GridInteractionItem extends GridInteractionRectItem {\n readonly readOnly?: boolean;\n readonly passive?: boolean;\n}\n\n/** Caller-controlled snapping inputs for both world axes. */\nexport interface GridInteractionSnap {\n readonly enabled?: boolean;\n readonly tolerancePixels: number;\n readonly priorities: readonly GridSnapCandidate['kind'][];\n readonly x?: readonly GridSnapCandidate[];\n readonly y?: readonly GridSnapCandidate[];\n}\n\n/** Events emitted by the adapter; callers remain responsible for mutations. */\nexport interface GridInteractionIntent {\n readonly type: 'select' | 'move' | 'resize' | 'marquee' | 'pan';\n readonly itemIds: readonly string[];\n readonly rects?: readonly GridInteractionItem[];\n readonly marquee?: GridRect;\n readonly viewport?: GridViewport;\n}\n\n/** Public, controlled inputs for generic world-space grid interaction. */\nexport interface GridInteractionsProps extends ZoraBaseProps {\n readonly children: React.ReactNode;\n readonly viewport: GridViewport;\n readonly items: readonly GridInteractionItem[];\n readonly selectedIds?: readonly string[];\n readonly marqueeMode?: GridMarqueeSelectionMode;\n /** Identifies the resize handle represented by this interaction surface. */\n readonly resizeHandle?: GridResizeHandle;\n readonly snap?: GridInteractionSnap;\n readonly onIntent: (intent: GridInteractionIntent) => void;\n}\n\n/** The non-visual controlled contract consumed by the platform-neutral controller. */\nexport type GridInteractionsControllerProps = Omit<GridInteractionsProps, 'children'>;\n\n/** Pointer coordinates in viewport pixels, independent of native or web event shapes. */\nexport interface GridInteractionPointer {\n readonly x: number;\n readonly y: number;\n readonly shiftKey?: boolean;\n readonly metaKey?: boolean;\n readonly ctrlKey?: boolean;\n readonly altKey?: boolean;\n readonly spaceKey?: boolean;\n}\n\n/** Imperative handlers supplied to native responders or web pointer adapters. */\nexport interface GridInteractionsController {\n readonly begin: (pointer: GridInteractionPointer, handle?: GridResizeHandle) => void;\n readonly move: (pointer: GridInteractionPointer) => void;\n readonly end: (pointer: GridInteractionPointer) => void;\n readonly cancel: () => void;\n readonly keyDown: (key: string, pointer?: GridInteractionPointer) => boolean;\n readonly update: (props: GridInteractionsControllerProps) => void;\n}\n\n/** Gesture-scoped ownership of ancestor scrolling for one interaction surface. */\nexport interface GridInteractionScrollLock {\n readonly acquire: () => void;\n readonly release: () => void;\n}\n"]}
|
|
@@ -55,4 +55,44 @@ export interface TileGridProps extends ZoraBaseProps {
|
|
|
55
55
|
onVisibleItemIdsChange?: (ids: readonly string[]) => void;
|
|
56
56
|
renderItem: (item: TileGridItem) => React.ReactNode;
|
|
57
57
|
}
|
|
58
|
+
/** The two independent native scroll axes that back a GridView viewport. */
|
|
59
|
+
export type GridScrollAxis = 'x' | 'y';
|
|
60
|
+
/** A physical native scroll position in pixels. */
|
|
61
|
+
export interface GridScrollPosition {
|
|
62
|
+
readonly x: number;
|
|
63
|
+
readonly y: number;
|
|
64
|
+
}
|
|
65
|
+
/** A programmatic native scroll request that GridView is still waiting to observe. */
|
|
66
|
+
export interface GridPendingScroll {
|
|
67
|
+
readonly animated: boolean;
|
|
68
|
+
readonly expiresAt: number;
|
|
69
|
+
readonly target: number;
|
|
70
|
+
}
|
|
71
|
+
/** Native capabilities and clock used by the programmatic-versus-user scroll arbiter. */
|
|
72
|
+
export interface GridScrollSyncOptions {
|
|
73
|
+
/** Requests a native scroll of one axis. */
|
|
74
|
+
readonly scrollTo: (axis: GridScrollAxis, offset: number, animated: boolean) => void;
|
|
75
|
+
/** Reports a genuine user scroll as the pixel displacement of the native offset. */
|
|
76
|
+
readonly onUserScroll: (axis: GridScrollAxis, displacement: number) => void;
|
|
77
|
+
/** Reconciles a late programmatic native frame without classifying it as a user pan. */
|
|
78
|
+
readonly onProgrammaticScroll: (axis: GridScrollAxis, displacement: number) => void;
|
|
79
|
+
readonly now?: () => number;
|
|
80
|
+
readonly schedule?: (callback: () => void, delay: number) => ReturnType<typeof setTimeout>;
|
|
81
|
+
readonly cancel?: (handle: ReturnType<typeof setTimeout>) => void;
|
|
82
|
+
}
|
|
83
|
+
/** Separates echoes of programmatic scrolls from user scrolling, independently per axis. */
|
|
84
|
+
export interface GridScrollSync {
|
|
85
|
+
/** True when the baseline already matches the position within native tolerance. */
|
|
86
|
+
readonly isCurrent: (position: GridScrollPosition) => boolean;
|
|
87
|
+
/** Moves native scrolling to a viewport-derived position. */
|
|
88
|
+
readonly request: (position: GridScrollPosition, animated: boolean) => void;
|
|
89
|
+
/** Routes one native scroll event. */
|
|
90
|
+
readonly scrolled: (axis: GridScrollAxis, offset: number) => void;
|
|
91
|
+
/** Hands an axis to the user, adopting the native offset at the start of their drag. */
|
|
92
|
+
readonly dragBegan: (axis: GridScrollAxis, offset: number) => void;
|
|
93
|
+
/** Adopts the final native offset when a programmatic or momentum scroll ends. */
|
|
94
|
+
readonly scrollEnded: (axis: GridScrollAxis, offset: number) => void;
|
|
95
|
+
/** Cancels every pending settle timer. */
|
|
96
|
+
readonly dispose: () => void;
|
|
97
|
+
}
|
|
58
98
|
//# sourceMappingURL=grid-view.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grid-view.d.ts","sourceRoot":"","sources":["../../src/types/grid-view.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EACZ,uBAAuB,EACvB,cAAc,EACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE5C,gFAAgF;AAChF,MAAM,WAAW,aAAc,SAAQ,aAAa;IAClD,KAAK,EAAE,SAAS,YAAY,EAAE,CAAC;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,qFAAqF;IACrF,eAAe,CAAC,EAAE,OAAO,CACvB,IAAI,CAAC,YAAY,EAAE,SAAS,GAAG,SAAS,GAAG,gBAAgB,GAAG,gBAAgB,CAAC,CAChF,CAAC;IACF,uFAAuF;IACvF,mBAAmB,CAAC,EAAE,uBAAuB,CAAC;IAC9C,6EAA6E;IAC7E,UAAU,CAAC,EAAE,cAAc,CAAC;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D,QAAQ,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,kBAAkB,EAAE,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5E,sCAAsC;IACtC,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAClE,wFAAwF;IACxF,QAAQ,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACnE,kFAAkF;IAClF,QAAQ,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACrE,0CAA0C;IAC1C,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;CAC9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grid-view.js","sourceRoot":"","sources":["../../src/types/grid-view.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n GridRectItem,\n GridViewport,\n GridViewportConstraints,\n GridZoomLimits,\n} from '@ankhorage/grid-view';\nimport type React from 'react';\n\nimport type { ZoraBaseProps } from './base';\n\n/** The renderer owns presentation only; world geometry comes from grid-view. */\nexport interface GridViewProps extends ZoraBaseProps {\n items: readonly GridRectItem[];\n contentWidth: number;\n contentHeight: number;\n width: number;\n height: number;\n /**\n * Canonical controlled world viewport. Supplying this value makes `onViewportChange`\n * report interaction proposals without mutating renderer-owned state.\n */\n viewport?: GridViewport;\n /** Initial world position and independent axis scales for uncontrolled rendering. */\n defaultViewport?: Partial<\n Pick<GridViewport, 'offsetX' | 'offsetY' | 'pixelsPerUnitX' | 'pixelsPerUnitY'>\n >;\n /** Finite world bounds and optional overscroll for panning and focused-item reveal. */\n viewportConstraints?: GridViewportConstraints;\n /** Independent X/Y scale limits applied to focal-point zoom interactions. */\n zoomLimits?: GridZoomLimits;\n /** @deprecated Use `defaultViewport` for new code. */\n zoom?: number;\n overscanPixels?: number;\n /** Stable item identity that must be scrolled into view without duplicating viewport geometry. */\n focusedItemId?: string;\n /** Pixel inset retained around a revealed focused item. */\n revealPaddingPixels?: number;\n onViewportChange?: (viewport: GridViewport) => void;\n onVisibleItemIdsChange?: (ids: readonly string[]) => void;\n renderItem: (item: GridRectItem) => React.ReactNode;\n}\n\n/** An item needs a stable ID; visual positioning belongs to the TileGrid composition. */\nexport interface TileGridItem {\n readonly id: string;\n}\n\n/** Reusable tile presentation based on the generic world/viewport engine. */\nexport interface TileGridProps extends ZoraBaseProps {\n items: readonly TileGridItem[];\n width?: number;\n height?: number;\n tileSize?: number;\n gap?: number;\n zoom?: number;\n viewport?: GridViewport;\n defaultViewport?: Partial<\n Pick<GridViewport, 'offsetX' | 'offsetY' | 'pixelsPerUnitX' | 'pixelsPerUnitY'>\n >;\n viewportConstraints?: GridViewportConstraints;\n zoomLimits?: GridZoomLimits;\n overscanPixels?: number;\n focusedItemId?: string;\n revealPaddingPixels?: number;\n /** Reports the same measured column count used to position tiles. */\n onColumnsChange?: (columns: number) => void;\n onViewportChange?: (viewport: GridViewport) => void;\n onVisibleItemIdsChange?: (ids: readonly string[]) => void;\n renderItem: (item: TileGridItem) => React.ReactNode;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"grid-view.js","sourceRoot":"","sources":["../../src/types/grid-view.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n GridRectItem,\n GridViewport,\n GridViewportConstraints,\n GridZoomLimits,\n} from '@ankhorage/grid-view';\nimport type React from 'react';\n\nimport type { ZoraBaseProps } from './base';\n\n/** The renderer owns presentation only; world geometry comes from grid-view. */\nexport interface GridViewProps extends ZoraBaseProps {\n items: readonly GridRectItem[];\n contentWidth: number;\n contentHeight: number;\n width: number;\n height: number;\n /**\n * Canonical controlled world viewport. Supplying this value makes `onViewportChange`\n * report interaction proposals without mutating renderer-owned state.\n */\n viewport?: GridViewport;\n /** Initial world position and independent axis scales for uncontrolled rendering. */\n defaultViewport?: Partial<\n Pick<GridViewport, 'offsetX' | 'offsetY' | 'pixelsPerUnitX' | 'pixelsPerUnitY'>\n >;\n /** Finite world bounds and optional overscroll for panning and focused-item reveal. */\n viewportConstraints?: GridViewportConstraints;\n /** Independent X/Y scale limits applied to focal-point zoom interactions. */\n zoomLimits?: GridZoomLimits;\n /** @deprecated Use `defaultViewport` for new code. */\n zoom?: number;\n overscanPixels?: number;\n /** Stable item identity that must be scrolled into view without duplicating viewport geometry. */\n focusedItemId?: string;\n /** Pixel inset retained around a revealed focused item. */\n revealPaddingPixels?: number;\n onViewportChange?: (viewport: GridViewport) => void;\n onVisibleItemIdsChange?: (ids: readonly string[]) => void;\n renderItem: (item: GridRectItem) => React.ReactNode;\n}\n\n/** An item needs a stable ID; visual positioning belongs to the TileGrid composition. */\nexport interface TileGridItem {\n readonly id: string;\n}\n\n/** Reusable tile presentation based on the generic world/viewport engine. */\nexport interface TileGridProps extends ZoraBaseProps {\n items: readonly TileGridItem[];\n width?: number;\n height?: number;\n tileSize?: number;\n gap?: number;\n zoom?: number;\n viewport?: GridViewport;\n defaultViewport?: Partial<\n Pick<GridViewport, 'offsetX' | 'offsetY' | 'pixelsPerUnitX' | 'pixelsPerUnitY'>\n >;\n viewportConstraints?: GridViewportConstraints;\n zoomLimits?: GridZoomLimits;\n overscanPixels?: number;\n focusedItemId?: string;\n revealPaddingPixels?: number;\n /** Reports the same measured column count used to position tiles. */\n onColumnsChange?: (columns: number) => void;\n onViewportChange?: (viewport: GridViewport) => void;\n onVisibleItemIdsChange?: (ids: readonly string[]) => void;\n renderItem: (item: TileGridItem) => React.ReactNode;\n}\n\n/** The two independent native scroll axes that back a GridView viewport. */\nexport type GridScrollAxis = 'x' | 'y';\n\n/** A physical native scroll position in pixels. */\nexport interface GridScrollPosition {\n readonly x: number;\n readonly y: number;\n}\n\n/** A programmatic native scroll request that GridView is still waiting to observe. */\nexport interface GridPendingScroll {\n readonly animated: boolean;\n readonly expiresAt: number;\n readonly target: number;\n}\n\n/** Native capabilities and clock used by the programmatic-versus-user scroll arbiter. */\nexport interface GridScrollSyncOptions {\n /** Requests a native scroll of one axis. */\n readonly scrollTo: (axis: GridScrollAxis, offset: number, animated: boolean) => void;\n /** Reports a genuine user scroll as the pixel displacement of the native offset. */\n readonly onUserScroll: (axis: GridScrollAxis, displacement: number) => void;\n /** Reconciles a late programmatic native frame without classifying it as a user pan. */\n readonly onProgrammaticScroll: (axis: GridScrollAxis, displacement: number) => void;\n readonly now?: () => number;\n readonly schedule?: (callback: () => void, delay: number) => ReturnType<typeof setTimeout>;\n readonly cancel?: (handle: ReturnType<typeof setTimeout>) => void;\n}\n\n/** Separates echoes of programmatic scrolls from user scrolling, independently per axis. */\nexport interface GridScrollSync {\n /** True when the baseline already matches the position within native tolerance. */\n readonly isCurrent: (position: GridScrollPosition) => boolean;\n /** Moves native scrolling to a viewport-derived position. */\n readonly request: (position: GridScrollPosition, animated: boolean) => void;\n /** Routes one native scroll event. */\n readonly scrolled: (axis: GridScrollAxis, offset: number) => void;\n /** Hands an axis to the user, adopting the native offset at the start of their drag. */\n readonly dragBegan: (axis: GridScrollAxis, offset: number) => void;\n /** Adopts the final native offset when a programmatic or momentum scroll ends. */\n readonly scrollEnded: (axis: GridScrollAxis, offset: number) => void;\n /** Cancels every pending settle timer. */\n readonly dispose: () => void;\n}\n"]}
|
package/dist/types/layout.d.ts
CHANGED
|
@@ -22,4 +22,9 @@ export interface ScreenProps extends ZoraBaseProps {
|
|
|
22
22
|
scroll?: boolean;
|
|
23
23
|
width?: ZoraContentWidth;
|
|
24
24
|
}
|
|
25
|
+
/** Exclusive-gesture coordination between a ZORA scroll container and its descendant surfaces. */
|
|
26
|
+
export interface ScrollGestureLock {
|
|
27
|
+
/** Suspends scrolling until the returned release function runs; releasing twice is harmless. */
|
|
28
|
+
readonly acquire: () => () => void;
|
|
29
|
+
}
|
|
25
30
|
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.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EAAE,gBAAgB,CAAC;CAC1B;AAED,kGAAkG;AAClG,MAAM,WAAW,iBAAiB;IAChC,gGAAgG;IAChG,QAAQ,CAAC,OAAO,EAAE,MAAM,MAAM,IAAI,CAAC;CACpC"}
|
package/dist/types/layout.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../../src/types/layout.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n DividerProps as SurfaceDividerProps,\n GridProps as SurfaceGridProps,\n ScrollViewProps as SurfaceScrollViewProps,\n ViewProps as SurfaceViewProps,\n} from '@ankhorage/surface';\nimport type React from 'react';\n\nimport type { ZoraBaseProps } from './base';\n\nexport type ZoraContentWidth = 'narrow' | 'default' | 'wide';\n\nexport interface ViewProps extends ZoraBaseProps, Omit<SurfaceViewProps, 'mode' | 'themeId'> {}\nexport interface ScrollViewProps\n extends ZoraBaseProps, Omit<SurfaceScrollViewProps, 'mode' | 'themeId'> {}\nexport interface DividerProps\n extends ZoraBaseProps, Omit<SurfaceDividerProps, 'mode' | 'themeId'> {}\nexport interface GridProps extends ZoraBaseProps, Omit<SurfaceGridProps, 'mode' | 'themeId'> {}\n\nexport interface AppShellProps extends ZoraBaseProps {\n children?: React.ReactNode;\n header?: React.ReactNode;\n footer?: React.ReactNode;\n overlay?: React.ReactNode;\n}\n\nexport interface ScreenProps extends ZoraBaseProps {\n children?: React.ReactNode;\n footer?: React.ReactNode;\n scroll?: boolean;\n width?: ZoraContentWidth;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../../src/types/layout.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n DividerProps as SurfaceDividerProps,\n GridProps as SurfaceGridProps,\n ScrollViewProps as SurfaceScrollViewProps,\n ViewProps as SurfaceViewProps,\n} from '@ankhorage/surface';\nimport type React from 'react';\n\nimport type { ZoraBaseProps } from './base';\n\nexport type ZoraContentWidth = 'narrow' | 'default' | 'wide';\n\nexport interface ViewProps extends ZoraBaseProps, Omit<SurfaceViewProps, 'mode' | 'themeId'> {}\nexport interface ScrollViewProps\n extends ZoraBaseProps, Omit<SurfaceScrollViewProps, 'mode' | 'themeId'> {}\nexport interface DividerProps\n extends ZoraBaseProps, Omit<SurfaceDividerProps, 'mode' | 'themeId'> {}\nexport interface GridProps extends ZoraBaseProps, Omit<SurfaceGridProps, 'mode' | 'themeId'> {}\n\nexport interface AppShellProps extends ZoraBaseProps {\n children?: React.ReactNode;\n header?: React.ReactNode;\n footer?: React.ReactNode;\n overlay?: React.ReactNode;\n}\n\nexport interface ScreenProps extends ZoraBaseProps {\n children?: React.ReactNode;\n footer?: React.ReactNode;\n scroll?: boolean;\n width?: ZoraContentWidth;\n}\n\n/** Exclusive-gesture coordination between a ZORA scroll container and its descendant surfaces. */\nexport interface ScrollGestureLock {\n /** Suspends scrolling until the returned release function runs; releasing twice is harmless. */\n readonly acquire: () => () => void;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/zora",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "25.8.
|
|
4
|
+
"version": "25.8.12",
|
|
5
5
|
"description": "Opinionated React Native and React Native Web UI kit built on @ankhorage/surface.",
|
|
6
6
|
"homepage": "https://github.com/ankhorage/zora#readme",
|
|
7
7
|
"bugs": {
|
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
},
|
|
136
136
|
"devDependencies": {
|
|
137
137
|
"@ankhorage/devtools": "^2.3.18",
|
|
138
|
-
"@ankhorage/paradox": "^0.3.
|
|
138
|
+
"@ankhorage/paradox": "^0.3.5",
|
|
139
139
|
"@react-native-vector-icons/fontawesome": "^13.1.5",
|
|
140
140
|
"@react-native-vector-icons/fontawesome5": "^13.1.5",
|
|
141
141
|
"@react-native-vector-icons/fontawesome6": "^13.1.5",
|