@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,91 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import tailwindColors from '@/utils/builder/tailwaind-colors'
|
|
3
|
+
import PageBuilder from '@/composables/PageBuilder.ts'
|
|
4
|
+
import { computed, ref, watch } from 'vue'
|
|
5
|
+
import {
|
|
6
|
+
Listbox,
|
|
7
|
+
ListboxButton,
|
|
8
|
+
ListboxLabel,
|
|
9
|
+
ListboxOption,
|
|
10
|
+
ListboxOptions,
|
|
11
|
+
} from '@headlessui/vue'
|
|
12
|
+
import { usePageBuilderStateStore } from '@/stores/page-builder-state'
|
|
13
|
+
import { useMediaLibraryStore } from '@/stores/media-library'
|
|
14
|
+
|
|
15
|
+
const mediaLibraryStore = useMediaLibraryStore()
|
|
16
|
+
const pageBuilderStateStore = usePageBuilderStateStore()
|
|
17
|
+
const pageBuilder = new PageBuilder(pageBuilderStateStore, mediaLibraryStore)
|
|
18
|
+
const textColor = ref(null)
|
|
19
|
+
const getTextColor = computed(() => {
|
|
20
|
+
return pageBuilderStateStore.getTextColor
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
watch(
|
|
24
|
+
getTextColor,
|
|
25
|
+
(newValue) => {
|
|
26
|
+
textColor.value = newValue
|
|
27
|
+
pageBuilder.handlePageBuilderMethods()
|
|
28
|
+
},
|
|
29
|
+
{ immediate: true },
|
|
30
|
+
)
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<template>
|
|
34
|
+
<Listbox as="div" v-model="textColor">
|
|
35
|
+
<div class="relative">
|
|
36
|
+
<ListboxButton
|
|
37
|
+
class="w-max flex items-center px-2 text-[12.5px] gap-2 text-nowrap pl-2 pr-3 h-10 cursor-pointer rounded-full border-none justify-center bg-gray-50 hover:bg-myPrimaryLinkColor hover:text-white focus-visible:ring-0"
|
|
38
|
+
>
|
|
39
|
+
<div v-if="getTextColor === 'none'" class="flex gap-2 items-center">
|
|
40
|
+
<span class="material-symbols-outlined"> format_color_text </span>
|
|
41
|
+
<span class="block truncate text-[12.5px]">Text color</span>
|
|
42
|
+
</div>
|
|
43
|
+
<div v-if="textColor !== 'none'" class="flex items-center gap-2">
|
|
44
|
+
<div
|
|
45
|
+
class="aspect-square w-6 h-6 border border-gray-800 rounded-sm"
|
|
46
|
+
:class="`bg-${textColor?.replace('text-', '')}`"
|
|
47
|
+
></div>
|
|
48
|
+
<span class="block truncate text-[12.5px]">{{ textColor }}</span>
|
|
49
|
+
</div>
|
|
50
|
+
</ListboxButton>
|
|
51
|
+
|
|
52
|
+
<transition
|
|
53
|
+
leave-active-class="transition ease-in duration-100"
|
|
54
|
+
leave-from-class="opacity-100"
|
|
55
|
+
leave-to-class="opacity-0"
|
|
56
|
+
>
|
|
57
|
+
<ListboxOptions
|
|
58
|
+
class="absolute min-w-[12rem] z-40 mt-1 max-h-56 w-full overflow-auto rounded-md bg-gray-50 py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm"
|
|
59
|
+
>
|
|
60
|
+
<ListboxOption
|
|
61
|
+
as="template"
|
|
62
|
+
v-for="color in tailwindColors.textColorVariables"
|
|
63
|
+
@click="pageBuilder.handleTextColor(textColor)"
|
|
64
|
+
:key="color"
|
|
65
|
+
:value="color"
|
|
66
|
+
v-slot="{ active, textColor }"
|
|
67
|
+
>
|
|
68
|
+
<li
|
|
69
|
+
:class="[
|
|
70
|
+
active ? 'bg-myPrimaryLinkColor text-white' : 'text-myPrimaryDarkGrayColor',
|
|
71
|
+
'relative cursor-default select-none py-2 pl-3 pr-9',
|
|
72
|
+
]"
|
|
73
|
+
>
|
|
74
|
+
<div v-if="color === 'none'" class="flex items-center">
|
|
75
|
+
<span class="material-symbols-outlined"> invert_colors </span>
|
|
76
|
+
<span class="ml-3">Default black</span>
|
|
77
|
+
</div>
|
|
78
|
+
<div v-if="color !== 'none'" class="flex items-center">
|
|
79
|
+
<div
|
|
80
|
+
class="aspect-square w-6 h-6 border border-gray-100 rounded-sm"
|
|
81
|
+
:class="`bg-${color.replace('text-', '')}`"
|
|
82
|
+
></div>
|
|
83
|
+
<span class="ml-3">{{ color }}</span>
|
|
84
|
+
</div>
|
|
85
|
+
</li>
|
|
86
|
+
</ListboxOption>
|
|
87
|
+
</ListboxOptions>
|
|
88
|
+
</transition>
|
|
89
|
+
</div>
|
|
90
|
+
</Listbox>
|
|
91
|
+
</template>
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import PageBuilder from '@/composables/PageBuilder.ts'
|
|
3
|
+
import EditorAccordion from '@/Components/PageBuilder/EditorMenu/EditorAccordion.vue'
|
|
4
|
+
import tailwindFontSizes from '@/utils/builder/tailwind-font-sizes'
|
|
5
|
+
import tailwindFontStyles from '@/utils/builder/tailwind-font-styles'
|
|
6
|
+
import { computed, ref, watch } from 'vue'
|
|
7
|
+
import { usePageBuilderStateStore } from '@/stores/page-builder-state'
|
|
8
|
+
|
|
9
|
+
const pageBuilderStateStore = usePageBuilderStateStore()
|
|
10
|
+
const pageBuilder = new PageBuilder(pageBuilderStateStore, mediaLibraryStore)
|
|
11
|
+
const fontBase = ref(null)
|
|
12
|
+
const fontDesktop = ref(null)
|
|
13
|
+
const fontTablet = ref(null)
|
|
14
|
+
const fontMobile = ref(null)
|
|
15
|
+
const fontWeight = ref(null)
|
|
16
|
+
const fontFamily = ref(null)
|
|
17
|
+
const fontStyle = ref(null)
|
|
18
|
+
const getFontBase = computed(() => {
|
|
19
|
+
return pageBuilderStateStore.getFontBase
|
|
20
|
+
})
|
|
21
|
+
const getFontDesktop = computed(() => {
|
|
22
|
+
return pageBuilderStateStore.getFontDesktop
|
|
23
|
+
})
|
|
24
|
+
const getFontTablet = computed(() => {
|
|
25
|
+
return pageBuilderStateStore.getFontTablet
|
|
26
|
+
})
|
|
27
|
+
const getFontMobile = computed(() => {
|
|
28
|
+
return pageBuilderStateStore.getFontMobile
|
|
29
|
+
})
|
|
30
|
+
const getFontWeight = computed(() => {
|
|
31
|
+
return pageBuilderStateStore.getFontWeight
|
|
32
|
+
})
|
|
33
|
+
const getFontFamily = computed(() => {
|
|
34
|
+
return pageBuilderStateStore.getFontFamily
|
|
35
|
+
})
|
|
36
|
+
const getFontStyle = computed(() => {
|
|
37
|
+
return pageBuilderStateStore.getFontStyle
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
watch(
|
|
41
|
+
getFontBase,
|
|
42
|
+
(newValue) => {
|
|
43
|
+
fontBase.value = newValue
|
|
44
|
+
pageBuilder.handlePageBuilderMethods()
|
|
45
|
+
},
|
|
46
|
+
{ immediate: true },
|
|
47
|
+
)
|
|
48
|
+
watch(
|
|
49
|
+
getFontDesktop,
|
|
50
|
+
(newValue) => {
|
|
51
|
+
fontDesktop.value = newValue
|
|
52
|
+
pageBuilder.handlePageBuilderMethods()
|
|
53
|
+
},
|
|
54
|
+
{ immediate: true },
|
|
55
|
+
)
|
|
56
|
+
watch(
|
|
57
|
+
getFontTablet,
|
|
58
|
+
(newValue) => {
|
|
59
|
+
fontTablet.value = newValue
|
|
60
|
+
pageBuilder.handlePageBuilderMethods()
|
|
61
|
+
},
|
|
62
|
+
{ immediate: true },
|
|
63
|
+
)
|
|
64
|
+
watch(
|
|
65
|
+
getFontMobile,
|
|
66
|
+
(newValue) => {
|
|
67
|
+
fontMobile.value = newValue
|
|
68
|
+
pageBuilder.handlePageBuilderMethods()
|
|
69
|
+
},
|
|
70
|
+
{ immediate: true },
|
|
71
|
+
)
|
|
72
|
+
watch(
|
|
73
|
+
getFontWeight,
|
|
74
|
+
(newValue) => {
|
|
75
|
+
fontWeight.value = newValue
|
|
76
|
+
pageBuilder.handlePageBuilderMethods()
|
|
77
|
+
},
|
|
78
|
+
{ immediate: true },
|
|
79
|
+
)
|
|
80
|
+
watch(
|
|
81
|
+
getFontFamily,
|
|
82
|
+
(newValue) => {
|
|
83
|
+
fontFamily.value = newValue
|
|
84
|
+
pageBuilder.handlePageBuilderMethods()
|
|
85
|
+
},
|
|
86
|
+
{ immediate: true },
|
|
87
|
+
)
|
|
88
|
+
watch(
|
|
89
|
+
getFontStyle,
|
|
90
|
+
(newValue) => {
|
|
91
|
+
fontStyle.value = newValue
|
|
92
|
+
pageBuilder.handlePageBuilderMethods()
|
|
93
|
+
},
|
|
94
|
+
{ immediate: true },
|
|
95
|
+
)
|
|
96
|
+
</script>
|
|
97
|
+
|
|
98
|
+
<template>
|
|
99
|
+
<EditorAccordion>
|
|
100
|
+
<template #title> Typographies </template>
|
|
101
|
+
<template #content>
|
|
102
|
+
<!-- FONT SIZES -->
|
|
103
|
+
<p class="myPrimaryParagraph font-medium py-0 my-4">Font sizes</p>
|
|
104
|
+
<div class="my-3 py-3">
|
|
105
|
+
<label class="myPrimaryInputLabel"> Font Base </label>
|
|
106
|
+
<select
|
|
107
|
+
v-model="fontBase"
|
|
108
|
+
class="myPrimarySelect"
|
|
109
|
+
@change="pageBuilder.handleFontSize(fontBase)"
|
|
110
|
+
>
|
|
111
|
+
<option disabled value="">Select</option>
|
|
112
|
+
<option v-for="fontSize in tailwindFontSizes.fontBase" :key="fontSize">
|
|
113
|
+
{{ fontSize }}
|
|
114
|
+
</option>
|
|
115
|
+
</select>
|
|
116
|
+
</div>
|
|
117
|
+
<div class="my-3 py-3">
|
|
118
|
+
<label class="myPrimaryInputLabel"> Font desktop size </label>
|
|
119
|
+
<select
|
|
120
|
+
v-model="fontDesktop"
|
|
121
|
+
class="myPrimarySelect"
|
|
122
|
+
@change="pageBuilder.handleFontSize(fontDesktop)"
|
|
123
|
+
>
|
|
124
|
+
<option disabled value="">Select</option>
|
|
125
|
+
<option v-for="fontSize in tailwindFontSizes.fontDesktop" :key="fontSize">
|
|
126
|
+
{{ fontSize }}
|
|
127
|
+
</option>
|
|
128
|
+
</select>
|
|
129
|
+
</div>
|
|
130
|
+
<div class="my-3 py-3">
|
|
131
|
+
<label class="myPrimaryInputLabel"> Font tablet size </label>
|
|
132
|
+
<select
|
|
133
|
+
v-model="fontTablet"
|
|
134
|
+
class="myPrimarySelect"
|
|
135
|
+
@change="pageBuilder.handleFontSize(fontTablet)"
|
|
136
|
+
>
|
|
137
|
+
<option disabled value="">Select</option>
|
|
138
|
+
<option v-for="fontSize in tailwindFontSizes.fontTablet" :key="fontSize">
|
|
139
|
+
{{ fontSize }}
|
|
140
|
+
</option>
|
|
141
|
+
</select>
|
|
142
|
+
</div>
|
|
143
|
+
<div class="my-3 py-3">
|
|
144
|
+
<label class="myPrimaryInputLabel"> Font mobile size </label>
|
|
145
|
+
<select
|
|
146
|
+
v-model="fontMobile"
|
|
147
|
+
class="myPrimarySelect"
|
|
148
|
+
@change="pageBuilder.handleFontSize(fontMobile)"
|
|
149
|
+
>
|
|
150
|
+
<option disabled value="">Select</option>
|
|
151
|
+
<option v-for="fontSize in tailwindFontSizes.fontMobile" :key="fontSize">
|
|
152
|
+
{{ fontSize }}
|
|
153
|
+
</option>
|
|
154
|
+
</select>
|
|
155
|
+
</div>
|
|
156
|
+
<hr />
|
|
157
|
+
<p class="myPrimaryParagraph font-medium py-0 my-4">Font general</p>
|
|
158
|
+
<div class="my-3 py-3">
|
|
159
|
+
<label class="myPrimaryInputLabel"> Font weight </label>
|
|
160
|
+
<select
|
|
161
|
+
v-model="fontWeight"
|
|
162
|
+
class="myPrimarySelect"
|
|
163
|
+
@change="pageBuilder.handleFontWeight(fontWeight)"
|
|
164
|
+
>
|
|
165
|
+
<option disabled value="">Select</option>
|
|
166
|
+
<option v-for="fontWeight in tailwindFontStyles.fontWeight" :key="fontWeight">
|
|
167
|
+
{{ fontWeight }}
|
|
168
|
+
</option>
|
|
169
|
+
</select>
|
|
170
|
+
</div>
|
|
171
|
+
<div class="my-3 py-3">
|
|
172
|
+
<label class="myPrimaryInputLabel"> Font family </label>
|
|
173
|
+
<select
|
|
174
|
+
v-model="fontFamily"
|
|
175
|
+
class="myPrimarySelect"
|
|
176
|
+
@change="pageBuilder.handleFontFamily(fontFamily)"
|
|
177
|
+
>
|
|
178
|
+
<option disabled value="">Select</option>
|
|
179
|
+
<option v-for="fontFamily in tailwindFontStyles.fontFamily" :key="fontFamily">
|
|
180
|
+
{{ fontFamily }}
|
|
181
|
+
</option>
|
|
182
|
+
</select>
|
|
183
|
+
</div>
|
|
184
|
+
<div class="my-3 py-3">
|
|
185
|
+
<label class="myPrimaryInputLabel"> Font Style </label>
|
|
186
|
+
<select
|
|
187
|
+
v-model="fontStyle"
|
|
188
|
+
class="myPrimarySelect"
|
|
189
|
+
@change="pageBuilder.handleFontStyle(fontStyle)"
|
|
190
|
+
>
|
|
191
|
+
<option disabled value="">Select</option>
|
|
192
|
+
<option v-for="fontStyle in tailwindFontStyles.fontStyle" :key="fontStyle">
|
|
193
|
+
{{ fontStyle }}
|
|
194
|
+
</option>
|
|
195
|
+
</select>
|
|
196
|
+
</div>
|
|
197
|
+
</template>
|
|
198
|
+
</EditorAccordion>
|
|
199
|
+
</template>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="flex flex-col"
|
|
4
|
+
:class="{ 'pb-8': expanded }"
|
|
5
|
+
>
|
|
6
|
+
<div
|
|
7
|
+
class="border-t border-myPrimaryLightGrayColor flex flex-row justify-between items-center pl-3 pr-3 py-5 cursor-pointer duration-200 hover:bg-myPrimaryLightGrayColor"
|
|
8
|
+
@click="expanded = !expanded"
|
|
9
|
+
>
|
|
10
|
+
<p class="myPrimaryParagraph font-medium my-0 py-0">
|
|
11
|
+
<slot name="title" />
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
<template v-if="expanded">
|
|
15
|
+
<span class="material-symbols-outlined"> keyboard_arrow_down </span>
|
|
16
|
+
</template>
|
|
17
|
+
<template v-if="!expanded">
|
|
18
|
+
<span class="material-symbols-outlined"> chevron_right </span>
|
|
19
|
+
</template>
|
|
20
|
+
</div>
|
|
21
|
+
<div
|
|
22
|
+
:class="[expanded ? 'block' : 'hidden']"
|
|
23
|
+
class="px-4 ease-linear duration-75 bg-white mt-4"
|
|
24
|
+
>
|
|
25
|
+
<slot name="content" />
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<script>
|
|
31
|
+
import { ref } from 'vue';
|
|
32
|
+
|
|
33
|
+
export default {
|
|
34
|
+
setup() {
|
|
35
|
+
const expanded = ref(false);
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
expanded,
|
|
39
|
+
};
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
</script>
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, ref, watch } from 'vue';
|
|
3
|
+
import ClassEditor from '@/Components/PageBuilder/EditorMenu/Editables/ClassEditor.vue';
|
|
4
|
+
import ImageEditor from '@/Components/PageBuilder/EditorMenu/Editables/ImageEditor.vue';
|
|
5
|
+
import OpacityEditor from '@/Components/PageBuilder/EditorMenu/Editables/OpacityEditor.vue';
|
|
6
|
+
import Typography from '@/Components/PageBuilder/EditorMenu/Editables/Typography.vue';
|
|
7
|
+
import PaddingPlusMargin from '@/Components/PageBuilder/EditorMenu/Editables/PaddingPlusMargin.vue';
|
|
8
|
+
import DeleteElement from '@/Components/PageBuilder/EditorMenu/Editables/DeleteElement.vue';
|
|
9
|
+
import BorderRadius from '@/Components/PageBuilder/EditorMenu/Editables/BorderRadius.vue';
|
|
10
|
+
import BackgroundColorEditor from '@/Components/PageBuilder/EditorMenu/Editables/BackgroundColorEditor.vue';
|
|
11
|
+
import Borders from '@/Components/PageBuilder/EditorMenu/Editables/Borders.vue';
|
|
12
|
+
import LinkEditor from '@/Components/PageBuilder/EditorMenu/Editables/LinkEditor.vue';
|
|
13
|
+
import TipTap from '@/Components/TipTap/TipTap.vue';
|
|
14
|
+
import { usePageBuilderStateStore } from '@/stores/page-builder-state';
|
|
15
|
+
import ElementEditor from '@/Components/PageBuilder/EditorMenu/Editables/ElementEditor.vue';
|
|
16
|
+
|
|
17
|
+
const pageBuilderStateStore = usePageBuilderStateStore();
|
|
18
|
+
|
|
19
|
+
// emit
|
|
20
|
+
const emit = defineEmits(['closeEditor']);
|
|
21
|
+
|
|
22
|
+
// get current element tag
|
|
23
|
+
const getElement = computed(() => {
|
|
24
|
+
return pageBuilderStateStore.getElement;
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
// Get tagName of element
|
|
28
|
+
const elementTag = computed(() => {
|
|
29
|
+
return getElement.value?.tagName;
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
const isHeadingElement = computed(() => {
|
|
33
|
+
return (
|
|
34
|
+
(getElement.value instanceof HTMLElement &&
|
|
35
|
+
getElement.value.innerText.trim() !== ' ') ||
|
|
36
|
+
getElement.value instanceof HTMLImageElement
|
|
37
|
+
);
|
|
38
|
+
});
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
<template>
|
|
42
|
+
<div class="h-full w-80 bg-white">
|
|
43
|
+
<div class="h-screen flex flex-col">
|
|
44
|
+
<div
|
|
45
|
+
class="flex flex-row justify-between pt-2.5 pr-4 pl-4 items-center mb-3"
|
|
46
|
+
>
|
|
47
|
+
<button
|
|
48
|
+
type="button"
|
|
49
|
+
@click="$emit('closeEditor')"
|
|
50
|
+
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"
|
|
51
|
+
>
|
|
52
|
+
<span class="material-symbols-outlined"> close </span>
|
|
53
|
+
</button>
|
|
54
|
+
<p class="font-medium text-sm">
|
|
55
|
+
Editing
|
|
56
|
+
<span class="lowercase"><{{ elementTag }}></span>
|
|
57
|
+
</p>
|
|
58
|
+
</div>
|
|
59
|
+
|
|
60
|
+
<div class="pl-3 pr-3 mb-4 overflow-y-scroll md:pb-24 pb-12">
|
|
61
|
+
<div v-show="isHeadingElement === true">
|
|
62
|
+
<article>
|
|
63
|
+
<ImageEditor> </ImageEditor>
|
|
64
|
+
</article>
|
|
65
|
+
<article>
|
|
66
|
+
<TipTap></TipTap>
|
|
67
|
+
</article>
|
|
68
|
+
<article
|
|
69
|
+
v-if="
|
|
70
|
+
false &&
|
|
71
|
+
$page.props.user.superadmin !== null &&
|
|
72
|
+
$page.props.user.superadmin.role === 'admin'
|
|
73
|
+
"
|
|
74
|
+
>
|
|
75
|
+
<LinkEditor></LinkEditor>
|
|
76
|
+
</article>
|
|
77
|
+
<article
|
|
78
|
+
v-if="
|
|
79
|
+
false &&
|
|
80
|
+
$page.props.user.superadmin !== null &&
|
|
81
|
+
$page.props.user.superadmin.role === 'admin'
|
|
82
|
+
"
|
|
83
|
+
>
|
|
84
|
+
<Typography></Typography>
|
|
85
|
+
</article>
|
|
86
|
+
|
|
87
|
+
<article>
|
|
88
|
+
<OpacityEditor> </OpacityEditor>
|
|
89
|
+
</article>
|
|
90
|
+
<article>
|
|
91
|
+
<PaddingPlusMargin> </PaddingPlusMargin>
|
|
92
|
+
</article>
|
|
93
|
+
<article>
|
|
94
|
+
<BorderRadius></BorderRadius>
|
|
95
|
+
</article>
|
|
96
|
+
<article>
|
|
97
|
+
<Borders></Borders>
|
|
98
|
+
</article>
|
|
99
|
+
<article>
|
|
100
|
+
<ClassEditor></ClassEditor>
|
|
101
|
+
</article>
|
|
102
|
+
</div>
|
|
103
|
+
|
|
104
|
+
<div>
|
|
105
|
+
<article>
|
|
106
|
+
<ElementEditor></ElementEditor>
|
|
107
|
+
</article>
|
|
108
|
+
</div>
|
|
109
|
+
<article class="min-h-[12em]"></article>
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
</div>
|
|
113
|
+
</template>
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref, computed } from 'vue';
|
|
3
|
+
import { usePageBuilderStateStore } from '@/stores/page-builder-state';
|
|
4
|
+
|
|
5
|
+
const pageBuilderStateStore = usePageBuilderStateStore();
|
|
6
|
+
const getElement = computed(() => {
|
|
7
|
+
return pageBuilderStateStore.getElement;
|
|
8
|
+
});
|
|
9
|
+
const getComponent = computed(() => {
|
|
10
|
+
return pageBuilderStateStore.getComponent;
|
|
11
|
+
});
|
|
12
|
+
const getComponents = computed(() => {
|
|
13
|
+
return pageBuilderStateStore.getComponents;
|
|
14
|
+
});
|
|
15
|
+
const current = ref('element');
|
|
16
|
+
|
|
17
|
+
const updateCurrentTab = function (tab) {
|
|
18
|
+
current.value = tab;
|
|
19
|
+
};
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<div class="my-8">
|
|
24
|
+
<div
|
|
25
|
+
class="flex items-left flex-col myPrimaryGap border-myPrimaryMediumGrayColor"
|
|
26
|
+
>
|
|
27
|
+
<h4 class="myQuaternaryHeader">Selected HTML</h4>
|
|
28
|
+
<p class="myPrimaryParagraph text-xs">
|
|
29
|
+
Overview of Selected Element, Component, and Components. This section
|
|
30
|
+
provides real-time updates based on your HTML selection.
|
|
31
|
+
</p>
|
|
32
|
+
|
|
33
|
+
<!-- Types - start -->
|
|
34
|
+
<div>
|
|
35
|
+
<h4 class="myPrimaryParagraph text-sm pb-2">Types</h4>
|
|
36
|
+
<div class="text-white overflow-hidden bg-gray-900 max-w-2xl">
|
|
37
|
+
<div class="flex bg-gray-800/40 ring-1 ring-white/5">
|
|
38
|
+
<div
|
|
39
|
+
class="-mb-px flex text-xs font-medium text-myPrimaryMediumGrayColor"
|
|
40
|
+
>
|
|
41
|
+
<div class="px-4 py-4 text-white">Types</div>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
<div class="px-4 pb-8 pt-4 text-white text-xs">
|
|
45
|
+
<p
|
|
46
|
+
v-if="getElement === null || getElement === undefined"
|
|
47
|
+
class="text-xs pb-2"
|
|
48
|
+
></p>
|
|
49
|
+
<p
|
|
50
|
+
v-if="getElement !== null && getElement !== undefined"
|
|
51
|
+
class="text-xs pb-2"
|
|
52
|
+
>
|
|
53
|
+
<span>Element type: </span>
|
|
54
|
+
<span>
|
|
55
|
+
{{ typeof getElement }}
|
|
56
|
+
</span>
|
|
57
|
+
</p>
|
|
58
|
+
|
|
59
|
+
<p
|
|
60
|
+
v-if="getComponent === null || getComponent === undefined"
|
|
61
|
+
class="text-xs pb-2"
|
|
62
|
+
>
|
|
63
|
+
<span>Component type: </span>
|
|
64
|
+
{{ JSON.stringify(getComponent) }}
|
|
65
|
+
</p>
|
|
66
|
+
<p
|
|
67
|
+
v-if="getComponent !== null && getComponent !== undefined"
|
|
68
|
+
class="text-xs pb-2"
|
|
69
|
+
>
|
|
70
|
+
<span>Component type: </span>
|
|
71
|
+
<span>
|
|
72
|
+
{{
|
|
73
|
+
Array.isArray(getComponent) === true
|
|
74
|
+
? 'array'
|
|
75
|
+
: typeof getComponent
|
|
76
|
+
}}
|
|
77
|
+
</span>
|
|
78
|
+
</p>
|
|
79
|
+
<p class="text-xs pb-2">
|
|
80
|
+
<span>Components: </span>
|
|
81
|
+
<span>
|
|
82
|
+
{{
|
|
83
|
+
Array.isArray(getComponents) === true
|
|
84
|
+
? 'array'
|
|
85
|
+
: typeof getComponents
|
|
86
|
+
}}
|
|
87
|
+
</span>
|
|
88
|
+
</p>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
<!-- Types - end -->
|
|
93
|
+
<!-- Code Block Component - start-->
|
|
94
|
+
<div>
|
|
95
|
+
<h4 class="myPrimaryParagraph text-sm pb-2">Content</h4>
|
|
96
|
+
<div class="overflow-hidden bg-gray-900 max-w-2xl">
|
|
97
|
+
<div class="flex bg-gray-800/40 ring-1 ring-white/5">
|
|
98
|
+
<div
|
|
99
|
+
class="-mb-px flex text-xs font-medium text-myPrimaryMediumGrayColor"
|
|
100
|
+
>
|
|
101
|
+
<div
|
|
102
|
+
@click="updateCurrentTab('element')"
|
|
103
|
+
class="px-4 py-4 cursor-pointer"
|
|
104
|
+
:class="[current === 'element' ? 'text-white' : '']"
|
|
105
|
+
>
|
|
106
|
+
Element
|
|
107
|
+
</div>
|
|
108
|
+
<div
|
|
109
|
+
@click="updateCurrentTab('component')"
|
|
110
|
+
class="px-4 py-4 cursor-pointer"
|
|
111
|
+
:class="[current === 'component' ? 'text-white' : '']"
|
|
112
|
+
>
|
|
113
|
+
Component
|
|
114
|
+
</div>
|
|
115
|
+
<div
|
|
116
|
+
@click="updateCurrentTab('components')"
|
|
117
|
+
class="px-4 py-4 cursor-pointer"
|
|
118
|
+
:class="[current === 'components' ? 'text-white' : '']"
|
|
119
|
+
>
|
|
120
|
+
Components
|
|
121
|
+
{{ Array.isArray(getComponents) && getComponents.length }}
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
124
|
+
</div>
|
|
125
|
+
<div class="px-4 pb-8 pt-4 text-white text-xs break-all">
|
|
126
|
+
<div v-if="current === 'element'">
|
|
127
|
+
<div v-if="getElement">
|
|
128
|
+
<div
|
|
129
|
+
class="flex flex-col gap-4 border-b border-white mb-4 pb-4"
|
|
130
|
+
>
|
|
131
|
+
<p>Selected element outerHTML:</p>
|
|
132
|
+
<p class="whitespace-pre-line leading-5">
|
|
133
|
+
{{ getElement?.outerHTML }}
|
|
134
|
+
</p>
|
|
135
|
+
</div>
|
|
136
|
+
<div
|
|
137
|
+
class="flex flex-col gap-2 mt-4 border-b border-white mb-4 pb-4"
|
|
138
|
+
>
|
|
139
|
+
<p>Selected element src:</p>
|
|
140
|
+
<p class="whitespace-pre-line leading-5">
|
|
141
|
+
{{
|
|
142
|
+
getElement?.src ? getElement?.src : typeof getElement?.src
|
|
143
|
+
}}
|
|
144
|
+
</p>
|
|
145
|
+
</div>
|
|
146
|
+
<div
|
|
147
|
+
class="flex flex-col gap-2 mt-4 border-b border-white mb-4 pb-4"
|
|
148
|
+
>
|
|
149
|
+
<p>Selected element href:</p>
|
|
150
|
+
<p class="whitespace-pre-line leading-5">
|
|
151
|
+
{{
|
|
152
|
+
getElement?.href
|
|
153
|
+
? getElement?.href
|
|
154
|
+
: typeof getElement?.href
|
|
155
|
+
}}
|
|
156
|
+
</p>
|
|
157
|
+
</div>
|
|
158
|
+
<div
|
|
159
|
+
class="flex flex-col gap-2 mt-4 border-b border-white mb-4 pb-4"
|
|
160
|
+
>
|
|
161
|
+
<p>Selected element class:</p>
|
|
162
|
+
<p class="whitespace-pre-line leading-5">
|
|
163
|
+
{{
|
|
164
|
+
getElement?.classList
|
|
165
|
+
? getElement?.classList
|
|
166
|
+
: typeof getElement?.classList
|
|
167
|
+
}}
|
|
168
|
+
</p>
|
|
169
|
+
</div>
|
|
170
|
+
<div class="flex flex-col gap-2 mt-4">
|
|
171
|
+
<p>Selected element style:</p>
|
|
172
|
+
<p class="whitespace-pre-line leading-5">
|
|
173
|
+
{{
|
|
174
|
+
getElement?.style
|
|
175
|
+
? JSON.stringify(getElement?.style)
|
|
176
|
+
: typeof getElement?.style
|
|
177
|
+
}}
|
|
178
|
+
</p>
|
|
179
|
+
</div>
|
|
180
|
+
</div>
|
|
181
|
+
</div>
|
|
182
|
+
<div v-if="current === 'component'">
|
|
183
|
+
<div v-if="!getComponent">
|
|
184
|
+
<p class="pb-2">
|
|
185
|
+
{{ getComponent === null ? 'NULL' : typeof getComponent }}
|
|
186
|
+
</p>
|
|
187
|
+
</div>
|
|
188
|
+
<div v-if="getComponent">
|
|
189
|
+
<p class="pb-2">
|
|
190
|
+
Component ID:
|
|
191
|
+
{{ getComponent?.id }}
|
|
192
|
+
</p>
|
|
193
|
+
<p class="whitespace-pre-line leading-5 mt-4">
|
|
194
|
+
Component HTML:<br />
|
|
195
|
+
{{ getComponent?.html_code }}
|
|
196
|
+
</p>
|
|
197
|
+
</div>
|
|
198
|
+
</div>
|
|
199
|
+
<div v-if="current === 'components'">
|
|
200
|
+
<div v-if="!getComponents">
|
|
201
|
+
<p class="pb-2">
|
|
202
|
+
{{ getComponents === null ? 'NULL' : typeof getComponents }}
|
|
203
|
+
</p>
|
|
204
|
+
</div>
|
|
205
|
+
<div v-if="getComponents">
|
|
206
|
+
<div
|
|
207
|
+
class="border-b border-white mb-4 pb-4 last:border-none"
|
|
208
|
+
v-for="component in getComponents"
|
|
209
|
+
:key="component.id"
|
|
210
|
+
>
|
|
211
|
+
<p class="pb-2">
|
|
212
|
+
Component ID:
|
|
213
|
+
{{ component.id }}
|
|
214
|
+
</p>
|
|
215
|
+
|
|
216
|
+
<p class="whitespace-pre-line leading-5 mt-4">
|
|
217
|
+
Component HTML:<br />
|
|
218
|
+
{{ component.html_code }}
|
|
219
|
+
</p>
|
|
220
|
+
</div>
|
|
221
|
+
</div>
|
|
222
|
+
</div>
|
|
223
|
+
</div>
|
|
224
|
+
</div>
|
|
225
|
+
</div>
|
|
226
|
+
<!-- Code Block Component - end-->
|
|
227
|
+
</div>
|
|
228
|
+
</div>
|
|
229
|
+
</template>
|