@dcodegroup-au/page-builder 0.3.3 → 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.
@@ -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: "Team member\n" +
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcodegroup-au/page-builder",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "exports": {
5
5
  ".": {
6
6
  "import": "./dist/page-builder.es.js"
@@ -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="openStates[sectionIndex] = !openStates[sectionIndex]"
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 pb-4">
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" :class="{'bg-gray-50 px-0': dataRef?.has_extra, 'bg-gray-200 px-6': !dataRef?.hasOwnProperty('has_extra')}">
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')"
@@ -89,7 +89,7 @@ const toggleItem = (index) => {
89
89
  };
90
90
 
91
91
  const addItem = () => {
92
- dataRef.value.data.push(createItem({}, type === 'sliders'));
92
+ dataRef.value.data.push(createItem({}, type === 'sliders', type === 'timeline_items'));
93
93
  emit("update", false);
94
94
  };
95
95
 
@@ -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 ?? 20"
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 ?? 20"
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) {
@@ -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-contain rounded-[24px]"
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
- <p 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"></p>
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
- <p class="text-lg text-gray-600 mt-2 mb-4 leading-[24px]">{{ data.description }}</p>
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
- <p class="text-xl font-normal leading-[30px] mt-4 text-gray-600" v-html="section.components[0].paragraph"></p>
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 md:px-8">
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] bg-navy-50 rounded-[48px] relative pt-[164px]"
4
+ class="md:px-[90px]"
5
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
- <img
9
- v-if="hasFeaturedImage"
10
- :src="section.components[0]?.featured_image"
11
- alt="Card Image"
12
- class="w-full max-w-[1632px] h-[480px] object-cover rounded-[48px] relative top-[64px]"
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
- <p class="text-xl text-gray-600 mt-3 leading-[30px]">{{ line.description }}</p>
26
+ <div class="all-unset">
27
+ <p v-html="line.description"></p>
28
+ </div>
27
29
  </div>
28
30
  </div>
29
31
  </div>