@myissue/vue-website-page-builder 3.0.18 → 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 +4 -3
- 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
|
|
2
|
+
import { ref, computed, inject, watch, nextTick } from 'vue'
|
|
3
3
|
import EditorAccordion from '../EditorAccordion.vue'
|
|
4
|
-
import
|
|
4
|
+
import PageBuilderClass from '@/composables/PageBuilderClass.ts'
|
|
5
5
|
import { Switch } from '@headlessui/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 hyperlinkEnable = ref(false)
|
|
13
13
|
const urlInput = ref(null)
|
|
14
14
|
const openHyperlinkInNewTab = ref(false)
|
|
@@ -59,18 +59,26 @@ const handleToggleHyperlinkEnable = async function (data) {
|
|
|
59
59
|
|
|
60
60
|
// remove hyperlink
|
|
61
61
|
if (hyperlinkEnable.value === false) {
|
|
62
|
-
|
|
62
|
+
pageBuilderClass.handleHyperlink(hyperlinkEnable.value, data)
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
// add hyperlink
|
|
66
66
|
const handleHyperlink = function () {
|
|
67
|
-
|
|
67
|
+
pageBuilderClass.handleHyperlink(
|
|
68
|
+
hyperlinkEnable.value,
|
|
69
|
+
urlInput.value,
|
|
70
|
+
openHyperlinkInNewTab.value,
|
|
71
|
+
)
|
|
68
72
|
}
|
|
69
73
|
|
|
70
74
|
const handleToggleOpenHyperlinkInNewTab = async function () {
|
|
71
75
|
await nextTick()
|
|
72
76
|
|
|
73
|
-
|
|
77
|
+
pageBuilderClass.handleHyperlink(
|
|
78
|
+
hyperlinkEnable.value,
|
|
79
|
+
urlInput.value,
|
|
80
|
+
openHyperlinkInNewTab.value,
|
|
81
|
+
)
|
|
74
82
|
}
|
|
75
83
|
</script>
|
|
76
84
|
|
|
@@ -82,7 +90,7 @@ const handleToggleOpenHyperlinkInNewTab = async function () {
|
|
|
82
90
|
<div v-if="getHyperlinkAbility === false" class="rounded-md bg-red-50 p-2">
|
|
83
91
|
<div class="flex items-center">
|
|
84
92
|
<div class="flex-shrink-0">
|
|
85
|
-
<
|
|
93
|
+
<span class="myMediumIcon material-symbols-outlined"> warning </span>
|
|
86
94
|
</div>
|
|
87
95
|
<div class="ml-2">
|
|
88
96
|
<p class="text-sm font-medium text-green-800">
|
|
@@ -187,9 +195,7 @@ const handleToggleOpenHyperlinkInNewTab = async function () {
|
|
|
187
195
|
<div v-if="getElementContainsHyperlink === false" class="rounded-md bg-red-50 p-2">
|
|
188
196
|
<div class="flex items-center">
|
|
189
197
|
<div class="flex-shrink-0">
|
|
190
|
-
<
|
|
191
|
-
class="w-4 h-4 text-myPrimaryErrorColor"
|
|
192
|
-
></ExclamationCircleIcon>
|
|
198
|
+
<span class="myMediumIcon material-symbols-outlined"> warning </span>
|
|
193
199
|
</div>
|
|
194
200
|
<div class="ml-2">
|
|
195
201
|
<p class="text-sm font-medium text-green-800">No hyperlink added</p>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { computed,
|
|
3
|
-
import
|
|
4
|
-
import
|
|
2
|
+
import { ref, computed, inject, watch } from 'vue'
|
|
3
|
+
import EditorAccordion from '../EditorAccordion.vue'
|
|
4
|
+
import PageBuilderClass from '@/composables/PageBuilderClass.ts'
|
|
5
5
|
import tailwindOpacities from '@/utils/builder/tailwind-opacities'
|
|
6
6
|
import {
|
|
7
7
|
Listbox,
|
|
@@ -10,12 +10,11 @@ import {
|
|
|
10
10
|
ListboxOption,
|
|
11
11
|
ListboxOptions,
|
|
12
12
|
} from '@headlessui/vue'
|
|
13
|
-
import { usePageBuilderStateStore } from '@/stores/page-builder-state'
|
|
14
|
-
import { useMediaLibraryStore } from '@/stores/media-library'
|
|
15
13
|
|
|
16
|
-
|
|
17
|
-
const pageBuilderStateStore =
|
|
18
|
-
const
|
|
14
|
+
// Get stores from parent PageBuilder component
|
|
15
|
+
const pageBuilderStateStore = inject('pageBuilderStateStore')
|
|
16
|
+
const mediaLibraryStore = inject('mediaLibraryStore')
|
|
17
|
+
const pageBuilderClass = new PageBuilderClass(pageBuilderStateStore, mediaLibraryStore)
|
|
19
18
|
const opacityVueModel = ref(null)
|
|
20
19
|
const getBackgroundOpacity = computed(() => {
|
|
21
20
|
return pageBuilderStateStore.getBackgroundOpacity
|
|
@@ -25,7 +24,7 @@ watch(
|
|
|
25
24
|
getBackgroundOpacity,
|
|
26
25
|
(newValue) => {
|
|
27
26
|
opacityVueModel.value = newValue
|
|
28
|
-
|
|
27
|
+
pageBuilderClass.handlePageBuilderMethods()
|
|
29
28
|
},
|
|
30
29
|
{ immediate: true },
|
|
31
30
|
)
|
|
@@ -71,7 +70,7 @@ watch(
|
|
|
71
70
|
<ListboxOption
|
|
72
71
|
as="template"
|
|
73
72
|
v-for="backgroundOpacity in tailwindOpacities.backgroundOpacities"
|
|
74
|
-
@click="
|
|
73
|
+
@click="pageBuilderClass.handleBackgroundOpacity(backgroundOpacity)"
|
|
75
74
|
:key="backgroundOpacity"
|
|
76
75
|
:value="backgroundOpacity"
|
|
77
76
|
v-slot="{ active }"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { computed,
|
|
3
|
-
import
|
|
4
|
-
import
|
|
2
|
+
import { ref, computed, inject, watch } from 'vue'
|
|
3
|
+
import EditorAccordion from '../EditorAccordion.vue'
|
|
4
|
+
import PageBuilderClass from '@/composables/PageBuilderClass.ts'
|
|
5
5
|
import tailwindOpacities from '@/utils/builder/tailwind-opacities'
|
|
6
6
|
import {
|
|
7
7
|
Listbox,
|
|
@@ -10,12 +10,11 @@ import {
|
|
|
10
10
|
ListboxOption,
|
|
11
11
|
ListboxOptions,
|
|
12
12
|
} from '@headlessui/vue'
|
|
13
|
-
import { usePageBuilderStateStore } from '@/stores/page-builder-state'
|
|
14
|
-
import { useMediaLibraryStore } from '@/stores/media-library'
|
|
15
13
|
|
|
16
|
-
|
|
17
|
-
const pageBuilderStateStore =
|
|
18
|
-
const
|
|
14
|
+
// Get stores from parent PageBuilder component
|
|
15
|
+
const pageBuilderStateStore = inject('pageBuilderStateStore')
|
|
16
|
+
const mediaLibraryStore = inject('mediaLibraryStore')
|
|
17
|
+
const pageBuilderClass = new PageBuilderClass(pageBuilderStateStore, mediaLibraryStore)
|
|
19
18
|
const opacityVueModel = ref(null)
|
|
20
19
|
const getOpacity = computed(() => {
|
|
21
20
|
return pageBuilderStateStore.getOpacity
|
|
@@ -25,7 +24,7 @@ watch(
|
|
|
25
24
|
getOpacity,
|
|
26
25
|
(newValue) => {
|
|
27
26
|
opacityVueModel.value = newValue
|
|
28
|
-
|
|
27
|
+
pageBuilderClass.handlePageBuilderMethods()
|
|
29
28
|
},
|
|
30
29
|
{ immediate: true },
|
|
31
30
|
)
|
|
@@ -71,7 +70,7 @@ watch(
|
|
|
71
70
|
<ListboxOption
|
|
72
71
|
as="template"
|
|
73
72
|
v-for="elementOpacity in tailwindOpacities.opacities"
|
|
74
|
-
@click="
|
|
73
|
+
@click="pageBuilderClass.handleOpacity(elementOpacity)"
|
|
75
74
|
:key="elementOpacity"
|
|
76
75
|
:value="elementOpacity"
|
|
77
76
|
v-slot="{ active }"
|
|
@@ -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>
|