@meetelise/chat
Advanced tools
Comparing version 1.0.0-rc.12 to 1.0.0-rc.13
@@ -9,12 +9,13 @@ import getIcons from "./getIcons"; | ||
export default function installTalkJSStyles(theme) { | ||
var _a, _b, _c; | ||
const styleOverrides = document.createElement('style'); | ||
document.head.appendChild(styleOverrides); | ||
const [openIcon, closeIcon] = getIcons(theme); | ||
styleOverrides.sheet?.insertRule(`#__talkjs_launcher { | ||
(_a = styleOverrides.sheet) === null || _a === void 0 ? void 0 : _a.insertRule(`#__talkjs_launcher { | ||
background-color: ${theme.launchButtonColor}; | ||
}`); | ||
styleOverrides.sheet?.insertRule(`#__talkjs_launcher.closed { | ||
(_b = styleOverrides.sheet) === null || _b === void 0 ? void 0 : _b.insertRule(`#__talkjs_launcher.closed { | ||
background-image: url(${openIcon}); | ||
}`); | ||
styleOverrides.sheet?.insertRule(`#__talkjs_launcher.open { | ||
(_c = styleOverrides.sheet) === null || _c === void 0 ? void 0 : _c.insertRule(`#__talkjs_launcher.open { | ||
background-image: url(${closeIcon}); | ||
@@ -21,0 +22,0 @@ }`); |
export default function resolveTheme(building, theme) { | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r; | ||
return { | ||
avatarInitials: theme.avatarInitials ?? building.avatarInitials ?? building.userFirstName[0], | ||
avatarSrc: theme.avatarSrc ?? building.avatarSrc, | ||
bannerColor: theme.bannerColor ?? building.bannerColor ?? '#e7ecee', | ||
avatarInitials: (_b = (_a = theme.avatarInitials) !== null && _a !== void 0 ? _a : building.avatarInitials) !== null && _b !== void 0 ? _b : building.userFirstName[0], | ||
avatarSrc: (_c = theme.avatarSrc) !== null && _c !== void 0 ? _c : building.avatarSrc, | ||
bannerColor: (_e = (_d = theme.bannerColor) !== null && _d !== void 0 ? _d : building.bannerColor) !== null && _e !== void 0 ? _e : '#e7ecee', | ||
bannerTextColor: 'rgba(0, 0, 0, 0.88)', | ||
chatSubtitle: theme.chatSubtitle ?? building.chatSubtitle, | ||
chatTitle: theme.chatTitle ?? building.chatTitle ?? building.userFirstName, | ||
launchButtonColor: theme.launchButtonColor ?? building.launchButtonColor ?? '#0785f2', | ||
launchButtonIconColor: theme.launchButtonIconColor ?? building.launchButtonIconColor ?? '#ffffff', | ||
launchButtonSize: theme.launchButtonSize ?? building.launchButtonSize ?? '60px', | ||
messageColor: theme.messageColor ?? building.messageColor ?? '#0785f2', | ||
chatSubtitle: (_f = theme.chatSubtitle) !== null && _f !== void 0 ? _f : building.chatSubtitle, | ||
chatTitle: (_h = (_g = theme.chatTitle) !== null && _g !== void 0 ? _g : building.chatTitle) !== null && _h !== void 0 ? _h : building.userFirstName, | ||
launchButtonColor: (_k = (_j = theme.launchButtonColor) !== null && _j !== void 0 ? _j : building.launchButtonColor) !== null && _k !== void 0 ? _k : '#0785f2', | ||
launchButtonIconColor: (_m = (_l = theme.launchButtonIconColor) !== null && _l !== void 0 ? _l : building.launchButtonIconColor) !== null && _m !== void 0 ? _m : '#ffffff', | ||
launchButtonSize: (_p = (_o = theme.launchButtonSize) !== null && _o !== void 0 ? _o : building.launchButtonSize) !== null && _p !== void 0 ? _p : '60px', | ||
messageColor: (_r = (_q = theme.messageColor) !== null && _q !== void 0 ? _q : building.messageColor) !== null && _r !== void 0 ? _r : '#0785f2', | ||
messageTextColor: '#fff', // TODO REX-353 compute based on contrast | ||
@@ -14,0 +15,0 @@ }; |
@@ -37,2 +37,3 @@ import Talk from 'talkjs'; | ||
function createConversation(building, theme, chatID) { | ||
var _a; | ||
const agent = new Talk.User({ | ||
@@ -53,3 +54,3 @@ id: `building_${building.id}`, | ||
userId: building.userId.toString(), | ||
subtitle: theme.chatSubtitle ?? null, | ||
subtitle: (_a = theme.chatSubtitle) !== null && _a !== void 0 ? _a : null, | ||
bannerColor: theme.bannerColor, | ||
@@ -56,0 +57,0 @@ bannerTextColor: theme.bannerTextColor, |
{ | ||
"name": "@meetelise/chat", | ||
"version": "1.0.0-rc.12", | ||
"version": "1.0.0-rc.13", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -7,3 +7,3 @@ { | ||
// "incremental": true, /* Enable incremental compilation */ | ||
"target": "es2021", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', 'ES2021', or 'ESNEXT'. */ | ||
"target": "es2019", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', 'ES2021', or 'ESNEXT'. */ | ||
"module": "esnext", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */ | ||
@@ -10,0 +10,0 @@ "lib": ["esnext", "dom"], /* Specify library files to be included in the compilation. */ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
52259
880