[WEB-5196] chore: switch from isomorphic-dompurify to dompurify (#7983)
* [WEB-5196] chore: switch from isomorphic-dompurify to dompurify Replace isomorphic-dompurify with dompurify package in utils. This change simplifies the dependency and uses the canonical DOMPurify package directly. * fix: removing dompurify from the space app as dependency * chore: remove unused import --------- Co-authored-by: sriramveeraghanta <veeraghanta.sriram@gmail.com>
This commit is contained in:
parent
80bd1b6dcd
commit
e710f5b278
6 changed files with 100 additions and 621 deletions
|
|
@ -1,5 +1,3 @@
|
||||||
import DOMPurify from "dompurify";
|
|
||||||
|
|
||||||
export const addSpaceIfCamelCase = (str: string) => str.replace(/([a-z])([A-Z])/g, "$1 $2");
|
export const addSpaceIfCamelCase = (str: string) => str.replace(/([a-z])([A-Z])/g, "$1 $2");
|
||||||
|
|
||||||
const fallbackCopyTextToClipboard = (text: string) => {
|
const fallbackCopyTextToClipboard = (text: string) => {
|
||||||
|
|
@ -50,13 +48,6 @@ export const checkEmailValidity = (email: string): boolean => {
|
||||||
return isEmailValid;
|
return isEmailValid;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const isEmptyHtmlString = (htmlString: string, allowedHTMLTags: string[] = []) => {
|
|
||||||
// Remove HTML tags using regex
|
|
||||||
const cleanText = DOMPurify.sanitize(htmlString, { ALLOWED_TAGS: allowedHTMLTags });
|
|
||||||
// Trim the string and check if it's empty
|
|
||||||
return cleanText.trim() === "";
|
|
||||||
};
|
|
||||||
|
|
||||||
export const replaceUnderscoreIfSnakeCase = (str: string) => str.replace(/_/g, " ");
|
export const replaceUnderscoreIfSnakeCase = (str: string) => str.replace(/_/g, " ");
|
||||||
|
|
||||||
export const capitalizeFirstLetter = (str: string) => str.charAt(0).toUpperCase() + str.slice(1);
|
export const capitalizeFirstLetter = (str: string) => str.charAt(0).toUpperCase() + str.slice(1);
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,6 @@
|
||||||
"axios": "catalog:",
|
"axios": "catalog:",
|
||||||
"clsx": "^2.0.0",
|
"clsx": "^2.0.0",
|
||||||
"date-fns": "^4.1.0",
|
"date-fns": "^4.1.0",
|
||||||
"dompurify": "^3.0.11",
|
|
||||||
"dotenv": "^16.3.1",
|
"dotenv": "^16.3.1",
|
||||||
"lodash-es": "catalog:",
|
"lodash-es": "catalog:",
|
||||||
"lowlight": "^2.9.0",
|
"lowlight": "^2.9.0",
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,6 @@
|
||||||
"dotenv": "^16.0.3",
|
"dotenv": "^16.0.3",
|
||||||
"emoji-picker-react": "^4.5.16",
|
"emoji-picker-react": "^4.5.16",
|
||||||
"export-to-csv": "^1.4.0",
|
"export-to-csv": "^1.4.0",
|
||||||
"isomorphic-dompurify": "^2.12.0",
|
|
||||||
"lodash-es": "catalog:",
|
"lodash-es": "catalog:",
|
||||||
"lucide-react": "catalog:",
|
"lucide-react": "catalog:",
|
||||||
"mobx": "catalog:",
|
"mobx": "catalog:",
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
"@plane/types": "workspace:*",
|
"@plane/types": "workspace:*",
|
||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
"date-fns": "^4.1.0",
|
"date-fns": "^4.1.0",
|
||||||
"isomorphic-dompurify": "^2.16.0",
|
"dompurify": "3.2.7",
|
||||||
"lodash-es": "catalog:",
|
"lodash-es": "catalog:",
|
||||||
"lucide-react": "catalog:",
|
"lucide-react": "catalog:",
|
||||||
"react": "catalog:",
|
"react": "catalog:",
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import DOMPurify from "isomorphic-dompurify";
|
import DOMPurify from "dompurify";
|
||||||
import type { Content, JSONContent } from "@plane/types";
|
import type { Content, JSONContent } from "@plane/types";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
706
pnpm-lock.yaml
generated
706
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue