@myissue/vue-website-page-builder 3.3.55 → 3.3.56
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/package.json
CHANGED
|
@@ -16,6 +16,7 @@ import EditGetElement from './Editables/EditGetElement.vue'
|
|
|
16
16
|
import ElementEditor from './Editables/ElementEditor.vue'
|
|
17
17
|
import { getPageBuilder } from '../../../composables/builderInstance'
|
|
18
18
|
import EditorAccordion from '../EditorMenu/EditorAccordion.vue'
|
|
19
|
+
import fullHTMLContent from '../../../utils/builder/html-doc-declaration-with-components'
|
|
19
20
|
const pageBuilderService = getPageBuilder()
|
|
20
21
|
// Use shared store instance
|
|
21
22
|
const pageBuilderStateStore = sharedPageBuilderStore
|
|
@@ -64,6 +65,28 @@ function onScroll() {
|
|
|
64
65
|
}
|
|
65
66
|
}
|
|
66
67
|
|
|
68
|
+
// generate HTML
|
|
69
|
+
const generateHTML = function (filename, HTML) {
|
|
70
|
+
const element = document.createElement('a')
|
|
71
|
+
element.setAttribute(
|
|
72
|
+
'href',
|
|
73
|
+
'data:text/html;charset=utf-8,' + encodeURIComponent(fullHTMLContent(HTML)),
|
|
74
|
+
)
|
|
75
|
+
element.setAttribute('download', filename)
|
|
76
|
+
|
|
77
|
+
element.style.display = 'none'
|
|
78
|
+
document.body.appendChild(element)
|
|
79
|
+
|
|
80
|
+
element.click()
|
|
81
|
+
|
|
82
|
+
document.body.removeChild(element)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const getComponents = computed(() => {
|
|
86
|
+
return pageBuilderStateStore.getComponents
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
const downloadedComponents = ref(null)
|
|
67
90
|
// handle download HTML
|
|
68
91
|
const handleDownloadHTML = function () {
|
|
69
92
|
downloadedComponents.value = getComponents.value.map((component) => {
|
|
@@ -1,39 +1,16 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { ref, computed } from 'vue'
|
|
3
3
|
import { sharedPageBuilderStore } from '../../../stores/shared-store'
|
|
4
|
-
|
|
4
|
+
|
|
5
5
|
import { isEmptyObject } from '../../../helpers/isEmptyObject.ts'
|
|
6
6
|
const version = __APP_VERSION__
|
|
7
7
|
|
|
8
8
|
// Use shared store instance
|
|
9
9
|
const pageBuilderStateStore = sharedPageBuilderStore
|
|
10
10
|
|
|
11
|
-
const downloadedComponents = ref(null)
|
|
12
|
-
|
|
13
11
|
const getPageBuilderConfig = computed(() => {
|
|
14
12
|
return pageBuilderStateStore.getPageBuilderConfig
|
|
15
13
|
})
|
|
16
|
-
|
|
17
|
-
const getComponents = computed(() => {
|
|
18
|
-
return pageBuilderStateStore.getComponents
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
// generate HTML
|
|
22
|
-
const generateHTML = function (filename, HTML) {
|
|
23
|
-
const element = document.createElement('a')
|
|
24
|
-
element.setAttribute(
|
|
25
|
-
'href',
|
|
26
|
-
'data:text/html;charset=utf-8,' + encodeURIComponent(fullHTMLContent(HTML)),
|
|
27
|
-
)
|
|
28
|
-
element.setAttribute('download', filename)
|
|
29
|
-
|
|
30
|
-
element.style.display = 'none'
|
|
31
|
-
document.body.appendChild(element)
|
|
32
|
-
|
|
33
|
-
element.click()
|
|
34
|
-
|
|
35
|
-
document.body.removeChild(element)
|
|
36
|
-
}
|
|
37
14
|
</script>
|
|
38
15
|
|
|
39
16
|
<template>
|