@sitecore-content-sdk/nextjs 2.2.0 → 2.2.1-beta.atoms.20260709124639

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.
@@ -18,7 +18,7 @@ const react_2 = require("@sitecore-content-sdk/react");
18
18
  * @param {DesingLibraryAppProps} props - The properties for the Design Library App.
19
19
  * @public
20
20
  */
21
- const DesignLibraryApp = ({ page, componentMap, loadServerImportMap, }) => {
21
+ const DesignLibraryApp = ({ page, componentMap, loadServerImportMap = react_2.noopLoadImportMap, }) => {
22
22
  var _a;
23
23
  const { route } = page.layout.sitecore;
24
24
  if (!route)
@@ -94,7 +94,7 @@ exports.DesignLibraryServer = DesignLibraryServer;
94
94
  * @param {DesignLibraryServerVariantGenerationProps} props The props. {@link DesignLibraryServerVariantGenerationProps}
95
95
  * @returns {JSX.Element} The preview surface, or `null` when not in Design Library mode.
96
96
  */
97
- const DesignLibraryServerVariantGeneration = async ({ page, rendering, loadServerImportMap, componentMap, }) => {
97
+ const DesignLibraryServerVariantGeneration = async ({ page, rendering, loadServerImportMap = react_3.noopLoadImportMap, componentMap, }) => {
98
98
  var _a, _b;
99
99
  let designLibraryStatus = editing_1.DesignLibraryStatus.READY;
100
100
  let importMap;
@@ -107,19 +107,14 @@ const DesignLibraryServerVariantGeneration = async ({ page, rendering, loadServe
107
107
  message: error instanceof Error ? error.message : String(error),
108
108
  });
109
109
  // load importmap and importmap payload to pass to FE
110
- // if not provided, or errors during load set error to pass to FE
111
- if (!loadServerImportMap) {
112
- componentInitError = getComponentInitError(codegen.DesignLibraryPreviewError.ImportMapMissing, 'No loadImportMap provided');
110
+ // if errors during load set error to pass to FE
111
+ try {
112
+ const mod = await loadServerImportMap();
113
+ importMap = mod.default;
114
+ importMapInfo = getImportMapInfo(importMap);
113
115
  }
114
- else {
115
- try {
116
- const mod = await loadServerImportMap();
117
- importMap = mod.default;
118
- importMapInfo = getImportMapInfo(importMap);
119
- }
120
- catch (e) {
121
- componentInitError = getComponentInitError(codegen.DesignLibraryPreviewError.ImportMapLoad, `Error loading import map: ${e}`);
122
- }
116
+ catch (e) {
117
+ componentInitError = getComponentInitError(codegen.DesignLibraryPreviewError.ImportMapLoad, `Error loading import map: ${e}`);
123
118
  }
124
119
  let componentToUpdate = (_b = (_a = rendering === null || rendering === void 0 ? void 0 : rendering.placeholders) === null || _a === void 0 ? void 0 : _a[layout_1.EDITING_COMPONENT_PLACEHOLDER]) === null || _b === void 0 ? void 0 : _b[0];
125
120
  if (!componentToUpdate)
package/dist/cjs/index.js CHANGED
@@ -37,7 +37,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.BYOCWrapper = exports.FEaaSWrapper = exports.BYOCServerWrapper = exports.BYOCClientWrapper = exports.FEaaSServerWrapper = exports.FEaaSClientWrapper = exports.NextImage = exports.Placeholder = exports.RichText = exports.Link = exports.useComponentProps = exports.ComponentPropsContext = exports.ComponentPropsReactContext = exports.ComponentPropsService = exports.normalizeSiteRewrite = exports.getSiteRewriteData = exports.getSiteRewrite = exports.SiteInfoService = exports.SiteResolver = exports.RobotsService = exports.ErrorPagesService = exports.SitemapXmlService = exports.REDIRECT_TYPE_SERVER_TRANSFER = exports.REDIRECT_TYPE_302 = exports.REDIRECT_TYPE_301 = exports.RedirectsService = exports.SitePathService = exports.PersonalizeService = exports.CdpHelper = exports.normalizePersonalizedRewrite = exports.getGroomedVariantIds = exports.getPersonalizedRewriteData = exports.getPersonalizedRewrite = exports.personalizeLayout = exports.DictionaryService = exports.mediaApi = exports.ComponentLayoutService = exports.ErrorPage = exports.RenderingType = exports.EditMode = exports.getContentStylesheetLink = exports.getFieldValue = exports.getChildPlaceholder = exports.LayoutService = exports.LayoutServicePageState = exports.MemoryCacheClient = exports.enableDebug = exports.NativeDataFetcher = exports.constants = exports.debug = void 0;
40
- exports.collectSitecorePageCacheTags = exports.buildSitecoreDictionaryCacheTag = exports.setCachedPageParams = exports.getCachedPageParams = exports.DesignLibraryApp = exports.analyticsProxyAdapter = exports.personalizeProxyAdapter = exports.initContentSdk = exports.renderEmptyPlaceholder = exports.AppPlaceholder = exports.ClientEditingChromesUpdate = exports.Form = exports.EditingScripts = exports.withEmptyFieldEditingComponent = exports.withFieldMetadata = exports.withDatasourceCheck = exports.withPlaceholder = exports.withAppPlaceholder = exports.withEditorChromes = exports.useSitecore = exports.withSitecore = exports.SitecoreProviderReactContext = exports.SitecoreProvider = exports.DefaultEmptyFieldEditingComponentText = exports.DefaultEmptyFieldEditingComponentImage = exports.DesignLibrary = exports.File = exports.getDesignLibraryStylesheetLinks = exports.BYOCComponent = exports.fetchFEaaSComponentServerProps = exports.FEaaSComponent = exports.DateField = exports.Text = exports.Image = void 0;
40
+ exports.collectSitecorePageCacheTags = exports.buildSitecoreDictionaryCacheTag = exports.setCachedPageParams = exports.getCachedPageParams = exports.DesignLibraryApp = exports.analyticsProxyAdapter = exports.personalizeProxyAdapter = exports.initContentSdk = exports.renderEmptyPlaceholder = exports.AppPlaceholder = exports.ClientEditingChromesUpdate = exports.Form = exports.EditingScripts = exports.withEmptyFieldEditingComponent = exports.withFieldMetadata = exports.withDatasourceCheck = exports.withPlaceholder = exports.withAppPlaceholder = exports.withEditorChromes = exports.useSitecore = exports.withSitecore = exports.SitecoreProviderReactContext = exports.SitecoreProvider = exports.noopLoadImportMap = exports.DefaultEmptyFieldEditingComponentText = exports.DefaultEmptyFieldEditingComponentImage = exports.DesignLibrary = exports.File = exports.getDesignLibraryStylesheetLinks = exports.BYOCComponent = exports.fetchFEaaSComponentServerProps = exports.FEaaSComponent = exports.DateField = exports.Text = exports.Image = void 0;
41
41
  var debug_1 = require("./debug");
42
42
  Object.defineProperty(exports, "debug", { enumerable: true, get: function () { return __importDefault(debug_1).default; } });
43
43
  var core_1 = require("@sitecore-content-sdk/core");
@@ -120,6 +120,7 @@ Object.defineProperty(exports, "File", { enumerable: true, get: function () { re
120
120
  Object.defineProperty(exports, "DesignLibrary", { enumerable: true, get: function () { return react_2.DesignLibrary; } });
121
121
  Object.defineProperty(exports, "DefaultEmptyFieldEditingComponentImage", { enumerable: true, get: function () { return react_2.DefaultEmptyFieldEditingComponentImage; } });
122
122
  Object.defineProperty(exports, "DefaultEmptyFieldEditingComponentText", { enumerable: true, get: function () { return react_2.DefaultEmptyFieldEditingComponentText; } });
123
+ Object.defineProperty(exports, "noopLoadImportMap", { enumerable: true, get: function () { return react_2.noopLoadImportMap; } });
123
124
  Object.defineProperty(exports, "SitecoreProvider", { enumerable: true, get: function () { return react_2.SitecoreProvider; } });
124
125
  Object.defineProperty(exports, "SitecoreProviderReactContext", { enumerable: true, get: function () { return react_2.SitecoreProviderReactContext; } });
125
126
  Object.defineProperty(exports, "withSitecore", { enumerable: true, get: function () { return react_2.withSitecore; } });
@@ -127,11 +127,14 @@ class RedirectsProxy extends proxy_1.ProxyBase {
127
127
  // Apply regex replacements to the target URL if the pattern is a regex
128
128
  const sourcePath = existsRedirect.matchedPath || reqUrl.pathname;
129
129
  const pathForCaptureMatch = sourcePath.replace(/\/*$/gi, '') || '/';
130
- const matched = pathForCaptureMatch.match(this.getRedirectPatternRegex(existsRedirect.pattern));
131
- if (matched) {
132
- existsRedirect.target = existsRedirect.target.replace(/\$(\d+)/g, (_, index) => {
133
- return matched[parseInt(index, 10)] || '';
134
- });
130
+ if ((0, tools_1.isRegexOrUrl)(existsRedirect.pattern) === 'regex') {
131
+ const redirectRegex = this.safeCompileRedirectPattern(existsRedirect.pattern);
132
+ const matched = redirectRegex ? pathForCaptureMatch.match(redirectRegex) : null;
133
+ if (matched) {
134
+ existsRedirect.target = existsRedirect.target.replace(/\$(\d+)/g, (_, index) => {
135
+ return matched[parseInt(index, 10)] || '';
136
+ });
137
+ }
135
138
  }
136
139
  const isAbsoluteUrl = REGEXP_ABSOLUTE_URL.test(existsRedirect.target);
137
140
  const redirectedResponse = isAbsoluteUrl
@@ -266,7 +269,7 @@ class RedirectsProxy extends proxy_1.ProxyBase {
266
269
  const patternParts = patternPath.split('/');
267
270
  const maybeLocale = patternParts[1].toLowerCase();
268
271
  // case insensitive lookup of locales
269
- if (new RegExp(this.locales.join('|'), 'i').test(maybeLocale)) {
272
+ if (new RegExp(this.locales.map(tools_1.escapeRegExp).join('|'), 'i').test(maybeLocale)) {
270
273
  patternPath = patternPath.replace(`/${patternParts[1]}`, `/${maybeLocale}`);
271
274
  }
272
275
  return ((patternPath === localePath || patternPath === normalizedPath) &&
@@ -274,7 +277,10 @@ class RedirectsProxy extends proxy_1.ProxyBase {
274
277
  (0, tools_1.areURLSearchParamsEqual)(new URLSearchParams(patternQS), new URLSearchParams(incomingQS))));
275
278
  }
276
279
  // process regex rules
277
- const regex = this.getRedirectPatternRegex(redirect.pattern);
280
+ const regex = this.safeCompileRedirectPattern(redirect.pattern);
281
+ if (!regex) {
282
+ return false;
283
+ }
278
284
  const testRegex = (value) => {
279
285
  regex.lastIndex = 0;
280
286
  return regex.test(value);
@@ -309,7 +315,7 @@ class RedirectsProxy extends proxy_1.ProxyBase {
309
315
  * @private
310
316
  */
311
317
  matchRedirectItemRedirect(redirects, locale, currentPath) {
312
- const nonLocalePath = currentPath.replace(new RegExp(`^\/?${locale}\/`, 'i'), '/');
318
+ const nonLocalePath = currentPath.replace(new RegExp(`^/?${(0, tools_1.escapeRegExp)(locale)}/`, 'i'), '/');
313
319
  return redirects.length
314
320
  ? redirects.find((redirect) => {
315
321
  const patternPath = redirect.pattern.replace(/\/*$/g, '').toLowerCase();
@@ -441,6 +447,23 @@ class RedirectsProxy extends proxy_1.ProxyBase {
441
447
  }
442
448
  return redirect;
443
449
  }
450
+ /**
451
+ * Compiles a redirect pattern to RegExp; returns null if Sitecore produced a malformed rule
452
+ * so one bad entry does not fail the entire redirect chain.
453
+ * @param {string} pattern redirect pattern from redirect map
454
+ * @returns {RegExp | null} normalized regex instance, or null when invalid
455
+ * @private
456
+ */
457
+ safeCompileRedirectPattern(pattern) {
458
+ try {
459
+ return this.getRedirectPatternRegex(pattern);
460
+ }
461
+ catch (error) {
462
+ const message = error instanceof Error ? error.message : String(error);
463
+ console.warn(`[RedirectsProxy] Invalid redirect regex; skipping rule. pattern=${pattern} (${message})`);
464
+ return null;
465
+ }
466
+ }
444
467
  /**
445
468
  * Converts a redirect pattern string into a RegExp.
446
469
  * Supports both JS literal form (`/pattern/i`) and plain regex source (`^/path$`).
@@ -469,7 +492,7 @@ class RedirectsProxy extends proxy_1.ProxyBase {
469
492
  if (!urlLocale) {
470
493
  return path;
471
494
  }
472
- const localePrefixRegex = new RegExp(`^/${urlLocale}(?=/|$)`, 'i');
495
+ const localePrefixRegex = new RegExp(`^/${(0, tools_1.escapeRegExp)(urlLocale)}(?=/|$)`, 'i');
473
496
  const strippedPath = path.replace(localePrefixRegex, '') || '/';
474
497
  return strippedPath.startsWith('/') ? strippedPath : `/${strippedPath}`;
475
498
  }
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { EDITING_COMPONENT_PLACEHOLDER } from '@sitecore-content-sdk/content/layout';
3
3
  import { DesignLibraryServer } from './DesignLibraryServer';
4
- import { DesignLibrary } from '@sitecore-content-sdk/react';
4
+ import { DesignLibrary, noopLoadImportMap } from '@sitecore-content-sdk/react';
5
5
  /**
6
6
  * Design Library component intended to be used by the NextJs app router application
7
7
  * This component serves as a router between client and server component rendering modes for the Design Library.
@@ -12,7 +12,7 @@ import { DesignLibrary } from '@sitecore-content-sdk/react';
12
12
  * @param {DesingLibraryAppProps} props - The properties for the Design Library App.
13
13
  * @public
14
14
  */
15
- export const DesignLibraryApp = ({ page, componentMap, loadServerImportMap, }) => {
15
+ export const DesignLibraryApp = ({ page, componentMap, loadServerImportMap = noopLoadImportMap, }) => {
16
16
  var _a;
17
17
  const { route } = page.layout.sitecore;
18
18
  if (!route)
@@ -6,7 +6,7 @@ import * as globalCache from '@sitecore-content-sdk/core/tools';
6
6
  import { DesignLibraryStatus, COMPONENT_UPDATE_CACHE_KEY_PREFIX, COMPONENT_PREVIEW_CACHE_KEY_PREFIX, updateComponent as updateComponentOriginal, } from '@sitecore-content-sdk/content/editing';
7
7
  import * as codegen from '@sitecore-content-sdk/content/codegen';
8
8
  import { AppPlaceholder, PlaceholderMetadata } from '@sitecore-content-sdk/react';
9
- import { DesignLibraryErrorBoundary, ErrorComponent, } from '@sitecore-content-sdk/react';
9
+ import { DesignLibraryErrorBoundary, ErrorComponent, noopLoadImportMap, } from '@sitecore-content-sdk/react';
10
10
  let { getCacheAndClean, hasCache } = globalCache;
11
11
  let { createComponentInstance, getImportMapInfo } = codegen;
12
12
  let updateComponent = updateComponentOriginal;
@@ -53,7 +53,7 @@ export const DesignLibraryServer = async ({ page, componentMap, rendering, loadS
53
53
  * @param {DesignLibraryServerVariantGenerationProps} props The props. {@link DesignLibraryServerVariantGenerationProps}
54
54
  * @returns {JSX.Element} The preview surface, or `null` when not in Design Library mode.
55
55
  */
56
- export const DesignLibraryServerVariantGeneration = async ({ page, rendering, loadServerImportMap, componentMap, }) => {
56
+ export const DesignLibraryServerVariantGeneration = async ({ page, rendering, loadServerImportMap = noopLoadImportMap, componentMap, }) => {
57
57
  var _a, _b;
58
58
  let designLibraryStatus = DesignLibraryStatus.READY;
59
59
  let importMap;
@@ -66,19 +66,14 @@ export const DesignLibraryServerVariantGeneration = async ({ page, rendering, lo
66
66
  message: error instanceof Error ? error.message : String(error),
67
67
  });
68
68
  // load importmap and importmap payload to pass to FE
69
- // if not provided, or errors during load set error to pass to FE
70
- if (!loadServerImportMap) {
71
- componentInitError = getComponentInitError(codegen.DesignLibraryPreviewError.ImportMapMissing, 'No loadImportMap provided');
69
+ // if errors during load set error to pass to FE
70
+ try {
71
+ const mod = await loadServerImportMap();
72
+ importMap = mod.default;
73
+ importMapInfo = getImportMapInfo(importMap);
72
74
  }
73
- else {
74
- try {
75
- const mod = await loadServerImportMap();
76
- importMap = mod.default;
77
- importMapInfo = getImportMapInfo(importMap);
78
- }
79
- catch (e) {
80
- componentInitError = getComponentInitError(codegen.DesignLibraryPreviewError.ImportMapLoad, `Error loading import map: ${e}`);
81
- }
75
+ catch (e) {
76
+ componentInitError = getComponentInitError(codegen.DesignLibraryPreviewError.ImportMapLoad, `Error loading import map: ${e}`);
82
77
  }
83
78
  let componentToUpdate = (_b = (_a = rendering === null || rendering === void 0 ? void 0 : rendering.placeholders) === null || _a === void 0 ? void 0 : _a[EDITING_COMPONENT_PLACEHOLDER]) === null || _b === void 0 ? void 0 : _b[0];
84
79
  if (!componentToUpdate)
package/dist/esm/index.js CHANGED
@@ -21,7 +21,7 @@ import * as BYOCWrapper from './components/BYOCWrapper';
21
21
  export { FEaaSClientWrapper, FEaaSServerWrapper, BYOCClientWrapper, BYOCServerWrapper, } from '@sitecore-content-sdk/react';
22
22
  export { FEaaSWrapper };
23
23
  export { BYOCWrapper };
24
- export { Image, Text, DateField, FEaaSComponent, fetchFEaaSComponentServerProps, BYOCComponent, getDesignLibraryStylesheetLinks, File, DesignLibrary, DefaultEmptyFieldEditingComponentImage, DefaultEmptyFieldEditingComponentText, SitecoreProvider, SitecoreProviderReactContext, withSitecore, useSitecore, withEditorChromes, withAppPlaceholder, withPlaceholder, withDatasourceCheck, withFieldMetadata, withEmptyFieldEditingComponent, EditingScripts, Form, ClientEditingChromesUpdate, AppPlaceholder, renderEmptyPlaceholder, } from '@sitecore-content-sdk/react';
24
+ export { Image, Text, DateField, FEaaSComponent, fetchFEaaSComponentServerProps, BYOCComponent, getDesignLibraryStylesheetLinks, File, DesignLibrary, DefaultEmptyFieldEditingComponentImage, DefaultEmptyFieldEditingComponentText, noopLoadImportMap, SitecoreProvider, SitecoreProviderReactContext, withSitecore, useSitecore, withEditorChromes, withAppPlaceholder, withPlaceholder, withDatasourceCheck, withFieldMetadata, withEmptyFieldEditingComponent, EditingScripts, Form, ClientEditingChromesUpdate, AppPlaceholder, renderEmptyPlaceholder, } from '@sitecore-content-sdk/react';
25
25
  export { initContentSdk } from '@sitecore-content-sdk/core';
26
26
  export { personalizeProxyAdapter } from './initialization/proxy/personalize-adapter';
27
27
  export { analyticsProxyAdapter } from './initialization/proxy/analytics-adapter';
@@ -1,5 +1,5 @@
1
1
  import { RedirectsService, REDIRECT_TYPE_301, REDIRECT_TYPE_302, REDIRECT_TYPE_SERVER_TRANSFER, } from '@sitecore-content-sdk/content/site';
2
- import { areURLSearchParamsEqual, escapeNonSpecialQuestionMarks, isRegexOrUrl, mergeURLSearchParams, } from '@sitecore-content-sdk/core/tools';
2
+ import { areURLSearchParamsEqual, escapeNonSpecialQuestionMarks, escapeRegExp, isRegexOrUrl, mergeURLSearchParams, } from '@sitecore-content-sdk/core/tools';
3
3
  import { NextResponse } from 'next/server';
4
4
  import { ProxyBase, REWRITE_HEADER_NAME } from './proxy';
5
5
  import debug from '../debug';
@@ -121,11 +121,14 @@ export class RedirectsProxy extends ProxyBase {
121
121
  // Apply regex replacements to the target URL if the pattern is a regex
122
122
  const sourcePath = existsRedirect.matchedPath || reqUrl.pathname;
123
123
  const pathForCaptureMatch = sourcePath.replace(/\/*$/gi, '') || '/';
124
- const matched = pathForCaptureMatch.match(this.getRedirectPatternRegex(existsRedirect.pattern));
125
- if (matched) {
126
- existsRedirect.target = existsRedirect.target.replace(/\$(\d+)/g, (_, index) => {
127
- return matched[parseInt(index, 10)] || '';
128
- });
124
+ if (isRegexOrUrl(existsRedirect.pattern) === 'regex') {
125
+ const redirectRegex = this.safeCompileRedirectPattern(existsRedirect.pattern);
126
+ const matched = redirectRegex ? pathForCaptureMatch.match(redirectRegex) : null;
127
+ if (matched) {
128
+ existsRedirect.target = existsRedirect.target.replace(/\$(\d+)/g, (_, index) => {
129
+ return matched[parseInt(index, 10)] || '';
130
+ });
131
+ }
129
132
  }
130
133
  const isAbsoluteUrl = REGEXP_ABSOLUTE_URL.test(existsRedirect.target);
131
134
  const redirectedResponse = isAbsoluteUrl
@@ -260,7 +263,7 @@ export class RedirectsProxy extends ProxyBase {
260
263
  const patternParts = patternPath.split('/');
261
264
  const maybeLocale = patternParts[1].toLowerCase();
262
265
  // case insensitive lookup of locales
263
- if (new RegExp(this.locales.join('|'), 'i').test(maybeLocale)) {
266
+ if (new RegExp(this.locales.map(escapeRegExp).join('|'), 'i').test(maybeLocale)) {
264
267
  patternPath = patternPath.replace(`/${patternParts[1]}`, `/${maybeLocale}`);
265
268
  }
266
269
  return ((patternPath === localePath || patternPath === normalizedPath) &&
@@ -268,7 +271,10 @@ export class RedirectsProxy extends ProxyBase {
268
271
  areURLSearchParamsEqual(new URLSearchParams(patternQS), new URLSearchParams(incomingQS))));
269
272
  }
270
273
  // process regex rules
271
- const regex = this.getRedirectPatternRegex(redirect.pattern);
274
+ const regex = this.safeCompileRedirectPattern(redirect.pattern);
275
+ if (!regex) {
276
+ return false;
277
+ }
272
278
  const testRegex = (value) => {
273
279
  regex.lastIndex = 0;
274
280
  return regex.test(value);
@@ -303,7 +309,7 @@ export class RedirectsProxy extends ProxyBase {
303
309
  * @private
304
310
  */
305
311
  matchRedirectItemRedirect(redirects, locale, currentPath) {
306
- const nonLocalePath = currentPath.replace(new RegExp(`^\/?${locale}\/`, 'i'), '/');
312
+ const nonLocalePath = currentPath.replace(new RegExp(`^/?${escapeRegExp(locale)}/`, 'i'), '/');
307
313
  return redirects.length
308
314
  ? redirects.find((redirect) => {
309
315
  const patternPath = redirect.pattern.replace(/\/*$/g, '').toLowerCase();
@@ -435,6 +441,23 @@ export class RedirectsProxy extends ProxyBase {
435
441
  }
436
442
  return redirect;
437
443
  }
444
+ /**
445
+ * Compiles a redirect pattern to RegExp; returns null if Sitecore produced a malformed rule
446
+ * so one bad entry does not fail the entire redirect chain.
447
+ * @param {string} pattern redirect pattern from redirect map
448
+ * @returns {RegExp | null} normalized regex instance, or null when invalid
449
+ * @private
450
+ */
451
+ safeCompileRedirectPattern(pattern) {
452
+ try {
453
+ return this.getRedirectPatternRegex(pattern);
454
+ }
455
+ catch (error) {
456
+ const message = error instanceof Error ? error.message : String(error);
457
+ console.warn(`[RedirectsProxy] Invalid redirect regex; skipping rule. pattern=${pattern} (${message})`);
458
+ return null;
459
+ }
460
+ }
438
461
  /**
439
462
  * Converts a redirect pattern string into a RegExp.
440
463
  * Supports both JS literal form (`/pattern/i`) and plain regex source (`^/path$`).
@@ -463,7 +486,7 @@ export class RedirectsProxy extends ProxyBase {
463
486
  if (!urlLocale) {
464
487
  return path;
465
488
  }
466
- const localePrefixRegex = new RegExp(`^/${urlLocale}(?=/|$)`, 'i');
489
+ const localePrefixRegex = new RegExp(`^/${escapeRegExp(urlLocale)}(?=/|$)`, 'i');
467
490
  const strippedPath = path.replace(localePrefixRegex, '') || '/';
468
491
  return strippedPath.startsWith('/') ? strippedPath : `/${strippedPath}`;
469
492
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sitecore-content-sdk/nextjs",
3
- "version": "2.2.0",
3
+ "version": "2.2.1-beta.atoms.20260709124639",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "sideEffects": false,
@@ -32,8 +32,8 @@
32
32
  "url": "https://github.com/sitecore/content-sdk/issues"
33
33
  },
34
34
  "devDependencies": {
35
- "@sitecore-content-sdk/analytics-core": "^2.1.0",
36
- "@sitecore-content-sdk/personalize": "^2.1.0",
35
+ "@sitecore-content-sdk/analytics-core": "2.1.1-beta.atoms.20260709124639",
36
+ "@sitecore-content-sdk/personalize": "2.1.1-beta.atoms.20260709124639",
37
37
  "@stylistic/eslint-plugin": "^5.2.2",
38
38
  "@testing-library/dom": "^10.4.0",
39
39
  "@testing-library/react": "^16.3.0",
@@ -75,9 +75,9 @@
75
75
  "typescript": "~5.8.3"
76
76
  },
77
77
  "peerDependencies": {
78
- "@sitecore-content-sdk/analytics-core": "^2.1.0",
79
- "@sitecore-content-sdk/events": "^2.1.0",
80
- "@sitecore-content-sdk/personalize": "^2.1.0",
78
+ "@sitecore-content-sdk/analytics-core": "2.1.1-beta.atoms.20260709124639",
79
+ "@sitecore-content-sdk/events": "2.1.1-beta.atoms.20260709124639",
80
+ "@sitecore-content-sdk/personalize": "2.1.1-beta.atoms.20260709124639",
81
81
  "next": "^16.2.0",
82
82
  "react": "^19.2.1",
83
83
  "react-dom": "^19.2.1",
@@ -90,10 +90,10 @@
90
90
  },
91
91
  "dependencies": {
92
92
  "@babel/parser": "^7.27.2",
93
- "@sitecore-content-sdk/content": "^2.2.0",
94
- "@sitecore-content-sdk/core": "^2.1.1",
95
- "@sitecore-content-sdk/events": "^2.1.0",
96
- "@sitecore-content-sdk/react": "^2.2.0",
93
+ "@sitecore-content-sdk/content": "2.2.1-beta.atoms.20260709124639",
94
+ "@sitecore-content-sdk/core": "2.1.2-beta.atoms.20260709124639",
95
+ "@sitecore-content-sdk/events": "2.1.1-beta.atoms.20260709124639",
96
+ "@sitecore-content-sdk/react": "2.2.1-beta.atoms.20260709124639",
97
97
  "recast": "^0.23.11",
98
98
  "regex-parser": "^2.3.1"
99
99
  },
@@ -1 +1 @@
1
- {"version":3,"file":"DesignLibraryServer.d.ts","sourceRoot":"","sources":["../../../src/components/DesignLibrary/DesignLibraryServer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAwB1B,OAAO,EACL,wBAAwB,EACxB,+BAA+B,EAC/B,yCAAyC,EAE1C,MAAM,UAAU,CAAC;AAMlB,eAAO,MAAM,kBAAkB,GAAU,OAAO,GAAG,kBAUlD,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,mBAAmB,GAAU,yDAKvC,wBAAwB,sCAoB1B,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,oCAAoC,GAAU,yDAKxD,yCAAyC,+BA+I3C,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,0BAA0B,GAAU,oCAI9C,+BAA+B,+BAsCjC,CAAC"}
1
+ {"version":3,"file":"DesignLibraryServer.d.ts","sourceRoot":"","sources":["../../../src/components/DesignLibrary/DesignLibraryServer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAyB1B,OAAO,EACL,wBAAwB,EACxB,+BAA+B,EAC/B,yCAAyC,EAE1C,MAAM,UAAU,CAAC;AAMlB,eAAO,MAAM,kBAAkB,GAAU,OAAO,GAAG,kBAUlD,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,mBAAmB,GAAU,yDAKvC,wBAAwB,sCAoB1B,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,oCAAoC,GAAU,yDAKxD,yCAAyC,+BAwI3C,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,0BAA0B,GAAU,oCAI9C,+BAA+B,+BAsCjC,CAAC"}
@@ -18,8 +18,9 @@ export type DesignLibraryServerProps = {
18
18
  page: Page;
19
19
  /**
20
20
  * The dynamic import for sever import map to be used in variant generation mode.
21
+ * When omitted, an empty import map is used (ex: code generation is disabled).
21
22
  */
22
- loadServerImportMap: () => Promise<ImportMapImport>;
23
+ loadServerImportMap?: () => Promise<ImportMapImport>;
23
24
  };
24
25
  export type DesingLibraryAppProps = DesignLibraryServerProps;
25
26
  export type DesignLibraryServerPreviewProps = Omit<DesignLibraryServerProps, 'loadServerImportMap'>;
@@ -1 +1 @@
1
- {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../src/components/DesignLibrary/models.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,sBAAsB,EACtB,eAAe,EAChB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACrF,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,IAAI,EAAE,MAAM,sCAAsC,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE5E,MAAM,MAAM,wBAAwB,GAAG;IACrC;;OAEG;IACH,YAAY,EAAE,YA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e,EAAE,MAAM,6BAA6B,CAAC;AAE5E,MAAM,MAAM,wBAAwB,GAAG;IACrC;;OAEG;IACH,YAAY,EAAE,YAAY,CAAC;IAC3B;;OAEG;IACH,SAAS,EAAE,kBAAkB,GAAG,SAAS,CAAC;IAC1C;;OAEG;IACH,IAAI,EAAE,IAAI,CAAC;IACX;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,OAAO,CAAC,eAAe,CAAC,CAAC;CACtD,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,wBAAwB,CAAC;AAE7D,MAAM,MAAM,+BAA+B,GAAG,IAAI,CAAC,wBAAwB,EAAE,qBAAqB,CAAC,CAAC;AAEpG,MAAM,MAAM,yCAAyC,GAAG,wBAAwB,CAAC;AAEjF,MAAM,MAAM,+BAA+B,GAAG;IAC5C;;OAEG;IACH,mBAAmB,EAAE,mBAAmB,CAAC;IACzC;;OAEG;IACH,SAAS,EAAE,kBAAkB,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,yCAAyC,GAAG,+BAA+B,GAAG;IACxF;;OAEG;IACH,SAAS,CAAC,EAAE,eAAe,EAAE,CAAC;IAC9B;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,wBAAwB,CAAC;IAC9C;;OAEG;IACH,sBAAsB,CAAC,EAAE,sBAAsB,CAAC;CACjD,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,kEAAkE;IAClE,IAAI,EAAE,yBAAyB,CAAC;IAChC,yBAAyB;IACzB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC"}
package/types/index.d.ts CHANGED
@@ -23,7 +23,7 @@ import * as BYOCWrapper from './components/BYOCWrapper';
23
23
  export { FEaaSClientWrapper, FEaaSServerWrapper, BYOCClientWrapper, BYOCServerWrapper, } from '@sitecore-content-sdk/react';
24
24
  export { FEaaSWrapper };
25
25
  export { BYOCWrapper };
26
- export { ComponentMap, Image, ImageField, ImageFieldValue, ImageProps, LinkField, LinkFieldValue, Text, TextField, DateField, FEaaSComponent, FEaaSComponentProps, FEaaSComponentParams, fetchFEaaSComponentServerProps, BYOCComponentParams, BYOCComponent, BYOCComponentProps, getDesignLibraryStylesheetLinks, File, FileField, RichTextField, DesignLibrary, DefaultEmptyFieldEditingComponentImage, DefaultEmptyFieldEditingComponentText, PlaceholderComponentProps, SitecoreProvider, SitecoreProviderState, SitecoreProviderReactContext, withSitecore, useSitecore, withEditorChromes, withAppPlaceholder, withPlaceholder, withDatasourceCheck, ImageSizeParameters, withFieldMetadata, withEmptyFieldEditingComponent, EditingScripts, Form, ClientEditingChromesUpdate, AppPlaceholder, AppPlaceholderProps, renderEmptyPlaceholder, } from '@sitecore-content-sdk/react';
26
+ export { ComponentMap, Image, ImageField, ImageFieldValue, ImageProps, LinkField, LinkFieldValue, Text, TextField, DateField, FEaaSComponent, FEaaSComponentProps, FEaaSComponentParams, fetchFEaaSComponentServerProps, BYOCComponentParams, BYOCComponent, BYOCComponentProps, getDesignLibraryStylesheetLinks, File, FileField, RichTextField, DesignLibrary, DefaultEmptyFieldEditingComponentImage, DefaultEmptyFieldEditingComponentText, noopLoadImportMap, PlaceholderComponentProps, SitecoreProvider, SitecoreProviderState, SitecoreProviderReactContext, withSitecore, useSitecore, withEditorChromes, withAppPlaceholder, withPlaceholder, withDatasourceCheck, ImageSizeParameters, withFieldMetadata, withEmptyFieldEditingComponent, EditingScripts, Form, ClientEditingChromesUpdate, AppPlaceholder, AppPlaceholderProps, renderEmptyPlaceholder, } from '@sitecore-content-sdk/react';
27
27
  export { initContentSdk } from '@sitecore-content-sdk/core';
28
28
  export type { PersonalizeGeoData } from './proxy/personalize-proxy';
29
29
  export type { PersonalizeProxyAdapter } from './initialization/proxy/personalize-adapter';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAC;AAE3C,OAAO,EACL,SAAS,EA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,EAAE,MAAM,4BAA4B,CAAC;AAC5D,YAAY,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,YAAY,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AAC1F,OAAO,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AACrF,YAAY,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACtF,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAE/E,OAAO,EACL,KAAK,gBAAgB,EACrB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAM7B,OAAO,EACL,+BAA+B,EAC/B,KAAK,qCAAqC,GAC3C,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,4BAA4B,EAC5B,KAAK,kCAAkC,GACxC,MAAM,kCAAkC,CAAC"}
@@ -101,6 +101,14 @@ export declare class RedirectsProxy extends ProxyBase {
101
101
  * @returns {NextResponse<unknown>} The redirect response.
102
102
  */
103
103
  protected createRedirectResponse(url: NextURL | string, res: Response | undefined, status: number, statusText: string): NextResponse;
104
+ /**
105
+ * Compiles a redirect pattern to RegExp; returns null if Sitecore produced a malformed rule
106
+ * so one bad entry does not fail the entire redirect chain.
107
+ * @param {string} pattern redirect pattern from redirect map
108
+ * @returns {RegExp | null} normalized regex instance, or null when invalid
109
+ * @private
110
+ */
111
+ private safeCompileRedirectPattern;
104
112
  /**
105
113
  * Converts a redirect pattern string into a RegExp.
106
114
  * Supports both JS literal form (`/pattern/i`) and plain regex source (`^/path$`).
@@ -1 +1 @@
1
- {"version":3,"file":"redirects-proxy.d.ts","sourceRoot":"","sources":["../../src/proxy/redirects-proxy.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EAItB,YAAY,EAEb,MAAM,oCAAoC,CAAC;AAO5C,OAAO,EAAE,OAAO,EAAE,MAAM,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