From 61229b3d83e1a482df244459caa04cb1079fe43d Mon Sep 17 00:00:00 2001 From: ghiscoding Date: Tue, 7 May 2024 00:19:12 -0400 Subject: [PATCH] fix: make some more cleanup with now optional DOMPurify --- docs/column-functionalities/Formatters.md | 2 +- .../editors/Select-Dropdown-Editor-(single,multiple).md | 3 --- docs/column-functionalities/filters/Select-Filter.md | 4 ---- packages/common/package.json | 1 - packages/custom-tooltip-plugin/README.md | 3 --- packages/custom-tooltip-plugin/package.json | 3 --- pnpm-lock.yaml | 8 +------- 7 files changed, 2 insertions(+), 22 deletions(-) diff --git a/docs/column-functionalities/Formatters.md b/docs/column-functionalities/Formatters.md index e2d8f3f82..d6e0ea991 100644 --- a/docs/column-functionalities/Formatters.md +++ b/docs/column-functionalities/Formatters.md @@ -184,7 +184,7 @@ Since version 4.x, you can now also return native DOM element instead of an HTML 2. Performance (the reasons are similar to point 1.) - since it's native it can be appended directly to the grid cell - when it's an HTML string, it has to do 2 extra steps (which is an overhead process) - i. sanitize the string (we use [DOMPurify](https://github.com/cure53/DOMPurify) by default) + i. sanitize the string (when a sanitizer, for example [DOMPurify](https://github.com/cure53/DOMPurify)) ii. SlickGrid then has to convert it to native element by using `innerHTML` on the grid cell Demo diff --git a/docs/column-functionalities/editors/Select-Dropdown-Editor-(single,multiple).md b/docs/column-functionalities/editors/Select-Dropdown-Editor-(single,multiple).md index e4aaf054c..7e1026e56 100644 --- a/docs/column-functionalities/editors/Select-Dropdown-Editor-(single,multiple).md +++ b/docs/column-functionalities/editors/Select-Dropdown-Editor-(single,multiple).md @@ -231,6 +231,3 @@ this.columnDefinitions = [ } ]; ``` - -### Change Default DOMPurify Options (sanitize html) -If you find that the HTML that you passed is being sanitized and you wish to change it, then you can change the default `sanitizeHtmlOptions` property defined in the Global Grid Options, for more info on how to change these global options, see the `Global Grid Options` and also take a look at the [GitHub - DOMPurify](https://github.com/cure53/DOMPurify#can-i-configure-it) configurations. diff --git a/docs/column-functionalities/filters/Select-Filter.md b/docs/column-functionalities/filters/Select-Filter.md index 230374dc4..aaaa86498 100644 --- a/docs/column-functionalities/filters/Select-Filter.md +++ b/docs/column-functionalities/filters/Select-Filter.md @@ -423,10 +423,6 @@ this.columnDefinitions = [ ]; ``` -#### Change Default DOMPurify Options (sanitize html) -If you find that the HTML that you passed is being sanitized and you wish to change it, then you can change the default `sanitizeHtmlOptions` property defined in the Global Grid Options, for more info on how to change these [global options](https://github.com/ghiscoding/slickgrid-universal/blob/master/packages/common/src/global-grid-options.ts). - - ### Collection Add Blank Entry In some cases a blank entry at the beginning of the collection could be useful, the most common example for this is to use the first option as a blank entry to tell our Filter to show everything. So for that we can use the `addBlankEntry` flag in `collectionOptions diff --git a/packages/common/package.json b/packages/common/package.json index cc21f28cc..64d6f345d 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -70,7 +70,6 @@ "@slickgrid-universal/binding": "workspace:~", "@slickgrid-universal/event-pub-sub": "workspace:~", "@slickgrid-universal/utils": "workspace:~", - "@types/dompurify": "^3.0.5", "@types/sortablejs": "^1.15.8", "autocompleter": "^9.2.1", "dequal": "^2.0.3", diff --git a/packages/custom-tooltip-plugin/README.md b/packages/custom-tooltip-plugin/README.md index 726ebfc66..2c5dd19aa 100644 --- a/packages/custom-tooltip-plugin/README.md +++ b/packages/custom-tooltip-plugin/README.md @@ -55,8 +55,5 @@ export class MyExample { ### Internal Dependencies - [@slickgrid-universal/common](https://github.com/ghiscoding/slickgrid-universal/tree/master/packages/common) -### External Dependencies -- [DOM Purify](https://github.com/cure53/DOMPurify) to sanitize HTML text - ### Installation Follow the instruction provided in the main [README](https://github.com/ghiscoding/slickgrid-universal#installation) diff --git a/packages/custom-tooltip-plugin/package.json b/packages/custom-tooltip-plugin/package.json index 77122e33c..a648ed082 100644 --- a/packages/custom-tooltip-plugin/package.json +++ b/packages/custom-tooltip-plugin/package.json @@ -51,8 +51,5 @@ "dependencies": { "@slickgrid-universal/common": "workspace:~", "@slickgrid-universal/utils": "workspace:~" - }, - "devDependencies": { - "@types/dompurify": "^3.0.5" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d82ce8b9c..42fe71461 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -237,9 +237,6 @@ importers: '@slickgrid-universal/utils': specifier: workspace:~ version: link:../utils - '@types/dompurify': - specifier: ^3.0.5 - version: 3.0.5 '@types/sortablejs': specifier: ^1.15.8 version: 1.15.8 @@ -326,10 +323,6 @@ importers: '@slickgrid-universal/utils': specifier: workspace:~ version: link:../utils - devDependencies: - '@types/dompurify': - specifier: ^3.0.5 - version: 3.0.5 packages/empty-warning-component: dependencies: @@ -2408,6 +2401,7 @@ packages: resolution: {integrity: sha512-1Wg0g3BtQF7sSb27fJQAKck1HECM6zV1EB66j8JH9i3LCjYabJa0FSdiSgsD5K/RbrsR0SiraKacLB+T8ZVYAg==} dependencies: '@types/trusted-types': 2.0.7 + dev: true /@types/estree@1.0.5: resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==}