@vectoriox/iox-builder 1.4.49 → 1.4.51
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
|
|
376
|
-
if (
|
|
377
|
-
|
|
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(
|
|
394
|
+
this.dropComplete$.next(cloned);
|
|
380
395
|
}
|
|
381
396
|
afterDrop?.();
|
|
382
397
|
return;
|
|
@@ -677,9 +692,8 @@ class DragEngineService {
|
|
|
677
692
|
// whose DOM element lives inside the dragged source wrapper.
|
|
678
693
|
if (this._sourceEl?.contains(el))
|
|
679
694
|
continue;
|
|
680
|
-
// Skip elements hidden by interaction pre-state
|
|
681
|
-
|
|
682
|
-
if (el.style.pointerEvents === 'none')
|
|
695
|
+
// Skip elements hidden by interaction pre-state, and any of their children.
|
|
696
|
+
if (el.closest('[data-iox-hidden]'))
|
|
683
697
|
continue;
|
|
684
698
|
const rect = this._dropzoneRectCache.get(id) ?? el.getBoundingClientRect();
|
|
685
699
|
if (px >= rect.left && px <= rect.right && py >= rect.top && py <= rect.bottom) {
|
|
@@ -1436,6 +1450,7 @@ class InteractionEngineService {
|
|
|
1436
1450
|
if (this.ENTRANCE_TYPES.has(action.type)) {
|
|
1437
1451
|
anim.finished.then(() => {
|
|
1438
1452
|
element.style.removeProperty('pointer-events');
|
|
1453
|
+
element.removeAttribute('data-iox-hidden');
|
|
1439
1454
|
this.preStatedElements.delete(element);
|
|
1440
1455
|
// Builder: clear inline pre-state so cancelling animations later
|
|
1441
1456
|
// doesn't leave the element invisible after a play preview.
|
|
@@ -1468,11 +1483,10 @@ class InteractionEngineService {
|
|
|
1468
1483
|
for (const [prop, val] of Object.entries(first)) {
|
|
1469
1484
|
element.style[prop] = String(val);
|
|
1470
1485
|
}
|
|
1471
|
-
//
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
}
|
|
1486
|
+
// Mark as hidden so the builder overlay and drag engine can ignore this element
|
|
1487
|
+
// and all of its children regardless of which entrance animation type is used.
|
|
1488
|
+
element.setAttribute('data-iox-hidden', '');
|
|
1489
|
+
element.style.setProperty('pointer-events', 'none');
|
|
1476
1490
|
this.preStatedElements.add(element);
|
|
1477
1491
|
}
|
|
1478
1492
|
clearInlineAnimationStyles(element) {
|
|
@@ -1480,6 +1494,7 @@ class InteractionEngineService {
|
|
|
1480
1494
|
element.style.removeProperty('transform');
|
|
1481
1495
|
element.style.removeProperty('visibility');
|
|
1482
1496
|
element.style.removeProperty('pointer-events');
|
|
1497
|
+
element.removeAttribute('data-iox-hidden');
|
|
1483
1498
|
}
|
|
1484
1499
|
reverseAction(element, action) {
|
|
1485
1500
|
const { keyframes } = this.buildAnimation(action);
|