@use-kona/editor 0.1.24-dnd.5 → 0.1.24-dnd.6
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.
|
@@ -55,12 +55,14 @@ class DnDPlugin {
|
|
|
55
55
|
const nodes = selected.length > 0 && selected.includes(currentElement.nodeId) ? getNodesByNodeIds(editor, selected) : [
|
|
56
56
|
structuredClone(props.element)
|
|
57
57
|
];
|
|
58
|
+
const item = this.options.customTypes?.[currentElement.type].getData?.(currentElement);
|
|
58
59
|
const items = nodes.map((node)=>{
|
|
59
60
|
if (this.options.customTypes?.[node.type]) return this.options.customTypes[node.type].getData?.(node);
|
|
60
61
|
return null;
|
|
61
62
|
}).filter(Boolean);
|
|
62
63
|
const dragItem = {
|
|
63
64
|
nodes,
|
|
65
|
+
item,
|
|
64
66
|
items,
|
|
65
67
|
source: {
|
|
66
68
|
editorId: this.getEditorId(editor),
|
package/package.json
CHANGED
|
@@ -90,6 +90,11 @@ export class DnDPlugin implements IPlugin {
|
|
|
90
90
|
? getNodesByNodeIds(editor, selected)
|
|
91
91
|
: [structuredClone(props.element as NodeWithId)];
|
|
92
92
|
|
|
93
|
+
const item =
|
|
94
|
+
this.options.customTypes?.[currentElement.type].getData?.(
|
|
95
|
+
currentElement,
|
|
96
|
+
);
|
|
97
|
+
|
|
93
98
|
const items = nodes
|
|
94
99
|
.map((node) => {
|
|
95
100
|
if (this.options.customTypes?.[node.type]) {
|
|
@@ -101,6 +106,7 @@ export class DnDPlugin implements IPlugin {
|
|
|
101
106
|
|
|
102
107
|
const dragItem: EditorDragItem = {
|
|
103
108
|
nodes,
|
|
109
|
+
item,
|
|
104
110
|
items,
|
|
105
111
|
source: {
|
|
106
112
|
editorId: this.getEditorId(editor),
|