@myissue/vue-website-page-builder 3.0.17 → 3.0.19
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/README.md +79 -76
- package/dist/page-builder/2-images-text.png +0 -0
- package/dist/page-builder/3-images-text.png +0 -0
- package/dist/page-builder/3-vertical-images.png +0 -0
- package/dist/page-builder/4-images-text.png +0 -0
- package/dist/vue-website-page-builder.css +1 -1
- package/dist/vue-website-page-builder.js +7168 -7261
- package/dist/vue-website-page-builder.umd.cjs +146 -81
- package/package.json +5 -4
- package/src/App.vue +4 -115
- package/src/Components/Homepage/HomeSection.vue +70 -162
- package/src/Components/MediaLibrary/SidebarUnsplash.vue +9 -16
- package/src/Components/MediaLibrary/Unsplash.vue +51 -91
- package/src/Components/Modals/MediaLibraryModal.vue +56 -318
- package/src/Components/Modals/PageBuilderPreviewModal.vue +22 -40
- package/src/Components/PageBuilder/AdvancedPageBuilderSettings.vue +7 -0
- package/src/Components/PageBuilder/DropdownsPlusToggles/OptionsDropdown.vue +165 -110
- package/src/Components/PageBuilder/EditorMenu/Editables/BackgroundColorEditor.vue +9 -16
- package/src/Components/PageBuilder/EditorMenu/Editables/BorderRadius.vue +18 -18
- package/src/Components/PageBuilder/EditorMenu/Editables/Borders.vue +16 -21
- package/src/Components/PageBuilder/EditorMenu/Editables/ClassEditor.vue +12 -12
- package/src/Components/PageBuilder/EditorMenu/Editables/ComponentTopMenu.vue +10 -9
- package/src/Components/PageBuilder/EditorMenu/Editables/DeleteElement.vue +9 -9
- package/src/Components/PageBuilder/EditorMenu/Editables/EditGetElement.vue +144 -136
- package/src/Components/PageBuilder/EditorMenu/Editables/ElementEditor.vue +9 -10
- package/src/Components/PageBuilder/EditorMenu/Editables/ImageEditor.vue +31 -27
- package/src/Components/PageBuilder/EditorMenu/Editables/LinkEditor.vue +20 -14
- package/src/Components/PageBuilder/EditorMenu/Editables/ManageBackgroundOpacity.vue +9 -10
- package/src/Components/PageBuilder/EditorMenu/Editables/ManageOpacity.vue +9 -10
- package/src/Components/PageBuilder/EditorMenu/Editables/PaddingPlusMargin.vue +16 -16
- package/src/Components/PageBuilder/EditorMenu/Editables/TextColorEditor.vue +9 -16
- package/src/Components/PageBuilder/EditorMenu/Editables/Typography.vue +22 -20
- package/src/Components/PageBuilder/EditorMenu/RightSidebarEditor.vue +25 -27
- package/src/Components/PageBuilder/NoneCustomMediaLibraryComponent.vue +3 -0
- package/src/Components/PageBuilder/NoneCustomSearchComponent.vue +91 -0
- package/src/Components/PageBuilder/PageBuilderSettings.vue +8 -0
- package/src/Components/PageBuilder/Settings/AdvancedPageBuilderSettings.vue +31 -72
- package/src/Components/PageBuilder/Settings/PageBuilderSettings.vue +32 -36
- package/src/Components/Search/SearchComponents.vue +11 -199
- package/src/Components/TipTap/TipTap.vue +8 -7
- package/src/Components/TipTap/TipTapInput.vue +136 -134
- package/src/PageBuilder/PageBuilder.vue +220 -32
- package/src/composables/{PageBuilder.ts → PageBuilderClass.ts} +223 -142
- package/src/composables/usePageBuilderModal.ts +25 -0
- package/src/index.ts +8 -2
- package/src/stores/media-library.ts +1 -5
- package/src/stores/page-builder-state.ts +52 -36
- package/src/stores/user.ts +8 -6
- package/src/types/global.d.ts +6 -44
- package/src/types/index.ts +169 -0
- package/src/utils/html-elements/component.ts +88 -0
- package/src/utils/html-elements/componentHelpers.ts +101 -0
- package/src/Components/Modals/PageBuilderModal.vue +0 -233
- package/src/utils/builder/html-elements/componentHelpers.ts +0 -101
|
@@ -1,18 +1,27 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { Menu, MenuButton, MenuItem, MenuItems } from '@headlessui/vue'
|
|
3
|
-
import
|
|
4
|
-
import { ref, computed } from 'vue'
|
|
3
|
+
import PageBuilderClass from '@/composables/PageBuilderClass.ts'
|
|
4
|
+
import { ref, computed, inject } from 'vue'
|
|
5
5
|
import PageBuilderPreviewModal from '@/Components/Modals/PageBuilderPreviewModal.vue'
|
|
6
6
|
import Preview from '@/PageBuilder/Preview.vue'
|
|
7
7
|
import SlideOverRight from '@/Components/PageBuilder/Slidebars/SlideOverRight.vue'
|
|
8
8
|
import PageBuilderSettings from '@/Components/PageBuilder/Settings/PageBuilderSettings.vue'
|
|
9
9
|
import DynamicModal from '@/Components/Modals/DynamicModal.vue'
|
|
10
|
-
import { usePageBuilderStateStore } from '@/stores/page-builder-state'
|
|
11
|
-
import { useMediaLibraryStore } from '@/stores/media-library'
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
const pageBuilderStateStore =
|
|
15
|
-
const
|
|
11
|
+
// Get stores from parent PageBuilder component
|
|
12
|
+
const pageBuilderStateStore = inject('pageBuilderStateStore')
|
|
13
|
+
const mediaLibraryStore = inject('mediaLibraryStore')
|
|
14
|
+
const userStore = inject('userStore')
|
|
15
|
+
|
|
16
|
+
const getCurrentUser = computed(() => {
|
|
17
|
+
return userStore.getCurrentUser
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
const getCurrentResourceData = computed(() => {
|
|
21
|
+
return pageBuilderStateStore.getCurrentResourceData
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
const pageBuilderClass = new PageBuilderClass(pageBuilderStateStore, mediaLibraryStore)
|
|
16
25
|
const emit = defineEmits(['previewCurrentDesign'])
|
|
17
26
|
|
|
18
27
|
const showModalDeleteAllComponents = ref(false)
|
|
@@ -63,7 +72,7 @@ const deleteAllComponents = function () {
|
|
|
63
72
|
//
|
|
64
73
|
// handle click
|
|
65
74
|
thirdModalButtonFunction.value = function () {
|
|
66
|
-
|
|
75
|
+
pageBuilderClass.deleteAllComponents()
|
|
67
76
|
pageBuilderStateStore.setComponents(null)
|
|
68
77
|
showModalDeleteAllComponents.value = false
|
|
69
78
|
}
|
|
@@ -86,117 +95,163 @@ const settingsSlideOverButton = function () {
|
|
|
86
95
|
</script>
|
|
87
96
|
|
|
88
97
|
<template>
|
|
89
|
-
<
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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"
|
|
98
|
+
<div>
|
|
99
|
+
<SlideOverRight
|
|
100
|
+
:open="showSettingsSlideOverRight"
|
|
101
|
+
:title="titleSettingsSlideOverRight"
|
|
102
|
+
@slideOverButton="settingsSlideOverButton"
|
|
129
103
|
>
|
|
130
|
-
<
|
|
131
|
-
|
|
104
|
+
<PageBuilderSettings> </PageBuilderSettings>
|
|
105
|
+
</SlideOverRight>
|
|
106
|
+
<DynamicModal
|
|
107
|
+
:show="showModalDeleteAllComponents"
|
|
108
|
+
:type="typeModal"
|
|
109
|
+
:gridColumnAmount="gridColumnModal"
|
|
110
|
+
:title="titleModal"
|
|
111
|
+
:description="descriptionModal"
|
|
112
|
+
:firstButtonText="firstButtonModal"
|
|
113
|
+
:secondButtonText="secondButtonModal"
|
|
114
|
+
:thirdButtonText="thirdButtonModal"
|
|
115
|
+
@firstModalButtonFunction="firstModalButtonFunction"
|
|
116
|
+
@secondModalButtonFunction="secondModalButtonFunction"
|
|
117
|
+
@thirdModalButtonFunction="thirdModalButtonFunction"
|
|
118
|
+
>
|
|
119
|
+
<header></header>
|
|
120
|
+
<main></main>
|
|
121
|
+
</DynamicModal>
|
|
122
|
+
<Menu as="div" class="myPrimaryParagraph relative lg:inline-block hidden text-left">
|
|
123
|
+
<div>
|
|
124
|
+
<MenuButton
|
|
125
|
+
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"
|
|
126
|
+
>
|
|
127
|
+
<span class="material-symbols-outlined text-[16px]"> keyboard_command_key </span>
|
|
128
|
+
<span class="text-sm"> Options </span>
|
|
129
|
+
</MenuButton>
|
|
130
|
+
</div>
|
|
131
|
+
|
|
132
|
+
<transition
|
|
133
|
+
enter-active-class="transition ease-out duration-100"
|
|
134
|
+
enter-from-class="transform opacity-0 scale-95"
|
|
135
|
+
enter-to-class="transform opacity-100 scale-100"
|
|
136
|
+
leave-active-class="transition ease-in duration-75"
|
|
137
|
+
leave-from-class="transform opacity-100 scale-100"
|
|
138
|
+
leave-to-class="transform opacity-0 scale-95"
|
|
132
139
|
>
|
|
133
|
-
<
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
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">
|
|
140
|
+
<MenuItems
|
|
141
|
+
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"
|
|
142
|
+
>
|
|
143
|
+
<div class="py-1">
|
|
144
|
+
<template v-if="getCurrentUser && getCurrentUser.name">
|
|
145
|
+
<MenuItem v-slot="{ active }">
|
|
144
146
|
<div
|
|
145
|
-
class="
|
|
147
|
+
class="cursor-defualt"
|
|
148
|
+
:class="[
|
|
149
|
+
active ? 'bg-myPrimaryLightGrayColor text-gray-900' : 'text-gray-700',
|
|
150
|
+
'block px-4 py-2',
|
|
151
|
+
]"
|
|
146
152
|
>
|
|
147
|
-
<
|
|
153
|
+
<div class="flex items-center justify-left gap-2 text-sm">
|
|
154
|
+
<div
|
|
155
|
+
class="h-8 w-8 cursor-defualt rounded-full flex items-center border-none justify-center bg-gray-50 aspect-square hover:bg-myPrimaryLinkColor hover:text-white focus-visible:ring-0"
|
|
156
|
+
>
|
|
157
|
+
<span class="material-symbols-outlined text-[16px]"> person </span>
|
|
158
|
+
</div>
|
|
159
|
+
<div>
|
|
160
|
+
{{ getCurrentUser.name }}
|
|
161
|
+
</div>
|
|
162
|
+
</div>
|
|
148
163
|
</div>
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
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
|
+
</MenuItem>
|
|
165
|
+
</template>
|
|
166
|
+
<template v-if="getCurrentResourceData && getCurrentResourceData.title">
|
|
167
|
+
<MenuItem v-slot="{ active }">
|
|
164
168
|
<div
|
|
165
|
-
class="
|
|
169
|
+
class="cursor-default"
|
|
170
|
+
:class="[
|
|
171
|
+
active ? 'bg-myPrimaryLightGrayColor text-gray-900' : 'text-gray-700',
|
|
172
|
+
'block px-4 py-2',
|
|
173
|
+
]"
|
|
166
174
|
>
|
|
167
|
-
<
|
|
175
|
+
<div class="flex items-center justify-left gap-2 text-sm">
|
|
176
|
+
<div
|
|
177
|
+
class="h-8 w-8 cursor-default rounded-full flex items-center border-none justify-center bg-gray-50 aspect-square hover:bg-myPrimaryLinkColor hover:text-white focus-visible:ring-0"
|
|
178
|
+
>
|
|
179
|
+
<span class="material-symbols-outlined text-[16px]"> post </span>
|
|
180
|
+
</div>
|
|
181
|
+
<div>
|
|
182
|
+
{{ getCurrentResourceData.title }}
|
|
183
|
+
</div>
|
|
184
|
+
</div>
|
|
185
|
+
</div>
|
|
186
|
+
</MenuItem>
|
|
187
|
+
</template>
|
|
188
|
+
<MenuItem v-slot="{ active }">
|
|
189
|
+
<div
|
|
190
|
+
@click="handlePageBuilderPreview"
|
|
191
|
+
class="cursor-pointer"
|
|
192
|
+
:class="[
|
|
193
|
+
active ? 'bg-myPrimaryLightGrayColor text-gray-900' : 'text-gray-700',
|
|
194
|
+
'block px-4 py-2',
|
|
195
|
+
]"
|
|
196
|
+
>
|
|
197
|
+
<div class="flex items-center justify-left gap-2 text-sm">
|
|
198
|
+
<div
|
|
199
|
+
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"
|
|
200
|
+
>
|
|
201
|
+
<span class="material-symbols-outlined text-[16px]"> visibility </span>
|
|
202
|
+
</div>
|
|
203
|
+
Preview
|
|
168
204
|
</div>
|
|
169
|
-
Settings
|
|
170
205
|
</div>
|
|
171
|
-
</
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
206
|
+
</MenuItem>
|
|
207
|
+
|
|
208
|
+
<MenuItem v-slot="{ active }">
|
|
209
|
+
<div
|
|
210
|
+
@click="handleSettingsSlideOver"
|
|
211
|
+
class="cursor-pointer"
|
|
212
|
+
:class="[
|
|
213
|
+
active ? 'bg-myPrimaryLightGrayColor text-gray-900' : 'text-gray-700',
|
|
214
|
+
'block px-4 py-2',
|
|
215
|
+
]"
|
|
216
|
+
>
|
|
217
|
+
<div class="flex items-center justify-left gap-2 text-sm">
|
|
218
|
+
<div
|
|
219
|
+
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"
|
|
220
|
+
>
|
|
221
|
+
<span class="material-symbols-outlined text-[16px]"> settings </span>
|
|
222
|
+
</div>
|
|
223
|
+
Settings
|
|
187
224
|
</div>
|
|
188
|
-
<span class="group-hover:text-white"> Clear page </span>
|
|
189
225
|
</div>
|
|
190
|
-
</
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
226
|
+
</MenuItem>
|
|
227
|
+
<MenuItem v-slot="{ active }">
|
|
228
|
+
<div
|
|
229
|
+
@click="deleteAllComponents"
|
|
230
|
+
class="cursor-pointer"
|
|
231
|
+
:class="[
|
|
232
|
+
active ? 'bg-myPrimaryLightGrayColor text-gray-900' : 'text-gray-700',
|
|
233
|
+
'block px-4 py-2',
|
|
234
|
+
]"
|
|
235
|
+
>
|
|
236
|
+
<div class="flex items-center justify-left gap-2 text-sm">
|
|
237
|
+
<div
|
|
238
|
+
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"
|
|
239
|
+
>
|
|
240
|
+
<span class="myMediumIcon material-symbols-outlined text-[16px]"> delete </span>
|
|
241
|
+
</div>
|
|
242
|
+
<span class="group-hover:text-white"> Clear page </span>
|
|
243
|
+
</div>
|
|
244
|
+
</div>
|
|
245
|
+
</MenuItem>
|
|
246
|
+
</div>
|
|
247
|
+
</MenuItems>
|
|
248
|
+
</transition>
|
|
249
|
+
</Menu>
|
|
250
|
+
<PageBuilderPreviewModal
|
|
251
|
+
:show="openPageBuilderPreviewModal"
|
|
252
|
+
@firstPageBuilderPreviewModalButton="firstPageBuilderPreviewModalButton"
|
|
253
|
+
>
|
|
254
|
+
<Preview></Preview>
|
|
255
|
+
</PageBuilderPreviewModal>
|
|
256
|
+
</div>
|
|
202
257
|
</template>
|
|
@@ -1,20 +1,13 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import { ref, computed, inject, watch } from 'vue'
|
|
3
|
+
import { Listbox, ListboxButton, ListboxOption, ListboxOptions } from '@headlessui/vue'
|
|
4
|
+
import PageBuilderClass from '@/composables/PageBuilderClass.ts'
|
|
2
5
|
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
6
|
|
|
15
|
-
|
|
16
|
-
const pageBuilderStateStore =
|
|
17
|
-
const
|
|
7
|
+
// Get stores from parent PageBuilder component
|
|
8
|
+
const pageBuilderStateStore = inject('pageBuilderStateStore')
|
|
9
|
+
const mediaLibraryStore = inject('mediaLibraryStore')
|
|
10
|
+
const pageBuilderClass = new PageBuilderClass(pageBuilderStateStore, mediaLibraryStore)
|
|
18
11
|
const backgroundColor = ref(null)
|
|
19
12
|
const getBackgroundColor = computed(() => {
|
|
20
13
|
return pageBuilderStateStore.getBackgroundColor
|
|
@@ -24,7 +17,7 @@ watch(
|
|
|
24
17
|
getBackgroundColor,
|
|
25
18
|
(newValue) => {
|
|
26
19
|
backgroundColor.value = newValue
|
|
27
|
-
|
|
20
|
+
pageBuilderClass.handlePageBuilderMethods()
|
|
28
21
|
},
|
|
29
22
|
{ immediate: true },
|
|
30
23
|
)
|
|
@@ -60,7 +53,7 @@ watch(
|
|
|
60
53
|
<ListboxOption
|
|
61
54
|
as="template"
|
|
62
55
|
v-for="color in tailwindColors.backgroundColorVariables"
|
|
63
|
-
@click="
|
|
56
|
+
@click="pageBuilderClass.handleBackgroundColor(backgroundColor)"
|
|
64
57
|
:key="color"
|
|
65
58
|
:value="color"
|
|
66
59
|
v-slot="{ active, backgroundColor }"
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import { ref, computed, inject, watch } from 'vue'
|
|
3
|
+
import EditorAccordion from '../EditorAccordion.vue'
|
|
4
|
+
import PageBuilderClass from '@/composables/PageBuilderClass.ts'
|
|
2
5
|
import tailwindBorderRadius from '@/utils/builder/tailwind-border-radius'
|
|
3
|
-
import PageBuilder from '@/composables/PageBuilder.ts'
|
|
4
|
-
import EditorAccordion from '@/Components/PageBuilder/EditorMenu/EditorAccordion.vue'
|
|
5
|
-
import { computed, ref, watch } from 'vue'
|
|
6
|
-
import { usePageBuilderStateStore } from '@/stores/page-builder-state'
|
|
7
|
-
import { useMediaLibraryStore } from '@/stores/media-library'
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
const pageBuilderStateStore =
|
|
11
|
-
const
|
|
7
|
+
// Get stores from parent PageBuilder component
|
|
8
|
+
const pageBuilderStateStore = inject('pageBuilderStateStore')
|
|
9
|
+
const mediaLibraryStore = inject('mediaLibraryStore')
|
|
10
|
+
|
|
11
|
+
const pageBuilderClass = new PageBuilderClass(pageBuilderStateStore, mediaLibraryStore)
|
|
12
12
|
const borderRadiusGlobal = ref(null)
|
|
13
13
|
const borderRadiusTopLeft = ref(null)
|
|
14
14
|
const borderRadiusTopRight = ref(null)
|
|
@@ -34,7 +34,7 @@ watch(
|
|
|
34
34
|
getBorderRadiusGlobal,
|
|
35
35
|
(newValue) => {
|
|
36
36
|
borderRadiusGlobal.value = newValue
|
|
37
|
-
|
|
37
|
+
pageBuilderClass.handlePageBuilderMethods()
|
|
38
38
|
},
|
|
39
39
|
{ immediate: true },
|
|
40
40
|
)
|
|
@@ -42,7 +42,7 @@ watch(
|
|
|
42
42
|
getBorderRadiusTopLeft,
|
|
43
43
|
(newValue) => {
|
|
44
44
|
borderRadiusTopLeft.value = newValue
|
|
45
|
-
|
|
45
|
+
pageBuilderClass.handlePageBuilderMethods()
|
|
46
46
|
},
|
|
47
47
|
{ immediate: true },
|
|
48
48
|
)
|
|
@@ -50,7 +50,7 @@ watch(
|
|
|
50
50
|
getBorderRadiusTopRight,
|
|
51
51
|
(newValue) => {
|
|
52
52
|
borderRadiusTopRight.value = newValue
|
|
53
|
-
|
|
53
|
+
pageBuilderClass.handlePageBuilderMethods()
|
|
54
54
|
},
|
|
55
55
|
{ immediate: true },
|
|
56
56
|
)
|
|
@@ -58,7 +58,7 @@ watch(
|
|
|
58
58
|
getBorderRadiusBottomleft,
|
|
59
59
|
(newValue) => {
|
|
60
60
|
borderRadiusBottomleft.value = newValue
|
|
61
|
-
|
|
61
|
+
pageBuilderClass.handlePageBuilderMethods()
|
|
62
62
|
},
|
|
63
63
|
{ immediate: true },
|
|
64
64
|
)
|
|
@@ -66,7 +66,7 @@ watch(
|
|
|
66
66
|
getBorderRadiusBottomRight,
|
|
67
67
|
(newValue) => {
|
|
68
68
|
borderRadiusBottomRight.value = newValue
|
|
69
|
-
|
|
69
|
+
pageBuilderClass.handlePageBuilderMethods()
|
|
70
70
|
},
|
|
71
71
|
{ immediate: true },
|
|
72
72
|
)
|
|
@@ -82,7 +82,7 @@ watch(
|
|
|
82
82
|
<select
|
|
83
83
|
v-model="borderRadiusGlobal"
|
|
84
84
|
class="myPrimarySelect"
|
|
85
|
-
@change="
|
|
85
|
+
@change="pageBuilderClass.handleBorderRadiusGlobal(borderRadiusGlobal)"
|
|
86
86
|
>
|
|
87
87
|
<option disabled value="">Select</option>
|
|
88
88
|
<option
|
|
@@ -99,7 +99,7 @@ watch(
|
|
|
99
99
|
<select
|
|
100
100
|
v-model="borderRadiusTopLeft"
|
|
101
101
|
class="myPrimarySelect"
|
|
102
|
-
@change="
|
|
102
|
+
@change="pageBuilderClass.handleBorderRadiusTopLeft(borderRadiusTopLeft)"
|
|
103
103
|
>
|
|
104
104
|
<option disabled value="">Select</option>
|
|
105
105
|
<option
|
|
@@ -115,7 +115,7 @@ watch(
|
|
|
115
115
|
<select
|
|
116
116
|
v-model="borderRadiusTopRight"
|
|
117
117
|
class="myPrimarySelect"
|
|
118
|
-
@change="
|
|
118
|
+
@change="pageBuilderClass.handleBorderRadiusTopRight(borderRadiusTopRight)"
|
|
119
119
|
>
|
|
120
120
|
<option disabled value="">Select</option>
|
|
121
121
|
<option
|
|
@@ -131,7 +131,7 @@ watch(
|
|
|
131
131
|
<select
|
|
132
132
|
v-model="borderRadiusBottomleft"
|
|
133
133
|
class="myPrimarySelect"
|
|
134
|
-
@change="
|
|
134
|
+
@change="pageBuilderClass.handleBorderRadiusBottomleft(borderRadiusBottomleft)"
|
|
135
135
|
>
|
|
136
136
|
<option disabled value="">Select</option>
|
|
137
137
|
<option
|
|
@@ -147,7 +147,7 @@ watch(
|
|
|
147
147
|
<select
|
|
148
148
|
v-model="borderRadiusBottomRight"
|
|
149
149
|
class="myPrimarySelect"
|
|
150
|
-
@change="
|
|
150
|
+
@change="pageBuilderClass.handleBorderRadiusBottomRight(borderRadiusBottomRight)"
|
|
151
151
|
>
|
|
152
152
|
<option disabled value="">Select</option>
|
|
153
153
|
<option
|
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import { ref, computed, inject, watch } from 'vue'
|
|
3
|
+
import EditorAccordion from '../EditorAccordion.vue'
|
|
4
|
+
import PageBuilderClass from '@/composables/PageBuilderClass.ts'
|
|
2
5
|
import tailwindBorderStyleWidthPlusColor from '@/utils/builder/tailwind-border-style-width-color'
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { computed, ref, watch } from 'vue'
|
|
6
|
-
import {
|
|
7
|
-
Listbox,
|
|
8
|
-
ListboxButton,
|
|
9
|
-
ListboxLabel,
|
|
10
|
-
ListboxOption,
|
|
11
|
-
ListboxOptions,
|
|
12
|
-
} from '@headlessui/vue'
|
|
13
|
-
import { usePageBuilderStateStore } from '@/stores/page-builder-state'
|
|
14
|
-
import { useMediaLibraryStore } from '@/stores/media-library'
|
|
6
|
+
import tailwindColors from '@/utils/builder/tailwaind-colors'
|
|
7
|
+
import { Listbox, ListboxButton, ListboxOption, ListboxOptions } from '@headlessui/vue'
|
|
15
8
|
|
|
16
|
-
|
|
17
|
-
const pageBuilderStateStore =
|
|
18
|
-
const
|
|
9
|
+
// Get stores from parent PageBuilder component
|
|
10
|
+
const pageBuilderStateStore = inject('pageBuilderStateStore')
|
|
11
|
+
const mediaLibraryStore = inject('mediaLibraryStore')
|
|
12
|
+
|
|
13
|
+
const pageBuilderClass = new PageBuilderClass(pageBuilderStateStore, mediaLibraryStore)
|
|
19
14
|
const borderStyle = ref(null)
|
|
20
15
|
const borderWidth = ref(null)
|
|
21
16
|
const borderColor = ref(null)
|
|
@@ -33,7 +28,7 @@ watch(
|
|
|
33
28
|
getBorderStyle,
|
|
34
29
|
(newValue) => {
|
|
35
30
|
borderStyle.value = newValue
|
|
36
|
-
|
|
31
|
+
pageBuilderClass.handlePageBuilderMethods()
|
|
37
32
|
},
|
|
38
33
|
{ immediate: true },
|
|
39
34
|
)
|
|
@@ -41,7 +36,7 @@ watch(
|
|
|
41
36
|
getBorderWidth,
|
|
42
37
|
(newValue) => {
|
|
43
38
|
borderWidth.value = newValue
|
|
44
|
-
|
|
39
|
+
pageBuilderClass.handlePageBuilderMethods()
|
|
45
40
|
},
|
|
46
41
|
{ immediate: true },
|
|
47
42
|
)
|
|
@@ -49,7 +44,7 @@ watch(
|
|
|
49
44
|
getBorderColor,
|
|
50
45
|
(newValue) => {
|
|
51
46
|
borderColor.value = newValue
|
|
52
|
-
|
|
47
|
+
pageBuilderClass.handlePageBuilderMethods()
|
|
53
48
|
},
|
|
54
49
|
{ immediate: true },
|
|
55
50
|
)
|
|
@@ -64,7 +59,7 @@ watch(
|
|
|
64
59
|
<select
|
|
65
60
|
v-model="borderStyle"
|
|
66
61
|
class="myPrimarySelect"
|
|
67
|
-
@change="
|
|
62
|
+
@change="pageBuilderClass.handleBorderStyle(borderStyle)"
|
|
68
63
|
>
|
|
69
64
|
<option disabled value="">Select</option>
|
|
70
65
|
<option
|
|
@@ -80,7 +75,7 @@ watch(
|
|
|
80
75
|
<select
|
|
81
76
|
v-model="borderWidth"
|
|
82
77
|
class="myPrimarySelect"
|
|
83
|
-
@change="
|
|
78
|
+
@change="pageBuilderClass.handleBorderWidth(borderWidth)"
|
|
84
79
|
>
|
|
85
80
|
<option disabled value="">Select</option>
|
|
86
81
|
<option
|
|
@@ -127,7 +122,7 @@ watch(
|
|
|
127
122
|
<ListboxOption
|
|
128
123
|
as="template"
|
|
129
124
|
v-for="color in tailwindBorderStyleWidthPlusColor.borderColor"
|
|
130
|
-
@click="
|
|
125
|
+
@click="pageBuilderClass.handleBorderColor(borderColor)"
|
|
131
126
|
:key="color"
|
|
132
127
|
:value="color"
|
|
133
128
|
v-slot="{ active, borderColor }"
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { computed,
|
|
3
|
-
import EditorAccordion from '
|
|
4
|
-
import
|
|
5
|
-
import { usePageBuilderStateStore } from '@/stores/page-builder-state'
|
|
6
|
-
import { useMediaLibraryStore } from '@/stores/media-library'
|
|
2
|
+
import { ref, computed, inject, watch } from 'vue'
|
|
3
|
+
import EditorAccordion from '../EditorAccordion.vue'
|
|
4
|
+
import PageBuilderClass from '@/composables/PageBuilderClass.ts'
|
|
7
5
|
|
|
8
|
-
|
|
9
|
-
const pageBuilderStateStore =
|
|
10
|
-
const
|
|
6
|
+
// Get stores from parent PageBuilder component
|
|
7
|
+
const pageBuilderStateStore = inject('pageBuilderStateStore')
|
|
8
|
+
const mediaLibraryStore = inject('mediaLibraryStore')
|
|
9
|
+
|
|
10
|
+
const pageBuilderClass = new PageBuilderClass(pageBuilderStateStore, mediaLibraryStore)
|
|
11
11
|
const currentClasses = ref(null)
|
|
12
12
|
const getCurrentClasses = computed(() => {
|
|
13
13
|
return pageBuilderStateStore.getCurrentClasses
|
|
@@ -24,8 +24,8 @@ watch(
|
|
|
24
24
|
const inputClass = ref('')
|
|
25
25
|
|
|
26
26
|
const handleAddClasses = function () {
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
pageBuilderClass.handleAddClasses(inputClass.value)
|
|
28
|
+
pageBuilderClass.handlePageBuilderMethods()
|
|
29
29
|
|
|
30
30
|
inputClass.value = ''
|
|
31
31
|
}
|
|
@@ -42,8 +42,8 @@ const handleAddClasses = function () {
|
|
|
42
42
|
class="myPrimaryTag cursor-pointer hover:bg-myPrimaryErrorColor hover:text-white text-xs py-2 font-medium"
|
|
43
43
|
@click="
|
|
44
44
|
() => {
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
pageBuilderClass.handleRemoveClasses(className)
|
|
46
|
+
pageBuilderClass.handlePageBuilderMethods()
|
|
47
47
|
}
|
|
48
48
|
"
|
|
49
49
|
>
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import DynamicModal from '@/Components/Modals/DynamicModal.vue'
|
|
3
|
-
import
|
|
3
|
+
import { computed, inject } from 'vue'
|
|
4
|
+
import PageBuilderClass from '@/composables/PageBuilderClass.ts'
|
|
4
5
|
import { ref } from 'vue'
|
|
5
|
-
import { usePageBuilderStateStore } from '@/stores/page-builder-state'
|
|
6
|
-
import { useMediaLibraryStore } from '@/stores/media-library'
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
const pageBuilderStateStore =
|
|
7
|
+
// Get stores from parent PageBuilder component
|
|
8
|
+
const pageBuilderStateStore = inject('pageBuilderStateStore')
|
|
9
|
+
const mediaLibraryStore = inject('mediaLibraryStore')
|
|
10
|
+
|
|
10
11
|
const showModalDeleteComponent = ref(false)
|
|
11
12
|
// use dynamic model
|
|
12
13
|
const typeModal = ref('')
|
|
@@ -20,7 +21,7 @@ const thirdButtonModal = ref(null)
|
|
|
20
21
|
const firstModalButtonFunction = ref(null)
|
|
21
22
|
const secondModalButtonFunction = ref(null)
|
|
22
23
|
const thirdModalButtonFunction = ref(null)
|
|
23
|
-
const
|
|
24
|
+
const pageBuilderClass = new PageBuilderClass(pageBuilderStateStore, mediaLibraryStore)
|
|
24
25
|
|
|
25
26
|
// remove component
|
|
26
27
|
const deleteComponent = function (e) {
|
|
@@ -40,7 +41,7 @@ const deleteComponent = function (e) {
|
|
|
40
41
|
//
|
|
41
42
|
// handle click
|
|
42
43
|
thirdModalButtonFunction.value = function () {
|
|
43
|
-
|
|
44
|
+
pageBuilderClass.deleteComponent()
|
|
44
45
|
|
|
45
46
|
showModalDeleteComponent.value = false
|
|
46
47
|
}
|
|
@@ -77,14 +78,14 @@ const deleteComponent = function (e) {
|
|
|
77
78
|
|
|
78
79
|
<button
|
|
79
80
|
type="button"
|
|
80
|
-
@click="
|
|
81
|
+
@click="pageBuilderClass.moveComponent(-1)"
|
|
81
82
|
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"
|
|
82
83
|
>
|
|
83
84
|
<span class="material-symbols-outlined"> move_up </span>
|
|
84
85
|
</button>
|
|
85
86
|
<button
|
|
86
87
|
type="button"
|
|
87
|
-
@click="
|
|
88
|
+
@click="pageBuilderClass.moveComponent(1)"
|
|
88
89
|
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"
|
|
89
90
|
>
|
|
90
91
|
<span class="material-symbols-outlined"> move_down </span>
|