react-aria-components 3.0.0-nightly-4f85a359f-241022 → 3.0.0-nightly-fb28ab3b4-241024

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.
@@ -67,7 +67,7 @@ function $0c2289d253cb4544$export$d1e8e3fbb7461f6(selectionManager, dragAndDropH
67
67
  return new Set([
68
68
  focusedKey,
69
69
  dropTargetKey
70
- ].filter((k)=>k !== null));
70
+ ].filter((k)=>k != null));
71
71
  }, [
72
72
  focusedKey,
73
73
  dropTargetKey
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;AAaM,MAAM,0DAAqB,CAAA,GAAA,0BAAY,EAA2B,CAAC;AACnE,MAAM,0DAAuB,CAAA,GAAA,0BAAY,EAAoC;AAepF,SAAS,oCAAc,KAAyB,EAAE,GAA8B;IAC9E,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,uBAAS,EAAE;IAC1B,qBAAO,sHAAG,OAAO,OAAO;AAC1B;AAEA;;CAEC,GACD,MAAM,0DAAiB,CAAA,GAAA,uBAAS,EAAE;AAG3B,SAAS,0CAAuB,gBAAmC,EAAE,SAAoC;QAEtF;IADxB,IAAI,sBAAsB,6BAAA,uCAAA,iBAAkB,mBAAmB;IAC/D,IAAI,oBAAoB,6BAAA,wCAAA,sCAAA,iBAAkB,iBAAiB,cAAnC,0DAAA,yCAAA;IACxB,IAAI,KAAK,CAAA,GAAA,wBAAU,EAAE,CAAC;QACpB,sFAAsF;QACtF,IAAI,sBAAqB,sBAAA,gCAAA,UAAW,YAAY,CAAC,UAC/C,OAAO,sBAAsB,oBAAoB,wBAAU,0DAAC;YAAe,QAAQ;;IAErF,6CAA6C;IAC7C,uDAAuD;IACzD,GAAG;QAAC,sBAAA,gCAAA,UAAW,MAAM;QAAE;QAAmB;KAAoB;IAC9D,OAAO,CAAA,6BAAA,uCAAA,iBAAkB,gBAAgB,IAAG,KAAK;AACnD;AAEO,SAAS,yCAAoB,gBAA0C,EAAE,gBAAmC,EAAE,SAAoC;QAInJ,qCAA2C;IAH/C,mDAAmD;IACnD,IAAI,aAAa,iBAAiB,UAAU;IAC5C,IAAI,gBAA4B;IAChC,IAAI,CAAA,6BAAA,wCAAA,sCAAA,iBAAkB,iBAAiB,cAAnC,0DAAA,yCAAA,sBAA2C,CAAA,sBAAA,iCAAA,oBAAA,UAAW,MAAM,cAAjB,wCAAA,kBAAmB,IAAI,MAAK,QAAQ;QACjF,gBAAgB,UAAU,MAAM,CAAC,GAAG;YAGlB;QAFlB,IAAI,UAAU,MAAM,CAAC,YAAY,KAAK,SACpC,iFAAiF;QACjF,gBAAgB,CAAA,oCAAA,UAAU,UAAU,CAAC,WAAW,CAAC,4BAAjC,+CAAA,oCAAmD;IAEvE;IAEA,OAAO,CAAA,GAAA,oBAAM,EAAE;QACb,OAAO,IAAI,IAAI;YAAC;YAAY;SAAc,CAAC,MAAM,CAAC,CAAA,IAAK,MAAM;IAC/D,GAAG;QAAC;QAAY;KAAc;AAChC","sources":["packages/react-aria-components/src/DragAndDrop.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport type {DropIndicatorProps as AriaDropIndicatorProps, ItemDropTarget, Key} from 'react-aria';\nimport type {DragAndDropHooks} from './useDragAndDrop';\nimport type {DraggableCollectionState, DroppableCollectionState, MultipleSelectionManager} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, JSX, ReactNode, useCallback, useContext, useMemo} from 'react';\nimport type {RenderProps} from './utils';\n\nexport interface DragAndDropContextValue {\n dragAndDropHooks?: DragAndDropHooks,\n dragState?: DraggableCollectionState,\n dropState?: DroppableCollectionState\n}\n\nexport const DragAndDropContext = createContext<DragAndDropContextValue>({});\nexport const DropIndicatorContext = createContext<DropIndicatorContextValue | null>(null);\n\nexport interface DropIndicatorRenderProps {\n /**\n * Whether the drop indicator is currently the active drop target.\n * @selector [data-drop-target]\n */\n isDropTarget: boolean\n}\n\nexport interface DropIndicatorProps extends AriaDropIndicatorProps, RenderProps<DropIndicatorRenderProps> { }\ninterface DropIndicatorContextValue {\n render: (props: DropIndicatorProps, ref: ForwardedRef<HTMLElement>) => ReactNode\n}\n\nfunction DropIndicator(props: DropIndicatorProps, ref: ForwardedRef<HTMLElement>): JSX.Element {\n let {render} = useContext(DropIndicatorContext)!;\n return <>{render(props, ref)}</>;\n}\n\n/**\n * A DropIndicator is rendered between items in a collection to indicate where dropped data will be inserted.\n */\nconst _DropIndicator = forwardRef(DropIndicator);\nexport {_DropIndicator as DropIndicator};\n\nexport function useRenderDropIndicator(dragAndDropHooks?: DragAndDropHooks, dropState?: DroppableCollectionState) {\n let renderDropIndicator = dragAndDropHooks?.renderDropIndicator;\n let isVirtualDragging = dragAndDropHooks?.isVirtualDragging?.();\n let fn = useCallback((target: ItemDropTarget) => {\n // Only show drop indicators when virtual dragging or this is the current drop target.\n if (isVirtualDragging || dropState?.isDropTarget(target)) {\n return renderDropIndicator ? renderDropIndicator(target) : <_DropIndicator target={target} />;\n }\n // We invalidate whenever the target changes.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [dropState?.target, isVirtualDragging, renderDropIndicator]);\n return dragAndDropHooks?.useDropIndicator ? fn : undefined;\n}\n\nexport function useDndPersistedKeys(selectionManager: MultipleSelectionManager, dragAndDropHooks?: DragAndDropHooks, dropState?: DroppableCollectionState) {\n // Persist the focused key and the drop target key.\n let focusedKey = selectionManager.focusedKey;\n let dropTargetKey: Key | null = null;\n if (dragAndDropHooks?.isVirtualDragging?.() && dropState?.target?.type === 'item') {\n dropTargetKey = dropState.target.key;\n if (dropState.target.dropPosition === 'after') {\n // Normalize to the \"before\" drop position since we only render those to the DOM.\n dropTargetKey = dropState.collection.getKeyAfter(dropTargetKey) ?? dropTargetKey;\n }\n }\n\n return useMemo(() => {\n return new Set([focusedKey, dropTargetKey].filter(k => k !== null));\n }, [focusedKey, dropTargetKey]);\n}\n"],"names":[],"version":3,"file":"DragAndDrop.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;AAaM,MAAM,0DAAqB,CAAA,GAAA,0BAAY,EAA2B,CAAC;AACnE,MAAM,0DAAuB,CAAA,GAAA,0BAAY,EAAoC;AAepF,SAAS,oCAAc,KAAyB,EAAE,GAA8B;IAC9E,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,uBAAS,EAAE;IAC1B,qBAAO,sHAAG,OAAO,OAAO;AAC1B;AAEA;;CAEC,GACD,MAAM,0DAAiB,CAAA,GAAA,uBAAS,EAAE;AAG3B,SAAS,0CAAuB,gBAAmC,EAAE,SAAoC;QAEtF;IADxB,IAAI,sBAAsB,6BAAA,uCAAA,iBAAkB,mBAAmB;IAC/D,IAAI,oBAAoB,6BAAA,wCAAA,sCAAA,iBAAkB,iBAAiB,cAAnC,0DAAA,yCAAA;IACxB,IAAI,KAAK,CAAA,GAAA,wBAAU,EAAE,CAAC;QACpB,sFAAsF;QACtF,IAAI,sBAAqB,sBAAA,gCAAA,UAAW,YAAY,CAAC,UAC/C,OAAO,sBAAsB,oBAAoB,wBAAU,0DAAC;YAAe,QAAQ;;IAErF,6CAA6C;IAC7C,uDAAuD;IACzD,GAAG;QAAC,sBAAA,gCAAA,UAAW,MAAM;QAAE;QAAmB;KAAoB;IAC9D,OAAO,CAAA,6BAAA,uCAAA,iBAAkB,gBAAgB,IAAG,KAAK;AACnD;AAEO,SAAS,yCAAoB,gBAA0C,EAAE,gBAAmC,EAAE,SAAoC;QAInJ,qCAA2C;IAH/C,mDAAmD;IACnD,IAAI,aAAa,iBAAiB,UAAU;IAC5C,IAAI,gBAAwC;IAC5C,IAAI,CAAA,6BAAA,wCAAA,sCAAA,iBAAkB,iBAAiB,cAAnC,0DAAA,yCAAA,sBAA2C,CAAA,sBAAA,iCAAA,oBAAA,UAAW,MAAM,cAAjB,wCAAA,kBAAmB,IAAI,MAAK,QAAQ;QACjF,gBAAgB,UAAU,MAAM,CAAC,GAAG;YAGlB;QAFlB,IAAI,UAAU,MAAM,CAAC,YAAY,KAAK,SACpC,iFAAiF;QACjF,gBAAgB,CAAA,oCAAA,UAAU,UAAU,CAAC,WAAW,CAAC,4BAAjC,+CAAA,oCAAmD;IAEvE;IAEA,OAAO,CAAA,GAAA,oBAAM,EAAE;QACb,OAAO,IAAI,IAAI;YAAC;YAAY;SAAc,CAAC,MAAM,CAAC,CAAA,IAAK,KAAK;IAC9D,GAAG;QAAC;QAAY;KAAc;AAChC","sources":["packages/react-aria-components/src/DragAndDrop.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport type {DropIndicatorProps as AriaDropIndicatorProps, ItemDropTarget, Key} from 'react-aria';\nimport type {DragAndDropHooks} from './useDragAndDrop';\nimport type {DraggableCollectionState, DroppableCollectionState, MultipleSelectionManager} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, JSX, ReactNode, useCallback, useContext, useMemo} from 'react';\nimport type {RenderProps} from './utils';\n\nexport interface DragAndDropContextValue {\n dragAndDropHooks?: DragAndDropHooks,\n dragState?: DraggableCollectionState,\n dropState?: DroppableCollectionState\n}\n\nexport const DragAndDropContext = createContext<DragAndDropContextValue>({});\nexport const DropIndicatorContext = createContext<DropIndicatorContextValue | null>(null);\n\nexport interface DropIndicatorRenderProps {\n /**\n * Whether the drop indicator is currently the active drop target.\n * @selector [data-drop-target]\n */\n isDropTarget: boolean\n}\n\nexport interface DropIndicatorProps extends AriaDropIndicatorProps, RenderProps<DropIndicatorRenderProps> { }\ninterface DropIndicatorContextValue {\n render: (props: DropIndicatorProps, ref: ForwardedRef<HTMLElement>) => ReactNode\n}\n\nfunction DropIndicator(props: DropIndicatorProps, ref: ForwardedRef<HTMLElement>): JSX.Element {\n let {render} = useContext(DropIndicatorContext)!;\n return <>{render(props, ref)}</>;\n}\n\n/**\n * A DropIndicator is rendered between items in a collection to indicate where dropped data will be inserted.\n */\nconst _DropIndicator = forwardRef(DropIndicator);\nexport {_DropIndicator as DropIndicator};\n\nexport function useRenderDropIndicator(dragAndDropHooks?: DragAndDropHooks, dropState?: DroppableCollectionState) {\n let renderDropIndicator = dragAndDropHooks?.renderDropIndicator;\n let isVirtualDragging = dragAndDropHooks?.isVirtualDragging?.();\n let fn = useCallback((target: ItemDropTarget) => {\n // Only show drop indicators when virtual dragging or this is the current drop target.\n if (isVirtualDragging || dropState?.isDropTarget(target)) {\n return renderDropIndicator ? renderDropIndicator(target) : <_DropIndicator target={target} />;\n }\n // We invalidate whenever the target changes.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [dropState?.target, isVirtualDragging, renderDropIndicator]);\n return dragAndDropHooks?.useDropIndicator ? fn : undefined;\n}\n\nexport function useDndPersistedKeys(selectionManager: MultipleSelectionManager, dragAndDropHooks?: DragAndDropHooks, dropState?: DroppableCollectionState) {\n // Persist the focused key and the drop target key.\n let focusedKey = selectionManager.focusedKey;\n let dropTargetKey: Key | null | undefined = null;\n if (dragAndDropHooks?.isVirtualDragging?.() && dropState?.target?.type === 'item') {\n dropTargetKey = dropState.target.key;\n if (dropState.target.dropPosition === 'after') {\n // Normalize to the \"before\" drop position since we only render those to the DOM.\n dropTargetKey = dropState.collection.getKeyAfter(dropTargetKey) ?? dropTargetKey;\n }\n }\n\n return useMemo(() => {\n return new Set([focusedKey, dropTargetKey].filter(k => k != null));\n }, [focusedKey, dropTargetKey]);\n}\n"],"names":[],"version":3,"file":"DragAndDrop.main.js.map"}
@@ -53,7 +53,7 @@ function $612b8eb6cb90e02d$export$d1e8e3fbb7461f6(selectionManager, dragAndDropH
53
53
  return new Set([
54
54
  focusedKey,
55
55
  dropTargetKey
56
- ].filter((k)=>k !== null));
56
+ ].filter((k)=>k != null));
57
57
  }, [
58
58
  focusedKey,
59
59
  dropTargetKey
@@ -53,7 +53,7 @@ function $612b8eb6cb90e02d$export$d1e8e3fbb7461f6(selectionManager, dragAndDropH
53
53
  return new Set([
54
54
  focusedKey,
55
55
  dropTargetKey
56
- ].filter((k)=>k !== null));
56
+ ].filter((k)=>k != null));
57
57
  }, [
58
58
  focusedKey,
59
59
  dropTargetKey
@@ -1 +1 @@
1
- {"mappings":";;AAAA;;;;;;;;;;CAUC;AAaM,MAAM,0DAAqB,CAAA,GAAA,oBAAY,EAA2B,CAAC;AACnE,MAAM,0DAAuB,CAAA,GAAA,oBAAY,EAAoC;AAepF,SAAS,oCAAc,KAAyB,EAAE,GAA8B;IAC9E,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,iBAAS,EAAE;IAC1B,qBAAO,kEAAG,OAAO,OAAO;AAC1B;AAEA;;CAEC,GACD,MAAM,0DAAiB,CAAA,GAAA,iBAAS,EAAE;AAG3B,SAAS,0CAAuB,gBAAmC,EAAE,SAAoC;QAEtF;IADxB,IAAI,sBAAsB,6BAAA,uCAAA,iBAAkB,mBAAmB;IAC/D,IAAI,oBAAoB,6BAAA,wCAAA,sCAAA,iBAAkB,iBAAiB,cAAnC,0DAAA,yCAAA;IACxB,IAAI,KAAK,CAAA,GAAA,kBAAU,EAAE,CAAC;QACpB,sFAAsF;QACtF,IAAI,sBAAqB,sBAAA,gCAAA,UAAW,YAAY,CAAC,UAC/C,OAAO,sBAAsB,oBAAoB,wBAAU,gCAAC;YAAe,QAAQ;;IAErF,6CAA6C;IAC7C,uDAAuD;IACzD,GAAG;QAAC,sBAAA,gCAAA,UAAW,MAAM;QAAE;QAAmB;KAAoB;IAC9D,OAAO,CAAA,6BAAA,uCAAA,iBAAkB,gBAAgB,IAAG,KAAK;AACnD;AAEO,SAAS,yCAAoB,gBAA0C,EAAE,gBAAmC,EAAE,SAAoC;QAInJ,qCAA2C;IAH/C,mDAAmD;IACnD,IAAI,aAAa,iBAAiB,UAAU;IAC5C,IAAI,gBAA4B;IAChC,IAAI,CAAA,6BAAA,wCAAA,sCAAA,iBAAkB,iBAAiB,cAAnC,0DAAA,yCAAA,sBAA2C,CAAA,sBAAA,iCAAA,oBAAA,UAAW,MAAM,cAAjB,wCAAA,kBAAmB,IAAI,MAAK,QAAQ;QACjF,gBAAgB,UAAU,MAAM,CAAC,GAAG;YAGlB;QAFlB,IAAI,UAAU,MAAM,CAAC,YAAY,KAAK,SACpC,iFAAiF;QACjF,gBAAgB,CAAA,oCAAA,UAAU,UAAU,CAAC,WAAW,CAAC,4BAAjC,+CAAA,oCAAmD;IAEvE;IAEA,OAAO,CAAA,GAAA,cAAM,EAAE;QACb,OAAO,IAAI,IAAI;YAAC;YAAY;SAAc,CAAC,MAAM,CAAC,CAAA,IAAK,MAAM;IAC/D,GAAG;QAAC;QAAY;KAAc;AAChC","sources":["packages/react-aria-components/src/DragAndDrop.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport type {DropIndicatorProps as AriaDropIndicatorProps, ItemDropTarget, Key} from 'react-aria';\nimport type {DragAndDropHooks} from './useDragAndDrop';\nimport type {DraggableCollectionState, DroppableCollectionState, MultipleSelectionManager} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, JSX, ReactNode, useCallback, useContext, useMemo} from 'react';\nimport type {RenderProps} from './utils';\n\nexport interface DragAndDropContextValue {\n dragAndDropHooks?: DragAndDropHooks,\n dragState?: DraggableCollectionState,\n dropState?: DroppableCollectionState\n}\n\nexport const DragAndDropContext = createContext<DragAndDropContextValue>({});\nexport const DropIndicatorContext = createContext<DropIndicatorContextValue | null>(null);\n\nexport interface DropIndicatorRenderProps {\n /**\n * Whether the drop indicator is currently the active drop target.\n * @selector [data-drop-target]\n */\n isDropTarget: boolean\n}\n\nexport interface DropIndicatorProps extends AriaDropIndicatorProps, RenderProps<DropIndicatorRenderProps> { }\ninterface DropIndicatorContextValue {\n render: (props: DropIndicatorProps, ref: ForwardedRef<HTMLElement>) => ReactNode\n}\n\nfunction DropIndicator(props: DropIndicatorProps, ref: ForwardedRef<HTMLElement>): JSX.Element {\n let {render} = useContext(DropIndicatorContext)!;\n return <>{render(props, ref)}</>;\n}\n\n/**\n * A DropIndicator is rendered between items in a collection to indicate where dropped data will be inserted.\n */\nconst _DropIndicator = forwardRef(DropIndicator);\nexport {_DropIndicator as DropIndicator};\n\nexport function useRenderDropIndicator(dragAndDropHooks?: DragAndDropHooks, dropState?: DroppableCollectionState) {\n let renderDropIndicator = dragAndDropHooks?.renderDropIndicator;\n let isVirtualDragging = dragAndDropHooks?.isVirtualDragging?.();\n let fn = useCallback((target: ItemDropTarget) => {\n // Only show drop indicators when virtual dragging or this is the current drop target.\n if (isVirtualDragging || dropState?.isDropTarget(target)) {\n return renderDropIndicator ? renderDropIndicator(target) : <_DropIndicator target={target} />;\n }\n // We invalidate whenever the target changes.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [dropState?.target, isVirtualDragging, renderDropIndicator]);\n return dragAndDropHooks?.useDropIndicator ? fn : undefined;\n}\n\nexport function useDndPersistedKeys(selectionManager: MultipleSelectionManager, dragAndDropHooks?: DragAndDropHooks, dropState?: DroppableCollectionState) {\n // Persist the focused key and the drop target key.\n let focusedKey = selectionManager.focusedKey;\n let dropTargetKey: Key | null = null;\n if (dragAndDropHooks?.isVirtualDragging?.() && dropState?.target?.type === 'item') {\n dropTargetKey = dropState.target.key;\n if (dropState.target.dropPosition === 'after') {\n // Normalize to the \"before\" drop position since we only render those to the DOM.\n dropTargetKey = dropState.collection.getKeyAfter(dropTargetKey) ?? dropTargetKey;\n }\n }\n\n return useMemo(() => {\n return new Set([focusedKey, dropTargetKey].filter(k => k !== null));\n }, [focusedKey, dropTargetKey]);\n}\n"],"names":[],"version":3,"file":"DragAndDrop.module.js.map"}
1
+ {"mappings":";;AAAA;;;;;;;;;;CAUC;AAaM,MAAM,0DAAqB,CAAA,GAAA,oBAAY,EAA2B,CAAC;AACnE,MAAM,0DAAuB,CAAA,GAAA,oBAAY,EAAoC;AAepF,SAAS,oCAAc,KAAyB,EAAE,GAA8B;IAC9E,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,iBAAS,EAAE;IAC1B,qBAAO,kEAAG,OAAO,OAAO;AAC1B;AAEA;;CAEC,GACD,MAAM,0DAAiB,CAAA,GAAA,iBAAS,EAAE;AAG3B,SAAS,0CAAuB,gBAAmC,EAAE,SAAoC;QAEtF;IADxB,IAAI,sBAAsB,6BAAA,uCAAA,iBAAkB,mBAAmB;IAC/D,IAAI,oBAAoB,6BAAA,wCAAA,sCAAA,iBAAkB,iBAAiB,cAAnC,0DAAA,yCAAA;IACxB,IAAI,KAAK,CAAA,GAAA,kBAAU,EAAE,CAAC;QACpB,sFAAsF;QACtF,IAAI,sBAAqB,sBAAA,gCAAA,UAAW,YAAY,CAAC,UAC/C,OAAO,sBAAsB,oBAAoB,wBAAU,gCAAC;YAAe,QAAQ;;IAErF,6CAA6C;IAC7C,uDAAuD;IACzD,GAAG;QAAC,sBAAA,gCAAA,UAAW,MAAM;QAAE;QAAmB;KAAoB;IAC9D,OAAO,CAAA,6BAAA,uCAAA,iBAAkB,gBAAgB,IAAG,KAAK;AACnD;AAEO,SAAS,yCAAoB,gBAA0C,EAAE,gBAAmC,EAAE,SAAoC;QAInJ,qCAA2C;IAH/C,mDAAmD;IACnD,IAAI,aAAa,iBAAiB,UAAU;IAC5C,IAAI,gBAAwC;IAC5C,IAAI,CAAA,6BAAA,wCAAA,sCAAA,iBAAkB,iBAAiB,cAAnC,0DAAA,yCAAA,sBAA2C,CAAA,sBAAA,iCAAA,oBAAA,UAAW,MAAM,cAAjB,wCAAA,kBAAmB,IAAI,MAAK,QAAQ;QACjF,gBAAgB,UAAU,MAAM,CAAC,GAAG;YAGlB;QAFlB,IAAI,UAAU,MAAM,CAAC,YAAY,KAAK,SACpC,iFAAiF;QACjF,gBAAgB,CAAA,oCAAA,UAAU,UAAU,CAAC,WAAW,CAAC,4BAAjC,+CAAA,oCAAmD;IAEvE;IAEA,OAAO,CAAA,GAAA,cAAM,EAAE;QACb,OAAO,IAAI,IAAI;YAAC;YAAY;SAAc,CAAC,MAAM,CAAC,CAAA,IAAK,KAAK;IAC9D,GAAG;QAAC;QAAY;KAAc;AAChC","sources":["packages/react-aria-components/src/DragAndDrop.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport type {DropIndicatorProps as AriaDropIndicatorProps, ItemDropTarget, Key} from 'react-aria';\nimport type {DragAndDropHooks} from './useDragAndDrop';\nimport type {DraggableCollectionState, DroppableCollectionState, MultipleSelectionManager} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, JSX, ReactNode, useCallback, useContext, useMemo} from 'react';\nimport type {RenderProps} from './utils';\n\nexport interface DragAndDropContextValue {\n dragAndDropHooks?: DragAndDropHooks,\n dragState?: DraggableCollectionState,\n dropState?: DroppableCollectionState\n}\n\nexport const DragAndDropContext = createContext<DragAndDropContextValue>({});\nexport const DropIndicatorContext = createContext<DropIndicatorContextValue | null>(null);\n\nexport interface DropIndicatorRenderProps {\n /**\n * Whether the drop indicator is currently the active drop target.\n * @selector [data-drop-target]\n */\n isDropTarget: boolean\n}\n\nexport interface DropIndicatorProps extends AriaDropIndicatorProps, RenderProps<DropIndicatorRenderProps> { }\ninterface DropIndicatorContextValue {\n render: (props: DropIndicatorProps, ref: ForwardedRef<HTMLElement>) => ReactNode\n}\n\nfunction DropIndicator(props: DropIndicatorProps, ref: ForwardedRef<HTMLElement>): JSX.Element {\n let {render} = useContext(DropIndicatorContext)!;\n return <>{render(props, ref)}</>;\n}\n\n/**\n * A DropIndicator is rendered between items in a collection to indicate where dropped data will be inserted.\n */\nconst _DropIndicator = forwardRef(DropIndicator);\nexport {_DropIndicator as DropIndicator};\n\nexport function useRenderDropIndicator(dragAndDropHooks?: DragAndDropHooks, dropState?: DroppableCollectionState) {\n let renderDropIndicator = dragAndDropHooks?.renderDropIndicator;\n let isVirtualDragging = dragAndDropHooks?.isVirtualDragging?.();\n let fn = useCallback((target: ItemDropTarget) => {\n // Only show drop indicators when virtual dragging or this is the current drop target.\n if (isVirtualDragging || dropState?.isDropTarget(target)) {\n return renderDropIndicator ? renderDropIndicator(target) : <_DropIndicator target={target} />;\n }\n // We invalidate whenever the target changes.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [dropState?.target, isVirtualDragging, renderDropIndicator]);\n return dragAndDropHooks?.useDropIndicator ? fn : undefined;\n}\n\nexport function useDndPersistedKeys(selectionManager: MultipleSelectionManager, dragAndDropHooks?: DragAndDropHooks, dropState?: DroppableCollectionState) {\n // Persist the focused key and the drop target key.\n let focusedKey = selectionManager.focusedKey;\n let dropTargetKey: Key | null | undefined = null;\n if (dragAndDropHooks?.isVirtualDragging?.() && dropState?.target?.type === 'item') {\n dropTargetKey = dropState.target.key;\n if (dropState.target.dropPosition === 'after') {\n // Normalize to the \"before\" drop position since we only render those to the DOM.\n dropTargetKey = dropState.collection.getKeyAfter(dropTargetKey) ?? dropTargetKey;\n }\n }\n\n return useMemo(() => {\n return new Set([focusedKey, dropTargetKey].filter(k => k != null));\n }, [focusedKey, dropTargetKey]);\n}\n"],"names":[],"version":3,"file":"DragAndDrop.module.js.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-aria-components",
3
- "version": "3.0.0-nightly-4f85a359f-241022",
3
+ "version": "3.0.0-nightly-fb28ab3b4-241024",
4
4
  "description": "A library of styleable components built using React Aria",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -37,37 +37,37 @@
37
37
  "url": "https://github.com/adobe/react-spectrum"
38
38
  },
39
39
  "dependencies": {
40
- "@internationalized/date": "^3.0.0-nightly-4f85a359f-241022",
41
- "@internationalized/string": "^3.0.0-nightly-4f85a359f-241022",
42
- "@react-aria/accordion": "3.0.0-nightly-4f85a359f-241022",
43
- "@react-aria/collections": "3.0.0-nightly-4f85a359f-241022",
44
- "@react-aria/color": "^3.0.0-nightly-4f85a359f-241022",
45
- "@react-aria/disclosure": "3.0.0-nightly-4f85a359f-241022",
46
- "@react-aria/dnd": "^3.0.0-nightly-4f85a359f-241022",
47
- "@react-aria/focus": "^3.0.0-nightly-4f85a359f-241022",
48
- "@react-aria/interactions": "^3.0.0-nightly-4f85a359f-241022",
49
- "@react-aria/live-announcer": "^3.0.0-nightly-4f85a359f-241022",
50
- "@react-aria/menu": "^3.0.0-nightly-4f85a359f-241022",
51
- "@react-aria/toolbar": "3.0.0-nightly-4f85a359f-241022",
52
- "@react-aria/tree": "3.0.0-nightly-4f85a359f-241022",
53
- "@react-aria/utils": "^3.0.0-nightly-4f85a359f-241022",
54
- "@react-aria/virtualizer": "^3.0.0-nightly-4f85a359f-241022",
55
- "@react-stately/color": "^3.0.0-nightly-4f85a359f-241022",
56
- "@react-stately/disclosure": "3.0.0-nightly-4f85a359f-241022",
57
- "@react-stately/layout": "^3.0.0-nightly-4f85a359f-241022",
58
- "@react-stately/menu": "^3.0.0-nightly-4f85a359f-241022",
59
- "@react-stately/table": "^3.0.0-nightly-4f85a359f-241022",
60
- "@react-stately/utils": "^3.0.0-nightly-4f85a359f-241022",
61
- "@react-stately/virtualizer": "^3.0.0-nightly-4f85a359f-241022",
62
- "@react-types/color": "^3.0.0-nightly-4f85a359f-241022",
63
- "@react-types/form": "^3.0.0-nightly-4f85a359f-241022",
64
- "@react-types/grid": "^3.0.0-nightly-4f85a359f-241022",
65
- "@react-types/shared": "^3.0.0-nightly-4f85a359f-241022",
66
- "@react-types/table": "^3.0.0-nightly-4f85a359f-241022",
40
+ "@internationalized/date": "^3.0.0-nightly-fb28ab3b4-241024",
41
+ "@internationalized/string": "^3.0.0-nightly-fb28ab3b4-241024",
42
+ "@react-aria/accordion": "3.0.0-nightly-fb28ab3b4-241024",
43
+ "@react-aria/collections": "3.0.0-nightly-fb28ab3b4-241024",
44
+ "@react-aria/color": "^3.0.0-nightly-fb28ab3b4-241024",
45
+ "@react-aria/disclosure": "3.0.0-nightly-fb28ab3b4-241024",
46
+ "@react-aria/dnd": "^3.0.0-nightly-fb28ab3b4-241024",
47
+ "@react-aria/focus": "^3.0.0-nightly-fb28ab3b4-241024",
48
+ "@react-aria/interactions": "^3.0.0-nightly-fb28ab3b4-241024",
49
+ "@react-aria/live-announcer": "^3.0.0-nightly-fb28ab3b4-241024",
50
+ "@react-aria/menu": "^3.0.0-nightly-fb28ab3b4-241024",
51
+ "@react-aria/toolbar": "3.0.0-nightly-fb28ab3b4-241024",
52
+ "@react-aria/tree": "3.0.0-nightly-fb28ab3b4-241024",
53
+ "@react-aria/utils": "^3.0.0-nightly-fb28ab3b4-241024",
54
+ "@react-aria/virtualizer": "^3.0.0-nightly-fb28ab3b4-241024",
55
+ "@react-stately/color": "^3.0.0-nightly-fb28ab3b4-241024",
56
+ "@react-stately/disclosure": "3.0.0-nightly-fb28ab3b4-241024",
57
+ "@react-stately/layout": "^3.0.0-nightly-fb28ab3b4-241024",
58
+ "@react-stately/menu": "^3.0.0-nightly-fb28ab3b4-241024",
59
+ "@react-stately/table": "^3.0.0-nightly-fb28ab3b4-241024",
60
+ "@react-stately/utils": "^3.0.0-nightly-fb28ab3b4-241024",
61
+ "@react-stately/virtualizer": "^3.0.0-nightly-fb28ab3b4-241024",
62
+ "@react-types/color": "^3.0.0-nightly-fb28ab3b4-241024",
63
+ "@react-types/form": "^3.0.0-nightly-fb28ab3b4-241024",
64
+ "@react-types/grid": "^3.0.0-nightly-fb28ab3b4-241024",
65
+ "@react-types/shared": "^3.0.0-nightly-fb28ab3b4-241024",
66
+ "@react-types/table": "^3.0.0-nightly-fb28ab3b4-241024",
67
67
  "@swc/helpers": "^0.5.0",
68
68
  "client-only": "^0.0.1",
69
- "react-aria": "^3.0.0-nightly-4f85a359f-241022",
70
- "react-stately": "^3.0.0-nightly-4f85a359f-241022",
69
+ "react-aria": "^3.0.0-nightly-fb28ab3b4-241024",
70
+ "react-stately": "^3.0.0-nightly-fb28ab3b4-241024",
71
71
  "use-sync-external-store": "^1.2.0"
72
72
  },
73
73
  "peerDependencies": {
@@ -65,7 +65,7 @@ export function useRenderDropIndicator(dragAndDropHooks?: DragAndDropHooks, drop
65
65
  export function useDndPersistedKeys(selectionManager: MultipleSelectionManager, dragAndDropHooks?: DragAndDropHooks, dropState?: DroppableCollectionState) {
66
66
  // Persist the focused key and the drop target key.
67
67
  let focusedKey = selectionManager.focusedKey;
68
- let dropTargetKey: Key | null = null;
68
+ let dropTargetKey: Key | null | undefined = null;
69
69
  if (dragAndDropHooks?.isVirtualDragging?.() && dropState?.target?.type === 'item') {
70
70
  dropTargetKey = dropState.target.key;
71
71
  if (dropState.target.dropPosition === 'after') {
@@ -75,6 +75,6 @@ export function useDndPersistedKeys(selectionManager: MultipleSelectionManager,
75
75
  }
76
76
 
77
77
  return useMemo(() => {
78
- return new Set([focusedKey, dropTargetKey].filter(k => k !== null));
78
+ return new Set([focusedKey, dropTargetKey].filter(k => k != null));
79
79
  }, [focusedKey, dropTargetKey]);
80
80
  }