@visitscotland/component-library 5.1.0 → 5.1.2

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.
@@ -10827,9 +10827,7 @@ const Card = /* @__PURE__ */ _export_sfc(_sfc_main$1G, [["render", _sfc_render$1
10827
10827
  }, cookieValues$5 = {
10828
10828
  youtube: ["C0001", "C0004"],
10829
10829
  embed: ["C0001", "C0003", "C0004"]
10830
- }, cookieValues$4 = cookieValues$5.youtube;
10831
- let videoStore$1 = null;
10832
- const _sfc_main$1F = {
10830
+ }, cookieValues$4 = cookieValues$5.youtube, _sfc_main$1F = {
10833
10831
  name: "VsStretchedLinkCard",
10834
10832
  status: "prototype",
10835
10833
  release: "0.0.1",
@@ -10972,6 +10970,11 @@ const _sfc_main$1F = {
10972
10970
  default: !1
10973
10971
  }
10974
10972
  },
10973
+ setup() {
10974
+ return {
10975
+ videoStore: useVideoStore()
10976
+ };
10977
+ },
10975
10978
  data() {
10976
10979
  return {
10977
10980
  jsDisabled: !0,
@@ -10991,10 +10994,10 @@ const _sfc_main$1F = {
10991
10994
  return this.disabled && (e += "vs-stretched-link-card--disabled"), this.type === "video" && (e += " vs-stretched-link-card--video"), this.showWarning && this.type === "video" && (e += " vs-stretched-link-card--warning"), e;
10992
10995
  },
10993
10996
  videoDetails() {
10994
- return videoStore$1 ? videoStore$1.videos[this.videoId] : null;
10997
+ return this.videoStore ? this.videoStore.videos[this.videoId] : null;
10995
10998
  },
10996
10999
  videoLoaded() {
10997
- return typeof this.videoDetails < "u" && this.videoDetails !== null && this.videoDetails.videoDuration > 0;
11000
+ return typeof this.videoDetails < "u" && this.videoDetails.videoDuration > 0;
10998
11001
  },
10999
11002
  // Calculates if warning is showing and gives class for appropriate styles
11000
11003
  warningClass() {
@@ -11023,7 +11026,7 @@ const _sfc_main$1F = {
11023
11026
  }
11024
11027
  },
11025
11028
  mounted() {
11026
- videoStore$1 = useVideoStore(), this.jsDisabled = jsIsDisabled();
11029
+ this.jsDisabled = jsIsDisabled();
11027
11030
  },
11028
11031
  methods: {
11029
11032
  emitShowModal() {
@@ -24896,6 +24899,18 @@ const VsTextarea = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["render", _sfc_ren
24896
24899
  type: Boolean,
24897
24900
  default: !0
24898
24901
  },
24902
+ /**
24903
+ * For non-marketo forms this dictates which data processing layer the form uses - 'breg',
24904
+ * 'fepl', or 'dp'. This adjusts certain behaviour, for example the `exponea.identify()`
24905
+ * tracking is only desirable for breg forms.
24906
+ *
24907
+ * Defaults to breg as it is by far the most common form type, and from within the
24908
+ * freemarker sites we don't currently have access to the information to distinguish them.
24909
+ */
24910
+ submissionType: {
24911
+ type: String,
24912
+ default: "breg"
24913
+ },
24899
24914
  /**
24900
24915
  * The target url for the form, if not marketo
24901
24916
  */
@@ -25219,7 +25234,7 @@ const VsTextarea = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["render", _sfc_ren
25219
25234
  e.addHiddenFields(this.form), window.grecaptcha && e.addHiddenFields({
25220
25235
  lastReCAPTCHAUserFingerprint: window.grecaptcha.getResponse(),
25221
25236
  lastRecaptchaEnabledFormID: this.formId
25222
- }), e.onSuccess(() => (this.submitting = !1, this.submitted = !0, this.attachEmail(), !1)), e.onSubmit(() => {
25237
+ }), e.onSuccess(() => (this.submitting = !1, this.submitted = !0, !1)), e.onSubmit(() => {
25223
25238
  this.submitting = !0;
25224
25239
  }), e.submit();
25225
25240
  },
@@ -25242,11 +25257,11 @@ const VsTextarea = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["render", _sfc_ren
25242
25257
  ).then(() => (this.submitting = !1, this.submitted = !0, this.attachEmail(), !1)).catch(() => (this.submitError = !0, !1));
25243
25258
  },
25244
25259
  /**
25245
- * If exponea is present in the window (via gtm with accepted cookies), attach the
25246
- * current user to the record associated with their email address
25260
+ * If exponea is present in the window (via gtm with accepted cookies), and the form uses
25261
+ * BREG, attach the current user to the record associated with their email address
25247
25262
  */
25248
25263
  attachEmail() {
25249
- this.formData.fields.forEach((e) => {
25264
+ this.submissionType && this.submissionType === "breg" && (this.formData.fields.forEach((e) => {
25250
25265
  e.type === "email" && !this.emailFieldName && (this.emailFieldName = e.name);
25251
25266
  }), this.emailFieldName && typeof exponea < "u" && exponea.identify(
25252
25267
  {
@@ -25258,7 +25273,7 @@ const VsTextarea = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["render", _sfc_ren
25258
25273
  () => {
25259
25274
  },
25260
25275
  !0
25261
- );
25276
+ ));
25262
25277
  },
25263
25278
  /**
25264
25279
  * Checks recaptcha response from the server