@uniformdev/canvas-next 20.56.1-alpha.5 → 20.57.1
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/{chunk-4YXXKXP3.mjs → chunk-JQWYBVLI.mjs} +0 -16
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.js +0 -5
- package/dist/index.js +0 -5
- package/dist/index.mjs +0 -5
- package/dist/{models-r9gINwBs.d.mts → models-CupnCqnn.d.mts} +0 -1
- package/dist/{models-r9gINwBs.d.ts → models-CupnCqnn.d.ts} +0 -1
- package/dist/project-map/index.d.mts +1 -1
- package/dist/project-map/index.d.ts +1 -1
- package/dist/project-map/index.js +6 -33
- package/dist/project-map/index.mjs +8 -21
- package/dist/route/index.d.mts +1 -1
- package/dist/route/index.d.ts +1 -1
- package/dist/route/index.js +6 -33
- package/dist/route/index.mjs +8 -21
- package/dist/slug/index.d.mts +1 -1
- package/dist/slug/index.d.ts +1 -1
- package/dist/slug/index.js +6 -33
- package/dist/slug/index.mjs +8 -21
- package/package.json +8 -8
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
// src/helpers/resolvePreviewReleaseId.ts
|
|
2
|
-
function resolvePreviewReleaseId({
|
|
3
|
-
explicitReleaseId,
|
|
4
|
-
isPreview,
|
|
5
|
-
previewReleaseId
|
|
6
|
-
}) {
|
|
7
|
-
if (typeof explicitReleaseId !== "undefined") {
|
|
8
|
-
return explicitReleaseId;
|
|
9
|
-
}
|
|
10
|
-
if (!isPreview) {
|
|
11
|
-
return void 0;
|
|
12
|
-
}
|
|
13
|
-
return previewReleaseId;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
1
|
// src/logging/logCompositionResponse.ts
|
|
17
2
|
import { white as white2 } from "colorette";
|
|
18
3
|
|
|
@@ -119,6 +104,5 @@ function resolveDiagnosticsDuration(data) {
|
|
|
119
104
|
}
|
|
120
105
|
|
|
121
106
|
export {
|
|
122
|
-
resolvePreviewReleaseId,
|
|
123
107
|
logCompositionResponse
|
|
124
108
|
};
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RichTextRendererComponent, RenderRichTextComponentResolver, UniformRichText as UniformRichText$1, UniformRichTextNode as UniformRichTextNode$1 } from '@uniformdev/canvas-react';
|
|
2
2
|
import { ParsedUrlQuery } from 'querystring';
|
|
3
|
-
export { U as UniformCompositionNextPage, c as UniformGetServerSideProps, b as UniformGetStaticProps, a as UniformPreviewData } from './models-
|
|
3
|
+
export { U as UniformCompositionNextPage, c as UniformGetServerSideProps, b as UniformGetStaticProps, a as UniformPreviewData } from './models-CupnCqnn.mjs';
|
|
4
4
|
import { NextApiHandler, NextApiRequest } from 'next';
|
|
5
5
|
import { RootComponentInstance } from '@uniformdev/canvas';
|
|
6
6
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RichTextRendererComponent, RenderRichTextComponentResolver, UniformRichText as UniformRichText$1, UniformRichTextNode as UniformRichTextNode$1 } from '@uniformdev/canvas-react';
|
|
2
2
|
import { ParsedUrlQuery } from 'querystring';
|
|
3
|
-
export { U as UniformCompositionNextPage, c as UniformGetServerSideProps, b as UniformGetStaticProps, a as UniformPreviewData } from './models-
|
|
3
|
+
export { U as UniformCompositionNextPage, c as UniformGetServerSideProps, b as UniformGetStaticProps, a as UniformPreviewData } from './models-CupnCqnn.js';
|
|
4
4
|
import { NextApiHandler, NextApiRequest } from 'next';
|
|
5
5
|
import { RootComponentInstance } from '@uniformdev/canvas';
|
|
6
6
|
|
package/dist/index.esm.js
CHANGED
|
@@ -98,7 +98,6 @@ var createPreviewHandlerGet = ({ secret, resolveFullPath = resolveFullPathDefaul
|
|
|
98
98
|
const slug = getQueryParam(req, compositionQueryParam.slug);
|
|
99
99
|
const path = getQueryParam(req, compositionQueryParam.path);
|
|
100
100
|
const locale = getQueryParam(req, compositionQueryParam.locale);
|
|
101
|
-
const releaseId = getQueryParam(req, "releaseId") || void 0;
|
|
102
101
|
if (typeof pathToRedirectTo === "undefined") {
|
|
103
102
|
pathToRedirectTo = resolveFullPath({ id, slug, path, locale });
|
|
104
103
|
}
|
|
@@ -126,7 +125,6 @@ var createPreviewHandlerGet = ({ secret, resolveFullPath = resolveFullPathDefaul
|
|
|
126
125
|
compositionSlug: slug,
|
|
127
126
|
compositionPath: path,
|
|
128
127
|
locale,
|
|
129
|
-
releaseId,
|
|
130
128
|
isPlayground,
|
|
131
129
|
patternType: !isPlayground ? void 0 : getQueryParam(req, "patternType")
|
|
132
130
|
},
|
|
@@ -145,9 +143,6 @@ var createPreviewHandlerGet = ({ secret, resolveFullPath = resolveFullPathDefaul
|
|
|
145
143
|
);
|
|
146
144
|
const redirectionUrl = new URL(pathToRedirectTo, BASE_URL_EXAMPLE);
|
|
147
145
|
assignRequestQueryToSearchParams(redirectionUrl.searchParams, req.query);
|
|
148
|
-
if (releaseId) {
|
|
149
|
-
redirectionUrl.searchParams.set("releaseId", releaseId);
|
|
150
|
-
}
|
|
151
146
|
if (!isUniformContextualEditing) {
|
|
152
147
|
contextualEditingQueryParams.forEach((param) => {
|
|
153
148
|
redirectionUrl.searchParams.delete(param);
|
package/dist/index.js
CHANGED
|
@@ -140,7 +140,6 @@ var createPreviewHandlerGet = ({ secret, resolveFullPath = resolveFullPathDefaul
|
|
|
140
140
|
const slug = getQueryParam(req, compositionQueryParam.slug);
|
|
141
141
|
const path = getQueryParam(req, compositionQueryParam.path);
|
|
142
142
|
const locale = getQueryParam(req, compositionQueryParam.locale);
|
|
143
|
-
const releaseId = getQueryParam(req, "releaseId") || void 0;
|
|
144
143
|
if (typeof pathToRedirectTo === "undefined") {
|
|
145
144
|
pathToRedirectTo = resolveFullPath({ id, slug, path, locale });
|
|
146
145
|
}
|
|
@@ -168,7 +167,6 @@ var createPreviewHandlerGet = ({ secret, resolveFullPath = resolveFullPathDefaul
|
|
|
168
167
|
compositionSlug: slug,
|
|
169
168
|
compositionPath: path,
|
|
170
169
|
locale,
|
|
171
|
-
releaseId,
|
|
172
170
|
isPlayground,
|
|
173
171
|
patternType: !isPlayground ? void 0 : getQueryParam(req, "patternType")
|
|
174
172
|
},
|
|
@@ -187,9 +185,6 @@ var createPreviewHandlerGet = ({ secret, resolveFullPath = resolveFullPathDefaul
|
|
|
187
185
|
);
|
|
188
186
|
const redirectionUrl = new URL(pathToRedirectTo, BASE_URL_EXAMPLE);
|
|
189
187
|
assignRequestQueryToSearchParams(redirectionUrl.searchParams, req.query);
|
|
190
|
-
if (releaseId) {
|
|
191
|
-
redirectionUrl.searchParams.set("releaseId", releaseId);
|
|
192
|
-
}
|
|
193
188
|
if (!isUniformContextualEditing) {
|
|
194
189
|
contextualEditingQueryParams.forEach((param) => {
|
|
195
190
|
redirectionUrl.searchParams.delete(param);
|
package/dist/index.mjs
CHANGED
|
@@ -98,7 +98,6 @@ var createPreviewHandlerGet = ({ secret, resolveFullPath = resolveFullPathDefaul
|
|
|
98
98
|
const slug = getQueryParam(req, compositionQueryParam.slug);
|
|
99
99
|
const path = getQueryParam(req, compositionQueryParam.path);
|
|
100
100
|
const locale = getQueryParam(req, compositionQueryParam.locale);
|
|
101
|
-
const releaseId = getQueryParam(req, "releaseId") || void 0;
|
|
102
101
|
if (typeof pathToRedirectTo === "undefined") {
|
|
103
102
|
pathToRedirectTo = resolveFullPath({ id, slug, path, locale });
|
|
104
103
|
}
|
|
@@ -126,7 +125,6 @@ var createPreviewHandlerGet = ({ secret, resolveFullPath = resolveFullPathDefaul
|
|
|
126
125
|
compositionSlug: slug,
|
|
127
126
|
compositionPath: path,
|
|
128
127
|
locale,
|
|
129
|
-
releaseId,
|
|
130
128
|
isPlayground,
|
|
131
129
|
patternType: !isPlayground ? void 0 : getQueryParam(req, "patternType")
|
|
132
130
|
},
|
|
@@ -145,9 +143,6 @@ var createPreviewHandlerGet = ({ secret, resolveFullPath = resolveFullPathDefaul
|
|
|
145
143
|
);
|
|
146
144
|
const redirectionUrl = new URL(pathToRedirectTo, BASE_URL_EXAMPLE);
|
|
147
145
|
assignRequestQueryToSearchParams(redirectionUrl.searchParams, req.query);
|
|
148
|
-
if (releaseId) {
|
|
149
|
-
redirectionUrl.searchParams.set("releaseId", releaseId);
|
|
150
|
-
}
|
|
151
146
|
if (!isUniformContextualEditing) {
|
|
152
147
|
contextualEditingQueryParams.forEach((param) => {
|
|
153
148
|
redirectionUrl.searchParams.delete(param);
|
|
@@ -10,7 +10,6 @@ type UniformPreviewData = PreviewData & {
|
|
|
10
10
|
compositionSlug?: string;
|
|
11
11
|
compositionPath?: string;
|
|
12
12
|
locale?: string;
|
|
13
|
-
releaseId?: string;
|
|
14
13
|
isPlayground?: boolean;
|
|
15
14
|
/**
|
|
16
15
|
* The type of pattern being previewed in Canvas editor. This value is only set when `isPlayground` is `true`.
|
|
@@ -10,7 +10,6 @@ type UniformPreviewData = PreviewData & {
|
|
|
10
10
|
compositionSlug?: string;
|
|
11
11
|
compositionPath?: string;
|
|
12
12
|
locale?: string;
|
|
13
|
-
releaseId?: string;
|
|
14
13
|
isPlayground?: boolean;
|
|
15
14
|
/**
|
|
16
15
|
* The type of pattern being previewed in Canvas editor. This value is only set when `isPlayground` is `true`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as next from 'next';
|
|
2
2
|
import { GetServerSidePropsContext, PreviewData, GetServerSideProps, GetStaticPropsContext, GetStaticProps } from 'next';
|
|
3
|
-
import { c as UniformGetServerSideProps, a as UniformPreviewData, b as UniformGetStaticProps } from '../models-
|
|
3
|
+
import { c as UniformGetServerSideProps, a as UniformPreviewData, b as UniformGetStaticProps } from '../models-CupnCqnn.mjs';
|
|
4
4
|
import * as querystring from 'querystring';
|
|
5
5
|
import { ParsedUrlQuery } from 'querystring';
|
|
6
6
|
import { CanvasClient, CompositionGetByNodePathParameters, DataResolutionOption } from '@uniformdev/canvas';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as next from 'next';
|
|
2
2
|
import { GetServerSidePropsContext, PreviewData, GetServerSideProps, GetStaticPropsContext, GetStaticProps } from 'next';
|
|
3
|
-
import { c as UniformGetServerSideProps, a as UniformPreviewData, b as UniformGetStaticProps } from '../models-
|
|
3
|
+
import { c as UniformGetServerSideProps, a as UniformPreviewData, b as UniformGetStaticProps } from '../models-CupnCqnn.js';
|
|
4
4
|
import * as querystring from 'querystring';
|
|
5
5
|
import { ParsedUrlQuery } from 'querystring';
|
|
6
6
|
import { CanvasClient, CompositionGetByNodePathParameters, DataResolutionOption } from '@uniformdev/canvas';
|
|
@@ -32,21 +32,6 @@ module.exports = __toCommonJS(project_map_exports);
|
|
|
32
32
|
// src/project-map/withUniformGetServerSideProps.ts
|
|
33
33
|
var import_canvas = require("@uniformdev/canvas");
|
|
34
34
|
|
|
35
|
-
// src/helpers/resolvePreviewReleaseId.ts
|
|
36
|
-
function resolvePreviewReleaseId({
|
|
37
|
-
explicitReleaseId,
|
|
38
|
-
isPreview,
|
|
39
|
-
previewReleaseId
|
|
40
|
-
}) {
|
|
41
|
-
if (typeof explicitReleaseId !== "undefined") {
|
|
42
|
-
return explicitReleaseId;
|
|
43
|
-
}
|
|
44
|
-
if (!isPreview) {
|
|
45
|
-
return void 0;
|
|
46
|
-
}
|
|
47
|
-
return previewReleaseId;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
35
|
// src/logging/logCompositionIssues.ts
|
|
51
36
|
var import_colorette = require("colorette");
|
|
52
37
|
function logCompositionIssues(prefix, issues, colour = "red") {
|
|
@@ -159,21 +144,16 @@ var withUniformGetServerSideProps = (options) => {
|
|
|
159
144
|
edgeApiHost: process.env.UNIFORM_CLI_BASE_EDGE_URL
|
|
160
145
|
});
|
|
161
146
|
return async function wrappedGetServerSideProps(context) {
|
|
162
|
-
var _a, _b
|
|
147
|
+
var _a, _b;
|
|
163
148
|
const projectMapId = (_a = options == null ? void 0 : options.projectMapId) != null ? _a : process.env.UNIFORM_PROJECT_MAP_ID;
|
|
164
149
|
const { preview, previewData } = context;
|
|
165
|
-
const releaseId = resolvePreviewReleaseId({
|
|
166
|
-
explicitReleaseId: (_b = options == null ? void 0 : options.requestOptions) == null ? void 0 : _b.releaseId,
|
|
167
|
-
isPreview: preview || (options == null ? void 0 : options.preview),
|
|
168
|
-
previewReleaseId: previewData == null ? void 0 : previewData.releaseId
|
|
169
|
-
});
|
|
170
150
|
let composition = void 0;
|
|
171
151
|
let nodePath = (options == null ? void 0 : options.prefix) ? context.resolvedUrl.replace(new RegExp(`^${options.prefix}`), "") : context.resolvedUrl;
|
|
172
152
|
if (options == null ? void 0 : options.modifyPath) {
|
|
173
153
|
nodePath = options.modifyPath(nodePath, context);
|
|
174
154
|
}
|
|
175
155
|
if (previewData == null ? void 0 : previewData.isUniformContextualEditing) {
|
|
176
|
-
composition = { ...import_canvas.EMPTY_COMPOSITION, _id: (
|
|
156
|
+
composition = { ...import_canvas.EMPTY_COMPOSITION, _id: (_b = previewData.compositionId) != null ? _b : import_canvas.EMPTY_COMPOSITION._id };
|
|
177
157
|
} else {
|
|
178
158
|
try {
|
|
179
159
|
const time = Date.now();
|
|
@@ -181,8 +161,7 @@ var withUniformGetServerSideProps = (options) => {
|
|
|
181
161
|
...options == null ? void 0 : options.requestOptions,
|
|
182
162
|
projectMapId,
|
|
183
163
|
projectMapNodePath: nodePath,
|
|
184
|
-
state: preview || (options == null ? void 0 : options.preview) ? import_canvas.CANVAS_DRAFT_STATE : import_canvas.CANVAS_PUBLISHED_STATE
|
|
185
|
-
releaseId
|
|
164
|
+
state: preview || (options == null ? void 0 : options.preview) ? import_canvas.CANVAS_DRAFT_STATE : import_canvas.CANVAS_PUBLISHED_STATE
|
|
186
165
|
});
|
|
187
166
|
const duration = Date.now() - time;
|
|
188
167
|
composition = response.composition;
|
|
@@ -258,7 +237,7 @@ var withUniformGetStaticProps = (options) => {
|
|
|
258
237
|
edgeApiHost: process.env.UNIFORM_CLI_BASE_EDGE_URL
|
|
259
238
|
});
|
|
260
239
|
return async function wrappedGetStaticProps(context) {
|
|
261
|
-
var _a2, _b
|
|
240
|
+
var _a2, _b;
|
|
262
241
|
const projectMapId = (_a2 = options == null ? void 0 : options.projectMapId) != null ? _a2 : process.env.UNIFORM_PROJECT_MAP_ID;
|
|
263
242
|
let pathString = resolveSlugFromParams({
|
|
264
243
|
param: options == null ? void 0 : options.param,
|
|
@@ -268,14 +247,9 @@ var withUniformGetStaticProps = (options) => {
|
|
|
268
247
|
pathString = options.modifyPath(pathString, context);
|
|
269
248
|
}
|
|
270
249
|
const { preview, previewData } = context;
|
|
271
|
-
const releaseId = resolvePreviewReleaseId({
|
|
272
|
-
explicitReleaseId: (_b = options == null ? void 0 : options.requestOptions) == null ? void 0 : _b.releaseId,
|
|
273
|
-
isPreview: preview || (options == null ? void 0 : options.preview),
|
|
274
|
-
previewReleaseId: previewData == null ? void 0 : previewData.releaseId
|
|
275
|
-
});
|
|
276
250
|
let composition = void 0;
|
|
277
251
|
if (previewData == null ? void 0 : previewData.isUniformContextualEditing) {
|
|
278
|
-
composition = { ...import_canvas3.EMPTY_COMPOSITION, _id: (
|
|
252
|
+
composition = { ...import_canvas3.EMPTY_COMPOSITION, _id: (_b = previewData.compositionId) != null ? _b : import_canvas3.EMPTY_COMPOSITION._id };
|
|
279
253
|
} else {
|
|
280
254
|
try {
|
|
281
255
|
const time = Date.now();
|
|
@@ -283,8 +257,7 @@ var withUniformGetStaticProps = (options) => {
|
|
|
283
257
|
...options == null ? void 0 : options.requestOptions,
|
|
284
258
|
projectMapId,
|
|
285
259
|
projectMapNodePath: pathString,
|
|
286
|
-
state: preview || (options == null ? void 0 : options.preview) ? import_canvas3.CANVAS_DRAFT_STATE : import_canvas3.CANVAS_PUBLISHED_STATE
|
|
287
|
-
releaseId
|
|
260
|
+
state: preview || (options == null ? void 0 : options.preview) ? import_canvas3.CANVAS_DRAFT_STATE : import_canvas3.CANVAS_PUBLISHED_STATE
|
|
288
261
|
});
|
|
289
262
|
const duration = Date.now() - time;
|
|
290
263
|
composition = response.composition;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
-
logCompositionResponse
|
|
3
|
-
|
|
4
|
-
} from "../chunk-4YXXKXP3.mjs";
|
|
2
|
+
logCompositionResponse
|
|
3
|
+
} from "../chunk-JQWYBVLI.mjs";
|
|
5
4
|
import {
|
|
6
5
|
resolveSlugFromParams
|
|
7
6
|
} from "../chunk-TR7V6ABJ.mjs";
|
|
@@ -21,21 +20,16 @@ var withUniformGetServerSideProps = (options) => {
|
|
|
21
20
|
edgeApiHost: process.env.UNIFORM_CLI_BASE_EDGE_URL
|
|
22
21
|
});
|
|
23
22
|
return async function wrappedGetServerSideProps(context) {
|
|
24
|
-
var _a, _b
|
|
23
|
+
var _a, _b;
|
|
25
24
|
const projectMapId = (_a = options == null ? void 0 : options.projectMapId) != null ? _a : process.env.UNIFORM_PROJECT_MAP_ID;
|
|
26
25
|
const { preview, previewData } = context;
|
|
27
|
-
const releaseId = resolvePreviewReleaseId({
|
|
28
|
-
explicitReleaseId: (_b = options == null ? void 0 : options.requestOptions) == null ? void 0 : _b.releaseId,
|
|
29
|
-
isPreview: preview || (options == null ? void 0 : options.preview),
|
|
30
|
-
previewReleaseId: previewData == null ? void 0 : previewData.releaseId
|
|
31
|
-
});
|
|
32
26
|
let composition = void 0;
|
|
33
27
|
let nodePath = (options == null ? void 0 : options.prefix) ? context.resolvedUrl.replace(new RegExp(`^${options.prefix}`), "") : context.resolvedUrl;
|
|
34
28
|
if (options == null ? void 0 : options.modifyPath) {
|
|
35
29
|
nodePath = options.modifyPath(nodePath, context);
|
|
36
30
|
}
|
|
37
31
|
if (previewData == null ? void 0 : previewData.isUniformContextualEditing) {
|
|
38
|
-
composition = { ...EMPTY_COMPOSITION, _id: (
|
|
32
|
+
composition = { ...EMPTY_COMPOSITION, _id: (_b = previewData.compositionId) != null ? _b : EMPTY_COMPOSITION._id };
|
|
39
33
|
} else {
|
|
40
34
|
try {
|
|
41
35
|
const time = Date.now();
|
|
@@ -43,8 +37,7 @@ var withUniformGetServerSideProps = (options) => {
|
|
|
43
37
|
...options == null ? void 0 : options.requestOptions,
|
|
44
38
|
projectMapId,
|
|
45
39
|
projectMapNodePath: nodePath,
|
|
46
|
-
state: preview || (options == null ? void 0 : options.preview) ? CANVAS_DRAFT_STATE : CANVAS_PUBLISHED_STATE
|
|
47
|
-
releaseId
|
|
40
|
+
state: preview || (options == null ? void 0 : options.preview) ? CANVAS_DRAFT_STATE : CANVAS_PUBLISHED_STATE
|
|
48
41
|
});
|
|
49
42
|
const duration = Date.now() - time;
|
|
50
43
|
composition = response.composition;
|
|
@@ -115,7 +108,7 @@ var withUniformGetStaticProps = (options) => {
|
|
|
115
108
|
edgeApiHost: process.env.UNIFORM_CLI_BASE_EDGE_URL
|
|
116
109
|
});
|
|
117
110
|
return async function wrappedGetStaticProps(context) {
|
|
118
|
-
var _a2, _b
|
|
111
|
+
var _a2, _b;
|
|
119
112
|
const projectMapId = (_a2 = options == null ? void 0 : options.projectMapId) != null ? _a2 : process.env.UNIFORM_PROJECT_MAP_ID;
|
|
120
113
|
let pathString = resolveSlugFromParams({
|
|
121
114
|
param: options == null ? void 0 : options.param,
|
|
@@ -125,14 +118,9 @@ var withUniformGetStaticProps = (options) => {
|
|
|
125
118
|
pathString = options.modifyPath(pathString, context);
|
|
126
119
|
}
|
|
127
120
|
const { preview, previewData } = context;
|
|
128
|
-
const releaseId = resolvePreviewReleaseId({
|
|
129
|
-
explicitReleaseId: (_b = options == null ? void 0 : options.requestOptions) == null ? void 0 : _b.releaseId,
|
|
130
|
-
isPreview: preview || (options == null ? void 0 : options.preview),
|
|
131
|
-
previewReleaseId: previewData == null ? void 0 : previewData.releaseId
|
|
132
|
-
});
|
|
133
121
|
let composition = void 0;
|
|
134
122
|
if (previewData == null ? void 0 : previewData.isUniformContextualEditing) {
|
|
135
|
-
composition = { ...EMPTY_COMPOSITION2, _id: (
|
|
123
|
+
composition = { ...EMPTY_COMPOSITION2, _id: (_b = previewData.compositionId) != null ? _b : EMPTY_COMPOSITION2._id };
|
|
136
124
|
} else {
|
|
137
125
|
try {
|
|
138
126
|
const time = Date.now();
|
|
@@ -140,8 +128,7 @@ var withUniformGetStaticProps = (options) => {
|
|
|
140
128
|
...options == null ? void 0 : options.requestOptions,
|
|
141
129
|
projectMapId,
|
|
142
130
|
projectMapNodePath: pathString,
|
|
143
|
-
state: preview || (options == null ? void 0 : options.preview) ? CANVAS_DRAFT_STATE3 : CANVAS_PUBLISHED_STATE3
|
|
144
|
-
releaseId
|
|
131
|
+
state: preview || (options == null ? void 0 : options.preview) ? CANVAS_DRAFT_STATE3 : CANVAS_PUBLISHED_STATE3
|
|
145
132
|
});
|
|
146
133
|
const duration = Date.now() - time;
|
|
147
134
|
composition = response.composition;
|
package/dist/route/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as next from 'next';
|
|
2
2
|
import { GetServerSidePropsContext, GetServerSidePropsResult, GetServerSideProps, GetStaticPropsContext, GetStaticPropsResult, GetStaticProps } from 'next';
|
|
3
|
-
import { a as UniformPreviewData } from '../models-
|
|
3
|
+
import { a as UniformPreviewData } from '../models-CupnCqnn.mjs';
|
|
4
4
|
import * as querystring from 'querystring';
|
|
5
5
|
import { ParsedUrlQuery } from 'querystring';
|
|
6
6
|
import * as _uniformdev_context__ from '@uniformdev/context/*';
|
package/dist/route/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as next from 'next';
|
|
2
2
|
import { GetServerSidePropsContext, GetServerSidePropsResult, GetServerSideProps, GetStaticPropsContext, GetStaticPropsResult, GetStaticProps } from 'next';
|
|
3
|
-
import { a as UniformPreviewData } from '../models-
|
|
3
|
+
import { a as UniformPreviewData } from '../models-CupnCqnn.js';
|
|
4
4
|
import * as querystring from 'querystring';
|
|
5
5
|
import { ParsedUrlQuery } from 'querystring';
|
|
6
6
|
import * as _uniformdev_context__ from '@uniformdev/context/*';
|
package/dist/route/index.js
CHANGED
|
@@ -38,21 +38,6 @@ var import_redirect = require("@uniformdev/redirect");
|
|
|
38
38
|
var import_canvas = require("@uniformdev/canvas");
|
|
39
39
|
var import_colorette6 = require("colorette");
|
|
40
40
|
|
|
41
|
-
// src/helpers/resolvePreviewReleaseId.ts
|
|
42
|
-
function resolvePreviewReleaseId({
|
|
43
|
-
explicitReleaseId,
|
|
44
|
-
isPreview,
|
|
45
|
-
previewReleaseId
|
|
46
|
-
}) {
|
|
47
|
-
if (typeof explicitReleaseId !== "undefined") {
|
|
48
|
-
return explicitReleaseId;
|
|
49
|
-
}
|
|
50
|
-
if (!isPreview) {
|
|
51
|
-
return void 0;
|
|
52
|
-
}
|
|
53
|
-
return previewReleaseId;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
41
|
// src/logging/logCompositionIssues.ts
|
|
57
42
|
var import_colorette = require("colorette");
|
|
58
43
|
function logCompositionIssues(prefix, issues, colour = "red") {
|
|
@@ -233,9 +218,7 @@ function createRouteFetcher(options) {
|
|
|
233
218
|
contextualEditingCompositionId,
|
|
234
219
|
contextualEditingPath,
|
|
235
220
|
resolvedUrl,
|
|
236
|
-
defaultFetchState: defaultPreviewState
|
|
237
|
-
isPreview,
|
|
238
|
-
previewReleaseId
|
|
221
|
+
defaultFetchState: defaultPreviewState
|
|
239
222
|
} = parseContext(context);
|
|
240
223
|
let nodePath = prefix ? resolvedUrl.replace(new RegExp(`^${prefix}`), "") : resolvedUrl;
|
|
241
224
|
nodePath = handleModifyPath(nodePath, context);
|
|
@@ -303,11 +286,6 @@ function createRouteFetcher(options) {
|
|
|
303
286
|
console.log("Fetch route", nodePath);
|
|
304
287
|
}
|
|
305
288
|
const resolvedOptions = typeof requestOptions === "function" ? requestOptions(context) : requestOptions;
|
|
306
|
-
const releaseId = resolvePreviewReleaseId({
|
|
307
|
-
explicitReleaseId: resolvedOptions == null ? void 0 : resolvedOptions.releaseId,
|
|
308
|
-
isPreview,
|
|
309
|
-
previewReleaseId
|
|
310
|
-
});
|
|
311
289
|
const time = Date.now();
|
|
312
290
|
const response = await routeClient.getRoute({
|
|
313
291
|
...resolvedOptions,
|
|
@@ -317,8 +295,7 @@ function createRouteFetcher(options) {
|
|
|
317
295
|
defaultPreviewState
|
|
318
296
|
),
|
|
319
297
|
projectMapId,
|
|
320
|
-
path: nodePath
|
|
321
|
-
releaseId
|
|
298
|
+
path: nodePath
|
|
322
299
|
});
|
|
323
300
|
const duration = Date.now() - time;
|
|
324
301
|
if (!silent) {
|
|
@@ -384,16 +361,14 @@ var withUniformGetServerSideProps = (options) => {
|
|
|
384
361
|
defaultHandleNotFound,
|
|
385
362
|
defaultHandleRedirect,
|
|
386
363
|
parseContext(context) {
|
|
387
|
-
var _a, _b, _c, _d
|
|
364
|
+
var _a, _b, _c, _d;
|
|
388
365
|
return {
|
|
389
366
|
contextualEditingCompositionId: ((_a = context.previewData) == null ? void 0 : _a.isUniformContextualEditing) ? (_b = context.previewData) == null ? void 0 : _b.compositionId : void 0,
|
|
390
367
|
contextualEditingPath: ((_c = context.previewData) == null ? void 0 : _c.isUniformContextualEditing) ? (_d = context.previewData) == null ? void 0 : _d.compositionPath : void 0,
|
|
391
368
|
resolvedUrl: context.resolvedUrl,
|
|
392
369
|
// auto engage draft content when in next preview mode
|
|
393
370
|
// (can override with explicit setting of request options)'
|
|
394
|
-
defaultFetchState: context.preview ? import_canvas2.CANVAS_DRAFT_STATE : void 0
|
|
395
|
-
isPreview: context.preview,
|
|
396
|
-
previewReleaseId: (_e = context.previewData) == null ? void 0 : _e.releaseId
|
|
371
|
+
defaultFetchState: context.preview ? import_canvas2.CANVAS_DRAFT_STATE : void 0
|
|
397
372
|
};
|
|
398
373
|
}
|
|
399
374
|
});
|
|
@@ -496,7 +471,7 @@ var withUniformGetStaticProps = (options) => {
|
|
|
496
471
|
defaultHandleNotFound,
|
|
497
472
|
defaultHandleRedirect,
|
|
498
473
|
parseContext(context) {
|
|
499
|
-
var _a, _b, _c, _d, _e
|
|
474
|
+
var _a, _b, _c, _d, _e;
|
|
500
475
|
return {
|
|
501
476
|
contextualEditingCompositionId: ((_a = context.previewData) == null ? void 0 : _a.isUniformContextualEditing) ? (_b = context.previewData) == null ? void 0 : _b.compositionId : void 0,
|
|
502
477
|
contextualEditingPath: ((_c = context.previewData) == null ? void 0 : _c.isUniformContextualEditing) ? (_d = context.previewData) == null ? void 0 : _d.compositionPath : void 0,
|
|
@@ -506,9 +481,7 @@ var withUniformGetStaticProps = (options) => {
|
|
|
506
481
|
}),
|
|
507
482
|
// auto engage draft content when in next preview mode
|
|
508
483
|
// (can override with explicit setting of request options)
|
|
509
|
-
defaultFetchState: context.preview ? import_canvas4.CANVAS_DRAFT_STATE : void 0
|
|
510
|
-
isPreview: context.preview,
|
|
511
|
-
previewReleaseId: (_f = context.previewData) == null ? void 0 : _f.releaseId
|
|
484
|
+
defaultFetchState: context.preview ? import_canvas4.CANVAS_DRAFT_STATE : void 0
|
|
512
485
|
};
|
|
513
486
|
}
|
|
514
487
|
});
|
package/dist/route/index.mjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
-
logCompositionResponse
|
|
3
|
-
|
|
4
|
-
} from "../chunk-4YXXKXP3.mjs";
|
|
2
|
+
logCompositionResponse
|
|
3
|
+
} from "../chunk-JQWYBVLI.mjs";
|
|
5
4
|
import {
|
|
6
5
|
resolveSlugFromParams
|
|
7
6
|
} from "../chunk-TR7V6ABJ.mjs";
|
|
@@ -97,9 +96,7 @@ function createRouteFetcher(options) {
|
|
|
97
96
|
contextualEditingCompositionId,
|
|
98
97
|
contextualEditingPath,
|
|
99
98
|
resolvedUrl,
|
|
100
|
-
defaultFetchState: defaultPreviewState
|
|
101
|
-
isPreview,
|
|
102
|
-
previewReleaseId
|
|
99
|
+
defaultFetchState: defaultPreviewState
|
|
103
100
|
} = parseContext(context);
|
|
104
101
|
let nodePath = prefix ? resolvedUrl.replace(new RegExp(`^${prefix}`), "") : resolvedUrl;
|
|
105
102
|
nodePath = handleModifyPath(nodePath, context);
|
|
@@ -167,11 +164,6 @@ function createRouteFetcher(options) {
|
|
|
167
164
|
console.log("Fetch route", nodePath);
|
|
168
165
|
}
|
|
169
166
|
const resolvedOptions = typeof requestOptions === "function" ? requestOptions(context) : requestOptions;
|
|
170
|
-
const releaseId = resolvePreviewReleaseId({
|
|
171
|
-
explicitReleaseId: resolvedOptions == null ? void 0 : resolvedOptions.releaseId,
|
|
172
|
-
isPreview,
|
|
173
|
-
previewReleaseId
|
|
174
|
-
});
|
|
175
167
|
const time = Date.now();
|
|
176
168
|
const response = await routeClient.getRoute({
|
|
177
169
|
...resolvedOptions,
|
|
@@ -181,8 +173,7 @@ function createRouteFetcher(options) {
|
|
|
181
173
|
defaultPreviewState
|
|
182
174
|
),
|
|
183
175
|
projectMapId,
|
|
184
|
-
path: nodePath
|
|
185
|
-
releaseId
|
|
176
|
+
path: nodePath
|
|
186
177
|
});
|
|
187
178
|
const duration = Date.now() - time;
|
|
188
179
|
if (!silent) {
|
|
@@ -248,16 +239,14 @@ var withUniformGetServerSideProps = (options) => {
|
|
|
248
239
|
defaultHandleNotFound,
|
|
249
240
|
defaultHandleRedirect,
|
|
250
241
|
parseContext(context) {
|
|
251
|
-
var _a, _b, _c, _d
|
|
242
|
+
var _a, _b, _c, _d;
|
|
252
243
|
return {
|
|
253
244
|
contextualEditingCompositionId: ((_a = context.previewData) == null ? void 0 : _a.isUniformContextualEditing) ? (_b = context.previewData) == null ? void 0 : _b.compositionId : void 0,
|
|
254
245
|
contextualEditingPath: ((_c = context.previewData) == null ? void 0 : _c.isUniformContextualEditing) ? (_d = context.previewData) == null ? void 0 : _d.compositionPath : void 0,
|
|
255
246
|
resolvedUrl: context.resolvedUrl,
|
|
256
247
|
// auto engage draft content when in next preview mode
|
|
257
248
|
// (can override with explicit setting of request options)'
|
|
258
|
-
defaultFetchState: context.preview ? CANVAS_DRAFT_STATE : void 0
|
|
259
|
-
isPreview: context.preview,
|
|
260
|
-
previewReleaseId: (_e = context.previewData) == null ? void 0 : _e.releaseId
|
|
249
|
+
defaultFetchState: context.preview ? CANVAS_DRAFT_STATE : void 0
|
|
261
250
|
};
|
|
262
251
|
}
|
|
263
252
|
});
|
|
@@ -350,7 +339,7 @@ var withUniformGetStaticProps = (options) => {
|
|
|
350
339
|
defaultHandleNotFound,
|
|
351
340
|
defaultHandleRedirect,
|
|
352
341
|
parseContext(context) {
|
|
353
|
-
var _a, _b, _c, _d, _e
|
|
342
|
+
var _a, _b, _c, _d, _e;
|
|
354
343
|
return {
|
|
355
344
|
contextualEditingCompositionId: ((_a = context.previewData) == null ? void 0 : _a.isUniformContextualEditing) ? (_b = context.previewData) == null ? void 0 : _b.compositionId : void 0,
|
|
356
345
|
contextualEditingPath: ((_c = context.previewData) == null ? void 0 : _c.isUniformContextualEditing) ? (_d = context.previewData) == null ? void 0 : _d.compositionPath : void 0,
|
|
@@ -360,9 +349,7 @@ var withUniformGetStaticProps = (options) => {
|
|
|
360
349
|
}),
|
|
361
350
|
// auto engage draft content when in next preview mode
|
|
362
351
|
// (can override with explicit setting of request options)
|
|
363
|
-
defaultFetchState: context.preview ? CANVAS_DRAFT_STATE3 : void 0
|
|
364
|
-
isPreview: context.preview,
|
|
365
|
-
previewReleaseId: (_f = context.previewData) == null ? void 0 : _f.releaseId
|
|
352
|
+
defaultFetchState: context.preview ? CANVAS_DRAFT_STATE3 : void 0
|
|
366
353
|
};
|
|
367
354
|
}
|
|
368
355
|
});
|
package/dist/slug/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as next from 'next';
|
|
2
2
|
import { GetServerSidePropsContext, GetServerSideProps, GetStaticPropsContext, GetStaticProps } from 'next';
|
|
3
|
-
import { a as UniformPreviewData, c as UniformGetServerSideProps, b as UniformGetStaticProps } from '../models-
|
|
3
|
+
import { a as UniformPreviewData, c as UniformGetServerSideProps, b as UniformGetStaticProps } from '../models-CupnCqnn.mjs';
|
|
4
4
|
import * as querystring from 'querystring';
|
|
5
5
|
import { ParsedUrlQuery } from 'querystring';
|
|
6
6
|
import { CanvasClient, CompositionGetBySlugParameters, DataResolutionOption, CompositionGetParameters, CompositionGetResponse } from '@uniformdev/canvas';
|
package/dist/slug/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as next from 'next';
|
|
2
2
|
import { GetServerSidePropsContext, GetServerSideProps, GetStaticPropsContext, GetStaticProps } from 'next';
|
|
3
|
-
import { a as UniformPreviewData, c as UniformGetServerSideProps, b as UniformGetStaticProps } from '../models-
|
|
3
|
+
import { a as UniformPreviewData, c as UniformGetServerSideProps, b as UniformGetStaticProps } from '../models-CupnCqnn.js';
|
|
4
4
|
import * as querystring from 'querystring';
|
|
5
5
|
import { ParsedUrlQuery } from 'querystring';
|
|
6
6
|
import { CanvasClient, CompositionGetBySlugParameters, DataResolutionOption, CompositionGetParameters, CompositionGetResponse } from '@uniformdev/canvas';
|
package/dist/slug/index.js
CHANGED
|
@@ -32,21 +32,6 @@ module.exports = __toCommonJS(slug_exports);
|
|
|
32
32
|
// src/slug/withUniformGetServerSideProps.ts
|
|
33
33
|
var import_canvas = require("@uniformdev/canvas");
|
|
34
34
|
|
|
35
|
-
// src/helpers/resolvePreviewReleaseId.ts
|
|
36
|
-
function resolvePreviewReleaseId({
|
|
37
|
-
explicitReleaseId,
|
|
38
|
-
isPreview,
|
|
39
|
-
previewReleaseId
|
|
40
|
-
}) {
|
|
41
|
-
if (typeof explicitReleaseId !== "undefined") {
|
|
42
|
-
return explicitReleaseId;
|
|
43
|
-
}
|
|
44
|
-
if (!isPreview) {
|
|
45
|
-
return void 0;
|
|
46
|
-
}
|
|
47
|
-
return previewReleaseId;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
35
|
// src/logging/logCompositionIssues.ts
|
|
51
36
|
var import_colorette = require("colorette");
|
|
52
37
|
function logCompositionIssues(prefix, issues, colour = "red") {
|
|
@@ -159,20 +144,15 @@ var withUniformGetServerSideProps = (options) => {
|
|
|
159
144
|
edgeApiHost: process.env.UNIFORM_CLI_BASE_EDGE_URL
|
|
160
145
|
});
|
|
161
146
|
return async function wrappedGetServerSideProps(context) {
|
|
162
|
-
var _a
|
|
147
|
+
var _a;
|
|
163
148
|
const { preview, previewData } = context;
|
|
164
|
-
const releaseId = resolvePreviewReleaseId({
|
|
165
|
-
explicitReleaseId: (_a = options == null ? void 0 : options.requestOptions) == null ? void 0 : _a.releaseId,
|
|
166
|
-
isPreview: preview || (options == null ? void 0 : options.preview),
|
|
167
|
-
previewReleaseId: previewData == null ? void 0 : previewData.releaseId
|
|
168
|
-
});
|
|
169
149
|
let composition = void 0;
|
|
170
150
|
let slug = (options == null ? void 0 : options.prefix) ? context.resolvedUrl.replace(new RegExp(`^${options.prefix}`), "") : context.resolvedUrl;
|
|
171
151
|
if (options == null ? void 0 : options.modifySlug) {
|
|
172
152
|
slug = options.modifySlug(slug, context);
|
|
173
153
|
}
|
|
174
154
|
if (previewData == null ? void 0 : previewData.isUniformContextualEditing) {
|
|
175
|
-
composition = { ...import_canvas.EMPTY_COMPOSITION, _id: (
|
|
155
|
+
composition = { ...import_canvas.EMPTY_COMPOSITION, _id: (_a = previewData.compositionId) != null ? _a : import_canvas.EMPTY_COMPOSITION._id };
|
|
176
156
|
} else {
|
|
177
157
|
try {
|
|
178
158
|
const time = Date.now();
|
|
@@ -180,8 +160,7 @@ var withUniformGetServerSideProps = (options) => {
|
|
|
180
160
|
...options == null ? void 0 : options.requestOptions,
|
|
181
161
|
slug,
|
|
182
162
|
state: preview || (options == null ? void 0 : options.preview) ? import_canvas.CANVAS_DRAFT_STATE : import_canvas.CANVAS_PUBLISHED_STATE,
|
|
183
|
-
diagnostics: true
|
|
184
|
-
releaseId
|
|
163
|
+
diagnostics: true
|
|
185
164
|
});
|
|
186
165
|
const duration = Date.now() - time;
|
|
187
166
|
composition = response.composition;
|
|
@@ -254,7 +233,7 @@ var withUniformGetStaticProps = (options) => {
|
|
|
254
233
|
edgeApiHost: process.env.UNIFORM_CLI_BASE_EDGE_URL
|
|
255
234
|
});
|
|
256
235
|
return async function wrappedGetStaticProps(context) {
|
|
257
|
-
var _a2
|
|
236
|
+
var _a2;
|
|
258
237
|
let slugString = resolveSlugFromParams({
|
|
259
238
|
param: options == null ? void 0 : options.param,
|
|
260
239
|
params: context == null ? void 0 : context.params
|
|
@@ -263,22 +242,16 @@ var withUniformGetStaticProps = (options) => {
|
|
|
263
242
|
slugString = options.modifySlug(slugString, context);
|
|
264
243
|
}
|
|
265
244
|
const { preview, previewData } = context;
|
|
266
|
-
const releaseId = resolvePreviewReleaseId({
|
|
267
|
-
explicitReleaseId: (_a2 = options == null ? void 0 : options.requestOptions) == null ? void 0 : _a2.releaseId,
|
|
268
|
-
isPreview: preview || (options == null ? void 0 : options.preview),
|
|
269
|
-
previewReleaseId: previewData == null ? void 0 : previewData.releaseId
|
|
270
|
-
});
|
|
271
245
|
let composition = void 0;
|
|
272
246
|
if (previewData == null ? void 0 : previewData.isUniformContextualEditing) {
|
|
273
|
-
composition = { ...import_canvas3.EMPTY_COMPOSITION, _id: (
|
|
247
|
+
composition = { ...import_canvas3.EMPTY_COMPOSITION, _id: (_a2 = previewData.compositionId) != null ? _a2 : import_canvas3.EMPTY_COMPOSITION._id };
|
|
274
248
|
} else {
|
|
275
249
|
try {
|
|
276
250
|
const time = Date.now();
|
|
277
251
|
const response = await canvasClient.getCompositionBySlug({
|
|
278
252
|
slug: slugString,
|
|
279
253
|
state: preview || (options == null ? void 0 : options.preview) ? import_canvas3.CANVAS_DRAFT_STATE : import_canvas3.CANVAS_PUBLISHED_STATE,
|
|
280
|
-
...options == null ? void 0 : options.requestOptions
|
|
281
|
-
releaseId
|
|
254
|
+
...options == null ? void 0 : options.requestOptions
|
|
282
255
|
});
|
|
283
256
|
const duration = Date.now() - time;
|
|
284
257
|
composition = response.composition;
|
package/dist/slug/index.mjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
-
logCompositionResponse
|
|
3
|
-
|
|
4
|
-
} from "../chunk-4YXXKXP3.mjs";
|
|
2
|
+
logCompositionResponse
|
|
3
|
+
} from "../chunk-JQWYBVLI.mjs";
|
|
5
4
|
import {
|
|
6
5
|
resolveSlugFromParams
|
|
7
6
|
} from "../chunk-TR7V6ABJ.mjs";
|
|
@@ -21,20 +20,15 @@ var withUniformGetServerSideProps = (options) => {
|
|
|
21
20
|
edgeApiHost: process.env.UNIFORM_CLI_BASE_EDGE_URL
|
|
22
21
|
});
|
|
23
22
|
return async function wrappedGetServerSideProps(context) {
|
|
24
|
-
var _a
|
|
23
|
+
var _a;
|
|
25
24
|
const { preview, previewData } = context;
|
|
26
|
-
const releaseId = resolvePreviewReleaseId({
|
|
27
|
-
explicitReleaseId: (_a = options == null ? void 0 : options.requestOptions) == null ? void 0 : _a.releaseId,
|
|
28
|
-
isPreview: preview || (options == null ? void 0 : options.preview),
|
|
29
|
-
previewReleaseId: previewData == null ? void 0 : previewData.releaseId
|
|
30
|
-
});
|
|
31
25
|
let composition = void 0;
|
|
32
26
|
let slug = (options == null ? void 0 : options.prefix) ? context.resolvedUrl.replace(new RegExp(`^${options.prefix}`), "") : context.resolvedUrl;
|
|
33
27
|
if (options == null ? void 0 : options.modifySlug) {
|
|
34
28
|
slug = options.modifySlug(slug, context);
|
|
35
29
|
}
|
|
36
30
|
if (previewData == null ? void 0 : previewData.isUniformContextualEditing) {
|
|
37
|
-
composition = { ...EMPTY_COMPOSITION, _id: (
|
|
31
|
+
composition = { ...EMPTY_COMPOSITION, _id: (_a = previewData.compositionId) != null ? _a : EMPTY_COMPOSITION._id };
|
|
38
32
|
} else {
|
|
39
33
|
try {
|
|
40
34
|
const time = Date.now();
|
|
@@ -42,8 +36,7 @@ var withUniformGetServerSideProps = (options) => {
|
|
|
42
36
|
...options == null ? void 0 : options.requestOptions,
|
|
43
37
|
slug,
|
|
44
38
|
state: preview || (options == null ? void 0 : options.preview) ? CANVAS_DRAFT_STATE : CANVAS_PUBLISHED_STATE,
|
|
45
|
-
diagnostics: true
|
|
46
|
-
releaseId
|
|
39
|
+
diagnostics: true
|
|
47
40
|
});
|
|
48
41
|
const duration = Date.now() - time;
|
|
49
42
|
composition = response.composition;
|
|
@@ -113,7 +106,7 @@ var withUniformGetStaticProps = (options) => {
|
|
|
113
106
|
edgeApiHost: process.env.UNIFORM_CLI_BASE_EDGE_URL
|
|
114
107
|
});
|
|
115
108
|
return async function wrappedGetStaticProps(context) {
|
|
116
|
-
var _a2
|
|
109
|
+
var _a2;
|
|
117
110
|
let slugString = resolveSlugFromParams({
|
|
118
111
|
param: options == null ? void 0 : options.param,
|
|
119
112
|
params: context == null ? void 0 : context.params
|
|
@@ -122,22 +115,16 @@ var withUniformGetStaticProps = (options) => {
|
|
|
122
115
|
slugString = options.modifySlug(slugString, context);
|
|
123
116
|
}
|
|
124
117
|
const { preview, previewData } = context;
|
|
125
|
-
const releaseId = resolvePreviewReleaseId({
|
|
126
|
-
explicitReleaseId: (_a2 = options == null ? void 0 : options.requestOptions) == null ? void 0 : _a2.releaseId,
|
|
127
|
-
isPreview: preview || (options == null ? void 0 : options.preview),
|
|
128
|
-
previewReleaseId: previewData == null ? void 0 : previewData.releaseId
|
|
129
|
-
});
|
|
130
118
|
let composition = void 0;
|
|
131
119
|
if (previewData == null ? void 0 : previewData.isUniformContextualEditing) {
|
|
132
|
-
composition = { ...EMPTY_COMPOSITION2, _id: (
|
|
120
|
+
composition = { ...EMPTY_COMPOSITION2, _id: (_a2 = previewData.compositionId) != null ? _a2 : EMPTY_COMPOSITION2._id };
|
|
133
121
|
} else {
|
|
134
122
|
try {
|
|
135
123
|
const time = Date.now();
|
|
136
124
|
const response = await canvasClient.getCompositionBySlug({
|
|
137
125
|
slug: slugString,
|
|
138
126
|
state: preview || (options == null ? void 0 : options.preview) ? CANVAS_DRAFT_STATE3 : CANVAS_PUBLISHED_STATE3,
|
|
139
|
-
...options == null ? void 0 : options.requestOptions
|
|
140
|
-
releaseId
|
|
127
|
+
...options == null ? void 0 : options.requestOptions
|
|
141
128
|
});
|
|
142
129
|
const duration = Date.now() - time;
|
|
143
130
|
composition = response.composition;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/canvas-next",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.57.1",
|
|
4
4
|
"description": "Next.js SDK for Uniform Canvas",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -67,12 +67,12 @@
|
|
|
67
67
|
"document:prebuild": "api-extractor run --local"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@uniformdev/canvas": "20.
|
|
71
|
-
"@uniformdev/canvas-react": "20.
|
|
72
|
-
"@uniformdev/context": "20.
|
|
73
|
-
"@uniformdev/project-map": "20.
|
|
74
|
-
"@uniformdev/redirect": "20.
|
|
75
|
-
"@uniformdev/richtext": "20.
|
|
70
|
+
"@uniformdev/canvas": "20.57.1",
|
|
71
|
+
"@uniformdev/canvas-react": "20.57.1",
|
|
72
|
+
"@uniformdev/context": "20.57.1",
|
|
73
|
+
"@uniformdev/project-map": "20.57.1",
|
|
74
|
+
"@uniformdev/redirect": "20.57.1",
|
|
75
|
+
"@uniformdev/richtext": "20.57.1",
|
|
76
76
|
"colorette": "2.0.20"
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|
|
@@ -92,5 +92,5 @@
|
|
|
92
92
|
"publishConfig": {
|
|
93
93
|
"access": "public"
|
|
94
94
|
},
|
|
95
|
-
"gitHead": "
|
|
95
|
+
"gitHead": "1e3550de803a5532c1facf22ce6513001c847650"
|
|
96
96
|
}
|