@dcodegroup-au/page-builder 0.3.5 → 0.3.7

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 (30) hide show
  1. package/dist/page-builder.css +2 -2
  2. package/dist/page-builder.es.js +8408 -8298
  3. package/dist/page-builder.umd.js +47 -47
  4. package/example/src/App.vue +7 -5
  5. package/example/src/pages/BestLife.js +3 -4
  6. package/example/src/pages/Home.js +18 -11
  7. package/example/src/pages/OurVision.js +148 -0
  8. package/package.json +1 -1
  9. package/src/components/ItemEdit.vue +7 -4
  10. package/src/components/LinkCardEdit.vue +7 -2
  11. package/src/components/PageBuilder.vue +2 -0
  12. package/src/components/PageRender.vue +2 -0
  13. package/src/components/builders/Header.vue +5 -9
  14. package/src/components/builders/Links.vue +9 -2
  15. package/src/components/common/Button.vue +1 -1
  16. package/src/components/helpers/common.js +6 -1
  17. package/src/components/helpers/defaultProps.js +1 -1
  18. package/src/components/helpers/pageBuilderFactory.js +13 -3
  19. package/src/components/presenters/components/CarouselPresenter.vue +7 -8
  20. package/src/components/presenters/components/CollectionGridPresenter.vue +4 -3
  21. package/src/components/presenters/components/SliderPresenter.vue +1 -4
  22. package/src/components/presenters/components/VerticalTabPresenter.vue +1 -1
  23. package/src/components/presenters/modules/Callout.vue +32 -0
  24. package/src/components/presenters/modules/CollectionGrid.vue +5 -5
  25. package/src/components/presenters/modules/LinkCard.vue +3 -2
  26. package/src/components/presenters/modules/LinkList.vue +2 -1
  27. package/src/components/presenters/modules/LogoCloud.vue +1 -1
  28. package/src/components/presenters/modules/TwoColumnsImageContent.vue +37 -2
  29. package/src/components/presenters/overridables/VCarouselPrimaryButton.vue +1 -4
  30. package/tailwind.config.js +3 -0
@@ -2,6 +2,7 @@
2
2
  import {Home} from "./pages/Home.js";
3
3
  import {BestLife} from "./pages/BestLife.js";
4
4
  import {AboutUs} from "./pages/AboutUs.js";
5
+ import {OurVision} from "./pages/OurVision.js";
5
6
 
6
7
  const slide = {
7
8
  title: "About ELAA",
@@ -13,7 +14,7 @@ const slide = {
13
14
  label: 'Join ELAA',
14
15
  url: '/admin', // external could be an url
15
16
  type: 'site-content',
16
- is_new_tab: true,
17
+ open_in_new_tab: true,
17
18
  },
18
19
  secondary_button: {
19
20
  show: true,
@@ -35,7 +36,7 @@ const tab = {
35
36
  label: 'View all',
36
37
  url: 'google.com', // external could be an url
37
38
  type: 'external-page',
38
- is_new_tab: true,
39
+ open_in_new_tab: true,
39
40
  },
40
41
  }
41
42
 
@@ -62,7 +63,7 @@ const linkCardItem = {
62
63
  label: 'Learn more',
63
64
  url: 'https://beta-frontend.elaa.org.au/img/homepage/asset_free_resources.png', // external could be an url
64
65
  type: 'external-page',
65
- is_new_tab: true,
66
+ open_in_new_tab: true,
66
67
  },
67
68
  }
68
69
 
