@myissue/vue-website-page-builder 3.3.13 → 3.3.14
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/vue-website-page-builder.js +2415 -2366
- package/dist/vue-website-page-builder.umd.cjs +32 -32
- package/package.json +1 -1
- package/src/Components/PageBuilder/ToolbarOption/ToolbarOption.vue +2 -2
- package/src/PageBuilder/PageBuilder.vue +57 -14
- package/src/composables/PageBuilderService.ts +13 -2
package/package.json
CHANGED
|
@@ -164,8 +164,8 @@ const openHTMLSettings = function () {
|
|
|
164
164
|
<!-- Main Settings Start -->
|
|
165
165
|
<button
|
|
166
166
|
@click="
|
|
167
|
-
() => {
|
|
168
|
-
pageBuilderService.clearHtmlSelection()
|
|
167
|
+
async () => {
|
|
168
|
+
await pageBuilderService.clearHtmlSelection()
|
|
169
169
|
openMainSettings()
|
|
170
170
|
}
|
|
171
171
|
"
|
|
@@ -149,7 +149,6 @@ watch(getElementAttributes, async (newAttributes, oldAttributes) => {
|
|
|
149
149
|
newAttributes?.dataImage !== oldAttributes?.dataImage
|
|
150
150
|
) {
|
|
151
151
|
debounce(async () => {
|
|
152
|
-
await pageBuilderService.handleAutoSave()
|
|
153
152
|
await pageBuilderService.initializeElementStyles()
|
|
154
153
|
}, 200)
|
|
155
154
|
}
|
|
@@ -237,7 +236,7 @@ const handleRestoreOriginalContent = async function () {
|
|
|
237
236
|
|
|
238
237
|
titleModalRestore.value = 'Do you want to reset this page?'
|
|
239
238
|
descriptionModalRestore.value =
|
|
240
|
-
'Are you sure you want to reset this page? This will overwrite your current
|
|
239
|
+
'Are you sure you want to reset this page? This will overwrite your current changes.'
|
|
241
240
|
firstButtonRestore.value = 'Close'
|
|
242
241
|
secondButtonRestore.value = null
|
|
243
242
|
thirdButtonRestore.value = 'Reset changes'
|
|
@@ -296,11 +295,21 @@ onMounted(async () => {
|
|
|
296
295
|
the builder by running the startBuilder method for this resource.
|
|
297
296
|
</ModalBuilder>
|
|
298
297
|
<div
|
|
299
|
-
@click.self="
|
|
298
|
+
@click.self="
|
|
299
|
+
async () => {
|
|
300
|
+
await pageBuilderService.clearHtmlSelection()
|
|
301
|
+
}
|
|
302
|
+
"
|
|
300
303
|
class="pbx-min-h-24 pbx-flex pbx-justify-between pbx-items-center pbx-pb-2 pbx-border-b pbx-border-gray-200"
|
|
301
304
|
>
|
|
302
305
|
<!-- Logo # start -->
|
|
303
|
-
<div
|
|
306
|
+
<div
|
|
307
|
+
@click="
|
|
308
|
+
async () => {
|
|
309
|
+
await pageBuilderService.clearHtmlSelection()
|
|
310
|
+
}
|
|
311
|
+
"
|
|
312
|
+
>
|
|
304
313
|
<div
|
|
305
314
|
v-if="
|
|
306
315
|
getPageBuilderConfig &&
|
|
@@ -386,7 +395,11 @@ onMounted(async () => {
|
|
|
386
395
|
<div>
|
|
387
396
|
<div class="pbx-relative pbx-h-full pbx-flex pbx-pb-2 pbx-gap-2">
|
|
388
397
|
<div
|
|
389
|
-
@click.self="
|
|
398
|
+
@click.self="
|
|
399
|
+
async () => {
|
|
400
|
+
await pageBuilderService.clearHtmlSelection()
|
|
401
|
+
}
|
|
402
|
+
"
|
|
390
403
|
id="pagebuilder-left-area"
|
|
391
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"
|
|
392
405
|
>
|
|
@@ -405,7 +418,13 @@ onMounted(async () => {
|
|
|
405
418
|
<span class="pbx-myMediumIcon material-symbols-outlined"> interests </span>
|
|
406
419
|
</button>
|
|
407
420
|
</div>
|
|
408
|
-
<div
|
|
421
|
+
<div
|
|
422
|
+
@click.self="
|
|
423
|
+
async () => {
|
|
424
|
+
await pageBuilderService.clearHtmlSelection()
|
|
425
|
+
}
|
|
426
|
+
"
|
|
427
|
+
>
|
|
409
428
|
<ComponentTopMenu v-if="getElement"></ComponentTopMenu>
|
|
410
429
|
</div>
|
|
411
430
|
</div>
|
|
@@ -419,7 +438,11 @@ onMounted(async () => {
|
|
|
419
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"
|
|
420
439
|
>
|
|
421
440
|
<div
|
|
422
|
-
@click.self="
|
|
441
|
+
@click.self="
|
|
442
|
+
async () => {
|
|
443
|
+
await pageBuilderService.clearHtmlSelection()
|
|
444
|
+
}
|
|
445
|
+
"
|
|
423
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"
|
|
424
447
|
>
|
|
425
448
|
<!-- Save Start -->
|
|
@@ -504,11 +527,19 @@ onMounted(async () => {
|
|
|
504
527
|
</div>
|
|
505
528
|
|
|
506
529
|
<div
|
|
507
|
-
@click.self="
|
|
530
|
+
@click.self="
|
|
531
|
+
async () => {
|
|
532
|
+
await pageBuilderService.clearHtmlSelection()
|
|
533
|
+
}
|
|
534
|
+
"
|
|
508
535
|
class="pbx-flex pbx-justify-end pbx-py-2 pbx-pr-2 pbx-h-24 pbx-w-full"
|
|
509
536
|
>
|
|
510
537
|
<div
|
|
511
|
-
@click.self="
|
|
538
|
+
@click.self="
|
|
539
|
+
async () => {
|
|
540
|
+
await pageBuilderService.clearHtmlSelection()
|
|
541
|
+
}
|
|
542
|
+
"
|
|
512
543
|
class="pbx-flex pbx-items-center pbx-justify-center pbx-gap-4"
|
|
513
544
|
>
|
|
514
545
|
<button
|
|
@@ -535,10 +566,10 @@ onMounted(async () => {
|
|
|
535
566
|
<button
|
|
536
567
|
type="button"
|
|
537
568
|
@click="
|
|
538
|
-
() => {
|
|
569
|
+
async () => {
|
|
539
570
|
pageBuilderStateStore.setMenuRight(false)
|
|
540
571
|
pageBuilderStateStore.setElement(null)
|
|
541
|
-
pageBuilderService.clearHtmlSelection()
|
|
572
|
+
await pageBuilderService.clearHtmlSelection()
|
|
542
573
|
handlePageBuilderPreview()
|
|
543
574
|
}
|
|
544
575
|
"
|
|
@@ -558,11 +589,19 @@ onMounted(async () => {
|
|
|
558
589
|
</div>
|
|
559
590
|
|
|
560
591
|
<div
|
|
561
|
-
@click.self="
|
|
592
|
+
@click.self="
|
|
593
|
+
async () => {
|
|
594
|
+
await pageBuilderService.clearHtmlSelection()
|
|
595
|
+
}
|
|
596
|
+
"
|
|
562
597
|
class="pbx-flex pbx-justify-end pbx-py-2 pbx-pr-2 pbx-w-full pbx-h-24"
|
|
563
598
|
>
|
|
564
599
|
<div
|
|
565
|
-
@click.self="
|
|
600
|
+
@click.self="
|
|
601
|
+
async () => {
|
|
602
|
+
await pageBuilderService.clearHtmlSelection()
|
|
603
|
+
}
|
|
604
|
+
"
|
|
566
605
|
class="pbx-flex pbx-items-center pbx-justify-center pbx-gap-4"
|
|
567
606
|
>
|
|
568
607
|
<button
|
|
@@ -608,7 +647,11 @@ onMounted(async () => {
|
|
|
608
647
|
<!-- Add Component # start -->
|
|
609
648
|
|
|
610
649
|
<div
|
|
611
|
-
@click="
|
|
650
|
+
@click="
|
|
651
|
+
async () => {
|
|
652
|
+
await pageBuilderService.clearHtmlSelection()
|
|
653
|
+
}
|
|
654
|
+
"
|
|
612
655
|
id="pagebuilder-bottom-components-area"
|
|
613
656
|
class="pbx-pt-8 pbx-pb-12 pbx-text-center focus:pbx-outline-none focus:pbx-ring-2 focus:pbx-ring-indigo-500 focus:pbx-ring-offset-2 pbx-my-2 pbx-mx-4"
|
|
614
657
|
:class="{ 'pbx-border-t pbx-border-gray-200': getComponents.length > 0 }"
|
|
@@ -291,11 +291,16 @@ export class PageBuilderService {
|
|
|
291
291
|
}
|
|
292
292
|
|
|
293
293
|
async tryMountPendingComponents() {
|
|
294
|
+
// Always clear DOM and store before mounting new resource
|
|
295
|
+
this.deleteAllComponentsFromDOM()
|
|
296
|
+
|
|
297
|
+
const localStorageData = this.loadStoredComponentsFromStorage()
|
|
298
|
+
|
|
294
299
|
this.pageBuilderStateStore.setIsLoadingGlobal(true)
|
|
295
300
|
await delay(200)
|
|
296
301
|
const config = this.pageBuilderStateStore.getPageBuilderConfig
|
|
297
302
|
const formType = config && config.updateOrCreate && config.updateOrCreate.formType
|
|
298
|
-
|
|
303
|
+
|
|
299
304
|
//
|
|
300
305
|
if (!config) return
|
|
301
306
|
//
|
|
@@ -549,6 +554,8 @@ export class PageBuilderService {
|
|
|
549
554
|
e.preventDefault()
|
|
550
555
|
e.stopPropagation()
|
|
551
556
|
|
|
557
|
+
await this.handleAutoSave()
|
|
558
|
+
|
|
552
559
|
const pagebuilder = document.querySelector('#pagebuilder')
|
|
553
560
|
|
|
554
561
|
if (!pagebuilder) return
|
|
@@ -1478,6 +1485,7 @@ export class PageBuilderService {
|
|
|
1478
1485
|
* Saves the current DOM state (components) to localStorage.
|
|
1479
1486
|
*/
|
|
1480
1487
|
#saveDomComponentsToLocalStorage() {
|
|
1488
|
+
this.#updateLocalStorageItemName()
|
|
1481
1489
|
const pagebuilder = document.querySelector('#pagebuilder')
|
|
1482
1490
|
if (!pagebuilder) return
|
|
1483
1491
|
|
|
@@ -1512,6 +1520,7 @@ export class PageBuilderService {
|
|
|
1512
1520
|
}
|
|
1513
1521
|
|
|
1514
1522
|
async removeCurrentComponentsFromLocalStorage() {
|
|
1523
|
+
this.#updateLocalStorageItemName()
|
|
1515
1524
|
await nextTick()
|
|
1516
1525
|
|
|
1517
1526
|
const key = this.getLocalStorageItemName.value
|
|
@@ -1580,6 +1589,7 @@ export class PageBuilderService {
|
|
|
1580
1589
|
|
|
1581
1590
|
//
|
|
1582
1591
|
async resumeEditingForUpdate() {
|
|
1592
|
+
this.#updateLocalStorageItemName()
|
|
1583
1593
|
const config = this.pageBuilderStateStore.getPageBuilderConfig
|
|
1584
1594
|
const formType = config && config.updateOrCreate && config.updateOrCreate.formType
|
|
1585
1595
|
|
|
@@ -1595,7 +1605,6 @@ export class PageBuilderService {
|
|
|
1595
1605
|
|
|
1596
1606
|
if (typeof updateDraftFromLocalStorage === 'string') {
|
|
1597
1607
|
this.pageBuilderStateStore.setIsLoadingResumeEditing(true)
|
|
1598
|
-
localStorage.removeItem(key)
|
|
1599
1608
|
await delay(300)
|
|
1600
1609
|
await this.#updateComponentsFromString(updateDraftFromLocalStorage)
|
|
1601
1610
|
this.pageBuilderStateStore.setIsLoadingResumeEditing(false)
|
|
@@ -1611,6 +1620,7 @@ export class PageBuilderService {
|
|
|
1611
1620
|
}
|
|
1612
1621
|
|
|
1613
1622
|
async restoreOriginalContent() {
|
|
1623
|
+
this.#updateLocalStorageItemName()
|
|
1614
1624
|
const config = this.pageBuilderStateStore.getPageBuilderConfig
|
|
1615
1625
|
const formType = config && config.updateOrCreate && config.updateOrCreate.formType
|
|
1616
1626
|
|
|
@@ -1638,6 +1648,7 @@ export class PageBuilderService {
|
|
|
1638
1648
|
}
|
|
1639
1649
|
|
|
1640
1650
|
loadStoredComponentsFromStorage() {
|
|
1651
|
+
this.#updateLocalStorageItemName()
|
|
1641
1652
|
if (!this.getLocalStorageItemName.value) return false
|
|
1642
1653
|
|
|
1643
1654
|
if (
|