@dcodegroup-au/page-builder 0.3.2 → 0.3.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.
- package/dist/page-builder.css +1 -1
- package/dist/page-builder.es.js +5775 -5733
- package/dist/page-builder.umd.js +12 -12
- package/example/src/pages/BestLife.js +2 -8
- package/package.json +1 -1
- package/src/assets/css/style.css +75 -0
- package/src/components/PageBuilder.vue +6 -1
- package/src/components/builders/Header.vue +2 -2
- package/src/components/builders/Items.vue +1 -1
- package/src/components/builders/Links.vue +13 -3
- package/src/components/common/IconSelector.vue +12 -2
- package/src/components/helpers/pageBuilderFactory.js +10 -1
- package/src/components/presenters/modules/BulletPoints.vue +2 -2
- package/src/components/presenters/modules/LinkCard.vue +2 -2
- package/src/components/presenters/modules/Paragraph.vue +3 -1
- package/src/components/presenters/modules/StandardHeader.vue +12 -10
- package/src/components/presenters/modules/Timeline.vue +3 -1
|
@@ -23,14 +23,7 @@ export const BestLife = {
|
|
|
23
23
|
name: "Paragraph section",
|
|
24
24
|
type: "paragraph",
|
|
25
25
|
title: "ELAA is proudly supporting",
|
|
26
|
-
paragraph: "
|
|
27
|
-
"Paragraph\n" +
|
|
28
|
-
"@olivia\n" +
|
|
29
|
-
"The Victorian Government's Best Start, Best Life reforms represent the most substantial transformation in Victoria's early childhood sector in a generation. As part of these reforms:\n" +
|
|
30
|
-
"The Three-Year-Old Kindergarten program will expand, reaching 15 hours per week across the state by 2029.\n" +
|
|
31
|
-
"The Four-Year-Old Kindergarten program will evolve into Pre-Prep, with weekly hours increasing from 15 to 30 by 2036 throughout Victoria.\n" +
|
|
32
|
-
"Extending the hours of teacher-led, play-based learning through Pre-Prep in the year before school provides children with enhanced access to the numerous benefits of early childhood education. Pre-Prep will launch in 2025, starting with children in six regional Victorian local government areas, and will gradually expand across the state.\n" +
|
|
33
|
-
"This is a hint text to help user.",
|
|
26
|
+
paragraph: '<p>The Victorian Government’s Best Start, Best Life reforms represent the most substantial transformation in Victoria’s early childhood sector in a generation. As part of these reforms:</p><ol><li data-list=\\"bullet\\"><span class=\\"ql-ui\\" contenteditable=\\"false\\"></span>The Three-Year-Old Kindergarten program will expand, reaching 15 hours per week across the state by 2029.</li><li data-list=\\"bullet\\"><span class=\\"ql-ui\\" contenteditable=\\"false\\"></span>The Four-Year-Old Kindergarten program will evolve into Pre-Prep, with weekly hours increasing from 15 to 30 by 2036 throughout Victoria.</li></ol><p>Extending the hours of teacher-led, play-based learning through Pre-Prep in the year before school provides children with enhanced access to the numerous benefits of early childhood education. Pre-Prep will launch in 2025, starting with children in six regional Victorian local government areas, and will gradually expand across the state.</p>',
|
|
34
27
|
},
|
|
35
28
|
]
|
|
36
29
|
},
|
|
@@ -280,6 +273,7 @@ export const BestLife = {
|
|
|
280
273
|
{
|
|
281
274
|
name: "Section header",
|
|
282
275
|
type: "header",
|
|
276
|
+
has_extra: true,
|
|
283
277
|
title: 'Upcoming Events',
|
|
284
278
|
dark: true,
|
|
285
279
|
supporting_text: 'Don\'t Miss Our Upcoming Activities and Gatherings in Early Education.',
|
package/package.json
CHANGED
package/src/assets/css/style.css
CHANGED
|
@@ -2,6 +2,81 @@
|
|
|
2
2
|
@tailwind components;
|
|
3
3
|
@tailwind utilities;
|
|
4
4
|
|
|
5
|
+
/* Add this to your global CSS file */
|
|
6
|
+
@layer utilities {
|
|
7
|
+
.all-unset {
|
|
8
|
+
/* Default styles for common elements */
|
|
9
|
+
html {
|
|
10
|
+
font-size: 16px;
|
|
11
|
+
line-height: 1.15;
|
|
12
|
+
-webkit-text-size-adjust: 100%;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
body {
|
|
16
|
+
margin: 8px;
|
|
17
|
+
font-family: Arial, sans-serif;
|
|
18
|
+
color: black;
|
|
19
|
+
background-color: white;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
h1, h2, h3, h4, h5, h6 {
|
|
23
|
+
font-weight: bold;
|
|
24
|
+
margin: 0.67em 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
p {
|
|
28
|
+
margin: 1em 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
ul, ol {
|
|
32
|
+
padding-left: 40px;
|
|
33
|
+
margin: 1em 0;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
li {
|
|
37
|
+
list-style-type: disc;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
a {
|
|
41
|
+
color: -webkit-link;
|
|
42
|
+
text-decoration: underline;
|
|
43
|
+
cursor: pointer;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
button {
|
|
47
|
+
align-items: center;
|
|
48
|
+
appearance: button;
|
|
49
|
+
background-color: -internal-light-dark(rgb(239, 239, 239), rgb(59, 59, 59));
|
|
50
|
+
border: 2px solid transparent;
|
|
51
|
+
border-radius: 4px;
|
|
52
|
+
box-sizing: border-box;
|
|
53
|
+
color: buttontext;
|
|
54
|
+
cursor: default;
|
|
55
|
+
display: inline-flex;
|
|
56
|
+
font: 400 13.3333px Arial;
|
|
57
|
+
padding: 1px 6px;
|
|
58
|
+
text-align: center;
|
|
59
|
+
text-shadow: none;
|
|
60
|
+
white-space: nowrap;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
input {
|
|
64
|
+
font: 400 13.3333px Arial;
|
|
65
|
+
padding: 1px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
table {
|
|
69
|
+
border-collapse: collapse;
|
|
70
|
+
border-spacing: 0;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
th, td {
|
|
74
|
+
padding: 0;
|
|
75
|
+
text-align: left;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
5
80
|
.page-builder, .page-render, .item-edit {
|
|
6
81
|
[type="text"],
|
|
7
82
|
[type="email"],
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<div class="flex w-[356px] flex-col gap-2 pb-10 overflow-y-auto h-[100vh]">
|
|
5
5
|
<div v-for="(parent, sectionIndex) in modelValue.sections" class="border-b border-gray-200 pb-2">
|
|
6
6
|
<div
|
|
7
|
-
@click="
|
|
7
|
+
@click="updateState(sectionIndex)"
|
|
8
8
|
class="flex cursor-pointer items-center justify-between px-2 py-4"
|
|
9
9
|
>
|
|
10
10
|
<span class="text-lg font-semibold text-brand-800">
|
|
@@ -149,6 +149,11 @@ if (!openStates.value) {
|
|
|
149
149
|
window.localStorage.setItem("pageBuilderOpenStates", JSON.stringify(openStates.value));
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
+
const updateState = (sectionIndex) => {
|
|
153
|
+
openStates.value[sectionIndex] = !openStates.value[sectionIndex];
|
|
154
|
+
window.localStorage.setItem("pageBuilderOpenStates", JSON.stringify(openStates.value));
|
|
155
|
+
};
|
|
156
|
+
|
|
152
157
|
const selectComponent = (sectionIndex, component, index) => {
|
|
153
158
|
selected.value = {
|
|
154
159
|
page: props.modelValue,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="bg-gray-50 px-6 py-5 rounded-xl">
|
|
3
|
-
<p class="text-lg font-semibold text-gray-900 border-b border-gray-200
|
|
3
|
+
<p class="text-lg font-semibold text-gray-900 pb-4" :class="{'border-b border-gray-200': !dataRef?.has_extra}">
|
|
4
4
|
{{ dataRef.name }}
|
|
5
5
|
</p>
|
|
6
|
-
<div class="flex flex-col gap-4 rounded-xl py-5
|
|
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')}">
|
|
8
8
|
<input-wrapper
|
|
9
9
|
v-if="dataRef.hasOwnProperty('icon')"
|
|
@@ -45,14 +45,24 @@
|
|
|
45
45
|
label-text="Title *"
|
|
46
46
|
class="w-full mb-4"
|
|
47
47
|
:value="item.title"
|
|
48
|
-
:limit="componentData?.max_title ??
|
|
48
|
+
:limit="componentData?.max_title ?? 200"
|
|
49
49
|
>
|
|
50
50
|
<input
|
|
51
|
+
v-if="!isBulletPoint"
|
|
51
52
|
v-model="item.title"
|
|
52
53
|
name="title"
|
|
53
54
|
type="text"
|
|
54
55
|
placeholder="Title"
|
|
55
|
-
:maxlength="componentData?.max_title ??
|
|
56
|
+
:maxlength="componentData?.max_title ?? 200"
|
|
57
|
+
class="border-1 border-solid border-gray-300 rounded-lg bg-white w-full"
|
|
58
|
+
/>
|
|
59
|
+
<textarea
|
|
60
|
+
v-else
|
|
61
|
+
v-model="item.title"
|
|
62
|
+
name="title"
|
|
63
|
+
placeholder="Title"
|
|
64
|
+
:maxlength="componentData?.max_title ?? 200"
|
|
65
|
+
rows="4"
|
|
56
66
|
class="border-1 border-solid border-gray-300 rounded-lg bg-white w-full"
|
|
57
67
|
/>
|
|
58
68
|
</input-wrapper>
|
|
@@ -105,7 +115,7 @@ function addItem() {
|
|
|
105
115
|
if (componentData.value.data?.length >= componentData.value.max_items) {
|
|
106
116
|
return;
|
|
107
117
|
}
|
|
108
|
-
componentData.value.data?.push(createLink({}, isBulletPoint));
|
|
118
|
+
componentData.value.data?.push(createLink({}, isBulletPoint.value));
|
|
109
119
|
|
|
110
120
|
nextTick(() => {
|
|
111
121
|
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(
|
|
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
|
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
export function createItem(overrides = {}, withSecondary = true) {
|
|
1
|
+
export function createItem(overrides = {}, withSecondary = true, isTimeline = false) {
|
|
2
|
+
if (isTimeline) {
|
|
3
|
+
return {
|
|
4
|
+
lines: [],
|
|
5
|
+
title: "New title",
|
|
6
|
+
max_items: 5,
|
|
7
|
+
group_title: ""
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
2
11
|
let data = {
|
|
3
12
|
title: "New Item",
|
|
4
13
|
description: "New description",
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
<div class="max-w-[1640px] md:px-[120px] mx-auto w-full my-[40px]" :class="{'flex gap-8': headerComponent?.featured_image}">
|
|
4
4
|
<img v-if="headerComponent?.featured_image"
|
|
5
5
|
:src="headerComponent?.featured_image"
|
|
6
|
-
class="w-[480px] object-
|
|
6
|
+
class="w-[480px] object-cover rounded-[24px]"
|
|
7
7
|
alt="Feature"/>
|
|
8
|
-
<div v-if="headerComponent">
|
|
8
|
+
<div v-if="headerComponent" :class="{'py-[48px]': headerComponent?.featured_image}">
|
|
9
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
10
|
<IconComponent :icon="headerComponent.icon" icon-classes="w-5 h-5 text-brand-600"></IconComponent>
|
|
11
11
|
</div>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<div class="max-w-[1640px] md:px-[120px] mx-auto w-full my-[40px]">
|
|
4
4
|
<div class="rounded-xl px-[40px] text-center mb-6 max-w-[1280px] mx-auto" v-if="headerComponent">
|
|
5
5
|
<h3 class="text-[36px] text-gray-900 font-semibold">{{ headerComponent.title }}</h3>
|
|
6
|
-
<
|
|
6
|
+
<div v-if="headerComponent?.supporting_text" class="text-[20px] font-normal mt-2 text-gray-600 leading-[30px] max-w-[768px] mx-auto" v-html="headerComponent.supporting_text"></div>
|
|
7
7
|
</div>
|
|
8
8
|
<div v-if="cardComponent" class="flex w-full" :class="{'gap-8': headerComponent?.featured_image}">
|
|
9
9
|
<img v-if="headerComponent?.featured_image"
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
<IconComponent :icon="data.icon" icon-classes="w-5 h-5" :key="index"></IconComponent>
|
|
18
18
|
</div>
|
|
19
19
|
<h1 class="text-[20px] font-semibold text-gray-900">{{ data.title }}</h1>
|
|
20
|
-
<
|
|
20
|
+
<div class="text-lg text-gray-600 mt-2 mb-4 leading-[24px]" v-html="data.description"></div>
|
|
21
21
|
<a
|
|
22
22
|
v-if="data?.primary_button.url"
|
|
23
23
|
class="text-brand-700 inline-flex gap-1.5 items-center font-semibold text-base"
|
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
<h3 class="text-[36px] text-gray-900 font-semibold">
|
|
6
6
|
{{ section.components[0].title }}
|
|
7
7
|
</h3>
|
|
8
|
-
<
|
|
8
|
+
<div class="all-unset">
|
|
9
|
+
<div v-html="section.components[0].paragraph"></div>
|
|
10
|
+
</div>
|
|
9
11
|
</div>
|
|
10
12
|
</div>
|
|
11
13
|
</div>
|
|
@@ -1,16 +1,18 @@
|
|
|
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">
|
|
3
3
|
<div v-if="section.hasOwnProperty('components') > 0 && section.components.length > 0"
|
|
4
|
-
class="md:px-[90px]
|
|
4
|
+
class="md:px-[90px]"
|
|
5
5
|
:class="{'flex flex-col items-center text-center': section.components[0]?.center, 'mb-[64px]': hasFeaturedImage}">
|
|
6
|
-
<
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
<div class="bg-navy-50 rounded-[48px] relative pt-[164px] px-[120px]">
|
|
7
|
+
<h3 class="text-[48px] font-semibold text-gray-900 w-2/3">{{ section.components[0].title }}</h3>
|
|
8
|
+
<h3 class="text-xl font-normal text-gray-600 mt-3 w-2/3" :class="{'pb-[100px]': !hasFeaturedImage}">{{ section.components[0].supporting_text }}</h3>
|
|
9
|
+
<img
|
|
10
|
+
v-if="hasFeaturedImage"
|
|
11
|
+
:src="section.components[0]?.featured_image"
|
|
12
|
+
alt="Card Image"
|
|
13
|
+
class="w-full max-w-[1632px] h-[480px] object-cover rounded-[48px] relative top-[64px]"
|
|
14
|
+
/>
|
|
15
|
+
</div>
|
|
14
16
|
</div>
|
|
15
17
|
</div>
|
|
16
18
|
</template>
|
|
@@ -23,7 +23,9 @@
|
|
|
23
23
|
class="bg-pale-orange-100 p-6 mb-6 rounded-[16px]"
|
|
24
24
|
>
|
|
25
25
|
<h4 class="text-xl font-semibold text-gray-900">{{ line.title }}</h4>
|
|
26
|
-
<
|
|
26
|
+
<div class="all-unset">
|
|
27
|
+
<p v-html="line.description"></p>
|
|
28
|
+
</div>
|
|
27
29
|
</div>
|
|
28
30
|
</div>
|
|
29
31
|
</div>
|