@myissue/vue-website-page-builder 3.0.18 → 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.
Files changed (54) hide show
  1. package/README.md +79 -76
  2. package/dist/page-builder/2-images-text.png +0 -0
  3. package/dist/page-builder/3-images-text.png +0 -0
  4. package/dist/page-builder/3-vertical-images.png +0 -0
  5. package/dist/page-builder/4-images-text.png +0 -0
  6. package/dist/vue-website-page-builder.css +1 -1
  7. package/dist/vue-website-page-builder.js +7168 -7261
  8. package/dist/vue-website-page-builder.umd.cjs +146 -81
  9. package/package.json +4 -3
  10. package/src/App.vue +4 -115
  11. package/src/Components/Homepage/HomeSection.vue +70 -162
  12. package/src/Components/MediaLibrary/SidebarUnsplash.vue +9 -16
  13. package/src/Components/MediaLibrary/Unsplash.vue +51 -91
  14. package/src/Components/Modals/MediaLibraryModal.vue +56 -318
  15. package/src/Components/Modals/PageBuilderPreviewModal.vue +22 -40
  16. package/src/Components/PageBuilder/AdvancedPageBuilderSettings.vue +7 -0
  17. package/src/Components/PageBuilder/DropdownsPlusToggles/OptionsDropdown.vue +165 -110
  18. package/src/Components/PageBuilder/EditorMenu/Editables/BackgroundColorEditor.vue +9 -16
  19. package/src/Components/PageBuilder/EditorMenu/Editables/BorderRadius.vue +18 -18
  20. package/src/Components/PageBuilder/EditorMenu/Editables/Borders.vue +16 -21
  21. package/src/Components/PageBuilder/EditorMenu/Editables/ClassEditor.vue +12 -12
  22. package/src/Components/PageBuilder/EditorMenu/Editables/ComponentTopMenu.vue +10 -9
  23. package/src/Components/PageBuilder/EditorMenu/Editables/DeleteElement.vue +9 -9
  24. package/src/Components/PageBuilder/EditorMenu/Editables/EditGetElement.vue +144 -136
  25. package/src/Components/PageBuilder/EditorMenu/Editables/ElementEditor.vue +9 -10
  26. package/src/Components/PageBuilder/EditorMenu/Editables/ImageEditor.vue +31 -27
  27. package/src/Components/PageBuilder/EditorMenu/Editables/LinkEditor.vue +20 -14
  28. package/src/Components/PageBuilder/EditorMenu/Editables/ManageBackgroundOpacity.vue +9 -10
  29. package/src/Components/PageBuilder/EditorMenu/Editables/ManageOpacity.vue +9 -10
  30. package/src/Components/PageBuilder/EditorMenu/Editables/PaddingPlusMargin.vue +16 -16
  31. package/src/Components/PageBuilder/EditorMenu/Editables/TextColorEditor.vue +9 -16
  32. package/src/Components/PageBuilder/EditorMenu/Editables/Typography.vue +22 -20
  33. package/src/Components/PageBuilder/EditorMenu/RightSidebarEditor.vue +25 -27
  34. package/src/Components/PageBuilder/NoneCustomMediaLibraryComponent.vue +3 -0
  35. package/src/Components/PageBuilder/NoneCustomSearchComponent.vue +91 -0
  36. package/src/Components/PageBuilder/PageBuilderSettings.vue +8 -0
  37. package/src/Components/PageBuilder/Settings/AdvancedPageBuilderSettings.vue +31 -72
  38. package/src/Components/PageBuilder/Settings/PageBuilderSettings.vue +32 -36
  39. package/src/Components/Search/SearchComponents.vue +11 -199
  40. package/src/Components/TipTap/TipTap.vue +8 -7
  41. package/src/Components/TipTap/TipTapInput.vue +136 -134
  42. package/src/PageBuilder/PageBuilder.vue +220 -32
  43. package/src/composables/{PageBuilder.ts → PageBuilderClass.ts} +223 -142
  44. package/src/composables/usePageBuilderModal.ts +25 -0
  45. package/src/index.ts +8 -2
  46. package/src/stores/media-library.ts +1 -5
  47. package/src/stores/page-builder-state.ts +52 -36
  48. package/src/stores/user.ts +8 -6
  49. package/src/types/global.d.ts +6 -44
  50. package/src/types/index.ts +169 -0
  51. package/src/utils/html-elements/component.ts +88 -0
  52. package/src/utils/html-elements/componentHelpers.ts +101 -0
  53. package/src/Components/Modals/PageBuilderModal.vue +0 -233
  54. package/src/utils/builder/html-elements/componentHelpers.ts +0 -101
