@burdenoff/website-sdk 2026.1003.2 → 2026.1004.1
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 +36 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +36 -11
- 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 +6 -5
package/dist/index.js
CHANGED
|
@@ -375,6 +375,17 @@ function useWebSDKConfig() {
|
|
|
375
375
|
const client = useWebSDK();
|
|
376
376
|
return client.getConfig();
|
|
377
377
|
}
|
|
378
|
+
var RECAPTCHA_WIDGET_HEIGHT = 78;
|
|
379
|
+
function useDeferredRecaptcha(siteKey) {
|
|
380
|
+
const [engaged, setEngaged] = React.useState(false);
|
|
381
|
+
const arm = React.useCallback(() => setEngaged(true), []);
|
|
382
|
+
const enabled = siteKey.length > 0;
|
|
383
|
+
return {
|
|
384
|
+
armed: enabled && engaged,
|
|
385
|
+
arm,
|
|
386
|
+
formProps: enabled && !engaged ? { onFocus: arm, onPointerDown: arm } : {}
|
|
387
|
+
};
|
|
388
|
+
}
|
|
378
389
|
|
|
379
390
|
// src/utils/product-slug.ts
|
|
380
391
|
var PRODUCT_SLUG_RENAMES = Object.freeze(
|
|
@@ -838,12 +849,14 @@ function ContactPage({
|
|
|
838
849
|
const displayName = productName ?? product?.name ?? config.productId;
|
|
839
850
|
const effectiveRecaptchaSiteKey = recaptchaSiteKey ?? product?.recaptchaSiteKey ?? config.recaptchaSiteKey ?? "";
|
|
840
851
|
const recaptchaRef = React.useRef(null);
|
|
852
|
+
const recaptchaGate = useDeferredRecaptcha(effectiveRecaptchaSiteKey);
|
|
841
853
|
const [isSubmitting, setIsSubmitting] = React.useState(false);
|
|
842
854
|
const [submitStatus, setSubmitStatus] = React.useState("idle");
|
|
843
855
|
const handleSubmit = async (e) => {
|
|
844
856
|
e.preventDefault();
|
|
845
857
|
const recaptchaToken = recaptchaRef.current?.getValue() ?? "";
|
|
846
858
|
if (effectiveRecaptchaSiteKey && !recaptchaToken) {
|
|
859
|
+
recaptchaGate.arm();
|
|
847
860
|
sonner.toast.error("Please complete the reCAPTCHA verification");
|
|
848
861
|
return;
|
|
849
862
|
}
|
|
@@ -970,6 +983,7 @@ function ContactPage({
|
|
|
970
983
|
{
|
|
971
984
|
onSubmit: handleSubmit,
|
|
972
985
|
className: "space-y-4 sm:space-y-6",
|
|
986
|
+
...recaptchaGate.formProps,
|
|
973
987
|
children: [
|
|
974
988
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid sm:grid-cols-2 gap-4 sm:gap-6", children: [
|
|
975
989
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
@@ -1094,13 +1108,20 @@ function ContactPage({
|
|
|
1094
1108
|
)
|
|
1095
1109
|
] }),
|
|
1096
1110
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
1097
|
-
effectiveRecaptchaSiteKey && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1098
|
-
|
|
1111
|
+
effectiveRecaptchaSiteKey && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1112
|
+
"div",
|
|
1099
1113
|
{
|
|
1100
|
-
|
|
1101
|
-
|
|
1114
|
+
className: "flex justify-center sm:justify-start",
|
|
1115
|
+
style: { minHeight: RECAPTCHA_WIDGET_HEIGHT },
|
|
1116
|
+
children: recaptchaGate.armed && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1117
|
+
ReCAPTCHA4__default.default,
|
|
1118
|
+
{
|
|
1119
|
+
ref: recaptchaRef,
|
|
1120
|
+
sitekey: effectiveRecaptchaSiteKey
|
|
1121
|
+
}
|
|
1122
|
+
)
|
|
1102
1123
|
}
|
|
1103
|
-
)
|
|
1124
|
+
),
|
|
1104
1125
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1105
1126
|
Button,
|
|
1106
1127
|
{
|
|
@@ -2821,6 +2842,7 @@ function NewsletterForm({
|
|
|
2821
2842
|
const effectiveProductId = product?.id || config.productId;
|
|
2822
2843
|
const effectiveRecaptchaSiteKey = recaptchaSiteKey ?? productConfig.recaptchaSiteKey ?? config.recaptchaSiteKey ?? "";
|
|
2823
2844
|
const recaptchaRef = React.useRef(null);
|
|
2845
|
+
const recaptchaGate = useDeferredRecaptcha(effectiveRecaptchaSiteKey);
|
|
2824
2846
|
const [email, setEmail] = React.useState("");
|
|
2825
2847
|
const [isLoading, setIsLoading] = React.useState(false);
|
|
2826
2848
|
const handleSubmit = async (e) => {
|
|
@@ -2831,6 +2853,7 @@ function NewsletterForm({
|
|
|
2831
2853
|
}
|
|
2832
2854
|
const recaptchaToken = recaptchaRef.current?.getValue() ?? "";
|
|
2833
2855
|
if (effectiveRecaptchaSiteKey && !recaptchaToken) {
|
|
2856
|
+
recaptchaGate.arm();
|
|
2834
2857
|
sonner.toast.error("Please complete the reCAPTCHA verification");
|
|
2835
2858
|
return;
|
|
2836
2859
|
}
|
|
@@ -2869,6 +2892,7 @@ function NewsletterForm({
|
|
|
2869
2892
|
onSubmit: handleSubmit,
|
|
2870
2893
|
className: isInline ? "flex flex-col gap-2" : "flex flex-col gap-2",
|
|
2871
2894
|
style: { overflow: "visible" },
|
|
2895
|
+
...recaptchaGate.formProps,
|
|
2872
2896
|
children: [
|
|
2873
2897
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2874
2898
|
"div",
|
|
@@ -2939,9 +2963,10 @@ function NewsletterForm({
|
|
|
2939
2963
|
position: "relative",
|
|
2940
2964
|
zIndex: 50,
|
|
2941
2965
|
display: "flex",
|
|
2942
|
-
justifyContent: "flex-start"
|
|
2966
|
+
justifyContent: "flex-start",
|
|
2967
|
+
minHeight: RECAPTCHA_WIDGET_HEIGHT
|
|
2943
2968
|
},
|
|
2944
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2969
|
+
children: recaptchaGate.armed && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2945
2970
|
ReCAPTCHA4__default.default,
|
|
2946
2971
|
{
|
|
2947
2972
|
ref: recaptchaRef,
|
|
@@ -6049,7 +6074,7 @@ function ConceptDetail({
|
|
|
6049
6074
|
{
|
|
6050
6075
|
"aria-label": "Previous and next concepts",
|
|
6051
6076
|
"data-concepts": "pager",
|
|
6052
|
-
className: "mt-16 grid gap-4 sm:grid-cols-2",
|
|
6077
|
+
className: "mt-16 grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
6053
6078
|
children: [
|
|
6054
6079
|
previous ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6055
6080
|
Link,
|
|
@@ -6098,7 +6123,7 @@ function ConceptDetail({
|
|
|
6098
6123
|
Link,
|
|
6099
6124
|
{
|
|
6100
6125
|
href: CONCEPTS_PATH,
|
|
6101
|
-
className: "inline-flex items-center gap-2 rounded text-sm font-medium text-
|
|
6126
|
+
className: "inline-flex items-center gap-2 rounded text-sm font-medium text-foreground hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
6102
6127
|
children: [
|
|
6103
6128
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowLeft, { "aria-hidden": "true", className: "h-4 w-4" }),
|
|
6104
6129
|
"All ",
|
|
@@ -17997,7 +18022,7 @@ function FacetList({
|
|
|
17997
18022
|
className: `w-full text-left text-sm px-2 py-1 rounded flex items-center justify-between gap-2 transition-colors ${selected === f.value ? "bg-primary/10 text-primary font-medium" : "text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,
|
|
17998
18023
|
children: [
|
|
17999
18024
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: f.value }),
|
|
18000
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs
|
|
18025
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs flex-shrink-0", children: f.count })
|
|
18001
18026
|
]
|
|
18002
18027
|
}
|
|
18003
18028
|
) }, f.value)) })
|
|
@@ -18180,7 +18205,7 @@ function StoreBrowsePage({
|
|
|
18180
18205
|
className: `w-full text-left text-sm px-2 py-1.5 rounded flex items-center justify-between gap-2 transition-colors ${category === f.value ? "bg-primary/10 text-primary font-medium" : "text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,
|
|
18181
18206
|
children: [
|
|
18182
18207
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: cat?.name ?? f.value }),
|
|
18183
|
-
f.count > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs
|
|
18208
|
+
f.count > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs flex-shrink-0", children: f.count })
|
|
18184
18209
|
]
|
|
18185
18210
|
},
|
|
18186
18211
|
f.value
|