@myissue/vue-website-page-builder 3.3.18 → 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.
@@ -30,6 +30,10 @@ const props = defineProps({
30
30
  type: Object,
31
31
  default: null,
32
32
  },
33
+ showCloseButton: {
34
+ type: Boolean,
35
+ default: false,
36
+ },
33
37
  })
34
38
 
35
39
  // Use shared Pinia instance for PageBuilder package
@@ -39,14 +43,18 @@ const pageBuilderStateStore = sharedPageBuilderStore
39
43
 
40
44
  // Provide store for child components (all pointing to the same consolidated store)
41
45
  provide('pageBuilderStateStore', pageBuilderStateStore)
42
-
43
46
  // Provide the internal Pinia instance for components that need to create stores
44
47
  provide('internalPinia', internalPinia)
45
-
46
48
  // Provide custom components for child components
47
49
  provide('CustomMediaComponent', props.CustomMediaLibraryComponent)
48
50
  provide('CustomBuilderComponents', props.CustomBuilderComponents)
49
51
 
52
+ const emit = defineEmits(['handleClosePageBuilder'])
53
+
54
+ const closePageBuilder = function () {
55
+ emit('handleClosePageBuilder')
56
+ }
57
+
50
58
  // Provide modal close function for custom components
51
59
  const closeAddComponentModal = () => {
52
60
  showModalAddComponent.value = false
@@ -106,6 +114,10 @@ const getElement = computed(() => {
106
114
  return pageBuilderStateStore.getElement
107
115
  })
108
116
 
117
+ const getRestoredElement = computed(() => {
118
+ return pageBuilderStateStore.getRestoredElement
119
+ })
120
+
109
121
  const getComponents = computed(() => {
110
122
  return pageBuilderStateStore.getComponents
111
123
  })
@@ -187,8 +199,6 @@ const secondModalButtonResumeEditingFunction = ref(null)
187
199
  const thirdModalButtonResumeEditingFunction = ref(null)
188
200
 
189
201
  const handlerRumeEditingForUpdate = async function () {
190
- await pageBuilderService.clearHtmlSelection()
191
-
192
202
  typeModal.value = 'warning'
193
203
  showModalResumeEditing.value = true
194
204
 
@@ -260,8 +270,83 @@ const ensureBuilderInitialized = function () {
260
270
  }
261
271
  }
262
272
 
273
+ const pbxToolBar = ref(null)
274
+
275
+ let lastToolbarLeft = null
276
+ let lastToolbarTop = null
277
+
278
+ function updatePanelPosition() {
279
+ const container = pbxToolBar.value
280
+ const editToolbar = container && container.querySelector('#editToolbar')
281
+ const restored = getRestoredElement.value
282
+
283
+ if (!container || !editToolbar) return
284
+
285
+ const selected = container.querySelector('[selected]')
286
+
287
+ if (selected && typeof selected.getBoundingClientRect === 'function') {
288
+ const selectedRect = selected.getBoundingClientRect()
289
+ const containerRect = container.getBoundingClientRect()
290
+
291
+ // Position editToolbar just above selected element, with a gap
292
+ const left =
293
+ selectedRect.left - containerRect.left + selectedRect.width / 2 - editToolbar.offsetWidth / 2
294
+
295
+ const GAP = 20 // px
296
+ const proposedTop =
297
+ selectedRect.top - containerRect.top + container.scrollTop - editToolbar.offsetHeight - GAP
298
+
299
+ const top = Math.max(0, proposedTop)
300
+
301
+ editToolbar.style.position = 'absolute'
302
+ editToolbar.style.left = `${left}px`
303
+ editToolbar.style.top = `${top}px`
304
+ editToolbar.style.opacity = '1'
305
+ editToolbar.style.pointerEvents = 'auto'
306
+ editToolbar.style.transform = 'translateY(0)'
307
+
308
+ // Store last position
309
+ lastToolbarLeft = left
310
+ lastToolbarTop = top
311
+ } else if (restored && lastToolbarLeft !== null && lastToolbarTop !== null) {
312
+ // Use last position for restore icon
313
+ editToolbar.style.position = 'absolute'
314
+ editToolbar.style.left = `${lastToolbarLeft}px`
315
+ editToolbar.style.top = `${lastToolbarTop}px`
316
+ editToolbar.style.opacity = '1'
317
+ editToolbar.style.pointerEvents = 'auto'
318
+ editToolbar.style.transform = 'translateY(0)'
319
+ } else {
320
+ editToolbar.style.opacity = '0'
321
+ editToolbar.style.pointerEvents = 'none'
322
+ editToolbar.style.transform = 'translateY(0.5rem)'
323
+ }
324
+ }
325
+
263
326
  onMounted(async () => {
264
327
  await pageBuilderService.tryMountPendingComponents()
328
+
329
+ updatePanelPosition()
330
+
331
+ // Set up MutationObserver and event listeners
332
+ const container = pbxToolBar.value
333
+ if (!container) return
334
+
335
+ const observer = new MutationObserver(updatePanelPosition)
336
+ observer.observe(container, {
337
+ childList: true,
338
+ subtree: true,
339
+ attributes: true,
340
+ attributeFilter: ['selected'],
341
+ })
342
+
343
+ window.addEventListener('scroll', updatePanelPosition)
344
+ window.addEventListener('resize', updatePanelPosition)
345
+
346
+ //
347
+ //
348
+ //
349
+ //
265
350
  // Check if Builder started
266
351
  await delay(10000)
267
352
  ensureBuilderInitialized()
@@ -280,64 +365,19 @@ onMounted(async () => {
280
365
  <div
281
366
  class="pbx-font-sans pbx-max-w-full pbx-m-1 pbx-border pbx-border-gray-400 pbx-inset-x-0 pbx-z-10 pbx-bg-white pbx-overflow-x-auto"
282
367
  >
283
- <div id="pagebuilder-top-area" class="lg:pbx-px-4 pbx-pt-2 pbx-pb-4 pbx-mx-4 pbx-mb-4 pbx-mt-2">
284
- <GlobalLoader v-if="getIsLoadingGlobal & !openAppNotStartedModal"></GlobalLoader>
285
- <ModalBuilder
286
- title="The builder hasn’t started yet"
287
- :showModalBuilder="openAppNotStartedModal"
288
- @closeMainModalBuilder="handlAppNotStartedModal"
289
- type="delete"
290
- maxWidth="2xl"
291
- :noBackgroundOpacity="true"
292
- >
293
- The builder hasn’t started yet. If this screen doesn’t go away soon, it may just need a
294
- little setup in the background. You can safely contact support and ask them to initialize
295
- the builder by running the startBuilder method for this resource.
296
- </ModalBuilder>
297
- <div
298
- @click.self="
299
- async () => {
300
- await pageBuilderService.clearHtmlSelection()
301
- }
302
- "
303
- class="pbx-min-h-24 pbx-flex pbx-justify-between pbx-items-center pbx-pb-2 pbx-border-b pbx-border-gray-200"
304
- >
305
- <!-- Logo # start -->
306
- <div
307
- @click="
308
- async () => {
309
- await pageBuilderService.clearHtmlSelection()
310
- }
311
- "
312
- >
313
- <div
314
- v-if="
315
- getPageBuilderConfig &&
316
- getPageBuilderConfig.pageBuilderLogo &&
317
- getPageBuilderConfig.pageBuilderLogo.src
318
- "
319
- class="pbx-flex pbx-items-center pbx-divide-x pbx-divide-gray-200"
320
- >
321
- <div id="pagebuilder-logo-main" class="pbx-pr-4">
322
- <img class="pbx-h-6" :src="getPageBuilderConfig.pageBuilderLogo.src" alt="Logo" />
323
- </div>
324
- <span class="pbx-myPrimaryParagraph pbx-font-medium pbx-pl-4">Editing Page </span>
325
- </div>
326
- <div v-else>
327
- <div class="pbx-pr-6">
328
- <span class="pbx-myPrimaryParagraph pbx-font-medium">Editing Page </span>
329
- </div>
330
- </div>
331
- </div>
332
- <!-- Logo # end -->
333
-
334
- <!-- Options # Start -->
335
- <div>
336
- <ToolbarOption></ToolbarOption>
337
- </div>
338
- <!-- Options # Start -->
339
- </div>
340
- </div>
368
+ <GlobalLoader v-if="getIsLoadingGlobal & !openAppNotStartedModal"></GlobalLoader>
369
+ <ModalBuilder
370
+ title="The builder hasn’t started yet"
371
+ :showModalBuilder="openAppNotStartedModal"
372
+ @closeMainModalBuilder="handlAppNotStartedModal"
373
+ type="delete"
374
+ maxWidth="2xl"
375
+ :noBackgroundOpacity="true"
376
+ >
377
+ The builder hasn’t started yet. If this screen doesn’t go away soon, it may just need a little
378
+ setup in the background. You can safely contact support and ask them to initialize the builder
379
+ by running the startBuilder method for this resource.
380
+ </ModalBuilder>
341
381
 
342
382
  <BuilderComponents
343
383
  v-if="showModalAddComponent"
@@ -393,78 +433,114 @@ onMounted(async () => {
393
433
  </DynamicModalBuilder>
394
434
 
395
435
  <div>
396
- <div class="pbx-relative pbx-h-full pbx-flex pbx-pb-2 pbx-gap-2">
397
- <div
398
- @click.self="
399
- async () => {
400
- await pageBuilderService.clearHtmlSelection()
401
- }
436
+ <!-- Top Layout Save And Reset Area - Start -->
437
+ <div
438
+ id="pagebuilder-toolbar-area"
439
+ class="pbx-flex pbx-items-center pbx-justify-between pbx-bg-myPrimaryLightGrayColor pbx-border-b pbx-border-gray-200 pbx-mb-2 lg:pbx-px-6 pbx-px-4"
440
+ >
441
+ <template
442
+ v-if="
443
+ getPageBuilderConfig &&
444
+ getPageBuilderConfig.pageBuilderLogo &&
445
+ getPageBuilderConfig.pageBuilderLogo.src
402
446
  "
403
- id="pagebuilder-left-area"
404
- class="pbx-min-w-[3.5rem] pbx-pt-7 pbx-pb-2 pbx-ml-2 pbx-bg-myPrimaryLightGrayColor pbx-rounded-full pbx-shadow-sm"
405
447
  >
406
- <div class="pbx-mx-2 pbx-flex pbx-flex-col pbx-myPrimaryGap pbx-items-stretch">
407
- <div class="pbx-flex pbx-gap-2 pbx-items-center pbx-justify-center">
408
- <button
409
- type="button"
410
- @click="
411
- () => {
412
- pageBuilderStateStore.setComponentArrayAddMethod('unshift')
413
- handleAddComponent()
414
- }
415
- "
416
- class="pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-50 pbx-aspect-square hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white focus-visible:pbx-ring-0"
417
- >
418
- <span class="pbx-myMediumIcon material-symbols-outlined"> interests </span>
419
- </button>
420
- </div>
448
+ <!-- Logo # start -->
449
+ <div
450
+ @click.self="
451
+ async () => {
452
+ await pageBuilderService.clearHtmlSelection()
453
+ }
454
+ "
455
+ class="pbx-flex pbx-justify-start pbx-py-2 pbx-min-h-20 pbx-max-h-20 pbx-w-full"
456
+ >
421
457
  <div
422
- @click.self="
458
+ @click="
423
459
  async () => {
424
460
  await pageBuilderService.clearHtmlSelection()
425
461
  }
426
462
  "
463
+ class="pbx-flex pbx-items-center pbx-justify-center"
427
464
  >
428
- <ComponentTopMenu v-if="getElement"></ComponentTopMenu>
465
+ <div id="pagebuilder-logo-main" class="pbx-flex pbx-items-center pbx-justify-center">
466
+ <img class="pbx-h-6" :src="getPageBuilderConfig.pageBuilderLogo.src" alt="Logo" />
467
+ </div>
429
468
  </div>
430
469
  </div>
431
- </div>
432
- <main
433
- class="pbx-flex pbx-flex-col pbx-h-full pbx-grow pbx-rounded-tr-2xl pbx-rounded-tl-2xl pbx-border pbx-border-gray-200 pbx-items-stretch"
434
- :class="{ 'pbx-mr-2': !getMenuRight, '': getMenuRight }"
470
+ </template>
471
+ <!-- Logo # end -->
472
+
473
+ <div
474
+ @click.self="
475
+ async () => {
476
+ await pageBuilderService.clearHtmlSelection()
477
+ }
478
+ "
479
+ class="pbx-flex pbx-justify-center pbx-items-center pbx-py-2 pbx-min-h-20 pbx-max-h-20 pbx-w-full"
435
480
  >
436
- <div
437
- id="pagebuilder-toolbar-area"
438
- class="pbx-flex pbx-items-center pbx-justify-between pbx-rounded-t-2xl pbx-min-w-[30rem] pbx-bg-myPrimaryLightGrayColor pbx-border-b pbx-border-gray-200"
439
- >
440
- <div
441
- @click.self="
481
+ <div class="pbx-flex pbx-items-center pbx-justify-center">
482
+ <!-- Save Start -->
483
+ <button
484
+ class="pbx-mySecondaryButton pbx-h-6 pbx-flex pbx-gap-2 pbx-mr-2"
485
+ @click.stop="
442
486
  async () => {
443
487
  await pageBuilderService.clearHtmlSelection()
488
+ await pageBuilderService.handleManualSave()
444
489
  }
445
490
  "
446
- class="pbx-min-w-max pbx-pr-2 pbx-flex pbx-myPrimaryGap pbx-items-center pbx-pt-2 pbx-pb-2 pbx-pl-2 pbx-h-24 pbx-w-full"
491
+ type="button"
492
+ :disabled="getIsSaving"
493
+ >
494
+ <div
495
+ v-if="!getIsSaving"
496
+ class="pbx-h-10 pbx-w-4 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-justify-center"
497
+ >
498
+ <span class="material-symbols-outlined">save</span>
499
+ </div>
500
+ <div
501
+ v-if="getIsSaving"
502
+ class="pbx-h-10 pbx-w-4 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-justify-center"
503
+ >
504
+ <span class="pbx-relative pbx-flex pbx-size-3">
505
+ <span
506
+ class="pbx-absolute pbx-inline-flex pbx-h-full pbx-w-full pbx-animate-ping pbx-rounded-full pbx-bg-gray-400 pbx-opacity-75"
507
+ ></span>
508
+ <span
509
+ class="pbx-relative pbx-inline-flex pbx-size-3 pbx-rounded-full pbx-bg-green-200"
510
+ ></span>
511
+ </span>
512
+ </div>
513
+ <div>Save</div>
514
+ </button>
515
+ <!-- Save End -->
516
+
517
+ <!-- Restore Start -->
518
+ <template
519
+ v-if="
520
+ getPageBuilderConfig &&
521
+ getPageBuilderConfig.updateOrCreate &&
522
+ getPageBuilderConfig.updateOrCreate.formType === 'update'
523
+ "
447
524
  >
448
- <!-- Save Start -->
449
525
  <button
450
526
  class="pbx-mySecondaryButton pbx-h-6 pbx-flex pbx-gap-2"
451
527
  @click.stop="
452
528
  async () => {
453
529
  await pageBuilderService.clearHtmlSelection()
454
- await pageBuilderService.handleManualSave()
530
+ await handleRestoreOriginalContent()
455
531
  }
456
532
  "
457
533
  type="button"
458
- :disabled="getIsSaving"
534
+ :disabled="getIsRestoring"
459
535
  >
460
536
  <div
461
- v-if="!getIsSaving"
537
+ v-if="!getIsRestoring"
462
538
  class="pbx-h-10 pbx-w-4 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-justify-center"
463
539
  >
464
- <span class="material-symbols-outlined">save</span>
540
+ <span class="material-symbols-outlined"> settings_backup_restore </span>
465
541
  </div>
466
542
  <div
467
- v-if="getIsSaving"
543
+ v-if="getIsRestoring"
468
544
  class="pbx-h-10 pbx-w-4 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-justify-center"
469
545
  >
470
546
  <span class="pbx-relative pbx-flex pbx-size-3">
@@ -476,154 +552,172 @@ onMounted(async () => {
476
552
  ></span>
477
553
  </span>
478
554
  </div>
479
- <div>Save</div>
555
+ <div class="lg:pbx-block pbx-hidden">
556
+ <span> Reset Page </span>
557
+ </div>
480
558
  </button>
481
- <!-- Save End -->
482
-
483
- <!-- Restore Start -->
484
- <template
485
- v-if="
486
- getPageBuilderConfig &&
487
- getPageBuilderConfig.updateOrCreate &&
488
- getPageBuilderConfig.updateOrCreate.formType === 'update'
489
- "
490
- >
491
- <button
492
- class="pbx-mySecondaryButton pbx-h-6 pbx-flex pbx-gap-2"
493
- @click.stop="
494
- async () => {
495
- await pageBuilderService.clearHtmlSelection()
496
- await handleRestoreOriginalContent()
497
- }
498
- "
499
- type="button"
500
- :disabled="getIsRestoring"
501
- >
502
- <div
503
- v-if="!getIsRestoring"
504
- class="pbx-h-10 pbx-w-4 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-justify-center"
505
- >
506
- <span class="material-symbols-outlined"> settings_backup_restore </span>
507
- </div>
508
- <div
509
- v-if="getIsRestoring"
510
- class="pbx-h-10 pbx-w-4 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-justify-center"
511
- >
512
- <span class="pbx-relative pbx-flex pbx-size-3">
513
- <span
514
- class="pbx-absolute pbx-inline-flex pbx-h-full pbx-w-full pbx-animate-ping pbx-rounded-full pbx-bg-gray-400 pbx-opacity-75"
515
- ></span>
516
- <span
517
- class="pbx-relative pbx-inline-flex pbx-size-3 pbx-rounded-full pbx-bg-green-200"
518
- ></span>
519
- </span>
520
- </div>
521
- <div class="lg:pbx-block pbx-hidden">
522
- <span> Reset Page </span>
523
- </div>
524
- </button>
525
- </template>
526
- <!-- Restore End -->
527
- </div>
559
+ </template>
560
+ <!-- Restore End -->
561
+ </div>
562
+ </div>
528
563
 
529
- <div
530
- @click.self="
531
- async () => {
532
- await pageBuilderService.clearHtmlSelection()
564
+ <div
565
+ @click.self="
566
+ async () => {
567
+ await pageBuilderService.clearHtmlSelection()
568
+ }
569
+ "
570
+ class="pbx-flex pbx-justify-center pbx-items-center pbx-py-2 pbx-min-h-20 pbx-max-h-20 pbx-w-full"
571
+ >
572
+ <div
573
+ @click.self="
574
+ async () => {
575
+ await pageBuilderService.clearHtmlSelection()
576
+ }
577
+ "
578
+ class="pbx-flex pbx-items-center pbx-justify-center"
579
+ >
580
+ <button
581
+ type="button"
582
+ class="pbx-mr-2"
583
+ @click="
584
+ () => {
585
+ pageBuilderStateStore.setComponentArrayAddMethod('unshift')
586
+ handleAddComponent()
533
587
  }
534
588
  "
535
- class="pbx-flex pbx-justify-end pbx-py-2 pbx-pr-2 pbx-h-24 pbx-w-full"
536
589
  >
537
- <div
538
- @click.self="
590
+ <div class="pbx-flex pbx-items-center pbx-justify-center pbx-gap-2">
591
+ <span class="lg:pbx-block pbx-hidden">
592
+ <div class="pbx-whitespace-nowrap">Add new Components</div>
593
+ </span>
594
+ <span
595
+ class="pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-50 pbx-aspect-square hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white focus-visible:pbx-ring-0"
596
+ >
597
+ <span class="pbx-myMediumIcon material-symbols-outlined"> interests </span>
598
+ </span>
599
+ </div>
600
+ </button>
601
+ <div class="pbx-flex pbx-items-center pbx-justify-center">
602
+ <button
603
+ type="button"
604
+ @click="
539
605
  async () => {
606
+ pageBuilderStateStore.setMenuRight(false)
607
+ pageBuilderStateStore.setElement(null)
540
608
  await pageBuilderService.clearHtmlSelection()
609
+ handlePageBuilderPreview()
541
610
  }
542
611
  "
543
- class="pbx-flex pbx-items-center pbx-justify-center pbx-gap-4"
544
612
  >
545
- <button
546
- type="button"
547
- @click="
548
- () => {
549
- pageBuilderStateStore.setComponentArrayAddMethod('unshift')
550
- handleAddComponent()
551
- }
552
- "
553
- >
554
- <div class="pbx-flex pbx-items-center pbx-justify-center pbx-gap-2">
555
- <span class="lg:pbx-block pbx-hidden">
556
- <div class="pbx-whitespace-nowrap">Add new Components</div>
557
- </span>
558
- <span
559
- class="pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-50 pbx-aspect-square hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white focus-visible:pbx-ring-0"
560
- >
561
- <span class="pbx-myMediumIcon material-symbols-outlined"> interests </span>
562
- </span>
563
- </div>
564
- </button>
565
- <div class="pbx-flex pbx-items-center pbx-justify-center pbx-gap-4">
566
- <button
567
- type="button"
568
- @click="
569
- async () => {
570
- pageBuilderStateStore.setMenuRight(false)
571
- pageBuilderStateStore.setElement(null)
572
- await pageBuilderService.clearHtmlSelection()
573
- handlePageBuilderPreview()
574
- }
575
- "
613
+ <div class="pbx-flex pbx-items-center pbx-justify-center pbx-gap-2">
614
+ <div class="pbx-whitespace-nowrap lg:pbx-block pbx-hidden">Preview</div>
615
+
616
+ <span
617
+ class="pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-50 pbx-aspect-square hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white focus-visible:pbx-ring-0"
576
618
  >
577
- <div class="pbx-flex pbx-items-center pbx-justify-center pbx-gap-2">
578
- <div class="pbx-whitespace-nowrap lg:pbx-block pbx-hidden">Preview</div>
579
-
580
- <span
581
- class="pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-50 pbx-aspect-square hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white focus-visible:pbx-ring-0"
582
- >
583
- <span class="pbx-myMediumIcon material-symbols-outlined"> visibility </span>
584
- </span>
585
- </div>
586
- </button>
619
+ <span class="pbx-myMediumIcon material-symbols-outlined"> visibility </span>
620
+ </span>
587
621
  </div>
588
- </div>
622
+ </button>
589
623
  </div>
590
-
591
- <div
592
- @click.self="
624
+ </div>
625
+ </div>
626
+ <!-- Options # Start -->
627
+ <div
628
+ @click.self="
629
+ async () => {
630
+ await pageBuilderService.clearHtmlSelection()
631
+ }
632
+ "
633
+ class="pbx-flex pbx-items-center pbx-py-2 pbx-min-h-20 pbx-max-h-20 pbx-w-full"
634
+ :class="[showCloseButton ? 'pbx-justify-between' : 'pbx-justify-end']"
635
+ >
636
+ <ToolbarOption></ToolbarOption>
637
+ <template v-if="showCloseButton">
638
+ <button
639
+ class="pbx-h-10 pbx-w-10 pbx-flex-end pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-50 pbx-aspect-square hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white hover:pbx-fill-white focus-visible:pbx-ring-0"
640
+ @click="
593
641
  async () => {
642
+ closePageBuilder()
594
643
  await pageBuilderService.clearHtmlSelection()
595
644
  }
596
645
  "
597
- class="pbx-flex pbx-justify-end pbx-py-2 pbx-pr-2 pbx-w-full pbx-h-24"
598
646
  >
599
- <div
600
- @click.self="
601
- async () => {
602
- await pageBuilderService.clearHtmlSelection()
647
+ <span class="material-symbols-outlined"> close </span>
648
+ </button>
649
+ </template>
650
+ </div>
651
+ <!-- Options # Start -->
652
+ </div>
653
+
654
+ <!-- Top Layout Save And Reset Area - End -->
655
+ <div class="pbx-relative pbx-h-full pbx-flex pbx-pb-2 pbx-gap-2">
656
+ <div
657
+ @click.self="
658
+ async () => {
659
+ await pageBuilderService.clearHtmlSelection()
660
+ }
661
+ "
662
+ id="pagebuilder-left-area"
663
+ class="pbx-min-w-[3.5rem] pbx-pt-7 pbx-pb-2 pbx-ml-2 pbx-bg-myPrimaryLightGrayColor pbx-rounded-full pbx-shadow-sm"
664
+ >
665
+ <div class="pbx-mx-2 pbx-flex pbx-flex-col pbx-myPrimaryGap pbx-items-stretch">
666
+ <div class="pbx-flex pbx-gap-2 pbx-items-center pbx-justify-center">
667
+ <button
668
+ type="button"
669
+ @click="
670
+ () => {
671
+ pageBuilderStateStore.setComponentArrayAddMethod('unshift')
672
+ handleAddComponent()
603
673
  }
604
674
  "
605
- class="pbx-flex pbx-items-center pbx-justify-center pbx-gap-4"
675
+ class="pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-50 pbx-aspect-square hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white focus-visible:pbx-ring-0"
606
676
  >
607
- <button
608
- type="button"
609
- v-if="getMenuRight === false"
610
- @click="pageBuilderStateStore.setMenuRight(true)"
611
- >
612
- <div class="pbx-flex pbx-items-center pbx-justify-center pbx-gap-2">
613
- <span class="lg:pbx-block pbx-hidden"> Styling </span>
614
-
615
- <span
616
- class="pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-50 pbx-aspect-square hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white focus-visible:pbx-ring-0"
617
- >
618
- <span class="pbx-myMediumIcon material-symbols-outlined"> more_vert </span>
619
- </span>
620
- </div>
621
- </button>
622
- </div>
677
+ <span class="pbx-myMediumIcon material-symbols-outlined"> interests </span>
678
+ </button>
623
679
  </div>
680
+ <div
681
+ @click.self="
682
+ async () => {
683
+ await pageBuilderService.clearHtmlSelection()
684
+ }
685
+ "
686
+ >
687
+ <ComponentTopMenu v-if="getElement"></ComponentTopMenu>
688
+ </div>
689
+ </div>
690
+ </div>
691
+
692
+ <main
693
+ ref="pbxToolBar"
694
+ class="pbx-flex pbx-flex-col pbx-h-full pbx-grow pbx-rounded-tr-2xl pbx-rounded-tl-2xl pbx-border pbx-border-gray-200 pbx-items-stretch"
695
+ :class="{ 'pbx-mr-2': !getMenuRight, '': getMenuRight }"
696
+ >
697
+ <div
698
+ id="editToolbar"
699
+ class="pbx-z-30 lg:pbx-mx-20 pbx-flex pbx-gap-2 pbx-justify-center pbx-min-w-48 pbx-items-center pbx-rounded-full pbx-px-4"
700
+ style="
701
+ outline: 10px solid oklch(86.9% 0.005 56.366);
702
+ outline-offset: 0px;
703
+ background: oklch(86.9% 0.005 56.366);
704
+ "
705
+ >
706
+ <template v-if="getElement">
707
+ <EditGetElement></EditGetElement>
708
+ </template>
709
+ <template v-if="getRestoredElement">
710
+ <button
711
+ @click="pageBuilderService.restoreDeletedElementToDOM"
712
+ type="button"
713
+ class="pbx-h-10 pbx-w-10 pbx-flex-end pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-aspect-square hover:pbx-bg-gray-100 hover:pbx-fill-white pbx-bg-gray-200 focus-visible:pbx-ring-0"
714
+ >
715
+ <span class="material-symbols-outlined"> undo </span>
716
+ </button>
717
+ </template>
624
718
  </div>
719
+ <!-- Element Popover toolbar end -->
625
720
 
626
- <EditGetElement></EditGetElement>
627
721
  <div
628
722
  id="contains-pagebuilder"
629
723
  class="pbx-pl-4 pbx-pr-4 pbx-pb-4 pbx-overflow-y-auto pbx-pt-1 pbx-h-[39rem]"
@@ -641,13 +735,39 @@ onMounted(async () => {
641
735
  <div v-html="component.html_code"></div>
642
736
  </div>
643
737
  </div>
738
+ <!-- Added Components to DOM # end -->
644
739
  </div>
645
- <!-- Added Components to DOM # end -->
646
740
  </div>
647
741
  </div>
648
742
  </main>
649
743
 
650
- <!-- Add Component # end -->
744
+ <div
745
+ v-if="!getMenuRight"
746
+ @click.self="
747
+ async () => {
748
+ await pageBuilderService.clearHtmlSelection()
749
+ }
750
+ "
751
+ class="pbx-min-w-[3.5rem] pbx-pt-7 pbx-pb-2 pbx-ml-2 pbx-border-l pbx-border-gray-200"
752
+ >
753
+ <div
754
+ @click.self="
755
+ async () => {
756
+ await pageBuilderService.clearHtmlSelection()
757
+ }
758
+ "
759
+ class="pbx-flex pbx-items-center pbx-justify-center pbx-gap-4"
760
+ >
761
+ <button
762
+ type="button"
763
+ v-if="!getMenuRight"
764
+ @click="pageBuilderStateStore.setMenuRight(true)"
765
+ class="pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-50 pbx-aspect-square hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white focus-visible:pbx-ring-0"
766
+ >
767
+ <span class="material-symbols-outlined"> palette </span>
768
+ </button>
769
+ </div>
770
+ </div>
651
771
 
652
772
  <aside
653
773
  aria-label="Menu"