@ninetailed/experience.js-react 7.20.5 → 7.21.0
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/index.cjs.js +44 -50
- package/index.esm.js +44 -50
- package/package.json +4 -4
- package/src/index.d.ts +1 -1
- package/src/lib/EntryAnalytics/EntryAnalytics.d.ts +4 -4
- package/src/lib/EntryAnalytics/index.d.ts +2 -2
- package/src/lib/Experience/ComponentMarker/ComponentMarker.d.ts +2 -2
- package/src/lib/Experience/ComponentMarker/index.d.ts +1 -1
- package/src/lib/Experience/DefaultExperienceLoadingComponent.d.ts +7 -7
- package/src/lib/Experience/ESRLoadingComponent.d.ts +16 -16
- package/src/lib/Experience/Experience.d.ts +5 -5
- package/src/lib/Experience/constants.d.ts +1 -1
- package/src/lib/Experience/index.d.ts +4 -4
- package/src/lib/Experience/types/Baseline.d.ts +3 -3
- package/src/lib/Experience/types/BaselineWithVariants.d.ts +6 -6
- package/src/lib/Experience/types/Experience.d.ts +23 -22
- package/src/lib/Experience/types/Variant.d.ts +3 -3
- package/src/lib/Experience/types/index.d.ts +4 -4
- package/src/lib/Experience/useExperience.d.ts +49 -49
- package/src/lib/MergeTag/MergeTag.d.ts +7 -7
- package/src/lib/MergeTag/helpers.d.ts +3 -3
- package/src/lib/MergeTag/index.d.ts +1 -1
- package/src/lib/NinetailedContext.d.ts +2 -3
- package/src/lib/NinetailedProvider.d.ts +25 -24
- package/src/lib/Personalize.d.ts +23 -23
- package/src/lib/TrackHasSeenComponent.d.ts +11 -11
- package/src/lib/Variant.d.ts +6 -6
- package/src/lib/index.d.ts +17 -17
- package/src/lib/useFlag.d.ts +31 -31
- package/src/lib/useFlagWithManualTracking.d.ts +19 -19
- package/src/lib/useNinetailed.d.ts +3 -3
- package/src/lib/usePersonalize.d.ts +32 -32
- package/src/lib/useProfile.d.ts +17 -17
package/index.cjs.js
CHANGED
|
@@ -27,6 +27,7 @@ const NinetailedProvider = props => {
|
|
|
27
27
|
buildClientContext,
|
|
28
28
|
onInitProfileId,
|
|
29
29
|
componentViewTrackingThreshold,
|
|
30
|
+
componentHoverTrackingThreshold,
|
|
30
31
|
storageImpl,
|
|
31
32
|
useSDKEvaluation
|
|
32
33
|
} = props;
|
|
@@ -44,6 +45,7 @@ const NinetailedProvider = props => {
|
|
|
44
45
|
buildClientContext,
|
|
45
46
|
onInitProfileId,
|
|
46
47
|
componentViewTrackingThreshold,
|
|
48
|
+
componentHoverTrackingThreshold,
|
|
47
49
|
storageImpl,
|
|
48
50
|
useSDKEvaluation
|
|
49
51
|
});
|
|
@@ -51,11 +53,10 @@ const NinetailedProvider = props => {
|
|
|
51
53
|
const {
|
|
52
54
|
children
|
|
53
55
|
} = props;
|
|
54
|
-
return jsxRuntime.jsx(NinetailedContext.Provider,
|
|
55
|
-
value: ninetailed
|
|
56
|
-
}, {
|
|
56
|
+
return jsxRuntime.jsx(NinetailedContext.Provider, {
|
|
57
|
+
value: ninetailed,
|
|
57
58
|
children: children
|
|
58
|
-
})
|
|
59
|
+
});
|
|
59
60
|
};
|
|
60
61
|
|
|
61
62
|
const useNinetailed = () => {
|
|
@@ -80,7 +81,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
80
81
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
81
82
|
PERFORMANCE OF THIS SOFTWARE.
|
|
82
83
|
***************************************************************************** */
|
|
83
|
-
/* global Reflect, Promise
|
|
84
|
+
/* global Reflect, Promise */
|
|
84
85
|
|
|
85
86
|
|
|
86
87
|
function __rest(s, e) {
|
|
@@ -93,12 +94,7 @@ function __rest(s, e) {
|
|
|
93
94
|
t[p[i]] = s[p[i]];
|
|
94
95
|
}
|
|
95
96
|
return t;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
99
|
-
var e = new Error(message);
|
|
100
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
101
|
-
};
|
|
97
|
+
}
|
|
102
98
|
|
|
103
99
|
function formatProfileForHook(profile) {
|
|
104
100
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -110,16 +106,16 @@ function formatProfileForHook(profile) {
|
|
|
110
106
|
loading: profile.status === 'loading'
|
|
111
107
|
});
|
|
112
108
|
}
|
|
113
|
-
/**
|
|
114
|
-
* Custom hook that provides access to the Ninetailed profile state
|
|
115
|
-
* with the 'experiences' property removed to prevent unnecessary re-renders.
|
|
116
|
-
*
|
|
117
|
-
* This hook handles profile state changes efficiently by:
|
|
118
|
-
* 1. Only updating state when actual changes occur
|
|
119
|
-
* 2. Removing the large 'experiences' object from the state
|
|
120
|
-
* 3. Properly cleaning up subscriptions when components unmount
|
|
121
|
-
*
|
|
122
|
-
* @returns The profile state without the 'experiences' property
|
|
109
|
+
/**
|
|
110
|
+
* Custom hook that provides access to the Ninetailed profile state
|
|
111
|
+
* with the 'experiences' property removed to prevent unnecessary re-renders.
|
|
112
|
+
*
|
|
113
|
+
* This hook handles profile state changes efficiently by:
|
|
114
|
+
* 1. Only updating state when actual changes occur
|
|
115
|
+
* 2. Removing the large 'experiences' object from the state
|
|
116
|
+
* 3. Properly cleaning up subscriptions when components unmount
|
|
117
|
+
*
|
|
118
|
+
* @returns The profile state without the 'experiences' property
|
|
123
119
|
*/
|
|
124
120
|
const useProfile = () => {
|
|
125
121
|
const ninetailed = useNinetailed();
|
|
@@ -156,8 +152,8 @@ const usePersonalize = (baseline, variants, options = {
|
|
|
156
152
|
return experience_js.selectVariant(baseline, variants, profile, options);
|
|
157
153
|
};
|
|
158
154
|
|
|
159
|
-
/**
|
|
160
|
-
* Hook to access a Ninetailed variable flag with manual tracking control.
|
|
155
|
+
/**
|
|
156
|
+
* Hook to access a Ninetailed variable flag with manual tracking control.
|
|
161
157
|
*/
|
|
162
158
|
function useFlagWithManualTracking(flagKey, defaultValue) {
|
|
163
159
|
const ninetailed = useNinetailed();
|
|
@@ -247,11 +243,11 @@ function useFlagWithManualTracking(flagKey, defaultValue) {
|
|
|
247
243
|
return [result, track];
|
|
248
244
|
}
|
|
249
245
|
|
|
250
|
-
/**
|
|
251
|
-
* Hook to access a Ninetailed variable flag with built-in auto-tracking.
|
|
252
|
-
*
|
|
253
|
-
* @remarks
|
|
254
|
-
* For manual control over tracking behavior, consider using {@link useFlagWithManualTracking}.
|
|
246
|
+
/**
|
|
247
|
+
* Hook to access a Ninetailed variable flag with built-in auto-tracking.
|
|
248
|
+
*
|
|
249
|
+
* @remarks
|
|
250
|
+
* For manual control over tracking behavior, consider using {@link useFlagWithManualTracking}.
|
|
255
251
|
*/
|
|
256
252
|
function useFlag(flagKey, defaultValue, options = {}) {
|
|
257
253
|
const [result, track] = useFlagWithManualTracking(flagKey, defaultValue);
|
|
@@ -334,24 +330,22 @@ const Personalize = _a => {
|
|
|
334
330
|
if (LoadingComponent) {
|
|
335
331
|
return jsxRuntime.jsx(LoadingComponent, {});
|
|
336
332
|
}
|
|
337
|
-
return jsxRuntime.jsx("div",
|
|
333
|
+
return jsxRuntime.jsx("div", {
|
|
338
334
|
style: {
|
|
339
335
|
opacity: 0
|
|
340
|
-
}
|
|
341
|
-
}, {
|
|
336
|
+
},
|
|
342
337
|
children: jsxRuntime.jsx(Component, Object.assign({}, variant, {
|
|
343
338
|
ninetailed: {
|
|
344
339
|
isPersonalized,
|
|
345
340
|
audience
|
|
346
341
|
}
|
|
347
342
|
}))
|
|
348
|
-
}
|
|
343
|
+
}, "hide");
|
|
349
344
|
}
|
|
350
|
-
return jsxRuntime.jsx(TrackHasSeenComponent,
|
|
345
|
+
return jsxRuntime.jsx(TrackHasSeenComponent, {
|
|
351
346
|
variant: variant,
|
|
352
347
|
audience: audience,
|
|
353
|
-
isPersonalized: isPersonalized
|
|
354
|
-
}, {
|
|
348
|
+
isPersonalized: isPersonalized,
|
|
355
349
|
children: /*#__PURE__*/React.createElement(Component, Object.assign({}, variant, {
|
|
356
350
|
key: `${audience.id}-${variant.id}`,
|
|
357
351
|
ninetailed: {
|
|
@@ -359,7 +353,7 @@ const Personalize = _a => {
|
|
|
359
353
|
audience
|
|
360
354
|
}
|
|
361
355
|
}))
|
|
362
|
-
})
|
|
356
|
+
});
|
|
363
357
|
};
|
|
364
358
|
|
|
365
359
|
const generateSelectors = id => {
|
|
@@ -432,9 +426,9 @@ const ComponentMarker = /*#__PURE__*/React.forwardRef((_, ref) => {
|
|
|
432
426
|
const markerRef = React.useRef(null);
|
|
433
427
|
React.useEffect(() => {
|
|
434
428
|
var _a;
|
|
435
|
-
/*
|
|
436
|
-
Due to React's limitation on setting !important styles during rendering, we set the display property on the DOM element directly.
|
|
437
|
-
See: https://github.com/facebook/react/issues/1881
|
|
429
|
+
/*
|
|
430
|
+
Due to React's limitation on setting !important styles during rendering, we set the display property on the DOM element directly.
|
|
431
|
+
See: https://github.com/facebook/react/issues/1881
|
|
438
432
|
*/
|
|
439
433
|
(_a = markerRef.current) === null || _a === void 0 ? void 0 : _a.style.setProperty('display', 'none', 'important');
|
|
440
434
|
}, []);
|
|
@@ -511,15 +505,14 @@ const DefaultExperienceLoadingComponent = _a => {
|
|
|
511
505
|
};
|
|
512
506
|
}, [isHidden, logger, unhideAfterMs]);
|
|
513
507
|
if (isHidden) {
|
|
514
|
-
return jsxRuntime.jsx("div",
|
|
508
|
+
return jsxRuntime.jsx("div", {
|
|
515
509
|
style: {
|
|
516
510
|
visibility: 'hidden',
|
|
517
511
|
pointerEvents: 'none'
|
|
518
512
|
},
|
|
519
513
|
"aria-hidden": "true",
|
|
520
514
|
// Prevent focus and interaction within the hidden loading subtree.
|
|
521
|
-
inert: true
|
|
522
|
-
}, {
|
|
515
|
+
inert: true,
|
|
523
516
|
children: jsxRuntime.jsx(Component, Object.assign({}, passthroughProps, baseline, {
|
|
524
517
|
ninetailed: {
|
|
525
518
|
isPersonalized: false,
|
|
@@ -528,7 +521,7 @@ const DefaultExperienceLoadingComponent = _a => {
|
|
|
528
521
|
}
|
|
529
522
|
}
|
|
530
523
|
}))
|
|
531
|
-
}
|
|
524
|
+
}, "experience-loader-hidden-baseline");
|
|
532
525
|
}
|
|
533
526
|
return jsxRuntime.jsx(Component, Object.assign({}, passthroughProps, baseline, {
|
|
534
527
|
ninetailed: {
|
|
@@ -546,9 +539,10 @@ const Experience = _a => {
|
|
|
546
539
|
component: Component,
|
|
547
540
|
loadingComponent: LoadingComponent = DefaultExperienceLoadingComponent,
|
|
548
541
|
trackClicks,
|
|
542
|
+
trackHovers,
|
|
549
543
|
passthroughProps
|
|
550
544
|
} = _a,
|
|
551
|
-
baseline = __rest(_a, ["experiences", "component", "loadingComponent", "trackClicks", "passthroughProps"]);
|
|
545
|
+
baseline = __rest(_a, ["experiences", "component", "loadingComponent", "trackClicks", "trackHovers", "passthroughProps"]);
|
|
552
546
|
const {
|
|
553
547
|
observeElement,
|
|
554
548
|
unobserveElement,
|
|
@@ -595,7 +589,8 @@ const Experience = _a => {
|
|
|
595
589
|
}) : variant,
|
|
596
590
|
variantIndex
|
|
597
591
|
}, {
|
|
598
|
-
trackClicks
|
|
592
|
+
trackClicks,
|
|
593
|
+
trackHovers
|
|
599
594
|
});
|
|
600
595
|
return () => {
|
|
601
596
|
if (componentElement) {
|
|
@@ -606,7 +601,7 @@ const Experience = _a => {
|
|
|
606
601
|
return () => {
|
|
607
602
|
// noop
|
|
608
603
|
};
|
|
609
|
-
}, [observeElement, unobserveElement, experience, baseline, variant, variantIndex, audience, isVariantHidden, trackClicks]);
|
|
604
|
+
}, [observeElement, unobserveElement, experience, baseline, variant, variantIndex, audience, isVariantHidden, trackClicks, trackHovers]);
|
|
610
605
|
if (!hasVariants) {
|
|
611
606
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
612
607
|
children: [!isComponentForwardRef && jsxRuntime.jsx(ComponentMarker, {
|
|
@@ -653,13 +648,12 @@ const ESRProvider = ({
|
|
|
653
648
|
experienceVariantsMap,
|
|
654
649
|
children
|
|
655
650
|
}) => {
|
|
656
|
-
return jsxRuntime.jsx(ESRContext.Provider,
|
|
651
|
+
return jsxRuntime.jsx(ESRContext.Provider, {
|
|
657
652
|
value: {
|
|
658
653
|
experienceVariantsMap
|
|
659
|
-
}
|
|
660
|
-
}, {
|
|
654
|
+
},
|
|
661
655
|
children: children
|
|
662
|
-
})
|
|
656
|
+
});
|
|
663
657
|
};
|
|
664
658
|
const useESR = () => {
|
|
665
659
|
const context = React.useContext(ESRContext);
|
package/index.esm.js
CHANGED
|
@@ -25,6 +25,7 @@ const NinetailedProvider = props => {
|
|
|
25
25
|
buildClientContext,
|
|
26
26
|
onInitProfileId,
|
|
27
27
|
componentViewTrackingThreshold,
|
|
28
|
+
componentHoverTrackingThreshold,
|
|
28
29
|
storageImpl,
|
|
29
30
|
useSDKEvaluation
|
|
30
31
|
} = props;
|
|
@@ -42,6 +43,7 @@ const NinetailedProvider = props => {
|
|
|
42
43
|
buildClientContext,
|
|
43
44
|
onInitProfileId,
|
|
44
45
|
componentViewTrackingThreshold,
|
|
46
|
+
componentHoverTrackingThreshold,
|
|
45
47
|
storageImpl,
|
|
46
48
|
useSDKEvaluation
|
|
47
49
|
});
|
|
@@ -49,11 +51,10 @@ const NinetailedProvider = props => {
|
|
|
49
51
|
const {
|
|
50
52
|
children
|
|
51
53
|
} = props;
|
|
52
|
-
return jsx(NinetailedContext.Provider,
|
|
53
|
-
value: ninetailed
|
|
54
|
-
}, {
|
|
54
|
+
return jsx(NinetailedContext.Provider, {
|
|
55
|
+
value: ninetailed,
|
|
55
56
|
children: children
|
|
56
|
-
})
|
|
57
|
+
});
|
|
57
58
|
};
|
|
58
59
|
|
|
59
60
|
const useNinetailed = () => {
|
|
@@ -78,7 +79,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
78
79
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
79
80
|
PERFORMANCE OF THIS SOFTWARE.
|
|
80
81
|
***************************************************************************** */
|
|
81
|
-
/* global Reflect, Promise
|
|
82
|
+
/* global Reflect, Promise */
|
|
82
83
|
|
|
83
84
|
|
|
84
85
|
function __rest(s, e) {
|
|
@@ -91,12 +92,7 @@ function __rest(s, e) {
|
|
|
91
92
|
t[p[i]] = s[p[i]];
|
|
92
93
|
}
|
|
93
94
|
return t;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
97
|
-
var e = new Error(message);
|
|
98
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
99
|
-
};
|
|
95
|
+
}
|
|
100
96
|
|
|
101
97
|
function formatProfileForHook(profile) {
|
|
102
98
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -108,16 +104,16 @@ function formatProfileForHook(profile) {
|
|
|
108
104
|
loading: profile.status === 'loading'
|
|
109
105
|
});
|
|
110
106
|
}
|
|
111
|
-
/**
|
|
112
|
-
* Custom hook that provides access to the Ninetailed profile state
|
|
113
|
-
* with the 'experiences' property removed to prevent unnecessary re-renders.
|
|
114
|
-
*
|
|
115
|
-
* This hook handles profile state changes efficiently by:
|
|
116
|
-
* 1. Only updating state when actual changes occur
|
|
117
|
-
* 2. Removing the large 'experiences' object from the state
|
|
118
|
-
* 3. Properly cleaning up subscriptions when components unmount
|
|
119
|
-
*
|
|
120
|
-
* @returns The profile state without the 'experiences' property
|
|
107
|
+
/**
|
|
108
|
+
* Custom hook that provides access to the Ninetailed profile state
|
|
109
|
+
* with the 'experiences' property removed to prevent unnecessary re-renders.
|
|
110
|
+
*
|
|
111
|
+
* This hook handles profile state changes efficiently by:
|
|
112
|
+
* 1. Only updating state when actual changes occur
|
|
113
|
+
* 2. Removing the large 'experiences' object from the state
|
|
114
|
+
* 3. Properly cleaning up subscriptions when components unmount
|
|
115
|
+
*
|
|
116
|
+
* @returns The profile state without the 'experiences' property
|
|
121
117
|
*/
|
|
122
118
|
const useProfile = () => {
|
|
123
119
|
const ninetailed = useNinetailed();
|
|
@@ -154,8 +150,8 @@ const usePersonalize = (baseline, variants, options = {
|
|
|
154
150
|
return selectVariant(baseline, variants, profile, options);
|
|
155
151
|
};
|
|
156
152
|
|
|
157
|
-
/**
|
|
158
|
-
* Hook to access a Ninetailed variable flag with manual tracking control.
|
|
153
|
+
/**
|
|
154
|
+
* Hook to access a Ninetailed variable flag with manual tracking control.
|
|
159
155
|
*/
|
|
160
156
|
function useFlagWithManualTracking(flagKey, defaultValue) {
|
|
161
157
|
const ninetailed = useNinetailed();
|
|
@@ -245,11 +241,11 @@ function useFlagWithManualTracking(flagKey, defaultValue) {
|
|
|
245
241
|
return [result, track];
|
|
246
242
|
}
|
|
247
243
|
|
|
248
|
-
/**
|
|
249
|
-
* Hook to access a Ninetailed variable flag with built-in auto-tracking.
|
|
250
|
-
*
|
|
251
|
-
* @remarks
|
|
252
|
-
* For manual control over tracking behavior, consider using {@link useFlagWithManualTracking}.
|
|
244
|
+
/**
|
|
245
|
+
* Hook to access a Ninetailed variable flag with built-in auto-tracking.
|
|
246
|
+
*
|
|
247
|
+
* @remarks
|
|
248
|
+
* For manual control over tracking behavior, consider using {@link useFlagWithManualTracking}.
|
|
253
249
|
*/
|
|
254
250
|
function useFlag(flagKey, defaultValue, options = {}) {
|
|
255
251
|
const [result, track] = useFlagWithManualTracking(flagKey, defaultValue);
|
|
@@ -332,24 +328,22 @@ const Personalize = _a => {
|
|
|
332
328
|
if (LoadingComponent) {
|
|
333
329
|
return jsx(LoadingComponent, {});
|
|
334
330
|
}
|
|
335
|
-
return jsx("div",
|
|
331
|
+
return jsx("div", {
|
|
336
332
|
style: {
|
|
337
333
|
opacity: 0
|
|
338
|
-
}
|
|
339
|
-
}, {
|
|
334
|
+
},
|
|
340
335
|
children: jsx(Component, Object.assign({}, variant, {
|
|
341
336
|
ninetailed: {
|
|
342
337
|
isPersonalized,
|
|
343
338
|
audience
|
|
344
339
|
}
|
|
345
340
|
}))
|
|
346
|
-
}
|
|
341
|
+
}, "hide");
|
|
347
342
|
}
|
|
348
|
-
return jsx(TrackHasSeenComponent,
|
|
343
|
+
return jsx(TrackHasSeenComponent, {
|
|
349
344
|
variant: variant,
|
|
350
345
|
audience: audience,
|
|
351
|
-
isPersonalized: isPersonalized
|
|
352
|
-
}, {
|
|
346
|
+
isPersonalized: isPersonalized,
|
|
353
347
|
children: /*#__PURE__*/createElement(Component, Object.assign({}, variant, {
|
|
354
348
|
key: `${audience.id}-${variant.id}`,
|
|
355
349
|
ninetailed: {
|
|
@@ -357,7 +351,7 @@ const Personalize = _a => {
|
|
|
357
351
|
audience
|
|
358
352
|
}
|
|
359
353
|
}))
|
|
360
|
-
})
|
|
354
|
+
});
|
|
361
355
|
};
|
|
362
356
|
|
|
363
357
|
const generateSelectors = id => {
|
|
@@ -430,9 +424,9 @@ const ComponentMarker = /*#__PURE__*/forwardRef((_, ref) => {
|
|
|
430
424
|
const markerRef = useRef(null);
|
|
431
425
|
useEffect(() => {
|
|
432
426
|
var _a;
|
|
433
|
-
/*
|
|
434
|
-
Due to React's limitation on setting !important styles during rendering, we set the display property on the DOM element directly.
|
|
435
|
-
See: https://github.com/facebook/react/issues/1881
|
|
427
|
+
/*
|
|
428
|
+
Due to React's limitation on setting !important styles during rendering, we set the display property on the DOM element directly.
|
|
429
|
+
See: https://github.com/facebook/react/issues/1881
|
|
436
430
|
*/
|
|
437
431
|
(_a = markerRef.current) === null || _a === void 0 ? void 0 : _a.style.setProperty('display', 'none', 'important');
|
|
438
432
|
}, []);
|
|
@@ -509,15 +503,14 @@ const DefaultExperienceLoadingComponent = _a => {
|
|
|
509
503
|
};
|
|
510
504
|
}, [isHidden, logger, unhideAfterMs]);
|
|
511
505
|
if (isHidden) {
|
|
512
|
-
return jsx("div",
|
|
506
|
+
return jsx("div", {
|
|
513
507
|
style: {
|
|
514
508
|
visibility: 'hidden',
|
|
515
509
|
pointerEvents: 'none'
|
|
516
510
|
},
|
|
517
511
|
"aria-hidden": "true",
|
|
518
512
|
// Prevent focus and interaction within the hidden loading subtree.
|
|
519
|
-
inert: true
|
|
520
|
-
}, {
|
|
513
|
+
inert: true,
|
|
521
514
|
children: jsx(Component, Object.assign({}, passthroughProps, baseline, {
|
|
522
515
|
ninetailed: {
|
|
523
516
|
isPersonalized: false,
|
|
@@ -526,7 +519,7 @@ const DefaultExperienceLoadingComponent = _a => {
|
|
|
526
519
|
}
|
|
527
520
|
}
|
|
528
521
|
}))
|
|
529
|
-
}
|
|
522
|
+
}, "experience-loader-hidden-baseline");
|
|
530
523
|
}
|
|
531
524
|
return jsx(Component, Object.assign({}, passthroughProps, baseline, {
|
|
532
525
|
ninetailed: {
|
|
@@ -544,9 +537,10 @@ const Experience = _a => {
|
|
|
544
537
|
component: Component,
|
|
545
538
|
loadingComponent: LoadingComponent = DefaultExperienceLoadingComponent,
|
|
546
539
|
trackClicks,
|
|
540
|
+
trackHovers,
|
|
547
541
|
passthroughProps
|
|
548
542
|
} = _a,
|
|
549
|
-
baseline = __rest(_a, ["experiences", "component", "loadingComponent", "trackClicks", "passthroughProps"]);
|
|
543
|
+
baseline = __rest(_a, ["experiences", "component", "loadingComponent", "trackClicks", "trackHovers", "passthroughProps"]);
|
|
550
544
|
const {
|
|
551
545
|
observeElement,
|
|
552
546
|
unobserveElement,
|
|
@@ -593,7 +587,8 @@ const Experience = _a => {
|
|
|
593
587
|
}) : variant,
|
|
594
588
|
variantIndex
|
|
595
589
|
}, {
|
|
596
|
-
trackClicks
|
|
590
|
+
trackClicks,
|
|
591
|
+
trackHovers
|
|
597
592
|
});
|
|
598
593
|
return () => {
|
|
599
594
|
if (componentElement) {
|
|
@@ -604,7 +599,7 @@ const Experience = _a => {
|
|
|
604
599
|
return () => {
|
|
605
600
|
// noop
|
|
606
601
|
};
|
|
607
|
-
}, [observeElement, unobserveElement, experience, baseline, variant, variantIndex, audience, isVariantHidden, trackClicks]);
|
|
602
|
+
}, [observeElement, unobserveElement, experience, baseline, variant, variantIndex, audience, isVariantHidden, trackClicks, trackHovers]);
|
|
608
603
|
if (!hasVariants) {
|
|
609
604
|
return jsxs(Fragment, {
|
|
610
605
|
children: [!isComponentForwardRef && jsx(ComponentMarker, {
|
|
@@ -651,13 +646,12 @@ const ESRProvider = ({
|
|
|
651
646
|
experienceVariantsMap,
|
|
652
647
|
children
|
|
653
648
|
}) => {
|
|
654
|
-
return jsx(ESRContext.Provider,
|
|
649
|
+
return jsx(ESRContext.Provider, {
|
|
655
650
|
value: {
|
|
656
651
|
experienceVariantsMap
|
|
657
|
-
}
|
|
658
|
-
}, {
|
|
652
|
+
},
|
|
659
653
|
children: children
|
|
660
|
-
})
|
|
654
|
+
});
|
|
661
655
|
};
|
|
662
656
|
const useESR = () => {
|
|
663
657
|
const context = React.useContext(ESRContext);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ninetailed/experience.js-react",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.21.0",
|
|
4
4
|
"description": "Ninetailed SDK for React",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
},
|
|
29
29
|
"sideEffects": false,
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@ninetailed/experience.js": "7.
|
|
32
|
-
"@ninetailed/experience.js-shared": "7.
|
|
33
|
-
"@ninetailed/experience.js-plugin-analytics": "7.
|
|
31
|
+
"@ninetailed/experience.js": "7.21.0",
|
|
32
|
+
"@ninetailed/experience.js-shared": "7.21.0",
|
|
33
|
+
"@ninetailed/experience.js-plugin-analytics": "7.21.0",
|
|
34
34
|
"radash": "10.9.0",
|
|
35
35
|
"react-is": "19.2.4"
|
|
36
36
|
},
|
package/src/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './lib';
|
|
1
|
+
export * from './lib';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Baseline } from '@ninetailed/experience.js';
|
|
2
|
-
import { ExperienceProps } from '../Experience';
|
|
3
|
-
export type EntryAnalyticsProps<P> = Omit<ExperienceProps<P>, 'experiences'> & Baseline<P>;
|
|
4
|
-
export declare const EntryAnalytics: <P>({ component: Component, passthroughProps, ...entry }: EntryAnalyticsProps<P>) => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { Baseline } from '@ninetailed/experience.js';
|
|
2
|
+
import { ExperienceProps } from '../Experience';
|
|
3
|
+
export type EntryAnalyticsProps<P> = Omit<ExperienceProps<P>, 'experiences'> & Baseline<P>;
|
|
4
|
+
export declare const EntryAnalytics: <P>({ component: Component, passthroughProps, ...entry }: EntryAnalyticsProps<P>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { EntryAnalyticsProps } from './EntryAnalytics';
|
|
2
|
-
export { EntryAnalytics } from './EntryAnalytics';
|
|
1
|
+
export type { EntryAnalyticsProps } from './EntryAnalytics';
|
|
2
|
+
export { EntryAnalytics } from './EntryAnalytics';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export declare const ComponentMarker: React.ForwardRefExoticComponent<React.RefAttributes<unknown>>;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const ComponentMarker: React.ForwardRefExoticComponent<React.RefAttributes<unknown>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './ComponentMarker';
|
|
1
|
+
export * from './ComponentMarker';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Reference } from '@ninetailed/experience.js';
|
|
2
|
-
import type { ExperienceBaseProps } from './types/Experience';
|
|
3
|
-
type DefaultExperienceLoadingComponentProps = ExperienceBaseProps<Record<string, unknown>, Record<string, unknown>, Record<string, unknown> & Reference> & {
|
|
4
|
-
unhideAfterMs?: number;
|
|
5
|
-
};
|
|
6
|
-
export declare const DefaultExperienceLoadingComponent: ({ component: Component, unhideAfterMs, passthroughProps, ...baseline }: DefaultExperienceLoadingComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export {};
|
|
1
|
+
import type { Reference } from '@ninetailed/experience.js';
|
|
2
|
+
import type { ExperienceBaseProps } from './types/Experience';
|
|
3
|
+
type DefaultExperienceLoadingComponentProps = ExperienceBaseProps<Record<string, unknown>, Record<string, unknown>, Record<string, unknown> & Reference> & {
|
|
4
|
+
unhideAfterMs?: number;
|
|
5
|
+
};
|
|
6
|
+
export declare const DefaultExperienceLoadingComponent: ({ component: Component, unhideAfterMs, passthroughProps, ...baseline }: DefaultExperienceLoadingComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import React, { PropsWithChildren } from 'react';
|
|
2
|
-
import { ExperienceBaseProps } from './Experience';
|
|
3
|
-
import { Reference } from '@ninetailed/experience.js';
|
|
4
|
-
type ESRContextValue = {
|
|
5
|
-
experienceVariantsMap: Record<string, number>;
|
|
6
|
-
};
|
|
7
|
-
export declare const ESRContext: React.Context<ESRContextValue | undefined>;
|
|
8
|
-
type ESRProviderProps = {
|
|
9
|
-
experienceVariantsMap: Record<string, number>;
|
|
10
|
-
};
|
|
11
|
-
export declare const ESRProvider: React.FC<PropsWithChildren<ESRProviderProps>>;
|
|
12
|
-
export declare const useESR: () => {
|
|
13
|
-
experienceVariantsMap: Record<string, number>;
|
|
14
|
-
};
|
|
15
|
-
export declare const ESRLoadingComponent: <P, PassThroughProps extends Partial<P> = Partial<P>, Variant extends Pick<P, Exclude<keyof P, keyof PassThroughProps>> & Reference = Pick<P, Exclude<keyof P, keyof PassThroughProps>> & Reference>({ experiences, component: Component, passthroughProps, ...baseline }: ExperienceBaseProps<P, PassThroughProps, Variant>) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
export {};
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
|
+
import { ExperienceBaseProps } from './Experience';
|
|
3
|
+
import { Reference } from '@ninetailed/experience.js';
|
|
4
|
+
type ESRContextValue = {
|
|
5
|
+
experienceVariantsMap: Record<string, number>;
|
|
6
|
+
};
|
|
7
|
+
export declare const ESRContext: React.Context<ESRContextValue | undefined>;
|
|
8
|
+
type ESRProviderProps = {
|
|
9
|
+
experienceVariantsMap: Record<string, number>;
|
|
10
|
+
};
|
|
11
|
+
export declare const ESRProvider: React.FC<PropsWithChildren<ESRProviderProps>>;
|
|
12
|
+
export declare const useESR: () => {
|
|
13
|
+
experienceVariantsMap: Record<string, number>;
|
|
14
|
+
};
|
|
15
|
+
export declare const ESRLoadingComponent: <P, PassThroughProps extends Partial<P> = Partial<P>, Variant extends Pick<P, Exclude<keyof P, keyof PassThroughProps>> & Reference = Pick<P, Exclude<keyof P, keyof PassThroughProps>> & Reference>({ experiences, component: Component, passthroughProps, ...baseline }: ExperienceBaseProps<P, PassThroughProps, Variant>) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Reference } from '@ninetailed/experience.js';
|
|
2
|
-
import type { ExperienceProps } from './types/Experience';
|
|
3
|
-
export declare const Experience: <P, PassThroughProps extends Partial<P> = Partial<P>, Variant extends Pick<P, Exclude<keyof P, keyof PassThroughProps>> & Reference = Pick<P, Exclude<keyof P, keyof PassThroughProps>> & Reference>({ experiences, component: Component, loadingComponent: LoadingComponent, trackClicks, passthroughProps, ...baseline }: ExperienceProps<P, PassThroughProps, Variant>) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
export type { ExperienceProps, ExperienceBaseProps, ExperienceComponent, ExperienceLoadingComponent, } from './types/Experience';
|
|
5
|
-
export { DefaultExperienceLoadingComponent } from './DefaultExperienceLoadingComponent';
|
|
1
|
+
import type { Reference } from '@ninetailed/experience.js';
|
|
2
|
+
import type { ExperienceProps } from './types/Experience';
|
|
3
|
+
export declare const Experience: <P, PassThroughProps extends Partial<P> = Partial<P>, Variant extends Pick<P, Exclude<keyof P, keyof PassThroughProps>> & Reference = Pick<P, Exclude<keyof P, keyof PassThroughProps>> & Reference>({ experiences, component: Component, loadingComponent: LoadingComponent, trackClicks, trackHovers, passthroughProps, ...baseline }: ExperienceProps<P, PassThroughProps, Variant>) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export type { ExperienceProps, ExperienceBaseProps, ExperienceComponent, ExperienceLoadingComponent, } from './types/Experience';
|
|
5
|
+
export { DefaultExperienceLoadingComponent } from './DefaultExperienceLoadingComponent';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const EXPERIENCE_TRAIT_PREFIX = "nt_experiment_";
|
|
1
|
+
export declare const EXPERIENCE_TRAIT_PREFIX = "nt_experiment_";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Experience, DefaultExperienceLoadingComponent } from './Experience';
|
|
2
|
-
export type { ExperienceProps, ExperienceBaseProps, ExperienceComponent, ExperienceLoadingComponent, } from './types/Experience';
|
|
3
|
-
export { ESRProvider, ESRLoadingComponent } from './ESRLoadingComponent';
|
|
4
|
-
export { useExperience } from './useExperience';
|
|
1
|
+
export { Experience, DefaultExperienceLoadingComponent } from './Experience';
|
|
2
|
+
export type { ExperienceProps, ExperienceBaseProps, ExperienceComponent, ExperienceLoadingComponent, } from './types/Experience';
|
|
3
|
+
export { ESRProvider, ESRLoadingComponent } from './ESRLoadingComponent';
|
|
4
|
+
export { useExperience } from './useExperience';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type Baseline<P extends object = object> = P & {
|
|
2
|
-
id: string;
|
|
3
|
-
};
|
|
1
|
+
export type Baseline<P extends object = object> = P & {
|
|
2
|
+
id: string;
|
|
3
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Baseline } from './Baseline';
|
|
2
|
-
import { Variant } from './Variant';
|
|
3
|
-
export type BaselineWithVariants = {
|
|
4
|
-
baseline: Baseline;
|
|
5
|
-
variants: Variant<Record<string, unknown>>[];
|
|
6
|
-
};
|
|
1
|
+
import { Baseline } from './Baseline';
|
|
2
|
+
import { Variant } from './Variant';
|
|
3
|
+
export type BaselineWithVariants = {
|
|
4
|
+
baseline: Baseline;
|
|
5
|
+
variants: Variant<Record<string, unknown>>[];
|
|
6
|
+
};
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import type { ComponentType } from 'react';
|
|
2
|
-
import type { Baseline, ExperienceConfiguration, Reference } from '@ninetailed/experience.js';
|
|
3
|
-
export type ExperienceComponent<P> = ComponentType<Omit<P, 'id'> & {
|
|
4
|
-
ninetailed?: {
|
|
5
|
-
isPersonalized: boolean;
|
|
6
|
-
audience: {
|
|
7
|
-
id: string;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
}>;
|
|
11
|
-
export type ExperienceBaseProps<P, PassThroughProps extends Partial<P>, Variant extends Pick<P, Exclude<keyof P, keyof PassThroughProps>> & Reference> = Baseline<Pick<P, Exclude<keyof P, keyof PassThroughProps>>> & {
|
|
12
|
-
experiences: ExperienceConfiguration<Variant>[];
|
|
13
|
-
component: ComponentType<P>;
|
|
14
|
-
passthroughProps?: PassThroughProps;
|
|
15
|
-
};
|
|
16
|
-
export type ExperienceLoadingComponent<P, PassThroughProps extends Partial<P>, Variant extends Pick<P, Exclude<keyof P, keyof PassThroughProps>> & Reference> = ComponentType<ExperienceBaseProps<P, PassThroughProps, Variant>>;
|
|
17
|
-
export type ExperienceProps<P, PassThroughProps extends Partial<P> = Partial<P>, Variant extends Pick<P, Exclude<keyof P, keyof PassThroughProps>> & Reference = Pick<P, Exclude<keyof P, keyof PassThroughProps>> & Reference> = ExperienceBaseProps<P, PassThroughProps, Variant> & {
|
|
18
|
-
experiences: ExperienceConfiguration<Variant>[];
|
|
19
|
-
component: ComponentType<P>;
|
|
20
|
-
loadingComponent?: ExperienceLoadingComponent<P, PassThroughProps, Variant>;
|
|
21
|
-
trackClicks?: boolean;
|
|
22
|
-
|
|
1
|
+
import type { ComponentType } from 'react';
|
|
2
|
+
import type { Baseline, ExperienceConfiguration, Reference } from '@ninetailed/experience.js';
|
|
3
|
+
export type ExperienceComponent<P> = ComponentType<Omit<P, 'id'> & {
|
|
4
|
+
ninetailed?: {
|
|
5
|
+
isPersonalized: boolean;
|
|
6
|
+
audience: {
|
|
7
|
+
id: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
}>;
|
|
11
|
+
export type ExperienceBaseProps<P, PassThroughProps extends Partial<P>, Variant extends Pick<P, Exclude<keyof P, keyof PassThroughProps>> & Reference> = Baseline<Pick<P, Exclude<keyof P, keyof PassThroughProps>>> & {
|
|
12
|
+
experiences: ExperienceConfiguration<Variant>[];
|
|
13
|
+
component: ComponentType<P>;
|
|
14
|
+
passthroughProps?: PassThroughProps;
|
|
15
|
+
};
|
|
16
|
+
export type ExperienceLoadingComponent<P, PassThroughProps extends Partial<P>, Variant extends Pick<P, Exclude<keyof P, keyof PassThroughProps>> & Reference> = ComponentType<ExperienceBaseProps<P, PassThroughProps, Variant>>;
|
|
17
|
+
export type ExperienceProps<P, PassThroughProps extends Partial<P> = Partial<P>, Variant extends Pick<P, Exclude<keyof P, keyof PassThroughProps>> & Reference = Pick<P, Exclude<keyof P, keyof PassThroughProps>> & Reference> = ExperienceBaseProps<P, PassThroughProps, Variant> & {
|
|
18
|
+
experiences: ExperienceConfiguration<Variant>[];
|
|
19
|
+
component: ComponentType<P>;
|
|
20
|
+
loadingComponent?: ExperienceLoadingComponent<P, PassThroughProps, Variant>;
|
|
21
|
+
trackClicks?: boolean;
|
|
22
|
+
trackHovers?: boolean;
|
|
23
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type Variant<P> = P & {
|
|
2
|
-
id: string;
|
|
3
|
-
};
|
|
1
|
+
export type Variant<P> = P & {
|
|
2
|
+
id: string;
|
|
3
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { Baseline } from './Baseline';
|
|
2
|
-
export type { Variant } from './Variant';
|
|
3
|
-
export type { BaselineWithVariants } from './BaselineWithVariants';
|
|
4
|
-
export type { ExperienceProps, ExperienceBaseProps, ExperienceComponent, ExperienceLoadingComponent, } from './Experience';
|
|
1
|
+
export type { Baseline } from './Baseline';
|
|
2
|
+
export type { Variant } from './Variant';
|
|
3
|
+
export type { BaselineWithVariants } from './BaselineWithVariants';
|
|
4
|
+
export type { ExperienceProps, ExperienceBaseProps, ExperienceComponent, ExperienceLoadingComponent, } from './Experience';
|
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
import { ExperienceConfiguration, Profile, Reference, VariantRef } from '@ninetailed/experience.js';
|
|
2
|
-
type Load<TBaseline extends Reference> = {
|
|
3
|
-
status: 'loading';
|
|
4
|
-
loading: boolean;
|
|
5
|
-
hasVariants: boolean;
|
|
6
|
-
baseline: TBaseline;
|
|
7
|
-
experience: null;
|
|
8
|
-
variant: TBaseline;
|
|
9
|
-
variantIndex: 0;
|
|
10
|
-
audience: null;
|
|
11
|
-
isPersonalized: boolean;
|
|
12
|
-
profile: null;
|
|
13
|
-
error: null;
|
|
14
|
-
};
|
|
15
|
-
type Success<TBaseline extends Reference, TVariant extends Reference> = {
|
|
16
|
-
status: 'success';
|
|
17
|
-
loading: boolean;
|
|
18
|
-
hasVariants: boolean;
|
|
19
|
-
baseline: TBaseline;
|
|
20
|
-
experience: ExperienceConfiguration<TVariant> | null;
|
|
21
|
-
variant: TBaseline | TVariant;
|
|
22
|
-
variantIndex: number;
|
|
23
|
-
audience: {
|
|
24
|
-
id: string;
|
|
25
|
-
} | null;
|
|
26
|
-
isPersonalized: boolean;
|
|
27
|
-
profile: Profile;
|
|
28
|
-
error: null;
|
|
29
|
-
};
|
|
30
|
-
type Fail<TBaseline extends Reference> = {
|
|
31
|
-
status: 'error';
|
|
32
|
-
loading: boolean;
|
|
33
|
-
hasVariants: boolean;
|
|
34
|
-
baseline: TBaseline;
|
|
35
|
-
experience: null;
|
|
36
|
-
variant: TBaseline;
|
|
37
|
-
variantIndex: 0;
|
|
38
|
-
audience: null;
|
|
39
|
-
isPersonalized: boolean;
|
|
40
|
-
profile: null;
|
|
41
|
-
error: Error;
|
|
42
|
-
};
|
|
43
|
-
type UseExperienceArgs<TBaseline extends Reference, TVariant extends Reference> = {
|
|
44
|
-
baseline: TBaseline;
|
|
45
|
-
experiences: ExperienceConfiguration<TVariant>[];
|
|
46
|
-
};
|
|
47
|
-
type UseExperienceReturn<TBaseline extends Reference, TVariant extends Reference> = Load<TBaseline> | Success<TBaseline, TVariant | VariantRef> | Fail<TBaseline>;
|
|
48
|
-
export declare const useExperience: <TBaseline extends Reference, TVariant extends Reference>({ baseline, experiences, }: UseExperienceArgs<TBaseline, TVariant>) => UseExperienceReturn<TBaseline, TVariant>;
|
|
49
|
-
export {};
|
|
1
|
+
import { ExperienceConfiguration, Profile, Reference, VariantRef } from '@ninetailed/experience.js';
|
|
2
|
+
type Load<TBaseline extends Reference> = {
|
|
3
|
+
status: 'loading';
|
|
4
|
+
loading: boolean;
|
|
5
|
+
hasVariants: boolean;
|
|
6
|
+
baseline: TBaseline;
|
|
7
|
+
experience: null;
|
|
8
|
+
variant: TBaseline;
|
|
9
|
+
variantIndex: 0;
|
|
10
|
+
audience: null;
|
|
11
|
+
isPersonalized: boolean;
|
|
12
|
+
profile: null;
|
|
13
|
+
error: null;
|
|
14
|
+
};
|
|
15
|
+
type Success<TBaseline extends Reference, TVariant extends Reference> = {
|
|
16
|
+
status: 'success';
|
|
17
|
+
loading: boolean;
|
|
18
|
+
hasVariants: boolean;
|
|
19
|
+
baseline: TBaseline;
|
|
20
|
+
experience: ExperienceConfiguration<TVariant> | null;
|
|
21
|
+
variant: TBaseline | TVariant;
|
|
22
|
+
variantIndex: number;
|
|
23
|
+
audience: {
|
|
24
|
+
id: string;
|
|
25
|
+
} | null;
|
|
26
|
+
isPersonalized: boolean;
|
|
27
|
+
profile: Profile;
|
|
28
|
+
error: null;
|
|
29
|
+
};
|
|
30
|
+
type Fail<TBaseline extends Reference> = {
|
|
31
|
+
status: 'error';
|
|
32
|
+
loading: boolean;
|
|
33
|
+
hasVariants: boolean;
|
|
34
|
+
baseline: TBaseline;
|
|
35
|
+
experience: null;
|
|
36
|
+
variant: TBaseline;
|
|
37
|
+
variantIndex: 0;
|
|
38
|
+
audience: null;
|
|
39
|
+
isPersonalized: boolean;
|
|
40
|
+
profile: null;
|
|
41
|
+
error: Error;
|
|
42
|
+
};
|
|
43
|
+
type UseExperienceArgs<TBaseline extends Reference, TVariant extends Reference> = {
|
|
44
|
+
baseline: TBaseline;
|
|
45
|
+
experiences: ExperienceConfiguration<TVariant>[];
|
|
46
|
+
};
|
|
47
|
+
type UseExperienceReturn<TBaseline extends Reference, TVariant extends Reference> = Load<TBaseline> | Success<TBaseline, TVariant | VariantRef> | Fail<TBaseline>;
|
|
48
|
+
export declare const useExperience: <TBaseline extends Reference, TVariant extends Reference>({ baseline, experiences, }: UseExperienceArgs<TBaseline, TVariant>) => UseExperienceReturn<TBaseline, TVariant>;
|
|
49
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
2
|
-
type MergeTagProps = {
|
|
3
|
-
id: string;
|
|
4
|
-
fallback?: string;
|
|
5
|
-
};
|
|
6
|
-
export declare const MergeTag: ({ id, fallback, }: PropsWithChildren<MergeTagProps>) => import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
-
export {};
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
type MergeTagProps = {
|
|
3
|
+
id: string;
|
|
4
|
+
fallback?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const MergeTag: ({ id, fallback, }: PropsWithChildren<MergeTagProps>) => import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Profile } from '@ninetailed/experience.js-shared';
|
|
2
|
-
export declare const generateSelectors: (id: string) => string[];
|
|
3
|
-
export declare const selectValueFromProfile: (profile: Profile, id: string) => unknown;
|
|
1
|
+
import { Profile } from '@ninetailed/experience.js-shared';
|
|
2
|
+
export declare const generateSelectors: (id: string) => string[];
|
|
3
|
+
export declare const selectValueFromProfile: (profile: Profile, id: string) => unknown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './MergeTag';
|
|
1
|
+
export * from './MergeTag';
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare const NinetailedContext: import("react").Context<NinetailedInstance<import("@ninetailed/experience.js").Reference, import("@ninetailed/experience.js").Reference> | undefined>;
|
|
1
|
+
import { NinetailedInstance } from '@ninetailed/experience.js';
|
|
2
|
+
export declare const NinetailedContext: import("react").Context<NinetailedInstance<import("@ninetailed/experience.js").Reference, import("@ninetailed/experience.js").Reference> | undefined>;
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Ninetailed, OnInitProfileId, Storage } from '@ninetailed/experience.js';
|
|
3
|
-
import { Locale, OnErrorHandler, OnLogHandler, NinetailedRequestContext } from '@ninetailed/experience.js-shared';
|
|
4
|
-
import { NinetailedPlugin } from '@ninetailed/experience.js-plugin-analytics';
|
|
5
|
-
export type NinetailedProviderInstantiationProps = {
|
|
6
|
-
clientId: string;
|
|
7
|
-
environment?: string;
|
|
8
|
-
preview?: boolean;
|
|
9
|
-
url?: string;
|
|
10
|
-
plugins?: (NinetailedPlugin | NinetailedPlugin[])[];
|
|
11
|
-
locale?: Locale;
|
|
12
|
-
requestTimeout?: number;
|
|
13
|
-
onLog?: OnLogHandler;
|
|
14
|
-
onError?: OnErrorHandler;
|
|
15
|
-
componentViewTrackingThreshold?: number;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Ninetailed, OnInitProfileId, Storage } from '@ninetailed/experience.js';
|
|
3
|
+
import { Locale, OnErrorHandler, OnLogHandler, NinetailedRequestContext } from '@ninetailed/experience.js-shared';
|
|
4
|
+
import { NinetailedPlugin } from '@ninetailed/experience.js-plugin-analytics';
|
|
5
|
+
export type NinetailedProviderInstantiationProps = {
|
|
6
|
+
clientId: string;
|
|
7
|
+
environment?: string;
|
|
8
|
+
preview?: boolean;
|
|
9
|
+
url?: string;
|
|
10
|
+
plugins?: (NinetailedPlugin | NinetailedPlugin[])[];
|
|
11
|
+
locale?: Locale;
|
|
12
|
+
requestTimeout?: number;
|
|
13
|
+
onLog?: OnLogHandler;
|
|
14
|
+
onError?: OnErrorHandler;
|
|
15
|
+
componentViewTrackingThreshold?: number;
|
|
16
|
+
componentHoverTrackingThreshold?: number;
|
|
17
|
+
buildClientContext?: () => NinetailedRequestContext;
|
|
18
|
+
onInitProfileId?: OnInitProfileId;
|
|
19
|
+
storageImpl?: Storage;
|
|
20
|
+
useSDKEvaluation?: boolean;
|
|
21
|
+
};
|
|
22
|
+
export type NinetailedProviderProps = NinetailedProviderInstantiationProps | {
|
|
23
|
+
ninetailed: Ninetailed;
|
|
24
|
+
};
|
|
25
|
+
export declare const NinetailedProvider: (props: React.PropsWithChildren<NinetailedProviderProps>) => import("react/jsx-runtime").JSX.Element;
|
package/src/lib/Personalize.d.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Variant } from './Variant';
|
|
3
|
-
export type PersonalizedComponent<P> = React.ComponentType<Omit<P, 'id'> & {
|
|
4
|
-
ninetailed?: {
|
|
5
|
-
isPersonalized: boolean;
|
|
6
|
-
audience: {
|
|
7
|
-
id: string;
|
|
8
|
-
} | {
|
|
9
|
-
id: 'baseline';
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
}>;
|
|
13
|
-
type Baseline<P> = P & {
|
|
14
|
-
id: string;
|
|
15
|
-
};
|
|
16
|
-
type PersonalizeProps<P> = Baseline<P> & {
|
|
17
|
-
variants?: Variant<P>[];
|
|
18
|
-
component: PersonalizedComponent<P> | React.ComponentType<P>;
|
|
19
|
-
loadingComponent?: React.ComponentType;
|
|
20
|
-
holdout?: number;
|
|
21
|
-
};
|
|
22
|
-
export declare const Personalize: <P extends object>({ component: Component, loadingComponent: LoadingComponent, variants, holdout, ...baseline }: PersonalizeProps<P>) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
-
export {};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Variant } from './Variant';
|
|
3
|
+
export type PersonalizedComponent<P> = React.ComponentType<Omit<P, 'id'> & {
|
|
4
|
+
ninetailed?: {
|
|
5
|
+
isPersonalized: boolean;
|
|
6
|
+
audience: {
|
|
7
|
+
id: string;
|
|
8
|
+
} | {
|
|
9
|
+
id: 'baseline';
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
}>;
|
|
13
|
+
type Baseline<P> = P & {
|
|
14
|
+
id: string;
|
|
15
|
+
};
|
|
16
|
+
type PersonalizeProps<P> = Baseline<P> & {
|
|
17
|
+
variants?: Variant<P>[];
|
|
18
|
+
component: PersonalizedComponent<P> | React.ComponentType<P>;
|
|
19
|
+
loadingComponent?: React.ComponentType;
|
|
20
|
+
holdout?: number;
|
|
21
|
+
};
|
|
22
|
+
export declare const Personalize: <P extends object>({ component: Component, loadingComponent: LoadingComponent, variants, holdout, ...baseline }: PersonalizeProps<P>) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Variant } from './Variant';
|
|
3
|
-
type TrackHasSeenComponentProps = {
|
|
4
|
-
variant: Variant<any>;
|
|
5
|
-
audience: {
|
|
6
|
-
id: string;
|
|
7
|
-
};
|
|
8
|
-
isPersonalized: boolean;
|
|
9
|
-
};
|
|
10
|
-
export declare const TrackHasSeenComponent: React.FC<React.PropsWithChildren<TrackHasSeenComponentProps>>;
|
|
11
|
-
export {};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Variant } from './Variant';
|
|
3
|
+
type TrackHasSeenComponentProps = {
|
|
4
|
+
variant: Variant<any>;
|
|
5
|
+
audience: {
|
|
6
|
+
id: string;
|
|
7
|
+
};
|
|
8
|
+
isPersonalized: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare const TrackHasSeenComponent: React.FC<React.PropsWithChildren<TrackHasSeenComponentProps>>;
|
|
11
|
+
export {};
|
package/src/lib/Variant.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export type Variant<P = unknown> = P & {
|
|
2
|
-
id: string;
|
|
3
|
-
audience: {
|
|
4
|
-
id: string;
|
|
5
|
-
};
|
|
6
|
-
};
|
|
1
|
+
export type Variant<P = unknown> = P & {
|
|
2
|
+
id: string;
|
|
3
|
+
audience: {
|
|
4
|
+
id: string;
|
|
5
|
+
};
|
|
6
|
+
};
|
package/src/lib/index.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
export type { Profile, Variant } from '@ninetailed/experience.js-shared';
|
|
2
|
-
export type { ExperienceConfiguration, ExperienceType, EXPERIENCE_TRAIT_PREFIX, } from '@ninetailed/experience.js';
|
|
3
|
-
export { NinetailedProvider } from './NinetailedProvider';
|
|
4
|
-
export type { NinetailedProviderProps, NinetailedProviderInstantiationProps, } from './NinetailedProvider';
|
|
5
|
-
export { useNinetailed } from './useNinetailed';
|
|
6
|
-
export { useProfile } from './useProfile';
|
|
7
|
-
export { usePersonalize } from './usePersonalize';
|
|
8
|
-
export { useFlag } from './useFlag';
|
|
9
|
-
export { useFlagWithManualTracking } from './useFlagWithManualTracking';
|
|
10
|
-
export { Personalize } from './Personalize';
|
|
11
|
-
export type { PersonalizedComponent } from './Personalize';
|
|
12
|
-
export { MergeTag } from './MergeTag';
|
|
13
|
-
export { TrackHasSeenComponent } from './TrackHasSeenComponent';
|
|
14
|
-
export { Experience, ESRProvider, ESRLoadingComponent, DefaultExperienceLoadingComponent, useExperience, } from './Experience';
|
|
15
|
-
export type { ExperienceProps, ExperienceBaseProps, ExperienceComponent, ExperienceLoadingComponent, } from './Experience';
|
|
16
|
-
export { EntryAnalytics } from './EntryAnalytics';
|
|
17
|
-
export type { EntryAnalyticsProps } from './EntryAnalytics';
|
|
1
|
+
export type { Profile, Variant } from '@ninetailed/experience.js-shared';
|
|
2
|
+
export type { ExperienceConfiguration, ExperienceType, EXPERIENCE_TRAIT_PREFIX, } from '@ninetailed/experience.js';
|
|
3
|
+
export { NinetailedProvider } from './NinetailedProvider';
|
|
4
|
+
export type { NinetailedProviderProps, NinetailedProviderInstantiationProps, } from './NinetailedProvider';
|
|
5
|
+
export { useNinetailed } from './useNinetailed';
|
|
6
|
+
export { useProfile } from './useProfile';
|
|
7
|
+
export { usePersonalize } from './usePersonalize';
|
|
8
|
+
export { useFlag } from './useFlag';
|
|
9
|
+
export { useFlagWithManualTracking } from './useFlagWithManualTracking';
|
|
10
|
+
export { Personalize } from './Personalize';
|
|
11
|
+
export type { PersonalizedComponent } from './Personalize';
|
|
12
|
+
export { MergeTag } from './MergeTag';
|
|
13
|
+
export { TrackHasSeenComponent } from './TrackHasSeenComponent';
|
|
14
|
+
export { Experience, ESRProvider, ESRLoadingComponent, DefaultExperienceLoadingComponent, useExperience, } from './Experience';
|
|
15
|
+
export type { ExperienceProps, ExperienceBaseProps, ExperienceComponent, ExperienceLoadingComponent, } from './Experience';
|
|
16
|
+
export { EntryAnalytics } from './EntryAnalytics';
|
|
17
|
+
export type { EntryAnalyticsProps } from './EntryAnalytics';
|
package/src/lib/useFlag.d.ts
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { AllowedVariableType } from '@ninetailed/experience.js-shared';
|
|
2
|
-
export type FlagResult<T> = {
|
|
3
|
-
status: 'loading';
|
|
4
|
-
value: T;
|
|
5
|
-
error: null;
|
|
6
|
-
} | {
|
|
7
|
-
status: 'success';
|
|
8
|
-
value: T;
|
|
9
|
-
error: null;
|
|
10
|
-
} | {
|
|
11
|
-
status: 'error';
|
|
12
|
-
value: T;
|
|
13
|
-
error: Error;
|
|
14
|
-
};
|
|
15
|
-
type UseFlagOptions = {
|
|
16
|
-
/**
|
|
17
|
-
* Type for auto tracking
|
|
18
|
-
*
|
|
19
|
-
* @remarks
|
|
20
|
-
* if this is a function then it should be stable, otherwise tracking will happen more frequently than expected
|
|
21
|
-
*/
|
|
22
|
-
shouldAutoTrack?: boolean | (() => boolean);
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* Hook to access a Ninetailed variable flag with built-in auto-tracking.
|
|
26
|
-
*
|
|
27
|
-
* @remarks
|
|
28
|
-
* For manual control over tracking behavior, consider using {@link useFlagWithManualTracking}.
|
|
29
|
-
*/
|
|
30
|
-
export declare function useFlag<T extends AllowedVariableType>(flagKey: string, defaultValue: T, options?: UseFlagOptions): FlagResult<T>;
|
|
31
|
-
export {};
|
|
1
|
+
import { AllowedVariableType } from '@ninetailed/experience.js-shared';
|
|
2
|
+
export type FlagResult<T> = {
|
|
3
|
+
status: 'loading';
|
|
4
|
+
value: T;
|
|
5
|
+
error: null;
|
|
6
|
+
} | {
|
|
7
|
+
status: 'success';
|
|
8
|
+
value: T;
|
|
9
|
+
error: null;
|
|
10
|
+
} | {
|
|
11
|
+
status: 'error';
|
|
12
|
+
value: T;
|
|
13
|
+
error: Error;
|
|
14
|
+
};
|
|
15
|
+
type UseFlagOptions = {
|
|
16
|
+
/**
|
|
17
|
+
* Type for auto tracking
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* if this is a function then it should be stable, otherwise tracking will happen more frequently than expected
|
|
21
|
+
*/
|
|
22
|
+
shouldAutoTrack?: boolean | (() => boolean);
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Hook to access a Ninetailed variable flag with built-in auto-tracking.
|
|
26
|
+
*
|
|
27
|
+
* @remarks
|
|
28
|
+
* For manual control over tracking behavior, consider using {@link useFlagWithManualTracking}.
|
|
29
|
+
*/
|
|
30
|
+
export declare function useFlag<T extends AllowedVariableType>(flagKey: string, defaultValue: T, options?: UseFlagOptions): FlagResult<T>;
|
|
31
|
+
export {};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { AllowedVariableType } from '@ninetailed/experience.js-shared';
|
|
2
|
-
export type FlagResult<T> = {
|
|
3
|
-
status: 'loading';
|
|
4
|
-
value: T;
|
|
5
|
-
error: null;
|
|
6
|
-
} | {
|
|
7
|
-
status: 'success';
|
|
8
|
-
value: T;
|
|
9
|
-
error: null;
|
|
10
|
-
} | {
|
|
11
|
-
status: 'error';
|
|
12
|
-
value: T;
|
|
13
|
-
error: Error;
|
|
14
|
-
};
|
|
15
|
-
export type FlagResultWithTracking<T> = [FlagResult<T>, () => void];
|
|
16
|
-
/**
|
|
17
|
-
* Hook to access a Ninetailed variable flag with manual tracking control.
|
|
18
|
-
*/
|
|
19
|
-
export declare function useFlagWithManualTracking<T extends AllowedVariableType>(flagKey: string, defaultValue: T): FlagResultWithTracking<T>;
|
|
1
|
+
import { AllowedVariableType } from '@ninetailed/experience.js-shared';
|
|
2
|
+
export type FlagResult<T> = {
|
|
3
|
+
status: 'loading';
|
|
4
|
+
value: T;
|
|
5
|
+
error: null;
|
|
6
|
+
} | {
|
|
7
|
+
status: 'success';
|
|
8
|
+
value: T;
|
|
9
|
+
error: null;
|
|
10
|
+
} | {
|
|
11
|
+
status: 'error';
|
|
12
|
+
value: T;
|
|
13
|
+
error: Error;
|
|
14
|
+
};
|
|
15
|
+
export type FlagResultWithTracking<T> = [FlagResult<T>, () => void];
|
|
16
|
+
/**
|
|
17
|
+
* Hook to access a Ninetailed variable flag with manual tracking control.
|
|
18
|
+
*/
|
|
19
|
+
export declare function useFlagWithManualTracking<T extends AllowedVariableType>(flagKey: string, defaultValue: T): FlagResultWithTracking<T>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { NinetailedInstance } from '@ninetailed/experience.js';
|
|
2
|
-
import { Reference } from '@ninetailed/experience.js-shared';
|
|
3
|
-
export declare const useNinetailed: <TBaseline extends Reference = Reference, TVariant extends Reference = Reference>() => NinetailedInstance<TBaseline, TVariant>;
|
|
1
|
+
import { NinetailedInstance } from '@ninetailed/experience.js';
|
|
2
|
+
import { Reference } from '@ninetailed/experience.js-shared';
|
|
3
|
+
export declare const useNinetailed: <TBaseline extends Reference = Reference, TVariant extends Reference = Reference>() => NinetailedInstance<TBaseline, TVariant>;
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { Variant } from '@ninetailed/experience.js-shared';
|
|
2
|
-
type Options = {
|
|
3
|
-
holdout?: number;
|
|
4
|
-
};
|
|
5
|
-
export declare const usePersonalize: <T extends {
|
|
6
|
-
id: string;
|
|
7
|
-
}>(baseline: T, variants: Variant<T>[], options?: Options) => {
|
|
8
|
-
loading: true;
|
|
9
|
-
variant: Variant<T>;
|
|
10
|
-
audience: {
|
|
11
|
-
id: "baseline";
|
|
12
|
-
};
|
|
13
|
-
isPersonalized: false;
|
|
14
|
-
error: null;
|
|
15
|
-
} | {
|
|
16
|
-
loading: false;
|
|
17
|
-
variant: Variant<T>;
|
|
18
|
-
audience: {
|
|
19
|
-
id: string;
|
|
20
|
-
};
|
|
21
|
-
isPersonalized: boolean;
|
|
22
|
-
error: null;
|
|
23
|
-
} | {
|
|
24
|
-
loading: false;
|
|
25
|
-
variant: Variant<T>;
|
|
26
|
-
audience: {
|
|
27
|
-
id: "baseline";
|
|
28
|
-
};
|
|
29
|
-
isPersonalized: false;
|
|
30
|
-
error: Error;
|
|
31
|
-
};
|
|
32
|
-
export {};
|
|
1
|
+
import { Variant } from '@ninetailed/experience.js-shared';
|
|
2
|
+
type Options = {
|
|
3
|
+
holdout?: number;
|
|
4
|
+
};
|
|
5
|
+
export declare const usePersonalize: <T extends {
|
|
6
|
+
id: string;
|
|
7
|
+
}>(baseline: T, variants: Variant<T>[], options?: Options) => {
|
|
8
|
+
loading: true;
|
|
9
|
+
variant: Variant<T>;
|
|
10
|
+
audience: {
|
|
11
|
+
id: "baseline";
|
|
12
|
+
};
|
|
13
|
+
isPersonalized: false;
|
|
14
|
+
error: null;
|
|
15
|
+
} | {
|
|
16
|
+
loading: false;
|
|
17
|
+
variant: Variant<T>;
|
|
18
|
+
audience: {
|
|
19
|
+
id: string;
|
|
20
|
+
};
|
|
21
|
+
isPersonalized: boolean;
|
|
22
|
+
error: null;
|
|
23
|
+
} | {
|
|
24
|
+
loading: false;
|
|
25
|
+
variant: Variant<T>;
|
|
26
|
+
audience: {
|
|
27
|
+
id: "baseline";
|
|
28
|
+
};
|
|
29
|
+
isPersonalized: false;
|
|
30
|
+
error: Error;
|
|
31
|
+
};
|
|
32
|
+
export {};
|
package/src/lib/useProfile.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { ProfileState } from '@ninetailed/experience.js';
|
|
2
|
-
type UseProfileHookResult = Omit<ProfileState, 'experiences'> & {
|
|
3
|
-
loading: boolean;
|
|
4
|
-
};
|
|
5
|
-
/**
|
|
6
|
-
* Custom hook that provides access to the Ninetailed profile state
|
|
7
|
-
* with the 'experiences' property removed to prevent unnecessary re-renders.
|
|
8
|
-
*
|
|
9
|
-
* This hook handles profile state changes efficiently by:
|
|
10
|
-
* 1. Only updating state when actual changes occur
|
|
11
|
-
* 2. Removing the large 'experiences' object from the state
|
|
12
|
-
* 3. Properly cleaning up subscriptions when components unmount
|
|
13
|
-
*
|
|
14
|
-
* @returns The profile state without the 'experiences' property
|
|
15
|
-
*/
|
|
16
|
-
export declare const useProfile: () => UseProfileHookResult;
|
|
17
|
-
export {};
|
|
1
|
+
import { ProfileState } from '@ninetailed/experience.js';
|
|
2
|
+
type UseProfileHookResult = Omit<ProfileState, 'experiences'> & {
|
|
3
|
+
loading: boolean;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Custom hook that provides access to the Ninetailed profile state
|
|
7
|
+
* with the 'experiences' property removed to prevent unnecessary re-renders.
|
|
8
|
+
*
|
|
9
|
+
* This hook handles profile state changes efficiently by:
|
|
10
|
+
* 1. Only updating state when actual changes occur
|
|
11
|
+
* 2. Removing the large 'experiences' object from the state
|
|
12
|
+
* 3. Properly cleaning up subscriptions when components unmount
|
|
13
|
+
*
|
|
14
|
+
* @returns The profile state without the 'experiences' property
|
|
15
|
+
*/
|
|
16
|
+
export declare const useProfile: () => UseProfileHookResult;
|
|
17
|
+
export {};
|