@vectoriox/iox-builder 1.4.48 → 1.4.50

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.
@@ -372,11 +372,26 @@ class DragEngineService {
372
372
  handleDrop(children, event, dropListId, cdr, afterDrop) {
373
373
  const { payload, insertIndex } = event;
374
374
  if (payload.type === 'external') {
375
- const config = this.registry.createConfig(payload.data);
376
- if (config) {
377
- children.splice(insertIndex, 0, config);
375
+ const data = payload.data;
376
+ if (typeof data === 'string') {
377
+ // Built-in component type — create from registry.
378
+ const config = this.registry.createConfig(data);
379
+ if (config) {
380
+ children.splice(insertIndex, 0, config);
381
+ cdr.detectChanges();
382
+ this.dropComplete$.next(config);
383
+ }
384
+ }
385
+ else {
386
+ // Full block object { node, symbolId, syncInstances } or bare ComponentNode.
387
+ const nodeData = data.node ?? data;
388
+ const cloned = deepCloneNode(nodeData);
389
+ if (data.syncInstances && data.symbolId) {
390
+ cloned.symbolId = data.symbolId;
391
+ }
392
+ children.splice(insertIndex, 0, cloned);
378
393
  cdr.detectChanges();
379
- this.dropComplete$.next(config);
394
+ this.dropComplete$.next(cloned);
380
395
  }
381
396
  afterDrop?.();
382
397
  return;