data-primals-engine 1.5.2 → 1.6.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.
Files changed (63) hide show
  1. package/README.md +924 -915
  2. package/client/README.md +136 -136
  3. package/client/index.js +0 -1
  4. package/client/public/doc/API.postman_collection.json +213 -213
  5. package/client/public/react.svg +9 -9
  6. package/client/src/AddWidgetTypeModal.jsx +47 -47
  7. package/client/src/App.css +42 -42
  8. package/client/src/App.jsx +92 -150
  9. package/client/src/App.scss +6 -0
  10. package/client/src/AssistantChat.jsx +362 -363
  11. package/client/src/Button.jsx +12 -12
  12. package/client/src/Dashboard.jsx +480 -480
  13. package/client/src/DashboardHtmlViewItem.jsx +146 -146
  14. package/client/src/DashboardView.jsx +654 -654
  15. package/client/src/DataEditor.jsx +383 -383
  16. package/client/src/DataLayout.jsx +779 -808
  17. package/client/src/DataTable.jsx +782 -822
  18. package/client/src/DataTable.scss +186 -186
  19. package/client/src/GeolocationField.jsx +93 -93
  20. package/client/src/HistoryDialog.jsx +307 -307
  21. package/client/src/HistoryDialog.scss +319 -319
  22. package/client/src/HtmlViewBuilderModal.jsx +90 -90
  23. package/client/src/HtmlViewBuilderModal.scss +17 -17
  24. package/client/src/HtmlViewCard.jsx +43 -43
  25. package/client/src/ModelCreatorField.jsx +950 -950
  26. package/client/src/ModelList.jsx +280 -280
  27. package/client/src/Notification.jsx +136 -136
  28. package/client/src/PackGallery.jsx +391 -391
  29. package/client/src/PackGallery.scss +231 -231
  30. package/client/src/Pagination.jsx +143 -143
  31. package/client/src/RelationField.jsx +354 -354
  32. package/client/src/RelationSelectorWidget.jsx +172 -172
  33. package/client/src/RelationValue.jsx +2 -1
  34. package/client/src/contexts/CommandContext.jsx +260 -0
  35. package/client/src/contexts/ModelContext.jsx +4 -1
  36. package/client/src/contexts/UIContext.jsx +72 -72
  37. package/client/src/filter.js +263 -263
  38. package/client/src/index.css +90 -90
  39. package/package.json +6 -5
  40. package/perf/artillery-hooks.js +37 -37
  41. package/perf/setup.yml +25 -25
  42. package/src/constants.js +4 -0
  43. package/src/engine.js +335 -335
  44. package/src/events.js +232 -137
  45. package/src/filter.js +274 -274
  46. package/src/modules/assistant/assistant.js +225 -83
  47. package/src/modules/auth-google/index.js +50 -50
  48. package/src/modules/auth-microsoft/index.js +81 -81
  49. package/src/modules/data/data.core.js +118 -118
  50. package/src/modules/data/data.history.js +555 -555
  51. package/src/modules/data/data.operations.js +3401 -3381
  52. package/src/modules/data/data.relations.js +686 -686
  53. package/src/modules/data/data.routes.js +1879 -1879
  54. package/src/modules/data/data.validation.js +2 -2
  55. package/src/modules/file.js +247 -247
  56. package/src/packs.js +2 -2
  57. package/src/providers.js +2 -2
  58. package/src/services/stripe.js +196 -196
  59. package/src/sso.js +193 -193
  60. package/test/data.history.integration.test.js +264 -264
  61. package/test/data.integration.test.js +1206 -1206
  62. package/test/events.test.js +108 -10
  63. package/test/model.integration.test.js +377 -377
