@dcodegroup-au/page-builder 0.1.2 → 0.1.4

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.
@@ -22,14 +22,14 @@ const page = {
22
22
  primary_button: {
23
23
  show: true,
24
24
  label: 'Join ELAA',
25
- url: '/google.com', // external could be an url
25
+ url: 'google.com', // external could be an url
26
26
  type: 'site-content',
27
27
  is_new_tab: true,
28
28
  },
29
29
  secondary_button: {
30
30
  show: true,
31
31
  label: 'Learn about ELAA',
32
- url: '/admin', // external could be an url
32
+ url: 'facebook.com', // external could be an url
33
33
  type: 'site-content',
34
34
  open_in_new_tab: true,
35
35
  },
@@ -42,14 +42,14 @@ const page = {
42
42
  primary_button: {
43
43
  show: false,
44
44
  label: 'Apply now ELAA',
45
- url: '/admin', // external could be an url
45
+ url: 'facebook.com', // external could be an url
46
46
  type: 'site-content',
47
47
  is_new_tab: true,
48
48
  },
49
49
  secondary_button: {
50
50
  show: true,
51
51
  label: 'Construct ELAA',
52
- url: '/admin', // external could be an url
52
+ url: 'facebook.com', // external could be an url
53
53
  type: 'site-content',
54
54
  open_in_new_tab: true,
55
55
  },
@@ -62,14 +62,14 @@ const page = {
62
62
  primary_button: {
63
63
  show: true,
64
64
  label: 'Apply To Dcodegroup',
65
- url: '/admin', // external could be an url
65
+ url: 'facebook.com', // external could be an url
66
66
  type: 'site-content',
67
67
  is_new_tab: true,
68
68
  },
69
69
  secondary_button: {
70
70
  show: true,
71
71
  label: 'Construct Dcodegroup',
72
- url: '/admin', // external could be an url
72
+ url: 'admin', // external could be an url
73
73
  type: 'site-content',
74
74
  open_in_new_tab: true,
75
75
  },
@@ -176,7 +176,7 @@ const page = {
176
176
  show: true,
177
177
  name: 'Linked to',
178
178
  label: 'View all',
179
- url: 'google.com', // external could be an url
179
+ url: 'http://google.com', // external could be an url
180
180
  type: 'external-page',
181
181
  is_new_tab: true,
182
182
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcodegroup-au/page-builder",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "exports": {
5
5
  ".": {
6
6
  "import": "./dist/page-builder.es.js"
@@ -3,7 +3,7 @@
3
3
  <div class="flex justify-center" :class="{'!block': isLinkGrid}" v-for="link in component.data">
4
4
  <a
5
5
  :target="link.open_in_new_tab ? '_blank' : ''"
6
- :href="`/${link.url}`"
6
+ :href="link.url.startsWith('http') ? link.url : `//${link.url}`"
7
7
  class="text-white flex gap-1.5 items-center cursor-pointer mt-12 text-sm font-semibold hover:text-gray-300"
8
8
  :class="{'bg-white border border-gray-300 rounded-full !text-gray-700 px-4 h-[44px] w-max !mt-0 !text-base hover:bg-gray-100': isLinkGrid}"
9
9
  >
@@ -14,13 +14,13 @@
14
14
  <p class="text-lg font-normal text-navy-50" v-html="slide?.description"></p>
15
15
  <div class="flex gap-3 mt-8 flex-col lg:flex-row">
16
16
  <a class="text-white text-base font-semibold border border-white px-6 py-2 rounded-full hover:bg-navy-800 hover:opacity-60"
17
- :href="slide.secondary_button.url"
17
+ :href="formatUrl(slide.secondary_button.url)"
18
18
  v-if="slide.secondary_button.show"
19
19
  :target="slide.secondary_button.open_in_new_tab ? '_blank' : ''">
20
20
  <span>{{ slide.secondary_button.label }}</span>
21
21
  </a>
22
22
  <a class=" flex items-center gap-2 text-navy-800 bg-white text-base font-semibold border border-white px-6 py-2 rounded-full hover:bg-navy-50"
23
- :href="slide.primary_button.url"
23
+ :href="formatUrl(slide.primary_button.url)"
24
24
  v-if="slide.primary_button.show"
25
25
  :target="slide.primary_button.open_in_new_tab ? '_blank' : ''">
26
26
  {{ slide.primary_button.label }}
@@ -56,6 +56,10 @@ const props = defineProps({
56
56
  const currentSlide = ref(0);
57
57
  const componentData = ref(props.component);
58
58
  const slides = componentData.value.data.filter((o) => o.public);
59
+
60
+ const formatUrl = (url) => {
61
+ return url.startsWith('http') ? url : `//${url}`;
62
+ };
59
63
  </script>
60
64
 
61
65
  <style scoped>
@@ -44,7 +44,8 @@
44
44
  v-if="selectedItem?.primary_button?.show"
45
45
  class="text-sm md:text-md font-semibold text-brand-600 flex items-center gap-2 mt-4"
46
46
  :target="selectedItem?.primary_button?.is_new_tab ? '_blank' : ''"
47
- :href="selectedItem?.primary_button?.url">
47
+ :href="selectedItem?.primary_button?.url.startsWith('http') ? selectedItem.primary_button.url : `//${selectedItem.primary_button.url}`"
48
+ >
48
49
  {{ selectedItem?.primary_button?.label ?? 'N/A' }}
49
50
  <ArrowUpRight class="w-4 h-4 md:w-5 md:h-5" />
50
51
  </a>