@dcodegroup-au/page-builder 0.8.3 → 0.8.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.
@@ -727,6 +727,9 @@ select {
727
727
  .bottom-0 {
728
728
  bottom: 0px;
729
729
  }
730
+ .bottom-10 {
731
+ bottom: 2.5rem;
732
+ }
730
733
  .bottom-\[40px\] {
731
734
  bottom: 40px;
732
735
  }
@@ -867,9 +870,6 @@ select {
867
870
  .mr-3 {
868
871
  margin-right: 0.75rem;
869
872
  }
870
- .mr-6 {
871
- margin-right: 1.5rem;
872
- }
873
873
  .mr-\[40px\] {
874
874
  margin-right: 40px;
875
875
  }
@@ -1273,6 +1273,9 @@ select {
1273
1273
  .grid-cols-2 {
1274
1274
  grid-template-columns: repeat(2, minmax(0, 1fr));
1275
1275
  }
1276
+ .grid-cols-3 {
1277
+ grid-template-columns: repeat(3, minmax(0, 1fr));
1278
+ }
1276
1279
  .flex-row {
1277
1280
  flex-direction: row;
1278
1281
  }
@@ -1318,9 +1321,6 @@ select {
1318
1321
  .\!gap-4 {
1319
1322
  gap: 1rem !important;
1320
1323
  }
1321
- .gap-0 {
1322
- gap: 0px;
1323
- }
1324
1324
  .gap-1 {
1325
1325
  gap: 0.25rem;
1326
1326
  }
@@ -3152,6 +3152,14 @@ select {
3152
3152
  margin-top: 2rem;
3153
3153
  }
3154
3154
 
3155
+ .md\:grid {
3156
+ display: grid;
3157
+ }
3158
+
3159
+ .md\:hidden {
3160
+ display: none;
3161
+ }
3162
+
3155
3163
  .md\:h-5 {
3156
3164
  height: 1.25rem;
3157
3165
  }
@@ -3180,18 +3188,23 @@ select {
3180
3188
  max-width: 324px;
3181
3189
  }
3182
3190
 
3183
- .md\:grid-cols-2 {
3184
- grid-template-columns: repeat(2, minmax(0, 1fr));
3191
+ .md\:\!translate-x-0 {
3192
+ --tw-translate-x: 0px !important;
3193
+ transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)) !important;
3185
3194
  }
3186
3195
 
3187
- .md\:grid-cols-3 {
3188
- grid-template-columns: repeat(3, minmax(0, 1fr));
3196
+ .md\:grid-cols-2 {
3197
+ grid-template-columns: repeat(2, minmax(0, 1fr));
3189
3198
  }
3190
3199
 
3191
3200
  .md\:flex-row {
3192
3201
  flex-direction: row;
3193
3202
  }
3194
3203
 
3204
+ .md\:items-center {
3205
+ align-items: center;
3206
+ }
3207
+
3195
3208
  .md\:\!gap-8 {
3196
3209
  gap: 2rem !important;
3197
3210
  }
@@ -3235,6 +3248,11 @@ select {
3235
3248
  padding-right: 6rem;
3236
3249
  }
3237
3250
 
3251
+ .md\:px-4 {
3252
+ padding-left: 1rem;
3253
+ padding-right: 1rem;
3254
+ }
3255
+
3238
3256
  .md\:px-6 {
3239
3257
  padding-left: 1.5rem;
3240
3258
  padding-right: 1.5rem;
@@ -3895,7 +3913,7 @@ select {
3895
3913
  -webkit-line-clamp: 4; /* Limit the text to 3 lines */
3896
3914
  }
3897
3915
 
3898
- .card[data-v-aab1688f] {
3916
+ .card[data-v-269a5876] {
3899
3917
  display: flex;
3900
3918
  flex-direction: column;
3901
3919
  align-items: center;
@@ -45236,7 +45236,7 @@ const _hoisted_15$7 = {
45236
45236
  };
45237
45237
  const _hoisted_16$4 = ["onUpdate:modelValue", "maxlength"];
45238
45238
  const _hoisted_17$3 = ["onUpdate:modelValue", "maxlength"];
45239
- const _hoisted_18$3 = { key: 2 };
45239
+ const _hoisted_18$2 = { key: 2 };
45240
45240
  const _sfc_main$C = {
45241
45241
  __name: "Links",
45242
45242
  props: {
@@ -45436,7 +45436,7 @@ const _sfc_main$C = {
45436
45436
  sites: _ctx.sites,
45437
45437
  forms: __props.forms
45438
45438
  }, null, 8, ["name", "type", "onUpdate:type", "url", "onUpdate:url", "openInNewTab", "onUpdate:openInNewTab", "sites", "forms"])) : createCommentVNode("", true)
45439
- ])) : (openBlock(), createElementBlock("div", _hoisted_18$3, [
45439
+ ])) : (openBlock(), createElementBlock("div", _hoisted_18$2, [
45440
45440
  createVNode(_sfc_main$P, {
45441
45441
  "is-vertical": "",
45442
45442
  field: "image",
@@ -46195,7 +46195,7 @@ const _hoisted_15$6 = {
46195
46195
  };
46196
46196
  const _hoisted_16$3 = { class: "flex flex-col gap-1 pt-6 text-gray-600" };
46197
46197
  const _hoisted_17$2 = ["value"];
46198
- const _hoisted_18$2 = {
46198
+ const _hoisted_18$1 = {
46199
46199
  key: 1,
46200
46200
  class: "rounded-xl bg-gray-50 px-6 py-5"
46201
46201
  };
@@ -46360,7 +46360,7 @@ const _sfc_main$t = {
46360
46360
  _cache[2] || (_cache[2] = createElementVNode("p", null, "This sets the section name shown in the breadcrumb (e.g. Home / Who We Are / Page). Leave blank to skip the section.", -1))
46361
46361
  ])
46362
46362
  ])) : createCommentVNode("", true),
46363
- !unref(selected) ? (openBlock(), createElementBlock("div", _hoisted_18$2, [
46363
+ !unref(selected) ? (openBlock(), createElementBlock("div", _hoisted_18$1, [
46364
46364
  createVNode(Instructions)
46365
46365
  ])) : createCommentVNode("", true),
46366
46366
  (openBlock(), createBlock(resolveDynamicComponent(currentComponent.value), {
@@ -48545,13 +48545,13 @@ const _sfc_main$j = {
48545
48545
  var _a2;
48546
48546
  return openBlock(), createElementBlock("div", _hoisted_1$y, [
48547
48547
  createElementVNode("div", {
48548
- class: "slider-wrapper flex transition-transform duration-500 gap-0 mb-6",
48548
+ class: "slider-wrapper flex transition-transform duration-500 gap-6 mb-6",
48549
48549
  style: normalizeStyle({ transform: `translateX(-${currentSlide.value * ((windowWidth.value >= slideWidth.value ? slideWidth.value : windowWidth.value) + 24)}px)` })
48550
48550
  }, [
48551
48551
  (openBlock(), createElementBlock(Fragment, null, renderList(slides, (slide, index) => {
48552
48552
  return createElementVNode("div", {
48553
48553
  key: index,
48554
- class: normalizeClass(["slider-item flex-shrink-0 mr-6 w-[480px] max-w-full", { "h-[318px]": !__props.hasBackground, "h-full": __props.hasBackground }])
48554
+ class: normalizeClass(["slider-item flex-shrink-0 w-[480px] max-w-full", { "h-[318px]": !__props.hasBackground, "h-full": __props.hasBackground }])
48555
48555
  }, [
48556
48556
  createElementVNode("div", {
48557
48557
  class: normalizeClass(["w-full p-4 rounded-lg md:rounded-2xl", { "bg-gray-50 h-full flex flex-col justify-between": !__props.hasBackground, "bg-white": __props.hasBackground }])
@@ -48699,36 +48699,35 @@ function render$e(_ctx, _cache) {
48699
48699
  ]));
48700
48700
  }
48701
48701
  const PlayButton = { render: render$e };
48702
- const _hoisted_1$v = { class: "grid grid-cols-1 md:grid-cols-3 gap-6 w-full" };
48703
- const _hoisted_2$f = {
48702
+ const _hoisted_1$v = {
48704
48703
  key: 0,
48705
48704
  class: "relative group w-full object-cover rounded-lg md:rounded-2xl overflow-hidden"
48706
48705
  };
48707
- const _hoisted_3$f = {
48706
+ const _hoisted_2$f = {
48708
48707
  key: 0,
48709
48708
  class: "w-full h-[281px] md:rounded-2xl"
48710
48709
  };
48711
- const _hoisted_4$f = ["src"];
48712
- const _hoisted_5$f = ["onClick"];
48713
- const _hoisted_6$f = ["src"];
48714
- const _hoisted_7$e = ["href"];
48715
- const _hoisted_8$d = ["src"];
48716
- const _hoisted_9$d = ["href"];
48717
- const _hoisted_10$9 = { class: "flex flex-col gap-2 items-start text-left w-full" };
48718
- const _hoisted_11$8 = {
48710
+ const _hoisted_3$f = ["src"];
48711
+ const _hoisted_4$f = ["onClick"];
48712
+ const _hoisted_5$f = ["src"];
48713
+ const _hoisted_6$f = ["href"];
48714
+ const _hoisted_7$e = ["src"];
48715
+ const _hoisted_8$d = ["href"];
48716
+ const _hoisted_9$d = { class: "flex flex-col gap-2 items-start text-left w-full" };
48717
+ const _hoisted_10$9 = {
48719
48718
  key: 0,
48720
- class: "flex gap-2"
48719
+ class: "flex gap-2 flex-wrap"
48721
48720
  };
48721
+ const _hoisted_11$8 = ["href"];
48722
48722
  const _hoisted_12$6 = ["href"];
48723
- const _hoisted_13$6 = ["href"];
48724
- const _hoisted_14$5 = { class: "flex justify-between" };
48725
- const _hoisted_15$4 = ["innerHTML"];
48726
- const _hoisted_16$1 = { class: "text-gray-500 text-sm mb-4" };
48727
- const _hoisted_17$1 = {
48723
+ const _hoisted_13$6 = { class: "flex justify-between" };
48724
+ const _hoisted_14$5 = ["innerHTML"];
48725
+ const _hoisted_15$4 = { class: "text-gray-500 text-sm mb-4" };
48726
+ const _hoisted_16$1 = {
48728
48727
  key: 0,
48729
48728
  class: "flex justify-center"
48730
48729
  };
48731
- const _hoisted_18$1 = ["href", "target"];
48730
+ const _hoisted_17$1 = ["href", "target"];
48732
48731
  const _sfc_main$h = {
48733
48732
  __name: "CollectionGridPresenter",
48734
48733
  props: {
@@ -48740,6 +48739,37 @@ const _sfc_main$h = {
48740
48739
  setup(__props) {
48741
48740
  var _a, _b;
48742
48741
  const props = __props;
48742
+ const currentSlide = ref(0);
48743
+ const windowWidth = ref(480);
48744
+ const slideWidth = ref(480);
48745
+ onMounted(() => {
48746
+ windowWidth.value = window.innerWidth;
48747
+ slideWidth.value = windowWidth.value - 32;
48748
+ window.addEventListener("resize", updateWidth);
48749
+ });
48750
+ onUnmounted(() => {
48751
+ window.removeEventListener("resize", updateWidth);
48752
+ });
48753
+ const activeRightButton = computed(() => {
48754
+ return currentSlide.value <= items.length - 2;
48755
+ });
48756
+ const activeLeftButton = computed(() => {
48757
+ return currentSlide.value !== 0;
48758
+ });
48759
+ const updateWidth = () => {
48760
+ windowWidth.value = window.innerWidth;
48761
+ slideWidth.value = windowWidth.value - 32;
48762
+ };
48763
+ const nextSlide = () => {
48764
+ if (currentSlide.value <= items.length - 2) {
48765
+ currentSlide.value++;
48766
+ }
48767
+ };
48768
+ const prevSlide = () => {
48769
+ if (currentSlide.value > 0) {
48770
+ currentSlide.value--;
48771
+ }
48772
+ };
48743
48773
  let items = [];
48744
48774
  if (props.component.type === "news_grid") {
48745
48775
  items = [...((_a = props.component.content) == null ? void 0 : _a.items) || []];
@@ -48773,25 +48803,28 @@ const _sfc_main$h = {
48773
48803
  return `https://www.youtube.com/embed/${id}`;
48774
48804
  };
48775
48805
  return (_ctx, _cache) => {
48776
- var _a2, _b2;
48806
+ var _a2, _b2, _c;
48777
48807
  return openBlock(), createElementBlock("div", {
48778
- class: normalizeClass(["flex flex-col items-center gap-6 pb-[40px] pt-[24px]", { "!pt-0": __props.component.hasOwnProperty("padding_top") && !((_a2 = __props.component) == null ? void 0 : _a2.padding_top) }])
48808
+ class: normalizeClass(["flex flex-col items-start md:items-center gap-6 pb-[40px] pt-[24px] relative", { "!pt-0": __props.component.hasOwnProperty("padding_top") && !((_a2 = __props.component) == null ? void 0 : _a2.padding_top) }])
48779
48809
  }, [
48780
- createElementVNode("div", _hoisted_1$v, [
48810
+ createElementVNode("div", {
48811
+ class: "flex md:grid grid-cols-3 gap-6 w-full transition-transform duration-500 md:!translate-x-0",
48812
+ style: normalizeStyle({ transform: `translateX(-${currentSlide.value * ((windowWidth.value >= slideWidth.value ? slideWidth.value : windowWidth.value) + 24)}px)` })
48813
+ }, [
48781
48814
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(items), (card, index) => {
48782
48815
  return openBlock(), createElementBlock("div", {
48783
48816
  key: index,
48784
- class: "card bg-white sm:p-0 px-4 w-full"
48817
+ class: "card bg-white sm:p-0 md:px-4 w-full flex-shrink-0"
48785
48818
  }, [
48786
- __props.component.type === "video_grid" ? (openBlock(), createElementBlock("div", _hoisted_2$f, [
48787
- (card == null ? void 0 : card.youtube_url) && getEmbedUrl(card) ? (openBlock(), createElementBlock("div", _hoisted_3$f, [
48819
+ __props.component.type === "video_grid" ? (openBlock(), createElementBlock("div", _hoisted_1$v, [
48820
+ (card == null ? void 0 : card.youtube_url) && getEmbedUrl(card) ? (openBlock(), createElementBlock("div", _hoisted_2$f, [
48788
48821
  createElementVNode("iframe", {
48789
48822
  src: getEmbedUrl(card),
48790
48823
  frameborder: "0",
48791
48824
  allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",
48792
48825
  allowfullscreen: "",
48793
48826
  class: "w-full h-full"
48794
- }, null, 8, _hoisted_4$f)
48827
+ }, null, 8, _hoisted_3$f)
48795
48828
  ])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
48796
48829
  createElementVNode("video", {
48797
48830
  onClick: ($event) => togglePlayPause(index),
@@ -48804,8 +48837,8 @@ const _sfc_main$h = {
48804
48837
  }, [
48805
48838
  createElementVNode("source", {
48806
48839
  src: `${card.video}#t=2`
48807
- }, null, 8, _hoisted_6$f)
48808
- ], 8, _hoisted_5$f),
48840
+ }, null, 8, _hoisted_5$f)
48841
+ ], 8, _hoisted_4$f),
48809
48842
  !isPlaying.value[index] ? (openBlock(), createBlock(unref(PlayButton), {
48810
48843
  key: 0,
48811
48844
  class: "cursor-pointer absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 group-hover:opacity-100 transition-opacity",
@@ -48823,8 +48856,8 @@ const _sfc_main$h = {
48823
48856
  src: card.image,
48824
48857
  alt: "Card Image",
48825
48858
  class: "w-full h-[281px] object-cover rounded-lg md:rounded-2xl"
48826
- }, null, 8, _hoisted_8$d)
48827
- ], 8, _hoisted_7$e)) : (openBlock(), createElementBlock("a", {
48859
+ }, null, 8, _hoisted_7$e)
48860
+ ], 8, _hoisted_6$f)) : (openBlock(), createElementBlock("a", {
48828
48861
  key: 2,
48829
48862
  href: (card == null ? void 0 : card.link) ? unref(formatUrl)(card.link) : "javascript:void(0)",
48830
48863
  class: "mb-4 w-full",
@@ -48836,15 +48869,15 @@ const _sfc_main$h = {
48836
48869
  alt: "No Available",
48837
48870
  src: _imports_0
48838
48871
  }, null, -1)
48839
- ]), 8, _hoisted_9$d)),
48840
- createElementVNode("div", _hoisted_10$9, [
48841
- card.categories && card.categories.length ? (openBlock(), createElementBlock("div", _hoisted_11$8, [
48872
+ ]), 8, _hoisted_8$d)),
48873
+ createElementVNode("div", _hoisted_9$d, [
48874
+ card.categories && card.categories.length ? (openBlock(), createElementBlock("div", _hoisted_10$9, [
48842
48875
  (openBlock(true), createElementBlock(Fragment, null, renderList(card.categories, (tag) => {
48843
48876
  return openBlock(), createElementBlock("a", {
48844
48877
  key: tag,
48845
48878
  href: tag.link ? unref(formatUrl)(tag.link) : "javascript:void(0)",
48846
48879
  class: normalizeClass(["border py-0.5 px-1.5 text-xs font-medium bg-gray-blue-50 border-gray-blue-200 text-gray-blue-700 rounded-md", tag.link ? "hover:bg-gray-200" : "cursor-default"])
48847
- }, toDisplayString(tag.name), 11, _hoisted_12$6);
48880
+ }, toDisplayString(tag.name), 11, _hoisted_11$8);
48848
48881
  }), 128))
48849
48882
  ])) : createCommentVNode("", true),
48850
48883
  (card == null ? void 0 : card.link) ? (openBlock(), createElementBlock("a", {
@@ -48854,20 +48887,36 @@ const _sfc_main$h = {
48854
48887
  target: "_blank",
48855
48888
  rel: "noopener noreferrer"
48856
48889
  }, [
48857
- createElementVNode("div", _hoisted_14$5, [
48890
+ createElementVNode("div", _hoisted_13$6, [
48858
48891
  createElementVNode("span", {
48859
48892
  class: "w-5/6 leading-[28px]",
48860
48893
  innerHTML: card.title
48861
- }, null, 8, _hoisted_15$4),
48894
+ }, null, 8, _hoisted_14$5),
48862
48895
  createVNode(unref(ArrowUpRight), { class: "w-5 h-5 mt-1" })
48863
48896
  ])
48864
- ], 8, _hoisted_13$6)) : createCommentVNode("", true),
48865
- createElementVNode("p", _hoisted_16$1, toDisplayString(card.dateTime), 1)
48897
+ ], 8, _hoisted_12$6)) : createCommentVNode("", true),
48898
+ createElementVNode("p", _hoisted_15$4, toDisplayString(card.dateTime), 1)
48866
48899
  ])
48867
48900
  ]);
48868
48901
  }), 128))
48869
- ]),
48870
- Object.keys(unref(button)).length && ((_b2 = unref(button)) == null ? void 0 : _b2.show) ? (openBlock(), createElementBlock("div", _hoisted_17$1, [
48902
+ ], 4),
48903
+ createElementVNode("div", {
48904
+ class: normalizeClass(["md:hidden absolute right-0 flex gap-4", Object.keys(unref(button)).length && ((_b2 = unref(button)) == null ? void 0 : _b2.show) ? "bottom-10" : "bottom-0"])
48905
+ }, [
48906
+ createElementVNode("button", {
48907
+ onClick: prevSlide,
48908
+ class: normalizeClass(["p-2.5 bg-aqua-100 text-navy-800 rounded-full opacity-100", { "opacity-50 pointer-events-none": !activeLeftButton.value }])
48909
+ }, [
48910
+ createVNode(unref(ChevronLeft), { class: "w-6 h-6" })
48911
+ ], 2),
48912
+ createElementVNode("button", {
48913
+ onClick: nextSlide,
48914
+ class: normalizeClass(["p-2.5 bg-aqua-100 text-navy-800 rounded-full opacity-100", { "opacity-50 pointer-events-auto": !activeRightButton.value }])
48915
+ }, [
48916
+ createVNode(unref(ChevronRight), { class: "w-6 h-6" })
48917
+ ], 2)
48918
+ ], 2),
48919
+ Object.keys(unref(button)).length && ((_c = unref(button)) == null ? void 0 : _c.show) ? (openBlock(), createElementBlock("div", _hoisted_16$1, [
48871
48920
  createElementVNode("a", {
48872
48921
  class: "border-brand-300 hover:border-brand-700 border text-brand-700 h-[44px] rounded-full px-[14px] py-[10px] inline-flex gap-1.5 items-center font-semibold text-base",
48873
48922
  href: unref(formatUrl)(unref(button).url),
@@ -48875,13 +48924,13 @@ const _sfc_main$h = {
48875
48924
  }, [
48876
48925
  createTextVNode(toDisplayString(unref(button).title) + " ", 1),
48877
48926
  createVNode(unref(ArrowUpRight), { class: "w-5 h-5" })
48878
- ], 8, _hoisted_18$1)
48927
+ ], 8, _hoisted_17$1)
48879
48928
  ])) : createCommentVNode("", true)
48880
48929
  ], 2);
48881
48930
  };
48882
48931
  }
48883
48932
  };
48884
- const CollectionGridPresenter = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-aab1688f"]]);
48933
+ const CollectionGridPresenter = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-269a5876"]]);
48885
48934
  const _hoisted_1$u = { class: "overflow-hidden" };
48886
48935
  const _sfc_main$g = {
48887
48936
  __name: "CollectionGrid",
@@ -45239,7 +45239,7 @@ ${escapeText(this.code(index, length))}
45239
45239
  };
45240
45240
  const _hoisted_16$4 = ["onUpdate:modelValue", "maxlength"];
45241
45241
  const _hoisted_17$3 = ["onUpdate:modelValue", "maxlength"];
45242
- const _hoisted_18$3 = { key: 2 };
45242
+ const _hoisted_18$2 = { key: 2 };
45243
45243
  const _sfc_main$C = {
45244
45244
  __name: "Links",
45245
45245
  props: {
@@ -45439,7 +45439,7 @@ ${escapeText(this.code(index, length))}
45439
45439
  sites: _ctx.sites,
45440
45440
  forms: __props.forms
45441
45441
  }, null, 8, ["name", "type", "onUpdate:type", "url", "onUpdate:url", "openInNewTab", "onUpdate:openInNewTab", "sites", "forms"])) : vue.createCommentVNode("", true)
45442
- ])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_18$3, [
45442
+ ])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_18$2, [
45443
45443
  vue.createVNode(_sfc_main$P, {
45444
45444
  "is-vertical": "",
45445
45445
  field: "image",
@@ -46198,7 +46198,7 @@ ${escapeText(this.code(index, length))}
46198
46198
  };
46199
46199
  const _hoisted_16$3 = { class: "flex flex-col gap-1 pt-6 text-gray-600" };
46200
46200
  const _hoisted_17$2 = ["value"];
46201
- const _hoisted_18$2 = {
46201
+ const _hoisted_18$1 = {
46202
46202
  key: 1,
46203
46203
  class: "rounded-xl bg-gray-50 px-6 py-5"
46204
46204
  };
@@ -46363,7 +46363,7 @@ ${escapeText(this.code(index, length))}
46363
46363
  _cache[2] || (_cache[2] = vue.createElementVNode("p", null, "This sets the section name shown in the breadcrumb (e.g. Home / Who We Are / Page). Leave blank to skip the section.", -1))
46364
46364
  ])
46365
46365
  ])) : vue.createCommentVNode("", true),
46366
- !vue.unref(selected) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_18$2, [
46366
+ !vue.unref(selected) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_18$1, [
46367
46367
  vue.createVNode(Instructions)
46368
46368
  ])) : vue.createCommentVNode("", true),
46369
46369
  (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(currentComponent.value), {
@@ -48548,13 +48548,13 @@ ${escapeText(this.code(index, length))}
48548
48548
  var _a2;
48549
48549
  return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$y, [
48550
48550
  vue.createElementVNode("div", {
48551
- class: "slider-wrapper flex transition-transform duration-500 gap-0 mb-6",
48551
+ class: "slider-wrapper flex transition-transform duration-500 gap-6 mb-6",
48552
48552
  style: vue.normalizeStyle({ transform: `translateX(-${currentSlide.value * ((windowWidth.value >= slideWidth.value ? slideWidth.value : windowWidth.value) + 24)}px)` })
48553
48553
  }, [
48554
48554
  (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(slides, (slide, index) => {
48555
48555
  return vue.createElementVNode("div", {
48556
48556
  key: index,
48557
- class: vue.normalizeClass(["slider-item flex-shrink-0 mr-6 w-[480px] max-w-full", { "h-[318px]": !__props.hasBackground, "h-full": __props.hasBackground }])
48557
+ class: vue.normalizeClass(["slider-item flex-shrink-0 w-[480px] max-w-full", { "h-[318px]": !__props.hasBackground, "h-full": __props.hasBackground }])
48558
48558
  }, [
48559
48559
  vue.createElementVNode("div", {
48560
48560
  class: vue.normalizeClass(["w-full p-4 rounded-lg md:rounded-2xl", { "bg-gray-50 h-full flex flex-col justify-between": !__props.hasBackground, "bg-white": __props.hasBackground }])
@@ -48702,36 +48702,35 @@ ${escapeText(this.code(index, length))}
48702
48702
  ]));
48703
48703
  }
48704
48704
  const PlayButton = { render: render$e };
48705
- const _hoisted_1$v = { class: "grid grid-cols-1 md:grid-cols-3 gap-6 w-full" };
48706
- const _hoisted_2$f = {
48705
+ const _hoisted_1$v = {
48707
48706
  key: 0,
48708
48707
  class: "relative group w-full object-cover rounded-lg md:rounded-2xl overflow-hidden"
48709
48708
  };
48710
- const _hoisted_3$f = {
48709
+ const _hoisted_2$f = {
48711
48710
  key: 0,
48712
48711
  class: "w-full h-[281px] md:rounded-2xl"
48713
48712
  };
48714
- const _hoisted_4$f = ["src"];
48715
- const _hoisted_5$f = ["onClick"];
48716
- const _hoisted_6$f = ["src"];
48717
- const _hoisted_7$e = ["href"];
48718
- const _hoisted_8$d = ["src"];
48719
- const _hoisted_9$d = ["href"];
48720
- const _hoisted_10$9 = { class: "flex flex-col gap-2 items-start text-left w-full" };
48721
- const _hoisted_11$8 = {
48713
+ const _hoisted_3$f = ["src"];
48714
+ const _hoisted_4$f = ["onClick"];
48715
+ const _hoisted_5$f = ["src"];
48716
+ const _hoisted_6$f = ["href"];
48717
+ const _hoisted_7$e = ["src"];
48718
+ const _hoisted_8$d = ["href"];
48719
+ const _hoisted_9$d = { class: "flex flex-col gap-2 items-start text-left w-full" };
48720
+ const _hoisted_10$9 = {
48722
48721
  key: 0,
48723
- class: "flex gap-2"
48722
+ class: "flex gap-2 flex-wrap"
48724
48723
  };
48724
+ const _hoisted_11$8 = ["href"];
48725
48725
  const _hoisted_12$6 = ["href"];
48726
- const _hoisted_13$6 = ["href"];
48727
- const _hoisted_14$5 = { class: "flex justify-between" };
48728
- const _hoisted_15$4 = ["innerHTML"];
48729
- const _hoisted_16$1 = { class: "text-gray-500 text-sm mb-4" };
48730
- const _hoisted_17$1 = {
48726
+ const _hoisted_13$6 = { class: "flex justify-between" };
48727
+ const _hoisted_14$5 = ["innerHTML"];
48728
+ const _hoisted_15$4 = { class: "text-gray-500 text-sm mb-4" };
48729
+ const _hoisted_16$1 = {
48731
48730
  key: 0,
48732
48731
  class: "flex justify-center"
48733
48732
  };
48734
- const _hoisted_18$1 = ["href", "target"];
48733
+ const _hoisted_17$1 = ["href", "target"];
48735
48734
  const _sfc_main$h = {
48736
48735
  __name: "CollectionGridPresenter",
48737
48736
  props: {
@@ -48743,6 +48742,37 @@ ${escapeText(this.code(index, length))}
48743
48742
  setup(__props) {
48744
48743
  var _a, _b;
48745
48744
  const props = __props;
48745
+ const currentSlide = vue.ref(0);
48746
+ const windowWidth = vue.ref(480);
48747
+ const slideWidth = vue.ref(480);
48748
+ vue.onMounted(() => {
48749
+ windowWidth.value = window.innerWidth;
48750
+ slideWidth.value = windowWidth.value - 32;
48751
+ window.addEventListener("resize", updateWidth);
48752
+ });
48753
+ vue.onUnmounted(() => {
48754
+ window.removeEventListener("resize", updateWidth);
48755
+ });
48756
+ const activeRightButton = vue.computed(() => {
48757
+ return currentSlide.value <= items.length - 2;
48758
+ });
48759
+ const activeLeftButton = vue.computed(() => {
48760
+ return currentSlide.value !== 0;
48761
+ });
48762
+ const updateWidth = () => {
48763
+ windowWidth.value = window.innerWidth;
48764
+ slideWidth.value = windowWidth.value - 32;
48765
+ };
48766
+ const nextSlide = () => {
48767
+ if (currentSlide.value <= items.length - 2) {
48768
+ currentSlide.value++;
48769
+ }
48770
+ };
48771
+ const prevSlide = () => {
48772
+ if (currentSlide.value > 0) {
48773
+ currentSlide.value--;
48774
+ }
48775
+ };
48746
48776
  let items = [];
48747
48777
  if (props.component.type === "news_grid") {
48748
48778
  items = [...((_a = props.component.content) == null ? void 0 : _a.items) || []];
@@ -48776,25 +48806,28 @@ ${escapeText(this.code(index, length))}
48776
48806
  return `https://www.youtube.com/embed/${id}`;
48777
48807
  };
48778
48808
  return (_ctx, _cache) => {
48779
- var _a2, _b2;
48809
+ var _a2, _b2, _c;
48780
48810
  return vue.openBlock(), vue.createElementBlock("div", {
48781
- class: vue.normalizeClass(["flex flex-col items-center gap-6 pb-[40px] pt-[24px]", { "!pt-0": __props.component.hasOwnProperty("padding_top") && !((_a2 = __props.component) == null ? void 0 : _a2.padding_top) }])
48811
+ class: vue.normalizeClass(["flex flex-col items-start md:items-center gap-6 pb-[40px] pt-[24px] relative", { "!pt-0": __props.component.hasOwnProperty("padding_top") && !((_a2 = __props.component) == null ? void 0 : _a2.padding_top) }])
48782
48812
  }, [
48783
- vue.createElementVNode("div", _hoisted_1$v, [
48813
+ vue.createElementVNode("div", {
48814
+ class: "flex md:grid grid-cols-3 gap-6 w-full transition-transform duration-500 md:!translate-x-0",
48815
+ style: vue.normalizeStyle({ transform: `translateX(-${currentSlide.value * ((windowWidth.value >= slideWidth.value ? slideWidth.value : windowWidth.value) + 24)}px)` })
48816
+ }, [
48784
48817
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(items), (card, index) => {
48785
48818
  return vue.openBlock(), vue.createElementBlock("div", {
48786
48819
  key: index,
48787
- class: "card bg-white sm:p-0 px-4 w-full"
48820
+ class: "card bg-white sm:p-0 md:px-4 w-full flex-shrink-0"
48788
48821
  }, [
48789
- __props.component.type === "video_grid" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$f, [
48790
- (card == null ? void 0 : card.youtube_url) && getEmbedUrl(card) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$f, [
48822
+ __props.component.type === "video_grid" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$v, [
48823
+ (card == null ? void 0 : card.youtube_url) && getEmbedUrl(card) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$f, [
48791
48824
  vue.createElementVNode("iframe", {
48792
48825
  src: getEmbedUrl(card),
48793
48826
  frameborder: "0",
48794
48827
  allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",
48795
48828
  allowfullscreen: "",
48796
48829
  class: "w-full h-full"
48797
- }, null, 8, _hoisted_4$f)
48830
+ }, null, 8, _hoisted_3$f)
48798
48831
  ])) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
48799
48832
  vue.createElementVNode("video", {
48800
48833
  onClick: ($event) => togglePlayPause(index),
@@ -48807,8 +48840,8 @@ ${escapeText(this.code(index, length))}
48807
48840
  }, [
48808
48841
  vue.createElementVNode("source", {
48809
48842
  src: `${card.video}#t=2`
48810
- }, null, 8, _hoisted_6$f)
48811
- ], 8, _hoisted_5$f),
48843
+ }, null, 8, _hoisted_5$f)
48844
+ ], 8, _hoisted_4$f),
48812
48845
  !isPlaying.value[index] ? (vue.openBlock(), vue.createBlock(vue.unref(PlayButton), {
48813
48846
  key: 0,
48814
48847
  class: "cursor-pointer absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 group-hover:opacity-100 transition-opacity",
@@ -48826,8 +48859,8 @@ ${escapeText(this.code(index, length))}
48826
48859
  src: card.image,
48827
48860
  alt: "Card Image",
48828
48861
  class: "w-full h-[281px] object-cover rounded-lg md:rounded-2xl"
48829
- }, null, 8, _hoisted_8$d)
48830
- ], 8, _hoisted_7$e)) : (vue.openBlock(), vue.createElementBlock("a", {
48862
+ }, null, 8, _hoisted_7$e)
48863
+ ], 8, _hoisted_6$f)) : (vue.openBlock(), vue.createElementBlock("a", {
48831
48864
  key: 2,
48832
48865
  href: (card == null ? void 0 : card.link) ? vue.unref(formatUrl)(card.link) : "javascript:void(0)",
48833
48866
  class: "mb-4 w-full",
@@ -48839,15 +48872,15 @@ ${escapeText(this.code(index, length))}
48839
48872
  alt: "No Available",
48840
48873
  src: _imports_0
48841
48874
  }, null, -1)
48842
- ]), 8, _hoisted_9$d)),
48843
- vue.createElementVNode("div", _hoisted_10$9, [
48844
- card.categories && card.categories.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_11$8, [
48875
+ ]), 8, _hoisted_8$d)),
48876
+ vue.createElementVNode("div", _hoisted_9$d, [
48877
+ card.categories && card.categories.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_10$9, [
48845
48878
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(card.categories, (tag) => {
48846
48879
  return vue.openBlock(), vue.createElementBlock("a", {
48847
48880
  key: tag,
48848
48881
  href: tag.link ? vue.unref(formatUrl)(tag.link) : "javascript:void(0)",
48849
48882
  class: vue.normalizeClass(["border py-0.5 px-1.5 text-xs font-medium bg-gray-blue-50 border-gray-blue-200 text-gray-blue-700 rounded-md", tag.link ? "hover:bg-gray-200" : "cursor-default"])
48850
- }, vue.toDisplayString(tag.name), 11, _hoisted_12$6);
48883
+ }, vue.toDisplayString(tag.name), 11, _hoisted_11$8);
48851
48884
  }), 128))
48852
48885
  ])) : vue.createCommentVNode("", true),
48853
48886
  (card == null ? void 0 : card.link) ? (vue.openBlock(), vue.createElementBlock("a", {
@@ -48857,20 +48890,36 @@ ${escapeText(this.code(index, length))}
48857
48890
  target: "_blank",
48858
48891
  rel: "noopener noreferrer"
48859
48892
  }, [
48860
- vue.createElementVNode("div", _hoisted_14$5, [
48893
+ vue.createElementVNode("div", _hoisted_13$6, [
48861
48894
  vue.createElementVNode("span", {
48862
48895
  class: "w-5/6 leading-[28px]",
48863
48896
  innerHTML: card.title
48864
- }, null, 8, _hoisted_15$4),
48897
+ }, null, 8, _hoisted_14$5),
48865
48898
  vue.createVNode(vue.unref(ArrowUpRight), { class: "w-5 h-5 mt-1" })
48866
48899
  ])
48867
- ], 8, _hoisted_13$6)) : vue.createCommentVNode("", true),
48868
- vue.createElementVNode("p", _hoisted_16$1, vue.toDisplayString(card.dateTime), 1)
48900
+ ], 8, _hoisted_12$6)) : vue.createCommentVNode("", true),
48901
+ vue.createElementVNode("p", _hoisted_15$4, vue.toDisplayString(card.dateTime), 1)
48869
48902
  ])
48870
48903
  ]);
48871
48904
  }), 128))
48872
- ]),
48873
- Object.keys(vue.unref(button)).length && ((_b2 = vue.unref(button)) == null ? void 0 : _b2.show) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_17$1, [
48905
+ ], 4),
48906
+ vue.createElementVNode("div", {
48907
+ class: vue.normalizeClass(["md:hidden absolute right-0 flex gap-4", Object.keys(vue.unref(button)).length && ((_b2 = vue.unref(button)) == null ? void 0 : _b2.show) ? "bottom-10" : "bottom-0"])
48908
+ }, [
48909
+ vue.createElementVNode("button", {
48910
+ onClick: prevSlide,
48911
+ class: vue.normalizeClass(["p-2.5 bg-aqua-100 text-navy-800 rounded-full opacity-100", { "opacity-50 pointer-events-none": !activeLeftButton.value }])
48912
+ }, [
48913
+ vue.createVNode(vue.unref(ChevronLeft), { class: "w-6 h-6" })
48914
+ ], 2),
48915
+ vue.createElementVNode("button", {
48916
+ onClick: nextSlide,
48917
+ class: vue.normalizeClass(["p-2.5 bg-aqua-100 text-navy-800 rounded-full opacity-100", { "opacity-50 pointer-events-auto": !activeRightButton.value }])
48918
+ }, [
48919
+ vue.createVNode(vue.unref(ChevronRight), { class: "w-6 h-6" })
48920
+ ], 2)
48921
+ ], 2),
48922
+ Object.keys(vue.unref(button)).length && ((_c = vue.unref(button)) == null ? void 0 : _c.show) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_16$1, [
48874
48923
  vue.createElementVNode("a", {
48875
48924
  class: "border-brand-300 hover:border-brand-700 border text-brand-700 h-[44px] rounded-full px-[14px] py-[10px] inline-flex gap-1.5 items-center font-semibold text-base",
48876
48925
  href: vue.unref(formatUrl)(vue.unref(button).url),
@@ -48878,13 +48927,13 @@ ${escapeText(this.code(index, length))}
48878
48927
  }, [
48879
48928
  vue.createTextVNode(vue.toDisplayString(vue.unref(button).title) + " ", 1),
48880
48929
  vue.createVNode(vue.unref(ArrowUpRight), { class: "w-5 h-5" })
48881
- ], 8, _hoisted_18$1)
48930
+ ], 8, _hoisted_17$1)
48882
48931
  ])) : vue.createCommentVNode("", true)
48883
48932
  ], 2);
48884
48933
  };
48885
48934
  }
48886
48935
  };
48887
- const CollectionGridPresenter = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-aab1688f"]]);
48936
+ const CollectionGridPresenter = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-269a5876"]]);
48888
48937
  const _hoisted_1$u = { class: "overflow-hidden" };
48889
48938
  const _sfc_main$g = {
48890
48939
  __name: "CollectionGrid",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcodegroup-au/page-builder",
3
- "version": "0.8.3",
3
+ "version": "0.8.4",
4
4
  "exports": {
5
5
  ".": {
6
6
  "import": "./dist/page-builder.es.js"
@@ -2,13 +2,13 @@
2
2
  <div class="relative">
3
3
  <!-- Slider Wrapper -->
4
4
  <div
5
- class="slider-wrapper flex transition-transform duration-500 gap-0 mb-6"
5
+ class="slider-wrapper flex transition-transform duration-500 gap-6 mb-6"
6
6
  :style="{ transform: `translateX(-${currentSlide * ((windowWidth >= slideWidth ? slideWidth : windowWidth) + 24)}px)` }"
7
7
  >
8
8
  <div
9
9
  v-for="(slide, index) in slides"
10
10
  :key="index"
11
- class="slider-item flex-shrink-0 mr-6 w-[480px] max-w-full"
11
+ class="slider-item flex-shrink-0 w-[480px] max-w-full"
12
12
  :class="{'h-[318px]': !hasBackground, 'h-full': hasBackground}"
13
13
  >
14
14
  <div class="w-full p-4 rounded-lg md:rounded-2xl" :class="{'bg-gray-50 h-full flex flex-col justify-between': !hasBackground, 'bg-white': hasBackground}">
@@ -119,8 +119,8 @@ const props = defineProps({
119
119
  const currentSlide = ref(0); // Start at 0
120
120
  const itemsToShow = ref(4); // Number of items to show at a time
121
121
  const slides = [...props.component.content?.items || []];
122
- const windowWidth = ref(480)
123
- const slideWidth = ref(480)
122
+ const windowWidth = ref(480);
123
+ const slideWidth = ref(480);
124
124
 
125
125
  onMounted(() => {
126
126
  windowWidth.value = window.innerWidth
@@ -1,7 +1,9 @@
1
1
  <template>
2
- <div class="flex flex-col items-center gap-6 pb-[40px] pt-[24px]" :class="{'!pt-0': component.hasOwnProperty('padding_top') && !component?.padding_top}">
3
- <div class="grid grid-cols-1 md:grid-cols-3 gap-6 w-full">
4
- <div v-for="(card, index) in items" :key="index" class="card bg-white sm:p-0 px-4 w-full">
2
+ <div class="flex flex-col items-start md:items-center gap-6 pb-[40px] pt-[24px] relative" :class="{'!pt-0': component.hasOwnProperty('padding_top') && !component?.padding_top}">
3
+ <div class="flex md:grid grid-cols-3 gap-6 w-full transition-transform duration-500 md:!translate-x-0"
4
+ :style="{ transform: `translateX(-${currentSlide * ((windowWidth >= slideWidth ? slideWidth : windowWidth) + 24)}px)` }"
5
+ >
6
+ <div v-for="(card, index) in items" :key="index" class="card bg-white sm:p-0 md:px-4 w-full flex-shrink-0">
5
7
  <div v-if="component.type === 'video_grid'" class="relative group w-full object-cover rounded-lg md:rounded-2xl overflow-hidden">
6
8
  <div v-if="card?.youtube_url && getEmbedUrl(card)" class="w-full h-[281px] md:rounded-2xl">
7
9
  <iframe
@@ -48,7 +50,7 @@
48
50
  <img class="w-full h-[281px] object-cover rounded-lg md:rounded-2xl" alt="No Available" src="@/assets/img/no_image_available.jpeg">
49
51
  </a>
50
52
  <div class="flex flex-col gap-2 items-start text-left w-full">
51
- <div v-if="card.categories && card.categories.length" class="flex gap-2">
53
+ <div v-if="card.categories && card.categories.length" class="flex gap-2 flex-wrap">
52
54
  <a
53
55
  v-for="tag in card.categories"
54
56
  :key="tag"
@@ -75,6 +77,25 @@
75
77
  </div>
76
78
  </div>
77
79
  </div>
80
+ <!-- Control Buttons -->
81
+ <div class="md:hidden absolute right-0 flex gap-4"
82
+ :class="Object.keys(button).length && button?.show ? 'bottom-10' : 'bottom-0'"
83
+ >
84
+ <button
85
+ @click="prevSlide"
86
+ class="p-2.5 bg-aqua-100 text-navy-800 rounded-full opacity-100"
87
+ :class="{'opacity-50 pointer-events-none': !activeLeftButton}"
88
+ >
89
+ <ChevronLeft class="w-6 h-6" />
90
+ </button>
91
+ <button
92
+ @click="nextSlide"
93
+ class="p-2.5 bg-aqua-100 text-navy-800 rounded-full opacity-100"
94
+ :class="{'opacity-50 pointer-events-auto': !activeRightButton}"
95
+ >
96
+ <ChevronRight class="w-6 h-6" />
97
+ </button>
98
+ </div>
78
99
  <div v-if="Object.keys(button).length && button?.show" class="flex justify-center">
79
100
  <a
80
101
  class="border-brand-300 hover:border-brand-700 border text-brand-700 h-[44px] rounded-full px-[14px] py-[10px] inline-flex gap-1.5 items-center font-semibold text-base"
@@ -89,7 +110,9 @@
89
110
  </template>
90
111
 
91
112
  <script setup>
92
- import { ref } from "vue";
113
+ import { ref, onMounted, onUnmounted, computed } from 'vue';
114
+ import ChevronRight from "@/assets/img/icons/chevron-right.svg";
115
+ import ChevronLeft from "@/assets/img/icons/chevron-left.svg";
93
116
  import ArrowUpRight from "@/assets/img/icons/arrow-up-right.svg";
94
117
  import PlayButton from "@/assets/svg/play.svg";
95
118
  import { formatUrl } from "@/components/helpers/common";
@@ -101,6 +124,47 @@ const props = defineProps({
101
124
  },
102
125
  });
103
126
 
127
+ const currentSlide = ref(0);
128
+ const windowWidth = ref(480);
129
+ const slideWidth = ref(480);
130
+
131
+ onMounted(() => {
132
+ windowWidth.value = window.innerWidth
133
+ slideWidth.value = windowWidth.value - 32;
134
+ window.addEventListener('resize', updateWidth)
135
+ })
136
+
137
+ onUnmounted(() => {
138
+ window.removeEventListener('resize', updateWidth)
139
+ })
140
+
141
+ const activeRightButton = computed(() => {
142
+ return currentSlide.value <= items.length - 2;
143
+ })
144
+
145
+ const activeLeftButton = computed(() => {
146
+ return currentSlide.value !== 0;
147
+ })
148
+
149
+ const updateWidth = () => {
150
+ windowWidth.value = window.innerWidth;
151
+ slideWidth.value = windowWidth.value - 32;
152
+ }
153
+
154
+ // Navigate to the next slide
155
+ const nextSlide = () => {
156
+ if (currentSlide.value <= items.length - 2) {
157
+ currentSlide.value++;
158
+ }
159
+ };
160
+
161
+ // Navigate to the previous slide
162
+ const prevSlide = () => {
163
+ if (currentSlide.value > 0) {
164
+ currentSlide.value--;
165
+ }
166
+ };
167
+
104
168
  let items = [];
105
169
  if (props.component.type === 'news_grid') {
106
170
  items = [...props.component.content?.items || []];