@myissue/vue-website-page-builder 3.0.17 → 3.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +79 -76
- package/dist/page-builder/2-images-text.png +0 -0
- package/dist/page-builder/3-images-text.png +0 -0
- package/dist/page-builder/3-vertical-images.png +0 -0
- package/dist/page-builder/4-images-text.png +0 -0
- package/dist/vue-website-page-builder.css +1 -1
- package/dist/vue-website-page-builder.js +7168 -7261
- package/dist/vue-website-page-builder.umd.cjs +146 -81
- package/package.json +5 -4
- package/src/App.vue +4 -115
- package/src/Components/Homepage/HomeSection.vue +70 -162
- package/src/Components/MediaLibrary/SidebarUnsplash.vue +9 -16
- package/src/Components/MediaLibrary/Unsplash.vue +51 -91
- package/src/Components/Modals/MediaLibraryModal.vue +56 -318
- package/src/Components/Modals/PageBuilderPreviewModal.vue +22 -40
- package/src/Components/PageBuilder/AdvancedPageBuilderSettings.vue +7 -0
- package/src/Components/PageBuilder/DropdownsPlusToggles/OptionsDropdown.vue +165 -110
- package/src/Components/PageBuilder/EditorMenu/Editables/BackgroundColorEditor.vue +9 -16
- package/src/Components/PageBuilder/EditorMenu/Editables/BorderRadius.vue +18 -18
- package/src/Components/PageBuilder/EditorMenu/Editables/Borders.vue +16 -21
- package/src/Components/PageBuilder/EditorMenu/Editables/ClassEditor.vue +12 -12
- package/src/Components/PageBuilder/EditorMenu/Editables/ComponentTopMenu.vue +10 -9
- package/src/Components/PageBuilder/EditorMenu/Editables/DeleteElement.vue +9 -9
- package/src/Components/PageBuilder/EditorMenu/Editables/EditGetElement.vue +144 -136
- package/src/Components/PageBuilder/EditorMenu/Editables/ElementEditor.vue +9 -10
- package/src/Components/PageBuilder/EditorMenu/Editables/ImageEditor.vue +31 -27
- package/src/Components/PageBuilder/EditorMenu/Editables/LinkEditor.vue +20 -14
- package/src/Components/PageBuilder/EditorMenu/Editables/ManageBackgroundOpacity.vue +9 -10
- package/src/Components/PageBuilder/EditorMenu/Editables/ManageOpacity.vue +9 -10
- package/src/Components/PageBuilder/EditorMenu/Editables/PaddingPlusMargin.vue +16 -16
- package/src/Components/PageBuilder/EditorMenu/Editables/TextColorEditor.vue +9 -16
- package/src/Components/PageBuilder/EditorMenu/Editables/Typography.vue +22 -20
- package/src/Components/PageBuilder/EditorMenu/RightSidebarEditor.vue +25 -27
- package/src/Components/PageBuilder/NoneCustomMediaLibraryComponent.vue +3 -0
- package/src/Components/PageBuilder/NoneCustomSearchComponent.vue +91 -0
- package/src/Components/PageBuilder/PageBuilderSettings.vue +8 -0
- package/src/Components/PageBuilder/Settings/AdvancedPageBuilderSettings.vue +31 -72
- package/src/Components/PageBuilder/Settings/PageBuilderSettings.vue +32 -36
- package/src/Components/Search/SearchComponents.vue +11 -199
- package/src/Components/TipTap/TipTap.vue +8 -7
- package/src/Components/TipTap/TipTapInput.vue +136 -134
- package/src/PageBuilder/PageBuilder.vue +220 -32
- package/src/composables/{PageBuilder.ts → PageBuilderClass.ts} +223 -142
- package/src/composables/usePageBuilderModal.ts +25 -0
- package/src/index.ts +8 -2
- package/src/stores/media-library.ts +1 -5
- package/src/stores/page-builder-state.ts +52 -36
- package/src/stores/user.ts +8 -6
- package/src/types/global.d.ts +6 -44
- package/src/types/index.ts +169 -0
- package/src/utils/html-elements/component.ts +88 -0
- package/src/utils/html-elements/componentHelpers.ts +101 -0
- package/src/Components/Modals/PageBuilderModal.vue +0 -233
- package/src/utils/builder/html-elements/componentHelpers.ts +0 -101
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import { ref, computed, inject, watch } from 'vue'
|
|
3
|
+
import EditorAccordion from '../EditorAccordion.vue'
|
|
4
|
+
import PageBuilderClass from '@/composables/PageBuilderClass.ts'
|
|
2
5
|
import tailwindPaddingPlusMargin from '@/utils/builder/tailwind-padding-margin'
|
|
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
6
|
|
|
9
|
-
|
|
10
|
-
const pageBuilderStateStore =
|
|
11
|
-
const
|
|
7
|
+
// Get stores from parent PageBuilder component
|
|
8
|
+
const pageBuilderStateStore = inject('pageBuilderStateStore')
|
|
9
|
+
const mediaLibraryStore = inject('mediaLibraryStore')
|
|
10
|
+
|
|
11
|
+
const pageBuilderClass = new PageBuilderClass(pageBuilderStateStore, mediaLibraryStore)
|
|
12
12
|
const fontVerticalPadding = ref(null)
|
|
13
13
|
const fontHorizontalPadding = ref(null)
|
|
14
14
|
const fontVerticalMargin = ref(null)
|
|
@@ -30,7 +30,7 @@ watch(
|
|
|
30
30
|
getFontVerticalPadding,
|
|
31
31
|
(newValue) => {
|
|
32
32
|
fontVerticalPadding.value = newValue
|
|
33
|
-
|
|
33
|
+
pageBuilderClass.handlePageBuilderMethods()
|
|
34
34
|
},
|
|
35
35
|
{ immediate: true },
|
|
36
36
|
)
|
|
@@ -38,7 +38,7 @@ watch(
|
|
|
38
38
|
getFontHorizontalPadding,
|
|
39
39
|
(newValue) => {
|
|
40
40
|
fontHorizontalPadding.value = newValue
|
|
41
|
-
|
|
41
|
+
pageBuilderClass.handlePageBuilderMethods()
|
|
42
42
|
},
|
|
43
43
|
{ immediate: true },
|
|
44
44
|
)
|
|
@@ -46,7 +46,7 @@ watch(
|
|
|
46
46
|
getFontVerticalMargin,
|
|
47
47
|
(newValue) => {
|
|
48
48
|
fontVerticalMargin.value = newValue
|
|
49
|
-
|
|
49
|
+
pageBuilderClass.handlePageBuilderMethods()
|
|
50
50
|
},
|
|
51
51
|
{ immediate: true },
|
|
52
52
|
)
|
|
@@ -54,7 +54,7 @@ watch(
|
|
|
54
54
|
getFontHorizontalMargin,
|
|
55
55
|
(newValue) => {
|
|
56
56
|
fontHorizontalMargin.value = newValue
|
|
57
|
-
|
|
57
|
+
pageBuilderClass.handlePageBuilderMethods()
|
|
58
58
|
},
|
|
59
59
|
{ immediate: true },
|
|
60
60
|
)
|
|
@@ -69,7 +69,7 @@ watch(
|
|
|
69
69
|
<select
|
|
70
70
|
v-model="fontVerticalPadding"
|
|
71
71
|
class="myPrimarySelect"
|
|
72
|
-
@change="
|
|
72
|
+
@change="pageBuilderClass.handleVerticalPadding(fontVerticalPadding)"
|
|
73
73
|
>
|
|
74
74
|
<option disabled value="">Select</option>
|
|
75
75
|
<option
|
|
@@ -85,7 +85,7 @@ watch(
|
|
|
85
85
|
<select
|
|
86
86
|
v-model="fontHorizontalPadding"
|
|
87
87
|
class="myPrimarySelect"
|
|
88
|
-
@change="
|
|
88
|
+
@change="pageBuilderClass.handleHorizontalPadding(fontHorizontalPadding)"
|
|
89
89
|
>
|
|
90
90
|
<option disabled value="">Select</option>
|
|
91
91
|
<option
|
|
@@ -102,7 +102,7 @@ watch(
|
|
|
102
102
|
<select
|
|
103
103
|
v-model="fontVerticalMargin"
|
|
104
104
|
class="myPrimarySelect"
|
|
105
|
-
@change="
|
|
105
|
+
@change="pageBuilderClass.handleVerticalMargin(fontVerticalMargin)"
|
|
106
106
|
>
|
|
107
107
|
<option disabled value="">Select</option>
|
|
108
108
|
<option
|
|
@@ -118,7 +118,7 @@ watch(
|
|
|
118
118
|
<select
|
|
119
119
|
v-model="fontHorizontalMargin"
|
|
120
120
|
class="myPrimarySelect"
|
|
121
|
-
@change="
|
|
121
|
+
@change="pageBuilderClass.handleHorizontalMargin(fontHorizontalMargin)"
|
|
122
122
|
>
|
|
123
123
|
<option disabled value="">Select</option>
|
|
124
124
|
<option
|
|
@@ -1,20 +1,13 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import { ref, computed, inject, watch } from 'vue'
|
|
3
|
+
import { Listbox, ListboxButton, ListboxOption, ListboxOptions } from '@headlessui/vue'
|
|
4
|
+
import PageBuilderClass from '@/composables/PageBuilderClass.ts'
|
|
2
5
|
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
6
|
|
|
15
|
-
|
|
16
|
-
const pageBuilderStateStore =
|
|
17
|
-
const
|
|
7
|
+
// Get stores from parent PageBuilder component
|
|
8
|
+
const pageBuilderStateStore = inject('pageBuilderStateStore')
|
|
9
|
+
const mediaLibraryStore = inject('mediaLibraryStore')
|
|
10
|
+
const pageBuilderClass = new PageBuilderClass(pageBuilderStateStore, mediaLibraryStore)
|
|
18
11
|
const textColor = ref(null)
|
|
19
12
|
const getTextColor = computed(() => {
|
|
20
13
|
return pageBuilderStateStore.getTextColor
|
|
@@ -24,7 +17,7 @@ watch(
|
|
|
24
17
|
getTextColor,
|
|
25
18
|
(newValue) => {
|
|
26
19
|
textColor.value = newValue
|
|
27
|
-
|
|
20
|
+
pageBuilderClass.handlePageBuilderMethods()
|
|
28
21
|
},
|
|
29
22
|
{ immediate: true },
|
|
30
23
|
)
|
|
@@ -60,7 +53,7 @@ watch(
|
|
|
60
53
|
<ListboxOption
|
|
61
54
|
as="template"
|
|
62
55
|
v-for="color in tailwindColors.textColorVariables"
|
|
63
|
-
@click="
|
|
56
|
+
@click="pageBuilderClass.handleTextColor(textColor)"
|
|
64
57
|
:key="color"
|
|
65
58
|
:value="color"
|
|
66
59
|
v-slot="{ active, textColor }"
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import
|
|
3
|
-
import EditorAccordion from '
|
|
2
|
+
import { ref, computed, inject, watch } from 'vue'
|
|
3
|
+
import EditorAccordion from '../EditorAccordion.vue'
|
|
4
|
+
import PageBuilderClass from '@/composables/PageBuilderClass.ts'
|
|
4
5
|
import tailwindFontSizes from '@/utils/builder/tailwind-font-sizes'
|
|
5
6
|
import tailwindFontStyles from '@/utils/builder/tailwind-font-styles'
|
|
6
|
-
import { computed, ref, watch } from 'vue'
|
|
7
|
-
import { usePageBuilderStateStore } from '@/stores/page-builder-state'
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
const
|
|
8
|
+
// Get stores from parent PageBuilder component
|
|
9
|
+
const pageBuilderStateStore = inject('pageBuilderStateStore')
|
|
10
|
+
const mediaLibraryStore = inject('mediaLibraryStore')
|
|
11
|
+
|
|
12
|
+
const pageBuilderClass = new PageBuilderClass(pageBuilderStateStore, mediaLibraryStore)
|
|
11
13
|
const fontBase = ref(null)
|
|
12
14
|
const fontDesktop = ref(null)
|
|
13
15
|
const fontTablet = ref(null)
|
|
@@ -41,7 +43,7 @@ watch(
|
|
|
41
43
|
getFontBase,
|
|
42
44
|
(newValue) => {
|
|
43
45
|
fontBase.value = newValue
|
|
44
|
-
|
|
46
|
+
pageBuilderClass.handlePageBuilderMethods()
|
|
45
47
|
},
|
|
46
48
|
{ immediate: true },
|
|
47
49
|
)
|
|
@@ -49,7 +51,7 @@ watch(
|
|
|
49
51
|
getFontDesktop,
|
|
50
52
|
(newValue) => {
|
|
51
53
|
fontDesktop.value = newValue
|
|
52
|
-
|
|
54
|
+
pageBuilderClass.handlePageBuilderMethods()
|
|
53
55
|
},
|
|
54
56
|
{ immediate: true },
|
|
55
57
|
)
|
|
@@ -57,7 +59,7 @@ watch(
|
|
|
57
59
|
getFontTablet,
|
|
58
60
|
(newValue) => {
|
|
59
61
|
fontTablet.value = newValue
|
|
60
|
-
|
|
62
|
+
pageBuilderClass.handlePageBuilderMethods()
|
|
61
63
|
},
|
|
62
64
|
{ immediate: true },
|
|
63
65
|
)
|
|
@@ -65,7 +67,7 @@ watch(
|
|
|
65
67
|
getFontMobile,
|
|
66
68
|
(newValue) => {
|
|
67
69
|
fontMobile.value = newValue
|
|
68
|
-
|
|
70
|
+
pageBuilderClass.handlePageBuilderMethods()
|
|
69
71
|
},
|
|
70
72
|
{ immediate: true },
|
|
71
73
|
)
|
|
@@ -73,7 +75,7 @@ watch(
|
|
|
73
75
|
getFontWeight,
|
|
74
76
|
(newValue) => {
|
|
75
77
|
fontWeight.value = newValue
|
|
76
|
-
|
|
78
|
+
pageBuilderClass.handlePageBuilderMethods()
|
|
77
79
|
},
|
|
78
80
|
{ immediate: true },
|
|
79
81
|
)
|
|
@@ -81,7 +83,7 @@ watch(
|
|
|
81
83
|
getFontFamily,
|
|
82
84
|
(newValue) => {
|
|
83
85
|
fontFamily.value = newValue
|
|
84
|
-
|
|
86
|
+
pageBuilderClass.handlePageBuilderMethods()
|
|
85
87
|
},
|
|
86
88
|
{ immediate: true },
|
|
87
89
|
)
|
|
@@ -89,7 +91,7 @@ watch(
|
|
|
89
91
|
getFontStyle,
|
|
90
92
|
(newValue) => {
|
|
91
93
|
fontStyle.value = newValue
|
|
92
|
-
|
|
94
|
+
pageBuilderClass.handlePageBuilderMethods()
|
|
93
95
|
},
|
|
94
96
|
{ immediate: true },
|
|
95
97
|
)
|
|
@@ -106,7 +108,7 @@ watch(
|
|
|
106
108
|
<select
|
|
107
109
|
v-model="fontBase"
|
|
108
110
|
class="myPrimarySelect"
|
|
109
|
-
@change="
|
|
111
|
+
@change="pageBuilderClass.handleFontSize(fontBase)"
|
|
110
112
|
>
|
|
111
113
|
<option disabled value="">Select</option>
|
|
112
114
|
<option v-for="fontSize in tailwindFontSizes.fontBase" :key="fontSize">
|
|
@@ -119,7 +121,7 @@ watch(
|
|
|
119
121
|
<select
|
|
120
122
|
v-model="fontDesktop"
|
|
121
123
|
class="myPrimarySelect"
|
|
122
|
-
@change="
|
|
124
|
+
@change="pageBuilderClass.handleFontSize(fontDesktop)"
|
|
123
125
|
>
|
|
124
126
|
<option disabled value="">Select</option>
|
|
125
127
|
<option v-for="fontSize in tailwindFontSizes.fontDesktop" :key="fontSize">
|
|
@@ -132,7 +134,7 @@ watch(
|
|
|
132
134
|
<select
|
|
133
135
|
v-model="fontTablet"
|
|
134
136
|
class="myPrimarySelect"
|
|
135
|
-
@change="
|
|
137
|
+
@change="pageBuilderClass.handleFontSize(fontTablet)"
|
|
136
138
|
>
|
|
137
139
|
<option disabled value="">Select</option>
|
|
138
140
|
<option v-for="fontSize in tailwindFontSizes.fontTablet" :key="fontSize">
|
|
@@ -145,7 +147,7 @@ watch(
|
|
|
145
147
|
<select
|
|
146
148
|
v-model="fontMobile"
|
|
147
149
|
class="myPrimarySelect"
|
|
148
|
-
@change="
|
|
150
|
+
@change="pageBuilderClass.handleFontSize(fontMobile)"
|
|
149
151
|
>
|
|
150
152
|
<option disabled value="">Select</option>
|
|
151
153
|
<option v-for="fontSize in tailwindFontSizes.fontMobile" :key="fontSize">
|
|
@@ -160,7 +162,7 @@ watch(
|
|
|
160
162
|
<select
|
|
161
163
|
v-model="fontWeight"
|
|
162
164
|
class="myPrimarySelect"
|
|
163
|
-
@change="
|
|
165
|
+
@change="pageBuilderClass.handleFontWeight(fontWeight)"
|
|
164
166
|
>
|
|
165
167
|
<option disabled value="">Select</option>
|
|
166
168
|
<option v-for="fontWeight in tailwindFontStyles.fontWeight" :key="fontWeight">
|
|
@@ -173,7 +175,7 @@ watch(
|
|
|
173
175
|
<select
|
|
174
176
|
v-model="fontFamily"
|
|
175
177
|
class="myPrimarySelect"
|
|
176
|
-
@change="
|
|
178
|
+
@change="pageBuilderClass.handleFontFamily(fontFamily)"
|
|
177
179
|
>
|
|
178
180
|
<option disabled value="">Select</option>
|
|
179
181
|
<option v-for="fontFamily in tailwindFontStyles.fontFamily" :key="fontFamily">
|
|
@@ -186,7 +188,7 @@ watch(
|
|
|
186
188
|
<select
|
|
187
189
|
v-model="fontStyle"
|
|
188
190
|
class="myPrimarySelect"
|
|
189
|
-
@change="
|
|
191
|
+
@change="pageBuilderClass.handleFontStyle(fontStyle)"
|
|
190
192
|
>
|
|
191
193
|
<option disabled value="">Select</option>
|
|
192
194
|
<option v-for="fontStyle in tailwindFontStyles.fontStyle" :key="fontStyle">
|
|
@@ -1,49 +1,47 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { computed,
|
|
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
|
|
15
|
-
import ElementEditor from '@/Components/PageBuilder/EditorMenu/Editables/ElementEditor.vue'
|
|
2
|
+
import { computed, inject } 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 EditGetElement from '@/Components/PageBuilder/EditorMenu/Editables/EditGetElement.vue'
|
|
15
|
+
import ElementEditor from '@/Components/PageBuilder/EditorMenu/Editables/ElementEditor.vue'
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
// Get stores from parent PageBuilder component
|
|
18
|
+
const pageBuilderStateStore = inject('pageBuilderStateStore')
|
|
18
19
|
|
|
19
20
|
// emit
|
|
20
|
-
const emit = defineEmits(['closeEditor'])
|
|
21
|
+
const emit = defineEmits(['closeEditor'])
|
|
21
22
|
|
|
22
23
|
// get current element tag
|
|
23
24
|
const getElement = computed(() => {
|
|
24
|
-
return pageBuilderStateStore.getElement
|
|
25
|
-
})
|
|
25
|
+
return pageBuilderStateStore.getElement
|
|
26
|
+
})
|
|
26
27
|
|
|
27
28
|
// Get tagName of element
|
|
28
29
|
const elementTag = computed(() => {
|
|
29
|
-
return getElement.value?.tagName
|
|
30
|
-
})
|
|
30
|
+
return getElement.value?.tagName
|
|
31
|
+
})
|
|
31
32
|
|
|
32
33
|
const isHeadingElement = computed(() => {
|
|
33
34
|
return (
|
|
34
|
-
(getElement.value instanceof HTMLElement &&
|
|
35
|
-
getElement.value.innerText.trim() !== ' ') ||
|
|
35
|
+
(getElement.value instanceof HTMLElement && getElement.value.innerText.trim() !== ' ') ||
|
|
36
36
|
getElement.value instanceof HTMLImageElement
|
|
37
|
-
)
|
|
38
|
-
})
|
|
37
|
+
)
|
|
38
|
+
})
|
|
39
39
|
</script>
|
|
40
40
|
|
|
41
41
|
<template>
|
|
42
42
|
<div class="h-full w-80 bg-white">
|
|
43
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
|
-
>
|
|
44
|
+
<div class="flex flex-row justify-between pt-2.5 pr-4 pl-4 items-center mb-3">
|
|
47
45
|
<button
|
|
48
46
|
type="button"
|
|
49
47
|
@click="$emit('closeEditor')"
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import componentHelpers from '../../utils/html-elements/componentHelpers'
|
|
3
|
+
import components from '../../utils/html-elements/component'
|
|
4
|
+
import PageBuilderClass from '../../composables/PageBuilderClass'
|
|
5
|
+
import { usePageBuilderModal } from '../../composables/usePageBuilderModal'
|
|
6
|
+
import type { ComponentObject, PageBuilderStateStore, MediaLibraryStore } from '../../types'
|
|
7
|
+
|
|
8
|
+
import { inject } from 'vue'
|
|
9
|
+
|
|
10
|
+
// Get stores from parent PageBuilder component
|
|
11
|
+
const pageBuilderStateStore = inject<PageBuilderStateStore>('pageBuilderStateStore')
|
|
12
|
+
const mediaLibraryStore = inject<MediaLibraryStore>('mediaLibraryStore')
|
|
13
|
+
|
|
14
|
+
// Get modal close function
|
|
15
|
+
const { closeAddComponentModal } = usePageBuilderModal()
|
|
16
|
+
|
|
17
|
+
const pageBuilderClass = new PageBuilderClass(pageBuilderStateStore!, mediaLibraryStore!)
|
|
18
|
+
|
|
19
|
+
// Super simple component addition with professional modal closing!
|
|
20
|
+
const handleDropComponent = function (componentObject: ComponentObject) {
|
|
21
|
+
pageBuilderClass.addComponent(componentObject)
|
|
22
|
+
closeAddComponentModal()
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Helper function to convert ComponentData to ComponentObject
|
|
26
|
+
const convertToComponentObject = function (comp: any): ComponentObject {
|
|
27
|
+
return {
|
|
28
|
+
id: null, // Generate ID when needed in PageBuilderClass
|
|
29
|
+
html_code: comp.html_code,
|
|
30
|
+
title: comp.title,
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<style scoped>
|
|
36
|
+
/* Add any additional styling if needed */
|
|
37
|
+
</style>
|
|
38
|
+
|
|
39
|
+
<template>
|
|
40
|
+
<div class="p-4">
|
|
41
|
+
<!-- Helper Components Section -->
|
|
42
|
+
<div class="mb-8">
|
|
43
|
+
<h3 class="myQuaternaryHeader mb-4">Helper Components</h3>
|
|
44
|
+
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4">
|
|
45
|
+
<div
|
|
46
|
+
v-for="helper in componentHelpers"
|
|
47
|
+
:key="helper.title"
|
|
48
|
+
class="border border-gray-200 overflow-hidden hover:border-myPrimaryLinkColor duration-100 cursor-pointer p-4"
|
|
49
|
+
@click="handleDropComponent(helper)"
|
|
50
|
+
>
|
|
51
|
+
<div class="max-h-72 cursor-pointer object-contain bg-white mx-auto">
|
|
52
|
+
<div class="mr-2" v-html="helper.icon"></div>
|
|
53
|
+
<h4 class="myPrimaryParagraph text-sm font-normal">{{ helper.title }}</h4>
|
|
54
|
+
</div>
|
|
55
|
+
<div class="myPrimaryParagraph text-xs font-normal pt-2">
|
|
56
|
+
Click to add {{ helper.title.toLowerCase() }} component
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
<!-- Regular Components Section -->
|
|
63
|
+
<div>
|
|
64
|
+
<h3 class="myQuaternaryHeader mb-4">Layout Components</h3>
|
|
65
|
+
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4">
|
|
66
|
+
<div
|
|
67
|
+
v-for="comp in components[0].components.data"
|
|
68
|
+
:key="comp.title"
|
|
69
|
+
class="border border-gray-200 overflow-hidden hover:border-myPrimaryLinkColor duration-100 cursor-pointer"
|
|
70
|
+
@click="handleDropComponent(convertToComponentObject(comp))"
|
|
71
|
+
>
|
|
72
|
+
<div
|
|
73
|
+
class="overflow-hidden whitespace-pre-line flex-1 h-auto border-b border-gray-200 lg:py-10 py-8 px-2"
|
|
74
|
+
>
|
|
75
|
+
<img
|
|
76
|
+
v-if="comp.cover_image"
|
|
77
|
+
:src="comp.cover_image"
|
|
78
|
+
:alt="comp.title"
|
|
79
|
+
class="max-h-72 cursor-pointer object-contain bg-white mx-auto"
|
|
80
|
+
/>
|
|
81
|
+
<div v-else class="text-gray-500">{{ comp.title }}</div>
|
|
82
|
+
</div>
|
|
83
|
+
<div class="p-3">
|
|
84
|
+
<h4 class="myPrimaryParagraph text-sm font-normal">{{ comp.title }}</h4>
|
|
85
|
+
<div class="myPrimaryParagraph text-xs font-normal pt-2">Click to add component</div>
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
</template>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref, onMounted, inject } from 'vue'
|
|
3
|
+
import { Switch } from '@headlessui/vue'
|
|
4
|
+
import Modal from '@/Components/Modals/Modal.vue'
|
|
5
|
+
|
|
6
|
+
// Get stores from parent PageBuilder component
|
|
7
|
+
const pageBuilderStateStore = inject('pageBuilderStateStore')
|
|
8
|
+
</script>
|
|
@@ -1,33 +1,32 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { ref, computed } from 'vue'
|
|
3
|
-
|
|
2
|
+
import { ref, computed, inject } from 'vue'
|
|
3
|
+
|
|
4
|
+
// Get stores from parent PageBuilder component
|
|
5
|
+
const pageBuilderStateStore = inject('pageBuilderStateStore')
|
|
4
6
|
|
|
5
|
-
const pageBuilderStateStore = usePageBuilderStateStore();
|
|
6
7
|
const getElement = computed(() => {
|
|
7
|
-
return pageBuilderStateStore.getElement
|
|
8
|
-
})
|
|
8
|
+
return pageBuilderStateStore.getElement
|
|
9
|
+
})
|
|
9
10
|
const getComponent = computed(() => {
|
|
10
|
-
return pageBuilderStateStore.getComponent
|
|
11
|
-
})
|
|
11
|
+
return pageBuilderStateStore.getComponent
|
|
12
|
+
})
|
|
12
13
|
const getComponents = computed(() => {
|
|
13
|
-
return pageBuilderStateStore.getComponents
|
|
14
|
-
})
|
|
15
|
-
const current = ref('element')
|
|
14
|
+
return pageBuilderStateStore.getComponents
|
|
15
|
+
})
|
|
16
|
+
const current = ref('element')
|
|
16
17
|
|
|
17
18
|
const updateCurrentTab = function (tab) {
|
|
18
|
-
current.value = tab
|
|
19
|
-
}
|
|
19
|
+
current.value = tab
|
|
20
|
+
}
|
|
20
21
|
</script>
|
|
21
22
|
|
|
22
23
|
<template>
|
|
23
24
|
<div class="my-8">
|
|
24
|
-
<div
|
|
25
|
-
class="flex items-left flex-col myPrimaryGap border-myPrimaryMediumGrayColor"
|
|
26
|
-
>
|
|
25
|
+
<div class="flex items-left flex-col myPrimaryGap border-myPrimaryMediumGrayColor">
|
|
27
26
|
<h4 class="myQuaternaryHeader">Selected HTML</h4>
|
|
28
27
|
<p class="myPrimaryParagraph text-xs">
|
|
29
|
-
Overview of Selected Element, Component, and Components. This section
|
|
30
|
-
|
|
28
|
+
Overview of Selected Element, Component, and Components. This section provides real-time
|
|
29
|
+
updates based on your HTML selection.
|
|
31
30
|
</p>
|
|
32
31
|
|
|
33
32
|
<!-- Types - start -->
|
|
@@ -35,55 +34,33 @@ const updateCurrentTab = function (tab) {
|
|
|
35
34
|
<h4 class="myPrimaryParagraph text-sm pb-2">Types</h4>
|
|
36
35
|
<div class="text-white overflow-hidden bg-gray-900 max-w-2xl">
|
|
37
36
|
<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
|
-
>
|
|
37
|
+
<div class="-mb-px flex text-xs font-medium text-myPrimaryMediumGrayColor">
|
|
41
38
|
<div class="px-4 py-4 text-white">Types</div>
|
|
42
39
|
</div>
|
|
43
40
|
</div>
|
|
44
41
|
<div class="px-4 pb-8 pt-4 text-white text-xs">
|
|
45
|
-
<p
|
|
46
|
-
|
|
47
|
-
class="text-xs pb-2"
|
|
48
|
-
></p>
|
|
49
|
-
<p
|
|
50
|
-
v-if="getElement !== null && getElement !== undefined"
|
|
51
|
-
class="text-xs pb-2"
|
|
52
|
-
>
|
|
42
|
+
<p v-if="getElement === null || getElement === undefined" class="text-xs pb-2"></p>
|
|
43
|
+
<p v-if="getElement !== null && getElement !== undefined" class="text-xs pb-2">
|
|
53
44
|
<span>Element type: </span>
|
|
54
45
|
<span>
|
|
55
46
|
{{ typeof getElement }}
|
|
56
47
|
</span>
|
|
57
48
|
</p>
|
|
58
49
|
|
|
59
|
-
<p
|
|
60
|
-
v-if="getComponent === null || getComponent === undefined"
|
|
61
|
-
class="text-xs pb-2"
|
|
62
|
-
>
|
|
50
|
+
<p v-if="getComponent === null || getComponent === undefined" class="text-xs pb-2">
|
|
63
51
|
<span>Component type: </span>
|
|
64
52
|
{{ JSON.stringify(getComponent) }}
|
|
65
53
|
</p>
|
|
66
|
-
<p
|
|
67
|
-
v-if="getComponent !== null && getComponent !== undefined"
|
|
68
|
-
class="text-xs pb-2"
|
|
69
|
-
>
|
|
54
|
+
<p v-if="getComponent !== null && getComponent !== undefined" class="text-xs pb-2">
|
|
70
55
|
<span>Component type: </span>
|
|
71
56
|
<span>
|
|
72
|
-
{{
|
|
73
|
-
Array.isArray(getComponent) === true
|
|
74
|
-
? 'array'
|
|
75
|
-
: typeof getComponent
|
|
76
|
-
}}
|
|
57
|
+
{{ Array.isArray(getComponent) === true ? 'array' : typeof getComponent }}
|
|
77
58
|
</span>
|
|
78
59
|
</p>
|
|
79
60
|
<p class="text-xs pb-2">
|
|
80
61
|
<span>Components: </span>
|
|
81
62
|
<span>
|
|
82
|
-
{{
|
|
83
|
-
Array.isArray(getComponents) === true
|
|
84
|
-
? 'array'
|
|
85
|
-
: typeof getComponents
|
|
86
|
-
}}
|
|
63
|
+
{{ Array.isArray(getComponents) === true ? 'array' : typeof getComponents }}
|
|
87
64
|
</span>
|
|
88
65
|
</p>
|
|
89
66
|
</div>
|
|
@@ -95,9 +72,7 @@ const updateCurrentTab = function (tab) {
|
|
|
95
72
|
<h4 class="myPrimaryParagraph text-sm pb-2">Content</h4>
|
|
96
73
|
<div class="overflow-hidden bg-gray-900 max-w-2xl">
|
|
97
74
|
<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
|
-
>
|
|
75
|
+
<div class="-mb-px flex text-xs font-medium text-myPrimaryMediumGrayColor">
|
|
101
76
|
<div
|
|
102
77
|
@click="updateCurrentTab('element')"
|
|
103
78
|
class="px-4 py-4 cursor-pointer"
|
|
@@ -125,45 +100,29 @@ const updateCurrentTab = function (tab) {
|
|
|
125
100
|
<div class="px-4 pb-8 pt-4 text-white text-xs break-all">
|
|
126
101
|
<div v-if="current === 'element'">
|
|
127
102
|
<div v-if="getElement">
|
|
128
|
-
<div
|
|
129
|
-
class="flex flex-col gap-4 border-b border-white mb-4 pb-4"
|
|
130
|
-
>
|
|
103
|
+
<div class="flex flex-col gap-4 border-b border-white mb-4 pb-4">
|
|
131
104
|
<p>Selected element outerHTML:</p>
|
|
132
105
|
<p class="whitespace-pre-line leading-5">
|
|
133
106
|
{{ getElement?.outerHTML }}
|
|
134
107
|
</p>
|
|
135
108
|
</div>
|
|
136
|
-
<div
|
|
137
|
-
class="flex flex-col gap-2 mt-4 border-b border-white mb-4 pb-4"
|
|
138
|
-
>
|
|
109
|
+
<div class="flex flex-col gap-2 mt-4 border-b border-white mb-4 pb-4">
|
|
139
110
|
<p>Selected element src:</p>
|
|
140
111
|
<p class="whitespace-pre-line leading-5">
|
|
141
|
-
{{
|
|
142
|
-
getElement?.src ? getElement?.src : typeof getElement?.src
|
|
143
|
-
}}
|
|
112
|
+
{{ getElement?.src ? getElement?.src : typeof getElement?.src }}
|
|
144
113
|
</p>
|
|
145
114
|
</div>
|
|
146
|
-
<div
|
|
147
|
-
class="flex flex-col gap-2 mt-4 border-b border-white mb-4 pb-4"
|
|
148
|
-
>
|
|
115
|
+
<div class="flex flex-col gap-2 mt-4 border-b border-white mb-4 pb-4">
|
|
149
116
|
<p>Selected element href:</p>
|
|
150
117
|
<p class="whitespace-pre-line leading-5">
|
|
151
|
-
{{
|
|
152
|
-
getElement?.href
|
|
153
|
-
? getElement?.href
|
|
154
|
-
: typeof getElement?.href
|
|
155
|
-
}}
|
|
118
|
+
{{ getElement?.href ? getElement?.href : typeof getElement?.href }}
|
|
156
119
|
</p>
|
|
157
120
|
</div>
|
|
158
|
-
<div
|
|
159
|
-
class="flex flex-col gap-2 mt-4 border-b border-white mb-4 pb-4"
|
|
160
|
-
>
|
|
121
|
+
<div class="flex flex-col gap-2 mt-4 border-b border-white mb-4 pb-4">
|
|
161
122
|
<p>Selected element class:</p>
|
|
162
123
|
<p class="whitespace-pre-line leading-5">
|
|
163
124
|
{{
|
|
164
|
-
getElement?.classList
|
|
165
|
-
? getElement?.classList
|
|
166
|
-
: typeof getElement?.classList
|
|
125
|
+
getElement?.classList ? getElement?.classList : typeof getElement?.classList
|
|
167
126
|
}}
|
|
168
127
|
</p>
|
|
169
128
|
</div>
|