@remkoj/optimizely-one-nextjs 6.0.0-pre9 → 6.0.0-rc.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/AGENTS.md +130 -0
- package/README.md +5 -1
- package/dist/api/graph-info-service.js +1 -1
- package/dist/api/graph-info-service.js.map +1 -1
- package/dist/api/index.js +5 -3
- package/dist/api/index.js.map +1 -1
- package/dist/api/profile-api-service.js +4 -2
- package/dist/api/profile-api-service.js.map +1 -1
- package/dist/api/types.d.ts +2 -2
- package/dist/client-types.d.ts +94 -23
- package/dist/client-types.js +5 -1
- package/dist/client-types.js.map +1 -1
- package/dist/components/context.d.ts +223 -60
- package/dist/components/context.js +159 -67
- package/dist/components/context.js.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/optimizely-one-gadget/_notice.js +1 -0
- package/dist/components/optimizely-one-gadget/_notice.js.map +1 -1
- package/dist/components/optimizely-one-gadget/_types.d.ts +13 -13
- package/dist/components/optimizely-one-gadget/audiences-panel.js +2 -1
- package/dist/components/optimizely-one-gadget/audiences-panel.js.map +1 -1
- package/dist/components/optimizely-one-gadget/exp-panel.d.ts +1 -1
- package/dist/components/optimizely-one-gadget/exp-panel.js +1 -0
- package/dist/components/optimizely-one-gadget/exp-panel.js.map +1 -1
- package/dist/components/optimizely-one-gadget/gadget.js +25 -17
- package/dist/components/optimizely-one-gadget/gadget.js.map +1 -1
- package/dist/components/optimizely-one-gadget/goals-panel.js +1 -0
- package/dist/components/optimizely-one-gadget/goals-panel.js.map +1 -1
- package/dist/components/optimizely-one-gadget/graph-panel.js +1 -0
- package/dist/components/optimizely-one-gadget/graph-panel.js.map +1 -1
- package/dist/components/optimizely-one-gadget/interests-panel.js +1 -0
- package/dist/components/optimizely-one-gadget/interests-panel.js.map +1 -1
- package/dist/components/optimizely-one-gadget/logo.js +1 -0
- package/dist/components/optimizely-one-gadget/logo.js.map +1 -1
- package/dist/components/optimizely-one-gadget/profile-panel.js +3 -2
- package/dist/components/optimizely-one-gadget/profile-panel.js.map +1 -1
- package/dist/components/page-activator.d.ts +1 -1
- package/dist/components/page-activator.js +12 -31
- package/dist/components/page-activator.js.map +1 -1
- package/dist/components/service-filters.d.ts +46 -0
- package/dist/components/service-filters.js +56 -0
- package/dist/components/service-filters.js.map +1 -0
- package/dist/components/types.d.ts +2 -0
- package/dist/components/types.js +2 -0
- package/dist/components/types.js.map +1 -0
- package/dist/components/use-cookie.js.map +1 -1
- package/dist/components/use-local-state.d.ts +24 -0
- package/dist/components/use-local-state.js +55 -0
- package/dist/components/use-local-state.js.map +1 -0
- package/dist/components/use-test-mode.js +2 -2
- package/dist/components/use-test-mode.js.map +1 -1
- package/dist/config.d.ts +119 -0
- package/dist/config.js +101 -2
- package/dist/config.js.map +1 -1
- package/dist/env-vars.d.ts +3 -0
- package/dist/env-vars.js +3 -0
- package/dist/env-vars.js.map +1 -1
- package/dist/products/content-recs/api.js.map +1 -1
- package/dist/products/content-recs/client.d.ts +10 -3
- package/dist/products/content-recs/client.js +38 -2
- package/dist/products/content-recs/client.js.map +1 -1
- package/dist/products/content-recs/delivery.d.ts +18 -18
- package/dist/products/content-recs/delivery.js.map +1 -1
- package/dist/products/content-recs/snippet.d.ts +1 -1
- package/dist/products/content-recs/snippet.js +0 -1
- package/dist/products/content-recs/snippet.js.map +1 -1
- package/dist/{api/content-goals.d.ts → products/content-recs/webservice-goals.d.ts} +1 -1
- package/dist/{api/content-goals.js → products/content-recs/webservice-goals.js} +4 -4
- package/dist/products/content-recs/webservice-goals.js.map +1 -0
- package/dist/products/content-recs/webservice.d.ts +3 -0
- package/dist/{api/content-recs.js → products/content-recs/webservice.js} +13 -12
- package/dist/products/content-recs/webservice.js.map +1 -0
- package/dist/products/data-platform/api.d.ts +9 -9
- package/dist/products/data-platform/api.js +9 -9
- package/dist/products/data-platform/api.js.map +1 -1
- package/dist/products/data-platform/client.d.ts +11 -2
- package/dist/products/data-platform/client.js +52 -9
- package/dist/products/data-platform/client.js.map +1 -1
- package/dist/products/data-platform/index.js.map +1 -1
- package/dist/products/data-platform/snippet.d.ts +1 -1
- package/dist/products/data-platform/snippet.js +3 -4
- package/dist/products/data-platform/snippet.js.map +1 -1
- package/dist/products/feature-experimentation/provider.d.ts +7 -0
- package/dist/products/feature-experimentation/provider.js +38 -0
- package/dist/products/feature-experimentation/provider.js.map +1 -0
- package/dist/products/web-experimentation/client.d.ts +5 -2
- package/dist/products/web-experimentation/client.js +21 -7
- package/dist/products/web-experimentation/client.js.map +1 -1
- package/dist/products/web-experimentation/snippet.d.ts +1 -1
- package/dist/products/web-experimentation/snippet.js +2 -3
- package/dist/products/web-experimentation/snippet.js.map +1 -1
- package/dist/products/web-experimentation/webservice.d.ts +3 -0
- package/dist/{api/experimentation-api.js → products/web-experimentation/webservice.js} +2 -2
- package/dist/products/web-experimentation/webservice.js.map +1 -0
- package/dist/server-components/index.d.ts +3 -0
- package/dist/server-components/index.js +3 -0
- package/dist/server-components/index.js.map +1 -1
- package/dist/{components/optimizely-one-gadget/index.d.ts → server-components/optimizely-one-gadget.d.ts} +2 -2
- package/dist/{components/optimizely-one-gadget/index.js → server-components/optimizely-one-gadget.js} +4 -5
- package/dist/server-components/optimizely-one-gadget.js.map +1 -0
- package/dist/server-components/optimizely-one.d.ts +219 -0
- package/dist/server-components/optimizely-one.js +112 -0
- package/dist/server-components/optimizely-one.js.map +1 -0
- package/dist/server-components/scripts/footer.d.ts +1 -1
- package/dist/server-components/scripts/footer.js.map +1 -1
- package/dist/server-components/scripts/header.d.ts +29 -29
- package/dist/server-components/scripts/header.js.map +1 -1
- package/dist/server-components/scripts/index.d.ts +6 -6
- package/dist/server-components/scripts/index.js +6 -6
- package/dist/server-components/scripts/index.js.map +1 -1
- package/dist/server.d.ts +1 -2
- package/dist/server.js +1 -6
- package/dist/server.js.map +1 -1
- package/dist/styles.css +2 -2
- package/dist/utils/env.js.map +1 -1
- package/dist/utils/products.d.ts +92 -0
- package/dist/utils/products.js +84 -0
- package/dist/utils/products.js.map +1 -0
- package/package.json +35 -30
- package/dist/api/content-goals.js.map +0 -1
- package/dist/api/content-recs.d.ts +0 -3
- package/dist/api/content-recs.js.map +0 -1
- package/dist/api/experimentation-api.d.ts +0 -3
- package/dist/api/experimentation-api.js.map +0 -1
- package/dist/components/optimizely-one-gadget/index.js.map +0 -1
- package/dist/components/rsc.d.ts +0 -2
- package/dist/components/rsc.js +0 -3
- package/dist/components/rsc.js.map +0 -1
|
@@ -1,102 +1,265 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type PropsWithChildren, type Dispatch, type SetStateAction } from "react";
|
|
2
|
+
import type * as ClientApi from '../client-types';
|
|
3
|
+
import type { SupportedProductNames } from './types';
|
|
2
4
|
import WebExperimenationService from '../products/web-experimentation/client';
|
|
3
5
|
import DataPlatformService from '../products/data-platform/client';
|
|
4
6
|
import ContentRecsService from '../products/content-recs/client';
|
|
5
|
-
import * as ClientApi from '../client-types';
|
|
6
7
|
/**
|
|
7
|
-
*
|
|
8
|
+
* Context contract for Optimizely One integrations.
|
|
9
|
+
*
|
|
10
|
+
* Provides runtime flags, active service management, event dispatching,
|
|
11
|
+
* and capability-specific service selectors used by consumers.
|
|
8
12
|
*/
|
|
9
|
-
type OptimizelyOneContextType = {
|
|
13
|
+
export type OptimizelyOneContextType = Readonly<{
|
|
10
14
|
/**
|
|
11
15
|
* With tracking completely disabled, all events will be stopped by
|
|
12
16
|
* the OptimizelyOne hook. The "PageActivator" component will propagate
|
|
13
17
|
* this instruction to all configured Optimizely One services
|
|
14
18
|
*/
|
|
15
|
-
disableTracking
|
|
19
|
+
disableTracking: Readonly<boolean>;
|
|
16
20
|
/**
|
|
17
21
|
* With auto-tracking disabled, the "PageActivator" component will not
|
|
18
22
|
* automatically track a generic pageview for all configured Optimizely
|
|
19
23
|
* One services.
|
|
20
24
|
*/
|
|
21
|
-
disableAutotracking
|
|
25
|
+
disableAutotracking: Readonly<boolean>;
|
|
22
26
|
/**
|
|
23
|
-
* The list of
|
|
24
|
-
* context.
|
|
25
|
-
*
|
|
27
|
+
* The list of the active Optimizely One Services registered with the
|
|
28
|
+
* context. Inactive services are filtered out and will not be part of
|
|
29
|
+
* this collection.
|
|
26
30
|
*/
|
|
27
|
-
services
|
|
31
|
+
services: ReadonlyArray<ClientApi.OptimizelyOneService>;
|
|
28
32
|
/**
|
|
29
|
-
* Whether
|
|
33
|
+
* Whether debug output is enabled for registered services.
|
|
34
|
+
*/
|
|
35
|
+
debug: Readonly<boolean>;
|
|
36
|
+
/**
|
|
37
|
+
* Updates debug mode for the context.
|
|
38
|
+
*/
|
|
39
|
+
setDebug: Dispatch<SetStateAction<boolean>>;
|
|
40
|
+
/**
|
|
41
|
+
* Adds a service to the context.
|
|
42
|
+
*
|
|
43
|
+
* This allows dynamic service registration after initialization, but requires
|
|
44
|
+
* the full service definition, including `isActive`.
|
|
45
|
+
*
|
|
46
|
+
* @param service The service instance to add.
|
|
30
47
|
*/
|
|
31
|
-
debug?: boolean;
|
|
32
|
-
setDebug: (newDebug: boolean) => void;
|
|
33
48
|
addService: (service: ClientApi.OptimizelyOneService) => void;
|
|
49
|
+
/**
|
|
50
|
+
* Removes a service from the context.
|
|
51
|
+
*
|
|
52
|
+
* The exact same service instance must be passed as was used during add.
|
|
53
|
+
* Built-in default services cannot be removed with this method.
|
|
54
|
+
*
|
|
55
|
+
* @param service The service instance to remove.
|
|
56
|
+
*/
|
|
34
57
|
removeService: (service: ClientApi.OptimizelyOneService) => void;
|
|
58
|
+
/**
|
|
59
|
+
* Tracks an event through the generic event API.
|
|
60
|
+
*
|
|
61
|
+
* All configured services that support event tracking receive this event.
|
|
62
|
+
*
|
|
63
|
+
* @param event The event payload to send.
|
|
64
|
+
*/
|
|
65
|
+
track: (event: ClientApi.OptimizelyOneEvent) => void;
|
|
66
|
+
/**
|
|
67
|
+
* Discovers profile data from active discovery-capable services.
|
|
68
|
+
*
|
|
69
|
+
* @param signal Optional abort signal used to cancel discovery requests.
|
|
70
|
+
* @returns A promise that resolves when profile discovery and merge are complete.
|
|
71
|
+
*/
|
|
72
|
+
discoverProfileData: (signal?: AbortSignal | null) => Promise<void>;
|
|
73
|
+
/**
|
|
74
|
+
* Merges the provided profile data into the current profile state.
|
|
75
|
+
*
|
|
76
|
+
* @param profileData Profile data patch to merge.
|
|
77
|
+
*/
|
|
78
|
+
updateProfile: (profileData: Partial<ClientApi.OptimizelyOneProfileData>) => void;
|
|
79
|
+
/**
|
|
80
|
+
* Retrieves active services that support the page activation step.
|
|
81
|
+
*
|
|
82
|
+
* @returns A list of active services with `activatePage` capability.
|
|
83
|
+
*/
|
|
84
|
+
getActivatePageServices: () => ClientApi.OptimizelyOneServiceWithCapability<unknown, string, 'activatePage'>[];
|
|
85
|
+
/**
|
|
86
|
+
* Retrieves active services that support page-view tracking.
|
|
87
|
+
*
|
|
88
|
+
* @returns A list of active services with `trackPage` capability.
|
|
89
|
+
*/
|
|
90
|
+
getTrackPageServices: () => ClientApi.OptimizelyOneServiceWithCapability<unknown, string, 'trackPage'>[];
|
|
91
|
+
/**
|
|
92
|
+
* Retrieves active services that support profile updates.
|
|
93
|
+
*
|
|
94
|
+
* @returns A list of active services with `updateProfile` capability.
|
|
95
|
+
*/
|
|
96
|
+
getProfileServices: () => ClientApi.OptimizelyOneServiceWithCapability<unknown, string, 'updateProfile'>[];
|
|
97
|
+
/**
|
|
98
|
+
* Retrieves active services that can discover profile data.
|
|
99
|
+
*
|
|
100
|
+
* @returns A list of active services with `discoverProfileData` capability.
|
|
101
|
+
*/
|
|
102
|
+
getProfileDataSources: () => ClientApi.OptimizelyOneServiceWithCapability<unknown, string, 'discoverProfileData'>[];
|
|
103
|
+
/**
|
|
104
|
+
* Retrieves an individual active service by its code.
|
|
105
|
+
*
|
|
106
|
+
* @param code The service code.
|
|
107
|
+
* @returns The matching service, or `undefined` when not found.
|
|
108
|
+
*/
|
|
109
|
+
getService: <SC extends string>(code: SC) => SC extends keyof CoreServices ? CoreServices[SC] : (ClientApi.OptimizelyOneService<unknown, SC> | undefined);
|
|
110
|
+
}>;
|
|
111
|
+
type CoreServices = {
|
|
112
|
+
webex: WebExperimenationService;
|
|
113
|
+
dataPlatform: DataPlatformService;
|
|
114
|
+
contentRecs: ContentRecsService;
|
|
35
115
|
};
|
|
36
|
-
|
|
37
|
-
|
|
116
|
+
/**
|
|
117
|
+
* Props accepted by `OptimizelyOneProvider`.
|
|
118
|
+
*
|
|
119
|
+
* `value` supplies initial context flags and optional additional services.
|
|
120
|
+
* `enabledOptimizelyServices` controls which built-in product services are enabled.
|
|
121
|
+
*/
|
|
122
|
+
export type ProviderProps = PropsWithChildren<{
|
|
123
|
+
/**
|
|
124
|
+
* Initial context values and optional custom services.
|
|
125
|
+
*/
|
|
126
|
+
value?: {
|
|
127
|
+
/**
|
|
128
|
+
* Disables all event tracking when `true`.
|
|
129
|
+
*/
|
|
130
|
+
disableTracking?: boolean | undefined;
|
|
131
|
+
/**
|
|
132
|
+
* Disables automatic page-view tracking when `true`.
|
|
133
|
+
*/
|
|
134
|
+
disableAutotracking?: boolean | undefined;
|
|
135
|
+
/**
|
|
136
|
+
* Additional services to register alongside built-in services.
|
|
137
|
+
*/
|
|
138
|
+
services?: readonly ClientApi.OptimizelyOneService[] | undefined;
|
|
139
|
+
/**
|
|
140
|
+
* Enables debug logging for service operations when `true`.
|
|
141
|
+
*/
|
|
142
|
+
debug?: boolean;
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* Optional allow-list for built-in product services.
|
|
146
|
+
*/
|
|
147
|
+
enabledOptimizelyServices?: Array<SupportedProductNames>;
|
|
38
148
|
}>;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
149
|
+
/**
|
|
150
|
+
* Provides Optimizely One context values to descendant components.
|
|
151
|
+
*
|
|
152
|
+
* It composes built-in product services with optional additional services,
|
|
153
|
+
* filters active capabilities, and exposes tracking and service access APIs.
|
|
154
|
+
*
|
|
155
|
+
* @param props Provider configuration and children.
|
|
156
|
+
* @returns The Optimizely One context provider element.
|
|
157
|
+
*/
|
|
158
|
+
export declare function OptimizelyOneProvider({ value: { disableTracking, disableAutotracking, services, debug }, children, enabledOptimizelyServices }: ProviderProps): import("react").JSX.Element;
|
|
159
|
+
export declare namespace OptimizelyOneProvider {
|
|
160
|
+
var displayName: string;
|
|
44
161
|
}
|
|
45
162
|
/**
|
|
46
|
-
*
|
|
47
|
-
*
|
|
163
|
+
* Retrieves the current Optimizely One context value.
|
|
164
|
+
*
|
|
165
|
+
* @returns The active `OptimizelyOneContextType` instance.
|
|
48
166
|
*/
|
|
49
|
-
|
|
167
|
+
export declare function useOptimizelyOne(): Readonly<{
|
|
168
|
+
/**
|
|
169
|
+
* With tracking completely disabled, all events will be stopped by
|
|
170
|
+
* the OptimizelyOne hook. The "PageActivator" component will propagate
|
|
171
|
+
* this instruction to all configured Optimizely One services
|
|
172
|
+
*/
|
|
173
|
+
disableTracking: Readonly<boolean>;
|
|
174
|
+
/**
|
|
175
|
+
* With auto-tracking disabled, the "PageActivator" component will not
|
|
176
|
+
* automatically track a generic pageview for all configured Optimizely
|
|
177
|
+
* One services.
|
|
178
|
+
*/
|
|
179
|
+
disableAutotracking: Readonly<boolean>;
|
|
180
|
+
/**
|
|
181
|
+
* The list of the active Optimizely One Services registered with the
|
|
182
|
+
* context. Inactive services are filtered out and will not be part of
|
|
183
|
+
* this collection.
|
|
184
|
+
*/
|
|
185
|
+
services: ReadonlyArray<ClientApi.OptimizelyOneService>;
|
|
50
186
|
/**
|
|
51
|
-
*
|
|
52
|
-
|
|
187
|
+
* Whether debug output is enabled for registered services.
|
|
188
|
+
*/
|
|
189
|
+
debug: Readonly<boolean>;
|
|
190
|
+
/**
|
|
191
|
+
* Updates debug mode for the context.
|
|
192
|
+
*/
|
|
193
|
+
setDebug: Dispatch<SetStateAction<boolean>>;
|
|
194
|
+
/**
|
|
195
|
+
* Adds a service to the context.
|
|
196
|
+
*
|
|
197
|
+
* This allows dynamic service registration after initialization, but requires
|
|
198
|
+
* the full service definition, including `isActive`.
|
|
53
199
|
*
|
|
54
|
-
* @param
|
|
55
|
-
|
|
200
|
+
* @param service The service instance to add.
|
|
201
|
+
*/
|
|
202
|
+
addService: (service: ClientApi.OptimizelyOneService) => void;
|
|
203
|
+
/**
|
|
204
|
+
* Removes a service from the context.
|
|
205
|
+
*
|
|
206
|
+
* The exact same service instance must be passed as was used during add.
|
|
207
|
+
* Built-in default services cannot be removed with this method.
|
|
208
|
+
*
|
|
209
|
+
* @param service The service instance to remove.
|
|
210
|
+
*/
|
|
211
|
+
removeService: (service: ClientApi.OptimizelyOneService) => void;
|
|
212
|
+
/**
|
|
213
|
+
* Tracks an event through the generic event API.
|
|
214
|
+
*
|
|
215
|
+
* All configured services that support event tracking receive this event.
|
|
216
|
+
*
|
|
217
|
+
* @param event The event payload to send.
|
|
56
218
|
*/
|
|
57
219
|
track: (event: ClientApi.OptimizelyOneEvent) => void;
|
|
58
220
|
/**
|
|
59
|
-
|
|
60
|
-
|
|
221
|
+
* Discovers profile data from active discovery-capable services.
|
|
222
|
+
*
|
|
223
|
+
* @param signal Optional abort signal used to cancel discovery requests.
|
|
224
|
+
* @returns A promise that resolves when profile discovery and merge are complete.
|
|
225
|
+
*/
|
|
226
|
+
discoverProfileData: (signal?: AbortSignal | null) => Promise<void>;
|
|
227
|
+
/**
|
|
228
|
+
* Merges the provided profile data into the current profile state.
|
|
229
|
+
*
|
|
230
|
+
* @param profileData Profile data patch to merge.
|
|
231
|
+
*/
|
|
232
|
+
updateProfile: (profileData: Partial<ClientApi.OptimizelyOneProfileData>) => void;
|
|
233
|
+
/**
|
|
234
|
+
* Retrieves active services that support the page activation step.
|
|
61
235
|
*
|
|
62
|
-
* @returns
|
|
236
|
+
* @returns A list of active services with `activatePage` capability.
|
|
63
237
|
*/
|
|
64
|
-
getActivatePageServices: () =>
|
|
65
|
-
activatePage: NonNullable<ClientApi.OptimizelyOneService['activatePage']>;
|
|
66
|
-
isActive: true;
|
|
67
|
-
})[];
|
|
238
|
+
getActivatePageServices: () => ClientApi.OptimizelyOneServiceWithCapability<unknown, string, "activatePage">[];
|
|
68
239
|
/**
|
|
69
|
-
*
|
|
70
|
-
* the execution cycle
|
|
240
|
+
* Retrieves active services that support page-view tracking.
|
|
71
241
|
*
|
|
72
|
-
* @returns
|
|
242
|
+
* @returns A list of active services with `trackPage` capability.
|
|
73
243
|
*/
|
|
74
|
-
getTrackPageServices: () =>
|
|
75
|
-
trackPage: NonNullable<ClientApi.OptimizelyOneService['trackPage']>;
|
|
76
|
-
isActive: true;
|
|
77
|
-
})[];
|
|
244
|
+
getTrackPageServices: () => ClientApi.OptimizelyOneServiceWithCapability<unknown, string, "trackPage">[];
|
|
78
245
|
/**
|
|
79
|
-
*
|
|
80
|
-
* been discovered
|
|
246
|
+
* Retrieves active services that support profile updates.
|
|
81
247
|
*
|
|
82
|
-
* @returns
|
|
248
|
+
* @returns A list of active services with `updateProfile` capability.
|
|
83
249
|
*/
|
|
84
|
-
getProfileServices: () =>
|
|
85
|
-
updateProfile: NonNullable<ClientApi.OptimizelyOneService['updateProfile']>;
|
|
86
|
-
isActive: true;
|
|
87
|
-
})[];
|
|
88
|
-
getProfileDataSources: () => (Omit<ClientApi.OptimizelyOneService, 'discoverProfileData' | 'isActive'> & {
|
|
89
|
-
discoverProfileData: NonNullable<ClientApi.OptimizelyOneService['discoverProfileData']>;
|
|
90
|
-
isActive: true;
|
|
91
|
-
})[];
|
|
250
|
+
getProfileServices: () => ClientApi.OptimizelyOneServiceWithCapability<unknown, string, "updateProfile">[];
|
|
92
251
|
/**
|
|
93
|
-
*
|
|
252
|
+
* Retrieves active services that can discover profile data.
|
|
94
253
|
*
|
|
95
|
-
* @
|
|
96
|
-
* @returns The service, or undefined if it's not part of the collection
|
|
254
|
+
* @returns A list of active services with `discoverProfileData` capability.
|
|
97
255
|
*/
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
256
|
+
getProfileDataSources: () => ClientApi.OptimizelyOneServiceWithCapability<unknown, string, "discoverProfileData">[];
|
|
257
|
+
/**
|
|
258
|
+
* Retrieves an individual active service by its code.
|
|
259
|
+
*
|
|
260
|
+
* @param code The service code.
|
|
261
|
+
* @returns The matching service, or `undefined` when not found.
|
|
262
|
+
*/
|
|
263
|
+
getService: <SC extends string>(code: SC) => SC extends keyof CoreServices ? CoreServices[SC] : (ClientApi.OptimizelyOneService<unknown, SC> | undefined);
|
|
264
|
+
}>;
|
|
265
|
+
export {};
|
|
@@ -1,79 +1,171 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { createContext, useContext,
|
|
3
|
+
import { createContext, useContext, useCallback, useMemo, useState, useEffect } from "react";
|
|
4
|
+
import { deepmerge as createDeepmerge } from "@fastify/deepmerge";
|
|
5
|
+
import { diff } from "deep-object-diff";
|
|
6
|
+
import { DefaultProfileData } from "../client-types";
|
|
7
|
+
import * as Filters from './service-filters';
|
|
8
|
+
// Default services to be always included in the context, but can be toggled on/off based on the enabledOptimizelyServices
|
|
4
9
|
import WebExperimenationService from '../products/web-experimentation/client';
|
|
5
10
|
import DataPlatformService from '../products/data-platform/client';
|
|
6
11
|
import ContentRecsService from '../products/content-recs/client';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
12
|
+
import { useLocalState } from "./use-local-state";
|
|
13
|
+
// Create a deepmerge instance for merging profile data from multiple sources
|
|
14
|
+
const deepmerge = createDeepmerge({
|
|
15
|
+
onlyDefinedProperties: true
|
|
16
|
+
});
|
|
17
|
+
const throwNoContextDefined = () => {
|
|
18
|
+
throw new Error("No context defined");
|
|
19
|
+
};
|
|
20
|
+
const DefaultOptimizelyOneContextValues = {
|
|
21
|
+
disableTracking: false,
|
|
22
|
+
disableAutotracking: false,
|
|
23
|
+
services: [],
|
|
24
|
+
debug: false,
|
|
25
|
+
setDebug: throwNoContextDefined,
|
|
26
|
+
addService: throwNoContextDefined,
|
|
27
|
+
removeService: throwNoContextDefined,
|
|
28
|
+
track: throwNoContextDefined,
|
|
29
|
+
getActivatePageServices: throwNoContextDefined,
|
|
30
|
+
getTrackPageServices: throwNoContextDefined,
|
|
31
|
+
getProfileServices: throwNoContextDefined,
|
|
32
|
+
getProfileDataSources: throwNoContextDefined,
|
|
33
|
+
getService: throwNoContextDefined,
|
|
34
|
+
discoverProfileData: throwNoContextDefined,
|
|
35
|
+
updateProfile: throwNoContextDefined
|
|
36
|
+
};
|
|
37
|
+
const OptimizelyOneContext = createContext(DefaultOptimizelyOneContextValues);
|
|
23
38
|
OptimizelyOneContext.displayName = "Optimizely One: Context";
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Provides Optimizely One context values to descendant components.
|
|
41
|
+
*
|
|
42
|
+
* It composes built-in product services with optional additional services,
|
|
43
|
+
* filters active capabilities, and exposes tracking and service access APIs.
|
|
44
|
+
*
|
|
45
|
+
* @param props Provider configuration and children.
|
|
46
|
+
* @returns The Optimizely One context provider element.
|
|
47
|
+
*/
|
|
48
|
+
export function OptimizelyOneProvider({ value: { disableTracking = false, disableAutotracking = false, services = [], debug = false } = {}, children, enabledOptimizelyServices }) {
|
|
49
|
+
// Local state to hold the current profile data, allowing it to be updated and
|
|
50
|
+
// accessed across the context
|
|
51
|
+
const [currentProfileData, setCurrentProfileData] = useLocalState('profileData', DefaultProfileData);
|
|
52
|
+
// Track the debug state in the context, to allow dynamic enabling/disabling
|
|
53
|
+
// of debug mode after initialization.
|
|
54
|
+
const [ctxDebug, setCtxDebug] = useState(debug);
|
|
55
|
+
// Track the additional services through state, to allow dynamic
|
|
56
|
+
// adding/removing of services after initialization.
|
|
57
|
+
const [additionalServices, setAdditionalServices] = useState(services);
|
|
58
|
+
// Memoize the active services to avoid unnecessary re-renders and
|
|
59
|
+
// computations in the context consumers.
|
|
60
|
+
const activeServices = useMemo(() => {
|
|
61
|
+
const defaultServices = [
|
|
62
|
+
new WebExperimenationService(enabledOptimizelyServices),
|
|
63
|
+
new DataPlatformService(enabledOptimizelyServices),
|
|
64
|
+
new ContentRecsService(enabledOptimizelyServices)
|
|
65
|
+
];
|
|
66
|
+
const allServices = [...defaultServices, ...additionalServices];
|
|
67
|
+
allServices.forEach(s => s.debug = ctxDebug);
|
|
68
|
+
return allServices.filter(s => s.isActive).sort((a, b) => a.order - b.order);
|
|
69
|
+
}, [additionalServices, enabledOptimizelyServices, ctxDebug]);
|
|
70
|
+
// Use memoized event tracking function to ensure stable reference for
|
|
71
|
+
// context consumers
|
|
72
|
+
const track = useCallback((event) => {
|
|
73
|
+
if (!disableTracking) {
|
|
74
|
+
if (ctxDebug) {
|
|
75
|
+
console.groupCollapsed(`📢 [Optimizely One] Tracking event: ${event.event}`);
|
|
76
|
+
console.log('Event data:', event);
|
|
77
|
+
}
|
|
78
|
+
activeServices.forEach(service => {
|
|
79
|
+
if (Filters.isActiveWithEventTracker(service)) {
|
|
80
|
+
service.trackEvent(event);
|
|
47
81
|
}
|
|
82
|
+
});
|
|
83
|
+
if (ctxDebug)
|
|
84
|
+
console.groupEnd();
|
|
85
|
+
}
|
|
86
|
+
else if (ctxDebug)
|
|
87
|
+
console.log('🔐 [Optimizely One] Tracking disabled, ignored event');
|
|
88
|
+
}, [activeServices, ctxDebug]);
|
|
89
|
+
// Use memoized profile discovery function to ensure stable reference for
|
|
90
|
+
// context consumers and to allow triggering profile refresh from multiple
|
|
91
|
+
// places (e.g. page activator effect and manual trigger) without causing
|
|
92
|
+
// unnecessary re-renders.
|
|
93
|
+
const discoverProfileData = useCallback(async (signal) => {
|
|
94
|
+
if (ctxDebug)
|
|
95
|
+
console.log('📢 [Optimizely One] Updating profile data from sources...');
|
|
96
|
+
const discoveryServices = activeServices.filter(Filters.isActiveWithProfileDiscovery);
|
|
97
|
+
const results = await Promise.allSettled(discoveryServices.map(service => service.discoverProfileData(signal ?? undefined)));
|
|
98
|
+
const mergedProfileData = results.reduce((merged, current) => current.status === 'fulfilled'
|
|
99
|
+
? deepmerge(merged, current.value)
|
|
100
|
+
: merged, currentProfileData);
|
|
101
|
+
const profileDataDiff = diff(currentProfileData, mergedProfileData);
|
|
102
|
+
if (Object.keys(profileDataDiff).length > 0) {
|
|
103
|
+
if (ctxDebug)
|
|
104
|
+
console.log(' - Profile data changes detected:', profileDataDiff);
|
|
105
|
+
setCurrentProfileData(mergedProfileData);
|
|
106
|
+
}
|
|
107
|
+
else if (ctxDebug) {
|
|
108
|
+
console.log(' - No changes in profile data detected.');
|
|
109
|
+
}
|
|
110
|
+
}, [currentProfileData, activeServices, ctxDebug]);
|
|
111
|
+
// Callback to update profile data, which can be passed to services that support
|
|
112
|
+
// profile updates. This allows those services to trigger profile data changes
|
|
113
|
+
// that are then propagated to all other services and context consumers.
|
|
114
|
+
const updateProfile = useCallback((profileData) => {
|
|
115
|
+
if (ctxDebug)
|
|
116
|
+
console.log('📢 [Optimizely One] Updating profile data with:', profileData);
|
|
117
|
+
const mergedProfileData = deepmerge(currentProfileData, profileData);
|
|
118
|
+
const profileDataDiff = diff(currentProfileData, mergedProfileData);
|
|
119
|
+
if (Object.keys(profileDataDiff).length > 0) {
|
|
120
|
+
if (ctxDebug)
|
|
121
|
+
console.log(' - Profile data changes detected:', profileDataDiff);
|
|
122
|
+
setCurrentProfileData(mergedProfileData);
|
|
123
|
+
}
|
|
124
|
+
else if (ctxDebug) {
|
|
125
|
+
console.log(' - No changes in profile data detected.');
|
|
126
|
+
}
|
|
127
|
+
}, [currentProfileData, ctxDebug]);
|
|
128
|
+
// Effect to update profile data across all services whenever it changes
|
|
129
|
+
useEffect(() => {
|
|
130
|
+
if (ctxDebug)
|
|
131
|
+
console.log('📢 [Optimizely One] Profile data updated:', currentProfileData);
|
|
132
|
+
activeServices.forEach(service => {
|
|
133
|
+
if (Filters.isActiveWithUpdateProfile(service)) {
|
|
134
|
+
service.updateProfile(currentProfileData);
|
|
48
135
|
}
|
|
136
|
+
});
|
|
137
|
+
}, [currentProfileData, activeServices, ctxDebug]);
|
|
138
|
+
// Memoize the entire context value to avoid unnecessary re-renders in context consumers
|
|
139
|
+
// when any of the context values change. This ensures that consumers only re-render
|
|
140
|
+
// when the specific context values they use actually change.
|
|
141
|
+
const contextValue = useMemo(() => {
|
|
142
|
+
return {
|
|
143
|
+
disableTracking,
|
|
144
|
+
disableAutotracking,
|
|
145
|
+
services: activeServices,
|
|
146
|
+
debug: ctxDebug,
|
|
147
|
+
setDebug: setCtxDebug,
|
|
148
|
+
addService: (service) => setAdditionalServices(prev => [...prev, service]),
|
|
149
|
+
removeService: (service) => setAdditionalServices(prev => prev.filter(s => s !== service)),
|
|
150
|
+
track,
|
|
151
|
+
getActivatePageServices: () => activeServices.filter(Filters.isActiveWithActivatePage),
|
|
152
|
+
getTrackPageServices: () => activeServices.filter(Filters.isActiveWithTrackPage),
|
|
153
|
+
getProfileServices: () => activeServices.filter(Filters.isActiveWithUpdateProfile),
|
|
154
|
+
getProfileDataSources: () => activeServices.filter(Filters.isActiveWithProfileDiscovery),
|
|
155
|
+
getService: (code) => activeServices.find(s => s.code === code),
|
|
156
|
+
discoverProfileData,
|
|
157
|
+
updateProfile
|
|
49
158
|
};
|
|
50
|
-
}, [
|
|
51
|
-
return
|
|
159
|
+
}, [disableTracking, disableAutotracking, activeServices, ctxDebug, track, discoverProfileData, updateProfile]);
|
|
160
|
+
return _jsx(OptimizelyOneContext.Provider, { value: contextValue, children: children });
|
|
52
161
|
}
|
|
53
|
-
const OptimizelyOneProvider = ({ value, children }) => {
|
|
54
|
-
const [ctxDebug, setCtxDebug] = useState(value?.debug ?? false);
|
|
55
|
-
const [services, setServices] = useState([
|
|
56
|
-
new WebExperimenationService(),
|
|
57
|
-
new DataPlatformService(),
|
|
58
|
-
new ContentRecsService(),
|
|
59
|
-
...(value?.services || [])
|
|
60
|
-
].sort((a, b) => a.order - b.order));
|
|
61
|
-
services.forEach(service => service.debug = ctxDebug);
|
|
62
|
-
return _jsx(OptimizelyOneContext.Provider, { value: {
|
|
63
|
-
disableAutotracking: value?.disableAutotracking,
|
|
64
|
-
disableTracking: value?.disableTracking,
|
|
65
|
-
services,
|
|
66
|
-
debug: ctxDebug,
|
|
67
|
-
setDebug: debugEnabled => { services.forEach(service => service.debug = debugEnabled); setCtxDebug(debugEnabled); },
|
|
68
|
-
addService: service => setServices(list => list.concat([service]).sort((a, b) => a.order - b.order)),
|
|
69
|
-
removeService: service => {
|
|
70
|
-
const idx = services.indexOf(service);
|
|
71
|
-
if (idx == -1)
|
|
72
|
-
return;
|
|
73
|
-
setServices(list => list.slice(0, idx).concat(list.slice(idx + 1)));
|
|
74
|
-
},
|
|
75
|
-
}, children: children });
|
|
76
|
-
};
|
|
77
162
|
OptimizelyOneProvider.displayName = "Optimizely One: State & Context provider";
|
|
78
|
-
|
|
163
|
+
/**
|
|
164
|
+
* Retrieves the current Optimizely One context value.
|
|
165
|
+
*
|
|
166
|
+
* @returns The active `OptimizelyOneContextType` instance.
|
|
167
|
+
*/
|
|
168
|
+
export function useOptimizelyOne() {
|
|
169
|
+
return useContext(OptimizelyOneContext);
|
|
170
|
+
}
|
|
79
171
|
//# sourceMappingURL=context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/components/context.tsx"],"names":[],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CAAC,CAAC,KAAK,OAAO,CAAC,CAAC;YAC1H,KAAK;YACL,uBAAuB,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC,OAAO,CAAC,wBAAwB,CAAC;YACtF,oBAAoB,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC,OAAO,CAAC,qBAAqB,CAAC;YAChF,kBAAkB,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC,OAAO,CAAC,yBAAyB,CAAC;YAClF,qBAAqB,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC,OAAO,CAAC,4BAA4B,CAAC;YACxF,UAAU,EAAE,CAAoB,IAAQ,EAAE,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAiH;YACtM,mBAAmB;YACnB,aAAa;SACd,CAAA;IACH,CAAC,EAAE,CAAE,eAAe,EAAE,mBAAmB,EAAE,cAAc,EAAE,QAAQ,EAAE,KAAK,EAAE,mBAAmB,EAAE,aAAa,CAAE,CAAC,CAAA;IAEjH,OAAO,KAAC,oBAAoB,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,YAAI,QAAQ,GAAkC,CAAA;AACzG,CAAC;AACD,qBAAqB,CAAC,WAAW,GAAG,0CAA0C,CAAA;AAE9E;;;;GAIG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO,UAAU,CAAC,oBAAoB,CAAC,CAAA;AACzC,CAAC"}
|
|
@@ -2,3 +2,4 @@ export { OptimizelyOneGadget } from './optimizely-one-gadget/gadget';
|
|
|
2
2
|
export { OptimizelyOneProvider, useOptimizelyOne } from './context';
|
|
3
3
|
export { PageActivator } from './page-activator';
|
|
4
4
|
export { useIsInTestMode } from './use-test-mode';
|
|
5
|
+
export type { SupportedProductNames } from './types';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_notice.js","sourceRoot":"","sources":["../../../src/components/optimizely-one-gadget/_notice.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"_notice.js","sourceRoot":"","sources":["../../../src/components/optimizely-one-gadget/_notice.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAOZ,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAEzD,MAAM,CAAC,MAAM,MAAM,GAMf,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,GAAG,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE;IACvD,MAAM,eAAe,GAAG,MAAM,IAAI,CAChC,eAAM,SAAS,EAAC,cAAc,YAAE,MAAM,GAAQ,CAC/C,CAAA;IACD,MAAM,OAAO,GAAG,SAAS,IAAI,CAC3B,KAAC,aAAa,IAAC,SAAS,EAAC,uDAAuD,GAAG,CACpF,CAAA;IACD,OAAO,CACL,aAAG,SAAS,EAAC,8HAA8H,aACxI,OAAO,EACP,eAAe,EACf,OAAO,EACP,QAAQ,IACP,CACL,CAAA;AACH,CAAC,CAAA;AAED,eAAe,MAAM,CAAA"}
|