@astryxdesign/core 0.7.14 → 0.7.15-canary.gea16e8d
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/dist/Calendar/Calendar.d.ts.map +1 -1
- package/dist/Calendar/Calendar.js +11 -2
- package/dist/Calendar/getInitialFocusDate.d.ts +8 -3
- package/dist/Calendar/getInitialFocusDate.d.ts.map +1 -1
- package/dist/Calendar/getInitialFocusDate.js +42 -7
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +9 -4
- package/dist/CheckboxList/CheckboxListItem.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxListItem.js +3 -8
- package/dist/DateInput/useTypedDate.d.ts.map +1 -1
- package/dist/DateInput/useTypedDate.js +3 -2
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +6 -3
- package/dist/DateTimeInput/NativeDateSegment.d.ts.map +1 -1
- package/dist/DateTimeInput/NativeDateSegment.js +23 -9
- package/dist/DateTimeInput/NativeTimeSegment.d.ts.map +1 -1
- package/dist/DateTimeInput/NativeTimeSegment.js +22 -8
- package/dist/Drawer/Drawer.d.ts.map +1 -1
- package/dist/Drawer/Drawer.js +7 -5
- package/dist/DropdownMenu/MenuBottomSheetActionList.d.ts.map +1 -1
- package/dist/DropdownMenu/MenuBottomSheetActionList.js +5 -1
- package/dist/Item/Item.d.ts +1 -1
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/Item.js +4 -2
- package/dist/Link/useLinkify.d.ts.map +1 -1
- package/dist/Link/useLinkify.js +3 -2
- package/dist/List/List.d.ts +4 -1
- package/dist/List/List.d.ts.map +1 -1
- package/dist/Markdown/Markdown.d.ts.map +1 -1
- package/dist/Markdown/Markdown.js +8 -0
- package/dist/RadioList/RadioListItem.d.ts.map +1 -1
- package/dist/RadioList/RadioListItem.js +19 -4
- package/dist/SegmentedControl/useSegmentedSelectionMotion.d.ts +43 -15
- package/dist/SegmentedControl/useSegmentedSelectionMotion.d.ts.map +1 -1
- package/dist/SegmentedControl/useSegmentedSelectionMotion.js +108 -18
- package/dist/SegmentedControl/useSegmentedTouchTracking.d.ts.map +1 -1
- package/dist/SegmentedControl/useSegmentedTouchTracking.js +5 -0
- package/dist/Table/plugins/sortable/useTableSortableState.d.ts.map +1 -1
- package/dist/Table/plugins/sortable/useTableSortableState.js +7 -3
- package/dist/Token/Token.d.ts.map +1 -1
- package/dist/Token/Token.js +2 -0
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +85 -12
- package/dist/astryx.css +11 -10
- package/dist/gestures/GestureHost.d.ts +5 -0
- package/dist/gestures/GestureHost.d.ts.map +1 -1
- package/dist/gestures/GestureHost.js +54 -28
- package/dist/hooks/menuPressGesture.d.ts +39 -2
- package/dist/hooks/menuPressGesture.d.ts.map +1 -1
- package/dist/hooks/menuPressGesture.js +92 -5
- package/dist/hooks/scrollOwnerRegistry.d.ts +0 -1
- package/dist/hooks/scrollOwnerRegistry.d.ts.map +1 -1
- package/dist/hooks/scrollOwnerRegistry.js +4 -1
- package/dist/hooks/useClickableContainer.d.ts +6 -4
- package/dist/hooks/useClickableContainer.d.ts.map +1 -1
- package/dist/hooks/useClickableContainer.js +11 -8
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useFocusTrap.js +6 -0
- package/dist/hooks/useMenuPress.d.ts.map +1 -1
- package/dist/hooks/useMenuPress.js +35 -2
- package/dist/hooks/useStreamingText.d.ts.map +1 -1
- package/dist/hooks/useStreamingText.js +38 -23
- package/dist/i18n/generated-english/DateInput/useTypedDate.generated.js +2 -2
- package/dist/i18n/generated-locales/en.generated.js +2 -2
- package/dist/i18n/generated-locales/pseudo.generated.js +2 -2
- package/dist/motion/uikit/segmented.d.ts +35 -7
- package/dist/motion/uikit/segmented.d.ts.map +1 -1
- package/dist/motion/uikit/segmented.js +39 -11
- package/dist/privateAttributes/press.stylex.d.ts.map +1 -1
- package/dist/privateAttributes/press.stylex.js +1 -1
- package/dist/privateAttributes/pressBox.stylex.d.ts +12 -4
- package/dist/privateAttributes/pressBox.stylex.d.ts.map +1 -1
- package/dist/privateAttributes/pressBox.stylex.js +21 -4
- package/dist/privateAttributes/tokenRemove.stylex.d.ts +5 -0
- package/dist/privateAttributes/tokenRemove.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/tokenRemove.stylex.js +25 -0
- package/dist/theme/defineTheme.d.ts +0 -1
- package/dist/theme/defineTheme.d.ts.map +1 -1
- package/dist/utils/inputAge.d.ts +5 -2
- package/dist/utils/inputAge.d.ts.map +1 -1
- package/dist/utils/inputAge.js +4 -1
- package/dist/utils/pressFeedback.d.ts.map +1 -1
- package/dist/utils/pressFeedback.js +60 -9
- package/locales/en.json +3 -3
- package/locales/pseudo.json +2 -2
- package/package.json +5 -5
- package/src/Calendar/Calendar.tsx +11 -1
- package/src/Calendar/getInitialFocusDate.ts +70 -8
- package/src/CheckboxInput/CheckboxInput.doc.mjs +16 -2
- package/src/CheckboxInput/CheckboxInput.tsx +32 -23
- package/src/CheckboxList/CheckboxList.doc.mjs +1 -1
- package/src/CheckboxList/CheckboxListItem.tsx +3 -6
- package/src/DateInput/useTypedDate.ts +9 -6
- package/src/DateTimeInput/DateTimeInput.tsx +7 -3
- package/src/DateTimeInput/NativeDateSegment.tsx +28 -10
- package/src/DateTimeInput/NativeTimeSegment.tsx +19 -9
- package/src/Drawer/Drawer.tsx +7 -5
- package/src/DropdownMenu/MenuBottomSheetActionList.tsx +3 -0
- package/src/Item/Item.doc.mjs +2 -1
- package/src/Item/Item.tsx +7 -3
- package/src/Link/useLinkify.tsx +7 -9
- package/src/List/List.doc.mjs +9 -21
- package/src/List/List.tsx +4 -1
- package/src/List/ListItem.doc.mjs +4 -2
- package/src/Markdown/Markdown.tsx +7 -0
- package/src/RadioList/RadioListItem.tsx +60 -30
- package/src/SegmentedControl/SegmentedControl.doc.mjs +3 -3
- package/src/SegmentedControl/useSegmentedSelectionMotion.ts +115 -19
- package/src/SegmentedControl/useSegmentedTouchTracking.ts +5 -0
- package/src/Table/plugins/sortable/useTableSortableState.tsx +5 -1
- package/src/Token/Token.tsx +2 -0
- package/src/Tokenizer/Tokenizer.tsx +102 -7
- package/src/gestures/GestureHost.ts +62 -32
- package/src/hooks/menuPressGesture.ts +116 -9
- package/src/hooks/scrollOwnerRegistry.ts +8 -1
- package/src/hooks/useClickableContainer.ts +11 -8
- package/src/hooks/useFocusTrap.ts +6 -0
- package/src/hooks/useMenuPress.ts +32 -2
- package/src/hooks/useStreamingText.ts +30 -25
- package/src/i18n/generated-english/DateInput/useTypedDate.generated.ts +2 -2
- package/src/i18n/generated-locales/en.generated.ts +2 -2
- package/src/i18n/generated-locales/pseudo.generated.ts +2 -2
- package/src/motion/MEASUREMENTS.md +2 -3
- package/src/motion/uikit/segmented.ts +35 -10
- package/src/privateAttributes/press.stylex.ts +2 -8
- package/src/privateAttributes/pressBox.stylex.ts +23 -4
- package/src/privateAttributes/tokenRemove.stylex.ts +27 -0
- package/src/theme/defineTheme.ts +0 -1
- package/src/theme/useThemeName.doc.mjs +69 -0
- package/src/utils/inputAge.ts +5 -2
- package/src/utils/pressFeedback.ts +80 -9
|
@@ -65,6 +65,8 @@ import { InputGroupInternalContext } from "../InputGroup/InputGroupInternalConte
|
|
|
65
65
|
import { composeEventHandlers, mergeProps } from "../utils/index.js";
|
|
66
66
|
import { getInputARIA, joinAriaIDs } from "../utils/inputAria.js";
|
|
67
67
|
import { isFocusDetached } from "../utils/isFocusDetached.js";
|
|
68
|
+
import { removeControlOf } from "../privateAttributes/tokenRemove.stylex.js";
|
|
69
|
+
import { useTapStop } from "../Layer/useTouchTrigger.js";
|
|
68
70
|
import { themeProps } from "../utils/themeProps.js";
|
|
69
71
|
import { useResolvedRequired } from "../hooks/useResolvedRequired.js";
|
|
70
72
|
import { registerEnglishFallback, useComponentTranslator } from "../i18n/useComponentTranslator.js";
|
|
@@ -665,6 +667,54 @@ export function Tokenizer({
|
|
|
665
667
|
}
|
|
666
668
|
});
|
|
667
669
|
|
|
670
|
+
// Focus a pointer puts on a token's own control stays there: the
|
|
671
|
+
// person chose that control. The shared tracker says which input moved it.
|
|
672
|
+
const {
|
|
673
|
+
ref: modalityRef,
|
|
674
|
+
readModality
|
|
675
|
+
} = useInteractionModalityTracking();
|
|
676
|
+
// The last press that started inside the field. A touch keyboard rises
|
|
677
|
+
// whenever the field focuses its input during a tap. So a tap on a token's
|
|
678
|
+
// remove button moves focus to the input only if the input already had it.
|
|
679
|
+
// `readModality()` tells whether that press is still the latest interaction
|
|
680
|
+
// in the field's document; a key press since then restores the keyboard
|
|
681
|
+
// rules.
|
|
682
|
+
const lastPressRef = useRef(null);
|
|
683
|
+
// The touch keyboard is down while the input is unfocused. Only a finger's
|
|
684
|
+
// press counts: a pen's press keeps the default focus rules, as a mouse's
|
|
685
|
+
// does.
|
|
686
|
+
const wasKeyboardDown = useCallback(() => {
|
|
687
|
+
const press = lastPressRef.current;
|
|
688
|
+
return press != null && press.isFinger && !press.inputHadFocus && readModality() === 'pointer';
|
|
689
|
+
}, [readModality]);
|
|
690
|
+
// A finger's tap on a token's remove button with the keyboard down keeps
|
|
691
|
+
// focus out of the field. Chrome focuses a pressed button on the tap's
|
|
692
|
+
// compatibility mouse events. That focus would expand an `unfocusedInline`
|
|
693
|
+
// field and remount the control under the finger. Cancelling it, as
|
|
694
|
+
// InputClearButton does, leaves the field as it was. The stop sees every
|
|
695
|
+
// press, so a press that turns into a scroll leaves no arm behind.
|
|
696
|
+
const {
|
|
697
|
+
onPointerDown: armTapStop,
|
|
698
|
+
onMouseDown: stopTap
|
|
699
|
+
} = useTapStop('mousedown');
|
|
700
|
+
const handlePointerDownCapture = useCallback(e => {
|
|
701
|
+
armTapStop(e);
|
|
702
|
+
lastPressRef.current = {
|
|
703
|
+
inputHadFocus: inputRef.current != null && inputRef.current.ownerDocument.activeElement === inputRef.current,
|
|
704
|
+
isFinger: e.pointerType === 'touch',
|
|
705
|
+
pressedTokenRemove: removeControlOf(e.target)
|
|
706
|
+
};
|
|
707
|
+
}, [armTapStop]);
|
|
708
|
+
const handleMouseDownCapture = useCallback(e => {
|
|
709
|
+
if (removeControlOf(e.target) != null && wasKeyboardDown()) {
|
|
710
|
+
stopTap(e);
|
|
711
|
+
}
|
|
712
|
+
}, [stopTap, wasKeyboardDown]);
|
|
713
|
+
// The press record ends with its tap: after the click's task, or when the
|
|
714
|
+
// browser takes the press over for a scroll.
|
|
715
|
+
const endPress = useCallback(() => {
|
|
716
|
+
lastPressRef.current = null;
|
|
717
|
+
}, []);
|
|
668
718
|
// `adaptive` resolves through the policy the selection controls share. An
|
|
669
719
|
// open sheet keeps its presentation until it closes. A resolution change
|
|
670
720
|
// during a task does not replace the open surface.
|
|
@@ -708,12 +758,6 @@ export function Tokenizer({
|
|
|
708
758
|
// handing focus from one control to the other — so the receiving control
|
|
709
759
|
// does not report it as focus entering from outside.
|
|
710
760
|
const isHandingOffFocusRef = useRef(false);
|
|
711
|
-
// Focus a pointer puts on a token's own control stays there: the
|
|
712
|
-
// person chose that control. The shared tracker says which input moved it.
|
|
713
|
-
const {
|
|
714
|
-
ref: modalityRef,
|
|
715
|
-
readModality
|
|
716
|
-
} = useInteractionModalityTracking();
|
|
717
761
|
// True while the menu returns focus after it closes. That focus stays on
|
|
718
762
|
// the token the menu returns to.
|
|
719
763
|
const isMenuFocusReturnRef = useRef(false);
|
|
@@ -976,12 +1020,14 @@ export function Tokenizer({
|
|
|
976
1020
|
// it: it is the keyboard path to its hidden tokens.
|
|
977
1021
|
// In a grouped row, a move to the input also scrolls the strip to its
|
|
978
1022
|
// end before the press releases, so a press on a token's remove
|
|
979
|
-
// button keeps its focus too.
|
|
980
|
-
|
|
1023
|
+
// button keeps its focus too. A finger's tap on a remove button with
|
|
1024
|
+
// the keyboard down keeps focus out of the input. Focusing it would
|
|
1025
|
+
// raise the keyboard for a removal.
|
|
1026
|
+
if (e.target !== inputRef.current && e.target !== trackRef.current && !(readModality() === 'pointer' && (findTokenControl(e.target) != null || e.target instanceof Node && trackRef.current?.contains(e.target) === true)) && !isMenuFocusReturnRef.current && !(removeControlOf(e.target) != null && wasKeyboardDown())) {
|
|
981
1027
|
inputRef.current?.focus();
|
|
982
1028
|
}
|
|
983
1029
|
}
|
|
984
|
-
}, [isLayerMode, layer, isFocusInTokenizer, onFocus, readModality, findTokenControl]);
|
|
1030
|
+
}, [isLayerMode, layer, isFocusInTokenizer, onFocus, readModality, findTokenControl, wasKeyboardDown]);
|
|
985
1031
|
const handleBlurCapture = useCallback(e => {
|
|
986
1032
|
if (!isFocusInTokenizer(e.relatedTarget)) {
|
|
987
1033
|
hasReportedFocusRef.current = false;
|
|
@@ -1144,9 +1190,25 @@ export function Tokenizer({
|
|
|
1144
1190
|
label: item.label
|
|
1145
1191
|
}));
|
|
1146
1192
|
}
|
|
1147
|
-
|
|
1193
|
+
// Focusing the input inside a keyboard-down tap would raise the
|
|
1194
|
+
// keyboard. The sheet's own removals (`silent`) leave focus to the
|
|
1195
|
+
// sheet.
|
|
1196
|
+
const pressed = !options?.silent && wasKeyboardDown() ? lastPressRef.current?.pressedTokenRemove ?? null : null;
|
|
1197
|
+
if (pressed == null) {
|
|
1198
|
+
inputRef.current?.focus();
|
|
1199
|
+
return true;
|
|
1200
|
+
}
|
|
1201
|
+
// A token that held focus, on its remove button or on another of its
|
|
1202
|
+
// controls, unmounts with focus inside it. Focus then moves to the
|
|
1203
|
+
// input, as for every other removal. Focus anywhere else stays where it
|
|
1204
|
+
// is. A built-in token's only control is its remove button.
|
|
1205
|
+
const active = pressed.ownerDocument.activeElement;
|
|
1206
|
+
const token = [...tokenSlotsRef.current].find(slot => slot.contains(pressed)) ?? pressed;
|
|
1207
|
+
if (active != null && token.contains(active)) {
|
|
1208
|
+
inputRef.current?.focus();
|
|
1209
|
+
}
|
|
1148
1210
|
return true;
|
|
1149
|
-
}, [value, onChange, isDisabled, canRemoveItem, announce, t]);
|
|
1211
|
+
}, [value, onChange, isDisabled, canRemoveItem, announce, t, wasKeyboardDown]);
|
|
1150
1212
|
|
|
1151
1213
|
// A composing component that words its own Clear all (PowerSearch) provides
|
|
1152
1214
|
// its words; otherwise the field's own (component:Tokenizer AR7).
|
|
@@ -1254,7 +1316,9 @@ export function Tokenizer({
|
|
|
1254
1316
|
ref: wrapperCallbackRef,
|
|
1255
1317
|
role: "group",
|
|
1256
1318
|
"aria-label": label,
|
|
1257
|
-
onClick: handleWrapperClick
|
|
1319
|
+
onClick: handleWrapperClick,
|
|
1320
|
+
onPointerDownCapture: handlePointerDownCapture,
|
|
1321
|
+
onMouseDownCapture: handleMouseDownCapture
|
|
1258
1322
|
// The control a click activates is recorded while the click passes
|
|
1259
1323
|
// down through the field, before the token's own handler runs. The
|
|
1260
1324
|
// record ends with the click's task, also when the token's handler
|
|
@@ -1270,7 +1334,16 @@ export function Tokenizer({
|
|
|
1270
1334
|
}
|
|
1271
1335
|
}, 0);
|
|
1272
1336
|
}
|
|
1337
|
+
const press = lastPressRef.current;
|
|
1338
|
+
if (press != null) {
|
|
1339
|
+
setTimeout(() => {
|
|
1340
|
+
if (lastPressRef.current === press) {
|
|
1341
|
+
endPress();
|
|
1342
|
+
}
|
|
1343
|
+
}, 0);
|
|
1344
|
+
}
|
|
1273
1345
|
},
|
|
1346
|
+
onPointerCancelCapture: endPress,
|
|
1274
1347
|
onFocusCapture: handleFocusCapture,
|
|
1275
1348
|
onBlurCapture: handleBlurCapture
|
|
1276
1349
|
// Keys on the field's other controls (clear button, tokens) reach a
|
package/dist/astryx.css
CHANGED
|
@@ -157,6 +157,7 @@
|
|
|
157
157
|
.xhg274n{--_hover-delay:0s}
|
|
158
158
|
.x8xu23y{--_hover-delay:var(--x---_hover-delay)}
|
|
159
159
|
.xqwz7mz{--_hovercard-radius:var(--radius-container)}
|
|
160
|
+
.x1bl9l2n{--_indicator-active-press:transparent}
|
|
160
161
|
.x1y1g3jp{--_indicator-press-image:var(--_checkbox-row-press-paint,none)}
|
|
161
162
|
.x1dj2fx0{--_item-description-color:var(--color-text-error)}
|
|
162
163
|
.x1nwg5ib{--_item-inset-inline:0px}
|
|
@@ -479,14 +480,14 @@
|
|
|
479
480
|
.xpa4xmd{--tree-list-indent:var(--spacing-4)}
|
|
480
481
|
.x1xbi2jf{--tree-list-row-gap:var(--spacing-0-5)}
|
|
481
482
|
.x1gxz47l.x1gxz47l:where(.x139im0d:last-child *){--_table-row-divider-width:0px}
|
|
482
|
-
.
|
|
483
|
-
.
|
|
483
|
+
.x1b9k41a:is([data-astryx-press="fading"]){--_checkbox-row-press-paint:var(--_press-paint-image)}
|
|
484
|
+
.x1u7ooqu:is([data-astryx-press="on"]){--_checkbox-row-press-paint:var(--_press-paint-image)}
|
|
484
485
|
.x1wfyzv7:focus-within{--_fade-delay:0s}
|
|
485
486
|
.xqih627:focus-visible{--_focus-outline:var(--focus-outline-width) var(--focus-outline-style) var(--focus-outline-color)}
|
|
486
487
|
.xqchwus:focus-visible{--_focus-outline-offset:var(--focus-outline-offset)}
|
|
487
488
|
.x51rtne.x51rtne:where(:has(~ .x1sz7nw1:not([data-divider]))){--_layout-flush-block-end:0px}
|
|
488
489
|
.x1akq5vd.x1akq5vd:where(.xo0ftvq:not([data-divider]) ~ *){--_layout-flush-block-start:0px}
|
|
489
|
-
.
|
|
490
|
+
.x19rtxe:active:not([data-astryx-press="on"],[data-astryx-press="fading"]):not(:has(button:not([aria-readonly="true"]):active,a:not([aria-readonly="true"]):active,input:not([type="radio"],[aria-readonly="true"]):active,select:not([aria-readonly="true"]):active,textarea:not([aria-readonly="true"]):active,[role="button"]:not([aria-readonly="true"]):active,[role="link"]:not([aria-readonly="true"]):active,[role="checkbox"]:not([aria-readonly="true"]):active,[role="radio"]:not([aria-readonly="true"]):active,[role="switch"]:not([aria-readonly="true"]):active,[role="tab"]:not([aria-readonly="true"]):active,[role="menuitem"]:not([aria-readonly="true"]):active,[role="option"]:not([aria-readonly="true"]):active,[role="combobox"]:not([aria-readonly="true"]):active,[role="listbox"]:not([aria-readonly="true"]):active,[role="slider"]:not([aria-readonly="true"]):active,[role="spinbutton"]:not([aria-readonly="true"]):active,[data-pressable-container]:not([aria-readonly="true"]):active)){--_radio-row-press:var(--color-overlay-pressed)}
|
|
490
491
|
.x1mjsb9v:focus-within{--_reveal-delay:0s,0s}
|
|
491
492
|
.x1z42dm:focus-within{--_reveal-delay-reduced:0s,0s}
|
|
492
493
|
.xi33vf3:focus-within{--_reveal-opacity:1}
|
|
@@ -525,13 +526,11 @@
|
|
|
525
526
|
@media (pointer: coarse){.x1h9khjt.x1h9khjt{--_thumbnail-hit-inset:-2px}}
|
|
526
527
|
@media (hover: hover){.x1m110vg.x1m110vg{--resize-hint:transparent}}
|
|
527
528
|
.xb8awce.xb8awce:active:where(:not(:disabled,[aria-disabled="true"])){--_press-overlay:var(--color-overlay-pressed)}
|
|
528
|
-
@media (pointer: coarse){.x18sblwv.x18sblwv:is([data-astryx-press="on"]){--_checkbox-row-press-paint:var(--_press-paint-image)}}
|
|
529
|
-
@media (pointer: coarse){.x19dyfww.x19dyfww:is([data-astryx-press="fading"]){--_checkbox-row-press-paint:var(--_press-paint-image)}}
|
|
530
529
|
@media (hover: hover){.x1316hva.x1316hva.x1316hva:hover:where(:not(:disabled,[aria-disabled="true"])){--_conceal-opacity:0}}
|
|
531
530
|
@media (hover: hover){.xuzfaso.xuzfaso.xuzfaso:hover:where(:not(:disabled,[aria-disabled="true"])){--_conceal-opacity:1}}
|
|
532
531
|
@media (hover: hover){.xq03417.xq03417.xq03417:hover:where(:not(:disabled,[aria-disabled="true"])){--_fade-delay:0s}}
|
|
533
532
|
@media (hover: hover){.x14nxqze.x14nxqze.x14nxqze:hover:where(:not(:disabled,[aria-disabled="true"])){--_fade-delay:var(--_hover-delay,0s)}}
|
|
534
|
-
@media (pointer: coarse){.
|
|
533
|
+
@media (pointer: coarse){.xkwazwr.xkwazwr:active:not([data-astryx-press="on"],[data-astryx-press="fading"]):not(:has(button:not([aria-readonly="true"]):active,a:not([aria-readonly="true"]):active,input:not([type="radio"],[aria-readonly="true"]):active,select:not([aria-readonly="true"]):active,textarea:not([aria-readonly="true"]):active,[role="button"]:not([aria-readonly="true"]):active,[role="link"]:not([aria-readonly="true"]):active,[role="checkbox"]:not([aria-readonly="true"]):active,[role="radio"]:not([aria-readonly="true"]):active,[role="switch"]:not([aria-readonly="true"]):active,[role="tab"]:not([aria-readonly="true"]):active,[role="menuitem"]:not([aria-readonly="true"]):active,[role="option"]:not([aria-readonly="true"]):active,[role="combobox"]:not([aria-readonly="true"]):active,[role="listbox"]:not([aria-readonly="true"]):active,[role="slider"]:not([aria-readonly="true"]):active,[role="spinbutton"]:not([aria-readonly="true"]):active,[data-pressable-container]:not([aria-readonly="true"]):active)){--_radio-row-press:transparent}}
|
|
535
534
|
@media (hover: hover){.x1t6fdr0.x1t6fdr0.x1t6fdr0:hover:where(:not(:disabled,[aria-disabled="true"])){--_reveal-delay:0s,0s}}
|
|
536
535
|
@media (hover: hover){.x1tx49wl.x1tx49wl.x1tx49wl:hover:where(:not(:disabled,[aria-disabled="true"])){--_reveal-delay:0s,var(--duration-fast)}}
|
|
537
536
|
@media (hover: hover){.xi1ebb6.xi1ebb6.xi1ebb6:hover:where(:not(:disabled,[aria-disabled="true"])){--_reveal-delay:var(--_hover-delay,0s),var(--_hover-delay,0s)}}
|
|
@@ -1640,6 +1639,8 @@
|
|
|
1640
1639
|
.x6cuj84:not(#\#):not(#\#):not(#\#){z-index:500}
|
|
1641
1640
|
.x1q2oy4v:not(#\#):not(#\#):not(#\#){z-index:9999}
|
|
1642
1641
|
.x6tapwc:not(#\#):not(#\#):not(#\#){z-index:var(--_tree-focus-z,auto)}
|
|
1642
|
+
.x1qwhovg[data-astryx-press="on"]:not(#\#):not(#\#):not(#\#){--_indicator-active-press:transparent}
|
|
1643
|
+
.x858ff1[data-astryx-press="fading"]:not(#\#):not(#\#):not(#\#){--_indicator-active-press:transparent}
|
|
1643
1644
|
.x189o2zt[data-astryx-press="fading"]:not(#\#):not(#\#):not(#\#){--_indicator-press-image:var(--_press-paint-image)}
|
|
1644
1645
|
.x1dueop1[data-astryx-press="on"]:not(#\#):not(#\#):not(#\#){--_indicator-press-image:var(--_press-paint-image)}
|
|
1645
1646
|
.xcukuoe[data-astryx-menu-press-lit]:not(#\#):not(#\#):not(#\#){--_menu-row-active-paint:var(--color-overlay-pressed)}
|
|
@@ -2659,10 +2660,12 @@
|
|
|
2659
2660
|
.x1r0yslu:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{z-index:0}
|
|
2660
2661
|
.x12maryy:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{z-index:1}
|
|
2661
2662
|
.x1jg531d:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{z-index:2}
|
|
2662
|
-
.xzywxsk.xzywxsk:where(.x1odsvnm:active *):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{background-color:var(--color-overlay-pressed)}
|
|
2663
2663
|
@supports (content: "a" / ""){.x1q91k8u.x1q91k8u:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{content:var(--x-flj70p)}}
|
|
2664
|
+
.xur6jaf.xur6jaf:where(.x1odsvnm:active:not([data-astryx-press="on"],[data-astryx-press="fading"]) *):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{background-color:var(--color-overlay-pressed)}
|
|
2664
2665
|
.xk7vujl:is([dir="rtl"] *):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{background-image:linear-gradient(to left,var(--color-shadow),transparent)}
|
|
2665
2666
|
.xlptwl5:is([dir="rtl"] *):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{background-image:linear-gradient(to right,var(--color-shadow),transparent)}
|
|
2667
|
+
.x178sc5r.x178sc5r:where(.x1odsvnm[data-astryx-press="on"] *):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{background-image:var(--_press-paint-image)}
|
|
2668
|
+
.x1d4iov5.x1d4iov5:where(.x1odsvnm[data-astryx-press="fading"] *):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{background-image:var(--_press-paint-image)}
|
|
2666
2669
|
.xf7ekc6.xf7ekc6:where(:has(.x1lrrceh:is(*))):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{content:none}
|
|
2667
2670
|
.x3k25x4:is([dir="rtl"] *):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{inset-inline-end:0}
|
|
2668
2671
|
.x17kcdp5:is([dir="rtl"] *):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{inset-inline-end:calc(-1 * var(--spacing-1) - 1px)}
|
|
@@ -2694,14 +2697,12 @@
|
|
|
2694
2697
|
@media (prefers-reduced-motion: reduce) and (pointer: coarse){.xszhkds.xszhkds:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{transition-timing-function:var(--ease-exit)}}
|
|
2695
2698
|
@media (pointer: coarse){.x177mwkx.x177mwkx:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{will-change:var(--astryx-motion-will-change-after,auto)}}
|
|
2696
2699
|
@media (pointer: coarse){.xx13w5u.xx13w5u:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{z-index:1}}
|
|
2697
|
-
@media (pointer: coarse){.x1gybruy.x1gybruy.x1gybruy:where(.x1odsvnm:active *):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{background-color:transparent}}
|
|
2698
2700
|
@media (pointer: coarse){.xs8z9ty.xs8z9ty.xs8z9ty:where(.x1iwu4tg[data-astryx-press="fading"] *):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{animation-duration:var(--duration-exit)}}
|
|
2699
2701
|
@media (pointer: coarse){.xq2jpp1.xq2jpp1.xq2jpp1:where(.x1iwu4tg[data-astryx-press="fading"] *):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{animation-fill-mode:both}}
|
|
2700
2702
|
@media (pointer: coarse){.xxhzo2e.xxhzo2e.xxhzo2e:where(.x1iwu4tg[data-astryx-press="fading"] *):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{animation-name:x1jn504y-B}}
|
|
2701
2703
|
@media (pointer: coarse){.x15baseh.x15baseh.x15baseh:where(.x1iwu4tg[data-astryx-press="fading"] *):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{animation-timing-function:var(--ease-exit)}}
|
|
2704
|
+
@media (pointer: coarse){.xtawv5c.xtawv5c.xtawv5c:where(.x1odsvnm:active:not([data-astryx-press="on"],[data-astryx-press="fading"]) *):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{background-color:transparent}}
|
|
2702
2705
|
@media (pointer: coarse){.x1dn949c.x1dn949c:is([data-astryx-press="on"],[data-astryx-press="fading"]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{background-color:var(--color-overlay-pressed)}}
|
|
2703
|
-
@media (pointer: coarse){.x1ikgzpo.x1ikgzpo.x1ikgzpo:where(.x1odsvnm[data-astryx-press="on"] *):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{background-image:var(--_press-paint-image)}}
|
|
2704
|
-
@media (pointer: coarse){.xsozn46.xsozn46.xsozn46:where(.x1odsvnm[data-astryx-press="fading"] *):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{background-image:var(--_press-paint-image)}}
|
|
2705
2706
|
@media (pointer: coarse){.x15cra4q.x15cra4q.x15cra4q:where(.x1iwu4tg[data-astryx-press="fading"] *):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{content:""}}
|
|
2706
2707
|
@media (pointer: coarse){.xpxppvc.xpxppvc.xpxppvc:where(.x1iwu4tg[data-astryx-press="on"] *):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{content:""}}
|
|
2707
2708
|
@media (pointer: coarse){.x1ccaw7f.x1ccaw7f.x1ccaw7f:where(.x1iwu4tg[data-astryx-press="fading"] *):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{opacity:0}}
|
|
@@ -179,6 +179,11 @@ export declare class GestureHost {
|
|
|
179
179
|
private claimedLiftTimer;
|
|
180
180
|
/** The arena's clock, which the claimed lifts' timer runs on too. */
|
|
181
181
|
private readonly clock;
|
|
182
|
+
/**
|
|
183
|
+
* The clock of the document's own window, which stamps its events. A page
|
|
184
|
+
* can replace it after the host exists, so each read looks it up.
|
|
185
|
+
*/
|
|
186
|
+
private get timing();
|
|
182
187
|
/** Fingers still waiting for their pointerdown, by arena id. */
|
|
183
188
|
private readonly unpairedTouches;
|
|
184
189
|
private readonly isPrimaryPointerCoarse;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GestureHost.d.ts","sourceRoot":"","sources":["../../src/gestures/GestureHost.ts"],"names":[],"mappings":"AAqIA,OAAO,EAEL,YAAY,EAGZ,KAAK,mBAAmB,EACxB,KAAK,YAAY,EAClB,MAAM,gBAAgB,CAAC;A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AgB;CAmCzB;AA4BD,4DAA4D;AAC5D,wBAAgB,cAAc,CAAC,GAAG,EAAE,QAAQ,GAAG,WAAW,CAOzD"}
|
|
@@ -136,6 +136,7 @@ import { gestureHostStyle, intersectTouchAction } from "./touchAction.js";
|
|
|
136
136
|
import { markTouchAction, TOUCH_ACTION_ATTRIBUTE, unmarkTouchAction } from "./touchActionRule.js";
|
|
137
137
|
import { internals } from "./recognizerInternals.js";
|
|
138
138
|
import { armClickGuard, disarmClickGuard, withoutClickGuard } from "../utils/clickGuard.js";
|
|
139
|
+
import { clockOf } from "../utils/inputAge.js";
|
|
139
140
|
import { subscribeInput } from "../utils/inputStream.js";
|
|
140
141
|
import { isPrimaryClick } from "../utils/primaryClick.js";
|
|
141
142
|
import { lockDragSelection, locksSelectionFor, selectionRangesOf, startsOnSelectableText } from "../utils/selectionLock.js";
|
|
@@ -402,17 +403,35 @@ function panTakesMove(recognizer, cx, cy) {
|
|
|
402
403
|
}
|
|
403
404
|
|
|
404
405
|
/**
|
|
405
|
-
* An event's time on the arena's clock
|
|
406
|
-
*
|
|
406
|
+
* An event's time on the arena's clock: `timing.now()`, with `timing` the
|
|
407
|
+
* clock of the event's own window. Some engines and DOM emulators stamp
|
|
408
|
+
* events in epoch milliseconds instead.
|
|
407
409
|
*/
|
|
408
|
-
function eventTime(event) {
|
|
410
|
+
function eventTime(event, timing) {
|
|
409
411
|
const time = event.timeStamp;
|
|
410
|
-
if (time > 1e12 &&
|
|
411
|
-
return time -
|
|
412
|
+
if (time > 1e12 && timing != null && timing.timeOrigin > 0) {
|
|
413
|
+
return time - timing.timeOrigin;
|
|
412
414
|
}
|
|
413
415
|
return time;
|
|
414
416
|
}
|
|
415
417
|
|
|
418
|
+
/**
|
|
419
|
+
* The arena clock for `doc`. The page's own document keeps the page's clock.
|
|
420
|
+
* A same-origin iframe or a Picture-in-Picture window stamps its events from
|
|
421
|
+
* its own start, so its clock reads that window's `performance`. A page can
|
|
422
|
+
* replace that object after the host exists, so each reading looks it up.
|
|
423
|
+
*/
|
|
424
|
+
function documentClock(doc) {
|
|
425
|
+
const view = doc.defaultView;
|
|
426
|
+
if (view == null || view === globalThis) {
|
|
427
|
+
return browserClock;
|
|
428
|
+
}
|
|
429
|
+
return {
|
|
430
|
+
...browserClock,
|
|
431
|
+
now: () => clockOf(doc)?.now() ?? browserClock.now()
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
|
|
416
435
|
/** A touch list as an array; a synthetic event may carry none. */
|
|
417
436
|
function touchesOf(list) {
|
|
418
437
|
return list == null ? [] : Array.from(list);
|
|
@@ -527,6 +546,13 @@ export class GestureHost {
|
|
|
527
546
|
claimedLiftTimer = null;
|
|
528
547
|
/** The arena's clock, which the claimed lifts' timer runs on too. */
|
|
529
548
|
|
|
549
|
+
/**
|
|
550
|
+
* The clock of the document's own window, which stamps its events. A page
|
|
551
|
+
* can replace it after the host exists, so each read looks it up.
|
|
552
|
+
*/
|
|
553
|
+
get timing() {
|
|
554
|
+
return clockOf(this.doc);
|
|
555
|
+
}
|
|
530
556
|
/** Fingers still waiting for their pointerdown, by arena id. */
|
|
531
557
|
unpairedTouches = new Map();
|
|
532
558
|
|
|
@@ -631,7 +657,7 @@ export class GestureHost {
|
|
|
631
657
|
};
|
|
632
658
|
}
|
|
633
659
|
};
|
|
634
|
-
this.clock = options.clock ??
|
|
660
|
+
this.clock = options.clock ?? documentClock(doc);
|
|
635
661
|
this.arena = new GestureArena({
|
|
636
662
|
clock: this.clock,
|
|
637
663
|
environment,
|
|
@@ -1811,7 +1837,7 @@ export class GestureHost {
|
|
|
1811
1837
|
return;
|
|
1812
1838
|
}
|
|
1813
1839
|
this.wheelsSeen.add(wheel);
|
|
1814
|
-
const time = eventTime(wheel);
|
|
1840
|
+
const time = eventTime(wheel, this.timing);
|
|
1815
1841
|
const kind = wheel.ctrlKey ? 'pinch' : 'pan';
|
|
1816
1842
|
let gesture = this.wheel;
|
|
1817
1843
|
if (gesture != null && (gesture.kind !== kind || time - gesture.last >= gesture.endMs)) {
|
|
@@ -2447,7 +2473,7 @@ export class GestureHost {
|
|
|
2447
2473
|
return true;
|
|
2448
2474
|
}
|
|
2449
2475
|
onTouchStart = event => {
|
|
2450
|
-
this.endWheel(eventTime(event));
|
|
2476
|
+
this.endWheel(eventTime(event, this.timing));
|
|
2451
2477
|
this.noteFingersDown(event);
|
|
2452
2478
|
// Where the host reads a finger from its pointer events (no ontouchstart,
|
|
2453
2479
|
// as after touch emulation turns on), its Touch Events would track it twice.
|
|
@@ -2457,7 +2483,7 @@ export class GestureHost {
|
|
|
2457
2483
|
if (this.fingerTargets.length > 1) {
|
|
2458
2484
|
this.failUnclaimedLoneFingerPans();
|
|
2459
2485
|
}
|
|
2460
|
-
const time = eventTime(event);
|
|
2486
|
+
const time = eventTime(event, this.timing);
|
|
2461
2487
|
const inputs = [];
|
|
2462
2488
|
const untracked = [];
|
|
2463
2489
|
const stale = [];
|
|
@@ -2573,7 +2599,7 @@ export class GestureHost {
|
|
|
2573
2599
|
return;
|
|
2574
2600
|
}
|
|
2575
2601
|
this.dropFingersNotDown(event);
|
|
2576
|
-
const time = eventTime(event);
|
|
2602
|
+
const time = eventTime(event, this.timing);
|
|
2577
2603
|
const ids = [];
|
|
2578
2604
|
const inputs = [];
|
|
2579
2605
|
for (const touch of touchesOf(event.changedTouches)) {
|
|
@@ -2669,7 +2695,7 @@ export class GestureHost {
|
|
|
2669
2695
|
*/
|
|
2670
2696
|
onClaimedTouchEnd = event => {
|
|
2671
2697
|
const end = event;
|
|
2672
|
-
const time = eventTime(end);
|
|
2698
|
+
const time = eventTime(end, this.timing);
|
|
2673
2699
|
for (let i = this.claimedLifts.length - 1; i >= 0; i--) {
|
|
2674
2700
|
if (time - this.claimedLifts[i].time > CLAIMED_LIFT_MS) {
|
|
2675
2701
|
this.claimedLifts.splice(i, 1);
|
|
@@ -2741,7 +2767,7 @@ export class GestureHost {
|
|
|
2741
2767
|
return;
|
|
2742
2768
|
}
|
|
2743
2769
|
this.dropFingersNotDown(event);
|
|
2744
|
-
const time = eventTime(event);
|
|
2770
|
+
const time = eventTime(event, this.timing);
|
|
2745
2771
|
const inputs = [];
|
|
2746
2772
|
const retargetedEnds = [];
|
|
2747
2773
|
let isRefused = false;
|
|
@@ -2844,7 +2870,7 @@ export class GestureHost {
|
|
|
2844
2870
|
}
|
|
2845
2871
|
}
|
|
2846
2872
|
if (ids.length > 0) {
|
|
2847
|
-
this.arena.cancelled(ids, eventTime(event));
|
|
2873
|
+
this.arena.cancelled(ids, eventTime(event, this.timing));
|
|
2848
2874
|
}
|
|
2849
2875
|
};
|
|
2850
2876
|
|
|
@@ -2900,7 +2926,7 @@ export class GestureHost {
|
|
|
2900
2926
|
}
|
|
2901
2927
|
}
|
|
2902
2928
|
if (ids.length > 0) {
|
|
2903
|
-
this.arena.cancelled(ids, eventTime(event));
|
|
2929
|
+
this.arena.cancelled(ids, eventTime(event, this.timing));
|
|
2904
2930
|
}
|
|
2905
2931
|
}
|
|
2906
2932
|
watchTarget(identifier, target, isBlocking, isClaiming) {
|
|
@@ -3079,7 +3105,7 @@ export class GestureHost {
|
|
|
3079
3105
|
// --- Pointer events --------------------------------------------------------
|
|
3080
3106
|
|
|
3081
3107
|
onPointerDown = event => {
|
|
3082
|
-
this.endWheel(eventTime(event));
|
|
3108
|
+
this.endWheel(eventTime(event, this.timing));
|
|
3083
3109
|
// A new press: whatever click is still owed to the last one is not this.
|
|
3084
3110
|
disarmClickGuard(this.doc);
|
|
3085
3111
|
if (!isPointerKind(event.pointerType)) {
|
|
@@ -3135,7 +3161,7 @@ export class GestureHost {
|
|
|
3135
3161
|
id,
|
|
3136
3162
|
x: event.clientX,
|
|
3137
3163
|
y: event.clientY,
|
|
3138
|
-
time: eventTime(event),
|
|
3164
|
+
time: eventTime(event, this.timing),
|
|
3139
3165
|
pointerType: event.pointerType,
|
|
3140
3166
|
target,
|
|
3141
3167
|
scroll: createNativeScrollProbe(target),
|
|
@@ -3165,8 +3191,8 @@ export class GestureHost {
|
|
|
3165
3191
|
id,
|
|
3166
3192
|
x: event.clientX,
|
|
3167
3193
|
y: event.clientY,
|
|
3168
|
-
time: eventTime(event),
|
|
3169
|
-
history: coalescedHistory(event)
|
|
3194
|
+
time: eventTime(event, this.timing),
|
|
3195
|
+
history: coalescedHistory(event, this.timing)
|
|
3170
3196
|
}]);
|
|
3171
3197
|
}
|
|
3172
3198
|
return;
|
|
@@ -3177,8 +3203,8 @@ export class GestureHost {
|
|
|
3177
3203
|
id,
|
|
3178
3204
|
x: event.clientX,
|
|
3179
3205
|
y: event.clientY,
|
|
3180
|
-
time: eventTime(event),
|
|
3181
|
-
history: coalescedHistory(event)
|
|
3206
|
+
time: eventTime(event, this.timing),
|
|
3207
|
+
history: coalescedHistory(event, this.timing)
|
|
3182
3208
|
}]);
|
|
3183
3209
|
return;
|
|
3184
3210
|
}
|
|
@@ -3193,7 +3219,7 @@ export class GestureHost {
|
|
|
3193
3219
|
this.liftStamps.set(id, {
|
|
3194
3220
|
x: event.clientX,
|
|
3195
3221
|
y: event.clientY,
|
|
3196
|
-
time: eventTime(event)
|
|
3222
|
+
time: eventTime(event, this.timing)
|
|
3197
3223
|
});
|
|
3198
3224
|
}
|
|
3199
3225
|
this.fingerPointers.delete(event.pointerId);
|
|
@@ -3216,7 +3242,7 @@ export class GestureHost {
|
|
|
3216
3242
|
id,
|
|
3217
3243
|
x: event.clientX,
|
|
3218
3244
|
y: event.clientY,
|
|
3219
|
-
time: eventTime(event)
|
|
3245
|
+
time: eventTime(event, this.timing)
|
|
3220
3246
|
}]);
|
|
3221
3247
|
// A selection the lift's own handlers made stays, as a click's does.
|
|
3222
3248
|
hold?.keepLiftSelection();
|
|
@@ -3258,7 +3284,7 @@ export class GestureHost {
|
|
|
3258
3284
|
x: event.clientX,
|
|
3259
3285
|
y: event.clientY,
|
|
3260
3286
|
target: landedOn(event),
|
|
3261
|
-
time: eventTime(event)
|
|
3287
|
+
time: eventTime(event, this.timing)
|
|
3262
3288
|
});
|
|
3263
3289
|
if (this.claimedLifts.length > CLAIMED_LIFT_LIMIT) {
|
|
3264
3290
|
this.claimedLifts.shift();
|
|
@@ -3303,7 +3329,7 @@ export class GestureHost {
|
|
|
3303
3329
|
// browser scrolls with it): its touch events, now the only channel,
|
|
3304
3330
|
// sample it, as a watcher following the scroll to the lift needs.
|
|
3305
3331
|
this.pointerFed.delete(id);
|
|
3306
|
-
this.browserTook([id], eventTime(event));
|
|
3332
|
+
this.browserTook([id], eventTime(event, this.timing));
|
|
3307
3333
|
}
|
|
3308
3334
|
return;
|
|
3309
3335
|
}
|
|
@@ -3315,7 +3341,7 @@ export class GestureHost {
|
|
|
3315
3341
|
this.pointerKinds.delete(event.pointerId);
|
|
3316
3342
|
this.unlockSelection(id, true);
|
|
3317
3343
|
this.retargeted.delete(id);
|
|
3318
|
-
this.arena.cancelled([id], eventTime(event));
|
|
3344
|
+
this.arena.cancelled([id], eventTime(event, this.timing));
|
|
3319
3345
|
}
|
|
3320
3346
|
};
|
|
3321
3347
|
|
|
@@ -3418,7 +3444,7 @@ export class GestureHost {
|
|
|
3418
3444
|
return this.ownedScrolls.has(scroller);
|
|
3419
3445
|
}
|
|
3420
3446
|
onScroll = event => {
|
|
3421
|
-
const time = eventTime(event);
|
|
3447
|
+
const time = eventTime(event, this.timing);
|
|
3422
3448
|
const scroller = event.target === this.doc ? this.doc : event.target;
|
|
3423
3449
|
if (!isNode(scroller) || this.ownedScrolls.has(scroller)) {
|
|
3424
3450
|
return;
|
|
@@ -3576,7 +3602,7 @@ function needsSuppression(dispositions) {
|
|
|
3576
3602
|
}
|
|
3577
3603
|
return false;
|
|
3578
3604
|
}
|
|
3579
|
-
function coalescedHistory(event) {
|
|
3605
|
+
function coalescedHistory(event, timing) {
|
|
3580
3606
|
if (typeof event.getCoalescedEvents !== 'function') {
|
|
3581
3607
|
return [];
|
|
3582
3608
|
}
|
|
@@ -3584,7 +3610,7 @@ function coalescedHistory(event) {
|
|
|
3584
3610
|
return coalesced.slice(0, -1).map(sample => ({
|
|
3585
3611
|
x: sample.clientX,
|
|
3586
3612
|
y: sample.clientY,
|
|
3587
|
-
time: eventTime(sample)
|
|
3613
|
+
time: eventTime(sample, timing)
|
|
3588
3614
|
}));
|
|
3589
3615
|
}
|
|
3590
3616
|
|
|
@@ -36,6 +36,21 @@ export type MenuPressState<T> = {
|
|
|
36
36
|
origin: 'trigger' | 'menu';
|
|
37
37
|
/** The enabled row currently under the pointer, if any. */
|
|
38
38
|
row: T | null;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The window lost focus under a finger. The gesture is still tracked, so its
|
|
42
|
+
* document listeners stay its own until its release or cancel. Nothing it
|
|
43
|
+
* does highlights or acts.
|
|
44
|
+
* @internal Not public contract.
|
|
45
|
+
*/
|
|
46
|
+
| {
|
|
47
|
+
phase: 'withdrawn';
|
|
48
|
+
pointerType: MenuPressPointerType;
|
|
49
|
+
/**
|
|
50
|
+
* Withdrawn while it was still a press on the trigger: its tap's click
|
|
51
|
+
* is what opens the menu, so its release lets that click through.
|
|
52
|
+
*/
|
|
53
|
+
fromTrigger?: true;
|
|
39
54
|
};
|
|
40
55
|
/** @internal */
|
|
41
56
|
export type MenuPressInput<T> = {
|
|
@@ -79,6 +94,15 @@ export type MenuPressInput<T> = {
|
|
|
79
94
|
/** The browser took the gesture: pointercancel, a second pointer, a scroll. */
|
|
80
95
|
| {
|
|
81
96
|
type: 'cancel';
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* The window lost focus mid-press. A finger's or pen's gesture is withdrawn,
|
|
100
|
+
* tracked to its release with nothing acting; a mouse's ends as a cancel
|
|
101
|
+
* does.
|
|
102
|
+
* @internal Not public contract.
|
|
103
|
+
*/
|
|
104
|
+
| {
|
|
105
|
+
type: 'withdraw';
|
|
82
106
|
};
|
|
83
107
|
/** @internal */
|
|
84
108
|
export type MenuPressOutcome<T> = {
|
|
@@ -99,19 +123,32 @@ export type MenuPressOutcome<T> = {
|
|
|
99
123
|
/**
|
|
100
124
|
* The gesture ended without a row acting. `stray` says whether the browser
|
|
101
125
|
* will still report a `click` for this gesture that must not act; `dismiss`
|
|
102
|
-
* says the menu should close: a mouse released outside it.
|
|
126
|
+
* says the menu should close: a mouse released outside it. `clear`
|
|
127
|
+
* (@internal) says a row a finger lit loses its highlight (the browser took
|
|
128
|
+
* the press).
|
|
103
129
|
*/
|
|
104
130
|
| {
|
|
105
131
|
type: 'settle';
|
|
106
132
|
stray: boolean;
|
|
107
133
|
dismiss: boolean;
|
|
134
|
+
clear?: true;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* The gesture was withdrawn and is still live: stop what drives it (the
|
|
138
|
+
* hold, the autoscroll, the page lock). `clear` says a row a finger lit
|
|
139
|
+
* loses its highlight.
|
|
140
|
+
* @internal Not public contract.
|
|
141
|
+
*/
|
|
142
|
+
| {
|
|
143
|
+
type: 'withdraw';
|
|
144
|
+
clear?: true;
|
|
108
145
|
};
|
|
109
146
|
/** @internal */
|
|
110
147
|
export interface MenuPressTransition<T> {
|
|
111
148
|
gesture: MenuPressState<T>;
|
|
112
149
|
effect: MenuPressOutcome<T>;
|
|
113
150
|
}
|
|
114
|
-
export declare const IDLE_MENU_PRESS: MenuPressState<never>;
|
|
151
|
+
export declare const IDLE_MENU_PRESS: MenuPressGesture<never> & MenuPressState<never>;
|
|
115
152
|
/**
|
|
116
153
|
* Advance the gesture by one event. Pure: same inputs, same output.
|
|
117
154
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menuPressGesture.d.ts","sourceRoot":"","sources":["../../src/hooks/menuPressGesture.ts"],"names":[],"mappings":"AAiBA;;;GAGG;AACH,eAAO,MAAM,oBAAoB,MAAM,CAAC;AAExC;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,MAAoC,CAAC;AAEzE,MAAM,MAAM,oBAAoB,GAAG,OAAO,GAAG,OAAO,GAAG,KAAK,CAAC;AAE7D,gBAAgB;AAChB,MAAM,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