@myissue/vue-website-page-builder 3.2.91 → 3.2.92
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 +5191 -5273
- 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 +4 -5
- package/src/DemoComponents/HomeSection.vue +9 -30
- package/src/PageBuilder/PageBuilder.vue +194 -96
- package/src/composables/{PageBuilderClass.ts → PageBuilderService.ts} +258 -97
- 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 +32 -2
- package/src/types/index.ts +99 -9
- package/src/helpers/passedPageBuilderConfig.ts +0 -71
|
@@ -6,18 +6,20 @@ import PageBuilderSettings from '../Settings/PageBuilderSettings.vue'
|
|
|
6
6
|
import AdvancedPageBuilderSettings from '../Settings/AdvancedPageBuilderSettings.vue'
|
|
7
7
|
import { preloadImage } from '../../../composables/preloadImage'
|
|
8
8
|
|
|
9
|
-
import PageBuilderClass from '../../../composables/PageBuilderClass'
|
|
10
9
|
import DynamicModalBuilder from '../../Modals/DynamicModalBuilder.vue'
|
|
11
10
|
|
|
11
|
+
import { getPageBuilder } from '../../../composables/builderInstance'
|
|
12
|
+
import { delay } from '@/composables/delay'
|
|
13
|
+
const pageBuilderService = getPageBuilder()
|
|
14
|
+
|
|
12
15
|
// Use shared store instance
|
|
13
16
|
const pageBuilderStateStore = sharedPageBuilderStore
|
|
14
17
|
|
|
15
|
-
const
|
|
16
|
-
return pageBuilderStateStore.
|
|
18
|
+
const getPageBuilderConfig = computed(() => {
|
|
19
|
+
return pageBuilderStateStore.getPageBuilderConfig
|
|
17
20
|
})
|
|
18
21
|
|
|
19
|
-
const
|
|
20
|
-
|
|
22
|
+
const isDeletingLayout = ref(false)
|
|
21
23
|
const showModalDeleteAllComponents = ref(false)
|
|
22
24
|
//
|
|
23
25
|
// use dynamic model
|
|
@@ -50,24 +52,14 @@ const deleteAllComponents = function () {
|
|
|
50
52
|
//
|
|
51
53
|
// handle click
|
|
52
54
|
thirdModalButtonFunctionDynamicModalBuilder.value = async function () {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
getConfigPageBuilder.value.updateOrCreate &&
|
|
58
|
-
typeof getConfigPageBuilder.value.updateOrCreate.formType === 'string'
|
|
59
|
-
) {
|
|
60
|
-
if (getConfigPageBuilder.value.updateOrCreate.formType === 'create') {
|
|
61
|
-
await pageBuilderClass.removeItemComponentsLocalStorage()
|
|
62
|
-
}
|
|
63
|
-
if (getConfigPageBuilder.value.updateOrCreate.formType === 'update') {
|
|
64
|
-
await pageBuilderClass.removeItemComponentsLocalStorage()
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// if(getConfigPageBuilder.updateOrCreate && getConfigPageBuilder.updateOrCreate){}
|
|
55
|
+
isDeletingLayout.value = true
|
|
56
|
+
pageBuilderService.deleteAllComponents()
|
|
57
|
+
await pageBuilderService.clearHtmlSelection()
|
|
58
|
+
await pageBuilderService.removeItemComponentsLocalStorage()
|
|
69
59
|
|
|
60
|
+
await delay(500)
|
|
70
61
|
showModalDeleteAllComponents.value = false
|
|
62
|
+
isDeletingLayout.value = false
|
|
71
63
|
}
|
|
72
64
|
// end modal
|
|
73
65
|
}
|
|
@@ -106,24 +98,24 @@ const openHTMLSettings = function () {
|
|
|
106
98
|
<div
|
|
107
99
|
class="pbx-flex pbx-items-center pbx-myPrimaryTag pbx-py-0"
|
|
108
100
|
v-if="
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
(!
|
|
113
|
-
(typeof
|
|
114
|
-
|
|
101
|
+
getPageBuilderConfig &&
|
|
102
|
+
getPageBuilderConfig.userForPageBuilder &&
|
|
103
|
+
getPageBuilderConfig.userForPageBuilder.name &&
|
|
104
|
+
(!getPageBuilderConfig.userForPageBuilder.image ||
|
|
105
|
+
(typeof getPageBuilderConfig.userForPageBuilder.image === 'string' &&
|
|
106
|
+
getPageBuilderConfig.userForPageBuilder.image?.length < 2))
|
|
115
107
|
"
|
|
116
108
|
>
|
|
117
109
|
<div
|
|
118
110
|
class="pbx-text-white pbx-rounded-full pbx-bg-myPrimaryBrandColor pbx-flex pbx-justify-center pbx-items-center pbx-text-xs pbx-h-8 pbx-min-h-8 pbx-max-h-8 pbx-w-8 pbx-min-w-8 pbx-max-w-8 pbx-font-normal"
|
|
119
111
|
>
|
|
120
112
|
{{
|
|
121
|
-
typeof
|
|
122
|
-
|
|
113
|
+
typeof getPageBuilderConfig.userForPageBuilder.name === 'string' &&
|
|
114
|
+
getPageBuilderConfig.userForPageBuilder.name[0]
|
|
123
115
|
}}
|
|
124
116
|
</div>
|
|
125
117
|
<div class="pbx-hidden pbx-text-xs pbx-h-8 lg:pbx-flex pbx-items-center pbx-font-normal">
|
|
126
|
-
{{
|
|
118
|
+
{{ getPageBuilderConfig.userForPageBuilder.name }}
|
|
127
119
|
</div>
|
|
128
120
|
</div>
|
|
129
121
|
|
|
@@ -133,12 +125,12 @@ const openHTMLSettings = function () {
|
|
|
133
125
|
<div
|
|
134
126
|
class="pbx-flex pbx-items-center lg:pbx-myPrimaryTag pbx-py-0 pbx-gap-4 pbx-w-max"
|
|
135
127
|
v-if="
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
typeof
|
|
141
|
-
|
|
128
|
+
getPageBuilderConfig &&
|
|
129
|
+
getPageBuilderConfig.userForPageBuilder &&
|
|
130
|
+
getPageBuilderConfig.userForPageBuilder.name &&
|
|
131
|
+
getPageBuilderConfig.userForPageBuilder.image &&
|
|
132
|
+
typeof getPageBuilderConfig.userForPageBuilder.image === 'string' &&
|
|
133
|
+
getPageBuilderConfig.userForPageBuilder.image.length > 2
|
|
142
134
|
"
|
|
143
135
|
>
|
|
144
136
|
<div
|
|
@@ -146,12 +138,12 @@ const openHTMLSettings = function () {
|
|
|
146
138
|
>
|
|
147
139
|
<img
|
|
148
140
|
alt="avatar"
|
|
149
|
-
:src="`${
|
|
141
|
+
:src="`${getPageBuilderConfig.userForPageBuilder.image}`"
|
|
150
142
|
class="pbx-block pbx-inset-0 pbx-object-top pbx-h-8 pbx-min-h-8 pbx-max-h-8 pbx-w-8 pbx-min-w-8 pbx-max-w-8 pbx-object-cover pbx-rounded-full"
|
|
151
143
|
/>
|
|
152
144
|
</div>
|
|
153
145
|
<div class="pbx-hidden pbx-text-xs pbx-h-8 lg:pbx-flex pbx-items-center pbx-font-normal">
|
|
154
|
-
{{
|
|
146
|
+
{{ getPageBuilderConfig.userForPageBuilder.name }}
|
|
155
147
|
</div>
|
|
156
148
|
</div>
|
|
157
149
|
|
|
@@ -173,7 +165,7 @@ const openHTMLSettings = function () {
|
|
|
173
165
|
<button
|
|
174
166
|
@click="
|
|
175
167
|
() => {
|
|
176
|
-
|
|
168
|
+
pageBuilderService.clearHtmlSelection()
|
|
177
169
|
openMainSettings()
|
|
178
170
|
}
|
|
179
171
|
"
|
|
@@ -198,7 +190,7 @@ const openHTMLSettings = function () {
|
|
|
198
190
|
<button
|
|
199
191
|
@click="
|
|
200
192
|
() => {
|
|
201
|
-
|
|
193
|
+
pageBuilderService.clearHtmlSelection()
|
|
202
194
|
deleteAllComponents()
|
|
203
195
|
}
|
|
204
196
|
"
|
|
@@ -242,6 +234,7 @@ const openHTMLSettings = function () {
|
|
|
242
234
|
:gridColumnAmount="gridColumnModal"
|
|
243
235
|
:title="titleModal"
|
|
244
236
|
:description="descriptionModal"
|
|
237
|
+
:isLoading="isDeletingLayout"
|
|
245
238
|
:firstButtonText="firstButtonModal"
|
|
246
239
|
:secondButtonText="secondButtonModal"
|
|
247
240
|
:thirdButtonText="thirdButtonModal"
|
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
// Use shared store instance
|
|
6
|
-
const pageBuilderStateStore = sharedPageBuilderStore
|
|
7
|
-
|
|
8
|
-
const pageBuilderClass = new PageBuilderClass(pageBuilderStateStore)
|
|
2
|
+
import { getPageBuilder } from '../../composables/builderInstance'
|
|
3
|
+
const pageBuilderService = getPageBuilder()
|
|
9
4
|
</script>
|
|
10
5
|
|
|
11
6
|
<template>
|
|
12
7
|
<div>
|
|
13
8
|
<div class="pbx-blockease-linear pbx-duration-200 pbx-block pbx-ease-linear">
|
|
14
|
-
<template v-if="
|
|
9
|
+
<template v-if="pageBuilderService.isSelectedElementValidText()">
|
|
15
10
|
<div class="pbx-flex pbx-items-center pbx-justify-center pbx-mb-6">
|
|
16
11
|
<div class="pbx-px-2 pbx-flex pbx-items-center pbx-justify-start pbx-gap-2 pbx-w-max">
|
|
17
12
|
<button
|
|
18
|
-
@click="
|
|
13
|
+
@click="pageBuilderService.toggleTipTapModal(true)"
|
|
19
14
|
type="button"
|
|
20
15
|
class="pbx-myPrimaryTag"
|
|
21
16
|
>
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
import { useEditor, EditorContent } from '@tiptap/vue-3'
|
|
3
3
|
import StarterKit from '@tiptap/starter-kit'
|
|
4
4
|
import { computed, onBeforeMount, onMounted, ref, watch } from 'vue'
|
|
5
|
-
import PageBuilderClass from '../../composables/PageBuilderClass.ts'
|
|
6
5
|
import Link from '@tiptap/extension-link'
|
|
7
6
|
import DynamicModalBuilder from '../Modals/DynamicModalBuilder.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
|
|
@@ -25,8 +26,6 @@ const firstModalButtonFunctionDynamicModalBuilder = ref(null)
|
|
|
25
26
|
const secondModalButtonFunctionDynamicModalBuilder = ref(null)
|
|
26
27
|
const thirdModalButtonFunctionDynamicModalBuilder = ref(null)
|
|
27
28
|
|
|
28
|
-
const pageBuilderClass = new PageBuilderClass(pageBuilderStateStore)
|
|
29
|
-
|
|
30
29
|
const getElement = computed(() => {
|
|
31
30
|
return pageBuilderStateStore.getElement
|
|
32
31
|
})
|
|
@@ -36,6 +35,7 @@ const textContent = computed(() => {
|
|
|
36
35
|
if (editor.value) {
|
|
37
36
|
return editor.value.getHTML()
|
|
38
37
|
}
|
|
38
|
+
return null
|
|
39
39
|
})
|
|
40
40
|
|
|
41
41
|
const getElementtextContentLength = ref(0)
|
|
@@ -69,19 +69,19 @@ const editor = useEditor({
|
|
|
69
69
|
|
|
70
70
|
// watch for changes in textContent and update store and textContentVueModel
|
|
71
71
|
watch(textContent, async (newValue) => {
|
|
72
|
-
if (!
|
|
72
|
+
if (!pageBuilderService.isSelectedElementValidText()) return
|
|
73
73
|
|
|
74
74
|
if (getElement.value) {
|
|
75
75
|
pageBuilderStateStore.setTextAreaVueModel(newValue)
|
|
76
76
|
|
|
77
77
|
if (typeof newValue === 'string' && newValue !== textContentVueModel.value) {
|
|
78
|
-
await
|
|
78
|
+
await pageBuilderService.handleTextInput(newValue)
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
})
|
|
82
82
|
|
|
83
83
|
const TipTapSetContent = function () {
|
|
84
|
-
if (!
|
|
84
|
+
if (!pageBuilderService.isSelectedElementValidText()) return
|
|
85
85
|
|
|
86
86
|
if (editor.value) {
|
|
87
87
|
editor.value.commands.setContent(getElement.value.innerHTML)
|
|
@@ -216,7 +216,7 @@ onMounted(() => {
|
|
|
216
216
|
</DynamicModalBuilder>
|
|
217
217
|
|
|
218
218
|
<div class="pbx-blockease-linear pbx-duration-200 pbx-block pbx-ease-linear">
|
|
219
|
-
<div v-if="
|
|
219
|
+
<div v-if="pageBuilderService.isSelectedElementValidText() && editor">
|
|
220
220
|
<div class="pbx-relative pbx-rounded-lg">
|
|
221
221
|
<div
|
|
222
222
|
class="pbx-flex pbx-justify-between pbx-myPrimaryGap pbx-items-center pbx-py-4 pbx-px-4 pbx-overflow-x-auto pbx-border-b pbx-border-gray-200"
|
|
@@ -227,7 +227,7 @@ onMounted(() => {
|
|
|
227
227
|
class="pbx-px-2 pbx-flex pbx-items-center pbx-justify-start pbx-gap-2 pbx-w-max pbx-p-1 pbx-rounded-full pbx-border pbx-border-gray-200 pbx-shadow-sm"
|
|
228
228
|
>
|
|
229
229
|
<button
|
|
230
|
-
@click="
|
|
230
|
+
@click="pageBuilderService.toggleTipTapModal(false)"
|
|
231
231
|
type="button"
|
|
232
232
|
class="pbx-myPrimaryTag"
|
|
233
233
|
>
|
|
@@ -4,15 +4,14 @@ const unsplashKey = import.meta.env.VITE_UNSPLASH_KEY
|
|
|
4
4
|
import { usePageBuilderModal } from '../composables/usePageBuilderModal'
|
|
5
5
|
import { delay } from '../composables/delay'
|
|
6
6
|
import { preloadImage } from '../composables/preloadImage'
|
|
7
|
-
import PageBuilderClass from '../composables/PageBuilderClass.ts'
|
|
8
7
|
import { sharedPageBuilderStore } from '../stores/shared-store'
|
|
8
|
+
import { getPageBuilder } from '../composables/builderInstance'
|
|
9
|
+
const pageBuilderService = getPageBuilder()
|
|
9
10
|
|
|
10
11
|
const { closeMediaLibraryModal } = usePageBuilderModal()
|
|
11
12
|
|
|
12
13
|
const pageBuilderStateStore = sharedPageBuilderStore
|
|
13
14
|
|
|
14
|
-
const pageBuilderClass = new PageBuilderClass(pageBuilderStateStore)
|
|
15
|
-
|
|
16
15
|
const getIsLoading = ref(false)
|
|
17
16
|
const getIsLoadingImage = ref(false)
|
|
18
17
|
const getSearchTerm = ref('')
|
|
@@ -105,7 +104,7 @@ const applySelectedImage = async function (imageURL) {
|
|
|
105
104
|
src: `${imageURL}`,
|
|
106
105
|
})
|
|
107
106
|
|
|
108
|
-
await
|
|
107
|
+
await pageBuilderService.updateBasePrimaryImage()
|
|
109
108
|
|
|
110
109
|
closeMediaLibraryModal()
|
|
111
110
|
}
|
|
@@ -252,7 +251,7 @@ onMounted(async () => {
|
|
|
252
251
|
}}
|
|
253
252
|
</button>
|
|
254
253
|
|
|
255
|
-
<span class="pbx-myPrimaryTag py-2.5 pbx-px-4">
|
|
254
|
+
<span class="pbx-myPrimaryTag pbx-py-2.5 pbx-px-4">
|
|
256
255
|
{{ Number(getCurrentPageNumber) }}
|
|
257
256
|
</span>
|
|
258
257
|
<button
|
|
@@ -1,26 +1,16 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import FullWidthElement from '../Components/Layouts/FullWidthElement.vue'
|
|
3
3
|
import PageBuilder from '../PageBuilder/PageBuilder.vue'
|
|
4
|
-
import PageBuilderClass from '../composables/PageBuilderClass.ts'
|
|
5
4
|
|
|
6
5
|
import DemoMediaLibraryComponent from './DemoMediaLibraryComponent.vue'
|
|
7
6
|
import DemoBuilderComponents from './DemoBuilderComponents.vue'
|
|
8
|
-
import {
|
|
9
|
-
import { sharedPageBuilderStore } from '../stores/shared-store'
|
|
7
|
+
import { onMounted } from 'vue'
|
|
10
8
|
import oldhtmlfromdb from './oldhtmlfromdb.json'
|
|
11
9
|
import html from './html.json'
|
|
12
10
|
import { rawHTML } from './rawHTML'
|
|
13
11
|
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
const getLocalStorageItemName = computed(() => {
|
|
18
|
-
return pageBuilderStateStore.getLocalStorageItemName
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
const getComponents = computed(() => {
|
|
22
|
-
return pageBuilderStateStore.getComponents
|
|
23
|
-
})
|
|
12
|
+
import { getPageBuilder } from '../composables/builderInstance'
|
|
13
|
+
const pageBuilderService = getPageBuilder()
|
|
24
14
|
|
|
25
15
|
const features = [
|
|
26
16
|
{
|
|
@@ -71,8 +61,8 @@ const configPageBuilder = {
|
|
|
71
61
|
image: '/jane_doe.jpg',
|
|
72
62
|
},
|
|
73
63
|
updateOrCreate: {
|
|
74
|
-
formType: 'create'
|
|
75
|
-
formName: '
|
|
64
|
+
formType: 'create',
|
|
65
|
+
formName: 'collection',
|
|
76
66
|
},
|
|
77
67
|
pageBuilderLogo: {
|
|
78
68
|
src: '/logo/logo.svg',
|
|
@@ -82,29 +72,18 @@ const configPageBuilder = {
|
|
|
82
72
|
id: 1,
|
|
83
73
|
},
|
|
84
74
|
userSettings: {
|
|
85
|
-
theme: 'light'
|
|
75
|
+
theme: 'light',
|
|
86
76
|
language: 'en',
|
|
87
77
|
autoSave: true,
|
|
88
78
|
},
|
|
89
79
|
settings: {
|
|
90
80
|
brandColor: '#DB93B0',
|
|
91
81
|
},
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
pageBuilderClass.applyPageBuilderConfig(configPageBuilder)
|
|
82
|
+
} as const
|
|
95
83
|
|
|
96
84
|
onMounted(async () => {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
if (value) {
|
|
101
|
-
pageBuilderClass.mountComponentsToDOM(JSON.stringify(value))
|
|
102
|
-
} else {
|
|
103
|
-
pageBuilderClass.mountComponentsToDOM(JSON.stringify(html), true)
|
|
104
|
-
// pageBuilderClass.mountComponentsToDOM(rawHTML, true)
|
|
105
|
-
// pageBuilderClass.mountComponentsToDOM(JSON.stringify(oldhtmlfromdb), true)
|
|
106
|
-
}
|
|
107
|
-
}
|
|
85
|
+
await pageBuilderService.startBuilder(configPageBuilder)
|
|
86
|
+
pageBuilderService.mountComponentsToDOM(JSON.stringify(html))
|
|
108
87
|
})
|
|
109
88
|
</script>
|
|
110
89
|
|