@preprio/toolkit 0.6.0-alpha.5 → 0.6.0-alpha.6

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.
@@ -1,5 +1,5 @@
1
1
  // src/version.ts
2
- var VERSION = "0.6.0-alpha.5";
2
+ var VERSION = "0.6.0-alpha.6";
3
3
 
4
4
  // src/core/features.ts
5
5
  function isEnabled(config) {
@@ -3,7 +3,7 @@ import {
3
3
  getPreprHeadersFromHeaders,
4
4
  isPersonalizedResponse,
5
5
  validatePreprToken
6
- } from "./chunk-CD4LXNR3.js";
6
+ } from "./chunk-MWRA3732.js";
7
7
 
8
8
  // src/core/variants/constants.ts
9
9
  var PREPR_CONTEXT_ALIAS = "_preprContext";
@@ -31,7 +31,7 @@ __export(astro_exports, {
31
31
  module.exports = __toCommonJS(astro_exports);
32
32
 
33
33
  // src/version.ts
34
- var VERSION = "0.6.0-alpha.5";
34
+ var VERSION = "0.6.0-alpha.6";
35
35
 
36
36
  // src/core/features.ts
37
37
  function isEnabled(config) {
@@ -7,7 +7,7 @@ import {
7
7
  getToolbarPropsFromHeaders,
8
8
  isPersonalizedResponse,
9
9
  resolveFeatures
10
- } from "./chunk-CD4LXNR3.js";
10
+ } from "./chunk-MWRA3732.js";
11
11
 
12
12
  // src/core/constants.ts
13
13
  var COOKIE_PREVIEW_MODE = "Prepr-Preview-Mode";
@@ -1,5 +1,5 @@
1
1
  // src/version.ts
2
- var VERSION = "0.6.0-alpha.5";
2
+ var VERSION = "0.6.0-alpha.6";
3
3
 
4
4
  // src/core/features.ts
5
5
  function isEnabled(config) {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  VERSION,
3
3
  resolveFeatures
4
- } from "./chunk-OH2PPC76.js";
4
+ } from "./chunk-NSQOGI5K.js";
5
5
 
6
6
  // src/core/server.ts
7
7
  var PreprError = class extends Error {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  PreprError
3
- } from "./chunk-5O7RGYHX.js";
3
+ } from "./chunk-OQGEL4TV.js";
4
4
 
5
5
  // src/core/variants/constants.ts
6
6
  var PREPR_CONTEXT_ALIAS = "_preprContext";
@@ -11,7 +11,7 @@ import {
11
11
  ALL_FEATURES_ENABLED,
12
12
  VERSION,
13
13
  resolveFeatures
14
- } from "./chunk-OH2PPC76.js";
14
+ } from "./chunk-NSQOGI5K.js";
15
15
 
16
16
  // src/core/stega/dom.ts
17
17
  var IGNORED_ANCESTORS = "script, style, noscript";
@@ -2,9 +2,9 @@ import {
2
2
  toDecisionQuery,
3
3
  toSchemaInfo,
4
4
  toVariantsQuery
5
- } from "../chunk-ZWKHACNA.js";
6
- import "../chunk-5O7RGYHX.js";
7
- import "../chunk-OH2PPC76.js";
5
+ } from "../chunk-W6AVX6FI.js";
6
+ import "../chunk-OQGEL4TV.js";
7
+ import "../chunk-NSQOGI5K.js";
8
8
 
9
9
  // src/codegen/index.ts
10
10
  function typeRef(type) {
package/dist/graphql.js CHANGED
@@ -21,12 +21,12 @@ import {
21
21
  toSchemaInfo,
22
22
  toVariantsDocument,
23
23
  toVariantsQuery
24
- } from "./chunk-ZWKHACNA.js";
24
+ } from "./chunk-W6AVX6FI.js";
25
25
  import {
26
26
  PreprError,
27
27
  validatePreprToken
28
- } from "./chunk-5O7RGYHX.js";
29
- import "./chunk-OH2PPC76.js";
28
+ } from "./chunk-OQGEL4TV.js";
29
+ import "./chunk-NSQOGI5K.js";
30
30
 
