🐛 (js) Fix container color when empty
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@typebot.io/js",
|
"name": "@typebot.io/js",
|
||||||
"version": "0.0.65",
|
"version": "0.0.66",
|
||||||
"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",
|
||||||
|
@ -8,6 +8,7 @@ import {
|
|||||||
} from '@typebot.io/schemas'
|
} from '@typebot.io/schemas'
|
||||||
import { BackgroundType } from '@typebot.io/schemas/features/typebot/theme/enums'
|
import { BackgroundType } from '@typebot.io/schemas/features/typebot/theme/enums'
|
||||||
import { isLight, hexToRgb } from '@typebot.io/lib/hexToRgb'
|
import { isLight, hexToRgb } from '@typebot.io/lib/hexToRgb'
|
||||||
|
import { isNotEmpty } from '@typebot.io/lib'
|
||||||
|
|
||||||
const cssVariableNames = {
|
const cssVariableNames = {
|
||||||
general: {
|
general: {
|
||||||
@ -37,6 +38,7 @@ const cssVariableNames = {
|
|||||||
},
|
},
|
||||||
checkbox: {
|
checkbox: {
|
||||||
bgColor: '--typebot-checkbox-bg-color',
|
bgColor: '--typebot-checkbox-bg-color',
|
||||||
|
color: '--typebot-checkbox-color',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
} as const
|
} as const
|
||||||
@ -155,7 +157,9 @@ const setTypebotBackground = (
|
|||||||
parseBackgroundValue(background)
|
parseBackgroundValue(background)
|
||||||
)
|
)
|
||||||
const backgroundColor =
|
const backgroundColor =
|
||||||
(BackgroundType.COLOR ? background.content : '#ffffff') ?? '#ffffff'
|
(BackgroundType.COLOR && isNotEmpty(background.content)
|
||||||
|
? background.content
|
||||||
|
: '#ffffff') ?? '#ffffff'
|
||||||
documentStyle.setProperty(
|
documentStyle.setProperty(
|
||||||
cssVariableNames.chat.checkbox.bgColor,
|
cssVariableNames.chat.checkbox.bgColor,
|
||||||
(BackgroundType.COLOR ? background.content : '#ffffff') ?? '#ffffff'
|
(BackgroundType.COLOR ? background.content : '#ffffff') ?? '#ffffff'
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@typebot.io/react",
|
"name": "@typebot.io/react",
|
||||||
"version": "0.0.65",
|
"version": "0.0.66",
|
||||||
"description": "React library to display typebots on your website",
|
"description": "React library to display typebots on your website",
|
||||||
"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