@burdenoff/website-sdk 2026.1003.2 → 2026.1003.3
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/components/contact.js +26 -5
- package/dist/components/contact.js.map +1 -1
- package/dist/components/contact.mjs +27 -6
- package/dist/components/contact.mjs.map +1 -1
- package/dist/components/newsletter.js +17 -2
- package/dist/components/newsletter.js.map +1 -1
- package/dist/components/newsletter.mjs +18 -3
- package/dist/components/newsletter.mjs.map +1 -1
- package/dist/components/partners.js +26 -5
- package/dist/components/partners.js.map +1 -1
- package/dist/components/partners.mjs +27 -6
- package/dist/components/partners.mjs.map +1 -1
- package/dist/index.js +34 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +34 -9
- package/dist/index.mjs.map +1 -1
- package/dist/store/index.js +2 -2
- package/dist/store/index.js.map +1 -1
- package/dist/store/index.mjs +2 -2
- package/dist/store/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { createContext, useState, useEffect, useContext, useRef } from 'react';
|
|
2
|
+
import { createContext, useState, useEffect, useContext, useRef, useCallback } from 'react';
|
|
3
3
|
import { Mail, Phone, MapPin, Clock, Send, FileText, Download } from 'lucide-react';
|
|
4
4
|
import ReCAPTCHA from 'react-google-recaptcha';
|
|
5
5
|
import { toast } from 'sonner';
|
|
@@ -242,6 +242,17 @@ function useWebSDKConfig() {
|
|
|
242
242
|
const client = useWebSDK();
|
|
243
243
|
return client.getConfig();
|
|
244
244
|
}
|
|
245
|
+
var RECAPTCHA_WIDGET_HEIGHT = 78;
|
|
246
|
+
function useDeferredRecaptcha(siteKey) {
|
|
247
|
+
const [engaged, setEngaged] = useState(false);
|
|
248
|
+
const arm = useCallback(() => setEngaged(true), []);
|
|
249
|
+
const enabled = siteKey.length > 0;
|
|
250
|
+
return {
|
|
251
|
+
armed: enabled && engaged,
|
|
252
|
+
arm,
|
|
253
|
+
formProps: enabled && !engaged ? { onFocus: arm, onPointerDown: arm } : {}
|
|
254
|
+
};
|
|
255
|
+
}
|
|
245
256
|
|
|
246
257
|
// src/utils/product-slug.ts
|
|
247
258
|
var PRODUCT_SLUG_RENAMES = Object.freeze(
|
|
@@ -545,12 +556,14 @@ function ContactPage({
|
|
|
545
556
|
const displayName = productName ?? product?.name ?? config.productId;
|
|
546
557
|
const effectiveRecaptchaSiteKey = recaptchaSiteKey ?? product?.recaptchaSiteKey ?? config.recaptchaSiteKey ?? "";
|
|
547
558
|
const recaptchaRef = useRef(null);
|
|
559
|
+
const recaptchaGate = useDeferredRecaptcha(effectiveRecaptchaSiteKey);
|
|
548
560
|
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
549
561
|
const [submitStatus, setSubmitStatus] = useState("idle");
|
|
550
562
|
const handleSubmit = async (e) => {
|
|
551
563
|
e.preventDefault();
|
|
552
564
|
const recaptchaToken = recaptchaRef.current?.getValue() ?? "";
|
|
553
565
|
if (effectiveRecaptchaSiteKey && !recaptchaToken) {
|
|
566
|
+
recaptchaGate.arm();
|
|
554
567
|
toast.error("Please complete the reCAPTCHA verification");
|
|
555
568
|
return;
|
|
556
569
|
}
|
|
@@ -677,6 +690,7 @@ function ContactPage({
|
|
|
677
690
|
{
|
|
678
691
|
onSubmit: handleSubmit,
|
|
679
692
|
className: "space-y-4 sm:space-y-6",
|
|
693
|
+
...recaptchaGate.formProps,
|
|
680
694
|
children: [
|
|
681
695
|
/* @__PURE__ */ jsxs("div", { className: "grid sm:grid-cols-2 gap-4 sm:gap-6", children: [
|
|
682
696
|
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
@@ -801,13 +815,20 @@ function ContactPage({
|
|
|
801
815
|
)
|
|
802
816
|
] }),
|
|
803
817
|
/* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
804
|
-
effectiveRecaptchaSiteKey && /* @__PURE__ */ jsx(
|
|
805
|
-
|
|
818
|
+
effectiveRecaptchaSiteKey && /* @__PURE__ */ jsx(
|
|
819
|
+
"div",
|
|
806
820
|
{
|
|
807
|
-
|
|
808
|
-
|
|
821
|
+
className: "flex justify-center sm:justify-start",
|
|
822
|
+
style: { minHeight: RECAPTCHA_WIDGET_HEIGHT },
|
|
823
|
+
children: recaptchaGate.armed && /* @__PURE__ */ jsx(
|
|
824
|
+
ReCAPTCHA,
|
|
825
|
+
{
|
|
826
|
+
ref: recaptchaRef,
|
|
827
|
+
sitekey: effectiveRecaptchaSiteKey
|
|
828
|
+
}
|
|
829
|
+
)
|
|
809
830
|
}
|
|
810
|
-
)
|
|
831
|
+
),
|
|
811
832
|
/* @__PURE__ */ jsx(
|
|
812
833
|
Button,
|
|
813
834
|
{
|