31
31
  // src/core/variants/probe-document.ts
32
32
  function probeSelectionSet(set, fragments) {
package/dist/index.cjs CHANGED
@@ -45,7 +45,7 @@ __export(src_exports, {
45
45
  module.exports = __toCommonJS(src_exports);
46
46
 
47
47
  // src/version.ts
48
- var VERSION = "0.6.0-alpha.5";
48
+ var VERSION = "0.6.0-alpha.6";
49
49
 
50
50
  // src/core/features.ts
51
51
  function isEnabled(config) {
package/dist/index.d.cts CHANGED
@@ -7,7 +7,7 @@ export { P as PreprPixelConfig, l as loadTrackingPixel, s as setTrackingParam, t
7
7
  * Package version; must match package.json. Lives in its own leaf module so
8
8
  * core can import it without cycling through the barrel.
9
9
  */
10
- declare const VERSION = "0.6.0-alpha.5";
10
+ declare const VERSION = "0.6.0-alpha.6";
11
11
 
12
12
  /**
13
13
  * Resolve a `PreprFeatures` bag to plain booleans, defaulting every omitted key
package/dist/index.d.ts CHANGED
@@ -7,7 +7,7 @@ export { P as PreprPixelConfig, l as loadTrackingPixel, s as setTrackingParam, t
7
7
  * Package version; must match package.json. Lives in its own leaf module so
8
8
  * core can import it without cycling through the barrel.
9
9
  */
10
- declare const VERSION = "0.6.0-alpha.5";
10
+ declare const VERSION = "0.6.0-alpha.6";
11
11
 
12
12
  /**
13
13
  * Resolve a `PreprFeatures` bag to plain booleans, defaulting every omitted key
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@ import {
15
15
  loadTrackingPixel,
16
16
  setTrackingParam,
17
17
  trackEvent
18
- } from "./chunk-HPWTLDLR.js";
18
+ } from "./chunk-Y7DWVOOY.js";
19
19
  import {
20
20
  isPersonalizedResponse
21
21
  } from "./chunk-3NCEVJJ3.js";
@@ -32,11 +32,11 @@ import {
32
32
  getPreprUUIDFromHeaders,
33
33
  getToolbarPropsFromHeaders,
34
34
  validatePreprToken
35
- } from "./chunk-5O7RGYHX.js";
35
+ } from "./chunk-OQGEL4TV.js";
36
36
  import {
37
37
  VERSION,
38
38
  resolveFeatures
39
- } from "./chunk-OH2PPC76.js";
39
+ } from "./chunk-NSQOGI5K.js";
40
40
 
41
41
  // src/core/middleware.ts
42
42
  var UTM_PARAMS = [
@@ -2,7 +2,7 @@
2
2
  import { NextResponse } from "next/server";
3
3
 
4
4
  // src/version.ts
5
- var VERSION = "0.6.0-alpha.5";
5
+ var VERSION = "0.6.0-alpha.6";
6
6
 
7
7
  // src/core/constants.ts
8
8
  var COOKIE_PREVIEW_MODE = "Prepr-Preview-Mode";
@@ -2513,7 +2513,7 @@ function applyPreprDecisions(view) {
2513
2513
  var import_react = require("react");
2514
2514
 
2515
2515
  // src/version.ts
2516
- var VERSION = "0.6.0-alpha.5";
2516
+ var VERSION = "0.6.0-alpha.6";
2517
2517
 
2518
2518
  // src/core/pixel.ts
2519
2519
  var PIXEL_SCRIPT_URL = "https://cdn.tracking.prepr.io/js/prepr.min.js";
@@ -2,9 +2,9 @@
2
2
  import {
3
3
  createPreprPreview,
4
4
  loadTrackingPixel
5
- } from "../chunk-HPWTLDLR.js";
5
+ } from "../chunk-Y7DWVOOY.js";
6
6
  import "../chunk-S5RWVMDJ.js";
7
- import "../chunk-OH2PPC76.js";
7
+ import "../chunk-NSQOGI5K.js";
8
8
 
9
9
  // src/nextjs/components.ts
10
10
  import { usePathname, useRouter } from "next/navigation";
@@ -38,7 +38,7 @@ __export(graphql_exports, {
38
38
  module.exports = __toCommonJS(graphql_exports);
39
39
 
40
40
  // src/version.ts
41
- var VERSION = "0.6.0-alpha.5";
41
+ var VERSION = "0.6.0-alpha.6";
42
42
 
43
43
  // src/core/features.ts
44
44
  function isEnabled(config) {
@@ -1552,7 +1552,8 @@ function createPreprProxy(options) {
1552
1552
  parseRefreshPaths(request.headers.get(PREPR_REFRESH_HEADER))
1553
1553
  );
1554
1554
  }
1555
- const target = isPagePath(request.nextUrl.pathname) ? lookup(request.nextUrl) : null;
1555
+ const rendersPage = (request.method === "GET" || request.method === "HEAD") && isPagePath(request.nextUrl.pathname);
1556
+ const target = rendersPage ? lookup(request.nextUrl) : null;
1556
1557
  if (target && preview) {
1557
1558
  const draft = preprDraftRedirect(request, { preview });
1558
1559
  if (draft) return draft;
@@ -7,7 +7,7 @@ import {
7
7
  preprDraftRedirect,
8
8
  resolvePreprBucket,
9
9
  validatePreprToken
10
- } from "./chunk-L4L6X3JJ.js";
10
+ } from "./chunk-PIQF5ZI5.js";
11
11
 
12
12
  // src/core/variants/constants.ts
13
13
  var PREPR_CONTEXT_ALIAS = "_preprContext";
@@ -1143,7 +1143,8 @@ function createPreprProxy(options) {
1143
1143
  parseRefreshPaths(request.headers.get(PREPR_REFRESH_HEADER))
1144
1144
  );
1145
1145
  }
1146
- const target = isPagePath(request.nextUrl.pathname) ? lookup(request.nextUrl) : null;
1146
+ const rendersPage = (request.method === "GET" || request.method === "HEAD") && isPagePath(request.nextUrl.pathname);
1147
+ const target = rendersPage ? lookup(request.nextUrl) : null;
1147
1148
  if (target && preview) {
1148
1149
  const draft = preprDraftRedirect(request, { preview });
1149
1150
  if (draft) return draft;
@@ -44,7 +44,7 @@ module.exports = __toCommonJS(nextjs_exports);
44
44
  var import_server = require("next/server");
45
45
 
46
46
  // src/version.ts
47
- var VERSION = "0.6.0-alpha.5";
47
+ var VERSION = "0.6.0-alpha.6";
48
48
 
49
49
  // src/core/constants.ts
50
50
  var COOKIE_PREVIEW_MODE = "Prepr-Preview-Mode";
@@ -13,7 +13,7 @@ import {
13
13
  preprDraftRedirect,
14
14
  resolvePreprBucket,
15
15
  validatePreprToken
16
- } from "./chunk-L4L6X3JJ.js";
16
+ } from "./chunk-PIQF5ZI5.js";
17
17
 
18
18
  // src/nextjs/index.ts
19
19
  import {
@@ -1,5 +1,5 @@
1
1
  // src/version.ts
2
- var VERSION = "0.6.0-alpha.5";
2
+ var VERSION = "0.6.0-alpha.6";
3
3
 
4
4
  // src/core/constants.ts
5
5
  var COOKIE_PREVIEW_MODE = "Prepr-Preview-Mode";
@@ -4,7 +4,7 @@ import {
4
4
  getPreprHeadersFromHeaders,
5
5
  isPersonalizedResponse,
6
6
  validatePreprToken
7
- } from "./chunk-PJZMLKJ2.js";
7
+ } from "./chunk-PF6GVWHV.js";
8
8
 
9
9
  // src/core/variants/constants.ts
10
10
  var PREPR_CONTEXT_ALIAS = "_preprContext";
@@ -36,7 +36,7 @@ __export(nuxt_exports, {
36
36
  module.exports = __toCommonJS(nuxt_exports);
37
37
 
38
38
  // src/version.ts
39
- var VERSION = "0.6.0-alpha.5";
39
+ var VERSION = "0.6.0-alpha.6";
40
40
 
41
41
  // src/core/constants.ts
42
42
  var COOKIE_PREVIEW_MODE = "Prepr-Preview-Mode";
@@ -11,7 +11,7 @@ import {
11
11
  handlePreprRequest,
12
12
  isPersonalizedResponse,
13
13
  validatePreprToken
14
- } from "./chunk-PJZMLKJ2.js";
14
+ } from "./chunk-PF6GVWHV.js";
15
15
 
16
16
  // src/nuxt/server.ts
17
17
  function getPreprUUID(headers) {
@@ -2313,7 +2313,7 @@ function isReactHydrated(text) {
2313
2313
  }
2314
2314
 
2315
2315
  // src/version.ts
2316
- var VERSION = "0.6.0-alpha.5";
2316
+ var VERSION = "0.6.0-alpha.6";
2317
2317
 
2318
2318
  // src/core/pixel.ts
2319
2319
  var PIXEL_SCRIPT_URL = "https://cdn.tracking.prepr.io/js/prepr.min.js";
@@ -2289,7 +2289,7 @@ function isReactHydrated(text) {
2289
2289
  }
2290
2290
 
2291
2291
  // src/version.ts
2292
- var VERSION = "0.6.0-alpha.5";
2292
+ var VERSION = "0.6.0-alpha.6";
2293
2293
 
2294
2294
  // src/core/pixel.ts
2295
2295
  var PIXEL_SCRIPT_URL = "https://cdn.tracking.prepr.io/js/prepr.min.js";
@@ -1,5 +1,5 @@
1
1
  // src/version.ts
2
- var VERSION = "0.6.0-alpha.5";
2
+ var VERSION = "0.6.0-alpha.6";
3
3
 
4
4
  // src/core/constants.ts
5
5
  var COOKIE_PREVIEW_MODE = "Prepr-Preview-Mode";
@@ -4,7 +4,7 @@ import {
4
4
  getPreprHeadersFromLocals,
5
5
  isPersonalizedResponse,
6
6
  validatePreprToken
7
- } from "./chunk-SKBW7RBD.js";
7
+ } from "./chunk-5K7HWMIF.js";
8
8
 
9
9
  // src/core/variants/constants.ts
10
10
  var PREPR_CONTEXT_ALIAS = "_preprContext";
@@ -36,7 +36,7 @@ __export(sveltekit_exports, {
36
36
  module.exports = __toCommonJS(sveltekit_exports);
37
37
 
38
38
  // src/version.ts
39
- var VERSION = "0.6.0-alpha.5";
39
+ var VERSION = "0.6.0-alpha.6";
40
40
 
41
41
  // src/core/constants.ts
42
42
  var COOKIE_PREVIEW_MODE = "Prepr-Preview-Mode";
@@ -11,7 +11,7 @@ import {
11
11
  isPersonalizedResponse,
12
12
  preprHandle,
13
13
  validatePreprToken
14
- } from "./chunk-SKBW7RBD.js";
14
+ } from "./chunk-5K7HWMIF.js";
15
15
 
16
16
  // src/sveltekit/server.ts
17
17
  function getPreprUUID(headers) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@preprio/toolkit",
3
- "version": "0.6.0-alpha.5",
3
+ "version": "0.6.0-alpha.6",
4
4
  "description": "Prepr personalization, A/B testing and preview toolkit for React, Next.js, Nuxt, Astro, SvelteKit and Express",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Prepr B.V. (https://prepr.io)",