Add planner-aware memos and unified tool configuration panels
All checks were successful
Deploy Sokko G / deploy (push) Successful in 18s
All checks were successful
Deploy Sokko G / deploy (push) Successful in 18s
This commit is contained in:
parent
acd9b2fe11
commit
808610dcf2
53 changed files with 842 additions and 329 deletions
|
|
@ -11,6 +11,7 @@ import { useInlineEdit } from "../../hooks/useInlineEdit.js";
|
|||
import { compressImage } from "../../utils/imageCompression.js";
|
||||
import { getGameCardCover, ToolboxCard, ToolboxGameIcon, ToolboxIconPicker } from "./ToolboxCard.jsx";
|
||||
import { AddToolControls, ToolboxModules } from "./modules/index.jsx";
|
||||
import { getMemosDataAfterPlannerRemoval } from "./modules/memosPlannerUtils.js";
|
||||
import { ToolboxSpaces } from "./ToolboxSpaces.jsx";
|
||||
import {
|
||||
addModuleToToolboxSpace,
|
||||
|
|
@ -195,7 +196,9 @@ function ToolboxView({ siteContent, toolbox, toolboxGame, embedded, actions, sto
|
|||
isModuleDataReady: actions.isModuleDataReady,
|
||||
storageStatus: siteContent.toolboxes.storageStatus,
|
||||
storageReady,
|
||||
toolboxModules: toolbox.modules,
|
||||
moduleText,
|
||||
moduleConfigurationText: siteContent.toolboxes.moduleConfiguration,
|
||||
normalizeChecklistData,
|
||||
normalizeCombosData,
|
||||
normalizeLinksData,
|
||||
|
|
@ -403,6 +406,7 @@ function ToolboxView({ siteContent, toolbox, toolboxGame, embedded, actions, sto
|
|||
context={moduleContext}
|
||||
reorder={moduleReorder}
|
||||
spacesText={spacesText}
|
||||
configurationText={siteContent.toolboxes.moduleConfiguration}
|
||||
scrollToModuleId={pendingModuleId}
|
||||
onModuleScrolled={() => setPendingModuleId("")}
|
||||
onRename={(moduleId, title) => updateToolbox({ ...toolbox, modules: toolbox.modules.map((module) => module.id === moduleId ? { ...module, title } : module) })}
|
||||
|
|
@ -419,6 +423,15 @@ function ToolboxView({ siteContent, toolbox, toolboxGame, embedded, actions, sto
|
|||
danger: true,
|
||||
onResolve: (confirmed) => {
|
||||
if (!confirmed) return;
|
||||
const removedModule = toolbox.modules.find((module) => module.id === moduleId);
|
||||
const remainingModules = toolbox.modules.filter((module) => module.id !== moduleId);
|
||||
if (removedModule?.type === "taskPlanner") {
|
||||
toolbox.modules.filter((module) => module.type === "memos").forEach((memosModule) => {
|
||||
const memosData = normalizeMemosData(getModuleData(toolbox.id, memosModule.id, { items: [] }));
|
||||
const nextMemosData = getMemosDataAfterPlannerRemoval(memosData, moduleId, remainingModules);
|
||||
if (nextMemosData !== memosData) updateModuleData(toolbox.id, memosModule.id, nextMemosData, "memos");
|
||||
});
|
||||
}
|
||||
actions.removeModuleData(toolbox.id, moduleId);
|
||||
updateToolbox(removeModuleFromToolboxSpaces(toolbox, moduleId));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue