@uniformdev/next-app-router 20.72.1 → 20.72.2-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cache.js CHANGED
@@ -1498,6 +1498,17 @@ var RouteClient = class extends ApiClient {
1498
1498
  );
1499
1499
  }
1500
1500
  };
1501
+ var getDataSourceVariantFromRouteGetParams = (params, defaultPreviewState) => {
1502
+ var _a, _b;
1503
+ const dataSourceVariant = (
1504
+ // support explicit 'undefined' as a way to opt out of data resources variant
1505
+ "dataSourceVariant" in params ? params.dataSourceVariant : (
1506
+ // in case of DRAFT state we still want to fetch unpublished data
1507
+ ((_b = (_a = params == null ? void 0 : params.state) != null ? _a : defaultPreviewState) != null ? _b : CANVAS_PUBLISHED_STATE) !== CANVAS_PUBLISHED_STATE ? "unpublished" : void 0
1508
+ )
1509
+ );
1510
+ return dataSourceVariant;
1511
+ };
1501
1512
 
1502
1513
  // src/data/client.ts
1503
1514
  var import_functions = require("@vercel/functions");
@@ -2010,6 +2021,7 @@ var DefaultDataClient = class {
2010
2021
  const originalRoute = {
2011
2022
  path: options.pageState.routePath,
2012
2023
  state: options.pageState.compositionState,
2024
+ dataSourceVariant: getDataSourceVariantFromRouteGetParams({}, options.pageState.compositionState),
2013
2025
  withComponentIDs: true,
2014
2026
  releaseId: options.pageState.releaseId,
2015
2027
  locale: options.pageState.locale,
package/dist/cache.mjs CHANGED
@@ -1485,6 +1485,17 @@ var RouteClient = class extends ApiClient {
1485
1485
  );
1486
1486
  }
1487
1487
  };
1488
+ var getDataSourceVariantFromRouteGetParams = (params, defaultPreviewState) => {
1489
+ var _a, _b;
1490
+ const dataSourceVariant = (
1491
+ // support explicit 'undefined' as a way to opt out of data resources variant
1492
+ "dataSourceVariant" in params ? params.dataSourceVariant : (
1493
+ // in case of DRAFT state we still want to fetch unpublished data
1494
+ ((_b = (_a = params == null ? void 0 : params.state) != null ? _a : defaultPreviewState) != null ? _b : CANVAS_PUBLISHED_STATE) !== CANVAS_PUBLISHED_STATE ? "unpublished" : void 0
1495
+ )
1496
+ );
1497
+ return dataSourceVariant;
1498
+ };
1488
1499
 
1489
1500
  // src/data/client.ts
1490
1501
  import { getCache, waitUntil } from "@vercel/functions";
@@ -1997,6 +2008,7 @@ var DefaultDataClient = class {
1997
2008
  const originalRoute = {
1998
2009
  path: options.pageState.routePath,
1999
2010
  state: options.pageState.compositionState,
2011
+ dataSourceVariant: getDataSourceVariantFromRouteGetParams({}, options.pageState.compositionState),
2000
2012
  withComponentIDs: true,
2001
2013
  releaseId: options.pageState.releaseId,
2002
2014
  locale: options.pageState.locale,
package/dist/index.esm.js CHANGED
@@ -2048,6 +2048,17 @@ var RouteClient = class extends ApiClient {
2048
2048
  );
2049
2049
  }
2050
2050
  };
