@marianmeres/stuic 1.69.0 → 1.71.0

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.
@@ -18,7 +18,7 @@ export interface DroppableOptions {
18
18
  id?: string;
19
19
  enabled?: boolean;
20
20
  onDrop: (data: any, e: DragEvent) => void;
21
- onDragover?: (data: any) => void;
21
+ onDragover?: (e: DragEvent) => void;
22
22
  dropEffect?: DropEffect;
23
23
  isDraggedOver?: Writable<string | null>;
24
24
  logger?: (...args: any[]) => void;
@@ -88,9 +88,13 @@ export const droppable = (node, options) => {
88
88
  };
89
89
  const onDragover = (e) => {
90
90
  // _log('onDragover', e.dataTransfer); // too much spam
91
- // prevent default to allow drop
92
- // this alse prevents animation (todo: really?)
91
+ // this is important, otherwise onDrop will no be fired
92
+ // (so we're preventing default not to prevent future onDrop)
93
93
  e.preventDefault();
94
+ options?.isDraggedOver?.set(options.id);
95
+ if (_isFn(options.onDragover)) {
96
+ return options.onDragover(e);
97
+ }
94
98
  };
95
99
  const onDragleave = (e) => {
96
100
  _log('onDragleave', e.dataTransfer);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marianmeres/stuic",
3
- "version": "1.69.0",
3
+ "version": "1.71.0",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run package && node ./scripts/date.js",