@sitecore-content-sdk/nextjs 1.5.3-canary.8 → 1.5.3-canary.9

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.
Files changed (29) hide show
  1. package/dist/cjs/client/sitecore-nextjs-client.js +19 -0
  2. package/dist/cjs/editing/constants.js +6 -1
  3. package/dist/cjs/editing/editing-render-middleware.js +4 -2
  4. package/dist/cjs/editing/utils.js +5 -2
  5. package/dist/cjs/middleware/index.js +3 -1
  6. package/dist/cjs/middleware/middleware.js +7 -1
  7. package/dist/cjs/middleware/preview-middleware.js +73 -0
  8. package/dist/cjs/route-handler/editing-render-route-handler.js +18 -6
  9. package/dist/esm/client/sitecore-nextjs-client.js +19 -0
  10. package/dist/esm/editing/constants.js +5 -0
  11. package/dist/esm/editing/editing-render-middleware.js +4 -2
  12. package/dist/esm/editing/utils.js +5 -2
  13. package/dist/esm/middleware/index.js +1 -0
  14. package/dist/esm/middleware/middleware.js +7 -1
  15. package/dist/esm/middleware/preview-middleware.js +69 -0
  16. package/dist/esm/route-handler/editing-render-route-handler.js +18 -6
  17. package/package.json +4 -4
  18. package/types/client/sitecore-nextjs-client.d.ts +7 -0
  19. package/types/client/sitecore-nextjs-client.d.ts.map +1 -1
  20. package/types/editing/constants.d.ts +5 -0
  21. package/types/editing/constants.d.ts.map +1 -1
  22. package/types/editing/editing-render-middleware.d.ts.map +1 -1
  23. package/types/editing/utils.d.ts.map +1 -1
  24. package/types/middleware/index.d.ts +1 -0
  25. package/types/middleware/index.d.ts.map +1 -1
  26. package/types/middleware/middleware.d.ts.map +1 -1
  27. package/types/middleware/preview-middleware.d.ts +21 -0
  28. package/types/middleware/preview-middleware.d.ts.map +1 -0
  29. package/types/route-handler/editing-render-route-handler.d.ts.map +1 -1
@@ -14,6 +14,7 @@ const client_1 = require("@sitecore-content-sdk/core/client");
14
14
  const component_props_service_1 = require("../services/component-props-service");
15
15
  const site_1 = require("@sitecore-content-sdk/core/site");
16
16
  const personalize_1 = require("@sitecore-content-sdk/core/personalize");