@@ -85,9 +86,10 @@ const breadcrumbs = [
85
86
 
86
87
  <template>
87
88
  <div>
89
+ {{ JSON.stringify(OurVision) }}
88
90
  <div style="margin: 40px 0">
89
91
  <h1 style="margin-bottom: 20px; font-size: 50px;">Page Render</h1>
90
- <PageRender :page="AboutUs"/>
92
+ <PageRender :page="OurVision"/>
91
93
  </div>
92
94
  <div style="margin: 40px 0">
93
95
  <h1 style="margin-bottom: 20px; font-size: 50px;">Slider Edit</h1>
@@ -103,7 +105,7 @@ const breadcrumbs = [
103
105
  </div>
104
106
  <div style="margin: 40px 0">
105
107
  <h1 style="margin-bottom: 20px; font-size: 50px;">Page Builder</h1>
106
- <PageBuilder v-model="AboutUs" :breadcrumbs="breadcrumbs"/>
108
+ <PageBuilder v-model="OurVision" :breadcrumbs="breadcrumbs"/>
107
109
  </div>
108
110
  </div>
109
111
  </template>
@@ -139,7 +139,6 @@ export const BestLife = {
139
139
  name: "Link cards",
140
140
  type: "link_cards",
141
141
  supportive_text: "Manage the link cards.",
142
-
143
142
  max_items: 4,
144
143
  data: [
145
144
  {
@@ -153,7 +152,7 @@ export const BestLife = {
153
152
  label: 'Learn more',
154
153
  url: 'https://beta-frontend.elaa.org.au/img/homepage/asset_free_resources.png', // external could be an url
155
154
  type: 'external-page',
156
- is_new_tab: true,
155
+ open_in_new_tab: false,
157
156
  }
158
157
  },
159
158
  {
@@ -167,7 +166,7 @@ export const BestLife = {
167
166
  label: 'Learn more',
168
167
  url: 'https://beta-frontend.elaa.org.au/img/homepage/asset_free_resources.png', // external could be an url
169
168
  type: 'external-page',
170
- is_new_tab: true,
169
+ open_in_new_tab: true,
171
170
  }
172
171
  },
173
172
  ]
@@ -223,7 +222,7 @@ export const BestLife = {
223
222
  title: 'View all news',
224
223
  url: 'google.com', // external could be an url
225
224
  type: 'external-page',
226
- is_new_tab: true,
225
+ open_in_new_tab: true,
227
226
  show: true,
228
227
  },
229
228
  content: {
@@ -23,7 +23,7 @@ export const Home = {
23
23
  label: 'Join ELAA',
24
24
  url: 'google.com', // external could be an url
25
25
  type: 'site-content',
26
- is_new_tab: true,
26
+ open_in_new_tab: true,
27
27
  },
28
28
  secondary_button: {
29
29
  show: true,
@@ -43,7 +43,7 @@ export const Home = {
43
43
  label: 'Apply now ELAA',
44
44
  url: 'facebook.com', // external could be an url
45
45
  type: 'site-content',
46
- is_new_tab: true,
46
+ open_in_new_tab: true,
47
47
  },
48
48
  secondary_button: {
49
49
  show: true,
@@ -63,7 +63,7 @@ export const Home = {
63
63
  label: 'Apply To Dcodegroup',
64
64
  url: 'facebook.com', // external could be an url
65
65
  type: 'site-content',
66
- is_new_tab: true,
66
+ open_in_new_tab: true,
67
67
  },
68
68
  secondary_button: {
69
69
  show: true,
@@ -83,7 +83,7 @@ export const Home = {
83
83
  label: 'Apply To Image Credits',
84
84
  url: '/admin', // external could be an url
85
85
  type: 'site-content',
86
- is_new_tab: true,
86
+ open_in_new_tab: true,
87
87
  },
88
88
  secondary_button: {
89
89
  show: true,
@@ -176,7 +176,7 @@ export const Home = {
176
176
  label: 'View all',
177
177
  url: 'google.com', // external could be an url
178
178
  type: 'external-page',
179
- is_new_tab: true,
179
+ open_in_new_tab: true,
180
180
  },
181
181
  },
182
182
  {
@@ -190,7 +190,7 @@ export const Home = {
190
190
  label: 'View all',
191
191
  url: 'http://google.com', // external could be an url
192
192
  type: 'external-page',
193
- is_new_tab: true,
193
+ open_in_new_tab: true,
194
194
  },
195
195
  },
196
196
  {
@@ -204,7 +204,7 @@ export const Home = {
204
204
  label: 'View all',
205
205
  url: 'google.com', // external could be an url
206
206
  type: 'external-page',
207
- is_new_tab: true,
207
+ open_in_new_tab: true,
208
208
  },
209
209
  },
210
210
  {
@@ -218,7 +218,7 @@ export const Home = {
218
218
  label: 'View all',
219
219
  url: 'google.com', // external could be an url
220
220
  type: 'external-page',
221
- is_new_tab: true,
221
+ open_in_new_tab: true,
222
222
  },
223
223
  },
224
224
  ]
@@ -280,7 +280,7 @@ export const Home = {
280
280
  title: 'View all news',
281
281
  url: 'google.com', // external could be an url
282
282
  type: 'external-page',
283
- is_new_tab: true,
283
+ open_in_new_tab: true,
284
284
  show: true,
285
285
  },
286
286
  content: {
@@ -357,7 +357,7 @@ export const Home = {
357
357
  title: 'View all events',
358
358
  url: 'google.com', // external could be an url
359
359
  type: 'external-page',
360
- is_new_tab: true,
360
+ open_in_new_tab: true,
361
361
  },
362
362
  content: {
363
363
  label: 'Content',
@@ -366,6 +366,7 @@ export const Home = {
366
366
  {
367
367
  type: 'event',
368
368
  title: 'Change Management – Drop in session',
369
+ url: 'google1.com',
369
370
  description: 'This face to face event is specifically designed for those responsible for the management of OHS in early childhood services.',
370
371
  image: 'https://beta-frontend.elaa.org.au/img/events/event_1.jpg',
371
372
  tags: ['Governance', 'CEO&Leadership', 'Zoom webinar'],
@@ -383,6 +384,7 @@ export const Home = {
383
384
  },
384
385
  {
385
386
  type: 'event',
387
+ url: 'google.com',
386
388
  title: 'Let’s start making sense of OHS: Safety – not child’s play',
387
389
  description: 'This face to face event is specifically designed for those responsible for the management of OHS in early childhood services. Guidance on how to manage risks by addressing the most common hazards faced by the early childhood sector.',
388
390
  image: 'https://beta-frontend.elaa.org.au/img/events/event_2.jpg',
@@ -401,6 +403,7 @@ export const Home = {
401
403
  },
402
404
  {
403
405
  type: 'event',
406
+ url: 'google.com',
404
407
  title: 'DE Regional Governance Training Session',
405
408
  description: 'Guidance on how to manage risks by addressing the most common hazards faced by the early childhood sector.',
406
409
  image: 'https://beta-frontend.elaa.org.au/img/events/event_3.jpg',
@@ -420,6 +423,7 @@ export const Home = {
420
423
  },
421
424
  {
422
425
  type: 'event',
426
+ url: 'google.com',
423
427
  title: 'Change Management – Drop in session 2',
424
428
  description: 'This face to face event is specifically designed for those responsible for the management of OHS in early childhood services.',
425
429
  image: 'https://beta-frontend.elaa.org.au/img/events/event_1.jpg',
@@ -438,6 +442,7 @@ export const Home = {
438
442
  },
439
443
  {
440
444
  type: 'event',
445
+ url: 'google.com',
441
446
  title: 'Let’s start making sense of OHS: Safety – not child’s play 2',
442
447
  description: 'This face to face event is specifically designed for those responsible for the management of OHS in early childhood services. Guidance on how to manage risks by addressing the most common hazards faced by the early childhood sector.',
443
448
  image: 'https://beta-frontend.elaa.org.au/img/events/event_2.jpg',
@@ -456,6 +461,7 @@ export const Home = {
456
461
  },
457
462
  {
458
463
  type: 'event',
464
+ url: 'google.com',
459
465
  title: 'Let’s start making sense of OHS: Safety – not child’s play 3',
460
466
  description: 'This face to face event is specifically designed for those responsible for the management of OHS in early childhood services. Guidance on how to manage risks by addressing the most common hazards faced by the early childhood sector.',
461
467
  image: 'https://beta-frontend.elaa.org.au/img/events/event_2.jpg',
@@ -474,6 +480,7 @@ export const Home = {
474
480
  },
475
481
  {
476
482
  type: 'event',
483
+ url: 'google.com',
477
484
  title: 'Let’s start making sense of OHS: Safety – not child’s play 4',
478
485
  description: 'This face to face event is specifically designed for those responsible for the management of OHS in early childhood services. Guidance on how to manage risks by addressing the most common hazards faced by the early childhood sector.',
479
486
  image: 'https://beta-frontend.elaa.org.au/img/events/event_2.jpg',
@@ -514,7 +521,7 @@ export const Home = {
514
521
  title: 'View all submissions',
515
522
  url: 'google.com', // external could be an url
516
523
  type: 'external-page',
517
- is_new_tab: true,
524
+ open_in_new_tab: true,
518
525
  },
519
526
  content: {
520
527
  label: 'Content',
@@ -0,0 +1,148 @@
1
+ export const OurVision =
2
+ {
3
+ title: "Our Vision & History",
4
+ sections: [
5
+ {
6
+ title: "Standard header",
7
+ type: "standard_header",
8
+ components: [
9
+ {
10
+ name: "Standard header",
11
+ type: "header",
12
+ title: "Our Vision & History",
13
+ supporting_text_max_length: 500,
14
+ supporting_text: "ELAA is the national peak body championing excellence in early learning for children and supporting parents and service. For over 30 years Early Learning Association Australia (ELAA) has been working with parents and early learning providers toward a shared vision of excellence in early learning for every child.",
15
+ },
16
+ ]
17
+ },
18
+ {
19
+ title: "Callout Section",
20
+ type: "callout",
21
+ components: [
22
+ {
23
+ name: "Callout Section",
24
+ type: "callout",
25
+ title: "Our Vision",
26
+ has_extra: true,
27
+ title_label: "Eyebrow heading",
28
+ supporting_text: "Excellence and equity in early childhood education and care",
29
+ supporting_text_label: "Message *",
30
+ featured_image: "https://beta-frontend.elaa.org.au/img/our-vision-and-purpose.png"
31
+ },
32
+ ]
33
+ },
34
+ {
35
+ title: "Callout Section",
36
+ type: "callout",
37
+ components: [
38
+ {
39
+ name: "Callout Section",
40
+ type: "callout",
41
+ title: "Our Purpose",
42
+ has_extra: true,
43
+ title_label: "Eyebrow heading",
44
+ supporting_text: "To build meaningful, reliable, and human-centered software that solves real problems, empowers users, and advances innovation responsibly.",
45
+ supporting_text_label: "Message *",
46
+ },
47
+ ]
48
+ },
49
+ {
50
+ title: "Two columns with image and content",
51
+ type: "two_column_image_content",
52
+ display: "horizontal",
53
+ components: [
54
+ {
55
+ name: "Image Block",
56
+ type: "image_block",
57
+ featured_image: "https://beta-frontend.elaa.org.au/img/our-vision-and-purpose-2.png",
58
+ },
59
+ {
60
+ name: "Standard header",
61
+ type: "header",
62
+ title: "Our values",
63
+ supporting_text_max_length: 500,
64
+ supporting_text: "We create software to address real-world needs — making life easier, work more efficient, and systems more intelligent.",
65
+ },
66
+ {
67
+ name: "Feature items",
68
+ type: "feature_items",
69
+ supportive_text: "Section can contain up to 10 items.",
70
+ max_items: 10,
71
+ data: [
72
+ {
73
+ has_extra: true,
74
+ as_item: true,
75
+ title: "Excellence",
76
+ icon: "AlertCircle",
77
+ supporting_text: "We create software to address real-world needs — making life easier, work more efficient, and systems more intelligent 1.",
78
+ },
79
+ {
80
+ has_extra: true,
81
+ as_item: true,
82
+ title: "Equity",
83
+ icon: 'AlignLeft01',
84
+ supporting_text: "We create software to address real-world needs — making life easier, work more efficient, and systems more intelligent 2.",
85
+ },
86
+ {
87
+ has_extra: true,
88
+ as_item: true,
89
+ title: "Collaboration",
90
+ icon: 'AlignLeft01',
91
+ supporting_text: "We create software to address real-world needs — making life easier, work more efficient, and systems more intelligent 3.",
92
+ },
93
+ {
94
+ has_extra: true,
95
+ as_item: true,
96
+ title: "Collaboration",
97
+ icon: 'AlignLeft01',
98
+ supporting_text: "We create software to address real-world needs — making life easier, work more efficient, and systems more intelligent 3.",
99
+ },
100
+ {
101
+ has_extra: true,
102
+ as_item: true,
103
+ title: "Collaboration",
104
+ icon: 'AlignLeft01',
105
+ supporting_text: "We create software to address real-world needs — making life easier, work more efficient, and systems more intelligent 3.",
106
+ },
107
+ ]
108
+ }
109
+ ]
110
+ },
111
+ {
112
+ title: "Bullet Points Section",
113
+ type: "bullet_points",
114
+ components: [
115
+ {
116
+ name: "Section header",
117
+ type: "header",
118
+ title: "Support Services",
119
+ featured_image: "https://beta.elaa.org.au/img/what-we-do/best-start-best-life/divided-01.jpg"
120
+ },
121
+ {
122
+ name: "Bullet Points",
123
+ type: "bullet_points",
124
+ supportive_text: "This section can contain up to 10 items.",
125
+ max_items: 10,
126
+ max_title: 500,
127
+ data: [
128
+ {
129
+ title: "Through our Commonwealth",
130
+ },
131
+ {
132
+ title: "We work with members, peak bodies.",
133
+ },
134
+ {
135
+ title: "We work with members, peak bodies.",
136
+ },
137
+ {
138
+ title: "We work with members, peak bodies.",
139
+ },
140
+ {
141
+ title: "We work with members, peak bodies.",
142
+ },
143
+ ]
144
+ }
145
+ ]
146
+ },
147
+ ]
148
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcodegroup-au/page-builder",
3
- "version": "0.3.5",
3
+ "version": "0.3.7",
4
4
  "exports": {
5
5
  ".": {
6
6
  "import": "./dist/page-builder.es.js"
@@ -211,7 +211,6 @@ const basicForm = ref({
211
211
  title: props.item.title,
212
212
  description: props.item.description,
213
213
  featured_image: props.item.featured_image,
214
- lines: props.item.lines || [],
215
214
  });
216
215
 
217
216
  const advancedForm = ref({
@@ -235,20 +234,24 @@ const addLine = () => {
235
234
 
236
235
  const removeLine = (index) => {
237
236
  advancedForm.value.lines.splice(index, 1);
238
- emit("update", false);
237
+ this.save();
239
238
  };
240
239
 
241
240
  const save = () => {
242
241
  let form = hasLines.value ? advancedForm : basicForm;
243
- emit("update", form.value);
244
242
 
245
243
  if (props.saveEndpoint) {
246
- axios.post(props.saveEndpoint, form.value).then(() => {
244
+ axios.post(props.saveEndpoint, form.value).then((data) => {
245
+ emit("update", data);
247
246
  if (props.cancelEndpoint) {
248
247
  // window.location.href = props.cancelEndpoint;
249
248
  }
250
249
  });
250
+
251
+ return;
251
252
  }
253
+
254
+ emit("update", form.value);
252
255
  };
253
256
 
254
257
  const close = () => {
@@ -114,12 +114,17 @@ const save = () => {
114
114
  emit("update", form.value);
115
115
 
116
116
  if (props.saveEndpoint) {
117
- axios.post(props.saveEndpoint, form.value).then (() => {
117
+ axios.post(props.saveEndpoint, form.value).then((data) => {
118
+ emit("update", data);
118
119
  if (props.cancelEndpoint) {
119
120
  // window.location.href = props.cancelEndpoint;
120
121
  }
121
- })
122
+ });
123
+
124
+ return;
122
125
  }
126
+
127
+ emit("update", form.value);
123
128
  };
124
129
 
125
130
  const close = () => {
@@ -127,6 +127,7 @@ const componentMaps = ref({
127
127
  vertical_tabs: markRaw(VItems),
128
128
  links: markRaw(VLinks),
129
129
  header: markRaw(VHeader),
130
+ callout: markRaw(VHeader),
130
131
  link_grid: markRaw(VLinks),
131
132
  logos: markRaw(VLogos),
132
133
  carousel: markRaw(VCollectionCarousel),
@@ -136,6 +137,7 @@ const componentMaps = ref({
136
137
  image_block: markRaw(VImageBlock),
137
138
  timeline_items: markRaw(VItems),
138
139
  bullet_points: markRaw(VLinks),
140
+ feature_items: markRaw(VLinks),
139
141
  link_cards: markRaw(VItems),
140
142
  });
141
143
 
@@ -24,6 +24,7 @@ import Timeline from "@/components/presenters/modules/Timeline.vue";
24
24
  import LinkCard from "@/components/presenters/modules/LinkCard.vue";
25
25
  import LinkList from "@/components/presenters/modules/LinkList.vue";
26
26
  import BulletPoints from "@/components/presenters/modules/BulletPoints.vue";
27
+ import Callout from "@/components/presenters/modules/Callout.vue";
27
28
 
28
29
  const props = defineProps({
29
30
  page: {
@@ -46,6 +47,7 @@ const componentMaps = ref({
46
47
  link_card: markRaw(LinkCard),
47
48
  link_list: markRaw(LinkList),
48
49
  bullet_points: markRaw(BulletPoints),
50
+ callout: markRaw(Callout),
49
51
  });
50
52
 
51
53
  const currentComponent = (section) => {
@@ -1,7 +1,7 @@
1
1
  <template>
2
- <div class="bg-gray-50 px-6 py-5 rounded-xl">
2
+ <div :class="{'bg-gray-50 px-6 py-5 rounded-xl': !dataRef?.as_item, '-mx-6 -my-5': dataRef?.as_item}">
3
3
  <p class="text-lg font-semibold text-gray-900 pb-4" :class="{'border-b border-gray-200': !dataRef?.has_extra}">
4
- {{ dataRef.name }}
4
+ {{ dataRef?.name }}
5
5
  </p>
6
6
  <div class="flex flex-col gap-4 rounded-xl py-5 bg-gray-50 px-0" :class="{'!bg-gray-200 !px-6': dataRef?.hasOwnProperty('has_extra')}">
7
7
  <div :class="{'flex gap-4': dataRef.hasOwnProperty('icon')}">
@@ -18,7 +18,7 @@
18
18
  v-if="dataRef.hasOwnProperty('title')"
19
19
  is-vertical
20
20
  field="title"
21
- label-text="Title *"
21
+ :label-text="dataRef?.title_label ?? 'Title *'"
22
22
  class="w-full mb-4"
23
23
  :value="dataRef.title"
24
24
  :limit="51"
@@ -37,7 +37,7 @@
37
37
  is-vertical
38
38
  v-if="dataRef.hasOwnProperty('supporting_text')"
39
39
  field="supporting_text"
40
- label-text="Supporting Text *"
40
+ :label-text="dataRef?.supporting_text_label ?? 'Supporting Text *'"
41
41
  class="w-full mb-4"
42
42
  :value="dataRef.supporting_text"
43
43
  :limit="dataRef.supporting_text_max_length ?? 100"
@@ -83,11 +83,7 @@ const VFileUpload = inject("VFileUpload", DefaultFileUpload);
83
83
  const emit = defineEmits(["update"]);
84
84
  const props = defineProps({
85
85
  ...defaultProps,
86
- hasExtra: {
87
- type: Boolean,
88
- default: true
89
- },
90
86
  });
91
87
 
92
- const dataRef = ref(props.data.component);
88
+ const dataRef = ref(props.data?.component ?? props.data);
93
89
  </script>
@@ -39,7 +39,9 @@
39
39
  </div>
40
40
  <div class="flex flex-col gap-6">
41
41
  <div class="flex flex-col gap-1.5">
42
+ <Header v-if="isFeatureItem" :data="item"></Header>
42
43
  <input-wrapper
44
+ v-else
43
45
  is-vertical
44
46
  field="title"
45
47
  label-text="Title *"
@@ -57,7 +59,7 @@
57
59
  class="border-1 border-solid border-gray-300 rounded-lg bg-white w-full"
58
60
  />
59
61
  <textarea
60
- v-else
62
+ v-if="isBulletPoint"
61
63
  v-model="item.title"
62
64
  name="title"
63
65
  placeholder="Title"
@@ -90,6 +92,7 @@ import {createLink} from "@/components/helpers/pageBuilderFactory";
90
92
  import ActionMenu from "@/components/common/ActionMenu.vue";
91
93
  import InputWrapper from "@/components/common/InputWrapper.vue";
92
94
  import LinkedTo from "@/components/common/LinkedTo.vue";
95
+ import Header from "@/components/builders/Header.vue";
93
96
  import VModal from "@/components/common/Modal.vue";
94
97
 
95
98
  const emit = defineEmits(["update"]);
@@ -107,6 +110,10 @@ const isBulletPoint = computed(() => {
107
110
  return componentData.value.type === 'bullet_points';
108
111
  });
109
112
 
113
+ const isFeatureItem = computed(() => {
114
+ return componentData.value.type === 'feature_items';
115
+ });
116
+
110
117
  function addItem() {
111
118
  if (!componentData.value.hasOwnProperty('data')) {
112
119
  componentData.value.data = [];
@@ -115,7 +122,7 @@ function addItem() {
115
122
  if (componentData.value.data?.length >= componentData.value.max_items) {
116
123
  return;
117
124
  }
118
- componentData.value.data?.push(createLink({}, isBulletPoint.value));
125
+ componentData.value.data?.push(createLink({}, isBulletPoint.value, isFeatureItem.value));
119
126
 
120
127
  nextTick(() => {
121
128
  if (lastItemRef.value) {
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <card v-if="button" :title="button?.name ?? 'Primary button'" class="flex flex-col gap-4 rounded-xl px-6 py-5 mt-4" :classes="classes" :class="classes">
2
+ <card v-if="button" :title="button?.name ?? 'Button'" class="flex flex-col gap-4 rounded-xl px-6 py-5 mt-4" :classes="classes" :class="classes">
3
3
  <div class="flex flex-col gap-8">
4
4
  <VToggle name="show" v-model="button.show" title="Show Button" />
5
5
  <input-wrapper
@@ -58,4 +58,9 @@ export function parseName(str, capitalizeFirst = true) {
58
58
  }
59
59
 
60
60
  return lastWord;
61
- }
61
+ }
62
+
63
+ // Format URL
64
+ export function formatUrl(url) {
65
+ return url?.startsWith("http") ? url : `//${url}`;
66
+ };
@@ -4,7 +4,7 @@ export const defaultProps = {
4
4
  type: Object,
5
5
  },
6
6
  sites: {
7
- required: true,
7
+ required: false,
8
8
  type: Array,
9
9
  },
10
10
  };
@@ -18,7 +18,7 @@ export function createItem(overrides = {}, withSecondary = true, isTimeline = fa
18
18
  label: "",
19
19
  type: "site-content",
20
20
  url: '',
21
- is_new_tab: false,
21
+ open_in_new_tab: false,
22
22
  ...(overrides.primary_button || {}),
23
23
  },
24
24
  }
@@ -32,7 +32,7 @@ export function createItem(overrides = {}, withSecondary = true, isTimeline = fa
32
32
  label: "",
33
33
  type: "site-content",
34
34
  url: '',
35
- is_new_tab: false,
35
+ open_in_new_tab: false,
36
36
  ...(overrides.secondary_button || {}),
37
37
  };
38
38
  }
@@ -43,7 +43,17 @@ export function createItem(overrides = {}, withSecondary = true, isTimeline = fa
43
43
  };
44
44
  }
45
45
 
46
- export function createLink(overrides = {}, isBulletPoint = false) {
46
+ export function createLink(overrides = {}, isBulletPoint = false, isFeatureItem = false) {
47
+ if (isFeatureItem) {
48
+ return {
49
+ has_extra: true,
50
+ as_item: true,
51
+ title: "Item title",
52
+ icon: "AlertCircle",
53
+ supporting_text: "Enter your description here.",
54
+ }
55
+ }
56
+
47
57
  if (isBulletPoint) {
48
58
  return {
49
59
  title: "New link",