@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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,76 @@
|
|
|
1
1
|
# @xds/core
|
|
2
2
|
|
|
3
|
+
# 0.7.15
|
|
4
|
+
|
|
5
|
+
#### New Features
|
|
6
|
+
|
|
7
|
+
- DateInput, DateTimeInput: `onEntryErrorChange` reports why the field rejects typed text, so an app can word its own message. It receives a `DateInputEntryError` (exported from both components) with a `kind` that does not depend on the locale (`unreadable`, `incomplete`, `nonexistent`, `outOfRange` for a date before `min` or after `max`, or `unavailable` for a day that `dateConstraints` rules out), the typed `text`, and, for `outOfRange` and `unavailable`, the Gregorian ISO `date`. It runs each time the rejection changes, including when a new `min`, `max`, `dateConstraints`, or `value`, a calendar pick, disabling the field, or Enter or blur changes it, and with `null` when the rejection ends, or when the typed field leaves while its rejection stands, as when a presentation or pointer change shows the native or touch picker. With the callback, an `error` `status` that has a message is the message the field shows and announces, and the field's own message applies only without one; a `warning` or `success` status never replaces a rejection. When a rejection starts while that error message stays the same, the field announces the message once more for it. Without the callback, nothing else changes. For every DateTimeInput, while a native date control replaces the typed date field, kept typed text and its rejection wait for the typed field, so the field shows the caller's `status` meanwhile. The native and touch pickers take no typed text, so the callback never reports a rejection there. Fixes #10366. (#11311)
|
|
8
|
+
- SegmentedControl: under a finger, pressing the selected segment lifts its surface as UIKit's does, and it settles back when the finger lets go. A pen lifts it the same way on a touch device. With a mouse on a desktop, or with Reduce Motion, nothing lifts. (#9724)
|
|
9
|
+
- Where the primary pointer is fine, a mouse press on a CheckboxInput or a RadioList option paints at once on `pointerdown` and fades on release, as a finger's press does, instead of the browser's `:active`. A right click, or a press on a link or a button inside a RadioList option, does not paint the option. Other controls keep `:active` for a mouse. (#8696)
|
|
10
|
+
|
|
11
|
+
#### Fixes
|
|
12
|
+
|
|
13
|
+
- Calendar, DateRangeInput: a two-month calendar whose `max` falls in the month it would open on now opens with that month in the second pane. Before, with `max` set to today, or with a selected value starting in `max`'s month, it opened on that month and the next one, and every day of the next month was disabled while the previous month stayed hidden. The first pane still never goes before `min`'s month, an explicit `focusDate` is shown as given, and a one-month calendar is unchanged. (#11202)
|
|
14
|
+
- Calendar: with `hasWeekNumbers`, each row shows the ISO 8601 week number of its Thursday, the ISO week that holds most of its days. Before, most rows that start on Sunday or Saturday showed the previous ISO week, so the first two rows of a month could show the same number. Rows that start on Monday are unchanged. (#11271)
|
|
15
|
+
- DateInput, DateTimeInput: a typed date that the calendar does not have, such as February 30, shows "Enter a real date". The message names the calendar, as in "Enter a real date (Persian Calendar)", only when the field's calendar differs from the `InternationalizationProvider` calendar. A day that `dateConstraints` rules out shows "Enter an available date". (#11309)
|
|
16
|
+
- DateInput keeps its typed field's and native field's bookkeeping in state. A render React discards, as a suspended transition does, no longer drops typed text, clears a refused date, or reports the same date twice. (#10877)
|
|
17
|
+
- DateTimeInput keeps its native pickers' last value and commit epoch in state. A render React discards, as a suspended transition does, no longer drops a time chosen before the date, clears a refused date or time, or lets the same native edit commit twice. (#10861)
|
|
18
|
+
- Drawer keeps the side it exits to in state. A render React discards, as a suspended transition does, no longer changes the edge a closing drawer slides out to. (#10859)
|
|
19
|
+
- useLinkify and RichTextEditorAutoLinkPlugin: email detection now takes linear time. A long word with no email in it, such as a pasted hash or base64 string, no longer freezes the page for seconds. Valid email addresses link as before, with three exceptions. In the rich-text editor, an address directly after a period no longer links, and a quoted local part ends at the next quote. In useLinkify, a fragment glued to the end of an earlier address no longer links on its own. (#11306)
|
|
20
|
+
- Dialog, CommandPalette, BottomSheet, Lightbox, Drawer, MobileNav, Popover: a Tab pressed with Ctrl or Meta on the first or last control of a modal no longer moves focus to the other end, and the modal no longer cancels the press. A page or a host app that handles Ctrl+Tab or Meta+Tab itself, for example to switch its own tabs, now gets the press on every control, as it already did between the first and the last. Alt+Tab still wraps, because Safari moves focus to each item on Option+Tab. (#11247)
|
|
21
|
+
- Gestures in a same-origin iframe or a Picture-in-Picture window now time touches on that window's own clock. Before, a short tap there could start a long press, because the page's clock reads ahead of the window's. (#11155)
|
|
22
|
+
- `Item`'s swipe actions: under `reveal`, a fling opens the row at its actions; under either model a fling never fires an entry. On a side with two or more entries, only a drag that starts on the open row fires the outermost entry. The panel shows no entry's colour behind another. The entries fill it, and the entry that fires covers it until the row comes back or holds out. No API changes. (#11054)
|
|
23
|
+
- Keep disabled Item actions focusable (#11169)
|
|
24
|
+
- After the window loses focus during a finger's press, lifting that finger no longer acts on any menu (DropdownMenu, MoreMenu, ContextMenu, Selector, and menus built on the public `useMenuPress`), and a tap on a menu's trigger still opens it. Under a finger, a row lit by a press that is cancelled (a scroll, a second finger, the window losing focus) now clears, as on iOS. It clears in DropdownMenu and its sub-menus under any `presentation`, MoreMenu, ContextMenu, Selector's list and the bottom sheet's action list, and in a menu built on the public `useMenuPress` whose root can take focus. A mouse keeps its highlight. (#8508)
|
|
25
|
+
- The menu press model behind DropdownMenu, ContextMenu and their submenus syncs its option, step and trigger-context refs at commit. A press after a render React discards, as a suspended transition does, now uses the committed options. (#10901)
|
|
26
|
+
- The mobile keyboard hook syncs its enabled, expanded and open flags at commit. After a render React discards, as a suspended transition does, a dismissal and the keyboard's listeners follow the committed options. (#10914)
|
|
27
|
+
- Outline's scroll spy reads its items, its `onActiveIdChange` and its active item as committed. A render React discards, as a suspended transition does, no longer changes which item a scroll marks or which callback a landed navigation calls. (#10802)
|
|
28
|
+
- Carousel paging: a row that resizes while it settles no longer stops at once or runs back to an earlier page. The settle plays on at its speed, to the last page when it was heading there, and otherwise to the page nearest where it was heading. It ends on that page with no step when it goes back to native scrolling. A resize that leaves the row past its new last page, or that gives the row its first width, still lands it at once on the page it was heading for. (#10592)
|
|
29
|
+
- ResizeHandle reads its region, direction and disabled state as committed. A render React discards, as a suspended transition does, no longer makes a key press resize another region or refuse an enabled handle. (#10803)
|
|
30
|
+
- In a swizzled AppShell, the first Tab into the main region now stops on the region, as in the package's AppShell, when its first link or button sits inside a package scroll region that does not overflow (ScrollableArea, Table, CodeBlock, Tokenizer, BottomSheet), and the reverse. Arrow and Page keys are unchanged. No API changes. (#11225)
|
|
31
|
+
- A disabled `Step` now reflects `disabled` on the `step-indicator` theming target, beside `step-label`, so a theme can restyle a disabled step's indicator. In a compact horizontal `Stepper` with on-track indicators, where a disabled step's label is not shown, the indicator is the only target a theme can reach. The `step` and `step-description` targets do not gain the selector. (#8997) (#9192)
|
|
32
|
+
- `useStreamingText` keeps where its reveal restarts in state. A render React discards, as a suspended transition does, no longer restarts a streaming reveal from the start or jumps it to the end. (#10862)
|
|
33
|
+
- Table keeps one array for each list of columns, and for each list of plugins, compared by identity. A render React throws away, as a suspended transition does, can no longer replace the array the table last displayed. The next committed render reuses the array, so rows skip rendering when the columns and plugins match the committed ones. `useBaseTablePlugins` also keeps its array when the base plugins come in a new array of the same plugins. A column plugin with its own render-time cache, such as the tree plugin, still re-renders every row. (#10940)
|
|
34
|
+
- `useTableSortableState` sorts only when its data, sort or locale changes. It re-sorted every row on every render of its owner. (#10942)
|
|
35
|
+
- Table sorting with `useTableSortableState` calls the latest `onSortChange`. Before, a sort header kept the handler from the last time the sort changed, so a parent that passed a new handler without a sort change had its old handler called, and that handler saw out-of-date state. (#11349)
|
|
36
|
+
- Text and Heading: on Android, the first tap on a button or link inside truncated text opens the truncation tooltip, as on iOS. The tap focused the element first, and that focus took the tap; now only a keyboard focus counts. Tooltip: a tap on a text field inside a tooltip's trigger focuses the field and no longer opens or closes the tooltip. This includes a text field inside truncated text. (#11213)
|
|
37
|
+
- A Timestamp hover card's copy button now shows when the clipboard write fails, as CodeBlock's copy button does: the icon becomes a cross for 1.5 seconds, and the button is named, tooltipped and announces "Failed to copy value to clipboard." It used to do nothing. A theme that maps the `timestamp-copy` slot keeps its rest glyph during a failure (`copied` is false). The error itself is not shown. (#10434)
|
|
38
|
+
- ToastViewport syncs its committed list at commit. A toast that only a render React discards showed, such as a suspended transition, reports no `onHide` when a repeat replaces it and the same handler then dismisses it. (#10902)
|
|
39
|
+
- Tokenizer's sheet numbers its searches and its opens in state. A render React discards, as a suspended transition does, no longer makes a reopen announce a search that never ran. (#10886)
|
|
40
|
+
- In Tokenizer's inline field on a touch screen (a tablet, or `presentation="popover"` on a phone), removing a token with a finger no longer raises the touch keyboard. A tap on a token's own remove button (Token's ×) used to move focus to the field's input inside the tap, which makes iOS and Android show their keyboard; when the input was not focused before the tap (the keyboard was down), focus now stays where it was, unless the tapped × or another control in its token held focus, when focus moves to the input as before. A tap made while typing, a pen's tap, a mouse click, a key press on the remove button, and a remove control drawn by a custom `renderToken` still put focus in the input. PowerSearch's filter tokens, which render Token, get the same fix. (#8160)
|
|
41
|
+
|
|
42
|
+
#### Documentation
|
|
43
|
+
|
|
44
|
+
- Hook docs for `useThemeName`, so `astryx hook useThemeName` and `astryx search` return it, and a `useThemeName — Active theme` example block: the name of the theme wrapped around the caller. (#11235)
|
|
45
|
+
- List's anatomy now names its optional header and drops a description part that List does not render. The `ref` docs now say that the ref reaches the list element, with or without a header. (#11277)
|
|
46
|
+
- `DefinedTheme.__componentIcons` is now documented public API; its presence and shape follow the compatibility policy. (#11192)
|
|
47
|
+
|
|
48
|
+
#### Other Changes
|
|
49
|
+
|
|
50
|
+
- Internal: Core's internal touch entry re-exports UIKit's timing table and the motion engine's AnimateOptions and MotionHandle types for Lab's SearchField. Apps import nothing new. (#10956)
|
|
51
|
+
- Internal: the close button name of Lab's SearchField joins Core's message catalog. Apps import nothing new. (#10956)
|
|
52
|
+
- Internal: Core adds two internal hooks that keep a ref at the latest committed prop or callback for event and gesture callbacks, and an internal entry through which Lab reaches them. Outline's scroll spy, ResizeHandle and resizing logic, menu press handling, the mobile keyboard hook, and ToastViewport use them. Apps import nothing new. (#11352)
|
|
53
|
+
- Internal: one shared context request from a long press, a right click, or Shift+F10 and the context-menu key, reporting which input made it, one per gesture. A held finger's hold loses to a claim another gesture already made on that finger, and a control that keeps its press for a hold-repeat owns only its hold, so its right click and Shift+F10 still reach the request. A held pen's own context menu event is refused like a held finger's. The hold is UIKit's long press and requests as it begins. Not exported from the package entry point. (#8670)
|
|
54
|
+
- Internal: Core's internal layer hook drops a dismissal-check field that no component reads. The layer still refuses to reopen during the press that closed it. Apps see no change. (#11332)
|
|
55
|
+
- Internal: Markdown records its streaming fade-in refs as an exception to the runtime's ref rule, with tests that pin why it is harmless. (#10939)
|
|
56
|
+
- Internal: the rule that ends a container's press for a press on a nested control is named for every pointer it covers, and its comments and records say what it does. No change to any component's behavior or API. (#11304)
|
|
57
|
+
|
|
58
|
+
#### Contributors
|
|
59
|
+
|
|
60
|
+
Thanks to everyone who contributed to this release:
|
|
61
|
+
|
|
62
|
+
- @aashish254
|
|
63
|
+
- @ChenyangLi4288
|
|
64
|
+
- @cixzhang
|
|
65
|
+
- @duytbp
|
|
66
|
+
- @Geervan
|
|
67
|
+
- @nynexman4464
|
|
68
|
+
- @popsiclelmlm
|
|
69
|
+
- @Varshavia
|
|
70
|
+
- @vjeux
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
3
74
|
# 0.7.14
|
|
4
75
|
|
|
5
76
|
#### New Features
|
|
@@ -5022,7 +5093,6 @@ This release makes **bare component names canonical**: `Button`, `Stack`, `useTh
|
|
|
5022
5093
|
- **Un-prefix migration — bare names are canonical** — Every `XDS*` component, hook, and type now has a bare alias (`XDSButton` → `Button`, `useXDSTheme` → `useTheme`, ~634 identifiers across 100 barrels). The prefixed names still work as aliases during the compat window, so this is non-breaking if you do nothing — but bare names are the new default for docs, discovery, and new code. (#2941)
|
|
5023
5094
|
**Codemod:** `npx astryx upgrade --codemod drop-xds-prefix-imports`
|
|
5024
5095
|
- **`@xds/core` un-prefix** — `XDSMetaAppShell` → `MetaAppShell` and related meta-app exports drop the `XDS` prefix. (#2957)
|
|
5025
|
-
**Codemod:** `npx astryx upgrade --codemod drop-xds-meta-prefix`
|
|
5026
5096
|
- **DatePicker components renamed to Input** — `XDSDateTimePicker` → `XDSDateTimeInput` and `XDSDateRangePicker` → `XDSDateRangeInput` (plus their props, size, and hour-format types), for consistency with `DateInput`/`TextInput`/`NumberInput`. (#2276)
|
|
5027
5097
|
**Codemod:** `npx astryx upgrade --codemod rename-date-picker-to-input`
|
|
5028
5098
|
- **Stack `element` → `as`** — `XDSStack`, `XDSHStack`, `XDSVStack`, and `XDSStackItem` use `as` instead of `element`, matching other polymorphic components. (#2441)
|
|
@@ -5048,7 +5118,7 @@ This release makes **bare component names canonical**: `Button`, `Stack`, `useTh
|
|
|
5048
5118
|
npx astryx upgrade --apply
|
|
5049
5119
|
```
|
|
5050
5120
|
|
|
5051
|
-
This runs the release codemods in sequence. The bare-name migration (`drop-xds-prefix-imports
|
|
5121
|
+
This runs the release codemods in sequence. The bare-name migration (`drop-xds-prefix-imports`) and the theme data-attribute migration (`migrate-theme-selectors-to-data-attrs`) are optional — run them explicitly when you're ready, e.g.:
|
|
5052
5122
|
|
|
5053
5123
|
```bash
|
|
5054
5124
|
npx astryx upgrade --codemod drop-xds-prefix-imports --codemod-only --apply
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheetPanel.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/BottomSheetPanel.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;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etPanel({
|
|
|
527
527
|
|
|
528
528
|
// Everything derived from the snap points keys off their identity, not the
|
|
529
529
|
// array's: the resolver's identity is the hook's signal that the stops
|
|
530
|
-
// changed, so it must not churn on a re-render the drag caused. The
|
|
531
|
-
// reads the points through a ref, so
|
|
532
|
-
//
|
|
530
|
+
// changed, so it must not churn on a re-render the drag caused. The resolver
|
|
531
|
+
// reads the points through a ref, so it resolves them at call time —
|
|
532
|
+
// against whatever the viewport is then, not what it was at memo time.
|
|
533
533
|
const snapPointsKey = snapPointsKeyFor(snapPoints);
|
|
534
534
|
const snapPointsRef = useRef(snapPoints);
|
|
535
535
|
snapPointsRef.current = snapPoints;
|
|
@@ -543,11 +543,12 @@ export function BottomSheetPanel({
|
|
|
543
543
|
ignoredSnapPointsMessage: ''
|
|
544
544
|
};
|
|
545
545
|
}
|
|
546
|
-
const ignored = (
|
|
546
|
+
const ignored = (snapPoints ?? []).filter(point => !isValidSnapPoint(point));
|
|
547
547
|
return {
|
|
548
548
|
snapHeights: () => resolveSnapPoints(snapPointsRef.current ?? [], layoutViewportHeight()),
|
|
549
549
|
ignoredSnapPointsMessage: ignored.length === 0 ? '' : `snapPoints ignored ${JSON.stringify(ignored)}. A snap point is a viewport fraction above 0 and up to 1 (0.5 is half the screen), a px length ('320px'), or a percentage ('50%').`
|
|
550
550
|
};
|
|
551
|
+
// eslint-disable-next-line @eslint-react/exhaustive-deps -- keyed by the snap points' identity, not the array's
|
|
551
552
|
}, [snapPointsKey]);
|
|
552
553
|
useDevWarning('BottomSheet', ignoredSnapPointsMessage, ignoredSnapPointsMessage !== '');
|
|
553
554
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxInput.d.ts","sourceRoot":"","sources":["../../src/CheckboxInput/CheckboxInput.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAOL,KAAK,WAAW,EAChB,KAAK,UAAU,EAGf,KAAK,SAAS,EACf,MAAM,OAAO,CAA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AAQ,EACR,eAAe,EACf,UAAkB,EAClB,UAAkB,EAClB,UAAkB,EAClB,IAAW,EACX,OAAO,EACP,MAAM,EACN,SAAS,EACT,MAAM,EACN,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,kBAAkB,EAAE,mBAAmB,EACvC,GAAG,IAAI,EACR,EAAE,kBAAkB,+BAwSpB;yBAnUe,aAAa"}
|
|
@@ -27,7 +27,6 @@ import { useTooltip } from "../Tooltip/useTooltip.js";
|
|
|
27
27
|
import { mergeProps } from "../utils/mergeProps.js";
|
|
28
28
|
import { rtlStyles } from "../utils/rtlStyles.js";
|
|
29
29
|
import { withholdCallerHandlers } from "../utils/disabledInteraction.js";
|
|
30
|
-
import "../Indicator/indicator.markers.stylex.js";
|
|
31
30
|
import { indicatorScope } from "../Indicator/indicator.markers.stylex.js";
|
|
32
31
|
import "../internal/indicatorPress.stylex.js";
|
|
33
32
|
import { indicatorPressScope } from "../internal/indicatorPress.stylex.js";
|
|
@@ -40,6 +39,7 @@ import { themeProps } from "../utils/themeProps.js";
|
|
|
40
39
|
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
41
40
|
import { useTouchHitArea } from "../utils/touchHitArea.js";
|
|
42
41
|
import { pressBoxProps } from "../privateAttributes/pressBox.stylex.js";
|
|
42
|
+
import { indicatorPressPaintStyles } from "../privateAttributes/press.stylex.js";
|
|
43
43
|
import { registerBoxHold } from "../utils/boxHold.js";
|
|
44
44
|
import { touchHitAreaStyles } from "../internal/touchHitArea.stylex.js";
|
|
45
45
|
import { registerEnglishFallback, useComponentTranslator } from "../i18n/useComponentTranslator.js";
|
|
@@ -50,19 +50,6 @@ registerEnglishFallback(english);
|
|
|
50
50
|
// Registered here, not in the press controller, so a page with no box carries
|
|
51
51
|
// none of its code.
|
|
52
52
|
registerBoxHold();
|
|
53
|
-
|
|
54
|
-
/** Written by the press controller while the row is pressed. */
|
|
55
|
-
const PRESSED_ON = '[data-astryx-press="on"]';
|
|
56
|
-
/** Written by the press controller for the press's release. */
|
|
57
|
-
const PRESSED_FADING = '[data-astryx-press="fading"]';
|
|
58
|
-
/** The row is pressed, and the press controller does not paint the press. */
|
|
59
|
-
const ACTIVE_UNPAINTED = `:active:not(${PRESSED_ON},${PRESSED_FADING})`;
|
|
60
|
-
|
|
61
|
-
// The touch press's paint, declared by the shared overlay styles on the
|
|
62
|
-
// element the controller writes to (`pressedAlpha`) at the press's strength,
|
|
63
|
-
// 1 while on and 1 → 0 over the release, and inherited resolved by the layer
|
|
64
|
-
// that paints it. See interactionOverlay.stylex.ts.
|
|
65
|
-
const pressedOverlayImage = 'var(--_press-paint-image)';
|
|
66
53
|
const styles = {
|
|
67
54
|
container: {
|
|
68
55
|
k1xSpc: "x78zum5",
|
|
@@ -78,11 +65,6 @@ const styles = {
|
|
|
78
65
|
kVAEAm: "xrxqdxo",
|
|
79
66
|
$$css: true
|
|
80
67
|
},
|
|
81
|
-
indicatorPressImage: {
|
|
82
|
-
"--_indicator-press-image": "x1dueop1 x189o2zt",
|
|
83
|
-
"--_indicator-active-press": "x1qwhovg x858ff1",
|
|
84
|
-
$$css: true
|
|
85
|
-
},
|
|
86
68
|
indicatorRowPressImage: {
|
|
87
69
|
"--_indicator-press-image": "x1y1g3jp",
|
|
88
70
|
"--_indicator-active-press": "x1bl9l2n",
|
|
@@ -103,8 +85,6 @@ const styles = {
|
|
|
103
85
|
kv0HGH: "xarstr8",
|
|
104
86
|
kUfP38: "xtb6wbx",
|
|
105
87
|
kloYau: "x2q1x1w",
|
|
106
|
-
ks3ayO: "xyhc2n1 xur6jaf xtawv5c",
|
|
107
|
-
kNctxI: "x178sc5r x1d4iov5",
|
|
108
88
|
$$css: true
|
|
109
89
|
},
|
|
110
90
|
indicatorRowPressOverlay: {
|
|
@@ -328,7 +308,11 @@ export function CheckboxInput({
|
|
|
328
308
|
...stylex.props(styles.container, isLabelHidden && styles.containerLabelHidden, hasHitArea && styles.hitAreaHost, hasHitArea && touchHitAreaStyles.layer,
|
|
329
309
|
// Hover and focus reach the checkbox visual through this ancestor
|
|
330
310
|
// marker rather than props, so the whole row drives it.
|
|
331
|
-
!isDisabled && indicatorScope,
|
|
311
|
+
!isDisabled && indicatorScope,
|
|
312
|
+
// An indicator in another package may not name the private press
|
|
313
|
+
// attribute. So the row hands its press image down to an indicator
|
|
314
|
+
// that paints its own press (`indicatorPressPaintStyles.handDown`).
|
|
315
|
+
!isDisabled && (isRowPressSurface ? styles.indicatorRowPressImage : indicatorPressPaintStyles.handDown),
|
|
332
316
|
// The touch press's strength and release live on the row the
|
|
333
317
|
// controller writes to; the layer over the checkbox box inherits
|
|
334
318
|
// and paints it. Under a row that owns the press, the box inherits
|
|
@@ -336,7 +320,10 @@ export function CheckboxInput({
|
|
|
336
320
|
ownsPress && interactionOverlayStyles.pressedAlpha),
|
|
337
321
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
338
322
|
...(isDisabled ? undefined : pressBoxProps),
|
|
339
|
-
...stylex.props(styles.checkboxWrapper, wrapperSizeStyles[size], !isDisabled && styles.indicatorPressOverlay,
|
|
323
|
+
...stylex.props(styles.checkboxWrapper, wrapperSizeStyles[size], !isDisabled && styles.indicatorPressOverlay,
|
|
324
|
+
// Under a row that owns the press, the row's own overlay paints
|
|
325
|
+
// instead of the owner's press paint.
|
|
326
|
+
!isDisabled && (isRowPressSurface ? styles.indicatorRowPressOverlay : [indicatorPressPaintStyles.activeFill, indicatorPressPaintStyles.image])),
|
|
340
327
|
...focusProps,
|
|
341
328
|
children: [/*#__PURE__*/_jsx("input", {
|
|
342
329
|
...withholdCallerHandlers(rest, isDisabled),
|
package/dist/Item/Item.js
CHANGED
|
@@ -46,7 +46,7 @@ import { ItemTrailingContext } from "./ItemTrailingContext.js";
|
|
|
46
46
|
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
47
47
|
import { computeTargetAndRel } from "../Link/computeTargetAndRel.js";
|
|
48
48
|
import { useLinkComponent } from "../Link/useLinkComponent.js";
|
|
49
|
-
import {
|
|
49
|
+
import { cancelNestedPress, PRESSABLE_CONTAINER_ATTRIBUTE, useClickableContainerProxy } from "../hooks/useClickableContainer.js";
|
|
50
50
|
import { useDevWarning } from "../hooks/useDevWarning.js";
|
|
51
51
|
import { themeProps } from "../utils/themeProps.js";
|
|
52
52
|
import { focusOutlineProps } from "../utils/focusOutline.stylex.js";
|
|
@@ -355,7 +355,7 @@ export function Item({
|
|
|
355
355
|
// it keeps the press. Such a row is not a clickable container: an enclosing
|
|
356
356
|
// card still treats it as part of its own surface.
|
|
357
357
|
const hasOwnAction = (onClick != null || href != null) && !hasParentRole && !isLinkRoot;
|
|
358
|
-
const pressOnRow = event =>
|
|
358
|
+
const pressOnRow = event => cancelNestedPress(event, event.currentTarget, href != null ? actionLinkRef.current : actionButtonRef.current);
|
|
359
359
|
const leadingSwipe = swipeActions?.leading ?? [];
|
|
360
360
|
const trailingSwipe = swipeActions?.trailing ?? [];
|
|
361
361
|
const hasSwipe = servesSwipeActions({
|
|
@@ -69,6 +69,11 @@ export interface TapRecognizer {
|
|
|
69
69
|
press(event: PointerEvent, trigger: Element | null, onTap: (tapEvent: Event) => void): boolean;
|
|
70
70
|
/** Stops waiting for a press still waiting for its tap. */
|
|
71
71
|
forget(): void;
|
|
72
|
+
/**
|
|
73
|
+
* Whether a touch or pen press still waits for its tap, with no key press
|
|
74
|
+
* or new press since. A focus at that time is the press's own focus.
|
|
75
|
+
*/
|
|
76
|
+
isTouchPressCurrent(): boolean;
|
|
72
77
|
}
|
|
73
78
|
/** One tap recognizer for a trigger, released on unmount. Internal. */
|
|
74
79
|
export declare function useTapRecognizer(): TapRecognizer;
|
|
@@ -204,5 +209,11 @@ export declare function useTouchTriggerInternal(options: UseTouchTriggerOptions,
|
|
|
204
209
|
* pointer lifted inside the layer: the layer stays open, and useTooltip
|
|
205
210
|
* ends a hold that the press started.
|
|
206
211
|
*/
|
|
207
|
-
onReleaseInLayer?: () => void
|
|
212
|
+
onReleaseInLayer?: () => void,
|
|
213
|
+
/**
|
|
214
|
+
* Whether a tap on a text-entry control inside the trigger only focuses
|
|
215
|
+
* that control, so no tooltip covers text the person starts to type. Only
|
|
216
|
+
* useTooltip passes it.
|
|
217
|
+
*/
|
|
218
|
+
isTextEntryTapIgnored?: boolean): UseTouchTriggerInternalReturn;
|
|
208
219
|
//# sourceMappingURL=useTouchTrigger.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTouchTrigger.d.ts","sourceRoot":"","sources":["../../src/Layer/useTouchTrigger.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,OAAO,EAKL,KAAK,UAAU,IAAI,eAAe,EAClC,KAAK,YAAY,IAAI,iBAAiB,EACtC,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useTouchTrigger.d.ts","sourceRoot":"","sources":["../../src/Layer/useTouchTrigger.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,OAAO,EAKL,KAAK,UAAU,IAAI,eAAe,EAClC,KAAK,YAAY,IAAI,iBAAiB,EACtC,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAef;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC;AAExD;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,aAA4B,CAAC;AAE7D,wEAAwE;AACxE,MAAM,WAAW,aAAa;IAC5B;;;;;OAKG;IACH,KAAK,CACH,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,OAAO,GAAG,IAAI,EACvB,KAAK,EAAE,CAAC,QAAQ,EAAE,KAAK,KAAK,IAAI,GAC/B,OAAO,CAAC;IACX,2DAA2D;IAC3D,MAAM,IAAI,IAAI,CAAC;IACf;;;OAGG;IACH,mBAAmB,IAAI,OAAO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;;;;OAMG;IACH,kBAAkB,EAAE,MAAM,OAAO,CAAC;IAElC;;;;OAIG;IACH,kBAAkB,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IAElD;;;;;;OAMG;IACH,iBAAiB,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,OAAO,CAAC;IAEpD,gFAAgF;IAChF,YAAY,EAAE,MAAM,IAAI,CAAC;CAC1B;AAED;;;;;GAKG;AACH,MAAM,WAAW,6BAA8B,SAAQ,qBAAqB;IAC1E;;;;OAIG;IACH,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAC9B;;;OAGG;IACH,SAAS,EAAE,CAAC,QAAQ,EAAE,KAAK,GAAG,IAAI,KAAK,IAAI,CAAC;CAC7C;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,sBAAsB,GAC9B,qBAAqB,CASvB;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,sBAAsB;AAC/B;;;;GAIG;AACH,gBAAgB,CAAC,EAAE,MAAM,IAAI;AAC7B;;;;GAIG;AACH,qBAAqB,UAAQ,GAC5B,6BAA6B,CA0N/B"}
|
|
@@ -49,6 +49,8 @@ import { currentGesture } from "./gestureCounter.js";
|
|
|
49
49
|
import { noteOutsideDismissal } from "./outsidePress.js";
|
|
50
50
|
import { innermostInteractive, matchesInteractiveSelectors } from "../hooks/useClickableContainer.js";
|
|
51
51
|
import { isDisabledControl } from "../utils/pressDisabled.js";
|
|
52
|
+
import { isElement, isHTMLElement } from "../utils/nodeType.js";
|
|
53
|
+
import { findTextEntryControl } from "../keyboard/keyboardHeight.js";
|
|
52
54
|
import { isTextEntrySincePointer, useInteractionModalityTrackingFor } from "../utils/interactionModality.js";
|
|
53
55
|
|
|
54
56
|
/**
|
|
@@ -80,6 +82,7 @@ export function useTapRecognizer() {
|
|
|
80
82
|
}
|
|
81
83
|
function createTapRecognizer() {
|
|
82
84
|
let stopWaiting = null;
|
|
85
|
+
let waitingGesture = null;
|
|
83
86
|
const forget = () => {
|
|
84
87
|
stopWaiting?.();
|
|
85
88
|
stopWaiting = null;
|
|
@@ -97,6 +100,7 @@ function createTapRecognizer() {
|
|
|
97
100
|
// advances the gesture, so a keyboard activation that later fires
|
|
98
101
|
// `click` on the trigger (Enter on a button) is not mistaken for it.
|
|
99
102
|
const gesture = currentGesture();
|
|
103
|
+
waitingGesture = gesture;
|
|
100
104
|
const stop = () => {
|
|
101
105
|
trigger.removeEventListener('click', handleTap);
|
|
102
106
|
trigger.removeEventListener('pointercancel', stop);
|
|
@@ -115,7 +119,8 @@ function createTapRecognizer() {
|
|
|
115
119
|
stopWaiting = stop;
|
|
116
120
|
return true;
|
|
117
121
|
},
|
|
118
|
-
forget
|
|
122
|
+
forget,
|
|
123
|
+
isTouchPressCurrent: () => stopWaiting != null && waitingGesture === currentGesture()
|
|
119
124
|
};
|
|
120
125
|
}
|
|
121
126
|
export function useTapStop(event) {
|
|
@@ -277,7 +282,13 @@ export function useTouchTriggerInternal(options,
|
|
|
277
282
|
* pointer lifted inside the layer: the layer stays open, and useTooltip
|
|
278
283
|
* ends a hold that the press started.
|
|
279
284
|
*/
|
|
280
|
-
onReleaseInLayer
|
|
285
|
+
onReleaseInLayer,
|
|
286
|
+
/**
|
|
287
|
+
* Whether a tap on a text-entry control inside the trigger only focuses
|
|
288
|
+
* that control, so no tooltip covers text the person starts to type. Only
|
|
289
|
+
* useTooltip passes it.
|
|
290
|
+
*/
|
|
291
|
+
isTextEntryTapIgnored = false) {
|
|
281
292
|
const {
|
|
282
293
|
touchTrigger,
|
|
283
294
|
isEnabled,
|
|
@@ -385,9 +396,17 @@ onReleaseInLayer) {
|
|
|
385
396
|
const answerTapRef = useRef(() => {});
|
|
386
397
|
answerTapRef.current = tapEvent => {
|
|
387
398
|
const trigger = triggerRef.current;
|
|
399
|
+
const tapped = isElement(tapEvent?.target) ? tapEvent.target : null;
|
|
400
|
+
// A disabled field keeps its reason's tap, and a trigger that is itself
|
|
401
|
+
// a field keeps its own tap.
|
|
402
|
+
if (isTextEntryTapIgnored && tapped != null && isHTMLElement(trigger)) {
|
|
403
|
+
const field = findTextEntryControl(tapped, trigger);
|
|
404
|
+
if (field != null && field !== trigger && !tapLandsOnDisabledControl(tapped)) {
|
|
405
|
+
return;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
388
408
|
// A tap that landed in a disabled control is that control's: its reason
|
|
389
409
|
// opens. Every other tap is the trigger's to decide.
|
|
390
|
-
const tapped = tapEvent?.target instanceof Element ? tapEvent.target : null;
|
|
391
410
|
const mode = touchTrigger === 'auto' ? tapped != null && tapLandsOnDisabledControl(tapped) ? 'tap' : trigger != null && isActionTrigger(trigger) ? 'none' : 'tap' : touchTrigger;
|
|
392
411
|
if (mode === 'none' || !isEnabled) {
|
|
393
412
|
// A layer left open by an earlier tap must not survive the next one.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useScrollSpy.d.ts","sourceRoot":"","sources":["../../src/Outline/useScrollSpy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useScrollSpy.d.ts","sourceRoot":"","sources":["../../src/Outline/useScrollSpy.ts"],"names":[],"mappings":"AAuCA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,SAAS,CAAC;AA8HzC,UAAU,mBAAmB;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,gBAAgB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAC7C;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,6EAA6E;IAC7E,kBAAkB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACzD,8EAA8E;IAC9E,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,iEAAiE;IACjE,eAAe,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,6EAA6E;IAC7E,aAAa,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC;AAED,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,+EAA+E;IAC/E,WAAW,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC;;;;;;;;;;;;OAYG;IACH,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC;CACnC;AAED,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,KAAK,EACL,gBAAgB,EAChB,OAAO,EACP,MAAU,EACV,kBAAkB,EAClB,gBAAuB,EACvB,eAAe,EACf,aAAa,GACd,EAAE,mBAAmB,GAAG,kBAAkB,CAsN1C"}
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
* SYNC: When modified, update /packages/core/src/Outline/Outline.tsx
|
|
35
35
|
*/
|
|
36
36
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
37
|
+
import { useCommittedRef } from "../hooks/useCommittedRef.js";
|
|
37
38
|
import { scrollingAncestor } from "../utils/scrollingAncestor.js";
|
|
38
39
|
/**
|
|
39
40
|
* How long to wait for a programmatic smooth scroll to settle when the
|
|
@@ -105,17 +106,17 @@ function scrollToTarget(target, scrollRoot, scrollTarget, offset) {
|
|
|
105
106
|
* one (headings are in document order). When none have passed (scrolled above
|
|
106
107
|
* the first), the first item is active; at the bottom, the last item is active.
|
|
107
108
|
*/
|
|
108
|
-
function resolveActiveId(
|
|
109
|
-
if (
|
|
109
|
+
function resolveActiveId(ids, scrollRoot, offset) {
|
|
110
|
+
if (ids.length === 0) {
|
|
110
111
|
return undefined;
|
|
111
112
|
}
|
|
112
113
|
const atBottom = scrollRoot != null ? scrollRoot.scrollTop + scrollRoot.clientHeight >= scrollRoot.scrollHeight - 2 : window.innerHeight + window.scrollY >= document.documentElement.scrollHeight - 2;
|
|
113
114
|
if (atBottom) {
|
|
114
|
-
return
|
|
115
|
+
return ids[ids.length - 1];
|
|
115
116
|
}
|
|
116
|
-
let activeId =
|
|
117
|
-
for (const
|
|
118
|
-
const element = document.getElementById(
|
|
117
|
+
let activeId = ids[0];
|
|
118
|
+
for (const id of ids) {
|
|
119
|
+
const element = document.getElementById(id);
|
|
119
120
|
if (element == null) {
|
|
120
121
|
continue;
|
|
121
122
|
}
|
|
@@ -123,7 +124,7 @@ function resolveActiveId(items, scrollRoot, offset) {
|
|
|
123
124
|
// 1px of tolerance absorbs sub-pixel rounding after a scroll lands.
|
|
124
125
|
const top = element.getBoundingClientRect().top;
|
|
125
126
|
if (top <= getRestingTop(element, scrollRoot, offset) + 1) {
|
|
126
|
-
activeId =
|
|
127
|
+
activeId = id;
|
|
127
128
|
} else {
|
|
128
129
|
break;
|
|
129
130
|
}
|
|
@@ -143,7 +144,10 @@ export function useScrollSpy({
|
|
|
143
144
|
}) {
|
|
144
145
|
const isControlled = activeId !== undefined;
|
|
145
146
|
const [uncontrolledActiveId, setUncontrolledActiveId] = useState(items[0]?.id);
|
|
146
|
-
|
|
147
|
+
// The uncontrolled active item, for the scroll listener's comparison. It
|
|
148
|
+
// starts as the state does, and every handler that sets the uncontrolled
|
|
149
|
+
// state writes it too.
|
|
150
|
+
const activeIdRef = useRef(uncontrolledActiveId);
|
|
147
151
|
// While true, scroll-spy ignores scroll updates because a navigation is
|
|
148
152
|
// driving a programmatic scroll. Released when it settles or the user scrolls.
|
|
149
153
|
const suppressRef = useRef(false);
|
|
@@ -152,14 +156,12 @@ export function useScrollSpy({
|
|
|
152
156
|
// Latest scroll-position resolver, so a navigation can resume tracking when
|
|
153
157
|
// the user scrolls during the programmatic scroll.
|
|
154
158
|
const syncRef = useRef(null);
|
|
155
|
-
//
|
|
156
|
-
//
|
|
157
|
-
const
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
const itemIds = items.map(item => item.id).join('\n');
|
|
162
|
-
activeIdRef.current = isControlled ? activeId : uncontrolledActiveId;
|
|
159
|
+
// The scroll listener reads the callback through this ref, so it does not
|
|
160
|
+
// subscribe again on each render.
|
|
161
|
+
const onActiveIdChangeRef = useCommittedRef(onActiveIdChange);
|
|
162
|
+
// Items is a new array each render. The scroll listener subscribes with
|
|
163
|
+
// their ids, and subscribes again only when the ids change.
|
|
164
|
+
const itemIds = JSON.stringify(items.map(item => item.id));
|
|
163
165
|
|
|
164
166
|
/**
|
|
165
167
|
* The element whose scroll position drives the outline: the explicit
|
|
@@ -178,13 +180,14 @@ export function useScrollSpy({
|
|
|
178
180
|
}
|
|
179
181
|
const scrollRoot = getScrollRoot();
|
|
180
182
|
const scrollTarget = scrollRoot ?? window;
|
|
183
|
+
const ids = JSON.parse(itemIds);
|
|
181
184
|
let frame = 0;
|
|
182
185
|
const update = () => {
|
|
183
186
|
frame = 0;
|
|
184
187
|
if (suppressRef.current) {
|
|
185
188
|
return;
|
|
186
189
|
}
|
|
187
|
-
const nextActiveId = resolveActiveId(
|
|
190
|
+
const nextActiveId = resolveActiveId(ids, scrollRoot, offset);
|
|
188
191
|
if (nextActiveId != null && nextActiveId !== activeIdRef.current) {
|
|
189
192
|
activeIdRef.current = nextActiveId;
|
|
190
193
|
setUncontrolledActiveId(nextActiveId);
|
|
@@ -212,7 +215,7 @@ export function useScrollSpy({
|
|
|
212
215
|
cancelAnimationFrame(frame);
|
|
213
216
|
}
|
|
214
217
|
};
|
|
215
|
-
}, [isControlled, itemIds, offset, getScrollRoot]);
|
|
218
|
+
}, [isControlled, itemIds, offset, getScrollRoot, onActiveIdChangeRef]);
|
|
216
219
|
|
|
217
220
|
// Tear down any in-flight navigation's listeners when the Outline unmounts.
|
|
218
221
|
useEffect(() => {
|
|
@@ -222,6 +225,7 @@ export function useScrollSpy({
|
|
|
222
225
|
}, []);
|
|
223
226
|
const setActiveId = nextActiveId => {
|
|
224
227
|
if (!isControlled) {
|
|
228
|
+
activeIdRef.current = nextActiveId;
|
|
225
229
|
setUncontrolledActiveId(nextActiveId);
|
|
226
230
|
}
|
|
227
231
|
onActiveIdChange?.(nextActiveId);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioListItem.d.ts","sourceRoot":"","sources":["../../src/RadioList/RadioListItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,EAAqB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAGhE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAiB5C,OAAO,EAAO,KAAK,SAAS,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"RadioListItem.d.ts","sourceRoot":"","sources":["../../src/RadioList/RadioListItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,EAAqB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAGhE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAiB5C,OAAO,EAAO,KAAK,SAAS,EAAC,MAAM,cAAc,CAAC;AA2GlD,MAAM,WAAW,kBAAmB,SAAQ,SAAS,CAAC,cAAc,CAAC;IACnE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;;;;OAKG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;;;;;;;;OAUG;IACH,KAAK,EAAE,SAAS,CAAC;IACjB;;;;;;;;;;;;;;OAcG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;OAEG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAAC,EAC5B,GAAG,EACH,KAAK,EACL,YAAY,EAAE,SAAS,EACvB,KAAK,EACL,WAAW,EACX,UAAU,EAAE,cAAsB,EAClC,YAAY,EACZ,UAAU,EACV,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,OAAO,EACP,GAAG,IAAI,EACR,EAAE,kBAAkB,qBAoMpB;yBAnNe,aAAa"}
|
|
@@ -23,11 +23,10 @@ import { RadioListContext } from "./RadioList.js";
|
|
|
23
23
|
import { RadioListReasonContext } from "./RadioListReasonContext.js";
|
|
24
24
|
import { joinAriaIDs } from "../utils/inputAria.js";
|
|
25
25
|
import "../theme/tokens.stylex.js";
|
|
26
|
-
import {
|
|
26
|
+
import { radiusVars } from "../theme/tokens.stylex.js";
|
|
27
27
|
import { isRenderable } from "../utils/isRenderable.js";
|
|
28
28
|
import { mergeProps } from "../utils/mergeProps.js";
|
|
29
29
|
import { rtlStyles } from "../utils/rtlStyles.js";
|
|
30
|
-
import "../Indicator/indicator.markers.stylex.js";
|
|
31
30
|
import { indicatorScope } from "../Indicator/indicator.markers.stylex.js";
|
|
32
31
|
import { useIndicatorFocusRing } from "../hooks/useIndicatorFocusRing.js";
|
|
33
32
|
import { usePressFeedback } from "../hooks/usePressFeedback.js";
|
|
@@ -39,36 +38,16 @@ import { touchHitAreaStyles } from "../internal/touchHitArea.stylex.js";
|
|
|
39
38
|
import { useIndicator } from "../Indicator/useIndicator.js";
|
|
40
39
|
import { Item } from "../Item/Item.js";
|
|
41
40
|
import { themeProps } from "../utils/themeProps.js";
|
|
42
|
-
import { rowPressLayerStyles } from "../privateAttributes/press.stylex.js";
|
|
41
|
+
import { indicatorPressPaintStyles, rowPressLayerStyles, rowPressPaintStyles } from "../privateAttributes/press.stylex.js";
|
|
43
42
|
|
|
44
43
|
// Registered here, not in the press controller, so a page with no box carries
|
|
45
44
|
// none of its code.
|
|
46
45
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
47
46
|
registerBoxHold();
|
|
48
47
|
|
|
49
|
-
// The touch press's paint, declared by the shared overlay styles on the
|
|
50
|
-
// element the controller writes to (`pressedAlpha`) at the press's strength,
|
|
51
|
-
// 1 while on and 1 → 0 over the release, and inherited resolved by the layer
|
|
52
|
-
// that paints it. See interactionOverlay.stylex.ts.
|
|
53
|
-
const pressedOverlayImage = 'var(--_press-paint-image)';
|
|
54
|
-
|
|
55
|
-
/** Written by the press controller while the row is pressed. */
|
|
56
|
-
const PRESSED_ON = '[data-astryx-press="on"]';
|
|
57
|
-
/** Written by the press controller for the press's release. */
|
|
58
|
-
const PRESSED_FADING = '[data-astryx-press="fading"]';
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* The nested controls that keep their own press, each at `:active`. It is
|
|
62
|
-
* INTERACTIVE_SELECTORS (hooks/useClickableContainer.ts), which StyleX cannot
|
|
63
|
-
* import, less the read-only ones. The row's own radio is the row's action,
|
|
64
|
-
* so its press is the row's. CSS cannot tell it from a nested radio input, so
|
|
65
|
-
* a nested one presses the circle too. RadioListItem.press.source-build.test.mjs
|
|
66
|
-
* keeps the two lists equal.
|
|
67
|
-
*/
|
|
68
|
-
const NESTED_CONTROL_ACTIVE = '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';
|
|
69
|
-
|
|
70
48
|
// The paint of a press the controller does not paint, declared on the row
|
|
71
|
-
// and inherited by the layer over the circle.
|
|
49
|
+
// (`rowPressPaintStyles.radioRow`) and inherited by the layer over the circle.
|
|
50
|
+
// Internal: not a theme hook.
|
|
72
51
|
const ROW_PRESS = '--_radio-row-press';
|
|
73
52
|
const styles = {
|
|
74
53
|
radioWrapper: {
|
|
@@ -87,7 +66,6 @@ const styles = {
|
|
|
87
66
|
kUfP38: "xq94oqs",
|
|
88
67
|
kloYau: "x2q1x1w",
|
|
89
68
|
ks3ayO: "xnbhnmn",
|
|
90
|
-
kNctxI: "x178sc5r x1d4iov5",
|
|
91
69
|
$$css: true
|
|
92
70
|
},
|
|
93
71
|
input: {
|
|
@@ -130,10 +108,6 @@ const rowStyles = {
|
|
|
130
108
|
k7Eaqz: "xeuugli",
|
|
131
109
|
kWkggS: "xjbqb8w",
|
|
132
110
|
$$css: true
|
|
133
|
-
},
|
|
134
|
-
press: {
|
|
135
|
-
"--_radio-row-press": "x19rtxe xkwazwr",
|
|
136
|
-
$$css: true
|
|
137
111
|
}
|
|
138
112
|
};
|
|
139
113
|
/**
|
|
@@ -219,7 +193,7 @@ export function RadioListItem({
|
|
|
219
193
|
const mergedRowRef = useMergedRefs(ref, watchRowHitArea);
|
|
220
194
|
const radioCircle = /*#__PURE__*/_jsxs("div", {
|
|
221
195
|
...(isDisabled ? undefined : pressBoxProps),
|
|
222
|
-
...stylex.props(styles.radioWrapper, wrapperSizeStyles[size], !isDisabled && styles.indicatorPressOverlay),
|
|
196
|
+
...stylex.props(styles.radioWrapper, wrapperSizeStyles[size], !isDisabled && styles.indicatorPressOverlay, !isDisabled && indicatorPressPaintStyles.image),
|
|
223
197
|
...focusProps,
|
|
224
198
|
children: [/*#__PURE__*/_jsx("input", {
|
|
225
199
|
ref: radioRef,
|
|
@@ -315,7 +289,7 @@ export function RadioListItem({
|
|
|
315
289
|
// interactive hover/press background. Applied after Item's own base
|
|
316
290
|
// styles so it wins within the base layer; a `radio-list-item` theme
|
|
317
291
|
// still overrides it from the higher `astryx-theme` layer.
|
|
318
|
-
rowStyles.root, !isDisabled &&
|
|
292
|
+
rowStyles.root, !isDisabled && rowPressPaintStyles.radioRow, !isDisabled && touchHitAreaStyles.layer, xstyle],
|
|
319
293
|
...mergeProps(
|
|
320
294
|
// One target for every row, carrying its size and runtime state so a
|
|
321
295
|
// theme can express "selected option at large" or restyle disabled
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResizeHandle.d.ts","sourceRoot":"","sources":["../../src/Resizable/ResizeHandle.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAiB,SAAS,EAAC,MAAM,OAAO,CAAC;AAErD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAU5C,OAAO,EAKL,KAAK,cAAc,EACnB,KAAK,eAAe,EACrB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"ResizeHandle.d.ts","sourceRoot":"","sources":["../../src/Resizable/ResizeHandle.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAiB,SAAS,EAAC,MAAM,OAAO,CAAC;AAErD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAU5C,OAAO,EAKL,KAAK,cAAc,EACnB,KAAK,eAAe,EACrB,MAAM,gBAAgB,CAAC;AA8BxB,KAAK,aAAa,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;AAkQzD,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAC7C,SAAS,CAAC,cAAc,CAAC,EACzB,OAAO,CACR;I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