@myissue/vue-website-page-builder 3.2.91 → 3.2.93
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 +122 -84
- package/dist/vue-website-page-builder.css +1 -1
- package/dist/vue-website-page-builder.js +5221 -5286
- package/dist/vue-website-page-builder.umd.cjs +52 -52
- package/package.json +1 -1
- package/src/Components/Loaders/GlobalLoader.vue +11 -0
- package/src/Components/Modals/DynamicModalBuilder.vue +41 -245
- package/src/Components/Modals/ModalBuilder.vue +29 -4
- package/src/Components/PageBuilder/DefaultComponents/DefaultBuilderComponents.vue +3 -8
- package/src/Components/PageBuilder/EditorMenu/Editables/BackgroundColorEditor.vue +5 -4
- package/src/Components/PageBuilder/EditorMenu/Editables/BorderRadius.vue +12 -13
- package/src/Components/PageBuilder/EditorMenu/Editables/Borders.vue +8 -8
- package/src/Components/PageBuilder/EditorMenu/Editables/ClassEditor.vue +7 -6
- package/src/Components/PageBuilder/EditorMenu/Editables/ComponentTopMenu.vue +6 -10
- package/src/Components/PageBuilder/EditorMenu/Editables/DeleteElement.vue +4 -4
- package/src/Components/PageBuilder/EditorMenu/Editables/EditGetElement.vue +10 -11
- package/src/Components/PageBuilder/EditorMenu/Editables/ElementEditor.vue +4 -5
- package/src/Components/PageBuilder/EditorMenu/Editables/ImageEditor.vue +0 -9
- package/src/Components/PageBuilder/EditorMenu/Editables/LinkEditor.vue +5 -5
- package/src/Components/PageBuilder/EditorMenu/Editables/ManageBackgroundOpacity.vue +4 -4
- package/src/Components/PageBuilder/EditorMenu/Editables/ManageOpacity.vue +4 -4
- package/src/Components/PageBuilder/EditorMenu/Editables/Margin.vue +8 -8
- package/src/Components/PageBuilder/EditorMenu/Editables/Padding.vue +8 -8
- package/src/Components/PageBuilder/EditorMenu/Editables/TextColorEditor.vue +4 -4
- package/src/Components/PageBuilder/EditorMenu/Editables/Typography.vue +16 -16
- package/src/Components/PageBuilder/EditorMenu/RightSidebarEditor.vue +3 -7
- package/src/Components/PageBuilder/Settings/PageBuilderSettings.vue +55 -58
- package/src/Components/PageBuilder/ToolbarOption/ToolbarOption.vue +33 -40
- package/src/Components/TipTap/TipTap.vue +4 -9
- package/src/Components/TipTap/TipTapInput.vue +8 -8
- package/src/DemoComponents/DemoUnsplash.vue +11 -12
- package/src/DemoComponents/HomeSection.vue +9 -30
- package/src/PageBuilder/PageBuilder.vue +194 -96
- package/src/composables/{PageBuilderClass.ts → PageBuilderService.ts} +292 -112
- package/src/composables/builderInstance.ts +25 -0
- package/src/css/app.css +15 -0
- package/src/css/dev-global.css +7 -0
- package/src/index.ts +4 -2
- package/src/main.ts +3 -0
- package/src/stores/page-builder-state.ts +39 -10
- package/src/types/index.ts +100 -10
- package/src/helpers/passedPageBuilderConfig.ts +0 -71
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { ref, computed, watch } from 'vue'
|
|
3
3
|
import EditorAccordion from '../EditorAccordion.vue'
|
|
4
|
-
import PageBuilderClass from '../../../../composables/PageBuilderClass.ts'
|
|
5
4
|
import tailwindBorderStyleWidthPlusColor from '../../../../utils/builder/tailwind-border-style-width-color'
|
|
6
5
|
import tailwindColors from '../../../../utils/builder/tailwaind-colors'
|
|
7
6
|
import { Listbox, ListboxButton, ListboxOption, ListboxOptions } from '@headlessui/vue'
|
|
8
7
|
import { sharedPageBuilderStore } from '../../../../stores/shared-store'
|
|
8
|
+
import { getPageBuilder } from '../../../../composables/builderInstance'
|
|
9
|
+
const pageBuilderService = getPageBuilder()
|
|
9
10
|
|
|
10
11
|
// Use shared store instance
|
|
11
12
|
const pageBuilderStateStore = sharedPageBuilderStore
|
|
12
13
|
|
|
13
|
-
const pageBuilderClass = new PageBuilderClass(pageBuilderStateStore)
|
|
14
14
|
const borderStyle = ref(null)
|
|
15
15
|
const borderWidth = ref(null)
|
|
16
16
|
const borderColor = ref(null)
|
|
@@ -28,7 +28,7 @@ watch(
|
|
|
28
28
|
getBorderStyle,
|
|
29
29
|
async (newValue) => {
|
|
30
30
|
borderStyle.value = newValue
|
|
31
|
-
await
|
|
31
|
+
await pageBuilderService.initializeElementStyles()
|
|
32
32
|
},
|
|
33
33
|
{ immediate: true },
|
|
34
34
|
)
|
|
@@ -36,7 +36,7 @@ watch(
|
|
|
36
36
|
getBorderWidth,
|
|
37
37
|
async (newValue) => {
|
|
38
38
|
borderWidth.value = newValue
|
|
39
|
-
await
|
|
39
|
+
await pageBuilderService.initializeElementStyles()
|
|
40
40
|
},
|
|
41
41
|
{ immediate: true },
|
|
42
42
|
)
|
|
@@ -44,7 +44,7 @@ watch(
|
|
|
44
44
|
getBorderColor,
|
|
45
45
|
async (newValue) => {
|
|
46
46
|
borderColor.value = newValue
|
|
47
|
-
await
|
|
47
|
+
await pageBuilderService.initializeElementStyles()
|
|
48
48
|
},
|
|
49
49
|
{ immediate: true },
|
|
50
50
|
)
|
|
@@ -61,7 +61,7 @@ watch(
|
|
|
61
61
|
<select
|
|
62
62
|
v-model="borderStyle"
|
|
63
63
|
class="pbx-myPrimarySelect"
|
|
64
|
-
@change="
|
|
64
|
+
@change="pageBuilderService.handleBorderStyle(borderStyle)"
|
|
65
65
|
>
|
|
66
66
|
<option disabled value="">Select</option>
|
|
67
67
|
<option
|
|
@@ -77,7 +77,7 @@ watch(
|
|
|
77
77
|
<select
|
|
78
78
|
v-model="borderWidth"
|
|
79
79
|
class="pbx-myPrimarySelect"
|
|
80
|
-
@change="
|
|
80
|
+
@change="pageBuilderService.handleBorderWidth(borderWidth)"
|
|
81
81
|
>
|
|
82
82
|
<option disabled value="">Select</option>
|
|
83
83
|
<option
|
|
@@ -124,7 +124,7 @@ watch(
|
|
|
124
124
|
<ListboxOption
|
|
125
125
|
as="template"
|
|
126
126
|
v-for="color in tailwindBorderStyleWidthPlusColor.borderColor"
|
|
127
|
-
@click="
|
|
127
|
+
@click="pageBuilderService.handleBorderColor(borderColor)"
|
|
128
128
|
:key="color"
|
|
129
129
|
:value="color"
|
|
130
130
|
v-slot="{ active, borderColor }"
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
import { ref, computed, watch } from 'vue'
|
|
3
3
|
import { sharedPageBuilderStore } from '../../../../stores/shared-store'
|
|
4
4
|
import EditorAccordion from '../EditorAccordion.vue'
|
|
5
|
-
import
|
|
5
|
+
import { getPageBuilder } from '../../../../composables/builderInstance'
|
|
6
|
+
|
|
7
|
+
const pageBuilderService = getPageBuilder()
|
|
6
8
|
|
|
7
9
|
// Use shared store instance
|
|
8
10
|
const pageBuilderStateStore = sharedPageBuilderStore
|
|
9
11
|
|
|
10
|
-
const pageBuilderClass = new PageBuilderClass(pageBuilderStateStore)
|
|
11
12
|
const currentClasses = ref(null)
|
|
12
13
|
const getCurrentClasses = computed(() => {
|
|
13
14
|
return pageBuilderStateStore.getCurrentClasses
|
|
@@ -24,8 +25,8 @@ watch(
|
|
|
24
25
|
const inputClass = ref('')
|
|
25
26
|
|
|
26
27
|
const handleAddClasses = async function () {
|
|
27
|
-
|
|
28
|
-
await
|
|
28
|
+
pageBuilderService.handleAddClasses(inputClass.value)
|
|
29
|
+
await pageBuilderService.initializeElementStyles()
|
|
29
30
|
|
|
30
31
|
inputClass.value = ''
|
|
31
32
|
}
|
|
@@ -42,8 +43,8 @@ const handleAddClasses = async function () {
|
|
|
42
43
|
class="pbx-myPrimaryTag pbx-cursor-pointer hover:pbx-bg-myPrimaryErrorColor hover:pbx-text-white pbx-text-xs pbx-py-2 pbx-font-medium"
|
|
43
44
|
@click="
|
|
44
45
|
async () => {
|
|
45
|
-
|
|
46
|
-
await
|
|
46
|
+
pageBuilderService.handleRemoveClasses(className)
|
|
47
|
+
await pageBuilderService.initializeElementStyles()
|
|
47
48
|
}
|
|
48
49
|
"
|
|
49
50
|
>
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import DynamicModalBuilder from '../../../Modals/DynamicModalBuilder.vue'
|
|
3
3
|
import { computed, ref } from 'vue'
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
// Use shared store instance
|
|
8
|
-
const pageBuilderStateStore = sharedPageBuilderStore
|
|
4
|
+
import { getPageBuilder } from '../../../../composables/builderInstance'
|
|
5
|
+
const pageBuilderService = getPageBuilder()
|
|
9
6
|
|
|
10
7
|
const showModalDeleteComponent = ref(false)
|
|
11
8
|
// use dynamic model
|
|
@@ -20,10 +17,9 @@ const thirdButtonModal = ref(null)
|
|
|
20
17
|
const firstModalButtonFunctionDynamicModalBuilder = ref(null)
|
|
21
18
|
const secondModalButtonFunctionDynamicModalBuilder = ref(null)
|
|
22
19
|
const thirdModalButtonFunctionDynamicModalBuilder = ref(null)
|
|
23
|
-
const pageBuilderClass = new PageBuilderClass(pageBuilderStateStore)
|
|
24
20
|
|
|
25
21
|
// remove component
|
|
26
|
-
const deleteSelectedComponent = function (
|
|
22
|
+
const deleteSelectedComponent = function () {
|
|
27
23
|
showModalDeleteComponent.value = true
|
|
28
24
|
typeModal.value = 'delete'
|
|
29
25
|
gridColumnModal.value = 2
|
|
@@ -40,7 +36,7 @@ const deleteSelectedComponent = function (e) {
|
|
|
40
36
|
//
|
|
41
37
|
// handle click
|
|
42
38
|
thirdModalButtonFunctionDynamicModalBuilder.value = function () {
|
|
43
|
-
|
|
39
|
+
pageBuilderService.deleteSelectedComponent()
|
|
44
40
|
|
|
45
41
|
showModalDeleteComponent.value = false
|
|
46
42
|
}
|
|
@@ -77,14 +73,14 @@ const deleteSelectedComponent = function (e) {
|
|
|
77
73
|
|
|
78
74
|
<button
|
|
79
75
|
type="button"
|
|
80
|
-
@click="
|
|
76
|
+
@click="pageBuilderService.reorderComponent(-1)"
|
|
81
77
|
class="pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-50 pbx-aspect-square hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white focus-visible:pbx-ring-0"
|
|
82
78
|
>
|
|
83
79
|
<span class="material-symbols-outlined"> move_up </span>
|
|
84
80
|
</button>
|
|
85
81
|
<button
|
|
86
82
|
type="button"
|
|
87
|
-
@click="
|
|
83
|
+
@click="pageBuilderService.reorderComponent(1)"
|
|
88
84
|
class="pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-50 pbx-aspect-square hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white focus-visible:pbx-ring-0"
|
|
89
85
|
>
|
|
90
86
|
<span class="material-symbols-outlined"> move_down </span>
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import EditorAccordion from '../EditorAccordion.vue'
|
|
3
3
|
import { computed } from 'vue'
|
|
4
4
|
import { sharedPageBuilderStore } from '../../../../stores/shared-store'
|
|
5
|
-
import
|
|
5
|
+
import { getPageBuilder } from '../../../../composables/builderInstance'
|
|
6
|
+
const pageBuilderService = getPageBuilder()
|
|
6
7
|
|
|
7
8
|
// Use shared store instance
|
|
8
9
|
const pageBuilderStateStore = sharedPageBuilderStore
|
|
9
10
|
|
|
10
|
-
const pageBuilderClass = new PageBuilderClass(pageBuilderStateStore)
|
|
11
11
|
const getRestoredElement = computed(() => {
|
|
12
12
|
return pageBuilderStateStore.getRestoredElement
|
|
13
13
|
})
|
|
@@ -20,7 +20,7 @@ const getRestoredElement = computed(() => {
|
|
|
20
20
|
<div class="pbx-my-2">
|
|
21
21
|
<button
|
|
22
22
|
v-if="getRestoredElement !== null"
|
|
23
|
-
@click="
|
|
23
|
+
@click="pageBuilderService.handleRestoreElement"
|
|
24
24
|
type="button"
|
|
25
25
|
class="pbx-myPrimaryButton pbx-gap-2 pbx-items-center pbx-w-full"
|
|
26
26
|
>
|
|
@@ -29,7 +29,7 @@ const getRestoredElement = computed(() => {
|
|
|
29
29
|
</button>
|
|
30
30
|
<button
|
|
31
31
|
v-if="getRestoredElement === null"
|
|
32
|
-
@click="
|
|
32
|
+
@click="pageBuilderService.handleDeleteElement"
|
|
33
33
|
type="button"
|
|
34
34
|
class="pbx-myPrimaryDeleteButton pbx-gap-2 pbx-items-center pbx-w-full"
|
|
35
35
|
>
|
|
@@ -2,18 +2,17 @@
|
|
|
2
2
|
import { ref, computed, onMounted, inject } from 'vue'
|
|
3
3
|
import DynamicModalBuilder from '../../../Modals/DynamicModalBuilder.vue'
|
|
4
4
|
import TipTapInput from '../../../TipTap/TipTapInput.vue'
|
|
5
|
-
import PageBuilderClass from '../../../../composables/PageBuilderClass.ts'
|
|
6
5
|
import MediaLibraryModal from '../../../Modals/MediaLibraryModal.vue'
|
|
7
6
|
import TextColorEditor from './TextColorEditor.vue'
|
|
8
7
|
import BackgroundColorEditor from './BackgroundColorEditor.vue'
|
|
9
8
|
import { sharedPageBuilderStore } from '../../../../stores/shared-store'
|
|
9
|
+
import { getPageBuilder } from '../../../../composables/builderInstance'
|
|
10
|
+
const pageBuilderService = getPageBuilder()
|
|
10
11
|
|
|
11
12
|
// Use shared store instance
|
|
12
13
|
const pageBuilderStateStore = sharedPageBuilderStore
|
|
13
14
|
const customMediaComponent = inject('CustomMediaComponent')
|
|
14
15
|
|
|
15
|
-
const pageBuilderClass = new PageBuilderClass(pageBuilderStateStore)
|
|
16
|
-
|
|
17
16
|
const getElement = computed(() => {
|
|
18
17
|
return pageBuilderStateStore.getElement
|
|
19
18
|
})
|
|
@@ -45,7 +44,7 @@ const secondModalButtonFunctionDynamicModalBuilder = ref(null)
|
|
|
45
44
|
const thirdModalButtonFunctionDynamicModalBuilder = ref(null)
|
|
46
45
|
|
|
47
46
|
const handleModalPreviewTiptap = function () {
|
|
48
|
-
|
|
47
|
+
pageBuilderService.toggleTipTapModal(true)
|
|
49
48
|
|
|
50
49
|
typeModal.value = 'success'
|
|
51
50
|
gridColumnModal.value = 2
|
|
@@ -58,11 +57,11 @@ const handleModalPreviewTiptap = function () {
|
|
|
58
57
|
// handle click
|
|
59
58
|
|
|
60
59
|
firstModalButtonFunctionDynamicModalBuilder.value = function () {
|
|
61
|
-
|
|
60
|
+
pageBuilderService.toggleTipTapModal(false)
|
|
62
61
|
}
|
|
63
62
|
|
|
64
63
|
thirdModalButtonFunctionDynamicModalBuilder.value = function () {
|
|
65
|
-
|
|
64
|
+
pageBuilderService.toggleTipTapModal(true)
|
|
66
65
|
}
|
|
67
66
|
}
|
|
68
67
|
|
|
@@ -268,7 +267,7 @@ const handleModalIframeSrc = function () {
|
|
|
268
267
|
class="pbx-flex pbx-items-center pbx-justify-center"
|
|
269
268
|
:class="{ 'pbx-rounded-full pbx-border pbx-border-gray-200 pbx-shadow-sm': getElement }"
|
|
270
269
|
>
|
|
271
|
-
<template v-if="
|
|
270
|
+
<template v-if="pageBuilderService.ElOrFirstChildIsIframe()">
|
|
272
271
|
<div class="pbx-px-2 pbx-flex pbx-items-center pbx-justify-start pbx-gap-2 pbx-w-max">
|
|
273
272
|
<button @click="handleModalIframeSrc" type="button" class="pbx-myPrimaryTag">
|
|
274
273
|
<span class="material-symbols-outlined"> play_circle </span>
|
|
@@ -279,8 +278,8 @@ const handleModalIframeSrc = function () {
|
|
|
279
278
|
|
|
280
279
|
<template
|
|
281
280
|
v-if="
|
|
282
|
-
|
|
283
|
-
!
|
|
281
|
+
pageBuilderService.isSelectedElementValidText() &&
|
|
282
|
+
!pageBuilderService.ElOrFirstChildIsIframe()
|
|
284
283
|
"
|
|
285
284
|
>
|
|
286
285
|
<div class="pbx-px-2 pbx-flex pbx-items-center pbx-justify-start pbx-gap-2 pbx-w-max">
|
|
@@ -299,7 +298,7 @@ const handleModalIframeSrc = function () {
|
|
|
299
298
|
getElement &&
|
|
300
299
|
getComponent &&
|
|
301
300
|
getBasePrimaryImage !== null &&
|
|
302
|
-
!
|
|
301
|
+
!pageBuilderService.ElOrFirstChildIsIframe()
|
|
303
302
|
"
|
|
304
303
|
>
|
|
305
304
|
<div class="pbx-px-2 pbx-flex pbx-items-center pbx-justify-start pbx-gap-2 pbx-w-max">
|
|
@@ -315,7 +314,7 @@ const handleModalIframeSrc = function () {
|
|
|
315
314
|
getElement &&
|
|
316
315
|
getElement.nodeType === 1 &&
|
|
317
316
|
!getBasePrimaryImage &&
|
|
318
|
-
!
|
|
317
|
+
!pageBuilderService.ElOrFirstChildIsIframe()
|
|
319
318
|
"
|
|
320
319
|
>
|
|
321
320
|
<div class="pbx-px-2">
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed } from 'vue'
|
|
3
3
|
import { sharedPageBuilderStore } from '../../../../stores/shared-store'
|
|
4
|
-
import PageBuilderClass from '../../../../composables/PageBuilderClass.ts'
|
|
5
4
|
import EditorAccordion from '../EditorAccordion.vue'
|
|
5
|
+
import { getPageBuilder } from '../../../../composables/builderInstance'
|
|
6
|
+
const pageBuilderService = getPageBuilder()
|
|
6
7
|
|
|
7
8
|
// Use shared store instance
|
|
8
9
|
const pageBuilderStateStore = sharedPageBuilderStore
|
|
9
10
|
|
|
10
|
-
const pageBuilderClass = new PageBuilderClass(pageBuilderStateStore)
|
|
11
|
-
|
|
12
11
|
const getElement = computed(() => {
|
|
13
12
|
return pageBuilderStateStore.getElement
|
|
14
13
|
})
|
|
@@ -30,7 +29,7 @@ const getRestoredElement = computed(() => {
|
|
|
30
29
|
<label class="pbx-myPrimaryInputLabel"> Restore the last deleted HTML element.</label>
|
|
31
30
|
<div class="pbx-px-2 pbx-flex pbx-items-center pbx-justify-start pbx-gap-2 pbx-w-max">
|
|
32
31
|
<button
|
|
33
|
-
@click="
|
|
32
|
+
@click="pageBuilderService.handleRestoreElement"
|
|
34
33
|
type="button"
|
|
35
34
|
class="pbx-myPrimaryButton pbx-w-full pbx-mt-4"
|
|
36
35
|
>
|
|
@@ -49,7 +48,7 @@ const getRestoredElement = computed(() => {
|
|
|
49
48
|
|
|
50
49
|
<div class="pbx-px-2 pbx-flex pbx-items-center pbx-justify-start pbx-gap-2 pbx-w-max">
|
|
51
50
|
<button
|
|
52
|
-
@click="
|
|
51
|
+
@click="pageBuilderService.handleDeleteElement"
|
|
53
52
|
type="button"
|
|
54
53
|
class="pbx-myPrimaryDeleteButton pbx-w-full pbx-mt-4"
|
|
55
54
|
>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed, ref, inject } from 'vue'
|
|
3
3
|
import MediaLibraryModal from '../../../Modals/MediaLibraryModal.vue'
|
|
4
|
-
import PageBuilderClass from '../../../../composables/PageBuilderClass.ts'
|
|
5
4
|
import { sharedPageBuilderStore } from '../../../../stores/shared-store'
|
|
6
5
|
import { preloadImage } from '../../../../composables/preloadImage'
|
|
7
6
|
import { delay } from '../../../../composables/delay'
|
|
@@ -10,9 +9,6 @@ import { delay } from '../../../../composables/delay'
|
|
|
10
9
|
const pageBuilderStateStore = sharedPageBuilderStore
|
|
11
10
|
const customMediaComponent = inject('CustomMediaComponent')
|
|
12
11
|
|
|
13
|
-
const pageBuilderClass = new PageBuilderClass(pageBuilderStateStore)
|
|
14
|
-
|
|
15
|
-
const isLoading = ref(false)
|
|
16
12
|
const getIsLoadingImage = ref(false)
|
|
17
13
|
|
|
18
14
|
// use media library
|
|
@@ -34,11 +30,6 @@ const getBasePrimaryImage = computed(() => {
|
|
|
34
30
|
return pageBuilderStateStore.getBasePrimaryImage
|
|
35
31
|
})
|
|
36
32
|
|
|
37
|
-
// get current image from store
|
|
38
|
-
const getElement = computed(() => {
|
|
39
|
-
return pageBuilderStateStore.getElement
|
|
40
|
-
})
|
|
41
|
-
|
|
42
33
|
const handleAddImage = function () {
|
|
43
34
|
// open modal to true
|
|
44
35
|
showMediaLibraryModal.value = true
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import { ref, computed, watch, nextTick } from 'vue'
|
|
3
3
|
import { sharedPageBuilderStore } from '../../../../stores/shared-store'
|
|
4
4
|
import EditorAccordion from '../EditorAccordion.vue'
|
|
5
|
-
import PageBuilderClass from '../../../../composables/PageBuilderClass.ts'
|
|
6
5
|
import { Switch } from '@headlessui/vue'
|
|
6
|
+
import { getPageBuilder } from '../../../../composables/builderInstance'
|
|
7
|
+
const pageBuilderService = getPageBuilder()
|
|
7
8
|
|
|
8
9
|
// Use shared store instance
|
|
9
10
|
const pageBuilderStateStore = sharedPageBuilderStore
|
|
10
11
|
|
|
11
|
-
const pageBuilderClass = new PageBuilderClass(pageBuilderStateStore)
|
|
12
12
|
const hyperlinkEnable = ref(false)
|
|
13
13
|
const urlInput = ref(null)
|
|
14
14
|
const openHyperlinkInNewTab = ref(false)
|
|
@@ -59,12 +59,12 @@ const handleToggleHyperlinkEnable = async function (data) {
|
|
|
59
59
|
|
|
60
60
|
// remove hyperlink
|
|
61
61
|
if (hyperlinkEnable.value === false) {
|
|
62
|
-
|
|
62
|
+
pageBuilderService.handleHyperlink(hyperlinkEnable.value, data)
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
// add hyperlink
|
|
66
66
|
const handleHyperlink = function () {
|
|
67
|
-
|
|
67
|
+
pageBuilderService.handleHyperlink(
|
|
68
68
|
hyperlinkEnable.value,
|
|
69
69
|
urlInput.value,
|
|
70
70
|
openHyperlinkInNewTab.value,
|
|
@@ -74,7 +74,7 @@ const handleHyperlink = function () {
|
|
|
74
74
|
const handleToggleOpenHyperlinkInNewTab = async function () {
|
|
75
75
|
await nextTick()
|
|
76
76
|
|
|
77
|
-
|
|
77
|
+
pageBuilderService.handleHyperlink(
|
|
78
78
|
hyperlinkEnable.value,
|
|
79
79
|
urlInput.value,
|
|
80
80
|
openHyperlinkInNewTab.value,
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { ref, computed, watch } from 'vue'
|
|
3
3
|
import { sharedPageBuilderStore } from '../../../../stores/shared-store'
|
|
4
4
|
import EditorAccordion from '../EditorAccordion.vue'
|
|
5
|
-
import PageBuilderClass from '../../../../composables/PageBuilderClass.ts'
|
|
6
5
|
import tailwindOpacities from '../../../../utils/builder/tailwind-opacities'
|
|
7
6
|
import {
|
|
8
7
|
Listbox,
|
|
@@ -11,10 +10,11 @@ import {
|
|
|
11
10
|
ListboxOption,
|
|
12
11
|
ListboxOptions,
|
|
13
12
|
} from '@headlessui/vue'
|
|
13
|
+
import { getPageBuilder } from '../../../../composables/builderInstance'
|
|
14
|
+
const pageBuilderService = getPageBuilder()
|
|
14
15
|
|
|
15
16
|
// Use shared store instance
|
|
16
17
|
const pageBuilderStateStore = sharedPageBuilderStore
|
|
17
|
-
const pageBuilderClass = new PageBuilderClass(pageBuilderStateStore)
|
|
18
18
|
const opacityVueModel = ref(null)
|
|
19
19
|
const getBackgroundOpacity = computed(() => {
|
|
20
20
|
return pageBuilderStateStore.getBackgroundOpacity
|
|
@@ -24,7 +24,7 @@ watch(
|
|
|
24
24
|
getBackgroundOpacity,
|
|
25
25
|
async (newValue) => {
|
|
26
26
|
opacityVueModel.value = newValue
|
|
27
|
-
await
|
|
27
|
+
await pageBuilderService.initializeElementStyles()
|
|
28
28
|
},
|
|
29
29
|
{ immediate: true },
|
|
30
30
|
)
|
|
@@ -72,7 +72,7 @@ watch(
|
|
|
72
72
|
<ListboxOption
|
|
73
73
|
as="template"
|
|
74
74
|
v-for="backgroundOpacity in tailwindOpacities.backgroundOpacities"
|
|
75
|
-
@click="
|
|
75
|
+
@click="pageBuilderService.handleBackgroundOpacity(backgroundOpacity)"
|
|
76
76
|
:key="backgroundOpacity"
|
|
77
77
|
:value="backgroundOpacity"
|
|
78
78
|
v-slot="{ active }"
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { ref, computed, watch } from 'vue'
|
|
3
|
-
import PageBuilderClass from '../../../../composables/PageBuilderClass.ts'
|
|
4
3
|
import tailwindOpacities from '../../../../utils/builder/tailwind-opacities'
|
|
5
4
|
import {
|
|
6
5
|
Listbox,
|
|
@@ -10,10 +9,11 @@ import {
|
|
|
10
9
|
ListboxOptions,
|
|
11
10
|
} from '@headlessui/vue'
|
|
12
11
|
import { sharedPageBuilderStore } from '../../../../stores/shared-store'
|
|
12
|
+
import { getPageBuilder } from '../../../../composables/builderInstance'
|
|
13
|
+
const pageBuilderService = getPageBuilder()
|
|
13
14
|
|
|
14
15
|
// Use shared store instance
|
|
15
16
|
const pageBuilderStateStore = sharedPageBuilderStore
|
|
16
|
-
const pageBuilderClass = new PageBuilderClass(pageBuilderStateStore)
|
|
17
17
|
const opacityVueModel = ref(null)
|
|
18
18
|
const getOpacity = computed(() => {
|
|
19
19
|
return pageBuilderStateStore.getOpacity
|
|
@@ -23,7 +23,7 @@ watch(
|
|
|
23
23
|
getOpacity,
|
|
24
24
|
async (newValue) => {
|
|
25
25
|
opacityVueModel.value = newValue
|
|
26
|
-
await
|
|
26
|
+
await pageBuilderService.initializeElementStyles()
|
|
27
27
|
},
|
|
28
28
|
{ immediate: true },
|
|
29
29
|
)
|
|
@@ -71,7 +71,7 @@ watch(
|
|
|
71
71
|
<ListboxOption
|
|
72
72
|
as="template"
|
|
73
73
|
v-for="elementOpacity in tailwindOpacities.opacities"
|
|
74
|
-
@click="
|
|
74
|
+
@click="pageBuilderService.handleOpacity(elementOpacity)"
|
|
75
75
|
:key="elementOpacity"
|
|
76
76
|
:value="elementOpacity"
|
|
77
77
|
v-slot="{ active }"
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import { ref, computed, watch } from 'vue'
|
|
3
3
|
import { sharedPageBuilderStore } from '../../../../stores/shared-store'
|
|
4
4
|
import EditorAccordion from '../EditorAccordion.vue'
|
|
5
|
-
import PageBuilderClass from '../../../../composables/PageBuilderClass.ts'
|
|
6
5
|
import tailwindPaddingPlusMargin from '../../../../utils/builder/tailwind-padding-margin'
|
|
6
|
+
import { getPageBuilder } from '../../../../composables/builderInstance'
|
|
7
|
+
const pageBuilderService = getPageBuilder()
|
|
7
8
|
|
|
8
9
|
// Use shared store instance
|
|
9
10
|
const pageBuilderStateStore = sharedPageBuilderStore
|
|
10
11
|
|
|
11
|
-
const pageBuilderClass = new PageBuilderClass(pageBuilderStateStore)
|
|
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
|
async (newValue) => {
|
|
32
32
|
fontVerticalPadding.value = newValue
|
|
33
|
-
await
|
|
33
|
+
await pageBuilderService.initializeElementStyles()
|
|
34
34
|
},
|
|
35
35
|
{ immediate: true },
|
|
36
36
|
)
|
|
@@ -38,7 +38,7 @@ watch(
|
|
|
38
38
|
getFontHorizontalPadding,
|
|
39
39
|
async (newValue) => {
|
|
40
40
|
fontHorizontalPadding.value = newValue
|
|
41
|
-
await
|
|
41
|
+
await pageBuilderService.initializeElementStyles()
|
|
42
42
|
},
|
|
43
43
|
{ immediate: true },
|
|
44
44
|
)
|
|
@@ -46,7 +46,7 @@ watch(
|
|
|
46
46
|
getFontVerticalMargin,
|
|
47
47
|
async (newValue) => {
|
|
48
48
|
fontVerticalMargin.value = newValue
|
|
49
|
-
await
|
|
49
|
+
await pageBuilderService.initializeElementStyles()
|
|
50
50
|
},
|
|
51
51
|
{ immediate: true },
|
|
52
52
|
)
|
|
@@ -54,7 +54,7 @@ watch(
|
|
|
54
54
|
getFontHorizontalMargin,
|
|
55
55
|
async (newValue) => {
|
|
56
56
|
fontHorizontalMargin.value = newValue
|
|
57
|
-
await
|
|
57
|
+
await pageBuilderService.initializeElementStyles()
|
|
58
58
|
},
|
|
59
59
|
{ immediate: true },
|
|
60
60
|
)
|
|
@@ -68,7 +68,7 @@ watch(
|
|
|
68
68
|
<select
|
|
69
69
|
v-model="fontVerticalMargin"
|
|
70
70
|
class="pbx-myPrimarySelect"
|
|
71
|
-
@change="
|
|
71
|
+
@change="pageBuilderService.handleVerticalMargin(fontVerticalMargin)"
|
|
72
72
|
>
|
|
73
73
|
<option disabled value="">Select</option>
|
|
74
74
|
<option
|
|
@@ -85,7 +85,7 @@ watch(
|
|
|
85
85
|
<select
|
|
86
86
|
v-model="fontHorizontalMargin"
|
|
87
87
|
class="pbx-myPrimarySelect"
|
|
88
|
-
@change="
|
|
88
|
+
@change="pageBuilderService.handleHorizontalMargin(fontHorizontalMargin)"
|
|
89
89
|
>
|
|
90
90
|
<option disabled value="">Select</option>
|
|
91
91
|
<option
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import { ref, computed, watch } from 'vue'
|
|
3
3
|
import { sharedPageBuilderStore } from '../../../../stores/shared-store'
|
|
4
4
|
import EditorAccordion from '../EditorAccordion.vue'
|
|
5
|
-
import PageBuilderClass from '../../../../composables/PageBuilderClass.ts'
|
|
6
5
|
import tailwindPaddingPlusMargin from '../../../../utils/builder/tailwind-padding-margin'
|
|
6
|
+
import { getPageBuilder } from '../../../../composables/builderInstance'
|
|
7
|
+
const pageBuilderService = getPageBuilder()
|
|
7
8
|
|
|
8
9
|
// Use shared store instance
|
|
9
10
|
const pageBuilderStateStore = sharedPageBuilderStore
|
|
10
11
|
|
|
11
|
-
const pageBuilderClass = new PageBuilderClass(pageBuilderStateStore)
|
|
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
|
async (newValue) => {
|
|
32
32
|
fontVerticalPadding.value = newValue
|
|
33
|
-
await
|
|
33
|
+
await pageBuilderService.initializeElementStyles()
|
|
34
34
|
},
|
|
35
35
|
{ immediate: true },
|
|
36
36
|
)
|
|
@@ -38,7 +38,7 @@ watch(
|
|
|
38
38
|
getFontHorizontalPadding,
|
|
39
39
|
async (newValue) => {
|
|
40
40
|
fontHorizontalPadding.value = newValue
|
|
41
|
-
await
|
|
41
|
+
await pageBuilderService.initializeElementStyles()
|
|
42
42
|
},
|
|
43
43
|
{ immediate: true },
|
|
44
44
|
)
|
|
@@ -46,7 +46,7 @@ watch(
|
|
|
46
46
|
getFontVerticalMargin,
|
|
47
47
|
async (newValue) => {
|
|
48
48
|
fontVerticalMargin.value = newValue
|
|
49
|
-
await
|
|
49
|
+
await pageBuilderService.initializeElementStyles()
|
|
50
50
|
},
|
|
51
51
|
{ immediate: true },
|
|
52
52
|
)
|
|
@@ -54,7 +54,7 @@ watch(
|
|
|
54
54
|
getFontHorizontalMargin,
|
|
55
55
|
async (newValue) => {
|
|
56
56
|
fontHorizontalMargin.value = newValue
|
|
57
|
-
await
|
|
57
|
+
await pageBuilderService.initializeElementStyles()
|
|
58
58
|
},
|
|
59
59
|
{ immediate: true },
|
|
60
60
|
)
|
|
@@ -68,7 +68,7 @@ watch(
|
|
|
68
68
|
<select
|
|
69
69
|
v-model="fontVerticalPadding"
|
|
70
70
|
class="pbx-myPrimarySelect"
|
|
71
|
-
@change="
|
|
71
|
+
@change="pageBuilderService.handleVerticalPadding(fontVerticalPadding)"
|
|
72
72
|
>
|
|
73
73
|
<option disabled value="">Select</option>
|
|
74
74
|
<option
|
|
@@ -85,7 +85,7 @@ watch(
|
|
|
85
85
|
<select
|
|
86
86
|
v-model="fontHorizontalPadding"
|
|
87
87
|
class="pbx-myPrimarySelect"
|
|
88
|
-
@change="
|
|
88
|
+
@change="pageBuilderService.handleHorizontalPadding(fontHorizontalPadding)"
|
|
89
89
|
>
|
|
90
90
|
<option disabled value="">Select</option>
|
|
91
91
|
<option
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { ref, computed, watch } from 'vue'
|
|
3
3
|
import { Listbox, ListboxButton, ListboxOption, ListboxOptions } from '@headlessui/vue'
|
|
4
|
-
import PageBuilderClass from '../../../../composables/PageBuilderClass.ts'
|
|
5
4
|
import tailwindColors from '../../../../utils/builder/tailwaind-colors'
|
|
6
5
|
import { sharedPageBuilderStore } from '../../../../stores/shared-store'
|
|
6
|
+
import { getPageBuilder } from '../../../../composables/builderInstance'
|
|
7
|
+
const pageBuilderService = getPageBuilder()
|
|
7
8
|
|
|
8
9
|
// Use shared store instance
|
|
9
10
|
const pageBuilderStateStore = sharedPageBuilderStore
|
|
10
|
-
const pageBuilderClass = new PageBuilderClass(pageBuilderStateStore)
|
|
11
11
|
const textColor = ref(null)
|
|
12
12
|
const getTextColor = computed(() => {
|
|
13
13
|
return pageBuilderStateStore.getTextColor
|
|
@@ -17,7 +17,7 @@ watch(
|
|
|
17
17
|
getTextColor,
|
|
18
18
|
async (newValue) => {
|
|
19
19
|
textColor.value = newValue
|
|
20
|
-
await
|
|
20
|
+
await pageBuilderService.initializeElementStyles()
|
|
21
21
|
},
|
|
22
22
|
{ immediate: true },
|
|
23
23
|
)
|
|
@@ -51,7 +51,7 @@ watch(
|
|
|
51
51
|
<ListboxOption
|
|
52
52
|
as="template"
|
|
53
53
|
v-for="color in tailwindColors.textColorVariables"
|
|
54
|
-
@click="
|
|
54
|
+
@click="pageBuilderService.handleTextColor(textColor)"
|
|
55
55
|
:key="color"
|
|
56
56
|
:value="color"
|
|
57
57
|
v-slot="{ active, textColor }"
|