@myissue/vue-website-page-builder 3.0.1
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/LICENSE +21 -0
- package/README.md +470 -0
- package/dist/android-chrome-192x192.png +0 -0
- package/dist/android-chrome-512x512.png +0 -0
- package/dist/apple-touch-icon.png +0 -0
- package/dist/browserconfig.xml +9 -0
- package/dist/components.json +36 -0
- package/dist/favicon-16x16.png +0 -0
- package/dist/favicon-32x32.png +0 -0
- package/dist/favicon.ico +0 -0
- package/dist/home/features.jpg +0 -0
- package/dist/home/page-builder-example.jpg +0 -0
- package/dist/logo/logo.svg +49 -0
- package/dist/mstile-310x150.png +0 -0
- package/dist/mstile-310x310.png +0 -0
- package/dist/page-builder/2-images-text-top.png +0 -0
- package/dist/page-builder/2-images.png +0 -0
- package/dist/page-builder/3-images.png +0 -0
- package/dist/page-builder/6-images.png +0 -0
- package/dist/page-builder/image.png +0 -0
- package/dist/page-builder/placeholder.jpg +0 -0
- package/dist/page-builder/two-vertical-images.png +0 -0
- package/dist/placeholder_image.jpg +0 -0
- package/dist/robots.txt +2 -0
- package/dist/vue-website-page-builder.css +1 -0
- package/dist/vue-website-page-builder.js +24794 -0
- package/dist/vue-website-page-builder.umd.cjs +195 -0
- package/package.json +99 -0
- package/src/App.vue +122 -0
- package/src/Components/Homepage/Footer.vue +42 -0
- package/src/Components/Homepage/HomeSection.vue +540 -0
- package/src/Components/Homepage/Navbar.vue +30 -0
- package/src/Components/Layouts/FullWidthElement.vue +34 -0
- package/src/Components/Loaders/FullScreenSpinner.vue +13 -0
- package/src/Components/Loaders/SmallUniversalSpinner.vue +26 -0
- package/src/Components/MediaLibrary/SidebarUnsplash.vue +40 -0
- package/src/Components/MediaLibrary/Unsplash.vue +306 -0
- package/src/Components/Modals/DynamicModal.vue +476 -0
- package/src/Components/Modals/MediaLibraryModal.vue +418 -0
- package/src/Components/Modals/Modal.vue +102 -0
- package/src/Components/Modals/PageBuilderModal.vue +233 -0
- package/src/Components/Modals/PageBuilderPreviewModal.vue +123 -0
- package/src/Components/PageBuilder/DropdownsPlusToggles/OptionsDropdown.vue +202 -0
- package/src/Components/PageBuilder/DropdownsPlusToggles/SaveDesign.vue +7 -0
- package/src/Components/PageBuilder/EditorMenu/Editables/BackgroundColorEditor.vue +91 -0
- package/src/Components/PageBuilder/EditorMenu/Editables/BorderRadius.vue +163 -0
- package/src/Components/PageBuilder/EditorMenu/Editables/Borders.vue +164 -0
- package/src/Components/PageBuilder/EditorMenu/Editables/ClassEditor.vue +80 -0
- package/src/Components/PageBuilder/EditorMenu/Editables/ComponentTopMenu.vue +93 -0
- package/src/Components/PageBuilder/EditorMenu/Editables/DeleteElement.vue +42 -0
- package/src/Components/PageBuilder/EditorMenu/Editables/EditGetElement.vue +338 -0
- package/src/Components/PageBuilder/EditorMenu/Editables/ElementEditor.vue +58 -0
- package/src/Components/PageBuilder/EditorMenu/Editables/ImageEditor.vue +82 -0
- package/src/Components/PageBuilder/EditorMenu/Editables/LinkEditor.vue +301 -0
- package/src/Components/PageBuilder/EditorMenu/Editables/ManageBackgroundOpacity.vue +109 -0
- package/src/Components/PageBuilder/EditorMenu/Editables/ManageOpacity.vue +107 -0
- package/src/Components/PageBuilder/EditorMenu/Editables/OpacityEditor.vue +16 -0
- package/src/Components/PageBuilder/EditorMenu/Editables/PaddingPlusMargin.vue +134 -0
- package/src/Components/PageBuilder/EditorMenu/Editables/TextColorEditor.vue +91 -0
- package/src/Components/PageBuilder/EditorMenu/Editables/Typography.vue +199 -0
- package/src/Components/PageBuilder/EditorMenu/EditorAccordion.vue +42 -0
- package/src/Components/PageBuilder/EditorMenu/RightSidebarEditor.vue +113 -0
- package/src/Components/PageBuilder/Settings/AdvancedPageBuilderSettings.vue +229 -0
- package/src/Components/PageBuilder/Settings/PageBuilderSettings.vue +101 -0
- package/src/Components/PageBuilder/Slidebars/SlideOverRight.vue +91 -0
- package/src/Components/PageBuilder/Slidebars/SlideOverRightParent.vue +91 -0
- package/src/Components/Search/SearchComponents.vue +259 -0
- package/src/Components/TipTap/TipTap.vue +32 -0
- package/src/Components/TipTap/TipTapInput.vue +325 -0
- package/src/PageBuilder/PageBuilder.vue +347 -0
- package/src/PageBuilder/Preview.vue +24 -0
- package/src/composables/PageBuilder.ts +1483 -0
- package/src/composables/delay.ts +5 -0
- package/src/composables/extract-text-content-html.ts +34 -0
- package/src/composables/isObject.ts +6 -0
- package/src/composables/usePromise.ts +10 -0
- package/src/composables/vueFetch.ts +278 -0
- package/src/css/app.css +614 -0
- package/src/index.ts +16 -0
- package/src/main.ts +11 -0
- package/src/stores/media-library.ts +34 -0
- package/src/stores/page-builder-state.ts +461 -0
- package/src/stores/unsplash.ts +107 -0
- package/src/stores/user.ts +30 -0
- package/src/types/global.d.ts +49 -0
- package/src/utils/builder/compiledCSS.ts +2205 -0
- package/src/utils/builder/html-doc-declaration-with-components.ts +7 -0
- package/src/utils/builder/html-elements/componentHelpers.ts +101 -0
- package/src/utils/builder/tailwaind-colors.ts +503 -0
- package/src/utils/builder/tailwind-border-radius.ts +67 -0
- package/src/utils/builder/tailwind-border-style-width-color.ts +272 -0
- package/src/utils/builder/tailwind-font-sizes.ts +76 -0
- package/src/utils/builder/tailwind-font-styles.ts +24 -0
- package/src/utils/builder/tailwind-opacities.ts +45 -0
- package/src/utils/builder/tailwind-padding-margin.ts +159 -0
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import Modal from '@/Components/Modals/Modal.vue'
|
|
3
|
+
import DynamicModal from '@/Components/Modals/DynamicModal.vue'
|
|
4
|
+
import PageBuilder from '@/composables/PageBuilder.ts'
|
|
5
|
+
import { delay } from '@/composables/delay'
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
Dialog,
|
|
9
|
+
DialogOverlay,
|
|
10
|
+
DialogTitle,
|
|
11
|
+
TransitionChild,
|
|
12
|
+
TransitionRoot,
|
|
13
|
+
} from '@headlessui/vue'
|
|
14
|
+
import { Menu, MenuButton, MenuItem, MenuItems } from '@headlessui/vue'
|
|
15
|
+
import { computed, onMounted, ref } from 'vue'
|
|
16
|
+
import { usePageBuilderStateStore } from '@/stores/page-builder-state'
|
|
17
|
+
import { useUserStore } from '@/stores/user'
|
|
18
|
+
import { useMediaLibraryStore } from '@/stores/media-library'
|
|
19
|
+
|
|
20
|
+
const mediaLibraryStore = useMediaLibraryStore()
|
|
21
|
+
const userStore = useUserStore()
|
|
22
|
+
const pageBuilderStateStore = usePageBuilderStateStore()
|
|
23
|
+
|
|
24
|
+
defineProps({
|
|
25
|
+
show: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: false,
|
|
28
|
+
required: true,
|
|
29
|
+
},
|
|
30
|
+
updateOrCreate: {
|
|
31
|
+
required: true,
|
|
32
|
+
},
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
const pageBuilder = new PageBuilder(pageBuilderStateStore, mediaLibraryStore)
|
|
36
|
+
|
|
37
|
+
const hideDraftButton = ref(true)
|
|
38
|
+
|
|
39
|
+
const showModalConfirmClosePageBuilder = ref(false)
|
|
40
|
+
//
|
|
41
|
+
// use dynamic model
|
|
42
|
+
const typeModal = ref('')
|
|
43
|
+
const gridColumnModal = ref(Number(1))
|
|
44
|
+
const titleModal = ref('')
|
|
45
|
+
const descriptionModal = ref('')
|
|
46
|
+
const firstButtonModal = ref('')
|
|
47
|
+
const secondButtonModal = ref(null)
|
|
48
|
+
const thirdButtonModal = ref(null)
|
|
49
|
+
// set dynamic modal handle functions
|
|
50
|
+
const firstModalButtonFunction = ref(null)
|
|
51
|
+
const secondModalButtonFunction = ref(null)
|
|
52
|
+
const thirdModalButtonFunction = ref(null)
|
|
53
|
+
|
|
54
|
+
const emit = defineEmits([
|
|
55
|
+
'pageBuilderPrimaryHandler',
|
|
56
|
+
'pageBuilderSecondaryHandler',
|
|
57
|
+
'handleDraftForUpdate',
|
|
58
|
+
])
|
|
59
|
+
|
|
60
|
+
const firstButton = function () {
|
|
61
|
+
showModalConfirmClosePageBuilder.value = true
|
|
62
|
+
typeModal.value = 'danger'
|
|
63
|
+
gridColumnModal.value = 3
|
|
64
|
+
titleModal.value = 'Close page builder without save?'
|
|
65
|
+
descriptionModal.value =
|
|
66
|
+
'Are you sure you want to close the page builder without saving? Any changes will be lost.'
|
|
67
|
+
firstButtonModal.value = 'Close'
|
|
68
|
+
secondButtonModal.value = null
|
|
69
|
+
thirdButtonModal.value = 'Exit Page Builder'
|
|
70
|
+
|
|
71
|
+
// handle click
|
|
72
|
+
firstModalButtonFunction.value = function () {
|
|
73
|
+
showModalConfirmClosePageBuilder.value = false
|
|
74
|
+
}
|
|
75
|
+
// handle click
|
|
76
|
+
secondModalButtonFunction.value = function () {
|
|
77
|
+
secondButton()
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// handle click
|
|
81
|
+
thirdModalButtonFunction.value = async function () {
|
|
82
|
+
showModalConfirmClosePageBuilder.value = false
|
|
83
|
+
emit('pageBuilderPrimaryHandler')
|
|
84
|
+
|
|
85
|
+
pageBuilder.removeHoveredAndSelected()
|
|
86
|
+
userStore.setIsLoading(true)
|
|
87
|
+
await delay()
|
|
88
|
+
userStore.setIsLoading(false)
|
|
89
|
+
}
|
|
90
|
+
//
|
|
91
|
+
// end modal
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const handleEscapeKey = function () {
|
|
95
|
+
firstButton()
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// first button function
|
|
99
|
+
const secondButton = function () {
|
|
100
|
+
emit('pageBuilderSecondaryHandler')
|
|
101
|
+
pageBuilder.removeHoveredAndSelected()
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
//
|
|
105
|
+
//
|
|
106
|
+
const getLocalStorageItemNameUpdate = computed(() => {
|
|
107
|
+
return pageBuilderStateStore.getLocalStorageItemNameUpdate
|
|
108
|
+
})
|
|
109
|
+
//
|
|
110
|
+
const handleDraftForUpdate = function () {
|
|
111
|
+
hideDraftButton.value = false
|
|
112
|
+
emit('handleDraftForUpdate')
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
onMounted(() => {
|
|
116
|
+
const item = localStorage.getItem(getLocalStorageItemNameUpdate.value)
|
|
117
|
+
if (item) {
|
|
118
|
+
const parsedValue = JSON.parse(item)
|
|
119
|
+
|
|
120
|
+
if (Array.isArray(parsedValue) && parsedValue.length === 0) {
|
|
121
|
+
hideDraftButton.value = false
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
if (!item) {
|
|
125
|
+
hideDraftButton.value = false
|
|
126
|
+
}
|
|
127
|
+
})
|
|
128
|
+
</script>
|
|
129
|
+
|
|
130
|
+
<template>
|
|
131
|
+
<teleport to="body">
|
|
132
|
+
<TransitionRoot :show="show" as="template">
|
|
133
|
+
<Dialog
|
|
134
|
+
@close="firstButton"
|
|
135
|
+
@keydown.escape.prevent="handleEscapeKey"
|
|
136
|
+
as="div"
|
|
137
|
+
class="fixed z-30 inset-0 overflow-y-auto focus:outline-none"
|
|
138
|
+
tabindex="0"
|
|
139
|
+
>
|
|
140
|
+
<div class="flex items-end justify-center pb-20 text-center sm:block sm:p-0 bg-white">
|
|
141
|
+
<TransitionChild
|
|
142
|
+
as="template"
|
|
143
|
+
enter="ease-out duration-100"
|
|
144
|
+
enter-from="opacity-0"
|
|
145
|
+
enter-to="opacity-100"
|
|
146
|
+
leave="ease-in duration-200"
|
|
147
|
+
leave-from="opacity-100"
|
|
148
|
+
leave-to="opacity-0"
|
|
149
|
+
>
|
|
150
|
+
<DialogOverlay class="fixed inset-0 bg-white bg-opacity-75 transition-opacity" />
|
|
151
|
+
</TransitionChild>
|
|
152
|
+
|
|
153
|
+
<!-- This element is to trick the browser into centering the modal contents. -->
|
|
154
|
+
<span aria-hidden="true" class="hidden sm:inline-block sm:align-middle sm:h-screen"
|
|
155
|
+
>​</span
|
|
156
|
+
>
|
|
157
|
+
<TransitionChild
|
|
158
|
+
as="template"
|
|
159
|
+
enter="ease-out duration-100"
|
|
160
|
+
enter-from="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
|
|
161
|
+
enter-to="opacity-100 translate-y-0 sm:scale-100"
|
|
162
|
+
leave="ease-in duration-200"
|
|
163
|
+
leave-from="opacity-100 translate-y-0 sm:scale-100"
|
|
164
|
+
leave-to="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
|
|
165
|
+
>
|
|
166
|
+
<div
|
|
167
|
+
class="bg-red-100 inline-block align-bottom text-left transform transition-all sm:align-middle w-full overflow-hidden h-[100vh] top-0 left-0 right-0 absolute"
|
|
168
|
+
>
|
|
169
|
+
<DynamicModal
|
|
170
|
+
:show="showModalConfirmClosePageBuilder"
|
|
171
|
+
:type="typeModal"
|
|
172
|
+
:gridColumnAmount="gridColumnModal"
|
|
173
|
+
:title="titleModal"
|
|
174
|
+
:description="descriptionModal"
|
|
175
|
+
:firstButtonText="firstButtonModal"
|
|
176
|
+
:secondButtonText="secondButtonModal"
|
|
177
|
+
:thirdButtonText="thirdButtonModal"
|
|
178
|
+
@firstModalButtonFunction="firstModalButtonFunction"
|
|
179
|
+
@secondModalButtonFunction="secondModalButtonFunction"
|
|
180
|
+
@thirdModalButtonFunction="thirdModalButtonFunction"
|
|
181
|
+
>
|
|
182
|
+
<header></header>
|
|
183
|
+
<main></main>
|
|
184
|
+
</DynamicModal>
|
|
185
|
+
<div
|
|
186
|
+
@click="pageBuilderStateStore.setComponent(null)"
|
|
187
|
+
class="px-4 px-4 lg:h-[10vh] h-[16vh] flex items-center justify-between border-b border-gray-200 bg-white"
|
|
188
|
+
>
|
|
189
|
+
<div class="flex items-center justify-start divide-x divide-gray-200">
|
|
190
|
+
<button type="button" @click="firstButton" class="border-r border-gray-200 pr-6">
|
|
191
|
+
<img class="h-6" src="/logo/logo.svg" alt="Logo" />
|
|
192
|
+
</button>
|
|
193
|
+
<button
|
|
194
|
+
class="myPrimaryButton lg:text-sm text-[10px] lg:py-2 py-2 min-h-2 ml-4"
|
|
195
|
+
@click="secondButton"
|
|
196
|
+
type="button"
|
|
197
|
+
>
|
|
198
|
+
<span class="material-symbols-outlined text-[18px]"> save </span>
|
|
199
|
+
Save & Close
|
|
200
|
+
</button>
|
|
201
|
+
<button
|
|
202
|
+
v-if="updateOrCreate === 'update' && hideDraftButton"
|
|
203
|
+
class="mySecondaryButton lg:text-sm text-[10px] lg:py-2 py-2 min-h-2 ml-2"
|
|
204
|
+
@click="handleDraftForUpdate"
|
|
205
|
+
type="button"
|
|
206
|
+
>
|
|
207
|
+
<span class="material-symbols-outlined text-[18px]">
|
|
208
|
+
settings_backup_restore
|
|
209
|
+
</span>
|
|
210
|
+
Use Draft
|
|
211
|
+
</button>
|
|
212
|
+
</div>
|
|
213
|
+
<button
|
|
214
|
+
type="button"
|
|
215
|
+
@click="firstButton"
|
|
216
|
+
class="flex items-center justify-center gap-1 cursor-pointer"
|
|
217
|
+
>
|
|
218
|
+
<span class="myPrimaryParagraph font-medium"> Close Builder </span>
|
|
219
|
+
<div
|
|
220
|
+
class="h-10 w-10 cursor-pointer rounded-full flex items-center border-none justify-center bg-gray-50 aspect-square hover:bg-myPrimaryLinkColor hover:text-white focus-visible:ring-0"
|
|
221
|
+
>
|
|
222
|
+
<span class="material-symbols-outlined"> close </span>
|
|
223
|
+
</div>
|
|
224
|
+
</button>
|
|
225
|
+
</div>
|
|
226
|
+
<slot></slot>
|
|
227
|
+
</div>
|
|
228
|
+
</TransitionChild>
|
|
229
|
+
</div>
|
|
230
|
+
</Dialog>
|
|
231
|
+
</TransitionRoot>
|
|
232
|
+
</teleport>
|
|
233
|
+
</template>
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import Modal from '@/Components/Modals/Modal.vue';
|
|
3
|
+
import { delay } from '@/composables/delay';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
Dialog,
|
|
7
|
+
DialogOverlay,
|
|
8
|
+
DialogTitle,
|
|
9
|
+
TransitionChild,
|
|
10
|
+
TransitionRoot,
|
|
11
|
+
} from '@headlessui/vue';
|
|
12
|
+
import { Menu, MenuButton, MenuItem, MenuItems } from '@headlessui/vue';
|
|
13
|
+
import { useUserStore } from '@/stores/user';
|
|
14
|
+
|
|
15
|
+
const userStore = useUserStore();
|
|
16
|
+
|
|
17
|
+
defineProps({
|
|
18
|
+
show: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: false,
|
|
21
|
+
required: true,
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const emit = defineEmits(['firstPageBuilderPreviewModalButton']);
|
|
26
|
+
|
|
27
|
+
// first button function
|
|
28
|
+
const firstButton = async function () {
|
|
29
|
+
emit('firstPageBuilderPreviewModalButton');
|
|
30
|
+
|
|
31
|
+
userStore.setIsLoading(true);
|
|
32
|
+
await delay();
|
|
33
|
+
userStore.setIsLoading(false);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const handleEscapeKey = function () {
|
|
37
|
+
firstButton();
|
|
38
|
+
};
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
<template>
|
|
42
|
+
<teleport to="body">
|
|
43
|
+
<TransitionRoot
|
|
44
|
+
:show="show"
|
|
45
|
+
as="template"
|
|
46
|
+
>
|
|
47
|
+
<Dialog
|
|
48
|
+
@close="firstButton"
|
|
49
|
+
@keydown.escape.prevent="handleEscapeKey"
|
|
50
|
+
as="div"
|
|
51
|
+
class="fixed z-30 inset-0 overflow-y-auto focus:outline-none"
|
|
52
|
+
tabindex="0"
|
|
53
|
+
>
|
|
54
|
+
<div
|
|
55
|
+
class="flex items-end justify-center pb-20 text-center sm:block sm:p-0 bg-white"
|
|
56
|
+
>
|
|
57
|
+
<TransitionChild
|
|
58
|
+
as="template"
|
|
59
|
+
enter="ease-out duration-100"
|
|
60
|
+
enter-from="opacity-0"
|
|
61
|
+
enter-to="opacity-100"
|
|
62
|
+
leave="ease-in duration-100"
|
|
63
|
+
leave-from="opacity-100"
|
|
64
|
+
leave-to="opacity-100"
|
|
65
|
+
>
|
|
66
|
+
<DialogOverlay
|
|
67
|
+
class="fixed inset-0 bg-opacity-75 transition-opacity"
|
|
68
|
+
/>
|
|
69
|
+
</TransitionChild>
|
|
70
|
+
|
|
71
|
+
<!-- This element is to trick the browser into centering the modal contents. -->
|
|
72
|
+
<span
|
|
73
|
+
aria-hidden="true"
|
|
74
|
+
class="hidden sm:inline-block sm:align-middle sm:h-screen"
|
|
75
|
+
>​</span
|
|
76
|
+
>
|
|
77
|
+
<TransitionChild
|
|
78
|
+
as="template"
|
|
79
|
+
enter="ease-out duration-100"
|
|
80
|
+
enter-from="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
|
|
81
|
+
enter-to="opacity-100 translate-y-0 sm:scale-100"
|
|
82
|
+
leave="ease-in duration-100"
|
|
83
|
+
leave-from="opacity-100 translate-y-0 sm:scale-100"
|
|
84
|
+
leave-to="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
|
|
85
|
+
>
|
|
86
|
+
<div
|
|
87
|
+
class="bg-red-100 inline-block align-bottom text-left transform transition-all sm:align-middle w-full overflow-hidden h-[100vh] top-0 left-0 right-0 absolute"
|
|
88
|
+
>
|
|
89
|
+
<div
|
|
90
|
+
class="px-4 px-4 lg:h-[10vh] h-[16vh] flex items-center justify-between border-b border-gray-200 bg-white"
|
|
91
|
+
>
|
|
92
|
+
<button
|
|
93
|
+
type="button"
|
|
94
|
+
@click="firstButton"
|
|
95
|
+
>
|
|
96
|
+
<img
|
|
97
|
+
class="h-6"
|
|
98
|
+
src="/logo/logo.svg"
|
|
99
|
+
alt="Logo"
|
|
100
|
+
/>
|
|
101
|
+
</button>
|
|
102
|
+
<div
|
|
103
|
+
@click="firstButton"
|
|
104
|
+
class="flex items-center justify-center gap-1 cursor-pointer"
|
|
105
|
+
>
|
|
106
|
+
<span class="myPrimaryParagraph font-medium">
|
|
107
|
+
Close Preview
|
|
108
|
+
</span>
|
|
109
|
+
<div
|
|
110
|
+
class="h-10 w-10 cursor-pointer rounded-full flex items-center border-none justify-center bg-gray-50 aspect-square hover:bg-myPrimaryLinkColor hover:text-white focus-visible:ring-0"
|
|
111
|
+
>
|
|
112
|
+
<span class="material-symbols-outlined"> close </span>
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
116
|
+
<slot></slot>
|
|
117
|
+
</div>
|
|
118
|
+
</TransitionChild>
|
|
119
|
+
</div>
|
|
120
|
+
</Dialog>
|
|
121
|
+
</TransitionRoot>
|
|
122
|
+
</teleport>
|
|
123
|
+
</template>
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { Menu, MenuButton, MenuItem, MenuItems } from '@headlessui/vue'
|
|
3
|
+
import PageBuilder from '@/composables/PageBuilder.ts'
|
|
4
|
+
import { ref, computed } from 'vue'
|
|
5
|
+
import PageBuilderPreviewModal from '@/Components/Modals/PageBuilderPreviewModal.vue'
|
|
6
|
+
import Preview from '@/PageBuilder/Preview.vue'
|
|
7
|
+
import SlideOverRight from '@/Components/PageBuilder/Slidebars/SlideOverRight.vue'
|
|
8
|
+
import PageBuilderSettings from '@/Components/PageBuilder/Settings/PageBuilderSettings.vue'
|
|
9
|
+
import DynamicModal from '@/Components/Modals/DynamicModal.vue'
|
|
10
|
+
import { usePageBuilderStateStore } from '@/stores/page-builder-state'
|
|
11
|
+
import { useMediaLibraryStore } from '@/stores/media-library'
|
|
12
|
+
|
|
13
|
+
const mediaLibraryStore = useMediaLibraryStore()
|
|
14
|
+
const pageBuilderStateStore = usePageBuilderStateStore()
|
|
15
|
+
const pageBuilder = new PageBuilder(pageBuilderStateStore, mediaLibraryStore)
|
|
16
|
+
const emit = defineEmits(['previewCurrentDesign'])
|
|
17
|
+
|
|
18
|
+
const showModalDeleteAllComponents = ref(false)
|
|
19
|
+
//
|
|
20
|
+
// use dynamic model
|
|
21
|
+
const typeModal = ref('')
|
|
22
|
+
const gridColumnModal = ref(Number(1))
|
|
23
|
+
const titleModal = ref('')
|
|
24
|
+
const descriptionModal = ref('')
|
|
25
|
+
const firstButtonModal = ref('')
|
|
26
|
+
const secondButtonModal = ref(null)
|
|
27
|
+
const thirdButtonModal = ref(null)
|
|
28
|
+
// set dynamic modal handle functions
|
|
29
|
+
const firstModalButtonFunction = ref(null)
|
|
30
|
+
const secondModalButtonFunction = ref(null)
|
|
31
|
+
const thirdModalButtonFunction = ref(null)
|
|
32
|
+
|
|
33
|
+
const showSettingsSlideOverRight = ref(false)
|
|
34
|
+
const titleSettingsSlideOverRight = ref(null)
|
|
35
|
+
const openPageBuilderPreviewModal = ref(false)
|
|
36
|
+
const firstPageBuilderPreviewModalButton = ref(null)
|
|
37
|
+
|
|
38
|
+
const handlePageBuilderPreview = function () {
|
|
39
|
+
emit('previewCurrentDesign')
|
|
40
|
+
|
|
41
|
+
openPageBuilderPreviewModal.value = true
|
|
42
|
+
// handle click
|
|
43
|
+
firstPageBuilderPreviewModalButton.value = function () {
|
|
44
|
+
openPageBuilderPreviewModal.value = false
|
|
45
|
+
}
|
|
46
|
+
// end modal
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const deleteAllComponents = function () {
|
|
50
|
+
showModalDeleteAllComponents.value = true
|
|
51
|
+
typeModal.value = 'delete'
|
|
52
|
+
gridColumnModal.value = 2
|
|
53
|
+
titleModal.value = 'Remove all Components'
|
|
54
|
+
descriptionModal.value = 'Are you sure you want to remove all Components?'
|
|
55
|
+
firstButtonModal.value = 'Close'
|
|
56
|
+
secondButtonModal.value = null
|
|
57
|
+
thirdButtonModal.value = 'Delete'
|
|
58
|
+
|
|
59
|
+
// handle click
|
|
60
|
+
firstModalButtonFunction.value = function () {
|
|
61
|
+
showModalDeleteAllComponents.value = false
|
|
62
|
+
}
|
|
63
|
+
//
|
|
64
|
+
// handle click
|
|
65
|
+
thirdModalButtonFunction.value = function () {
|
|
66
|
+
pageBuilder.deleteAllComponents()
|
|
67
|
+
pageBuilderStateStore.setComponents(null)
|
|
68
|
+
showModalDeleteAllComponents.value = false
|
|
69
|
+
}
|
|
70
|
+
// end modal
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// handle slideover window
|
|
74
|
+
const handleSettingsSlideOver = function () {
|
|
75
|
+
pageBuilderStateStore.setComponent(null)
|
|
76
|
+
|
|
77
|
+
titleSettingsSlideOverRight.value = 'Settings'
|
|
78
|
+
showSettingsSlideOverRight.value = true
|
|
79
|
+
}
|
|
80
|
+
// handle slideover window
|
|
81
|
+
const settingsSlideOverButton = function () {
|
|
82
|
+
pageBuilderStateStore.setComponent(null)
|
|
83
|
+
|
|
84
|
+
showSettingsSlideOverRight.value = false
|
|
85
|
+
}
|
|
86
|
+
</script>
|
|
87
|
+
|
|
88
|
+
<template>
|
|
89
|
+
<SlideOverRight
|
|
90
|
+
:open="showSettingsSlideOverRight"
|
|
91
|
+
:title="titleSettingsSlideOverRight"
|
|
92
|
+
@slideOverButton="settingsSlideOverButton"
|
|
93
|
+
>
|
|
94
|
+
<PageBuilderSettings> </PageBuilderSettings>
|
|
95
|
+
</SlideOverRight>
|
|
96
|
+
<DynamicModal
|
|
97
|
+
:show="showModalDeleteAllComponents"
|
|
98
|
+
:type="typeModal"
|
|
99
|
+
:gridColumnAmount="gridColumnModal"
|
|
100
|
+
:title="titleModal"
|
|
101
|
+
:description="descriptionModal"
|
|
102
|
+
:firstButtonText="firstButtonModal"
|
|
103
|
+
:secondButtonText="secondButtonModal"
|
|
104
|
+
:thirdButtonText="thirdButtonModal"
|
|
105
|
+
@firstModalButtonFunction="firstModalButtonFunction"
|
|
106
|
+
@secondModalButtonFunction="secondModalButtonFunction"
|
|
107
|
+
@thirdModalButtonFunction="thirdModalButtonFunction"
|
|
108
|
+
>
|
|
109
|
+
<header></header>
|
|
110
|
+
<main></main>
|
|
111
|
+
</DynamicModal>
|
|
112
|
+
<Menu as="div" class="myPrimaryParagraph relative lg:inline-block hidden text-left">
|
|
113
|
+
<div>
|
|
114
|
+
<MenuButton
|
|
115
|
+
class="inline-flex items-center gap-2 justify-center w-full rounded-md border border-gray-300 shadow-sm pl-4 pr-6 py-2 bg-white text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-100 focus:ring-emerald-600"
|
|
116
|
+
>
|
|
117
|
+
<span class="material-symbols-outlined text-[16px]"> keyboard_command_key </span>
|
|
118
|
+
<span class="text-sm"> Options </span>
|
|
119
|
+
</MenuButton>
|
|
120
|
+
</div>
|
|
121
|
+
|
|
122
|
+
<transition
|
|
123
|
+
enter-active-class="transition ease-out duration-100"
|
|
124
|
+
enter-from-class="transform opacity-0 scale-95"
|
|
125
|
+
enter-to-class="transform opacity-100 scale-100"
|
|
126
|
+
leave-active-class="transition ease-in duration-75"
|
|
127
|
+
leave-from-class="transform opacity-100 scale-100"
|
|
128
|
+
leave-to-class="transform opacity-0 scale-95"
|
|
129
|
+
>
|
|
130
|
+
<MenuItems
|
|
131
|
+
class="z-50 origin-top-right absolute right-0 mt-2 w-56 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5 divide-y divide-gray-100 focus:outline-none"
|
|
132
|
+
>
|
|
133
|
+
<div class="py-1">
|
|
134
|
+
<MenuItem v-slot="{ active }">
|
|
135
|
+
<div
|
|
136
|
+
@click="handlePageBuilderPreview"
|
|
137
|
+
class="cursor-pointer"
|
|
138
|
+
:class="[
|
|
139
|
+
active ? 'bg-myPrimaryLightGrayColor text-gray-900' : 'text-gray-700',
|
|
140
|
+
'block px-4 py-2',
|
|
141
|
+
]"
|
|
142
|
+
>
|
|
143
|
+
<div class="flex items-center justify-left gap-2 text-sm">
|
|
144
|
+
<div
|
|
145
|
+
class="h-8 w-8 cursor-pointer rounded-full flex items-center border-none justify-center bg-gray-50 aspect-square hover:bg-myPrimaryLinkColor hover:text-white focus-visible:ring-0"
|
|
146
|
+
>
|
|
147
|
+
<span class="material-symbols-outlined text-[16px]"> visibility </span>
|
|
148
|
+
</div>
|
|
149
|
+
Preview
|
|
150
|
+
</div>
|
|
151
|
+
</div>
|
|
152
|
+
</MenuItem>
|
|
153
|
+
|
|
154
|
+
<MenuItem v-slot="{ active }">
|
|
155
|
+
<div
|
|
156
|
+
@click="handleSettingsSlideOver"
|
|
157
|
+
class="cursor-pointer"
|
|
158
|
+
:class="[
|
|
159
|
+
active ? 'bg-myPrimaryLightGrayColor text-gray-900' : 'text-gray-700',
|
|
160
|
+
'block px-4 py-2',
|
|
161
|
+
]"
|
|
162
|
+
>
|
|
163
|
+
<div class="flex items-center justify-left gap-2 text-sm">
|
|
164
|
+
<div
|
|
165
|
+
class="h-8 w-8 cursor-pointer rounded-full flex items-center border-none justify-center bg-gray-50 aspect-square hover:bg-myPrimaryLinkColor hover:text-white focus-visible:ring-0"
|
|
166
|
+
>
|
|
167
|
+
<span class="material-symbols-outlined text-[16px]"> settings </span>
|
|
168
|
+
</div>
|
|
169
|
+
Settings
|
|
170
|
+
</div>
|
|
171
|
+
</div>
|
|
172
|
+
</MenuItem>
|
|
173
|
+
<MenuItem v-slot="{ active }">
|
|
174
|
+
<div
|
|
175
|
+
@click="deleteAllComponents"
|
|
176
|
+
class="cursor-pointer"
|
|
177
|
+
:class="[
|
|
178
|
+
active ? 'bg-myPrimaryLightGrayColor text-gray-900' : 'text-gray-700',
|
|
179
|
+
'block px-4 py-2',
|
|
180
|
+
]"
|
|
181
|
+
>
|
|
182
|
+
<div class="flex items-center justify-left gap-2 text-sm">
|
|
183
|
+
<div
|
|
184
|
+
class="h-8 w-8 cursor-pointer rounded-full flex items-center border-none justify-center bg-gray-50 aspect-square hover:bg-myPrimaryErrorColor hover:text-white text-myPrimaryErrorColor"
|
|
185
|
+
>
|
|
186
|
+
<span class="myMediumIcon material-symbols-outlined text-[16px]"> delete </span>
|
|
187
|
+
</div>
|
|
188
|
+
<span class="group-hover:text-white"> Clear page </span>
|
|
189
|
+
</div>
|
|
190
|
+
</div>
|
|
191
|
+
</MenuItem>
|
|
192
|
+
</div>
|
|
193
|
+
</MenuItems>
|
|
194
|
+
</transition>
|
|
195
|
+
</Menu>
|
|
196
|
+
<PageBuilderPreviewModal
|
|
197
|
+
:show="openPageBuilderPreviewModal"
|
|
198
|
+
@firstPageBuilderPreviewModalButton="firstPageBuilderPreviewModalButton"
|
|
199
|
+
>
|
|
200
|
+
<Preview></Preview>
|
|
201
|
+
</PageBuilderPreviewModal>
|
|
202
|
+
</template>
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import tailwindColors from '@/utils/builder/tailwaind-colors'
|
|
3
|
+
import PageBuilder from '@/composables/PageBuilder.ts'
|
|
4
|
+
import { computed, ref, watch } from 'vue'
|
|
5
|
+
import {
|
|
6
|
+
Listbox,
|
|
7
|
+
ListboxButton,
|
|
8
|
+
ListboxLabel,
|
|
9
|
+
ListboxOption,
|
|
10
|
+
ListboxOptions,
|
|
11
|
+
} from '@headlessui/vue'
|
|
12
|
+
import { usePageBuilderStateStore } from '@/stores/page-builder-state'
|
|
13
|
+
import { useMediaLibraryStore } from '@/stores/media-library'
|
|
14
|
+
|
|
15
|
+
const mediaLibraryStore = useMediaLibraryStore()
|
|
16
|
+
const pageBuilderStateStore = usePageBuilderStateStore()
|
|
17
|
+
const pageBuilder = new PageBuilder(pageBuilderStateStore, mediaLibraryStore)
|
|
18
|
+
const backgroundColor = ref(null)
|
|
19
|
+
const getBackgroundColor = computed(() => {
|
|
20
|
+
return pageBuilderStateStore.getBackgroundColor
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
watch(
|
|
24
|
+
getBackgroundColor,
|
|
25
|
+
(newValue) => {
|
|
26
|
+
backgroundColor.value = newValue
|
|
27
|
+
pageBuilder.handlePageBuilderMethods()
|
|
28
|
+
},
|
|
29
|
+
{ immediate: true },
|
|
30
|
+
)
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<template>
|
|
34
|
+
<Listbox as="div" v-model="backgroundColor">
|
|
35
|
+
<div class="relative">
|
|
36
|
+
<ListboxButton
|
|
37
|
+
class="w-max flex items-center px-2 text-[12.5px] gap-2 text-nowrap pl-2 pr-3 h-10 cursor-pointer rounded-full border-none justify-center bg-gray-50 hover:bg-myPrimaryLinkColor hover:text-white focus-visible:ring-0"
|
|
38
|
+
>
|
|
39
|
+
<div v-if="getBackgroundColor === 'none'" class="flex gap-2 items-center">
|
|
40
|
+
<span class="material-symbols-outlined"> colors </span>
|
|
41
|
+
<span class="block truncate text-[12.5px]">Background color </span>
|
|
42
|
+
</div>
|
|
43
|
+
<div v-if="backgroundColor !== 'none'" class="flex items-center gap-2">
|
|
44
|
+
<div
|
|
45
|
+
class="aspect-square w-6 h-6 border border-gray-800 rounded-sm"
|
|
46
|
+
:class="`bg-${backgroundColor?.replace('bg-', '')}`"
|
|
47
|
+
></div>
|
|
48
|
+
<span class="block truncate">{{ backgroundColor }}</span>
|
|
49
|
+
</div>
|
|
50
|
+
</ListboxButton>
|
|
51
|
+
|
|
52
|
+
<transition
|
|
53
|
+
leave-active-class="transition ease-in duration-100"
|
|
54
|
+
leave-from-class="opacity-100"
|
|
55
|
+
leave-to-class="opacity-0"
|
|
56
|
+
>
|
|
57
|
+
<ListboxOptions
|
|
58
|
+
class="absolute min-w-[12rem] z-40 mt-1 max-h-56 w-full overflow-auto rounded-md bg-gray-50 py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm"
|
|
59
|
+
>
|
|
60
|
+
<ListboxOption
|
|
61
|
+
as="template"
|
|
62
|
+
v-for="color in tailwindColors.backgroundColorVariables"
|
|
63
|
+
@click="pageBuilder.handleBackgroundColor(backgroundColor)"
|
|
64
|
+
:key="color"
|
|
65
|
+
:value="color"
|
|
66
|
+
v-slot="{ active, backgroundColor }"
|
|
67
|
+
>
|
|
68
|
+
<li
|
|
69
|
+
:class="[
|
|
70
|
+
active ? 'bg-myPrimaryLinkColor text-white' : 'text-myPrimaryDarkGrayColor',
|
|
71
|
+
'relative cursor-default select-none py-2 pl-3 pr-9',
|
|
72
|
+
]"
|
|
73
|
+
>
|
|
74
|
+
<div v-if="color === 'none'" class="flex items-center">
|
|
75
|
+
<span class="material-symbols-outlined"> ev_shadow </span>
|
|
76
|
+
<span class="ml-3">Transparent</span>
|
|
77
|
+
</div>
|
|
78
|
+
<div v-if="color !== 'none'" class="flex items-center">
|
|
79
|
+
<div
|
|
80
|
+
class="aspect-square w-6 h-6 border border-gray-100 rounded-sm"
|
|
81
|
+
:class="`bg-${color.replace('bg-', '')}`"
|
|
82
|
+
></div>
|
|
83
|
+
<span class="ml-3">{{ color }}</span>
|
|
84
|
+
</div>
|
|
85
|
+
</li>
|
|
86
|
+
</ListboxOption>
|
|
87
|
+
</ListboxOptions>
|
|
88
|
+
</transition>
|
|
89
|
+
</div>
|
|
90
|
+
</Listbox>
|
|
91
|
+
</template>
|