2051
+ var getDataSourceVariantFromRouteGetParams = (params, defaultPreviewState) => {
2052
+ var _a, _b;
2053
+ const dataSourceVariant = (
2054
+ // support explicit 'undefined' as a way to opt out of data resources variant
2055
+ "dataSourceVariant" in params ? params.dataSourceVariant : (
2056
+ // in case of DRAFT state we still want to fetch unpublished data
2057
+ ((_b = (_a = params == null ? void 0 : params.state) != null ? _a : defaultPreviewState) != null ? _b : CANVAS_PUBLISHED_STATE) !== CANVAS_PUBLISHED_STATE ? "unpublished" : void 0
2058
+ )
2059
+ );
2060
+ return dataSourceVariant;
2061
+ };
2051
2062
  function mapSlotToPersonalizedVariations(slot) {
2052
2063
  if (!slot) return [];
2053
2064
  return slot.map((v, i) => {
@@ -3926,6 +3937,7 @@ var DefaultDataClient = class {
3926
3937
  const originalRoute = {
3927
3938
  path: options.pageState.routePath,
3928
3939
  state: options.pageState.compositionState,
3940
+ dataSourceVariant: getDataSourceVariantFromRouteGetParams({}, options.pageState.compositionState),
3929
3941
  withComponentIDs: true,
3930
3942
  releaseId: options.pageState.releaseId,
3931
3943
  locale: options.pageState.locale,
package/dist/index.js CHANGED
@@ -2075,6 +2075,17 @@ var RouteClient = class extends ApiClient {
2075
2075
  );
2076
2076
  }
2077
2077
  };
2078
+ var getDataSourceVariantFromRouteGetParams = (params, defaultPreviewState) => {
2079
+ var _a, _b;
2080
+ const dataSourceVariant = (
2081
+ // support explicit 'undefined' as a way to opt out of data resources variant
2082
+ "dataSourceVariant" in params ? params.dataSourceVariant : (
2083
+ // in case of DRAFT state we still want to fetch unpublished data
2084
+ ((_b = (_a = params == null ? void 0 : params.state) != null ? _a : defaultPreviewState) != null ? _b : CANVAS_PUBLISHED_STATE) !== CANVAS_PUBLISHED_STATE ? "unpublished" : void 0
2085
+ )
2086
+ );
2087
+ return dataSourceVariant;
2088
+ };
2078
2089
  function mapSlotToPersonalizedVariations(slot) {
2079
2090
  if (!slot) return [];
2080
2091
  return slot.map((v, i) => {
@@ -3947,6 +3958,7 @@ var DefaultDataClient = class {
3947
3958
  const originalRoute = {
3948
3959
  path: options.pageState.routePath,
3949
3960
  state: options.pageState.compositionState,
3961
+ dataSourceVariant: getDataSourceVariantFromRouteGetParams({}, options.pageState.compositionState),
3950
3962
  withComponentIDs: true,
3951
3963
  releaseId: options.pageState.releaseId,
3952
3964
  locale: options.pageState.locale,
package/dist/index.mjs CHANGED
@@ -2048,6 +2048,17 @@ var RouteClient = class extends ApiClient {
2048
2048
  );
2049
2049
  }
2050
2050
  };
2051
+ var getDataSourceVariantFromRouteGetParams = (params, defaultPreviewState) => {
2052
+ var _a, _b;
2053
+ const dataSourceVariant = (
2054
+ // support explicit 'undefined' as a way to opt out of data resources variant
2055
+ "dataSourceVariant" in params ? params.dataSourceVariant : (
2056
+ // in case of DRAFT state we still want to fetch unpublished data
2057
+ ((_b = (_a = params == null ? void 0 : params.state) != null ? _a : defaultPreviewState) != null ? _b : CANVAS_PUBLISHED_STATE) !== CANVAS_PUBLISHED_STATE ? "unpublished" : void 0
2058
+ )
2059
+ );
2060
+ return dataSourceVariant;
2061
+ };
2051
2062
  function mapSlotToPersonalizedVariations(slot) {
2052
2063
  if (!slot) return [];
2053
2064
  return slot.map((v, i) => {
@@ -3926,6 +3937,7 @@ var DefaultDataClient = class {
3926
3937
  const originalRoute = {
3927
3938
  path: options.pageState.routePath,
3928
3939
  state: options.pageState.compositionState,
3940
+ dataSourceVariant: getDataSourceVariantFromRouteGetParams({}, options.pageState.compositionState),
3929
3941
  withComponentIDs: true,
3930
3942
  releaseId: options.pageState.releaseId,
3931
3943
  locale: options.pageState.locale,
@@ -3027,6 +3027,7 @@ var DefaultDataClient = class {
3027
3027
  const originalRoute = {
3028
3028
  path: options.pageState.routePath,
3029
3029
  state: options.pageState.compositionState,
3030
+ dataSourceVariant: getDataSourceVariantFromRouteGetParams({}, options.pageState.compositionState),
3030
3031
  withComponentIDs: true,
3031
3032
  releaseId: options.pageState.releaseId,
3032
3033
  locale: options.pageState.locale,
@@ -3014,6 +3014,7 @@ var DefaultDataClient = class {
3014
3014
  const originalRoute = {
3015
3015
  path: options.pageState.routePath,
3016
3016
  state: options.pageState.compositionState,
3017
+ dataSourceVariant: getDataSourceVariantFromRouteGetParams({}, options.pageState.compositionState),
3017
3018
  withComponentIDs: true,
3018
3019
  releaseId: options.pageState.releaseId,
3019
3020
  locale: options.pageState.locale,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/next-app-router",
3
- "version": "20.72.1",
3
+ "version": "20.72.2-alpha.3+a1f072e7b4",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "scripts": {
6
6
  "build": "tsup",
@@ -98,12 +98,12 @@
98
98
  "vitest": "4.1.9"
99
99
  },
100
100
  "dependencies": {
101
- "@uniformdev/canvas-react": "20.72.1",
102
- "@uniformdev/next-app-router-client": "20.72.1",
103
- "@uniformdev/next-app-router-shared": "20.72.1",
104
- "@uniformdev/redirect": "20.72.1",
105
- "@uniformdev/richtext": "20.72.1",
106
- "@uniformdev/webhooks": "20.72.1",
101
+ "@uniformdev/canvas-react": "20.72.2-alpha.3+a1f072e7b4",
102
+ "@uniformdev/next-app-router-client": "20.72.2-alpha.3+a1f072e7b4",
103
+ "@uniformdev/next-app-router-shared": "20.72.2-alpha.3+a1f072e7b4",
104
+ "@uniformdev/redirect": "20.72.2-alpha.3+a1f072e7b4",
105
+ "@uniformdev/richtext": "20.72.2-alpha.3+a1f072e7b4",
106
+ "@uniformdev/webhooks": "20.72.2-alpha.3+a1f072e7b4",
107
107
  "@vercel/functions": "^3.7.2",
108
108
  "encoding": "^0.1.13",
109
109
  "server-only": "^0.0.1",
@@ -120,5 +120,5 @@
120
120
  "publishConfig": {
121
121
  "access": "public"
122
122
  },
123
- "gitHead": "bff8f45027258b16690597b05c88e148f2ffde96"
123
+ "gitHead": "a1f072e7b42ac4b3c694ebdd2e75216efd74a9c2"
124
124
  }