@noya-app/noya-file-explorer 0.0.8 → 0.0.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noya-app/noya-file-explorer",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",
@@ -20,11 +20,11 @@
20
20
  "dev": "npm run build:main -- --watch"
21
21
  },
22
22
  "dependencies": {
23
- "@noya-app/noya-designsystem": "0.1.56",
23
+ "@noya-app/noya-designsystem": "0.1.58",
24
24
  "@noya-app/noya-icons": "0.1.10",
25
- "@noya-app/noya-multiplayer-react": "0.1.57",
25
+ "@noya-app/noya-multiplayer-react": "0.1.58",
26
26
  "@noya-app/noya-keymap": "0.1.3",
27
- "@noya-app/react-utils": "0.1.18",
27
+ "@noya-app/react-utils": "0.1.19",
28
28
  "@noya-app/noya-utils": "0.1.5",
29
29
  "@noya-app/noya-schemas": "0.1.5",
30
30
  "imfs": "^0.1.0",
@@ -232,12 +232,19 @@ type MediaCollectionProps = {
232
232
  sortable?: boolean;
233
233
  } & Pick<
234
234
  CollectionProps<MediaItem, MenuAction>,
235
- "size" | "expandable" | "renamable" | "scrollable" | "renderEmptyState"
235
+ | "sortableId"
236
+ | "size"
237
+ | "expandable"
238
+ | "renamable"
239
+ | "scrollable"
240
+ | "renderEmptyState"
241
+ | "sharedDragProps"
236
242
  >;
237
243
 
238
244
  export const MediaCollection = memo(
239
245
  forwardRef<MediaCollectionRef, MediaCollectionProps>(function MediaCollection(
240
246
  {
247
+ sortableId,
241
248
  onSelectionChange,
242
249
  selectedIds: selectedIdsProp,
243
250
  media,
@@ -261,6 +268,7 @@ export const MediaCollection = memo(
261
268
  scrollable = false,
262
269
  sortable = false,
263
270
  renderEmptyState,
271
+ sharedDragProps,
264
272
  },
265
273
  ref
266
274
  ) {
@@ -772,7 +780,9 @@ export const MediaCollection = memo(
772
780
  >
773
781
  <FileExplorerCollection<MediaItem, MenuAction>
774
782
  ref={collectionRef}
783
+ sortableId={sortableId}
775
784
  scrollable={scrollable}
785
+ sharedDragProps={sharedDragProps}
776
786
  items={visibleItems}
777
787
  viewType={viewType}
778
788
  size={size}
@@ -836,11 +846,17 @@ export const MediaCollection = memo(
836
846
  );
837
847
  return parentIndex === -1 ? undefined : parentIndex;
838
848
  }}
839
- acceptsDrop={(
840
- sourceIndex: number,
841
- targetIndex: number,
842
- position: string
843
- ) => {
849
+ acceptsDrop={({
850
+ sourceIndex,
851
+ targetIndex,
852
+ position,
853
+ sourceListId,
854
+ targetListId,
855
+ }) => {
856
+ if (sourceListId !== targetListId) {
857
+ return false;
858
+ }
859
+
844
860
  const sourceItem = visibleItems[sourceIndex];
845
861
  const targetItem = visibleItems[targetIndex];
846
862
 
@@ -866,11 +882,7 @@ export const MediaCollection = memo(
866
882
 
867
883
  return true;
868
884
  }}
869
- onMoveItem={(
870
- sourceIndex: number,
871
- targetIndex: number,
872
- position: string
873
- ) => {
885
+ onMoveItem={({ sourceIndex, targetIndex, position }) => {
874
886
  const sourceItem = visibleItems[sourceIndex];
875
887
  const targetItem = visibleItems[targetIndex];
876
888
  if (position === "inside") {