Skip to content

Commit 2717e18

Browse files
committed
Merge branch 'main' into patch-9
# Conflicts: # packages/@react-aria/utils/src/useViewportSize.ts
2 parents 208559e + 953488a commit 2717e18

File tree

119 files changed

+1603
-578
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+1603
-578
lines changed

.circleci/config.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,25 @@ commands:
7777
--cache-control "public,max-age=31536000,immutable" \
7878
--exclude "*.html" --exclude "*.rsc" --exclude "*.txt" --exclude "*.json" --exclude "*.md" --exclude "*.xml"
7979
- run:
80-
name: Copy HTML and text files to S3
80+
name: Copy HTML and data files to S3
8181
command: |
8282
aws s3 cp /tmp/dist/s2-docs/<< parameters.dir >> << parameters.bucket >> --recursive \
8383
--cache-control "public,max-age=300,stale-while-revalidate=300" \
84-
--exclude "*" --include "*.html" --include "*.txt" --include "*.json" --include "*.md" --include "*.xml"
84+
--exclude "*" --include "*.html" --include "*.json" --include "*.xml"
85+
- run:
86+
name: Copy Markdown files to S3
87+
command: |
88+
aws s3 cp /tmp/dist/s2-docs/<< parameters.dir >> << parameters.bucket >> --recursive \
89+
--cache-control "public,max-age=300,stale-while-revalidate=300" \
90+
--content-type "text/markdown;charset=utf-8" \
91+
--exclude "*" --include "*.md"
92+
- run:
93+
name: Copy text files to S3
94+
command: |
95+
aws s3 cp /tmp/dist/s2-docs/<< parameters.dir >> << parameters.bucket >> --recursive \
96+
--cache-control "public,max-age=300,stale-while-revalidate=300" \
97+
--content-type "text/plain;charset=utf-8" \
98+
--exclude "*" --include "*.txt"
8599
- run:
86100
name: Copy RSC files to S3
87101
command: |

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ coverage
88
dist
99
junit.xml
1010
.yarn/install-state.gz
11+
yarn-error.log
1112
node_modules
1213
npm-debug.log
1314
public

