@stack-spot/portal-components 0.0.17 → 0.0.18

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.
Files changed (86) hide show
  1. package/dist/components/Breadcrumb/index.d.ts +12 -2
  2. package/dist/components/Breadcrumb/index.d.ts.map +1 -1
  3. package/dist/components/Breadcrumb/index.js +6 -5
  4. package/dist/components/Breadcrumb/index.js.map +1 -1
  5. package/package.json +1 -1
  6. package/src/components/Breadcrumb/index.tsx +18 -5
  7. package/dist/BannerWarning.d.ts +0 -4
  8. package/dist/BannerWarning.d.ts.map +0 -1
  9. package/dist/BannerWarning.js +0 -6
  10. package/dist/BannerWarning.js.map +0 -1
  11. package/dist/Login.d.ts +0 -25
  12. package/dist/Login.d.ts.map +0 -1
  13. package/dist/Login.js +0 -104
  14. package/dist/Login.js.map +0 -1
  15. package/dist/MiniLogo.d.ts +0 -6
  16. package/dist/MiniLogo.d.ts.map +0 -1
  17. package/dist/MiniLogo.js +0 -4
  18. package/dist/MiniLogo.js.map +0 -1
  19. package/dist/components/src/components/BannerWarning.d.ts +0 -4
  20. package/dist/components/src/components/BannerWarning.d.ts.map +0 -1
  21. package/dist/components/src/components/BannerWarning.js +0 -6
  22. package/dist/components/src/components/BannerWarning.js.map +0 -1
  23. package/dist/components/src/components/Breadcrumb/index.d.ts +0 -42
  24. package/dist/components/src/components/Breadcrumb/index.d.ts.map +0 -1
  25. package/dist/components/src/components/Breadcrumb/index.js +0 -27
  26. package/dist/components/src/components/Breadcrumb/index.js.map +0 -1
  27. package/dist/components/src/components/Breadcrumb/styled.d.ts +0 -3
  28. package/dist/components/src/components/Breadcrumb/styled.d.ts.map +0 -1
  29. package/dist/components/src/components/Breadcrumb/styled.js +0 -36
  30. package/dist/components/src/components/Breadcrumb/styled.js.map +0 -1
  31. package/dist/components/src/components/ChatBot.d.ts +0 -2
  32. package/dist/components/src/components/ChatBot.d.ts.map +0 -1
  33. package/dist/components/src/components/ChatBot.js +0 -61
  34. package/dist/components/src/components/ChatBot.js.map +0 -1
  35. package/dist/components/src/components/Login.d.ts +0 -26
  36. package/dist/components/src/components/Login.d.ts.map +0 -1
  37. package/dist/components/src/components/Login.js +0 -100
  38. package/dist/components/src/components/Login.js.map +0 -1
  39. package/dist/components/src/components/MiniLogo.d.ts +0 -6
  40. package/dist/components/src/components/MiniLogo.d.ts.map +0 -1
  41. package/dist/components/src/components/MiniLogo.js +0 -4
  42. package/dist/components/src/components/MiniLogo.js.map +0 -1
  43. package/dist/components/src/components/tour/StepContainer.d.ts +0 -13
  44. package/dist/components/src/components/tour/StepContainer.d.ts.map +0 -1
  45. package/dist/components/src/components/tour/StepContainer.js +0 -48
  46. package/dist/components/src/components/tour/StepContainer.js.map +0 -1
  47. package/dist/components/src/components/tour/StepNavigation.d.ts +0 -13
  48. package/dist/components/src/components/tour/StepNavigation.d.ts.map +0 -1
  49. package/dist/components/src/components/tour/StepNavigation.js +0 -20
  50. package/dist/components/src/components/tour/StepNavigation.js.map +0 -1
  51. package/dist/components/src/components/tour/StepTitle.d.ts +0 -7
  52. package/dist/components/src/components/tour/StepTitle.d.ts.map +0 -1
  53. package/dist/components/src/components/tour/StepTitle.js +0 -5
  54. package/dist/components/src/components/tour/StepTitle.js.map +0 -1
  55. package/dist/components/src/components/tour/context.d.ts +0 -17
  56. package/dist/components/src/components/tour/context.d.ts.map +0 -1
  57. package/dist/components/src/components/tour/context.js +0 -48
  58. package/dist/components/src/components/tour/context.js.map +0 -1
  59. package/dist/components/src/components/tour/index.d.ts +0 -4
  60. package/dist/components/src/components/tour/index.d.ts.map +0 -1
  61. package/dist/components/src/components/tour/index.js +0 -4
  62. package/dist/components/src/components/tour/index.js.map +0 -1
  63. package/dist/components/src/components/tour/utils.d.ts +0 -13
  64. package/dist/components/src/components/tour/utils.d.ts.map +0 -1
  65. package/dist/components/src/components/tour/utils.js +0 -43
  66. package/dist/components/src/components/tour/utils.js.map +0 -1
  67. package/dist/components/src/hooks/service-now.d.ts +0 -24
  68. package/dist/components/src/hooks/service-now.d.ts.map +0 -1
  69. package/dist/components/src/hooks/service-now.js +0 -161
  70. package/dist/components/src/hooks/service-now.js.map +0 -1
  71. package/dist/components/src/hooks/title.d.ts +0 -3
  72. package/dist/components/src/hooks/title.d.ts.map +0 -1
  73. package/dist/components/src/hooks/title.js +0 -13
  74. package/dist/components/src/hooks/title.js.map +0 -1
  75. package/dist/components/src/hooks/use-effect-once.d.ts +0 -12
  76. package/dist/components/src/hooks/use-effect-once.d.ts.map +0 -1
  77. package/dist/components/src/hooks/use-effect-once.js +0 -40
  78. package/dist/components/src/hooks/use-effect-once.js.map +0 -1
  79. package/dist/components/src/index.d.ts +0 -9
  80. package/dist/components/src/index.d.ts.map +0 -1
  81. package/dist/components/src/index.js +0 -9
  82. package/dist/components/src/index.js.map +0 -1
  83. package/dist/layout/src/components/tour/PortalSwitcherStep.d.ts +0 -2
  84. package/dist/layout/src/components/tour/PortalSwitcherStep.d.ts.map +0 -1
  85. package/dist/layout/src/components/tour/PortalSwitcherStep.js +0 -30
  86. package/dist/layout/src/components/tour/PortalSwitcherStep.js.map +0 -1
