@preprio/prepr-nextjs 1.0.0-beta.8 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -26
- package/dist/components.css +158 -50
- package/dist/components.css.map +1 -1
- package/dist/components.js +197 -99
- package/dist/components.js.map +1 -1
- package/dist/components.mjs +199 -101
- package/dist/components.mjs.map +1 -1
- package/dist/index.d.mts +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.js +40 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +40 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +12 -9
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { NextResponse } from 'next/server'\nimport { headers } from 'next/headers'\n\n/**\n *\n * @param request NextRequest object\n * @param response optional NextResponse object\n */\nexport function PreprMiddleware(request: any, response?: NextResponse) {\n const newResponse = response || NextResponse.next()\n\n const utm_source = request.nextUrl.searchParams.get('utm_source')\n const utm_medium = request.nextUrl.searchParams.get('utm_medium')\n const utm_term = request.nextUrl.searchParams.get('utm_term')\n const utm_content = request.nextUrl.searchParams.get('utm_content')\n const utm_campaign = request.nextUrl.searchParams.get('utm_campaign')\n const initial_referral = request.headers.get('referer')\n\n let cookie = request.cookies.get('__prepr_uid')?.value\n const hutkCookie = request.cookies.get('hubspotutk')?.value\n\n if (utm_source) {\n newResponse.headers.set('Prepr-Context-utm_source', utm_source)\n }\n\n if (utm_medium) {\n newResponse.headers.set('Prepr-Context-utm_medium', utm_medium)\n }\n\n if (utm_term) {\n newResponse.headers.set('Prepr-Context-utm_term', utm_term)\n }\n\n if (utm_content) {\n newResponse.headers.set('Prepr-Context-utm_content', utm_content)\n }\n\n if (utm_campaign) {\n newResponse.headers.set('Prepr-Context-utm_campaign', utm_campaign)\n }\n\n if (hutkCookie) {\n newResponse.headers.set('Prepr-Hubspot-Id', hutkCookie)\n }\n\n if (initial_referral) {\n newResponse.headers.set(\n 'prepr-context-initial_referral',\n initial_referral\n )\n }\n\n if (!cookie) {\n cookie = crypto.randomUUID()\n newResponse.cookies.set('__prepr_uid', cookie, {\n maxAge: 1 * 365 * 24 * 60, // Set for one year\n })\n }\n\n newResponse.headers.set('Prepr-Customer-Id', cookie)\n\n if (process.env.PREPR_ENV === 'preview') {\n newResponse.headers.set('Prepr-Preview-Bar', 'true')\n\n if (request.nextUrl.searchParams.has('prepr_preview_segment')) {\n const segments = request.nextUrl.searchParams.get(\n 'prepr_preview_segment'\n )\n\n if (segments) {\n newResponse.headers.set('Prepr-Segments', segments)\n newResponse.cookies.set('Prepr-Segments', segments, {\n maxAge: 60, // Set for one year\n })\n }\n }\n\n if (request.nextUrl.searchParams.has('prepr_preview_ab')) {\n const ab_testing =\n request.nextUrl.searchParams.get('prepr_preview_ab')\n let value = ab_testing?.toUpperCase()\n if (value === 'B') {\n value = 'B'\n } else {\n value = 'A'\n }\n\n newResponse.headers.set('Prepr-ABtesting', value)\n newResponse.cookies.set('Prepr-ABtesting', value, {\n maxAge: 60, // Set for one year\n })\n }\n\n const segmentCookie = request.cookies.get('Prepr-Segments')?.value\n if (segmentCookie) {\n newResponse.headers.set('Prepr-Segments', segmentCookie)\n }\n\n const abCookie = request.cookies.get('Prepr-ABtesting')?.value\n if (abCookie) {\n newResponse.headers.set('Prepr-ABtesting', abCookie)\n }\n }\n\n return newResponse\n}\n\n/**\n * Returns the Prepr Customer ID from the headers\n */\nexport async function getPreprUUID() {\n const headersList = await headers()\n return headersList.get('prepr-customer-id')\n}\n\n/**\n * Retuns the active segment from the headers\n */\nexport async function getActiveSegment() {\n const headersList = await headers()\n return headersList.get('Prepr-Segments')\n}\n\n/**\n * Returns the active variant from the headers\n */\nexport async function getActiveVariant() {\n const headersList = await headers()\n return headersList.get('Prepr-ABtesting')\n}\n\n/**\n * Helper function to retrieve Prepr headers (will filter out customer ID if in preview mode)\n */\nexport async function getPreprHeaders() {\n let newHeaders: {\n [key: string]: string\n } = {}\n\n const headersList = await headers()\n\n headersList.forEach((value, key) => {\n if (key.startsWith('prepr')) {\n newHeaders[key] = value\n }\n })\n\n return newHeaders\n}\n\nexport type PreprSegment = {\n id: string\n created_on: string\n changed_on: string\n synced_on: string\n label: string\n reference_id: string\n body: string\n query: string\n count: number\n}\n\nexport type PreprSegmentsResponse = {\n total: number\n skip: number\n limit: number\n items: PreprSegment[]\n}\n\n/**\n * Fetches the segments from the Prepr API\n * @param token Prepr access token with scope 'segments'\n * @returns Object with total, skip, limit and items\n */\nexport async function getPreprEnvironmentSegments(\n token: string\n): Promise<PreprSegmentsResponse> {\n const response = await fetch('https://api.eu1.prepr.io/segments', {\n headers: {\n Authorization: `Bearer ${token}`,\n 'User-Agent': 'Prepr-Preview-Bar/1.0',\n },\n })\n\n return response.json()\n}\n\n/**\n * Fetches all the necessary previewbar props\n * @param token Prepr access token with scope 'segments'\n * @returns Object with activeSegment, activeVariant and data\n */\nexport async function getPreviewBarProps(token: string): Promise<{\n activeSegment: string | null\n activeVariant: string | null\n data: PreprSegmentsResponse\n}> {\n const data = await getPreprEnvironmentSegments(token)\n const activeSegment = await getActiveSegment()\n const activeVariant = await getActiveVariant()\n\n return {\n activeSegment,\n activeVariant,\n data,\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA6B;AAC7B,qBAAwB;AAOjB,SAAS,gBAAgB,SAAc,UAAyB;AARvE;AASI,QAAM,cAAc,YAAY,2BAAa,KAAK;AAElD,QAAM,aAAa,QAAQ,QAAQ,aAAa,IAAI,YAAY;AAChE,QAAM,aAAa,QAAQ,QAAQ,aAAa,IAAI,YAAY;AAChE,QAAM,WAAW,QAAQ,QAAQ,aAAa,IAAI,UAAU;AAC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,IAAI,WAAW,OAAO,GAAG;AACzB,mBAAW,GAAG,IAAI;AAAA,MACtB;AAAA,IACJ,CAAC;AAED,WAAO;AAAA,EACX;AAAA;AA0BA,SAAsB,4BAClB,OAC8B;AAAA;AAC9B,UAAM,WAAW,MAAM,MAAM,qCAAqC;AAAA,MAC9D,SAAS;AAAA,QACL,eAAe,UAAU,KAAK;AAAA,QAC9B,cAAc;AAAA,MAClB;AAAA,IACJ,CAAC;AAED,WAAO,SAAS,KAAK;AAAA,EACzB;AAAA;AAOA,SAAsB,mBAAmB,OAItC;AAAA;AACC,UAAM,OAAO,MAAM,4BAA4B,KAAK;AACpD,UAAM,gBAAgB,MAAM,iBAAiB;AAC7C,UAAM,gBAAgB,MAAM,iBAAiB;AAE7C,WAAO;AAAA,MACH;AAAA,MACA;AAAA,MACA;AAAA,IACJ;AAAA,EACJ;AAAA;","names":[]}
|
package/dist/index.mjs
CHANGED
|
@@ -6,9 +6,40 @@ import {
|
|
|
6
6
|
import { NextResponse } from "next/server";
|
|
7
7
|
import { headers } from "next/headers";
|
|
8
8
|
function PreprMiddleware(request, response) {
|
|
9
|
-
var _a, _b, _c;
|
|
9
|
+
var _a, _b, _c, _d;
|
|
10
10
|
const newResponse = response || NextResponse.next();
|
|
11
|
+
const utm_source = request.nextUrl.searchParams.get("utm_source");
|
|
12
|
+
const utm_medium = request.nextUrl.searchParams.get("utm_medium");
|
|
13
|
+
const utm_term = request.nextUrl.searchParams.get("utm_term");
|
|
14
|
+
const utm_content = request.nextUrl.searchParams.get("utm_content");
|
|
15
|
+
const utm_campaign = request.nextUrl.searchParams.get("utm_campaign");
|
|
16
|
+
const initial_referral = request.headers.get("referer");
|
|
11
17
|
let cookie = (_a = request.cookies.get("__prepr_uid")) == null ? void 0 : _a.value;
|
|
18
|
+
const hutkCookie = (_b = request.cookies.get("hubspotutk")) == null ? void 0 : _b.value;
|
|
19
|
+
if (utm_source) {
|
|
20
|
+
newResponse.headers.set("Prepr-Context-utm_source", utm_source);
|
|
21
|
+
}
|
|
22
|
+
if (utm_medium) {
|
|
23
|
+
newResponse.headers.set("Prepr-Context-utm_medium", utm_medium);
|
|
24
|
+
}
|
|
25
|
+
if (utm_term) {
|
|
26
|
+
newResponse.headers.set("Prepr-Context-utm_term", utm_term);
|
|
27
|
+
}
|
|
28
|
+
if (utm_content) {
|
|
29
|
+
newResponse.headers.set("Prepr-Context-utm_content", utm_content);
|
|
30
|
+
}
|
|
31
|
+
if (utm_campaign) {
|
|
32
|
+
newResponse.headers.set("Prepr-Context-utm_campaign", utm_campaign);
|
|
33
|
+
}
|
|
34
|
+
if (hutkCookie) {
|
|
35
|
+
newResponse.headers.set("Prepr-Hubspot-Id", hutkCookie);
|
|
36
|
+
}
|
|
37
|
+
if (initial_referral) {
|
|
38
|
+
newResponse.headers.set(
|
|
39
|
+
"prepr-context-initial_referral",
|
|
40
|
+
initial_referral
|
|
41
|
+
);
|
|
42
|
+
}
|
|
12
43
|
if (!cookie) {
|
|
13
44
|
cookie = crypto.randomUUID();
|
|
14
45
|
newResponse.cookies.set("__prepr_uid", cookie, {
|
|
@@ -19,8 +50,10 @@ function PreprMiddleware(request, response) {
|
|
|
19
50
|
newResponse.headers.set("Prepr-Customer-Id", cookie);
|
|
20
51
|
if (process.env.PREPR_ENV === "preview") {
|
|
21
52
|
newResponse.headers.set("Prepr-Preview-Bar", "true");
|
|
22
|
-
if (request.nextUrl.searchParams.has("
|
|
23
|
-
const segments = request.nextUrl.searchParams.get(
|
|
53
|
+
if (request.nextUrl.searchParams.has("prepr_preview_segment")) {
|
|
54
|
+
const segments = request.nextUrl.searchParams.get(
|
|
55
|
+
"prepr_preview_segment"
|
|
56
|
+
);
|
|
24
57
|
if (segments) {
|
|
25
58
|
newResponse.headers.set("Prepr-Segments", segments);
|
|
26
59
|
newResponse.cookies.set("Prepr-Segments", segments, {
|
|
@@ -29,8 +62,8 @@ function PreprMiddleware(request, response) {
|
|
|
29
62
|
});
|
|
30
63
|
}
|
|
31
64
|
}
|
|
32
|
-
if (request.nextUrl.searchParams.has("
|
|
33
|
-
const ab_testing = request.nextUrl.searchParams.get("
|
|
65
|
+
if (request.nextUrl.searchParams.has("prepr_preview_ab")) {
|
|
66
|
+
const ab_testing = request.nextUrl.searchParams.get("prepr_preview_ab");
|
|
34
67
|
let value = ab_testing == null ? void 0 : ab_testing.toUpperCase();
|
|
35
68
|
if (value === "B") {
|
|
36
69
|
value = "B";
|
|
@@ -43,11 +76,11 @@ function PreprMiddleware(request, response) {
|
|
|
43
76
|
// Set for one year
|
|
44
77
|
});
|
|
45
78
|
}
|
|
46
|
-
const segmentCookie = (
|
|
79
|
+
const segmentCookie = (_c = request.cookies.get("Prepr-Segments")) == null ? void 0 : _c.value;
|
|
47
80
|
if (segmentCookie) {
|
|
48
81
|
newResponse.headers.set("Prepr-Segments", segmentCookie);
|
|
49
82
|
}
|
|
50
|
-
const abCookie = (
|
|
83
|
+
const abCookie = (_d = request.cookies.get("Prepr-ABtesting")) == null ? void 0 : _d.value;
|
|
51
84
|
if (abCookie) {
|
|
52
85
|
newResponse.headers.set("Prepr-ABtesting", abCookie);
|
|
53
86
|
}
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { NextResponse } from 'next/server'\nimport { headers } from 'next/headers'\n\n/**\n *\n * @param request NextRequest object\n * @param response optional NextResponse object\n */\nexport function PreprMiddleware(request: any, response?: NextResponse) {\n const newResponse = response || NextResponse.next()\n\n const utm_source = request.nextUrl.searchParams.get('utm_source')\n const utm_medium = request.nextUrl.searchParams.get('utm_medium')\n const utm_term = request.nextUrl.searchParams.get('utm_term')\n const utm_content = request.nextUrl.searchParams.get('utm_content')\n const utm_campaign = request.nextUrl.searchParams.get('utm_campaign')\n const initial_referral = request.headers.get('referer')\n\n let cookie = request.cookies.get('__prepr_uid')?.value\n const hutkCookie = request.cookies.get('hubspotutk')?.value\n\n if (utm_source) {\n newResponse.headers.set('Prepr-Context-utm_source', utm_source)\n }\n\n if (utm_medium) {\n newResponse.headers.set('Prepr-Context-utm_medium', utm_medium)\n }\n\n if (utm_term) {\n newResponse.headers.set('Prepr-Context-utm_term', utm_term)\n }\n\n if (utm_content) {\n newResponse.headers.set('Prepr-Context-utm_content', utm_content)\n }\n\n if (utm_campaign) {\n newResponse.headers.set('Prepr-Context-utm_campaign', utm_campaign)\n }\n\n if (hutkCookie) {\n newResponse.headers.set('Prepr-Hubspot-Id', hutkCookie)\n }\n\n if (initial_referral) {\n newResponse.headers.set(\n 'prepr-context-initial_referral',\n initial_referral\n )\n }\n\n if (!cookie) {\n cookie = crypto.randomUUID()\n newResponse.cookies.set('__prepr_uid', cookie, {\n maxAge: 1 * 365 * 24 * 60, // Set for one year\n })\n }\n\n newResponse.headers.set('Prepr-Customer-Id', cookie)\n\n if (process.env.PREPR_ENV === 'preview') {\n newResponse.headers.set('Prepr-Preview-Bar', 'true')\n\n if (request.nextUrl.searchParams.has('prepr_preview_segment')) {\n const segments = request.nextUrl.searchParams.get(\n 'prepr_preview_segment'\n )\n\n if (segments) {\n newResponse.headers.set('Prepr-Segments', segments)\n newResponse.cookies.set('Prepr-Segments', segments, {\n maxAge: 60, // Set for one year\n })\n }\n }\n\n if (request.nextUrl.searchParams.has('prepr_preview_ab')) {\n const ab_testing =\n request.nextUrl.searchParams.get('prepr_preview_ab')\n let value = ab_testing?.toUpperCase()\n if (value === 'B') {\n value = 'B'\n } else {\n value = 'A'\n }\n\n newResponse.headers.set('Prepr-ABtesting', value)\n newResponse.cookies.set('Prepr-ABtesting', value, {\n maxAge: 60, // Set for one year\n })\n }\n\n const segmentCookie = request.cookies.get('Prepr-Segments')?.value\n if (segmentCookie) {\n newResponse.headers.set('Prepr-Segments', segmentCookie)\n }\n\n const abCookie = request.cookies.get('Prepr-ABtesting')?.value\n if (abCookie) {\n newResponse.headers.set('Prepr-ABtesting', abCookie)\n }\n }\n\n return newResponse\n}\n\n/**\n * Returns the Prepr Customer ID from the headers\n */\nexport async function getPreprUUID() {\n const headersList = await headers()\n return headersList.get('prepr-customer-id')\n}\n\n/**\n * Retuns the active segment from the headers\n */\nexport async function getActiveSegment() {\n const headersList = await headers()\n return headersList.get('Prepr-Segments')\n}\n\n/**\n * Returns the active variant from the headers\n */\nexport async function getActiveVariant() {\n const headersList = await headers()\n return headersList.get('Prepr-ABtesting')\n}\n\n/**\n * Helper function to retrieve Prepr headers (will filter out customer ID if in preview mode)\n */\nexport async function getPreprHeaders() {\n let newHeaders: {\n [key: string]: string\n } = {}\n\n const headersList = await headers()\n\n headersList.forEach((value, key) => {\n if (key.startsWith('prepr')) {\n newHeaders[key] = value\n }\n })\n\n return newHeaders\n}\n\nexport type PreprSegment = {\n id: string\n created_on: string\n changed_on: string\n synced_on: string\n label: string\n reference_id: string\n body: string\n query: string\n count: number\n}\n\nexport type PreprSegmentsResponse = {\n total: number\n skip: number\n limit: number\n items: PreprSegment[]\n}\n\n/**\n * Fetches the segments from the Prepr API\n * @param token Prepr access token with scope 'segments'\n * @returns Object with total, skip, limit and items\n */\nexport async function getPreprEnvironmentSegments(\n token: string\n): Promise<PreprSegmentsResponse> {\n const response = await fetch('https://api.eu1.prepr.io/segments', {\n headers: {\n Authorization: `Bearer ${token}`,\n 'User-Agent': 'Prepr-Preview-Bar/1.0',\n },\n })\n\n return response.json()\n}\n\n/**\n * Fetches all the necessary previewbar props\n * @param token Prepr access token with scope 'segments'\n * @returns Object with activeSegment, activeVariant and data\n */\nexport async function getPreviewBarProps(token: string): Promise<{\n activeSegment: string | null\n activeVariant: string | null\n data: PreprSegmentsResponse\n}> {\n const data = await getPreprEnvironmentSegments(token)\n const activeSegment = await getActiveSegment()\n const activeVariant = await getActiveVariant()\n\n return {\n activeSegment,\n activeVariant,\n data,\n }\n}\n"],"mappings":";;;;;AAAA,SAAS,oBAAoB;AAC7B,SAAS,eAAe;AAOjB,SAAS,gBAA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AM,cAAc,MAAM,QAAQ;AAClC,WAAO,YAAY,IAAI,iBAAiB;AAAA,EAC5C;AAAA;AAKA,SAAsB,kBAAkB;AAAA;AACpC,QAAI,aAEA,CAAC;AAEL,UAAM,cAAc,MAAM,QAAQ;AAElC,gBAAY,QAAQ,CAAC,OAAO,QAAQ;AAChC,UAAI,IAAI,WAAW,OAAO,GAAG;AACzB,mBAAW,GAAG,IAAI;AAAA,MACtB;AAAA,IACJ,CAAC;AAED,WAAO;AAAA,EACX;AAAA;AA0BA,SAAsB,4BAClB,OAC8B;AAAA;AAC9B,UAAM,WAAW,MAAM,MAAM,qCAAqC;AAAA,MAC9D,SAAS;AAAA,QACL,eAAe,UAAU,KAAK;AAAA,QAC9B,cAAc;AAAA,MAClB;AAAA,IACJ,CAAC;AAED,WAAO,SAAS,KAAK;AAAA,EACzB;AAAA;AAOA,SAAsB,mBAAmB,OAItC;AAAA;AACC,UAAM,OAAO,MAAM,4BAA4B,KAAK;AACpD,UAAM,gBAAgB,MAAM,iBAAiB;AAC7C,UAAM,gBAAgB,MAAM,iBAAiB;AAE7C,WAAO;AAAA,MACH;AAAA,MACA;AAAA,MACA;AAAA,IACJ;AAAA,EACJ;AAAA;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@preprio/prepr-nextjs",
|
|
3
|
-
"version": "1.0.0
|
|
4
|
-
"description": "A next.js package
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "A next.js package containing helper functions and a preview bar to use in combination with Prepr",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"module": "./dist/index.mjs",
|
|
@@ -11,14 +11,14 @@
|
|
|
11
11
|
],
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
14
15
|
"import": "./dist/index.js",
|
|
15
|
-
"require": "./dist/index.js"
|
|
16
|
-
"types": "./dist/index.d.ts"
|
|
16
|
+
"require": "./dist/index.js"
|
|
17
17
|
},
|
|
18
18
|
"./components": {
|
|
19
|
+
"types": "./dist/components.d.ts",
|
|
19
20
|
"import": "./dist/components.js",
|
|
20
|
-
"require": "./dist/components.js"
|
|
21
|
-
"types": "./dist/components.d.ts"
|
|
21
|
+
"require": "./dist/components.js"
|
|
22
22
|
},
|
|
23
23
|
"./dist/components.css": {
|
|
24
24
|
"import": "./dist/components.css",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"build": "tsup",
|
|
34
34
|
"dev": "tsup --watch"
|
|
35
35
|
},
|
|
36
|
-
"author": "",
|
|
36
|
+
"author": "Prepr",
|
|
37
37
|
"license": "ISC",
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/react": "^18.3.3",
|
|
@@ -48,10 +48,13 @@
|
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@headlessui/react": "^2.1.8",
|
|
50
50
|
"classnames": "^2.5.1",
|
|
51
|
-
"
|
|
51
|
+
"clsx": "^2.1.1",
|
|
52
|
+
"micromatch": "^4.0.8",
|
|
53
|
+
"next": "^14.2.10",
|
|
52
54
|
"react": "^18.3.1",
|
|
53
55
|
"react-dom": "^18.3.1",
|
|
54
|
-
"react-icons": "^5.3.0"
|
|
56
|
+
"react-icons": "^5.3.0",
|
|
57
|
+
"rollup": "^4.22.4"
|
|
55
58
|
},
|
|
56
59
|
"repository": {
|
|
57
60
|
"type": "git",
|