react-aria-components 3.0.0-nightly-77b3442e4-250521 → 3.0.0-nightly-0784c3d29-250523
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/dist/Collection.main.js +31 -7
- package/dist/Collection.main.js.map +1 -1
- package/dist/Collection.mjs +32 -9
- package/dist/Collection.module.js +32 -9
- package/dist/Collection.module.js.map +1 -1
- package/dist/Tree.main.js +28 -12
- package/dist/Tree.main.js.map +1 -1
- package/dist/Tree.mjs +29 -13
- package/dist/Tree.module.js +29 -13
- package/dist/Tree.module.js.map +1 -1
- package/dist/Virtualizer.main.js +8 -9
- package/dist/Virtualizer.main.js.map +1 -1
- package/dist/Virtualizer.mjs +9 -10
- package/dist/Virtualizer.module.js +9 -10
- package/dist/Virtualizer.module.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +26 -26
- package/src/Collection.tsx +39 -5
- package/src/Tree.tsx +38 -8
- package/src/Virtualizer.tsx +7 -8
package/src/Virtualizer.tsx
CHANGED
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import {CollectionBranchProps, CollectionRenderer, CollectionRendererContext, CollectionRootProps} from './Collection';
|
|
14
|
-
import {
|
|
13
|
+
import {CollectionBranchProps, CollectionRenderer, CollectionRendererContext, CollectionRootProps, renderAfterDropIndicators} from './Collection';
|
|
14
|
+
import {DropTargetDelegate, ItemDropTarget, Node} from '@react-types/shared';
|
|
15
15
|
import {Layout, ReusableView, useVirtualizerState, VirtualizerState} from '@react-stately/virtualizer';
|
|
16
16
|
import React, {createContext, JSX, ReactNode, useContext, useMemo} from 'react';
|
|
17
17
|
import {useScrollView, VirtualizerItem} from '@react-aria/virtualizer';
|
|
@@ -137,13 +137,13 @@ function renderWrapper(
|
|
|
137
137
|
);
|
|
138
138
|
|
|
139
139
|
let {collection, layout} = reusableView.virtualizer;
|
|
140
|
-
let
|
|
141
|
-
if (type === 'item' && renderDropIndicator && layout.getDropTargetLayoutInfo) {
|
|
140
|
+
let node = reusableView.content!;
|
|
141
|
+
if (node.type === 'item' && renderDropIndicator && layout.getDropTargetLayoutInfo) {
|
|
142
142
|
rendered = (
|
|
143
143
|
<React.Fragment key={reusableView.key}>
|
|
144
|
-
{renderDropIndicatorWrapper(parent, reusableView, 'before', renderDropIndicator)}
|
|
144
|
+
{renderDropIndicatorWrapper(parent, reusableView, {type: 'item', key: reusableView.content!.key, dropPosition: 'before'}, renderDropIndicator)}
|
|
145
145
|
{rendered}
|
|
146
|
-
{collection
|
|
146
|
+
{renderAfterDropIndicators(collection, node, target => renderDropIndicatorWrapper(parent, reusableView, target, renderDropIndicator))}
|
|
147
147
|
</React.Fragment>
|
|
148
148
|
);
|
|
149
149
|
}
|
|
@@ -154,10 +154,9 @@ function renderWrapper(
|
|
|
154
154
|
function renderDropIndicatorWrapper(
|
|
155
155
|
parent: View | null,
|
|
156
156
|
reusableView: View,
|
|
157
|
-
|
|
157
|
+
target: ItemDropTarget,
|
|
158
158
|
renderDropIndicator: (target: ItemDropTarget) => ReactNode
|
|
159
159
|
) {
|
|
160
|
-
let target: DropTarget = {type: 'item', key: reusableView.content!.key, dropPosition};
|
|
161
160
|
let indicator = renderDropIndicator(target);
|
|
162
161
|
if (indicator) {
|
|
163
162
|
let layoutInfo = reusableView.virtualizer.layout.getDropTargetLayoutInfo!(target);
|