@use-kona/editor 0.1.24-dnd.2 → 0.1.24-dnd.4

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.
@@ -98,7 +98,7 @@ class DnDPlugin {
98
98
  const hoverClientY = clientOffset.y - hoverBoundingRect.top;
99
99
  hoverClientY < hoverMiddleY ? setDropPosition('top') : setDropPosition('bottom');
100
100
  },
101
- drop (item, monitor) {
101
+ drop: (item, monitor)=>{
102
102
  const itemType = monitor.getItemType();
103
103
  const sourceTo = ReactEditor.findPath(editor, props.element);
104
104
  if (!sourceTo) return;
@@ -115,6 +115,7 @@ class DnDPlugin {
115
115
  return;
116
116
  }
117
117
  console.log('customDropHandler not found', itemType);
118
+ options.customDropHandlers && console.log('valid drop handlers are', Object.keys(options.customDropHandlers));
118
119
  switch(itemType){
119
120
  case NativeTypes.FILE:
120
121
  options.onDropFiles(editor, item.files, insertAt);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@use-kona/editor",
3
- "version": "0.1.24-dnd.2",
3
+ "version": "0.1.24-dnd.4",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./src/index.ts"
@@ -151,7 +151,7 @@ export class DnDPlugin implements IPlugin {
151
151
  setDropPosition('bottom');
152
152
  }
153
153
  },
154
- drop(item, monitor) {
154
+ drop: (item, monitor) => {
155
155
  const itemType = monitor.getItemType();
156
156
 
157
157
  const sourceTo = ReactEditor.findPath(editor, props.element);
@@ -175,10 +175,11 @@ export class DnDPlugin implements IPlugin {
175
175
  return;
176
176
  } else {
177
177
  console.log('customDropHandler not found', itemType);
178
- console.log(
179
- 'valid drop handlers are',
180
- Object.keys(options.customDropHandlers),
181
- );
178
+ options.customDropHandlers &&
179
+ console.log(
180
+ 'valid drop handlers are',
181
+ Object.keys(options.customDropHandlers),
182
+ );
182
183
  }
183
184
 
184
185
  switch (itemType) {