@uniformdev/next-app-router 20.71.2-alpha.7 → 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
@@ -1226,6 +1226,9 @@ function projectionToQuery(spec) {
1226
1226
  appendCsv(out, `${p}fields[only]`, fields.only);
1227
1227
  appendCsv(out, `${p}fields[except]`, fields.except);
1228
1228
  appendCsv(out, `${p}fields[locales]`, fields.locales);
1229
+ if (fields.blockDepth === "preserveAll" || typeof fields.blockDepth === "number") {
1230
+ out[`${p}fields[blockDepth]`] = String(fields.blockDepth);
1231
+ }
1229
1232
  }
1230
1233
  if (fieldTypes) {
1231
1234
  appendCsv(out, `${p}fieldTypes[only]`, fieldTypes.only);
@@ -1495,6 +1498,17 @@ var RouteClient = class extends ApiClient {
1495
1498
  );
1496
1499
  }
1497
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
+ };
1498
1512
 
1499
1513
  // src/data/client.ts
1500
1514
  var import_functions = require("@vercel/functions");
@@ -2007,6 +2021,7 @@ var DefaultDataClient = class {
2007
2021
  const originalRoute = {
2008
2022
  path: options.pageState.routePath,
2009
2023
  state: options.pageState.compositionState,
2024
+ dataSourceVariant: getDataSourceVariantFromRouteGetParams({}, options.pageState.compositionState),
2010
2025
  withComponentIDs: true,
2011
2026
  releaseId: options.pageState.releaseId,
2012
2027
  locale: options.pageState.locale,
package/dist/cache.mjs CHANGED
@@ -1213,6 +1213,9 @@ function projectionToQuery(spec) {
1213
1213
  appendCsv(out, `${p}fields[only]`, fields.only);
1214
1214
  appendCsv(out, `${p}fields[except]`, fields.except);
1215
1215
  appendCsv(out, `${p}fields[locales]`, fields.locales);
1216
+ if (fields.blockDepth === "preserveAll" || typeof fields.blockDepth === "number") {
1217
+ out[`${p}fields[blockDepth]`] = String(fields.blockDepth);
1218
+ }
1216
1219
  }
1217
1220
  if (fieldTypes) {
1218
1221
  appendCsv(out, `${p}fieldTypes[only]`, fieldTypes.only);
@@ -1482,6 +1485,17 @@ var RouteClient = class extends ApiClient {
1482
1485
  );
1483
1486
  }
1484
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
+ };
1485
1499
 
1486
1500
  // src/data/client.ts
1487
1501
  import { getCache, waitUntil } from "@vercel/functions";
@@ -1994,6 +2008,7 @@ var DefaultDataClient = class {
1994
2008
  const originalRoute = {
1995
2009
  path: options.pageState.routePath,
1996
2010
  state: options.pageState.compositionState,
2011
+ dataSourceVariant: getDataSourceVariantFromRouteGetParams({}, options.pageState.compositionState),
1997
2012
  withComponentIDs: true,
1998
2013
  releaseId: options.pageState.releaseId,
1999
2014
  locale: options.pageState.locale,
package/dist/component.js CHANGED
@@ -648,6 +648,9 @@ function projectionToQuery(spec) {
648
648
  appendCsv(out, `${p}fields[only]`, fields.only);
649
649
  appendCsv(out, `${p}fields[except]`, fields.except);
650
650
  appendCsv(out, `${p}fields[locales]`, fields.locales);
651
+ if (fields.blockDepth === "preserveAll" || typeof fields.blockDepth === "number") {
652
+ out[`${p}fields[blockDepth]`] = String(fields.blockDepth);
653
+ }
651
654
  }
652
655
  if (fieldTypes) {
653
656
  appendCsv(out, `${p}fieldTypes[only]`, fieldTypes.only);
@@ -633,6 +633,9 @@ function projectionToQuery(spec) {
633
633
  appendCsv(out, `${p}fields[only]`, fields.only);
634
634
  appendCsv(out, `${p}fields[except]`, fields.except);
635
635
  appendCsv(out, `${p}fields[locales]`, fields.locales);
636
+ if (fields.blockDepth === "preserveAll" || typeof fields.blockDepth === "number") {
637
+ out[`${p}fields[blockDepth]`] = String(fields.blockDepth);
638
+ }
636
639
  }
637
640
  if (fieldTypes) {
638
641
  appendCsv(out, `${p}fieldTypes[only]`, fieldTypes.only);
package/dist/handler.js CHANGED
@@ -1224,6 +1224,9 @@ function projectionToQuery(spec) {
1224
1224
  appendCsv(out, `${p}fields[only]`, fields.only);
1225
1225
  appendCsv(out, `${p}fields[except]`, fields.except);
1226
1226
  appendCsv(out, `${p}fields[locales]`, fields.locales);
1227
+ if (fields.blockDepth === "preserveAll" || typeof fields.blockDepth === "number") {
1228
+ out[`${p}fields[blockDepth]`] = String(fields.blockDepth);
1229
+ }
1227
1230
  }
1228
1231
  if (fieldTypes) {
1229
1232
  appendCsv(out, `${p}fieldTypes[only]`, fieldTypes.only);
package/dist/handler.mjs CHANGED
@@ -1209,6 +1209,9 @@ function projectionToQuery(spec) {
1209
1209
  appendCsv(out, `${p}fields[only]`, fields.only);
1210
1210
  appendCsv(out, `${p}fields[except]`, fields.except);
1211
1211
  appendCsv(out, `${p}fields[locales]`, fields.locales);
1212
+ if (fields.blockDepth === "preserveAll" || typeof fields.blockDepth === "number") {
1213
+ out[`${p}fields[blockDepth]`] = String(fields.blockDepth);
1214
+ }
1212
1215
  }
1213
1216
  if (fieldTypes) {
1214
1217
  appendCsv(out, `${p}fieldTypes[only]`, fieldTypes.only);
package/dist/index.esm.js CHANGED
@@ -1216,6 +1216,9 @@ function projectionToQuery(spec) {
1216
1216
  appendCsv(out, `${p}fields[only]`, fields.only);
1217
1217
  appendCsv(out, `${p}fields[except]`, fields.except);
1218
1218
  appendCsv(out, `${p}fields[locales]`, fields.locales);
1219
+ if (fields.blockDepth === "preserveAll" || typeof fields.blockDepth === "number") {
1220
+ out[`${p}fields[blockDepth]`] = String(fields.blockDepth);
1221
+ }
1219
1222
  }
1220
1223
  if (fieldTypes) {
1221
1224
  appendCsv(out, `${p}fieldTypes[only]`, fieldTypes.only);
@@ -2045,6 +2048,17 @@ var RouteClient = class extends ApiClient {
2045
2048
  );
2046
2049
  }
2047
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
+ };
2048
2062
  function mapSlotToPersonalizedVariations(slot) {
2049
2063
  if (!slot) return [];
2050
2064
  return slot.map((v, i) => {
@@ -3923,6 +3937,7 @@ var DefaultDataClient = class {
3923
3937
  const originalRoute = {
3924
3938
  path: options.pageState.routePath,
3925
3939
  state: options.pageState.compositionState,
3940
+ dataSourceVariant: getDataSourceVariantFromRouteGetParams({}, options.pageState.compositionState),
3926
3941
  withComponentIDs: true,
3927
3942
  releaseId: options.pageState.releaseId,
3928
3943
  locale: options.pageState.locale,
package/dist/index.js CHANGED
@@ -1243,6 +1243,9 @@ function projectionToQuery(spec) {
1243
1243
  appendCsv(out, `${p}fields[only]`, fields.only);
1244
1244
  appendCsv(out, `${p}fields[except]`, fields.except);
1245
1245
  appendCsv(out, `${p}fields[locales]`, fields.locales);
1246
+ if (fields.blockDepth === "preserveAll" || typeof fields.blockDepth === "number") {
1247
+ out[`${p}fields[blockDepth]`] = String(fields.blockDepth);
1248
+ }
1246
1249
  }
1247
1250
  if (fieldTypes) {
1248
1251
  appendCsv(out, `${p}fieldTypes[only]`, fieldTypes.only);
@@ -2072,6 +2075,17 @@ var RouteClient = class extends ApiClient {
2072
2075
  );
2073
2076
  }
2074
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
+ };
2075
2089
  function mapSlotToPersonalizedVariations(slot) {
2076
2090
  if (!slot) return [];
2077
2091
  return slot.map((v, i) => {
@@ -3944,6 +3958,7 @@ var DefaultDataClient = class {
3944
3958
  const originalRoute = {
3945
3959
  path: options.pageState.routePath,
3946
3960
  state: options.pageState.compositionState,
3961
+ dataSourceVariant: getDataSourceVariantFromRouteGetParams({}, options.pageState.compositionState),
3947
3962
  withComponentIDs: true,
3948
3963
  releaseId: options.pageState.releaseId,
3949
3964
  locale: options.pageState.locale,
package/dist/index.mjs CHANGED
@@ -1216,6 +1216,9 @@ function projectionToQuery(spec) {
1216
1216
  appendCsv(out, `${p}fields[only]`, fields.only);
1217
1217
  appendCsv(out, `${p}fields[except]`, fields.except);
1218
1218
  appendCsv(out, `${p}fields[locales]`, fields.locales);
1219
+ if (fields.blockDepth === "preserveAll" || typeof fields.blockDepth === "number") {
1220
+ out[`${p}fields[blockDepth]`] = String(fields.blockDepth);
1221
+ }
1219
1222
  }
1220
1223
  if (fieldTypes) {
1221
1224
  appendCsv(out, `${p}fieldTypes[only]`, fieldTypes.only);
@@ -2045,6 +2048,17 @@ var RouteClient = class extends ApiClient {
2045
2048
  );
2046
2049
  }
2047
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
+ };
2048
2062
  function mapSlotToPersonalizedVariations(slot) {
2049
2063
  if (!slot) return [];
2050
2064
  return slot.map((v, i) => {
@@ -3923,6 +3937,7 @@ var DefaultDataClient = class {
3923
3937
  const originalRoute = {
3924
3938
  path: options.pageState.routePath,
3925
3939
  state: options.pageState.compositionState,
3940
+ dataSourceVariant: getDataSourceVariantFromRouteGetParams({}, options.pageState.compositionState),
3926
3941
  withComponentIDs: true,
3927
3942
  releaseId: options.pageState.releaseId,
3928
3943
  locale: options.pageState.locale,
@@ -1414,6 +1414,9 @@ function projectionToQuery(spec) {
1414
1414
  appendCsv(out, `${p}fields[only]`, fields.only);
1415
1415
  appendCsv(out, `${p}fields[except]`, fields.except);
1416
1416
  appendCsv(out, `${p}fields[locales]`, fields.locales);
1417
+ if (fields.blockDepth === "preserveAll" || typeof fields.blockDepth === "number") {
1418
+ out[`${p}fields[blockDepth]`] = String(fields.blockDepth);
1419
+ }
1417
1420
  }
1418
1421
  if (fieldTypes) {
1419
1422
  appendCsv(out, `${p}fieldTypes[only]`, fieldTypes.only);
@@ -3024,6 +3027,7 @@ var DefaultDataClient = class {
3024
3027
  const originalRoute = {
3025
3028
  path: options.pageState.routePath,
3026
3029
  state: options.pageState.compositionState,
3030
+ dataSourceVariant: getDataSourceVariantFromRouteGetParams({}, options.pageState.compositionState),
3027
3031
  withComponentIDs: true,
3028
3032
  releaseId: options.pageState.releaseId,
3029
3033
  locale: options.pageState.locale,
@@ -1399,6 +1399,9 @@ function projectionToQuery(spec) {
1399
1399
  appendCsv(out, `${p}fields[only]`, fields.only);
1400
1400
  appendCsv(out, `${p}fields[except]`, fields.except);
1401
1401
  appendCsv(out, `${p}fields[locales]`, fields.locales);
1402
+ if (fields.blockDepth === "preserveAll" || typeof fields.blockDepth === "number") {
1403
+ out[`${p}fields[blockDepth]`] = String(fields.blockDepth);
1404
+ }
1402
1405
  }
1403
1406
  if (fieldTypes) {
1404
1407
  appendCsv(out, `${p}fieldTypes[only]`, fieldTypes.only);
@@ -3011,6 +3014,7 @@ var DefaultDataClient = class {
3011
3014
  const originalRoute = {
3012
3015
  path: options.pageState.routePath,
3013
3016
  state: options.pageState.compositionState,
3017
+ dataSourceVariant: getDataSourceVariantFromRouteGetParams({}, options.pageState.compositionState),
3014
3018
  withComponentIDs: true,
3015
3019
  releaseId: options.pageState.releaseId,
3016
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.71.2-alpha.7+2ec20a4ae2",
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.71.2-alpha.7+2ec20a4ae2",
102
- "@uniformdev/next-app-router-client": "20.71.2-alpha.7+2ec20a4ae2",
103
- "@uniformdev/next-app-router-shared": "20.71.2-alpha.7+2ec20a4ae2",
104
- "@uniformdev/redirect": "20.71.2-alpha.7+2ec20a4ae2",
105
- "@uniformdev/richtext": "20.71.2-alpha.7+2ec20a4ae2",
106
- "@uniformdev/webhooks": "20.71.2-alpha.7+2ec20a4ae2",
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": "2ec20a4ae2d167b6e4e6ad47463b90fb16b73c47"
123
+ "gitHead": "a1f072e7b42ac4b3c694ebdd2e75216efd74a9c2"
124
124
  }