@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,418 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, onMounted, ref, watch } from 'vue';
|
|
3
|
+
import {
|
|
4
|
+
Dialog,
|
|
5
|
+
DialogOverlay,
|
|
6
|
+
DialogTitle,
|
|
7
|
+
TransitionChild,
|
|
8
|
+
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
|
+
]);
|
|
42
|
+
|
|
43
|
+
const props = defineProps({
|
|
44
|
+
title: {
|
|
45
|
+
type: String,
|
|
46
|
+
required: true,
|
|
47
|
+
},
|
|
48
|
+
description: {
|
|
49
|
+
required: true,
|
|
50
|
+
},
|
|
51
|
+
firstButtonText: {
|
|
52
|
+
type: String,
|
|
53
|
+
},
|
|
54
|
+
secondButtonText: {
|
|
55
|
+
type: String,
|
|
56
|
+
},
|
|
57
|
+
thirdButtonText: {
|
|
58
|
+
type: String,
|
|
59
|
+
},
|
|
60
|
+
open: {
|
|
61
|
+
required: true,
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
const emit = defineEmits([
|
|
66
|
+
'firstMediaButtonFunction',
|
|
67
|
+
'secondMediaButtonFunction',
|
|
68
|
+
'thirdMediaButtonFunction',
|
|
69
|
+
]);
|
|
70
|
+
|
|
71
|
+
// first button function
|
|
72
|
+
const firstButton = function () {
|
|
73
|
+
emit('firstMediaButtonFunction');
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
// second button function
|
|
77
|
+
const secondButton = function () {
|
|
78
|
+
emit('secondMediaButtonFunction');
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
// third button function
|
|
82
|
+
const thirdButton = function () {
|
|
83
|
+
emit('thirdMediaButtonFunction');
|
|
84
|
+
};
|
|
85
|
+
//
|
|
86
|
+
//
|
|
87
|
+
const changeSelectedMenuTab = function (clicked) {
|
|
88
|
+
selected.value = clicked;
|
|
89
|
+
};
|
|
90
|
+
</script>
|
|
91
|
+
|
|
92
|
+
<template>
|
|
93
|
+
<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
|
+
>
|
|
103
|
+
<div class="flex items-end justify-center text-center sm:block sm:p-0">
|
|
104
|
+
<TransitionChild
|
|
105
|
+
as="template"
|
|
106
|
+
enter="ease-out duration-100"
|
|
107
|
+
enter-from="opacity-0"
|
|
108
|
+
enter-to="opacity-100"
|
|
109
|
+
leave="ease-in duration-100"
|
|
110
|
+
leave-from="opacity-100"
|
|
111
|
+
leave-to="opacity-0"
|
|
112
|
+
>
|
|
113
|
+
<DialogOverlay
|
|
114
|
+
class="fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"
|
|
115
|
+
/>
|
|
116
|
+
</TransitionChild>
|
|
117
|
+
|
|
118
|
+
<!-- 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"
|
|
122
|
+
>​</span
|
|
123
|
+
>
|
|
124
|
+
<TransitionChild
|
|
125
|
+
as="template"
|
|
126
|
+
enter="ease-out duration-100"
|
|
127
|
+
enter-from="opacity-0 scale-95"
|
|
128
|
+
enter-to="opacity-100 scale-100"
|
|
129
|
+
leave="ease-in duration-100"
|
|
130
|
+
leave-from="opacity-100 scale-100"
|
|
131
|
+
leave-to="opacity-0 scale-95"
|
|
132
|
+
>
|
|
133
|
+
<div
|
|
134
|
+
class="relative max-h-[65rem] my-2 inline-block align-bottom bg-white rounded-2xl text-left overflow-hidden shadow-xl transform transition-all sm:align-middle sm:max-w-7xl sm:w-full w-[96%]"
|
|
135
|
+
>
|
|
136
|
+
<div
|
|
137
|
+
class="flex gap-2 justify-between items-center border-b border-gray-200 p-4 mb-2"
|
|
138
|
+
>
|
|
139
|
+
<DialogTitle
|
|
140
|
+
as="h3"
|
|
141
|
+
class="tertiaryHeader my-0 py-0"
|
|
142
|
+
>
|
|
143
|
+
{{ title }}
|
|
144
|
+
</DialogTitle>
|
|
145
|
+
|
|
146
|
+
<div class="flex-end">
|
|
147
|
+
<div class="flex-end">
|
|
148
|
+
<div
|
|
149
|
+
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 hover:fill-white focus-visible:ring-0 text-myPrimaryDarkGrayColor"
|
|
150
|
+
@click="firstButton"
|
|
151
|
+
>
|
|
152
|
+
<span class="material-symbols-outlined"> close </span>
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
155
|
+
</div>
|
|
156
|
+
</div>
|
|
157
|
+
|
|
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 -->
|
|
410
|
+
</div>
|
|
411
|
+
</div>
|
|
412
|
+
</div>
|
|
413
|
+
</TransitionChild>
|
|
414
|
+
</div>
|
|
415
|
+
</Dialog>
|
|
416
|
+
</TransitionRoot>
|
|
417
|
+
</teleport>
|
|
418
|
+
</template>
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, onMounted, onUnmounted, watch } from "vue";
|
|
3
|
+
import {
|
|
4
|
+
Dialog,
|
|
5
|
+
DialogOverlay,
|
|
6
|
+
DialogTitle,
|
|
7
|
+
TransitionChild,
|
|
8
|
+
TransitionRoot,
|
|
9
|
+
} from "@headlessui/vue";
|
|
10
|
+
|
|
11
|
+
const props = defineProps({
|
|
12
|
+
show: {
|
|
13
|
+
type: Boolean,
|
|
14
|
+
default: false,
|
|
15
|
+
},
|
|
16
|
+
maxWidth: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: "2xl",
|
|
19
|
+
},
|
|
20
|
+
minHeight: {
|
|
21
|
+
type: String,
|
|
22
|
+
},
|
|
23
|
+
maxHeight: {
|
|
24
|
+
type: String,
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
const emit = defineEmits(["close"]);
|
|
29
|
+
|
|
30
|
+
const close = () => {
|
|
31
|
+
emit("close");
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const maxWidthClass = computed(() => {
|
|
35
|
+
return {
|
|
36
|
+
sm: "sm:max-w-sm",
|
|
37
|
+
md: "sm:max-w-md",
|
|
38
|
+
lg: "sm:max-w-lg",
|
|
39
|
+
xl: "sm:max-w-xl",
|
|
40
|
+
"2xl": "sm:max-w-2xl",
|
|
41
|
+
"3xl": "sm:max-w-3xl",
|
|
42
|
+
"4xl": "sm:max-w-4xl",
|
|
43
|
+
"5xl": "sm:max-w-5xl",
|
|
44
|
+
}[props.maxWidth];
|
|
45
|
+
});
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<template>
|
|
49
|
+
<teleport to="body">
|
|
50
|
+
<TransitionRoot :show="show" as="template">
|
|
51
|
+
<Dialog
|
|
52
|
+
as="div"
|
|
53
|
+
class="fixed z-30 inset-0 overflow-y-auto"
|
|
54
|
+
@close="close"
|
|
55
|
+
>
|
|
56
|
+
<div
|
|
57
|
+
class="flex items-end justify-center text-center sm:block sm:p-0"
|
|
58
|
+
>
|
|
59
|
+
<TransitionChild
|
|
60
|
+
as="template"
|
|
61
|
+
enter="ease-out duration-100"
|
|
62
|
+
enter-from="opacity-0"
|
|
63
|
+
enter-to="opacity-100"
|
|
64
|
+
leave="ease-in duration-100"
|
|
65
|
+
leave-from="opacity-100"
|
|
66
|
+
leave-to="opacity-0"
|
|
67
|
+
>
|
|
68
|
+
<DialogOverlay
|
|
69
|
+
class="fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"
|
|
70
|
+
/>
|
|
71
|
+
</TransitionChild>
|
|
72
|
+
<!-- This element is to trick the browser into centering the modal contents. -->
|
|
73
|
+
<span
|
|
74
|
+
aria-hidden="true"
|
|
75
|
+
class="hidden sm:inline-block sm:align-middle sm:h-screen"
|
|
76
|
+
>​</span
|
|
77
|
+
>
|
|
78
|
+
<TransitionChild
|
|
79
|
+
as="template"
|
|
80
|
+
enter="ease-out duration-100"
|
|
81
|
+
enter-from="opacity-0 scale-95"
|
|
82
|
+
enter-to="opacity-100 scale-100"
|
|
83
|
+
leave="ease-in duration-100"
|
|
84
|
+
leave-from="opacity-100 scale-100"
|
|
85
|
+
leave-to="opacity-0 scale-95"
|
|
86
|
+
>
|
|
87
|
+
<div
|
|
88
|
+
class="relative inline-block align-bottom bg-white rounded-xl text-left overflow-hidden shadow-xl transform transition-all sm:align-top top-4 sm:w-full w-[96%]"
|
|
89
|
+
:class="[
|
|
90
|
+
maxWidthClass ? maxWidthClass : '',
|
|
91
|
+
minHeight ? minHeight : '',
|
|
92
|
+
maxHeight ? maxHeight : '',
|
|
93
|
+
]"
|
|
94
|
+
>
|
|
95
|
+
<slot></slot>
|
|
96
|
+
</div>
|
|
97
|
+
</TransitionChild>
|
|
98
|
+
</div>
|
|
99
|
+
</Dialog>
|
|
100
|
+
</TransitionRoot>
|
|
101
|
+
</teleport>
|
|
102
|
+
</template>
|