@myissue/vue-website-page-builder 3.3.85 → 3.3.87
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/style.css +1 -1
- package/dist/vue-website-page-builder.js +969 -966
- package/dist/vue-website-page-builder.umd.cjs +7 -7
- package/package.json +1 -1
- package/src/Components/Modals/BuilderComponents.vue +1 -16
- package/src/Components/Modals/ModalBuilder.vue +1 -1
- package/src/PageBuilder/PageBuilder.vue +41 -30
- package/src/services/PageBuilderService.ts +3 -1
- package/src/tests/DefaultComponents/DefaultBuilderComponents.vue +78 -51
- package/src/tests/TestComponents/DemoUnsplash.vue +21 -17
package/package.json
CHANGED
|
@@ -44,25 +44,10 @@ const firstButtonBuilder = function () {
|
|
|
44
44
|
<div v-if="CustomBuilderComponents">
|
|
45
45
|
<component :is="CustomBuilderComponents" />
|
|
46
46
|
</div>
|
|
47
|
-
<div
|
|
47
|
+
<div v-else>
|
|
48
48
|
<DefaultBuilderComponents :customMediaComponent="customMediaComponent" />
|
|
49
49
|
</div>
|
|
50
50
|
</div>
|
|
51
51
|
</div>
|
|
52
|
-
<div
|
|
53
|
-
class="pbx-border-0 pbx-py-4 pbx-flex sm:pbx-justify-end pbx-justify-center pbx-border-solid pbx-border-t pbx-border-gray-200 pbx-mt-4"
|
|
54
|
-
>
|
|
55
|
-
<div class="sm:pbx-w-3/6 pbx-w-full pbx-px-2 pbx-my-2 pbx-flex pbx-gap-2 pbx-justify-end">
|
|
56
|
-
<button
|
|
57
|
-
v-if="firstButtonText"
|
|
58
|
-
ref="firstButtonRef"
|
|
59
|
-
class="pbx-mySecondaryButton"
|
|
60
|
-
type="button"
|
|
61
|
-
@click="firstButtonBuilder"
|
|
62
|
-
>
|
|
63
|
-
{{ firstButtonText }}
|
|
64
|
-
</button>
|
|
65
|
-
</div>
|
|
66
|
-
</div>
|
|
67
52
|
</ModalBuilder>
|
|
68
53
|
</template>
|
|
@@ -72,7 +72,7 @@ const maxWidthClass = computed(() => {
|
|
|
72
72
|
></div>
|
|
73
73
|
|
|
74
74
|
<div
|
|
75
|
-
class="pbx-relative pbx-inline-block pbx-bg-white pbx-rounded-xl pbx-text-left pbx-overflow-hidden pbx-shadow-xl pbx-transform pbx-transition-all pbx-max-w-[96vh] lg:pbx-max-h-[98vh] pbx-max-h-[85vh] pbx-overflow-y-
|
|
75
|
+
class="pbx-relative pbx-inline-block pbx-bg-white pbx-rounded-xl pbx-text-left pbx-overflow-hidden pbx-shadow-xl pbx-transform pbx-transition-all pbx-max-w-[96vh] lg:pbx-max-h-[98vh] pbx-max-h-[85vh] pbx-overflow-y-scroll pbx-w-full"
|
|
76
76
|
:class="[
|
|
77
77
|
maxWidthClass ? maxWidthClass : '',
|
|
78
78
|
minHeight ? minHeight : '',
|
|
@@ -61,8 +61,8 @@ const emit = defineEmits(['handleClosePageBuilder', 'handlePublishPageBuilder'])
|
|
|
61
61
|
const closePageBuilder = function () {
|
|
62
62
|
emit('handleClosePageBuilder')
|
|
63
63
|
}
|
|
64
|
-
const closePublish = function () {
|
|
65
|
-
pageBuilderService.handleManualSave()
|
|
64
|
+
const closePublish = async function () {
|
|
65
|
+
await pageBuilderService.handleManualSave()
|
|
66
66
|
emit('handlePublishPageBuilder')
|
|
67
67
|
}
|
|
68
68
|
|
|
@@ -93,10 +93,6 @@ watch(languageSelction, async (newVal) => {
|
|
|
93
93
|
}
|
|
94
94
|
})
|
|
95
95
|
|
|
96
|
-
const getCurrentLanguage = computed(() => {
|
|
97
|
-
return pageBuilderStateStore.getCurrentLanguage
|
|
98
|
-
})
|
|
99
|
-
|
|
100
96
|
const getBuilderStarted = computed(() => {
|
|
101
97
|
return pageBuilderStateStore.getBuilderStarted
|
|
102
98
|
})
|
|
@@ -434,7 +430,7 @@ onMounted(async () => {
|
|
|
434
430
|
|
|
435
431
|
<template>
|
|
436
432
|
<div
|
|
437
|
-
class="pbx-flex pbx-flex-col pbx-font-sans pbx-text-black pbx-
|
|
433
|
+
class="lg:pbx-min-w-full lg:pbx-max-w-full lg:pbx-w-full pbx-mx-auto pbx-flex pbx-flex-col pbx-font-sans pbx-text-black pbx-border-solid pbx-border pbx-border-gray-400 pbx-inset-x-0 pbx-z-10 pbx-bg-white pbx-overflow-x-auto pbx-h-full"
|
|
438
434
|
>
|
|
439
435
|
<GlobalLoader
|
|
440
436
|
v-if="(getIsLoadingGlobal && !openAppNotStartedModal) || isLoadingLang"
|
|
@@ -516,7 +512,7 @@ onMounted(async () => {
|
|
|
516
512
|
|
|
517
513
|
<div
|
|
518
514
|
id="pagebuilder-navbar"
|
|
519
|
-
class="pbx-w-full pbx-bg-myPrimaryLightGrayColor pbx-flex pbx-items-center pbx-justify-between pbx-border-0 pbx-border-solid pbx-border-b pbx-border-gray-200 pbx-mb-2 lg:pbx-px-6 pbx-px-4 pbx-font-sans pbx-min-h-20"
|
|
515
|
+
class="lg:pbx-min-w-full lg:pbx-max-w-full lg:pbx-w-full pbx-min-w-[96rem] pbx-max-w-[96rem] pbx-w-[96rem] pbx-flex-1 pbx-bg-myPrimaryLightGrayColor pbx-flex pbx-items-center pbx-justify-between pbx-border-0 pbx-border-solid pbx-border-b pbx-border-gray-200 pbx-mb-2 lg:pbx-px-6 pbx-px-4 pbx-font-sans pbx-min-h-20"
|
|
520
516
|
>
|
|
521
517
|
<template
|
|
522
518
|
v-if="
|
|
@@ -532,7 +528,7 @@ onMounted(async () => {
|
|
|
532
528
|
await pageBuilderService.clearHtmlSelection()
|
|
533
529
|
}
|
|
534
530
|
"
|
|
535
|
-
class="
|
|
531
|
+
class="pbx-flex pbx-justify-start pbx-py-2"
|
|
536
532
|
>
|
|
537
533
|
<img class="pbx-h-6" :src="getPageBuilderConfig.pageBuilderLogo.src" alt="Logo" />
|
|
538
534
|
</div>
|
|
@@ -704,7 +700,7 @@ onMounted(async () => {
|
|
|
704
700
|
>
|
|
705
701
|
<div class="pbx-flex pbx-items-center pbx-justify-center pbx-gap-2">
|
|
706
702
|
<span
|
|
707
|
-
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
|
|
703
|
+
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 focus-visible:pbx-ring-0 pbx-text-black hover:pbx-text-white"
|
|
708
704
|
>
|
|
709
705
|
<span class="material-symbols-outlined"> phone_iphone </span>
|
|
710
706
|
</span>
|
|
@@ -783,14 +779,15 @@ onMounted(async () => {
|
|
|
783
779
|
getPageBuilderConfig.userSettings.language.enable.length >= 1
|
|
784
780
|
"
|
|
785
781
|
>
|
|
786
|
-
<
|
|
782
|
+
<option
|
|
787
783
|
v-for="lang in pageBuilderService
|
|
788
784
|
.availableLanguage()
|
|
789
785
|
.filter((l) => getPageBuilderConfig.userSettings.language.enable.includes(l))"
|
|
790
786
|
:key="lang"
|
|
787
|
+
:value="lang"
|
|
791
788
|
>
|
|
792
|
-
|
|
793
|
-
</
|
|
789
|
+
{{ lang }}
|
|
790
|
+
</option>
|
|
794
791
|
</template>
|
|
795
792
|
<template
|
|
796
793
|
v-if="
|
|
@@ -799,9 +796,13 @@ onMounted(async () => {
|
|
|
799
796
|
getPageBuilderConfig.userSettings.language.enable.length === 0)
|
|
800
797
|
"
|
|
801
798
|
>
|
|
802
|
-
<
|
|
803
|
-
|
|
804
|
-
|
|
799
|
+
<option
|
|
800
|
+
v-for="lang in pageBuilderService.availableLanguage()"
|
|
801
|
+
:key="lang"
|
|
802
|
+
:value="lang"
|
|
803
|
+
>
|
|
804
|
+
{{ lang }}
|
|
805
|
+
</option>
|
|
805
806
|
</template>
|
|
806
807
|
</select>
|
|
807
808
|
</div>
|
|
@@ -824,10 +825,14 @@ onMounted(async () => {
|
|
|
824
825
|
</template>
|
|
825
826
|
</div>
|
|
826
827
|
</div>
|
|
827
|
-
|
|
828
828
|
<!-- Top Layout Save And Reset Area - End -->
|
|
829
|
-
|
|
830
|
-
|
|
829
|
+
|
|
830
|
+
<!-- Page Builder Main Start -->
|
|
831
|
+
<div
|
|
832
|
+
id="pagebuilder-main"
|
|
833
|
+
class="lg:pbx-min-w-full lg:pbx-max-w-full lg:pbx-w-full pbx-min-w-[96rem] pbx-max-w-[96rem] pbx-w-[96rem] pbx-flex-1 pbx-relative pbx-h-full pbx-flex pbx-pb-2 pbx-gap-2"
|
|
834
|
+
>
|
|
835
|
+
<!-- Left Menu Start -->
|
|
831
836
|
<div
|
|
832
837
|
@click.self="
|
|
833
838
|
async () => {
|
|
@@ -835,7 +840,7 @@ onMounted(async () => {
|
|
|
835
840
|
}
|
|
836
841
|
"
|
|
837
842
|
id="pagebuilder-left-menu"
|
|
838
|
-
class="pbx-w-
|
|
843
|
+
class="pbx-w-16 pbx-pt-7 pbx-pb-2 pbx-bg-myPrimaryLightGrayColor pbx-rounded-r-2xl pbx-shadow-sm"
|
|
839
844
|
>
|
|
840
845
|
<div class="pbx-mx-2 pbx-flex pbx-flex-col pbx-myPrimaryGap pbx-items-stretch">
|
|
841
846
|
<div class="pbx-flex pbx-gap-2 pbx-items-center pbx-justify-center">
|
|
@@ -847,7 +852,7 @@ onMounted(async () => {
|
|
|
847
852
|
handleAddComponent()
|
|
848
853
|
}
|
|
849
854
|
"
|
|
850
|
-
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
|
|
855
|
+
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 focus-visible:pbx-ring-0 pbx-text-black hover:pbx-text-white"
|
|
851
856
|
>
|
|
852
857
|
<span class="pbx-myMediumIcon material-symbols-outlined"> interests </span>
|
|
853
858
|
</button>
|
|
@@ -863,11 +868,12 @@ onMounted(async () => {
|
|
|
863
868
|
</div>
|
|
864
869
|
</div>
|
|
865
870
|
</div>
|
|
871
|
+
<!-- Left Menu End -->
|
|
866
872
|
|
|
867
873
|
<main
|
|
868
874
|
ref="pbxToolBar"
|
|
869
|
-
class="pbx-
|
|
870
|
-
:class="
|
|
875
|
+
class="pbx-transition-all pbx-duration-300 pbx-font-sans pbx-p-1 pbx-flex pbx-flex-col pbx-grow pbx-rounded-tr-2xl pbx-rounded-tl-2xl pbx-border-solid pbx-border pbx-border-gray-200 pbx-items-stretch pbx-text-black pbx-h-[100vh]"
|
|
876
|
+
:class="[getMenuRight ? 'pbx-w-full' : 'pbx-w-full']"
|
|
871
877
|
>
|
|
872
878
|
<div
|
|
873
879
|
id="pbxEditToolbar"
|
|
@@ -908,11 +914,12 @@ onMounted(async () => {
|
|
|
908
914
|
v-if="getMenuRight"
|
|
909
915
|
aria-label="menu"
|
|
910
916
|
id="pagebuilder-right-menu"
|
|
911
|
-
:class="{
|
|
912
|
-
'pbx-w-0 pbx-mr-0': !getMenuRight,
|
|
913
|
-
'pbx-w-80 pbx-bg-myPrimaryLightGrayColor pbx-items-stretch': getMenuRight,
|
|
914
|
-
}"
|
|
915
917
|
class="pbx-z-20 pbx-flex-shrink-0 pbx-overflow-hidden pbx-border-0 pbx-border-solid pbx-border-l-0 pbx-border-l-gray-600 pbx-rounded-l-2xl pbx-h-[100vh] pbx-pl-2"
|
|
918
|
+
:class="[
|
|
919
|
+
getMenuRight
|
|
920
|
+
? 'pbx-w-80 pbx-bg-myPrimaryLightGrayColor pbx-items-stretch'
|
|
921
|
+
: 'bpx-w-0 pbx-mr-0',
|
|
922
|
+
]"
|
|
916
923
|
>
|
|
917
924
|
<RightSidebarEditor @closeEditor="pageBuilderStateStore.setMenuRight(false)">
|
|
918
925
|
</RightSidebarEditor>
|
|
@@ -924,7 +931,7 @@ onMounted(async () => {
|
|
|
924
931
|
await pageBuilderService.clearHtmlSelection()
|
|
925
932
|
}
|
|
926
933
|
"
|
|
927
|
-
class="pbx-w-
|
|
934
|
+
class="pbx-w-16 pbx-bg-myPrimaryLightGrayColor pbx-pt-5 pbx-z-20 pbx-flex-shrink-0 pbx-overflow-hidden pbx-border-0 pbx-border-solid pbx-border-l-0 pbx-border-l-gray-600 pbx-rounded-l-2xl pbx-h-[100vh] pbx-pl-2 pbx-pr-2"
|
|
928
935
|
>
|
|
929
936
|
<div
|
|
930
937
|
@click.self="
|
|
@@ -946,9 +953,12 @@ onMounted(async () => {
|
|
|
946
953
|
</div>
|
|
947
954
|
</transition>
|
|
948
955
|
</div>
|
|
956
|
+
<!-- Page Builder Main End -->
|
|
957
|
+
|
|
958
|
+
<!-- Footer Start -->
|
|
949
959
|
<div
|
|
950
960
|
id="pagebuilder-footer"
|
|
951
|
-
class="pbx-w-full pbx-flex pbx-items-center pbx-justify-center pbx-p-4 pbx-border-0 pbx-border-t pbx-border-t-gray-200 pbx-border-solid pbx-bg-myPrimaryLightGrayColor"
|
|
961
|
+
class="lg:pbx-min-w-full lg:pbx-max-w-full lg:pbx-w-full pbx-min-w-[96rem] pbx-max-w-[96rem] pbx-w-[96rem] pbx-flex-1 pbx-flex pbx-items-center pbx-justify-center pbx-p-4 pbx-border-0 pbx-border-t pbx-border-t-gray-200 pbx-border-solid pbx-bg-myPrimaryLightGrayColor"
|
|
952
962
|
>
|
|
953
963
|
<div
|
|
954
964
|
@click="
|
|
@@ -965,13 +975,14 @@ onMounted(async () => {
|
|
|
965
975
|
<div class="pbx-flex pbx-gap-2 pbx-items-center pbx-justify-center">
|
|
966
976
|
<button
|
|
967
977
|
type="button"
|
|
968
|
-
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
|
|
978
|
+
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 focus-visible:pbx-ring-0 pbx-text-black hover:pbx-text-white"
|
|
969
979
|
>
|
|
970
980
|
<span class="pbx-myMediumIcon material-symbols-outlined"> interests </span>
|
|
971
981
|
</button>
|
|
972
982
|
</div>
|
|
973
983
|
</div>
|
|
974
984
|
</div>
|
|
985
|
+
<!-- Footer End -->
|
|
975
986
|
</div>
|
|
976
987
|
</template>
|
|
977
988
|
|
|
@@ -895,9 +895,11 @@ export class PageBuilderService {
|
|
|
895
895
|
public handleManualSave = async () => {
|
|
896
896
|
this.startEditing()
|
|
897
897
|
this.pageBuilderStateStore.setIsSaving(true)
|
|
898
|
+
this.pageBuilderStateStore.setIsLoadingGlobal(true)
|
|
898
899
|
this.saveDomComponentsToLocalStorage()
|
|
899
|
-
await delay(
|
|
900
|
+
await delay(300)
|
|
900
901
|
this.pageBuilderStateStore.setIsSaving(false)
|
|
902
|
+
this.pageBuilderStateStore.setIsLoadingGlobal(false)
|
|
901
903
|
}
|
|
902
904
|
|
|
903
905
|
public cloneCompObjForDOMInsertion(componentObject: ComponentObject): ComponentObject {
|
|
@@ -20,6 +20,8 @@ defineProps({
|
|
|
20
20
|
},
|
|
21
21
|
})
|
|
22
22
|
|
|
23
|
+
const isLoading = ref(false)
|
|
24
|
+
|
|
23
25
|
const selectedCategory = ref('All')
|
|
24
26
|
|
|
25
27
|
const categories = computed(() => {
|
|
@@ -39,6 +41,7 @@ const { closeAddComponentModal } = usePageBuilderModal()
|
|
|
39
41
|
|
|
40
42
|
// Super simple component addition with professional modal closing!
|
|
41
43
|
const handleDropComponent = async function (componentObject: ComponentObject) {
|
|
44
|
+
isLoading.value = true
|
|
42
45
|
// Translate all occurrences of the hardcoded strings in the html_code
|
|
43
46
|
const translatedHtmlCode = componentObject.html_code
|
|
44
47
|
.replace(/Layouts and visual\./g, translate('Layouts and visual.'))
|
|
@@ -56,6 +59,7 @@ const handleDropComponent = async function (componentObject: ComponentObject) {
|
|
|
56
59
|
|
|
57
60
|
await pageBuilderService.addComponent(translatedComponentObject)
|
|
58
61
|
closeAddComponentModal()
|
|
62
|
+
isLoading.value = false
|
|
59
63
|
}
|
|
60
64
|
|
|
61
65
|
// Helper function to convert ComponentData to ComponentObject
|
|
@@ -92,72 +96,95 @@ const getSvgPreview = (title: string) => {
|
|
|
92
96
|
|
|
93
97
|
<template>
|
|
94
98
|
<div>
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
<template v-if="isLoading">
|
|
100
|
+
<div class="pbx-min-h-[85vh] pbx-h-[85vh]">
|
|
101
|
+
<div class="pbx-flex pbx-items-center pbx-justify-center">
|
|
102
|
+
<div
|
|
103
|
+
class="pbx-inline-block pbx-h-8 pbx-w-8 pbx-animate-spin pbx-rounded-full pbx-border-4 pbx-border-solid pbx-border-current pbx-border-r-transparent pbx-align-[-0.125em] motion-reduce:pbx-animate-[spin_1.5s_linear_infinite]"
|
|
104
|
+
>
|
|
105
|
+
<span
|
|
106
|
+
class="!pbx-absolute !pbx-m-px !pbx-h-px !pbx-w-px !pbx-overflow-hidden !pbx-whitespace-nowrap !pbx-border-0 !pbx-p-0 !pbx-[clip:rect(0,0,0,0)]"
|
|
107
|
+
>{{ translate('Loading...') }}</span
|
|
108
|
+
>
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
</template>
|
|
113
|
+
<div v-if="!isLoading">
|
|
114
|
+
<!-- Helper Components Section -->
|
|
115
|
+
<div class="pbx-mb-8">
|
|
116
|
+
<h3 class="pbx-myQuaternaryHeader pbx-mb-4">{{ translate('Helper Components') }}</h3>
|
|
101
117
|
<div
|
|
102
|
-
|
|
103
|
-
:key="helper.title"
|
|
104
|
-
class="pbx-border-solid pbx-border pbx-border-gray-400 pbx-overflow-hidden hover:pbx-border-myPrimaryLinkColor pbx-duration-100 pbx-cursor-pointer pbx-p-4"
|
|
105
|
-
@click="handleDropComponent(helper)"
|
|
118
|
+
class="pbx-px-2 pbx-grid pbx-grid-cols-1 sm:pbx-grid-cols-2 md:pbx-grid-cols-3 lg:pbx-grid-cols-4 pbx-gap-4"
|
|
106
119
|
>
|
|
107
|
-
<div
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
120
|
+
<div
|
|
121
|
+
v-for="helper in componentHelpers"
|
|
122
|
+
:key="helper.title"
|
|
123
|
+
class="pbx-border-solid pbx-border pbx-border-gray-400 pbx-overflow-hidden hover:pbx-border-myPrimaryLinkColor pbx-duration-100 pbx-cursor-pointer pbx-p-4"
|
|
124
|
+
@click="handleDropComponent(helper)"
|
|
125
|
+
>
|
|
126
|
+
<div
|
|
127
|
+
class="pbx-max-h-72 pbx-cursor-pointer pbx-object-contain pbx-bg-white pbx-mx-auto"
|
|
128
|
+
>
|
|
129
|
+
<div v-if="false" class="pbx-mr-2" v-html="helper.icon"></div>
|
|
130
|
+
<h4 class="pbx-myPrimaryParagraph pbx-text-base pbx-font-medium">
|
|
131
|
+
{{ translate(helper.title) }}
|
|
132
|
+
</h4>
|
|
133
|
+
</div>
|
|
134
|
+
<div class="pbx-myPrimaryParagraph pbx-text-xs pbx-font-normal pbx-pt-2">
|
|
135
|
+
{{ translate('Click to add') }} {{ helper.title.toLowerCase() }}
|
|
136
|
+
{{ translate('component') }}
|
|
137
|
+
</div>
|
|
116
138
|
</div>
|
|
117
139
|
</div>
|
|
118
140
|
</div>
|
|
119
|
-
</div>
|
|
120
141
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
<div class="pbx-grid pbx-grid-cols-1 sm:pbx-grid-cols-2 md:pbx-grid-cols-3 pbx-gap-4">
|
|
142
|
+
<!-- Regular Components Section -->
|
|
143
|
+
<div class="pbx-px-2" v-if="customMediaComponent">
|
|
144
|
+
<h3 class="pbx-myQuaternaryHeader pbx-mb-4">{{ translate('Layout Components') }}</h3>
|
|
145
|
+
<div class="pbx-mb-4 pbx-flex pbx-jusitify-left pbx-items-center pbx-gap-2">
|
|
146
|
+
<button
|
|
147
|
+
v-for="category in categories"
|
|
148
|
+
:key="category"
|
|
149
|
+
@click="selectedCategory = category"
|
|
150
|
+
class="pbx-mySecondaryButton pbx-px-2 pbx-text-xs"
|
|
151
|
+
:class="{ active: selectedCategory === category }"
|
|
152
|
+
>
|
|
153
|
+
{{ translate(category) }}
|
|
154
|
+
</button>
|
|
155
|
+
</div>
|
|
136
156
|
<div
|
|
137
|
-
|
|
138
|
-
:key="comp.title"
|
|
139
|
-
class="pbx-border-solid pbx-border pbx-border-gray-400 pbx-overflow-hidden hover:pbx-border-myPrimaryLinkColor pbx-duration-100 pbx-cursor-pointer"
|
|
140
|
-
@click="handleDropComponent(convertToComponentObject(comp))"
|
|
157
|
+
class="pbx-grid pbx-grid-cols-1 sm:pbx-grid-cols-2 md:pbx-grid-cols-3 pbx-gap-4 pbx-pb-4"
|
|
141
158
|
>
|
|
142
159
|
<div
|
|
143
|
-
|
|
160
|
+
v-for="comp in filteredComponents"
|
|
161
|
+
:key="comp.title"
|
|
162
|
+
class="pbx-border-solid pbx-border pbx-border-gray-400 pbx-overflow-hidden hover:pbx-border-myPrimaryLinkColor pbx-duration-100 pbx-cursor-pointer"
|
|
163
|
+
@click="handleDropComponent(convertToComponentObject(comp))"
|
|
144
164
|
>
|
|
145
|
-
<!-- Use SVG preview instead of external images -->
|
|
146
165
|
<div
|
|
147
|
-
class="pbx-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
</
|
|
155
|
-
<div class="pbx-
|
|
156
|
-
|
|
166
|
+
class="pbx-overflow-hidden pbx-whitespace-pre-line pbx-flex-1 pbx-h-auto pbx-border-solid pbx-border-b pbx-border-gray-200 lg:pbx-py-10 pbx-py-8 pbx-px-2"
|
|
167
|
+
>
|
|
168
|
+
<!-- Use SVG preview instead of external images -->
|
|
169
|
+
<div
|
|
170
|
+
class="pbx-max-h-72 pbx-cursor-pointer pbx-bg-white pbx-mx-auto pbx-flex pbx-items-center pbx-justify-center"
|
|
171
|
+
v-html="getSvgPreview(comp.title)"
|
|
172
|
+
></div>
|
|
173
|
+
</div>
|
|
174
|
+
<div class="pbx-p-3">
|
|
175
|
+
<h4 class="pbx-myPrimaryParagraph pbx-text-sm pbx-font-normal">
|
|
176
|
+
{{ translate(comp.title) }}
|
|
177
|
+
</h4>
|
|
178
|
+
<div class="pbx-myPrimaryParagraph pbx-text-xs pbx-font-normal pbx-pt-2">
|
|
179
|
+
{{ translate('Click to add component') }}
|
|
180
|
+
</div>
|
|
157
181
|
</div>
|
|
158
182
|
</div>
|
|
159
183
|
</div>
|
|
160
184
|
</div>
|
|
185
|
+
<div>
|
|
186
|
+
<button class="pbx-sr-only">Focusable fallback</button>
|
|
187
|
+
</div>
|
|
161
188
|
</div>
|
|
162
189
|
</div>
|
|
163
190
|
</template>
|
|
@@ -98,12 +98,16 @@ const nextPage = async function () {
|
|
|
98
98
|
fetchUnsplash()
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
+
const isLoading = ref(false)
|
|
102
|
+
|
|
101
103
|
const applySelectedImage = async function (imageURL) {
|
|
104
|
+
isLoading.value = true
|
|
102
105
|
await pageBuilderService.applySelectedImage({
|
|
103
106
|
src: `${imageURL}`,
|
|
104
107
|
})
|
|
105
108
|
|
|
106
109
|
closeMediaLibraryModal()
|
|
110
|
+
isLoading.value = false
|
|
107
111
|
}
|
|
108
112
|
|
|
109
113
|
// on mounted
|
|
@@ -116,8 +120,20 @@ onMounted(async () => {
|
|
|
116
120
|
</script>
|
|
117
121
|
|
|
118
122
|
<template>
|
|
119
|
-
<div>
|
|
120
|
-
<div>
|
|
123
|
+
<div class="pbx-min-h-[85vh] pbx-h-[85vh]">
|
|
124
|
+
<div v-if="getIsLoading || isLoading">
|
|
125
|
+
<div class="pbx-flex pbx-items-center pbx-justify-center">
|
|
126
|
+
<div
|
|
127
|
+
class="pbx-inline-block pbx-h-8 pbx-w-8 pbx-animate-spin pbx-rounded-full pbx-border-4 pbx-border-solid pbx-border-current pbx-border-r-transparent pbx-align-[-0.125em] motion-reduce:pbx-animate-[spin_1.5s_linear_infinite]"
|
|
128
|
+
>
|
|
129
|
+
<span
|
|
130
|
+
class="!pbx-absolute !pbx-m-px !pbx-h-px !pbx-w-px !pbx-overflow-hidden !pbx-whitespace-nowrap !pbx-border-0 !pbx-p-0 !pbx-[clip:rect(0,0,0,0)]"
|
|
131
|
+
>{{ translate('Loading...') }}</span
|
|
132
|
+
>
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
</div>
|
|
136
|
+
<div v-if="!isLoading && !getIsLoading">
|
|
121
137
|
<form
|
|
122
138
|
@submit.prevent="
|
|
123
139
|
() => {
|
|
@@ -268,18 +284,6 @@ onMounted(async () => {
|
|
|
268
284
|
|
|
269
285
|
<div class="pbx-min-h-[33rem] pbx-max-h-[33rem] pbx-flex pbx-gap-6">
|
|
270
286
|
<div class="pbx-w-9/12 pbx-pr-1 pbx-rounded-lg pbx-overflow-y-auto">
|
|
271
|
-
<div v-if="getIsLoading">
|
|
272
|
-
<div class="pbx-flex pbx-items-center pbx-justify-center pbx-mt-4">
|
|
273
|
-
<div
|
|
274
|
-
class="pbx-inline-block pbx-h-8 pbx-w-8 pbx-animate-spin pbx-rounded-full pbx-border-4 pbx-border-solid pbx-border-current pbx-border-r-transparent pbx-align-[-0.125em] motion-reduce:pbx-animate-[spin_1.5s_linear_infinite]"
|
|
275
|
-
>
|
|
276
|
-
<span
|
|
277
|
-
class="!pbx-absolute !pbx-m-px !pbx-h-px !pbx-w-px !pbx-overflow-hidden !pbx-whitespace-nowrap !pbx-border-0 !pbx-p-0 !pbx-[clip:rect(0,0,0,0)]"
|
|
278
|
-
>{{ translate('Loading...') }}</span
|
|
279
|
-
>
|
|
280
|
-
</div>
|
|
281
|
-
</div>
|
|
282
|
-
</div>
|
|
283
287
|
<div v-if="getUnsplashImages && getUnsplashImages.results">
|
|
284
288
|
<div
|
|
285
289
|
v-if="!getIsLoading"
|
|
@@ -399,9 +403,9 @@ onMounted(async () => {
|
|
|
399
403
|
</div>
|
|
400
404
|
<!-- Actions footer # end -->
|
|
401
405
|
</div>
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
406
|
+
<div>
|
|
407
|
+
<button class="pbx-sr-only">Focusable fallback</button>
|
|
408
|
+
</div>
|
|
405
409
|
</div>
|
|
406
410
|
</div>
|
|
407
411
|
</template>
|