@dcodegroup-au/page-builder 0.3.1 → 0.3.3

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.
@@ -1,6 +1,7 @@
1
1
  <script setup>
2
2
  import {Home} from "./pages/Home.js";
3
3
  import {BestLife} from "./pages/BestLife.js";
4
+ import {AboutUs} from "./pages/AboutUs.js";
4
5
 
5
6
  const slide = {
6
7
  title: "About ELAA",
@@ -86,7 +87,7 @@ const breadcrumbs = [
86
87
  <div>
87
88
  <div style="margin: 40px 0">
88
89
  <h1 style="margin-bottom: 20px; font-size: 50px;">Page Render</h1>
89
- <PageRender :page="Home"/>
90
+ <PageRender :page="AboutUs"/>
90
91
  </div>
91
92
  <div style="margin: 40px 0">
92
93
  <h1 style="margin-bottom: 20px; font-size: 50px;">Slider Edit</h1>
@@ -102,7 +103,7 @@ const breadcrumbs = [
102
103
  </div>
103
104
  <div style="margin: 40px 0">
104
105
  <h1 style="margin-bottom: 20px; font-size: 50px;">Page Builder</h1>
105
- <PageBuilder v-model="BestLife" :breadcrumbs="breadcrumbs"/>
106
+ <PageBuilder v-model="AboutUs" :breadcrumbs="breadcrumbs"/>
106
107
  </div>
107
108
  </div>
108
109
  </template>
@@ -0,0 +1,130 @@
1
+ export const AboutUs = {
2
+ title: "About us",
3
+ sections: [
4
+ {
5
+ title: "Standard header",
6
+ type: "standard_header",
7
+ components: [
8
+ {
9
+ name: "Standard header",
10
+ type: "header",
11
+ title: "About us",
12
+ supporting_text_max_length: 500,
13
+ 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.",
14
+ },
15
+ ]
16
+ },
17
+ {
18
+ title: "Bullet Points Section",
19
+ type: "bullet_points",
20
+ components: [
21
+ {
22
+ name: "Section header",
23
+ type: "header",
24
+ title: "Support Services",
25
+ icon: "AlertCircle",
26
+ has_extra: false,
27
+ supporting_text: "ELAA has developed a grass roots understanding of the value and challenges presented by early childhood education. We share our members’ passion for delivering excellence in early learning to children before they commence school, and we help them to do this by providing professional support and resources on a wide range of matters including:",
28
+ },
29
+ {
30
+ name: "Bullet Points",
31
+ type: "bullet_points",
32
+ supportive_text: "This section can contain up to 10 items.",
33
+ max_items: 10,
34
+ max_title: 500,
35
+ data: [
36
+ {
37
+ title: "Read more about our history",
38
+ },
39
+ {
40
+ title: "Read more about our history 2",
41
+ },
42
+ {
43
+ title: "Read more about our history 3",
44
+ },
45
+ {
46
+ title: "Read more about our history 3",
47
+ },
48
+ {
49
+ title: "Read more about our history 3",
50
+ },
51
+ {
52
+ title: "Read more about our history 3",
53
+ },
54
+ {
55
+ title: "Read more about our history 3",
56
+ },
57
+ {
58
+ title: "Read more about our history 3",
59
+ },
60
+ {
61
+ title: "Read more about our history 3",
62
+ },
63
+ {
64
+ title: "Read more about our history 3",
65
+ },
66
+ {
67
+ title: "Read more about our history 3",
68
+ },
69
+ ]
70
+ }
71
+ ]
72
+ },
73
+ {
74
+ title: "Bullet Points Section",
75
+ type: "bullet_points",
76
+ components: [
77
+ {
78
+ name: "Section header",
79
+ type: "header",
80
+ title: "Support Services",
81
+ icon: "AlertCircle",
82
+ featured_image: "https://beta.elaa.org.au/img/what-we-do/best-start-best-life/divided-01.jpg"
83
+ },
84
+ {
85
+ name: "Bullet Points",
86
+ type: "bullet_points",
87
+ supportive_text: "This section can contain up to 10 items.",
88
+ max_items: 10,
89
+ max_title: 500,
90
+ data: [
91
+ {
92
+ title: "Through our advocacy work ELAA provides a voice for parents and service-providers alike; a voice that is clearly heard and respected by policy makers, thanks to our understanding of government, relationships with early learning sector stakeholders, and our advocacy experience. ",
93
+ },
94
+ {
95
+ title: "We work with members, peak bodies, Commonwealth, State and local governments, and other stakeholders to promote and support quality, accessibility and affordability of early childhood services.",
96
+ },
97
+ ]
98
+ }
99
+ ]
100
+ },
101
+ {
102
+ title: "Bullet Points Section",
103
+ type: "bullet_points",
104
+ components: [
105
+ {
106
+ name: "Section header",
107
+ type: "header",
108
+ title: "Support Services",
109
+ icon: "AlertCircle",
110
+ supporting_text: "ELAA has developed a grass roots understanding of the value and challenges presented by early childhood education. We share our members’ passion for delivering excellence in early learning to children before they commence school, and we help them to do this by providing professional support and resources on a wide range of matters including:",
111
+ },
112
+ {
113
+ name: "Bullet Points",
114
+ type: "bullet_points",
115
+ supportive_text: "This section can contain up to 10 items.",
116
+ max_items: 10,
117
+ max_title: 500,
118
+ data: [
119
+ {
120
+ title: "Read more about our history 3",
121
+ },
122
+ {
123
+ title: "Read more about our history 4",
124
+ },
125
+ ]
126
+ }
127
+ ]
128
+ },
129
+ ]
130
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcodegroup-au/page-builder",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "exports": {
5
5
  ".": {
6
6
  "import": "./dist/page-builder.es.js"
@@ -135,6 +135,7 @@ const componentMaps = ref({
135
135
  paragraph: markRaw(VParagraph),
136
136
  image_block: markRaw(VImageBlock),
137
137
  timeline_items: markRaw(VItems),
138
+ bullet_points: markRaw(VLinks),
138
139
  link_cards: markRaw(VItems),
139
140
  });
140
141
 
@@ -23,6 +23,7 @@ import TwoColumnsImageContent from "@/components/presenters/modules/TwoColumnsIm
23
23
  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
+ import BulletPoints from "@/components/presenters/modules/BulletPoints.vue";
26
27
 
27
28
  const props = defineProps({
28
29
  page: {
@@ -44,6 +45,7 @@ const componentMaps = ref({
44
45
  timeline: markRaw(Timeline),
45
46
  link_card: markRaw(LinkCard),
46
47
  link_list: markRaw(LinkList),
48
+ bullet_points: markRaw(BulletPoints),
47
49
  });
48
50
 
49
51
  const currentComponent = (section) => {
@@ -4,24 +4,35 @@
4
4
  {{ dataRef.name }}
5
5
  </p>
6
6
  <div class="flex flex-col gap-4 rounded-xl py-5" :class="{'bg-gray-50 px-0': dataRef?.has_extra, 'bg-gray-200 px-6': !dataRef?.hasOwnProperty('has_extra')}">
7
- <input-wrapper
8
- v-if="dataRef.hasOwnProperty('title')"
9
- is-vertical
10
- field="title"
11
- label-text="Title *"
12
- class="w-full mb-4"
13
- :value="dataRef.title"
14
- :limit="51"
15
- >
16
- <input
17
- v-model="dataRef.title"
18
- name="title"
19
- type="text"
20
- placeholder="Title"
21
- :maxlength="51"
22
- class="border-1 border-solid border-gray-300 rounded-lg bg-white w-full"
23
- />
24
- </input-wrapper>
7
+ <div :class="{'flex gap-4': dataRef.hasOwnProperty('icon')}">
8
+ <input-wrapper
9
+ v-if="dataRef.hasOwnProperty('icon')"
10
+ is-vertical
11
+ field="icon"
12
+ label-text="Icon *"
13
+ :value="dataRef.icon"
14
+ >
15
+ <IconSelector id="icon" v-model="dataRef.icon" />
16
+ </input-wrapper>
17
+ <input-wrapper
18
+ v-if="dataRef.hasOwnProperty('title')"
19
+ is-vertical
20
+ field="title"
21
+ label-text="Title *"
22
+ class="w-full mb-4"
23
+ :value="dataRef.title"
24
+ :limit="51"
25
+ >
26
+ <input
27
+ v-model="dataRef.title"
28
+ name="title"
29
+ type="text"
30
+ placeholder="Title"
31
+ :maxlength="51"
32
+ class="border-1 border-solid border-gray-300 rounded-lg bg-white w-full"
33
+ />
34
+ </input-wrapper>
35
+ </div>
25
36
  <input-wrapper
26
37
  is-vertical
27
38
  v-if="dataRef.hasOwnProperty('supporting_text')"
@@ -31,7 +42,7 @@
31
42
  :value="dataRef.supporting_text"
32
43
  :limit="dataRef.supporting_text_max_length ?? 100"
33
44
  >
34
- <input
45
+ <textarea
35
46
  v-model="dataRef.supporting_text"
36
47
  name="supporting_text"
37
48
  type="text"
@@ -61,6 +72,7 @@
61
72
  import {ref, inject} from "vue";
62
73
  import {defaultProps} from "@/components/helpers/defaultProps";
63
74
  import Card from "@/components/common/Card.vue";
75
+ import IconSelector from "@/components/common/IconSelector.vue";
64
76
  import InputWrapper from "@/components/common/InputWrapper.vue";
65
77
  import DefaultFileUpload from "@/components/common/FileUpload.vue";
66
78
  import VButton from "@/components/common/Button.vue";
@@ -78,5 +90,4 @@ const props = defineProps({
78
90
  });
79
91
 
80
92
  const dataRef = ref(props.data.component);
81
- console.log(dataRef)
82
93
  </script>
@@ -6,7 +6,7 @@
6
6
  </p>
7
7
  </div>
8
8
  <div class="flex flex-col gap-4">
9
- <div class="text-gray-600 border-b border-gray-200 pb-4 text-sm">
9
+ <div class="text-gray-600 border-b border-gray-200 pb-4 text-sm" v-if="dataRef.hasOwnProperty('supportive_text')">
10
10
  {{ dataRef.supportive_text }}
11
11
  </div>
12
12
  <div class="flex flex-col gap-3">
@@ -31,7 +31,7 @@
31
31
  >
32
32
  <div class="flex items-center justify-between">
33
33
  <div class="text-lg font-semibold text-gray-900">
34
- Link #{{ index + 1 }}
34
+ Item #{{ index + 1 }}
35
35
  </div>
36
36
  <div class="relative flex items-end">
37
37
  <ActionMenu @removeItem="handleDeleteItem(index)"/>
@@ -45,18 +45,19 @@
45
45
  label-text="Title *"
46
46
  class="w-full mb-4"
47
47
  :value="item.title"
48
- :limit="20"
48
+ :limit="componentData?.max_title ?? 20"
49
49
  >
50
50
  <input
51
51
  v-model="item.title"
52
52
  name="title"
53
53
  type="text"
54
54
  placeholder="Title"
55
- :maxlength="20"
55
+ :maxlength="componentData?.max_title ?? 20"
56
56
  class="border-1 border-solid border-gray-300 rounded-lg bg-white w-full"
57
57
  />
58
58
  </input-wrapper>
59
59
  <linked-to
60
+ v-if="item.hasOwnProperty('type')"
60
61
  label="Linked to"
61
62
  :name="`link_${index + 1}`"
62
63
  v-model:type="item.type"
@@ -72,7 +73,7 @@
72
73
  <VModal ref="modalRef" entity="link" :callback="deleteCallback"></VModal>
73
74
  </template>
74
75
  <script setup>
75
- import {ref, nextTick} from "vue";
76
+ import {ref, nextTick, computed} from "vue";
76
77
  import PlusIcon from "@/assets/img/icons/plus.svg";
77
78
  import {defaultProps} from "@/components/helpers/defaultProps";
78
79
  import {createLink} from "@/components/helpers/pageBuilderFactory";
@@ -92,6 +93,10 @@ const modalRef = ref(null);
92
93
  const lastItemRef = ref(null);
93
94
  const deleteItemIndex = ref(null);
94
95
 
96
+ const isBulletPoint = computed(() => {
97
+ return componentData.value.type === 'bullet_points';
98
+ });
99
+
95
100
  function addItem() {
96
101
  if (!componentData.value.hasOwnProperty('data')) {
97
102
  componentData.value.data = [];
@@ -100,7 +105,7 @@ function addItem() {
100
105
  if (componentData.value.data?.length >= componentData.value.max_items) {
101
106
  return;
102
107
  }
103
- componentData.value.data?.push(createLink());
108
+ componentData.value.data?.push(createLink({}, isBulletPoint));
104
109
 
105
110
  nextTick(() => {
106
111
  if (lastItemRef.value) {
@@ -69,16 +69,25 @@ export default {
69
69
  </script>
70
70
 
71
71
  <script setup>
72
- import {ref, watch, onMounted} from "vue";
72
+ import {ref, watch, onMounted, defineEmits} from "vue";
73
73
  import PlusIcon from "@/assets/img/icons/plus.svg";
74
74
  import IconComponent from "./Icon.vue";
75
75
  import iconsData from "@/assets/icons.json";
76
+ const props = defineProps({
77
+ modelValue: {
78
+ type: String,
79
+ default: null,
80
+ },
81
+ });
76
82
 
77
- const model = ref(null);
83
+ const model = ref(props.modelValue);
78
84
  const search = ref("");
79
85
  const icons = ref([]);
80
86
  const isDropdownOpen = ref(false);
81
87
 
88
+ const emit = defineEmits(["update:modelValue"]);
89
+
90
+
82
91
  function toggleDropdown() {
83
92
  isDropdownOpen.value = !isDropdownOpen.value;
84
93
  }
@@ -91,6 +100,7 @@ watch(search, (value) => {
91
100
 
92
101
  function update(event) {
93
102
  model.value = event;
103
+ emit('update:modelValue', model.value);
94
104
  isDropdownOpen.value = false; // Close dropdown after selection
95
105
  }
96
106
 
@@ -42,7 +42,7 @@ const openInNewTab = defineModel("openInNewTab");
42
42
 
43
43
  defineProps({
44
44
  label: { type: String, required: false },
45
- sites: { type: Object, required: true },
45
+ sites: { type: Array, required: true },
46
46
  name: { type: String, required: true },
47
47
  options: { type: Array, required: false, default: ["site-content", "external-page", 'download'] },
48
48
  });
@@ -34,7 +34,12 @@ export function createItem(overrides = {}, withSecondary = true) {
34
34
  };
35
35
  }
36
36
 
37
- export function createLink(overrides = {}) {
37
+ export function createLink(overrides = {}, isBulletPoint = false) {
38
+ if (isBulletPoint) {
39
+ return {
40
+ title: "New link",
41
+ };
42
+ }
38
43
  return {
39
44
  title: "New link",
40
45
  url: "",
@@ -0,0 +1,45 @@
1
+ <template>
2
+ <div class="overflow-hidden">
3
+ <div class="max-w-[1640px] md:px-[120px] mx-auto w-full my-[40px]" :class="{'flex gap-8': headerComponent?.featured_image}">
4
+ <img v-if="headerComponent?.featured_image"
5
+ :src="headerComponent?.featured_image"
6
+ class="w-[480px] object-contain rounded-[24px]"
7
+ alt="Feature"/>
8
+ <div v-if="headerComponent">
9
+ <div v-if="headerComponent?.icon" class="w-[48px] h-[48px] bg-brand-100 border-[8px] border-brand-50 rounded-full flex items-center justify-center">
10
+ <IconComponent :icon="headerComponent.icon" icon-classes="w-5 h-5 text-brand-600"></IconComponent>
11
+ </div>
12
+ <h3 class="text-[36px] text-gray-900 font-semibold">{{ headerComponent.title }}</h3>
13
+ <p v-if="headerComponent?.supporting_text" class="text-[20px] font-normal mt-2 text-gray-600 leading-[30px]" v-html="headerComponent.supporting_text"></p>
14
+ <div class="flex flex-col mt-8 gap-4" :class="{'!grid grid-cols-3' :!headerComponent?.featured_image}">
15
+ <div v-for="item in bulletPointsComponent.data" class="flex">
16
+ <div class="bg-gray-100 rounded-full w-[28px] h-[28px] flex items-center justify-center text-gray-500 mr-2">
17
+ <CheckIcon class="w-4 h-4"></CheckIcon>
18
+ </div>
19
+ <p class="text-lg text-gray-600 w-[97%]">{{ item.title }}</p>
20
+ </div>
21
+ </div>
22
+ </div>
23
+ </div>
24
+ </div>
25
+ </template>
26
+ <script setup>
27
+ import {ref, computed} from "vue";
28
+ import CheckIcon from "@/assets/img/icons/check.svg";
29
+ import IconComponent from "@/components/common/Icon.vue";
30
+
31
+ const props = defineProps({
32
+ section: {
33
+ required: true,
34
+ type: Object,
35
+ },
36
+ });
37
+
38
+ const section = ref(props.section);
39
+ const headerComponent = computed(() => {
40
+ return section.value.components.find((component) => component.type === "header");
41
+ });
42
+ const bulletPointsComponent = computed(() => {
43
+ return section.value.components.find((component) => component.type === "bullet_points");
44
+ });
45
+ </script>
@@ -1,24 +1,22 @@
1
1
  <template>
2
- <div class="rounded-[48px] 1xl:max-w-[1824px] mx-auto w-full">
2
+ <div class="rounded-[48px] 1xl:max-w-[1824px] mx-auto w-full md:px-8">
3
3
  <div v-if="section.hasOwnProperty('components') > 0 && section.components.length > 0"
4
- class="md:px-[90px] bg-navy-50 rounded-[48px] relative mb-[64px] pt-[164px]"
5
- :class="{'flex flex-col items-center text-center': section.components[0]?.center}">
6
- <h3 class="text-[48px] font-semibold text-gray-900 w-1/2">{{ section.components[0].title }}</h3>
7
- <h3 class="text-xl font-normal text-gray-600 mt-3 w-1/2">{{ section.components[0].supporting_text }}</h3>
4
+ class="md:px-[90px] bg-navy-50 rounded-[48px] relative pt-[164px]"
5
+ :class="{'flex flex-col items-center text-center': section.components[0]?.center, 'mb-[64px]': hasFeaturedImage}">
6
+ <h3 class="text-[48px] font-semibold text-gray-900 w-2/3">{{ section.components[0].title }}</h3>
7
+ <h3 class="text-xl font-normal text-gray-600 mt-3 w-2/3" :class="{'pb-[100px]': !hasFeaturedImage}">{{ section.components[0].supporting_text }}</h3>
8
8
  <img
9
- v-if="section?.components[0]?.featured_image"
9
+ v-if="hasFeaturedImage"
10
10
  :src="section.components[0]?.featured_image"
11
11
  alt="Card Image"
12
12
  class="w-full max-w-[1632px] h-[480px] object-cover rounded-[48px] relative top-[64px]"
13
13
  />
14
- <img v-else class="w-full max-w-[1632px] h-[480px] object-cover rounded-[48px] relative top-[64px]"
15
- src="@/assets/img/no_image_available.jpeg">
16
14
  </div>
17
15
  </div>
18
16
  </template>
19
17
 
20
18
  <script setup>
21
- import {ref} from "vue";
19
+ import {ref, computed} from "vue";
22
20
 
23
21
  const props = defineProps({
24
22
  section: {
@@ -28,5 +26,8 @@ const props = defineProps({
28
26
  });
29
27
 
30
28
  const section = ref(props.section);
29
+ const hasFeaturedImage = computed(() => {
30
+ return section.value?.components[0]?.hasOwnProperty('featured_image');
31
+ });
31
32
 
32
33
  </script>