@flamingo-stack/openframe-frontend-core 0.0.227 → 0.0.228
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/{chunk-E3DB4D43.cjs → chunk-6PWR6K2K.cjs} +9 -9
- package/dist/{chunk-E3DB4D43.cjs.map → chunk-6PWR6K2K.cjs.map} +1 -1
- package/dist/{chunk-K252FYE5.js → chunk-G6EKFWIC.js} +2213 -2192
- package/dist/chunk-G6EKFWIC.js.map +1 -0
- package/dist/{chunk-JUWPBMQM.cjs → chunk-GYRRSOTR.cjs} +50 -2
- package/dist/chunk-GYRRSOTR.cjs.map +1 -0
- package/dist/{chunk-LEM4FLCU.cjs → chunk-HLKC2OBT.cjs} +12 -12
- package/dist/{chunk-LEM4FLCU.cjs.map → chunk-HLKC2OBT.cjs.map} +1 -1
- package/dist/{chunk-QFC725WU.cjs → chunk-L65QBRV5.cjs} +59 -38
- package/dist/chunk-L65QBRV5.cjs.map +1 -0
- package/dist/{chunk-53EA4QPZ.js → chunk-LLTUSEHF.js} +50 -2
- package/dist/chunk-LLTUSEHF.js.map +1 -0
- package/dist/{chunk-CUBRHI6D.js → chunk-LWJJP64X.js} +3 -3
- package/dist/{chunk-X3KKG6IU.js → chunk-MT5GO55P.js} +2 -2
- package/dist/{chunk-EURLSRHW.js → chunk-QLOU4BDD.js} +10 -5
- package/dist/chunk-QLOU4BDD.js.map +1 -0
- package/dist/{chunk-HO2VEMEX.cjs → chunk-TAWNR7IW.cjs} +32 -27
- package/dist/chunk-TAWNR7IW.cjs.map +1 -0
- package/dist/{chunk-E3WJQQGW.cjs → chunk-VXYYZFVV.cjs} +7 -7
- package/dist/{chunk-E3WJQQGW.cjs.map → chunk-VXYYZFVV.cjs.map} +1 -1
- package/dist/{chunk-YE62NF6I.js → chunk-WLCBY6ZO.js} +2 -2
- package/dist/components/chat/index.cjs +3 -3
- package/dist/components/chat/index.js +2 -2
- package/dist/components/contact/contact-form.d.ts.map +1 -1
- package/dist/components/contact/index.cjs +4 -4
- package/dist/components/contact/index.js +3 -3
- package/dist/components/features/index.cjs +3 -3
- package/dist/components/features/index.js +2 -2
- package/dist/components/features/waitlist-form.d.ts +6 -3
- package/dist/components/features/waitlist-form.d.ts.map +1 -1
- package/dist/components/index.cjs +81 -79
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +7 -5
- package/dist/components/index.js.map +1 -1
- package/dist/components/navigation/index.cjs +3 -3
- package/dist/components/navigation/index.js +2 -2
- package/dist/components/onboarding-guides/index.cjs +26 -26
- package/dist/components/onboarding-guides/index.js +4 -4
- package/dist/components/tickets/index.cjs +67 -67
- package/dist/components/tickets/index.js +5 -5
- package/dist/components/ui/honeypot-field.d.ts +18 -0
- package/dist/components/ui/honeypot-field.d.ts.map +1 -0
- package/dist/components/ui/index.cjs +5 -3
- package/dist/components/ui/index.cjs.map +1 -1
- package/dist/components/ui/index.d.ts +1 -0
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +4 -2
- package/dist/hooks/index.cjs +4 -2
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +3 -1
- package/dist/hooks/use-humanity-signals.d.ts +26 -0
- package/dist/hooks/use-humanity-signals.d.ts.map +1 -0
- package/dist/index.cjs +19 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +18 -2
- package/dist/utils/humanity-signals.cjs +30 -0
- package/dist/utils/humanity-signals.cjs.map +1 -0
- package/dist/utils/humanity-signals.d.ts +45 -0
- package/dist/utils/humanity-signals.d.ts.map +1 -0
- package/dist/utils/humanity-signals.js +23 -0
- package/dist/utils/humanity-signals.js.map +1 -0
- package/dist/utils/index.cjs +26 -0
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +21 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +7 -1
- package/src/components/contact/contact-form.tsx +11 -1
- package/src/components/features/waitlist-form.tsx +14 -4
- package/src/components/ui/honeypot-field.tsx +30 -0
- package/src/components/ui/index.ts +1 -0
- package/src/hooks/index.ts +4 -0
- package/src/hooks/use-humanity-signals.ts +47 -0
- package/src/utils/humanity-signals.ts +57 -0
- package/src/utils/index.ts +6 -0
- package/dist/chunk-53EA4QPZ.js.map +0 -1
- package/dist/chunk-EURLSRHW.js.map +0 -1
- package/dist/chunk-HO2VEMEX.cjs.map +0 -1
- package/dist/chunk-JUWPBMQM.cjs.map +0 -1
- package/dist/chunk-K252FYE5.js.map +0 -1
- package/dist/chunk-QFC725WU.cjs.map +0 -1
- /package/dist/{chunk-CUBRHI6D.js.map → chunk-LWJJP64X.js.map} +0 -0
- /package/dist/{chunk-X3KKG6IU.js.map → chunk-MT5GO55P.js.map} +0 -0
- /package/dist/{chunk-YE62NF6I.js.map → chunk-WLCBY6ZO.js.map} +0 -0
|
@@ -2967,6 +2967,47 @@ function useOgPlaceholder(buildUrl, title, siteName = "", enabled = true, aspect
|
|
|
2967
2967
|
}, [buildUrl, title, siteName, enabled, aspect]);
|
|
2968
2968
|
}
|
|
2969
2969
|
|
|
2970
|
+
// src/hooks/use-humanity-signals.ts
|
|
2971
|
+
import { useCallback as useCallback13, useRef as useRef12 } from "react";
|
|
2972
|
+
|
|
2973
|
+
// src/utils/humanity-signals.ts
|
|
2974
|
+
var HONEYPOT_FIELD = "contact_url_confirm";
|
|
2975
|
+
var ELAPSED_MS_FIELD = "form_elapsed_ms";
|
|
2976
|
+
var DEFAULT_MIN_FILL_MS = 700;
|
|
2977
|
+
function extractHumanitySignals(body) {
|
|
2978
|
+
const b = body ?? {};
|
|
2979
|
+
const rawHp = b[HONEYPOT_FIELD];
|
|
2980
|
+
const honeypot = rawHp == null ? "" : String(rawHp);
|
|
2981
|
+
const rawMs = b[ELAPSED_MS_FIELD];
|
|
2982
|
+
const elapsedMs = typeof rawMs === "number" && Number.isFinite(rawMs) ? rawMs : null;
|
|
2983
|
+
return { honeypot, elapsedMs };
|
|
2984
|
+
}
|
|
2985
|
+
function evaluateHumanitySignals(body, opts) {
|
|
2986
|
+
const { honeypot, elapsedMs } = extractHumanitySignals(body);
|
|
2987
|
+
if (honeypot.trim() !== "") return { ok: false, reason: "honeypot" };
|
|
2988
|
+
if (elapsedMs !== null && elapsedMs < opts.minFillMs) return { ok: false, reason: "too_fast" };
|
|
2989
|
+
return { ok: true };
|
|
2990
|
+
}
|
|
2991
|
+
var splitCsvEnv = (s) => s?.split(",").map((t) => t.trim()).filter(Boolean) ?? [];
|
|
2992
|
+
|
|
2993
|
+
// src/hooks/use-humanity-signals.ts
|
|
2994
|
+
function useHumanitySignals() {
|
|
2995
|
+
const ref = useRef12(null);
|
|
2996
|
+
const mountedAt = useRef12(typeof performance !== "undefined" ? performance.now() : 0);
|
|
2997
|
+
const getSignals = useCallback13(
|
|
2998
|
+
() => ({
|
|
2999
|
+
[HONEYPOT_FIELD]: ref.current?.value ?? "",
|
|
3000
|
+
[ELAPSED_MS_FIELD]: typeof performance !== "undefined" ? Math.round(performance.now() - mountedAt.current) : 0
|
|
3001
|
+
}),
|
|
3002
|
+
[]
|
|
3003
|
+
);
|
|
3004
|
+
const resetSignals = useCallback13(() => {
|
|
3005
|
+
if (ref.current) ref.current.value = "";
|
|
3006
|
+
if (typeof performance !== "undefined") mountedAt.current = performance.now();
|
|
3007
|
+
}, []);
|
|
3008
|
+
return { honeypotInputProps: { ref, name: HONEYPOT_FIELD }, getSignals, resetSignals };
|
|
3009
|
+
}
|
|
3010
|
+
|
|
2970
3011
|
export {
|
|
2971
3012
|
useAutoLimitTags,
|
|
2972
3013
|
useDebounce,
|
|
@@ -3053,6 +3094,13 @@ export {
|
|
|
3053
3094
|
consumeAccessCode,
|
|
3054
3095
|
validateAndConsumeAccessCode,
|
|
3055
3096
|
useAccessCodeIntegration,
|
|
3056
|
-
useOgPlaceholder
|
|
3097
|
+
useOgPlaceholder,
|
|
3098
|
+
HONEYPOT_FIELD,
|
|
3099
|
+
ELAPSED_MS_FIELD,
|
|
3100
|
+
DEFAULT_MIN_FILL_MS,
|
|
3101
|
+
extractHumanitySignals,
|
|
3102
|
+
evaluateHumanitySignals,
|
|
3103
|
+
splitCsvEnv,
|
|
3104
|
+
useHumanitySignals
|
|
3057
3105
|
};
|
|
3058
|
-
//# sourceMappingURL=chunk-
|
|
3106
|
+
//# sourceMappingURL=chunk-LLTUSEHF.js.map
|