@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.
Files changed (95) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +470 -0
  3. package/dist/android-chrome-192x192.png +0 -0
  4. package/dist/android-chrome-512x512.png +0 -0
  5. package/dist/apple-touch-icon.png +0 -0
  6. package/dist/browserconfig.xml +9 -0
  7. package/dist/components.json +36 -0
  8. package/dist/favicon-16x16.png +0 -0
  9. package/dist/favicon-32x32.png +0 -0
  10. package/dist/favicon.ico +0 -0
  11. package/dist/home/features.jpg +0 -0
  12. package/dist/home/page-builder-example.jpg +0 -0
  13. package/dist/logo/logo.svg +49 -0
  14. package/dist/mstile-310x150.png +0 -0
  15. package/dist/mstile-310x310.png +0 -0
  16. package/dist/page-builder/2-images-text-top.png +0 -0
  17. package/dist/page-builder/2-images.png +0 -0
  18. package/dist/page-builder/3-images.png +0 -0
  19. package/dist/page-builder/6-images.png +0 -0
  20. package/dist/page-builder/image.png +0 -0
  21. package/dist/page-builder/placeholder.jpg +0 -0
  22. package/dist/page-builder/two-vertical-images.png +0 -0
  23. package/dist/placeholder_image.jpg +0 -0
  24. package/dist/robots.txt +2 -0
  25. package/dist/vue-website-page-builder.css +1 -0
  26. package/dist/vue-website-page-builder.js +24794 -0
  27. package/dist/vue-website-page-builder.umd.cjs +195 -0
  28. package/package.json +99 -0
  29. package/src/App.vue +122 -0
  30. package/src/Components/Homepage/Footer.vue +42 -0
  31. package/src/Components/Homepage/HomeSection.vue +540 -0
  32. package/src/Components/Homepage/Navbar.vue +30 -0
  33. package/src/Components/Layouts/FullWidthElement.vue +34 -0
  34. package/src/Components/Loaders/FullScreenSpinner.vue +13 -0
  35. package/src/Components/Loaders/SmallUniversalSpinner.vue +26 -0
  36. package/src/Components/MediaLibrary/SidebarUnsplash.vue +40 -0
  37. package/src/Components/MediaLibrary/Unsplash.vue +306 -0
  38. package/src/Components/Modals/DynamicModal.vue +476 -0
  39. package/src/Components/Modals/MediaLibraryModal.vue +418 -0
  40. package/src/Components/Modals/Modal.vue +102 -0
  41. package/src/Components/Modals/PageBuilderModal.vue +233 -0
  42. package/src/Components/Modals/PageBuilderPreviewModal.vue +123 -0
  43. package/src/Components/PageBuilder/DropdownsPlusToggles/OptionsDropdown.vue +202 -0
  44. package/src/Components/PageBuilder/DropdownsPlusToggles/SaveDesign.vue +7 -0
  45. package/src/Components/PageBuilder/EditorMenu/Editables/BackgroundColorEditor.vue +91 -0
  46. package/src/Components/PageBuilder/EditorMenu/Editables/BorderRadius.vue +163 -0
  47. package/src/Components/PageBuilder/EditorMenu/Editables/Borders.vue +164 -0
  48. package/src/Components/PageBuilder/EditorMenu/Editables/ClassEditor.vue +80 -0
  49. package/src/Components/PageBuilder/EditorMenu/Editables/ComponentTopMenu.vue +93 -0
  50. package/src/Components/PageBuilder/EditorMenu/Editables/DeleteElement.vue +42 -0
  51. package/src/Components/PageBuilder/EditorMenu/Editables/EditGetElement.vue +338 -0
  52. package/src/Components/PageBuilder/EditorMenu/Editables/ElementEditor.vue +58 -0
  53. package/src/Components/PageBuilder/EditorMenu/Editables/ImageEditor.vue +82 -0
  54. package/src/Components/PageBuilder/EditorMenu/Editables/LinkEditor.vue +301 -0
  55. package/src/Components/PageBuilder/EditorMenu/Editables/ManageBackgroundOpacity.vue +109 -0
  56. package/src/Components/PageBuilder/EditorMenu/Editables/ManageOpacity.vue +107 -0
  57. package/src/Components/PageBuilder/EditorMenu/Editables/OpacityEditor.vue +16 -0
  58. package/src/Components/PageBuilder/EditorMenu/Editables/PaddingPlusMargin.vue +134 -0
  59. package/src/Components/PageBuilder/EditorMenu/Editables/TextColorEditor.vue +91 -0
  60. package/src/Components/PageBuilder/EditorMenu/Editables/Typography.vue +199 -0
  61. package/src/Components/PageBuilder/EditorMenu/EditorAccordion.vue +42 -0
  62. package/src/Components/PageBuilder/EditorMenu/RightSidebarEditor.vue +113 -0
  63. package/src/Components/PageBuilder/Settings/AdvancedPageBuilderSettings.vue +229 -0
  64. package/src/Components/PageBuilder/Settings/PageBuilderSettings.vue +101 -0
  65. package/src/Components/PageBuilder/Slidebars/SlideOverRight.vue +91 -0
  66. package/src/Components/PageBuilder/Slidebars/SlideOverRightParent.vue +91 -0
  67. package/src/Components/Search/SearchComponents.vue +259 -0
  68. package/src/Components/TipTap/TipTap.vue +32 -0
  69. package/src/Components/TipTap/TipTapInput.vue +325 -0
  70. package/src/PageBuilder/PageBuilder.vue +347 -0
  71. package/src/PageBuilder/Preview.vue +24 -0
  72. package/src/composables/PageBuilder.ts +1483 -0
  73. package/src/composables/delay.ts +5 -0
  74. package/src/composables/extract-text-content-html.ts +34 -0
  75. package/src/composables/isObject.ts +6 -0
  76. package/src/composables/usePromise.ts +10 -0
  77. package/src/composables/vueFetch.ts +278 -0
  78. package/src/css/app.css +614 -0
  79. package/src/index.ts +16 -0
  80. package/src/main.ts +11 -0
  81. package/src/stores/media-library.ts +34 -0
  82. package/src/stores/page-builder-state.ts +461 -0
  83. package/src/stores/unsplash.ts +107 -0
  84. package/src/stores/user.ts +30 -0
  85. package/src/types/global.d.ts +49 -0
  86. package/src/utils/builder/compiledCSS.ts +2205 -0
  87. package/src/utils/builder/html-doc-declaration-with-components.ts +7 -0
  88. package/src/utils/builder/html-elements/componentHelpers.ts +101 -0
  89. package/src/utils/builder/tailwaind-colors.ts +503 -0
  90. package/src/utils/builder/tailwind-border-radius.ts +67 -0
  91. package/src/utils/builder/tailwind-border-style-width-color.ts +272 -0
  92. package/src/utils/builder/tailwind-font-sizes.ts +76 -0
  93. package/src/utils/builder/tailwind-font-styles.ts +24 -0
  94. package/src/utils/builder/tailwind-opacities.ts +45 -0
  95. package/src/utils/builder/tailwind-padding-margin.ts +159 -0