@@ -1,48 +1,46 @@
1
1
  <script setup>
2
- import { ref, computed, onMounted } from 'vue';
3
- import { useUnsplashStore } from '@/stores/unsplash';
4
- import { useMediaLibraryStore } from '@/stores/media-library';
5
- const mediaLibraryStore = useMediaLibraryStore();
6
- const unsplashStore = useUnsplashStore();
7
- const searchQuery = ref('');
8
- const currentPage = ref(1);
9
- const orientation = ref(null);
2
+ import { ref, computed, onMounted, inject } from 'vue'
3
+ import { useUnsplashStore } from '@/stores/unsplash'
4
+
5
+ // Get stores from parent PageBuilder component
6
+ const mediaLibraryStore = inject('mediaLibraryStore')
7
+ const unsplashStore = useUnsplashStore()
8
+ const searchQuery = ref('')
9
+ const currentPage = ref(1)
10
+ const orientation = ref(null)
10
11
 
11
12
  const getSearchTerm = computed(() => {
12
- return unsplashStore.getSearchTerm;
13
- });
13
+ return unsplashStore.getSearchTerm
14
+ })
14
15
  // unspalsh images
15
16
  const getUnsplashImages = computed(() => {
16
- return unsplashStore.getUnsplashImages;
17
- });
17
+ return unsplashStore.getUnsplashImages
18
+ })
18
19
 
19
20
  const handleImageClick = function (file) {
20
- mediaLibraryStore.setCurrentImage({ file });
21
- mediaLibraryStore.setCurrentPreviewImage(null);
22
- };
21
+ mediaLibraryStore.setCurrentImage({ src: file })
22
+ mediaLibraryStore.setCurrentPreviewImage(null)
23
+ }
23
24
 
24
25
  // search by orientation
25
26
  const searchByOrientation = function (orientationParameter) {
26
27
  // check if search term length is more than 0
27
- if (
28
- getSearchTerm.value.length > 0 &&
29
- orientation.value !== orientationParameter
30
- ) {
31
- orientation.value = orientationParameter;
32
- currentPage.value = 1;
33
- searchUnsplash();
28
+ if (getSearchTerm.value.length > 0 && orientation.value !== orientationParameter) {
29
+ orientation.value = orientationParameter
30
+ currentPage.value = 1
31
+ searchUnsplash()
34
32
  }
35
- };
33
+ }
36
34
  //
37
35
  // load images for previous page
38
36
  const previousPage = function () {
39
- searchUnsplash();
40
- };
37
+ searchUnsplash()
38
+ }
41
39
 
42
40
  // load images for next page
43
41
  const nextPage = function () {
44
- searchUnsplash();
45
- };
42
+ searchUnsplash()
43
+ }
46
44
  //
47
45
  //
48
46
  // search images
@@ -53,37 +51,34 @@ const searchUnsplash = function () {
53
51
  Array.isArray(getUnsplashImages.value.fetchedMedia.results) &&
54
52
  getUnsplashImages.value.fetchedMedia.results.length === 0
55
53
  ) {
56
- currentPage.value = 1;
54
+ currentPage.value = 1
57
55
  }
58
56
 
59
57
  // set values in store
60
58
 
61
- localStorage.setItem('unsplash-query', searchQuery.value);
59
+ localStorage.setItem('unsplash-query', searchQuery.value)
62
60
 
63
- unsplashStore.setSearchTerm(searchQuery.value);
64
- unsplashStore.setCurrentPageNumber(currentPage.value);
65
- unsplashStore.setOrientationValue(orientation.value);
61
+ unsplashStore.setSearchTerm(searchQuery.value)
62
+ unsplashStore.setCurrentPageNumber(currentPage.value)
63
+ unsplashStore.setOrientationValue(orientation.value)
66
64
  unsplashStore.setLoadUnsplashImages({
67
65
  searchTerm: getSearchTerm.value,
68
66
  currentPage: currentPage.value,
69
67
  orientation: orientation.value,
70
- });
71
- };
68
+ })
69
+ }
72
70
 
73
71
  // on mounted
