@astryxdesign/core 0.7.15-canary.gf890983 → 0.7.15
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 +72 -2
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +5 -4
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +10 -23
- package/dist/Item/Item.js +2 -2
- package/dist/Layer/useTouchTrigger.d.ts +12 -1
- package/dist/Layer/useTouchTrigger.d.ts.map +1 -1
- package/dist/Layer/useTouchTrigger.js +22 -3
- package/dist/Outline/useScrollSpy.d.ts.map +1 -1
- package/dist/Outline/useScrollSpy.js +22 -18
- package/dist/RadioList/RadioListItem.d.ts.map +1 -1
- package/dist/RadioList/RadioListItem.js +6 -32
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +5 -10
- package/dist/Resizable/useResizable.d.ts.map +1 -1
- package/dist/Resizable/useResizable.js +6 -5
- package/dist/Stepper/Step.js +8 -8
- package/dist/Table/plugins/sortable/useTableSortableState.d.ts.map +1 -1
- package/dist/Table/plugins/sortable/useTableSortableState.js +8 -4
- package/dist/Text/TruncationTooltip.d.ts.map +1 -1
- package/dist/Text/TruncationTooltip.js +10 -1
- package/dist/Toast/ToastViewport.d.ts.map +1 -1
- package/dist/Toast/ToastViewport.js +31 -6
- package/dist/Token/Token.js +2 -2
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +1 -1
- package/dist/TreeList/TreeListItem.js +2 -2
- package/dist/gestures/GestureHost.d.ts +38 -0
- package/dist/gestures/GestureHost.d.ts.map +1 -1
- package/dist/gestures/GestureHost.js +95 -1
- package/dist/gestures/contextRequest.d.ts +43 -0
- package/dist/gestures/contextRequest.d.ts.map +1 -0
- package/dist/gestures/contextRequest.js +167 -0
- package/dist/hooks/useClickableContainer.d.ts +1 -1
- package/dist/hooks/useClickableContainer.d.ts.map +1 -1
- package/dist/hooks/useClickableContainer.js +2 -2
- package/dist/hooks/useCommittedRef.d.ts +20 -0
- package/dist/hooks/useCommittedRef.d.ts.map +1 -0
- package/dist/hooks/useCommittedRef.js +38 -0
- package/dist/hooks/useMenuPress.d.ts.map +1 -1
- package/dist/hooks/useMenuPress.js +23 -27
- package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +2 -1
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +2 -1
- package/dist/internal/committed-ref.d.ts +15 -0
- package/dist/internal/committed-ref.d.ts.map +1 -0
- package/dist/internal/committed-ref.js +15 -0
- package/dist/internal/touch.d.ts +2 -1
- package/dist/internal/touch.d.ts.map +1 -1
- package/dist/internal/touch.js +1 -0
- package/dist/keyboard/keyboardHeight.d.ts.map +1 -1
- package/dist/keyboard/keyboardHeight.js +13 -9
- package/dist/keyboard/useMobileKeyboard.d.ts.map +1 -1
- package/dist/keyboard/useMobileKeyboard.js +8 -7
- package/dist/privateAttributes/press.stylex.d.ts +40 -10
- package/dist/privateAttributes/press.stylex.d.ts.map +1 -1
- package/dist/privateAttributes/press.stylex.js +46 -10
- package/locales/en.json +4 -0
- package/locales/pseudo.json +3 -0
- package/package.json +10 -5
- package/src/BottomSheet/BottomSheetPanel.tsx +5 -4
- package/src/CheckboxInput/CheckboxInput.tsx +20 -60
- package/src/Item/Item.tsx +2 -2
- package/src/Layer/useTouchTrigger.ts +30 -1
- package/src/Outline/useScrollSpy.ts +22 -22
- package/src/RadioList/RadioListItem.tsx +19 -79
- package/src/Resizable/ResizeHandle.tsx +5 -6
- package/src/Resizable/useResizable.ts +5 -5
- package/src/Stepper/Step.tsx +6 -6
- package/src/Stepper/Stepper.doc.mjs +8 -2
- package/src/Table/plugins/sortable/useTableSortableState.tsx +10 -4
- package/src/Text/TruncationTooltip.tsx +16 -1
- package/src/Toast/ToastViewport.tsx +31 -5
- package/src/Token/Token.tsx +2 -2
- package/src/Tooltip/useTooltip.tsx +1 -0
- package/src/TreeList/TreeListItem.tsx +2 -2
- package/src/gestures/GestureHost.ts +125 -1
- package/src/gestures/README.md +21 -0
- package/src/gestures/contextRequest.ts +206 -0
- package/src/hooks/useClickableContainer.ts +2 -2
- package/src/hooks/useCommittedRef.ts +39 -0
- package/src/hooks/useMenuPress.ts +59 -62
- package/src/i18n/generated-locales/en.generated.ts +1 -0
- package/src/i18n/generated-locales/pseudo.generated.ts +1 -0
- package/src/internal/committed-ref.ts +15 -0
- package/src/internal/touch.ts +3 -0
- package/src/keyboard/keyboardHeight.ts +15 -17
- package/src/keyboard/useMobileKeyboard.ts +8 -7
- package/src/privateAttributes/press.stylex.ts +109 -10
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type GestureHost } from './GestureHost.js';
|
|
2
|
+
import type { PointerKind } from './types.js';
|
|
3
|
+
/** What a context request reports. */
|
|
4
|
+
export interface ContextRequest {
|
|
5
|
+
/**
|
|
6
|
+
* What made it: a held finger or pen, a pointer's context click, or a key.
|
|
7
|
+
*/
|
|
8
|
+
readonly kind: 'hold' | 'pointer' | 'keyboard';
|
|
9
|
+
/** The pointer that made it; null from the keyboard. */
|
|
10
|
+
readonly pointerType: PointerKind | null;
|
|
11
|
+
/** Where, in client coordinates; null from the keyboard. */
|
|
12
|
+
readonly point: {
|
|
13
|
+
readonly x: number;
|
|
14
|
+
readonly y: number;
|
|
15
|
+
} | null;
|
|
16
|
+
/**
|
|
17
|
+
* The Pointer Events id of the pointer that made it, when the host knows it.
|
|
18
|
+
*/
|
|
19
|
+
readonly pointerId: number | null;
|
|
20
|
+
/** When, on the gesture host's clock. */
|
|
21
|
+
readonly time: number;
|
|
22
|
+
}
|
|
23
|
+
export interface ContextRequestOptions {
|
|
24
|
+
onRequest: (request: ContextRequest) => void;
|
|
25
|
+
/**
|
|
26
|
+
* Read when it attaches: a disabled request registers nothing. Read again
|
|
27
|
+
* at each input. @default () => true
|
|
28
|
+
*/
|
|
29
|
+
isEnabled?: () => boolean;
|
|
30
|
+
/**
|
|
31
|
+
* A hold's progress. It reports `committed` when the still finger or pen
|
|
32
|
+
* claims its touch and the hold requests. It then reports `ended` at its
|
|
33
|
+
* lift, or `cancelled` if a cancel ends the touch first. A hold disabled
|
|
34
|
+
* before it requests reports nothing.
|
|
35
|
+
*/
|
|
36
|
+
onHold?: (phase: 'committed' | 'ended' | 'cancelled') => void;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Report context requests on `element` until the returned function runs.
|
|
40
|
+
* `host` is the document's gesture host; tests pass their own.
|
|
41
|
+
*/
|
|
42
|
+
export declare function attachContextRequest(element: Element, options: ContextRequestOptions, host?: GestureHost): () => void;
|
|
43
|
+
//# sourceMappingURL=contextRequest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contextRequest.d.ts","sourceRoot":"","sources":["../../src/gestures/contextRequest.ts"],"names":[],"mappings":"AAcA,OAAO,EAAiB,KAAK,WAAW,EAAC,MAAM,eAAe,CAAC;AAE/D,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,SAAS,CAAC;AAEzC,sCAAsC;AACtC,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,CAAC;IAC/C,wDAAwD;IACxD,QAAQ,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;IACzC,4DAA4D;IAC5D,QAAQ,CAAC,KAAK,EAAE;QAAC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;KAAC,GAAG,IAAI,CAAC;IAChE;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,yCAAyC;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;IAC7C;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,OAAO,CAAC;IAC1B;;;;;OAKG;IACH,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,GAAG,WAAW,KAAK,IAAI,CAAC;CAC/D;AAuBD;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,qBAAqB,EAC9B,IAAI,GAAE,WAAmD,GACxD,MAAM,IAAI,CA4HZ"}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file contextRequest.ts
|
|
5
|
+
* @input An element, a request callback and the document's gesture host
|
|
6
|
+
* @output attachContextRequest: one shared context request from a held
|
|
7
|
+
* finger or pen, a pointer's context click, or Shift+F10 and the
|
|
8
|
+
* context-menu key
|
|
9
|
+
* @position Internal gesture module, never exported from the package. The
|
|
10
|
+
* headless context menu and row menus build on it.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { lockSelection } from "../utils/selectionLock.js";
|
|
14
|
+
import { sharedWeakSet } from "../utils/sharedRealm.js";
|
|
15
|
+
import { getGestureHost } from "./GestureHost.js";
|
|
16
|
+
import { LongPressGestureRecognizer } from "./LongPressGestureRecognizer.js";
|
|
17
|
+
|
|
18
|
+
/** What a context request reports. */
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* How long after a request key's last keydown, or a pen's lift, the browser's
|
|
22
|
+
* own context menu event is that input's echo, ms.
|
|
23
|
+
*/
|
|
24
|
+
const MENU_ECHO_MS = 500;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Menu events and keys a request already answered: one inside nested
|
|
28
|
+
* requests reaches only the innermost, as a hold resolves to one winner.
|
|
29
|
+
* Every copy of Core shares the set, so nested requests from two copies
|
|
30
|
+
* still answer once.
|
|
31
|
+
*/
|
|
32
|
+
const answered = sharedWeakSet('gestures/context-request/answered', 1);
|
|
33
|
+
const POINTER_KINDS = new Set(['touch', 'mouse', 'pen']);
|
|
34
|
+
function pointerKindOf(event) {
|
|
35
|
+
const type = event.pointerType;
|
|
36
|
+
return type != null && POINTER_KINDS.has(type) ? type : null;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Report context requests on `element` until the returned function runs.
|
|
41
|
+
* `host` is the document's gesture host; tests pass their own.
|
|
42
|
+
*/
|
|
43
|
+
export function attachContextRequest(element, options, host = getGestureHost(element.ownerDocument)) {
|
|
44
|
+
const isEnabled = () => options.isEnabled?.() !== false;
|
|
45
|
+
if (!isEnabled()) {
|
|
46
|
+
return () => {};
|
|
47
|
+
}
|
|
48
|
+
let lastRequestKeyAt = Number.NEGATIVE_INFINITY;
|
|
49
|
+
let held = null;
|
|
50
|
+
let isHoldReported = false;
|
|
51
|
+
|
|
52
|
+
// The defaults are UIKit's plain long press.
|
|
53
|
+
const recognizer = new LongPressGestureRecognizer({
|
|
54
|
+
name: 'contextRequest',
|
|
55
|
+
// A mouse held still selects text and drags: a hold is a finger's or a
|
|
56
|
+
// pen's.
|
|
57
|
+
allowedPointerTypes: ['touch', 'pen'],
|
|
58
|
+
// A hold that opens a menu takes no selection or callout.
|
|
59
|
+
selectionLock: lockSelection,
|
|
60
|
+
shouldReceiveTouch: (_recognizer, touch) => {
|
|
61
|
+
if (!isEnabled() || host.keepsPressBetween(touch.target, element)) {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
held = {
|
|
65
|
+
touchId: touch.id,
|
|
66
|
+
pointerType: touch.pointerType
|
|
67
|
+
};
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
recognizer.addListener(() => {
|
|
72
|
+
const {
|
|
73
|
+
state
|
|
74
|
+
} = recognizer;
|
|
75
|
+
if (state === 'began') {
|
|
76
|
+
// A request disabled during the hold makes none, and its hold reports
|
|
77
|
+
// no phase: `committed` comes only with a request.
|
|
78
|
+
if (!isEnabled()) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
isHoldReported = true;
|
|
82
|
+
options.onHold?.('committed');
|
|
83
|
+
const point = recognizer.location();
|
|
84
|
+
options.onRequest({
|
|
85
|
+
kind: 'hold',
|
|
86
|
+
pointerType: held?.pointerType ?? 'touch',
|
|
87
|
+
point: {
|
|
88
|
+
x: point.x,
|
|
89
|
+
y: point.y
|
|
90
|
+
},
|
|
91
|
+
pointerId: held == null ? null : host.pointerIdOf(held.touchId),
|
|
92
|
+
time: host.arena.now()
|
|
93
|
+
});
|
|
94
|
+
} else if (state === 'ended' || state === 'cancelled') {
|
|
95
|
+
if (isHoldReported) {
|
|
96
|
+
options.onHold?.(state);
|
|
97
|
+
}
|
|
98
|
+
isHoldReported = false;
|
|
99
|
+
held = null;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
const onContextMenu = event => {
|
|
103
|
+
const menu = event;
|
|
104
|
+
// A hold-repeat control inside owns only its hold: its right click
|
|
105
|
+
// reaches this request. A request inside already answered this event.
|
|
106
|
+
if (!isEnabled() || answered.has(menu)) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
answered.add(menu);
|
|
110
|
+
// The browser's own menu stays off either way.
|
|
111
|
+
menu.preventDefault();
|
|
112
|
+
const time = host.arena.now();
|
|
113
|
+
const pointerType = pointerKindOf(menu);
|
|
114
|
+
// A held finger's menu is the hold's to request, or a claim refused it.
|
|
115
|
+
// That needs a finger down inside this element. A key's menu event is
|
|
116
|
+
// that key's echo.
|
|
117
|
+
if (pointerType === 'touch' || host.isFingerDownIn(element) || time - lastRequestKeyAt < MENU_ECHO_MS ||
|
|
118
|
+
// A pen's own menu event is its hold's: during any hold of it inside
|
|
119
|
+
// this element, or right after its lift. The hold may be this
|
|
120
|
+
// request's, a stepper's, or a handle's that claimed first.
|
|
121
|
+
pointerType === 'pen' && (host.isPenDownIn(element) || time - host.lastPenLiftIn(element) < MENU_ECHO_MS)) {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
options.onRequest({
|
|
125
|
+
kind: 'pointer',
|
|
126
|
+
pointerType: pointerType ?? 'mouse',
|
|
127
|
+
point: {
|
|
128
|
+
x: menu.clientX,
|
|
129
|
+
y: menu.clientY
|
|
130
|
+
},
|
|
131
|
+
pointerId: menu.pointerId ?? null,
|
|
132
|
+
time
|
|
133
|
+
});
|
|
134
|
+
};
|
|
135
|
+
const onKeyDown = event => {
|
|
136
|
+
const key = event;
|
|
137
|
+
const isRequestKey = key.key === 'F10' && key.shiftKey || key.key === 'ContextMenu';
|
|
138
|
+
// A hold-repeat control inside owns only its hold: Shift+F10 on it
|
|
139
|
+
// reaches this request.
|
|
140
|
+
if (!isRequestKey || !isEnabled() || answered.has(key)) {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
answered.add(key);
|
|
144
|
+
key.preventDefault();
|
|
145
|
+
// A held key repeats its keydown. Each repeat keeps the echo window
|
|
146
|
+
// open, and only the first keydown requests.
|
|
147
|
+
lastRequestKeyAt = host.arena.now();
|
|
148
|
+
if (key.repeat) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
options.onRequest({
|
|
152
|
+
kind: 'keyboard',
|
|
153
|
+
pointerType: null,
|
|
154
|
+
point: null,
|
|
155
|
+
pointerId: null,
|
|
156
|
+
time: lastRequestKeyAt
|
|
157
|
+
});
|
|
158
|
+
};
|
|
159
|
+
const detachRecognizer = host.attach(element, recognizer);
|
|
160
|
+
element.addEventListener('contextmenu', onContextMenu);
|
|
161
|
+
element.addEventListener('keydown', onKeyDown);
|
|
162
|
+
return () => {
|
|
163
|
+
element.removeEventListener('contextmenu', onContextMenu);
|
|
164
|
+
element.removeEventListener('keydown', onKeyDown);
|
|
165
|
+
detachRecognizer();
|
|
166
|
+
};
|
|
167
|
+
}
|
|
@@ -69,7 +69,7 @@ export declare function hasInteractiveAncestor(el: Element, rootEl: Element): bo
|
|
|
69
69
|
* too. A press on the container's surface or on `ownAction` is left alone.
|
|
70
70
|
* Not part of the package's public API.
|
|
71
71
|
*/
|
|
72
|
-
export declare function
|
|
72
|
+
export declare function cancelNestedPress(event: PointerEvent<HTMLElement>, container: HTMLElement | null, ownAction: Element | null): void;
|
|
73
73
|
/**
|
|
74
74
|
* Check if there's a text selection inside the node (don't navigate on text select)
|
|
75
75
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useClickableContainer.d.ts","sourceRoot":"","sources":["../../src/hooks/useClickableContainer.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,YAAY,EAClB,MAAM,OAAO,CAAC;AAMf;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,6BAA6B,CAAC;AAExE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,qBAAqB,QAmBvB,CAAC;AAIZ;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAKrE;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,EAAE,EAAE,OAAO,EACX,MAAM,EAAE,OAAO,GAAG,IAAI,EACtB,aAAa,GAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAqC,GACzE,OAAO,GAAG,IAAI,CAShB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,GAAG,OAAO,CAE5E;AASD;;;;;;;;GAQG;AACH,wBAAgB,
|
|
1
|
+
{"version":3,"file":"useClickableContainer.d.ts","sourceRoot":"","sources":["../../src/hooks/useClickableContainer.ts"],"names":[],"mappings":"AAIA;;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MAAM,CAAC;IAChB,wCAAwC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAClD,SAAS,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACpD;;;;;;OAMG;IACH,aAAa,EAAE,CAAC,KAAK,EAAE,YAAY,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;CAC3D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,4BAA4B,GACpC,wBAAwB,CAU1B;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,EACzC,YAAY,EACZ,cAAc,EACd,OAAO,EAAE,WAAW,EACpB,IAAI,EACJ,MAAM,EACN,QAAgB,GACjB,EAAE,4BAA4B,GAAG,wBAAwB,CAwHzD"}
|
|
@@ -104,7 +104,7 @@ function belongsToSomethingElse(element) {
|
|
|
104
104
|
* too. A press on the container's surface or on `ownAction` is left alone.
|
|
105
105
|
* Not part of the package's public API.
|
|
106
106
|
*/
|
|
107
|
-
export function
|
|
107
|
+
export function cancelNestedPress(event, container, ownAction) {
|
|
108
108
|
const target = event.target;
|
|
109
109
|
if (container == null || event.pointerType !== 'touch' && pressBoxesIn(container).length === 0 || !(target instanceof Element) || target === event.currentTarget || !hasInteractiveAncestor(target, container) ||
|
|
110
110
|
// The container's own action, such as the control it delegates to: a
|
|
@@ -275,7 +275,7 @@ export function useClickableContainerProxy({
|
|
|
275
275
|
if (disabled) {
|
|
276
276
|
return;
|
|
277
277
|
}
|
|
278
|
-
|
|
278
|
+
cancelNestedPress(event, containerRef.current, interactiveRef?.current ?? null);
|
|
279
279
|
}, [containerRef, interactiveRef, disabled]);
|
|
280
280
|
return {
|
|
281
281
|
onClick,
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a ref whose `current` is the value of the last committed render.
|
|
3
|
+
* The ref object stays the same for the life of the component. Read
|
|
4
|
+
* `current` only in event and gesture callbacks, never during render. A
|
|
5
|
+
* value that selects a resource (what to subscribe to) belongs in the Effect's
|
|
6
|
+
* dependencies, not in a committed ref.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useCommittedRef<T>(value: T): {
|
|
9
|
+
readonly current: T;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Writes the value of each committed render into `ref`. Use this shape when
|
|
13
|
+
* callbacks that read the ref come before the value in the component. Create
|
|
14
|
+
* the ref with `useRef` first, then call this hook after the value exists.
|
|
15
|
+
* In all other cases, use `useCommittedRef`. The read rules are the same.
|
|
16
|
+
*/
|
|
17
|
+
export declare function useCommittedRefInto<T>(ref: {
|
|
18
|
+
current: T;
|
|
19
|
+
}, value: T): void;
|
|
20
|
+
//# sourceMappingURL=useCommittedRef.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCommittedRef.d.ts","sourceRoot":"","sources":["../../src/hooks/useCommittedRef.ts"],"names":[],"mappings":"AAaA;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG;IAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAA;CAAC,CAIlE;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,GAAG,EAAE;IAAC,OAAO,EAAE,CAAC,CAAA;CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,CAMxE"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @file useCommittedRef.ts
|
|
7
|
+
* @input A value from the current render: a prop or a callback
|
|
8
|
+
* @output Exports useCommittedRef and useCommittedRefInto
|
|
9
|
+
* @position Internal hooks; not in hooks/index.ts or the package entry
|
|
10
|
+
*/
|
|
11
|
+
import { useInsertionEffect, useRef } from 'react';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Returns a ref whose `current` is the value of the last committed render.
|
|
15
|
+
* The ref object stays the same for the life of the component. Read
|
|
16
|
+
* `current` only in event and gesture callbacks, never during render. A
|
|
17
|
+
* value that selects a resource (what to subscribe to) belongs in the Effect's
|
|
18
|
+
* dependencies, not in a committed ref.
|
|
19
|
+
*/
|
|
20
|
+
export function useCommittedRef(value) {
|
|
21
|
+
const ref = useRef(value);
|
|
22
|
+
useCommittedRefInto(ref, value);
|
|
23
|
+
return ref;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Writes the value of each committed render into `ref`. Use this shape when
|
|
28
|
+
* callbacks that read the ref come before the value in the component. Create
|
|
29
|
+
* the ref with `useRef` first, then call this hook after the value exists.
|
|
30
|
+
* In all other cases, use `useCommittedRef`. The read rules are the same.
|
|
31
|
+
*/
|
|
32
|
+
export function useCommittedRefInto(ref, value) {
|
|
33
|
+
// Stores values only. Refs to DOM nodes are not attached yet when this runs.
|
|
34
|
+
useInsertionEffect(() => {
|
|
35
|
+
// eslint-disable-next-line react-compiler/react-compiler -- the caller hands over its own ref so that this hook writes it
|
|
36
|
+
ref.current = value;
|
|
37
|
+
});
|
|
38
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMenuPress.d.ts","sourceRoot":"","sources":["../../src/hooks/useMenuPress.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAML,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useMenuPress.d.ts","sourceRoot":"","sources":["../../src/hooks/useMenuPress.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAML,KAAK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IACH,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,OAAO,GAAG,IAAI,CAAC;IACnD;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,+CAA+C;IAC/C,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAuBD,MAAM,WAAW,kBAAkB;IACjC,sEAAsE;IACtE,SAAS,EAAE;QACT,aAAa,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;QAChE,CAAC,iBAAiB,CAAC,EAAE,EAAE,CAAC;KACzB,CAAC;IACF;;;OAGG;IACH,YAAY,EAAE;QACZ,aAAa,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;QAChE,aAAa,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;KAC/D,CAAC;IACF;;;;OAIG;IACH,uBAAuB,EAAE,MAAM,OAAO,CAAC;IACvC,uEAAuE;IACvE,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAsED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,mBAAmB,GAAG,kBAAkB,CA4vB3E"}
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
21
21
|
import { currentGesture } from "../Layer/gestureCounter.js";
|
|
22
|
+
import { useCommittedRef } from "./useCommittedRef.js";
|
|
22
23
|
import { isInputShield } from "../Layer/inputHold.js";
|
|
23
24
|
import { IDLE_MENU_PRESS, menuPressTransition } from "./menuPressGesture.js";
|
|
24
25
|
import { MENU_PRESS_MARKER } from "./menuPressMarker.js";
|
|
@@ -203,8 +204,7 @@ export function useMenuPress(input) {
|
|
|
203
204
|
touchModel: publicOptions.longPressDelayMs === undefined ? 'uikit' : 'pointer',
|
|
204
205
|
isInScrollView: isInsideScrollView
|
|
205
206
|
};
|
|
206
|
-
const optionsRef =
|
|
207
|
-
optionsRef.current = options;
|
|
207
|
+
const optionsRef = useCommittedRef(options);
|
|
208
208
|
// The highlight, and the hover focus of the rows in this menu, follow the
|
|
209
209
|
// last input, which this tracks for the menu's own document.
|
|
210
210
|
useInteractionModalityTrackingFor(options.menuRef);
|
|
@@ -248,7 +248,7 @@ export function useMenuPress(input) {
|
|
|
248
248
|
const ignoredPointerIdRef = useRef(null);
|
|
249
249
|
const getDocument = useCallback(() => {
|
|
250
250
|
return optionsRef.current.menuRef.current?.ownerDocument ?? optionsRef.current.triggerRef?.current?.ownerDocument ?? document;
|
|
251
|
-
}, []);
|
|
251
|
+
}, [optionsRef]);
|
|
252
252
|
const resolvePoint = useCallback(event => {
|
|
253
253
|
const {
|
|
254
254
|
menuRef,
|
|
@@ -292,7 +292,7 @@ export function useMenuPress(input) {
|
|
|
292
292
|
isInMenu,
|
|
293
293
|
isOnTrigger
|
|
294
294
|
};
|
|
295
|
-
}, [getDocument]);
|
|
295
|
+
}, [getDocument, optionsRef]);
|
|
296
296
|
const stopAutoscroll = useCallback(() => {
|
|
297
297
|
autoscroll.stop();
|
|
298
298
|
autoscrollRef.current = null;
|
|
@@ -364,7 +364,7 @@ export function useMenuPress(input) {
|
|
|
364
364
|
preventScroll: true
|
|
365
365
|
});
|
|
366
366
|
}
|
|
367
|
-
}, [getDocument]);
|
|
367
|
+
}, [getDocument, optionsRef]);
|
|
368
368
|
const activate = useCallback((row, release) => {
|
|
369
369
|
// Every click this dispatches passes the shared click guard.
|
|
370
370
|
withoutClickGuard(() => {
|
|
@@ -399,10 +399,7 @@ export function useMenuPress(input) {
|
|
|
399
399
|
isModelActivation = false;
|
|
400
400
|
}
|
|
401
401
|
});
|
|
402
|
-
}, []);
|
|
403
|
-
|
|
404
|
-
// Declared before `step` so the mutual recursion through refs type-checks.
|
|
405
|
-
const stepRef = useRef(() => {});
|
|
402
|
+
}, [optionsRef]);
|
|
406
403
|
const applyEffect = useCallback((effect, gesture, native) => {
|
|
407
404
|
const doc = getDocument();
|
|
408
405
|
switch (effect.type) {
|
|
@@ -473,13 +470,14 @@ export function useMenuPress(input) {
|
|
|
473
470
|
return;
|
|
474
471
|
}
|
|
475
472
|
}
|
|
476
|
-
}, [activate, endGesture, getDocument, highlight, stopAutoscroll]);
|
|
473
|
+
}, [activate, endGesture, getDocument, highlight, optionsRef, stopAutoscroll]);
|
|
477
474
|
const step = useCallback((event, native) => {
|
|
478
475
|
const result = menuPressTransition(gestureRef.current, event);
|
|
479
476
|
gestureRef.current = result.gesture;
|
|
480
477
|
applyEffect(result.effect, result.gesture, native);
|
|
481
478
|
}, [applyEffect]);
|
|
482
|
-
|
|
479
|
+
// The trigger context is built once, so it calls `step` through this ref.
|
|
480
|
+
const stepRef = useCommittedRef(step);
|
|
483
481
|
const getScroller = useCallback(() => {
|
|
484
482
|
const {
|
|
485
483
|
getScroller: custom,
|
|
@@ -493,7 +491,7 @@ export function useMenuPress(input) {
|
|
|
493
491
|
return null;
|
|
494
492
|
}
|
|
495
493
|
return menu.scrollHeight > menu.clientHeight + 1 ? menu : null;
|
|
496
|
-
}, []);
|
|
494
|
+
}, [optionsRef]);
|
|
497
495
|
const updateAutoscroll = useCallback(event => {
|
|
498
496
|
if (gestureRef.current.phase !== 'tracking') {
|
|
499
497
|
stopAutoscroll();
|
|
@@ -531,7 +529,7 @@ export function useMenuPress(input) {
|
|
|
531
529
|
const last = lastPointerEventRef.current;
|
|
532
530
|
if (last != null) {
|
|
533
531
|
const point = resolvePoint(last);
|
|
534
|
-
|
|
532
|
+
step({
|
|
535
533
|
type: 'move',
|
|
536
534
|
row: point.row,
|
|
537
535
|
isInMenu: point.isInMenu,
|
|
@@ -541,7 +539,7 @@ export function useMenuPress(input) {
|
|
|
541
539
|
}
|
|
542
540
|
};
|
|
543
541
|
autoscroll.update();
|
|
544
|
-
}, [autoscroll, getScroller, resolvePoint, stopAutoscroll]);
|
|
542
|
+
}, [autoscroll, getScroller, resolvePoint, step, stopAutoscroll]);
|
|
545
543
|
const attach = useCallback(pointerId => {
|
|
546
544
|
detachRef.current?.();
|
|
547
545
|
const doc = getDocument();
|
|
@@ -561,14 +559,14 @@ export function useMenuPress(input) {
|
|
|
561
559
|
y: event.clientY
|
|
562
560
|
});
|
|
563
561
|
if (isPending === false) {
|
|
564
|
-
|
|
562
|
+
step({
|
|
565
563
|
type: 'cancel'
|
|
566
564
|
});
|
|
567
565
|
}
|
|
568
566
|
return;
|
|
569
567
|
}
|
|
570
568
|
const point = resolvePoint(event);
|
|
571
|
-
|
|
569
|
+
step({
|
|
572
570
|
type: 'move',
|
|
573
571
|
row: point.row,
|
|
574
572
|
isInMenu: point.isInMenu,
|
|
@@ -582,7 +580,7 @@ export function useMenuPress(input) {
|
|
|
582
580
|
return;
|
|
583
581
|
}
|
|
584
582
|
const point = resolvePoint(event);
|
|
585
|
-
|
|
583
|
+
step({
|
|
586
584
|
type: 'up',
|
|
587
585
|
row: point.row,
|
|
588
586
|
isInMenu: point.isInMenu,
|
|
@@ -595,7 +593,7 @@ export function useMenuPress(input) {
|
|
|
595
593
|
if (event.pointerId !== pointerIdRef.current) {
|
|
596
594
|
return;
|
|
597
595
|
}
|
|
598
|
-
|
|
596
|
+
step({
|
|
599
597
|
type: 'cancel'
|
|
600
598
|
});
|
|
601
599
|
};
|
|
@@ -603,7 +601,7 @@ export function useMenuPress(input) {
|
|
|
603
601
|
// Any press ends a withdrawn gesture: its finger lifted where the
|
|
604
602
|
// page could not see it, and the new press's click must act.
|
|
605
603
|
if (gestureRef.current.phase === 'withdrawn') {
|
|
606
|
-
|
|
604
|
+
step({
|
|
607
605
|
type: 'cancel'
|
|
608
606
|
});
|
|
609
607
|
return;
|
|
@@ -612,7 +610,7 @@ export function useMenuPress(input) {
|
|
|
612
610
|
// scroll, never a pick.
|
|
613
611
|
if (event.pointerId !== pointerIdRef.current) {
|
|
614
612
|
ignoredPointerIdRef.current = event.pointerId;
|
|
615
|
-
|
|
613
|
+
step({
|
|
616
614
|
type: 'cancel'
|
|
617
615
|
});
|
|
618
616
|
}
|
|
@@ -623,7 +621,7 @@ export function useMenuPress(input) {
|
|
|
623
621
|
// these listeners until its release. That release acts on nothing, and
|
|
624
622
|
// its click is swallowed. A mouse press ends as a cancel and keeps its
|
|
625
623
|
// click.
|
|
626
|
-
|
|
624
|
+
step({
|
|
627
625
|
type: 'withdraw'
|
|
628
626
|
});
|
|
629
627
|
};
|
|
@@ -639,7 +637,7 @@ export function useMenuPress(input) {
|
|
|
639
637
|
doc.removeEventListener('pointerdown', onOtherPointerDown, true);
|
|
640
638
|
view?.removeEventListener('blur', onBlur);
|
|
641
639
|
};
|
|
642
|
-
}, [getDocument, resolvePoint, updateAutoscroll]);
|
|
640
|
+
}, [getDocument, optionsRef, resolvePoint, step, updateAutoscroll]);
|
|
643
641
|
|
|
644
642
|
// `touch-action` was decided when the finger landed; the page must not
|
|
645
643
|
// scroll under a finger that is now driving a menu. Taken off when the
|
|
@@ -662,10 +660,8 @@ export function useMenuPress(input) {
|
|
|
662
660
|
}, [getDocument]);
|
|
663
661
|
|
|
664
662
|
// The trigger half below drives the model through this stable context.
|
|
665
|
-
const installRef =
|
|
666
|
-
|
|
667
|
-
const attachRef = useRef(attach);
|
|
668
|
-
attachRef.current = attach;
|
|
663
|
+
const installRef = useCommittedRef(installTouchMovePreventer);
|
|
664
|
+
const attachRef = useCommittedRef(attach);
|
|
669
665
|
const holdDetectorsRef = useRef(null);
|
|
670
666
|
const [triggerContext] = useState(() => ({
|
|
671
667
|
optionsRef,
|
|
@@ -752,7 +748,7 @@ export function useMenuPress(input) {
|
|
|
752
748
|
row: point.row,
|
|
753
749
|
time: Date.now()
|
|
754
750
|
}, native);
|
|
755
|
-
}, [attach, resolvePoint, step]);
|
|
751
|
+
}, [attach, optionsRef, resolvePoint, step]);
|
|
756
752
|
const isTriggerClickFromPress = useCallback(() => {
|
|
757
753
|
return triggerGestureRef.current != null && triggerGestureRef.current === currentGesture();
|
|
758
754
|
}, []);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.generated.d.ts","sourceRoot":"","sources":["../../../src/i18n/generated-locales/en.generated.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,QAAA,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"en.generated.d.ts","sourceRoot":"","sources":["../../../src/i18n/generated-locales/en.generated.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,QAAA,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAmtBpD,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -649,6 +649,7 @@ const runtimeCatalog = {
|
|
|
649
649
|
'@astryx.comments.olderFailed': "Earlier comments couldn't load",
|
|
650
650
|
'@astryx.comments.postFailed': "Your comment couldn't be posted.",
|
|
651
651
|
'@astryx.infoTip.label': 'More information',
|
|
652
|
-
'@astryx.navigationStack.back': 'Back'
|
|
652
|
+
'@astryx.navigationStack.back': 'Back',
|
|
653
|
+
'@astryx.searchField.cancel': 'Cancel'
|
|
653
654
|
};
|
|
654
655
|
export default runtimeCatalog;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pseudo.generated.d.ts","sourceRoot":"","sources":["../../../src/i18n/generated-locales/pseudo.generated.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,QAAA,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"pseudo.generated.d.ts","sourceRoot":"","sources":["../../../src/i18n/generated-locales/pseudo.generated.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,QAAA,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA+tBpD,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -649,6 +649,7 @@ const runtimeCatalog = {
|
|
|
649
649
|
'@astryx.comments.olderFailed': "⟦Éàřłíéř çóɱɱéñţš çóúłðñ'ţ łóàð⟧",
|
|
650
650
|
'@astryx.comments.postFailed': "⟦Ýóúř çóɱɱéñţ çóúłðñ'ţ ƀé þóšţéð.⟧",
|
|
651
651
|
'@astryx.infoTip.label': '⟦Ṁóřé íñƒóřɱàţíóñ⟧',
|
|
652
|
-
'@astryx.navigationStack.back': '⟦Ɓàçķ⟧'
|
|
652
|
+
'@astryx.navigationStack.back': '⟦Ɓàçķ⟧',
|
|
653
|
+
'@astryx.searchField.cancel': '⟦Çàñçéł⟧'
|
|
653
654
|
};
|
|
654
655
|
export default runtimeCatalog;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file committed-ref.ts
|
|
3
|
+
* @input Core's latest-value ref hooks
|
|
4
|
+
* @output `@astryxdesign/core/internal/committed-ref`: useCommittedRef and
|
|
5
|
+
* useCommittedRefInto, re-exported by name for Lab components
|
|
6
|
+
* @position An internal entry reserved for Astryx's own packages:
|
|
7
|
+
* undocumented, outside the public API and its compatibility promise,
|
|
8
|
+
* versioned in lockstep with Core, and allowed only in Core and Lab by the
|
|
9
|
+
* `@astryx/no-core-internal-import` lint rule. Core components import the
|
|
10
|
+
* same module by relative path. Named re-exports only.
|
|
11
|
+
*
|
|
12
|
+
* SYNC: When modified, update scripts/sync-exports.js.
|
|
13
|
+
*/
|
|
14
|
+
export { useCommittedRef, useCommittedRefInto } from '../hooks/useCommittedRef.js';
|
|
15
|
+
//# sourceMappingURL=committed-ref.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"committed-ref.d.ts","sourceRoot":"","sources":["../../src/internal/committed-ref.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAC,eAAe,EAAE,mBAAmB,EAAC,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
/**
|
|
3
|
+
* @file committed-ref.ts
|
|
4
|
+
* @input Core's latest-value ref hooks
|
|
5
|
+
* @output `@astryxdesign/core/internal/committed-ref`: useCommittedRef and
|
|
6
|
+
* useCommittedRefInto, re-exported by name for Lab components
|
|
7
|
+
* @position An internal entry reserved for Astryx's own packages:
|
|
8
|
+
* undocumented, outside the public API and its compatibility promise,
|
|
9
|
+
* versioned in lockstep with Core, and allowed only in Core and Lab by the
|
|
10
|
+
* `@astryx/no-core-internal-import` lint rule. Core components import the
|
|
11
|
+
* same module by relative path. Named re-exports only.
|
|
12
|
+
*
|
|
13
|
+
* SYNC: When modified, update scripts/sync-exports.js.
|
|
14
|
+
*/
|
|
15
|
+
export { useCommittedRef, useCommittedRefInto } from "../hooks/useCommittedRef.js";
|
package/dist/internal/touch.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ export type { PanGestureRecognizerOptions } from '../gestures/PanGestureRecogniz
|
|
|
31
31
|
export type { GestureEventContext, GestureTouch, PointerKind, } from '../gestures/types.js';
|
|
32
32
|
export { useGestureRecognizer } from '../gestures/useGestureRecognizer.js';
|
|
33
33
|
export { createMotionEngine } from '../motion/animator.js';
|
|
34
|
-
export type { Animator as MotionEngine, AnimatorOptions as MotionEngineOptions, MotionCurve, } from '../motion/animator.js';
|
|
34
|
+
export type { AnimateOptions, Animator as MotionEngine, AnimatorOptions as MotionEngineOptions, MotionCurve, MotionHandle, } from '../motion/animator.js';
|
|
35
35
|
export { cubicBezier } from '../motion/bezier.js';
|
|
36
36
|
export { mapProgress } from '../motion/progress.js';
|
|
37
37
|
export { parseCssEasing, parseMotionRoleValue } from '../motion/roles.js';
|
|
@@ -46,6 +46,7 @@ export { resolveMotion } from '../motion/resolveMotion.js';
|
|
|
46
46
|
export { solveSpring, toSpring } from '../motion/spring.js';
|
|
47
47
|
export type { SpringDescription } from '../motion/spring.js';
|
|
48
48
|
export { navigation } from '../motion/uikit/navigation.js';
|
|
49
|
+
export { timing } from '../motion/uikit/timing.js';
|
|
49
50
|
export { NAVIGATION_BAR_ELEMENTS_SPRING, NAVIGATION_INTERACTIVE_POP_FINISH_SPRING, NAVIGATION_POP_SPRING, NAVIGATION_PUSH_SPRING, } from '../motion/uikit/springs.js';
|
|
50
51
|
export { focusForLastInput, isFocusLost } from '../utils/focusReturn.js';
|
|
51
52
|
export { useInteractionModalityTracking } from '../utils/interactionModality.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"touch.d.ts","sourceRoot":"","sources":["../../src/internal/touch.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAC,YAAY,EAAE,YAAY,EAAC,MAAM,0BAA0B,CAAC;AACpE,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,QAAQ,EACR,UAAU,EACV,mBAAmB,EACnB,YAAY,GACb,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,WAAW,GACZ,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAC,0BAA0B,EAAC,MAAM,wCAAwC,CAAC;AAClF,OAAO,EAAC,oBAAoB,EAAC,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAC,mBAAmB,EAAC,MAAM,mBAAmB,CAAC;AAOtD,OAAO,EAAC,oBAAoB,EAAC,MAAM,kCAAkC,CAAC;AACtE,YAAY,EAAC,2BAA2B,EAAC,MAAM,kCAAkC,CAAC;AAClF,YAAY,EACV,mBAAmB,EACnB,YAAY,EACZ,WAAW,GACZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAC,oBAAoB,EAAC,MAAM,kCAAkC,CAAC;AAGtE,OAA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AC,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAC,kBAAkB,EAAC,MAAM,uBAAuB,CAAC;AAGzD,OAAO,EAAC,sBAAsB,EAAC,MAAM,iCAAiC,CAAC;AACvE,YAAY,EAAC,0BAA0B,EAAC,MAAM,iCAAiC,CAAC;AAGhF,OAAO,EAAC,wBAAwB,EAAC,MAAM,yBAAyB,CAAC"}
|
package/dist/internal/touch.js
CHANGED
|
@@ -58,6 +58,7 @@ export { ScreenEdgePanGestureRecognizer } from "../gestures/ScreenEdgePanGesture
|
|
|
58
58
|
export { resolveMotion } from "../motion/resolveMotion.js";
|
|
59
59
|
export { solveSpring, toSpring } from "../motion/spring.js";
|
|
60
60
|
export { navigation } from "../motion/uikit/navigation.js";
|
|
61
|
+
export { timing } from "../motion/uikit/timing.js";
|
|
61
62
|
export { NAVIGATION_BAR_ELEMENTS_SPRING, NAVIGATION_INTERACTIVE_POP_FINISH_SPRING, NAVIGATION_POP_SPRING, NAVIGATION_PUSH_SPRING } from "../motion/uikit/springs.js";
|
|
62
63
|
export { focusForLastInput, isFocusLost } from "../utils/focusReturn.js";
|
|
63
64
|
export { useInteractionModalityTracking } from "../utils/interactionModality.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyboardHeight.d.ts","sourceRoot":"","sources":["../../src/keyboard/keyboardHeight.ts"],"names":[],"mappings":"AA4BA,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAuBlC;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAQzD;AAED,8EAA8E;AAC9E,MAAM,MAAM,mBAAmB,GAC3B;IACE,kEAAkE;IAClE,IAAI,EAAE,UAAU,CAAC;IACjB,6CAA6C;IAC7C,MAAM,EAAE,MAAM,CAAC;IACf,uDAAuD;IACvD,SAAS,EAAE,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