@dcodegroup-au/page-builder 0.5.4 → 0.5.5

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.
@@ -165,7 +165,7 @@ export const Vectea2024 =
165
165
  },
166
166
  {
167
167
  name: "FAQs",
168
- type: "feature_items",
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcodegroup-au/page-builder",
3
- "version": "0.5.4",
3
+ "version": "0.5.5",
4
4
  "exports": {
5
5
  ".": {
6
6
  "import": "./dist/page-builder.es.js"
@@ -139,6 +139,7 @@ const componentMaps = ref({
139
139
  timeline_items: markRaw(VItems),
140
140
  bullet_points: markRaw(VLinks),
141
141
  feature_items: markRaw(VLinks),
142
+ faqs: markRaw(VLinks),
142
143
  link_cards: markRaw(VItems),
143
144
  contact_us: markRaw(ContactUs),
144
145
  });
@@ -42,7 +42,9 @@
42
42
  :value="dataRef.supporting_text"
43
43
  :limit="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="isFeatureItem" :data="item"></Header>
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({}, isBulletPoint.value, isFeatureItem.value));
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 = {}, isBulletPoint = false, isFeatureItem = false) {
47
- if (isFeatureItem) {
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 (isBulletPoint) {
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 p-2 w-full pt-6">
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
- <Plus v-if="!show[index]" class="w-6 h-6 cursor-pointer text-gray-400 hover:text-gray-700" @click="toggle(index)"></Plus>
19
- <Minus v-else class="w-6 h-6 cursor-pointer text-gray-400 hover:text-gray-700" @click="toggle(index)"></Minus>
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 === "feature_items");
49
+ return section.value.components.filter((component) => component.type === "faqs");
48
50
  });
49
51
 
50
52
  featureComponents.value.forEach((value, index) => {