@myissue/vue-website-page-builder 3.3.56 → 3.3.58
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 +39 -2
- package/dist/home/page_builder_architecture.png +0 -0
- package/dist/vue-website-page-builder.css +1 -1
- package/dist/vue-website-page-builder.js +3651 -3453
- package/dist/vue-website-page-builder.umd.cjs +37 -37
- package/package.json +1 -1
- package/src/Components/PageBuilder/EditorMenu/Editables/BackgroundColorEditor.vue +22 -1
- package/src/Components/PageBuilder/EditorMenu/Editables/ClassEditor.vue +1 -3
- package/src/Components/PageBuilder/EditorMenu/Editables/TextColorEditor.vue +23 -1
- package/src/Components/PageBuilder/EditorMenu/RightSidebarEditor.vue +101 -20
- package/src/Components/PageBuilder/ToolbarOption/ToolbarOption.vue +1 -1
- package/src/DemoComponents/HomeSection.vue +9 -1
- package/src/PageBuilder/PageBuilder.vue +3 -3
- package/src/PageBuilder/Preview.vue +4 -6
- package/src/composables/PageBuilderService.ts +167 -147
- package/src/composables/extractCleanHTMLFromPageBuilder.ts +58 -0
- package/src/css/app.css +7 -0
- package/src/types/index.ts +8 -1
package/package.json
CHANGED
|
@@ -9,6 +9,12 @@ const pageBuilderService = getPageBuilder()
|
|
|
9
9
|
// Use shared store instance
|
|
10
10
|
const pageBuilderStateStore = sharedPageBuilderStore
|
|
11
11
|
|
|
12
|
+
defineProps({
|
|
13
|
+
globalPageLayout: {
|
|
14
|
+
Type: Boolean,
|
|
15
|
+
},
|
|
16
|
+
})
|
|
17
|
+
|
|
12
18
|
const backgroundColor = ref(null)
|
|
13
19
|
const getBackgroundColor = computed(() => {
|
|
14
20
|
return pageBuilderStateStore.getBackgroundColor
|
|
@@ -27,8 +33,23 @@ watch(
|
|
|
27
33
|
<template>
|
|
28
34
|
<Listbox as="div" v-model="backgroundColor">
|
|
29
35
|
<div class="pbx-relative">
|
|
30
|
-
<div
|
|
36
|
+
<div
|
|
37
|
+
:class="[
|
|
38
|
+
globalPageLayout
|
|
39
|
+
? 'pbx-flex pbx-flex-col pbx-border-solid pbx-border pbx-border-gray-400'
|
|
40
|
+
: 'pbx-flex pbx-gap-2 pbx-items-center',
|
|
41
|
+
]"
|
|
42
|
+
>
|
|
43
|
+
<ListboxButton
|
|
44
|
+
v-if="globalPageLayout"
|
|
45
|
+
class="pbx-flex pbx-flex-row pbx-justify-between pbx-items-center pbx-pl-3 pbx-pr-3 pbx-py-5 pbx-cursor-pointer pbx-duration-200 hover:pbx-bg-myPrimaryLightGrayColor"
|
|
46
|
+
>
|
|
47
|
+
<p class="pbx-myPrimaryParagraph pbx-font-medium pbx-my-0 pbx-py-0">Background Color</p>
|
|
48
|
+
<span v-if="globalPageLayout" class="material-symbols-outlined"> chevron_right </span>
|
|
49
|
+
</ListboxButton>
|
|
50
|
+
|
|
31
51
|
<ListboxButton
|
|
52
|
+
v-if="!globalPageLayout"
|
|
32
53
|
class="pbx-h-10 pbx-w-10 pbx-flex-end 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-gray-100 hover:pbx-fill-white pbx-bg-gray-300 focus-visible:pbx-ring-0"
|
|
33
54
|
>
|
|
34
55
|
<div class="pbx-flex pbx-flex-col">
|
|
@@ -52,9 +52,7 @@ const handleAddClasses = async () => {
|
|
|
52
52
|
<EditorAccordion>
|
|
53
53
|
<template #title>Generated CSS</template>
|
|
54
54
|
<template #content>
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
<label class="pbx-myPrimaryInputLabel">
|
|
55
|
+
<label class="pbx-myPrimaryInputLabel pbx-my-4">
|
|
58
56
|
This is the CSS applied by the builder. Add your own CSS and press Enter to apply it to the
|
|
59
57
|
selected element.
|
|
60
58
|
</label>
|
|
@@ -8,6 +8,13 @@ const pageBuilderService = getPageBuilder()
|
|
|
8
8
|
|
|
9
9
|
// Use shared store instance
|
|
10
10
|
const pageBuilderStateStore = sharedPageBuilderStore
|
|
11
|
+
|
|
12
|
+
defineProps({
|
|
13
|
+
globalPageLayout: {
|
|
14
|
+
Type: Boolean,
|
|
15
|
+
},
|
|
16
|
+
})
|
|
17
|
+
|
|
11
18
|
const textColor = ref(null)
|
|
12
19
|
const getTextColor = computed(() => {
|
|
13
20
|
return pageBuilderStateStore.getTextColor
|
|
@@ -26,8 +33,23 @@ watch(
|
|
|
26
33
|
<template>
|
|
27
34
|
<Listbox as="div" v-model="textColor">
|
|
28
35
|
<div class="pbx-relative">
|
|
29
|
-
<div
|
|
36
|
+
<div
|
|
37
|
+
:class="[
|
|
38
|
+
globalPageLayout
|
|
39
|
+
? 'pbx-flex pbx-flex-col pbx-border-solid pbx-border pbx-border-gray-400'
|
|
40
|
+
: 'pbx-flex pbx-gap-2 pbx-items-center',
|
|
41
|
+
]"
|
|
42
|
+
>
|
|
43
|
+
<ListboxButton
|
|
44
|
+
v-if="globalPageLayout"
|
|
45
|
+
class="pbx-flex pbx-flex-row pbx-justify-between pbx-items-center pbx-pl-3 pbx-pr-3 pbx-py-5 pbx-cursor-pointer pbx-duration-200 hover:pbx-bg-myPrimaryLightGrayColor"
|
|
46
|
+
>
|
|
47
|
+
<p class="pbx-myPrimaryParagraph pbx-font-medium pbx-my-0 pbx-py-0">Text Color</p>
|
|
48
|
+
<span v-if="globalPageLayout" class="material-symbols-outlined"> chevron_right </span>
|
|
49
|
+
</ListboxButton>
|
|
50
|
+
|
|
30
51
|
<ListboxButton
|
|
52
|
+
v-if="!globalPageLayout"
|
|
31
53
|
class="pbx-h-10 pbx-w-10 pbx-flex-end 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-gray-100 hover:pbx-fill-white pbx-bg-gray-300 focus-visible:pbx-ring-0"
|
|
32
54
|
>
|
|
33
55
|
<div class="pbx-flex pbx-flex-col">
|
|
@@ -9,6 +9,7 @@ import Padding from './Editables/Padding.vue'
|
|
|
9
9
|
import Margin from './Editables/Margin.vue'
|
|
10
10
|
import BorderRadius from './Editables/BorderRadius.vue'
|
|
11
11
|
import BackgroundColorEditor from './Editables/BackgroundColorEditor.vue'
|
|
12
|
+
import TextColorEditor from './Editables/TextColorEditor.vue'
|
|
12
13
|
import Borders from './Editables/Borders.vue'
|
|
13
14
|
import LinkEditor from './Editables/LinkEditor.vue'
|
|
14
15
|
import TipTap from '../../TipTap/TipTap.vue'
|
|
@@ -17,6 +18,9 @@ import ElementEditor from './Editables/ElementEditor.vue'
|
|
|
17
18
|
import { getPageBuilder } from '../../../composables/builderInstance'
|
|
18
19
|
import EditorAccordion from '../EditorMenu/EditorAccordion.vue'
|
|
19
20
|
import fullHTMLContent from '../../../utils/builder/html-doc-declaration-with-components'
|
|
21
|
+
import ModalBuilder from '../../../Components/Modals/ModalBuilder.vue'
|
|
22
|
+
import { extractCleanHTMLFromPageBuilder } from '../../../composables/extractCleanHTMLFromPageBuilder'
|
|
23
|
+
|
|
20
24
|
const pageBuilderService = getPageBuilder()
|
|
21
25
|
// Use shared store instance
|
|
22
26
|
const pageBuilderStateStore = sharedPageBuilderStore
|
|
@@ -24,7 +28,9 @@ const pageBuilderStateStore = sharedPageBuilderStore
|
|
|
24
28
|
// emit
|
|
25
29
|
const emit = defineEmits(['closeEditor'])
|
|
26
30
|
|
|
27
|
-
|
|
31
|
+
const getComponents = computed(() => {
|
|
32
|
+
return pageBuilderStateStore.getComponents
|
|
33
|
+
})
|
|
28
34
|
const getElement = computed(() => {
|
|
29
35
|
return pageBuilderStateStore.getElement
|
|
30
36
|
})
|
|
@@ -82,18 +88,30 @@ const generateHTML = function (filename, HTML) {
|
|
|
82
88
|
document.body.removeChild(element)
|
|
83
89
|
}
|
|
84
90
|
|
|
85
|
-
const getComponents = computed(() => {
|
|
86
|
-
return pageBuilderStateStore.getComponents
|
|
87
|
-
})
|
|
88
|
-
|
|
89
|
-
const downloadedComponents = ref(null)
|
|
90
|
-
// handle download HTML
|
|
91
91
|
const handleDownloadHTML = function () {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
const pagebuilder = document.getElementById('pagebuilder')
|
|
93
|
+
if (!pagebuilder) {
|
|
94
|
+
return
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const html = extractCleanHTMLFromPageBuilder(pagebuilder)
|
|
98
|
+
|
|
99
|
+
generateHTML('downloaded_html.html', html)
|
|
100
|
+
}
|
|
101
|
+
const showModalGlobalPageStyles = ref(null)
|
|
95
102
|
|
|
96
|
-
|
|
103
|
+
const handleUpdatePageStyles = async function () {
|
|
104
|
+
showModalGlobalPageStyles.value = true
|
|
105
|
+
|
|
106
|
+
await pageBuilderService.globalPageStyles()
|
|
107
|
+
}
|
|
108
|
+
const handleCloseGlobalPageStyles = async function () {
|
|
109
|
+
// Remove global highlight if present
|
|
110
|
+
const pagebuilder = document.querySelector('#pagebuilder')
|
|
111
|
+
if (pagebuilder) {
|
|
112
|
+
pagebuilder.removeAttribute('data-global-selected')
|
|
113
|
+
}
|
|
114
|
+
showModalGlobalPageStyles.value = false
|
|
97
115
|
}
|
|
98
116
|
</script>
|
|
99
117
|
|
|
@@ -152,26 +170,89 @@ const handleDownloadHTML = function () {
|
|
|
152
170
|
</article>
|
|
153
171
|
</div>
|
|
154
172
|
|
|
155
|
-
|
|
173
|
+
<!-- Global Page Styles -->
|
|
174
|
+
<article
|
|
175
|
+
v-if="Array.isArray(getComponents) && getComponents.length >= 1"
|
|
176
|
+
class="pbx-my-1 pbx-bg-white"
|
|
177
|
+
>
|
|
156
178
|
<EditorAccordion>
|
|
157
|
-
<template #title>
|
|
179
|
+
<template #title>Global Page Styles</template>
|
|
158
180
|
<template #content>
|
|
159
|
-
<
|
|
160
|
-
|
|
161
|
-
|
|
181
|
+
<label class="pbx-myPrimaryInputLabel pbx-my-4">
|
|
182
|
+
Apply styles that affect the entire page. These settings include global font family,
|
|
183
|
+
text color, background color, and other universal styles that apply to all sections.
|
|
184
|
+
</label>
|
|
162
185
|
|
|
186
|
+
<div class="pbx-mt-4">
|
|
187
|
+
<button @click="handleUpdatePageStyles" type="button" class="pbx-myPrimaryButton">
|
|
188
|
+
Update Page Styles
|
|
189
|
+
</button>
|
|
190
|
+
</div>
|
|
191
|
+
</template>
|
|
192
|
+
</EditorAccordion>
|
|
193
|
+
</article>
|
|
194
|
+
<!-- Global Page Styles -->
|
|
195
|
+
|
|
196
|
+
<!-- Download Layout HTML -->
|
|
197
|
+
<article
|
|
198
|
+
v-if="Array.isArray(getComponents) && getComponents.length >= 1"
|
|
199
|
+
class="pbx-my-1 pbx-bg-white"
|
|
200
|
+
>
|
|
201
|
+
<EditorAccordion>
|
|
202
|
+
<template #title>Download HTML</template>
|
|
203
|
+
<template #content>
|
|
204
|
+
<label class="pbx-myPrimaryInputLabel pbx-my-4">
|
|
205
|
+
Export the entire page as a standalone HTML file. This includes all sections, content,
|
|
206
|
+
and applied styles, making it ready for use or integration elsewhere.
|
|
207
|
+
</label>
|
|
163
208
|
<div class="pbx-mt-4">
|
|
164
209
|
<button @click="handleDownloadHTML" type="button" class="pbx-myPrimaryButton">
|
|
165
210
|
Download HTML file
|
|
166
211
|
</button>
|
|
167
212
|
</div>
|
|
168
213
|
</template>
|
|
169
|
-
|
|
170
|
-
<!-- Download Layout HTML - end -->
|
|
171
214
|
</EditorAccordion>
|
|
215
|
+
<!-- Download Layout HTML -->
|
|
172
216
|
</article>
|
|
173
|
-
|
|
174
|
-
<article class="pbx-mt-1 pbx-bg-white"></article>
|
|
175
217
|
</div>
|
|
218
|
+
|
|
219
|
+
<ModalBuilder
|
|
220
|
+
maxWidth="md"
|
|
221
|
+
minHeight="pbx-h-[90vh]"
|
|
222
|
+
:showModalBuilder="showModalGlobalPageStyles"
|
|
223
|
+
title="Global Page Styles"
|
|
224
|
+
@closeMainModalBuilder="handleCloseGlobalPageStyles"
|
|
225
|
+
>
|
|
226
|
+
<div class="pbx-min-h-[90vh] pbx-flex pbx-flex-col pbx-gap-2 pbx-pt-4 pbx-pb-2">
|
|
227
|
+
<p class="pbx-myPrimaryParagraph">
|
|
228
|
+
Apply styles that affect the entire page. These settings include global font family, text
|
|
229
|
+
color, background color, and other universal styles that apply to all sections.
|
|
230
|
+
</p>
|
|
231
|
+
<article class="pbx-my-1 pbx-bg-gray-100">
|
|
232
|
+
<Typography></Typography>
|
|
233
|
+
</article>
|
|
234
|
+
<article class="pbx-my-1 pbx-bg-gray-100">
|
|
235
|
+
<TextColorEditor :globalPageLayout="true"></TextColorEditor>
|
|
236
|
+
</article>
|
|
237
|
+
<article class="pbx-my-1 pbx-bg-gray-100">
|
|
238
|
+
<BackgroundColorEditor :globalPageLayout="true"></BackgroundColorEditor>
|
|
239
|
+
</article>
|
|
240
|
+
<article class="pbx-my-1 pbx-bg-gray-100">
|
|
241
|
+
<Padding> </Padding>
|
|
242
|
+
</article>
|
|
243
|
+
<article class="pbx-my-1 pbx-bg-gray-100">
|
|
244
|
+
<Margin> </Margin>
|
|
245
|
+
</article>
|
|
246
|
+
<article class="pbx-my-1 pbx-bg-gray-100">
|
|
247
|
+
<BorderRadius></BorderRadius>
|
|
248
|
+
</article>
|
|
249
|
+
<article class="pbx-my-1 pbx-bg-gray-100">
|
|
250
|
+
<Borders></Borders>
|
|
251
|
+
</article>
|
|
252
|
+
<article class="pbx-my-1 pbx-bg-gray-100">
|
|
253
|
+
<ClassEditor></ClassEditor>
|
|
254
|
+
</article>
|
|
255
|
+
</div>
|
|
256
|
+
</ModalBuilder>
|
|
176
257
|
</div>
|
|
177
258
|
</template>
|
|
@@ -9,7 +9,7 @@ import { preloadImage } from '../../../composables/preloadImage'
|
|
|
9
9
|
import DynamicModalBuilder from '../../Modals/DynamicModalBuilder.vue'
|
|
10
10
|
|
|
11
11
|
import { getPageBuilder } from '../../../composables/builderInstance'
|
|
12
|
-
import { delay } from '
|
|
12
|
+
import { delay } from '../../../composables/delay'
|
|
13
13
|
const pageBuilderService = getPageBuilder()
|
|
14
14
|
|
|
15
15
|
// Use shared store instance
|
|
@@ -61,7 +61,7 @@ const configPageBuilder = {
|
|
|
61
61
|
image: '/jane_doe.jpg',
|
|
62
62
|
},
|
|
63
63
|
updateOrCreate: {
|
|
64
|
-
formType: '
|
|
64
|
+
formType: 'create',
|
|
65
65
|
formName: 'collection',
|
|
66
66
|
},
|
|
67
67
|
pageBuilderLogo: {
|
|
@@ -79,6 +79,14 @@ const configPageBuilder = {
|
|
|
79
79
|
settings: {
|
|
80
80
|
brandColor: '#DB93B0',
|
|
81
81
|
},
|
|
82
|
+
// pageSettings: {
|
|
83
|
+
// classes:
|
|
84
|
+
// 'pbx-font-didot pbx-italic pbx-px-20 pbx-rounded-full pbx-rounded-tr-full pbx-border-8 pbx-border-green-800 pbx-border-solid pbx-text-neutral-300 pbx-bg-stone-700',
|
|
85
|
+
// style: {
|
|
86
|
+
// backgroundColor: 'red',
|
|
87
|
+
// border: '6px solid yellow',
|
|
88
|
+
// },
|
|
89
|
+
// },
|
|
82
90
|
} as const
|
|
83
91
|
|
|
84
92
|
onMounted(async () => {
|
|
@@ -232,7 +232,7 @@ const handlerRumeEditingForUpdate = async function () {
|
|
|
232
232
|
secondModalButtonResumeEditingFunction.value = function () {}
|
|
233
233
|
|
|
234
234
|
thirdModalButtonResumeEditingFunction.value = async function () {
|
|
235
|
-
await pageBuilderService.
|
|
235
|
+
await pageBuilderService.resumeEditingFromDraft()
|
|
236
236
|
pageBuilderStateStore.setHasLocalDraftForUpdate(false)
|
|
237
237
|
|
|
238
238
|
showModalResumeEditing.value = false
|
|
@@ -330,7 +330,7 @@ function updatePanelPosition() {
|
|
|
330
330
|
}
|
|
331
331
|
|
|
332
332
|
onMounted(async () => {
|
|
333
|
-
await pageBuilderService.
|
|
333
|
+
await pageBuilderService.completeBuilderInitialization()
|
|
334
334
|
|
|
335
335
|
updatePanelPosition()
|
|
336
336
|
|
|
@@ -755,7 +755,7 @@ onMounted(async () => {
|
|
|
755
755
|
id="contains-pagebuilder"
|
|
756
756
|
class="pbx-pl-4 pbx-pr-4 pbx-pb-4 pbx-pt-1 pbx-h-full pbx-overflow-y-auto"
|
|
757
757
|
>
|
|
758
|
-
<div id="pagebuilder" class="pbx-text-black">
|
|
758
|
+
<div id="pagebuilder" class="pbx-text-black pbx-font-sans">
|
|
759
759
|
<div ref="draggableZone">
|
|
760
760
|
<!-- Added Components to DOM # start -->
|
|
761
761
|
<div
|
|
@@ -13,14 +13,12 @@ const previewData = localStorage.getItem('preview')
|
|
|
13
13
|
|
|
14
14
|
if (previewData) {
|
|
15
15
|
try {
|
|
16
|
-
const
|
|
17
|
-
htmlPage.value = Array.isArray(
|
|
18
|
-
} catch (
|
|
19
|
-
console.error('
|
|
16
|
+
const parsed = JSON.parse(previewData)
|
|
17
|
+
htmlPage.value = Array.isArray(parsed) ? parsed.join('') : ''
|
|
18
|
+
} catch (err) {
|
|
19
|
+
console.error('Invalid preview data:', err)
|
|
20
20
|
htmlPage.value = ''
|
|
21
21
|
}
|
|
22
|
-
} else {
|
|
23
|
-
htmlPage.value = ''
|
|
24
22
|
}
|
|
25
23
|
</script>
|
|
26
24
|
|