@griddo/ax 11.11.5 → 11.11.7-rc.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/README.md +0 -5
- package/package.json +2 -2
- package/src/__tests__/components/Browser/Browser.test.tsx +1 -87
- package/src/__tests__/helpers/shareToken.test.ts +91 -0
- package/src/api/index.tsx +4 -0
- package/src/api/pages.tsx +21 -18
- package/src/api/shareToken.tsx +62 -0
- package/src/api/utils.tsx +13 -0
- package/src/components/Browser/index.tsx +77 -31
- package/src/components/Browser/style.tsx +15 -8
- package/src/components/BrowserContent/index.tsx +20 -5
- package/src/components/ErrorPage/index.tsx +28 -14
- package/src/components/Fields/TextField/index.tsx +18 -4
- package/src/components/Icon/components/GriddoLogo.js +16 -0
- package/src/components/Icon/index.tsx +1 -0
- package/src/components/Icon/svgs/GriddoLogo.svg +9 -0
- package/src/components/Modal/index.tsx +3 -1
- package/src/components/Modal/style.tsx +19 -10
- package/src/components/PageInfoBanner/index.tsx +38 -0
- package/src/components/PageInfoBanner/styles.tsx +40 -0
- package/src/components/SearchField/index.tsx +10 -6
- package/src/components/SearchField/style.tsx +48 -27
- package/src/components/SharePageModal/index.tsx +187 -0
- package/src/components/SharePageModal/style.tsx +41 -0
- package/src/components/StatusTile/index.tsx +28 -0
- package/src/components/StatusTile/styles.ts +63 -0
- package/src/components/index.tsx +103 -102
- package/src/global.d.ts +8 -0
- package/src/helpers/dates.tsx +14 -8
- package/src/helpers/index.tsx +5 -0
- package/src/helpers/shareToken.ts +25 -0
- package/src/locales/en-US.ts +1 -0
- package/src/locales/es-ES.ts +1 -0
- package/src/modules/PublicPreview/index.tsx +35 -13
- package/src/routes/publicRoutes.tsx +2 -2
- package/src/themes/theme.json +4 -0
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
|
|
3
|
+
import type { IShareData } from "@ax/api";
|
|
4
|
+
import { shareToken as shareTokenApi } from "@ax/api";
|
|
5
|
+
import { Button, Loader, StatusTile, TextField } from "@ax/components";
|
|
6
|
+
import { copyTextToClipboard, DEV_NOW, formatDate, getShareTokenInfo, isReqOk } from "@ax/helpers";
|
|
7
|
+
import { useToast } from "@ax/hooks";
|
|
8
|
+
|
|
9
|
+
import Modal from "../Modal";
|
|
10
|
+
import Toast from "../Toast";
|
|
11
|
+
|
|
12
|
+
import * as S from "./style";
|
|
13
|
+
|
|
14
|
+
const SharePageModal = (props: SharePageModalProps): JSX.Element | null => {
|
|
15
|
+
const { isOpen, hide, pageID, entity, pageTitle, shareData, onShareChange } = props;
|
|
16
|
+
|
|
17
|
+
const { isVisible, toggleToast, setIsVisible, state: toastState } = useToast();
|
|
18
|
+
const [showActions, setShowActions] = useState(false);
|
|
19
|
+
const [loading, setLoading] = useState(false);
|
|
20
|
+
|
|
21
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: TODO: fix this
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (isOpen && !shareData && !loading) {
|
|
24
|
+
handleCreateShare();
|
|
25
|
+
}
|
|
26
|
+
}, [isOpen, shareData]);
|
|
27
|
+
|
|
28
|
+
if (!isOpen) return null;
|
|
29
|
+
|
|
30
|
+
const tokenInfo = shareData ? getShareTokenInfo(shareData, DEV_NOW) : null;
|
|
31
|
+
const shareUrl = shareData ? `${window.location.origin}/page-preview/${pageID}/${entity}` : "";
|
|
32
|
+
|
|
33
|
+
const renewalPreview =
|
|
34
|
+
shareData && showActions && tokenInfo
|
|
35
|
+
? (() => {
|
|
36
|
+
const currentExpiration = new Date(shareData.endDate);
|
|
37
|
+
const renewalDate = new Date(currentExpiration);
|
|
38
|
+
renewalDate.setDate(renewalDate.getDate() + shareData.daysValid);
|
|
39
|
+
return {
|
|
40
|
+
date: formatDate(renewalDate),
|
|
41
|
+
days: tokenInfo.validTokenDaysUntilExpires + shareData.daysValid,
|
|
42
|
+
};
|
|
43
|
+
})()
|
|
44
|
+
: null;
|
|
45
|
+
|
|
46
|
+
const handleCopy = () => {
|
|
47
|
+
copyTextToClipboard(shareUrl).then(
|
|
48
|
+
() => toggleToast("URL Copied"),
|
|
49
|
+
(err) => console.error("Could not copy text: ", err),
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const handleCreateShare = async () => {
|
|
54
|
+
setLoading(true);
|
|
55
|
+
const response = await shareTokenApi.createShare(pageID);
|
|
56
|
+
if (isReqOk(response.status)) {
|
|
57
|
+
onShareChange(response.data);
|
|
58
|
+
}
|
|
59
|
+
setShowActions(false);
|
|
60
|
+
setLoading(false);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const handleRenew = async () => {
|
|
64
|
+
setLoading(true);
|
|
65
|
+
const response = await shareTokenApi.renewShare(pageID);
|
|
66
|
+
if (isReqOk(response.status)) {
|
|
67
|
+
onShareChange(response.data);
|
|
68
|
+
}
|
|
69
|
+
setShowActions(false);
|
|
70
|
+
setLoading(false);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const handleHide = () => {
|
|
74
|
+
setShowActions(false);
|
|
75
|
+
hide();
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
const getModalActions = () => {
|
|
79
|
+
if (tokenInfo?.tokenHasExpired) {
|
|
80
|
+
return {
|
|
81
|
+
main: { title: "generate new link", onClick: handleCreateShare, disabled: loading, icon: "refresh" },
|
|
82
|
+
secondary: { title: "cancel", onClick: handleHide },
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
if (showActions) {
|
|
86
|
+
return {
|
|
87
|
+
main: { title: "renew link", onClick: handleRenew, disabled: loading, icon: "refresh" },
|
|
88
|
+
secondary: { title: "cancel", onClick: () => setShowActions(false) },
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
return { main: undefined, secondary: undefined };
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
const { main: mainAction, secondary: secondaryAction } = getModalActions();
|
|
95
|
+
|
|
96
|
+
return (
|
|
97
|
+
<>
|
|
98
|
+
<Modal
|
|
99
|
+
isOpen={isOpen}
|
|
100
|
+
hide={hide}
|
|
101
|
+
size="S"
|
|
102
|
+
height="auto"
|
|
103
|
+
title="Share Draft"
|
|
104
|
+
mainAction={mainAction}
|
|
105
|
+
secondaryAction={secondaryAction}
|
|
106
|
+
>
|
|
107
|
+
<S.ModalContent>
|
|
108
|
+
<S.Description>
|
|
109
|
+
Generate a secure, time-limited link to share the draft <strong>{pageTitle}</strong> with external
|
|
110
|
+
reviewers. They won't need a Griddo account to view it.
|
|
111
|
+
</S.Description>
|
|
112
|
+
|
|
113
|
+
{loading && (
|
|
114
|
+
<S.LoaderWrapper>
|
|
115
|
+
<Loader name="circle" size="60px" />
|
|
116
|
+
</S.LoaderWrapper>
|
|
117
|
+
)}
|
|
118
|
+
|
|
119
|
+
{!loading && shareData && tokenInfo && (
|
|
120
|
+
<>
|
|
121
|
+
<S.PreviewLinkWrapper expired={tokenInfo.tokenHasExpired}>
|
|
122
|
+
<S.Label>Secure preview link</S.Label>
|
|
123
|
+
<TextField
|
|
124
|
+
value={shareUrl}
|
|
125
|
+
icon="copy"
|
|
126
|
+
onChange={() => {}}
|
|
127
|
+
onClickIcon={handleCopy}
|
|
128
|
+
noeditable
|
|
129
|
+
selectOnFocus
|
|
130
|
+
disabled={tokenInfo.tokenHasExpired}
|
|
131
|
+
/>
|
|
132
|
+
</S.PreviewLinkWrapper>
|
|
133
|
+
<S.StatusLineWrapper>
|
|
134
|
+
{tokenInfo.tokenHasExpired ? (
|
|
135
|
+
<StatusTile
|
|
136
|
+
icon="user"
|
|
137
|
+
title="Expired"
|
|
138
|
+
description={`${tokenInfo.validTokenDaysUntilExpires} days`}
|
|
139
|
+
detail={`Expired on ${tokenInfo.tokenExpirationDate}`}
|
|
140
|
+
mode="warning"
|
|
141
|
+
/>
|
|
142
|
+
) : (
|
|
143
|
+
<StatusTile
|
|
144
|
+
icon="user"
|
|
145
|
+
title="Valid"
|
|
146
|
+
description={`${renewalPreview ? renewalPreview.days : tokenInfo.validTokenDaysUntilExpires} days`}
|
|
147
|
+
detail={`Expires ${renewalPreview ? renewalPreview.date : tokenInfo.tokenExpirationDate}`}
|
|
148
|
+
mode="info"
|
|
149
|
+
/>
|
|
150
|
+
)}
|
|
151
|
+
|
|
152
|
+
<StatusTile
|
|
153
|
+
icon="scheduled"
|
|
154
|
+
title="Activity"
|
|
155
|
+
description={`${shareData.visitCount} views`}
|
|
156
|
+
detail={`Shared since ${formatDate(new Date(shareData.startDate))}`}
|
|
157
|
+
mode="info"
|
|
158
|
+
/>
|
|
159
|
+
</S.StatusLineWrapper>
|
|
160
|
+
</>
|
|
161
|
+
)}
|
|
162
|
+
{!showActions && tokenInfo?.tokenCanBeRenewed && shareData && (
|
|
163
|
+
<S.RenewTextButton>
|
|
164
|
+
<Button type="button" buttonStyle="text" icon="refresh" onClick={() => setShowActions(true)}>
|
|
165
|
+
{`renew for ${shareData.daysValid} days`}
|
|
166
|
+
</Button>
|
|
167
|
+
</S.RenewTextButton>
|
|
168
|
+
)}
|
|
169
|
+
</S.ModalContent>
|
|
170
|
+
</Modal>
|
|
171
|
+
{isVisible && <Toast message={toastState} setIsVisible={setIsVisible} />}
|
|
172
|
+
</>
|
|
173
|
+
);
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
interface SharePageModalProps {
|
|
177
|
+
isOpen: boolean;
|
|
178
|
+
hide: () => void;
|
|
179
|
+
pageID: number;
|
|
180
|
+
entity: string;
|
|
181
|
+
pageTitle: string;
|
|
182
|
+
shareData: IShareData | null;
|
|
183
|
+
onShareChange: (shareData: IShareData) => void;
|
|
184
|
+
height?: string;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export default SharePageModal;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
|
|
3
|
+
const ModalContent = styled.div`
|
|
4
|
+
padding: ${({ theme }) => `${theme.spacing.m} ${theme.spacing.m}`};
|
|
5
|
+
`;
|
|
6
|
+
|
|
7
|
+
const Description = styled.p`
|
|
8
|
+
${(p) => p.theme.textStyle.uiM};
|
|
9
|
+
color: ${({ theme }) => theme.color.textHighEmphasis};
|
|
10
|
+
`;
|
|
11
|
+
|
|
12
|
+
const Label = styled.p`
|
|
13
|
+
${(p) => p.theme.textStyle.fieldLabel};
|
|
14
|
+
color: ${({ theme }) => theme.color.textMediumEmphasis};
|
|
15
|
+
margin-bottom: ${(p) => p.theme.spacing.xs};
|
|
16
|
+
`;
|
|
17
|
+
|
|
18
|
+
const LoaderWrapper = styled.div`
|
|
19
|
+
display: flex;
|
|
20
|
+
justify-content: center;
|
|
21
|
+
width: 100%;
|
|
22
|
+
padding: 32px;
|
|
23
|
+
`;
|
|
24
|
+
|
|
25
|
+
const RenewTextButton = styled.div`
|
|
26
|
+
margin-top: 32px;
|
|
27
|
+
`;
|
|
28
|
+
|
|
29
|
+
const PreviewLinkWrapper = styled.div<{ expired?: boolean }>`
|
|
30
|
+
pointer-events: ${(p) => (p.expired ? "none" : "unset")};
|
|
31
|
+
user-select: ${(p) => (p.expired ? "none" : "unset")};
|
|
32
|
+
padding: ${(p) => p.theme.spacing.s} 0;
|
|
33
|
+
`;
|
|
34
|
+
|
|
35
|
+
const StatusLineWrapper = styled.div`
|
|
36
|
+
display: flex;
|
|
37
|
+
gap: 10px;
|
|
38
|
+
width: 100%;
|
|
39
|
+
`;
|
|
40
|
+
|
|
41
|
+
export { Description, Label, LoaderWrapper, ModalContent, PreviewLinkWrapper, RenewTextButton, StatusLineWrapper };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as S from "./styles";
|
|
2
|
+
|
|
3
|
+
function StatusTile(props: StatusTileProps) {
|
|
4
|
+
const { detail, description, icon, title, mode } = props;
|
|
5
|
+
|
|
6
|
+
return (
|
|
7
|
+
<S.Content colorMode={mode}>
|
|
8
|
+
<S.Header colorMode={mode}>
|
|
9
|
+
<S.StyledIcon name={icon} size="16px" />
|
|
10
|
+
<S.Title>{title}</S.Title>
|
|
11
|
+
</S.Header>
|
|
12
|
+
<S.Description>{description}</S.Description>
|
|
13
|
+
<S.Detail>{detail}</S.Detail>
|
|
14
|
+
</S.Content>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type ColorMode = "info" | "success" | "warning";
|
|
19
|
+
|
|
20
|
+
interface StatusTileProps {
|
|
21
|
+
icon: string;
|
|
22
|
+
title: string;
|
|
23
|
+
description: string;
|
|
24
|
+
detail: string;
|
|
25
|
+
mode: ColorMode;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default StatusTile;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import Icon from "@ax/components/Icon";
|
|
2
|
+
|
|
3
|
+
import styled from "styled-components";
|
|
4
|
+
|
|
5
|
+
import type { ColorMode } from ".";
|
|
6
|
+
|
|
7
|
+
const getColorFromMode = (mode: ColorMode, theme: any) => {
|
|
8
|
+
const modes = {
|
|
9
|
+
info: {
|
|
10
|
+
border: "#DBDDE9", // No hay border1 en el theme...
|
|
11
|
+
main: theme.colors.interactive01,
|
|
12
|
+
},
|
|
13
|
+
warning: {
|
|
14
|
+
border: theme.colors.error,
|
|
15
|
+
main: theme.colors.error,
|
|
16
|
+
},
|
|
17
|
+
success: {
|
|
18
|
+
border: theme.colors.success,
|
|
19
|
+
main: theme.colors.success,
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
return modes[mode];
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const Content = styled.div<{ colorMode: ColorMode }>`
|
|
27
|
+
border: 1px solid ${({ colorMode, theme }) => getColorFromMode(colorMode, theme).border};
|
|
28
|
+
padding: ${({ theme }) => theme.spacing.s};
|
|
29
|
+
background: #ffffff;
|
|
30
|
+
border-radius: 6px;
|
|
31
|
+
width: 100%;
|
|
32
|
+
`;
|
|
33
|
+
|
|
34
|
+
const StyledIcon = styled(Icon)`
|
|
35
|
+
margin-right: 4px;
|
|
36
|
+
`;
|
|
37
|
+
|
|
38
|
+
const Header = styled.p<{ colorMode: ColorMode }>`
|
|
39
|
+
color: ${({ colorMode, theme }) => getColorFromMode(colorMode, theme).main};
|
|
40
|
+
column-gap: ${({ theme }) => theme.spacing.xs};
|
|
41
|
+
display: flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
text-transform: uppercase;
|
|
44
|
+
font-weight: 600;
|
|
45
|
+
svg path {
|
|
46
|
+
fill: ${({ colorMode, theme }) => getColorFromMode(colorMode, theme).main};
|
|
47
|
+
}
|
|
48
|
+
`;
|
|
49
|
+
|
|
50
|
+
const Title = styled.p`
|
|
51
|
+
font-size: 12px;
|
|
52
|
+
`;
|
|
53
|
+
|
|
54
|
+
const Description = styled.span`
|
|
55
|
+
font-weight: bold;
|
|
56
|
+
`;
|
|
57
|
+
|
|
58
|
+
const Detail = styled.p`
|
|
59
|
+
font-size: 12px;
|
|
60
|
+
color: ${({ theme }) => theme.colors.textMediumEmphasis};
|
|
61
|
+
`;
|
|
62
|
+
|
|
63
|
+
export { Content, Description, Detail, Header, StyledIcon, Title };
|
package/src/components/index.tsx
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
import ActionMenu from "./ActionMenu";
|
|
2
|
+
import Avatar from "./Avatar";
|
|
3
|
+
import BackFolder from "./BackFolder";
|
|
4
|
+
import Breadcrumb from "./Breadcrumb";
|
|
5
|
+
import Browser from "./Browser";
|
|
6
|
+
import BrowserContent from "./BrowserContent";
|
|
7
|
+
import BulkSelectionOptions from "./BulkSelectionOptions";
|
|
8
|
+
import Button from "./Button";
|
|
9
|
+
import CategoryCell from "./CategoryCell";
|
|
10
|
+
import Circle from "./Circle";
|
|
11
|
+
import ConfigPanel from "./ConfigPanel";
|
|
12
|
+
import DragAndDrop from "./DragAndDrop";
|
|
13
|
+
import ElementsTooltip from "./ElementsTooltip";
|
|
14
|
+
import EmptyState from "./EmptyState";
|
|
15
|
+
import ErrorCenter from "./ErrorCenter";
|
|
16
|
+
import ErrorPage from "./ErrorPage";
|
|
17
|
+
import ErrorToast from "./ErrorToast";
|
|
18
|
+
import ExportButton from "./ExportButton";
|
|
19
|
+
import FieldContainer from "./FieldContainer";
|
|
1
20
|
import {
|
|
2
21
|
AIReferenceField,
|
|
3
22
|
ArrayFieldGroup,
|
|
@@ -18,6 +37,7 @@ import {
|
|
|
18
37
|
HeadingField,
|
|
19
38
|
HiddenField,
|
|
20
39
|
ImageField,
|
|
40
|
+
IntegrationsField,
|
|
21
41
|
LinkField,
|
|
22
42
|
NoteField,
|
|
23
43
|
NumberField,
|
|
@@ -37,46 +57,7 @@ import {
|
|
|
37
57
|
VisualOption,
|
|
38
58
|
VisualUniqueSelection,
|
|
39
59
|
Wysiwyg,
|
|
40
|
-
IntegrationsField,
|
|
41
60
|
} from "./Fields";
|
|
42
|
-
import { ListTitle, ListItem } from "./Lists";
|
|
43
|
-
import {
|
|
44
|
-
CategoryFilter,
|
|
45
|
-
CustomizeFilters,
|
|
46
|
-
LiveFilter,
|
|
47
|
-
NameFilter,
|
|
48
|
-
SiteFilter,
|
|
49
|
-
StatusFilter,
|
|
50
|
-
TranslationsFilter,
|
|
51
|
-
TypeFilter,
|
|
52
|
-
DateFilter,
|
|
53
|
-
LastAccessFilter,
|
|
54
|
-
PermissionsFilter,
|
|
55
|
-
UsersFilter,
|
|
56
|
-
RoleFilter,
|
|
57
|
-
CheckGroupFilter,
|
|
58
|
-
StateFilter,
|
|
59
|
-
} from "./TableFilters";
|
|
60
|
-
|
|
61
|
-
import ActionMenu from "./ActionMenu";
|
|
62
|
-
import Avatar from "./Avatar";
|
|
63
|
-
import BackFolder from "./BackFolder";
|
|
64
|
-
import Breadcrumb from "./Breadcrumb";
|
|
65
|
-
import Browser from "./Browser";
|
|
66
|
-
import BrowserContent from "./BrowserContent";
|
|
67
|
-
import BulkSelectionOptions from "./BulkSelectionOptions";
|
|
68
|
-
import Button from "./Button";
|
|
69
|
-
import CategoryCell from "./CategoryCell";
|
|
70
|
-
import Circle from "./Circle";
|
|
71
|
-
import ConfigPanel from "./ConfigPanel";
|
|
72
|
-
import DragAndDrop from "./DragAndDrop";
|
|
73
|
-
import ElementsTooltip from "./ElementsTooltip";
|
|
74
|
-
import EmptyState from "./EmptyState";
|
|
75
|
-
import ErrorCenter from "./ErrorCenter";
|
|
76
|
-
import ErrorPage from "./ErrorPage";
|
|
77
|
-
import ErrorToast from "./ErrorToast";
|
|
78
|
-
import ExportButton from "./ExportButton";
|
|
79
|
-
import FieldContainer from "./FieldContainer";
|
|
80
61
|
import FieldsBehavior from "./FieldsBehavior";
|
|
81
62
|
import FileGallery from "./FileGallery";
|
|
82
63
|
import FilterTagsBar from "./FilterTagsBar";
|
|
@@ -91,96 +72,61 @@ import IconAction from "./IconAction";
|
|
|
91
72
|
import Image from "./Image";
|
|
92
73
|
import InformativeMenu from "./InformativeMenu";
|
|
93
74
|
import LanguageMenu from "./LanguageMenu";
|
|
75
|
+
import { ListItem, ListTitle } from "./Lists";
|
|
94
76
|
import Loader from "./Loader";
|
|
95
77
|
import Loading from "./Loading";
|
|
96
78
|
import Login from "./Login";
|
|
97
79
|
import MainWrapper from "./MainWrapper";
|
|
98
|
-
import MenuItem from "./MenuItem";
|
|
99
80
|
import MenuGroup from "./MenuGroup";
|
|
81
|
+
import MenuItem from "./MenuItem";
|
|
100
82
|
import Modal from "./Modal";
|
|
101
83
|
import Nav from "./Nav";
|
|
102
84
|
import Notification from "./Notification";
|
|
103
85
|
import OcassionalToast from "./OcassionalToast";
|
|
104
86
|
import PageFinder from "./PageFinder";
|
|
87
|
+
import PageInfoBanner from "./PageInfoBanner";
|
|
105
88
|
import Pagination from "./Pagination";
|
|
106
89
|
import ProgressBar from "./ProgressBar";
|
|
107
90
|
import ReorderArrows from "./ReorderArrows";
|
|
108
91
|
import ResizePanel from "./ResizePanel";
|
|
109
92
|
import RestoreModal from "./RestoreModal";
|
|
110
|
-
import {
|
|
93
|
+
import { CancelScheduleModal, ScheduleModal } from "./ScheduleModal";
|
|
111
94
|
import SearchField from "./SearchField";
|
|
112
95
|
import SearchTagsBar from "./SearchTagsBar";
|
|
96
|
+
import SharePageModal from "./SharePageModal";
|
|
113
97
|
import SideModal from "./SideModal";
|
|
98
|
+
import StatusTile from "./StatusTile";
|
|
114
99
|
import SubNav from "./SubNav";
|
|
115
100
|
import TableCounter from "./TableCounter";
|
|
116
|
-
import
|
|
117
|
-
import Tabs from "./Tabs";
|
|
118
|
-
import Tag from "./Tag";
|
|
119
|
-
import Tooltip from "./Tooltip";
|
|
120
|
-
import Toast from "./Toast";
|
|
121
|
-
|
|
122
|
-
export {
|
|
123
|
-
//Fields
|
|
124
|
-
AIReferenceField,
|
|
125
|
-
ArrayFieldGroup,
|
|
126
|
-
AsyncCheckGroup,
|
|
127
|
-
AsyncSelect,
|
|
128
|
-
CheckField,
|
|
129
|
-
CheckGroup,
|
|
130
|
-
ComponentArray,
|
|
131
|
-
ComponentContainer,
|
|
132
|
-
ConditionalField,
|
|
133
|
-
DateField,
|
|
134
|
-
FieldGroup,
|
|
135
|
-
FieldsDivider,
|
|
136
|
-
FileField,
|
|
137
|
-
FormCategorySelect,
|
|
138
|
-
FormContainer,
|
|
139
|
-
FormFieldArray,
|
|
140
|
-
HeadingField,
|
|
141
|
-
HiddenField,
|
|
142
|
-
ImageField,
|
|
143
|
-
LinkField,
|
|
144
|
-
NoteField,
|
|
145
|
-
NumberField,
|
|
146
|
-
RadioField,
|
|
147
|
-
RadioGroup,
|
|
148
|
-
ReferenceField,
|
|
149
|
-
RichText,
|
|
150
|
-
Select,
|
|
151
|
-
SummaryButton,
|
|
152
|
-
TextArea,
|
|
153
|
-
TextField,
|
|
154
|
-
TimeField,
|
|
155
|
-
ToggleField,
|
|
156
|
-
TranslateButton,
|
|
157
|
-
UniqueCheck,
|
|
158
|
-
UrlField,
|
|
159
|
-
VisualOption,
|
|
160
|
-
VisualUniqueSelection,
|
|
161
|
-
Wysiwyg,
|
|
162
|
-
IntegrationsField,
|
|
163
|
-
//Lists
|
|
164
|
-
ListTitle,
|
|
165
|
-
ListItem,
|
|
166
|
-
//Filters
|
|
167
|
-
CheckGroupFilter,
|
|
168
|
-
DateFilter,
|
|
101
|
+
import {
|
|
169
102
|
CategoryFilter,
|
|
103
|
+
CheckGroupFilter,
|
|
170
104
|
CustomizeFilters,
|
|
105
|
+
DateFilter,
|
|
106
|
+
LastAccessFilter,
|
|
171
107
|
LiveFilter,
|
|
172
108
|
NameFilter,
|
|
109
|
+
PermissionsFilter,
|
|
110
|
+
RoleFilter,
|
|
173
111
|
SiteFilter,
|
|
112
|
+
StateFilter,
|
|
174
113
|
StatusFilter,
|
|
175
114
|
TranslationsFilter,
|
|
176
115
|
TypeFilter,
|
|
177
|
-
StateFilter,
|
|
178
|
-
LastAccessFilter,
|
|
179
|
-
PermissionsFilter,
|
|
180
116
|
UsersFilter,
|
|
181
|
-
|
|
182
|
-
|
|
117
|
+
} from "./TableFilters";
|
|
118
|
+
import TableList from "./TableList";
|
|
119
|
+
import Tabs from "./Tabs";
|
|
120
|
+
import Tag from "./Tag";
|
|
121
|
+
import Toast from "./Toast";
|
|
122
|
+
import Tooltip from "./Tooltip";
|
|
123
|
+
|
|
124
|
+
export {
|
|
183
125
|
ActionMenu,
|
|
126
|
+
AIReferenceField,
|
|
127
|
+
ArrayFieldGroup,
|
|
128
|
+
AsyncCheckGroup,
|
|
129
|
+
AsyncSelect,
|
|
184
130
|
Avatar,
|
|
185
131
|
BackFolder,
|
|
186
132
|
Breadcrumb,
|
|
@@ -188,9 +134,20 @@ export {
|
|
|
188
134
|
BrowserContent,
|
|
189
135
|
BulkSelectionOptions,
|
|
190
136
|
Button,
|
|
137
|
+
CancelScheduleModal,
|
|
191
138
|
CategoryCell,
|
|
139
|
+
CategoryFilter,
|
|
140
|
+
CheckField,
|
|
141
|
+
CheckGroup,
|
|
142
|
+
CheckGroupFilter,
|
|
192
143
|
Circle,
|
|
144
|
+
ComponentArray,
|
|
145
|
+
ComponentContainer,
|
|
146
|
+
ConditionalField,
|
|
193
147
|
ConfigPanel,
|
|
148
|
+
CustomizeFilters,
|
|
149
|
+
DateField,
|
|
150
|
+
DateFilter,
|
|
194
151
|
DragAndDrop,
|
|
195
152
|
ElementsTooltip,
|
|
196
153
|
EmptyState,
|
|
@@ -199,46 +156,90 @@ export {
|
|
|
199
156
|
ErrorToast,
|
|
200
157
|
ExportButton,
|
|
201
158
|
FieldContainer,
|
|
159
|
+
FieldGroup,
|
|
202
160
|
FieldsBehavior,
|
|
161
|
+
FieldsDivider,
|
|
162
|
+
FileField,
|
|
203
163
|
FileGallery,
|
|
204
164
|
FilterTagsBar,
|
|
205
165
|
Flag,
|
|
206
166
|
FloatingButton,
|
|
207
167
|
FloatingMenu,
|
|
208
168
|
FloatingPanel,
|
|
169
|
+
FormCategorySelect,
|
|
170
|
+
FormContainer,
|
|
171
|
+
FormFieldArray,
|
|
209
172
|
Gallery,
|
|
210
173
|
GuardModal,
|
|
174
|
+
HeadingField,
|
|
175
|
+
HiddenField,
|
|
211
176
|
Icon,
|
|
212
177
|
IconAction,
|
|
213
178
|
Image,
|
|
179
|
+
ImageField,
|
|
214
180
|
InformativeMenu,
|
|
181
|
+
IntegrationsField,
|
|
215
182
|
LanguageMenu,
|
|
183
|
+
LastAccessFilter,
|
|
184
|
+
LinkField,
|
|
185
|
+
ListItem,
|
|
186
|
+
ListTitle,
|
|
187
|
+
LiveFilter,
|
|
216
188
|
Loader,
|
|
217
189
|
Loading,
|
|
218
190
|
Login,
|
|
219
191
|
MainWrapper,
|
|
220
|
-
MenuItem,
|
|
221
192
|
MenuGroup,
|
|
193
|
+
MenuItem,
|
|
222
194
|
Modal,
|
|
195
|
+
NameFilter,
|
|
223
196
|
Nav,
|
|
197
|
+
NoteField,
|
|
224
198
|
Notification,
|
|
199
|
+
NumberField,
|
|
225
200
|
OcassionalToast,
|
|
226
201
|
PageFinder,
|
|
202
|
+
PageInfoBanner,
|
|
227
203
|
Pagination,
|
|
204
|
+
PermissionsFilter,
|
|
228
205
|
ProgressBar,
|
|
206
|
+
RadioField,
|
|
207
|
+
RadioGroup,
|
|
208
|
+
ReferenceField,
|
|
229
209
|
ReorderArrows,
|
|
230
210
|
ResizePanel,
|
|
231
211
|
RestoreModal,
|
|
212
|
+
RichText,
|
|
213
|
+
RoleFilter,
|
|
232
214
|
ScheduleModal,
|
|
233
|
-
CancelScheduleModal,
|
|
234
215
|
SearchField,
|
|
235
216
|
SearchTagsBar,
|
|
217
|
+
Select,
|
|
218
|
+
SharePageModal,
|
|
236
219
|
SideModal,
|
|
220
|
+
SiteFilter,
|
|
221
|
+
StateFilter,
|
|
222
|
+
StatusFilter,
|
|
223
|
+
StatusTile,
|
|
237
224
|
SubNav,
|
|
225
|
+
SummaryButton,
|
|
238
226
|
TableCounter,
|
|
239
227
|
TableList,
|
|
240
228
|
Tabs,
|
|
241
229
|
Tag,
|
|
242
|
-
|
|
230
|
+
TextArea,
|
|
231
|
+
TextField,
|
|
232
|
+
TimeField,
|
|
243
233
|
Toast,
|
|
234
|
+
ToggleField,
|
|
235
|
+
Tooltip,
|
|
236
|
+
TranslateButton,
|
|
237
|
+
TranslationsFilter,
|
|
238
|
+
TypeFilter,
|
|
239
|
+
UniqueCheck,
|
|
240
|
+
UrlField,
|
|
241
|
+
UsersFilter,
|
|
242
|
+
VisualOption,
|
|
243
|
+
VisualUniqueSelection,
|
|
244
|
+
Wysiwyg,
|
|
244
245
|
};
|
package/src/global.d.ts
CHANGED
|
@@ -8,3 +8,11 @@ declare module "react-draft-wysiwyg";
|
|
|
8
8
|
declare module "history";
|
|
9
9
|
declare module "draftjs-to-html";
|
|
10
10
|
declare module "html-to-draftjs";
|
|
11
|
+
declare module "*.module.css" {
|
|
12
|
+
const classes: { [key: string]: string };
|
|
13
|
+
export default classes;
|
|
14
|
+
}
|
|
15
|
+
declare module "*.css" {
|
|
16
|
+
const classes: { [key: string]: string };
|
|
17
|
+
export default classes;
|
|
18
|
+
}
|
package/src/helpers/dates.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { format, formatDistanceToNowStrict,
|
|
1
|
+
import { addMinutes, format, formatDistanceToNowStrict, isValid, parse } from "date-fns";
|
|
2
|
+
import { enUS } from "date-fns/locale";
|
|
2
3
|
|
|
3
4
|
const formatString = "dd/MM/yyyy";
|
|
4
5
|
|
|
@@ -83,17 +84,22 @@ const getScheduleFormatDate = (date: string): string => {
|
|
|
83
84
|
return dateToString(dateObj, "dd/MM/yy · HH:mm");
|
|
84
85
|
};
|
|
85
86
|
|
|
87
|
+
const formatDate = (date: number | Date): string => {
|
|
88
|
+
return format(date, "MMMM d, yyyy", { locale: enUS });
|
|
89
|
+
};
|
|
90
|
+
|
|
86
91
|
export {
|
|
92
|
+
areEqualDates,
|
|
87
93
|
dateToString,
|
|
88
|
-
|
|
89
|
-
isValidDate,
|
|
90
|
-
isValidDateRange,
|
|
94
|
+
formatDate,
|
|
91
95
|
getDateRange,
|
|
92
|
-
areEqualDates,
|
|
93
|
-
getStringifyDateRange,
|
|
94
|
-
getHumanLastModifiedDate,
|
|
95
|
-
getFormattedDateWithTimezone,
|
|
96
96
|
getDaysAgo,
|
|
97
|
+
getFormattedDateWithTimezone,
|
|
98
|
+
getHumanLastModifiedDate,
|
|
97
99
|
getRange,
|
|
98
100
|
getScheduleFormatDate,
|
|
101
|
+
getStringifyDateRange,
|
|
102
|
+
isValidDate,
|
|
103
|
+
isValidDateRange,
|
|
104
|
+
stringToDate,
|
|
99
105
|
};
|
package/src/helpers/index.tsx
CHANGED
|
@@ -11,6 +11,7 @@ import { getActivatedDataPacksIds, getDeactivatedModules, isModuleDisabled } fro
|
|
|
11
11
|
import {
|
|
12
12
|
areEqualDates,
|
|
13
13
|
dateToString,
|
|
14
|
+
formatDate,
|
|
14
15
|
getDateRange,
|
|
15
16
|
getDaysAgo,
|
|
16
17
|
getFormattedDateWithTimezone,
|
|
@@ -73,6 +74,7 @@ import {
|
|
|
73
74
|
getTemplateType,
|
|
74
75
|
isMultipleNavigationModules,
|
|
75
76
|
} from "./schemas";
|
|
77
|
+
import { DEV_NOW, getShareTokenInfo } from "./shareToken";
|
|
76
78
|
import {
|
|
77
79
|
camelize,
|
|
78
80
|
capitalize,
|
|
@@ -132,6 +134,7 @@ export {
|
|
|
132
134
|
filterThemeTemplates,
|
|
133
135
|
findObjectValue,
|
|
134
136
|
formatBytes,
|
|
137
|
+
formatDate,
|
|
135
138
|
getActivatedDataPacksIds,
|
|
136
139
|
getCurrentPageStructuredData,
|
|
137
140
|
getDataPackSchema,
|
|
@@ -171,6 +174,8 @@ export {
|
|
|
171
174
|
getSchemaFormCategories,
|
|
172
175
|
getSchemaThumbnails,
|
|
173
176
|
getSchemaType,
|
|
177
|
+
DEV_NOW,
|
|
178
|
+
getShareTokenInfo,
|
|
174
179
|
getSlugFromUrl,
|
|
175
180
|
getStringifyDateRange,
|
|
176
181
|
getStructuredDataFromPage,
|