Improve toolbox architecture and initial bundle loading
All checks were successful
Deploy Sokko G / deploy (push) Successful in 15s
All checks were successful
Deploy Sokko G / deploy (push) Successful in 15s
This commit is contained in:
parent
f76cddcc95
commit
b221257616
34 changed files with 8358 additions and 6744 deletions
128
website/src/features/toolboxes/toolboxModuleRegistry.js
Normal file
128
website/src/features/toolboxes/toolboxModuleRegistry.js
Normal file
|
|
@ -0,0 +1,128 @@
|
|||
// Rôle : centralise les métadonnées légères des outils toolbox sans importer leurs composants.
|
||||
export const TOOLBOX_MODULE_DEFINITIONS = {
|
||||
notepad: {
|
||||
label: "Bloc notes",
|
||||
defaultTitle: "Bloc notes",
|
||||
mode: "Texte riche",
|
||||
icon: "notepad",
|
||||
editable: true,
|
||||
libraryCategory: "notesTracking"
|
||||
},
|
||||
checklist: {
|
||||
label: "Checklist",
|
||||
defaultTitle: "Checklist",
|
||||
mode: "Catégories + sans catégorie",
|
||||
icon: "checklist",
|
||||
editable: true,
|
||||
scrollable: true,
|
||||
libraryCategory: "notesTracking"
|
||||
},
|
||||
images: {
|
||||
label: "Images",
|
||||
defaultTitle: "Images",
|
||||
mode: "Média",
|
||||
icon: "picture",
|
||||
editable: true,
|
||||
scrollable: true,
|
||||
libraryCategory: "references"
|
||||
},
|
||||
links: {
|
||||
label: "Liens",
|
||||
defaultTitle: "Liens",
|
||||
mode: "Liste simple",
|
||||
icon: "link",
|
||||
editable: true,
|
||||
scrollable: true,
|
||||
libraryCategory: "references"
|
||||
},
|
||||
counters: {
|
||||
label: "Compteurs",
|
||||
defaultTitle: "Compteurs",
|
||||
mode: "Valeurs",
|
||||
icon: "abacus",
|
||||
editable: true,
|
||||
scrollable: true,
|
||||
libraryCategory: "notesTracking"
|
||||
},
|
||||
combos: {
|
||||
label: "Combos",
|
||||
defaultTitle: "Combos",
|
||||
mode: "Catégories",
|
||||
icon: "controller",
|
||||
editable: true,
|
||||
scrollable: true,
|
||||
libraryCategory: "buildsCommands"
|
||||
},
|
||||
calculator: {
|
||||
label: "Calculateur",
|
||||
defaultTitle: "Calculateur",
|
||||
mode: "Arborescence",
|
||||
icon: "calculator",
|
||||
editable: true,
|
||||
libraryCategory: "calculationData"
|
||||
},
|
||||
table: {
|
||||
label: "Tableau",
|
||||
defaultTitle: "Tableau",
|
||||
mode: "Grille + formules",
|
||||
icon: "table",
|
||||
editable: true,
|
||||
scrollable: true,
|
||||
libraryCategory: "calculationData"
|
||||
},
|
||||
timer: {
|
||||
label: "Timer",
|
||||
defaultTitle: "Timer",
|
||||
mode: "Chrono + comptes à rebours",
|
||||
icon: "clock",
|
||||
editable: true,
|
||||
libraryCategory: "timeRoutines"
|
||||
},
|
||||
taskPlanner: {
|
||||
label: "Planificateur de tâches",
|
||||
defaultTitle: "Planificateur de tâches",
|
||||
mode: "Catégories + parent/enfant",
|
||||
icon: "tasklist",
|
||||
editable: true,
|
||||
scrollable: true,
|
||||
libraryCategory: "timeRoutines"
|
||||
},
|
||||
equipmentPlanner: {
|
||||
label: "Planificateur d'équipements",
|
||||
defaultTitle: "Planificateur d'équipements",
|
||||
mode: "Build + sertissages",
|
||||
icon: "chest-armor",
|
||||
editable: true,
|
||||
scrollable: true,
|
||||
libraryCategory: "buildsCommands"
|
||||
},
|
||||
imageAnnotation: {
|
||||
label: "Annotation d'images",
|
||||
defaultTitle: "Annotation d'images",
|
||||
mode: "Image + marqueurs",
|
||||
icon: "map",
|
||||
editable: true,
|
||||
libraryCategory: "references"
|
||||
}
|
||||
};
|
||||
|
||||
export const TOOLBOX_MODULES = Object.fromEntries(Object.entries(TOOLBOX_MODULE_DEFINITIONS).map(([type, definition]) => [
|
||||
type,
|
||||
{ label: definition.label, icon: definition.icon }
|
||||
]));
|
||||
|
||||
export const LIBRARY_CATEGORY_DEFINITIONS = [
|
||||
{ key: "notesTracking", types: ["notepad", "checklist", "counters"] },
|
||||
{ key: "references", types: ["images", "imageAnnotation", "links"] },
|
||||
{ key: "calculationData", types: ["calculator", "table"] },
|
||||
{ key: "timeRoutines", types: ["timer", "taskPlanner"] },
|
||||
{ key: "buildsCommands", types: ["combos", "equipmentPlanner"] }
|
||||
];
|
||||
|
||||
export function getToolboxModuleDefinition(type) {
|
||||
return TOOLBOX_MODULE_DEFINITIONS[type] || TOOLBOX_MODULE_DEFINITIONS.notepad;
|
||||
}
|
||||
|
||||
export function getDefaultModuleTitle(type) {
|
||||
return getToolboxModuleDefinition(type).defaultTitle || "Outil";
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue