nextjs-cms 0.10.1 → 0.10.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,6 +6,10 @@ export declare function escapeHTML(value: string | undefined | null): string | u
6
6
  /**
7
7
  * Sanitize rich-text/HTML content using DOMPurify with a restrictive allow-list.
8
8
  * Always returns a string (empty string when value is undefined or null).
9
+ *
10
+ * Uses `isomorphic-dompurify` rather than `dompurify` directly: this runs during submission,
11
+ * which is server-side, and bare `dompurify` returns a factory (no `sanitize` method) when it
12
+ * cannot find a `document`. The isomorphic wrapper supplies a jsdom window on the server.
9
13
  */
10
14
  export declare function sanitizeRichText(value: string | undefined | null): Promise<string>;
11
15
  //# sourceMappingURL=dom.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../../src/core/security/dom.ts"],"names":[],"mappings":"AAaA;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,GAAG,SAAS,CAU/E;AA+DD;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAOxF"}
1
+ {"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../../src/core/security/dom.ts"],"names":[],"mappings":"AAaA;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,GAAG,SAAS,CAU/E;AA+DD;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAOxF"}
@@ -82,11 +82,15 @@ const RICH_TEXT_SANITIZE_CONFIG = {
82
82
  /**
83
83
  * Sanitize rich-text/HTML content using DOMPurify with a restrictive allow-list.
84
84
  * Always returns a string (empty string when value is undefined or null).
85
+ *
86
+ * Uses `isomorphic-dompurify` rather than `dompurify` directly: this runs during submission,
87
+ * which is server-side, and bare `dompurify` returns a factory (no `sanitize` method) when it
88
+ * cannot find a `document`. The isomorphic wrapper supplies a jsdom window on the server.
85
89
  */
86
90
  export async function sanitizeRichText(value) {
87
91
  if (value === undefined || value === null || value.trim().length === 0) {
88
92
  return '';
89
93
  }
90
- const { default: DOMPurify } = await import('dompurify');
94
+ const { default: DOMPurify } = await import('isomorphic-dompurify');
91
95
  return DOMPurify.sanitize(value, RICH_TEXT_SANITIZE_CONFIG);
92
96
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nextjs-cms",
3
- "version": "0.10.1",
3
+ "version": "0.10.3",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "type": "module",
@@ -185,7 +185,6 @@
185
185
  "chokidar": "3.6.0",
186
186
  "commander": "^14.0.2",
187
187
  "dayjs": "^1.11.19",
188
- "dompurify": "^3.3.3",
189
188
  "dotenv": "^17.2.3",
190
189
  "drizzle-orm": "^0.45.1",
191
190
  "esbuild": "0.27.2",
@@ -195,6 +194,7 @@
195
194
  "glob": "^10.4.5",
196
195
  "gradient-string": "^3.0.0",
197
196
  "international-types": "^0.8.1",
197
+ "isomorphic-dompurify": "^3.19.0",
198
198
  "jiti": "^2.6.1",
199
199
  "jose": "^6.0.11",
200
200
  "jsonwebtoken": "^9.0.2",
@@ -226,9 +226,9 @@
226
226
  "prettier": "^3.3.3",
227
227
  "tsx": "^4.20.6",
228
228
  "typescript": "^5.9.2",
229
+ "@lzcms/eslint-config": "0.3.0",
229
230
  "@lzcms/tsconfig": "0.1.0",
230
- "@lzcms/prettier-config": "0.1.0",
231
- "@lzcms/eslint-config": "0.3.0"
231
+ "@lzcms/prettier-config": "0.1.0"
232
232
  },
233
233
  "license": "MIT",
234
234
  "keywords": [