@refinedev/core 4.46.2 → 4.47.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 +23 -1
- package/README.md +4 -4
- package/dist/components/canAccess/index.d.ts +3 -0
- package/dist/components/canAccess/index.d.ts.map +1 -1
- package/dist/components/containers/refine/index.d.ts +4 -4
- package/dist/components/containers/refine/index.d.ts.map +1 -1
- package/dist/components/pages/config-error/index.d.ts +3 -0
- package/dist/components/pages/config-error/index.d.ts.map +1 -0
- package/dist/components/pages/config-success/index.d.ts +6 -0
- package/dist/components/pages/config-success/index.d.ts.map +1 -0
- package/dist/components/pages/welcome/index.d.ts +2 -5
- package/dist/components/pages/welcome/index.d.ts.map +1 -1
- package/dist/contexts/accessControl/IAccessControlContext.d.ts +3 -0
- package/dist/contexts/accessControl/IAccessControlContext.d.ts.map +1 -1
- package/dist/contexts/accessControl/index.d.ts.map +1 -1
- package/dist/contexts/auth/IAuthContext.d.ts +1 -1
- package/dist/contexts/data/index.d.ts +5 -49
- package/dist/contexts/data/index.d.ts.map +1 -1
- package/dist/contexts/refine/IRefineContext.d.ts +2 -0
- package/dist/contexts/refine/IRefineContext.d.ts.map +1 -1
- package/dist/contexts/refine/index.d.ts.map +1 -1
- package/dist/definitions/helpers/downloadInBrowser/index.d.ts +2 -0
- package/dist/definitions/helpers/downloadInBrowser/index.d.ts.map +1 -0
- package/dist/definitions/helpers/index.d.ts +1 -0
- package/dist/definitions/helpers/index.d.ts.map +1 -1
- package/dist/esm/index.js +26 -6
- package/dist/esm/index.js.map +1 -1
- package/dist/hooks/accessControl/useCan/index.d.ts +1 -1
- package/dist/hooks/accessControl/useCan/index.d.ts.map +1 -1
- package/dist/hooks/auth/useForgotPassword/index.d.ts.map +1 -1
- package/dist/hooks/auth/useLogin/index.d.ts.map +1 -1
- package/dist/hooks/auth/useLogout/index.d.ts.map +1 -1
- package/dist/hooks/auth/useRegister/index.d.ts.map +1 -1
- package/dist/hooks/auth/useUpdatePassword/index.d.ts.map +1 -1
- package/dist/hooks/data/useDataProvider.d.ts.map +1 -1
- package/dist/hooks/export/index.d.ts +27 -4
- package/dist/hooks/export/index.d.ts.map +1 -1
- package/dist/hooks/refine/useRefineContext.d.ts +1 -0
- package/dist/hooks/refine/useRefineContext.d.ts.map +1 -1
- package/dist/iife/index.js +26 -6
- package/dist/iife/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +26 -6
- package/dist/index.js.map +1 -1
- package/dist/interfaces/bindings/auth.d.ts +7 -1
- package/dist/interfaces/bindings/auth.d.ts.map +1 -1
- package/dist/interfaces/bindings/index.d.ts +1 -1
- package/dist/interfaces/bindings/index.d.ts.map +1 -1
- package/dist/interfaces/metaData/graphqlQueryOptions.d.ts +47 -0
- package/dist/interfaces/metaData/graphqlQueryOptions.d.ts.map +1 -1
- package/package.json +1 -2
- package/src/components/canAccess/index.tsx +6 -0
- package/src/components/containers/refine/index.tsx +4 -4
- package/src/components/pages/config-error/index.tsx +444 -0
- package/src/components/pages/config-success/index.tsx +294 -0
- package/src/components/pages/welcome/index.tsx +10 -289
- package/src/contexts/accessControl/IAccessControlContext.ts +3 -0
- package/src/contexts/accessControl/index.tsx +1 -0
- package/src/contexts/auth/IAuthContext.ts +1 -1
- package/src/contexts/data/index.tsx +9 -24
- package/src/contexts/refine/IRefineContext.ts +2 -0
- package/src/contexts/refine/index.tsx +1 -0
- package/src/definitions/helpers/downloadInBrowser/index.ts +25 -0
- package/src/definitions/helpers/index.ts +1 -0
- package/src/hooks/accessControl/useCan/index.ts +12 -5
- package/src/hooks/auth/useForgotPassword/index.ts +17 -1
- package/src/hooks/auth/useLogin/index.ts +22 -1
- package/src/hooks/auth/useLogout/index.ts +17 -1
- package/src/hooks/auth/useRegister/index.ts +22 -1
- package/src/hooks/auth/useUpdatePassword/index.ts +17 -1
- package/src/hooks/data/useDataProvider.tsx +3 -2
- package/src/hooks/export/index.ts +90 -9
- package/src/hooks/refine/useRefineContext.ts +2 -0
- package/src/index.tsx +1 -0
- package/src/interfaces/bindings/auth.ts +9 -1
- package/src/interfaces/bindings/index.ts +1 -0
- package/src/interfaces/metaData/graphqlQueryOptions.ts +47 -0
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
|
|
3
|
+
import { useMediaQuery } from "@definitions/helpers";
|
|
4
|
+
|
|
5
|
+
type CardInfo = {
|
|
6
|
+
title: string;
|
|
7
|
+
description: string;
|
|
8
|
+
link: string;
|
|
9
|
+
iconUrl: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const cards: CardInfo[] = [
|
|
13
|
+
{
|
|
14
|
+
title: "Documentation",
|
|
15
|
+
description:
|
|
16
|
+
"Learn about the technical details of using refine in your projects.",
|
|
17
|
+
link: "https://refine.dev/",
|
|
18
|
+
iconUrl:
|
|
19
|
+
"https://refine.ams3.cdn.digitaloceanspaces.com/welcome-page/book.svg",
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
title: "Tutorial",
|
|
23
|
+
description:
|
|
24
|
+
"Learn how to use refine by building a fully-functioning CRUD app, from scratch to full launch.",
|
|
25
|
+
link: "https://refine.dev/docs/tutorial/introduction/index/",
|
|
26
|
+
iconUrl:
|
|
27
|
+
"https://refine.ams3.cdn.digitaloceanspaces.com/welcome-page/hat.svg",
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
title: "Examples",
|
|
31
|
+
description:
|
|
32
|
+
"A collection of reference applications you can use as a starting point.",
|
|
33
|
+
link: "https://refine.dev/examples",
|
|
34
|
+
iconUrl:
|
|
35
|
+
"https://refine.ams3.cdn.digitaloceanspaces.com/welcome-page/application.svg",
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
title: "Community",
|
|
39
|
+
description:
|
|
40
|
+
"Join our Discord community and keep up with the latest news.",
|
|
41
|
+
link: "https://discord.gg/refine",
|
|
42
|
+
iconUrl:
|
|
43
|
+
"https://refine.ams3.cdn.digitaloceanspaces.com/welcome-page/discord.svg",
|
|
44
|
+
},
|
|
45
|
+
];
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* It is a page that welcomes you after the configuration is completed.
|
|
49
|
+
*/
|
|
50
|
+
export const ConfigSuccessPage: React.FC = () => {
|
|
51
|
+
const isTablet = useMediaQuery("(max-width: 1010px)");
|
|
52
|
+
const isMobile = useMediaQuery("(max-width: 650px)");
|
|
53
|
+
|
|
54
|
+
const getGridTemplateColumns = () => {
|
|
55
|
+
if (isMobile) {
|
|
56
|
+
return "1, 280px";
|
|
57
|
+
} else if (isTablet) {
|
|
58
|
+
return "2, 280px";
|
|
59
|
+
} else {
|
|
60
|
+
return "4, 1fr";
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const getHeaderFontSize = () => {
|
|
65
|
+
if (isMobile) {
|
|
66
|
+
return "32px";
|
|
67
|
+
} else if (isTablet) {
|
|
68
|
+
return "40px";
|
|
69
|
+
} else {
|
|
70
|
+
return "48px";
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
const getSubHeaderFontSize = () => {
|
|
75
|
+
if (isMobile) {
|
|
76
|
+
return "16px";
|
|
77
|
+
} else if (isTablet) {
|
|
78
|
+
return "20px";
|
|
79
|
+
} else {
|
|
80
|
+
return "24px";
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
return (
|
|
85
|
+
<div
|
|
86
|
+
style={{
|
|
87
|
+
position: "fixed",
|
|
88
|
+
zIndex: 10,
|
|
89
|
+
inset: 0,
|
|
90
|
+
overflow: "auto",
|
|
91
|
+
width: "100dvw",
|
|
92
|
+
height: "100dvh",
|
|
93
|
+
}}
|
|
94
|
+
>
|
|
95
|
+
<div
|
|
96
|
+
style={{
|
|
97
|
+
overflow: "hidden",
|
|
98
|
+
position: "relative",
|
|
99
|
+
backgroundSize: "cover",
|
|
100
|
+
backgroundRepeat: "no-repeat",
|
|
101
|
+
background: isMobile
|
|
102
|
+
? "url(https://refine.ams3.cdn.digitaloceanspaces.com/website/static/assets/landing-noise.webp), radial-gradient(88.89% 50% at 50% 100%, rgba(38, 217, 127, 0.10) 0%, rgba(38, 217, 127, 0.00) 100%), radial-gradient(88.89% 50% at 50% 0%, rgba(71, 235, 235, 0.15) 0%, rgba(71, 235, 235, 0.00) 100%), #1D1E30"
|
|
103
|
+
: isTablet
|
|
104
|
+
? "url(https://refine.ams3.cdn.digitaloceanspaces.com/website/static/assets/landing-noise.webp), radial-gradient(66.67% 50% at 50% 100%, rgba(38, 217, 127, 0.10) 0%, rgba(38, 217, 127, 0.00) 100%), radial-gradient(66.67% 50% at 50% 0%, rgba(71, 235, 235, 0.15) 0%, rgba(71, 235, 235, 0.00) 100%), #1D1E30"
|
|
105
|
+
: "url(https://refine.ams3.cdn.digitaloceanspaces.com/website/static/assets/landing-noise.webp), radial-gradient(35.56% 50% at 50% 100%, rgba(38, 217, 127, 0.12) 0%, rgba(38, 217, 127, 0) 100%), radial-gradient(35.56% 50% at 50% 0%, rgba(71, 235, 235, 0.18) 0%, rgba(71, 235, 235, 0) 100%), #1D1E30",
|
|
106
|
+
minHeight: "100%",
|
|
107
|
+
minWidth: "100%",
|
|
108
|
+
fontFamily: "Arial",
|
|
109
|
+
color: "#FFFFFF",
|
|
110
|
+
}}
|
|
111
|
+
>
|
|
112
|
+
<div
|
|
113
|
+
style={{
|
|
114
|
+
zIndex: 2,
|
|
115
|
+
position: "absolute",
|
|
116
|
+
width: isMobile ? "400px" : "800px",
|
|
117
|
+
height: "552px",
|
|
118
|
+
opacity: "0.5",
|
|
119
|
+
background:
|
|
120
|
+
"url(https://refine.ams3.cdn.digitaloceanspaces.com/assets/welcome-page-hexagon.png)",
|
|
121
|
+
backgroundRepeat: "no-repeat",
|
|
122
|
+
backgroundSize: "contain",
|
|
123
|
+
top: "0",
|
|
124
|
+
left: "50%",
|
|
125
|
+
transform: "translateX(-50%)",
|
|
126
|
+
}}
|
|
127
|
+
/>
|
|
128
|
+
<div style={{ height: isMobile ? "40px" : "80px" }}></div>
|
|
129
|
+
<div style={{ display: "flex", justifyContent: "center" }}>
|
|
130
|
+
<div
|
|
131
|
+
style={{
|
|
132
|
+
backgroundRepeat: "no-repeat",
|
|
133
|
+
backgroundSize: isMobile
|
|
134
|
+
? "112px 58px"
|
|
135
|
+
: "224px 116px",
|
|
136
|
+
backgroundImage:
|
|
137
|
+
"url(https://refine.ams3.cdn.digitaloceanspaces.com/assets/refine-logo.svg)",
|
|
138
|
+
width: isMobile ? 112 : 224,
|
|
139
|
+
height: isMobile ? 58 : 116,
|
|
140
|
+
}}
|
|
141
|
+
/>
|
|
142
|
+
</div>
|
|
143
|
+
<div
|
|
144
|
+
style={{
|
|
145
|
+
height: isMobile
|
|
146
|
+
? "120px"
|
|
147
|
+
: isTablet
|
|
148
|
+
? "200px"
|
|
149
|
+
: "30vh",
|
|
150
|
+
minHeight: isMobile
|
|
151
|
+
? "120px"
|
|
152
|
+
: isTablet
|
|
153
|
+
? "200px"
|
|
154
|
+
: "200px",
|
|
155
|
+
}}
|
|
156
|
+
></div>
|
|
157
|
+
<div
|
|
158
|
+
style={{
|
|
159
|
+
display: "flex",
|
|
160
|
+
flexDirection: "column",
|
|
161
|
+
gap: "16px",
|
|
162
|
+
textAlign: "center",
|
|
163
|
+
}}
|
|
164
|
+
>
|
|
165
|
+
<h1
|
|
166
|
+
style={{
|
|
167
|
+
fontSize: getHeaderFontSize(),
|
|
168
|
+
fontWeight: 700,
|
|
169
|
+
margin: "0px",
|
|
170
|
+
}}
|
|
171
|
+
>
|
|
172
|
+
Welcome Aboard!
|
|
173
|
+
</h1>
|
|
174
|
+
<h4
|
|
175
|
+
style={{
|
|
176
|
+
fontSize: getSubHeaderFontSize(),
|
|
177
|
+
fontWeight: 400,
|
|
178
|
+
margin: "0px",
|
|
179
|
+
}}
|
|
180
|
+
>
|
|
181
|
+
Your configuration is completed.
|
|
182
|
+
</h4>
|
|
183
|
+
</div>
|
|
184
|
+
<div style={{ height: "64px" }}></div>
|
|
185
|
+
<div
|
|
186
|
+
style={{
|
|
187
|
+
display: "grid",
|
|
188
|
+
gridTemplateColumns: `repeat(${getGridTemplateColumns()})`,
|
|
189
|
+
justifyContent: "center",
|
|
190
|
+
gap: "48px",
|
|
191
|
+
paddingRight: "16px",
|
|
192
|
+
paddingLeft: "16px",
|
|
193
|
+
paddingBottom: "32px",
|
|
194
|
+
maxWidth: "976px",
|
|
195
|
+
margin: "auto",
|
|
196
|
+
}}
|
|
197
|
+
>
|
|
198
|
+
{cards.map((card) => (
|
|
199
|
+
<Card key={`welcome-page-${card.title}`} card={card} />
|
|
200
|
+
))}
|
|
201
|
+
</div>
|
|
202
|
+
</div>
|
|
203
|
+
</div>
|
|
204
|
+
);
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
type CardProps = {
|
|
208
|
+
card: CardInfo;
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
const Card: React.FC<CardProps> = ({ card }) => {
|
|
212
|
+
const { title, description, iconUrl, link } = card;
|
|
213
|
+
|
|
214
|
+
const [isHover, setIsHover] = useState(false);
|
|
215
|
+
|
|
216
|
+
return (
|
|
217
|
+
<div
|
|
218
|
+
style={{
|
|
219
|
+
display: "flex",
|
|
220
|
+
flexDirection: "column",
|
|
221
|
+
gap: "16px",
|
|
222
|
+
}}
|
|
223
|
+
>
|
|
224
|
+
<div
|
|
225
|
+
style={{
|
|
226
|
+
display: "flex",
|
|
227
|
+
alignItems: "center",
|
|
228
|
+
}}
|
|
229
|
+
>
|
|
230
|
+
<a
|
|
231
|
+
onPointerEnter={() => setIsHover(true)}
|
|
232
|
+
onPointerLeave={() => setIsHover(false)}
|
|
233
|
+
style={{
|
|
234
|
+
display: "flex",
|
|
235
|
+
alignItems: "center",
|
|
236
|
+
color: "#fff",
|
|
237
|
+
textDecoration: "none",
|
|
238
|
+
}}
|
|
239
|
+
href={link}
|
|
240
|
+
>
|
|
241
|
+
<div
|
|
242
|
+
style={{
|
|
243
|
+
width: "16px",
|
|
244
|
+
height: "16px",
|
|
245
|
+
backgroundPosition: "center",
|
|
246
|
+
backgroundSize: "contain",
|
|
247
|
+
backgroundRepeat: "no-repeat",
|
|
248
|
+
backgroundImage: `url(${iconUrl})`,
|
|
249
|
+
}}
|
|
250
|
+
/>
|
|
251
|
+
<span
|
|
252
|
+
style={{
|
|
253
|
+
fontSize: "16px",
|
|
254
|
+
fontWeight: 700,
|
|
255
|
+
marginLeft: "13px",
|
|
256
|
+
marginRight: "14px",
|
|
257
|
+
}}
|
|
258
|
+
>
|
|
259
|
+
{title}
|
|
260
|
+
</span>
|
|
261
|
+
<svg
|
|
262
|
+
style={{
|
|
263
|
+
transition:
|
|
264
|
+
"transform 0.5s ease-in-out, opacity 0.2s ease-in-out",
|
|
265
|
+
...(isHover && {
|
|
266
|
+
transform: "translateX(4px)",
|
|
267
|
+
opacity: 1,
|
|
268
|
+
}),
|
|
269
|
+
}}
|
|
270
|
+
width="12"
|
|
271
|
+
height="8"
|
|
272
|
+
fill="none"
|
|
273
|
+
opacity="0.5"
|
|
274
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
275
|
+
>
|
|
276
|
+
<path
|
|
277
|
+
d="M7.293.293a1 1 0 0 1 1.414 0l3 3a1 1 0 0 1 0 1.414l-3 3a1 1 0 0 1-1.414-1.414L8.586 5H1a1 1 0 0 1 0-2h7.586L7.293 1.707a1 1 0 0 1 0-1.414Z"
|
|
278
|
+
fill="#fff"
|
|
279
|
+
/>
|
|
280
|
+
</svg>
|
|
281
|
+
</a>
|
|
282
|
+
</div>
|
|
283
|
+
<span
|
|
284
|
+
style={{
|
|
285
|
+
fontSize: "12px",
|
|
286
|
+
opacity: 0.5,
|
|
287
|
+
lineHeight: "16px",
|
|
288
|
+
}}
|
|
289
|
+
>
|
|
290
|
+
{description}
|
|
291
|
+
</span>
|
|
292
|
+
</div>
|
|
293
|
+
);
|
|
294
|
+
};
|
|
@@ -1,294 +1,15 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ConfigSuccessPage } from "../config-success";
|
|
3
|
+
import { useRefineContext } from "@hooks/refine";
|
|
4
|
+
import { ConfigErrorPage } from "../config-error";
|
|
2
5
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
type CardInfo = {
|
|
6
|
-
title: string;
|
|
7
|
-
description: string;
|
|
8
|
-
link: string;
|
|
9
|
-
iconUrl: string;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
const cards: CardInfo[] = [
|
|
13
|
-
{
|
|
14
|
-
title: "Documentation",
|
|
15
|
-
description:
|
|
16
|
-
"Learn about the technical details of using refine in your projects.",
|
|
17
|
-
link: "https://refine.dev/",
|
|
18
|
-
iconUrl:
|
|
19
|
-
"https://refine.ams3.cdn.digitaloceanspaces.com/welcome-page/book.svg",
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
title: "Tutorial",
|
|
23
|
-
description:
|
|
24
|
-
"Learn how to use refine by building a fully-functioning CRUD app, from scratch to full launch.",
|
|
25
|
-
link: "https://refine.dev/docs/tutorial/introduction/index/",
|
|
26
|
-
iconUrl:
|
|
27
|
-
"https://refine.ams3.cdn.digitaloceanspaces.com/welcome-page/hat.svg",
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
title: "Examples",
|
|
31
|
-
description:
|
|
32
|
-
"A collection of reference applications you can use as a starting point.",
|
|
33
|
-
link: "https://refine.dev/examples",
|
|
34
|
-
iconUrl:
|
|
35
|
-
"https://refine.ams3.cdn.digitaloceanspaces.com/welcome-page/application.svg",
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
title: "Community",
|
|
39
|
-
description:
|
|
40
|
-
"Join our Discord community and keep up with the latest news.",
|
|
41
|
-
link: "https://discord.gg/refine",
|
|
42
|
-
iconUrl:
|
|
43
|
-
"https://refine.ams3.cdn.digitaloceanspaces.com/welcome-page/discord.svg",
|
|
44
|
-
},
|
|
45
|
-
];
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* It is a page that welcomes you after the configuration is completed.
|
|
49
|
-
*/
|
|
50
|
-
export const WelcomePage: React.FC = () => {
|
|
51
|
-
const isTablet = useMediaQuery("(max-width: 1010px)");
|
|
52
|
-
const isMobile = useMediaQuery("(max-width: 650px)");
|
|
53
|
-
|
|
54
|
-
const getGridTemplateColumns = () => {
|
|
55
|
-
if (isMobile) {
|
|
56
|
-
return "1, 280px";
|
|
57
|
-
} else if (isTablet) {
|
|
58
|
-
return "2, 280px";
|
|
59
|
-
} else {
|
|
60
|
-
return "4, 1fr";
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
const getHeaderFontSize = () => {
|
|
65
|
-
if (isMobile) {
|
|
66
|
-
return "32px";
|
|
67
|
-
} else if (isTablet) {
|
|
68
|
-
return "40px";
|
|
69
|
-
} else {
|
|
70
|
-
return "48px";
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
const getSubHeaderFontSize = () => {
|
|
75
|
-
if (isMobile) {
|
|
76
|
-
return "16px";
|
|
77
|
-
} else if (isTablet) {
|
|
78
|
-
return "20px";
|
|
79
|
-
} else {
|
|
80
|
-
return "24px";
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
return (
|
|
85
|
-
<div
|
|
86
|
-
style={{
|
|
87
|
-
position: "fixed",
|
|
88
|
-
zIndex: 10,
|
|
89
|
-
inset: 0,
|
|
90
|
-
overflow: "auto",
|
|
91
|
-
width: "100dvw",
|
|
92
|
-
height: "100dvh",
|
|
93
|
-
}}
|
|
94
|
-
>
|
|
95
|
-
<div
|
|
96
|
-
style={{
|
|
97
|
-
overflow: "hidden",
|
|
98
|
-
position: "relative",
|
|
99
|
-
backgroundSize: "cover",
|
|
100
|
-
backgroundRepeat: "no-repeat",
|
|
101
|
-
background: isMobile
|
|
102
|
-
? "url(https://refine.ams3.cdn.digitaloceanspaces.com/website/static/assets/landing-noise.webp), radial-gradient(88.89% 50% at 50% 100%, rgba(38, 217, 127, 0.10) 0%, rgba(38, 217, 127, 0.00) 100%), radial-gradient(88.89% 50% at 50% 0%, rgba(71, 235, 235, 0.15) 0%, rgba(71, 235, 235, 0.00) 100%), #1D1E30"
|
|
103
|
-
: isTablet
|
|
104
|
-
? "url(https://refine.ams3.cdn.digitaloceanspaces.com/website/static/assets/landing-noise.webp), radial-gradient(66.67% 50% at 50% 100%, rgba(38, 217, 127, 0.10) 0%, rgba(38, 217, 127, 0.00) 100%), radial-gradient(66.67% 50% at 50% 0%, rgba(71, 235, 235, 0.15) 0%, rgba(71, 235, 235, 0.00) 100%), #1D1E30"
|
|
105
|
-
: "url(https://refine.ams3.cdn.digitaloceanspaces.com/website/static/assets/landing-noise.webp), radial-gradient(35.56% 50% at 50% 100%, rgba(38, 217, 127, 0.12) 0%, rgba(38, 217, 127, 0) 100%), radial-gradient(35.56% 50% at 50% 0%, rgba(71, 235, 235, 0.18) 0%, rgba(71, 235, 235, 0) 100%), #1D1E30",
|
|
106
|
-
minHeight: "100%",
|
|
107
|
-
minWidth: "100%",
|
|
108
|
-
fontFamily: "Arial",
|
|
109
|
-
color: "#FFFFFF",
|
|
110
|
-
}}
|
|
111
|
-
>
|
|
112
|
-
<div
|
|
113
|
-
style={{
|
|
114
|
-
zIndex: 2,
|
|
115
|
-
position: "absolute",
|
|
116
|
-
width: isMobile ? "400px" : "800px",
|
|
117
|
-
height: "552px",
|
|
118
|
-
opacity: "0.5",
|
|
119
|
-
background:
|
|
120
|
-
"url(https://refine.ams3.cdn.digitaloceanspaces.com/assets/welcome-page-hexagon.png)",
|
|
121
|
-
backgroundRepeat: "no-repeat",
|
|
122
|
-
backgroundSize: "contain",
|
|
123
|
-
top: "0",
|
|
124
|
-
left: "50%",
|
|
125
|
-
transform: "translateX(-50%)",
|
|
126
|
-
}}
|
|
127
|
-
/>
|
|
128
|
-
<div style={{ height: isMobile ? "40px" : "80px" }}></div>
|
|
129
|
-
<div style={{ display: "flex", justifyContent: "center" }}>
|
|
130
|
-
<div
|
|
131
|
-
style={{
|
|
132
|
-
backgroundRepeat: "no-repeat",
|
|
133
|
-
backgroundSize: isMobile
|
|
134
|
-
? "112px 58px"
|
|
135
|
-
: "224px 116px",
|
|
136
|
-
backgroundImage:
|
|
137
|
-
"url(https://refine.ams3.cdn.digitaloceanspaces.com/assets/refine-logo.svg)",
|
|
138
|
-
width: isMobile ? 112 : 224,
|
|
139
|
-
height: isMobile ? 58 : 116,
|
|
140
|
-
}}
|
|
141
|
-
/>
|
|
142
|
-
</div>
|
|
143
|
-
<div
|
|
144
|
-
style={{
|
|
145
|
-
height: isMobile
|
|
146
|
-
? "120px"
|
|
147
|
-
: isTablet
|
|
148
|
-
? "270px"
|
|
149
|
-
: "40vh",
|
|
150
|
-
minHeight: isMobile
|
|
151
|
-
? "120px"
|
|
152
|
-
: isTablet
|
|
153
|
-
? "270px"
|
|
154
|
-
: "270px",
|
|
155
|
-
}}
|
|
156
|
-
></div>
|
|
157
|
-
<div
|
|
158
|
-
style={{
|
|
159
|
-
display: "flex",
|
|
160
|
-
flexDirection: "column",
|
|
161
|
-
gap: "16px",
|
|
162
|
-
textAlign: "center",
|
|
163
|
-
}}
|
|
164
|
-
>
|
|
165
|
-
<h1
|
|
166
|
-
style={{
|
|
167
|
-
fontSize: getHeaderFontSize(),
|
|
168
|
-
fontWeight: 700,
|
|
169
|
-
margin: "0px",
|
|
170
|
-
}}
|
|
171
|
-
>
|
|
172
|
-
Welcome Aboard!
|
|
173
|
-
</h1>
|
|
174
|
-
<h4
|
|
175
|
-
style={{
|
|
176
|
-
fontSize: getSubHeaderFontSize(),
|
|
177
|
-
fontWeight: 400,
|
|
178
|
-
margin: "0px",
|
|
179
|
-
}}
|
|
180
|
-
>
|
|
181
|
-
Your configuration is completed.
|
|
182
|
-
</h4>
|
|
183
|
-
</div>
|
|
184
|
-
<div style={{ height: "64px" }}></div>
|
|
185
|
-
<div
|
|
186
|
-
style={{
|
|
187
|
-
display: "grid",
|
|
188
|
-
gridTemplateColumns: `repeat(${getGridTemplateColumns()})`,
|
|
189
|
-
justifyContent: "center",
|
|
190
|
-
gap: "48px",
|
|
191
|
-
paddingRight: "16px",
|
|
192
|
-
paddingLeft: "16px",
|
|
193
|
-
paddingBottom: "32px",
|
|
194
|
-
maxWidth: "976px",
|
|
195
|
-
margin: "auto",
|
|
196
|
-
}}
|
|
197
|
-
>
|
|
198
|
-
{cards.map((card) => (
|
|
199
|
-
<Card key={`welcome-page-${card.title}`} card={card} />
|
|
200
|
-
))}
|
|
201
|
-
</div>
|
|
202
|
-
</div>
|
|
203
|
-
</div>
|
|
204
|
-
);
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
type CardProps = {
|
|
208
|
-
card: CardInfo;
|
|
209
|
-
};
|
|
210
|
-
|
|
211
|
-
const Card: React.FC<CardProps> = ({ card }) => {
|
|
212
|
-
const { title, description, iconUrl, link } = card;
|
|
213
|
-
|
|
214
|
-
const [isHover, setIsHover] = useState(false);
|
|
6
|
+
export const WelcomePage = () => {
|
|
7
|
+
const { __initialized } = useRefineContext();
|
|
215
8
|
|
|
216
9
|
return (
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
gap: "16px",
|
|
222
|
-
}}
|
|
223
|
-
>
|
|
224
|
-
<div
|
|
225
|
-
style={{
|
|
226
|
-
display: "flex",
|
|
227
|
-
alignItems: "center",
|
|
228
|
-
}}
|
|
229
|
-
>
|
|
230
|
-
<a
|
|
231
|
-
onPointerEnter={() => setIsHover(true)}
|
|
232
|
-
onPointerLeave={() => setIsHover(false)}
|
|
233
|
-
style={{
|
|
234
|
-
display: "flex",
|
|
235
|
-
alignItems: "center",
|
|
236
|
-
color: "#fff",
|
|
237
|
-
textDecoration: "none",
|
|
238
|
-
}}
|
|
239
|
-
href={link}
|
|
240
|
-
>
|
|
241
|
-
<div
|
|
242
|
-
style={{
|
|
243
|
-
width: "16px",
|
|
244
|
-
height: "16px",
|
|
245
|
-
backgroundPosition: "center",
|
|
246
|
-
backgroundSize: "contain",
|
|
247
|
-
backgroundRepeat: "no-repeat",
|
|
248
|
-
backgroundImage: `url(${iconUrl})`,
|
|
249
|
-
}}
|
|
250
|
-
/>
|
|
251
|
-
<span
|
|
252
|
-
style={{
|
|
253
|
-
fontSize: "16px",
|
|
254
|
-
fontWeight: 700,
|
|
255
|
-
marginLeft: "13px",
|
|
256
|
-
marginRight: "14px",
|
|
257
|
-
}}
|
|
258
|
-
>
|
|
259
|
-
{title}
|
|
260
|
-
</span>
|
|
261
|
-
<svg
|
|
262
|
-
style={{
|
|
263
|
-
transition:
|
|
264
|
-
"transform 0.5s ease-in-out, opacity 0.2s ease-in-out",
|
|
265
|
-
...(isHover && {
|
|
266
|
-
transform: "translateX(4px)",
|
|
267
|
-
opacity: 1,
|
|
268
|
-
}),
|
|
269
|
-
}}
|
|
270
|
-
width="12"
|
|
271
|
-
height="8"
|
|
272
|
-
fill="none"
|
|
273
|
-
opacity="0.5"
|
|
274
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
275
|
-
>
|
|
276
|
-
<path
|
|
277
|
-
d="M7.293.293a1 1 0 0 1 1.414 0l3 3a1 1 0 0 1 0 1.414l-3 3a1 1 0 0 1-1.414-1.414L8.586 5H1a1 1 0 0 1 0-2h7.586L7.293 1.707a1 1 0 0 1 0-1.414Z"
|
|
278
|
-
fill="#fff"
|
|
279
|
-
/>
|
|
280
|
-
</svg>
|
|
281
|
-
</a>
|
|
282
|
-
</div>
|
|
283
|
-
<span
|
|
284
|
-
style={{
|
|
285
|
-
fontSize: "12px",
|
|
286
|
-
opacity: 0.5,
|
|
287
|
-
lineHeight: "16px",
|
|
288
|
-
}}
|
|
289
|
-
>
|
|
290
|
-
{description}
|
|
291
|
-
</span>
|
|
292
|
-
</div>
|
|
10
|
+
<>
|
|
11
|
+
<ConfigSuccessPage />
|
|
12
|
+
{!__initialized && <ConfigErrorPage />}
|
|
13
|
+
</>
|
|
293
14
|
);
|
|
294
15
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BaseKey, IResourceItem, ITreeMenu } from "../../interfaces";
|
|
2
|
+
import { UseQueryOptions } from "@tanstack/react-query";
|
|
2
3
|
|
|
3
4
|
export type CanParams = {
|
|
4
5
|
/**
|
|
@@ -32,6 +33,7 @@ export interface IAccessControlContext {
|
|
|
32
33
|
enableAccessControl?: boolean;
|
|
33
34
|
hideIfUnauthorized?: boolean;
|
|
34
35
|
};
|
|
36
|
+
queryOptions?: UseQueryOptions<CanReturnType>;
|
|
35
37
|
};
|
|
36
38
|
}
|
|
37
39
|
|
|
@@ -42,6 +44,7 @@ export interface IAccessControlContextReturnType {
|
|
|
42
44
|
enableAccessControl?: boolean;
|
|
43
45
|
hideIfUnauthorized?: boolean;
|
|
44
46
|
};
|
|
47
|
+
queryOptions?: UseQueryOptions<CanReturnType>;
|
|
45
48
|
};
|
|
46
49
|
}
|
|
47
50
|
|
|
@@ -5,7 +5,7 @@ export type TForgotPasswordData = void | false | string;
|
|
|
5
5
|
export type TUpdatePasswordData = void | false | string;
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* @deprecated `LegacyAuthProvider` is deprecated with refine@4, use `
|
|
8
|
+
* @deprecated `LegacyAuthProvider` is deprecated with refine@4, use `AuthProvider` instead, however, we still support `LegacyAuthProvider` for backward compatibility.
|
|
9
9
|
*/
|
|
10
10
|
export interface LegacyAuthProvider {
|
|
11
11
|
login: (params: any) => Promise<TLoginData>;
|
|
@@ -7,33 +7,18 @@ import {
|
|
|
7
7
|
} from "../../interfaces";
|
|
8
8
|
|
|
9
9
|
export const defaultDataProvider = () => {
|
|
10
|
-
return {
|
|
11
|
-
default: {
|
|
12
|
-
create: () => Promise.resolve({ data: { id: 1 } }),
|
|
13
|
-
createMany: () => Promise.resolve({ data: [] }),
|
|
14
|
-
deleteOne: () => Promise.resolve({ data: { id: 1 } }),
|
|
15
|
-
deleteMany: () => Promise.resolve({ data: [] }),
|
|
16
|
-
getList: () => Promise.resolve({ data: [], total: 0 }),
|
|
17
|
-
getMany: () => Promise.resolve({ data: [] }),
|
|
18
|
-
getOne: () => Promise.resolve({ data: { id: 1 } }),
|
|
19
|
-
update: () => Promise.resolve({ data: { id: 1 } }),
|
|
20
|
-
updateMany: () => Promise.resolve({ data: [] }),
|
|
21
|
-
custom: () => Promise.resolve({ data: {} }),
|
|
22
|
-
getApiUrl: () => "",
|
|
23
|
-
},
|
|
24
|
-
};
|
|
10
|
+
return {};
|
|
25
11
|
};
|
|
26
12
|
|
|
27
|
-
export const DataContext = React.createContext<
|
|
28
|
-
|
|
29
|
-
);
|
|
13
|
+
export const DataContext = React.createContext<
|
|
14
|
+
Partial<IDataMultipleContextProvider>
|
|
15
|
+
>(defaultDataProvider());
|
|
30
16
|
|
|
31
|
-
|
|
32
|
-
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
> = ({ children, ...rest }) => {
|
|
17
|
+
type Props = React.PropsWithChildren<
|
|
18
|
+
Partial<IDataMultipleContextProvider> | IDataContextProvider
|
|
19
|
+
>;
|
|
20
|
+
|
|
21
|
+
export const DataContextProvider: React.FC<Props> = ({ children, ...rest }) => {
|
|
37
22
|
let dataProviders;
|
|
38
23
|
if (!rest.getList || !rest.getOne) {
|
|
39
24
|
dataProviders = rest as IDataMultipleContextProvider;
|