@stack-spot/portal-layout 2.11.0 → 2.13.0
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/NotificationCenter/index.d.ts.map +1 -1
- package/dist/components/NotificationCenter/index.js +0 -2
- package/dist/components/NotificationCenter/index.js.map +1 -1
- package/dist/components/PortalSwitcher.d.ts +0 -6
- package/dist/components/PortalSwitcher.d.ts.map +1 -1
- package/dist/components/PortalSwitcher.js +2 -35
- package/dist/components/PortalSwitcher.js.map +1 -1
- package/dist/components/Rate/FeedbackModal.d.ts +5 -0
- package/dist/components/Rate/FeedbackModal.d.ts.map +1 -0
- package/dist/components/Rate/FeedbackModal.js +42 -0
- package/dist/components/Rate/FeedbackModal.js.map +1 -0
- package/dist/components/Rate/hook.d.ts +1 -0
- package/dist/components/Rate/hook.d.ts.map +1 -1
- package/dist/components/Rate/hook.js +5 -0
- package/dist/components/Rate/hook.js.map +1 -1
- package/dist/components/Rate/show-modals.d.ts +15 -0
- package/dist/components/Rate/show-modals.d.ts.map +1 -0
- package/dist/components/Rate/show-modals.js +14 -0
- package/dist/components/Rate/show-modals.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/NotificationCenter/index.tsx +0 -2
- package/src/components/PortalSwitcher.tsx +1 -42
- package/src/components/Rate/FeedbackModal.tsx +66 -0
- package/src/components/Rate/hook.tsx +6 -0
- package/src/components/Rate/show-modals.tsx +23 -0
- package/src/index.ts +1 -1
- package/dist/components/NotificationCenter/tour.d.ts +0 -2
- package/dist/components/NotificationCenter/tour.d.ts.map +0 -1
- package/dist/components/NotificationCenter/tour.js +0 -15
- package/dist/components/NotificationCenter/tour.js.map +0 -1
- package/dist/components/Rate/show-rating-modal.d.ts +0 -2
- package/dist/components/Rate/show-rating-modal.d.ts.map +0 -1
- package/dist/components/Rate/show-rating-modal.js +0 -11
- package/dist/components/Rate/show-rating-modal.js.map +0 -1
- package/src/components/NotificationCenter/tour.tsx +0 -19
- package/src/components/Rate/show-rating-modal.tsx +0 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.13.0](https://github.com/stack-spot/portal-commons/compare/portal-layout@v2.12.0...portal-layout@v2.13.0) (2024-10-15)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add feedback modal ([65405cb](https://github.com/stack-spot/portal-commons/commit/65405cb85670e633ac20ba184d08e1fd919f35c0))
|
|
9
|
+
|
|
10
|
+
## [2.12.0](https://github.com/stack-spot/portal-commons/compare/portal-layout@v2.11.0...portal-layout@v2.12.0) (2024-10-11)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* Remove tour from portal ([#408](https://github.com/stack-spot/portal-commons/issues/408)) ([13fe9a4](https://github.com/stack-spot/portal-commons/commit/13fe9a4be17a41b97fefcc80da9adc4567727306))
|
|
16
|
+
|
|
3
17
|
## [2.11.0](https://github.com/stack-spot/portal-commons/compare/portal-layout@v2.10.0...portal-layout@v2.11.0) (2024-10-11)
|
|
4
18
|
|
|
5
19
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/NotificationCenter/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/NotificationCenter/index.tsx"],"names":[],"mappings":"AAcA,eAAO,MAAM,kBAAkB,+CA2C9B,CAAA"}
|
|
@@ -9,7 +9,6 @@ import { useEffect, useState } from 'react';
|
|
|
9
9
|
import { useNotificationsDictionary } from './dictionary.js';
|
|
10
10
|
import { NotificationPanel } from './NotificationPanel.js';
|
|
11
11
|
import { NotificationBox } from './styled.js';
|
|
12
|
-
import { useNotificationsTourStep } from './tour.js';
|
|
13
12
|
import { getFiltersFromName, getNameFromFilters } from './utils.js';
|
|
14
13
|
const MAX_ITEMS = 10;
|
|
15
14
|
export const NotificationCenter = () => {
|
|
@@ -18,7 +17,6 @@ export const NotificationCenter = () => {
|
|
|
18
17
|
const { applyFilters, filters, items, status, error } = useNotificationList({ size: MAX_ITEMS });
|
|
19
18
|
const hasUnreadNotification = useUnreadNotifications();
|
|
20
19
|
const controller = useNotificationController();
|
|
21
|
-
useNotificationsTourStep();
|
|
22
20
|
useEffectOnce(() => {
|
|
23
21
|
controller.checkUnread();
|
|
24
22
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/NotificationCenter/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAC7D,OAAO,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAA;AACpI,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAA;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAC1C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/NotificationCenter/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE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BAAkB,CAAC,KAAK,CAAC,CAAC,CAAA;QACzC,CAAC;IACH,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAA;IAEV,OAAO,CACL,MAAC,eAAe,eACd,KAAC,UAAU,kBACG,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,iBAAiB,EAC/E,OAAO,EAAE,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,EAC/D,SAAS,EAAE,WAAW,CAAC;oBACrB,qBAAqB;oBACrB,MAAM,KAAK,SAAS,IAAI,SAAS;oBACjC,MAAM,KAAK,SAAS,IAAI,qBAAqB,IAAI,QAAQ;iBAC1D,CAAC,YAEF,KAAC,OAAO,IAAC,IAAI,EAAC,IAAI,EAAC,SAAS,EAAC,mBAAmB,YAC9C,KAAC,IAAI,KAAG,GACA,GACC,EACb,KAAC,iBAAiB,IAChB,MAAM,EAAE,kBAAkB,CAAC,OAAO,CAAC,EACnC,OAAO,EAAE,MAAM,KAAK,SAAS,EAC7B,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,EAC7B,QAAQ,EAAE,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC,EAAE,GAAG,kBAAkB,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,GACpF,IACc,CACnB,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -21,10 +21,4 @@ export interface PortalSwitcherProps {
|
|
|
21
21
|
* @param props the component Props {@link PortalSwitcherProps}.
|
|
22
22
|
*/
|
|
23
23
|
export declare const PortalSwitcher: ({ portals }: PortalSwitcherProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
-
/**
|
|
25
|
-
* Tutorial: a React hook for retrieving the React Tour step that explains how the portal switcher works. The portal switcher is a component
|
|
26
|
-
* at the top left corner of the layout (header) that allows the user to switch between the different Stackspot portals.
|
|
27
|
-
* @returns the React Tour step for the PortalSwitcher.
|
|
28
|
-
*/
|
|
29
|
-
export declare const usePortalSwitcherTourStep: () => void;
|
|
30
24
|
//# sourceMappingURL=PortalSwitcher.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PortalSwitcher.d.ts","sourceRoot":"","sources":["../../src/components/PortalSwitcher.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PortalSwitcher.d.ts","sourceRoot":"","sources":["../../src/components/PortalSwitcher.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AASxC,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,OAAO,EAAE,aAAa,CAAC;IACvB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AA0DD;;;;GAIG;AACH,eAAO,MAAM,cAAc,gBAAsB,mBAAmB,4CAwCnE,CAAA"}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button, Flex, IconBox } from '@citric/core';
|
|
3
3
|
import { ArrowRight, CheckCircleFill, Select } from '@citric/icons';
|
|
4
4
|
import { SelectionList } from '@stack-spot/portal-components/SelectionList';
|
|
5
5
|
import { AI, CS, EDP, HUB, Logo } from '@stack-spot/portal-components/svg';
|
|
6
6
|
import { theme } from '@stack-spot/portal-theme';
|
|
7
|
-
import { useTranslate } from '@stack-spot/portal-translate';
|
|
8
7
|
import { useState } from 'react';
|
|
9
8
|
import styled from 'styled-components';
|
|
10
|
-
import { useTour } from './tour/index.js';
|
|
11
9
|
const Logos = {
|
|
12
10
|
'AI': _jsx(AI, {}),
|
|
13
11
|
'EDP': _jsx(EDP, {}),
|
|
@@ -77,7 +75,6 @@ const PORTAL_SWITCHER_ID = 'PortalSwitcher';
|
|
|
77
75
|
export const PortalSwitcher = ({ portals = [] }) => {
|
|
78
76
|
const [visible, setVisible] = useState(false);
|
|
79
77
|
const currentPortal = portals?.find(portal => location.href.startsWith(portal.url));
|
|
80
|
-
usePortalSwitcherTourStep();
|
|
81
78
|
return _jsxs(PortalSwitcherBox, { children: [currentPortal ?
|
|
82
79
|
_jsx(Button, { className: "current-portal", appearance: "text", colorScheme: "light", "aria-controls": PORTAL_SWITCHER_ID, "aria-expanded": visible, onClick: () => {
|
|
83
80
|
setVisible(!visible);
|
|
@@ -94,34 +91,4 @@ export const PortalSwitcher = ({ portals = [] }) => {
|
|
|
94
91
|
iconRight: portal.acronym !== currentPortal?.acronym ? _jsx(ArrowRight, {}) : undefined,
|
|
95
92
|
})), visible: visible, maxHeight: "21rem", onHide: () => setVisible(false) })] });
|
|
96
93
|
};
|
|
97
|
-
/**
|
|
98
|
-
* Tutorial: a React hook for retrieving the React Tour step that explains how the portal switcher works. The portal switcher is a component
|
|
99
|
-
* at the top left corner of the layout (header) that allows the user to switch between the different Stackspot portals.
|
|
100
|
-
* @returns the React Tour step for the PortalSwitcher.
|
|
101
|
-
*/
|
|
102
|
-
export const usePortalSwitcherTourStep = () => {
|
|
103
|
-
const t = useTranslate(tourTranslations);
|
|
104
|
-
const { addStep } = useTour();
|
|
105
|
-
addStep({
|
|
106
|
-
selector: '.portal-switcher',
|
|
107
|
-
title: t.title,
|
|
108
|
-
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 }) })] }),
|
|
109
|
-
position: 'right',
|
|
110
|
-
style: {
|
|
111
|
-
width: '300px',
|
|
112
|
-
},
|
|
113
|
-
});
|
|
114
|
-
};
|
|
115
|
-
const tourTranslations = {
|
|
116
|
-
en: {
|
|
117
|
-
title: 'Expand Your Horizons with Stackspot',
|
|
118
|
-
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!',
|
|
119
|
-
imageAlt: 'GIF describing how to use product switcher and navigate between AI and EDP portals',
|
|
120
|
-
},
|
|
121
|
-
pt: {
|
|
122
|
-
title: 'Expanda Seus Horizontes com Stackspot',
|
|
123
|
-
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!',
|
|
124
|
-
imageAlt: 'GIF mostrando como usar o alternador de produtos e navegar entre os portais AI e EDP',
|
|
125
|
-
},
|
|
126
|
-
};
|
|
127
94
|
//# sourceMappingURL=PortalSwitcher.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PortalSwitcher.js","sourceRoot":"","sources":["../../src/components/PortalSwitcher.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"PortalSwitcher.js","sourceRoot":"","sources":["../../src/components/PortalSwitcher.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAA;AAC3E,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,mCAAmC,CAAA;AAC1E,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAChD,OAAO,EAAa,QAAQ,EAAE,MAAM,O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AAG,IAAI,CAAA;CAAE,mDA+B/F,CAAA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Button, Flex, IconBox, Text } from '@citric/core';
|
|
3
|
+
import { ArrowRight, TimesMini } from '@citric/icons';
|
|
4
|
+
import { IconButton } from '@citric/ui';
|
|
5
|
+
import { theme } from '@stack-spot/portal-theme';
|
|
6
|
+
import { useTranslate } from '@stack-spot/portal-translate';
|
|
7
|
+
import { useState } from 'react';
|
|
8
|
+
const style = {
|
|
9
|
+
box: {
|
|
10
|
+
width: '438px',
|
|
11
|
+
bg: 'light.500',
|
|
12
|
+
position: 'absolute',
|
|
13
|
+
bottom: 0,
|
|
14
|
+
right: 0,
|
|
15
|
+
p: 5,
|
|
16
|
+
borderRadius: '16px 16px 0 0',
|
|
17
|
+
boxShadow: `4px 4px 48px 0px ${theme.color.light[300]}`,
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
export const FeedbackModal = ({ onClick, portal }) => {
|
|
21
|
+
const [isVisible, setIsVisible] = useState(true);
|
|
22
|
+
const t = useTranslate(dictionary);
|
|
23
|
+
const handleClose = () => {
|
|
24
|
+
setIsVisible(false);
|
|
25
|
+
};
|
|
26
|
+
if (!isVisible)
|
|
27
|
+
return null;
|
|
28
|
+
return (_jsxs(Box, { sx: style.box, 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, {}) })] }) })] }));
|
|
29
|
+
};
|
|
30
|
+
const dictionary = {
|
|
31
|
+
en: {
|
|
32
|
+
title: 'How’s your experience with StackSpot ',
|
|
33
|
+
description: 'Your feedback helps us make the platform more useful and intuitive for you. It only takes a few minutes.',
|
|
34
|
+
buttonText: 'Share your feedback',
|
|
35
|
+
},
|
|
36
|
+
pt: {
|
|
37
|
+
title: 'Como está sua experiência com StackSpot ',
|
|
38
|
+
description: 'Seu feedback nos ajuda a tornar a plataforma mais útil e intuitiva para você. Leva apenas alguns minutos.',
|
|
39
|
+
buttonText: 'Compartilhe seu feedback',
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=FeedbackModal.js.map
|
|
@@ -0,0 +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,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEhC,MAAM,KAAK,GAAW;IACpB,GAAG,EAAE;QACH,KAAK,EAAE,OAAO;QACd,EAAE,EAAE,WAAW;QACf,QAAQ,EAAE,UAAU;QACpB,MAAM,EAAE,CAAC;QACT,KAAK,EAAE,CAAC;QACR,CAAC,EAAE,CAAC;QACJ,YAAY,EAAE,eAAe;QAC7B,SAAS,EAAE,oBAAoB,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;KACxD;CACF,CAAA;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAAE,OAAO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G;QACxH,UAAU,EAAE,0BAA0B;KACvC;CACmB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
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;AAED,wBAAgB,eAAe,SAS9B"}
|
|
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;AAED,wBAAgB,uBAAuB,YAItC;AAED,wBAAgB,eAAe,SAS9B"}
|
|
@@ -19,6 +19,11 @@ export function isLessThan30Days(date1, date2) {
|
|
|
19
19
|
// Check if the difference is fewer than 30 days
|
|
20
20
|
return differenceInDays < 30;
|
|
21
21
|
}
|
|
22
|
+
export function isFirstThreeDaysOfMonth() {
|
|
23
|
+
const today = new Date();
|
|
24
|
+
const day = today.getDate();
|
|
25
|
+
return day >= 1 && day <= 3;
|
|
26
|
+
}
|
|
22
27
|
export function useRatingEffect() {
|
|
23
28
|
const handleInit = async () => {
|
|
24
29
|
await loadScript();
|
|
@@ -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,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ACJ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const showFeedbackModal: ({ onClick, portal }: {
|
|
2
|
+
onClick: () => void;
|
|
3
|
+
portal: 'EDP' | 'AI';
|
|
4
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
interface Props {
|
|
6
|
+
sub: string;
|
|
7
|
+
tenant: string;
|
|
8
|
+
portal: 'EDP' | 'AI';
|
|
9
|
+
formIdentifier: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const showRateUsModal: ({ title, ...props }: Props & {
|
|
12
|
+
title: string;
|
|
13
|
+
}) => void;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=show-modals.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { overlay } from '../../LayoutOverlayManager.js';
|
|
3
|
+
import { FeedbackModal } from './FeedbackModal.js';
|
|
4
|
+
import { RateComponent } from './index.js';
|
|
5
|
+
export const showFeedbackModal = ({ onClick, portal }) => (_jsx(FeedbackModal, { onClick: onClick, portal: portal }));
|
|
6
|
+
export const showRateUsModal = ({ title, ...props }) => {
|
|
7
|
+
const { formIdentifier, sub, tenant, portal } = props;
|
|
8
|
+
overlay.showModal({
|
|
9
|
+
title: title,
|
|
10
|
+
children: _jsx(RateComponent, { tfLive: formIdentifier, userId: sub, orgId: tenant, portal: portal }),
|
|
11
|
+
size: 'large',
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=show-modals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { Backdrop } from './components/Backdrop.js';
|
|
2
2
|
export { showContactUsModal, showRateUsModal } from './components/Contact/show-contact-modal.js';
|
|
3
|
+
export { showFeedbackModal } from './components/Rate/show-modals.js';
|
|
3
4
|
export { Dialog } from './components/Dialog.js';
|
|
4
5
|
export { Header, HeaderProps } from './components/Header.js';
|
|
5
6
|
export { ActionItem, MenuContent, MenuGroup, Title } from './components/menu/MenuContent.js';
|
|
@@ -9,7 +10,6 @@ export { CLOSE_OVERLAY_ID, OverlayContent } from './components/OverlayContent.js
|
|
|
9
10
|
export { PortalSwitcher } from './components/PortalSwitcher.js';
|
|
10
11
|
export { RateComponent } from './components/Rate/index.js';
|
|
11
12
|
export { useRatingEffect } from './components/Rate/hook.js';
|
|
12
|
-
export { showRatingModal } from './components/Rate/show-rating-modal.js';
|
|
13
13
|
export * from './components/tour/index.js';
|
|
14
14
|
export * from './elements.js';
|
|
15
15
|
export * from './errors.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,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAA;AAC7F,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,MAAM,wBAAwB,CAAA;AACxD,
|
|
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,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAA;AAC7F,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AACjE,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,MAAM,wBAAwB,CAAA;AACxD,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,5 +1,6 @@
|
|
|
1
1
|
export { Backdrop } from './components/Backdrop.js';
|
|
2
2
|
export { showContactUsModal, showRateUsModal } from './components/Contact/show-contact-modal.js';
|
|
3
|
+
export { showFeedbackModal } from './components/Rate/show-modals.js';
|
|
3
4
|
export { Dialog } from './components/Dialog.js';
|
|
4
5
|
export { Header } from './components/Header.js';
|
|
5
6
|
export { ActionItem, MenuContent, MenuGroup, Title } from './components/menu/MenuContent.js';
|
|
@@ -9,7 +10,6 @@ export { CLOSE_OVERLAY_ID, OverlayContent } from './components/OverlayContent.js
|
|
|
9
10
|
export { PortalSwitcher } from './components/PortalSwitcher.js';
|
|
10
11
|
export { RateComponent } from './components/Rate/index.js';
|
|
11
12
|
export { useRatingEffect } from './components/Rate/hook.js';
|
|
12
|
-
export { showRatingModal } from './components/Rate/show-rating-modal.js';
|
|
13
13
|
export * from './components/tour/index.js';
|
|
14
14
|
export * from './elements.js';
|
|
15
15
|
export * from './errors.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,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAA;AAC7F,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,MAAM,wBAAwB,CAAA;AACxD,
|
|
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,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAA;AAC7F,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AACjE,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,MAAM,wBAAwB,CAAA;AACxD,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
|
@@ -8,7 +8,6 @@ import { useEffect, useState } from 'react'
|
|
|
8
8
|
import { useNotificationsDictionary } from './dictionary'
|
|
9
9
|
import { NotificationPanel } from './NotificationPanel'
|
|
10
10
|
import { NotificationBox } from './styled'
|
|
11
|
-
import { useNotificationsTourStep } from './tour'
|
|
12
11
|
import { getFiltersFromName, getNameFromFilters } from './utils'
|
|
13
12
|
|
|
14
13
|
const MAX_ITEMS = 10
|
|
@@ -19,7 +18,6 @@ export const NotificationCenter = () => {
|
|
|
19
18
|
const { applyFilters, filters, items, status, error } = useNotificationList({ size: MAX_ITEMS })
|
|
20
19
|
const hasUnreadNotification = useUnreadNotifications()
|
|
21
20
|
const controller = useNotificationController()
|
|
22
|
-
useNotificationsTourStep()
|
|
23
21
|
|
|
24
22
|
useEffectOnce(() => {
|
|
25
23
|
controller.checkUnread()
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Button, Flex, IconBox } from '@citric/core'
|
|
2
2
|
import { ArrowRight, CheckCircleFill, Select } from '@citric/icons'
|
|
3
3
|
import { SelectionList } from '@stack-spot/portal-components/SelectionList'
|
|
4
4
|
import { AI, CS, EDP, HUB, Logo } from '@stack-spot/portal-components/svg'
|
|
5
5
|
import { theme } from '@stack-spot/portal-theme'
|
|
6
|
-
import { useTranslate } from '@stack-spot/portal-translate'
|
|
7
6
|
import { ReactNode, useState } from 'react'
|
|
8
7
|
import styled from 'styled-components'
|
|
9
8
|
import { PortalAcronym } from '../types'
|
|
10
|
-
import { useTour } from './tour'
|
|
11
9
|
|
|
12
10
|
const Logos: Record<PortalAcronym, ReactNode> = {
|
|
13
11
|
'AI': <AI />,
|
|
@@ -98,7 +96,6 @@ const PORTAL_SWITCHER_ID = 'PortalSwitcher'
|
|
|
98
96
|
export const PortalSwitcher = ({ portals = [] }: PortalSwitcherProps) => {
|
|
99
97
|
const [visible, setVisible] = useState<boolean>(false)
|
|
100
98
|
const currentPortal = portals?.find(portal => location.href.startsWith(portal.url))
|
|
101
|
-
usePortalSwitcherTourStep()
|
|
102
99
|
|
|
103
100
|
return <PortalSwitcherBox>
|
|
104
101
|
{currentPortal ?
|
|
@@ -137,41 +134,3 @@ export const PortalSwitcher = ({ portals = [] }: PortalSwitcherProps) => {
|
|
|
137
134
|
onHide={() => setVisible(false)} />
|
|
138
135
|
</PortalSwitcherBox >
|
|
139
136
|
}
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* Tutorial: a React hook for retrieving the React Tour step that explains how the portal switcher works. The portal switcher is a component
|
|
143
|
-
* at the top left corner of the layout (header) that allows the user to switch between the different Stackspot portals.
|
|
144
|
-
* @returns the React Tour step for the PortalSwitcher.
|
|
145
|
-
*/
|
|
146
|
-
export const usePortalSwitcherTourStep = () => {
|
|
147
|
-
const t = useTranslate(tourTranslations)
|
|
148
|
-
const { addStep } = useTour()
|
|
149
|
-
|
|
150
|
-
addStep({
|
|
151
|
-
selector: '.portal-switcher',
|
|
152
|
-
title: t.title,
|
|
153
|
-
content: <>
|
|
154
|
-
<Image src="https://marketing.stackspot.com/switch-v2.gif" alt={t.imageAlt} />
|
|
155
|
-
<Box px={5} py={3}>
|
|
156
|
-
<Text appearance="microtext1" colorScheme="inverse.contrastText">{t.description}</Text>
|
|
157
|
-
</Box>
|
|
158
|
-
</>,
|
|
159
|
-
position: 'right',
|
|
160
|
-
style: {
|
|
161
|
-
width: '300px',
|
|
162
|
-
},
|
|
163
|
-
})
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
const tourTranslations = {
|
|
167
|
-
en: {
|
|
168
|
-
title: 'Expand Your Horizons with Stackspot',
|
|
169
|
-
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!',
|
|
170
|
-
imageAlt: 'GIF describing how to use product switcher and navigate between AI and EDP portals',
|
|
171
|
-
},
|
|
172
|
-
pt: {
|
|
173
|
-
title: 'Expanda Seus Horizontes com Stackspot',
|
|
174
|
-
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!',
|
|
175
|
-
imageAlt: 'GIF mostrando como usar o alternador de produtos e navegar entre os portais AI e EDP',
|
|
176
|
-
},
|
|
177
|
-
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Box, Button, Flex, IconBox, Styles, Text } from '@citric/core'
|
|
2
|
+
import { ArrowRight, TimesMini } from '@citric/icons'
|
|
3
|
+
import { IconButton } from '@citric/ui'
|
|
4
|
+
import { theme } from '@stack-spot/portal-theme'
|
|
5
|
+
import { Dictionary, useTranslate } from '@stack-spot/portal-translate'
|
|
6
|
+
import { useState } from 'react'
|
|
7
|
+
|
|
8
|
+
const style: Styles = {
|
|
9
|
+
box: {
|
|
10
|
+
width: '438px',
|
|
11
|
+
bg: 'light.500',
|
|
12
|
+
position: 'absolute',
|
|
13
|
+
bottom: 0,
|
|
14
|
+
right: 0,
|
|
15
|
+
p: 5,
|
|
16
|
+
borderRadius: '16px 16px 0 0',
|
|
17
|
+
boxShadow: `4px 4px 48px 0px ${theme.color.light[300]}`,
|
|
18
|
+
},
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const FeedbackModal = ({ onClick, portal }: { onClick: () => void, portal: 'EDP' | 'AI' }) => {
|
|
22
|
+
const [isVisible, setIsVisible] = useState(true)
|
|
23
|
+
const t = useTranslate(dictionary)
|
|
24
|
+
|
|
25
|
+
const handleClose = () => {
|
|
26
|
+
setIsVisible(false)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (!isVisible) return null
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<Box sx={style.box}>
|
|
33
|
+
<Flex justifyContent="space-between" flexWrap="nowrap">
|
|
34
|
+
<Text appearance="h5" mb={6}>{t.title}{portal}?</Text>
|
|
35
|
+
<IconButton onClick={handleClose}>
|
|
36
|
+
<TimesMini />
|
|
37
|
+
</IconButton>
|
|
38
|
+
</Flex>
|
|
39
|
+
<Text sx={{ lineHeight: '24px' }}>
|
|
40
|
+
{t.description}
|
|
41
|
+
</Text>
|
|
42
|
+
<Flex flexDirection="row-reverse" mt={7} mb={4}>
|
|
43
|
+
<Button onClick={onClick} size="md">
|
|
44
|
+
{t.buttonText}
|
|
45
|
+
<IconBox colorIcon="inverse.contrastText" ml={2}>
|
|
46
|
+
<ArrowRight />
|
|
47
|
+
</IconBox>
|
|
48
|
+
</Button>
|
|
49
|
+
</Flex>
|
|
50
|
+
</Box>
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const dictionary = {
|
|
55
|
+
en: {
|
|
56
|
+
title: 'How’s your experience with StackSpot ',
|
|
57
|
+
description: 'Your feedback helps us make the platform more useful and intuitive for you. It only takes a few minutes.',
|
|
58
|
+
buttonText: 'Share your feedback',
|
|
59
|
+
},
|
|
60
|
+
pt: {
|
|
61
|
+
title: 'Como está sua experiência com StackSpot ',
|
|
62
|
+
description: 'Seu feedback nos ajuda a tornar a plataforma mais útil e intuitiva para você. Leva apenas alguns minutos.',
|
|
63
|
+
buttonText: 'Compartilhe seu feedback',
|
|
64
|
+
},
|
|
65
|
+
} satisfies Dictionary
|
|
66
|
+
|
|
@@ -25,6 +25,12 @@ export function isLessThan30Days(date1: Date, date2: Date) {
|
|
|
25
25
|
return differenceInDays < 30
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
export function isFirstThreeDaysOfMonth() {
|
|
29
|
+
const today = new Date()
|
|
30
|
+
const day = today.getDate()
|
|
31
|
+
return day >= 1 && day <= 3
|
|
32
|
+
}
|
|
33
|
+
|
|
28
34
|
export function useRatingEffect() {
|
|
29
35
|
|
|
30
36
|
const handleInit = async () => {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { overlay } from '../../LayoutOverlayManager'
|
|
2
|
+
import { FeedbackModal } from './FeedbackModal'
|
|
3
|
+
import { RateComponent } from '.'
|
|
4
|
+
|
|
5
|
+
export const showFeedbackModal = ({ onClick, portal }: { onClick: () => void, portal: 'EDP' | 'AI' }) => (
|
|
6
|
+
<FeedbackModal onClick={onClick} portal={portal} />
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
interface Props {
|
|
10
|
+
sub: string,
|
|
11
|
+
tenant: string,
|
|
12
|
+
portal: 'EDP' | 'AI',
|
|
13
|
+
formIdentifier: string,
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const showRateUsModal = ({ title, ...props }: Props & { title: string }) => {
|
|
17
|
+
const { formIdentifier, sub, tenant, portal } = props
|
|
18
|
+
overlay.showModal({
|
|
19
|
+
title: title,
|
|
20
|
+
children: <RateComponent tfLive={formIdentifier} userId={sub} orgId={tenant} portal={portal} />,
|
|
21
|
+
size: 'large',
|
|
22
|
+
})
|
|
23
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { Backdrop } from './components/Backdrop'
|
|
2
2
|
export { showContactUsModal, showRateUsModal } from './components/Contact/show-contact-modal'
|
|
3
|
+
export { showFeedbackModal } from './components/Rate/show-modals'
|
|
3
4
|
export { Dialog } from './components/Dialog'
|
|
4
5
|
export { Header, HeaderProps } from './components/Header'
|
|
5
6
|
export { ActionItem, MenuContent, MenuGroup, Title } from './components/menu/MenuContent'
|
|
@@ -9,7 +10,6 @@ export { CLOSE_OVERLAY_ID, OverlayContent } from './components/OverlayContent'
|
|
|
9
10
|
export { PortalSwitcher } from './components/PortalSwitcher'
|
|
10
11
|
export { RateComponent } from './components/Rate'
|
|
11
12
|
export { useRatingEffect } from './components/Rate/hook'
|
|
12
|
-
export { showRatingModal } from './components/Rate/show-rating-modal'
|
|
13
13
|
export * from './components/tour'
|
|
14
14
|
export * from './elements'
|
|
15
15
|
export * from './errors'
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tour.d.ts","sourceRoot":"","sources":["../../../src/components/NotificationCenter/tour.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,wBAAwB,YAcpC,CAAA"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Text } from '@citric/core';
|
|
3
|
-
import { useTour } from '../tour/index.js';
|
|
4
|
-
import { useNotificationsDictionary } from './dictionary.js';
|
|
5
|
-
export const useNotificationsTourStep = () => {
|
|
6
|
-
const t = useNotificationsDictionary();
|
|
7
|
-
const { addStep } = useTour();
|
|
8
|
-
addStep({
|
|
9
|
-
content: _jsx(Box, { px: 5, py: 3, children: _jsx(Text, { appearance: "microtext1", colorScheme: "inverse.contrastText", children: t.tour }) }),
|
|
10
|
-
selector: '.notificationsTour',
|
|
11
|
-
title: t.notifications,
|
|
12
|
-
position: 'bottom',
|
|
13
|
-
});
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=tour.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tour.js","sourceRoot":"","sources":["../../../src/components/NotificationCenter/tour.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAA;AAEzD,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,EAAE;IAC3C,MAAM,CAAC,GAAG,0BAA0B,EAAE,CAAA;IACtC,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,CAAA;IAE7B,OAAO,CAAC;QACN,OAAO,EAAE,KAAC,GAAG,IAAC,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,YACxB,KAAC,IAAI,IAAC,UAAU,EAAC,YAAY,EAAC,WAAW,EAAC,sBAAsB,YAC7D,CAAC,CAAC,IAAI,GACF,GACH;QACN,QAAQ,EAAE,oBAAoB;QAC9B,KAAK,EAAE,CAAC,CAAC,aAAa;QACtB,QAAQ,EAAE,QAAQ;KACZ,CAAC,CAAA;AACX,CAAC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"show-rating-modal.d.ts","sourceRoot":"","sources":["../../../src/components/Rate/show-rating-modal.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,eAAe,QAAS,MAAM,UAAU,MAAM,UAAU,KAAK,GAAG,IAAI,kBAAkB,MAAM,SAAS,MAAM,SAMvH,CAAA"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { overlay } from '../../LayoutOverlayManager.js';
|
|
3
|
-
import { RateComponent } from './index.js';
|
|
4
|
-
export const showRatingModal = (sub, tenant, portal, formIdentifier, title) => {
|
|
5
|
-
overlay.showModal({
|
|
6
|
-
title,
|
|
7
|
-
children: _jsx(RateComponent, { tfLive: formIdentifier, userId: sub, orgId: tenant, portal: portal }),
|
|
8
|
-
size: 'large',
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=show-rating-modal.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"show-rating-modal.js","sourceRoot":"","sources":["../../../src/components/Rate/show-rating-modal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,GAAG,CAAA;AAEjC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,GAAW,EAAE,MAAc,EAAE,MAAoB,EAAE,cAAsB,EAAE,KAAa,EAAE,EAAE;IAC1H,OAAO,CAAC,SAAS,CAAC;QAChB,KAAK;QACL,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"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Box, Text } from '@citric/core'
|
|
2
|
-
import { useTour } from '../tour'
|
|
3
|
-
import { useNotificationsDictionary } from './dictionary'
|
|
4
|
-
|
|
5
|
-
export const useNotificationsTourStep = () => {
|
|
6
|
-
const t = useNotificationsDictionary()
|
|
7
|
-
const { addStep } = useTour()
|
|
8
|
-
|
|
9
|
-
addStep({
|
|
10
|
-
content: <Box px={5} py={3}>
|
|
11
|
-
<Text appearance="microtext1" colorScheme="inverse.contrastText">
|
|
12
|
-
{t.tour}
|
|
13
|
-
</Text>
|
|
14
|
-
</Box>,
|
|
15
|
-
selector: '.notificationsTour',
|
|
16
|
-
title: t.notifications,
|
|
17
|
-
position: 'bottom',
|
|
18
|
-
} as any)
|
|
19
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { overlay } from '../../LayoutOverlayManager'
|
|
2
|
-
import { RateComponent } from '.'
|
|
3
|
-
|
|
4
|
-
export const showRatingModal = (sub: string, tenant: string, portal: 'EDP' | 'AI', formIdentifier: string, title: string) => {
|
|
5
|
-
overlay.showModal({
|
|
6
|
-
title,
|
|
7
|
-
children: <RateComponent tfLive={formIdentifier} userId={sub} orgId={tenant} portal={portal} />,
|
|
8
|
-
size: 'large',
|
|
9
|
-
})
|
|
10
|
-
}
|