74
72
  onMounted(() => {
75
- if (
76
- localStorage.getItem('unsplash-query') &&
77
- localStorage.getItem('unsplash-query').length > 0
78
- ) {
79
- unsplashStore.setSearchTerm(localStorage.getItem('unsplash-query'));
80
- searchQuery.value = localStorage.getItem('unsplash-query');
81
- searchUnsplash();
73
+ if (localStorage.getItem('unsplash-query') && localStorage.getItem('unsplash-query').length > 0) {
74
+ unsplashStore.setSearchTerm(localStorage.getItem('unsplash-query'))
75
+ searchQuery.value = localStorage.getItem('unsplash-query')
76
+ searchUnsplash()
82
77
  } else {
83
- searchQuery.value = 'Magazine';
84
- searchUnsplash();
78
+ searchQuery.value = 'Magazine'
79
+ searchUnsplash()
85
80
  }
86
- });
81
+ })
87
82
  </script>
88
83
 
89
84
  <template>
@@ -97,9 +92,7 @@ onMounted(() => {
97
92
 
98
93
  <div class="mysearchBarWithOptions">
99
94
  <div class="relative w-full">
100
- <div
101
- class="flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none"
102
- >
95
+ <div class="flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none">
103
96
  <span class="material-symbols-outlined"> search </span>
104
97
  </div>
105
98
  <input
@@ -112,12 +105,7 @@ onMounted(() => {
112
105
  />
113
106
  </div>
114
107
 
115
- <button
116
- type="submit"
117
- class="myPrimaryButton"
118
- >
119
- Search
120
- </button>
108
+ <button type="submit" class="myPrimaryButton">Search</button>
121
109
  </div>
122
110
  </form>
123
111
 
@@ -142,9 +130,7 @@ onMounted(() => {
142
130
  "
143
131
  class="mt-2"
144
132
  >
145
- <div
146
- class="flex lg:justify-between justify-end items-center gap-2 py-2 mb-1"
147
- >
133
+ <div class="flex lg:justify-between justify-end items-center gap-2 py-2 mb-1">
148
134
  <div class="lg:flex hidden justify-left items-center gap-2">
149
135
  <button
150
136
  @click="searchByOrientation('landscape')"
@@ -189,27 +175,18 @@ onMounted(() => {
189
175
  stroke="currentColor"
190
176
  class="w-4 h-4 cursor-pointer"
191
177
  >
192
- <path
193
- stroke-linecap="round"
194
- stroke-linejoin="round"
195
- d="M6 18L18 6M6 6l12 12"
196
- />
178
+ <path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />
197
179
  </svg>
198
180
  </div>
199
181
 
200
- <nav
201
- class="flex items-center gap-2 justify-start"
202
- aria-label="Pagination"
203
- >
182
+ <nav class="flex items-center gap-2 justify-start" aria-label="Pagination">
204
183
  <p class="myPrimaryParagraph text-xs italic">
205
184
  Total pages {{ getUnsplashImages.fetchedMedia.total_pages }}
206
185
  </p>
207
186
  <p class="myPrimaryParagraph text-xs italic">
208
187
  Images {{ getUnsplashImages.fetchedMedia.total }}
209
188
  </p>
210
- <div
211
- class="flex flex-1 justify-between sm:justify-end items-center gap-2"
212
- >
189
+ <div class="flex flex-1 justify-between sm:justify-end items-center gap-2">
213
190
  <span
214
191
  v-if="currentPage !== 1"
215
192
  class="myPrimaryParagraph text-xs italic pr-2 pl-1 cursor-pointer underline"
@@ -231,13 +208,10 @@ onMounted(() => {
231
208
  {{ currentPage }}
232
209
  </span>
233
210
  <button
234
- :disabled="
235
- currentPage >= getUnsplashImages.fetchedMedia.total_pages
236
- "
211
+ :disabled="currentPage >= getUnsplashImages.fetchedMedia.total_pages"
237
212
  class="myPrimaryButton"
238
213
  :class="{
239
- 'opacity-50':
240
- currentPage >= getUnsplashImages.fetchedMedia.total_pages,
214
+ 'opacity-50': currentPage >= getUnsplashImages.fetchedMedia.total_pages,
241
215
  }"
242
216
  @click="nextPage(currentPage++)"
243
217
  >
@@ -261,22 +235,14 @@ onMounted(() => {
261
235
  class="group aspect-w-10 aspect-h-7 block w-full overflow-hidden rounded-lg bg-gray-100 focus-within:ring-2 focus-within:ring-myPrimaryBrandColor focus-within:ring-offset-2 focus-within:ring-offset-gray-100 cursor-pointer"
262
236
  :src="image.urls.thumb"
263
237
  />
264
- <p class="myPrimaryParagraph text-xs font-normal mt-2">
265
- By: {{ image.user.name }}
266
- </p>
238
+ <p class="myPrimaryParagraph text-xs font-normal mt-2">By: {{ image.user.name }}</p>
267
239
  </div>
268
240
  </div>
269
241
 
270
242
  <div v-if="getUnsplashImages.fetchedMedia.results.length < 1">
271
243
  <p class="myPrimaryParagraph py-4 px-4">
272
- <span v-if="currentPage === 1">
273
- We did not find any images. Make a new search.
274
- </span>
275
- <span
276
- v-if="currentPage > 1"
277
- @click="nextPage(1)"
278
- class="myPrimaryLink"
279
- >
244
+ <span v-if="currentPage === 1"> We did not find any images. Make a new search. </span>
245
+ <span v-if="currentPage > 1" @click="nextPage(1)" class="myPrimaryLink">
280
246
  No results on current page. Navigate to First Page.
281
247
  </span>
282
248
  </p>
@@ -284,13 +250,7 @@ onMounted(() => {
284
250
  </div>
285
251
  </div>
286
252
 
287
- <div
288
- v-if="
289
- getUnsplashImages &&
290
- getUnsplashImages.isLoading &&
291
- !getUnsplashImages.isError
292
- "
293
- >
253
+ <div v-if="getUnsplashImages && getUnsplashImages.isLoading && !getUnsplashImages.isError">
294
254
  <div class="flex items-center justify-center mt-4">
295
255
  <div
296
256
  class="inline-block h-8 w-8 animate-spin rounded-full border-4 border-solid border-current border-r-transparent align-[-0.125em] motion-reduce:animate-[spin_1.5s_linear_infinite]"
@@ -1,44 +1,13 @@
1
1
  <script setup>
2
- import { computed, onMounted, ref, watch } from 'vue';
3
2
  import {
4
3
  Dialog,
5
4
  DialogOverlay,
6
5
  DialogTitle,
7
6
  TransitionChild,
8
7
  TransitionRoot,
9
- } from '@headlessui/vue';
10
- import { Menu, MenuButton, MenuItem, MenuItems } from '@headlessui/vue';
11
-
12
- // new version
13
- import DynamicModal from '@/Components/Modals/DynamicModal.vue';
14
- import SidebarUnsplash from '@/Components/MediaLibrary/SidebarUnsplash.vue';
15
- import Unsplash from '@/Components/MediaLibrary/Unsplash.vue';
16
- import SmallUniversalSpinner from '@/Components/Loaders/SmallUniversalSpinner.vue';
17
-
18
- import { useMediaLibraryStore } from '@/stores/media-library';
19
-
20
- const mediaLibraryStore = useMediaLibraryStore();
21
-
22
- const getCurrentImage = computed(() => {
23
- return mediaLibraryStore.getCurrentImage;
24
- });
25
-
26
- const selected = ref('Unsplash');
27
-
28
- const tabs = ref([
29
- {
30
- name: 'Upload',
31
- current: false,
32
- },
33
- {
34
- name: 'Media library',
35
- current: false,
36
- },
37
- {
38
- name: 'Unsplash',
39
- current: true,
40
- },
41
- ]);
8
+ } from '@headlessui/vue'
9
+ import { provide } from 'vue'
10
+ import NoneCustomMediaLibraryComponent from '@/Components/PageBuilder/NoneCustomMediaLibraryComponent.vue'
42
11
 
43
12
  const props = defineProps({
44
13
  title: {
@@ -60,46 +29,44 @@ const props = defineProps({
60
29
  open: {
61
30
  required: true,
62
31
  },
63
- });
32
+ customMediaComponent: {
33
+ type: Object,
34
+ default: null,
35
+ },
36
+ })
64
37
 
65
38
  const emit = defineEmits([
66
39
  'firstMediaButtonFunction',
67
40
  'secondMediaButtonFunction',
68
41
  'thirdMediaButtonFunction',
69
- ]);
42
+ ])
70
43
 
71
44
  // first button function
72
45
  const firstButton = function () {
73
- emit('firstMediaButtonFunction');
74
- };
46
+ emit('firstMediaButtonFunction')
47
+ }
75
48
 
76
49
  // second button function
77
50
  const secondButton = function () {
78
- emit('secondMediaButtonFunction');
79
- };
51
+ emit('secondMediaButtonFunction')
52
+ }
80
53
 
81
54
  // third button function
82
55
  const thirdButton = function () {
83
- emit('thirdMediaButtonFunction');
84
- };
85
- //
86
- //
87
- const changeSelectedMenuTab = function (clicked) {
88
- selected.value = clicked;
89
- };
56
+ emit('thirdMediaButtonFunction')
57
+ }
58
+
59
+ // Provide close function for custom components
60
+ const closeMediaLibraryModal = () => {
61
+ firstButton() // This triggers the close by emitting to parent
62
+ }
63
+ provide('closeMediaLibraryModal', closeMediaLibraryModal)
90
64
  </script>
91
65
 
92
66
  <template>
93
67
  <teleport to="body">
94
- <TransitionRoot
95
- :show="open"
96
- as="template"
97
- >
98
- <Dialog
99
- as="div"
100
- class="fixed z-30 inset-0 overflow-y-auto sm:px-4"
101
- @close="firstButton"
102
- >
68
+ <TransitionRoot :show="open" as="template">
69
+ <Dialog as="div" class="fixed z-30 inset-0 overflow-y-auto sm:px-4" @close="firstButton">
103
70
  <div class="flex items-end justify-center text-center sm:block sm:p-0">
104
71
  <TransitionChild
105
72
  as="template"
@@ -110,15 +77,11 @@ const changeSelectedMenuTab = function (clicked) {
110
77
  leave-from="opacity-100"
111
78
  leave-to="opacity-0"
112
79
  >
113
- <DialogOverlay
114
- class="fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"
115
- />
80
+ <DialogOverlay class="fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity" />
116
81
  </TransitionChild>
117
82
 
118
83
  <!-- This element is to trick the browser into centering the modal contents. -->
119
- <span
120
- aria-hidden="true"
121
- class="hidden sm:inline-block sm:align-middle sm:h-screen"
84
+ <span aria-hidden="true" class="hidden sm:inline-block sm:align-middle sm:h-screen"
122
85
  >&#8203;</span
123
86
  >
124
87
  <TransitionChild
@@ -136,10 +99,7 @@ const changeSelectedMenuTab = function (clicked) {
136
99
  <div
137
100
  class="flex gap-2 justify-between items-center border-b border-gray-200 p-4 mb-2"
138
101
  >
139
- <DialogTitle
140
- as="h3"
141
- class="tertiaryHeader my-0 py-0"
142
- >
102
+ <DialogTitle as="h3" class="tertiaryHeader my-0 py-0">
143
103
  {{ title }}
144
104
  </DialogTitle>
145
105
 
@@ -155,260 +115,38 @@ const changeSelectedMenuTab = function (clicked) {
155
115
  </div>
156
116
  </div>
157
117
 
158
- <div class="flex items-center">
159
- <div class="flex-1">
160
- <!--content media library - start-->
161
- <div
162
- class="p-4 h-full flex md:flex-row flex-col myPrimaryGap mt-2 overflow-y-scroll"
163
- >
164
- <!-- Main content - start-->
165
-
166
- <div class="pb-4 max-w-7xl mx-auto w-full">
167
- <!-- Tabs -->
168
- <div class="mb-4">
169
- <!-- Tabs Mobile -->
170
- <div class="sm:hidden">
171
- <label
172
- for="tabs"
173
- class="sr-only"
174
- >Select a tab</label
175
- >
176
- <!-- Use an "onChange" listener to redirect the user to the selected tab URL. -->
177
-
178
- <select
179
- v-model="selected"
180
- id="tabs"
181
- class="block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-myPrimaryLinkColor focus:border-myPrimaryLinkColor sm:text-sm rounded-md"
182
- >
183
- <option>Upload</option>
184
- <option>Media library</option>
185
- <option>Unsplash</option>
186
- </select>
187
- </div>
188
- <div class="hidden sm:block">
189
- <div
190
- class="flex myPrimaryGap items-center overflow-x-auto bg-myPrimaryLightGrayColor px-2 pt-3 pb-2 rounded-full"
191
- >
192
- <nav
193
- class="flex-1 -mb-px flex space-x-2 xl:space-x-4"
194
- aria-label="Tabs"
195
- >
196
- <button
197
- @click="changeSelectedMenuTab(tab.name)"
198
- v-for="tab in tabs"
199
- :key="tab.name"
200
- :aria-current="tab.current ? 'page' : undefined"
201
- class="py-2 px-3 my-1 text-xs cursor-pointer font-medium"
202
- :class="[
203
- tab.name === selected
204
- ? 'myPrimaryButton'
205
- : 'mySecondaryButton',
206
- 'whitespace-nowrap',
207
- ]"
208
- >
209
- <span
210
- v-if="tab.name === 'Upload'"
211
- class="material-symbols-outlined"
212
- >
213
- cloud_upload
214
- </span>
215
- <span
216
- v-if="tab.name === 'Media library'"
217
- class="myMediumIcon material-symbols-outlined"
218
- >
219
- perm_media
220
- </span>
221
- <span
222
- v-if="tab.name === 'Unsplash'"
223
- class="myMediumIcon material-symbols-outlined"
224
- >
225
- filter_hdr
226
- </span>
227
- <span>
228
- {{ tab.name }}
229
- </span>
230
- </button>
231
- </nav>
232
- </div>
233
- </div>
234
- </div>
235
-
236
- <template v-if="selected === 'Upload'">
237
- <!-- image upload - start -->
238
- <div class="w-full">
239
- <div
240
- class="overflow-y-scroll pr-1 border border-gray-200 rounded-lg md:min-h-[25rem] md:max-h-[25em] min-h-[20rem] max-h-[20rem]"
241
- >
242
- <div class="myInputGroup p-4 mt-4">
243
- <div class="col-span-3 mb-4">
244
- <div
245
- class="relativeflex flex-col items-center justify-center"
246
- >
247
- <label
248
- class="myPrimaryInputLabel myPrimaryParagraph text-center w-full inset-0 block text-base cursor-pointer"
249
- for="images"
250
- >
251
- <header>
252
- <div
253
- class="p-2 rounded-full border-2 border-dashed border-myPrimaryLinkColor hover:border-2 hover:border-opacity-50 hover:border-dashed hover:border-myPrimaryLinkColor"
254
- >
255
- <div
256
- class="myPrimaryParagraph rounded-full bg-myPrimaryLightGrayColor text-center w-full inset-0 text-base pt-6 pb-6 px-2 flex items-center justify-center p-2"
257
- >
258
- <div
259
- class="myPrimaryButton hover:shadow gap-3"
260
- >
261
- <span
262
- class="material-symbols-outlined"
263
- >
264
- cloud_upload </span
265
- ><span> PNG, JPG, up to 2MB </span>
266
- </div>
267
- </div>
268
- </div>
269
- </header></label
270
- ><input
271
- id="images"
272
- type="file"
273
- multiple=""
274
- class="sr-only"
275
- />
276
- </div>
277
- </div>
278
- <div
279
- class="min-h-[1.5rem] flex items-center justify-start"
280
- >
281
- <p
282
- class="myPrimaryInputError mt-2 mb-0 py-0 self-start"
283
- ></p>
284
- </div>
285
- </div>
286
- </div>
287
- </div>
288
- <!-- image upload - end -->
289
- </template>
290
- <template v-if="selected === 'Media library'">
291
- <!-- image gallary - start -->
292
- <div class="w-full">
293
- <div
294
- class="overflow-y-scroll pr-1 border border-gray-200 rounded-lg md:min-h-[25rem] md:max-h-[25em] min-h-[20rem] max-h-[20rem]"
295
- >
296
- <div class="myInputGroup p-4 mt-4">
297
- <div class="col-span-3 mb-4">
298
- <p class="myPrimaryParagraph my-0 py-0">
299
- Media Library
300
- </p>
301
- </div>
302
- </div>
303
- </div>
304
- </div>
305
- <!-- image gallary - end -->
306
- </template>
307
- <template v-if="selected === 'Unsplash'">
308
- <!-- image gallary - start -->
309
- <div
310
- class="w-full border border-gray-200 rounded-lg py-4 px-2"
311
- >
312
- <Unsplash></Unsplash>
313
- </div>
314
- <!-- image gallary - end -->
315
- </template>
316
- </div>
317
-
318
- <!-- Main content - end-->
319
-
320
- <!-- Details sidebar - upload start-->
321
- <aside
322
- v-if="selected === 'Upload'"
323
- aria-label="sidebar"
324
- class="md:w-72"
325
- >
326
- <div
327
- class="pt-4 px-2 rounded-lg md:w-72 md:min-h-[42.5rem] md:max-h-[42.5rem] min-h-[15rem] max-h-[15rem] overflow-y-scroll bg-white border border-gray-200"
328
- >
329
- No image has been selected.
330
- </div>
331
- </aside>
332
- <!-- Details sidebar - media library start-->
333
- <aside
334
- v-if="selected === 'Media library'"
335
- aria-label="sidebar"
336
- class="md:w-72"
337
- >
338
- <div
339
- class="pt-4 px-2 rounded-lg md:w-72 md:min-h-[42.5rem] md:max-h-[42.5rem] min-h-[15rem] max-h-[15rem] overflow-y-scroll bg-white border border-gray-200"
340
- >
341
- No image has been selected.
342
- </div>
343
- </aside>
344
- <!-- Details sidebar - media library end-->
345
- <!-- Details sidebar - unsplash start-->
346
- <aside
347
- v-if="selected === 'Unsplash'"
348
- aria-label="sidebar"
349
- class="md:w-72"
350
- >
351
- <div
352
- class="pt-4 px-2 rounded-lg md:w-72 md:min-h-[42.5rem] md:max-h-[42.5rem] min-h-[15rem] max-h-[15rem] overflow-y-scroll bg-white border border-gray-200"
353
- >
354
- <SidebarUnsplash></SidebarUnsplash>
355
- </div>
356
- </aside>
357
- <!-- Details sidebar - unsplash end-->
358
-
359
- <!-- Details sidebar end-->
360
- </div>
361
- <!--content media library - end-->
362
-
363
- <!-- Actions # start -->
364
- <template v-if="selected === 'Unsplash'">
365
- <div
366
- v-if="getCurrentImage && getCurrentImage.file"
367
- class="bg-slate-50 px-2 py-4 flex sm:justify-end justify-center"
368
- >
369
- <div
370
- class="sm:grid-cols-3 sm:items-end justify-end flex sm:flex-row myPrimaryGap sm:w-5/6 w-full"
371
- >
372
- <div v-if="firstButtonText">
373
- <button
374
- ref="firstButtonRef"
375
- class="mySecondaryButton"
376
- type="button"
377
- @click="firstButton"
378
- >
379
- {{ firstButtonText }}
380
- </button>
381
- </div>
382
-
383
- <div v-if="secondButtonText">
384
- <button
385
- class="myPrimaryButton"
386
- type="button"
387
- @click="secondButton"
388
- >
389
- {{ secondButtonText }}
390
- </button>
391
- </div>
392
-
393
- <div
394
- v-if="thirdButtonText"
395
- class="w-full"
396
- >
397
- <button
398
- class="myPrimaryDeleteButton"
399
- type="button"
400
- @click="thirdButton"
401
- >
402
- {{ thirdButtonText }}
403
- </button>
404
- </div>
405
- </div>
406
- </div>
407
- <!-- Actions # end -->
408
- </template>
409
- <!-- Actions # end -->
118
+ <div class="p-4">
119
+ <!-- Show only custom media component if provided -->
120
+ <div v-if="customMediaComponent" class="w-full">
121
+ <component :is="customMediaComponent" />
122
+ </div>
123
+ <div v-else>
124
+ <NoneCustomMediaLibraryComponent />
410
125
  </div>
411
126
  </div>
127
+
128
+ <!-- Actions footer to ensure focusable elements -->
129
+ <div
130
+ v-if="firstButtonText || secondButtonText"
131
+ class="bg-slate-50 px-4 py-3 flex justify-end gap-2"
132
+ >
133
+ <button
134
+ v-if="firstButtonText"
135
+ @click="firstButton"
136
+ class="mySecondaryButton focus:ring-2 focus:ring-blue-500"
137
+ type="button"
138
+ >
139
+ {{ firstButtonText }}
140
+ </button>
141
+ <button
142
+ v-if="secondButtonText"
143
+ @click="secondButton"
144
+ class="myPrimaryButton focus:ring-2 focus:ring-blue-500"
145
+ type="button"
146
+ >
147
+ {{ secondButtonText }}
148
+ </button>
149
+ </div>
412
150
  </div>
413
151
  </TransitionChild>
414
152
  </div>