| 16 | // Append a generated key to the item type so they can only be reordered within this list and not dragged elsewhere. |
| 17 | let {dragAndDropHooks} = useDragAndDrop({ |
| 18 | getItems(keys) { |
| 19 | return [...keys].map(key => { |
| 20 | let item = list.getItem(key); |
| 21 | // Setup the drag types and associated info for each dragged item. |
| 22 | return { |
| 23 | 'custom-app-type-reorder': JSON.stringify(item), |
| 24 | 'text/plain': item?.name ?? '' |
| 25 | }; |
| 26 | }); |
| 27 | }, |
| 28 | acceptedDragTypes: ['custom-app-type-reorder'], |
| 29 | onReorder: async e => { |
| 30 | let {keys, target, dropOperation} = e; |