data-primals-engine 1.3.3 → 1.4.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 +797 -782
- package/client/README.md +20 -0
- package/client/package-lock.json +717 -151
- package/client/package.json +37 -36
- package/client/src/App.jsx +9 -10
- package/client/src/App.scss +42 -1
- package/client/src/Dashboard.jsx +349 -208
- package/client/src/DashboardView.jsx +569 -547
- package/client/src/DataEditor.jsx +20 -2
- package/client/src/DataLayout.jsx +54 -13
- package/client/src/DataTable.jsx +807 -760
- package/client/src/DataTable.scss +187 -90
- package/client/src/Dialog.scss +0 -3
- package/client/src/Field.jsx +1783 -1583
- package/client/src/ModelCreator.jsx +25 -3
- package/client/src/ModelCreatorField.jsx +906 -804
- package/client/src/ModelList.jsx +20 -2
- package/client/src/constants.js +16 -4
- package/client/src/contexts/UIContext.jsx +19 -10
- package/client/src/translations.js +265 -3
- package/package.json +4 -3
- package/server.js +1 -0
- package/src/core.js +18 -0
- package/src/defaultModels.js +70 -10
- package/src/email.js +2 -1
- package/src/filter.js +260 -256
- package/src/i18n.js +503 -30
- package/src/modules/data/data.core.js +5 -1
- package/src/modules/data/data.history.js +489 -489
- package/src/modules/data/data.js +76 -10
- package/src/modules/data/data.routes.js +3 -20
- package/src/modules/user.js +19 -0
- package/src/modules/workflow.js +1808 -1817
- package/client/public/demo/26899917-d1ba-4df4-bb33-48d09a8778da.jpg +0 -0
- package/client/public/demo/4b9894c7-12cd-466d-8fd3-a2757b09ec96.jpg +0 -0
- package/client/public/demo/7ed369ac-a1a2-4b45-b0cd-4fd5bcf5a75a.jpg +0 -0
package/client/package.json
CHANGED
|
@@ -12,61 +12,62 @@
|
|
|
12
12
|
"preview": "vite preview"
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@tiptap/react": "^2.
|
|
15
|
+
"@tiptap/react": "^2.26.1",
|
|
16
16
|
"react-chartjs-2": "^5.3.0",
|
|
17
17
|
"react-code-blocks": "^0.1.6",
|
|
18
|
-
"react-cookie": "^8.0.
|
|
18
|
+
"react-cookie": "^8.0.1",
|
|
19
19
|
"react-ga": "^3.3.1",
|
|
20
20
|
"react-helmet": "^6.1.0",
|
|
21
|
-
"react-icons": "^5.0
|
|
22
|
-
"react-international-phone": "^4.
|
|
21
|
+
"react-icons": "^5.5.0",
|
|
22
|
+
"react-international-phone": "^4.6.0",
|
|
23
23
|
"react-query": "^3.39.3",
|
|
24
|
-
"react-router-dom": "^7.1
|
|
24
|
+
"react-router-dom": "^7.8.1",
|
|
25
25
|
"react-syntax-highlighter": "^15.6.1",
|
|
26
|
-
"react-tooltip": "^5.
|
|
26
|
+
"react-tooltip": "^5.29.1"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@babel/runtime": "^7.
|
|
29
|
+
"@babel/runtime": "^7.28.3",
|
|
30
30
|
"@codeium/react-code-editor": "^1.0.12",
|
|
31
|
-
"@codemirror/lang-javascript": "^6.2.
|
|
32
|
-
"@tiptap/extension-code": "^2.
|
|
33
|
-
"@tiptap/extension-code-block": "^2.
|
|
34
|
-
"@tiptap/extension-code-block-lowlight": "^2.
|
|
35
|
-
"@tiptap/extension-color": "^2.
|
|
36
|
-
"@tiptap/extension-hard-break": "^2.
|
|
31
|
+
"@codemirror/lang-javascript": "^6.2.4",
|
|
32
|
+
"@tiptap/extension-code": "^2.26.1",
|
|
33
|
+
"@tiptap/extension-code-block": "^2.26.1",
|
|
34
|
+
"@tiptap/extension-code-block-lowlight": "^2.26.1",
|
|
35
|
+
"@tiptap/extension-color": "^2.26.1",
|
|
36
|
+
"@tiptap/extension-hard-break": "^2.26.1",
|
|
37
37
|
"@tiptap/extension-image": "^2.12.0",
|
|
38
|
-
"@tiptap/extension-link": "^2.
|
|
39
|
-
"@tiptap/extension-list-item": "^2.
|
|
40
|
-
"@tiptap/extension-text-style": "^2.
|
|
41
|
-
"@tiptap/pm": "^2.
|
|
42
|
-
"@tiptap/starter-kit": "^2.
|
|
43
|
-
"@uiw/react-codemirror": "^4.
|
|
44
|
-
"chart.js": "^4.
|
|
38
|
+
"@tiptap/extension-link": "^2.26.1",
|
|
39
|
+
"@tiptap/extension-list-item": "^2.26.1",
|
|
40
|
+
"@tiptap/extension-text-style": "^2.26.1",
|
|
41
|
+
"@tiptap/pm": "^2.26.1",
|
|
42
|
+
"@tiptap/starter-kit": "^2.26.1",
|
|
43
|
+
"@uiw/react-codemirror": "^4.25.1",
|
|
44
|
+
"chart.js": "^4.5.0",
|
|
45
45
|
"chartjs-adapter-date-fns": "^3.0.0",
|
|
46
46
|
"classnames": "^2.5.1",
|
|
47
47
|
"date-fns": "^4.1.0",
|
|
48
48
|
"express-rate-limit": "^7.5.1",
|
|
49
|
+
"i18next": "^25.4.0",
|
|
49
50
|
"lowlight": "^3.3.0",
|
|
50
|
-
"react": "18.3.1",
|
|
51
|
+
"react": "^18.3.1",
|
|
51
52
|
"react-big-calendar": "^1.15.0",
|
|
52
|
-
"react-dom": "18.3.1",
|
|
53
|
-
"react-router": "^7.
|
|
54
|
-
"react-switch": "^
|
|
53
|
+
"react-dom": "^18.3.1",
|
|
54
|
+
"react-router": "^7.8.1",
|
|
55
|
+
"react-switch": "^7.1.0",
|
|
55
56
|
"uniqid": "^5.4.0",
|
|
56
|
-
"yet-another-react-lightbox": "^3.
|
|
57
|
+
"yet-another-react-lightbox": "^3.25.0"
|
|
57
58
|
},
|
|
58
59
|
"devDependencies": {
|
|
59
|
-
"@eslint/js": "^9.
|
|
60
|
-
"@types/react": "18.3.1",
|
|
61
|
-
"@types/react-dom": "18.3.1",
|
|
62
|
-
"@vitejs/plugin-react": "^4.
|
|
63
|
-
"eslint": "^9.
|
|
64
|
-
"eslint-plugin-react": "^7.37.
|
|
65
|
-
"eslint-plugin-react-hooks": "^5.
|
|
66
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
67
|
-
"globals": "^15.
|
|
60
|
+
"@eslint/js": "^9.33.0",
|
|
61
|
+
"@types/react": "^18.3.1",
|
|
62
|
+
"@types/react-dom": "^18.3.1",
|
|
63
|
+
"@vitejs/plugin-react": "^4.7.0",
|
|
64
|
+
"eslint": "^9.33.0",
|
|
65
|
+
"eslint-plugin-react": "^7.37.5",
|
|
66
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
67
|
+
"eslint-plugin-react-refresh": "^0.4.20",
|
|
68
|
+
"globals": "^15.15.0",
|
|
68
69
|
"process": "^0.11.10",
|
|
69
|
-
"sass-embedded": "^1.
|
|
70
|
-
"vite": "^6.
|
|
70
|
+
"sass-embedded": "^1.90.0",
|
|
71
|
+
"vite": "^6.3.5"
|
|
71
72
|
}
|
|
72
73
|
}
|
package/client/src/App.jsx
CHANGED
|
@@ -4,7 +4,6 @@ import "yet-another-react-lightbox/plugins/captions.css";
|
|
|
4
4
|
import "yet-another-react-lightbox/styles.css";
|
|
5
5
|
import "./App.scss";
|
|
6
6
|
import {QueryClient, QueryClientProvider, useMutation, useQuery} from "react-query";
|
|
7
|
-
|
|
8
7
|
import {
|
|
9
8
|
BrowserRouter,
|
|
10
9
|
Outlet,
|
|
@@ -85,7 +84,7 @@ function TopBar({header}) {
|
|
|
85
84
|
return <>{header}</>;
|
|
86
85
|
}
|
|
87
86
|
|
|
88
|
-
function Layout ({header, routes, body, footer}) {
|
|
87
|
+
function Layout ({header, routes, body, footer,refreshUI}) {
|
|
89
88
|
const [cookies, setCookie, removeCookie] = useCookies(['username']);
|
|
90
89
|
const { i18n, t } = useTranslation();
|
|
91
90
|
const lang = (i18n.resolvedLanguage || i18n.language).split(/[-_]/)?.[0];
|
|
@@ -189,8 +188,6 @@ function Layout ({header, routes, body, footer}) {
|
|
|
189
188
|
}
|
|
190
189
|
|
|
191
190
|
|
|
192
|
-
const [refreshReducer, refreshUI]= useReducer((n) => n+1, 0,() => 0);
|
|
193
|
-
|
|
194
191
|
const nav = useNavigate();
|
|
195
192
|
|
|
196
193
|
const [red, triggerSignin] = useReducer((d) => d+1, 0, () => 0);
|
|
@@ -392,12 +389,12 @@ function Layout ({header, routes, body, footer}) {
|
|
|
392
389
|
|
|
393
390
|
<Route path="/user/:user/dashboards/:hash?" element={<>
|
|
394
391
|
{menu}
|
|
395
|
-
{
|
|
392
|
+
{<DashboardsPage />}
|
|
396
393
|
</>} />
|
|
397
394
|
|
|
398
395
|
<Route path={"/user/:user/*"} element={<>
|
|
399
396
|
{menu}
|
|
400
|
-
<UserPage notifs={[]} onAuthenticated={onAuthenticated} triggerSignin={triggerSignin}/>
|
|
397
|
+
<UserPage notifs={[]} refreshUI={refreshUI} onAuthenticated={onAuthenticated} triggerSignin={triggerSignin}/>
|
|
401
398
|
{!me && (<></>)}
|
|
402
399
|
</>}/>
|
|
403
400
|
<Route path={"/:lang/*"} element={<>
|
|
@@ -415,7 +412,7 @@ function Layout ({header, routes, body, footer}) {
|
|
|
415
412
|
</div>;
|
|
416
413
|
}
|
|
417
414
|
|
|
418
|
-
function UserPage({notifs,triggerSignin, onAuthenticated}) {
|
|
415
|
+
function UserPage({notifs,triggerSignin,refreshUI, onAuthenticated}) {
|
|
419
416
|
const {me} = useAuthContext()
|
|
420
417
|
const [cookies, setCookie, removeCookie] = useCookies(['username']);
|
|
421
418
|
const params = useParams();
|
|
@@ -515,7 +512,7 @@ function UserPage({notifs,triggerSignin, onAuthenticated}) {
|
|
|
515
512
|
}, [isDemo, shouldStartTour]);
|
|
516
513
|
|
|
517
514
|
return <>{/^demo[0-9]{1,2}$/.test(me?.username) && notifs}
|
|
518
|
-
{params.user === id && <DataLayout/>}
|
|
515
|
+
{params.user === id && <DataLayout refreshUI={refreshUI}/>}
|
|
519
516
|
{params.user !== id &&
|
|
520
517
|
<p>Veuillez vous authentifier avec cet utilisateur "{params.user}" pour accéder à vos
|
|
521
518
|
données</p>}</>;
|
|
@@ -532,6 +529,8 @@ const BaseLayout=()=>{
|
|
|
532
529
|
const { me, setMe } = useAuthContext();
|
|
533
530
|
const [translations, setTranslations] = useState([]);
|
|
534
531
|
|
|
532
|
+
const [refreshReducer, refreshUI]= useReducer((n) => n+1, 0,() => 0);
|
|
533
|
+
|
|
535
534
|
useEffect(() => {
|
|
536
535
|
if (Array.isArray(translations)) {
|
|
537
536
|
var trs= {};
|
|
@@ -565,7 +564,7 @@ const BaseLayout=()=>{
|
|
|
565
564
|
changeLanguage(lang);
|
|
566
565
|
}, [lang]);
|
|
567
566
|
|
|
568
|
-
return <Layout header={<header className={"flex"}>
|
|
567
|
+
return <Layout refreshUI={refreshUI} header={<header className={"flex"}>
|
|
569
568
|
<Tooltip id={"header"}/>
|
|
570
569
|
<h1 className="flex-1">{seoTitle}</h1>
|
|
571
570
|
<div className="center">
|
|
@@ -590,7 +589,7 @@ function App() {
|
|
|
590
589
|
<BrowserRouter>
|
|
591
590
|
<UIProvider>
|
|
592
591
|
<NotificationProvider>
|
|
593
|
-
<BaseLayout></BaseLayout>
|
|
592
|
+
<BaseLayout></BaseLayout>
|
|
594
593
|
</NotificationProvider>
|
|
595
594
|
</UIProvider>
|
|
596
595
|
</BrowserRouter>
|
package/client/src/App.scss
CHANGED
|
@@ -245,6 +245,7 @@ form, .form {
|
|
|
245
245
|
border-radius: 5px;
|
|
246
246
|
box-sizing: border-box;
|
|
247
247
|
transition: border-color 0.3s ease, box-shadow 0.3s ease;
|
|
248
|
+
font-family: "Nunito Sans", sans-serif;
|
|
248
249
|
&:focus, &:-webkit-autofill {
|
|
249
250
|
border-color: $secondary-color;
|
|
250
251
|
background-color: #eaeaea !important;
|
|
@@ -268,6 +269,11 @@ form, .form {
|
|
|
268
269
|
max-width: 150px;
|
|
269
270
|
}
|
|
270
271
|
|
|
272
|
+
input[type*=date] {
|
|
273
|
+
padding: 4px 8px;
|
|
274
|
+
font-size: 80%;
|
|
275
|
+
}
|
|
276
|
+
|
|
271
277
|
.btn {
|
|
272
278
|
background-color: $primary-color;
|
|
273
279
|
color: white;
|
|
@@ -1296,7 +1302,7 @@ select[multiple]{
|
|
|
1296
1302
|
|
|
1297
1303
|
.model-creator {
|
|
1298
1304
|
.field-checkbox {
|
|
1299
|
-
padding:
|
|
1305
|
+
padding: 2px;
|
|
1300
1306
|
display: flex;
|
|
1301
1307
|
gap: 8px;
|
|
1302
1308
|
align-items: flex-start;
|
|
@@ -1505,3 +1511,38 @@ select[multiple]{
|
|
|
1505
1511
|
}
|
|
1506
1512
|
|
|
1507
1513
|
|
|
1514
|
+
// Styles for TextField with suggestions
|
|
1515
|
+
.with-suggestions {
|
|
1516
|
+
position: relative;
|
|
1517
|
+
}
|
|
1518
|
+
|
|
1519
|
+
.suggestions-list {
|
|
1520
|
+
position: absolute;
|
|
1521
|
+
background-color: white;
|
|
1522
|
+
border: 1px solid #ccc;
|
|
1523
|
+
border-top: none;
|
|
1524
|
+
list-style: none;
|
|
1525
|
+
margin: 0;
|
|
1526
|
+
padding: 0;
|
|
1527
|
+
width: 100%;
|
|
1528
|
+
z-index: 1000; // High z-index to appear over other elements
|
|
1529
|
+
max-height: 250px;
|
|
1530
|
+
overflow-y: auto;
|
|
1531
|
+
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
|
|
1532
|
+
border-radius: 0 0 4px 4px;
|
|
1533
|
+
|
|
1534
|
+
li {
|
|
1535
|
+
padding: 8px 12px;
|
|
1536
|
+
cursor: pointer;
|
|
1537
|
+
display: flex;
|
|
1538
|
+
align-items: center;
|
|
1539
|
+
gap: 8px;
|
|
1540
|
+
font-size: 0.9rem;
|
|
1541
|
+
|
|
1542
|
+
&:hover {
|
|
1543
|
+
background-color: #f0f8ff; // A light blue hover
|
|
1544
|
+
}
|
|
1545
|
+
}
|
|
1546
|
+
}
|
|
1547
|
+
|
|
1548
|
+
|