@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,40 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from 'vue';
|
|
3
|
+
import { useMediaLibraryStore } from '@/stores/media-library';
|
|
4
|
+
|
|
5
|
+
const mediaLibraryStore = useMediaLibraryStore();
|
|
6
|
+
|
|
7
|
+
const getCurrentImage = computed(() => {
|
|
8
|
+
return mediaLibraryStore.getCurrentImage;
|
|
9
|
+
});
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<!-- Loading # end -->
|
|
14
|
+
<div
|
|
15
|
+
v-if="getCurrentImage && getCurrentImage.file"
|
|
16
|
+
class="pb-6 space-y-6"
|
|
17
|
+
>
|
|
18
|
+
<img
|
|
19
|
+
class="mx-auto block w-full object-cover object-center cursor-pointer"
|
|
20
|
+
:src="`${getCurrentImage.file}`"
|
|
21
|
+
alt="file"
|
|
22
|
+
/>
|
|
23
|
+
|
|
24
|
+
<div class="md:px-3 px-2">
|
|
25
|
+
<div>
|
|
26
|
+
<h3 class="font-normal text-gray-900">Information</h3>
|
|
27
|
+
<dl
|
|
28
|
+
class="mt-2 border-t border-b border-gray-200 divide-y divide-gray-200"
|
|
29
|
+
>
|
|
30
|
+
<div
|
|
31
|
+
class="py-3 flex justify-between text-sm font-normal items-center"
|
|
32
|
+
>
|
|
33
|
+
<dt class="text-gray-500">From</dt>
|
|
34
|
+
<dd class="text-gray-900">Unsplash</dd>
|
|
35
|
+
</div>
|
|
36
|
+
</dl>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
</template>
|
|
@@ -0,0 +1,306 @@
|
|
|
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);
|
|
10
|
+
|
|
11
|
+
const getSearchTerm = computed(() => {
|
|
12
|
+
return unsplashStore.getSearchTerm;
|
|
13
|
+
});
|
|
14
|
+
// unspalsh images
|
|
15
|
+
const getUnsplashImages = computed(() => {
|
|
16
|
+
return unsplashStore.getUnsplashImages;
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const handleImageClick = function (file) {
|
|
20
|
+
mediaLibraryStore.setCurrentImage({ file });
|
|
21
|
+
mediaLibraryStore.setCurrentPreviewImage(null);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
// search by orientation
|
|
25
|
+
const searchByOrientation = function (orientationParameter) {
|
|
26
|
+
// 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();
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
//
|
|
37
|
+
// load images for previous page
|
|
38
|
+
const previousPage = function () {
|
|
39
|
+
searchUnsplash();
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
// load images for next page
|
|
43
|
+
const nextPage = function () {
|
|
44
|
+
searchUnsplash();
|
|
45
|
+
};
|
|
46
|
+
//
|
|
47
|
+
//
|
|
48
|
+
// search images
|
|
49
|
+
const searchUnsplash = function () {
|
|
50
|
+
if (
|
|
51
|
+
getUnsplashImages.value &&
|
|
52
|
+
getUnsplashImages.value.fetchedMedia &&
|
|
53
|
+
Array.isArray(getUnsplashImages.value.fetchedMedia.results) &&
|
|
54
|
+
getUnsplashImages.value.fetchedMedia.results.length === 0
|
|
55
|
+
) {
|
|
56
|
+
currentPage.value = 1;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// set values in store
|
|
60
|
+
|
|
61
|
+
localStorage.setItem('unsplash-query', searchQuery.value);
|
|
62
|
+
|
|
63
|
+
unsplashStore.setSearchTerm(searchQuery.value);
|
|
64
|
+
unsplashStore.setCurrentPageNumber(currentPage.value);
|
|
65
|
+
unsplashStore.setOrientationValue(orientation.value);
|
|
66
|
+
unsplashStore.setLoadUnsplashImages({
|
|
67
|
+
searchTerm: getSearchTerm.value,
|
|
68
|
+
currentPage: currentPage.value,
|
|
69
|
+
orientation: orientation.value,
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
// on mounted
|
|
74
|
+
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();
|
|
82
|
+
} else {
|
|
83
|
+
searchQuery.value = 'Magazine';
|
|
84
|
+
searchUnsplash();
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
</script>
|
|
88
|
+
|
|
89
|
+
<template>
|
|
90
|
+
<div>
|
|
91
|
+
<form @submit.prevent="searchUnsplash">
|
|
92
|
+
<label
|
|
93
|
+
for="default-search"
|
|
94
|
+
class="mb-2 text-sm font-normal text-gray-900 sr-only dark:text-gray-300"
|
|
95
|
+
>Search</label
|
|
96
|
+
>
|
|
97
|
+
|
|
98
|
+
<div class="mysearchBarWithOptions">
|
|
99
|
+
<div class="relative w-full">
|
|
100
|
+
<div
|
|
101
|
+
class="flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none"
|
|
102
|
+
>
|
|
103
|
+
<span class="material-symbols-outlined"> search </span>
|
|
104
|
+
</div>
|
|
105
|
+
<input
|
|
106
|
+
type="search"
|
|
107
|
+
id="search_query"
|
|
108
|
+
v-model="searchQuery"
|
|
109
|
+
class="myPrimarySearchInput"
|
|
110
|
+
autocomplete="off"
|
|
111
|
+
placeholder="Search..."
|
|
112
|
+
/>
|
|
113
|
+
</div>
|
|
114
|
+
|
|
115
|
+
<button
|
|
116
|
+
type="submit"
|
|
117
|
+
class="myPrimaryButton"
|
|
118
|
+
>
|
|
119
|
+
Search
|
|
120
|
+
</button>
|
|
121
|
+
</div>
|
|
122
|
+
</form>
|
|
123
|
+
|
|
124
|
+
<div
|
|
125
|
+
v-if="
|
|
126
|
+
getUnsplashImages &&
|
|
127
|
+
!getUnsplashImages.isLoading &&
|
|
128
|
+
getUnsplashImages.isError &&
|
|
129
|
+
!getUnsplashImages.isSuccess
|
|
130
|
+
"
|
|
131
|
+
>
|
|
132
|
+
<p class="myPrimaryParagraphError">{{ getUnsplashImages.error }}</p>
|
|
133
|
+
</div>
|
|
134
|
+
|
|
135
|
+
<div
|
|
136
|
+
v-if="
|
|
137
|
+
getUnsplashImages &&
|
|
138
|
+
getUnsplashImages.fetchedMedia &&
|
|
139
|
+
getUnsplashImages.fetchedMedia.results &&
|
|
140
|
+
!getUnsplashImages.isLoading &&
|
|
141
|
+
!getUnsplashImages.isError
|
|
142
|
+
"
|
|
143
|
+
class="mt-2"
|
|
144
|
+
>
|
|
145
|
+
<div
|
|
146
|
+
class="flex lg:justify-between justify-end items-center gap-2 py-2 mb-1"
|
|
147
|
+
>
|
|
148
|
+
<div class="lg:flex hidden justify-left items-center gap-2">
|
|
149
|
+
<button
|
|
150
|
+
@click="searchByOrientation('landscape')"
|
|
151
|
+
type="button"
|
|
152
|
+
class="myPrimaryTag"
|
|
153
|
+
:class="{
|
|
154
|
+
'bg-myPrimaryBrandColor text-white': orientation === 'landscape',
|
|
155
|
+
'': orientation !== 'landscape',
|
|
156
|
+
}"
|
|
157
|
+
>
|
|
158
|
+
Landscape
|
|
159
|
+
</button>
|
|
160
|
+
<button
|
|
161
|
+
@click="searchByOrientation('portrait')"
|
|
162
|
+
type="button"
|
|
163
|
+
class="myPrimaryTag"
|
|
164
|
+
:class="{
|
|
165
|
+
'bg-myPrimaryBrandColor text-white': orientation === 'portrait',
|
|
166
|
+
'': orientation !== 'portrait',
|
|
167
|
+
}"
|
|
168
|
+
>
|
|
169
|
+
Portrait
|
|
170
|
+
</button>
|
|
171
|
+
<button
|
|
172
|
+
@click="searchByOrientation('squarish')"
|
|
173
|
+
type="button"
|
|
174
|
+
class="myPrimaryTag"
|
|
175
|
+
:class="{
|
|
176
|
+
'bg-myPrimaryBrandColor text-white': orientation === 'squarish',
|
|
177
|
+
'': orientation !== 'squarish',
|
|
178
|
+
}"
|
|
179
|
+
>
|
|
180
|
+
Squarish
|
|
181
|
+
</button>
|
|
182
|
+
|
|
183
|
+
<svg
|
|
184
|
+
@click="searchByOrientation(null)"
|
|
185
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
186
|
+
fill="none"
|
|
187
|
+
viewBox="0 0 24 24"
|
|
188
|
+
stroke-width="2"
|
|
189
|
+
stroke="currentColor"
|
|
190
|
+
class="w-4 h-4 cursor-pointer"
|
|
191
|
+
>
|
|
192
|
+
<path
|
|
193
|
+
stroke-linecap="round"
|
|
194
|
+
stroke-linejoin="round"
|
|
195
|
+
d="M6 18L18 6M6 6l12 12"
|
|
196
|
+
/>
|
|
197
|
+
</svg>
|
|
198
|
+
</div>
|
|
199
|
+
|
|
200
|
+
<nav
|
|
201
|
+
class="flex items-center gap-2 justify-start"
|
|
202
|
+
aria-label="Pagination"
|
|
203
|
+
>
|
|
204
|
+
<p class="myPrimaryParagraph text-xs italic">
|
|
205
|
+
Total pages {{ getUnsplashImages.fetchedMedia.total_pages }}
|
|
206
|
+
</p>
|
|
207
|
+
<p class="myPrimaryParagraph text-xs italic">
|
|
208
|
+
Images {{ getUnsplashImages.fetchedMedia.total }}
|
|
209
|
+
</p>
|
|
210
|
+
<div
|
|
211
|
+
class="flex flex-1 justify-between sm:justify-end items-center gap-2"
|
|
212
|
+
>
|
|
213
|
+
<span
|
|
214
|
+
v-if="currentPage !== 1"
|
|
215
|
+
class="myPrimaryParagraph text-xs italic pr-2 pl-1 cursor-pointer underline"
|
|
216
|
+
@click="nextPage((currentPage = 1))"
|
|
217
|
+
>
|
|
218
|
+
First page
|
|
219
|
+
</span>
|
|
220
|
+
</div>
|
|
221
|
+
<button
|
|
222
|
+
v-if="currentPage > 1"
|
|
223
|
+
:disabled="currentPage < 1"
|
|
224
|
+
class="myPrimaryButton"
|
|
225
|
+
@click="previousPage(currentPage--)"
|
|
226
|
+
>
|
|
227
|
+
{{ `Prev ${currentPage > 0 ? currentPage - 1 : currentPage - 1}` }}
|
|
228
|
+
</button>
|
|
229
|
+
|
|
230
|
+
<span class="myPrimaryTag p-2.5">
|
|
231
|
+
{{ currentPage }}
|
|
232
|
+
</span>
|
|
233
|
+
<button
|
|
234
|
+
:disabled="
|
|
235
|
+
currentPage >= getUnsplashImages.fetchedMedia.total_pages
|
|
236
|
+
"
|
|
237
|
+
class="myPrimaryButton"
|
|
238
|
+
:class="{
|
|
239
|
+
'opacity-50':
|
|
240
|
+
currentPage >= getUnsplashImages.fetchedMedia.total_pages,
|
|
241
|
+
}"
|
|
242
|
+
@click="nextPage(currentPage++)"
|
|
243
|
+
>
|
|
244
|
+
{{ `Next ${currentPage > 0 ? currentPage + 1 : currentPage + 1}` }}
|
|
245
|
+
</button>
|
|
246
|
+
</nav>
|
|
247
|
+
</div>
|
|
248
|
+
|
|
249
|
+
<div
|
|
250
|
+
class="overflow-y-scroll pr-1 rounded-lg md:min-h-[25.5rem] md:max-h-[25.5em] min-h-[12rem] max-h-[12rem]"
|
|
251
|
+
>
|
|
252
|
+
<div class="grid md:grid-cols-6 sm:grid-cols-4 grid-cols-2 gap-2">
|
|
253
|
+
<div
|
|
254
|
+
v-for="image in getUnsplashImages.fetchedMedia.results"
|
|
255
|
+
:key="image.id"
|
|
256
|
+
@click="handleImageClick(image.urls.regular)"
|
|
257
|
+
class="border border-myPrimaryLightGrayColor rounded-lg px-2 p-2 cursor-pointer bg-gray-50"
|
|
258
|
+
>
|
|
259
|
+
<img
|
|
260
|
+
:alt="image.user.name"
|
|
261
|
+
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
|
+
:src="image.urls.thumb"
|
|
263
|
+
/>
|
|
264
|
+
<p class="myPrimaryParagraph text-xs font-normal mt-2">
|
|
265
|
+
By: {{ image.user.name }}
|
|
266
|
+
</p>
|
|
267
|
+
</div>
|
|
268
|
+
</div>
|
|
269
|
+
|
|
270
|
+
<div v-if="getUnsplashImages.fetchedMedia.results.length < 1">
|
|
271
|
+
<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
|
+
>
|
|
280
|
+
No results on current page. Navigate to First Page.
|
|
281
|
+
</span>
|
|
282
|
+
</p>
|
|
283
|
+
</div>
|
|
284
|
+
</div>
|
|
285
|
+
</div>
|
|
286
|
+
|
|
287
|
+
<div
|
|
288
|
+
v-if="
|
|
289
|
+
getUnsplashImages &&
|
|
290
|
+
getUnsplashImages.isLoading &&
|
|
291
|
+
!getUnsplashImages.isError
|
|
292
|
+
"
|
|
293
|
+
>
|
|
294
|
+
<div class="flex items-center justify-center mt-4">
|
|
295
|
+
<div
|
|
296
|
+
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]"
|
|
297
|
+
>
|
|
298
|
+
<span
|
|
299
|
+
class="!absolute !-m-px !h-px !w-px !overflow-hidden !whitespace-nowrap !border-0 !p-0 ![clip:rect(0,0,0,0)]"
|
|
300
|
+
>Loading...</span
|
|
301
|
+
>
|
|
302
|
+
</div>
|
|
303
|
+
</div>
|
|
304
|
+
</div>
|
|
305
|
+
</div>
|
|
306
|
+
</template>
|