@@ -1,187 +1,187 @@
1
- /* client/src/index.css ou un fichier CSS dédié à DataImporter */
2
-
3
- .import-progress-container {
4
- margin-top: 20px;
5
- padding: 15px;
6
- border: 1px solid #ddd;
7
- border-radius: 8px;
8
- background-color: #f9f9f9;
9
- }
10
-
11
- .import-progress-container h3 {
12
- margin-bottom: 15px;
13
- color: #333;
14
- }
15
-
16
- .import-progress-container p {
17
- margin-bottom: 8px;
18
- color: #555;
19
- }
20
-
21
- .progress-bar-wrapper {
22
- width: 100%;
23
- background-color: #e0e0e0;
24
- border-radius: 5px;
25
- overflow: hidden;
26
- margin-top: 15px;
27
- height: 25px; /* Hauteur de la barre de progression */
28
- }
29
-
30
- .progress-bar {
31
- height: 100%;
32
- background-color: #4CAF50; /* Couleur verte pour la progression */
33
- text-align: center;
34
- color: white;
35
- line-height: 25px; /* Centrer le texte verticalement */
36
- transition: width 0.5s ease-in-out; /* Transition douce pour l'animation de la barre */
37
- border-radius: 5px;
38
- }
39
-
40
- .import-errors {
41
- margin-top: 20px;
42
- padding: 10px;
43
- border: 1px solid #f44336; /* Bordure rouge pour les erreurs */
44
- background-color: #ffebee; /* Fond rouge clair */
45
- border-radius: 5px;
46
- }
47
-
48
- .import-errors h4 {
49
- color: #d32f2f; /* Rouge plus foncé pour le titre des erreurs */
50
- margin-bottom: 10px;
51
- }
52
-
53
- .import-errors ul {
54
- list-style-type: disc;
55
- margin-left: 20px;
56
- color: #c62828; /* Rouge pour les éléments de liste */
57
- }
58
-
59
- .import-errors li {
60
- margin-bottom: 5px;
61
- }
62
-
63
- /* Ajustements pour le bouton de fermeture */
64
- .flex.justify-end.mt-4 button {
65
- padding: 8px 15px;
66
- border-radius: 5px;
67
- cursor: pointer;
68
- }
69
-
70
- .flex.justify-end.mt-4 button:disabled {
71
- background-color: #cccccc;
72
- cursor: not-allowed;
73
- }
74
- .preview-table {
75
- width: 100%;
76
- border-collapse: collapse;
77
- font-size: 0.9em;
78
- }
79
-
80
- .preview-table td {
81
- border: 1px solid #ddd;
82
- padding: 4px;
83
- }
84
-
85
- .preview-table-container {
86
- max-height: 300px;
87
- overflow: auto;
88
- border: 1px solid #eee;
89
- margin-bottom: 10px;
90
- }
91
-
92
- .gauge-container {
93
- position: relative;
94
- width: 100%;
95
- height: 24px;
96
- background-color: rgba(0, 0, 0, 0.1);
97
- border-radius: 4px;
98
- overflow: hidden;
99
- box-sizing: border-box;
100
-
101
- .gauge-bar {
102
- height: 100%;
103
- background-color: #4caf50;
104
- transition: width 0.3s ease-in-out;
105
- }
106
-
107
- .gauge-label {
108
- position: absolute;
109
- top: 50%;
110
- left: 50%;
111
- transform: translate(-50%, -50%);
112
- z-index: 1;
113
- font-size: 12px;
114
- font-weight: 500;
115
- color: #000;
116
- text-shadow: 0 0 2px rgb(255 255 255 / 70%);
117
- }
118
- }
119
-
120
- // For cells with a dark background color
121
- .unlighted {
122
- .gauge-container {
123
- background-color: rgba(255, 255, 255, 0.2);
124
- .gauge-bar {
125
- background-color: #a5d6a7; // A lighter green
126
- }
127
- .gauge-label {
128
- color: #fff;
129
- text-shadow: 0 0 2px rgba(0, 0, 0, 0.7);
130
- }
131
- }
132
- }
133
-
134
- .range-field {
135
- display: flex;
136
- align-items: center;
137
- gap: 10px;
138
- width: 100%;
139
-
140
- input[type="range"] {
141
- -webkit-appearance: none; /* Supprime l'apparence par défaut */
142
- appearance: none;
143
- width: 100%; /* Pleine largeur */
144
- height: 8px; /* Hauteur spécifiée */
145
- background: #ddd; /* Fond gris */
146
- outline: none; /* Pas de contour */
147
- opacity: 0.7; /* Transparence pour l'effet de survol */
148
- -webkit-transition: .2s; /* Transition de 0.2s au survol */
149
- transition: opacity .2s;
150
- border-radius: 5px;
151
-
152
- &:hover {
153
- opacity: 1; /* Totalement opaque au survol */
154
- }
155
-
156
- &::-webkit-slider-thumb {
157
- -webkit-appearance: none; /* Supprime l'apparence par défaut */
158
- appearance: none;
159
- width: 20px; /* Largeur de la poignée */
160
- height: 20px; /* Hauteur de la poignée */
161
- background: #4CAF50; /* Fond vert */
162
- cursor: pointer; /* Curseur en forme de main */
163
- border-radius: 50%;
164
- border: 2px solid white;
165
- box-shadow: 0 0 2px rgba(0,0,0,0.5);
166
- }
167
-
168
- &::-moz-range-thumb {
169
- width: 20px;
170
- height: 20px;
171
- background: #4CAF50;
172
- cursor: pointer;
173
- border-radius: 50%;
174
- border: 2px solid white;
175
- box-shadow: 0 0 2px rgba(0,0,0,0.5);
176
- }
177
- }
178
-
179
- .range-value {
180
- text-align: center;
181
- min-width: fit-content;
182
- padding: 4px 8px;
183
- border-radius: 4px;
184
- border: 1px dotted gray;
185
- font-size: 1rem;
186
- }
1
+ /* client/src/index.css ou un fichier CSS dédié à DataImporter */
2
+
3
+ .import-progress-container {
4
+ margin-top: 20px;
5
+ padding: 15px;
6
+ border: 1px solid #ddd;
7
+ border-radius: 8px;
8
+ background-color: #f9f9f9;
9
+ }
10
+
11
+ .import-progress-container h3 {
12
+ margin-bottom: 15px;
13
+ color: #333;
14
+ }
15
+
16
+ .import-progress-container p {
17
+ margin-bottom: 8px;
18
+ color: #555;
19
+ }
20
+
21
+ .progress-bar-wrapper {
22
+ width: 100%;
23
+ background-color: #e0e0e0;
24
+ border-radius: 5px;
25
+ overflow: hidden;
26
+ margin-top: 15px;
27
+ height: 25px; /* Hauteur de la barre de progression */
28
+ }
29
+
30
+ .progress-bar {
31
+ height: 100%;
32
+ background-color: #4CAF50; /* Couleur verte pour la progression */
33
+ text-align: center;
34
+ color: white;
35
+ line-height: 25px; /* Centrer le texte verticalement */
36
+ transition: width 0.5s ease-in-out; /* Transition douce pour l'animation de la barre */
37
+ border-radius: 5px;
38
+ }
39
+
40
+ .import-errors {
41
+ margin-top: 20px;
42
+ padding: 10px;
43
+ border: 1px solid #f44336; /* Bordure rouge pour les erreurs */
44
+ background-color: #ffebee; /* Fond rouge clair */
45
+ border-radius: 5px;
46
+ }
47
+
48
+ .import-errors h4 {
49
+ color: #d32f2f; /* Rouge plus foncé pour le titre des erreurs */
50
+ margin-bottom: 10px;
51
+ }
52
+
53
+ .import-errors ul {
54
+ list-style-type: disc;
55
+ margin-left: 20px;
56
+ color: #c62828; /* Rouge pour les éléments de liste */
57
+ }
58
+
59
+ .import-errors li {
60
+ margin-bottom: 5px;
61
+ }
62
+
63
+ /* Ajustements pour le bouton de fermeture */
64
+ .flex.justify-end.mt-4 button {
65
+ padding: 8px 15px;
66
+ border-radius: 5px;
67
+ cursor: pointer;
68
+ }
69
+
70
+ .flex.justify-end.mt-4 button:disabled {
71
+ background-color: #cccccc;
72
+ cursor: not-allowed;
73
+ }
74
+ .preview-table {
75
+ width: 100%;
76
+ border-collapse: collapse;
77
+ font-size: 0.9em;
78
+ }
79
+
80
+ .preview-table td {
81
+ border: 1px solid #ddd;
82
+ padding: 4px;
83
+ }
84
+
85
+ .preview-table-container {
86
+ max-height: 300px;
87
+ overflow: auto;
88
+ border: 1px solid #eee;
89
+ margin-bottom: 10px;
90
+ }
91
+
92
+ .gauge-container {
93
+ position: relative;
94
+ width: 100%;
95
+ height: 24px;
96
+ background-color: rgba(0, 0, 0, 0.1);
97
+ border-radius: 4px;
98
+ overflow: hidden;
99
+ box-sizing: border-box;
100
+
101
+ .gauge-bar {
102
+ height: 100%;
103
+ background-color: #4caf50;
104
+ transition: width 0.3s ease-in-out;
105
+ }
106
+
107
+ .gauge-label {
108
+ position: absolute;
109
+ top: 50%;
110
+ left: 50%;
111
+ transform: translate(-50%, -50%);
112
+ z-index: 1;
113
+ font-size: 12px;
114
+ font-weight: 500;
115
+ color: #000;
116
+ text-shadow: 0 0 2px rgb(255 255 255 / 70%);
117
+ }
118
+ }
119
+
120
+ // For cells with a dark background color
121
+ .unlighted {
122
+ .gauge-container {
123
+ background-color: rgba(255, 255, 255, 0.2);
124
+ .gauge-bar {
125
+ background-color: #a5d6a7; // A lighter green
126
+ }
127
+ .gauge-label {
128
+ color: #fff;
129
+ text-shadow: 0 0 2px rgba(0, 0, 0, 0.7);
130
+ }
131
+ }
132
+ }
133
+
134
+ .range-field {
135
+ display: flex;
136
+ align-items: center;
137
+ gap: 10px;
138
+ width: 100%;
139
+
140
+ input[type="range"] {
141
+ -webkit-appearance: none; /* Supprime l'apparence par défaut */
142
+ appearance: none;
143
+ width: 100%; /* Pleine largeur */
144
+ height: 8px; /* Hauteur spécifiée */
145
+ background: #ddd; /* Fond gris */
146
+ outline: none; /* Pas de contour */
147
+ opacity: 0.7; /* Transparence pour l'effet de survol */
148
+ -webkit-transition: .2s; /* Transition de 0.2s au survol */
149
+ transition: opacity .2s;
150
+ border-radius: 5px;
151
+
152
+ &:hover {
153
+ opacity: 1; /* Totalement opaque au survol */
154
+ }
155
+
156
+ &::-webkit-slider-thumb {
157
+ -webkit-appearance: none; /* Supprime l'apparence par défaut */
158
+ appearance: none;
159
+ width: 20px; /* Largeur de la poignée */
160
+ height: 20px; /* Hauteur de la poignée */
161
+ background: #4CAF50; /* Fond vert */
162
+ cursor: pointer; /* Curseur en forme de main */
163
+ border-radius: 50%;
164
+ border: 2px solid white;
165
+ box-shadow: 0 0 2px rgba(0,0,0,0.5);
166
+ }
167
+
168
+ &::-moz-range-thumb {
169
+ width: 20px;
170
+ height: 20px;
171
+ background: #4CAF50;
172
+ cursor: pointer;
173
+ border-radius: 50%;
174
+ border: 2px solid white;
175
+ box-shadow: 0 0 2px rgba(0,0,0,0.5);
176
+ }
177
+ }
178
+
179
+ .range-value {
180
+ text-align: center;
181
+ min-width: fit-content;
182
+ padding: 4px 8px;
183
+ border-radius: 4px;
184
+ border: 1px dotted gray;
185
+ font-size: 1rem;
186
+ }
187
187
  }
@@ -1,94 +1,94 @@
1
- import React, { useState, useEffect } from 'react';
2
- import { MapContainer, TileLayer, Marker, useMapEvents, Popup } from 'react-leaflet';
3
- import 'leaflet/dist/leaflet.css';
4
- import L from 'leaflet';
5
-
6
- // Fix for default marker icon issue with webpack/parcel
7
- delete L.Icon.Default.prototype._getIconUrl;
8
-
9
- L.Icon.Default.mergeOptions({
10
- iconRetinaUrl: 'https://unpkg.com/leaflet@1.7.1/dist/images/marker-icon-2x.png',
11
- iconUrl: 'https://unpkg.com/leaflet@1.7.1/dist/images/marker-icon.png',
12
- shadowUrl: 'https://unpkg.com/leaflet@1.7.1/dist/images/marker-shadow.png'
13
- });
14
-
15
-
16
- const LocationMarker = ({ position, setPosition, name, onChange, value }) => {
17
- const map = useMapEvents({
18
- click(e) {
19
- const { lat, lng } = e.latlng;
20
- const newPos = [lat, lng];
21
- setPosition(newPos);
22
- map.flyTo(newPos, map.getZoom());
23
- onChange({
24
- name: name,
25
- value: {
26
- type: 'Point',
27
- coordinates: [lng, lat]
28
- }
29
- });
30
- },
31
- locationfound(e) {
32
- const { lat, lng } = e.latlng;
33
- const newPos = [lat, lng];
34
- setPosition(newPos);
35
- map.flyTo(newPos, map.getZoom());
36
- onChange({
37
- name: name,
38
- value: {
39
- type: 'Point',
40
- coordinates: [lng, lat]
41
- }
42
- });
43
- },
44
- });
45
-
46
- useEffect(() => {
47
- // If there's no value, try to locate user
48
- if (!value) {
49
- map.locate();
50
- }
51
- }, [map, value]);
52
-
53
-
54
- return position === null ? null : (
55
- <Marker position={position}>
56
- <Popup>Selected location</Popup>
57
- </Marker>
58
- );
59
- }
60
-
61
- const GeolocationField = ({ value, onChange, name }) => {
62
- // Default to a central location if no value is provided, e.g., Paris
63
- const initialPosition = (value && value.coordinates && value.coordinates.length === 2)
64
- ? [value.coordinates[1], value.coordinates[0]] // Leaflet uses [lat, lng], GeoJSON uses [lng, lat]
65
- : [48.8566, 2.3522]; // Default to Paris
66
-
67
- const [position, setPosition] = useState(initialPosition);
68
-
69
- useEffect(() => {
70
- if (value && value.coordinates && value.coordinates.length === 2) {
71
- const newPos = [value.coordinates[1], value.coordinates[0]];
72
- if (position[0] !== newPos[0] || position[1] !== newPos[1]) {
73
- setPosition(newPos);
74
- }
75
- } else {
76
- // If value is cleared, reset to default. The map.locate() will try to find the user.
77
- setPosition([48.8566, 2.3522]);
78
- }
79
- }, [value]);
80
-
81
- return (
82
- <div style={{ height: '300px', width: '100%' }}>
83
- <MapContainer center={position} zoom={13} scrollWheelZoom={true} style={{ height: '100%', width: '100%' }}>
84
- <TileLayer
85
- attribution='&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
86
- url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
87
- />
88
- <LocationMarker position={position} setPosition={setPosition} name={name} onChange={onChange} value={value} />
89
- </MapContainer>
90
- </div>
91
- );
92
- };
93
-
1
+ import React, { useState, useEffect } from 'react';
2
+ import { MapContainer, TileLayer, Marker, useMapEvents, Popup } from 'react-leaflet';
3
+ import 'leaflet/dist/leaflet.css';
4
+ import L from 'leaflet';
5
+
6
+ // Fix for default marker icon issue with webpack/parcel
7
+ delete L.Icon.Default.prototype._getIconUrl;
8
+
9
+ L.Icon.Default.mergeOptions({
10
+ iconRetinaUrl: 'https://unpkg.com/leaflet@1.7.1/dist/images/marker-icon-2x.png',
11
+ iconUrl: 'https://unpkg.com/leaflet@1.7.1/dist/images/marker-icon.png',
12
+ shadowUrl: 'https://unpkg.com/leaflet@1.7.1/dist/images/marker-shadow.png'
13
+ });
14
+
15
+
16
+ const LocationMarker = ({ position, setPosition, name, onChange, value }) => {
17
+ const map = useMapEvents({
18
+ click(e) {
19
+ const { lat, lng } = e.latlng;
20
+ const newPos = [lat, lng];
21
+ setPosition(newPos);
22
+ map.flyTo(newPos, map.getZoom());
23
+ onChange({
24
+ name: name,
25
+ value: {
26
+ type: 'Point',
27
+ coordinates: [lng, lat]
28
+ }
29
+ });
30
+ },
31
+ locationfound(e) {
32
+ const { lat, lng } = e.latlng;
33
+ const newPos = [lat, lng];
34
+ setPosition(newPos);
35
+ map.flyTo(newPos, map.getZoom());
36
+ onChange({
37
+ name: name,
38
+ value: {
39
+ type: 'Point',
40
+ coordinates: [lng, lat]
41
+ }
42
+ });
43
+ },
44
+ });
45
+
46
+ useEffect(() => {
47
+ // If there's no value, try to locate user
48
+ if (!value) {
49
+ map.locate();
50
+ }
51
+ }, [map, value]);
52
+
53
+
54
+ return position === null ? null : (
55
+ <Marker position={position}>
56
+ <Popup>Selected location</Popup>
57
+ </Marker>
58
+ );
59
+ }
60
+
61
+ const GeolocationField = ({ value, onChange, name }) => {
62
+ // Default to a central location if no value is provided, e.g., Paris
63
+ const initialPosition = (value && value.coordinates && value.coordinates.length === 2)
64
+ ? [value.coordinates[1], value.coordinates[0]] // Leaflet uses [lat, lng], GeoJSON uses [lng, lat]
65
+ : [48.8566, 2.3522]; // Default to Paris
66
+
67
+ const [position, setPosition] = useState(initialPosition);
68
+
69
+ useEffect(() => {
70
+ if (value && value.coordinates && value.coordinates.length === 2) {
71
+ const newPos = [value.coordinates[1], value.coordinates[0]];
72
+ if (position[0] !== newPos[0] || position[1] !== newPos[1]) {
73
+ setPosition(newPos);
74
+ }
75
+ } else {
76
+ // If value is cleared, reset to default. The map.locate() will try to find the user.
77
+ setPosition([48.8566, 2.3522]);
78
+ }
79
+ }, [value]);
80
+
81
+ return (
82
+ <div style={{ height: '300px', width: '100%' }}>
83
+ <MapContainer center={position} zoom={13} scrollWheelZoom={true} style={{ height: '100%', width: '100%' }}>
84
+ <TileLayer
85
+ attribution='&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
86
+ url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
87
+ />
88
+ <LocationMarker position={position} setPosition={setPosition} name={name} onChange={onChange} value={value} />
89
+ </MapContainer>
90
+ </div>
91
+ );
92
+ };
93
+
94
94
  export default GeolocationField;