@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,163 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import tailwindBorderRadius from '@/utils/builder/tailwind-border-radius'
|
|
3
|
+
import PageBuilder from '@/composables/PageBuilder.ts'
|
|
4
|
+
import EditorAccordion from '@/Components/PageBuilder/EditorMenu/EditorAccordion.vue'
|
|
5
|
+
import { computed, ref, watch } from 'vue'
|
|
6
|
+
import { usePageBuilderStateStore } from '@/stores/page-builder-state'
|
|
7
|
+
import { useMediaLibraryStore } from '@/stores/media-library'
|
|
8
|
+
|
|
9
|
+
const mediaLibraryStore = useMediaLibraryStore()
|
|
10
|
+
const pageBuilderStateStore = usePageBuilderStateStore()
|
|
11
|
+
const pageBuilder = new PageBuilder(pageBuilderStateStore, mediaLibraryStore)
|
|
12
|
+
const borderRadiusGlobal = ref(null)
|
|
13
|
+
const borderRadiusTopLeft = ref(null)
|
|
14
|
+
const borderRadiusTopRight = ref(null)
|
|
15
|
+
const borderRadiusBottomleft = ref(null)
|
|
16
|
+
const borderRadiusBottomRight = ref(null)
|
|
17
|
+
const getBorderRadiusGlobal = computed(() => {
|
|
18
|
+
return pageBuilderStateStore.getBorderRadiusGlobal
|
|
19
|
+
})
|
|
20
|
+
const getBorderRadiusTopLeft = computed(() => {
|
|
21
|
+
return pageBuilderStateStore.getBorderRadiusTopLeft
|
|
22
|
+
})
|
|
23
|
+
const getBorderRadiusTopRight = computed(() => {
|
|
24
|
+
return pageBuilderStateStore.getBorderRadiusTopRight
|
|
25
|
+
})
|
|
26
|
+
const getBorderRadiusBottomleft = computed(() => {
|
|
27
|
+
return pageBuilderStateStore.getBorderRadiusBottomleft
|
|
28
|
+
})
|
|
29
|
+
const getBorderRadiusBottomRight = computed(() => {
|
|
30
|
+
return pageBuilderStateStore.getBorderRadiusBottomRight
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
watch(
|
|
34
|
+
getBorderRadiusGlobal,
|
|
35
|
+
(newValue) => {
|
|
36
|
+
borderRadiusGlobal.value = newValue
|
|
37
|
+
pageBuilder.handlePageBuilderMethods()
|
|
38
|
+
},
|
|
39
|
+
{ immediate: true },
|
|
40
|
+
)
|
|
41
|
+
watch(
|
|
42
|
+
getBorderRadiusTopLeft,
|
|
43
|
+
(newValue) => {
|
|
44
|
+
borderRadiusTopLeft.value = newValue
|
|
45
|
+
pageBuilder.handlePageBuilderMethods()
|
|
46
|
+
},
|
|
47
|
+
{ immediate: true },
|
|
48
|
+
)
|
|
49
|
+
watch(
|
|
50
|
+
getBorderRadiusTopRight,
|
|
51
|
+
(newValue) => {
|
|
52
|
+
borderRadiusTopRight.value = newValue
|
|
53
|
+
pageBuilder.handlePageBuilderMethods()
|
|
54
|
+
},
|
|
55
|
+
{ immediate: true },
|
|
56
|
+
)
|
|
57
|
+
watch(
|
|
58
|
+
getBorderRadiusBottomleft,
|
|
59
|
+
(newValue) => {
|
|
60
|
+
borderRadiusBottomleft.value = newValue
|
|
61
|
+
pageBuilder.handlePageBuilderMethods()
|
|
62
|
+
},
|
|
63
|
+
{ immediate: true },
|
|
64
|
+
)
|
|
65
|
+
watch(
|
|
66
|
+
getBorderRadiusBottomRight,
|
|
67
|
+
(newValue) => {
|
|
68
|
+
borderRadiusBottomRight.value = newValue
|
|
69
|
+
pageBuilder.handlePageBuilderMethods()
|
|
70
|
+
},
|
|
71
|
+
{ immediate: true },
|
|
72
|
+
)
|
|
73
|
+
</script>
|
|
74
|
+
|
|
75
|
+
<template>
|
|
76
|
+
<EditorAccordion>
|
|
77
|
+
<template #title>Border Radius</template>
|
|
78
|
+
<template #content>
|
|
79
|
+
<p class="myPrimaryParagraph font-medium py-0 my-4">Global</p>
|
|
80
|
+
<div class="my-3 py-3">
|
|
81
|
+
<label class="myPrimaryInputLabel"> Border Radius </label>
|
|
82
|
+
<select
|
|
83
|
+
v-model="borderRadiusGlobal"
|
|
84
|
+
class="myPrimarySelect"
|
|
85
|
+
@change="pageBuilder.handleBorderRadiusGlobal(borderRadiusGlobal)"
|
|
86
|
+
>
|
|
87
|
+
<option disabled value="">Select</option>
|
|
88
|
+
<option
|
|
89
|
+
v-for="borderRadiusGlobal in tailwindBorderRadius.roundedGlobal"
|
|
90
|
+
:key="borderRadiusGlobal"
|
|
91
|
+
>
|
|
92
|
+
{{ borderRadiusGlobal }}
|
|
93
|
+
</option>
|
|
94
|
+
</select>
|
|
95
|
+
</div>
|
|
96
|
+
<p class="myPrimaryParagraph font-medium py-0 my-4">Specific</p>
|
|
97
|
+
<div class="my-3 py-3">
|
|
98
|
+
<label class="myPrimaryInputLabel"> Border Radius top left </label>
|
|
99
|
+
<select
|
|
100
|
+
v-model="borderRadiusTopLeft"
|
|
101
|
+
class="myPrimarySelect"
|
|
102
|
+
@change="pageBuilder.handleBorderRadiusTopLeft(borderRadiusTopLeft)"
|
|
103
|
+
>
|
|
104
|
+
<option disabled value="">Select</option>
|
|
105
|
+
<option
|
|
106
|
+
v-for="borderRadiusTopLeft in tailwindBorderRadius.roundedTopLeft"
|
|
107
|
+
:key="borderRadiusTopLeft"
|
|
108
|
+
>
|
|
109
|
+
{{ borderRadiusTopLeft }}
|
|
110
|
+
</option>
|
|
111
|
+
</select>
|
|
112
|
+
</div>
|
|
113
|
+
<div class="my-3 py-3">
|
|
114
|
+
<label class="myPrimaryInputLabel"> Border Radius top right </label>
|
|
115
|
+
<select
|
|
116
|
+
v-model="borderRadiusTopRight"
|
|
117
|
+
class="myPrimarySelect"
|
|
118
|
+
@change="pageBuilder.handleBorderRadiusTopRight(borderRadiusTopRight)"
|
|
119
|
+
>
|
|
120
|
+
<option disabled value="">Select</option>
|
|
121
|
+
<option
|
|
122
|
+
v-for="borderRadiusTopRight in tailwindBorderRadius.roundedTopRight"
|
|
123
|
+
:key="borderRadiusTopRight"
|
|
124
|
+
>
|
|
125
|
+
{{ borderRadiusTopRight }}
|
|
126
|
+
</option>
|
|
127
|
+
</select>
|
|
128
|
+
</div>
|
|
129
|
+
<div class="my-3 py-3">
|
|
130
|
+
<label class="myPrimaryInputLabel"> Border Radius bottom left </label>
|
|
131
|
+
<select
|
|
132
|
+
v-model="borderRadiusBottomleft"
|
|
133
|
+
class="myPrimarySelect"
|
|
134
|
+
@change="pageBuilder.handleBorderRadiusBottomleft(borderRadiusBottomleft)"
|
|
135
|
+
>
|
|
136
|
+
<option disabled value="">Select</option>
|
|
137
|
+
<option
|
|
138
|
+
v-for="borderRadiusBottomleft in tailwindBorderRadius.roundedBottomLeft"
|
|
139
|
+
:key="borderRadiusBottomleft"
|
|
140
|
+
>
|
|
141
|
+
{{ borderRadiusBottomleft }}
|
|
142
|
+
</option>
|
|
143
|
+
</select>
|
|
144
|
+
</div>
|
|
145
|
+
<div class="my-3 py-3">
|
|
146
|
+
<label class="myPrimaryInputLabel"> Border Radius bottom right </label>
|
|
147
|
+
<select
|
|
148
|
+
v-model="borderRadiusBottomRight"
|
|
149
|
+
class="myPrimarySelect"
|
|
150
|
+
@change="pageBuilder.handleBorderRadiusBottomRight(borderRadiusBottomRight)"
|
|
151
|
+
>
|
|
152
|
+
<option disabled value="">Select</option>
|
|
153
|
+
<option
|
|
154
|
+
v-for="borderRadiusBottomRight in tailwindBorderRadius.roundedBottomRight"
|
|
155
|
+
:key="borderRadiusBottomRight"
|
|
156
|
+
>
|
|
157
|
+
{{ borderRadiusBottomRight }}
|
|
158
|
+
</option>
|
|
159
|
+
</select>
|
|
160
|
+
</div>
|
|
161
|
+
</template>
|
|
162
|
+
</EditorAccordion>
|
|
163
|
+
</template>
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import tailwindBorderStyleWidthPlusColor from '@/utils/builder/tailwind-border-style-width-color'
|
|
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 {
|
|
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 borderStyle = ref(null)
|
|
20
|
+
const borderWidth = ref(null)
|
|
21
|
+
const borderColor = ref(null)
|
|
22
|
+
const getBorderStyle = computed(() => {
|
|
23
|
+
return pageBuilderStateStore.getBorderStyle
|
|
24
|
+
})
|
|
25
|
+
const getBorderWidth = computed(() => {
|
|
26
|
+
return pageBuilderStateStore.getBorderWidth
|
|
27
|
+
})
|
|
28
|
+
const getBorderColor = computed(() => {
|
|
29
|
+
return pageBuilderStateStore.getBorderColor
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
watch(
|
|
33
|
+
getBorderStyle,
|
|
34
|
+
(newValue) => {
|
|
35
|
+
borderStyle.value = newValue
|
|
36
|
+
pageBuilder.handlePageBuilderMethods()
|
|
37
|
+
},
|
|
38
|
+
{ immediate: true },
|
|
39
|
+
)
|
|
40
|
+
watch(
|
|
41
|
+
getBorderWidth,
|
|
42
|
+
(newValue) => {
|
|
43
|
+
borderWidth.value = newValue
|
|
44
|
+
pageBuilder.handlePageBuilderMethods()
|
|
45
|
+
},
|
|
46
|
+
{ immediate: true },
|
|
47
|
+
)
|
|
48
|
+
watch(
|
|
49
|
+
getBorderColor,
|
|
50
|
+
(newValue) => {
|
|
51
|
+
borderColor.value = newValue
|
|
52
|
+
pageBuilder.handlePageBuilderMethods()
|
|
53
|
+
},
|
|
54
|
+
{ immediate: true },
|
|
55
|
+
)
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
<template>
|
|
59
|
+
<EditorAccordion>
|
|
60
|
+
<template #title>Border Style, Width & Color</template>
|
|
61
|
+
<template #content>
|
|
62
|
+
<div class="my-3 py-3">
|
|
63
|
+
<label class="myPrimaryInputLabel"> Border Style </label>
|
|
64
|
+
<select
|
|
65
|
+
v-model="borderStyle"
|
|
66
|
+
class="myPrimarySelect"
|
|
67
|
+
@change="pageBuilder.handleBorderStyle(borderStyle)"
|
|
68
|
+
>
|
|
69
|
+
<option disabled value="">Select</option>
|
|
70
|
+
<option
|
|
71
|
+
v-for="borderStyle in tailwindBorderStyleWidthPlusColor.borderStyle"
|
|
72
|
+
:key="borderStyle"
|
|
73
|
+
>
|
|
74
|
+
{{ borderStyle }}
|
|
75
|
+
</option>
|
|
76
|
+
</select>
|
|
77
|
+
</div>
|
|
78
|
+
<div class="my-3 py-3">
|
|
79
|
+
<label class="myPrimaryInputLabel"> Border Width </label>
|
|
80
|
+
<select
|
|
81
|
+
v-model="borderWidth"
|
|
82
|
+
class="myPrimarySelect"
|
|
83
|
+
@change="pageBuilder.handleBorderWidth(borderWidth)"
|
|
84
|
+
>
|
|
85
|
+
<option disabled value="">Select</option>
|
|
86
|
+
<option
|
|
87
|
+
v-for="borderWidth in tailwindBorderStyleWidthPlusColor.borderWidth"
|
|
88
|
+
:key="borderWidth"
|
|
89
|
+
>
|
|
90
|
+
{{ borderWidth }}
|
|
91
|
+
</option>
|
|
92
|
+
</select>
|
|
93
|
+
</div>
|
|
94
|
+
|
|
95
|
+
<label class="myPrimaryInputLabel"> Border Color </label>
|
|
96
|
+
<Listbox as="div" v-model="borderColor">
|
|
97
|
+
<div class="relative mt-2">
|
|
98
|
+
<ListboxButton class="myPrimarySelect">
|
|
99
|
+
<span class="flex items-center gap-2">
|
|
100
|
+
<div v-if="getBorderColor === 'none'">
|
|
101
|
+
<div class="myPrimaryColorPreview border-none">
|
|
102
|
+
<span class="material-symbols-outlined"> ev_shadow </span>
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
<div
|
|
106
|
+
v-if="borderColor !== 'none'"
|
|
107
|
+
class="aspect-square w-6 h-6 border border-gray-100 rounded-sm"
|
|
108
|
+
:class="`bg-${borderColor?.replace('border-', '')}`"
|
|
109
|
+
></div>
|
|
110
|
+
<span class="block truncate">{{ borderColor }}</span>
|
|
111
|
+
</span>
|
|
112
|
+
<span
|
|
113
|
+
class="pointer-events-none absolute inset-y-0 right-0 ml-3 flex items-center pr-2"
|
|
114
|
+
>
|
|
115
|
+
<span class="material-symbols-outlined"> keyboard_arrow_down </span>
|
|
116
|
+
</span>
|
|
117
|
+
</ListboxButton>
|
|
118
|
+
|
|
119
|
+
<transition
|
|
120
|
+
leave-active-class="transition ease-in duration-100"
|
|
121
|
+
leave-from-class="opacity-100"
|
|
122
|
+
leave-to-class="opacity-0"
|
|
123
|
+
>
|
|
124
|
+
<ListboxOptions
|
|
125
|
+
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"
|
|
126
|
+
>
|
|
127
|
+
<ListboxOption
|
|
128
|
+
as="template"
|
|
129
|
+
v-for="color in tailwindBorderStyleWidthPlusColor.borderColor"
|
|
130
|
+
@click="pageBuilder.handleBorderColor(borderColor)"
|
|
131
|
+
:key="color"
|
|
132
|
+
:value="color"
|
|
133
|
+
v-slot="{ active, borderColor }"
|
|
134
|
+
>
|
|
135
|
+
<li
|
|
136
|
+
:class="[
|
|
137
|
+
active ? 'bg-myPrimaryLinkColor text-white' : 'text-myPrimaryDarkGrayColor',
|
|
138
|
+
'relative cursor-default select-none py-2 pl-3 pr-9',
|
|
139
|
+
]"
|
|
140
|
+
>
|
|
141
|
+
<div class="flex items-center">
|
|
142
|
+
<div v-if="color === 'none'">
|
|
143
|
+
<div class="myPrimaryColorPreview border-none">
|
|
144
|
+
<span class="material-symbols-outlined"> ev_shadow </span>
|
|
145
|
+
</div>
|
|
146
|
+
</div>
|
|
147
|
+
|
|
148
|
+
<div
|
|
149
|
+
v-if="color !== 'none'"
|
|
150
|
+
class="aspect-square w-6 h-6 bg-gray-950"
|
|
151
|
+
:class="`bg-${color.replace('border-', '')}`"
|
|
152
|
+
></div>
|
|
153
|
+
<span v-if="color === 'none'" class="ml-3">Transparent</span>
|
|
154
|
+
<span v-if="color !== 'none'" class="ml-3">{{ color }}</span>
|
|
155
|
+
</div>
|
|
156
|
+
</li>
|
|
157
|
+
</ListboxOption>
|
|
158
|
+
</ListboxOptions>
|
|
159
|
+
</transition>
|
|
160
|
+
</div>
|
|
161
|
+
</Listbox>
|
|
162
|
+
</template>
|
|
163
|
+
</EditorAccordion>
|
|
164
|
+
</template>
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, ref, watch } from 'vue'
|
|
3
|
+
import EditorAccordion from '@/Components/PageBuilder/EditorMenu/EditorAccordion.vue'
|
|
4
|
+
import PageBuilder from '@/composables/PageBuilder.ts'
|
|
5
|
+
import { usePageBuilderStateStore } from '@/stores/page-builder-state'
|
|
6
|
+
import { useMediaLibraryStore } from '@/stores/media-library'
|
|
7
|
+
|
|
8
|
+
const mediaLibraryStore = useMediaLibraryStore()
|
|
9
|
+
const pageBuilderStateStore = usePageBuilderStateStore()
|
|
10
|
+
const pageBuilder = new PageBuilder(pageBuilderStateStore, mediaLibraryStore)
|
|
11
|
+
const currentClasses = ref(null)
|
|
12
|
+
const getCurrentClasses = computed(() => {
|
|
13
|
+
return pageBuilderStateStore.getCurrentClasses
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
watch(
|
|
17
|
+
getCurrentClasses,
|
|
18
|
+
(newValue) => {
|
|
19
|
+
currentClasses.value = newValue
|
|
20
|
+
},
|
|
21
|
+
{ immediate: true },
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
const inputClass = ref('')
|
|
25
|
+
|
|
26
|
+
const handleAddClasses = function () {
|
|
27
|
+
pageBuilder.handleAddClasses(inputClass.value)
|
|
28
|
+
pageBuilder.handlePageBuilderMethods()
|
|
29
|
+
|
|
30
|
+
inputClass.value = ''
|
|
31
|
+
}
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<template>
|
|
35
|
+
<EditorAccordion>
|
|
36
|
+
<template #title>Generated CSS</template>
|
|
37
|
+
<template #content>
|
|
38
|
+
<div class="flex flex-row flex-wrap gap-2 mt-2 mb-4">
|
|
39
|
+
<div
|
|
40
|
+
v-for="className in currentClasses"
|
|
41
|
+
:key="className"
|
|
42
|
+
class="myPrimaryTag cursor-pointer hover:bg-myPrimaryErrorColor hover:text-white text-xs py-2 font-medium"
|
|
43
|
+
@click="
|
|
44
|
+
() => {
|
|
45
|
+
pageBuilder.handleRemoveClasses(className)
|
|
46
|
+
pageBuilder.handlePageBuilderMethods()
|
|
47
|
+
}
|
|
48
|
+
"
|
|
49
|
+
>
|
|
50
|
+
<div class="flex items-center gap-1">
|
|
51
|
+
<span class="mr-1">
|
|
52
|
+
{{ className }}
|
|
53
|
+
</span>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
<div class="flex gap-2 item-center flex-col">
|
|
59
|
+
<div class="flex gap-2 item-center">
|
|
60
|
+
<div class="mt-1 relative flex items-center w-full border myPrimaryInput py-0 p-0">
|
|
61
|
+
<input
|
|
62
|
+
v-model="inputClass"
|
|
63
|
+
type="text"
|
|
64
|
+
placeholder="Type class"
|
|
65
|
+
@keydown.enter="handleAddClasses()"
|
|
66
|
+
autocomplete="off"
|
|
67
|
+
class="myPrimaryInput border-none rounded-r-none ml-0 w-full"
|
|
68
|
+
/>
|
|
69
|
+
<div
|
|
70
|
+
class="border border-gray-200 border-none rounded flex items-center justify-center h-full w-8"
|
|
71
|
+
>
|
|
72
|
+
<kbd class="myPrimaryParagraph text-gray-400 border-none"> ⏎ </kbd>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
<p class="myPrimaryInputError"></p>
|
|
77
|
+
</div>
|
|
78
|
+
</template>
|
|
79
|
+
</EditorAccordion>
|
|
80
|
+
</template>
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import DynamicModal from '@/Components/Modals/DynamicModal.vue'
|
|
3
|
+
import PageBuilder from '@/composables/PageBuilder.ts'
|
|
4
|
+
import { ref } from 'vue'
|
|
5
|
+
import { usePageBuilderStateStore } from '@/stores/page-builder-state'
|
|
6
|
+
import { useMediaLibraryStore } from '@/stores/media-library'
|
|
7
|
+
|
|
8
|
+
const mediaLibraryStore = useMediaLibraryStore()
|
|
9
|
+
const pageBuilderStateStore = usePageBuilderStateStore()
|
|
10
|
+
const showModalDeleteComponent = ref(false)
|
|
11
|
+
// use dynamic model
|
|
12
|
+
const typeModal = ref('')
|
|
13
|
+
const gridColumnModal = ref(Number(1))
|
|
14
|
+
const titleModal = ref('')
|
|
15
|
+
const descriptionModal = ref('')
|
|
16
|
+
const firstButtonModal = ref('')
|
|
17
|
+
const secondButtonModal = ref(null)
|
|
18
|
+
const thirdButtonModal = ref(null)
|
|
19
|
+
// set dynamic modal handle functions
|
|
20
|
+
const firstModalButtonFunction = ref(null)
|
|
21
|
+
const secondModalButtonFunction = ref(null)
|
|
22
|
+
const thirdModalButtonFunction = ref(null)
|
|
23
|
+
const pageBuilder = new PageBuilder(pageBuilderStateStore, mediaLibraryStore)
|
|
24
|
+
|
|
25
|
+
// remove component
|
|
26
|
+
const deleteComponent = function (e) {
|
|
27
|
+
showModalDeleteComponent.value = true
|
|
28
|
+
typeModal.value = 'delete'
|
|
29
|
+
gridColumnModal.value = 2
|
|
30
|
+
titleModal.value = 'Remove Component?'
|
|
31
|
+
descriptionModal.value = 'Are you sure you want to remove this Component?'
|
|
32
|
+
firstButtonModal.value = 'Close'
|
|
33
|
+
secondButtonModal.value = null
|
|
34
|
+
thirdButtonModal.value = 'Delete'
|
|
35
|
+
|
|
36
|
+
// handle click
|
|
37
|
+
firstModalButtonFunction.value = function () {
|
|
38
|
+
showModalDeleteComponent.value = false
|
|
39
|
+
}
|
|
40
|
+
//
|
|
41
|
+
// handle click
|
|
42
|
+
thirdModalButtonFunction.value = function () {
|
|
43
|
+
pageBuilder.deleteComponent()
|
|
44
|
+
|
|
45
|
+
showModalDeleteComponent.value = false
|
|
46
|
+
}
|
|
47
|
+
// end modal
|
|
48
|
+
}
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<template>
|
|
52
|
+
<DynamicModal
|
|
53
|
+
:show="showModalDeleteComponent"
|
|
54
|
+
:type="typeModal"
|
|
55
|
+
:gridColumnAmount="gridColumnModal"
|
|
56
|
+
:title="titleModal"
|
|
57
|
+
:description="descriptionModal"
|
|
58
|
+
:firstButtonText="firstButtonModal"
|
|
59
|
+
:secondButtonText="secondButtonModal"
|
|
60
|
+
:thirdButtonText="thirdButtonModal"
|
|
61
|
+
@firstModalButtonFunction="firstModalButtonFunction"
|
|
62
|
+
@secondModalButtonFunction="secondModalButtonFunction"
|
|
63
|
+
@thirdModalButtonFunction="thirdModalButtonFunction"
|
|
64
|
+
>
|
|
65
|
+
<header></header>
|
|
66
|
+
<main></main>
|
|
67
|
+
</DynamicModal>
|
|
68
|
+
<div class="flex flex-col items-center justify-center myPrimaryGap">
|
|
69
|
+
<div class="flex gap-2 items-center justify-center">
|
|
70
|
+
<div
|
|
71
|
+
@click="deleteComponent()"
|
|
72
|
+
class="h-10 w-10 cursor-pointer rounded-full flex items-center border-none justify-center bg-gray-50 aspect-square hover:bg-myPrimaryErrorColor hover:text-white text-myPrimaryErrorColor"
|
|
73
|
+
>
|
|
74
|
+
<span class="material-symbols-outlined"> delete_forever </span>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
|
|
78
|
+
<button
|
|
79
|
+
type="button"
|
|
80
|
+
@click="pageBuilder.moveComponent(-1)"
|
|
81
|
+
class="h-10 w-10 cursor-pointer rounded-full flex items-center border-none justify-center bg-gray-50 aspect-square hover:bg-myPrimaryLinkColor hover:text-white focus-visible:ring-0"
|
|
82
|
+
>
|
|
83
|
+
<span class="material-symbols-outlined"> move_up </span>
|
|
84
|
+
</button>
|
|
85
|
+
<button
|
|
86
|
+
type="button"
|
|
87
|
+
@click="pageBuilder.moveComponent(1)"
|
|
88
|
+
class="h-10 w-10 cursor-pointer rounded-full flex items-center border-none justify-center bg-gray-50 aspect-square hover:bg-myPrimaryLinkColor hover:text-white focus-visible:ring-0"
|
|
89
|
+
>
|
|
90
|
+
<span class="material-symbols-outlined"> move_down </span>
|
|
91
|
+
</button>
|
|
92
|
+
</div>
|
|
93
|
+
</template>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import EditorAccordion from '../EditorAccordion.vue'
|
|
3
|
+
import { computed, ref } from 'vue'
|
|
4
|
+
import PageBuilder from '@/composables/PageBuilder.ts'
|
|
5
|
+
import { usePageBuilderStateStore } from '@/stores/page-builder-state'
|
|
6
|
+
import { useMediaLibraryStore } from '@/stores/media-library'
|
|
7
|
+
|
|
8
|
+
const mediaLibraryStore = useMediaLibraryStore()
|
|
9
|
+
const pageBuilderStateStore = usePageBuilderStateStore()
|
|
10
|
+
const pageBuilder = new PageBuilder(pageBuilderStateStore, mediaLibraryStore)
|
|
11
|
+
const getRestoredElement = computed(() => {
|
|
12
|
+
return pageBuilderStateStore.getRestoredElement
|
|
13
|
+
})
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<EditorAccordion>
|
|
18
|
+
<template #title>Delete or restore</template>
|
|
19
|
+
<template #content>
|
|
20
|
+
<div class="my-2">
|
|
21
|
+
<button
|
|
22
|
+
v-if="getRestoredElement !== null"
|
|
23
|
+
@click="pageBuilder.handleRestoreElement"
|
|
24
|
+
type="button"
|
|
25
|
+
class="myPrimaryButton gap-2 items-center w-full"
|
|
26
|
+
>
|
|
27
|
+
<span class="material-symbols-outlined"> refresh </span>
|
|
28
|
+
Restore Element
|
|
29
|
+
</button>
|
|
30
|
+
<button
|
|
31
|
+
v-if="getRestoredElement === null"
|
|
32
|
+
@click="pageBuilder.handleDeleteElement"
|
|
33
|
+
type="button"
|
|
34
|
+
class="myPrimaryDeleteButton gap-2 items-center w-full"
|
|
35
|
+
>
|
|
36
|
+
<span class="myMediumIcon material-symbols-outlined"> delete </span>
|
|
37
|
+
Delete Element
|
|
38
|
+
</button>
|
|
39
|
+
</div>
|
|
40
|
+
</template>
|
|
41
|
+
</EditorAccordion>
|
|
42
|
+
</template>
|