@hifilabs/pixel 0.6.1 → 0.6.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.
- package/dist/index.js +25 -0
- package/dist/index.mjs +25 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -37,6 +37,7 @@ __export(src_exports, {
|
|
|
37
37
|
BalanceAnalytics: () => BalanceAnalytics,
|
|
38
38
|
BalanceContext: () => BalanceContext,
|
|
39
39
|
BalanceProvider: () => BalanceProvider,
|
|
40
|
+
ConsentBridge: () => ConsentBridge,
|
|
40
41
|
DEFAULT_GTM_CONSENT: () => DEFAULT_GTM_CONSENT,
|
|
41
42
|
GTMProvider: () => GTMProvider,
|
|
42
43
|
StorageManager: () => StorageManager,
|
|
@@ -2849,6 +2850,30 @@ function BalanceAnalytics() {
|
|
|
2849
2850
|
|
|
2850
2851
|
// src/react/ConsentBridge.tsx
|
|
2851
2852
|
var import_react22 = require("react");
|
|
2853
|
+
function ConsentBridge({
|
|
2854
|
+
analytics,
|
|
2855
|
+
marketing,
|
|
2856
|
+
personalization
|
|
2857
|
+
}) {
|
|
2858
|
+
const { setConsent: setConsent2 } = useBalanceConsent();
|
|
2859
|
+
const isInitialized = (0, import_react22.useRef)(false);
|
|
2860
|
+
(0, import_react22.useEffect)(() => {
|
|
2861
|
+
if (analytics === void 0 && marketing === void 0 && personalization === void 0) {
|
|
2862
|
+
return;
|
|
2863
|
+
}
|
|
2864
|
+
setConsent2({
|
|
2865
|
+
analytics: analytics ?? false,
|
|
2866
|
+
marketing: marketing ?? false,
|
|
2867
|
+
personalization: personalization ?? false,
|
|
2868
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
2869
|
+
});
|
|
2870
|
+
if (!isInitialized.current) {
|
|
2871
|
+
console.log("[ConsentBridge] Initial sync:", { analytics, marketing, personalization });
|
|
2872
|
+
isInitialized.current = true;
|
|
2873
|
+
}
|
|
2874
|
+
}, [analytics, marketing, personalization, setConsent2]);
|
|
2875
|
+
return null;
|
|
2876
|
+
}
|
|
2852
2877
|
|
|
2853
2878
|
// src/react/useBalanceIdentify.ts
|
|
2854
2879
|
var import_react23 = require("react");
|
package/dist/index.mjs
CHANGED
|
@@ -2781,6 +2781,30 @@ function BalanceAnalytics() {
|
|
|
2781
2781
|
|
|
2782
2782
|
// src/react/ConsentBridge.tsx
|
|
2783
2783
|
import { useEffect as useEffect8, useRef as useRef15 } from "react";
|
|
2784
|
+
function ConsentBridge({
|
|
2785
|
+
analytics,
|
|
2786
|
+
marketing,
|
|
2787
|
+
personalization
|
|
2788
|
+
}) {
|
|
2789
|
+
const { setConsent: setConsent2 } = useBalanceConsent();
|
|
2790
|
+
const isInitialized = useRef15(false);
|
|
2791
|
+
useEffect8(() => {
|
|
2792
|
+
if (analytics === void 0 && marketing === void 0 && personalization === void 0) {
|
|
2793
|
+
return;
|
|
2794
|
+
}
|
|
2795
|
+
setConsent2({
|
|
2796
|
+
analytics: analytics ?? false,
|
|
2797
|
+
marketing: marketing ?? false,
|
|
2798
|
+
personalization: personalization ?? false,
|
|
2799
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
2800
|
+
});
|
|
2801
|
+
if (!isInitialized.current) {
|
|
2802
|
+
console.log("[ConsentBridge] Initial sync:", { analytics, marketing, personalization });
|
|
2803
|
+
isInitialized.current = true;
|
|
2804
|
+
}
|
|
2805
|
+
}, [analytics, marketing, personalization, setConsent2]);
|
|
2806
|
+
return null;
|
|
2807
|
+
}
|
|
2784
2808
|
|
|
2785
2809
|
// src/react/useBalanceIdentify.ts
|
|
2786
2810
|
import { useCallback as useCallback16, useEffect as useEffect9, useRef as useRef16 } from "react";
|
|
@@ -3188,6 +3212,7 @@ export {
|
|
|
3188
3212
|
BalanceAnalytics,
|
|
3189
3213
|
BalanceContext,
|
|
3190
3214
|
BalanceProvider,
|
|
3215
|
+
ConsentBridge,
|
|
3191
3216
|
DEFAULT_GTM_CONSENT,
|
|
3192
3217
|
GTMProvider,
|
|
3193
3218
|
StorageManager,
|