@myissue/vue-website-page-builder 3.3.82 → 3.3.84

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.
Files changed (46) hide show
  1. package/dist/{ar-COgc0DCm.js → ar-ITBqBm-d.js} +72 -41
  2. package/dist/{de-CGky7E-a.js → de-BJpPaS11.js} +68 -37
  3. package/dist/{en-DU_tZbAN.js → en-B_2bnBr-.js} +71 -40
  4. package/dist/{es-OjYclQFK.js → es-whPPQx5J.js} +68 -37
  5. package/dist/{fr-q_n3yaNn.js → fr-BT4veodQ.js} +72 -41
  6. package/dist/{hi-PCyw3ByF.js → hi-ebTmcUsS.js} +75 -44
  7. package/dist/{ja-fF78DiFn.js → ja-BRtI2tes.js} +69 -38
  8. package/dist/{pt-h1yUOPEo.js → pt-DcvtSuUT.js} +74 -43
  9. package/dist/{ru-91i2N905.js → ru-Q6PD0n2W.js} +62 -31
  10. package/dist/style.css +1 -1
  11. package/dist/vue-website-page-builder.js +6358 -6215
  12. package/dist/vue-website-page-builder.umd.cjs +96 -63
  13. package/dist/{zh-Hans-DU7U45Js.js → zh-Hans-CZQ2JK7v.js} +69 -38
  14. package/package.json +1 -1
  15. package/src/Components/Modals/BuilderComponents.vue +1 -1
  16. package/src/Components/Modals/MediaLibraryModal.vue +1 -1
  17. package/src/Components/PageBuilder/EditorMenu/Editables/BorderRadius.vue +3 -0
  18. package/src/Components/PageBuilder/EditorMenu/Editables/Borders.vue +70 -67
  19. package/src/Components/PageBuilder/EditorMenu/Editables/ClassEditor.vue +2 -1
  20. package/src/Components/PageBuilder/EditorMenu/Editables/StyleEditor.vue +2 -1
  21. package/src/Components/PageBuilder/EditorMenu/RightSidebarEditor.vue +4 -2
  22. package/src/Components/PageBuilder/Settings/AdvancedPageBuilderSettings.vue +152 -56
  23. package/src/Components/PageBuilder/ToolbarOption/ToolbarOption.vue +8 -8
  24. package/src/Components/TipTap/TipTap.vue +14 -8
  25. package/src/PageBuilder/PageBuilder.vue +101 -80
  26. package/src/composables/extractCleanHTMLFromPageBuilder.ts +1 -1
  27. package/src/css/dev-global.css +0 -9
  28. package/src/css/style.css +2 -37
  29. package/src/locales/ar.json +26 -1
  30. package/src/locales/de.json +26 -1
  31. package/src/locales/en.json +24 -2
  32. package/src/locales/es.json +26 -1
  33. package/src/locales/fr.json +26 -1
  34. package/src/locales/hi.json +26 -1
  35. package/src/locales/ja.json +26 -1
  36. package/src/locales/pt.json +26 -1
  37. package/src/locales/ru.json +26 -1
  38. package/src/locales/zh-Hans.json +26 -1
  39. package/src/services/PageBuilderService.ts +94 -49
  40. package/src/tailwind-safelist.html +1 -1
  41. package/src/{Components/PageBuilder → tests}/DefaultComponents/DefaultBuilderComponents.vue +50 -11
  42. package/src/tests/TestComponents/DemoMediaLibraryComponentTest.vue +1 -1
  43. package/src/{Components → tests/TestComponents}/DemoUnsplash.vue +5 -5
  44. package/src/utils/componentPreviews.ts +35 -0
  45. package/src/utils/html-elements/component.ts +17 -3
  46. /package/src/{Components/PageBuilder → tests}/DefaultComponents/DefaultMediaLibraryComponent.vue +0 -0
@@ -1,12 +1,13 @@
1
1
  <script setup lang="ts">
