@meetelise/chat
Advanced tools
Comparing version 1.0.0-rc.16 to 1.0.0-rc.17
import getIcons from "./getIcons"; | ||
let styleElement; | ||
/** | ||
@@ -10,12 +11,14 @@ * Overrides the TalkJS stylesheet so our icons have the right colors. | ||
var _a, _b, _c; | ||
const styleOverrides = document.createElement("style"); | ||
document.head.appendChild(styleOverrides); | ||
if (styleElement) | ||
document.head.removeChild(styleElement); | ||
styleElement = document.createElement("style"); | ||
document.head.appendChild(styleElement); | ||
const [openIcon, closeIcon] = getIcons(theme); | ||
(_a = styleOverrides.sheet) === null || _a === void 0 ? void 0 : _a.insertRule(`#__talkjs_launcher { | ||
(_a = styleElement.sheet) === null || _a === void 0 ? void 0 : _a.insertRule(`#__talkjs_launcher { | ||
background-color: ${theme.launchButtonColor}; | ||
}`); | ||
(_b = styleOverrides.sheet) === null || _b === void 0 ? void 0 : _b.insertRule(`#__talkjs_launcher.closed { | ||
(_b = styleElement.sheet) === null || _b === void 0 ? void 0 : _b.insertRule(`#__talkjs_launcher.closed { | ||
background-image: url(${openIcon}); | ||
}`); | ||
(_c = styleOverrides.sheet) === null || _c === void 0 ? void 0 : _c.insertRule(`#__talkjs_launcher.open { | ||
(_c = styleElement.sheet) === null || _c === void 0 ? void 0 : _c.insertRule(`#__talkjs_launcher.open { | ||
background-image: url(${closeIcon}); | ||
@@ -22,0 +25,0 @@ }`); |
@@ -74,2 +74,3 @@ import fetchBuildingInfo from "./fetchBuildingInfo"; | ||
updateTheme(p, b, resolvedTheme); | ||
installTalkJSStyles(resolvedTheme); | ||
return new Promise(requestAnimationFrame); | ||
@@ -76,0 +77,0 @@ }) |
{ | ||
"name": "@meetelise/chat", | ||
"version": "1.0.0-rc.16", | ||
"version": "1.0.0-rc.17", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "type": "module", |
import { Theme } from "./resolveTheme"; | ||
import getIcons from "./getIcons"; | ||
let styleElement: HTMLStyleElement; | ||
/** | ||
@@ -11,14 +13,15 @@ * Overrides the TalkJS stylesheet so our icons have the right colors. | ||
export default function installTalkJSStyles(theme: Theme): void { | ||
const styleOverrides = document.createElement("style"); | ||
document.head.appendChild(styleOverrides); | ||
if (styleElement) document.head.removeChild(styleElement); | ||
styleElement = document.createElement("style"); | ||
document.head.appendChild(styleElement); | ||
const [openIcon, closeIcon] = getIcons(theme); | ||
styleOverrides.sheet?.insertRule(`#__talkjs_launcher { | ||
styleElement.sheet?.insertRule(`#__talkjs_launcher { | ||
background-color: ${theme.launchButtonColor}; | ||
}`); | ||
styleOverrides.sheet?.insertRule(`#__talkjs_launcher.closed { | ||
styleElement.sheet?.insertRule(`#__talkjs_launcher.closed { | ||
background-image: url(${openIcon}); | ||
}`); | ||
styleOverrides.sheet?.insertRule(`#__talkjs_launcher.open { | ||
styleElement.sheet?.insertRule(`#__talkjs_launcher.open { | ||
background-image: url(${closeIcon}); | ||
}`); | ||
} |
@@ -68,2 +68,3 @@ import Talk from "talkjs"; | ||
updateTheme(p, b, resolvedTheme); | ||
installTalkJSStyles(resolvedTheme); | ||
return new Promise(requestAnimationFrame); | ||
@@ -70,0 +71,0 @@ }) |
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
58170
1048