@dcodegroup-au/page-builder 0.5.4 → 0.5.6
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/dist/page-builder.css +3283 -2
- package/dist/page-builder.es.js +29140 -19607
- package/dist/page-builder.umd.js +50240 -65
- package/example/src/pages/Vectea2024.js +5 -1
- package/package.json +1 -1
- package/src/components/LinkCardEdit.vue +2 -2
- package/src/components/PageBuilder.vue +1 -0
- package/src/components/builders/Header.vue +4 -1
- package/src/components/builders/Links.vue +2 -2
- package/src/components/helpers/pageBuilderFactory.js +13 -3
- package/src/components/presenters/modules/FAQ.vue +6 -4
- package/src/components/presenters/modules/LinkCard.vue +1 -1
- package/src/components/presenters/modules/Paragraph.vue +12 -4
- package/vite.config.js +1 -0
|
@@ -165,7 +165,7 @@ export const Vectea2024 =
|
|
|
165
165
|
},
|
|
166
166
|
{
|
|
167
167
|
name: "FAQs",
|
|
168
|
-
type: "
|
|
168
|
+
type: "faqs",
|
|
169
169
|
supportive_text: "This section can contain up to 10 items.",
|
|
170
170
|
has_type_switcher: false,
|
|
171
171
|
max_items: 50,
|
|
@@ -174,12 +174,14 @@ export const Vectea2024 =
|
|
|
174
174
|
{
|
|
175
175
|
has_extra: true,
|
|
176
176
|
as_item: true,
|
|
177
|
+
is_editor: true,
|
|
177
178
|
title: "What is an enterprise agreement? Is this the same as an award?",
|
|
178
179
|
supporting_text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Dignissimos quaerat sed minus maiores dolorem consectetur quibusdam harum itaque deserunt at eligendi qui illum praesentium odit sit, voluptates nobis expedita?",
|
|
179
180
|
},
|
|
180
181
|
{
|
|
181
182
|
has_extra: true,
|
|
182
183
|
as_item: true,
|
|
184
|
+
is_editor: true,
|
|
183
185
|
title: "What is an enterprise agreement? Is this the same as an award?",
|
|
184
186
|
supporting_text: "The last scheduled salary increase under VECTEA 2020, along with its corresponding agreements, was in April 2024. During the re-negotiation period, current salaries established under VECTEA 2020 will continue to be in effect. \n" +
|
|
185
187
|
"Future salary increases under a new VECTEA 2024 will take effect once the Fair Work Commission approves the new agreement.\n" +
|
|
@@ -188,12 +190,14 @@ export const Vectea2024 =
|
|
|
188
190
|
{
|
|
189
191
|
has_extra: true,
|
|
190
192
|
as_item: true,
|
|
193
|
+
is_editor: true,
|
|
191
194
|
title: "We actively work with our partners, developing flexible tailored approaches to maximise your return on investment.",
|
|
192
195
|
supporting_text: "This section can contain up to 10 items.",
|
|
193
196
|
},
|
|
194
197
|
{
|
|
195
198
|
has_extra: true,
|
|
196
199
|
as_item: true,
|
|
200
|
+
is_editor: true,
|
|
197
201
|
title: "We have a dedicated, largely female audience – and we know what works for them.",
|
|
198
202
|
supporting_text: "This section can contain up to 10 items.",
|
|
199
203
|
},
|
package/package.json
CHANGED
|
@@ -137,8 +137,8 @@ const close = () => {
|
|
|
137
137
|
|
|
138
138
|
const descriptionWordCount = computed(() => {
|
|
139
139
|
const plainText = form.value.description?.replace(/<[^>]*>/g, ' ').trim();
|
|
140
|
-
const words = plainText
|
|
141
|
-
return words
|
|
140
|
+
const words = plainText?.split(/\s+/).filter(word => word.length > 0);
|
|
141
|
+
return words?.length ?? 0;
|
|
142
142
|
});
|
|
143
143
|
|
|
144
144
|
</script>
|
|
@@ -40,9 +40,11 @@
|
|
|
40
40
|
:label-text="dataRef?.supporting_text_label ?? 'Supporting Text *'"
|
|
41
41
|
class="w-full mb-4"
|
|
42
42
|
:value="dataRef.supporting_text"
|
|
43
|
-
:limit="dataRef.supporting_text_max_length ?? 500"
|
|
43
|
+
:limit="dataRef?.is_editor ? null : (dataRef.supporting_text_max_length ?? 500)"
|
|
44
44
|
>
|
|
45
|
+
<QuillEditor v-if="dataRef?.is_editor" v-model="dataRef.supporting_text"/>
|
|
45
46
|
<textarea
|
|
47
|
+
v-else
|
|
46
48
|
v-model="dataRef.supporting_text"
|
|
47
49
|
name="supporting_text"
|
|
48
50
|
type="text"
|
|
@@ -88,6 +90,7 @@ import IconSelector from "@/components/common/IconSelector.vue";
|
|
|
88
90
|
import InputWrapper from "@/components/common/InputWrapper.vue";
|
|
89
91
|
import DefaultFileUpload from "@/components/common/FileUpload.vue";
|
|
90
92
|
import VButton from "@/components/common/Button.vue";
|
|
93
|
+
import QuillEditor from "@/components/common/QuillEditor.vue";
|
|
91
94
|
|
|
92
95
|
// Inject the FileUpload component or fallback to the default one
|
|
93
96
|
const VFileUpload = inject("VFileUpload", DefaultFileUpload);
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
</label>
|
|
71
71
|
</div>
|
|
72
72
|
<div class="flex flex-col gap-1.5" v-if="!item.hasOwnProperty('content_type') || item.content_type === 'content'">
|
|
73
|
-
<Header v-if="
|
|
73
|
+
<Header v-if="['feature_items', 'faqs'].includes(componentData.type)" :data="item"></Header>
|
|
74
74
|
<input-wrapper
|
|
75
75
|
v-else
|
|
76
76
|
is-vertical
|
|
@@ -169,7 +169,7 @@ function addItem() {
|
|
|
169
169
|
if (componentData.value.data?.length >= componentData.value.max_items) {
|
|
170
170
|
return;
|
|
171
171
|
}
|
|
172
|
-
componentData.value.data?.push(createLink({},
|
|
172
|
+
componentData.value.data?.push(createLink({}, componentData.value.type));
|
|
173
173
|
|
|
174
174
|
nextTick(() => {
|
|
175
175
|
if (lastItemRef.value) {
|
|
@@ -43,8 +43,18 @@ export function createItem(overrides = {}, withSecondary = true, isTimeline = fa
|
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
export function createLink(overrides = {},
|
|
47
|
-
if (
|
|
46
|
+
export function createLink(overrides = {}, type = null) {
|
|
47
|
+
if (type === 'faqs') {
|
|
48
|
+
return {
|
|
49
|
+
has_extra: true,
|
|
50
|
+
as_item: true,
|
|
51
|
+
is_editor: true,
|
|
52
|
+
title: "Item title",
|
|
53
|
+
supporting_text: "Enter your description here.",
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (type === 'feature_items') {
|
|
48
58
|
return {
|
|
49
59
|
has_extra: true,
|
|
50
60
|
as_item: true,
|
|
@@ -54,7 +64,7 @@ export function createLink(overrides = {}, isBulletPoint = false, isFeatureItem
|
|
|
54
64
|
}
|
|
55
65
|
}
|
|
56
66
|
|
|
57
|
-
if (
|
|
67
|
+
if (type === 'bullet_points') {
|
|
58
68
|
return {
|
|
59
69
|
title: "New link",
|
|
60
70
|
};
|
|
@@ -10,13 +10,15 @@
|
|
|
10
10
|
</div>
|
|
11
11
|
<div v-if="featureComponents[index]" class="flex flex-col divide-y gap-8">
|
|
12
12
|
<div v-for="(link, index) in featureComponents[index].data"
|
|
13
|
-
class="relative bg-white
|
|
13
|
+
class="relative bg-white w-full pt-6">
|
|
14
14
|
<a class="text-gray-900 cursor-pointer w-full inline-flex justify-between gap-1.5 items-center leading-[28px] font-semibold text-lg">
|
|
15
15
|
<span class="hover:underline" @click="toggle(index)">
|
|
16
16
|
{{ link.title }}
|
|
17
17
|
</span>
|
|
18
|
-
<
|
|
19
|
-
|
|
18
|
+
<span class="min-w-[24px]">
|
|
19
|
+
<Plus v-if="!show[index]" class="w-6 h-6 cursor-pointer text-gray-400 hover:text-gray-700" @click="toggle(index)"></Plus>
|
|
20
|
+
<Minus v-else class="w-6 h-6 cursor-pointer text-gray-400 hover:text-gray-700" @click="toggle(index)"></Minus>
|
|
21
|
+
</span>
|
|
20
22
|
</a>
|
|
21
23
|
<p v-if="show[index]" class="mt-2 text-gray-600 leading-[24px]" v-html="link.supporting_text"></p>
|
|
22
24
|
</div>
|
|
@@ -44,7 +46,7 @@ const headerComponents = computed(() => {
|
|
|
44
46
|
});
|
|
45
47
|
|
|
46
48
|
const featureComponents = computed(() => {
|
|
47
|
-
return section.value.components.filter((component) => component.type === "
|
|
49
|
+
return section.value.components.filter((component) => component.type === "faqs");
|
|
48
50
|
});
|
|
49
51
|
|
|
50
52
|
featureComponents.value.forEach((value, index) => {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
<IconComponent :icon="data.icon" icon-classes="w-5 h-5" :key="index"></IconComponent>
|
|
21
21
|
</div>
|
|
22
22
|
<h1 class="text-[20px] font-semibold text-gray-900">{{ data.title }}</h1>
|
|
23
|
-
<div class="text-lg text-gray-600 mt-2 leading-[24px]" v-html="data.description"></div>
|
|
23
|
+
<div class="text-lg text-gray-600 mt-2 leading-[24px]" v-if="data?.description" v-html="data.description"></div>
|
|
24
24
|
<a
|
|
25
25
|
v-if="data?.primary_button.show && data.primary_button.url"
|
|
26
26
|
class="text-brand-700 inline-flex gap-1.5 items-center font-semibold text-base mt-4"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="overflow-hidden mt-4">
|
|
3
|
-
<div class="max-w-[1640px] md:px-[120px] mx-auto w-full pt-4 mb-4 flex gap-16">
|
|
4
|
-
<div class="max-w-[800px]" v-if="section.components[0]?.title">
|
|
3
|
+
<div class="max-w-[1640px] md:px-[120px] mx-auto w-full pt-4 mb-4 flex gap-16 items-center">
|
|
4
|
+
<div class="max-w-[800px] py-4" v-if="section.components[0]?.title" ref="leftColumn">
|
|
5
5
|
<h3 class="text-[36px] text-gray-900 font-semibold">
|
|
6
6
|
{{ section.components[0].title }}
|
|
7
7
|
</h3>
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<div v-html="section.components[0].paragraph"></div>
|
|
10
10
|
</div>
|
|
11
11
|
</div>
|
|
12
|
-
<div class="w-full rounded-[24px]" v-if="section.components[0]?.featured_image">
|
|
12
|
+
<div class="w-full rounded-[24px]" v-if="section.components[0]?.featured_image" ref="rightColumn">
|
|
13
13
|
<img :src="section.components[0]?.featured_image" alt="Feature Image" class="w-full h-full object-cover rounded-[24px]"/>
|
|
14
14
|
</div>
|
|
15
15
|
</div>
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
</template>
|
|
18
18
|
|
|
19
19
|
<script setup>
|
|
20
|
-
import {ref} from "vue";
|
|
20
|
+
import {ref, onMounted} from "vue";
|
|
21
21
|
|
|
22
22
|
const props = defineProps({
|
|
23
23
|
section: {
|
|
@@ -26,6 +26,14 @@ const props = defineProps({
|
|
|
26
26
|
},
|
|
27
27
|
});
|
|
28
28
|
|
|
29
|
+
const leftColumn = ref(null);
|
|
30
|
+
const rightColumn = ref(null);
|
|
31
|
+
|
|
29
32
|
const section = ref(props.section);
|
|
30
33
|
|
|
34
|
+
onMounted(() => {
|
|
35
|
+
if (leftColumn.value && rightColumn.value) {
|
|
36
|
+
rightColumn.value.style.height = `${leftColumn.value.offsetHeight}px`;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
31
39
|
</script>
|