@astryxdesign/core 0.7.6-canary.962dffe → 0.7.6-canary.bcb16db
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/ComplexSelector/ComplexSelector.d.ts.map +1 -1
- package/dist/ComplexSelector/ComplexSelector.js +41 -4
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +23 -2
- package/dist/SideNav/SideNavItem.d.ts +2 -2
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/SideNav/SideNavItem.js +18 -7
- package/dist/astryx.css +4 -0
- package/dist/gestures/GestureArena.d.ts +26 -1
- package/dist/gestures/GestureArena.d.ts.map +1 -1
- package/dist/gestures/GestureArena.js +70 -9
- package/dist/gestures/GestureRecognizer.d.ts +3 -1
- package/dist/gestures/GestureRecognizer.d.ts.map +1 -1
- package/dist/gestures/GestureRecognizer.js +3 -1
- package/dist/gestures/PressTracker.d.ts +112 -0
- package/dist/gestures/PressTracker.d.ts.map +1 -0
- package/dist/gestures/PressTracker.js +267 -0
- package/dist/gestures/index.d.ts +37 -0
- package/dist/gestures/index.d.ts.map +1 -0
- package/dist/gestures/index.js +25 -0
- package/dist/gestures/useGestureRecognizer.d.ts +56 -0
- package/dist/gestures/useGestureRecognizer.d.ts.map +1 -0
- package/dist/gestures/useGestureRecognizer.js +226 -0
- package/dist/motion/animator.d.ts +76 -7
- package/dist/motion/animator.d.ts.map +1 -1
- package/dist/motion/animator.js +589 -99
- package/dist/motion/coast.d.ts +4 -1
- package/dist/motion/coast.d.ts.map +1 -1
- package/dist/motion/coast.js +4 -2
- package/dist/motion/reducedMotion.d.ts.map +1 -1
- package/dist/motion/reducedMotion.js +6 -2
- package/dist/motion/reducedMotionPlan.d.ts +7 -0
- package/dist/motion/reducedMotionPlan.d.ts.map +1 -1
- package/dist/motion/reducedMotionPlan.js +14 -1
- package/dist/motion/resolveMotion.d.ts +42 -0
- package/dist/motion/resolveMotion.d.ts.map +1 -0
- package/dist/motion/resolveMotion.js +43 -0
- package/dist/motion/roleValue.d.ts +2 -1
- package/dist/motion/roleValue.d.ts.map +1 -1
- package/dist/motion/roleValue.js +2 -1
- package/dist/motion/uikit/timing.d.ts +7 -1
- package/dist/motion/uikit/timing.d.ts.map +1 -1
- package/dist/motion/uikit/timing.js +19 -1
- package/dist/utils/focusOutline.stylex.d.ts +6 -0
- package/dist/utils/focusOutline.stylex.d.ts.map +1 -1
- package/dist/utils/focusOutline.stylex.js +7 -0
- package/dist/utils/touchPresentation.d.ts +2 -2
- package/dist/utils/touchPresentation.d.ts.map +1 -1
- package/dist/utils/touchPresentation.js +8 -5
- package/dist/utils/touchQueries.d.ts +13 -0
- package/dist/utils/touchQueries.d.ts.map +1 -0
- package/dist/utils/touchQueries.js +15 -0
- package/package.json +4 -4
- package/src/ComplexSelector/ComplexSelector.test.tsx +111 -0
- package/src/ComplexSelector/ComplexSelector.tsx +41 -4
- package/src/NumberInput/NumberInput.test.tsx +68 -7
- package/src/NumberInput/NumberInput.tsx +31 -1
- package/src/SideNav/SideNav.test.tsx +124 -4
- package/src/SideNav/SideNavItem.spec.md +14 -24
- package/src/SideNav/SideNavItem.tsx +27 -10
- package/src/__tests__/internalModulesNotExperimental.test.ts +88 -0
- package/src/gestures/GestureArena.ts +76 -11
- package/src/gestures/GestureRecognizer.ts +3 -1
- package/src/gestures/PressTracker.ts +386 -0
- package/src/gestures/README.md +420 -0
- package/src/gestures/__tests__/GestureHost.test.ts +50 -1
- package/src/gestures/__tests__/PressTracker.test.ts +275 -0
- package/src/gestures/__tests__/arena.test.ts +35 -0
- package/src/gestures/__tests__/harness.ts +31 -2
- package/src/gestures/__tests__/pressTrackerFactory.test.ts +59 -0
- package/src/gestures/__tests__/useGestureRecognizer.test.tsx +570 -0
- package/src/gestures/index.ts +79 -0
- package/src/gestures/useGestureRecognizer.ts +305 -0
- package/src/motion/MEASUREMENTS.md +2 -1
- package/src/motion/README.md +101 -32
- package/src/motion/__tests__/animator.interaction.browser.spec.ts +843 -0
- package/src/motion/__tests__/motionBundle.ts +14 -0
- package/src/motion/animator.test.ts +978 -33
- package/src/motion/animator.ts +790 -104
- package/src/motion/coast.ts +10 -3
- package/src/motion/reducedMotion.ts +12 -2
- package/src/motion/reducedMotionPlan.test.ts +26 -0
- package/src/motion/reducedMotionPlan.ts +20 -1
- package/src/motion/resolveMotion.test.ts +123 -0
- package/src/motion/resolveMotion.ts +68 -0
- package/src/motion/roleValue.ts +2 -1
- package/src/motion/roles.test.ts +16 -0
- package/src/motion/uikit/tableImports.test.ts +293 -0
- package/src/motion/uikit/timing.ts +15 -1
- package/src/motion/uikit/values.test.ts +23 -12
- package/src/utils/focusOutline.stylex.ts +28 -0
- package/src/utils/pressGesture.test.ts +9 -0
- package/src/utils/touchPresentation.ts +8 -5
- package/src/utils/touchQueries.ts +15 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComplexSelector.d.ts","sourceRoot":"","sources":["../../src/ComplexSelector/ComplexSelector.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,EAQZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACzB,MAAM,qBAAqB,CAAC;AAK7B,OAAO,EAA4B,KAAK,kBAAkB,EAAC,MAAM,UAAU,CAAC;AAC5E,OAAO,EAAuB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAI5D,OAAO,KAAK,EAAC,cAAc,EAAE,cAAc,EAAC,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"ComplexSelector.d.ts","sourceRoot":"","sources":["../../src/ComplexSelector/ComplexSelector.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,EA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,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B;;;;OAIG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;IAC7C;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,iCAAiC,KAAK,SAAS,CAAC;IACxE;;;;;OAKG;IACH,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,qDAAqD;IACrD,aAAa,CAAC,EAAE,YAAY,CAAC;IAC7B,sCAAsC;IACtC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAOD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,EACrC,KAAK,EACL,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,WAAW,EAAE,oBAAoB,EACjC,aAAqB,EACrB,WAAW,EACX,UAAkB,EAClB,UAAkB,EAClB,UAAkB,EAClB,SAAiB,EACjB,MAAM,EACN,aAA0B,EAC1B,YAAY,EACZ,IAAW,EACX,OAAiB,EACjB,SAAS,EACT,KAAK,EACL,SAAmB,EACnB,SAAmB,EACnB,SAAS,EACT,aAAa,EACb,YAAY,EACZ,aAAa,EACb,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,GAAG,EACH,EAAE,EACF,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE,aAAa,EACxB,kBAAkB,EAAE,mBAAmB,EACvC,GAAG,SAAS,EACb,EAAE,oBAAoB,CAAC,KAAK,CAAC,qBA0Z7B;yBAjce,eAAe"}
|
|
@@ -29,16 +29,23 @@ import { useTranslator } from "../i18n/index.js";
|
|
|
29
29
|
import { layerAnimations } from "../Layer/layerAnimations.stylex.js";
|
|
30
30
|
import { usePopover } from "../Popover/usePopover.js";
|
|
31
31
|
import { useResolvedRequired } from "../hooks/useResolvedRequired.js";
|
|
32
|
+
import { useInputStatusIcon } from "../hooks/useInputStatusIcon.js";
|
|
32
33
|
import "../theme/tokens.stylex.js";
|
|
33
34
|
import { colorVars, durationVars, easeVars, fontWeightVars, radiusVars, sizeVars, spacingVars, typographyVars, typeScaleVars } from "../theme/tokens.stylex.js";
|
|
35
|
+
import { focusOutlineStyles } from "../utils/focusOutline.stylex.js";
|
|
34
36
|
import { isRenderable, mergeProps } from "../utils/index.js";
|
|
35
37
|
import { composeEventHandlers } from "../utils/composeEventHandlers.js";
|
|
36
|
-
import { focusOutlineStyles } from "../utils/focusOutline.stylex.js";
|
|
37
38
|
import { interactionOverlayStyles } from "../utils/interactionOverlay.stylex.js";
|
|
38
39
|
import { usePressFeedback } from "../hooks/usePressFeedback.js";
|
|
39
40
|
import { themeProps } from "../utils/themeProps.js";
|
|
40
41
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
41
42
|
const styles = {
|
|
43
|
+
statusTip: {
|
|
44
|
+
k1xSpc: "x3nfvp2",
|
|
45
|
+
kGNEyG: "x6s0dn4",
|
|
46
|
+
kmuXW: "x2lah0s",
|
|
47
|
+
$$css: true
|
|
48
|
+
},
|
|
42
49
|
triggerContainer: {
|
|
43
50
|
kVAEAm: "x1n2onr6",
|
|
44
51
|
k1xSpc: "x78zum5",
|
|
@@ -177,6 +184,11 @@ const RENDER_TRIGGER_PARTS_MESSAGE = '`container*` and `control*` styling props
|
|
|
177
184
|
* open and close, including the ones the selector performs itself.
|
|
178
185
|
*/
|
|
179
186
|
|
|
187
|
+
/** Keeps a click from reaching the control box's open-the-popup handler. */
|
|
188
|
+
function stopPropagation(event) {
|
|
189
|
+
event.stopPropagation();
|
|
190
|
+
}
|
|
191
|
+
|
|
180
192
|
/**
|
|
181
193
|
* A selector shell for rich, custom selection surfaces.
|
|
182
194
|
*
|
|
@@ -268,7 +280,19 @@ export function ComplexSelector({
|
|
|
268
280
|
const contentId = useId();
|
|
269
281
|
const descriptionId = useId();
|
|
270
282
|
const statusMessageId = useId();
|
|
271
|
-
|
|
283
|
+
// With `tooltip` placement Field renders no message box, so the status
|
|
284
|
+
// lives in an info-tip button on the trigger row (family:input-fields FR8).
|
|
285
|
+
// Only that placement renders an on-field status affordance here.
|
|
286
|
+
const isTooltipStatus = effectiveStatusVariant === 'tooltip';
|
|
287
|
+
const {
|
|
288
|
+
statusIcon: statusTip,
|
|
289
|
+
describedBy: statusTipDescribedBy
|
|
290
|
+
} = useInputStatusIcon({
|
|
291
|
+
status: isTooltipStatus ? status : undefined,
|
|
292
|
+
statusVariant: effectiveStatusVariant,
|
|
293
|
+
size: 'sm'
|
|
294
|
+
});
|
|
295
|
+
const ariaDescribedBy = [description ? descriptionId : null, isTooltipStatus ? statusTipDescribedBy : status?.message ? statusMessageId : null].filter(id => id != null).join(' ') || undefined;
|
|
272
296
|
const triggerRef = useRef(null);
|
|
273
297
|
const triggerButtonRef = useMergedRefs(triggerRef, ref);
|
|
274
298
|
const [isPending, startTransition] = useTransition();
|
|
@@ -464,8 +488,10 @@ export function ComplexSelector({
|
|
|
464
488
|
// The ring belongs to the wrapper (the focusable `<button>` sits
|
|
465
489
|
// inside it), but it must still be a KEYBOARD ring: `:focus-within`
|
|
466
490
|
// matched a mouse click on the trigger and drew the outline for
|
|
467
|
-
// pointer users too.
|
|
468
|
-
|
|
491
|
+
// pointer users too. It keys off the trigger alone, so the status
|
|
492
|
+
// info-tip beside it rings itself and the box does not ring too
|
|
493
|
+
// (architecture:interaction-modality INV3).
|
|
494
|
+
focusOutlineStyles.focusWithinCombobox, variant === 'secondary' && styles.triggerSecondary, variant === 'ghost' && styles.triggerGhost, variant !== 'input' && interactionOverlayStyles.backgroundImage, isDisabled && inputWrapperStyles.disabled, variant !== 'input' && isDisabled && styles.triggerGhostDisabled, isDisabled && styles.disabled, triggerLabel == null && styles.placeholder, controlXstyle), controlClassName, controlStyle),
|
|
469
495
|
children: [isRenderable(startIconSlot) && startIconSlot, /*#__PURE__*/_jsx("button", {
|
|
470
496
|
...rest,
|
|
471
497
|
ref: triggerButtonRef,
|
|
@@ -505,6 +531,17 @@ export function ComplexSelector({
|
|
|
505
531
|
},
|
|
506
532
|
children: triggerContent
|
|
507
533
|
})
|
|
534
|
+
}), isRenderable(statusTip) &&
|
|
535
|
+
/*#__PURE__*/
|
|
536
|
+
// The info-tip is its own control: a press on it, or on its message
|
|
537
|
+
// bubble (portaled, so outside this span in the DOM but inside it in
|
|
538
|
+
// React), shows the message without opening the popup.
|
|
539
|
+
_jsx("span", {
|
|
540
|
+
onClick: stopPropagation,
|
|
541
|
+
...{
|
|
542
|
+
className: "x3nfvp2 x6s0dn4 x2lah0s"
|
|
543
|
+
},
|
|
544
|
+
children: statusTip
|
|
508
545
|
}), isBusy && /*#__PURE__*/_jsx(Spinner, {
|
|
509
546
|
size: "sm",
|
|
510
547
|
"aria-hidden": "true"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberInput.d.ts","sourceRoot":"","sources":["../../src/NumberInput/NumberInput.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"NumberInput.d.ts","sourceRoot":"","sources":["../../src/NumberInput/NumberInput.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAQL,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAS3C,OAAO,EAGL,KAAK,WAAW,EAKhB,KAAK,kBAAkB,EACxB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAuB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAyJ5D,QAAA,MAAM,UAAU;;;;;;;;;;EAUd,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,UAAU,CAAC;AAMt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tD;;;;;;OAMG;IACH,QAAQ,EAAE,IAAI,CAAC;IACf,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAC1B,4BAA4B,GAAG,yBAAyB,CAAC;AAsF3D;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,aAAqB,EACrB,WAAW,EACX,UAAkB,EAClB,UAAkB,EAClB,UAAU,EAAE,cAAsB,EAClC,UAAkB,EAClB,eAAe,EACf,SAAS,EACT,SAAS,EACT,MAAM,EACN,aAA0B,EAC1B,IAAI,EAAE,QAAQ,EACd,QAAQ,EACR,KAAK,EACL,WAAW,EACX,YAAY,EACZ,YAAoB,EACpB,QAAQ,EACR,YAAY,EACZ,GAAG,EACH,GAAG,EACH,IAAI,EACJ,WAAW,EACX,cAAqB,EACrB,iBAAyB,EACzB,KAAK,EACL,aAAqB,EACrB,OAAO,EACP,MAAM,EACN,QAAQ,EACR,OAAO,EACP,SAAS,EACT,KAAK,EACL,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,GAAG,EACH,EAAE,EAAE,MAAM,EACV,kBAAkB,EAAE,mBAAmB,EACvC,iBAAiB,EAAE,kBAAkB,EACrC,GAAG,SAAS,EACb,EAAE,gBAAgB,+BA2kBlB;yBAznBe,WAAW"}
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* - /apps/storybook/stories/NumberInput.stories.tsx (storybook stories)
|
|
18
18
|
* - /packages/cli/assets/templates/blocks/components/NumberInput/ (showcase blocks)
|
|
19
19
|
*/
|
|
20
|
-
import { use, useId, useState, useMemo, useCallback, useRef } from 'react';
|
|
20
|
+
import { use, useId, useState, useMemo, useCallback, useLayoutEffect, useRef } from 'react';
|
|
21
21
|
import * as stylex from '@stylexjs/stylex';
|
|
22
22
|
import "../theme/tokens.stylex.js";
|
|
23
23
|
import { colorVars, sizeVars, spacingVars, typographyVars, typeScaleVars, borderVars } from "../theme/tokens.stylex.js";
|
|
@@ -363,10 +363,31 @@ export function NumberInput({
|
|
|
363
363
|
}, [isDisabled, isReadOnly]);
|
|
364
364
|
|
|
365
365
|
// Handle focus
|
|
366
|
+
// Tab into the field selects its text so typing replaces it. With
|
|
367
|
+
// `formatValue` the text at rest differs from the editable text, and putting
|
|
368
|
+
// the editable text in the input after focus collapses that selection to the
|
|
369
|
+
// end, so typing would append. When focus arrives with the text selected,
|
|
370
|
+
// select the swapped-in text too.
|
|
371
|
+
const reselectOnFocusRef = useRef(false);
|
|
366
372
|
const handleFocus = useCallback(e => {
|
|
373
|
+
const input = e.currentTarget;
|
|
374
|
+
// Only when focusing swaps the text: otherwise no render follows to
|
|
375
|
+
// consume the flag, and the first keystroke would.
|
|
376
|
+
const editableText = pendingInput ?? (value == null ? '' : formatEditableNumber(value, locale));
|
|
377
|
+
reselectOnFocusRef.current = input.value.length > 0 && input.value !== editableText && input.selectionStart === 0 && input.selectionEnd === input.value.length;
|
|
367
378
|
setIsFocused(true);
|
|
368
379
|
onFocus?.(e);
|
|
369
|
-
}, [onFocus]);
|
|
380
|
+
}, [onFocus, pendingInput, value, locale]);
|
|
381
|
+
useLayoutEffect(() => {
|
|
382
|
+
if (!reselectOnFocusRef.current) {
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
385
|
+
reselectOnFocusRef.current = false;
|
|
386
|
+
const input = inputRef.current;
|
|
387
|
+
if (input != null && input === document.activeElement) {
|
|
388
|
+
input.setSelectionRange(0, input.value.length);
|
|
389
|
+
}
|
|
390
|
+
}, [displayValue]);
|
|
370
391
|
const commitPendingInput = useCallback(trigger => {
|
|
371
392
|
if (pendingInput === null) {
|
|
372
393
|
return;
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
* provided and fall back to `label` when it is missing or blank. Their label
|
|
10
10
|
* tooltip binds to the interactive control through a callback ref, so hover,
|
|
11
11
|
* keyboard focus, and `aria-describedby` follow the control from the first
|
|
12
|
-
* collapsed render. A disabled control takes
|
|
13
|
-
*
|
|
12
|
+
* collapsed render. A disabled control takes no pointer, so its row listens
|
|
13
|
+
* for the tooltip instead, while the control keeps focus and the description.
|
|
14
14
|
*
|
|
15
15
|
* Collapsed items with children open their submenu flyout through
|
|
16
16
|
* `useMenuHover`, the shared hover-intent hook (same one `SideNavHeading` and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SideNavItem.d.ts","sourceRoot":"","sources":["../../src/SideNav/SideNavItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAYf,OAAO,EAAuB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAE5D,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAIrD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAgB,KAAK,WAAW,EAAC,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"SideNavItem.d.ts","sourceRoot":"","sources":["../../src/SideNav/SideNavItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAYf,OAAO,EAAuB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAE5D,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAIrD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAgB,KAAK,WAAW,EAAC,MAAM,iCAAiC,CAAC;AA6ThF,MAAM,WAAW,gBAAiB,SAAQ,SAAS,CAAC,WAAW,CAAC;IAC9D,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,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sCAiclB;yBAnde,WAAW"}
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
* provided and fall back to `label` when it is missing or blank. Their label
|
|
14
14
|
* tooltip binds to the interactive control through a callback ref, so hover,
|
|
15
15
|
* keyboard focus, and `aria-describedby` follow the control from the first
|
|
16
|
-
* collapsed render. A disabled control takes
|
|
17
|
-
*
|
|
16
|
+
* collapsed render. A disabled control takes no pointer, so its row listens
|
|
17
|
+
* for the tooltip instead, while the control keeps focus and the description.
|
|
18
18
|
*
|
|
19
19
|
* Collapsed items with children open their submenu flyout through
|
|
20
20
|
* `useMenuHover`, the shared hover-intent hook (same one `SideNavHeading` and
|
|
@@ -52,6 +52,7 @@ import { useSideNavCollapse, SideNavCollapseContext } from "./SideNavCollapseCon
|
|
|
52
52
|
import { useSideNavRenderMode } from "./SideNavRenderContext.js";
|
|
53
53
|
import { useAppShellMobile } from "../AppShell/AppShellMobileContext.js";
|
|
54
54
|
import { themeProps } from "../utils/themeProps.js";
|
|
55
|
+
import { disabledInteractionProps } from "../utils/disabledInteraction.js";
|
|
55
56
|
import { useTranslator } from "../i18n/index.js";
|
|
56
57
|
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
57
58
|
// =============================================================================
|
|
@@ -207,6 +208,8 @@ const EXPANDED_COLLAPSE_STATE = {
|
|
|
207
208
|
/**
|
|
208
209
|
* Renders `<a>` (via LinkComponent) when `href` is set, otherwise `<button>`.
|
|
209
210
|
* Centralizes the link-vs-button decision used across all SideNavItem paths.
|
|
211
|
+
* A disabled item is a `<button>` that keeps its tab stop and exposes
|
|
212
|
+
* `aria-disabled`, but is inert (spec:AST-085 FR1, FR2).
|
|
210
213
|
*/
|
|
211
214
|
function NavItemElement({
|
|
212
215
|
href,
|
|
@@ -231,8 +234,11 @@ function NavItemElement({
|
|
|
231
234
|
ref: ref,
|
|
232
235
|
type: "button",
|
|
233
236
|
onClick: onClick,
|
|
234
|
-
disabled: isDisabled,
|
|
235
237
|
...rest,
|
|
238
|
+
...(isDisabled ? {
|
|
239
|
+
'aria-disabled': true,
|
|
240
|
+
...disabledInteractionProps(rest.onKeyDown)
|
|
241
|
+
} : null),
|
|
236
242
|
children: children
|
|
237
243
|
});
|
|
238
244
|
}
|
|
@@ -335,6 +341,10 @@ export function SideNavItem({
|
|
|
335
341
|
const isRailLeaf = isCollapsed && !hasChildren;
|
|
336
342
|
const railTooltip = useTooltip({
|
|
337
343
|
placement: 'end',
|
|
344
|
+
// A disabled leaf's row is the trigger (see the collapsed path). It is not
|
|
345
|
+
// focusable itself, so `auto` would never hear the focus that bubbles up
|
|
346
|
+
// from its control.
|
|
347
|
+
focusTrigger: 'always',
|
|
338
348
|
isEnabled: isRailLeaf,
|
|
339
349
|
isOpen: isRailLeaf ? undefined : false
|
|
340
350
|
});
|
|
@@ -477,12 +487,14 @@ export function SideNavItem({
|
|
|
477
487
|
|
|
478
488
|
// Items without children: icon-only link or button, its label in a
|
|
479
489
|
// tooltip. The control is the trigger, so the element that takes focus is
|
|
480
|
-
// the one described. A disabled control takes
|
|
481
|
-
// (`navItemStyles.disabled`)
|
|
490
|
+
// the one described. A disabled control takes no pointer
|
|
491
|
+
// (`navItemStyles.disabled`), so its row listens for the tooltip instead;
|
|
492
|
+
// the control still takes focus (focusin reaches the row) and stays the
|
|
493
|
+
// element described (spec:AST-085 FR5).
|
|
482
494
|
const isRowTrigger = isDisabled;
|
|
483
495
|
const collapsedAriaProps = {
|
|
484
496
|
'aria-current': isSelected ? 'page' : undefined,
|
|
485
|
-
'aria-describedby':
|
|
497
|
+
'aria-describedby': joinIds(rest['aria-describedby'], railTooltip.describedBy),
|
|
486
498
|
'aria-disabled': isDisabled || undefined,
|
|
487
499
|
'aria-label': collapsedAccessibleLabel,
|
|
488
500
|
'data-testid': testId
|
|
@@ -500,7 +512,6 @@ export function SideNavItem({
|
|
|
500
512
|
});
|
|
501
513
|
return /*#__PURE__*/_jsxs("div", {
|
|
502
514
|
ref: isRowTrigger ? railTooltip.ref : undefined,
|
|
503
|
-
"aria-describedby": isRowTrigger ? railTooltip.describedBy : undefined,
|
|
504
515
|
...stylex.props(styles.root, xstyle),
|
|
505
516
|
children: [collapsedElement, railTooltip.renderTooltip(label)]
|
|
506
517
|
});
|
package/dist/astryx.css
CHANGED
|
@@ -1589,12 +1589,16 @@
|
|
|
1589
1589
|
.x92e2el:has(> [data-astryx-edge-comp]:last-child):not(#\#):not(#\#):not(#\#){margin-inline-end:var(--x-4drmnv)}
|
|
1590
1590
|
.x1kftj4p:has(> [data-astryx-edge-comp]:first-child):not(#\#):not(#\#):not(#\#){margin-inline-start:var(--x-126w13d)}
|
|
1591
1591
|
.x1uy843r:has(:focus-visible):not(#\#):not(#\#):not(#\#){outline-color:var(--focus-outline-color)}
|
|
1592
|
+
.x4jz7i8:has(> [role="combobox"]:focus-visible):not(#\#):not(#\#):not(#\#){outline-color:var(--focus-outline-color)}
|
|
1592
1593
|
.xobxmqy:has(> :first-child:focus-visible):not(#\#):not(#\#):not(#\#){outline-color:var(--focus-outline-color)}
|
|
1594
|
+
.x1fz9cfn:has(> [role="combobox"]:focus-visible):not(#\#):not(#\#):not(#\#){outline-offset:var(--focus-outline-offset)}
|
|
1593
1595
|
.x1jumodi:has(:focus-visible):not(#\#):not(#\#):not(#\#){outline-offset:var(--focus-outline-offset)}
|
|
1594
1596
|
.x2vr5qc:has(> :first-child:focus-visible):not(#\#):not(#\#):not(#\#){outline-offset:var(--focus-outline-offset)}
|
|
1597
|
+
.x151uj7h:has(> [role="combobox"]:focus-visible):not(#\#):not(#\#):not(#\#){outline-style:var(--focus-outline-style)}
|
|
1595
1598
|
.xciu248:has(:focus-visible):not(#\#):not(#\#):not(#\#){outline-style:var(--focus-outline-style)}
|
|
1596
1599
|
.xfd04fr:has(> :first-child:focus-visible):not(#\#):not(#\#):not(#\#){outline-style:var(--focus-outline-style)}
|
|
1597
1600
|
.x11j6mr8:has(:focus-visible):not(#\#):not(#\#):not(#\#){outline-width:var(--focus-outline-width)}
|
|
1601
|
+
.x1ufq04b:has(> [role="combobox"]:focus-visible):not(#\#):not(#\#):not(#\#){outline-width:var(--focus-outline-width)}
|
|
1598
1602
|
.xmmisi4:has(> :first-child:focus-visible):not(#\#):not(#\#):not(#\#){outline-width:var(--focus-outline-width)}
|
|
1599
1603
|
.xxdn8bs:has(> div > .astryx-layout-content):not(#\#):not(#\#):not(#\#){padding-inline-end:max(0px,calc((100% - var(--layout-content-width)) / 2))}
|
|
1600
1604
|
.xmnmr5y:has(.astryx-nav-icon):not(#\#):not(#\#):not(#\#){padding-inline-start:0}
|
|
@@ -69,10 +69,15 @@ export interface GestureArenaOptions {
|
|
|
69
69
|
/** Every recognizer transition, for debugging and tests. */
|
|
70
70
|
onTransition?: (recognizer: GestureRecognizer, from: GestureState, to: GestureState) => void;
|
|
71
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* The arena that decides which recognizer gets a touch.
|
|
74
|
+
*/
|
|
72
75
|
export declare class GestureArena {
|
|
73
76
|
readonly environment: GestureEnvironment;
|
|
74
77
|
private readonly clock;
|
|
75
78
|
private readonly options;
|
|
79
|
+
/** The touches whose move the arena is delivering right now. */
|
|
80
|
+
private movingIds;
|
|
76
81
|
private readonly records;
|
|
77
82
|
/** Recognizers involved in the current interaction, in resolution order. */
|
|
78
83
|
private active;
|
|
@@ -84,6 +89,10 @@ export declare class GestureArena {
|
|
|
84
89
|
/** The latest time processed: input never moves the clock backwards. */
|
|
85
90
|
private latestTime;
|
|
86
91
|
private depth;
|
|
92
|
+
/** Open `deferResolution` calls: what their stops unblock waits. */
|
|
93
|
+
private deferDepth;
|
|
94
|
+
/** A deferred stop left recognitions, held touches or resets to settle. */
|
|
95
|
+
private owesResolution;
|
|
87
96
|
constructor(options?: GestureArenaOptions);
|
|
88
97
|
/** The current time on the event clock. */
|
|
89
98
|
now(): number;
|
|
@@ -130,6 +139,18 @@ export declare class GestureArena {
|
|
|
130
139
|
/** @internal */
|
|
131
140
|
clearTimer(recognizer: GestureRecognizer): void;
|
|
132
141
|
/** Cancel an active recognizer, or fail a possible one. */
|
|
142
|
+
/**
|
|
143
|
+
* Runs `body`, code outside input that stops recognizers (an Effect that
|
|
144
|
+
* turns one off or detaches it), without resolving what those stops
|
|
145
|
+
* unblock: the recognitions waiting on them, the touches they held from a
|
|
146
|
+
* view, the resets. A pass a microtask later resolves all of it, at the
|
|
147
|
+
* last event's time, so the listeners and consumers it reaches hear it
|
|
148
|
+
* outside the caller's frame and read the recognized state
|
|
149
|
+
* (react-component-runtime INV2).
|
|
150
|
+
*/
|
|
151
|
+
deferResolution(body: () => void): void;
|
|
152
|
+
/** The last event's time, or now before any event. */
|
|
153
|
+
private lastEventTime;
|
|
133
154
|
stop(recognizer: GestureRecognizer): void;
|
|
134
155
|
private attemptRecognition;
|
|
135
156
|
/** Whether `winner` being recognized prevents `other`. */
|
|
@@ -141,7 +162,11 @@ export declare class GestureArena {
|
|
|
141
162
|
* A recognition that claimed its touches and then fails or is cancelled (a
|
|
142
163
|
* waiting recognition that fails, a gesture a second finger or the app
|
|
143
164
|
* cancels) gives them back to the browser unless another recognition owns
|
|
144
|
-
* them, so a finger still resting there can pinch-zoom the page.
|
|
165
|
+
* them, so a finger still resting there can pinch-zoom the page. A gesture
|
|
166
|
+
* that cancels itself on a finger's move (a long press past its tolerance)
|
|
167
|
+
* keeps that finger until it lifts: the drag goes on, and the page never
|
|
168
|
+
* takes it over midway (`spec:AST-094` FR14), as UIKit's scroll view never
|
|
169
|
+
* takes a touch another recognizer had.
|
|
145
170
|
*/
|
|
146
171
|
private releaseClaim;
|
|
147
172
|
private apply;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GestureArena.d.ts","sourceRoot":"","sources":["../../src/gestures/GestureArena.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,EAGL,KAAK,iBAAiB,EACvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACV,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AiB,GAAG,IAAI;IAgBzC,OAAO,CAAC,kBAAkB;IA8D1B,0DAA0D;IAC1D,OAAO,CAAC,SAAS;IAUjB,+EAA+E;IAC/E,OAAO,CAAC,kBAAkB;IAU1B,OAAO,CAAC,IAAI;IAkBZ;;;;;;;;;OASG;IACH,OAAO,CAAC,YAAY;IA0BpB,OAAO,CAAC,KAAK;IAkBb;;;;OAIG;IACH,OAAO,CAAC,aAAa;IA0BrB,OAAO,CAAC,KAAK;IAyBb,OAAO,CAAC,gBAAgB;IAgBxB,qEAAqE;IACrE,OAAO,CAAC,UAAU;IAqClB,0DAA0D;IAC1D,OAAO,CAAC,UAAU;IAoClB,OAAO,CAAC,aAAa;IAUrB,OAAO,CAAC,WAAW;IAUnB,OAAO,CAAC,mBAAmB;IAW3B,OAAO,CAAC,UAAU;IAWlB,OAAO,CAAC,OAAO;IASf,OAAO,CAAC,WAAW;IAWnB,OAAO,CAAC,MAAM;IAyBd,OAAO,CAAC,SAAS;IAMjB;;;;;OAKG;IACH,OAAO,CAAC,GAAG;IAyBX,OAAO,CAAC,WAAW;IA+BnB,4EAA4E;IAC5E,OAAO,CAAC,IAAI;IAKZ,OAAO,CAAC,MAAM;IAoCd,OAAO,CAAC,iBAAiB;CAkC1B"}
|
|
@@ -56,7 +56,12 @@ export const browserClock = {
|
|
|
56
56
|
* be swallowed now and replayed if the recognizers holding it all fail.
|
|
57
57
|
*/
|
|
58
58
|
|
|
59
|
+
/**
|
|
60
|
+
* The arena that decides which recognizer gets a touch.
|
|
61
|
+
*/
|
|
59
62
|
export class GestureArena {
|
|
63
|
+
/** The touches whose move the arena is delivering right now. */
|
|
64
|
+
movingIds = new Set();
|
|
60
65
|
records = new Map();
|
|
61
66
|
/** Recognizers involved in the current interaction, in resolution order. */
|
|
62
67
|
active = [];
|
|
@@ -68,6 +73,10 @@ export class GestureArena {
|
|
|
68
73
|
/** The latest time processed: input never moves the clock backwards. */
|
|
69
74
|
latestTime = Number.NEGATIVE_INFINITY;
|
|
70
75
|
depth = 0;
|
|
76
|
+
/** Open `deferResolution` calls: what their stops unblock waits. */
|
|
77
|
+
deferDepth = 0;
|
|
78
|
+
/** A deferred stop left recognitions, held touches or resets to settle. */
|
|
79
|
+
owesResolution = false;
|
|
71
80
|
constructor(options = {}) {
|
|
72
81
|
this.options = options;
|
|
73
82
|
this.clock = options.clock ?? browserClock;
|
|
@@ -245,8 +254,14 @@ export class GestureArena {
|
|
|
245
254
|
return;
|
|
246
255
|
}
|
|
247
256
|
const context = this.context();
|
|
248
|
-
|
|
249
|
-
|
|
257
|
+
const previous = this.movingIds;
|
|
258
|
+
this.movingIds = new Set(changed.map(touch => touch.id));
|
|
259
|
+
try {
|
|
260
|
+
for (const recognizer of [...this.active]) {
|
|
261
|
+
recognizer.deliverMoved(changed, context);
|
|
262
|
+
}
|
|
263
|
+
} finally {
|
|
264
|
+
this.movingIds = previous;
|
|
250
265
|
}
|
|
251
266
|
for (const touch of changed) {
|
|
252
267
|
const record = this.records.get(touch.id);
|
|
@@ -391,10 +406,39 @@ export class GestureArena {
|
|
|
391
406
|
}
|
|
392
407
|
|
|
393
408
|
/** Cancel an active recognizer, or fail a possible one. */
|
|
409
|
+
/**
|
|
410
|
+
* Runs `body`, code outside input that stops recognizers (an Effect that
|
|
411
|
+
* turns one off or detaches it), without resolving what those stops
|
|
412
|
+
* unblock: the recognitions waiting on them, the touches they held from a
|
|
413
|
+
* view, the resets. A pass a microtask later resolves all of it, at the
|
|
414
|
+
* last event's time, so the listeners and consumers it reaches hear it
|
|
415
|
+
* outside the caller's frame and read the recognized state
|
|
416
|
+
* (react-component-runtime INV2).
|
|
417
|
+
*/
|
|
418
|
+
deferResolution(body) {
|
|
419
|
+
this.deferDepth += 1;
|
|
420
|
+
try {
|
|
421
|
+
body();
|
|
422
|
+
} finally {
|
|
423
|
+
this.deferDepth -= 1;
|
|
424
|
+
}
|
|
425
|
+
if (this.deferDepth === 0 && this.owesResolution) {
|
|
426
|
+
queueMicrotask(() => {
|
|
427
|
+
if (this.owesResolution && this.deferDepth === 0) {
|
|
428
|
+
this.run(this.lastEventTime(), () => {});
|
|
429
|
+
}
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
/** The last event's time, or now before any event. */
|
|
435
|
+
lastEventTime() {
|
|
436
|
+
return Number.isFinite(this.latestTime) ? this.latestTime : this.clock.now();
|
|
437
|
+
}
|
|
394
438
|
stop(recognizer) {
|
|
395
439
|
// A cancel from code between events happens at the last event's time:
|
|
396
440
|
// wall time would run deadlines ahead of input still queued (FR16).
|
|
397
|
-
const time = this.currentTime ??
|
|
441
|
+
const time = this.currentTime ?? this.lastEventTime();
|
|
398
442
|
this.run(time, () => {
|
|
399
443
|
if (isActive(recognizer.state)) {
|
|
400
444
|
this.apply(recognizer, 'cancelled');
|
|
@@ -487,6 +531,11 @@ export class GestureArena {
|
|
|
487
531
|
}
|
|
488
532
|
recognizer.pending = null;
|
|
489
533
|
this.apply(recognizer, 'failed');
|
|
534
|
+
if (this.deferDepth > 0) {
|
|
535
|
+
// Inside `deferResolution`, the next pass settles.
|
|
536
|
+
this.owesResolution = true;
|
|
537
|
+
return;
|
|
538
|
+
}
|
|
490
539
|
this.reviewPending();
|
|
491
540
|
}
|
|
492
541
|
|
|
@@ -494,12 +543,16 @@ export class GestureArena {
|
|
|
494
543
|
* A recognition that claimed its touches and then fails or is cancelled (a
|
|
495
544
|
* waiting recognition that fails, a gesture a second finger or the app
|
|
496
545
|
* cancels) gives them back to the browser unless another recognition owns
|
|
497
|
-
* them, so a finger still resting there can pinch-zoom the page.
|
|
546
|
+
* them, so a finger still resting there can pinch-zoom the page. A gesture
|
|
547
|
+
* that cancels itself on a finger's move (a long press past its tolerance)
|
|
548
|
+
* keeps that finger until it lifts: the drag goes on, and the page never
|
|
549
|
+
* takes it over midway (`spec:AST-094` FR14), as UIKit's scroll view never
|
|
550
|
+
* takes a touch another recognizer had.
|
|
498
551
|
*/
|
|
499
|
-
releaseClaim(recognizer) {
|
|
552
|
+
releaseClaim(recognizer, keep = new Set()) {
|
|
500
553
|
for (const touch of recognizer.trackedTouches) {
|
|
501
554
|
const record = this.records.get(touch.id);
|
|
502
|
-
if (record == null || !record.isClaimed) {
|
|
555
|
+
if (record == null || !record.isClaimed || keep.has(touch.id)) {
|
|
503
556
|
continue;
|
|
504
557
|
}
|
|
505
558
|
// A recognized discrete gesture (`ended`, a swipe) still owns its
|
|
@@ -521,7 +574,9 @@ export class GestureArena {
|
|
|
521
574
|
if (isTerminal(next)) {
|
|
522
575
|
this.clearTimer(recognizer);
|
|
523
576
|
}
|
|
524
|
-
if (next === 'cancelled'
|
|
577
|
+
if (next === 'cancelled') {
|
|
578
|
+
this.releaseClaim(recognizer, this.movingIds);
|
|
579
|
+
} else if (next === 'failed') {
|
|
525
580
|
this.releaseClaim(recognizer);
|
|
526
581
|
}
|
|
527
582
|
}
|
|
@@ -740,9 +795,15 @@ export class GestureArena {
|
|
|
740
795
|
this.currentTime = this.clampTime(time);
|
|
741
796
|
body();
|
|
742
797
|
// Re-entrant calls settle with the outermost one: settling mid-delivery
|
|
743
|
-
// would reset recognizers that have not heard the event yet.
|
|
798
|
+
// would reset recognizers that have not heard the event yet. Inside
|
|
799
|
+
// `deferResolution`, the next pass settles.
|
|
744
800
|
if (this.depth === 1) {
|
|
745
|
-
this.
|
|
801
|
+
if (this.deferDepth > 0) {
|
|
802
|
+
this.owesResolution = true;
|
|
803
|
+
} else {
|
|
804
|
+
this.owesResolution = false;
|
|
805
|
+
this.settle();
|
|
806
|
+
}
|
|
746
807
|
}
|
|
747
808
|
} finally {
|
|
748
809
|
this.depth -= 1;
|
|
@@ -64,7 +64,9 @@ export type GestureTransitionListener<R> = (recognizer: R, from: GestureState, t
|
|
|
64
64
|
export declare function isTransitionAllowed(from: GestureState, to: GestureState): boolean;
|
|
65
65
|
export declare function isTerminal(state: GestureState): boolean;
|
|
66
66
|
export declare function isActive(state: GestureState): boolean;
|
|
67
|
-
/**
|
|
67
|
+
/**
|
|
68
|
+
* The browser behaviors `touch-action` can keep or remove.
|
|
69
|
+
*/
|
|
68
70
|
export interface NativeTouchBehavior {
|
|
69
71
|
readonly panX: boolean;
|
|
70
72
|
readonly panY: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GestureRecognizer.d.ts","sourceRoot":"","sources":["../../src/gestures/GestureRecognizer.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACnB,YAAY,EACZ,YAAY,EACZ,KAAK,EACL,WAAW,EACZ,MAAM,SAAS,CAAC;AAGjB,MAAM,WAAW,wBAAwB,CAAC,CAAC,GAAG,iBAAiB;IAC7D,4CAA4C;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qGAAqG;IACrG,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,8EAA8E;IAC9E,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,2FAA2F;IAC3F,mBAAmB,CAAC,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;IACjD,sFAAsF;IACtF,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,+EAA+E;IAC/E,WAAW,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC,KAAK,OAAO,CAAC;IACzC,iFAAiF;IACjF,kBAAkB,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC,EAAE,KAAK,EAAE,YAAY,KAAK,OAAO,CAAC;IACrE,+DAA+D;IAC/D,6BAA6B,CAAC,EAAE,CAC9B,UAAU,EAAE,CAAC,EACb,KAAK,EAAE,iBAAiB,KACrB,OAAO,CAAC;IACb,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E,YAAY,GAAG,OAAO;IAUxC,gBAAgB;IAChB,YAAY,CACV,OAAO,EAAE,aAAa,CAAC,YAAY,CAAC,EACpC,KAAK,EAAE,mBAAmB,GACzB,IAAI;IASP,gBAAgB;IAChB,qBAAqB,CACnB,OAAO,EAAE,aAAa,CAAC,YAAY,CAAC,EACpC,KAAK,EAAE,mBAAmB,GACzB,IAAI;IAOP,gBAAgB;IAChB,YAAY,CACV,OAAO,EAAE,aAAa,CAAC,YAAY,CAAC,EACpC,KAAK,EAAE,mBAAmB,GACzB,IAAI;IASP,gBAAgB;IAChB,YAAY,CACV,OAAO,EAAE,aAAa,CAAC,YAAY,CAAC,EACpC,KAAK,EAAE,mBAAmB,GACzB,IAAI;IAcP,gBAAgB;IAChB,gBAAgB,CACd,OAAO,EAAE,aAAa,CAAC,YAAY,CAAC,EACpC,KAAK,EAAE,mBAAmB,GACzB,IAAI;IAaP,gBAAgB;IAChB,qBAAqB,CACnB,OAAO,EAAE,aAAa,CAAC,YAAY,CAAC,EACpC,KAAK,EAAE,mBAAmB,GACzB,IAAI;IAaP,+EAA+E;IAC/E,eAAe,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAQ;IAE5C;;;OAGG;IACH,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;IAWhC,4EAA4E;IAC5E,MAAM,IAAI,IAAI;IAWd,2DAA2D;IAC3D,UAAU,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI;IAsBpC,2DAA2D;IAC3D,eAAe,IAAI,IAAI;CAQxB"}
|
|
@@ -49,7 +49,9 @@ export function isActive(state) {
|
|
|
49
49
|
return state === 'began' || state === 'changed';
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
/**
|
|
52
|
+
/**
|
|
53
|
+
* The browser behaviors `touch-action` can keep or remove.
|
|
54
|
+
*/
|
|
53
55
|
|
|
54
56
|
export const ALL_NATIVE_TOUCH = {
|
|
55
57
|
panX: true,
|