@@ -0,0 +1,301 @@
1
+ <script setup>
2
+ import PageBuilder from '@/composables/PageBuilder.ts'
3
+ import EditorAccordion from '../EditorAccordion.vue'
4
+ import { computed, nextTick, ref, watch } from 'vue'
5
+ import { Switch } from '@headlessui/vue'
6
+ import { usePageBuilderStateStore } from '@/stores/page-builder-state'
7
+ import { useMediaLibraryStore } from '@/stores/media-library'
8
+
9
+ const mediaLibraryStore = useMediaLibraryStore()
10
+ const pageBuilderStateStore = usePageBuilderStateStore()
11
+ const pageBuilder = new PageBuilder(pageBuilderStateStore, mediaLibraryStore)
12
+ const hyperlinkEnable = ref(false)
13
+ const urlInput = ref(null)
14
+ const openHyperlinkInNewTab = ref(false)
15
+ const getElementContainsHyperlink = computed(() => {
16
+ return pageBuilderStateStore.getElementContainsHyperlink
17
+ })
18
+ const getHyperlinkAbility = computed(() => {
19
+ return pageBuilderStateStore.getHyperlinkAbility
20
+ })
21
+ const getHyperlinkMessage = computed(() => {
22
+ return pageBuilderStateStore.getHyperlinkMessage
23
+ })
24
+ const getHyperlinkError = computed(() => {
25
+ return pageBuilderStateStore.getHyperlinkError
26
+ })
27
+ const getHyperlinkInput = computed(() => {
28
+ return pageBuilderStateStore.getHyperlinkInput
29
+ })
30
+ const getHyberlinkEnable = computed(() => {
31
+ return pageBuilderStateStore.getHyberlinkEnable
32
+ })
33
+
34
+ const getOpenHyperlinkInNewTab = computed(() => {
35
+ return pageBuilderStateStore.getOpenHyperlinkInNewTab
36
+ })
37
+ const getElement = computed(() => {
38
+ return pageBuilderStateStore.getElement
39
+ })
40
+
41
+ watch(getHyperlinkInput, (newValue) => {
42
+ urlInput.value = newValue
43
+ })
44
+ watch(getHyberlinkEnable, (newValue) => {
45
+ hyperlinkEnable.value = newValue
46
+ })
47
+ watch(getOpenHyperlinkInNewTab, (newValue) => {
48
+ openHyperlinkInNewTab.value = newValue
49
+ })
50
+
51
+ // remove hyperlink
52
+ watch(hyperlinkEnable, (hyperlinkEnableNewValue) => {
53
+ hyperlinkEnable.value = hyperlinkEnableNewValue
54
+ pageBuilderStateStore.setHyberlinkEnable(hyperlinkEnable.value)
55
+ })
56
+
57
+ const handleToggleHyperlinkEnable = async function (data) {
58
+ await nextTick()
59
+
60
+ // remove hyperlink
61
+ if (hyperlinkEnable.value === false) {
62
+ pageBuilder.handleHyperlink(hyperlinkEnable.value, data)
63
+ }
64
+ }
65
+ // add hyperlink
66
+ const handleHyperlink = function () {
67
+ pageBuilder.handleHyperlink(hyperlinkEnable.value, urlInput.value, openHyperlinkInNewTab.value)
68
+ }
69
+
70
+ const handleToggleOpenHyperlinkInNewTab = async function () {
71
+ await nextTick()
72
+
73
+ pageBuilder.handleHyperlink(hyperlinkEnable.value, urlInput.value, openHyperlinkInNewTab.value)
74
+ }
75
+ </script>
76
+
77
+ <template>
78
+ <EditorAccordion>
79
+ <template #title>Link</template>
80
+ <template #content>
81
+ <!-- Hyperlink ability / start -->
82
+ <div v-if="getHyperlinkAbility === false" class="rounded-md bg-red-50 p-2">
83
+ <div class="flex items-center">
84
+ <div class="flex-shrink-0">
85
+ <ExclamationCircleIcon class="w-4 h-4 text-myPrimaryErrorColor"></ExclamationCircleIcon>
86
+ </div>
87
+ <div class="ml-2">
88
+ <p class="text-sm font-medium text-green-800">
89
+ Not able to add hyperlink on this element
90
+ </p>
91
+ </div>
92
+ <div class="ml-auto pl-3">
93
+ <div class="-mx-1.5 -my-1.5">
94
+ <button
95
+ type="button"
96
+ class="inline-flex rounded-md bg-green-50 p-1.5 text-green-500 hover:bg-green-100 focus:outline-none focus:ring-2 focus:ring-green-600 focus:ring-offset-2 focus:ring-offset-green-50"
97
+ ></button>
98
+ </div>
99
+ </div>
100
+ </div>
101
+ </div>
102
+ <!-- Hyperlink ability / end -->
103
+ <div v-if="getHyperlinkAbility === true">
104
+ <div class="my-3 py-3">
105
+ <div class="flex items-center justify-between gap-2 w-full">
106
+ <p class="myPrimaryParagraph">Enable hyperlink</p>
107
+ <!-- Toggle start -->
108
+ <Switch
109
+ v-model="hyperlinkEnable"
110
+ @click="handleToggleHyperlinkEnable('removeHyperlink')"
111
+ :class="[
112
+ hyperlinkEnable ? 'bg-myPrimaryLinkColor' : 'bg-gray-200',
113
+ 'relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-myPrimaryLinkColor focus:ring-offset-2',
114
+ ]"
115
+ >
116
+ <span class="sr-only">Use setting</span>
117
+ <span
118
+ :class="[
119
+ hyperlinkEnable ? 'translate-x-5' : 'translate-x-0',
120
+ 'pointer-events-none relative inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out',
121
+ ]"
122
+ >
123
+ <span
124
+ :class="[
125
+ hyperlinkEnable
126
+ ? 'opacity-0 ease-out duration-100'
127
+ : 'opacity-100 ease-in duration-200',
128
+ 'absolute inset-0 flex h-full w-full items-center justify-center transition-opacity',
129
+ ]"
130
+ aria-hidden="true"
131
+ >
132
+ <svg class="h-3 w-3 text-gray-400" fill="none" viewBox="0 0 12 12">
133
+ <path
134
+ d="M4 8l2-2m0 0l2-2M6 6L4 4m2 2l2 2"
135
+ stroke="currentColor"
136
+ stroke-width="1.5"
137
+ stroke-linecap="round"
138
+ stroke-linejoin="round"
139
+ />
140
+ </svg>
141
+ </span>
142
+ <span
143
+ :class="[
144
+ hyperlinkEnable
145
+ ? 'opacity-100 ease-in duration-200'
146
+ : 'opacity-0 ease-out duration-100',
147
+ 'absolute inset-0 flex h-full w-full items-center justify-center transition-opacity',
148
+ ]"
149
+ aria-hidden="true"
150
+ >
151
+ <svg
152
+ class="h-3 w-3 text-myPrimaryLinkColor"
153
+ fill="currentColor"
154
+ viewBox="0 0 12 12"
155
+ >
156
+ <path
157
+ d="M3.707 5.293a1 1 0 00-1.414 1.414l1.414-1.414zM5 8l-.707.707a1 1 0 001.414 0L5 8zm4.707-3.293a1 1 0 00-1.414-1.414l1.414 1.414zm-7.414 2l2 2 1.414-1.414-2-2-1.414 1.414zm3.414 2l4-4-1.414-1.414-4 4 1.414 1.414z"
158
+ />
159
+ </svg>
160
+ </span>
161
+ </span>
162
+ </Switch>
163
+ <!-- Toggle end -->
164
+ </div>
165
+ </div>
166
+ <!-- attached url - start -->
167
+ <div v-if="getElementContainsHyperlink === true" class="rounded-md bg-green-50 p-2">
168
+ <div class="flex items-center">
169
+ <div class="flex-shrink-0">
170
+ <span class="myMediumIcon material-symbols-outlined"> check </span>
171
+ </div>
172
+ <div class="ml-2">
173
+ <p class="text-sm font-medium text-green-800">Hyperlink added</p>
174
+ </div>
175
+ <div class="ml-auto pl-3">
176
+ <div class="-mx-1.5 -my-1.5">
177
+ <button
178
+ type="button"
179
+ class="inline-flex rounded-md bg-green-50 p-1.5 text-green-500 hover:bg-green-100 focus:outline-none focus:ring-2 focus:ring-green-600 focus:ring-offset-2 focus:ring-offset-green-50"
180
+ ></button>
181
+ </div>
182
+ </div>
183
+ </div>
184
+ </div>
185
+ <!-- attached url - end -->
186
+ <!-- no attached url - start -->
187
+ <div v-if="getElementContainsHyperlink === false" class="rounded-md bg-red-50 p-2">
188
+ <div class="flex items-center">
189
+ <div class="flex-shrink-0">
190
+ <ExclamationCircleIcon
191
+ class="w-4 h-4 text-myPrimaryErrorColor"
192
+ ></ExclamationCircleIcon>
193
+ </div>
194
+ <div class="ml-2">
195
+ <p class="text-sm font-medium text-green-800">No hyperlink added</p>
196
+ </div>
197
+ <div class="ml-auto pl-3">
198
+ <div class="-mx-1.5 -my-1.5">
199
+ <button
200
+ type="button"
201
+ class="inline-flex rounded-md bg-green-50 p-1.5 text-green-500 hover:bg-green-100 focus:outline-none focus:ring-2 focus:ring-green-600 focus:ring-offset-2 focus:ring-offset-green-50"
202
+ ></button>
203
+ </div>
204
+ </div>
205
+ </div>
206
+ </div>
207
+ <!-- no attached url - end -->
208
+ <div v-if="hyperlinkEnable === true" class="my-3 py-3">
209
+ <div class="relative flex items-center w-full border myPrimaryInput py-0 p-0">
210
+ <input
211
+ v-model="urlInput"
212
+ type="text"
213
+ placeholder="URL.."
214
+ autocomplete="off"
215
+ class="myPrimaryInput border-none rounded-r-none ml-0 w-full"
216
+ @keydown.enter.tab.prevent="handleHyperlink()"
217
+ />
218
+ <div
219
+ class="border border-gray-200 border-none rounded flex items-center justify-center h-full w-8"
220
+ >
221
+ <kbd class="myPrimaryParagraph text-gray-400 border-none"> ⏎ </kbd>
222
+ </div>
223
+ </div>
224
+
225
+ <p
226
+ v-if="getHyperlinkMessage !== null"
227
+ class="myPrimaryParagraph text-myPrimarySuccesColor mt-1"
228
+ >
229
+ {{ getHyperlinkMessage }}
230
+ </p>
231
+ <p v-if="getHyperlinkError !== null" class="myPrimaryParagraphError mt-1">
232
+ {{ getHyperlinkError }}
233
+ </p>
234
+
235
+ <div class="my-3 py-3">
236
+ <div class="flex items-center justify-between gap-2 w-full">
237
+ <p class="myPrimaryParagraph">Open in new tab</p>
238
+ <!-- Toggle start -->
239
+ <Switch
240
+ v-model="openHyperlinkInNewTab"
241
+ @click="handleToggleOpenHyperlinkInNewTab"
242
+ :class="[
243
+ openHyperlinkInNewTab ? 'bg-myPrimaryLinkColor' : 'bg-gray-200',
244
+ 'relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-myPrimaryLinkColor focus:ring-offset-2',
245
+ ]"
246
+ >
247
+ <span class="sr-only">Use setting</span>
248
+ <span
249
+ :class="[
250
+ openHyperlinkInNewTab ? 'translate-x-5' : 'translate-x-0',
251
+ 'pointer-events-none relative inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out',
252
+ ]"
253
+ >
254
+ <span
255
+ :class="[
256
+ openHyperlinkInNewTab
257
+ ? 'opacity-0 ease-out duration-100'
258
+ : 'opacity-100 ease-in duration-200',
259
+ 'absolute inset-0 flex h-full w-full items-center justify-center transition-opacity',
260
+ ]"
261
+ aria-hidden="true"
262
+ >
263
+ <svg class="h-3 w-3 text-gray-400" fill="none" viewBox="0 0 12 12">
264
+ <path
265
+ d="M4 8l2-2m0 0l2-2M6 6L4 4m2 2l2 2"
266
+ stroke="currentColor"
267
+ stroke-width="1.5"
268
+ stroke-linecap="round"
269
+ stroke-linejoin="round"
270
+ />
271
+ </svg>
272
+ </span>
273
+ <span
274
+ :class="[
275
+ openHyperlinkInNewTab
276
+ ? 'opacity-100 ease-in duration-200'
277
+ : 'opacity-0 ease-out duration-100',
278
+ 'absolute inset-0 flex h-full w-full items-center justify-center transition-opacity',
279
+ ]"
280
+ aria-hidden="true"
281
+ >
282
+ <svg
283
+ class="h-3 w-3 text-myPrimaryLinkColor"
284
+ fill="currentColor"
285
+ viewBox="0 0 12 12"
286
+ >
287
+ <path
288
+ d="M3.707 5.293a1 1 0 00-1.414 1.414l1.414-1.414zM5 8l-.707.707a1 1 0 001.414 0L5 8zm4.707-3.293a1 1 0 00-1.414-1.414l1.414 1.414zm-7.414 2l2 2 1.414-1.414-2-2-1.414 1.414zm3.414 2l4-4-1.414-1.414-4 4 1.414 1.414z"
289
+ />
290
+ </svg>
291
+ </span>
292
+ </span>
293
+ </Switch>
294
+ <!-- Toggle end -->
295
+ </div>
296
+ </div>
297
+ </div>
298
+ </div>
299
+ </template>
300
+ </EditorAccordion>
301
+ </template>
@@ -0,0 +1,109 @@
1
+ <script setup>
2
+ import { computed, onMounted, watch } from 'vue'
3
+ import PageBuilder from '@/composables/PageBuilder.ts'
4
+ import { ref } from 'vue'
5
+ import tailwindOpacities from '@/utils/builder/tailwind-opacities'
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'
15
+
16
+ const mediaLibraryStore = useMediaLibraryStore()
17
+ const pageBuilderStateStore = usePageBuilderStateStore()
18
+ const pageBuilder = new PageBuilder(pageBuilderStateStore, mediaLibraryStore)
19
+ const opacityVueModel = ref(null)
20
+ const getBackgroundOpacity = computed(() => {
21
+ return pageBuilderStateStore.getBackgroundOpacity
22
+ })
23
+
24
+ watch(
25
+ getBackgroundOpacity,
26
+ (newValue) => {
27
+ opacityVueModel.value = newValue
28
+ pageBuilder.handlePageBuilderMethods()
29
+ },
30
+ { immediate: true },
31
+ )
32
+ </script>
33
+
34
+ <template>
35
+ <div class="my-3 py-3">
36
+ <label class="myPrimaryInputLabel"> Background opacity</label>
37
+
38
+ <Listbox as="div" v-model="opacityVueModel">
39
+ <div class="relative">
40
+ <ListboxButton class="myPrimarySelect">
41
+ <span class="flex items-center gap-2">
42
+ <div v-if="opacityVueModel === 'none'">
43
+ <div class="myPrimaryColorPreview border-none">
44
+ <span class="material-symbols-outlined"> ev_shadow </span>
45
+ </div>
46
+ </div>
47
+
48
+ <div
49
+ v-if="opacityVueModel !== 'none'"
50
+ class="aspect-square w-6 h-6 bg-gray-950"
51
+ :class="`${opacityVueModel}`"
52
+ ></div>
53
+
54
+ <span class="block truncate" :class="[opacityVueModel !== 'none' ? '' : '']">{{
55
+ opacityVueModel === 'none' ? 'Transparent' : opacityVueModel
56
+ }}</span>
57
+ </span>
58
+ <span class="pointer-events-none absolute inset-y-0 right-0 ml-3 flex items-center pr-2">
59
+ <span class="material-symbols-outlined"> keyboard_arrow_down </span>
60
+ </span>
61
+ </ListboxButton>
62
+
63
+ <transition
64
+ leave-active-class="transition ease-in duration-100"
65
+ leave-from-class="opacity-100"
66
+ leave-to-class="opacity-0"
67
+ >
68
+ <ListboxOptions
69
+ class="absolute z-10 mt-1 max-h-56 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm"
70
+ >
71
+ <ListboxOption
72
+ as="template"
73
+ v-for="backgroundOpacity in tailwindOpacities.backgroundOpacities"
74
+ @click="pageBuilder.handleBackgroundOpacity(backgroundOpacity)"
75
+ :key="backgroundOpacity"
76
+ :value="backgroundOpacity"
77
+ v-slot="{ active }"
78
+ >
79
+ <li
80
+ :class="[
81
+ active ? 'bg-myPrimaryLinkColor text-white' : 'text-myPrimaryDarkGrayColor',
82
+ 'relative cursor-default select-none py-2 pl-3 pr-9',
83
+ ]"
84
+ >
85
+ <div class="flex items-center">
86
+ <div v-if="backgroundOpacity === 'none'" class="aspect-square w-6 h-6">
87
+ <div class="myPrimaryColorPreview border-none">
88
+ <span class="material-symbols-outlined"> ev_shadow </span>
89
+ </div>
90
+ </div>
91
+
92
+ <div
93
+ v-if="backgroundOpacity !== 'none'"
94
+ class="aspect-square w-6 h-6 bg-gray-950"
95
+ :class="`${backgroundOpacity}`"
96
+ ></div>
97
+ <span v-if="backgroundOpacity !== 'none'" class="ml-3">{{
98
+ backgroundOpacity
99
+ }}</span>
100
+ <span v-if="backgroundOpacity === 'none'" class="ml-3">Transparent</span>
101
+ </div>
102
+ </li>
103
+ </ListboxOption>
104
+ </ListboxOptions>
105
+ </transition>
106
+ </div>
107
+ </Listbox>
108
+ </div>
109
+ </template>
@@ -0,0 +1,107 @@
1
+ <script setup>
2
+ import { computed, onMounted, watch } from 'vue'
3
+ import PageBuilder from '@/composables/PageBuilder.ts'
4
+ import { ref } from 'vue'
5
+ import tailwindOpacities from '@/utils/builder/tailwind-opacities'
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'
15
+
16
+ const mediaLibraryStore = useMediaLibraryStore()
17
+ const pageBuilderStateStore = usePageBuilderStateStore()
18
+ const pageBuilder = new PageBuilder(pageBuilderStateStore, mediaLibraryStore)
19
+ const opacityVueModel = ref(null)
20
+ const getOpacity = computed(() => {
21
+ return pageBuilderStateStore.getOpacity
22
+ })
23
+
24
+ watch(
25
+ getOpacity,
26
+ (newValue) => {
27
+ opacityVueModel.value = newValue
28
+ pageBuilder.handlePageBuilderMethods()
29
+ },
30
+ { immediate: true },
31
+ )
32
+ </script>
33
+
34
+ <template>
35
+ <div class="my-3 py-3">
36
+ <label class="myPrimaryInputLabel"> Opacity</label>
37
+
38
+ <Listbox as="div" v-model="opacityVueModel">
39
+ <div class="relative">
40
+ <ListboxButton class="myPrimarySelect">
41
+ <span class="flex items-center gap-2">
42
+ <div v-if="opacityVueModel === 'none'">
43
+ <div class="myPrimaryColorPreview border-none">
44
+ <span class="material-symbols-outlined"> ev_shadow </span>
45
+ </div>
46
+ </div>
47
+
48
+ <div
49
+ v-if="opacityVueModel !== 'none'"
50
+ class="aspect-square w-6 h-6 bg-gray-950"
51
+ :class="`${opacityVueModel}`"
52
+ ></div>
53
+
54
+ <span class="block truncate" :class="[opacityVueModel !== 'none' ? '' : '']">{{
55
+ opacityVueModel === 'none' ? 'Transparent' : opacityVueModel
56
+ }}</span>
57
+ </span>
58
+ <span class="pointer-events-none absolute inset-y-0 right-0 ml-3 flex items-center pr-2">
59
+ <span class="material-symbols-outlined"> keyboard_arrow_down </span>
60
+ </span>
61
+ </ListboxButton>
62
+
63
+ <transition
64
+ leave-active-class="transition ease-in duration-100"
65
+ leave-from-class="opacity-100"
66
+ leave-to-class="opacity-0"
67
+ >
68
+ <ListboxOptions
69
+ class="absolute z-10 mt-1 max-h-56 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm"
70
+ >
71
+ <ListboxOption
72
+ as="template"
73
+ v-for="elementOpacity in tailwindOpacities.opacities"
74
+ @click="pageBuilder.handleOpacity(elementOpacity)"
75
+ :key="elementOpacity"
76
+ :value="elementOpacity"
77
+ v-slot="{ active }"
78
+ >
79
+ <li
80
+ :class="[
81
+ active ? 'bg-myPrimaryLinkColor text-white' : 'text-myPrimaryDarkGrayColor',
82
+ 'relative cursor-default select-none py-2 pl-3 pr-9',
83
+ ]"
84
+ >
85
+ <div class="flex items-center">
86
+ <div v-if="elementOpacity === 'none'">
87
+ <div class="myPrimaryColorPreview border-none">
88
+ <span class="material-symbols-outlined"> ev_shadow </span>
89
+ </div>
90
+ </div>
91
+
92
+ <div
93
+ v-if="elementOpacity !== 'none'"
94
+ class="aspect-square w-6 h-6 bg-gray-950"
95
+ :class="`${elementOpacity}`"
96
+ ></div>
97
+ <span v-if="elementOpacity === 'none'" class="ml-3">Transparent</span>
98
+ <span v-if="elementOpacity !== 'none'" class="ml-3">{{ elementOpacity }}</span>
99
+ </div>
100
+ </li>
101
+ </ListboxOption>
102
+ </ListboxOptions>
103
+ </transition>
104
+ </div>
105
+ </Listbox>
106
+ </div>
107
+ </template>
@@ -0,0 +1,16 @@
1
+ <script setup>
2
+ import EditorAccordion from '@/Components/PageBuilder/EditorMenu/EditorAccordion.vue';
3
+ import ManageBackgroundOpacity from '@/Components/PageBuilder/EditorMenu/Editables/ManageBackgroundOpacity.vue';
4
+ import ManageOpacity from '@/Components/PageBuilder/EditorMenu/Editables/ManageOpacity.vue';
5
+ </script>
6
+
7
+ <template>
8
+ <EditorAccordion>
9
+ <template #title>Opacity settings</template>
10
+ <template #content>
11
+ <!-- Text color - end -->
12
+ <ManageOpacity></ManageOpacity>
13
+ <ManageBackgroundOpacity></ManageBackgroundOpacity>
14
+ </template>
15
+ </EditorAccordion>
16
+ </template>
@@ -0,0 +1,134 @@
1
+ <script setup>
2
+ import tailwindPaddingPlusMargin from '@/utils/builder/tailwind-padding-margin'
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
+
9
+ const mediaLibraryStore = useMediaLibraryStore()
10
+ const pageBuilderStateStore = usePageBuilderStateStore()
11
+ const pageBuilder = new PageBuilder(pageBuilderStateStore, mediaLibraryStore)
12
+ const fontVerticalPadding = ref(null)
13
+ const fontHorizontalPadding = ref(null)
14
+ const fontVerticalMargin = ref(null)
15
+ const fontHorizontalMargin = ref(null)
16
+ const getFontVerticalPadding = computed(() => {
17
+ return pageBuilderStateStore.getFontVerticalPadding
18
+ })
19
+ const getFontHorizontalPadding = computed(() => {
20
+ return pageBuilderStateStore.getFontHorizontalPadding
21
+ })
22
+ const getFontVerticalMargin = computed(() => {
23
+ return pageBuilderStateStore.getFontVerticalMargin
24
+ })
25
+ const getFontHorizontalMargin = computed(() => {
26
+ return pageBuilderStateStore.getFontHorizontalMargin
27
+ })
28
+
29
+ watch(
30
+ getFontVerticalPadding,
31
+ (newValue) => {
32
+ fontVerticalPadding.value = newValue
33
+ pageBuilder.handlePageBuilderMethods()
34
+ },
35
+ { immediate: true },
36
+ )
37
+ watch(
38
+ getFontHorizontalPadding,
39
+ (newValue) => {
40
+ fontHorizontalPadding.value = newValue
41
+ pageBuilder.handlePageBuilderMethods()
42
+ },
43
+ { immediate: true },
44
+ )
45
+ watch(
46
+ getFontVerticalMargin,
47
+ (newValue) => {
48
+ fontVerticalMargin.value = newValue
49
+ pageBuilder.handlePageBuilderMethods()
50
+ },
51
+ { immediate: true },
52
+ )
53
+ watch(
54
+ getFontHorizontalMargin,
55
+ (newValue) => {
56
+ fontHorizontalMargin.value = newValue
57
+ pageBuilder.handlePageBuilderMethods()
58
+ },
59
+ { immediate: true },
60
+ )
61
+ </script>
62
+ <template>
63
+ <EditorAccordion>
64
+ <template #title>Padding & Margin</template>
65
+ <template #content>
66
+ <p class="myPrimaryParagraph font-medium py-0 my-4">Padding</p>
67
+ <div class="my-3 py-3">
68
+ <label class="myPrimaryInputLabel"> Padding Y-axis </label>
69
+ <select
70
+ v-model="fontVerticalPadding"
71
+ class="myPrimarySelect"
72
+ @change="pageBuilder.handleVerticalPadding(fontVerticalPadding)"
73
+ >
74
+ <option disabled value="">Select</option>
75
+ <option
76
+ v-for="verticalPadding in tailwindPaddingPlusMargin.verticalPadding"
77
+ :key="verticalPadding"
78
+ >
79
+ {{ verticalPadding }}
80
+ </option>
81
+ </select>
82
+ </div>
83
+ <div class="my-3 py-3">
84
+ <label class="myPrimaryInputLabel"> Padding X-axis </label>
85
+ <select
86
+ v-model="fontHorizontalPadding"
87
+ class="myPrimarySelect"
88
+ @change="pageBuilder.handleHorizontalPadding(fontHorizontalPadding)"
89
+ >
90
+ <option disabled value="">Select</option>
91
+ <option
92
+ v-for="horizontalPadding in tailwindPaddingPlusMargin.horizontalPadding"
93
+ :key="horizontalPadding"
94
+ >
95
+ {{ horizontalPadding }}
96
+ </option>
97
+ </select>
98
+ </div>
99
+ <p class="myPrimaryParagraph font-medium py-0 my-4">Margin</p>
100
+ <div class="my-3 py-3">
101
+ <label class="myPrimaryInputLabel"> Margin Y-axis </label>
102
+ <select
103
+ v-model="fontVerticalMargin"
104
+ class="myPrimarySelect"
105
+ @change="pageBuilder.handleVerticalMargin(fontVerticalMargin)"
106
+ >
107
+ <option disabled value="">Select</option>
108
+ <option
109
+ v-for="verticalMargin in tailwindPaddingPlusMargin.verticalMargin"
110
+ :key="verticalMargin"
111
+ >
112
+ {{ verticalMargin }}
113
+ </option>
114
+ </select>
115
+ </div>
116
+ <div class="my-3 py-3">
117
+ <label class="myPrimaryInputLabel"> Margin X-axis </label>
118
+ <select
119
+ v-model="fontHorizontalMargin"
120
+ class="myPrimarySelect"
121
+ @change="pageBuilder.handleHorizontalMargin(fontHorizontalMargin)"
122
+ >
123
+ <option disabled value="">Select</option>
124
+ <option
125
+ v-for="horizontalMargin in tailwindPaddingPlusMargin.horizontalMargin"
126
+ :key="horizontalMargin"
127
+ >
128
+ {{ horizontalMargin }}
129
+ </option>
130
+ </select>
131
+ </div>
132
+ </template>
133
+ </EditorAccordion>
134
+ </template>