17
+ const constants_1 = require("../editing/constants");
17
18
  /**
18
19
  * The SitecoreNextjsClient class extends the SitecoreClient class to provide additional functionality for Next.js.
19
20
  * @public
@@ -179,6 +180,24 @@ class SitecoreNextjsClient extends client_1.SitecoreClient {
179
180
  return componentProps;
180
181
  });
181
182
  }
183
+ /**
184
+ * **NOTE**: App Router only.
185
+ * Retrieves preview data from the request headers
186
+ * @param {Headers} headers - The headers from the incoming request.
187
+ * @returns {PreviewData} The preview data.
188
+ */
189
+ getPreviewData(headers) {
190
+ var _a;
191
+ const packed = (_a = headers.get(constants_1.EDITING_PARAMS_HEADER)) !== null && _a !== void 0 ? _a : '';
192
+ if (!packed)
193
+ return {};
194
+ try {
195
+ return JSON.parse(packed);
196
+ }
197
+ catch (_b) {
198
+ return {};
199
+ }
200
+ }
182
201
  getComponentPropsService() {
183
202
  return new component_props_service_1.ComponentPropsService();
184
203
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EDITING_PASS_THROUGH_HEADERS = exports.QUERY_PARAM_VERCEL_SET_BYPASS_COOKIE = exports.QUERY_PARAM_VERCEL_PROTECTION_BYPASS = void 0;
3
+ exports.EDITING_PARAMS_HEADER = exports.EDITING_PASS_THROUGH_HEADERS = exports.QUERY_PARAM_VERCEL_SET_BYPASS_COOKIE = exports.QUERY_PARAM_VERCEL_PROTECTION_BYPASS = void 0;
4
4
  exports.QUERY_PARAM_VERCEL_PROTECTION_BYPASS = 'x-vercel-protection-bypass';
5
5
  exports.QUERY_PARAM_VERCEL_SET_BYPASS_COOKIE = 'x-vercel-set-bypass-cookie';
6
6
  /**
@@ -8,3 +8,8 @@ exports.QUERY_PARAM_VERCEL_SET_BYPASS_COOKIE = 'x-vercel-set-bypass-cookie';
8
8
  * Note these are in lowercase format to match expected `IncomingHttpHeaders`.
9
9
  */
10
10
  exports.EDITING_PASS_THROUGH_HEADERS = ['authorization', 'cookie'];
11
+ /**
12
+ * Header used to propagate editing preview parameters from the editing render
13
+ * route handler to the Next.js page when running in App Router.
14
+ */
15
+ exports.EDITING_PARAMS_HEADER = 'x-sitecore-editing-params';
@@ -17,6 +17,7 @@ const utils_1 = require("../utils/utils");
17
17
  const render_middleware_1 = require("./render-middleware");
18
18
  const utils_2 = require("@sitecore-content-sdk/core/utils");
19
19
  const utils_3 = require("./utils");
20
+ const constants_1 = require("./constants");
20
21
  /**
21
22
  * Middleware / handler for use in the editing render Next.js API route (e.g. '/api/editing/render')
22
23
  * which is required for Sitecore editing support.
@@ -85,7 +86,8 @@ class EditingRenderMiddleware extends render_middleware_1.RenderMiddlewareBase {
85
86
  });
86
87
  }
87
88
  const previewDataParams = (0, utils_3.mapEditingParams)(query);
88
- res.setPreviewData(Object.assign(Object.assign({}, previewDataParams), { variantIds: (_b = previewDataParams.variantIds) === null || _b === void 0 ? void 0 : _b.split(',') }), {
89
+ const previewData = Object.assign(Object.assign({}, previewDataParams), { variantIds: (_b = previewDataParams.variantIds) === null || _b === void 0 ? void 0 : _b.split(',') });
90
+ res.setPreviewData(previewData, {
89
91
  maxAge: 3,
90
92
  });
91
93
  // Set Preview mode identifier cookie, if the page is rendered in Sitecore Preview mode
@@ -108,7 +110,7 @@ class EditingRenderMiddleware extends render_middleware_1.RenderMiddlewareBase {
108
110
  // Get query string parameters to propagate on subsequent requests (e.g. for deployment protection bypass)
109
111
  const propagatedQsParams = (0, utils_3.getQueryParamsForPropagation)(query);
110
112
  // Get headers to propagate on subsequent requests
111
- const propagatedHeaders = (0, utils_3.getHeadersForPropagation)(headers);
113
+ const propagatedHeaders = Object.assign(Object.assign({}, (0, utils_3.getHeadersForPropagation)(headers)), { [constants_1.EDITING_PARAMS_HEADER]: JSON.stringify(previewData) });
112
114
  const html = yield (0, utils_3.getEditingRequestHtml)(requestUrl, propagatedQsParams, propagatedHeaders, cookies, this.dataFetcher);
113
115
  // remove preview cookies to not leak them to the browser
114
116
  if (cookies && Array.isArray(cookies)) {
@@ -163,6 +163,7 @@ exports.getHeadersForPropagation = getHeadersForPropagation;
163
163
  * @returns {string} HTML with editing markup
164
164
  */
165
165
  const getEditingRequestHtml = (requestUrl, propagatedQsParams, propagatedHeaders, cookies, dataFetcher) => __awaiter(void 0, void 0, void 0, function* () {
166
+ var _a;
166
167
  // Grab the Next.js preview cookies to send on to the render request
167
168
  propagatedHeaders.cookie = `${propagatedHeaders.cookie ? propagatedHeaders.cookie + ';' : ''}${cookies.join(';')}`;
168
169
  // enable content sdk preview
@@ -181,12 +182,14 @@ const getEditingRequestHtml = (requestUrl, propagatedQsParams, propagatedHeaders
181
182
  .catch((err) => {
182
183
  // We need to handle not found error provided by Vercel
183
184
  // for `fallback: false` pages
184
- if (err.response.status === 404) {
185
+ // Or preview content is not found or access is denied
186
+ if (err.response.status === 404 || err.response.status === 403) {
185
187
  return err.response;
186
188
  }
187
189
  throw err;
188
190
  });
189
- let html = pageRes.data;
191
+ // pageRes.data.html can be passed by middleware
192
+ let html = typeof pageRes.data === 'string' ? pageRes.data : ((_a = pageRes.data) === null || _a === void 0 ? void 0 : _a.html) || '';
190
193
  if (!html || html.length === 0) {
191
194
  throw new Error(`Failed to render html for ${requestUrl.toString()}`);
192
195
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.REDIRECT_TYPE_SERVER_TRANSFER = exports.REDIRECT_TYPE_302 = exports.REDIRECT_TYPE_301 = exports.RedirectsService = exports.PersonalizeService = exports.LocaleMiddleware = exports.RobotsMiddleware = exports.SitemapMiddleware = exports.AppRouterMultisiteMiddleware = exports.MultisiteMiddleware = exports.PersonalizeMiddleware = exports.RedirectsMiddleware = exports.defineMiddleware = exports.Middleware = exports.MiddlewareBase = exports.debug = void 0;
3
+ exports.REDIRECT_TYPE_SERVER_TRANSFER = exports.REDIRECT_TYPE_302 = exports.REDIRECT_TYPE_301 = exports.RedirectsService = exports.PreviewMiddleware = exports.PersonalizeService = exports.LocaleMiddleware = exports.RobotsMiddleware = exports.SitemapMiddleware = exports.AppRouterMultisiteMiddleware = exports.MultisiteMiddleware = exports.PersonalizeMiddleware = exports.RedirectsMiddleware = exports.defineMiddleware = exports.Middleware = exports.MiddlewareBase = exports.debug = void 0;
4
4
  var core_1 = require("@sitecore-content-sdk/core");
5
5
  Object.defineProperty(exports, "debug", { enumerable: true, get: function () { return core_1.debug; } });
6
6
  var middleware_1 = require("./middleware");
@@ -23,6 +23,8 @@ var locale_middleware_1 = require("./locale-middleware");
23
23
  Object.defineProperty(exports, "LocaleMiddleware", { enumerable: true, get: function () { return locale_middleware_1.LocaleMiddleware; } });
24
24
  var personalize_1 = require("@sitecore-content-sdk/core/personalize");
25
25
  Object.defineProperty(exports, "PersonalizeService", { enumerable: true, get: function () { return personalize_1.PersonalizeService; } });
26
+ var preview_middleware_1 = require("./preview-middleware");
27
+ Object.defineProperty(exports, "PreviewMiddleware", { enumerable: true, get: function () { return preview_middleware_1.PreviewMiddleware; } });
26
28
  var site_1 = require("@sitecore-content-sdk/core/site");
27
29
  Object.defineProperty(exports, "RedirectsService", { enumerable: true, get: function () { return site_1.RedirectsService; } });
28
30
  Object.defineProperty(exports, "REDIRECT_TYPE_301", { enumerable: true, get: function () { return site_1.REDIRECT_TYPE_301; } });
@@ -186,7 +186,13 @@ const defineMiddleware = (...middlewares) => {
186
186
  const response = res || server_1.NextResponse.next();
187
187
  core_1.debug.common('middleware start');
188
188
  const start = Date.now();
189
- const middlewareResponse = yield middlewares.reduce((p, middleware) => p.then((res) => middleware.handle(req, res, ev)), Promise.resolve(response));
189
+ const middlewareResponse = yield middlewares.reduce((p, middleware) => p.then((res) => {
190
+ // Short-circuit the remaining middlewares once a previous one
191
+ // denied the request (e.g. PreviewMiddleware returning 403).
192
+ if (res.status === 403)
193
+ return res;
194
+ return middleware.handle(req, res, ev);
195
+ }), Promise.resolve(response));
190
196
  core_1.debug.common('middleware end in %dms', Date.now() - start);
191
197
  return middlewareResponse;
192
198
  }),
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.PreviewMiddleware = void 0;
13
+ const server_1 = require("next/server");
14
+ const middleware_1 = require("./middleware");
15
+ const constants_1 = require("../editing/constants");
16
+ const site_1 = require("@sitecore-content-sdk/core/site");
17
+ const core_1 = require("@sitecore-content-sdk/core");
18
+ /**
19
+ * Middleware for preview requests. Acts as a gateway for preview requests.
20
+ * Currently it only supports internal editing hosts deployed on Sitecore AI.
21
+ * @public
22
+ */
23
+ class PreviewMiddleware extends middleware_1.MiddlewareBase {
24
+ constructor(config) {
25
+ // PreviewMiddleware does not need site resolution
26
+ super(Object.assign(Object.assign({}, config), { sites: [] }));
27
+ this.handle = (req, res) => __awaiter(this, void 0, void 0, function* () {
28
+ var _a, _b;
29
+ // Run only in internal editing host
30
+ if (!process.env.SITECORE) {
31
+ return res;
32
+ }
33
+ const previewParams = req.headers.get(constants_1.EDITING_PARAMS_HEADER);
34
+ const authHeader = (_a = req.headers.get('Authorization')) !== null && _a !== void 0 ? _a : '';
35
+ let editingOptions = previewParams ? JSON.parse(previewParams) : null;
36
+ core_1.debug.editing('preview middleware start');
37
+ // Process only preview requests (e.g. non editing or design studio)
38
+ if (editingOptions && editingOptions.mode !== 'preview') {
39
+ core_1.debug.editing('preview middleware skipped (mode is not preview)');
40
+ return res;
41
+ }
42
+ let pageData = null;
43
+ // Scenario when the request is coming from /api/editing/render endpoint
44
+ if (editingOptions) {
45
+ pageData = yield this.client.getPreview(editingOptions, {
46
+ headers: {
47
+ Authorization: authHeader,
48
+ },
49
+ });
50
+ }
51
+ else {
52
+ // Scenario when the page is requested using direct path or navigation is performed
53
+ pageData = yield this.client.getPage(req.nextUrl.pathname, {
54
+ site: (_b = req.cookies.get(site_1.SITE_KEY)) === null || _b === void 0 ? void 0 : _b.value,
55
+ locale: this.getLanguage(req),
56
+ }, {
57
+ headers: {
58
+ Authorization: authHeader,
59
+ },
60
+ });
61
+ }
62
+ // Preview content is not found or access is denied
63
+ if (!pageData) {
64
+ core_1.debug.editing('preview content is not found or access is denied');
65
+ return server_1.NextResponse.json({ html: 'Preview content is not found or access is denied' }, { status: 403 });
66
+ }
67
+ core_1.debug.editing('preview middleware end');
68
+ return res;
69
+ });
70
+ this.client = config.client;
71
+ }
72
+ }
73
+ exports.PreviewMiddleware = PreviewMiddleware;
@@ -18,6 +18,7 @@ const layout_1 = require("@sitecore-content-sdk/core/layout");
18
18
  const utils_2 = require("../utils/utils");
19
19
  const headers_1 = require("next/headers");
20
20
  const utils_3 = require("../editing/utils");
21
+ const constants_1 = require("../editing/constants");
21
22
  const site_1 = require("@sitecore-content-sdk/core/site");
22
23
  /**
23
24
  * Helper function to handle cookie operations - can be mocked for testing
@@ -150,11 +151,17 @@ const createEditingRenderRouteHandlers = (options) => {
150
151
  const convertedCookies = cookieStore.getAll().map((c) => `${c.name}=${c.value}`);
151
152
  try {
152
153
  core_1.debug.editing('fetching page route for %s', query.route);
153
- // Get query string parameters to propagate on subsequent requests (e.g. for deployment protection bypass)
154
- // Additionally ,in app router preview data is passed through query string instead of preview data cookie
155
- const propagatedQsParams = Object.assign(Object.assign({}, (0, utils_3.getQueryParamsForPropagation)(query)), (0, utils_3.mapEditingParams)(query));
156
- // Get headers to propagate on subsequent requests
157
- const propagatedHeaders = (0, utils_3.getHeadersForPropagation)(headers);
154
+ // Editing preview data, mapped from the incoming `sc_*` query parameters
155
+ // into the typed shape consumed by preview methods.
156
+ const editingPreviewData = Object.assign({}, (0, utils_3.mapEditingParams)(query));
157
+ // Query string parameters required by the runtime/platform itself
158
+ // (e.g. Vercel deployment protection bypass tokens). Editing preview
159
+ // data is also appended here for backward compatibility with apps that
160
+ // still read `searchParams` in the page; new code should consume the
161
+ // `EDITING_PARAMS_HEADER` instead via `client.getPreviewInputs`.
162
+ // TODO: Remove preview data from qs before next major release.
163
+ const propagatedQsParams = Object.assign(Object.assign({}, (0, utils_3.getQueryParamsForPropagation)(query)), editingPreviewData);
164
+ const propagatedHeaders = Object.assign(Object.assign({}, (0, utils_3.getHeadersForPropagation)(headers)), { [constants_1.EDITING_PARAMS_HEADER]: JSON.stringify(editingPreviewData) });
158
165
  const html = yield (0, utils_3.getEditingRequestHtml)(requestUrl, propagatedQsParams, propagatedHeaders, convertedCookies, dataFetcher);
159
166
  // remove nextjs preview cookies to not leak them to the browser
160
167
  const filteredCookies = (0, utils_3.cleanupNextPreviewCookies)(convertedCookies);
@@ -211,7 +218,11 @@ const createEditingRenderRouteHandlers = (options) => {
211
218
  req.nextUrl.searchParams.forEach((value, key) => {
212
219
  query[key] = value;
213
220
  });
214
- const propagatedQsParams = Object.assign(Object.assign({}, (0, utils_3.getQueryParamsForPropagation)(query)), (0, utils_3.mapEditingParams)(query));
221
+ const editingPreviewData = Object.assign({}, (0, utils_3.mapEditingParams)(query));
222
+ /**
223
+ * TODO: Remove preview data from qs before next major release.
224
+ */
225
+ const propagatedQsParams = Object.assign(Object.assign({}, (0, utils_3.getQueryParamsForPropagation)(query)), editingPreviewData);
215
226
  const base = (0, utils_3.resolveServerUrl)(req);
216
227
  const targetUrl = new URL('/', base);
217
228
  for (const key in propagatedQsParams) {
@@ -232,6 +243,7 @@ const createEditingRenderRouteHandlers = (options) => {
232
243
  : prerenderBypassCookie;
233
244
  const forwardHeaders = new Headers(req.headers);
234
245
  forwardHeaders.set('cookie', forwardCookie);
246
+ forwardHeaders.set(constants_1.EDITING_PARAMS_HEADER, JSON.stringify(editingPreviewData));
235
247
  const forwardedResponse = yield dataFetcher.fetch(targetUrl.toString(), {
236
248
  method: req.method,
237
249
  headers: forwardHeaders,
@@ -11,6 +11,7 @@ import { SitecoreClient, } from '@sitecore-content-sdk/core/client';
11
11
  import { ComponentPropsService } from '../services/component-props-service';
12
12
  import { getSiteRewriteData, normalizeSiteRewrite } from '@sitecore-content-sdk/core/site';
13
13
  import { getPersonalizedRewriteData, normalizePersonalizedRewrite, } from '@sitecore-content-sdk/core/personalize';
14
+ import { EDITING_PARAMS_HEADER } from '../editing/constants';
14
15
  /**
15
16
  * The SitecoreNextjsClient class extends the SitecoreClient class to provide additional functionality for Next.js.
16
17
  * @public
@@ -176,6 +177,24 @@ export class SitecoreNextjsClient extends SitecoreClient {
176
177
  return componentProps;
177
178
  });
178
179
  }
180
+ /**
181
+ * **NOTE**: App Router only.
182
+ * Retrieves preview data from the request headers
183
+ * @param {Headers} headers - The headers from the incoming request.
184
+ * @returns {PreviewData} The preview data.
185
+ */
186
+ getPreviewData(headers) {
187
+ var _a;
188
+ const packed = (_a = headers.get(EDITING_PARAMS_HEADER)) !== null && _a !== void 0 ? _a : '';
189
+ if (!packed)
190
+ return {};
191
+ try {
192
+ return JSON.parse(packed);
193
+ }
194
+ catch (_b) {
195
+ return {};
196
+ }
197
+ }
179
198
  getComponentPropsService() {
180
199
  return new ComponentPropsService();
181
200
  }
@@ -5,3 +5,8 @@ export const QUERY_PARAM_VERCEL_SET_BYPASS_COOKIE = 'x-vercel-set-bypass-cookie'
5
5
  * Note these are in lowercase format to match expected `IncomingHttpHeaders`.
6
6
  */
7
7
  export const EDITING_PASS_THROUGH_HEADERS = ['authorization', 'cookie'];
8
+ /**
9
+ * Header used to propagate editing preview parameters from the editing render
10
+ * route handler to the Next.js page when running in App Router.
11
+ */
12
+ export const EDITING_PARAMS_HEADER = 'x-sitecore-editing-params';
@@ -14,6 +14,7 @@ import { getEditingSecret } from '../utils/utils';
14
14
  import { RenderMiddlewareBase } from './render-middleware';
15
15
  import { getEnforcedCorsHeaders } from '@sitecore-content-sdk/core/utils';
16
16
  import { getPreviewCookies, getRequiredEditingParamsList, mapEditingParams, cleanupNextPreviewCookies, getQueryParamsForPropagation, getHeadersForPropagation, getEditingRequestHtml, getCSPHeader, resolveServerUrl, } from './utils';
17
+ import { EDITING_PARAMS_HEADER } from './constants';
17
18
  /**
18
19
  * Middleware / handler for use in the editing render Next.js API route (e.g. '/api/editing/render')
19
20
  * which is required for Sitecore editing support.
@@ -82,7 +83,8 @@ export class EditingRenderMiddleware extends RenderMiddlewareBase {
82
83
  });
83
84
  }
84
85
  const previewDataParams = mapEditingParams(query);
85
- res.setPreviewData(Object.assign(Object.assign({}, previewDataParams), { variantIds: (_b = previewDataParams.variantIds) === null || _b === void 0 ? void 0 : _b.split(',') }), {
86
+ const previewData = Object.assign(Object.assign({}, previewDataParams), { variantIds: (_b = previewDataParams.variantIds) === null || _b === void 0 ? void 0 : _b.split(',') });
87
+ res.setPreviewData(previewData, {
86
88
  maxAge: 3,
87
89
  });
88
90
  // Set Preview mode identifier cookie, if the page is rendered in Sitecore Preview mode
@@ -105,7 +107,7 @@ export class EditingRenderMiddleware extends RenderMiddlewareBase {
105
107
  // Get query string parameters to propagate on subsequent requests (e.g. for deployment protection bypass)
106
108
  const propagatedQsParams = getQueryParamsForPropagation(query);
107
109
  // Get headers to propagate on subsequent requests
108
- const propagatedHeaders = getHeadersForPropagation(headers);
110
+ const propagatedHeaders = Object.assign(Object.assign({}, getHeadersForPropagation(headers)), { [EDITING_PARAMS_HEADER]: JSON.stringify(previewData) });
109
111
  const html = yield getEditingRequestHtml(requestUrl, propagatedQsParams, propagatedHeaders, cookies, this.dataFetcher);
110
112
  // remove preview cookies to not leak them to the browser
111
113
  if (cookies && Array.isArray(cookies)) {
@@ -153,6 +153,7 @@ export const getHeadersForPropagation = (headers) => {
153
153
  * @returns {string} HTML with editing markup
154
154
  */
155
155
  export const getEditingRequestHtml = (requestUrl, propagatedQsParams, propagatedHeaders, cookies, dataFetcher) => __awaiter(void 0, void 0, void 0, function* () {
156
+ var _a;
156
157
  // Grab the Next.js preview cookies to send on to the render request
157
158
  propagatedHeaders.cookie = `${propagatedHeaders.cookie ? propagatedHeaders.cookie + ';' : ''}${cookies.join(';')}`;
158
159
  // enable content sdk preview
@@ -171,12 +172,14 @@ export const getEditingRequestHtml = (requestUrl, propagatedQsParams, propagated
171
172
  .catch((err) => {
172
173
  // We need to handle not found error provided by Vercel
173
174
  // for `fallback: false` pages
174
- if (err.response.status === 404) {
175
+ // Or preview content is not found or access is denied
176
+ if (err.response.status === 404 || err.response.status === 403) {
175
177
  return err.response;
176
178
  }
177
179
  throw err;
178
180
  });
179
- let html = pageRes.data;
181
+ // pageRes.data.html can be passed by middleware
182
+ let html = typeof pageRes.data === 'string' ? pageRes.data : ((_a = pageRes.data) === null || _a === void 0 ? void 0 : _a.html) || '';
180
183
  if (!html || html.length === 0) {
181
184
  throw new Error(`Failed to render html for ${requestUrl.toString()}`);
182
185
  }
@@ -8,4 +8,5 @@ export { SitemapMiddleware } from './sitemap-middleware';
8
8
  export { RobotsMiddleware } from './robots-middleware';
9
9
  export { LocaleMiddleware } from './locale-middleware';
10
10
  export { PersonalizeService, } from '@sitecore-content-sdk/core/personalize';
11
+ export { PreviewMiddleware } from './preview-middleware';
11
12
  export { RedirectsService, REDIRECT_TYPE_301, REDIRECT_TYPE_302, REDIRECT_TYPE_SERVER_TRANSFER, } from '@sitecore-content-sdk/core/site';
@@ -181,7 +181,13 @@ export const defineMiddleware = (...middlewares) => {
181
181
  const response = res || NextResponse.next();
182
182
  debug.common('middleware start');
183
183
  const start = Date.now();
184
- const middlewareResponse = yield middlewares.reduce((p, middleware) => p.then((res) => middleware.handle(req, res, ev)), Promise.resolve(response));
184
+ const middlewareResponse = yield middlewares.reduce((p, middleware) => p.then((res) => {
185
+ // Short-circuit the remaining middlewares once a previous one
186
+ // denied the request (e.g. PreviewMiddleware returning 403).
187
+ if (res.status === 403)
188
+ return res;
189
+ return middleware.handle(req, res, ev);
190
+ }), Promise.resolve(response));
185
191
  debug.common('middleware end in %dms', Date.now() - start);
186
192
  return middlewareResponse;
187
193
  }),
@@ -0,0 +1,69 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { NextResponse } from 'next/server';
11
+ import { MiddlewareBase } from './middleware';
12
+ import { EDITING_PARAMS_HEADER } from '../editing/constants';
13
+ import { SITE_KEY } from '@sitecore-content-sdk/core/site';
14
+ import { debug } from '@sitecore-content-sdk/core';
15
+ /**
16
+ * Middleware for preview requests. Acts as a gateway for preview requests.
17
+ * Currently it only supports internal editing hosts deployed on Sitecore AI.
18
+ * @public
19
+ */
20
+ export class PreviewMiddleware extends MiddlewareBase {
21
+ constructor(config) {
22
+ // PreviewMiddleware does not need site resolution
23
+ super(Object.assign(Object.assign({}, config), { sites: [] }));
24
+ this.handle = (req, res) => __awaiter(this, void 0, void 0, function* () {
25
+ var _a, _b;
26
+ // Run only in internal editing host
27
+ if (!process.env.SITECORE) {
28
+ return res;
29
+ }
30
+ const previewParams = req.headers.get(EDITING_PARAMS_HEADER);
31
+ const authHeader = (_a = req.headers.get('Authorization')) !== null && _a !== void 0 ? _a : '';
32
+ let editingOptions = previewParams ? JSON.parse(previewParams) : null;
33
+ debug.editing('preview middleware start');
34
+ // Process only preview requests (e.g. non editing or design studio)
35
+ if (editingOptions && editingOptions.mode !== 'preview') {
36
+ debug.editing('preview middleware skipped (mode is not preview)');
37
+ return res;
38
+ }
39
+ let pageData = null;
40
+ // Scenario when the request is coming from /api/editing/render endpoint
41
+ if (editingOptions) {
42
+ pageData = yield this.client.getPreview(editingOptions, {
43
+ headers: {
44
+ Authorization: authHeader,
45
+ },
46
+ });
47
+ }
48
+ else {
49
+ // Scenario when the page is requested using direct path or navigation is performed
50
+ pageData = yield this.client.getPage(req.nextUrl.pathname, {
51
+ site: (_b = req.cookies.get(SITE_KEY)) === null || _b === void 0 ? void 0 : _b.value,
52
+ locale: this.getLanguage(req),
53
+ }, {
54
+ headers: {
55
+ Authorization: authHeader,
56
+ },
57
+ });
58
+ }
59
+ // Preview content is not found or access is denied
60
+ if (!pageData) {
61
+ debug.editing('preview content is not found or access is denied');
62
+ return NextResponse.json({ html: 'Preview content is not found or access is denied' }, { status: 403 });
63
+ }
64
+ debug.editing('preview middleware end');
65
+ return res;
66
+ });
67
+ this.client = config.client;
68
+ }
69
+ }
@@ -14,6 +14,7 @@ import { LayoutServicePageState } from '@sitecore-content-sdk/core/layout';
14
14
  import { getEditingSecret } from '../utils/utils';
15
15
  import { draftMode, cookies as nextCokies } from 'next/headers';
16
16
  import { mapEditingParams, getEditingRequestHtml, cleanupNextPreviewCookies, getHeadersForPropagation, getQueryParamsForPropagation, getRequiredEditingParamsList, getCSPHeader, resolveServerUrl, } from '../editing/utils';
17
+ import { EDITING_PARAMS_HEADER } from '../editing/constants';
17
18
  import { SITE_KEY } from '@sitecore-content-sdk/core/site';
18
19
  /**
19
20
  * Helper function to handle cookie operations - can be mocked for testing
@@ -146,11 +147,17 @@ export const createEditingRenderRouteHandlers = (options) => {
146
147
  const convertedCookies = cookieStore.getAll().map((c) => `${c.name}=${c.value}`);
147
148
  try {
148
149
  debug.editing('fetching page route for %s', query.route);
149
- // Get query string parameters to propagate on subsequent requests (e.g. for deployment protection bypass)
150
- // Additionally ,in app router preview data is passed through query string instead of preview data cookie
151
- const propagatedQsParams = Object.assign(Object.assign({}, getQueryParamsForPropagation(query)), mapEditingParams(query));
152
- // Get headers to propagate on subsequent requests
153
- const propagatedHeaders = getHeadersForPropagation(headers);
150
+ // Editing preview data, mapped from the incoming `sc_*` query parameters
151
+ // into the typed shape consumed by preview methods.
152
+ const editingPreviewData = Object.assign({}, mapEditingParams(query));
153
+ // Query string parameters required by the runtime/platform itself
154
+ // (e.g. Vercel deployment protection bypass tokens). Editing preview
155
+ // data is also appended here for backward compatibility with apps that
156
+ // still read `searchParams` in the page; new code should consume the
157
+ // `EDITING_PARAMS_HEADER` instead via `client.getPreviewInputs`.
158
+ // TODO: Remove preview data from qs before next major release.
159
+ const propagatedQsParams = Object.assign(Object.assign({}, getQueryParamsForPropagation(query)), editingPreviewData);
160
+ const propagatedHeaders = Object.assign(Object.assign({}, getHeadersForPropagation(headers)), { [EDITING_PARAMS_HEADER]: JSON.stringify(editingPreviewData) });
154
161
  const html = yield getEditingRequestHtml(requestUrl, propagatedQsParams, propagatedHeaders, convertedCookies, dataFetcher);
155
162
  // remove nextjs preview cookies to not leak them to the browser
156
163
  const filteredCookies = cleanupNextPreviewCookies(convertedCookies);
@@ -207,7 +214,11 @@ export const createEditingRenderRouteHandlers = (options) => {
207
214
  req.nextUrl.searchParams.forEach((value, key) => {
208
215
  query[key] = value;
209
216
  });
210
- const propagatedQsParams = Object.assign(Object.assign({}, getQueryParamsForPropagation(query)), mapEditingParams(query));
217
+ const editingPreviewData = Object.assign({}, mapEditingParams(query));
218
+ /**
219
+ * TODO: Remove preview data from qs before next major release.
220
+ */
221
+ const propagatedQsParams = Object.assign(Object.assign({}, getQueryParamsForPropagation(query)), editingPreviewData);
211
222
  const base = resolveServerUrl(req);
212
223
  const targetUrl = new URL('/', base);
213
224
  for (const key in propagatedQsParams) {
@@ -228,6 +239,7 @@ export const createEditingRenderRouteHandlers = (options) => {
228
239
  : prerenderBypassCookie;
229
240
  const forwardHeaders = new Headers(req.headers);
230
241
  forwardHeaders.set('cookie', forwardCookie);
242
+ forwardHeaders.set(EDITING_PARAMS_HEADER, JSON.stringify(editingPreviewData));
231
243
  const forwardedResponse = yield dataFetcher.fetch(targetUrl.toString(), {
232
244
  method: req.method,
233
245
  headers: forwardHeaders,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sitecore-content-sdk/nextjs",
3
- "version": "1.5.3-canary.8",
3
+ "version": "1.5.3-canary.9",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "sideEffects": false,
@@ -91,8 +91,8 @@
91
91
  },
92
92
  "dependencies": {
93
93
  "@babel/parser": "^7.27.2",
94
- "@sitecore-content-sdk/core": "1.5.3-canary.8",
95
- "@sitecore-content-sdk/react": "1.5.3-canary.8",
94
+ "@sitecore-content-sdk/core": "1.5.3-canary.9",
95
+ "@sitecore-content-sdk/react": "1.5.3-canary.9",
96
96
  "recast": "^0.23.11",
97
97
  "regex-parser": "^2.3.1",
98
98
  "sync-disk-cache": "^2.1.0"
@@ -171,7 +171,7 @@
171
171
  },
172
172
  "description": "",
173
173
  "types": "types/index.d.ts",
174
- "gitHead": "ad56417c8e38c3a17b0176d13eedd71071569432",
174
+ "gitHead": "a4a5cae100023156d0f15a4129b078d2ff672d2e",
175
175
  "files": [
176
176
  "dist",
177
177
  "types",
@@ -78,6 +78,13 @@ export declare class SitecoreNextjsClient extends SitecoreClient {
78
78
  * @returns {ComponentPropsCollection} component props
79
79
  */
80
80
  getComponentData(layoutData: LayoutServiceData, context: GetServerSidePropsContext | GetStaticPropsContext, components: ComponentMap<NextjsContentSdkComponent>): Promise<ComponentPropsCollection>;
81
+ /**
82
+ * **NOTE**: App Router only.
83
+ * Retrieves preview data from the request headers
84
+ * @param {Headers} headers - The headers from the incoming request.
85
+ * @returns {PreviewData} The preview data.
86
+ */
87
+ getPreviewData(headers: Headers): PreviewData;
81
88
  protected getComponentPropsService(): ComponentPropsService;
82
89
  }
83
90
  //# sourceMappingURL=sitecore-nextjs-client.d.ts.map
@@ -1 +1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AAE,EACf,SAAS,CAAC,EAAE,MAAM,EAAE,EACpB,YAAY,CAAC,EAAE,YAAY,GAC1B,OAAO,CAAC,UAAU,EAAE,CAAC;IAaxB;;;;;;;OAOG;IACG,gBAAgB,CACpB,UAAU,EAAE,iBAAiB,EAC7B,OAAO,EAAE,yBAAyB,GAAG,qBAAqB,EAC1D,UAAU,EAAE,YAAY,CAAC,yBAAyB,CAAC,GAClD,OAAO,CAAC,wBAAwB,CAAC;IA2BpC;;;;;OAKG;IACH,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,WAAW;IAY7C,SAAS,CAAC,wBAAwB,IAAI,qBAAqB;CAG5D"}
@@ -5,4 +5,9 @@ export declare const QUERY_PARAM_VERCEL_SET_BYPASS_COOKIE = "x-vercel-set-bypass
5
5
  * Note these are in lowercase format to match expected `IncomingHttpHeaders`.
6
6
  */
7
7
  export declare const EDITING_PASS_THROUGH_HEADERS: string[];
8
+ /**
9
+ * Header used to propagate editing preview parameters from the editing render
10
+ * route handler to the Next.js page when running in App Router.
11
+ */
12
+ export declare const EDITING_PARAMS_HEADER = "x-sitecore-editing-params";
8
13
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/editing/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oCAAoC,+BAA+B,CAAC;AACjF,eAAO,MAAM,oCAAoC,+BAA+B,CAAC;AAEjF;;;GAGG;AACH,eAAO,MAAM,4BAA4B,UAA8B,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/editing/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oCAAoC,+BAA+B,CAAC;AACjF,eAAO,MAAM,oCAAoC,+BAA+B,CAAC;AAEjF;;;GAGG;AACH,eAAO,MAAM,4BAA4B,UAA8B,CAAC;AAExE;;;GAGG;AACH,eAAO,MAAM,qBAAqB,8BAA8B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"editing-render-middleware.d.ts","sourceRoot":"","sources":["../../src/editing/editing-render-middleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAEvD,OAAO,EAIL,wBAAwB,EACzB,MAAM,oCAAoC,CAAC;AAG5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAc3D;;;GAGG;AACH,MAAM,MAAM,6BAA6B,GAAG;IAC1C;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC;IAC9C;;OAEG;IACH,8BAA8B,CAAC,EAAE,MAAM,CAAC;CACzC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,cAAc,GAAG;IACnD,KAAK,EAAE,wBAAwB,CAAC;CACjC,CAAC;AAEF;;;;GAIG;AACH,qBAAa,uBAAwB,SAAQ,oBAAoB;IAK5C,MAAM,CAAC,EAAE,6BAA6B;IAJzD,OAAO,CAAC,WAAW,CAAoB;IACvC;;OAEG;gBACgB,MAAM,CAAC,EAAE,6BAA6B,YAAA;IAKzD;;;OAGG;IACI,UAAU,IAAI,CAAC,GAAG,EAAE,qBAAqB,EAAE,GAAG,EAAE,eAAe,KAAK,OAAO,CAAC,IAAI,CAAC;IAIxF,OAAO,CAAC,OAAO,CAoJb;CACH"}
1
+ {"version":3,"file":"editing-render-middleware.d.ts","sourceRoot":"","sources":["../../src/editing/editing-render-middleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAEvD,OAAO,EAIL,wBAAwB,EACzB,MAAM,oCAAoC,CAAC;AAG5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAe3D;;;GAGG;AACH,MAAM,MAAM,6BAA6B,GAAG;IAC1C;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE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,MAAM,GAAG,MAAM,CAAA;CAazB,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,GAChC,YAAY,GAAG,EACf,oBAAoB;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;CAAE,EACzD,mBAAmB;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,EAC5C,SAAS,MAAM,EAAE,EACjB,aAAa,iBAAiB,KAC7B,OAAO,CAAC,MAAM,CAkDhB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,GACrC,MAAM,OAAO,KACZ,IAAI,IAAI,8BAOV,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,gBAAgB,GAAI,KAAK,cAAc,GAAG,WAAW,WAmBjE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,cAIxB,CAAC"}
@@ -8,5 +8,6 @@ export { SitemapMiddleware } from './sitemap-middleware';
8
8
  export { RobotsMiddleware } from './robots-middleware';
9
9
  export { LocaleMiddleware, LocaleMiddlewareConfig } from './locale-middleware';
10
10
  export { PersonalizeService, PersonalizeServiceConfig, } from '@sitecore-content-sdk/core/personalize';
11
+ export { PreviewMiddleware, PreviewMiddlewareConfig } from './preview-middleware';
11
12
  export { RedirectsService, RedirectsServiceConfig, REDIRECT_TYPE_301, REDIRECT_TYPE_302, REDIRECT_TYPE_SERVER_TRANSFER, RedirectInfo, } from '@sitecore-content-sdk/core/site';
12
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/middleware/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAClG,OAAO,EAAE,mBAAmB,EAAE,yB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AAG,OAAO;IAIjD;;;;OAIG;IACH,SAAS,CAAC,UAAU,CAAC,GAAG,EAAE,WAAW,GAAG,OAAO;IAmB/C,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,WAAW,EAAE,GAAG,EAAE,YAAY;IAWtD;;;;;OAKG;IACH,SAAS,CAAC,mBAAmB,CAAC,eAAe,EAAE,OAAO;;;IAMtD;;;;;OAKG;IACH,SAAS,CAAC,WAAW,CAAC,GAAG,EAAE,WAAW,EAAE,GAAG,CAAC,EAAE,YAAY,GAAG,MAAM;IAUnE;;;;;OAKG;IACH,SAAS,CAAC,qBAAqB,CAAC,GAAG,CAAC,EAAE,YAAY,GAAG,MAAM,GAAG,SAAS;IAIvE;;;OAGG;IACH,SAAS,CAAC,aAAa,CAAC,GAAG,EAAE,WAAW;IAIxC;;;;;;;OAOG;IACH,SAAS,CAAC,OAAO,CAAC,GAAG,EAAE,WAAW,EAAE,GAAG,CAAC,EAAE,YAAY,GAAG,QAAQ;IAoBjE,SAAS,CAAC,gBAAgB,CAAC,cAAc,EAAE,oBAAoB,GAAG,2BAA2B;IAI7F;;;;;;OAMG;IACH,SAAS,CAAC,OAAO,CACf,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,WAAW,EAChB,GAAG,EAAE,YAAY,EACjB,UAAU,CAAC,EAAE,OAAO,GACnB,YAAY;CAahB;AAED;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAAI,GAAG,aAAa,UAAU,EAAE;IAEzD;;;;;OAKG;gBACe,WAAW,MAAM,cAAc,QAAQ,YAAY;CAyBxE,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { NextRequest, NextResponse } from 'next/server';
2
+ import { MiddlewareBase } from './middleware';
3
+ import { SitecoreClient } from '../client';
4
+ /**
5
+ * Configuration for PreviewMiddleware
6
+ * @public
7
+ */
8
+ export type PreviewMiddlewareConfig = {
9
+ client: SitecoreClient;
10
+ };
11
+ /**
12
+ * Middleware for preview requests. Acts as a gateway for preview requests.
13
+ * Currently it only supports internal editing hosts deployed on Sitecore AI.
14
+ * @public
15
+ */
16
+ export declare class PreviewMiddleware extends MiddlewareBase {
17
+ protected client: SitecoreClient;
18
+ constructor(config: PreviewMiddlewareConfig);
19
+ handle: (req: NextRequest, res: NextResponse) => Promise<NextResponse>;
20
+ }
21
+ //# sourceMappingURL=preview-middleware.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preview-middleware.d.ts","sourceRoot":"","sources":["../../src/middleware/preview-middleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAM3C;;;GAGG;AACH,MAAM,MAAM,uBAAuB,GAAG;IAAE,MAAM,EAAE,cAAc,CAAA;CAAE,CAAC;AAEjE;;;;GAIG;AACH,qBAAa,iBAAkB,SAAQ,cAAc;IACnD,SAAS,CAAC,MAAM,EAAE,cAAc,CAAC;gBAErB,MAAM,EAAE,uBAAuB;IAM3C,MAAM,GAAU,KAAK,WAAW,EAAE,KAAK,YAAY,KAAG,OAAO,CAAC,YAAY,CAAC,CAsDzE;CACH"}
@@ -1 +1 @@
1
- {"version":3,"file":"editing-render-route-handler.d.ts","sourceRoot":"","sources":["../../src/route-handler/editing-render-route-handler.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAgB1C;;;GAGG;AACH,wBAAsB,cAAc,iBAMnC;AAED,KAAK,qBAAqB,GAAG;IAC3B;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC;IAC9C;;OAEG;IACH,8BAA8B,CAAC,EAAE,MAAM,CAAC;CACzC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gCAAgC,GAAI,SAAS,qBAAqB;eAwDrD,WAAW;gBAyJV,WAAW;mBA3Kd,WAAW;CAqRlC,CAAC"}
1
+ {"version":3,"file":"editing-render-route-handler.d.ts","sourceRoot":"","sources":["../../src/route-handler/editing-render-route-handler.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAiB1C;;;GAGG;AACH,wBAAsB,cAAc,iBAMnC;AAED,KAAK,qBAAqB,GAAG;IAC3B;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC;IAC9C;;OAEG;IACH,8BAA8B,CAAC,EAAE,MAAM,CAAC;CACzC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gCAAgC,GAAI,SAAS,qBAAqB;eAwDrD,WAAW;gBAoKV,WAAW;mBAtLd,WAAW;CAwSlC,CAAC"}