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
|
@@ -5,7 +5,7 @@ import {useModelContext} from "./contexts/ModelContext.jsx";
|
|
|
5
5
|
import {FaArrowDown, FaArrowUp, FaEdit, FaInfo, FaMinus, FaPlus, FaSave, FaTrash} from "react-icons/fa";
|
|
6
6
|
|
|
7
7
|
import "./ModelCreator.scss"
|
|
8
|
-
import {CheckboxField, CodeField, ColorField, NumberField, SelectField, TextField} from "./Field.jsx";
|
|
8
|
+
import {CheckboxField, CodeField, ColorField, IconField, NumberField, SelectField, TextField} from "./Field.jsx";
|
|
9
9
|
import Button from "./Button.jsx";
|
|
10
10
|
import {Trans, useTranslation} from "react-i18next";
|
|
11
11
|
import {
|
|
@@ -42,6 +42,7 @@ const ModelCreator = forwardRef(({ initialPrompt = '', onModelGenerated, autoGen
|
|
|
42
42
|
const [modelMaxRequestData, setModelMaxRequestData] = useState(initialModel?.maxRequestData || ''); // Utilisation de initialModel
|
|
43
43
|
const [modelDescription, setModelDescription] = useState(initialModel?.name ? t(`model_description_${initialModel?.name}`, initialModel?.description) : '');
|
|
44
44
|
const [modelHistory, setModelHistory] = useState(!!initialModel?.history || undefined);
|
|
45
|
+
const [modelIcon, setModelIcon] = useState(!!initialModel?.icon || undefined);
|
|
45
46
|
const [fields, setFields] = useState([]);
|
|
46
47
|
const [changed, setChanged] = useState(false);
|
|
47
48
|
|
|
@@ -55,6 +56,7 @@ const ModelCreator = forwardRef(({ initialPrompt = '', onModelGenerated, autoGen
|
|
|
55
56
|
setModelDescription(initialModel.name ? t(`model_description_${initialModel.name}`, initialModel.description) : '');
|
|
56
57
|
setFields([...(initialModel.fields || []).map(m => ({...m}))]);
|
|
57
58
|
setModelHistory(initialModel.history);
|
|
59
|
+
setModelIcon(initialModel.icon);
|
|
58
60
|
} else {
|
|
59
61
|
// Mode création : on réinitialise tout pour une nouvelle génération
|
|
60
62
|
setModelName('');
|
|
@@ -63,6 +65,7 @@ const ModelCreator = forwardRef(({ initialPrompt = '', onModelGenerated, autoGen
|
|
|
63
65
|
setUseAI(true); // On active l'IA par défaut
|
|
64
66
|
setModelVisible(false);
|
|
65
67
|
setModelHistory(false);
|
|
68
|
+
setModelIcon(null);
|
|
66
69
|
}
|
|
67
70
|
}, [initialModel]);
|
|
68
71
|
|
|
@@ -74,6 +77,7 @@ const ModelCreator = forwardRef(({ initialPrompt = '', onModelGenerated, autoGen
|
|
|
74
77
|
setModelDescription(selectedModel.description || '');
|
|
75
78
|
setFields(selectedModel.fields || []);
|
|
76
79
|
setModelMaxRequestData(selectedModel.maxRequestData || defaultMaxRequestData);
|
|
80
|
+
setModelIcon(selectedModel.icon || null);
|
|
77
81
|
}
|
|
78
82
|
}
|
|
79
83
|
}, [generatedModels, selectedGeneratedModelIndex]);
|
|
@@ -134,6 +138,7 @@ const ModelCreator = forwardRef(({ initialPrompt = '', onModelGenerated, autoGen
|
|
|
134
138
|
setModelMaxRequestData(defaultMaxRequestData);
|
|
135
139
|
setFields([{ name: '', type: 'string' }]);
|
|
136
140
|
setModelHistory(undefined);
|
|
141
|
+
setModelIcon(null);
|
|
137
142
|
}
|
|
138
143
|
setDatasToLoad(datas=>[...datas, modelName]);
|
|
139
144
|
|
|
@@ -177,6 +182,8 @@ const ModelCreator = forwardRef(({ initialPrompt = '', onModelGenerated, autoGen
|
|
|
177
182
|
setModelName('');
|
|
178
183
|
setModelDescription('');
|
|
179
184
|
setSelectedModel(null)
|
|
185
|
+
setModelHistory(undefined)
|
|
186
|
+
setModelIcon(null);
|
|
180
187
|
setFields([{ name: '', type: 'string', _isNewField: true }]);
|
|
181
188
|
setDatasToLoad(datas => datas.filter(f => f !== modelName));
|
|
182
189
|
setGeneratedModels(mods => {
|
|
@@ -213,6 +220,7 @@ const ModelCreator = forwardRef(({ initialPrompt = '', onModelGenerated, autoGen
|
|
|
213
220
|
description: modelDescription,
|
|
214
221
|
maxRequestData: modelMaxRequestData,
|
|
215
222
|
history: modelHistory,
|
|
223
|
+
icon: modelIcon,
|
|
216
224
|
fields: (fields || []).map((field) => {
|
|
217
225
|
delete field['_isNewField'];
|
|
218
226
|
let otherFields = [];
|
|
@@ -227,7 +235,7 @@ const ModelCreator = forwardRef(({ initialPrompt = '', onModelGenerated, autoGen
|
|
|
227
235
|
break;
|
|
228
236
|
}
|
|
229
237
|
case 'number':
|
|
230
|
-
otherFields = ['min', 'max', 'step', 'unit'];
|
|
238
|
+
otherFields = ['min', 'max', 'step', 'unit','delay', 'gauge', 'percent'];
|
|
231
239
|
break;
|
|
232
240
|
case 'string':
|
|
233
241
|
case 'string_t':
|
|
@@ -608,6 +616,20 @@ const ModelCreator = forwardRef(({ initialPrompt = '', onModelGenerated, autoGen
|
|
|
608
616
|
}}
|
|
609
617
|
/>
|
|
610
618
|
|
|
619
|
+
<div className="flex field-bg">
|
|
620
|
+
<label htmlFor="modelIcon"><Trans i18nKey={"modelcreator.icon"}>Icône:</Trans></label>
|
|
621
|
+
</div>
|
|
622
|
+
<IconField
|
|
623
|
+
help={t('modelcreator.field.icon')}
|
|
624
|
+
id="modelIcon"
|
|
625
|
+
disabled={modelLocked}
|
|
626
|
+
value={modelIcon}
|
|
627
|
+
onChange={(e) => {
|
|
628
|
+
setModelIcon(e);
|
|
629
|
+
setChanged(true)
|
|
630
|
+
}}
|
|
631
|
+
/>
|
|
632
|
+
|
|
611
633
|
<div className="flex flex-no-wrap">
|
|
612
634
|
<div className="checkbox-label flex flex-1">
|
|
613
635
|
<CheckboxField
|
|
@@ -638,7 +660,7 @@ const ModelCreator = forwardRef(({ initialPrompt = '', onModelGenerated, autoGen
|
|
|
638
660
|
{/* Boutons d'action, visibles si un modèle est affiché ou en mode manuel */}
|
|
639
661
|
{(showModel || !useAI || initialModel) && (
|
|
640
662
|
<div className="actions flex">
|
|
641
|
-
{
|
|
663
|
+
{initialModel && (
|
|
642
664
|
<Button type="button" onClick={handleAddField}>
|
|
643
665
|
<FaPlus /> <Trans i18nKey={"btns.addField"}>Ajouter un champ</Trans>
|
|
644
666
|
</Button>
|