@myissue/vue-website-page-builder 3.3.20 → 3.3.21

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.
@@ -1026,6 +1026,9 @@ export class PageBuilderService {
1026
1026
  const element = this.getElement.value
1027
1027
  if (!element) return
1028
1028
 
1029
+ // Remove 'selected' attribute before deletion
1030
+ element.removeAttribute('selected')
1031
+
1029
1032
  if (!element.parentNode) {
1030
1033
  this.pageBuilderStateStore.setComponent(null)
1031
1034
  this.pageBuilderStateStore.setElement(null)
@@ -1039,15 +1042,18 @@ export class PageBuilderService {
1039
1042
  this.pageBuilderStateStore.setNextSibling(element.nextSibling as HTMLElement | null)
1040
1043
  // Remove only the element itself from the DOM
1041
1044
  element.remove()
1042
- } else {
1043
- // If the element's parent is a section, remove the whole component (section)
1044
- await this.deleteComponentFromDOM()
1045
- // No need to call element.remove() here, as the section is already removed
1046
1045
  }
1047
1046
 
1048
1047
  // Clear selection state
1049
1048
  this.pageBuilderStateStore.setComponent(null)
1050
1049
  this.pageBuilderStateStore.setElement(null)
1050
+
1051
+ // Deselect any selected or hovered elements in the builder UI
1052
+ await this.clearHtmlSelection()
1053
+ // Wait for Vue to finish DOM updates before attaching event listeners. This ensure elements exist in the DOM.
1054
+ await nextTick()
1055
+ // Attach event listeners to all editable elements in the Builder
1056
+ await this.#addListenersToEditableElements()
1051
1057
  }
1052
1058
 
1053
1059
  async restoreDeletedElementToDOM() {
@@ -130,3 +130,29 @@ These styles affect all HTML elements (like input, button, h1, etc.) in the cons
130
130
  gap: 6px 0px;
131
131
  justify-content: center;
132
132
  }
133
+
134
+ /* Hide the panel by default */
135
+ #settingsPanel {
136
+ opacity: 0;
137
+ pointer-events: none;
138
+ /* matches pbx-translate-y-2 */
139
+ transform: translateY(1rem);
140
+ transition: all 0.3s ease-out;
141
+ }
142
+
143
+ /* Show the panel when the parent with [selected] is hovered */
144
+ [selected]:hover #settingsPanel {
145
+ opacity: 1;
146
+ pointer-events: auto;
147
+ /* visible position */
148
+ transform: translateY(1);
149
+ }
150
+
151
+ #contains-pagebuilder {
152
+ position: relative; /* make this the positioning context for absolute children */
153
+ overflow-y: auto;
154
+ }
155
+ #settingsPanel {
156
+ position: absolute;
157
+ /* top and left will be set dynamically */
158
+ }