@uniformdev/canvas-next 19.190.0 → 19.190.1-alpha.10
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/route/index.js +10 -2
- package/dist/route/index.mjs +17 -8
- package/package.json +7 -7
package/dist/route/index.js
CHANGED
|
@@ -213,7 +213,7 @@ function createRouteFetcher(options) {
|
|
|
213
213
|
});
|
|
214
214
|
const handleModifyPath = modifyPath != null ? modifyPath : (path) => decodeURI(path);
|
|
215
215
|
return async function fetcher(context) {
|
|
216
|
-
var _a, _b;
|
|
216
|
+
var _a, _b, _c;
|
|
217
217
|
const {
|
|
218
218
|
contextualEditingCompositionId,
|
|
219
219
|
resolvedUrl,
|
|
@@ -283,10 +283,18 @@ function createRouteFetcher(options) {
|
|
|
283
283
|
console.log("Fetch route", nodePath);
|
|
284
284
|
}
|
|
285
285
|
const resolvedOptions = typeof requestOptions === "function" ? requestOptions(context) : requestOptions;
|
|
286
|
+
const dataResourcesVariant = (
|
|
287
|
+
// support explicit 'undefined' as a way to opt out of data resources variant
|
|
288
|
+
resolvedOptions && "dataResourcesVariant" in resolvedOptions ? resolvedOptions.dataResourcesVariant : (
|
|
289
|
+
// in case of DRAFT state we still want to fetch unpublished data
|
|
290
|
+
((_a = resolvedOptions == null ? void 0 : resolvedOptions.state) != null ? _a : defaultPreviewState) === import_canvas.CANVAS_DRAFT_STATE ? "unpublished" : void 0
|
|
291
|
+
)
|
|
292
|
+
);
|
|
286
293
|
const time = Date.now();
|
|
287
294
|
const response = await routeClient.getRoute({
|
|
288
295
|
...resolvedOptions,
|
|
289
|
-
state: (
|
|
296
|
+
state: (_c = (_b = resolvedOptions == null ? void 0 : resolvedOptions.state) != null ? _b : defaultPreviewState) != null ? _c : import_canvas.CANVAS_PUBLISHED_STATE,
|
|
297
|
+
dataResourcesVariant,
|
|
290
298
|
projectMapId,
|
|
291
299
|
path: nodePath
|
|
292
300
|
});
|
package/dist/route/index.mjs
CHANGED
|
@@ -6,12 +6,13 @@ import {
|
|
|
6
6
|
} from "../chunk-TR7V6ABJ.mjs";
|
|
7
7
|
|
|
8
8
|
// src/route/withUniformGetServerSideProps.ts
|
|
9
|
-
import { CANVAS_DRAFT_STATE } from "@uniformdev/canvas";
|
|
9
|
+
import { CANVAS_DRAFT_STATE as CANVAS_DRAFT_STATE2 } from "@uniformdev/canvas";
|
|
10
10
|
import { getTargetVariableExpandedUrl } from "@uniformdev/redirect";
|
|
11
11
|
|
|
12
12
|
// src/route/createRouteFetcher.ts
|
|
13
13
|
import {
|
|
14
14
|
ApiClientError,
|
|
15
|
+
CANVAS_DRAFT_STATE,
|
|
15
16
|
CANVAS_PUBLISHED_STATE,
|
|
16
17
|
EMPTY_COMPOSITION,
|
|
17
18
|
RouteClient
|
|
@@ -90,7 +91,7 @@ function createRouteFetcher(options) {
|
|
|
90
91
|
});
|
|
91
92
|
const handleModifyPath = modifyPath != null ? modifyPath : (path) => decodeURI(path);
|
|
92
93
|
return async function fetcher(context) {
|
|
93
|
-
var _a, _b;
|
|
94
|
+
var _a, _b, _c;
|
|
94
95
|
const {
|
|
95
96
|
contextualEditingCompositionId,
|
|
96
97
|
resolvedUrl,
|
|
@@ -160,10 +161,18 @@ function createRouteFetcher(options) {
|
|
|
160
161
|
console.log("Fetch route", nodePath);
|
|
161
162
|
}
|
|
162
163
|
const resolvedOptions = typeof requestOptions === "function" ? requestOptions(context) : requestOptions;
|
|
164
|
+
const dataResourcesVariant = (
|
|
165
|
+
// support explicit 'undefined' as a way to opt out of data resources variant
|
|
166
|
+
resolvedOptions && "dataResourcesVariant" in resolvedOptions ? resolvedOptions.dataResourcesVariant : (
|
|
167
|
+
// in case of DRAFT state we still want to fetch unpublished data
|
|
168
|
+
((_a = resolvedOptions == null ? void 0 : resolvedOptions.state) != null ? _a : defaultPreviewState) === CANVAS_DRAFT_STATE ? "unpublished" : void 0
|
|
169
|
+
)
|
|
170
|
+
);
|
|
163
171
|
const time = Date.now();
|
|
164
172
|
const response = await routeClient.getRoute({
|
|
165
173
|
...resolvedOptions,
|
|
166
|
-
state: (
|
|
174
|
+
state: (_c = (_b = resolvedOptions == null ? void 0 : resolvedOptions.state) != null ? _b : defaultPreviewState) != null ? _c : CANVAS_PUBLISHED_STATE,
|
|
175
|
+
dataResourcesVariant,
|
|
167
176
|
projectMapId,
|
|
168
177
|
path: nodePath
|
|
169
178
|
});
|
|
@@ -235,7 +244,7 @@ var withUniformGetServerSideProps = (options) => {
|
|
|
235
244
|
resolvedUrl: context.resolvedUrl,
|
|
236
245
|
// auto engage draft content when in next preview mode
|
|
237
246
|
// (can override with explicit setting of request options)'
|
|
238
|
-
defaultFetchState: context.preview ?
|
|
247
|
+
defaultFetchState: context.preview ? CANVAS_DRAFT_STATE2 : void 0
|
|
239
248
|
};
|
|
240
249
|
}
|
|
241
250
|
});
|
|
@@ -243,7 +252,7 @@ var withUniformGetServerSideProps = (options) => {
|
|
|
243
252
|
};
|
|
244
253
|
|
|
245
254
|
// src/route/withUniformGetStaticPaths.ts
|
|
246
|
-
import { CANVAS_DRAFT_STATE as
|
|
255
|
+
import { CANVAS_DRAFT_STATE as CANVAS_DRAFT_STATE3, CANVAS_PUBLISHED_STATE as CANVAS_PUBLISHED_STATE2 } from "@uniformdev/canvas";
|
|
247
256
|
import {
|
|
248
257
|
ProjectMapClient
|
|
249
258
|
} from "@uniformdev/project-map";
|
|
@@ -279,7 +288,7 @@ var withUniformGetStaticPaths = (options) => {
|
|
|
279
288
|
...options == null ? void 0 : options.requestOptions,
|
|
280
289
|
path: options == null ? void 0 : options.rootPath,
|
|
281
290
|
projectMapId,
|
|
282
|
-
state: (options == null ? void 0 : options.preview) ?
|
|
291
|
+
state: (options == null ? void 0 : options.preview) ? CANVAS_DRAFT_STATE3 : CANVAS_PUBLISHED_STATE2
|
|
283
292
|
}),
|
|
284
293
|
finalRedirectClient.getAllRedirects()
|
|
285
294
|
]);
|
|
@@ -299,7 +308,7 @@ var withUniformGetStaticPaths = (options) => {
|
|
|
299
308
|
};
|
|
300
309
|
|
|
301
310
|
// src/route/withUniformGetStaticProps.ts
|
|
302
|
-
import { CANVAS_DRAFT_STATE as
|
|
311
|
+
import { CANVAS_DRAFT_STATE as CANVAS_DRAFT_STATE4 } from "@uniformdev/canvas";
|
|
303
312
|
import { getTargetVariableExpandedUrl as getTargetVariableExpandedUrl2 } from "@uniformdev/redirect";
|
|
304
313
|
var withUniformGetStaticProps = (options) => {
|
|
305
314
|
const defaultHandleRedirect = (requestUrl, matched) => {
|
|
@@ -335,7 +344,7 @@ var withUniformGetStaticProps = (options) => {
|
|
|
335
344
|
}),
|
|
336
345
|
// auto engage draft content when in next preview mode
|
|
337
346
|
// (can override with explicit setting of request options)
|
|
338
|
-
defaultFetchState: context.preview ?
|
|
347
|
+
defaultFetchState: context.preview ? CANVAS_DRAFT_STATE4 : void 0
|
|
339
348
|
};
|
|
340
349
|
}
|
|
341
350
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/canvas-next",
|
|
3
|
-
"version": "19.190.
|
|
3
|
+
"version": "19.190.1-alpha.10+ec1c4180f7",
|
|
4
4
|
"description": "Next.js SDK for Uniform Canvas",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -67,11 +67,11 @@
|
|
|
67
67
|
"document": "api-extractor run --local"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@uniformdev/canvas": "19.190.
|
|
71
|
-
"@uniformdev/canvas-react": "19.190.
|
|
72
|
-
"@uniformdev/project-map": "19.190.
|
|
73
|
-
"@uniformdev/redirect": "19.190.
|
|
74
|
-
"@uniformdev/richtext": "19.190.
|
|
70
|
+
"@uniformdev/canvas": "19.190.1-alpha.10+ec1c4180f7",
|
|
71
|
+
"@uniformdev/canvas-react": "19.190.1-alpha.10+ec1c4180f7",
|
|
72
|
+
"@uniformdev/project-map": "19.190.1-alpha.10+ec1c4180f7",
|
|
73
|
+
"@uniformdev/redirect": "19.190.1-alpha.10+ec1c4180f7",
|
|
74
|
+
"@uniformdev/richtext": "19.190.1-alpha.10+ec1c4180f7",
|
|
75
75
|
"colorette": "2.0.20"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
"publishConfig": {
|
|
92
92
|
"access": "public"
|
|
93
93
|
},
|
|
94
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "ec1c4180f7c99bcfb5023bc0e1277d155acdca72"
|
|
95
95
|
}
|