2
- import componentHelpers from '../../../utils/html-elements/componentHelpers'
3
- import components from '../../../utils/html-elements/component'
4
- import { usePageBuilderModal } from '../../../composables/usePageBuilderModal'
5
- import { generateComponentPreview } from '../../../utils/componentPreviews'
6
- import type { ComponentObject } from '../../../types'
7
- import { getPageBuilder } from '../../../composables/builderInstance'
2
+ import { ref, computed } from 'vue'
3
+ import componentHelpers from '../../utils/html-elements/componentHelpers'
4
+ import components from '../../utils/html-elements/component'
5
+ import { usePageBuilderModal } from '../../composables/usePageBuilderModal'
6
+ import { generateComponentPreview } from '../../utils/componentPreviews'
7
+ import type { ComponentObject } from '../../types'
8
+ import { getPageBuilder } from '../../composables/builderInstance'
8
9
 
9
- import { useTranslations } from '../../../composables/useTranslations'
10
+ import { useTranslations } from '../../composables/useTranslations'
10
11
 
11
12
  const { translate } = useTranslations()
12
13
 
@@ -19,6 +20,20 @@ defineProps({
19
20
  },
20
21
  })
21
22
 
23
+ const selectedCategory = ref('All')
24
+
25
+ const categories = computed(() => {
26
+ const allCategories = components[0].components.data.map((comp) => comp.category)
27
+ return ['All', ...new Set(allCategories)]
28
+ })
29
+
30
+ const filteredComponents = computed(() => {
31
+ if (selectedCategory.value === 'All') {
32
+ return components[0].components.data
33
+ }
34
+ return components[0].components.data.filter((comp) => comp.category === selectedCategory.value)
35
+ })
36
+
22
37
  // Get modal close function
23
38
  const { closeAddComponentModal } = usePageBuilderModal()
24
39
 
@@ -44,7 +59,7 @@ const handleDropComponent = async function (componentObject: ComponentObject) {
44
59
  }
45
60
 
46
61
  // Helper function to convert ComponentData to ComponentObject
