@superblocksteam/library 2.0.41-next.53 → 2.0.41-next.55

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.
package/dist/index.js CHANGED
@@ -3407,11 +3407,12 @@ const getWidgetNode = (instanceId) => {
3407
3407
  const type = root_store_default.nameManager.getExistingIdentifier(instanceId)?.type;
3408
3408
  return document?.querySelector(`[data-sb-selector="${getEditWrapperIdWithType(instanceId, type)}"]`);
3409
3409
  };
3410
- const doesInteractionLayerContainInstance = (possibleParent, possibleChild) => {
3410
+ const doesInteractionLayerContainInstance = (possibleParent, possibleChild, handleNewlyCreatedComponents = false) => {
3411
3411
  if (!possibleParent || !possibleChild) return false;
3412
3412
  const editStore = getEditStore();
3413
3413
  const parentMeta = editStore.runtimeEntitiesManager.getEditorWidgetMeta(possibleParent);
3414
3414
  const childMeta = editStore.runtimeEntitiesManager.getEditorWidgetMeta(possibleChild);
3415
+ if (!childMeta?.interactionLayerInstanceId && handleNewlyCreatedComponents) return true;
3415
3416
  if (editStore.interactionLayerManager.interactionLayerInstanceIds.has(possibleParent)) return possibleChild === possibleParent || childMeta?.interactionLayerInstanceId === possibleParent;
3416
3417
  return parentMeta?.interactionLayerInstanceId === childMeta?.interactionLayerInstanceId;
3417
3418
  };
@@ -10363,7 +10364,7 @@ function useDialogEditing(props) {
10363
10364
  if (isEditing && instanceId) {
10364
10365
  if (prevIsOpenRef.current !== isOpen && !(prevIsOpenRef.current === void 0 && isOpen === false)) return;
10365
10366
  if (isOpen) {
10366
- if (selectedInstanceId && selectedInstanceId !== instanceId && !doesInteractionLayerContainInstance(instanceId, selectedInstanceId)) update((entity) => {
10367
+ if (selectedInstanceId && selectedInstanceId !== instanceId && !doesInteractionLayerContainInstance(instanceId, selectedInstanceId, true)) update((entity) => {
10367
10368
  set(entity, isOpenPropertyName, false);
10368
10369
  });
10369
10370
  } else if (selectedInstanceId === instanceId || selectedInstanceId && doesInteractionLayerContainInstance(instanceId, selectedInstanceId)) update((entity) => {