@stack-spot/portal-components 0.0.7 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/BannerWarning.d.ts.map +1 -0
- package/dist/components/BannerWarning.js.map +1 -0
- package/dist/components/ChatBot/index.d.ts +2 -0
- package/dist/components/ChatBot/index.d.ts.map +1 -0
- package/dist/components/ChatBot/index.js +44 -0
- package/dist/components/ChatBot/index.js.map +1 -0
- package/dist/components/ChatBot.d.ts +2 -0
- package/dist/components/ChatBot.d.ts.map +1 -0
- package/dist/components/ChatBot.js +53 -0
- package/dist/components/ChatBot.js.map +1 -0
- package/dist/{Login.d.ts → components/Login.d.ts} +2 -1
- package/dist/components/Login.d.ts.map +1 -0
- package/dist/{Login.js → components/Login.js} +3 -3
- package/dist/components/Login.js.map +1 -0
- package/dist/components/MiniLogo.d.ts.map +1 -0
- package/dist/components/MiniLogo.js.map +1 -0
- package/dist/hooks/service-now.d.ts +6 -0
- package/dist/hooks/service-now.d.ts.map +1 -0
- package/dist/hooks/service-now.js +162 -0
- package/dist/hooks/service-now.js.map +1 -0
- package/dist/hooks/use-effect-once.d.ts +12 -0
- package/dist/hooks/use-effect-once.d.ts.map +1 -0
- package/dist/hooks/use-effect-once.js +40 -0
- package/dist/hooks/use-effect-once.js.map +1 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/package.json +5 -2
- package/src/components/ChatBot.tsx +77 -0
- package/src/{Login.tsx → components/Login.tsx} +5 -4
- package/src/hooks/service-now.tsx +185 -0
- package/src/hooks/use-effect-once.tsx +43 -0
- package/src/index.ts +8 -2
- package/dist/BannerWarning.d.ts.map +0 -1
- package/dist/BannerWarning.js.map +0 -1
- package/dist/Login.d.ts.map +0 -1
- package/dist/Login.js.map +0 -1
- package/dist/MiniLogo.d.ts.map +0 -1
- package/dist/MiniLogo.js.map +0 -1
- /package/dist/{BannerWarning.d.ts → components/BannerWarning.d.ts} +0 -0
- /package/dist/{BannerWarning.js → components/BannerWarning.js} +0 -0
- /package/dist/{MiniLogo.d.ts → components/MiniLogo.d.ts} +0 -0
- /package/dist/{MiniLogo.js → components/MiniLogo.js} +0 -0
- /package/src/{BannerWarning.tsx → components/BannerWarning.tsx} +0 -0
- /package/src/{MiniLogo.tsx → components/MiniLogo.tsx} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BannerWarning.d.ts","sourceRoot":"","sources":["../../src/components/BannerWarning.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,aAAa;cAA8B,MAAM,SAAS;6CAgBtE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BannerWarning.js","sourceRoot":"","sources":["../../src/components/BannerWarning.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAElC,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAAE,QAAQ,EAAiC,EAAE,EAAE,CAAC,CAC5E,KAAC,IAAI,IAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,YACpE,MAAC,KAAK,IAAC,WAAW,EAAC,SAAS,EAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,aACnG,KAAC,OAAO,IAAC,IAAI,EAAC,IAAI,EAAC,WAAW,EAAC,OAAO,EAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE,YACvE,KAAC,mBAAmB,KAAG,GACf,EACV,KAAC,IAAI,IAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,YACtB,KAAC,IAAI,IAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,EAAE,WAAW,EAAC,sBAAsB,YACjG,QAAQ,GACJ,GACF,EACP,KAAC,OAAO,IAAC,IAAI,EAAC,IAAI,EAAC,WAAW,EAAC,OAAO,EAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE,YACvE,KAAC,mBAAmB,KAAG,GACf,IACJ,GACH,CACR,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ChatBot/index.tsx"],"names":[],"mappings":"AA0BA,eAAO,MAAM,OAAO,+CAwCnB,CAAA"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Button, Flex, IconBox } from '@citric/core';
|
|
3
|
+
import { QuestionAnswer, Times } from '@citric/icons';
|
|
4
|
+
import { useState } from 'react';
|
|
5
|
+
const styles = {
|
|
6
|
+
content: {
|
|
7
|
+
position: 'fixed',
|
|
8
|
+
bottom: '80px',
|
|
9
|
+
right: '0',
|
|
10
|
+
},
|
|
11
|
+
button: {
|
|
12
|
+
position: 'fixed',
|
|
13
|
+
right: '15px',
|
|
14
|
+
width: '64px',
|
|
15
|
+
height: '64px',
|
|
16
|
+
borderRadius: '50%',
|
|
17
|
+
border: 'none',
|
|
18
|
+
},
|
|
19
|
+
icon: {
|
|
20
|
+
position: 'absolute',
|
|
21
|
+
top: '50%',
|
|
22
|
+
left: '50%',
|
|
23
|
+
transform: 'translate(-50%, -50%)',
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
export const ChatBot = () => {
|
|
27
|
+
const buttonChatBot = document.getElementById('sn_va_web_client');
|
|
28
|
+
const isShowChatBot = buttonChatBot?.classList.contains('show');
|
|
29
|
+
const [, setButtonChatBotOpen] = useState(isShowChatBot);
|
|
30
|
+
const handleOpenChatBot = () => {
|
|
31
|
+
if (buttonChatBot) {
|
|
32
|
+
if (buttonChatBot.classList.contains('show')) {
|
|
33
|
+
buttonChatBot.classList.remove('show');
|
|
34
|
+
setButtonChatBotOpen(false);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
buttonChatBot.classList.add('show');
|
|
38
|
+
setButtonChatBotOpen(true);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
return (_jsx(Flex, { id: "service-now-content", sx: styles.content, children: _jsx(Button, { onClick: handleOpenChatBot, id: "service-now-button", sx: styles.button, children: _jsx(IconBox, { colorScheme: "light.400", sx: styles.icon, size: "lg", children: isShowChatBot ? (_jsx(Times, {})) : (_jsx(QuestionAnswer, {})) }) }) }));
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ChatBot/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAU,MAAM,cAAc,CAAA;AAC5D,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEhC,MAAM,MAAM,GAAW;IACrB,OAAO,EAAE;QACP,QAAQ,EAAE,OAAO;QACjB,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,GAAG;KACX;IACD,MAAM,EAAE;QACN,QAAQ,EAAE,OAAO;QACjB,KAAK,EAAE,MAAM;QACb,KAAK,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C,CACd,KAAC,KAAK,KAAG,CACV,CAAC,CAAC,CAAC,CACF,KAAC,cAAc,KAAG,CACnB,GAEK,GACH,GACJ,CACR,CAAA;AAEH,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChatBot.d.ts","sourceRoot":"","sources":["../../src/components/ChatBot.tsx"],"names":[],"mappings":"AAoCA,eAAO,MAAM,OAAO,+CAwCnB,CAAA"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Button, Flex, IconBox } from '@citric/core';
|
|
3
|
+
import { QuestionAnswer, Times } from '@citric/icons';
|
|
4
|
+
import { useState } from 'react';
|
|
5
|
+
import { addOrRemoveServiceNowLauncher, getServiceNowLauncher } from '../hooks/service-now.js';
|
|
6
|
+
const styles = {
|
|
7
|
+
content: {
|
|
8
|
+
position: 'fixed',
|
|
9
|
+
bottom: '80px',
|
|
10
|
+
right: '0',
|
|
11
|
+
visibility: 'visible',
|
|
12
|
+
},
|
|
13
|
+
button: {
|
|
14
|
+
position: 'fixed',
|
|
15
|
+
right: '15px',
|
|
16
|
+
width: '64px',
|
|
17
|
+
height: '64px',
|
|
18
|
+
borderRadius: '50%',
|
|
19
|
+
border: 'none',
|
|
20
|
+
opacity: '0',
|
|
21
|
+
'&.show': {
|
|
22
|
+
opacity: '1',
|
|
23
|
+
},
|
|
24
|
+
'&:hover, &:focus': {
|
|
25
|
+
background: 'primary.500',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
icon: {
|
|
29
|
+
position: 'absolute',
|
|
30
|
+
top: '50%',
|
|
31
|
+
left: '50%',
|
|
32
|
+
transform: 'translate(-50%, -50%)',
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
export const ChatBot = () => {
|
|
36
|
+
const chatBotIframe = getServiceNowLauncher();
|
|
37
|
+
const isShowChatBot = chatBotIframe?.classList.contains('show');
|
|
38
|
+
const [, setChatBotOpen] = useState(isShowChatBot);
|
|
39
|
+
const handleOpenChatBot = () => {
|
|
40
|
+
if (chatBotIframe) {
|
|
41
|
+
if (isShowChatBot) {
|
|
42
|
+
addOrRemoveServiceNowLauncher('remove');
|
|
43
|
+
setChatBotOpen(false);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
addOrRemoveServiceNowLauncher('add');
|
|
47
|
+
setChatBotOpen(true);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
return (_jsx(Flex, { id: "service-now-content", sx: styles.content, children: _jsx(Button, { onClick: handleOpenChatBot, id: "service-now-button", sx: styles.button, children: _jsx(IconBox, { colorScheme: "light.400", sx: styles.icon, size: "lg", children: isShowChatBot ? (_jsx(Times, {})) : (_jsx(QuestionAnswer, {})) }) }) }));
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=ChatBot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChatBot.js","sourceRoot":"","sources":["../../src/components/ChatBot.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAU,MAAM,cAAc,CAAA;AAC5D,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,EAAE,6BAA6B,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAE3F,MAAM,MAAM,GAAW;IACrB,OAAO,EAAE;QACP,QAAQ,EAAE,OAAO;QACjB,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,GAAG;QACV,UAAU,EAAE,SAAS;KACtB;IACD,MAAM,EAAE;QACN,QAAQ,EAAE,OAAO;QACjB,KAAK,EAAE,MAAM;QACb,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,MAAM;QACd,YAAY,EAAE,KAAK;QACnB,MAAM,EAAE,MAAM;QACd,OAAO,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,CACR,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -19,7 +19,8 @@ interface Props {
|
|
|
19
19
|
removeLoadingOnSuccess?: boolean;
|
|
20
20
|
className?: string;
|
|
21
21
|
style?: React.CSSProperties;
|
|
22
|
+
showBanner?: boolean;
|
|
22
23
|
}
|
|
23
|
-
export declare const Login: ({ onSubmit, initialValue, welcomeText, removeLoadingOnSuccess, className, style }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export declare const Login: ({ onSubmit, initialValue, welcomeText, removeLoadingOnSuccess, className, style, showBanner }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
24
25
|
export {};
|
|
25
26
|
//# sourceMappingURL=Login.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Login.d.ts","sourceRoot":"","sources":["../../src/components/Login.tsx"],"names":[],"mappings":";AAWA,KAAK,SAAS,GAAG,KAAK,GAAG,KAAK,CAAA;AAE9B,UAAU,QAAQ;IAChB,IAAI,EAAE,SAAS,CAAC;CACjB;AAED,UAAU,OAAQ,SAAQ,QAAQ;IAChC,IAAI,EAAE,KAAK,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf;AAED,UAAU,OAAQ,SAAQ,QAAQ;IAChC,IAAI,EAAE,KAAK,CAAC;IACZ,QAAQ,EAAE,qBAAqB,CAAC;CACjC;AAED,KAAK,SAAS,GAAG,OAAO,GAAG,OAAO,CAAA;AAElC,UAAU,KAAK;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AA4CD,eAAO,MAAM,KAAK,kGAAwG,KAAK,4CAwD9H,CAAA"}
|
|
@@ -7,8 +7,8 @@ import { theme } from '@stack-spot/portal-theme';
|
|
|
7
7
|
import { useTranslate } from '@stack-spot/portal-translate';
|
|
8
8
|
import { useState } from 'react';
|
|
9
9
|
import { styled } from 'styled-components';
|
|
10
|
-
import { MiniLogo } from './MiniLogo.js';
|
|
11
10
|
import { BannerWarning } from './BannerWarning.js';
|
|
11
|
+
import { MiniLogo } from './MiniLogo.js';
|
|
12
12
|
const LoginBox = styled.form `
|
|
13
13
|
display: flex;
|
|
14
14
|
flex-direction: column;
|
|
@@ -50,7 +50,7 @@ const LoginBox = styled.form `
|
|
|
50
50
|
line-height: 1.5rem;
|
|
51
51
|
}
|
|
52
52
|
`;
|
|
53
|
-
export const Login = ({ onSubmit, initialValue = '', welcomeText, removeLoadingOnSuccess, className, style }) => {
|
|
53
|
+
export const Login = ({ onSubmit, initialValue = '', welcomeText, removeLoadingOnSuccess, className, style, showBanner }) => {
|
|
54
54
|
const t = useTranslate(dictionary);
|
|
55
55
|
const searchParams = new URLSearchParams(location.search);
|
|
56
56
|
const [error, setError] = useState(searchParams.get('error_description') || searchParams.get('error') || '');
|
|
@@ -77,7 +77,7 @@ export const Login = ({ onSubmit, initialValue = '', welcomeText, removeLoadingO
|
|
|
77
77
|
return;
|
|
78
78
|
login('sso');
|
|
79
79
|
}
|
|
80
|
-
return (_jsxs(_Fragment, { children: [_jsxs(LoginBox, { onSubmit: submitForm, className: className, style: style, children: [_jsxs("header", { children: [_jsx(MiniLogo, {}), _jsx(Text, { className: "title", children: welcomeText || t.welcome })] }), _jsx(Input, { name: "email", value: email, onChange: e => setEmail(e.target.value), placeholder: t.placeholder }), _jsx(Button, { colorScheme: "primary", disabled: disabled || loading, children: loading ? _jsx(LoadingCircular, {}) : _jsx(Text, { children: t.continue }) }), _jsx("p", { className: "separator", children: t.or }), _jsx(Button, { colorScheme: "light", type: "button", onClick: () => login('idp'), disabled: loading, children: loading ? _jsx(LoadingCircular, {}) : (_jsxs(_Fragment, { children: [_jsx(IconBox, { children: _jsx(Github, {}) }), _jsx(Text, { children: t.loginWithGithub })] })) }), error && _jsxs(Text, { className: "error", children: [t.error, ": ", error] })] }), _jsx(BannerWarning, { children: t.bannerText })] }));
|
|
80
|
+
return (_jsxs(_Fragment, { children: [_jsxs(LoginBox, { onSubmit: submitForm, className: className, style: style, children: [_jsxs("header", { children: [_jsx(MiniLogo, {}), _jsx(Text, { className: "title", children: welcomeText || t.welcome })] }), _jsx(Input, { name: "email", value: email, onChange: e => setEmail(e.target.value), placeholder: t.placeholder }), _jsx(Button, { colorScheme: "primary", disabled: disabled || loading, children: loading ? _jsx(LoadingCircular, {}) : _jsx(Text, { children: t.continue }) }), _jsx("p", { className: "separator", children: t.or }), _jsx(Button, { colorScheme: "light", type: "button", onClick: () => login('idp'), disabled: loading, children: loading ? _jsx(LoadingCircular, {}) : (_jsxs(_Fragment, { children: [_jsx(IconBox, { children: _jsx(Github, {}) }), _jsx(Text, { children: t.loginWithGithub })] })) }), error && _jsxs(Text, { className: "error", children: [t.error, ": ", error] })] }), showBanner && _jsx(BannerWarning, { children: t.bannerText })] }));
|
|
81
81
|
};
|
|
82
82
|
const dictionary = {
|
|
83
83
|
en: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Login.js","sourceRoot":"","sources":["../../src/components/Login.tsx"],"names":[],"mappings":";AAAA,4BAA4B;AAC5B,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAChD,OAAO,EAAc,YAAY,EAAE,MAAM,8BAA8B,CAAA;AACvE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO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AC,mNAAmN,EAAC,IAAI,EAAC,SAAS,GAAQ,EAClP,eAAM,CAAC,EAAC,iNAAiN,EAAC,IAAI,EAAC,SAAS,GAAQ,EAChP,eAAM,CAAC,EAAC,mNAAmN,EAAC,IAAI,EAAC,SAAS,GAAQ,EAClP,eAAM,CAAC,EAAC,iNAAiN,EAAC,IAAI,EAAC,SAAS,GAAQ,EAChP,eAAM,CAAC,EAAC,mNAAmN,EAAC,IAAI,EAAC,SAAS,GAAQ,EAClP,eAAM,CAAC,EAAC,mNAAmN,EAAC,IAAI,EAAC,SAAS,GAAQ,EAClP,eAAM,CAAC,EAAC,iNAAiN,EAAC,IAAI,EAAC,SAAS,GAAQ,EAChP,eAAM,CAAC,EAAC,iNAAiN,EAAC,IAAI,EAAC,SAAS,GAAQ,IAC9O,EACJ,yBACE,mBAAU,EAAE,EAAC,qBAAqB,YAChC,eAAM,KAAK,EAAC,QAAQ,EAAC,MAAM,EAAC,SAAS,EAAC,IAAI,EAAC,OAAO,EAAC,SAAS,EAAC,qBAAqB,GAAQ,GACjF,GACN,IACH,CACP,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function getServiceNowLauncher(): HTMLElement | null;
|
|
2
|
+
export declare function openServiceNowChat(): void;
|
|
3
|
+
export declare function addOrRemoveServiceNowLauncher(action: string): void;
|
|
4
|
+
export declare function useServiceNowChatButtonVisibility(): boolean;
|
|
5
|
+
export declare function useServiceNowEffect(): void;
|
|
6
|
+
//# sourceMappingURL=service-now.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-now.d.ts","sourceRoot":"","sources":["../../src/hooks/service-now.tsx"],"names":[],"mappings":"AA8DA,wBAAgB,qBAAqB,uBAEpC;AAED,wBAAgB,kBAAkB,SAIjC;AAaD,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,MAAM,QAQ3D;AAoED,wBAAgB,iCAAiC,YAIhD;AAED,wBAAgB,mBAAmB,SAIlC"}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { overlay } from '@stack-spot/portal-layout';
|
|
2
|
+
import { getLanguage, translate } from '@stack-spot/portal-translate';
|
|
3
|
+
import { pull } from 'lodash';
|
|
4
|
+
import { useState } from 'react';
|
|
5
|
+
import { useEffectOnce } from './use-effect-once.js';
|
|
6
|
+
const closeButtonStyle = `
|
|
7
|
+
position: absolute;
|
|
8
|
+
bottom: -64px;
|
|
9
|
+
right: 60px;
|
|
10
|
+
width: 20px;
|
|
11
|
+
height: 20px;
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
background-color: #BCBCCF;
|
|
16
|
+
border: none;
|
|
17
|
+
outline: none;
|
|
18
|
+
border-radius: 50%;
|
|
19
|
+
font: 400 20px Roboto, sans-serif;
|
|
20
|
+
color: #0B0B0E;
|
|
21
|
+
cursor: pointer;
|
|
22
|
+
transform: scale(0);
|
|
23
|
+
transition: transform 0.2s;
|
|
24
|
+
z-index: 999999;
|
|
25
|
+
`;
|
|
26
|
+
const iframeStyle = `
|
|
27
|
+
position: fixed;
|
|
28
|
+
display: none;
|
|
29
|
+
right: 15px;
|
|
30
|
+
bottom: 88px;
|
|
31
|
+
max-height: calc(100vh - 152px);
|
|
32
|
+
border-radius: 12px;
|
|
33
|
+
width: 380px;
|
|
34
|
+
height: 600px;
|
|
35
|
+
`;
|
|
36
|
+
const HOVER_AREA_PX = 100;
|
|
37
|
+
const LOCAL_STORAGE_SERVICE_NOW_VALUE = 'serviceNowChatButtonVisible';
|
|
38
|
+
const chatVisibilityListeners = [];
|
|
39
|
+
const serviceNowReference = 'https://zupdev.service-now.com/sn_va_web_client_app_embed.do?sysparm_branding_key=stackspotvirtualagent';
|
|
40
|
+
function loadScript(src) {
|
|
41
|
+
return new Promise((resolve, reject) => {
|
|
42
|
+
const iframe = document.createElement('iframe');
|
|
43
|
+
const serviceNowContent = document.getElementById('service-now-content');
|
|
44
|
+
iframe.setAttribute('id', 'sn_va_web_client');
|
|
45
|
+
iframe.setAttribute('src', src);
|
|
46
|
+
iframe.style.cssText = iframeStyle;
|
|
47
|
+
iframe.onload = () => resolve();
|
|
48
|
+
iframe.onerror = (error) => reject(error);
|
|
49
|
+
serviceNowContent && serviceNowContent.appendChild(iframe);
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
export function getServiceNowLauncher() {
|
|
53
|
+
return document.getElementById('sn_va_web_client');
|
|
54
|
+
}
|
|
55
|
+
export function openServiceNowChat() {
|
|
56
|
+
hideOrShowServiceNowContent('visible');
|
|
57
|
+
addOrRemoveServiceNowLauncher('add');
|
|
58
|
+
showServiceNowChatButton();
|
|
59
|
+
}
|
|
60
|
+
function getServiceNowButton() {
|
|
61
|
+
return document.getElementById('service-now-button');
|
|
62
|
+
}
|
|
63
|
+
function hideOrShowServiceNowContent(action) {
|
|
64
|
+
const content = document.getElementById('service-now-content');
|
|
65
|
+
if (content) {
|
|
66
|
+
content.style.visibility = action;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
export function addOrRemoveServiceNowLauncher(action) {
|
|
70
|
+
const launcher = getServiceNowLauncher();
|
|
71
|
+
const isAdd = action === 'add';
|
|
72
|
+
if (launcher) {
|
|
73
|
+
isAdd ? launcher.classList.add('show') : launcher.classList.remove('show');
|
|
74
|
+
launcher.style.display = isAdd ? 'block' : 'none';
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function addChatVisibilityListener(listener) {
|
|
78
|
+
chatVisibilityListeners.push(listener);
|
|
79
|
+
return () => pull(chatVisibilityListeners, listener);
|
|
80
|
+
}
|
|
81
|
+
function renderCloseButton() {
|
|
82
|
+
const serviceNowButton = getServiceNowButton();
|
|
83
|
+
const anchor = serviceNowButton?.parentElement;
|
|
84
|
+
if (!anchor)
|
|
85
|
+
return;
|
|
86
|
+
const close = document.createElement('button');
|
|
87
|
+
close.setAttribute('id', 'close-service-now');
|
|
88
|
+
close.style.cssText = closeButtonStyle;
|
|
89
|
+
close.textContent = '-';
|
|
90
|
+
close.addEventListener('click', () => hideServiceNowChatButton());
|
|
91
|
+
anchor.appendChild(close);
|
|
92
|
+
serviceNowButton.addEventListener('mouseenter', () => {
|
|
93
|
+
const t = translate(dictionary, getLanguage());
|
|
94
|
+
close.setAttribute('title', t.hide);
|
|
95
|
+
close.style.transform = 'scale(1)';
|
|
96
|
+
const onMouseMove = (ev) => {
|
|
97
|
+
if (ev.clientX < window.innerWidth - HOVER_AREA_PX || ev.clientY < window.innerHeight - HOVER_AREA_PX) {
|
|
98
|
+
close.style.transform = 'scale(0)';
|
|
99
|
+
window.removeEventListener('mousemove', onMouseMove);
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
window.addEventListener('mousemove', onMouseMove);
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
function showServiceNowChatButton() {
|
|
106
|
+
getServiceNowButton()?.classList?.add('show');
|
|
107
|
+
localStorage.setItem(LOCAL_STORAGE_SERVICE_NOW_VALUE, 'true');
|
|
108
|
+
chatVisibilityListeners.forEach(l => l(true));
|
|
109
|
+
}
|
|
110
|
+
function hideServiceNowChatButton(silent = false) {
|
|
111
|
+
const t = translate(dictionary, getLanguage());
|
|
112
|
+
hideOrShowServiceNowContent('hidden');
|
|
113
|
+
addOrRemoveServiceNowLauncher('remove');
|
|
114
|
+
getServiceNowButton()?.classList?.remove('show');
|
|
115
|
+
localStorage.setItem(LOCAL_STORAGE_SERVICE_NOW_VALUE, 'false');
|
|
116
|
+
if (!silent)
|
|
117
|
+
overlay.showToaster({ type: 'info', title: t.hiddenTitle, message: t.hiddenMessage, autoClose: false });
|
|
118
|
+
chatVisibilityListeners.forEach(l => l(false));
|
|
119
|
+
}
|
|
120
|
+
function isServiceNowChatButtonVisible() {
|
|
121
|
+
return localStorage.getItem(LOCAL_STORAGE_SERVICE_NOW_VALUE) !== 'false';
|
|
122
|
+
}
|
|
123
|
+
async function initializeChat() {
|
|
124
|
+
try {
|
|
125
|
+
await loadScript(serviceNowReference);
|
|
126
|
+
if (isServiceNowChatButtonVisible())
|
|
127
|
+
showServiceNowChatButton();
|
|
128
|
+
else
|
|
129
|
+
hideServiceNowChatButton(true);
|
|
130
|
+
renderCloseButton();
|
|
131
|
+
}
|
|
132
|
+
catch {
|
|
133
|
+
const t = translate(dictionary, getLanguage());
|
|
134
|
+
// eslint-disable-next-line no-console
|
|
135
|
+
console.warn(t.errorLoadScript);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
export function useServiceNowChatButtonVisibility() {
|
|
139
|
+
const [visible, setVisible] = useState(isServiceNowChatButtonVisible());
|
|
140
|
+
useEffectOnce(() => addChatVisibilityListener(setVisible));
|
|
141
|
+
return visible;
|
|
142
|
+
}
|
|
143
|
+
export function useServiceNowEffect() {
|
|
144
|
+
useEffectOnce(() => {
|
|
145
|
+
initializeChat();
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
const dictionary = {
|
|
149
|
+
en: {
|
|
150
|
+
errorLoadScript: 'An error occurred while loading the script:',
|
|
151
|
+
hide: 'Hide chat button',
|
|
152
|
+
hiddenTitle: 'The chat button is now hidden',
|
|
153
|
+
hiddenMessage: 'To see it again, please select the option "Chat with us" in the menu just under this message.',
|
|
154
|
+
},
|
|
155
|
+
pt: {
|
|
156
|
+
errorLoadScript: 'Ocorreu um erro ao carregar o script:',
|
|
157
|
+
hide: 'Esconder o botão de chat',
|
|
158
|
+
hiddenTitle: 'O botão de chat foi escondido',
|
|
159
|
+
hiddenMessage: 'Para vê-lo novamente, por favor escolha a opção "Converse conosco" no menu logo em baixo desta mensagem.',
|
|
160
|
+
},
|
|
161
|
+
};
|
|
162
|
+
//# sourceMappingURL=service-now.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-now.js","sourceRoot":"","sources":["../../src/hooks/service-now.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AACnD,OAAO,EAA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AiC;IAC/C,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,6BAA6B,EAAE,CAAC,CAAA;IACvE,aAAa,CAAC,GAAG,EAAE,CAAC,yBAAyB,CAAC,UAAU,CAAC,CAAC,CAAA;IAC1D,OAAO,OAAO,CAAA;AAChB,CAAC;AAED,MAAM,UAAU,mBAAmB;IACjC,aAAa,CAAC,GAAG,EAAE;QACjB,cAAc,EAAE,CAAA;IAClB,CAAC,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,UAAU,GAAG;IACjB,EAAE,EAAE;QACF,eAAe,EAAE,6CAA6C;QAC9D,IAAI,EAAE,kBAAkB;QACxB,WAAW,EAAE,+BAA+B;QAC5C,aAAa,EAAE,+FAA+F;KAC/G;IACD,EAAE,EAAE;QACF,eAAe,EAAE,uCAAuC;QACxD,IAAI,EAAE,0BAA0B;QAChC,WAAW,EAAE,+BAA+B;QAC5C,aAAa,EAAE,0GAA0G;KAC1H;CACmB,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code taken from https://blog.ag-grid.com/avoiding-react-18-double-mount/
|
|
3
|
+
*
|
|
4
|
+
* Attention: don't use this hook unless you really have to!
|
|
5
|
+
*
|
|
6
|
+
* This hook fixes the React 18 behavior of calling useEffect hooks twice in strict/development mode, which ruins some mounting/unmounting
|
|
7
|
+
* behaviors.
|
|
8
|
+
*
|
|
9
|
+
* @param effect refer to React's useEffect.
|
|
10
|
+
*/
|
|
11
|
+
export declare const useEffectOnce: (effect: () => void | (() => void)) => void;
|
|
12
|
+
//# sourceMappingURL=use-effect-once.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-effect-once.d.ts","sourceRoot":"","sources":["../../src/hooks/use-effect-once.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,WAAY,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,SA8B9D,CAAA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { useEffect, useRef, useState } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Code taken from https://blog.ag-grid.com/avoiding-react-18-double-mount/
|
|
4
|
+
*
|
|
5
|
+
* Attention: don't use this hook unless you really have to!
|
|
6
|
+
*
|
|
7
|
+
* This hook fixes the React 18 behavior of calling useEffect hooks twice in strict/development mode, which ruins some mounting/unmounting
|
|
8
|
+
* behaviors.
|
|
9
|
+
*
|
|
10
|
+
* @param effect refer to React's useEffect.
|
|
11
|
+
*/
|
|
12
|
+
export const useEffectOnce = (effect) => {
|
|
13
|
+
const effectFn = useRef(effect);
|
|
14
|
+
const destroyFn = useRef();
|
|
15
|
+
const effectCalled = useRef(false);
|
|
16
|
+
const rendered = useRef(false);
|
|
17
|
+
const [, setVal] = useState(0);
|
|
18
|
+
if (effectCalled.current) {
|
|
19
|
+
rendered.current = true;
|
|
20
|
+
}
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
// only execute the effect first time around
|
|
23
|
+
if (!effectCalled.current) {
|
|
24
|
+
destroyFn.current = effectFn.current();
|
|
25
|
+
effectCalled.current = true;
|
|
26
|
+
}
|
|
27
|
+
// this forces one render after the effect is run
|
|
28
|
+
setVal((val) => val + 1);
|
|
29
|
+
return () => {
|
|
30
|
+
// if the comp didn't render since the useEffect was called,
|
|
31
|
+
// we know it's the dummy React cycle
|
|
32
|
+
if (!rendered.current)
|
|
33
|
+
return;
|
|
34
|
+
// otherwise this is not a dummy destroy, so call the destroy func
|
|
35
|
+
if (destroyFn.current)
|
|
36
|
+
destroyFn.current();
|
|
37
|
+
};
|
|
38
|
+
}, []);
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=use-effect-once.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-effect-once.js","sourceRoot":"","sources":["../../src/hooks/use-effect-once.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEnD;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,MAAiC,EAAE,EAAE;IACjE,MAAM,QAAQ,GAAG,MAAM,CAA4B,MAAM,CAAC,CAAA;IAC1D,MAAM,SAAS,GAAG,MAAM,EAAuB,CAAA;IAC/C,MAAM,YAAY,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA;IAClC,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC,GAAG,QAAQ,CAAS,CAAC,CAAC,CAAA;IAEtC,IAAI,YAAY,CAAC,OAAO,EAAE,CAAC;QACzB,QAAQ,CAAC,OAAO,GAAG,IAAI,CAAA;IACzB,CAAC;IAED,SAAS,CAAC,GAAG,EAAE;QACb,4CAA4C;QAC5C,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC;YAC1B,SAAS,CAAC,OAAO,GAAG,QAAQ,CAAC,OAAO,EAAE,CAAA;YACtC,YAAY,CAAC,OAAO,GAAG,IAAI,CAAA;QAC7B,CAAC;QAED,iDAAiD;QACjD,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,CAAA;QAExB,OAAO,GAAG,EAAE;YACV,4DAA4D;YAC5D,qCAAqC;YACrC,IAAI,CAAC,QAAQ,CAAC,OAAO;gBAAE,OAAM;YAE7B,kEAAkE;YAClE,IAAI,SAAS,CAAC,OAAO;gBAAE,SAAS,CAAC,OAAO,EAAE,CAAA;QAC5C,CAAC,CAAA;IACH,CAAC,EAAE,EAAE,CAAC,CAAA;AACR,CAAC,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { BannerWarning } from './components/BannerWarning.js';
|
|
2
|
+
export { ChatBot } from './components/ChatBot.js';
|
|
3
|
+
export { Login } from './components/Login.js';
|
|
4
|
+
export { openServiceNowChat, useServiceNowChatButtonVisibility, useServiceNowEffect, } from './hooks/service-now.js';
|
|
3
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC1C,OAAO,EACL,kBAAkB,EAClB,iCAAiC,EACjC,mBAAmB,GACpB,MAAM,qBAAqB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { BannerWarning } from './components/BannerWarning.js';
|
|
2
|
+
export { ChatBot } from './components/ChatBot.js';
|
|
3
|
+
export { Login } from './components/Login.js';
|
|
4
|
+
export { openServiceNowChat, useServiceNowChatButtonVisibility, useServiceNowEffect, } from './hooks/service-now.js';
|
|
3
5
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC1C,OAAO,EACL,kBAAkB,EAClB,iCAAiC,EACjC,mBAAmB,GACpB,MAAM,qBAAqB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stack-spot/portal-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"@citric/ui": ">=5.4.0",
|
|
11
11
|
"@stack-spot/portal-theme": ">=0.0.4",
|
|
12
12
|
"@stack-spot/portal-translate": ">=0.0.5",
|
|
13
|
+
"@stack-spot/portal-layout": ">=0.0.5",
|
|
13
14
|
"react": ">=18.2.0",
|
|
14
15
|
"react-dom": ">=18.2.0",
|
|
15
16
|
"styled-components": ">=6.1.1"
|
|
@@ -19,6 +20,7 @@
|
|
|
19
20
|
"@types/react-dom": "^18.2.15",
|
|
20
21
|
"@typescript-eslint/eslint-plugin": "^6.10.0",
|
|
21
22
|
"@typescript-eslint/parser": "^6.10.0",
|
|
23
|
+
"@types/lodash": "^4.14.202",
|
|
22
24
|
"eslint": "^8.53.0",
|
|
23
25
|
"eslint-plugin-filenames": "^1.3.2",
|
|
24
26
|
"eslint-plugin-import": "^2.29.0",
|
|
@@ -31,7 +33,8 @@
|
|
|
31
33
|
"typescript": "^5.2.2"
|
|
32
34
|
},
|
|
33
35
|
"dependencies": {
|
|
34
|
-
"react-toastify": "^9.1.3"
|
|
36
|
+
"react-toastify": "^9.1.3",
|
|
37
|
+
"lodash": "^4.17.21"
|
|
35
38
|
},
|
|
36
39
|
"scripts": {
|
|
37
40
|
"build": "tsc && tsc-esm-fix --target='dist'",
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Button, Flex, IconBox, Styles } from '@citric/core'
|
|
2
|
+
import { QuestionAnswer, Times } from '@citric/icons'
|
|
3
|
+
import { useState } from 'react'
|
|
4
|
+
import { addOrRemoveServiceNowLauncher, getServiceNowLauncher } from '../hooks/service-now'
|
|
5
|
+
|
|
6
|
+
const styles: Styles = {
|
|
7
|
+
content: {
|
|
8
|
+
position: 'fixed',
|
|
9
|
+
bottom: '80px',
|
|
10
|
+
right: '0',
|
|
11
|
+
visibility: 'visible',
|
|
12
|
+
},
|
|
13
|
+
button: {
|
|
14
|
+
position: 'fixed',
|
|
15
|
+
right: '15px',
|
|
16
|
+
width: '64px',
|
|
17
|
+
height: '64px',
|
|
18
|
+
borderRadius: '50%',
|
|
19
|
+
border: 'none',
|
|
20
|
+
opacity: '0',
|
|
21
|
+
|
|
22
|
+
'&.show': {
|
|
23
|
+
opacity: '1',
|
|
24
|
+
},
|
|
25
|
+
'&:hover, &:focus': {
|
|
26
|
+
background: 'primary.500',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
icon: {
|
|
30
|
+
position: 'absolute',
|
|
31
|
+
top: '50%',
|
|
32
|
+
left: '50%',
|
|
33
|
+
transform: 'translate(-50%, -50%)',
|
|
34
|
+
},
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const ChatBot = () => {
|
|
38
|
+
const chatBotIframe = getServiceNowLauncher()
|
|
39
|
+
const isShowChatBot = chatBotIframe?.classList.contains('show')
|
|
40
|
+
|
|
41
|
+
const [, setChatBotOpen] = useState(isShowChatBot)
|
|
42
|
+
|
|
43
|
+
const handleOpenChatBot = () => {
|
|
44
|
+
if (chatBotIframe) {
|
|
45
|
+
if (isShowChatBot) {
|
|
46
|
+
addOrRemoveServiceNowLauncher('remove')
|
|
47
|
+
setChatBotOpen(false)
|
|
48
|
+
} else {
|
|
49
|
+
addOrRemoveServiceNowLauncher('add')
|
|
50
|
+
setChatBotOpen(true)
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<Flex id="service-now-content" sx={styles.content}>
|
|
57
|
+
<Button
|
|
58
|
+
onClick={handleOpenChatBot}
|
|
59
|
+
id="service-now-button"
|
|
60
|
+
sx={styles.button}
|
|
61
|
+
>
|
|
62
|
+
<IconBox
|
|
63
|
+
colorScheme="light.400"
|
|
64
|
+
sx={styles.icon}
|
|
65
|
+
size="lg">
|
|
66
|
+
{
|
|
67
|
+
isShowChatBot ? (
|
|
68
|
+
<Times />
|
|
69
|
+
) : (
|
|
70
|
+
<QuestionAnswer />
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
</IconBox>
|
|
74
|
+
</Button>
|
|
75
|
+
</Flex>
|
|
76
|
+
)
|
|
77
|
+
}
|
|
@@ -6,8 +6,8 @@ import { theme } from '@stack-spot/portal-theme'
|
|
|
6
6
|
import { Dictionary, useTranslate } from '@stack-spot/portal-translate'
|
|
7
7
|
import { useState } from 'react'
|
|
8
8
|
import { styled } from 'styled-components'
|
|
9
|
-
import { MiniLogo } from './MiniLogo'
|
|
10
9
|
import { BannerWarning } from './BannerWarning'
|
|
10
|
+
import { MiniLogo } from './MiniLogo'
|
|
11
11
|
|
|
12
12
|
type LoginType = 'sso' | 'idp'
|
|
13
13
|
|
|
@@ -34,6 +34,7 @@ interface Props {
|
|
|
34
34
|
removeLoadingOnSuccess?: boolean,
|
|
35
35
|
className?: string,
|
|
36
36
|
style?: React.CSSProperties,
|
|
37
|
+
showBanner?: boolean,
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
const LoginBox = styled.form`
|
|
@@ -78,7 +79,7 @@ const LoginBox = styled.form`
|
|
|
78
79
|
}
|
|
79
80
|
`
|
|
80
81
|
|
|
81
|
-
export const Login = ({ onSubmit, initialValue = '', welcomeText, removeLoadingOnSuccess, className, style }: Props) => {
|
|
82
|
+
export const Login = ({ onSubmit, initialValue = '', welcomeText, removeLoadingOnSuccess, className, style, showBanner }: Props) => {
|
|
82
83
|
const t = useTranslate(dictionary)
|
|
83
84
|
const searchParams = new URLSearchParams(location.search)
|
|
84
85
|
const [error, setError] = useState(searchParams.get('error_description') || searchParams.get('error') || '')
|
|
@@ -129,9 +130,9 @@ export const Login = ({ onSubmit, initialValue = '', welcomeText, removeLoadingO
|
|
|
129
130
|
</Button>
|
|
130
131
|
{error && <Text className="error">{t.error}: {error}</Text>}
|
|
131
132
|
</LoginBox>
|
|
132
|
-
<BannerWarning>
|
|
133
|
+
{showBanner && <BannerWarning>
|
|
133
134
|
{t.bannerText}
|
|
134
|
-
</BannerWarning>
|
|
135
|
+
</BannerWarning>}
|
|
135
136
|
</>
|
|
136
137
|
)
|
|
137
138
|
}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
|
|
2
|
+
import { overlay } from '@stack-spot/portal-layout'
|
|
3
|
+
import { Dictionary, getLanguage, translate } from '@stack-spot/portal-translate'
|
|
4
|
+
import { pull } from 'lodash'
|
|
5
|
+
import { useState } from 'react'
|
|
6
|
+
import { useEffectOnce } from './use-effect-once'
|
|
7
|
+
|
|
8
|
+
const closeButtonStyle = `
|
|
9
|
+
position: absolute;
|
|
10
|
+
bottom: -64px;
|
|
11
|
+
right: 60px;
|
|
12
|
+
width: 20px;
|
|
13
|
+
height: 20px;
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
background-color: #BCBCCF;
|
|
18
|
+
border: none;
|
|
19
|
+
outline: none;
|
|
20
|
+
border-radius: 50%;
|
|
21
|
+
font: 400 20px Roboto, sans-serif;
|
|
22
|
+
color: #0B0B0E;
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
transform: scale(0);
|
|
25
|
+
transition: transform 0.2s;
|
|
26
|
+
z-index: 999999;
|
|
27
|
+
`
|
|
28
|
+
|
|
29
|
+
const iframeStyle = `
|
|
30
|
+
position: fixed;
|
|
31
|
+
display: none;
|
|
32
|
+
right: 15px;
|
|
33
|
+
bottom: 88px;
|
|
34
|
+
max-height: calc(100vh - 152px);
|
|
35
|
+
border-radius: 12px;
|
|
36
|
+
width: 380px;
|
|
37
|
+
height: 600px;
|
|
38
|
+
`
|
|
39
|
+
|
|
40
|
+
type ChatVisibilityListener = (visible: boolean) => void
|
|
41
|
+
|
|
42
|
+
const HOVER_AREA_PX = 100
|
|
43
|
+
const LOCAL_STORAGE_SERVICE_NOW_VALUE = 'serviceNowChatButtonVisible'
|
|
44
|
+
const chatVisibilityListeners: ChatVisibilityListener[] = []
|
|
45
|
+
|
|
46
|
+
const serviceNowReference = 'https://zupdev.service-now.com/sn_va_web_client_app_embed.do?sysparm_branding_key=stackspotvirtualagent'
|
|
47
|
+
|
|
48
|
+
function loadScript(src: string): Promise<void> {
|
|
49
|
+
return new Promise<void>((resolve, reject) => {
|
|
50
|
+
const iframe = document.createElement('iframe')
|
|
51
|
+
const serviceNowContent = document.getElementById('service-now-content')
|
|
52
|
+
iframe.setAttribute('id', 'sn_va_web_client')
|
|
53
|
+
iframe.setAttribute('src', src)
|
|
54
|
+
iframe.style.cssText = iframeStyle
|
|
55
|
+
|
|
56
|
+
iframe.onload = () => resolve()
|
|
57
|
+
iframe.onerror = (error) => reject(error)
|
|
58
|
+
|
|
59
|
+
serviceNowContent && serviceNowContent.appendChild(iframe)
|
|
60
|
+
})
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function getServiceNowLauncher() {
|
|
64
|
+
return document.getElementById('sn_va_web_client')
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function openServiceNowChat() {
|
|
68
|
+
hideOrShowServiceNowContent('visible')
|
|
69
|
+
addOrRemoveServiceNowLauncher('add')
|
|
70
|
+
showServiceNowChatButton()
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function getServiceNowButton() {
|
|
74
|
+
return document.getElementById('service-now-button')
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function hideOrShowServiceNowContent(action: string) {
|
|
78
|
+
const content = document.getElementById('service-now-content')
|
|
79
|
+
if (content) {
|
|
80
|
+
content.style.visibility = action
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export function addOrRemoveServiceNowLauncher(action: string) {
|
|
85
|
+
const launcher = getServiceNowLauncher()
|
|
86
|
+
const isAdd = action === 'add'
|
|
87
|
+
|
|
88
|
+
if (launcher) {
|
|
89
|
+
isAdd ? launcher.classList.add('show') : launcher.classList.remove('show')
|
|
90
|
+
launcher.style.display = isAdd ? 'block' : 'none'
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function addChatVisibilityListener(listener: ChatVisibilityListener) {
|
|
95
|
+
chatVisibilityListeners.push(listener)
|
|
96
|
+
return () => pull(chatVisibilityListeners, listener)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function renderCloseButton() {
|
|
100
|
+
const serviceNowButton = getServiceNowButton()
|
|
101
|
+
const anchor = serviceNowButton?.parentElement
|
|
102
|
+
if (!anchor) return
|
|
103
|
+
const close = document.createElement('button')
|
|
104
|
+
close.setAttribute('id', 'close-service-now')
|
|
105
|
+
close.style.cssText = closeButtonStyle
|
|
106
|
+
close.textContent = '-'
|
|
107
|
+
|
|
108
|
+
close.addEventListener('click', () => hideServiceNowChatButton())
|
|
109
|
+
anchor.appendChild(close)
|
|
110
|
+
|
|
111
|
+
serviceNowButton.addEventListener('mouseenter', () => {
|
|
112
|
+
const t = translate(dictionary, getLanguage())
|
|
113
|
+
close.setAttribute('title', t.hide)
|
|
114
|
+
close.style.transform = 'scale(1)'
|
|
115
|
+
|
|
116
|
+
const onMouseMove = (ev: MouseEvent) => {
|
|
117
|
+
if (ev.clientX < window.innerWidth - HOVER_AREA_PX || ev.clientY < window.innerHeight - HOVER_AREA_PX) {
|
|
118
|
+
close.style.transform = 'scale(0)'
|
|
119
|
+
window.removeEventListener('mousemove', onMouseMove)
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
window.addEventListener('mousemove', onMouseMove)
|
|
123
|
+
})
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function showServiceNowChatButton() {
|
|
127
|
+
getServiceNowButton()?.classList?.add('show')
|
|
128
|
+
localStorage.setItem(LOCAL_STORAGE_SERVICE_NOW_VALUE, 'true')
|
|
129
|
+
chatVisibilityListeners.forEach(l => l(true))
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function hideServiceNowChatButton(silent = false) {
|
|
133
|
+
const t = translate(dictionary, getLanguage())
|
|
134
|
+
|
|
135
|
+
hideOrShowServiceNowContent('hidden')
|
|
136
|
+
addOrRemoveServiceNowLauncher('remove')
|
|
137
|
+
getServiceNowButton()?.classList?.remove('show')
|
|
138
|
+
localStorage.setItem(LOCAL_STORAGE_SERVICE_NOW_VALUE, 'false')
|
|
139
|
+
if (!silent) overlay.showToaster({ type: 'info', title: t.hiddenTitle, message: t.hiddenMessage, autoClose: false })
|
|
140
|
+
chatVisibilityListeners.forEach(l => l(false))
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function isServiceNowChatButtonVisible() {
|
|
144
|
+
return localStorage.getItem(LOCAL_STORAGE_SERVICE_NOW_VALUE) !== 'false'
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
async function initializeChat() {
|
|
148
|
+
try {
|
|
149
|
+
await loadScript(serviceNowReference)
|
|
150
|
+
if (isServiceNowChatButtonVisible()) showServiceNowChatButton()
|
|
151
|
+
else hideServiceNowChatButton(true)
|
|
152
|
+
renderCloseButton()
|
|
153
|
+
} catch {
|
|
154
|
+
const t = translate(dictionary, getLanguage())
|
|
155
|
+
// eslint-disable-next-line no-console
|
|
156
|
+
console.warn(t.errorLoadScript)
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export function useServiceNowChatButtonVisibility() {
|
|
161
|
+
const [visible, setVisible] = useState(isServiceNowChatButtonVisible())
|
|
162
|
+
useEffectOnce(() => addChatVisibilityListener(setVisible))
|
|
163
|
+
return visible
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export function useServiceNowEffect() {
|
|
167
|
+
useEffectOnce(() => {
|
|
168
|
+
initializeChat()
|
|
169
|
+
})
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
const dictionary = {
|
|
173
|
+
en: {
|
|
174
|
+
errorLoadScript: 'An error occurred while loading the script:',
|
|
175
|
+
hide: 'Hide chat button',
|
|
176
|
+
hiddenTitle: 'The chat button is now hidden',
|
|
177
|
+
hiddenMessage: 'To see it again, please select the option "Chat with us" in the menu just under this message.',
|
|
178
|
+
},
|
|
179
|
+
pt: {
|
|
180
|
+
errorLoadScript: 'Ocorreu um erro ao carregar o script:',
|
|
181
|
+
hide: 'Esconder o botão de chat',
|
|
182
|
+
hiddenTitle: 'O botão de chat foi escondido',
|
|
183
|
+
hiddenMessage: 'Para vê-lo novamente, por favor escolha a opção "Converse conosco" no menu logo em baixo desta mensagem.',
|
|
184
|
+
},
|
|
185
|
+
} satisfies Dictionary
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { useEffect, useRef, useState } from 'react'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Code taken from https://blog.ag-grid.com/avoiding-react-18-double-mount/
|
|
5
|
+
*
|
|
6
|
+
* Attention: don't use this hook unless you really have to!
|
|
7
|
+
*
|
|
8
|
+
* This hook fixes the React 18 behavior of calling useEffect hooks twice in strict/development mode, which ruins some mounting/unmounting
|
|
9
|
+
* behaviors.
|
|
10
|
+
*
|
|
11
|
+
* @param effect refer to React's useEffect.
|
|
12
|
+
*/
|
|
13
|
+
export const useEffectOnce = (effect: () => void | (() => void)) => {
|
|
14
|
+
const effectFn = useRef<() => void | (() => void)>(effect)
|
|
15
|
+
const destroyFn = useRef<void | (() => void)>()
|
|
16
|
+
const effectCalled = useRef(false)
|
|
17
|
+
const rendered = useRef(false)
|
|
18
|
+
const [, setVal] = useState<number>(0)
|
|
19
|
+
|
|
20
|
+
if (effectCalled.current) {
|
|
21
|
+
rendered.current = true
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
// only execute the effect first time around
|
|
26
|
+
if (!effectCalled.current) {
|
|
27
|
+
destroyFn.current = effectFn.current()
|
|
28
|
+
effectCalled.current = true
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// this forces one render after the effect is run
|
|
32
|
+
setVal((val) => val + 1)
|
|
33
|
+
|
|
34
|
+
return () => {
|
|
35
|
+
// if the comp didn't render since the useEffect was called,
|
|
36
|
+
// we know it's the dummy React cycle
|
|
37
|
+
if (!rendered.current) return
|
|
38
|
+
|
|
39
|
+
// otherwise this is not a dummy destroy, so call the destroy func
|
|
40
|
+
if (destroyFn.current) destroyFn.current()
|
|
41
|
+
}
|
|
42
|
+
}, [])
|
|
43
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { BannerWarning } from './components/BannerWarning'
|
|
2
|
+
export { ChatBot } from './components/ChatBot'
|
|
3
|
+
export { Login } from './components/Login'
|
|
4
|
+
export {
|
|
5
|
+
openServiceNowChat,
|
|
6
|
+
useServiceNowChatButtonVisibility,
|
|
7
|
+
useServiceNowEffect,
|
|
8
|
+
} from './hooks/service-now'
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BannerWarning.d.ts","sourceRoot":"","sources":["../src/BannerWarning.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,aAAa;cAA8B,MAAM,SAAS;6CAgBtE,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BannerWarning.js","sourceRoot":"","sources":["../src/BannerWarning.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAElC,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAAE,QAAQ,EAAiC,EAAE,EAAE,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AAC,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,OAAO,YACrF,OAAO,CAAC,CAAC,CAAC,KAAC,eAAe,KAAG,CAAC,CAAC,CAAC,CAC/B,8BACE,KAAC,OAAO,cACN,KAAC,MAAM,KAAG,GACF,EACV,KAAC,IAAI,cAAE,CAAC,CAAC,eAAe,GAAQ,IAC/B,CACJ,GACM,EACR,KAAK,IAAI,MAAC,IAAI,IAAC,SAAS,EAAC,OAAO,aAAE,CAAC,CAAC,KAAK,QAAI,KAAK,IAAQ,IAClD,EACX,KAAC,aAAa,cACX,CAAC,CAAC,UAAU,GACC,IACf,CACJ,CAAA;AACH,CAAC,CAAA;AAED,MAAM,UAAU,GAAG;IACjB,EAAE,EAAE;QACF,OAAO,EAAE,sBAAsB;QAC/B,WAAW,EAAE,gBAAgB;QAC7B,QAAQ,EAAE,UAAU;QACpB,EAAE,EAAE,IAAI;QACR,eAAe,EAAE,mBAAmB;QACpC,KAAK,EAAE,iCAAiC;QACxC,UAAU,EACR;8GACwG;KAC3G;IACD,EAAE,EAAE;QACF,OAAO,EAAE,uBAAuB;QAChC,WAAW,EAAE,gBAAgB;QAC7B,QAAQ,EAAE,WAAW;QACrB,EAAE,EAAE,IAAI;QACR,eAAe,EAAE,oBAAoB;QACrC,KAAK,EAAE,qBAAqB;QAC5B,UAAU,EACR;mJAC6I;KAChJ;CACmB,CAAA"}
|
package/dist/MiniLogo.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MiniLogo.d.ts","sourceRoot":"","sources":["../src/MiniLogo.tsx"],"names":[],"mappings":";AAEA,eAAO,MAAM,QAAQ;;;6CA6BpB,CAAA"}
|
package/dist/MiniLogo.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MiniLogo.js","sourceRoot":"","sources":["../src/MiniLogo.tsx"],"names":[],"mappings":";AAAA,4BAA4B;AAE5B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