🚑 Fix custom CSS sanitization
This commit is contained in:
@@ -406,9 +406,7 @@ const sanitizeAndParseTheme = (
|
|||||||
general: deepParseVariables(variables)(theme.general),
|
general: deepParseVariables(variables)(theme.general),
|
||||||
chat: deepParseVariables(variables)(theme.chat),
|
chat: deepParseVariables(variables)(theme.chat),
|
||||||
customCss: theme.customCss
|
customCss: theme.customCss
|
||||||
? sanitizeAndParseHeadCode(
|
? removeLiteBadgeCss(parseVariables(variables)(theme.customCss))
|
||||||
parseVariables(variables)(removeLiteBadgeCss(theme.customCss))
|
|
||||||
)
|
|
||||||
: undefined,
|
: undefined,
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -420,6 +418,6 @@ const sanitizeAndParseHeadCode = (code: string) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const removeLiteBadgeCss = (code: string) => {
|
const removeLiteBadgeCss = (code: string) => {
|
||||||
const liteBadgeCssRegex = /.*#lite-badge[\s]*{[\s\S]*}/gm
|
const liteBadgeCssRegex = /.*#lite-badge.*{[\s\S][^{]*}/gm
|
||||||
return code.replace(liteBadgeCssRegex, '')
|
return code.replace(liteBadgeCssRegex, '')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@typebot.io/js",
|
"name": "@typebot.io/js",
|
||||||
"version": "0.2.2",
|
"version": "0.2.3",
|
||||||
"description": "Javascript library to display typebots on your website",
|
"description": "Javascript library to display typebots on your website",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
left: auto !important;
|
left: auto !important;
|
||||||
bottom: 20px !important;
|
bottom: 20px !important;
|
||||||
transition: background-color 0.2s ease-in-out !important;
|
transition: background-color 0.2s ease-in-out !important;
|
||||||
|
text-decoration: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
#lite-badge:hover {
|
#lite-badge:hover {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@typebot.io/nextjs",
|
"name": "@typebot.io/nextjs",
|
||||||
"version": "0.2.2",
|
"version": "0.2.3",
|
||||||
"description": "Convenient library to display typebots on your Next.js website",
|
"description": "Convenient library to display typebots on your Next.js website",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@typebot.io/react",
|
"name": "@typebot.io/react",
|
||||||
"version": "0.2.2",
|
"version": "0.2.3",
|
||||||
"description": "Convenient library to display typebots on your React app",
|
"description": "Convenient library to display typebots on your React app",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
|
|||||||
Reference in New Issue
Block a user