@marianmeres/stuic 1.69.0 → 1.70.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,10 @@ 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?)
93
- e.preventDefault();
91
+ options?.isDraggedOver?.set(options.id);
92
+ if (_isFn(options.onDragover)) {
93
+ return options.onDragover(e);
94
+ }
94
95
  };
95
96
  const onDragleave = (e) => {
96
97
  _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.70.0",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run package && node ./scripts/date.js",