@stack-spot/portal-layout 2.13.2 → 2.13.4
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/CHANGELOG.md +14 -0
- package/dist/components/Contact/show-contact-modal.d.ts +0 -10
- package/dist/components/Contact/show-contact-modal.d.ts.map +1 -1
- package/dist/components/Contact/show-contact-modal.js +0 -15
- package/dist/components/Contact/show-contact-modal.js.map +1 -1
- package/dist/components/Rate/FeedbackModal.d.ts +1 -1
- package/dist/components/Rate/FeedbackModal.d.ts.map +1 -1
- package/dist/components/Rate/FeedbackModal.js +12 -6
- package/dist/components/Rate/FeedbackModal.js.map +1 -1
- package/dist/components/Rate/hook.d.ts.map +1 -1
- package/dist/components/Rate/hook.js +29 -11
- package/dist/components/Rate/hook.js.map +1 -1
- package/dist/components/Rate/index.d.ts.map +1 -1
- package/dist/components/Rate/index.js.map +1 -1
- package/dist/components/Rate/on-nps-submit.d.ts.map +1 -1
- package/dist/components/Rate/on-nps-submit.js +2 -1
- package/dist/components/Rate/on-nps-submit.js.map +1 -1
- package/dist/components/Rate/{show-modals.d.ts → show-rate-us-modals.d.ts} +1 -1
- package/dist/components/Rate/show-rate-us-modals.d.ts.map +1 -0
- package/dist/components/Rate/{show-modals.js → show-rate-us-modals.js} +1 -1
- package/dist/components/Rate/show-rate-us-modals.js.map +1 -0
- package/dist/components/Rate/utils.d.ts +2 -0
- package/dist/components/Rate/utils.d.ts.map +1 -0
- package/dist/components/Rate/utils.js +9 -0
- package/dist/components/Rate/utils.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Contact/show-contact-modal.tsx +0 -23
- package/src/components/Rate/FeedbackModal.tsx +15 -5
- package/src/components/Rate/hook.tsx +30 -10
- package/src/components/Rate/index.tsx +11 -9
- package/src/components/Rate/on-nps-submit.ts +3 -0
- package/src/components/Rate/utils.ts +8 -0
- package/src/index.ts +2 -2
- package/dist/components/Rate/show-modals.d.ts.map +0 -1
- package/dist/components/Rate/show-modals.js.map +0 -1
- /package/src/components/Rate/{show-modals.tsx → show-rate-us-modals.tsx} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.13.4](https://github.com/stack-spot/portal-commons/compare/portal-layout@v2.13.3...portal-layout@v2.13.4) (2024-10-21)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* update validation day feedback modal ([b0c65a4](https://github.com/stack-spot/portal-commons/commit/b0c65a4ebedcd4e2a1d33ee6b578bd4e13c1c73c))
|
|
9
|
+
|
|
10
|
+
## [2.13.3](https://github.com/stack-spot/portal-commons/compare/portal-layout@v2.13.2...portal-layout@v2.13.3) (2024-10-21)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* update validations in feedback modal ([acd5ac1](https://github.com/stack-spot/portal-commons/commit/acd5ac17926d58586e29e3b116d70bcb35d155da))
|
|
16
|
+
|
|
3
17
|
## [2.13.2](https://github.com/stack-spot/portal-commons/compare/portal-layout@v2.13.1...portal-layout@v2.13.2) (2024-10-17)
|
|
4
18
|
|
|
5
19
|
|
|
@@ -1,15 +1,5 @@
|
|
|
1
|
-
interface Props {
|
|
2
|
-
sub: string;
|
|
3
|
-
tenant: string;
|
|
4
|
-
portal: 'EDP' | 'AI';
|
|
5
|
-
formIdentifier: string;
|
|
6
|
-
}
|
|
7
|
-
export declare const showRateUsModal: ({ title, ...props }: Props & {
|
|
8
|
-
title: string;
|
|
9
|
-
}) => void;
|
|
10
1
|
export declare const showContactUsModal: ({ title, serviceNowUrl }: {
|
|
11
2
|
serviceNowUrl: string;
|
|
12
3
|
title: string;
|
|
13
4
|
}) => void;
|
|
14
|
-
export {};
|
|
15
5
|
//# sourceMappingURL=show-contact-modal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"show-contact-modal.d.ts","sourceRoot":"","sources":["../../../src/components/Contact/show-contact-modal.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"show-contact-modal.d.ts","sourceRoot":"","sources":["../../../src/components/Contact/show-contact-modal.tsx"],"names":[],"mappings":"AAgDA,eAAO,MAAM,kBAAkB,6BAA6B;IAAE,aAAa,EAAC,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,SAMlG,CAAA"}
|
|
@@ -5,7 +5,6 @@ import { Card } from '@citric/ui';
|
|
|
5
5
|
import { useAnchorTag } from '@stack-spot/portal-components/anchor';
|
|
6
6
|
import { useTranslate } from '@stack-spot/portal-translate';
|
|
7
7
|
import { overlay } from '../../LayoutOverlayManager.js';
|
|
8
|
-
import { RateComponent } from '../Rate/index.js';
|
|
9
8
|
const CardItem = ({ title, description, hasMargin = false, buttonText, url, icon, onClick }) => {
|
|
10
9
|
const Link = useAnchorTag();
|
|
11
10
|
return _jsx(Card, { sx: { p: '7', bg: 'light.500', w: '100%' }, children: _jsxs(Flex, { flexDirection: "column", children: [_jsx(Text, { appearance: "h5", mb: "3", children: title }), _jsx(Text, { appearance: "microtext1", colorScheme: "light.700", mb: "8", children: description }), _jsx(Box, { mt: hasMargin ? 5 : 0, children: _jsx(Link, { onClick: onClick, href: url, target: "_blank", children: _jsxs(Button, { size: "md", colorScheme: "inverse", children: [buttonText, _jsx(IconBox, { sx: { ml: 2 }, colorIcon: "inverse.contrastText", children: icon })] }) }) })] }) });
|
|
@@ -14,14 +13,6 @@ const ContactUsComponent = ({ serviceNowUrl }) => {
|
|
|
14
13
|
const t = useTranslate(dictionary);
|
|
15
14
|
return _jsx(Flex, { sx: { gap: '8px' }, w: 12, mb: 10, flexWrap: "nowrap", children: _jsx(CardItem, { title: t.support, description: t.supportDescription, buttonText: t.supportButton, url: serviceNowUrl, icon: _jsx(ExternalLink, {}) }) });
|
|
16
15
|
};
|
|
17
|
-
export const showRateUsModal = ({ title, ...props }) => {
|
|
18
|
-
const { formIdentifier, sub, tenant, portal } = props;
|
|
19
|
-
overlay.showModal({
|
|
20
|
-
title: title,
|
|
21
|
-
children: _jsx(RateComponent, { tfLive: formIdentifier, userId: sub, orgId: tenant, portal: portal }),
|
|
22
|
-
size: 'large',
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
16
|
export const showContactUsModal = ({ title, serviceNowUrl }) => {
|
|
26
17
|
overlay.showModal({
|
|
27
18
|
title,
|
|
@@ -32,18 +23,12 @@ export const showContactUsModal = ({ title, serviceNowUrl }) => {
|
|
|
32
23
|
const dictionary = {
|
|
33
24
|
en: {
|
|
34
25
|
contactUs: 'Contact us',
|
|
35
|
-
rateUs: 'Rate us',
|
|
36
|
-
rateUsDescription: 'Share your StackSpot platform evaluation with us',
|
|
37
|
-
rateUsButton: 'Rate us now',
|
|
38
26
|
support: 'Support and feedback',
|
|
39
27
|
supportDescription: 'Need help or have a feedback? Connect with our Support team',
|
|
40
28
|
supportButton: 'Get in touch',
|
|
41
29
|
},
|
|
42
30
|
pt: {
|
|
43
31
|
contactUs: 'Fale conosco',
|
|
44
|
-
rateUs: 'Avalie-nos',
|
|
45
|
-
rateUsDescription: 'Compartilhe sua avaliação da StackSpot conosco',
|
|
46
|
-
rateUsButton: 'Avalie agora',
|
|
47
32
|
support: 'Suporte e feedback',
|
|
48
33
|
supportDescription: 'Precisa de ajuda ou tem algum feedback? Fale com o nosso time de Suporte',
|
|
49
34
|
supportButton: 'Entre em contato',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"show-contact-modal.js","sourceRoot":"","sources":["../../../src/components/Contact/show-contact-modal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC/D,OAAO,EAAE,YAAY,EA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AAsB;QAC/B,kBAAkB,EAAE,6DAA6D;QACjF,aAAa,EAAE,cAAc;KAC9B;IACD,EAAE,EAAE;QACF,SAAS,EAAE,cAAc;QACzB,OAAO,EAAE,oBAAoB;QAC7B,kBAAkB,EAAE,0EAA0E;QAC9F,aAAa,EAAE,kBAAkB;KAClC;CACmB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeedbackModal.d.ts","sourceRoot":"","sources":["../../../src/components/Rate/FeedbackModal.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FeedbackModal.d.ts","sourceRoot":"","sources":["../../../src/components/Rate/FeedbackModal.tsx"],"names":[],"mappings":"AAsBA,eAAO,MAAM,aAAa,wBAAyB;IAAE,OAAO,EAAE,MAAM,IAAI,CAAC;IAAC,MAAM,EAAE,KAAK,GAAG,IAAI,CAAA;CAAE,4CAyC/F,CAAA"}
|
|
@@ -4,7 +4,8 @@ import { ArrowRight, TimesMini } from '@citric/icons';
|
|
|
4
4
|
import { IconButton } from '@citric/ui';
|
|
5
5
|
import { theme } from '@stack-spot/portal-theme';
|
|
6
6
|
import { useTranslate } from '@stack-spot/portal-translate';
|
|
7
|
-
import {
|
|
7
|
+
import { useEffect } from 'react';
|
|
8
|
+
import { checkVisibility } from './utils.js';
|
|
8
9
|
const style = {
|
|
9
10
|
box: {
|
|
10
11
|
width: '438px',
|
|
@@ -19,15 +20,20 @@ const style = {
|
|
|
19
20
|
},
|
|
20
21
|
};
|
|
21
22
|
export const FeedbackModal = ({ onClick, portal }) => {
|
|
22
|
-
const [isVisible, setIsVisible] = useState(true);
|
|
23
23
|
const t = useTranslate(dictionary);
|
|
24
24
|
const handleClose = () => {
|
|
25
|
-
setIsVisible(false);
|
|
26
25
|
localStorage.setItem('RATED_US_IN', Date.now().toString());
|
|
26
|
+
checkVisibility({ key: 'RATED_US_IN' });
|
|
27
27
|
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
checkVisibility({ key: 'RATED_US_IN' });
|
|
30
|
+
const visibilityCheck = (event) => checkVisibility(event);
|
|
31
|
+
window.addEventListener('storage', visibilityCheck);
|
|
32
|
+
return () => {
|
|
33
|
+
window.removeEventListener('storage', visibilityCheck);
|
|
34
|
+
};
|
|
35
|
+
}, []);
|
|
36
|
+
return (_jsxs(Box, { sx: style.box, id: "feedback-modal", children: [_jsxs(Flex, { justifyContent: "space-between", flexWrap: "nowrap", children: [_jsxs(Text, { appearance: "h5", mb: 6, children: [t.title, portal, "?"] }), _jsx(IconButton, { onClick: handleClose, children: _jsx(TimesMini, {}) })] }), _jsx(Text, { sx: { lineHeight: '24px' }, children: t.description }), _jsx(Flex, { flexDirection: "row-reverse", mt: 7, mb: 4, children: _jsxs(Button, { onClick: onClick, size: "md", children: [t.buttonText, _jsx(IconBox, { colorIcon: "inverse.contrastText", ml: 2, children: _jsx(ArrowRight, {}) })] }) })] }));
|
|
31
37
|
};
|
|
32
38
|
const dictionary = {
|
|
33
39
|
en: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeedbackModal.js","sourceRoot":"","sources":["../../../src/components/Rate/FeedbackModal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAU,IAAI,EAAE,MAAM,cAAc,CAAA;AACvE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAChD,OAAO,EAAc,YAAY,EAAE,MAAM,8BAA8B,CAAA;AACvE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"FeedbackModal.js","sourceRoot":"","sources":["../../../src/components/Rate/FeedbackModal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,E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d.ts","sourceRoot":"","sources":["../../../src/components/Rate/hook.tsx"],"names":[],"mappings":"AAYA,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,WAaxD;
|
|
1
|
+
{"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../../src/components/Rate/hook.tsx"],"names":[],"mappings":"AAYA,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,WAaxD;AASD,eAAO,MAAM,kBAAkB,QAAO,OAoCrC,CAAA;AAED,wBAAgB,eAAe,SAS9B"}
|
|
@@ -19,22 +19,40 @@ export function isLessThan30Days(date1, date2) {
|
|
|
19
19
|
// Check if the difference is fewer than 30 days
|
|
20
20
|
return differenceInDays < 30;
|
|
21
21
|
}
|
|
22
|
+
// Function to check if a day is business day
|
|
23
|
+
const isBusinessDay = (date) => {
|
|
24
|
+
const dayOfWeek = date.getDay();
|
|
25
|
+
return dayOfWeek !== 0 && dayOfWeek !== 6; // 0 = sunday, 6 = saturday
|
|
26
|
+
};
|
|
27
|
+
// Function that returns a boolean to show modal feedback
|
|
22
28
|
export const shouldShowNpsModal = () => {
|
|
23
29
|
const today = new Date();
|
|
24
30
|
const currentDay = today.getDate();
|
|
25
|
-
|
|
26
|
-
if (!isFirstThreeDays) {
|
|
27
|
-
return false;
|
|
28
|
-
}
|
|
31
|
+
// Check if the month has already been evaluated
|
|
29
32
|
const ratedInfo = localStorage.getItem('RATED_US_IN');
|
|
30
|
-
if (
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
if (ratedInfo) {
|
|
34
|
+
const savedDate = new Date(parseInt(ratedInfo, 10));
|
|
35
|
+
const isSameMonth = savedDate.getMonth() === today.getMonth() && savedDate.getFullYear() === today.getFullYear();
|
|
36
|
+
// If it has already been evaluated this month, do not show the modal
|
|
37
|
+
if (isSameMonth)
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
// Variables to control working days shown and extension day
|
|
41
|
+
let businessDaysShown = 0;
|
|
42
|
+
let day = 25;
|
|
43
|
+
// Iterate from the 25th until you can show 3 business days
|
|
44
|
+
while (businessDaysShown < 3) {
|
|
45
|
+
const checkDate = new Date(today.getFullYear(), today.getMonth(), day);
|
|
46
|
+
if (isBusinessDay(checkDate)) {
|
|
47
|
+
businessDaysShown++;
|
|
48
|
+
}
|
|
49
|
+
// If we are on the current day and have not yet completed the working days, show the modal
|
|
50
|
+
if (currentDay === day) {
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
day++;
|
|
36
54
|
}
|
|
37
|
-
return
|
|
55
|
+
return false;
|
|
38
56
|
};
|
|
39
57
|
export function useRatingEffect() {
|
|
40
58
|
const handleInit = async () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hook.js","sourceRoot":"","sources":["../../../src/components/Rate/hook.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAE7D,MAAM,UAAU,GAAG,GAAG,EAAE,CAAC,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;IAC7D,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAA;IAC/C,MAAM,CAAC,YAAY,CAAC,KAAK,EAAE,oCAAoC,CAAC,CAAA;IAChE,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;IACpC,MAAM,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC,OAAO,EAAE,CAAA;IAC/B,MAAM,CAAC,OAAO,GAAG,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IACzC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA;AACnC,CAAC,CAAC,CAAA;AAEF,gFAAgF;AAChF,MAAM,UAAU,gBAAgB,CAAC,KAAW,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,OAAO,iBAAiB,GAAG,CAAC,EAAE,CAAC;QAC7B,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,EAAE,KAAK,CAAC,QAAQ,EAAE,EAAE,GAAG,CAAC,CAAA;QAEtE,IAAI,aAAa,CAAC,SAAS,CAAC,EAAE,CAAC;YAC7B,iBAAiB,EAAE,CAAA;QACrB,CAAC;QAED,2FAA2F;QAC3F,IAAI,UAAU,KAAK,GAAG,EAAE,CAAC;YACvB,OAAO,IAAI,CAAA;QACb,CAAC;QAED,GAAG,EAAE,CAAA;IACP,CAAC;IAED,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAED,MAAM,UAAU,eAAe;IAE7B,MAAM,UAAU,GAAG,KAAK,IAAI,EAAE;QAC5B,MAAM,UAAU,EAAE,CAAA;IACpB,CAAC,CAAA;IAED,aAAa,CAAC,GAAG,EAAE;QACjB,UAAU,EAAE,CAAA;IACd,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Rate/index.tsx"],"names":[],"mappings":"AAGA,OAAO,iBAAiB,CAAA;AAExB,UAAU,KAAK;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,IAAI,GAAG,KAAK,CAAC;CACtB;AAED,eAAO,MAAM,aAAa,sCAAuC,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Rate/index.tsx"],"names":[],"mappings":"AAGA,OAAO,iBAAiB,CAAA;AAExB,UAAU,KAAK;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,IAAI,GAAG,KAAK,CAAC;CACtB;AAED,eAAO,MAAM,aAAa,sCAAuC,KAAK,4CAsBrE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Rate/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,iBAAiB,CAAA;AASxB,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAS,EAAE,EAAE;IACxE,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAA;IAEhD,SAAS,CAAC,GAAG,EAAE;QACZ,MAAc,CAAC,EAAE,EAAE,IAAI,EAAE,CAAA;QAC1B,UAAU,CAAC,GAAG,EAAE;YACd,YAAY,CAAC,KAAK,CAAC,CAAA;QACrB,CAAC,EAAE,IAAI,CAAC,CAAA;IACV,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Rate/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,iBAAiB,CAAA;AASxB,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAS,EAAE,EAAE;IACxE,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAA;IAEhD,SAAS,CAAC,GAAG,EAAE;QACZ,MAAc,CAAC,EAAE,EAAE,IAAI,EAAE,CAAA;QAC1B,UAAU,CAAC,GAAG,EAAE;YACd,YAAY,CAAC,KAAK,CAAC,CAAA;QACrB,CAAC,EAAE,IAAI,CAAC,CAAA;IACV,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,OAAO,CACL,MAAC,GAAG,IAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,aAC/C,SAAS,IAAI,KAAC,IAAI,IAAC,UAAU,EAAC,QAAQ,EAAC,cAAc,EAAC,QAAQ,EAAC,CAAC,EAAC,IAAI,EAAC,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,YAC3F,KAAC,eAAe,KAAG,GACd,EACP,KAAC,GAAG,IAAC,EAAE,EAAE,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,YACvC,8BAAmB,MAAM,oBACP,WAAW,MAAM,WAAW,KAAK,gBAAgB,MAAM,EAAE,kBAC5D,MAAM,wBAAoB,KAAK,uBAAmB,aAAa,GAAG,GAC7E,IACF,CACP,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"on-nps-submit.d.ts","sourceRoot":"","sources":["../../../src/components/Rate/on-nps-submit.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"on-nps-submit.d.ts","sourceRoot":"","sources":["../../../src/components/Rate/on-nps-submit.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,CAAA;AAGT,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,WAAW,EAAE,MAAM,IAAI,CAAC;KACzB;CACF"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { checkVisibility } from './utils.js';
|
|
1
2
|
function onNpsSubmit() {
|
|
2
3
|
localStorage.setItem('RATED_US_IN', Date.now().toString());
|
|
4
|
+
checkVisibility({ key: 'RATED_US_IN' });
|
|
3
5
|
}
|
|
4
6
|
window.onNpsSubmit = onNpsSubmit;
|
|
5
|
-
export {};
|
|
6
7
|
//# sourceMappingURL=on-nps-submit.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"on-nps-submit.js","sourceRoot":"","sources":["../../../src/components/Rate/on-nps-submit.ts"],"names":[],"mappings":"AAAA,SAAS,WAAW;IAClB,YAAY,CAAC,OAAO,CAAC,aAAa,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"on-nps-submit.js","sourceRoot":"","sources":["../../../src/components/Rate/on-nps-submit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAEzC,SAAS,WAAW;IAClB,YAAY,CAAC,OAAO,CAAC,aAAa,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAA;IAC1D,eAAe,CAAC,EAAE,GAAG,EAAE,aAAa,EAAkB,CAAC,CAAA;AACzD,CAAC;AAWD,MAAM,CAAC,WAAW,GAAG,WAAW,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"show-rate-us-modals.d.ts","sourceRoot":"","sources":["../../../src/components/Rate/show-rate-us-modals.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,iBAAiB,wBAAyB;IAAE,OAAO,EAAE,MAAM,IAAI,CAAC;IAAC,MAAM,EAAE,KAAK,GAAG,IAAI,CAAA;CAAG,4CAEpG,CAAA;AAED,UAAU,KAAK;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,KAAK,GAAG,IAAI,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,eAAe,wBAAyB,KAAK,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,SAO7E,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"show-rate-us-modals.js","sourceRoot":"","sources":["../../../src/components/Rate/show-rate-us-modals.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,GAAG,CAAA;AAEjC,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAAE,OAAO,EAAE,MAAM,EAAkD,EAAE,EAAE,CAAC,CACxG,KAAC,aAAa,IAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAI,CACpD,CAAA;AASD,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,EAA6B,EAAE,EAAE;IAChF,MAAM,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAA;IACrD,OAAO,CAAC,SAAS,CAAC;QAChB,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,KAAC,aAAa,IAAC,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAI;QAC/F,IAAI,EAAE,OAAO;KACd,CAAC,CAAA;AACJ,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/Rate/utils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,UAAW,YAAY,SAOlD,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/components/Rate/utils.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAmB,EAAE,EAAE;IACrD,IAAI,KAAK,CAAC,GAAG,KAAK,aAAa,EAAE,CAAC;QAChC,MAAM,SAAS,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC,aAAa,CAAC,CAAA;QACtD,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,QAAQ,CAAC,cAAc,CAAC,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAA;QACrD,CAAC;IACH,CAAC;AACH,CAAC,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { Backdrop } from './components/Backdrop.js';
|
|
2
|
-
export { showContactUsModal
|
|
3
|
-
export { showFeedbackModal } from './components/Rate/show-modals.js';
|
|
2
|
+
export { showContactUsModal } from './components/Contact/show-contact-modal.js';
|
|
3
|
+
export { showFeedbackModal, showRateUsModal } from './components/Rate/show-rate-us-modals.js';
|
|
4
4
|
export { Dialog } from './components/Dialog.js';
|
|
5
5
|
export { Header, HeaderProps } from './components/Header.js';
|
|
6
6
|
export { ActionItem, MenuContent, MenuGroup, Title } from './components/menu/MenuContent.js';
|
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,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,EAAE,kBAAkB,EAAG,MAAM,yCAAyC,CAAA;AAC7E,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAA;AAC1F,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAA;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAA;AAC7D,cAAc,yBAAyB,CAAA;AACvC,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAC5E,cAAc,mBAAmB,CAAA;AACjC,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAChD,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { Backdrop } from './components/Backdrop.js';
|
|
2
|
-
export { showContactUsModal
|
|
3
|
-
export { showFeedbackModal } from './components/Rate/show-modals.js';
|
|
2
|
+
export { showContactUsModal } from './components/Contact/show-contact-modal.js';
|
|
3
|
+
export { showFeedbackModal, showRateUsModal } from './components/Rate/show-rate-us-modals.js';
|
|
4
4
|
export { Dialog } from './components/Dialog.js';
|
|
5
5
|
export { Header } from './components/Header.js';
|
|
6
6
|
export { ActionItem, MenuContent, MenuGroup, Title } from './components/menu/MenuContent.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,EAAE,kBAAkB,EAAG,MAAM,yCAAyC,CAAA;AAC7E,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAA;AAC1F,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,EAAE,MAAM,EAAe,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAA;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAA;AAC7D,cAAc,yBAAyB,CAAA;AACvC,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAC5E,cAAc,mBAAmB,CAAA;AACjC,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAChD,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA"}
|
package/package.json
CHANGED
|
@@ -5,7 +5,6 @@ import { useAnchorTag } from '@stack-spot/portal-components/anchor'
|
|
|
5
5
|
import { Dictionary, useTranslate } from '@stack-spot/portal-translate'
|
|
6
6
|
import { ReactElement } from 'react'
|
|
7
7
|
import { overlay } from '../../LayoutOverlayManager'
|
|
8
|
-
import { RateComponent } from '../Rate'
|
|
9
8
|
|
|
10
9
|
interface CardItemProps {
|
|
11
10
|
title: string,
|
|
@@ -37,13 +36,6 @@ const CardItem = ({ title, description, hasMargin = false, buttonText, url, icon
|
|
|
37
36
|
</Card>
|
|
38
37
|
}
|
|
39
38
|
|
|
40
|
-
interface Props {
|
|
41
|
-
sub: string,
|
|
42
|
-
tenant: string,
|
|
43
|
-
portal: 'EDP' | 'AI',
|
|
44
|
-
formIdentifier: string,
|
|
45
|
-
}
|
|
46
|
-
|
|
47
39
|
const ContactUsComponent = ({ serviceNowUrl }: {serviceNowUrl:string}) => {
|
|
48
40
|
const t = useTranslate(dictionary)
|
|
49
41
|
|
|
@@ -54,15 +46,6 @@ const ContactUsComponent = ({ serviceNowUrl }: {serviceNowUrl:string}) => {
|
|
|
54
46
|
}
|
|
55
47
|
|
|
56
48
|
|
|
57
|
-
export const showRateUsModal = ({ title, ...props }: Props & { title: string }) => {
|
|
58
|
-
const { formIdentifier, sub, tenant, portal } = props
|
|
59
|
-
overlay.showModal({
|
|
60
|
-
title: title,
|
|
61
|
-
children: <RateComponent tfLive={formIdentifier} userId={sub} orgId={tenant} portal={portal} />,
|
|
62
|
-
size: 'large',
|
|
63
|
-
})
|
|
64
|
-
}
|
|
65
|
-
|
|
66
49
|
export const showContactUsModal = ({ title, serviceNowUrl }:{ serviceNowUrl:string, title: string }) => {
|
|
67
50
|
overlay.showModal({
|
|
68
51
|
title,
|
|
@@ -74,18 +57,12 @@ export const showContactUsModal = ({ title, serviceNowUrl }:{ serviceNowUrl:stri
|
|
|
74
57
|
const dictionary = {
|
|
75
58
|
en: {
|
|
76
59
|
contactUs: 'Contact us',
|
|
77
|
-
rateUs: 'Rate us',
|
|
78
|
-
rateUsDescription: 'Share your StackSpot platform evaluation with us',
|
|
79
|
-
rateUsButton: 'Rate us now',
|
|
80
60
|
support: 'Support and feedback',
|
|
81
61
|
supportDescription: 'Need help or have a feedback? Connect with our Support team',
|
|
82
62
|
supportButton: 'Get in touch',
|
|
83
63
|
},
|
|
84
64
|
pt: {
|
|
85
65
|
contactUs: 'Fale conosco',
|
|
86
|
-
rateUs: 'Avalie-nos',
|
|
87
|
-
rateUsDescription: 'Compartilhe sua avaliação da StackSpot conosco',
|
|
88
|
-
rateUsButton: 'Avalie agora',
|
|
89
66
|
support: 'Suporte e feedback',
|
|
90
67
|
supportDescription: 'Precisa de ajuda ou tem algum feedback? Fale com o nosso time de Suporte',
|
|
91
68
|
supportButton: 'Entre em contato',
|
|
@@ -3,7 +3,8 @@ import { ArrowRight, TimesMini } from '@citric/icons'
|
|
|
3
3
|
import { IconButton } from '@citric/ui'
|
|
4
4
|
import { theme } from '@stack-spot/portal-theme'
|
|
5
5
|
import { Dictionary, useTranslate } from '@stack-spot/portal-translate'
|
|
6
|
-
import {
|
|
6
|
+
import { useEffect } from 'react'
|
|
7
|
+
import { checkVisibility } from './utils'
|
|
7
8
|
|
|
8
9
|
const style: Styles = {
|
|
9
10
|
box: {
|
|
@@ -20,18 +21,27 @@ const style: Styles = {
|
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
export const FeedbackModal = ({ onClick, portal }: { onClick: () => void, portal: 'EDP' | 'AI' }) => {
|
|
23
|
-
const [isVisible, setIsVisible] = useState(true)
|
|
24
24
|
const t = useTranslate(dictionary)
|
|
25
25
|
|
|
26
26
|
const handleClose = () => {
|
|
27
|
-
setIsVisible(false)
|
|
28
27
|
localStorage.setItem('RATED_US_IN', Date.now().toString())
|
|
28
|
+
checkVisibility({ key: 'RATED_US_IN' } as StorageEvent)
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
checkVisibility({ key: 'RATED_US_IN' } as StorageEvent)
|
|
33
|
+
|
|
34
|
+
const visibilityCheck = (event: StorageEvent) => checkVisibility(event)
|
|
35
|
+
|
|
36
|
+
window.addEventListener('storage', visibilityCheck)
|
|
37
|
+
|
|
38
|
+
return () => {
|
|
39
|
+
window.removeEventListener('storage', visibilityCheck)
|
|
40
|
+
}
|
|
41
|
+
}, [])
|
|
32
42
|
|
|
33
43
|
return (
|
|
34
|
-
<Box sx={style.box}>
|
|
44
|
+
<Box sx={style.box} id="feedback-modal">
|
|
35
45
|
<Flex justifyContent="space-between" flexWrap="nowrap">
|
|
36
46
|
<Text appearance="h5" mb={6}>{t.title}{portal}?</Text>
|
|
37
47
|
<IconButton onClick={handleClose}>
|
|
@@ -25,29 +25,49 @@ export function isLessThan30Days(date1: Date, date2: Date) {
|
|
|
25
25
|
return differenceInDays < 30
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
// Function to check if a day is business day
|
|
29
|
+
const isBusinessDay = (date: Date): boolean => {
|
|
30
|
+
const dayOfWeek = date.getDay()
|
|
31
|
+
return dayOfWeek !== 0 && dayOfWeek !== 6 // 0 = sunday, 6 = saturday
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Function that returns a boolean to show modal feedback
|
|
28
35
|
export const shouldShowNpsModal = (): boolean => {
|
|
29
36
|
const today = new Date()
|
|
30
37
|
const currentDay = today.getDate()
|
|
31
38
|
|
|
32
|
-
|
|
39
|
+
// Check if the month has already been evaluated
|
|
40
|
+
const ratedInfo = localStorage.getItem('RATED_US_IN')
|
|
33
41
|
|
|
34
|
-
if (
|
|
35
|
-
|
|
42
|
+
if (ratedInfo) {
|
|
43
|
+
const savedDate = new Date(parseInt(ratedInfo, 10))
|
|
44
|
+
const isSameMonth = savedDate.getMonth() === today.getMonth() && savedDate.getFullYear() === today.getFullYear()
|
|
45
|
+
|
|
46
|
+
// If it has already been evaluated this month, do not show the modal
|
|
47
|
+
if (isSameMonth) return false
|
|
36
48
|
}
|
|
37
49
|
|
|
38
|
-
|
|
50
|
+
// Variables to control working days shown and extension day
|
|
51
|
+
let businessDaysShown = 0
|
|
52
|
+
let day = 25
|
|
39
53
|
|
|
40
|
-
|
|
54
|
+
// Iterate from the 25th until you can show 3 business days
|
|
55
|
+
while (businessDaysShown < 3) {
|
|
56
|
+
const checkDate = new Date(today.getFullYear(), today.getMonth(), day)
|
|
41
57
|
|
|
42
|
-
|
|
58
|
+
if (isBusinessDay(checkDate)) {
|
|
59
|
+
businessDaysShown++
|
|
60
|
+
}
|
|
43
61
|
|
|
44
|
-
|
|
62
|
+
// If we are on the current day and have not yet completed the working days, show the modal
|
|
63
|
+
if (currentDay === day) {
|
|
64
|
+
return true
|
|
65
|
+
}
|
|
45
66
|
|
|
46
|
-
|
|
47
|
-
return false
|
|
67
|
+
day++
|
|
48
68
|
}
|
|
49
69
|
|
|
50
|
-
return
|
|
70
|
+
return false
|
|
51
71
|
}
|
|
52
72
|
|
|
53
73
|
export function useRatingEffect() {
|
|
@@ -20,15 +20,17 @@ export const RateComponent = ({ tfLive, userId, orgId, portal }: Props) => {
|
|
|
20
20
|
}, 2000)
|
|
21
21
|
}, [])
|
|
22
22
|
|
|
23
|
-
return (
|
|
24
|
-
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
<
|
|
29
|
-
data-tf-
|
|
30
|
-
|
|
23
|
+
return (
|
|
24
|
+
<Box sx={{ minWidth: '650px', minHeight: '500px' }}>
|
|
25
|
+
{isLoading && <Flex alignItems="center" justifyContent="center" w="12" sx={{ height: '100%' }}>
|
|
26
|
+
<LoadingCircular />
|
|
27
|
+
</Flex>}
|
|
28
|
+
<Box sx={{ opacity: isLoading ? '0' : 1 }}>
|
|
29
|
+
<div data-tf-live={tfLive}
|
|
30
|
+
data-tf-hidden={`user_id=${userId},org_id=${orgId},portal_name=${portal}`}
|
|
31
|
+
data-tf-open="time" data-tf-open-value="100" data-tf-on-submit="onNpsSubmit" />
|
|
32
|
+
</Box>
|
|
31
33
|
</Box>
|
|
32
|
-
|
|
34
|
+
)
|
|
33
35
|
}
|
|
34
36
|
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { Backdrop } from './components/Backdrop'
|
|
2
|
-
export { showContactUsModal
|
|
3
|
-
export { showFeedbackModal } from './components/Rate/show-modals'
|
|
2
|
+
export { showContactUsModal } from './components/Contact/show-contact-modal'
|
|
3
|
+
export { showFeedbackModal, showRateUsModal } from './components/Rate/show-rate-us-modals'
|
|
4
4
|
export { Dialog } from './components/Dialog'
|
|
5
5
|
export { Header, HeaderProps } from './components/Header'
|
|
6
6
|
export { ActionItem, MenuContent, MenuGroup, Title } from './components/menu/MenuContent'
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"show-modals.d.ts","sourceRoot":"","sources":["../../../src/components/Rate/show-modals.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,iBAAiB,wBAAyB;IAAE,OAAO,EAAE,MAAM,IAAI,CAAC;IAAC,MAAM,EAAE,KAAK,GAAG,IAAI,CAAA;CAAG,4CAEpG,CAAA;AAED,UAAU,KAAK;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,KAAK,GAAG,IAAI,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,eAAe,wBAAyB,KAAK,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,SAO7E,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"show-modals.js","sourceRoot":"","sources":["../../../src/components/Rate/show-modals.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,GAAG,CAAA;AAEjC,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAAE,OAAO,EAAE,MAAM,EAAkD,EAAE,EAAE,CAAC,CACxG,KAAC,aAAa,IAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAI,CACpD,CAAA;AASD,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,EAA6B,EAAE,EAAE;IAChF,MAAM,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAA;IACrD,OAAO,CAAC,SAAS,CAAC;QAChB,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,KAAC,aAAa,IAAC,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAI;QAC/F,IAAI,EAAE,OAAO;KACd,CAAC,CAAA;AACJ,CAAC,CAAA"}
|
|
File without changes
|