@@ -1,161 +0,0 @@
1
- import { getLanguage, translate } from '@stack-spot/portal-translate';
2
- import { pull } from 'lodash';
3
- import { useState } from 'react';
4
- import { useEffectOnce } from './use-effect-once.js';
5
- const closeButtonStyle = `
6
- position: absolute;
7
- bottom: -64px;
8
- right: 60px;
9
- width: 20px;
10
- height: 20px;
11
- display: flex;
12
- align-items: center;
13
- justify-content: center;
14
- background-color: #BCBCCF;
15
- border: none;
16
- outline: none;
17
- border-radius: 50%;
18
- font: 400 20px Roboto, sans-serif;
19
- color: #0B0B0E;
20
- cursor: pointer;
21
- transform: scale(0);
22
- transition: transform 0.2s;
23
- z-index: 999999;
24
- `;
25
- const iframeStyle = `
26
- position: fixed;
27
- display: none;
28
- right: 15px;
29
- bottom: 88px;
30
- max-height: calc(100vh - 152px);
31
- border-radius: 12px;
32
- width: 380px;
33
- height: 600px;
34
- `;
35
- const HOVER_AREA_PX = 100;
36
- const LOCAL_STORAGE_SERVICE_NOW_VALUE = 'serviceNowChatButtonVisible';
37
- const chatVisibilityListeners = [];
38
- const serviceNowReference = 'https://zup.service-now.com/sn_va_web_client_app_embed.do?sysparm_branding_key=stackspotvirtualagent&sysparm_topic=f2b636c11bb50e50fe670dcbe54bcb1d';
39
- function loadScript(src) {
40
- return new Promise((resolve, reject) => {
41
- const iframe = document.createElement('iframe');
42
- const serviceNowContent = document.getElementById('service-now-content');
43
- iframe.setAttribute('id', 'sn_va_web_client');
44
- iframe.setAttribute('src', src);
45
- iframe.style.cssText = iframeStyle;
46
- iframe.onload = () => resolve();
47
- iframe.onerror = (error) => reject(error);
48
- serviceNowContent && serviceNowContent.appendChild(iframe);
49
- });
50
- }
51
- export function getServiceNowLauncher() {
52
- return document.getElementById('sn_va_web_client');
53
- }
54
- export function openServiceNowChat() {
55
- hideOrShowServiceNowContent('visible');
56
- addOrRemoveServiceNowLauncher('add');
57
- showServiceNowChatButton();
58
- }
59
- function getServiceNowButton() {
60
- return document.getElementById('service-now-button');
61
- }
62
- function hideOrShowServiceNowContent(action) {
63
- const content = document.getElementById('service-now-content');
64
- if (content) {
65
- content.style.visibility = action;
66
- }
67
- }
68
- export function addOrRemoveServiceNowLauncher(action) {
69
- const launcher = getServiceNowLauncher();
70
- const isAdd = action === 'add';
71
- if (launcher) {
72
- isAdd ? launcher.classList.add('show') : launcher.classList.remove('show');
73
- const content = document.getElementById('service-now-content');
74
- isAdd ? content?.classList.add('opened') : content?.classList.remove('opened');
75
- launcher.style.display = isAdd ? 'block' : 'none';
76
- }
77
- }
78
- function addChatVisibilityListener(listener) {
79
- chatVisibilityListeners.push(listener);
80
- return () => pull(chatVisibilityListeners, listener);
81
- }
82
- function renderCloseButton(onClose) {
83
- const serviceNowButton = getServiceNowButton();
84
- const anchor = serviceNowButton?.parentElement;
85
- if (!anchor)
86
- return;
87
- const close = document.createElement('button');
88
- close.setAttribute('id', 'close-service-now');
89
- close.style.cssText = closeButtonStyle;
90
- close.textContent = '-';
91
- close.addEventListener('click', () => hideServiceNowChatButton(onClose));
92
- anchor.appendChild(close);
93
- serviceNowButton.addEventListener('mouseenter', () => {
94
- const t = translate(dictionary, getLanguage());
95
- close.setAttribute('title', t.hide);
96
- close.style.transform = 'scale(1)';
97
- const onMouseMove = (ev) => {
98
- if (ev.clientX < window.innerWidth - HOVER_AREA_PX || ev.clientY < window.innerHeight - HOVER_AREA_PX) {
99
- close.style.transform = 'scale(0)';
100
- window.removeEventListener('mousemove', onMouseMove);
101
- }
102
- };
103
- window.addEventListener('mousemove', onMouseMove);
104
- });
105
- }
106
- function showServiceNowChatButton() {
107
- getServiceNowButton()?.classList?.add('show');
108
- localStorage.setItem(LOCAL_STORAGE_SERVICE_NOW_VALUE, 'true');
109
- chatVisibilityListeners.forEach(l => l(true));
110
- }
111
- function hideServiceNowChatButton(onClose) {
112
- hideOrShowServiceNowContent('hidden');
113
- addOrRemoveServiceNowLauncher('remove');
114
- getServiceNowButton()?.classList?.remove('show');
115
- localStorage.setItem(LOCAL_STORAGE_SERVICE_NOW_VALUE, 'false');
116
- onClose?.();
117
- chatVisibilityListeners.forEach(l => l(false));
118
- }
119
- function isServiceNowChatButtonVisible() {
120
- return localStorage.getItem(LOCAL_STORAGE_SERVICE_NOW_VALUE) !== 'false';
121
- }
122
- async function initializeChat({ onClose } = {}) {
123
- try {
124
- await loadScript(serviceNowReference);
125
- if (isServiceNowChatButtonVisible())
126
- showServiceNowChatButton();
127
- else
128
- hideServiceNowChatButton();
129
- renderCloseButton(onClose);
130
- }
131
- catch {
132
- const t = translate(dictionary, getLanguage());
133
- // eslint-disable-next-line no-console
134
- console.warn(t.errorLoadScript);
135
- }
136
- }
137
- export function useServiceNowChatButtonVisibility() {
138
- const [visible, setVisible] = useState(isServiceNowChatButtonVisible());
139
- useEffectOnce(() => addChatVisibilityListener(setVisible));
140
- return visible;
141
- }
142
- export function useServiceNowEffect(options) {
143
- useEffectOnce(() => {
144
- initializeChat(options);
145
- });
146
- }
147
- export const dictionary = {
148
- en: {
149
- errorLoadScript: 'An error occurred while loading the script:',
150
- hide: 'Hide chat button',
151
- hiddenTitle: 'The chat button is now hidden',
152
- hiddenMessage: 'To see it again, please select the option "Chat with us" in the menu just under this message.',
153
- },
154
- pt: {
155
- errorLoadScript: 'Ocorreu um erro ao carregar o script:',
156
- hide: 'Esconder o botão de chat',
157
- hiddenTitle: 'O botão de chat foi escondido',
158
- hiddenMessage: 'Para vê-lo novamente, por favor escolha a opção "Converse conosco" no menu logo em baixo desta mensagem.',
159
- },
160
- };
161
- //# sourceMappingURL=service-now.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"service-now.js","sourceRoot":"","sources":["../../../../src/hooks/service-now.tsx"],"names":[],"mappings":"AACA,OAAO,EAAc,WAAW,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AACjF,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;CAmBxB,CAAA;AAED,MAAM,WAAW,GAAG;;;;;;;;;CASnB,CAAA;AAQD,MAAM,aAAa,GAAG,GAAG,CAAA;AACzB,MAAM,+BAA+B,GAAG,6BAA6B,CAAA;AACrE,MAAM,uBAAuB,GAA6B,EAAE,CAAA;AAE5D,MAAM,mBAAmB,GAAG,qJAAqJ,CAAA;AAEjL,SAAS,UAAU,CAAC,GAAW;IAC7B,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC3C,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAA;QAC/C,MAAM,iBAAiB,GAAG,QAAQ,CAAC,cAAc,CAAC,qBAAqB,CAAC,CAAA;QACxE,MAAM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OAAO,CAAC,+BAA+B,CAAC,KAAK,OAAO,CAAA;AAC1E,CAAC;AAED,KAAK,UAAU,cAAc,CAAC,EAAE,OAAO,KAAc,EAAE;IACrD,IAAI;QACF,MAAM,UAAU,CAAC,mBAAmB,CAAC,CAAA;QACrC,IAAI,6BAA6B,EAAE;YAAE,wBAAwB,EAAE,CAAA;;YAC1D,wBAAwB,EAAE,CAAA;QAC/B,iBAAiB,CAAC,OAAO,CAAC,CAAA;KAC3B;IAAC,MAAM;QACN,MAAM,CAAC,GAAG,SAAS,CAAC,UAAU,EAAE,WAAW,EAAE,CAAC,CAAA;QAC9C,sCAAsC;QACtC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,CAAA;KAChC;AACH,CAAC;AAED,MAAM,UAAU,iCAAiC;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,CAAC,OAAiB;IACnD,aAAa,CAAC,GAAG,EAAE;QACjB,cAAc,CAAC,OAAO,CAAC,CAAA;IACzB,CAAC,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,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"}
@@ -1,3 +0,0 @@
1
- export declare function titleEffect(title: string | undefined | null): () => void;
2
- export declare function useTitleEffect(title: string | undefined | null): void;
3
- //# sourceMappingURL=title.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"title.d.ts","sourceRoot":"","sources":["../../../../src/hooks/title.tsx"],"names":[],"mappings":"AAIA,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,cAM3D;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,QAE9D"}
@@ -1,13 +0,0 @@
1
- import { useEffect } from 'react';
2
- let originalTitle;
3
- export function titleEffect(title) {
4
- originalTitle ??= document.title;
5
- document.title = title ? `${title} - ${originalTitle}` : originalTitle;
6
- return () => {
7
- document.title = originalTitle ?? '';
8
- };
9
- }
10
- export function useTitleEffect(title) {
11
- useEffect(() => titleEffect(title), [title]);
12
- }
13
- //# sourceMappingURL=title.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"title.js","sourceRoot":"","sources":["../../../../src/hooks/title.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjC,IAAI,aAAiC,CAAA;AAErC,MAAM,UAAU,WAAW,CAAC,KAAgC;IAC1D,aAAa,KAAK,QAAQ,CAAC,KAAK,CAAA;IAChC,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,MAAM,aAAa,EAAE,CAAC,CAAC,CAAC,aAAa,CAAA;IACtE,OAAO,GAAG,EAAE;QACV,QAAQ,CAAC,KAAK,GAAG,aAAa,IAAI,EAAE,CAAA;IACtC,CAAC,CAAA;AACH,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,KAAgC;IAC7D,SAAS,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAA;AAC9C,CAAC"}
@@ -1,12 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,40 +0,0 @@
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
@@ -1 +0,0 @@
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;QACxB,QAAQ,CAAC,OAAO,GAAG,IAAI,CAAA;KACxB;IAED,SAAS,CAAC,GAAG,EAAE;QACb,4CAA4C;QAC5C,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE;YACzB,SAAS,CAAC,OAAO,GAAG,QAAQ,CAAC,OAAO,EAAE,CAAA;YACtC,YAAY,CAAC,OAAO,GAAG,IAAI,CAAA;SAC5B;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"}
@@ -1,9 +0,0 @@
1
- export { BannerWarning } from './components/BannerWarning.js';
2
- export { BreadcrumbList } from './components/Breadcrumb/index.js';
3
- export { ChatBot } from './components/ChatBot.js';
4
- export { Login } from './components/Login.js';
5
- export * from './components/tour/index.js';
6
- export { openServiceNowChat, dictionary as serviceNowDictionary, useServiceNowChatButtonVisibility, useServiceNowEffect, } from './hooks/service-now.js';
7
- export { titleEffect, useTitleEffect } from './hooks/title.js';
8
- export { useEffectOnce } from './hooks/use-effect-once.js';
9
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
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,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC1C,cAAc,mBAAmB,CAAA;AACjC,OAAO,EACL,kBAAkB,EAAE,UAAU,IAAI,oBAAoB,EAAE,iCAAiC,EAAE,mBAAmB,GAC/G,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA"}
@@ -1,9 +0,0 @@
1
- export { BannerWarning } from './components/BannerWarning.js';
2
- export { BreadcrumbList } from './components/Breadcrumb/index.js';
3
- export { ChatBot } from './components/ChatBot.js';
4
- export { Login } from './components/Login.js';
5
- export * from './components/tour/index.js';
6
- export { openServiceNowChat, dictionary as serviceNowDictionary, useServiceNowChatButtonVisibility, useServiceNowEffect, } from './hooks/service-now.js';
7
- export { titleEffect, useTitleEffect } from './hooks/title.js';
8
- export { useEffectOnce } from './hooks/use-effect-once.js';
9
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC1C,cAAc,mBAAmB,CAAA;AACjC,OAAO,EACL,kBAAkB,EAAE,UAAU,IAAI,oBAAoB,EAAE,iCAAiC,EAAE,mBAAmB,GAC/G,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA"}
@@ -1,2 +0,0 @@
1
- export declare const usePortalSwitcherStep: () => any;
2
- //# sourceMappingURL=PortalSwitcherStep.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PortalSwitcherStep.d.ts","sourceRoot":"","sources":["../../../../../../layout/src/components/tour/PortalSwitcherStep.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,qBAAqB,WAgBjC,CAAA"}
@@ -1,30 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- //@ts-nocheck
3
- import { Box, Image, Text } from '@citric/core';
4
- import { tourStepBuilder } from '@stack-spot/portal-components';
5
- import { useTranslate } from '@stack-spot/portal-translate';
6
- export const usePortalSwitcherStep = () => {
7
- const t = useTranslate(translations);
8
- return tourStepBuilder({
9
- selector: '.portal-switcher',
10
- title: t.title,
11
- content: _jsxs(_Fragment, { children: [_jsx(Image, { src: "https://marketing.stackspot.com/switch-v2.gif", alt: t.imageAlt }), _jsx(Box, { px: 5, py: 3, children: _jsx(Text, { appearance: "microtext1", colorScheme: "inverse.contrastText", children: t.description }) })] }),
12
- position: 'right',
13
- style: {
14
- width: '300px',
15
- },
16
- });
17
- };
18
- const translations = {
19
- en: {
20
- title: 'Expand Your Horizons with Stackspot',
21
- description: 'Easily switch between EDP and AI to enhance your projects. Access a wide range of resources with just one click and take your projects to a new level of efficiency. Start your journey now!',
22
- imageAlt: 'GIF describing how to use product switcher and navigate between AI and EDP portals',
23
- },
24
- pt: {
25
- title: 'Expanda Seus Horizontes com Stackspot',
26
- description: 'Troque facilmente entre EDP e AI para aprimorar seus projetos. Acesse uma ampla gama de recursos com apenas um clique e leve seus projetos para um novo nível de eficiência. Comece sua jornada agora!',
27
- imageAlt: 'GIF mostrando como usar o alternador de produtos e navegar entre os portais AI e EDP',
28
- },
29
- };
30
- //# sourceMappingURL=PortalSwitcherStep.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PortalSwitcherStep.js","sourceRoot":"","sources":["../../../../../../layout/src/components/tour/PortalSwitcherStep.tsx"],"names":[],"mappings":";AAAA,aAAa;AACb,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAC3D,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,EAAE;IACxC,MAAM,CAAC,GAAG,YAAY,CAAC,YAAY,CAAC,CAAA;IACpC,OAAO,eAAe,CAAC;QACrB,QAAQ,EAAE,kBAAkB;QAC5B,KAAK,EAAE,CAAC,CAAC,KAAK;QACd,OAAO,EAAE,8BACP,KAAC,KAAK,IAAC,GAAG,EAAC,+CAA+C,EAAC,GAAG,EAAE,CAAC,CAAC,QAAQ,GAAI,EAC9E,KAAC,GAAG,IAAC,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,YACf,KAAC,IAAI,IAAC,UAAU,EAAC,YAAY,EAAC,WAAW,EAAC,sBAAsB,YAAE,CAAC,CAAC,WAAW,GAAQ,GACnF,IACL;QACH,QAAQ,EAAE,OAAO;QACjB,KAAK,EAAE;YACL,KAAK,EAAE,OAAO;SACf;KACF,CAAC,CAAA;AACJ,CAAC,CAAA;AAKD,MAAM,YAAY,GAAG;IACnB,EAAE,EAAE;QACF,KAAK,EAAE,qCAAqC;QAC5C,WAAW,EAAE,8LAA8L;QAC3M,QAAQ,EAAE,oFAAoF;KAC/F;IACD,EAAE,EAAE;QACF,KAAK,EAAE,uCAAuC;QAC9C,WAAW,EAAE,wMAAwM;QACrN,QAAQ,EAAE,sFAAsF;KACjG;CACF,CAAA"}