eslint.config.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,10 @@ export default [{
361361
},
362362

363363
languageOptions: {
364+
globals: {
365+
globalThis: "readonly",
366+
},
367+
364368
parser: tseslint.parser,
365369
ecmaVersion: 6,
366370
sourceType: "module",

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@
99
},
1010
"packageManager": "[email protected]",
1111
"scripts": {
12-
"check-types": "tsc",
12+
"tsgo": "tsgo",
13+
"check-types": "tsgo --noEmit",
14+
"check-types:tsc": "tsc",
15+
"clean": "make clean",
16+
"clean:all": "make clean_all",
1317
"install-16": "node scripts/react-16-install-prep.mjs && yarn add react@^16.8.0 react-dom@^16.8.0 @testing-library/react@^12 @testing-library/react-hooks@^8 @testing-library/dom@^8 react-test-renderer@^16.9.0 && node scripts/oldReactSupport.mjs",
1418
"install-17": "node scripts/react-17-install-prep.mjs && yarn add react@^17 react-dom@^17 @testing-library/react@^12 @testing-library/react-hooks@^8 @testing-library/dom@^8 react-test-renderer@^16.9.0 && node scripts/oldReactSupport.mjs",
1519
"install-18": "node scripts/react-18-install-prep.mjs && yarn add react@^18 react-dom@^18 react-test-renderer@^18.3.1 && node scripts/oldReactSupport.mjs",
@@ -132,6 +136,7 @@
132136
"@testing-library/user-event": "patch:@testing-library/user-event@npm%3A14.6.1#~/.yarn/patches/@testing-library-user-event-npm-14.6.1-5da7e1d4e2.patch",
133137
"@types/react": "^19.0.0",
134138
"@types/react-dom": "^19.0.0",
139+
"@typescript/native-preview": "^7.0.0-dev.20251223.1",
135140
"@yarnpkg/types": "^4.0.0",
136141
"autoprefixer": "^9.6.0",
137142
"axe-playwright": "^1.1.11",

packages/@react-aria/calendar/src/useCalendarCell.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,13 @@ export function useCalendarCell(props: AriaCalendarCellProps, state: CalendarSta
338338
// outside the original pressed element.
339339
// (JSDOM does not support this)
340340
if ('releasePointerCapture' in e.target) {
341-
e.target.releasePointerCapture(e.pointerId);
341+
if ('hasPointerCapture' in e.target) {
342+
if (e.target.hasPointerCapture(e.pointerId)) {
343+
e.target.releasePointerCapture(e.pointerId);
344+
}
345+
} else {
346+
e.target.releasePointerCapture(e.pointerId);
347+
}
342348
}
343349
},
344350
onContextMenu(e) {

packages/@react-aria/collections/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"@react-aria/utils": "^3.32.0",
3232
"@react-types/shared": "^3.32.1",
3333
"@swc/helpers": "^0.5.0",
34-
"use-sync-external-store": "^1.4.0"
34+
"use-sync-external-store": "^1.6.0"
3535
},
3636
"peerDependencies": {
3737
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",

packages/@react-aria/combobox/src/useComboBox.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {AriaComboBoxProps} from '@react-types/combobox';
1616
import {ariaHideOutside} from '@react-aria/overlays';
1717
import {AriaListBoxOptions, getItemId, listData} from '@react-aria/listbox';
1818
import {BaseEvent, DOMAttributes, KeyboardDelegate, LayoutDelegate, PressEvent, RefObject, RouterOptions, ValidationResult} from '@react-types/shared';
19-
import {chain, getActiveElement, getOwnerDocument, isAppleDevice, mergeProps, useEvent, useLabels, useRouter, useUpdateEffect} from '@react-aria/utils';
19+
import {chain, getActiveElement, getOwnerDocument, isAppleDevice, mergeProps, useEvent, useFormReset, useLabels, useRouter, useUpdateEffect} from '@react-aria/utils';
2020
import {ComboBoxState} from '@react-stately/combobox';
2121
import {dispatchVirtualFocus} from '@react-aria/focus';
2222
import {FocusEvent, InputHTMLAttributes, KeyboardEvent, TouchEvent, useEffect, useMemo, useRef} from 'react';
@@ -220,6 +220,8 @@ export function useComboBox<T>(props: AriaComboBoxOptions<T>, state: ComboBoxSta
220220
[privateValidationStateProp]: state
221221
}, inputRef);
222222

223+
useFormReset(inputRef, state.defaultSelectedKey, state.setSelectedKey);
224+
223225
// Press handlers for the ComboBox button
224226
let onPress = (e: PressEvent) => {
225227
if (e.pointerType === 'touch') {

packages/@react-aria/interactions/src/usePress.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,13 @@ export function usePress(props: PressHookProps): PressResult {
596596
// This enables onPointerLeave and onPointerEnter to fire.
597597
let target = getEventTarget(e.nativeEvent);
598598
if ('releasePointerCapture' in target) {
599-
target.releasePointerCapture(e.pointerId);
599+
if ('hasPointerCapture' in target) {
600+
if (target.hasPointerCapture(e.pointerId)) {
601+
target.releasePointerCapture(e.pointerId);
602+
}
603+
} else {
604+
(target as Element).releasePointerCapture(e.pointerId);
605+
}
600606
}
601607
}
602608

packages/@react-aria/interactions/test/usePress.test.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,8 +420,10 @@ describe('usePress', function () {
420420

421421
let el = res.getByText('test');
422422
el.releasePointerCapture = jest.fn();
423+
el.hasPointerCapture = jest.fn().mockReturnValue(true);
423424
fireEvent(el, pointerEvent('pointerdown', {pointerId: 1, pointerType: 'mouse', clientX: 0, clientY: 0}));
424-
expect(el.releasePointerCapture).toHaveBeenCalled();
425+
expect(el.hasPointerCapture).toHaveBeenCalledWith(1);
426+
expect(el.releasePointerCapture).toHaveBeenCalledWith(1);
425427
// react listens for pointerout and pointerover instead of pointerleave and pointerenter...
426428
fireEvent(el, pointerEvent('pointerout', {pointerId: 1, pointerType: 'mouse', clientX: 100, clientY: 100}));
427429
fireEvent(document, pointerEvent('pointerup', {pointerId: 1, pointerType: 'mouse', clientX: 100, clientY: 100}));
@@ -560,6 +562,16 @@ describe('usePress', function () {
560562
]);
561563
});
562564

565+
it('should not call releasePointerCapture when hasPointerCapture returns false', function () {
566+
let res = render(<Example />);
567+
let el = res.getByText('test');
568+
el.releasePointerCapture = jest.fn();
569+
el.hasPointerCapture = jest.fn().mockReturnValue(false);
570+
fireEvent(el, pointerEvent('pointerdown', {pointerId: 1, pointerType: 'mouse', clientX: 0, clientY: 0}));
571+
expect(el.hasPointerCapture).toHaveBeenCalledWith(1);
572+
expect(el.releasePointerCapture).not.toHaveBeenCalled();
573+
});
574+
563575
it('should handle pointer cancel events', function () {
564576
let events = [];
565577
let addEvent = (e) => events.push(e);
@@ -4011,8 +4023,10 @@ describe('usePress', function () {
40114023

40124024
const el = shadowRoot.getElementById('testElement');
40134025
el.releasePointerCapture = jest.fn();
4026+
el.hasPointerCapture = jest.fn().mockReturnValue(true);
40144027
fireEvent(el, pointerEvent('pointerdown', {pointerId: 1, pointerType: 'mouse', clientX: 0, clientY: 0}));
4015-
expect(el.releasePointerCapture).toHaveBeenCalled();
4028+
expect(el.hasPointerCapture).toHaveBeenCalledWith(1);
4029+
expect(el.releasePointerCapture).toHaveBeenCalledWith(1);
40164030
// react listens for pointerout and pointerover instead of pointerleave and pointerenter...
40174031
fireEvent(el, pointerEvent('pointerout', {pointerId: 1, pointerType: 'mouse', clientX: 100, clientY: 100}));
40184032
fireEvent(document, pointerEvent('pointerup', {pointerId: 1, pointerType: 'mouse', clientX: 100, clientY: 100}));

packages/@react-aria/landmark/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"@react-aria/utils": "^3.32.0",
3030
"@react-types/shared": "^3.32.1",
3131
"@swc/helpers": "^0.5.0",
32-
"use-sync-external-store": "^1.4.0"
32+
"use-sync-external-store": "^1.6.0"
3333
},
3434
"peerDependencies": {
3535
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",

0 commit comments

Comments
 (0)