@myissue/vue-website-page-builder 3.2.20 → 3.2.21

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myissue/vue-website-page-builder",
3
- "version": "v3.2.20",
3
+ "version": "v3.2.21",
4
4
  "description": "🚧 DEVELOPMENT VERSION - Vue.js page builder component with drag & drop functionality. Not ready for production use.",
5
5
  "type": "module",
6
6
  "main": "./dist/vue-website-page-builder.umd.cjs",
package/src/App.vue CHANGED
@@ -1,6 +1,6 @@
1
1
  <script setup>
2
2
  import Navbar from './Components/Homepage/Navbar.vue'
3
- import HomeSection from './Components/Homepage/HomeSection.vue'
3
+ import HomeSection from './DemoComponents/HomeSection.vue'
4
4
  import Footer from './Components/Homepage/Footer.vue'
5
5
  </script>
6
6
 
@@ -174,7 +174,7 @@ const updateCurrentTab = function (tab) {
174
174
 
175
175
  <p class="whitespace-pre-line leading-5 mt-4">
176
176
  Component Title:
177
- {{ getComponent?.title }}
177
+ {{ component?.title }}
178
178
  </p>
179
179
  <p class="whitespace-pre-line leading-5 mt-4">
180
180
  Component HTML:<br />
@@ -1,9 +1,9 @@
1
1
  <script setup>
2
2
  import { ref, onMounted } from 'vue'
3
3
  const unsplashKey = import.meta.env.VITE_UNSPLASH_KEY
4
- import { usePageBuilderModal } from '../../../composables/usePageBuilderModal'
5
- import PageBuilderClass from '../../../composables/PageBuilderClass.ts'
6
- import { sharedPageBuilderStore } from '../../../stores/shared-store'
4
+ import { usePageBuilderModal } from '../composables/usePageBuilderModal'
5
+ import PageBuilderClass from '../composables/PageBuilderClass.ts'
6
+ import { sharedPageBuilderStore } from '../stores/shared-store'
7
7
 
8
8
  const { closeMediaLibraryModal } = usePageBuilderModal()
9
9
 
@@ -87,8 +87,6 @@ const nextPage = async function () {
87
87
  }
88
88
 
89
89
  const applySelectedImage = async function (imageURL) {
90
- console.log('file:', imageURL)
91
-
92
90
  // Ensure the current image is set in the store with proper structure
93
91
  pageBuilderClass.pageBuilderStateStore.setCurrentImage({
94
92
  src: `${imageURL}`,
@@ -263,11 +261,11 @@ onMounted(async () => {
263
261
  v-for="image in getUnsplashImages.results"
264
262
  :key="image.id"
265
263
  @click="handleImageClick({ url: image.urls.regular, user: image.user.name })"
266
- class="border border-myPrimaryLightGrayColor rounded-lg px-2 p-2 cursor-pointer bg-gray-50"
264
+ class="border border-gray-200 my-2 px-2 p-2 cursor-pointer"
267
265
  >
268
266
  <img
269
267
  :alt="image.user.name"
270
- class="group block w-full overflow-hidden rounded-lg cursor-pointer"
268
+ class="group block w-full overflow-hidden cursor-pointer"
271
269
  :src="image.urls.thumb"
272
270
  />
273
271
  <p class="myPrimaryParagraph text-xs font-normal mt-2">By: {{ image.user.name }}</p>
@@ -1,11 +1,24 @@
1
1
  <script setup>
2
- import FullWidthElement from '../../Components/Layouts/FullWidthElement.vue'
3
- import PageBuilder from '../../PageBuilder/PageBuilder.vue'
4
- import PageBuilderClass from '../../composables/PageBuilderClass.ts'
5
- import { sharedPageBuilderStore } from '../../stores/shared-store'
2
+ import FullWidthElement from '../Components/Layouts/FullWidthElement.vue'
3
+ import PageBuilder from '../PageBuilder/PageBuilder.vue'
4
+ import PageBuilderClass from '../composables/PageBuilderClass.ts'
6
5
 
7
- import DemoMediaLibraryComponent from '../../Components/PageBuilder/DemoComponent/DemoMediaLibraryComponent.vue'
8
- import DemoBuilderComponents from '../../Components/PageBuilder/DemoComponent/DemoBuilderComponents.vue'
6
+ import DemoMediaLibraryComponent from './DemoMediaLibraryComponent.vue'
7
+ import DemoBuilderComponents from './DemoBuilderComponents.vue'
8
+ import { computed, onMounted } from 'vue'
9
+ import { sharedPageBuilderStore } from '../stores/shared-store'
10
+ import html from './html.json'
11
+
12
+ const pageBuilderStateStore = sharedPageBuilderStore
13
+ const pageBuilderClass = new PageBuilderClass(pageBuilderStateStore)
14
+
15
+ const getLocalStorageItemName = computed(() => {
16
+ return pageBuilderStateStore.getLocalStorageItemName
17
+ })
18
+
19
+ const getComponents = computed(() => {
20
+ return pageBuilderStateStore.getComponents
21
+ })
9
22
 
10
23
  // first button function
11
24
  const handleButton = function () {
@@ -80,9 +93,14 @@ const configPageBuilder = {
80
93
  },
81
94
  }
82
95
 
83
- const pageBuilderStateStore = sharedPageBuilderStore
84
- const pageBuilderClass = new PageBuilderClass(pageBuilderStateStore)
85
96
  pageBuilderClass.setConfigPageBuilder(configPageBuilder)
97
+
98
+ onMounted(async () => {
99
+ if (localStorage.getItem(getLocalStorageItemName.value)) {
100
+ } else {
101
+ pageBuilderClass.loadExistingContent(JSON.stringify(html), true)
102
+ }
103
+ })
86
104
  </script>
87
105
 
88
106
  <template>
@@ -112,10 +130,8 @@ pageBuilderClass.setConfigPageBuilder(configPageBuilder)
112
130
  </p>
113
131
  </div>
114
132
  <div>
115
- <PageBuilder
116
- :CustomMediaLibraryComponent="DemoMediaLibraryComponent"
117
- :CustomBuilderComponents="DemoBuilderComponents"
118
- ></PageBuilder>
133
+ <!-- :CustomBuilderComponents="DemoBuilderComponents" -->
134
+ <PageBuilder :CustomMediaLibraryComponent="DemoMediaLibraryComponent"></PageBuilder>
119
135
  </div>
120
136
  </div>
121
137
 
@@ -0,0 +1,47 @@
1
+ [
2
+ {
3
+ "html_code": "<section data-componentid=\"0bc7406f-472e-4889-85fc-8ef3c263ac5e\"><div class=\"relative py-4\"><div class=\"mx-auto max-w-7xl lg:px-4 px-2\"><div class=\"break-words\"><h2><strong>Demo Content</strong></h2></div></div></div></section>",
4
+ "id": "0bc7406f-472e-4889-85fc-8ef3c263ac5e",
5
+ "title": "Header H2"
6
+ },
7
+ {
8
+ "html_code": "<section data-componentid=\"44244178-e183-4439-8150-6a2fdb2dfb72\">\n <div class=\"relative py-4\">\n <div class=\"mx-auto max-w-7xl lg:px-4 px-2\">\n <div><p>Introducing the The Lightweight Free Vue Click &amp; Drop Page Builder create and enhance digital experiences with Vue. Lightweight &amp; Minimalist Page Builder with an elegant and intuitive design, focused on simplicity and speed. Build responsive pages like listings, jobs or blog posts and manage content easily using the free Click &amp; Drop Page Builder.</p></div>\n </div>\n </div>\n </section>",
9
+ "id": "44244178-e183-4439-8150-6a2fdb2dfb72",
10
+ "title": "Text"
11
+ },
12
+ {
13
+ "html_code": "<section data-componentid=\"5515d33a-b0ce-4150-b775-2f00cf7118c9\">\n<div class=\"w-full md:pt-12 md:pb-12 pt-4 pb-4 lg:px-4 px-2 bg-black\"><div class=\"mx-auto max-w-7xl\"><div class=\"myPrimaryGap grid grid-cols-1 sm:grid-cols-3 lg:grid-cols-3\"> <div class=\"flex-1 py-2\"> <img class=\"object-cover w-full object-top aspect-[9/16] smooth-transition rounded-tl-full\" src=\"https://images.unsplash.com/photo-1632765866070-3fadf25d3d5b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMTI0Mzl8MHwxfHNlYXJjaHwxMjh8fG1vZGVsfGVufDB8fHx8MTc0OTgzMDgzMXww&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080\" alt=\"provider\" data-image=\"b2fb2e61-c916-4195-9cd2-c1d25747b4f7\"> </div> <div class=\"flex-1 py-2\"> <img class=\"object-cover w-full object-top aspect-[9/16] smooth-transition rounded-full\" src=\"https://images.unsplash.com/photo-1542513217-0b0eedf7005d?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMTI0Mzl8MHwxfHNlYXJjaHwxMDR8fG1vZGVsfGVufDB8fHx8MTc0OTgzMDc5MXww&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080\" alt=\"provider\" data-image=\"fdf36a14-f7ef-4025-942f-c87b20b18005\"> </div> <div class=\"flex-1 py-2\"> <img class=\"object-cover w-full object-top aspect-[9/16] smooth-transition rounded-br-full\" src=\"https://images.unsplash.com/photo-1574015974293-817f0ebebb74?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMTI0Mzl8MHwxfHNlYXJjaHwyNnx8bW9kZWx8ZW58MHx8fHwxNzQ5ODMwNzM1fDA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080\" alt=\"provider\" data-image=\"618a74a7-5d41-4dce-937c-130dd7490569\"></div></div> </div></div>\n</section>",
14
+ "id": "5515d33a-b0ce-4150-b775-2f00cf7118c9",
15
+ "title": "3 Vertical Images"
16
+ },
17
+ {
18
+ "html_code": "<section data-componentid=\"4a96e0ed-b74c-4d9d-bcdb-aa7dcb794712\"><div class=\"relative py-4\"><div class=\"mx-auto max-w-7xl lg:px-4 px-2\"><div class=\"break-words\"><h3>The web builder for stunning pages</h3></div></div></div></section>",
19
+ "id": "4a96e0ed-b74c-4d9d-bcdb-aa7dcb794712",
20
+ "title": "Header H3"
21
+ },
22
+ {
23
+ "html_code": "<section data-componentid=\"79f6665b-9179-448d-ae87-1eddc9d8e5ed\">\n <div class=\"relative py-4\">\n <div class=\"mx-auto max-w-7xl lg:px-4 px-2\">\n <div><p>A Page Builder designed for growth. Build your website pages with ready-made components that are fully customizable and always responsive, designed to fit every need. A powerful Page Builder for growing merchants, brands, and agencies.</p></div>\n </div>\n </div>\n </section>",
24
+ "id": "79f6665b-9179-448d-ae87-1eddc9d8e5ed",
25
+ "title": "Text"
26
+ },
27
+ {
28
+ "html_code": "<section data-componentid=\"2310d49a-dda0-48ac-811a-795e48c18d06\">\n<div class=\"w-full md:pt-12 md:pb-12 pt-4 pb-4 lg:px-4 px-2\"><div class=\"mx-auto max-w-7xl\"><div class=\"myPrimaryGap grid grid-cols-2 sm:grid-cols-2 lg:grid-cols-2\"> <div class=\"flex-1 py-2\"> <img class=\"object-cover w-full object-top aspect-[9/16] smooth-transition\" src=\"https://images.unsplash.com/photo-1592966719124-2ca2978ba325?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMTI0Mzl8MHwxfHNlYXJjaHwzfHxraW5mb2xrfGVufDB8fHx8MTc0OTgzMTAzM3ww&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080\" alt=\"provider\" data-image=\"536340a5-c7e1-479d-a2ae-a85e6dacc2df\"> </div> <div class=\"flex-1 py-2\"> <img class=\"object-cover w-full object-top aspect-[9/16] smooth-transition\" src=\"https://images.unsplash.com/photo-1549298222-1c31e8915347?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMTI0Mzl8MHwxfHNlYXJjaHwzfHxtYWdhemluZSUyMGZhc2hpb258ZW58MHx8fHwxNzQ5ODMxNTEwfDA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080\" alt=\"provider\" data-image=\"41655496-4742-4cc6-bc3c-abe7c2b241fb\"> </div> </div> </div> </div>\n</section>",
29
+ "id": "2310d49a-dda0-48ac-811a-795e48c18d06",
30
+ "title": "2 Vertical Images"
31
+ },
32
+ {
33
+ "html_code": "<section data-componentid=\"7cb6af83-f761-4044-a0cf-d6224fa01cab\"><div class=\"relative py-4\" selected=\"\"><div class=\"mx-auto max-w-7xl lg:px-4 px-2\"><div class=\"break-words\"><h3>Just publish it with Vue</h3></div></div></div></section>",
34
+ "id": "7cb6af83-f761-4044-a0cf-d6224fa01cab",
35
+ "title": "Header H3"
36
+ },
37
+ {
38
+ "html_code": "<section data-componentid=\"04c007ed-f4c9-4a63-a38c-4cb2e4c949d6\">\n <div class=\"relative py-4\">\n <div class=\"mx-auto max-w-7xl lg:px-4 px-2\">\n <div class=\"\"><p>The website builder loved by designers. Easily design, preview, and adjust layouts for every screen size.<br>Clean. Fast. Intuitive. Not everything powerful has to look complicated.</p></div>\n </div>\n </div>\n </section>",
39
+ "id": "04c007ed-f4c9-4a63-a38c-4cb2e4c949d6",
40
+ "title": "Text"
41
+ },
42
+ {
43
+ "html_code": "<section data-componentid=\"204ce730-ce82-4a9a-88e6-da431bb76c38\">\n <div class=\"py-4\">\n <div class=\"mx-auto max-w-7xl w-full pt-6 pb-6\">\n <div id=\"youtube-video\" class=\"w-full aspect-video p-4\">\n\n <iframe frameborder=\"0\" allowfullscreen=\"\" class=\"w-full aspect-video\" src=\"https://www.youtube.com/embed/pJvwV1Fm0vU\" allow=\"accelerometer; autoplay; clipboard-write;\">\n </iframe>\n </div>\n </div>\n </div>\n </section>",
44
+ "id": "204ce730-ce82-4a9a-88e6-da431bb76c38",
45
+ "title": "YouTube Video"
46
+ }
47
+ ]
@@ -1628,6 +1628,8 @@ class PageBuilderClass {
1628
1628
  savedCurrentDesign = parsedData
1629
1629
  }
1630
1630
 
1631
+ console.log('okokoko:', savedCurrentDesign)
1632
+
1631
1633
  this.pageBuilderStateStore.setComponents(savedCurrentDesign)
1632
1634
  } catch (error) {
1633
1635
  console.error('Error parsing JSON components:', error)
@@ -1653,8 +1655,7 @@ class PageBuilderClass {
1653
1655
  extractedSections.push({
1654
1656
  html_code: htmlElement.outerHTML,
1655
1657
  id: htmlElement.dataset.componentid || null,
1656
- title:
1657
- htmlElement.dataset.title || htmlElement.dataset.componentid || 'Untitled Component',
1658
+ title: htmlElement.title || htmlElement.dataset.componentid || 'Untitled Component',
1658
1659
  })
1659
1660
  })
1660
1661
 
@@ -1667,15 +1668,20 @@ class PageBuilderClass {
1667
1668
  }
1668
1669
 
1669
1670
  // Load existing content from HTML when in update mode
1670
- loadExistingContent(data?: string): void {
1671
+ loadExistingContent(data?: string, injectCustomHTMLSections?: boolean): void {
1671
1672
  if (this.showRunningMethodLogs) {
1672
1673
  console.log('loadExistingContent')
1673
1674
  }
1674
1675
 
1675
1676
  if (!this.pageBuilderStateStore.getConfigPageBuilder) return
1676
1677
 
1678
+ if (injectCustomHTMLSections && data !== undefined) {
1679
+ this.setComponentsFromData(data)
1680
+ }
1681
+
1682
+ const storedData = this.areComponentsStoredInLocalStorage()
1683
+
1677
1684
  if (this.pageBuilderStateStore.getConfigPageBuilder?.updateOrCreate?.formType === 'create') {
1678
- const storedData = this.areComponentsStoredInLocalStorage()
1679
1685
  if (storedData) {
1680
1686
  this.setComponentsFromData(storedData)
1681
1687
  }