parent
6fb83676e7
commit
f03d22fefa
8 changed files with 238 additions and 20 deletions
|
|
@ -21,6 +21,7 @@
|
|||
},
|
||||
"main": "dist-electron/main/index.cjs",
|
||||
"scripts": {
|
||||
"preinstall": "node ./scripts/ci/enforce-pnpm-install.mjs",
|
||||
"dev": "node ./scripts/dev-with-runtime.mjs",
|
||||
"dev:mcp": "node ./scripts/dev-with-runtime.mjs --remoteDebuggingPort 9222",
|
||||
"dev:kill": "node bin/kill-dev.js",
|
||||
|
|
@ -453,6 +454,8 @@
|
|||
"@radix-ui/react-dismissable-layer@1.1.11": "patches/@radix-ui__react-dismissable-layer@1.1.11.patch",
|
||||
"@radix-ui/react-popper@1.2.8": "patches/@radix-ui__react-popper@1.2.8.patch",
|
||||
"@radix-ui/react-select@2.2.6": "patches/@radix-ui__react-select@2.2.6.patch",
|
||||
"@radix-ui/react-slot@1.2.3": "patches/@radix-ui__react-slot@1.2.3.patch",
|
||||
"@radix-ui/react-slot@1.2.4": "patches/@radix-ui__react-slot@1.2.4.patch",
|
||||
"@radix-ui/react-tooltip@1.2.8": "patches/@radix-ui__react-tooltip@1.2.8.patch",
|
||||
"@radix-ui/react-menu@2.1.16": "patches/@radix-ui__react-menu@2.1.16.patch",
|
||||
"@radix-ui/react-checkbox@1.3.3": "patches/@radix-ui__react-checkbox@1.3.3.patch"
|
||||
|
|
|
|||
|
|
@ -126,17 +126,51 @@ index dc37ac4a018a086c4244a09a67215dbaa9b4de65..fc80522666f91087ce1bce3a34844b17
|
|||
style: {
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
@@ -971,9 +1002,10 @@ var SelectItemText = React.forwardRef(
|
||||
@@ -864,10 +895,15 @@ var SelectItem = React.forwardRef(
|
||||
const contentContext = useSelectContentContext(ITEM_NAME, __scopeSelect);
|
||||
const isSelected = context.value === value;
|
||||
const [textValue, setTextValue] = React.useState(textValueProp ?? "");
|
||||
+ const textValueRef = React.useRef(textValueProp ?? "");
|
||||
const [isFocused, setIsFocused] = React.useState(false);
|
||||
+ const itemRefCallback = React.useCallback(
|
||||
+ (node) => contentContext.itemRefCallback?.(node, value, disabled),
|
||||
+ [contentContext.itemRefCallback, value, disabled]
|
||||
+ );
|
||||
const composedRefs = (0, import_react_compose_refs.useComposedRefs)(
|
||||
forwardedRef,
|
||||
- (node) => contentContext.itemRefCallback?.(node, value, disabled)
|
||||
+ itemRefCallback
|
||||
);
|
||||
const textId = (0, import_react_id.useId)();
|
||||
const pointerTypeRef = React.useRef("touch");
|
||||
@@ -893,7 +931,10 @@ var SelectItem = React.forwardRef(
|
||||
textId,
|
||||
isSelected,
|
||||
onItemTextChange: React.useCallback((node) => {
|
||||
- setTextValue((prevTextValue) => prevTextValue || (node?.textContent ?? "").trim());
|
||||
+ const nextTextValue = (node?.textContent ?? "").trim();
|
||||
+ if (!nextTextValue || textValueRef.current) return;
|
||||
+ textValueRef.current = nextTextValue;
|
||||
+ setTextValue(nextTextValue);
|
||||
}, []),
|
||||
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
||||
Collection.ItemSlot,
|
||||
@@ -971,9 +1013,14 @@ var SelectItemText = React.forwardRef(
|
||||
const itemContext = useSelectItemContext(ITEM_TEXT_NAME, __scopeSelect);
|
||||
const nativeOptionsContext = useSelectNativeOptionsContext(ITEM_TEXT_NAME, __scopeSelect);
|
||||
const [itemTextNode, setItemTextNode] = React.useState(null);
|
||||
+ const setItemTextNodeRef = useGuardedNodeSetter(setItemTextNode);
|
||||
+ const itemTextRefCallback = React.useCallback(
|
||||
+ (node) => contentContext.itemTextRefCallback?.(node, itemContext.value, itemContext.disabled),
|
||||
+ [contentContext.itemTextRefCallback, itemContext.value, itemContext.disabled]
|
||||
+ );
|
||||
const composedRefs = (0, import_react_compose_refs.useComposedRefs)(
|
||||
forwardedRef,
|
||||
- (node) => setItemTextNode(node),
|
||||
+ setItemTextNodeRef,
|
||||
itemContext.onItemTextChange,
|
||||
(node) => contentContext.itemTextRefCallback?.(node, itemContext.value, itemContext.disabled)
|
||||
- (node) => contentContext.itemTextRefCallback?.(node, itemContext.value, itemContext.disabled)
|
||||
+ itemTextRefCallback
|
||||
);
|
||||
diff --git a/dist/index.mjs b/dist/index.mjs
|
||||
index f9b94f39dfddef678ef3086354f8d7413ae27e52..4a53ec0d65aa051b95e3e8ea4aff4fdd52a17406 100644
|
||||
|
|
@ -266,15 +300,49 @@ index f9b94f39dfddef678ef3086354f8d7413ae27e52..4a53ec0d65aa051b95e3e8ea4aff4fdd
|
|||
style: {
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
@@ -904,9 +935,10 @@ var SelectItemText = React.forwardRef(
|
||||
@@ -797,10 +828,15 @@ var SelectItem = React.forwardRef(
|
||||
const contentContext = useSelectContentContext(ITEM_NAME, __scopeSelect);
|
||||
const isSelected = context.value === value;
|
||||
const [textValue, setTextValue] = React.useState(textValueProp ?? "");
|
||||
+ const textValueRef = React.useRef(textValueProp ?? "");
|
||||
const [isFocused, setIsFocused] = React.useState(false);
|
||||
+ const itemRefCallback = React.useCallback(
|
||||
+ (node) => contentContext.itemRefCallback?.(node, value, disabled),
|
||||
+ [contentContext.itemRefCallback, value, disabled]
|
||||
+ );
|
||||
const composedRefs = useComposedRefs(
|
||||
forwardedRef,
|
||||
- (node) => contentContext.itemRefCallback?.(node, value, disabled)
|
||||
+ itemRefCallback
|
||||
);
|
||||
const textId = useId();
|
||||
const pointerTypeRef = React.useRef("touch");
|
||||
@@ -826,7 +864,10 @@ var SelectItem = React.forwardRef(
|
||||
textId,
|
||||
isSelected,
|
||||
onItemTextChange: React.useCallback((node) => {
|
||||
- setTextValue((prevTextValue) => prevTextValue || (node?.textContent ?? "").trim());
|
||||
+ const nextTextValue = (node?.textContent ?? "").trim();
|
||||
+ if (!nextTextValue || textValueRef.current) return;
|
||||
+ textValueRef.current = nextTextValue;
|
||||
+ setTextValue(nextTextValue);
|
||||
}, []),
|
||||
children: /* @__PURE__ */ jsx(
|
||||
Collection.ItemSlot,
|
||||
@@ -904,9 +946,14 @@ var SelectItemText = React.forwardRef(
|
||||
const itemContext = useSelectItemContext(ITEM_TEXT_NAME, __scopeSelect);
|
||||
const nativeOptionsContext = useSelectNativeOptionsContext(ITEM_TEXT_NAME, __scopeSelect);
|
||||
const [itemTextNode, setItemTextNode] = React.useState(null);
|
||||
+ const setItemTextNodeRef = useGuardedNodeSetter(setItemTextNode);
|
||||
+ const itemTextRefCallback = React.useCallback(
|
||||
+ (node) => contentContext.itemTextRefCallback?.(node, itemContext.value, itemContext.disabled),
|
||||
+ [contentContext.itemTextRefCallback, itemContext.value, itemContext.disabled]
|
||||
+ );
|
||||
const composedRefs = useComposedRefs(
|
||||
forwardedRef,
|
||||
- (node) => setItemTextNode(node),
|
||||
+ setItemTextNodeRef,
|
||||
itemContext.onItemTextChange,
|
||||
(node) => contentContext.itemTextRefCallback?.(node, itemContext.value, itemContext.disabled)
|
||||
- (node) => contentContext.itemTextRefCallback?.(node, itemContext.value, itemContext.disabled)
|
||||
+ itemTextRefCallback
|
||||
);
|
||||
|
|
|
|||
44
patches/@radix-ui__react-slot@1.2.3.patch
Normal file
44
patches/@radix-ui__react-slot@1.2.3.patch
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
diff --git a/dist/index.js b/dist/index.js
|
||||
index 6a29e17b2246048ddb3da22732e2c81517bf81da..cecc799949dbbe10ba98d587fdad5d3a9e1d8cf1 100644
|
||||
--- a/dist/index.js
|
||||
+++ b/dist/index.js
|
||||
@@ -70,11 +70,15 @@ var Slot = /* @__PURE__ */ createSlot("Slot");
|
||||
function createSlotClone(ownerName) {
|
||||
const SlotClone = React.forwardRef((props, forwardedRef) => {
|
||||
const { children, ...slotProps } = props;
|
||||
+ const childrenRef = React.isValidElement(children) ? getElementRef(children) : null;
|
||||
+ const composedRef = React.useMemo(
|
||||
+ () => forwardedRef && childrenRef ? (0, import_react_compose_refs.composeRefs)(forwardedRef, childrenRef) : forwardedRef || childrenRef || null,
|
||||
+ [forwardedRef, childrenRef]
|
||||
+ );
|
||||
if (React.isValidElement(children)) {
|
||||
- const childrenRef = getElementRef(children);
|
||||
const props2 = mergeProps(slotProps, children.props);
|
||||
if (children.type !== React.Fragment) {
|
||||
- props2.ref = forwardedRef ? (0, import_react_compose_refs.composeRefs)(forwardedRef, childrenRef) : childrenRef;
|
||||
+ props2.ref = composedRef;
|
||||
}
|
||||
return React.cloneElement(children, props2);
|
||||
}
|
||||
diff --git a/dist/index.mjs b/dist/index.mjs
|
||||
index 0d5bcb5df0a670f429c157c5354c7b0499e9a599..4b4cbbf55bdfb4ee3f2a91aa02ff1ffef51d98cf 100644
|
||||
--- a/dist/index.mjs
|
||||
+++ b/dist/index.mjs
|
||||
@@ -30,11 +30,15 @@ var Slot = /* @__PURE__ */ createSlot("Slot");
|
||||
function createSlotClone(ownerName) {
|
||||
const SlotClone = React.forwardRef((props, forwardedRef) => {
|
||||
const { children, ...slotProps } = props;
|
||||
+ const childrenRef = React.isValidElement(children) ? getElementRef(children) : null;
|
||||
+ const composedRef = React.useMemo(
|
||||
+ () => forwardedRef && childrenRef ? composeRefs(forwardedRef, childrenRef) : forwardedRef || childrenRef || null,
|
||||
+ [forwardedRef, childrenRef]
|
||||
+ );
|
||||
if (React.isValidElement(children)) {
|
||||
- const childrenRef = getElementRef(children);
|
||||
const props2 = mergeProps(slotProps, children.props);
|
||||
if (children.type !== React.Fragment) {
|
||||
- props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
||||
+ props2.ref = composedRef;
|
||||
}
|
||||
return React.cloneElement(children, props2);
|
||||
}
|
||||
48
patches/@radix-ui__react-slot@1.2.4.patch
Normal file
48
patches/@radix-ui__react-slot@1.2.4.patch
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
diff --git a/dist/index.js b/dist/index.js
|
||||
index 997ad803d345479c6afedb38fbfa4fed36dbb69f..e3845eab81088ac07f86ce0758f8fbb51bf20f7e 100644
|
||||
--- a/dist/index.js
|
||||
+++ b/dist/index.js
|
||||
@@ -87,13 +87,17 @@ function createSlotClone(ownerName) {
|
||||
if (isLazyComponent(children) && typeof use === "function") {
|
||||
children = use(children._payload);
|
||||
}
|
||||
+ const childrenRef = React.isValidElement(children) ? getElementRef(children) : null;
|
||||
+ const composedRef = React.useMemo(
|
||||
+ () => forwardedRef && childrenRef ? (0, import_react_compose_refs.composeRefs)(forwardedRef, childrenRef) : forwardedRef || childrenRef || null,
|
||||
+ [forwardedRef, childrenRef]
|
||||
+ );
|
||||
if (React.isValidElement(children)) {
|
||||
- const childrenRef = getElementRef(children);
|
||||
const props2 = mergeProps(slotProps, children.props);
|
||||
if (children.type !== React.Fragment) {
|
||||
- props2.ref = forwardedRef ? (0, import_react_compose_refs.composeRefs)(forwardedRef, childrenRef) : childrenRef;
|
||||
+ props2.ref = composedRef;
|
||||
}
|
||||
return React.cloneElement(children, props2);
|
||||
}
|
||||
return React.Children.count(children) > 1 ? React.Children.only(null) : null;
|
||||
});
|
||||
diff --git a/dist/index.mjs b/dist/index.mjs
|
||||
index 6365c8003f76c8a41351ddc65a4e84ad8b6bf0d1..3e6146372c27ae6dc1a628264e49910b9f41f3f7 100644
|
||||
--- a/dist/index.mjs
|
||||
+++ b/dist/index.mjs
|
||||
@@ -46,13 +46,17 @@ function createSlotClone(ownerName) {
|
||||
if (isLazyComponent(children) && typeof use === "function") {
|
||||
children = use(children._payload);
|
||||
}
|
||||
+ const childrenRef = React.isValidElement(children) ? getElementRef(children) : null;
|
||||
+ const composedRef = React.useMemo(
|
||||
+ () => forwardedRef && childrenRef ? composeRefs(forwardedRef, childrenRef) : forwardedRef || childrenRef || null,
|
||||
+ [forwardedRef, childrenRef]
|
||||
+ );
|
||||
if (React.isValidElement(children)) {
|
||||
- const childrenRef = getElementRef(children);
|
||||
const props2 = mergeProps(slotProps, children.props);
|
||||
if (children.type !== React.Fragment) {
|
||||
- props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
||||
+ props2.ref = composedRef;
|
||||
}
|
||||
return React.cloneElement(children, props2);
|
||||
}
|
||||
return React.Children.count(children) > 1 ? React.Children.only(null) : null;
|
||||
});
|
||||
|
|
@ -68,8 +68,14 @@ patchedDependencies:
|
|||
hash: afe90f800cfb3b1ce1a9c457772e2441a9202e1aa3f8658eb3b9613b3ba0ef7e
|
||||
path: patches/@radix-ui__react-presence@1.1.5.patch
|
||||
'@radix-ui/react-select@2.2.6':
|
||||
hash: eea50c1407feb65af64720d0aadd2b534ca7743474d9204e0fc1d6b93e5f31f4
|
||||
hash: 93cdd02c858fd8e3669eb902abbbd15644c2581c4c33aa63862fa351fefb4231
|
||||
path: patches/@radix-ui__react-select@2.2.6.patch
|
||||
'@radix-ui/react-slot@1.2.3':
|
||||
hash: cc153761e59f07565f64cf0883bb098c78bb27bed60b7363eaadb74ad4317504
|
||||
path: patches/@radix-ui__react-slot@1.2.3.patch
|
||||
'@radix-ui/react-slot@1.2.4':
|
||||
hash: 5c525e90054caa3bbfa5599b10f7650914e2085f54b773bd115ad0e41eeca30a
|
||||
path: patches/@radix-ui__react-slot@1.2.4.patch
|
||||
'@radix-ui/react-tooltip@1.2.8':
|
||||
hash: 92cb648a695f616d3b7222b90053cb36e162bab4303abf0fe39b517e1d9dd6b8
|
||||
path: patches/@radix-ui__react-tooltip@1.2.8.patch
|
||||
|
|
@ -209,10 +215,10 @@ importers:
|
|||
version: 1.1.5(patch_hash=afe90f800cfb3b1ce1a9c457772e2441a9202e1aa3f8658eb3b9613b3ba0ef7e)(@types/react-dom@19.2.3(@types/react@19.2.14))(@types/react@19.2.14)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)
|
||||
'@radix-ui/react-select':
|
||||
specifier: ^2.2.6
|
||||
version: 2.2.6(patch_hash=eea50c1407feb65af64720d0aadd2b534ca7743474d9204e0fc1d6b93e5f31f4)(@types/react-dom@19.2.3(@types/react@19.2.14))(@types/react@19.2.14)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)
|
||||
version: 2.2.6(patch_hash=93cdd02c858fd8e3669eb902abbbd15644c2581c4c33aa63862fa351fefb4231)(@types/react-dom@19.2.3(@types/react@19.2.14))(@types/react@19.2.14)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)
|
||||
'@radix-ui/react-slot':
|
||||
specifier: ^1.2.4
|
||||
version: 1.2.4(@types/react@19.2.14)(react@19.2.4)
|
||||
version: 1.2.4(patch_hash=5c525e90054caa3bbfa5599b10f7650914e2085f54b773bd115ad0e41eeca30a)(@types/react@19.2.14)(react@19.2.4)
|
||||
'@radix-ui/react-tabs':
|
||||
specifier: ^1.1.13
|
||||
version: 1.1.13(@types/react-dom@19.2.3(@types/react@19.2.14))(@types/react@19.2.14)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)
|
||||
|
|
@ -14462,7 +14468,7 @@ snapshots:
|
|||
'@radix-ui/react-context': 1.1.2(@types/react@19.2.14)(react@19.2.4)
|
||||
'@radix-ui/react-dialog': 1.1.15(@types/react-dom@19.2.3(@types/react@19.2.14))(@types/react@19.2.14)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)
|
||||
'@radix-ui/react-primitive': 2.1.3(@types/react-dom@19.2.3(@types/react@19.2.14))(@types/react@19.2.14)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)
|
||||
'@radix-ui/react-slot': 1.2.3(@types/react@19.2.14)(react@19.2.4)
|
||||
'@radix-ui/react-slot': 1.2.3(patch_hash=cc153761e59f07565f64cf0883bb098c78bb27bed60b7363eaadb74ad4317504)(@types/react@19.2.14)(react@19.2.4)
|
||||
react: 19.2.4
|
||||
react-dom: 19.2.4(react@19.2.4)
|
||||
optionalDependencies:
|
||||
|
|
@ -14515,7 +14521,7 @@ snapshots:
|
|||
'@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.14)(react@19.2.4)
|
||||
'@radix-ui/react-context': 1.1.2(@types/react@19.2.14)(react@19.2.4)
|
||||
'@radix-ui/react-primitive': 2.1.3(@types/react-dom@19.2.3(@types/react@19.2.14))(@types/react@19.2.14)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)
|
||||
'@radix-ui/react-slot': 1.2.3(@types/react@19.2.14)(react@19.2.4)
|
||||
'@radix-ui/react-slot': 1.2.3(patch_hash=cc153761e59f07565f64cf0883bb098c78bb27bed60b7363eaadb74ad4317504)(@types/react@19.2.14)(react@19.2.4)
|
||||
react: 19.2.4
|
||||
react-dom: 19.2.4(react@19.2.4)
|
||||
optionalDependencies:
|
||||
|
|
@ -14560,7 +14566,7 @@ snapshots:
|
|||
'@radix-ui/react-portal': 1.1.9(@types/react-dom@19.2.3(@types/react@19.2.14))(@types/react@19.2.14)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)
|
||||
'@radix-ui/react-presence': 1.1.5(patch_hash=afe90f800cfb3b1ce1a9c457772e2441a9202e1aa3f8658eb3b9613b3ba0ef7e)(@types/react-dom@19.2.3(@types/react@19.2.14))(@types/react@19.2.14)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)
|
||||
'@radix-ui/react-primitive': 2.1.3(@types/react-dom@19.2.3(@types/react@19.2.14))(@types/react@19.2.14)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)
|
||||
'@radix-ui/react-slot': 1.2.3(@types/react@19.2.14)(react@19.2.4)
|
||||
'@radix-ui/react-slot': 1.2.3(patch_hash=cc153761e59f07565f64cf0883bb098c78bb27bed60b7363eaadb74ad4317504)(@types/react@19.2.14)(react@19.2.4)
|
||||
'@radix-ui/react-use-controllable-state': 1.2.2(@types/react@19.2.14)(react@19.2.4)
|
||||
aria-hidden: 1.2.6
|
||||
react: 19.2.4
|
||||
|
|
@ -14670,7 +14676,7 @@ snapshots:
|
|||
'@radix-ui/react-presence': 1.1.5(patch_hash=afe90f800cfb3b1ce1a9c457772e2441a9202e1aa3f8658eb3b9613b3ba0ef7e)(@types/react-dom@19.2.3(@types/react@19.2.14))(@types/react@19.2.14)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)
|
||||
'@radix-ui/react-primitive': 2.1.3(@types/react-dom@19.2.3(@types/react@19.2.14))(@types/react@19.2.14)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)
|
||||
'@radix-ui/react-roving-focus': 1.1.11(@types/react-dom@19.2.3(@types/react@19.2.14))(@types/react@19.2.14)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)
|
||||
'@radix-ui/react-slot': 1.2.3(@types/react@19.2.14)(react@19.2.4)
|
||||
'@radix-ui/react-slot': 1.2.3(patch_hash=cc153761e59f07565f64cf0883bb098c78bb27bed60b7363eaadb74ad4317504)(@types/react@19.2.14)(react@19.2.4)
|
||||
'@radix-ui/react-use-callback-ref': 1.1.1(@types/react@19.2.14)(react@19.2.4)
|
||||
aria-hidden: 1.2.6
|
||||
react: 19.2.4
|
||||
|
|
@ -14693,7 +14699,7 @@ snapshots:
|
|||
'@radix-ui/react-portal': 1.1.9(@types/react-dom@19.2.3(@types/react@19.2.14))(@types/react@19.2.14)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)
|
||||
'@radix-ui/react-presence': 1.1.5(patch_hash=afe90f800cfb3b1ce1a9c457772e2441a9202e1aa3f8658eb3b9613b3ba0ef7e)(@types/react-dom@19.2.3(@types/react@19.2.14))(@types/react@19.2.14)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)
|
||||
'@radix-ui/react-primitive': 2.1.3(@types/react-dom@19.2.3(@types/react@19.2.14))(@types/react@19.2.14)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)
|
||||
'@radix-ui/react-slot': 1.2.3(@types/react@19.2.14)(react@19.2.4)
|
||||
'@radix-ui/react-slot': 1.2.3(patch_hash=cc153761e59f07565f64cf0883bb098c78bb27bed60b7363eaadb74ad4317504)(@types/react@19.2.14)(react@19.2.4)
|
||||
'@radix-ui/react-use-controllable-state': 1.2.2(@types/react@19.2.14)(react@19.2.4)
|
||||
aria-hidden: 1.2.6
|
||||
react: 19.2.4
|
||||
|
|
@ -14743,7 +14749,7 @@ snapshots:
|
|||
|
||||
'@radix-ui/react-primitive@2.1.3(@types/react-dom@19.2.3(@types/react@19.2.14))(@types/react@19.2.14)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)':
|
||||
dependencies:
|
||||
'@radix-ui/react-slot': 1.2.3(@types/react@19.2.14)(react@19.2.4)
|
||||
'@radix-ui/react-slot': 1.2.3(patch_hash=cc153761e59f07565f64cf0883bb098c78bb27bed60b7363eaadb74ad4317504)(@types/react@19.2.14)(react@19.2.4)
|
||||
react: 19.2.4
|
||||
react-dom: 19.2.4(react@19.2.4)
|
||||
optionalDependencies:
|
||||
|
|
@ -14752,7 +14758,7 @@ snapshots:
|
|||
|
||||
'@radix-ui/react-primitive@2.1.4(@types/react-dom@19.2.3(@types/react@19.2.14))(@types/react@19.2.14)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)':
|
||||
dependencies:
|
||||
'@radix-ui/react-slot': 1.2.4(@types/react@19.2.14)(react@19.2.4)
|
||||
'@radix-ui/react-slot': 1.2.4(patch_hash=5c525e90054caa3bbfa5599b10f7650914e2085f54b773bd115ad0e41eeca30a)(@types/react@19.2.14)(react@19.2.4)
|
||||
react: 19.2.4
|
||||
react-dom: 19.2.4(react@19.2.4)
|
||||
optionalDependencies:
|
||||
|
|
@ -14776,7 +14782,7 @@ snapshots:
|
|||
'@types/react': 19.2.14
|
||||
'@types/react-dom': 19.2.3(@types/react@19.2.14)
|
||||
|
||||
'@radix-ui/react-select@2.2.6(patch_hash=eea50c1407feb65af64720d0aadd2b534ca7743474d9204e0fc1d6b93e5f31f4)(@types/react-dom@19.2.3(@types/react@19.2.14))(@types/react@19.2.14)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)':
|
||||
'@radix-ui/react-select@2.2.6(patch_hash=93cdd02c858fd8e3669eb902abbbd15644c2581c4c33aa63862fa351fefb4231)(@types/react-dom@19.2.3(@types/react@19.2.14))(@types/react@19.2.14)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)':
|
||||
dependencies:
|
||||
'@radix-ui/number': 1.1.1
|
||||
'@radix-ui/primitive': 1.1.3
|
||||
|
|
@ -14791,7 +14797,7 @@ snapshots:
|
|||
'@radix-ui/react-popper': 1.2.8(patch_hash=bab709aa37cbdb3023036cd85534ddb1400f2fccfe54bd6321fe405d5d199404)(@types/react-dom@19.2.3(@types/react@19.2.14))(@types/react@19.2.14)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)
|
||||
'@radix-ui/react-portal': 1.1.9(@types/react-dom@19.2.3(@types/react@19.2.14))(@types/react@19.2.14)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)
|
||||
'@radix-ui/react-primitive': 2.1.3(@types/react-dom@19.2.3(@types/react@19.2.14))(@types/react@19.2.14)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)
|
||||
'@radix-ui/react-slot': 1.2.3(@types/react@19.2.14)(react@19.2.4)
|
||||
'@radix-ui/react-slot': 1.2.3(patch_hash=cc153761e59f07565f64cf0883bb098c78bb27bed60b7363eaadb74ad4317504)(@types/react@19.2.14)(react@19.2.4)
|
||||
'@radix-ui/react-use-callback-ref': 1.1.1(@types/react@19.2.14)(react@19.2.4)
|
||||
'@radix-ui/react-use-controllable-state': 1.2.2(@types/react@19.2.14)(react@19.2.4)
|
||||
'@radix-ui/react-use-layout-effect': 1.1.1(@types/react@19.2.14)(react@19.2.4)
|
||||
|
|
@ -14805,14 +14811,14 @@ snapshots:
|
|||
'@types/react': 19.2.14
|
||||
'@types/react-dom': 19.2.3(@types/react@19.2.14)
|
||||
|
||||
'@radix-ui/react-slot@1.2.3(@types/react@19.2.14)(react@19.2.4)':
|
||||
'@radix-ui/react-slot@1.2.3(patch_hash=cc153761e59f07565f64cf0883bb098c78bb27bed60b7363eaadb74ad4317504)(@types/react@19.2.14)(react@19.2.4)':
|
||||
dependencies:
|
||||
'@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.14)(react@19.2.4)
|
||||
react: 19.2.4
|
||||
optionalDependencies:
|
||||
'@types/react': 19.2.14
|
||||
|
||||
'@radix-ui/react-slot@1.2.4(@types/react@19.2.14)(react@19.2.4)':
|
||||
'@radix-ui/react-slot@1.2.4(patch_hash=5c525e90054caa3bbfa5599b10f7650914e2085f54b773bd115ad0e41eeca30a)(@types/react@19.2.14)(react@19.2.4)':
|
||||
dependencies:
|
||||
'@radix-ui/react-compose-refs': 1.1.2(@types/react@19.2.14)(react@19.2.4)
|
||||
react: 19.2.4
|
||||
|
|
@ -14846,7 +14852,7 @@ snapshots:
|
|||
'@radix-ui/react-portal': 1.1.9(@types/react-dom@19.2.3(@types/react@19.2.14))(@types/react@19.2.14)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)
|
||||
'@radix-ui/react-presence': 1.1.5(patch_hash=afe90f800cfb3b1ce1a9c457772e2441a9202e1aa3f8658eb3b9613b3ba0ef7e)(@types/react-dom@19.2.3(@types/react@19.2.14))(@types/react@19.2.14)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)
|
||||
'@radix-ui/react-primitive': 2.1.3(@types/react-dom@19.2.3(@types/react@19.2.14))(@types/react@19.2.14)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)
|
||||
'@radix-ui/react-slot': 1.2.3(@types/react@19.2.14)(react@19.2.4)
|
||||
'@radix-ui/react-slot': 1.2.3(patch_hash=cc153761e59f07565f64cf0883bb098c78bb27bed60b7363eaadb74ad4317504)(@types/react@19.2.14)(react@19.2.4)
|
||||
'@radix-ui/react-use-controllable-state': 1.2.2(@types/react@19.2.14)(react@19.2.4)
|
||||
'@radix-ui/react-visually-hidden': 1.2.3(@types/react-dom@19.2.3(@types/react@19.2.14))(@types/react@19.2.14)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)
|
||||
react: 19.2.4
|
||||
|
|
|
|||
13
scripts/ci/enforce-pnpm-install.mjs
Normal file
13
scripts/ci/enforce-pnpm-install.mjs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
const userAgent = process.env.npm_config_user_agent ?? '';
|
||||
|
||||
if (userAgent.startsWith('pnpm/')) {
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
console.error(
|
||||
[
|
||||
'Use pnpm install for this project.',
|
||||
'npm and yarn do not apply pnpm patchedDependencies, including the Radix React 19 patches.',
|
||||
].join('\n')
|
||||
);
|
||||
process.exit(1);
|
||||
|
|
@ -25,10 +25,19 @@ const patchChecks = [
|
|||
},
|
||||
{
|
||||
packageName: '@radix-ui/react-select',
|
||||
requiredMarkers: ['useGuardedNodeSetter', 'setContentRef', 'setItemTextNodeRef'],
|
||||
requiredMarkers: [
|
||||
'useGuardedNodeSetter',
|
||||
'setContentRef',
|
||||
'setItemTextNodeRef',
|
||||
'textValueRef',
|
||||
'nextTextValue',
|
||||
],
|
||||
forbiddenSnippets: [
|
||||
'(node) => setContent(node)',
|
||||
'(node) => setItemTextNode(node)',
|
||||
'forwardedRef,\n (node) => contentContext.itemRefCallback?.(node, value, disabled)',
|
||||
'itemContext.onItemTextChange,\n (node) => contentContext.itemTextRefCallback?.(node, itemContext.value, itemContext.disabled)',
|
||||
'setTextValue((prevTextValue) => prevTextValue || (node?.textContent ?? "").trim());',
|
||||
'onTriggerChange: setTrigger,',
|
||||
'onValueNodeChange: setValueNode,',
|
||||
'onViewportChange: setViewport,',
|
||||
|
|
@ -37,6 +46,23 @@ const patchChecks = [
|
|||
'setSelectedItemText(node);',
|
||||
],
|
||||
},
|
||||
{
|
||||
packageName: '@radix-ui/react-slot',
|
||||
requiredMarkers: ['composedRef', 'React.useMemo'],
|
||||
forbiddenSnippets: [
|
||||
'props2.ref = forwardedRef ? (0, import_react_compose_refs.composeRefs)(forwardedRef, childrenRef) : childrenRef;',
|
||||
'props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;',
|
||||
],
|
||||
},
|
||||
{
|
||||
packageName: '@radix-ui/react-slot',
|
||||
resolverFromPackage: '@radix-ui/react-select',
|
||||
requiredMarkers: ['composedRef', 'React.useMemo'],
|
||||
forbiddenSnippets: [
|
||||
'props2.ref = forwardedRef ? (0, import_react_compose_refs.composeRefs)(forwardedRef, childrenRef) : childrenRef;',
|
||||
'props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;',
|
||||
],
|
||||
},
|
||||
{
|
||||
packageName: '@radix-ui/react-popper',
|
||||
resolverFromPackage: '@radix-ui/react-select',
|
||||
|
|
|
|||
|
|
@ -27,6 +27,9 @@ const requiredMarkers = [
|
|||
'setSelectedItemRef',
|
||||
'setSelectedItemTextRef',
|
||||
'setItemTextNodeRef',
|
||||
'textValueRef',
|
||||
'nextTextValue',
|
||||
'composedRef',
|
||||
'setControlRef',
|
||||
'setBubbleInputRef',
|
||||
];
|
||||
|
|
@ -35,6 +38,12 @@ const forbiddenSnippets = [
|
|||
'(node) => setContent(node)',
|
||||
'(node2) => setNode(node2)',
|
||||
'(node) => setItemTextNode(node)',
|
||||
'forwardedRef,\n (node) => contentContext.itemRefCallback?.(node, value, disabled)',
|
||||
'forwardedRef,\n (node2) => contentContext.itemRefCallback?.(node2, value, disabled)',
|
||||
'itemContext.onItemTextChange,\n (node) => contentContext.itemTextRefCallback?.(node, itemContext.value, itemContext.disabled)',
|
||||
'itemContext.onItemTextChange,\n (node2) => contentContext.itemTextRefCallback?.(node2, itemContext.value, itemContext.disabled)',
|
||||
'setTextValue((prevTextValue) => prevTextValue || (node?.textContent ?? "").trim());',
|
||||
'setTextValue((prevTextValue) => prevTextValue || (node2?.textContent ?? "").trim());',
|
||||
'onContentChange: setContent,',
|
||||
'onTriggerChange: setTrigger,',
|
||||
'onValueNodeChange: setValueNode,',
|
||||
|
|
@ -46,6 +55,7 @@ const forbiddenSnippets = [
|
|||
'useComposedRefs(forwardedRef, setBubbleInput)',
|
||||
'useComposedRefs)(forwardedRef, setControl)',
|
||||
'useComposedRefs)(forwardedRef, setBubbleInput)',
|
||||
'props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;',
|
||||
];
|
||||
|
||||
const failures = [];
|
||||
|
|
|
|||
Loading…
Reference in a new issue