47
- const convertToComponentObject = function (comp: ComponentObject): ComponentObject {
62
+ const convertToComponentObject = function (comp: any): ComponentObject {
48
63
  return {
49
64
  id: null, // Generate ID when needed in PageBuilderClass
50
65
  html_code: comp.html_code,
@@ -60,6 +75,19 @@ const getSvgPreview = (title: string) => {
60
75
 
61
76
  <style scoped>
62
77
  /* Add any additional styling if needed */
78
+ .category-button {
79
+ background-color: #f0f0f0;
80
+ border: 1px solid #ccc;
81
+ padding: 8px 16px;
82
+ margin: 4px;
83
+ cursor: pointer;
84
+ border-radius: 4px;
85
+ }
86
+ .category-button.active {
87
+ background-color: #007bff;
88
+ color: white;
89
+ border-color: #007bff;
90
+ }
63
91
  </style>
64
92
 
65
93
  <template>
@@ -68,7 +96,7 @@ const getSvgPreview = (title: string) => {
68
96
  <div class="pbx-mb-8">
69
97
  <h3 class="pbx-myQuaternaryHeader pbx-mb-4">{{ translate('Helper Components') }}</h3>
70
98
  <div
71
- class="pbx-grid pbx-grid-cols-1 sm:pbx-grid-cols-2 md:pbx-grid-cols-3 lg:pbx-grid-cols-4 pbx-gap-4"
99
+ class="pbx-px-2 pbx-grid pbx-grid-cols-1 sm:pbx-grid-cols-2 md:pbx-grid-cols-3 lg:pbx-grid-cols-4 pbx-gap-4"
72
100
  >
73
101
  <div
74
102
  v-for="helper in componentHelpers"
@@ -91,11 +119,22 @@ const getSvgPreview = (title: string) => {
91
119
  </div>
92
120
 
93
121
  <!-- Regular Components Section -->
94
- <div v-if="customMediaComponent">
122
+ <div class="pbx-px-2" v-if="customMediaComponent">
95
123
  <h3 class="pbx-myQuaternaryHeader pbx-mb-4">{{ translate('Layout Components') }}</h3>
124
+ <div class="pbx-mb-4 pbx-flex pbx-jusitify-left pbx-items-center pbx-gap-2">
125
+ <button
126
+ v-for="category in categories"
127
+ :key="category"
128
+ @click="selectedCategory = category"
129
+ class="pbx-mySecondaryButton pbx-px-2 pbx-text-xs"
130
+ :class="{ active: selectedCategory === category }"
131
+ >
132
+ {{ translate(category) }}
133
+ </button>
134
+ </div>
96
135
  <div class="pbx-grid pbx-grid-cols-1 sm:pbx-grid-cols-2 md:pbx-grid-cols-3 pbx-gap-4">
97
136
  <div
98
- v-for="comp in components[0].components.data"
137
+ v-for="comp in filteredComponents"
99
138
  :key="comp.title"
100
139
  class="pbx-border-solid pbx-border pbx-border-gray-400 pbx-overflow-hidden hover:pbx-border-myPrimaryLinkColor pbx-duration-100 pbx-cursor-pointer"
101
140
  @click="handleDropComponent(convertToComponentObject(comp))"
@@ -1,5 +1,5 @@
1
1
  <script setup>
2
- import Unsplash from '../../Components/DemoUnsplash.vue'
2
+ import Unsplash from './DemoUnsplash.vue'
3
3
  </script>
4
4
  <template>
5
5
  <div>
@@ -1,11 +1,11 @@
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 { delay } from '../composables/delay'
6
- import { preloadImage } from '../composables/preloadImage'
7
- import { getPageBuilder } from '../composables/builderInstance'
8
- import { useTranslations } from '../composables/useTranslations'
4
+ import { usePageBuilderModal } from '../../composables/usePageBuilderModal'
5
+ import { delay } from '../../composables/delay'
6
+ import { preloadImage } from '../../composables/preloadImage'
7
+ import { getPageBuilder } from '../../composables/builderInstance'
8
+ import { useTranslations } from '../../composables/useTranslations'
9
9
  const { translate } = useTranslations()
10
10
 
11
11
  const pageBuilderService = getPageBuilder()
@@ -145,6 +145,41 @@ export const generateComponentPreview = (title: string): string => {
145
145
  `,
146
146
  },
147
147
 
148
+ 'Four Square Images': {
149
+ title: 'Four Square Images',
150
+ svg: `
151
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 190.34 42.55">
152
+ <defs>
153
+ <style>
154
+ .cls-1 {
155
+ fill: #394152;
156
+ }
157
+
158
+ .cls-2 {
159
+ fill: #718096;
160
+ }
161
+ </style>
162
+ </defs>
163
+ <rect class="cls-1" width="42.55" height="42.55"/>
164
+ <rect class="cls-1" x="49.05" width="42.55" height="42.55"/>
165
+ <rect class="cls-1" x="97.35" width="42.55" height="42.55"/>
166
+ <rect class="cls-1" x="147.79" width="42.55" height="42.55"/>
167
+ <polygon class="cls-2" points="6.47 27.62 17.04 14.93 27.62 27.62 6.47 27.62"/>
168
+ <polygon class="cls-2" points="25.5 27.62 30.79 21.28 36.07 27.62 25.5 27.62"/>
169
+ <circle class="cls-2" cx="30.79" cy="16.69" r="1.76"/>
170
+ <polygon class="cls-2" points="55.52 27.62 66.09 14.93 76.66 27.62 55.52 27.62"/>
171
+ <polygon class="cls-2" points="74.55 27.62 79.83 21.28 85.12 27.62 74.55 27.62"/>
172
+ <circle class="cls-2" cx="79.83" cy="16.69" r="1.76"/>
173
+ <polygon class="cls-2" points="103.82 27.62 114.39 14.93 124.97 27.62 103.82 27.62"/>
174
+ <polygon class="cls-2" points="122.85 27.62 128.14 21.28 133.42 27.62 122.85 27.62"/>
175
+ <circle class="cls-2" cx="128.14" cy="16.69" r="1.76"/>
176
+ <polygon class="cls-2" points="154.26 27.62 164.83 14.93 175.4 27.62 154.26 27.62"/>
177
+ <polygon class="cls-2" points="173.29 27.62 178.57 21.28 183.86 27.62 173.29 27.62"/>
178
+ <circle class="cls-2" cx="178.57" cy="16.69" r="1.76"/>
179
+ </svg>
180
+ `,
181
+ },
182
+
148
183
  'Six Square Images Grid': {
149
184
  title: 'Six Square Images Grid',
150
185
  svg: `
@@ -1,11 +1,10 @@
1
1
  import { getPlaceholderImageDataUrl } from '../componentPreviews'
2
- import { useTranslations } from '../../composables/useTranslations'
3
- const { translate } = useTranslations()
4
2
 
5
3
  interface ComponentData {
6
4
  title: string
7
5
  html_code: string
8
- cover_image: string | null // Now optional since we use SVG previews instead of external images
6
+ cover_image: string | null
7
+ category: string
9
8
  }
10
9
 
11
10
  interface Components {
@@ -25,46 +24,61 @@ const component: Components[] = [
25
24
  title: 'Single Image',
26
25
  html_code: `<section>\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-1 sm:grid-cols-1 lg:grid-cols-1"> <div class="flex-1 py-2"> <img class="object-cover w-full object-top aspect-square " src="${placeholderImage}" alt="provider"></div></div></div></div>\n</section>`,
27
26
  cover_image: null,
27
+ category: 'Image',
28
28
  },
29
29
  {
30
30
  title: 'Two Vertical Images',
31
31
  html_code: `<section>\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] " src="${placeholderImage}" alt="provider"> </div> <div class="flex-1 py-2"> <img class="object-cover w-full object-top aspect-[9/16] " src="${placeholderImage}" alt="provider"> </div> </div> </div> </div>\n</section>`,
32
32
  cover_image: null,
33
+ category: 'Image',
33
34
  },
34
35
  {
35
36
  title: 'Two Square Images',
36
37
  html_code: `<section>\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-1 sm:grid-cols-2 lg:grid-cols-2"> <div class="flex-1 py-2"> <img class="object-cover w-full object-top aspect-square " src="${placeholderImage}" alt="provider"> </div> <div class="flex-1 py-2"> <img class="object-cover w-full object-top aspect-square " src="${placeholderImage}" alt="provider"></div></div> </div></div>\n</section>`,
37
38
  cover_image: null,
39
+ category: 'Image',
38
40
  },
39
41
  {
40
42
  title: 'Three Square Images',
41
43
  html_code: `<section>\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-1 sm:grid-cols-3 lg:grid-cols-3"> <div class="flex-1 py-2"> <img class="object-cover w-full object-top aspect-square " src="${placeholderImage}" alt="provider"> </div> <div class="flex-1 py-2"> <img class="object-cover w-full object-top aspect-square " src="${placeholderImage}" alt="provider"> </div> <div class="flex-1 py-2"> <img class="object-cover w-full object-top aspect-square " src="${placeholderImage}" alt="provider"></div></div> </div></div>\n</section>`,
42
44
  cover_image: null,
45
+ category: 'Image',
46
+ },
47
+ {
48
+ title: 'Four Square Images',
49
+ html_code: `<section>\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-4"> <div><img class="object-cover w-full object-top aspect-square " src="${placeholderImage}" alt="provider"></div> <div><img class="object-cover w-full object-top aspect-square " src="${placeholderImage}" alt="provider"></div> <div><img class="object-cover w-full object-top aspect-square " src="${placeholderImage}" alt="provider"></div> <div><img class="object-cover w-full object-top aspect-square " src="${placeholderImage}" alt="provider"></div> </div> </div> </div>\n</section>`,
50
+ cover_image: null,
51
+ category: 'Image',
43
52
  },
44
53
  {
45
54
  title: 'Six Square Images Grid',
46
55
  html_code: `<section>\n<div class="w-full md:pt-12 md:pb-12 pt-4 pb-4 lg:px-4 px-2">\n<div class="mx-auto max-w-7xl">\n<div class="grid grid-cols-2 md:grid-cols-3 myPrimaryGap">\n\n<div>\n<img class="object-cover w-full object-top aspect-square " src="${placeholderImage}" alt="image">\n</div>\n\n<div>\n<img class="object-cover w-full object-top aspect-square " src="${placeholderImage}" alt="image">\n</div>\n\n<div>\n<img class="object-cover w-full object-top aspect-square " src="${placeholderImage}" alt="image">\n</div>\n\n<div>\n<img class="object-cover w-full object-top aspect-square " src="${placeholderImage}" alt="image">\n</div>\n\n<div>\n<img class="object-cover w-full object-top aspect-square " src="${placeholderImage}" alt="image">\n</div>\n\n<div>\n<img class="object-cover w-full object-top aspect-square " src="${placeholderImage}" alt="image">\n</div>\n\n</div>\n</div>\n</div>\n</section>`,
47
56
  cover_image: null,
57
+ category: 'Image',
48
58
  },
49
59
  {
50
60
  title: 'Two Square Images With Text',
51
61
  html_code: `<section>\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">\n<div class="myPrimaryGap lg:flex lg:justify-center"><div class="flex-1 py-2">\n<div class="grid myPrimaryGap grid-cols-1 lg:grid-cols-2"> <div class="flex-1 py-2"> <img class="object-cover w-full object-top aspect-square " src="${placeholderImage}" alt="provider"> </div> <div class="flex-1 py-2"> <img class="object-cover w-full object-top aspect-square " src="${placeholderImage}" alt="provider"> </div> </div> </div>\n\n<div class="flex-1 py-2"> <div class="break-words py-2"><p>Start customizing by editing this default text directly in the editor.</p></div></div> \n</div></div></div>\n</section>`,
52
62
  cover_image: null,
63
+ category: 'Image & Text',
53
64
  },
54
65
  {
55
66
  title: 'Three Vertical Images',
56
67
  html_code: `<section>\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-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] " src="${placeholderImage}" alt="provider"> </div> <div class="flex-1 py-2"> <img class="object-cover w-full object-top aspect-[9/16] " src="${placeholderImage}" alt="provider"> </div> <div class="flex-1 py-2"> <img class="object-cover w-full object-top aspect-[9/16] " src="${placeholderImage}" alt="provider"></div></div> </div></div>\n</section>`,
57
68
  cover_image: null,
69
+ category: 'Image',
58
70
  },
59
71
  {
60
72
  title: 'Four Square Images With Text',
61
73
  html_code: `<section>\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-4"> <div class="flex-1 py-2"> <img class="object-cover w-full object-top aspect-square " src="${placeholderImage}" alt="provider"> <div class="break-words py-2"><p>Layouts and visual.</p><p>Start customizing by editing this default text directly in the editor.</p></div> </div> <div class="flex-1 py-2"> <img class="object-cover w-full object-top aspect-square " src="${placeholderImage}" alt="provider"> <div class="break-words py-2"><p>Layouts and visual.</p><p>Start customizing by editing this default text directly in the editor.</p></div> </div> <div class="flex-1 py-2"> <img class="object-cover w-full object-top aspect-square " src="${placeholderImage}" alt="provider"> <div class="break-words py-2"><p>Layouts and visual.</p><p>Start customizing by editing this default text directly in the editor.</p></div> </div> <div class="flex-1 py-2"> <img class="object-cover w-full object-top aspect-square " src="${placeholderImage}" alt="provider"><div class="break-words py-2"><p>Layouts and visual.</p><p>Start customizing by editing this default text directly in the editor.</p></div> </div> </div> </div> </div>\n</section>`,
62
74
  cover_image: null,
75
+ category: 'Image & Text',
63
76
  },
64
77
  {
65
78
  title: 'Three Square Images With Text',
66
79
  html_code: `<section>\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-1 sm:grid-cols-3 lg:grid-cols-3"> <div class="flex-1 py-2"> <img class="object-cover w-full object-top aspect-square " src="${placeholderImage}" alt="provider"> <div class="break-words py-2"><p>Layouts and visual.</p><p>Start customizing by editing this default text directly in the editor.</p></div> </div> <div class="flex-1 py-2"> <img class="object-cover w-full object-top aspect-square " src="${placeholderImage}" alt="provider"> <div class="break-words py-2"><p>Layouts and visual.</p><p>Start customizing by editing this default text directly in the editor.</p></div> </div> <div class="flex-1 py-2"> <img class="object-cover w-full object-top aspect-square " src="${placeholderImage}" alt="provider"> <div class="break-words py-2"><p>Layouts and visual.</p><p>Start customizing by editing this default text directly in the editor.</p></div> </div> </div> </div> </div>\n</section>`,
67
80
  cover_image: null,
81
+ category: 'Image & Text',
68
82
  },
69
83
  ],
70
84
  },