Skip to content

Commit 1035fa2

Browse files
committed
Merge branch 'node-22' into node-22-real
2 parents 972c432 + 416f3e5 commit 1035fa2

File tree

70 files changed

+5137
-597
lines changed

Some content is hidden

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

70 files changed

+5137
-597
lines changed

.github/ISSUE_TEMPLATE/Bug_Report.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ body:
2424
id: current-behavior
2525
attributes:
2626
label: 😯 Current Behavior
27-
description: |
27+
description: |
2828
Tell us what happens instead of the expected behavior. Please include a link to the storybook if possible.
2929
If you are seeing an error, please include the full error message and stack trace.
3030
validations:
@@ -40,22 +40,23 @@ body:
4040
id: context
4141
attributes:
4242
label: 🔦 Context
43-
description: |
43+
description: |
4444
Providing context helps us come up with a solution that is most useful in the real world.
4545
How has this issue affected you? What are you trying to accomplish?
4646
validations:
4747
required: false
4848
- type: textarea
4949
id: base-reproduction
5050
attributes:
51-
label: 🖥️ Steps to Reproduce
52-
description: |
53-
Provide a minimal test case that can reproduce the problem. Include a CodeSandBox, link to sample repos, or specific doc examples to help us test your issue more easily.
51+
label: 🖥️ Steps to Reproduce
52+
description: |
53+
Provide a minimal test case that can reproduce the problem. Include a CodeSandBox, link to sample repos, or specific doc examples to help us test your issue more easily.
5454
5555
To get started, you can use the following CodeSandBox templates:
5656
For React Spectrum: https://codesandbox.io/s/react-spectrum-template-syueo
5757
For React Aria: https://codesandbox.io/s/react-aria-template-389r79
5858
For React Aria Components: https://codesandbox.io/s/react-aria-components-template-g7wmmk
59+
For React Spectrum S2 with Style Macros: https://codesandbox.io/p/devbox/react-spectrum-s2-style-macro-template-h6fpsq
5960
validations:
6061
required: true
6162
- type: markdown
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/buffer.d.ts b/buffer.d.ts
2+
index 5d6c97d6b5d47fd189f795498aefd6b8d7713b7d..b9a22c4634fa6308006ae17d3527ff3c518a789d 100644
3+
--- a/buffer.d.ts
4+
+++ b/buffer.d.ts
5+
@@ -629,7 +629,7 @@ declare module "buffer" {
6+
*/
7+
poolSize: number;
8+
}
9+
- interface Buffer extends Uint8Array {
10+
+ interface Buffer extends Uint8Array<ArrayBuffer> {
11+
/**
12+
* Writes `string` to `buf` at `offset` according to the character encoding in`encoding`. The `length` parameter is the number of bytes to write. If `buf` did
13+
* not contain enough space to fit the entire string, only part of `string` will be

examples/remix/app/root.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default function App() {
2828
<Links />
2929
</head>
3030
<body>
31-
<Provider
31+
<Provider
3232
theme={defaultTheme}
3333
locale="en"
3434
router={{
@@ -38,6 +38,12 @@ export default function App() {
3838
<Outlet />
3939
</Provider>
4040
<ScrollRestoration />
41+
{/* https://remix.run/docs/en/main/guides/envvars */}
42+
<script
43+
dangerouslySetInnerHTML={{
44+
__html: `window.process = {}; window.process.env = {};`,
45+
}}
46+
/>
4147
<Scripts />
4248
<LiveReload />
4349
</body>

examples/remix/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"react-dom": "^18.2.0"
2020
},
2121
"devDependencies": {
22+
"@react-aria/optimize-locales-plugin": "^1.1.4",
2223
"@remix-run/dev": "^2.3.1",
2324
"@remix-run/eslint-config": "^2.3.1",
2425
"@types/react": "^18",

examples/remix/vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { unstable_vitePlugin as remix } from "@remix-run/dev";
1+
import { vitePlugin as remix } from "@remix-run/dev";
22
import { defineConfig } from "vite";
33
import tsconfigPaths from "vite-tsconfig-paths";
44
import optimizeLocales from '@react-aria/optimize-locales-plugin';

lib/viewTransitions.d.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,3 @@
1313
interface Document {
1414
startViewTransition(update: (() => void) | {update: () => void, types: string[]}): ViewTransition;
1515
}
16-
17-
interface ViewTransition {
18-
ready: Promise<void>;
19-
finished: Promise<void>;
20-
}

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@
206206
"tailwindcss": "^4.0.0",
207207
"tailwindcss-animate": "^1.0.7",
208208
"tempy": "^0.5.0",
209-
"typescript": "^5.5.0",
209+
"typescript": "^5.8.2",
210210
"typescript-eslint": "^8.9.0",
211211
"verdaccio": "^6.0.0",
212212
"walk-object": "^4.0.0",
@@ -234,7 +234,10 @@
234234
"recast": "0.23.6",
235235
"ast-types": "0.16.1",
236236
"svgo": "^3",
237-
"@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"
237+
"@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",
238+
"@types/node@npm:*": "patch:@types/node@npm%3A20.14.13#~/.yarn/patches/@types-node-npm-20.14.13-41f92d384c.patch",
239+
"@types/node@npm:^18.0.0": "patch:@types/node@npm%3A20.14.13#~/.yarn/patches/@types-node-npm-20.14.13-41f92d384c.patch",
240+
"@types/node@npm:>= 8": "patch:@types/node@npm%3A20.14.13#~/.yarn/patches/@types-node-npm-20.14.13-41f92d384c.patch"
238241
},
239242
"@parcel/transformer-css": {
240243
"cssModules": {

packages/@react-aria/dnd/src/useDrop.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ export interface DropOptions {
3636
/**
3737
* Handler that is called after a valid drag is held over the drop target for a period of time.
3838
* This typically opens the item so that the user can drop within it.
39-
* @private
4039
*/
4140
onDropActivate?: (e: DropActivateEvent) => void,
4241
/** Handler that is called when a valid drag exits the drop target. */

packages/@react-aria/dnd/src/useDroppableCollection.ts

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import {
3030
DropTargetDelegate,
3131
Key,
3232
KeyboardDelegate,
33+
KeyboardEvents,
3334
Node,
3435
RefObject
3536
} from '@react-types/shared';
@@ -46,7 +47,8 @@ export interface DroppableCollectionOptions extends DroppableCollectionProps {
4647
/** A delegate object that implements behavior for keyboard focus movement. */
4748
keyboardDelegate: KeyboardDelegate,
4849
/** A delegate object that provides drop targets for pointer coordinates within the collection. */
49-
dropTargetDelegate: DropTargetDelegate
50+
dropTargetDelegate: DropTargetDelegate,
51+
onKeyDown?: KeyboardEvents['onKeyDown']
5052
}
5153

5254
export interface DroppableCollectionResult {
@@ -201,7 +203,7 @@ export function useDroppableCollection(props: DroppableCollectionOptions, state:
201203
autoScroll.stop();
202204
},
203205
onDropActivate(e) {
204-
if (state.target?.type === 'item' && state.target?.dropPosition === 'on' && typeof props.onDropActivate === 'function') {
206+
if (state.target?.type === 'item' && typeof props.onDropActivate === 'function') {
205207
props.onDropActivate({
206208
type: 'dropactivate',
207209
x: e.x, // todo
@@ -258,18 +260,25 @@ export function useDroppableCollection(props: DroppableCollectionOptions, state:
258260
// inserted item. If selection is disabled, then also show the focus ring so there
259261
// is some indication that items were added.
260262
if (state.selectionManager.focusedKey === prevFocusedKey) {
261-
let first = newKeys.keys().next().value;
262-
let item = state.collection.getItem(first);
263-
264-
// If this is a cell, focus the parent row.
265-
if (item?.type === 'cell') {
266-
first = item.parentKey;
267-
}
263+
let first: Key | null | undefined = newKeys.keys().next().value;
264+
if (first != null) {
265+
let item = state.collection.getItem(first);
266+
267+
// If this is a cell, focus the parent row.
268+
// eslint-disable-next-line max-depth
269+
if (item?.type === 'cell') {
270+
first = item.parentKey;
271+
}
268272

269-
state.selectionManager.setFocusedKey(first);
273+
// eslint-disable-next-line max-depth
274+
if (first != null) {
275+
state.selectionManager.setFocusedKey(first);
276+
}
270277

271-
if (state.selectionManager.selectionMode === 'none') {
272-
setInteractionModality('keyboard');
278+
// eslint-disable-next-line max-depth
279+
if (state.selectionManager.selectionMode === 'none') {
280+
setInteractionModality('keyboard');
281+
}
273282
}
274283
}
275284
} else if (
@@ -335,7 +344,7 @@ export function useDroppableCollection(props: DroppableCollectionOptions, state:
335344
}, 50);
336345
}, [localState, defaultOnDrop, ref, updateFocusAfterDrop]);
337346

338-
347+
339348
useEffect(() => {
340349
return () => {
341350
if (droppingState.current) {
@@ -741,6 +750,7 @@ export function useDroppableCollection(props: DroppableCollectionOptions, state:
741750
break;
742751
}
743752
}
753+
localState.props.onKeyDown?.(e as any);
744754
}
745755
});
746756
}, [localState, ref, onDrop, direction]);

packages/@react-aria/grid/src/useGridSelectionAnnouncement.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,20 +61,25 @@ export function useGridSelectionAnnouncement<T>(props: GridSelectionAnnouncement
6161
let messages: string[] = [];
6262

6363
if ((state.selectionManager.selectedKeys.size === 1 && isReplace)) {
64-
if (state.collection.getItem(state.selectionManager.selectedKeys.keys().next().value)) {
65-
let currentSelectionText = getRowText(state.selectionManager.selectedKeys.keys().next().value);
64+
let firstKey = state.selectionManager.selectedKeys.keys().next().value;
65+
if (firstKey != null && state.collection.getItem(firstKey)) {
66+
let currentSelectionText = getRowText(firstKey);
6667
if (currentSelectionText) {
6768
messages.push(stringFormatter.format('selectedItem', {item: currentSelectionText}));
6869
}
6970
}
7071
} else if (addedKeys.size === 1 && removedKeys.size === 0) {
71-
let addedText = getRowText(addedKeys.keys().next().value);
72-
if (addedText) {
73-
messages.push(stringFormatter.format('selectedItem', {item: addedText}));
72+
let firstKey = addedKeys.keys().next().value;
73+
if (firstKey != null) {
74+
let addedText = getRowText(firstKey);
75+
if (addedText) {
76+
messages.push(stringFormatter.format('selectedItem', {item: addedText}));
77+
}
7478
}
7579
} else if (removedKeys.size === 1 && addedKeys.size === 0) {
76-
if (state.collection.getItem(removedKeys.keys().next().value)) {
77-
let removedText = getRowText(removedKeys.keys().next().value);
80+
let firstKey = removedKeys.keys().next().value;
81+
if (firstKey != null && state.collection.getItem(firstKey)) {
82+
let removedText = getRowText(firstKey);
7883
if (removedText) {
7984
messages.push(stringFormatter.format('deselectedItem', {item: removedText}));
8085
}

0 commit comments

Comments
 (0)