@remkoj/optimizely-one-nextjs 5.1.0 → 6.0.0-pre1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/content-goals.js +1 -1
- package/dist/api/content-goals.js.map +1 -1
- package/dist/api/content-recs.js +1 -1
- package/dist/api/content-recs.js.map +1 -1
- package/dist/api/index.d.ts +1 -1
- package/dist/api/index.js +3 -2
- package/dist/api/index.js.map +1 -1
- package/dist/api/profile-api-service.js +6 -5
- package/dist/api/profile-api-service.js.map +1 -1
- package/dist/components/optimizely-one-gadget/_notice.d.ts +1 -1
- package/dist/components/optimizely-one-gadget/_notice.js +3 -3
- package/dist/components/optimizely-one-gadget/_notice.js.map +1 -1
- package/dist/components/optimizely-one-gadget/audiences-panel.js +12 -10
- package/dist/components/optimizely-one-gadget/audiences-panel.js.map +1 -1
- package/dist/components/optimizely-one-gadget/exp-panel.js +15 -7
- package/dist/components/optimizely-one-gadget/exp-panel.js.map +1 -1
- package/dist/components/optimizely-one-gadget/gadget.js +33 -25
- package/dist/components/optimizely-one-gadget/gadget.js.map +1 -1
- package/dist/components/optimizely-one-gadget/goals-panel.js +6 -6
- package/dist/components/optimizely-one-gadget/goals-panel.js.map +1 -1
- package/dist/components/optimizely-one-gadget/graph-panel.js +12 -8
- package/dist/components/optimizely-one-gadget/graph-panel.js.map +1 -1
- package/dist/components/optimizely-one-gadget/ids-panel.js +7 -7
- package/dist/components/optimizely-one-gadget/ids-panel.js.map +1 -1
- package/dist/components/optimizely-one-gadget/index.d.ts +1 -1
- package/dist/components/optimizely-one-gadget/index.js +3 -3
- package/dist/components/optimizely-one-gadget/index.js.map +1 -1
- package/dist/components/optimizely-one-gadget/interests-panel.js +7 -7
- package/dist/components/optimizely-one-gadget/interests-panel.js.map +1 -1
- package/dist/components/optimizely-one-gadget/profile-panel.js +8 -6
- package/dist/components/optimizely-one-gadget/profile-panel.js.map +1 -1
- package/dist/products/content-recs/helpers.d.ts +1 -1
- package/dist/products/content-recs/helpers.js.map +1 -1
- package/dist/products/data-platform/helpers.d.ts +1 -1
- package/dist/products/data-platform/helpers.js.map +1 -1
- package/dist/products/web-experimentation/helpers.d.ts +1 -1
- package/dist/products/web-experimentation/helpers.js.map +1 -1
- package/dist/styles.css +2 -1
- package/dist/utils/session.d.ts +1 -1
- package/dist/utils/session.js.map +1 -1
- package/package.json +23 -23
|
@@ -10,7 +10,7 @@ export const ContentRecsGoalsService = {
|
|
|
10
10
|
const products = checkProductStatus(config);
|
|
11
11
|
if (!products.contentRecsApi)
|
|
12
12
|
return Responses.NotFound;
|
|
13
|
-
const crId = ContentRecs.Tools.getVisitorID(cookies);
|
|
13
|
+
const crId = ContentRecs.Tools.getVisitorID(await cookies);
|
|
14
14
|
if (!crId)
|
|
15
15
|
return [{ goals: [] }, 200];
|
|
16
16
|
const contentRecs = new ContentRecs.Client();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-goals.js","sourceRoot":"","sources":["../../src/api/content-goals.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,SAAS,EAAE,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;AACzD,OAAO,KAAK,SAAS,MAAM,aAAa,CAAA;AAgBxC,MAAM,CAAC,MAAM,uBAAuB,GAA6B;
|
|
1
|
+
{"version":3,"file":"content-goals.js","sourceRoot":"","sources":["../../src/api/content-goals.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,SAAS,EAAE,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;AACzD,OAAO,KAAK,SAAS,MAAM,aAAa,CAAA;AAgBxC,MAAM,CAAC,MAAM,uBAAuB,GAA6B;IAC/D,GAAG,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE;IACrC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;QAChC,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;QAC1B,IAAI,CAAC,MAAM,CAAC,aAAa;YAAE,OAAO,SAAS,CAAC,QAAQ,CAAA;QAEpD,MAAM,QAAQ,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAA;QAC3C,IAAI,CAAC,QAAQ,CAAC,cAAc;YAAE,OAAO,SAAS,CAAC,QAAQ,CAAA;QAEvD,MAAM,IAAI,GAAG,WAAW,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,OAAO,CAAC,CAAA;QAC1D,IAAI,CAAC,IAAI;YACP,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,CAAA;QAC7B,MAAM,WAAW,GAAG,IAAI,WAAW,CAAC,MAAM,EAAE,CAAC;QAC7C,MAAM,aAAa,GAAG,MAAM,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAA;QAC9E,OAAO,CAAC,EAAE,KAAK,EAAE,aAAa,EAAE,EAAE,GAAG,CAAC,CAAA;IACxC,CAAC;CACF,CAAA;AAED,eAAe,uBAAuB,CAAA"}
|
package/dist/api/content-recs.js
CHANGED
|
@@ -7,7 +7,7 @@ export const ContentRecsApiService = {
|
|
|
7
7
|
const optiOneConfig = readConfigFromEnv();
|
|
8
8
|
if (!optiOneConfig.ContentRecsHost)
|
|
9
9
|
return Responses.NotFound;
|
|
10
|
-
const crId = ContentRecs.Tools.getVisitorID(cookies);
|
|
10
|
+
const crId = ContentRecs.Tools.getVisitorID(await cookies);
|
|
11
11
|
if (!crId)
|
|
12
12
|
return [{ total_hits: 0, content: [] }, 200];
|
|
13
13
|
const recsService = new URL(`https://api.${optiOneConfig.ContentRecsHost}/1.0/users/idio_visitor_id:${crId}/content?callback=fn`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-recs.js","sourceRoot":"","sources":["../../src/api/content-recs.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAC7C,OAAO,KAAK,SAAS,MAAM,aAAa,CAAA;AAExC,MAAM,CAAC,MAAM,qBAAqB,GAAoB;IACpD,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE;IACpC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;QAChC,MAAM,aAAa,GAAG,iBAAiB,EAAE,CAAC;QAC1C,IAAI,CAAC,aAAa,CAAC,eAAe;YAChC,OAAO,SAAS,CAAC,QAAQ,CAAA;QAE3B,MAAM,IAAI,GAAG,WAAW,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"content-recs.js","sourceRoot":"","sources":["../../src/api/content-recs.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAC7C,OAAO,KAAK,SAAS,MAAM,aAAa,CAAA;AAExC,MAAM,CAAC,MAAM,qBAAqB,GAAoB;IACpD,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE;IACpC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;QAChC,MAAM,aAAa,GAAG,iBAAiB,EAAE,CAAC;QAC1C,IAAI,CAAC,aAAa,CAAC,eAAe;YAChC,OAAO,SAAS,CAAC,QAAQ,CAAA;QAE3B,MAAM,IAAI,GAAG,WAAW,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,OAAO,CAAC,CAAA;QAC1D,IAAI,CAAC,IAAI;YACP,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,OAAO,E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AG,CAAC,CAAA;QACnG,CAAC;IACH,CAAC;CACF,CAAA;AAED,eAAe,qBAAqB,CAAA"}
|
package/dist/api/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import 'server-only';
|
|
|
2
2
|
import { type NextRequest, NextResponse } from 'next/server';
|
|
3
3
|
import type { ApiService } from './types';
|
|
4
4
|
type RequestContext = {
|
|
5
|
-
params: Record<string, string | string[]
|
|
5
|
+
params: Promise<Record<string, string | string[]>>;
|
|
6
6
|
};
|
|
7
7
|
type OptimizelyOneApi = (req: NextRequest, ctx: RequestContext) => Promise<NextResponse>;
|
|
8
8
|
export type OptimizelyOneApiConfig = {
|
package/dist/api/index.js
CHANGED
|
@@ -21,9 +21,10 @@ export function createOptimizelyOneApi(config) {
|
|
|
21
21
|
return serviceFor.path.toLowerCase() == path.toLowerCase() &&
|
|
22
22
|
serviceFor.verb.toLowerCase() == verb.toLowerCase();
|
|
23
23
|
}
|
|
24
|
-
async function handler(request,
|
|
24
|
+
async function handler(request, { params: asyncParams }) {
|
|
25
25
|
// Determine the current path & basePath for handling the request
|
|
26
|
-
|
|
26
|
+
const params = await asyncParams;
|
|
27
|
+
let apiPath = params[pathParameterName];
|
|
27
28
|
if (!apiPath)
|
|
28
29
|
apiPath = '/';
|
|
29
30
|
else if (Array.isArray(apiPath))
|
package/dist/api/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AACpB,OAAO,EAAoB,YAAY,EAAE,MAAM,aAAa,CAAA;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,OAAO,iBAAiB,MAAM,uBAAuB,CAAA;AACrD,OAAO,mBAAmB,MAAM,sBAAsB,CAAA;AACtD,OAAO,yBAAyB,MAAM,uBAAuB,CAAA;AAC7D,OAAO,qBAAqB,MAAM,gBAAgB,CAAA;AAClD,OAAO,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AE,CAAC,CAAA;IACrE,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC"}
|
|
@@ -19,10 +19,11 @@ export const ProfileApiService = {
|
|
|
19
19
|
const fetchODPAudiences = !scopes || scopes.includes('audiences');
|
|
20
20
|
const fetchProfileCard = !scopes || scopes.includes('profile');
|
|
21
21
|
// Read all IDs
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const
|
|
22
|
+
const cookieData = await cookies;
|
|
23
|
+
const odpId = DataPlatform.Tools.getVisitorID(cookieData);
|
|
24
|
+
const crId = ContentRecs.Tools.getVisitorID(cookieData);
|
|
25
|
+
const webExId = WebExperimentation.Tools.getVisitorID(cookieData);
|
|
26
|
+
const frontendId = Session.getVisitorId(cookieData);
|
|
26
27
|
// Read parameters & set values
|
|
27
28
|
const pageSize = config.OdpAudienceBatchSize;
|
|
28
29
|
const pageNumber = Math.max(stringToInt(query.get('page'), 0), 0);
|
|
@@ -44,7 +45,7 @@ export const ProfileApiService = {
|
|
|
44
45
|
audiencesPageCount = chunks.length;
|
|
45
46
|
// Apply filtering to the audiences
|
|
46
47
|
const userAudienceIds = /*chunkNr == 0 ?
|
|
47
|
-
|
|
48
|
+
(await Promise.all(chunks.map(chunk => odp.filterAudiences(odpId, chunk)))).flat() :*/ await odp.filterAudiences(odpId, chunks[pageNumber]);
|
|
48
49
|
audiences = allAudiences.filter(a => userAudienceIds.includes(a.id));
|
|
49
50
|
}
|
|
50
51
|
// Fetch the profile if needed
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile-api-service.js","sourceRoot":"","sources":["../../src/api/profile-api-service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,SAAS,MAAM,aAAa,CAAA;AACxC,OAAO,OAAO,MAAM,kBAAkB,CAAA;AACtC,OAAO,SAAS,EAAE,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;AAEzD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,kBAAkB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;gBAClB,cAAc;aACf;YACD,OAAO,EAAE,OAAO,IAAI,IAAI;YACxB,aAAa,EAAE,MAAM;YACrB,QAAQ,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI;SACpC,CAAA;QACD,OAAO,CAAC,YAAY,EAAE,GAAG,CAAC,CAAA;IAC5B,CAAC;CACF,CAAA;AAID,eAAe,iBAAiB,CAAA;AAqBhC,SAAS,WAAW,CAAC,KAAgC,EAAE,YAAoB;IACzE,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,IAAI,YAAY,CAAC,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAA;QACpE,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAA;IAC9C,CAAC;IAAC,MAAM,CAAC,CAAC,CAAC;IACX,OAAO,YAAY,CAAA;AACrB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ReactNode, type FunctionComponent, type PropsWithChildren } from
|
|
1
|
+
import { type ReactNode, type FunctionComponent, type PropsWithChildren } from 'react';
|
|
2
2
|
export declare const Notice: FunctionComponent<PropsWithChildren<{
|
|
3
3
|
prefix?: string;
|
|
4
4
|
message?: string | ReactNode;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { ArrowPathIcon } from '@heroicons/react/20/solid';
|
|
3
3
|
export const Notice = ({ prefix, message, isLoading = false, children }) => {
|
|
4
|
-
const PrefixComponent = prefix && _jsx("span", { className:
|
|
5
|
-
const Spinner = isLoading && _jsx(ArrowPathIcon, { className:
|
|
6
|
-
return _jsxs("p", { className:
|
|
4
|
+
const PrefixComponent = prefix && (_jsx("span", { className: "oo:font-bold", children: prefix }));
|
|
5
|
+
const Spinner = isLoading && (_jsx(ArrowPathIcon, { className: "oo:inline-block oo:h-4 oo:w-4 oo:ml-2 oo:animate-spin" }));
|
|
6
|
+
return (_jsxs("p", { className: "oo:text-[12px] oo:m-2 oo:mt-3 oo:p-1 oo:md:p-2 oo:rounded-md oo:bg-amber-200 oo:border oo:border-amber-800 oo:text-amber-800", children: [Spinner, PrefixComponent, message, children] }));
|
|
7
7
|
};
|
|
8
8
|
export default Notice;
|
|
9
9
|
//# sourceMappingURL=_notice.js.map
|
|
@@ -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":";AAKA,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"}
|
|
@@ -12,7 +12,7 @@ const buildGetKey = (servicePrefix, pageSize) => {
|
|
|
12
12
|
};
|
|
13
13
|
return getKey;
|
|
14
14
|
};
|
|
15
|
-
export const AudiencesPanel = ({ servicePrefix = '/api/me', refreshInterval = 0 }) => {
|
|
15
|
+
export const AudiencesPanel = ({ servicePrefix = '/api/me', refreshInterval = 0, }) => {
|
|
16
16
|
// Prepare data fetching
|
|
17
17
|
const pageSize = 50;
|
|
18
18
|
const getKey = buildGetKey(servicePrefix, pageSize);
|
|
@@ -23,7 +23,7 @@ export const AudiencesPanel = ({ servicePrefix = '/api/me', refreshInterval = 0
|
|
|
23
23
|
revalidateIfStale: true,
|
|
24
24
|
refreshInterval: refreshInterval > 0 ? Math.max(refreshInterval, 10000) : 0, //Minimum refresh interval for audiences is 10 seconds
|
|
25
25
|
fetcher: async (key) => {
|
|
26
|
-
return fetch(key).then(r => {
|
|
26
|
+
return fetch(key).then((r) => {
|
|
27
27
|
if (!r.ok)
|
|
28
28
|
throw new Error(`${r.status}: ${r.statusText}`);
|
|
29
29
|
return r.json();
|
|
@@ -31,24 +31,26 @@ export const AudiencesPanel = ({ servicePrefix = '/api/me', refreshInterval = 0
|
|
|
31
31
|
},
|
|
32
32
|
};
|
|
33
33
|
// Fetch results
|
|
34
|
-
const { data: profiles, isLoading, isValidating, error, size, setSize } = useSWRInfinite(getKey, config);
|
|
34
|
+
const { data: profiles, isLoading, isValidating, error, size, setSize, } = useSWRInfinite(getKey, config);
|
|
35
35
|
// Post-process the received values
|
|
36
|
-
const audiencePages = !profiles ? 1 :
|
|
37
|
-
const audienceCount = !profiles ? 0 :
|
|
36
|
+
const audiencePages = !profiles ? 1 : profiles[0]?.rts.audiencesPageCount || 1;
|
|
37
|
+
const audienceCount = !profiles ? 0 : profiles[0]?.rts.audiencesCount || 0;
|
|
38
38
|
const hasMore = size < audiencePages;
|
|
39
39
|
// Automatically correct to the correct size, based upon the response
|
|
40
40
|
useEffect(() => {
|
|
41
|
-
let newSize = !profiles ? -1 :
|
|
41
|
+
let newSize = !profiles ? -1 : profiles[0]?.rts.audiencesPageCount || -1;
|
|
42
42
|
if (newSize >= 1 && size != newSize)
|
|
43
43
|
setSize(newSize);
|
|
44
44
|
}, [size, profiles]);
|
|
45
45
|
// Handle error
|
|
46
46
|
if (error)
|
|
47
|
-
return _jsx(Notice, { message:
|
|
47
|
+
return (_jsx(Notice, { message: "There was an error loading your profile information" }));
|
|
48
48
|
// Show list
|
|
49
|
-
return _jsxs(_Fragment, { children: [hasMore && _jsx(Notice, { prefix:
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
return (_jsxs(_Fragment, { children: [hasMore && (_jsx(Notice, { prefix: "Please note:", message: _jsxs(_Fragment, { children: ["Showing results for the first ", size * pageSize, " audiences of", ' ', audienceCount, ",", ' ', _jsx("span", { onClick: () => setSize(size + 1), className: "oo:cursor-pointer oo:underline oo:text-blue-800", children: "load more" })] }) })), _jsx("ul", { className: "oo:grid oo:grid-cols-1 oo:divide-y oo:divide-slate-200", children: (profiles || [])
|
|
50
|
+
.map((profile) => (profile?.rts.audiences ?? []).map((a) => {
|
|
51
|
+
return (_jsxs("li", { className: "oo:py-1", children: [_jsx(UserGroupIcon, { className: "oo:inline-block oo:h-4 oo:w-4 oo:mr-2" }), a.name] }, 'audience-' + a.id));
|
|
52
|
+
}))
|
|
53
|
+
.flat() }), _jsx("p", { className: "oo:text-[12px]", children: "Powered by: Optimizely Data Platform" }), hasMore && (_jsx("p", { onClick: () => setSize(size + 1), className: "oo:text-center oo:inline-block oo:cursor-pointer oo:px-2 oo:py-1 oo:border oo:border-b-0 oo:border-slate-300 oo:rounded-md oo:bg-blue-500 oo:text-white", children: "Load more" })), isLoading && _jsx(Notice, { isLoading: true, message: "Loading the audiences..." }), isValidating && !isLoading && (_jsx(Notice, { isLoading: true, message: "Refreshing audiences" })), _jsx(Notice, { prefix: "Please note:", message: "Interest based audiences are updated once per hour" })] }));
|
|
52
54
|
};
|
|
53
55
|
export default AudiencesPanel;
|
|
54
56
|
//# sourceMappingURL=audiences-panel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audiences-panel.js","sourceRoot":"","sources":["../../../src/components/optimizely-one-gadget/audiences-panel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAA0B,MAAM,OAAO,CAAA;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AACzD,OAAO,
|
|
1
|
+
{"version":3,"file":"audiences-panel.js","sourceRoot":"","sources":["../../../src/components/optimizely-one-gadget/audiences-panel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAA0B,MAAM,OAAO,CAAA;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AACzD,OAAO,cAGN,MAAM,cAAc,CAAA;AAErB,OAAO,MAAM,MAAM,WAAW,CAAA;AAO9B,MAAM,WAAW,GAGuB,CAAC,aAAa,EAAE,QAAQ,EAAE,EAAE;IAClE,MAAM,UAAU,GAAG,GAAG,aAAa,0BAA0B,QAAQ,EAAE,CAAA;IACvE,MAAM,MAAM,GAAqC,CAC/C,SAAS,EACT,gBAAgB,EAChB,EAAE;QACF,IAAI,gBAAgB,IAAI,gBAAgB,CAAC,GAAG,CAAC,kBAAkB,GAAG,SAAS;YACzE,OAAO,IAAI,CAAA;QACb,OAAO,GAAG,UAAU,SAAS,SAAS,EAAE,CAAA;IAC1C,CAAC,CAAA;IACD,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,cAAc,GAA2C,CAAC,EACrE,aAAa,GAAG,SAAS,EACzB,eAAe,GAAG,CAAC,GACpB,EAAE,EAAE;IACH,wBAAwB;IACxB,MAAM,QAAQ,GAAG,EAAE,CAAA;IACnB,MAAM,MAAM,GAAG,WAAW,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAA;IACnD,MAAM,MAAM,GAAyC;QACnD,WAAW,EAAE,CAAC;QACd,aAAa,EAAE,IAAI;QACnB,iBAAiB,EAAE,IAAI;QACvB,iBAAiB,EAAE,IAAI;QACvB,eAAe,EAAE,eAAe,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,sDAAsD;QACnI,OAAO,EAAE,KAAK,EAAE,GAAG,EA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A;AACH,CAAC,CAAA;AAED,eAAe,cAAc,CAAA"}
|
|
@@ -11,12 +11,20 @@ export const ExpPanel = () => {
|
|
|
11
11
|
const [campaignStates, setCampaignStates] = useState({});
|
|
12
12
|
useEffect(() => {
|
|
13
13
|
setPagesObject(webEx?.get ? webEx?.get('state').getPageStates({ isActive: true }) : {});
|
|
14
|
-
setExperimentStates(webEx?.get
|
|
15
|
-
|
|
14
|
+
setExperimentStates(webEx?.get
|
|
15
|
+
? webEx?.get('state').getExperimentStates({ isActive: true })
|
|
16
|
+
: {});
|
|
17
|
+
setCampaignStates(webEx?.get
|
|
18
|
+
? webEx?.get('state').getCampaignStates({ isActive: true })
|
|
19
|
+
: {});
|
|
16
20
|
const intervalId = setInterval(() => {
|
|
17
21
|
setPagesObject(webEx?.get ? webEx?.get('state').getPageStates({ isActive: true }) : {});
|
|
18
|
-
setExperimentStates(webEx?.get
|
|
19
|
-
|
|
22
|
+
setExperimentStates(webEx?.get
|
|
23
|
+
? webEx?.get('state').getExperimentStates({ isActive: true })
|
|
24
|
+
: {});
|
|
25
|
+
setCampaignStates(webEx?.get
|
|
26
|
+
? webEx?.get('state').getCampaignStates({ isActive: true })
|
|
27
|
+
: {});
|
|
20
28
|
}, 2000);
|
|
21
29
|
return () => clearInterval(intervalId);
|
|
22
30
|
}, [webEx]);
|
|
@@ -32,11 +40,11 @@ export const ExpPanel = () => {
|
|
|
32
40
|
const campaignsArray = [];
|
|
33
41
|
for (const campaignId of Object.getOwnPropertyNames(campaignStates))
|
|
34
42
|
campaignsArray.push(campaignStates[campaignId]);
|
|
35
|
-
const filteredCampaigns = campaignsArray.filter(c => {
|
|
36
|
-
const expIds = experimentsArray.map(ed => ed.id);
|
|
43
|
+
const filteredCampaigns = campaignsArray.filter((c) => {
|
|
44
|
+
const expIds = experimentsArray.map((ed) => ed.id);
|
|
37
45
|
return !expIds.includes(c.experiment.id);
|
|
38
46
|
});
|
|
39
|
-
return _jsxs(_Fragment, { children: [_jsxs("dl", { className:
|
|
47
|
+
return (_jsxs(_Fragment, { children: [_jsxs("dl", { className: "oo:text-[14px]", children: [_jsx("dt", { className: "oo:font-bold oo:pt-1", children: "Script information:" }), _jsxs("dd", { children: ["Account id: ", data?.accountId, "; Project id:", ' ', _jsx(Link, { href: `https://app.optimizely.com/v2/projects/${data?.projectId ?? ''}`, target: "_blank", className: "oo:underline oo:text-blue-800", children: data?.projectId }), "; Revision: ", data?.revision] }), _jsx("dt", { className: "oo:font-bold oo:pt-1", children: "Active page(s):" }), _jsx("dd", { children: _jsx("ul", { children: pagesArray.map((p) => (_jsx("li", { children: _jsx(Link, { href: `https://app.optimizely.com/v2/projects/${data?.projectId ?? ''}/implementation/pages/${p.id}`, target: "_blank", className: "oo:underline oo:text-blue-800", children: p.name || p.apiName }) }, `exp-page-${data?.projectId}-${p.id}`))) }) }), _jsx("dt", { className: "oo:font-bold oo:pt-1", children: "Active experiment(s):" }), _jsx("dd", { children: _jsx("ul", { children: experimentsArray.map((e) => (_jsxs("li", { children: [_jsx(Link, { href: `https://app.optimizely.com/v2/projects/${data?.projectId ?? ''}/experiments/${e.id}`, target: "_blank", className: "oo:underline oo:text-blue-800", children: e.experimentName || e.id }), ", variant:", ' ', _jsx(Link, { href: `https://app.optimizely.com/v2/projects/${data?.projectId ?? ''}/experiments/${e.id}/variations/${e.variation.id}`, target: "_blank", className: "oo:underline oo:text-blue-800", children: e.variation.name || e.variation.id })] }, `exp-${data?.projectId}-${e.id}`))) }) }), _jsx("dt", { className: "oo:font-bold oo:pt-1", children: "Active Personalization Campaigns(s):" }), _jsx("dd", { children: _jsx("ul", { children: filteredCampaigns.map((e) => (_jsxs("li", { children: [_jsx(Link, { href: `https://app.optimizely.com/v2/projects/${data?.projectId ?? ''}/campaigns/${e.id}`, target: "_blank", className: "oo:underline oo:text-blue-800", children: e.campaignName || e.id }), "; Audience(s):", ' ', e.audiences.map((a) => (_jsxs("span", { children: [_jsx(Link, { href: `https://app.optimizely.com/v2/projects/${data?.projectId ?? ''}/audiences/${a.id}`, target: "_blank", className: "oo:underline oo:text-blue-800", children: a.name }), ",", ' '] }, 'exp-pers-aud-' + a.id)))] }, `campaign-${data?.projectId}-${e.id}`))) }) })] }), _jsx("p", { className: "oo:text-[12px]", children: "Powered by: Optimizely Web Experimentation" })] }));
|
|
40
48
|
};
|
|
41
49
|
export default ExpPanel;
|
|
42
50
|
//# sourceMappingURL=exp-panel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exp-panel.js","sourceRoot":"","sources":["../../../src/components/optimizely-one-gadget/exp-panel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAA0B,MAAM,OAAO,CAAA;AACnE,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAG7C,MAAM,CAAC,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"exp-panel.js","sourceRoot":"","sources":["../../../src/components/optimizely-one-gadget/exp-panel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAA0B,MAAM,OAAO,CAAA;AACnE,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAG7C,MAAM,CAAC,MAAM,QAAQ,GAA0B,GAAG,EAAE;IAClD,MAAM,IAAI,GAAG,gBAAgB,EAAE,CAAA;IAC/B,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,aAAa,EAAE,CAAA;IACvD,MAAM,IAAI,GAAG,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;IACvD,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAE5C,EAAE,CAAC,CAAA;IACL,MAAM,CAAC,gBAAgB,EAAE,m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AI,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,EAAE,CAgBpC,CACN,CAAC,GACC,GACF,EACL,aAAI,SAAS,EAAC,sBAAsB,qDAE/B,EACL,uBACE,uBACG,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAC5B,yBACE,KAAC,IAAI,IACH,IAAI,EAAE,0CAA0C,IAAI,EAAE,SAAS,IAAI,EAAE,cAAc,CAAC,CAAC,EAAE,EAAE,EACzF,MAAM,EAAC,QAAQ,EACf,SAAS,EAAC,+BAA+B,YAExC,CAAC,CAAC,YAAY,IAAI,CAAC,CAAC,EAAE,GAClB,oBACQ,GAAG,EACjB,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CACtB,2BACE,KAAC,IAAI,IACH,IAAI,EAAE,0CAA0C,IAAI,EAAE,SAAS,IAAI,EAAE,cAAc,CAAC,CAAC,EAAE,EAAE,EACzF,MAAM,EAAC,QAAQ,EACf,SAAS,EAAC,+BAA+B,YAExC,CAAC,CAAC,IAAI,GACF,OACL,GAAG,KARI,eAAe,GAAG,CAAC,CAAC,EAAE,CAS1B,CACR,CAAC,KApBK,YAAY,IAAI,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,EAAE,CAqBzC,CACN,CAAC,GACC,GACF,IACF,EACL,YAAG,SAAS,EAAC,gBAAgB,2DAEzB,IACH,CACJ,CAAA;AACH,CAAC,CAAA;AAED,eAAe,QAAQ,CAAA"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { Fragment, useLayoutEffect, useCallback } from 'react';
|
|
3
|
+
import { Fragment, useLayoutEffect, useCallback, } from 'react';
|
|
4
4
|
import useCookie from '../use-cookie';
|
|
5
|
-
import { Popover, PopoverButton, PopoverPanel, Tab, TabGroup, TabList, TabPanels, TabPanel } from '@headlessui/react';
|
|
6
|
-
import { ChevronUpIcon, UserGroupIcon, TagIcon, RocketLaunchIcon, IdentificationIcon, Square3Stack3DIcon, TrophyIcon, FingerPrintIcon } from '@heroicons/react/20/solid';
|
|
5
|
+
import { Popover, PopoverButton, PopoverPanel, Tab, TabGroup, TabList, TabPanels, TabPanel, } from '@headlessui/react';
|
|
6
|
+
import { ChevronUpIcon, UserGroupIcon, TagIcon, RocketLaunchIcon, IdentificationIcon, Square3Stack3DIcon, TrophyIcon, FingerPrintIcon, } from '@heroicons/react/20/solid';
|
|
7
7
|
import OptiLogo from './logo';
|
|
8
8
|
import { useIsInTestMode } from '../use-test-mode';
|
|
9
9
|
import { useSearchParams, usePathname } from 'next/navigation';
|
|
@@ -14,45 +14,45 @@ import dynamic from 'next/dynamic';
|
|
|
14
14
|
const Panels = [
|
|
15
15
|
{
|
|
16
16
|
id: 'Profile',
|
|
17
|
-
Tab: () => _jsxs(Tab, { as: "div", className: "oo-
|
|
17
|
+
Tab: () => (_jsxs(Tab, { as: "div", className: "oo:text-center oo:inline-block oo:cursor-pointer oo:px-2 oo:py-1 oo:border oo:border-b-0 oo:border-slate-300 oo:rounded-t-md oo:data-selected:bg-blue-500 oo:data-selected:text-white", children: [_jsx(IdentificationIcon, { className: "oo:inline-block oo:h-[1.25em] oo:w-[1.25em] oo:mr-[0.25em]" }), "Profile"] })),
|
|
18
18
|
Panel: dynamic(() => import('./profile-panel'), { ssr: false }),
|
|
19
|
-
products: ['odp']
|
|
19
|
+
products: ['odp'],
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
id: 'Interests',
|
|
23
|
-
Tab: () => _jsxs(Tab, { as: "div", className:
|
|
23
|
+
Tab: () => (_jsxs(Tab, { as: "div", className: "oo:text-center oo:inline-block oo:cursor-pointer oo:px-2 oo:py-1 oo:border oo:border-b-0 oo:border-slate-300 oo:rounded-t-md oo:data-selected:bg-blue-500 oo:data-selected:text-white", children: [_jsx(TagIcon, { className: "oo:inline-block oo:h-[1.25em] oo:w-[1.25em] oo:mr-[0.25em]" }), "Interests"] })),
|
|
24
24
|
Panel: dynamic(() => import('./interests-panel'), { ssr: false }),
|
|
25
|
-
products: ['crecs']
|
|
25
|
+
products: ['crecs'],
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
28
|
id: 'Goals',
|
|
29
|
-
Tab: () => _jsxs(Tab, { as: "div", className:
|
|
29
|
+
Tab: () => (_jsxs(Tab, { as: "div", className: "oo:text-center oo:inline-block oo:cursor-pointer oo:px-2 oo:py-1 oo:border oo:border-b-0 oo:border-slate-300 oo:rounded-t-md oo:data-selected:bg-blue-500 oo:data-selected:text-white", children: [_jsx(TrophyIcon, { className: "oo:inline-block oo:h-[1.25em] oo:w-[1.25em] oo:mr-[0.25em]" }), "Goals"] })),
|
|
30
30
|
Panel: dynamic(() => import('./goals-panel'), { ssr: false }),
|
|
31
|
-
products: ['crecs']
|
|
31
|
+
products: ['crecs'],
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
id: 'Audiences',
|
|
35
|
-
Tab: () => _jsxs(Tab, { as: "div", className:
|
|
35
|
+
Tab: () => (_jsxs(Tab, { as: "div", className: "oo:text-center oo:inline-block oo:cursor-pointer oo:px-2 oo:py-1 oo:border oo:border-b-0 oo:border-slate-300 oo:rounded-t-md oo:data-selected:bg-blue-500 oo:data-selected:text-white", children: [_jsx(UserGroupIcon, { className: "oo:inline-block oo:h-[1.25em] oo:w-[1.25em] oo:mr-[0.25em]" }), "Audiences"] })),
|
|
36
36
|
Panel: dynamic(() => import('./audiences-panel'), { ssr: false }),
|
|
37
|
-
products: ['odp']
|
|
37
|
+
products: ['odp'],
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
40
|
id: 'Experiments',
|
|
41
|
-
Tab: () => _jsxs(Tab, { as: "div", className:
|
|
41
|
+
Tab: () => (_jsxs(Tab, { as: "div", className: "oo:text-center oo:inline-block oo:cursor-pointer oo:px-2 oo:py-1 oo:border oo:border-b-0 oo:border-slate-300 oo:rounded-t-md oo:data-selected:bg-blue-500 oo:data-selected:text-white", children: [_jsx(RocketLaunchIcon, { className: "oo:inline-block oo:h-[1.25em] oo:w-[1.25em] oo:mr-[0.25em]" }), "Experiments"] })),
|
|
42
42
|
Panel: dynamic(() => import('./exp-panel'), { ssr: false }),
|
|
43
|
-
products: ['webex']
|
|
43
|
+
products: ['webex'],
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
46
|
id: 'Identifiers',
|
|
47
|
-
Tab: () => _jsxs(Tab, { as: "div", className:
|
|
47
|
+
Tab: () => (_jsxs(Tab, { as: "div", className: "oo:text-center oo:inline-block oo:cursor-pointer oo:px-2 oo:py-1 oo:border oo:border-b-0 oo:border-slate-300 oo:rounded-t-md oo:data-selected:bg-blue-500 oo:data-selected:text-white", children: [_jsx(FingerPrintIcon, { className: "oo:inline-block oo:h-[1.25em] oo:w-[1.25em] oo:mr-[0.25em]" }), "Identifiers"] })),
|
|
48
48
|
Panel: dynamic(() => import('./ids-panel'), { ssr: false }),
|
|
49
|
-
products: []
|
|
49
|
+
products: [],
|
|
50
50
|
},
|
|
51
51
|
{
|
|
52
52
|
id: 'Graph',
|
|
53
|
-
Tab: () => _jsxs(Tab, { as: "div", className:
|
|
53
|
+
Tab: () => (_jsxs(Tab, { as: "div", className: "oo:text-center oo:inline-block oo:cursor-pointer oo:px-2 oo:py-1 oo:border oo:border-b-0 oo:border-slate-300 oo:rounded-t-md oo:data-selected:bg-blue-500 oo:data-selected:text-white", children: [_jsx(Square3Stack3DIcon, { className: "oo:inline-block oo:h-[1.25em] oo:w-[1.25em] oo:mr-[0.25em]" }), "Graph"] })),
|
|
54
54
|
Panel: dynamic(() => import('./graph-panel'), { ssr: false }),
|
|
55
|
-
products: []
|
|
55
|
+
products: [],
|
|
56
56
|
},
|
|
57
57
|
];
|
|
58
58
|
/**
|
|
@@ -63,7 +63,7 @@ const Panels = [
|
|
|
63
63
|
* @param param0 The component properties
|
|
64
64
|
* @returns The component JSX
|
|
65
65
|
*/
|
|
66
|
-
export const OptimizelyOneGadget = ({ servicePrefix =
|
|
66
|
+
export const OptimizelyOneGadget = ({ servicePrefix = '/api/me', refreshInterval = 0, show = undefined, showContentRecs = true, showDataPlatform = true, showWebEx = true, }) => {
|
|
67
67
|
const inTestMode = useIsInTestMode();
|
|
68
68
|
const searchParams = useSearchParams();
|
|
69
69
|
const pathname = usePathname();
|
|
@@ -86,18 +86,24 @@ export const OptimizelyOneGadget = ({ servicePrefix = "/api/me", refreshInterval
|
|
|
86
86
|
window.location.href = newPath;
|
|
87
87
|
}
|
|
88
88
|
catch (e) {
|
|
89
|
-
console.log(
|
|
89
|
+
console.log('🛑 Refreshing the page to apply the new Web Experimenation project failed, please refresh manually.');
|
|
90
90
|
}
|
|
91
91
|
}, [pathname, searchParams]);
|
|
92
92
|
useLayoutEffect(() => {
|
|
93
93
|
if (wxProjectIdParam != null && wxProjectIdParam != projectIdCookie) {
|
|
94
|
-
if (wxProjectIdParam ==
|
|
94
|
+
if (wxProjectIdParam == '')
|
|
95
95
|
removeProjectIdCookie();
|
|
96
96
|
else
|
|
97
97
|
setProjectIdCookie(wxProjectIdParam);
|
|
98
98
|
removeQueryParam('pid');
|
|
99
99
|
}
|
|
100
|
-
}, [
|
|
100
|
+
}, [
|
|
101
|
+
wxProjectIdParam,
|
|
102
|
+
projectIdCookie,
|
|
103
|
+
removeQueryParam,
|
|
104
|
+
removeProjectIdCookie,
|
|
105
|
+
setProjectIdCookie,
|
|
106
|
+
]);
|
|
101
107
|
const forceHidden = show != undefined && show == false;
|
|
102
108
|
const forceShown = show != undefined && show == true;
|
|
103
109
|
if (forceHidden || (!forceShown && !inTestMode))
|
|
@@ -107,13 +113,15 @@ export const OptimizelyOneGadget = ({ servicePrefix = "/api/me", refreshInterval
|
|
|
107
113
|
console.log(`Refresh interval: ${refreshInterval == 0 ? 'DISABLED' : refreshInterval + 'ms'}`);
|
|
108
114
|
console.log(`Enabled products: ${enabledProducts.join(', ')}`);
|
|
109
115
|
console.groupEnd();
|
|
110
|
-
return _jsxs(Popover, { className: "oo-
|
|
116
|
+
return (_jsxs(Popover, { className: "oo:md:fixed oo:md:bottom-0 oo:z-[500]", children: [_jsxs(PopoverButton, { className: "oo:fixed oo:bottom-0 oo:right-0 oo:w-full oo:h-[50px] oo:flex oo:flex-row oo:justify-between oo:border-t oo:border-slate-500 oo:bg-slate-100 oo:text-slate-800 oo:md:w-[350px] oo:md:right-4 oo:md:rounded-t-md oo:md:border-x oo:z-[500] oo:p-[10px] oo:dark:text-slate-800", children: [_jsx(OptiLogo, { className: "oo:w-auto oo:h-full" }), _jsx(ChevronUpIcon, { className: "oo:data-open:rotate-180 oo:data-open:transform oo:h-full oo:w-auto oo:inline-block" })] }), _jsxs(PopoverPanel, { className: "oo:text-[14px] oo:fixed oo:bottom-[50px] oo:right-0 oo:w-full oo:top-0 oo:md:border oo:md:border-slate-300 oo:bg-white oo:md:right-4 oo:md:bottom-[55px] oo:md:w-[800px] oo:z-[501] oo:max-w-full oo:flex oo:flex-col oo:justify-stretch oo:md:h-[350px] oo:md:top-auto oo:md:rounded-md oo:md:shadow-xl oo:md:overflow-hidden oo:text-slate-800 oo:dark:text-slate-800", children: [_jsxs("div", { className: "oo:text-[18px] oo:border-b oo:border-slate-300 oo:bg-slate-100 oo:text-slate-800 oo:font-bold oo:p-1 oo:flex-none oo:md:p-2", children: [_jsx(IdentificationIcon, { className: "oo:inline-block oo:h-[1.5em] oo:w-[1.5em] oo:mr-[0.5em] oo:text-blue-500" }), "My Profile"] }), _jsxs(TabGroup, { as: Fragment, children: [_jsx(TabList, { className: "oo:flex-none oo:flex oo:justify-between oo:md:justify-start oo:gap-[0.25em] oo:px-[0.25em] oo:pt-[0.5em] oo:border-b oo:border-slate-300", children: Panels.filter((pnl) => pnl.products.length == 0 ||
|
|
117
|
+
pnl.products.every((pk) => enabledProducts.includes(pk))).map(({ id: pnlId, Tab: GadgetTab }) => {
|
|
111
118
|
const pnlTabKey = 'Tab-' + pnlId;
|
|
112
119
|
return _jsx(GadgetTab, {}, pnlTabKey);
|
|
113
|
-
}) }), _jsx(TabPanels, { className: "oo-
|
|
120
|
+
}) }), _jsx(TabPanels, { className: "oo:flex-1 oo:md:h-24 oo:overscroll-contain oo:overflow-y-auto", children: Panels.filter((pnl) => pnl.products.length == 0 ||
|
|
121
|
+
pnl.products.every((pk) => enabledProducts.includes(pk))).map(({ id: pnlId, Panel: GadgetPanel }) => {
|
|
114
122
|
const pnlKey = 'Panel-' + pnlId;
|
|
115
|
-
return _jsx(TabPanel, { as: "div", className: "oo-
|
|
116
|
-
}) })] })] })] });
|
|
123
|
+
return (_jsx(TabPanel, { as: "div", className: "oo:p-1 oo:md:p-2", children: _jsx(GadgetPanel, { servicePrefix: servicePrefix, refreshInterval: refreshInterval }) }, pnlKey));
|
|
124
|
+
}) })] })] })] }));
|
|
117
125
|
};
|
|
118
126
|
export default OptimizelyOneGadget;
|
|
119
127
|
//# sourceMappingURL=gadget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gadget.js","sourceRoot":"","sources":["../../../src/components/optimizely-one-gadget/gadget.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,
|
|
1
|
+
{"version":3,"file":"gadget.js","sourceRoot":"","sources":["../../../src/components/optimizely-one-gadget/gadget.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EACL,QAAQ,EACR,eAAe,EACf,WAAW,GAGZ,MAAM,OAAO,CAAA;AACd,OAAO,SAAS,MAAM,eAAe,CAAA;AACrC,OAAO,EACL,OAAO,EACP,aAAa,EACb,YAAY,EACZ,GAAG,EACH,QAAQ,EACR,OAAO,EACP,SAAS,EACT,QAAQ,GACT,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACL,aAAa,EACb,aAAa,EACb,OAAO,EACP,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,UAAU,EACV,eAAe,GAChB,MAAM,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AAI,CAAC;oCACxB,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,eAAe,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAC3D,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,EAAE;oCAC1C,MAAM,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAA;oCAC/B,OAAO,CACL,KAAC,QAAQ,IAAc,EAAE,EAAC,KAAK,EAAC,SAAS,EAAC,kBAAkB,YAC1D,KAAC,WAAW,IACV,aAAa,EAAE,aAAa,EAC5B,eAAe,EAAE,eAAe,GAChC,IAJW,MAAM,CAKV,CACZ,CAAA;gCACH,CAAC,CAAC,GACQ,IACH,IACE,IACP,CACX,CAAA;AACH,CAAC,CAAA;AAED,eAAe,mBAAmB,CAAA"}
|
|
@@ -2,23 +2,23 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { TrophyIcon } from '@heroicons/react/20/solid';
|
|
3
3
|
import useSWR from 'swr';
|
|
4
4
|
import Notice from './_notice';
|
|
5
|
-
export const GoalsPanel = ({ servicePrefix = '/api/me', refreshInterval = 2000 }) => {
|
|
5
|
+
export const GoalsPanel = ({ servicePrefix = '/api/me', refreshInterval = 2000, }) => {
|
|
6
6
|
const serviceUrl = `${servicePrefix}/cgoals`;
|
|
7
7
|
const { data, isLoading, isValidating, error } = useSWR(serviceUrl, {
|
|
8
8
|
revalidateOnMount: true,
|
|
9
|
-
fetcher: () => fetch(serviceUrl).then(r => {
|
|
9
|
+
fetcher: () => fetch(serviceUrl).then((r) => {
|
|
10
10
|
if (!r.ok)
|
|
11
11
|
throw new Error(`${r.status}: ${r.statusText}`);
|
|
12
12
|
return r.json();
|
|
13
13
|
}),
|
|
14
|
-
refreshInterval
|
|
14
|
+
refreshInterval,
|
|
15
15
|
});
|
|
16
16
|
if (error)
|
|
17
17
|
return _jsx(Notice, { children: "There was an error loading your next best goals" });
|
|
18
|
-
const goals = (data?.goals ?? []).map(t => _jsxs("li", { className:
|
|
18
|
+
const goals = (data?.goals ?? []).map((t) => (_jsxs("li", { className: "oo:py-1", children: [_jsx(TrophyIcon, { className: "oo:inline-block oo:h-4 oo:w-4 oo:mr-2" }), t.goal, " (", `${t.score * 100}%`, ")"] }, 'goal-' + t.goal)));
|
|
19
19
|
if (goals.length == 0)
|
|
20
|
-
goals.push(_jsx("li", { className:
|
|
21
|
-
return _jsxs(_Fragment, { children: [_jsx("ul", { className:
|
|
20
|
+
goals.push(_jsx("li", { className: "oo:py-1", children: _jsx(Notice, { children: "No goals inferred from behaviour" }) }, "no-topics"));
|
|
21
|
+
return (_jsxs(_Fragment, { children: [_jsx("ul", { className: "oo:grid oo:grid-cols-1 oo:divide-y oo:divide-slate-200", children: goals }), _jsx("p", { className: "oo:text-[12px]", children: "Powered by: Optimizely Content Recommendations" }), isValidating && !isLoading && (_jsx(Notice, { isLoading: true, children: " Refreshing goals" })), isLoading && _jsx(Notice, { isLoading: true, children: " Loading goals" })] }));
|
|
22
22
|
};
|
|
23
23
|
export default GoalsPanel;
|
|
24
24
|
//# sourceMappingURL=goals-panel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"goals-panel.js","sourceRoot":"","sources":["../../../src/components/optimizely-one-gadget/goals-panel.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"goals-panel.js","sourceRoot":"","sources":["../../../src/components/optimizely-one-gadget/goals-panel.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AACtD,OAAO,MAAM,MAAM,KAAK,CAAA;AAExB,OAAO,MAAM,MAAM,WAAW,CAAA;AAO9B,MAAM,CAAC,MAAM,UAAU,GAAuC,CAAC,EAC7D,aAAa,GAAG,SAAS,EACzB,eAAe,GAAG,IAAI,GAC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C,EACA,SAAS,IAAI,KAAC,MAAM,IAAC,SAAS,qCAAwB,IACtD,CACJ,CAAA;AACH,CAAC,CAAA;AAED,eAAe,UAAU,CAAA"}
|
|
@@ -2,26 +2,30 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import useSWR from 'swr';
|
|
3
3
|
import Link from 'next/link';
|
|
4
4
|
import Notice from './_notice';
|
|
5
|
-
export const GraphPanel = ({ servicePrefix = '/api/me', refreshInterval = 30000 }) => {
|
|
5
|
+
export const GraphPanel = ({ servicePrefix = '/api/me', refreshInterval = 30000, }) => {
|
|
6
6
|
const id = `${servicePrefix}/graph`;
|
|
7
7
|
const { data, isLoading, error } = useSWR(id, {
|
|
8
8
|
revalidateOnMount: true,
|
|
9
9
|
refreshInterval,
|
|
10
|
-
fetcher: (key) => fetch(key).then(r => {
|
|
10
|
+
fetcher: (key) => fetch(key).then((r) => {
|
|
11
11
|
if (!r.ok)
|
|
12
12
|
throw new Error(`${r.status}: ${r.statusText}`);
|
|
13
13
|
return r.json();
|
|
14
|
-
})
|
|
14
|
+
}),
|
|
15
15
|
});
|
|
16
16
|
if (isLoading)
|
|
17
|
-
return _jsx(Notice, { isLoading: true, message:
|
|
17
|
+
return (_jsx(Notice, { isLoading: true, message: "Loading Optimizely Graph information..." }));
|
|
18
18
|
if (error)
|
|
19
|
-
return _jsx(Notice, { message:
|
|
20
|
-
return _jsxs(_Fragment, { children: [_jsxs("dl", { className:
|
|
19
|
+
return (_jsx(Notice, { message: "There was an error loading Optimizely Graph information" }));
|
|
20
|
+
return (_jsxs(_Fragment, { children: [_jsxs("dl", { className: "oo:grid oo:grid-cols-3 oo:gap-x-4 oo:gap-y-1", children: [_jsx("dt", { className: "oo:font-bold", children: "Publishing changes to:" }), _jsx("dd", { className: "oo:col-span-2", children: _jsx("ul", { className: "oo:grid oo:grid-cols-1 oo:divide-y oo:divide-slate-200", children: (data?.hooks || []).map((hook) => (_jsxs("li", { className: "oo:py-1", children: [hook.method && (_jsxs("span", { className: "oo:text-amber-800", children: ["(", hook.method?.toLowerCase() ?? '', ")", ' '] })), hook.url, hook.hasQueryParams && _jsx(_Fragment, { children: "?..." })] }, `webhook-${hook.url}`))) }) }), _jsx("dt", { className: "oo:font-bold", children: "Exposing content from:" }), _jsx("dd", { className: "oo:col-span-2", children: _jsx("ul", { className: "oo:grid oo:grid-cols-1 oo:divide-y oo:divide-slate-200", children: (data?.sources || []).map((source) => (_jsxs("li", { className: "oo:py-1", children: [updateLabel(source.label), ", available languages:", ' ', source.languages.join(', ')] }, `source-${source.label}`))) }) })] }), _jsx("p", { className: "oo:pt-4 oo:text-[14px]", children: _jsx(Link, { className: "oo:cursor-pointer oo:underline oo:text-blue-800", href: "https://cg.optimizely.com/app/portal/", target: "_new", children: "Login to Optimizely Graph" }) })] }));
|
|
21
21
|
};
|
|
22
22
|
function updateLabel(label) {
|
|
23
|
-
if (label ==
|
|
24
|
-
return
|
|
23
|
+
if (label == 'default')
|
|
24
|
+
return 'Optimizely CMS';
|
|
25
|
+
if (label == 'cmp')
|
|
26
|
+
return 'Optimizely CMP';
|
|
27
|
+
if (label == 'hub')
|
|
28
|
+
return 'Optimizely Connect';
|
|
25
29
|
return label;
|
|
26
30
|
}
|
|
27
31
|
export default GraphPanel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph-panel.js","sourceRoot":"","sources":["../../../src/components/optimizely-one-gadget/graph-panel.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,MAAM,KAAK,CAAA;AAExB,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,MAAM,MAAM,WAAW,CAAA;AAO9B,MAAM,CAAC,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"graph-panel.js","sourceRoot":"","sources":["../../../src/components/optimizely-one-gadget/graph-panel.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,MAAM,KAAK,CAAA;AAExB,OAAO,IAAI,MAAM,WAA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IAAI,EAAE,OAAG,GAAG,IACnC,CACR,EACA,IAAI,CAAC,GAAG,EACR,IAAI,CAAC,cAAc,IAAI,qCAAS,KAPN,WAAW,IAAI,CAAC,GAAG,EAAE,CAQ7C,CACN,CAAC,GACC,GACF,EACL,aAAI,SAAS,EAAC,cAAc,uCAA4B,EACxD,aAAI,SAAS,EAAC,eAAe,YAC3B,aAAI,SAAS,EAAC,wDAAwD,YACnE,CAAC,IAAI,EAAE,OAAO,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CACrC,cAAI,SAAS,EAAC,SAAS,aACpB,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,4BAAwB,GAAG,EACpD,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,KAFD,UAAU,MAAM,CAAC,KAAK,EAAE,CAGhD,CACN,CAAC,GACC,GACF,IACF,EACL,YAAG,SAAS,EAAC,wBAAwB,YACnC,KAAC,IAAI,IACH,SAAS,EAAC,iDAAiD,EAC3D,IAAI,EAAC,uCAAuC,EAC5C,MAAM,EAAC,MAAM,0CAGR,GACL,IACH,CACJ,CAAA;AACH,CAAC,CAAA;AAED,SAAS,WAAW,CAAC,KAAa;IAChC,IAAI,KAAK,IAAI,SAAS;QAAE,OAAO,gBAAgB,CAAA;IAC/C,IAAI,KAAK,IAAI,KAAK;QAAE,OAAO,gBAAgB,CAAA;IAC3C,IAAI,KAAK,IAAI,KAAK;QAAE,OAAO,oBAAoB,CAAA;IAC/C,OAAO,KAAK,CAAA;AACd,CAAC;AAED,eAAe,UAAU,CAAA"}
|
|
@@ -4,25 +4,25 @@ import { usePathname } from 'next/navigation';
|
|
|
4
4
|
import useSWR from 'swr';
|
|
5
5
|
import { useOptimizelyOne } from '../context';
|
|
6
6
|
import Notice from './_notice';
|
|
7
|
-
export const IdsPanel = ({ servicePrefix = '/api/me', refreshInterval = 2000 }) => {
|
|
7
|
+
export const IdsPanel = ({ servicePrefix = '/api/me', refreshInterval = 2000, }) => {
|
|
8
8
|
const currentPath = usePathname();
|
|
9
9
|
const opti = useOptimizelyOne();
|
|
10
10
|
const webEx = opti.getService('webex')?.getBrowserApi();
|
|
11
11
|
const ids = `${servicePrefix}?scope=ids`;
|
|
12
|
-
const { data: profile, isLoading, error } = useSWR(ids, {
|
|
12
|
+
const { data: profile, isLoading, error, } = useSWR(ids, {
|
|
13
13
|
revalidateOnMount: true,
|
|
14
14
|
refreshInterval,
|
|
15
|
-
fetcher: () => fetch(ids).then(r => {
|
|
15
|
+
fetcher: () => fetch(ids).then((r) => {
|
|
16
16
|
if (!r.ok)
|
|
17
17
|
throw new Error(`${r.status}: ${r.statusText}`);
|
|
18
18
|
return r.json();
|
|
19
|
-
})
|
|
19
|
+
}),
|
|
20
20
|
});
|
|
21
21
|
if (isLoading)
|
|
22
|
-
return _jsx(Notice, { message:
|
|
22
|
+
return _jsx(Notice, { message: "Loading your profile information..." });
|
|
23
23
|
if (error)
|
|
24
|
-
return _jsx(Notice, { message:
|
|
25
|
-
return _jsx(_Fragment, { children: _jsxs("dl", { className:
|
|
24
|
+
return (_jsx(Notice, { message: "There was an error loading your profile information" }));
|
|
25
|
+
return (_jsx(_Fragment, { children: _jsxs("dl", { className: "oo:grid oo:grid-cols-3 oo:gap-x-4 oo:gap-y-1", children: [_jsx("dt", { className: "oo:font-bold", children: "Frontend (Feature Experimentation):" }), _jsx("dd", { className: "oo:col-span-2", children: profile?.ids.frontend ?? 'n/a' }), _jsx("dt", { className: "oo:font-bold", children: "Web Experimentation:" }), _jsx("dd", { className: "oo:col-span-2", children: webEx && webEx.get ? webEx.get('visitor').visitorId : 'n/a' }), _jsx("dt", { className: "oo:font-bold", children: "Content Intelligence:" }), _jsx("dd", { className: "oo:col-span-2", children: profile?.ids.contentIntelligence ?? 'n/a' }), _jsx("dt", { className: "oo:font-bold", children: "Data Platform:" }), _jsx("dd", { className: "oo:col-span-2", children: profile?.ids.dataPlatform ?? 'n/a' }), _jsx("dt", { className: "oo:font-bold", children: "Current path:" }), _jsx("dd", { className: "oo:col-span-2", children: currentPath })] }) }));
|
|
26
26
|
};
|
|
27
27
|
export default IdsPanel;
|
|
28
28
|
//# sourceMappingURL=ids-panel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ids-panel.js","sourceRoot":"","sources":["../../../src/components/optimizely-one-gadget/ids-panel.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,MAAM,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAE7C,OAAO,MAAM,MAAM,WAAW,CAAA;AAO9B,MAAM,CAAC,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"ids-panel.js","sourceRoot":"","sources":["../../../src/components/optimizely-one-gadget/ids-panel.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,MAAM,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAE7C,OAAO,MAAM,MAAM,WAAW,CAAA;AAO9B,MAAM,CAAC,MAAM,QAAQ,GAAqC,CAAC,EACzD,aAAa,GAAG,SAAS,EACzB,eAAe,GAAG,IAAI,GACvB,EAAE,EAAE;IACH,MAAM,WAAW,GAAG,WAAW,EAAE,CAAA;IACjC,MAAM,IAAI,GAAG,gBAAgB,EAAE,CAAA;IAC/B,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,aAAa,EAAE,CAAA;IAEvD,MAAM,GAAG,GAAG,GAAG,aAAa,YAAY,CAAA;IACxC,MAAM,EACJ,IAAI,EAAE,OAAO,EACb,SAAS,EACT,KAAK,GACN,GAAG,MAAM,CAAa,GAAG,EAAE;QAC1B,iBAAiB,EA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ACJ,CAAA;AACH,CAAC,CAAA;AAED,eAAe,QAAQ,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { OptimizelyOneGadgetProps } from './_types';
|
|
2
2
|
import 'server-only';
|
|
3
|
-
export declare const OptimizelyOneGadget: ({ refreshInterval, servicePrefix, show }: OptimizelyOneGadgetProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
3
|
+
export declare const OptimizelyOneGadget: ({ refreshInterval, servicePrefix, show, }: OptimizelyOneGadgetProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
4
4
|
export default OptimizelyOneGadget;
|
|
@@ -3,13 +3,13 @@ import getConfig, { checkProductStatus } from '../../config';
|
|
|
3
3
|
import dynamic from 'next/dynamic';
|
|
4
4
|
import { Suspense } from 'react';
|
|
5
5
|
import 'server-only';
|
|
6
|
-
const OptimizelyOneClientGadget = dynamic(() => import('./gadget')
|
|
7
|
-
export const OptimizelyOneGadget = ({ refreshInterval = 0, servicePrefix = '/api/me', show }) => {
|
|
6
|
+
const OptimizelyOneClientGadget = dynamic(() => import('./gadget'));
|
|
7
|
+
export const OptimizelyOneGadget = ({ refreshInterval = 0, servicePrefix = '/api/me', show, }) => {
|
|
8
8
|
const optiOneConfig = getConfig();
|
|
9
9
|
const { HelperEnabled, OptimizelyDebug } = optiOneConfig;
|
|
10
10
|
const productStatus = checkProductStatus(optiOneConfig);
|
|
11
11
|
if (show || (show === undefined && HelperEnabled)) {
|
|
12
|
-
return _jsx(Suspense, { fallback: null, children: _jsx(OptimizelyOneClientGadget, { refreshInterval: refreshInterval, servicePrefix: servicePrefix, show: show, showContentRecs: productStatus.contentRecsApi, showDataPlatform: productStatus.dataPlatform, showWebEx: productStatus.webExperimentation }) });
|
|
12
|
+
return (_jsx(Suspense, { fallback: null, children: _jsx(OptimizelyOneClientGadget, { refreshInterval: refreshInterval, servicePrefix: servicePrefix, show: show, showContentRecs: productStatus.contentRecsApi, showDataPlatform: productStatus.dataPlatform, showWebEx: productStatus.webExperimentation }) }));
|
|
13
13
|
}
|
|
14
14
|
if (OptimizelyDebug)
|
|
15
15
|
console.log(`🚀 [OptimizelyOne Gadget] Gadget disabled by ${show === undefined ? 'configuration' : 'parameter'}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/optimizely-one-gadget/index.tsx"],"names":[],"mappings":";AACA,OAAO,SAAS,EAAE,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAC5D,OAAO,OAAO,MAAM,cAAc,CAAA;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,aAAa,CAAA;AAEpB,MAAM,yBAAyB,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/optimizely-one-gadget/index.tsx"],"names":[],"mappings":";AACA,OAAO,SAAS,EAAE,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAC5D,OAAO,OAAO,MAAM,cAAc,CAAA;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,aAAa,CAAA;AAEpB,MAAM,yBAAyB,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAA;AAEnE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,EAClC,eAAe,GAAG,CAAC,EACnB,aAAa,GAAG,SAAS,EACzB,IAAI,GACqB,EAAE,EAAE;IAC7B,MAAM,aAAa,GAAG,SAAS,EAAE,CAAA;IACjC,MAAM,EAAE,aAAa,EAAE,eAAe,EAAE,GAAG,aAAa,CAAA;IACxD,MAAM,aAAa,GAAG,kBAAkB,CAAC,aAAa,CAAC,CAAA;IAEvD,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,aAAa,CAAC,EAAE,CAAC;QAClD,OAAO,CACL,KAAC,QAAQ,IAAC,QAAQ,EAAE,IAAI,YACtB,KAAC,yBAAyB,IACxB,eAAe,EAAE,eAAe,EAChC,aAAa,EAAE,aAAa,EAC5B,IAAI,EAAE,IAAI,EACV,eAAe,EAAE,aAAa,CAAC,cAAc,EAC7C,gBAAgB,EAAE,aAAa,CAAC,YAAY,EAC5C,SAAS,EAAE,aAAa,CAAC,kBAAkB,GAC3C,GACO,CACZ,CAAA;IACH,CAAC;IAED,IAAI,eAAe;QACjB,OAAO,CAAC,GAAG,CACT,gDAAgD,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,WAAW,EAAE,CACrG,CAAA;IACH,OAAO,IAAI,CAAA;AACb,CAAC,CAAA;AAED,eAAe,mBAAmB,CAAA"}
|
|
@@ -2,23 +2,23 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { TagIcon } from '@heroicons/react/20/solid';
|
|
3
3
|
import useSWR from 'swr';
|
|
4
4
|
import Notice from './_notice';
|
|
5
|
-
export const InterestsPanel = ({ servicePrefix = '/api/me', refreshInterval = 2000 }) => {
|
|
5
|
+
export const InterestsPanel = ({ servicePrefix = '/api/me', refreshInterval = 2000, }) => {
|
|
6
6
|
const topics = `${servicePrefix}?scope=topics`;
|
|
7
|
-
const { data: profile, isLoading, isValidating, error } = useSWR(topics, {
|
|
7
|
+
const { data: profile, isLoading, isValidating, error, } = useSWR(topics, {
|
|
8
8
|
revalidateOnMount: true,
|
|
9
|
-
fetcher: () => fetch(topics).then(r => {
|
|
9
|
+
fetcher: () => fetch(topics).then((r) => {
|
|
10
10
|
if (!r.ok)
|
|
11
11
|
throw new Error(`${r.status}: ${r.statusText}`);
|
|
12
12
|
return r.json();
|
|
13
13
|
}),
|
|
14
|
-
refreshInterval
|
|
14
|
+
refreshInterval,
|
|
15
15
|
});
|
|
16
16
|
if (error)
|
|
17
17
|
return _jsx(Notice, { children: "There was an error loading your profile information" });
|
|
18
|
-
const contentTopics = (profile?.contentTopics ?? []).map(t => _jsxs("li", { className:
|
|
18
|
+
const contentTopics = (profile?.contentTopics ?? []).map((t) => (_jsxs("li", { className: "oo:py-1", children: [_jsx(TagIcon, { className: "oo:inline-block oo:h-4 oo:w-4 oo:mr-2" }), t] }, 'topic-' + t)));
|
|
19
19
|
if (contentTopics.length == 0)
|
|
20
|
-
contentTopics.push(_jsx("li", { className:
|
|
21
|
-
return _jsxs(_Fragment, { children: [_jsx("ul", { className:
|
|
20
|
+
contentTopics.push(_jsx("li", { className: "oo:py-1", children: _jsx(Notice, { children: "No topics inferred from behaviour" }) }, "no-topics"));
|
|
21
|
+
return (_jsxs(_Fragment, { children: [_jsx("ul", { className: "oo:grid oo:grid-cols-1 oo:divide-y oo:divide-slate-200", children: contentTopics }), _jsx("p", { className: "oo:text-[12px]", children: "Powered by: Optimizely Content Recommendations" }), isValidating && !isLoading && (_jsx(Notice, { isLoading: true, children: " Refreshing interests" })), isLoading && _jsx(Notice, { isLoading: true, children: " Loading interests" })] }));
|
|
22
22
|
};
|
|
23
23
|
export default InterestsPanel;
|
|
24
24
|
//# sourceMappingURL=interests-panel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interests-panel.js","sourceRoot":"","sources":["../../../src/components/optimizely-one-gadget/interests-panel.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AACnD,OAAO,MAAM,MAAM,KAAK,CAAA;AAExB,OAAO,MAAM,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"interests-panel.js","sourceRoot":"","sources":["../../../src/components/optimizely-one-gadget/interests-panel.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AACnD,OAAO,MAAM,MAAM,KAAK,CAAA;AAExB,OAAO,MAAM,MAAM,WAAW,CAAA;AAO9B,MAAM,CAAC,MAAM,cAAc,GAA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jD,EACA,SAAS,IAAI,KAAC,MAAM,IAAC,SAAS,yCAA4B,IAC1D,CACJ,CAAA;AACH,CAAC,CAAA;AAED,eAAe,cAAc,CAAA"}
|
|
@@ -2,20 +2,22 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { UserCircleIcon } from '@heroicons/react/20/solid';
|
|
3
3
|
import useSWR from 'swr';
|
|
4
4
|
import Notice from './_notice';
|
|
5
|
-
export const ProfilePanel = ({ servicePrefix = '/api/me', refreshInterval = 2000 }) => {
|
|
5
|
+
export const ProfilePanel = ({ servicePrefix = '/api/me', refreshInterval = 2000, }) => {
|
|
6
6
|
const topics = `${servicePrefix}?scope=profile`;
|
|
7
|
-
const { data: profile, isLoading, isValidating, error } = useSWR(topics, {
|
|
7
|
+
const { data: profile, isLoading, isValidating, error, } = useSWR(topics, {
|
|
8
8
|
revalidateOnMount: true,
|
|
9
|
-
fetcher: () => fetch(topics).then(r => {
|
|
9
|
+
fetcher: () => fetch(topics).then((r) => {
|
|
10
10
|
if (!r.ok)
|
|
11
11
|
throw new Error(`${r.status}: ${r.statusText}`);
|
|
12
12
|
return r.json();
|
|
13
13
|
}),
|
|
14
|
-
refreshInterval
|
|
14
|
+
refreshInterval,
|
|
15
15
|
});
|
|
16
16
|
if (error)
|
|
17
|
-
return _jsx(Notice, { message:
|
|
18
|
-
return _jsxs(_Fragment, { children: [profile && !profile.profile && _jsx(Notice, { message:
|
|
17
|
+
return (_jsx(Notice, { message: "There was an error loading your profile information" }));
|
|
18
|
+
return (_jsxs(_Fragment, { children: [profile && !profile.profile && _jsx(Notice, { message: "Anonymous session" }), profile && profile.profile && (_jsxs("div", { className: "oo:w-full oo:flex oo:flex-row oo:gap-4 oo:mb-2", children: [_jsx("div", { className: "oo:flex-none oo:w-[100px]", children: profile.profile.image_url ? (_jsx("img", { src: profile.profile.image_url, alt: profile.profile.name ?? '', className: "oo:w-full oo:aspect-square oo:rounded-[15px]" })) : (_jsx(UserCircleIcon, { className: "oo:w-full oo:aspect-square oo:rounded-[15px]" })) }), _jsxs("div", { className: "oo:flex-grow", children: [_jsxs("dl", { className: "oo:grid oo:grid-cols-3 oo:gap-x-4 oo:gap-y-1", children: [_jsx("dt", { className: "oo:font-bold", children: "Name:" }), _jsx("dd", { className: "oo:col-span-2", children: profile.profile.name
|
|
19
|
+
? profile.profile.name
|
|
20
|
+
: `${profile.profile.first_name ?? ''} ${profile.profile.last_name}`.trim() }), _jsx("dt", { className: "oo:font-bold", children: "City:" }), _jsx("dd", { className: "oo:col-span-2", children: profile.profile.city ?? '' }), _jsx("dt", { className: "oo:font-bold", children: "E-Mail:" }), _jsx("dd", { className: "oo:col-span-2", children: profile.profile.email ?? '' }), _jsx("dt", { className: "oo:font-bold", children: "Phone:" }), _jsx("dd", { className: "oo:col-span-2", children: profile.profile.phone ?? '' }), _jsx("dt", { className: "oo:font-bold", children: "Age:" }), _jsx("dd", { className: "oo:col-span-2", children: profile.profile.observations.computed_age_years ?? 'n/a' }), _jsx("dt", { className: "oo:font-bold", children: "Number of visits:" }), _jsx("dd", { className: "oo:col-span-2", children: profile.profile.observations.session_count }), _jsx("dt", { className: "oo:font-bold", children: "Likelyhood of still alive:" }), _jsx("dd", { className: "oo:col-span-2", children: `${(profile.profile.insights.probability_alive ?? 0) * 100}%` })] }), _jsx("pre", { className: "oo:hidden", children: JSON.stringify(profile.profile, undefined, 4) })] })] })), _jsx("p", { className: "oo:text-[12px]", children: "Powered by: Optimizely Data Platform" }), isLoading && _jsx(Notice, { isLoading: true, message: "Loading profile" })] }));
|
|
19
21
|
};
|
|
20
22
|
export default ProfilePanel;
|
|
21
23
|
//# sourceMappingURL=profile-panel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile-panel.js","sourceRoot":"","sources":["../../../src/components/optimizely-one-gadget/profile-panel.tsx"],"names":[],"mappings":";AACA,OAAO,EAAiB,cAAc,EAAE,MAAM,2BAA2B,CAAA;AACzE,OAAO,MAAM,MAAM,KAAK,CAAA;AAExB,OAAO,MAAM,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"profile-panel.js","sourceRoot":"","sources":["../../../src/components/optimizely-one-gadget/profile-panel.tsx"],"names":[],"mappings":";AACA,OAAO,EAAiB,cAAc,EAAE,MAAM,2BAA2B,CAAA;AACzE,OAAO,MAAM,MAAM,KAAK,CAAA;AAExB,OAAO,MAAM,MAAM,WAAW,CAAA;AAO9B,MAAM,CAAC,MAAM,YAAY,GAAyC,CAAC,EACjE,aAAa,GAAG,SAAS,EACzB,eAAe,GAAG,IAAI,GACvB,EAAE,EAAE;IACH,MAAM,MAAM,GAAG,GAAG,aAAa,gBAAgB,CAAA;IAC/C,MAAM,EACJ,IAAI,EAAE,OAAO,EACb,SAAS,EACT,YAAY,EACZ,KAAK,GACN,GAAG,MAAM,CAAa,MAAM,EAAE;QAC7B,iBAAiB,EAAE,IAAI;QACvB,OAAO,EAAE,GAAG,EAAE,CACZ,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;YACvB,IAAI,CAAC,CAAC,CAAC,EAAE;gBAAE,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,UAAU,EAAE,CAAC,CAAA;YAC1D,OAAO,CAAC,CAAC,IAAI,EAAE,CAAA;QACjB,CAAC,CAAC;QACJ,eAAe;KAChB,CAAC,CAAA;IAEF,IAAI,KAAK;QACP,OAAO,CACL,KAAC,MAAM,IAAC,OAAO,EAAC,qDAAqD,GAAG,CACzE,CAAA;IAEH,OAAO,CACL,8BACG,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,KAAC,MAAM,IAAC,OAAO,EAAC,mBAAmB,GAAG,EACrE,OAAO,IAAI,OAAO,CAAC,OAAO,IAAI,CAC7B,eAAK,SAAS,EAAC,gDAAgD,aAC7D,cAAK,SAAS,EAAC,2BAA2B,YACvC,O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,YAAY,CAAC,aAAa,GACxC,EACL,aAAI,SAAS,EAAC,cAAc,2CAAgC,EAC5D,aAAI,SAAS,EAAC,eAAe,YAAE,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,IAAI,CAAC,CAAC,GAAG,GAAG,GAAG,GAAM,IAC/F,EACL,cAAK,SAAS,EAAC,WAAW,YACvB,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC,GAC1C,IACF,IACF,CACP,EACD,YAAG,SAAS,EAAC,gBAAgB,qDAAyC,EACrE,SAAS,IAAI,KAAC,MAAM,IAAC,SAAS,QAAC,OAAO,EAAC,iBAAiB,GAAG,IAC3D,CACJ,CAAA;AACH,CAAC,CAAA;AAED,eAAe,YAAY,CAAA"}
|
|
@@ -6,7 +6,7 @@ import type { ReadonlyRequestCookies } from '../types';
|
|
|
6
6
|
* @param cookies The request cookies
|
|
7
7
|
* @returns The identifier, or undefined if not known
|
|
8
8
|
*/
|
|
9
|
-
export declare function getVisitorID(cookies: ReadonlyRequestCookies): string | undefined;
|
|
9
|
+
export declare function getVisitorID(cookies: Awaited<ReadonlyRequestCookies>): string | undefined;
|
|
10
10
|
/**
|
|
11
11
|
* Server side check if the Content Recs integration has been configured
|
|
12
12
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/products/content-recs/helpers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAA;AAC3C,OAAO,OAAO,MAAM,gBAAgB,CAAA;AAEpC;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/products/content-recs/helpers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAA;AAC3C,OAAO,OAAO,MAAM,gBAAgB,CAAA;AAEpC;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,OAAwC;IACnE,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,KAAK,CAAA;AACjC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,SAAS;IACvB,MAAM,QAAQ,GAAG,QAAQ,CAAC,SAAS,CAAC,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAA;IAClE,MAAM,UAAU,GAAG,QAAQ,CAAC,SAAS,CAAC,OAAO,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAA;IACtE,OAAO,QAAQ,IAAI,EAAE,IAAI,UAAU,IAAI,EAAE,CAAA;AAC3C,CAAC;AAED,eAAe;IACb,YAAY;IACZ,SAAS;CACV,CAAA"}
|
|
@@ -14,7 +14,7 @@ export declare function parseApiKey(configuredKey: string): [string, string | nu
|
|
|
14
14
|
* @param cookies The request cookies
|
|
15
15
|
* @returns The identifier, or undefined if not known
|
|
16
16
|
*/
|
|
17
|
-
export declare function getVisitorID(cookies: ReadonlyRequestCookies): string | undefined;
|
|
17
|
+
export declare function getVisitorID(cookies: Awaited<ReadonlyRequestCookies>): string | undefined;
|
|
18
18
|
export declare function isEnabled(config?: OptiOneConfig): boolean;
|
|
19
19
|
declare const _default: {
|
|
20
20
|
getVisitorID: typeof getVisitorID;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/products/data-platform/helpers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAsB,MAAM,cAAc,CAAA;AAErE;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,aAAqB;
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/products/data-platform/helpers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAsB,MAAM,cAAc,CAAA;AAErE;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,aAAqB;IAC/C,MAAM,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG,aAAa,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IAC5D,OAAO,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;AACvD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,OAAwC;IACnE,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,EAAE,UAAU,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;AAC7E,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,MAAsB;IAC9C,OAAO,kBAAkB,CAAC,MAAM,CAAC,CAAC,YAAY,CAAA;AAChD,CAAC;AAED,eAAe;IACb,YAAY;IACZ,WAAW;CACZ,CAAA"}
|
|
@@ -6,7 +6,7 @@ import type { ReadonlyRequestCookies } from '../types';
|
|
|
6
6
|
* @param cookies The request cookies
|
|
7
7
|
* @returns The identifier, or undefined if not known
|
|
8
8
|
*/
|
|
9
|
-
export declare function getVisitorID(cookies: ReadonlyRequestCookies): string | undefined;
|
|
9
|
+
export declare function getVisitorID(cookies: Awaited<ReadonlyRequestCookies>): string | undefined;
|
|
10
10
|
declare const _default: {
|
|
11
11
|
getVisitorID: typeof getVisitorID;
|
|
12
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/products/web-experimentation/helpers.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/products/web-experimentation/helpers.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,OAAwC;IACnE,OAAO,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,EAAE,KAAK,CAAA;AAClD,CAAC;AAED,eAAe;IACb,YAAY;CACb,CAAA"}
|
package/dist/styles.css
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
/*! tailwindcss v4.1.11 | MIT License | https://tailwindcss.com */
|
|
2
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-font-weight:initial;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}@layer theme{:root,:host{--oo-font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--oo-font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--oo-color-amber-200:oklch(92.4% .12 95.746);--oo-color-amber-800:oklch(47.3% .137 46.201);--oo-color-blue-500:oklch(62.3% .214 259.815);--oo-color-blue-800:oklch(42.4% .199 265.638);--oo-color-slate-100:oklch(96.8% .007 247.896);--oo-color-slate-200:oklch(92.9% .013 255.508);--oo-color-slate-300:oklch(86.9% .022 252.894);--oo-color-slate-500:oklch(55.4% .046 257.417);--oo-color-slate-800:oklch(27.9% .041 260.031);--oo-color-white:#fff;--oo-spacing:.25rem;--oo-font-weight-bold:700;--oo-radius-md:.375rem;--oo-animate-spin:spin 1s linear infinite;--oo-default-font-family:var(--oo-font-sans);--oo-default-mono-font-family:var(--oo-font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--oo-default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--oo-default-font-feature-settings,normal);font-variation-settings:var(--oo-default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--oo-default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--oo-default-mono-font-feature-settings,normal);font-variation-settings:var(--oo-default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.oo\:fixed{position:fixed}.oo\:top-0{top:calc(var(--oo-spacing)*0)}.oo\:right-0{right:calc(var(--oo-spacing)*0)}.oo\:bottom-0{bottom:calc(var(--oo-spacing)*0)}.oo\:bottom-\[50px\]{bottom:50px}.oo\:z-\[500\]{z-index:500}.oo\:z-\[501\]{z-index:501}.oo\:col-span-2{grid-column:span 2/span 2}.oo\:m-2{margin:calc(var(--oo-spacing)*2)}.oo\:mt-3{margin-top:calc(var(--oo-spacing)*3)}.oo\:mr-2{margin-right:calc(var(--oo-spacing)*2)}.oo\:mr-\[0\.5em\]{margin-right:.5em}.oo\:mr-\[0\.25em\]{margin-right:.25em}.oo\:mb-2{margin-bottom:calc(var(--oo-spacing)*2)}.oo\:ml-2{margin-left:calc(var(--oo-spacing)*2)}.oo\:flex{display:flex}.oo\:grid{display:grid}.oo\:hidden{display:none}.oo\:inline-block{display:inline-block}.oo\:aspect-square{aspect-ratio:1}.oo\:h-4{height:calc(var(--oo-spacing)*4)}.oo\:h-\[1\.5em\]{height:1.5em}.oo\:h-\[1\.25em\]{height:1.25em}.oo\:h-\[50px\]{height:50px}.oo\:h-full{height:100%}.oo\:w-4{width:calc(var(--oo-spacing)*4)}.oo\:w-\[1\.5em\]{width:1.5em}.oo\:w-\[1\.25em\]{width:1.25em}.oo\:w-\[100px\]{width:100px}.oo\:w-auto{width:auto}.oo\:w-full{width:100%}.oo\:max-w-full{max-width:100%}.oo\:flex-1{flex:1}.oo\:flex-none{flex:none}.oo\:flex-grow{flex-grow:1}.oo\:animate-spin{animation:var(--oo-animate-spin)}.oo\:cursor-pointer{cursor:pointer}.oo\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.oo\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.oo\:flex-col{flex-direction:column}.oo\:flex-row{flex-direction:row}.oo\:justify-between{justify-content:space-between}.oo\:justify-stretch{justify-content:stretch}.oo\:gap-4{gap:calc(var(--oo-spacing)*4)}.oo\:gap-\[0\.25em\]{gap:.25em}.oo\:gap-x-4{column-gap:calc(var(--oo-spacing)*4)}.oo\:gap-y-1{row-gap:calc(var(--oo-spacing)*1)}:where(.oo\:divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px*var(--tw-divide-y-reverse));border-bottom-width:calc(1px*calc(1 - var(--tw-divide-y-reverse)))}:where(.oo\:divide-slate-200>:not(:last-child)){border-color:var(--oo-color-slate-200)}.oo\:overflow-y-auto{overflow-y:auto}.oo\:overscroll-contain{overscroll-behavior:contain}.oo\:rounded-\[15px\]{border-radius:15px}.oo\:rounded-md{border-radius:var(--oo-radius-md)}.oo\:rounded-t-md{border-top-left-radius:var(--oo-radius-md);border-top-right-radius:var(--oo-radius-md)}.oo\:border{border-style:var(--tw-border-style);border-width:1px}.oo\:border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.oo\:border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.oo\:border-b-0{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.oo\:border-amber-800{border-color:var(--oo-color-amber-800)}.oo\:border-slate-300{border-color:var(--oo-color-slate-300)}.oo\:border-slate-500{border-color:var(--oo-color-slate-500)}.oo\:bg-amber-200{background-color:var(--oo-color-amber-200)}.oo\:bg-blue-500{background-color:var(--oo-color-blue-500)}.oo\:bg-slate-100{background-color:var(--oo-color-slate-100)}.oo\:bg-white{background-color:var(--oo-color-white)}.oo\:p-1{padding:calc(var(--oo-spacing)*1)}.oo\:p-\[10px\]{padding:10px}.oo\:px-2{padding-inline:calc(var(--oo-spacing)*2)}.oo\:px-\[0\.25em\]{padding-inline:.25em}.oo\:py-1{padding-block:calc(var(--oo-spacing)*1)}.oo\:pt-1{padding-top:calc(var(--oo-spacing)*1)}.oo\:pt-4{padding-top:calc(var(--oo-spacing)*4)}.oo\:pt-\[0\.5em\]{padding-top:.5em}.oo\:text-center{text-align:center}.oo\:text-\[12px\]{font-size:12px}.oo\:text-\[14px\]{font-size:14px}.oo\:text-\[18px\]{font-size:18px}.oo\:font-bold{--tw-font-weight:var(--oo-font-weight-bold);font-weight:var(--oo-font-weight-bold)}.oo\:text-amber-800{color:var(--oo-color-amber-800)}.oo\:text-blue-500{color:var(--oo-color-blue-500)}.oo\:text-blue-800{color:var(--oo-color-blue-800)}.oo\:text-slate-800{color:var(--oo-color-slate-800)}.oo\:text-white{color:var(--oo-color-white)}.oo\:underline{text-decoration-line:underline}.oo\:data-open\:rotate-180[data-open]{rotate:180deg}.oo\:data-open\:transform[data-open]{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.oo\:data-selected\:bg-blue-500[data-selected]{background-color:var(--oo-color-blue-500)}.oo\:data-selected\:text-white[data-selected]{color:var(--oo-color-white)}@media (min-width:48rem){.oo\:md\:fixed{position:fixed}.oo\:md\:top-auto{top:auto}.oo\:md\:right-4{right:calc(var(--oo-spacing)*4)}.oo\:md\:bottom-0{bottom:calc(var(--oo-spacing)*0)}.oo\:md\:bottom-\[55px\]{bottom:55px}.oo\:md\:h-24{height:calc(var(--oo-spacing)*24)}.oo\:md\:h-\[350px\]{height:350px}.oo\:md\:w-\[350px\]{width:350px}.oo\:md\:w-\[800px\]{width:800px}.oo\:md\:justify-start{justify-content:flex-start}.oo\:md\:overflow-hidden{overflow:hidden}.oo\:md\:rounded-md{border-radius:var(--oo-radius-md)}.oo\:md\:rounded-t-md{border-top-left-radius:var(--oo-radius-md);border-top-right-radius:var(--oo-radius-md)}.oo\:md\:border{border-style:var(--tw-border-style);border-width:1px}.oo\:md\:border-x{border-inline-style:var(--tw-border-style);border-inline-width:1px}.oo\:md\:border-slate-300{border-color:var(--oo-color-slate-300)}.oo\:md\:p-2{padding:calc(var(--oo-spacing)*2)}.oo\:md\:shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}@media (prefers-color-scheme:dark){.oo\:dark\:text-slate-800{color:var(--oo-color-slate-800)}}}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@keyframes spin{to{transform:rotate(360deg)}}
|
package/dist/utils/session.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { NextRequest, NextResponse } from 'next/server';
|
|
2
2
|
import type { cookies } from "next/headers";
|
|
3
3
|
export declare function getOrCreateVisitorId(request: NextRequest): string;
|
|
4
|
-
export declare function getVisitorId(c: ReturnType<typeof cookies
|
|
4
|
+
export declare function getVisitorId(c: Awaited<ReturnType<typeof cookies>>): string | undefined;
|
|
5
5
|
export declare function addVisitorId<T = unknown>(response: NextResponse<T>, visitorId: string): NextResponse<T>;
|
|
6
6
|
declare const _default: {
|
|
7
7
|
getVisitorId: typeof getVisitorId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/utils/session.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,IAAI,UAAU,EAAE,MAAM,MAAM,CAAA;AACvC,OAAO,SAAS,MAAM,WAAW,CAAA;AAEjC,MAAM,UAAU,oBAAoB,CAAC,OAAoB;
|
|
1
|
+
{"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/utils/session.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,IAAI,UAAU,EAAE,MAAM,MAAM,CAAA;AACvC,OAAO,SAAS,MAAM,WAAW,CAAA;AAEjC,MAAM,UAAU,oBAAoB,CAAC,OAAoB;IACvD,OAAO,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,cAAc,CAAC,EAAE,KAAK,IAAI,UAAU,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;AACnG,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,CAAsC;IACjE,OAAO,CAAC,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,cAAc,CAAC,EAAE,KAAK,CAAA;AACjD,CAAC;AAED,MAAM,UAAU,YAAY,CAAc,QAAyB,EAAE,SAAiB;IACpF,MAAM,KAAK,GAAG,SAAS,EAAE,CAAC,UAAU,IAAI,aAAa,CAAA;IACrD,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC;QACnB,IAAI,EAAE,WAAW;QACjB,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE,QAAQ;QAClB,IAAI,EAAE,GAAG;QACT,MAAM,EAAE,CAAC,KAAK;KACf,CAAC,CAAA;IACF,OAAO,QAAQ,CAAA;AACjB,CAAC;AAED,eAAe;IACb,YAAY;IACZ,oBAAoB;IACpB,YAAY;CACb,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remkoj/optimizely-one-nextjs",
|
|
3
3
|
"license": "Apache-2.0",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "6.0.0-pre1",
|
|
5
5
|
"repository": "https://github.com/remkoj/optimizely-dxp-clients.git",
|
|
6
6
|
"author": "Remko Jantzen <693172+remkoj@users.noreply.github.com>",
|
|
7
7
|
"homepage": "https://github.com/remkoj/optimizely-dxp-clients",
|
|
@@ -39,41 +39,41 @@
|
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@
|
|
43
|
-
"@
|
|
44
|
-
"@heroicons/react": "^2.2.0",
|
|
45
|
-
"@remkoj/optimizely-graph-client": "^5.1.0",
|
|
42
|
+
"@remkoj/optimizely-graph-client": "^6.0.0-pre1",
|
|
43
|
+
"@tailwindcss/cli": "^4.1.11",
|
|
46
44
|
"@types/node": "^22.16.0",
|
|
47
|
-
"@types/react": "^
|
|
48
|
-
"@types/react-dom": "
|
|
45
|
+
"@types/react": "^19.1.8",
|
|
46
|
+
"@types/react-dom": "19.1.6",
|
|
49
47
|
"@types/uuid": "^10.0.0",
|
|
50
48
|
"browserslist": "^4.25.1",
|
|
51
|
-
"next": "^
|
|
49
|
+
"next": "^15.3.5",
|
|
52
50
|
"prop-types": "^15.8.1",
|
|
53
|
-
"react": "^
|
|
54
|
-
"react-dom": "^
|
|
51
|
+
"react": "^19.1.0",
|
|
52
|
+
"react-dom": "^19.1.0",
|
|
55
53
|
"scheduler": "^0.26.0",
|
|
56
|
-
"
|
|
57
|
-
"tailwindcss": "^3.4.17",
|
|
54
|
+
"tailwindcss": "^4.1.11",
|
|
58
55
|
"typescript": "^5.8.3",
|
|
59
|
-
"update-browserslist-db": "^1.1.3"
|
|
60
|
-
"uuid": "^11.1.0"
|
|
56
|
+
"update-browserslist-db": "^1.1.3"
|
|
61
57
|
},
|
|
62
58
|
"peerDependencies": {
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
"react
|
|
69
|
-
"
|
|
70
|
-
"
|
|
59
|
+
"next": "^15",
|
|
60
|
+
"react": "^19",
|
|
61
|
+
"react-dom": "^19"
|
|
62
|
+
},
|
|
63
|
+
"dependencies": {
|
|
64
|
+
"@headlessui/react": "^2.2.4",
|
|
65
|
+
"@heroicons/react": "^2.2.0",
|
|
66
|
+
"@remkoj/optimizely-graph-client": "^6.0.0-pre1",
|
|
67
|
+
"swr": "^2.3.4",
|
|
68
|
+
"uuid": "^11.1.0"
|
|
71
69
|
},
|
|
72
70
|
"scripts": {
|
|
73
71
|
"clean": "tsc --build --clean",
|
|
74
72
|
"prepare": "tsc --build --force && tailwindcss -i ./src/styles.css -o ./dist/styles.css --minify",
|
|
75
73
|
"watch": "tsc --watch",
|
|
76
74
|
"watch-styles": "tailwindcss -i ./src/styles.css -o ./dist/styles.css --minify --watch",
|
|
75
|
+
"tailwind": "tailwindcss -i ./src/styles.css -o ./dist/styles.css --minify",
|
|
77
76
|
"recompile": "tsc --build --clean && tsc --build --force"
|
|
78
|
-
}
|
|
77
|
+
},
|
|
78
|
+
"stableVersion": "5.1.0"
|
|
79
79
|
}
|