@dcodegroup-au/page-builder 0.2.3 → 0.2.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcodegroup-au/page-builder",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "exports": {
5
5
  ".": {
6
6
  "import": "./dist/page-builder.es.js"
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="item-edit">
3
- <div class="flex items-start gap-4 px-6 pt-4 h-full">
3
+ <div class="flex items-start gap-4 px-6 pt-4 h-full min-h-[90vh]">
4
4
  <div class="flex flex-1 flex-col gap-4">
5
5
  <card title="Description">
6
6
  <div class="flex flex-col gap-8">
@@ -33,7 +33,7 @@
33
33
  </input-wrapper>
34
34
  </div>
35
35
  </card>
36
- <card v-if="form.hasOwnProperty('primary_button')" :title="item?.primary_button?.name ?? 'Primary button'">
36
+ <card v-if="form.hasOwnProperty('primary_button')" :title="form?.primary_button?.name ?? 'Primary button'">
37
37
  <div class="flex flex-col gap-8">
38
38
  <VToggle name="show" v-model="form.primary_button.show" title="Show Button" />
39
39
  <input-wrapper
@@ -62,35 +62,33 @@
62
62
  />
63
63
  </div>
64
64
  </card>
65
- <card v-if="form.hasOwnProperty('secondary_button')" :title="item?.secondary_button?.name ?? 'Secondary button'">
65
+ <card v-if="form.hasOwnProperty('secondary_button')" :title="form?.secondary_button?.name ?? 'Secondary button'">
66
66
  <div class="flex flex-col gap-4">
67
67
  <VToggle name="show" v-model="form.secondary_button.show" title="Show Button" />
68
- <template v-if="form.secondary_button?.show">
69
- <input-wrapper
70
- is-vertical
71
- field="secondary_button.label"
72
- label-text="Button Label *"
73
- class="w-full mb-4"
74
- :value="form.secondary_button.label"
75
- :limit="20"
76
- >
77
- <input
78
- v-model="form.secondary_button.label"
79
- name="secondary_button.label"
80
- type="text"
81
- placeholder="Label"
82
- :maxlength="20"
83
- class="border-1 border-solid border-gray-300 rounded-lg bg-white w-full"
84
- />
85
- </input-wrapper>
86
- <linked-to
87
- name="secondary"
88
- v-model:type="form.secondary_button.type"
89
- v-model:url="form.secondary_button.url"
90
- v-model:openInNewTab="form.secondary_button.open_in_new_tab"
91
- :sites="sites"
68
+ <input-wrapper
69
+ is-vertical
70
+ field="secondary_button.label"
71
+ label-text="Button Label *"
72
+ class="w-full mb-4"
73
+ :value="form.secondary_button.label"
74
+ :limit="20"
75
+ >
76
+ <input
77
+ v-model="form.secondary_button.label"
78
+ name="secondary_button.label"
79
+ type="text"
80
+ placeholder="Label"
81
+ :maxlength="20"
82
+ class="border-1 border-solid border-gray-300 rounded-lg bg-white w-full"
92
83
  />
93
- </template>
84
+ </input-wrapper>
85
+ <linked-to
86
+ name="secondary"
87
+ v-model:type="form.secondary_button.type"
88
+ v-model:url="form.secondary_button.url"
89
+ v-model:openInNewTab="form.secondary_button.open_in_new_tab"
90
+ :sites="sites"
91
+ />
94
92
  </div>
95
93
  </card>
96
94
  </div>
@@ -37,8 +37,8 @@
37
37
  </div>
38
38
  </div>
39
39
  <div>
40
- <h3 v-if="componentData.content?.label" class="text-base text-gray-900 font-semibold">{{ componentData.data.content.label }}</h3>
41
- <p v-if="componentData.content?.supportive_text" class="text-gray-600 text-base font-normal mt-2">{{ componentData.data.content.supportive_text }}</p>
40
+ <h3 v-if="componentData.content?.label" class="text-base text-gray-900 font-semibold">{{ componentData.content.label }}</h3>
41
+ <p v-if="componentData.content?.supportive_text" class="text-gray-600 text-base font-normal mt-2">{{ componentData.content.supportive_text }}</p>
42
42
  </div>
43
43
  </div>
44
44
  </template>
@@ -87,8 +87,7 @@ const toggleItem = (index) => {
87
87
  };
88
88
 
89
89
  const addItem = () => {
90
- console.log(createItem({}, type.value === 'sliders'))
91
- dataRef.value.data.push(createItem({}, type.value === 'sliders'));
90
+ dataRef.value.data.push(createItem({}, type === 'sliders'));
92
91
  emit("update", false);
93
92
  };
94
93
 
@@ -1,19 +1,18 @@
1
1
  export function createItem(overrides = {}, withSecondary = true) {
2
2
  let data = {
3
3
  title: "New Item",
4
- description: "New description",
5
- public: false,
6
- featured_image: "",
7
- primary_button: {
4
+ description: "New description",
5
+ public: false,
6
+ featured_image: "",
7
+ primary_button: {
8
8
  show: false,
9
- label: "",
10
- type: "site-content",
11
- url: '',
12
- is_new_tab: false,
9
+ label: "",
10
+ type: "site-content",
11
+ url: '',
12
+ is_new_tab: false,
13
13
  ...(overrides.primary_button || {}),
14
14
  },
15
15
  }
16
-
17
16
  if (!withSecondary) {
18
17
  data.primary_button.name = 'Linked to';
19
18
  }