Add toolbox spaces and recover from stale asset bundles
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
0959c6740b
commit
0acf5ecf21
30 changed files with 1252 additions and 179 deletions
|
|
@ -8,7 +8,7 @@ import { ModuleDataGate, ModuleLoadingFallback } from "./ModuleDataGate.jsx";
|
|||
import { supportsTextExchange } from "./textImport.js";
|
||||
import { MODULE_COMPONENTS } from "./toolboxModuleComponents.jsx";
|
||||
|
||||
export function ModuleShell({ toolbox, module, context, reorder, itemGroup = "", scrollIntoView = false, onScrolledIntoView, onRename, onUpdateModule, onDelete }) {
|
||||
export function ModuleShell({ toolbox, module, context, reorder, itemGroup = "", spaces = [], activeSpaceId = "", moveText = "Déplacer vers", scrollIntoView = false, onScrolledIntoView, onRename, onUpdateModule, onDelete, onMoveToSpace }) {
|
||||
const definition = MODULE_COMPONENTS[module.type] || MODULE_COMPONENTS.notepad;
|
||||
const Component = definition.Component;
|
||||
const label = definition.label || module.type;
|
||||
|
|
@ -93,6 +93,19 @@ export function ModuleShell({ toolbox, module, context, reorder, itemGroup = "",
|
|||
<EditableModuleTitle value={module.title || label} fallback={label} tutorialTarget={module.type === "memos" ? "moduleTitle" : ""} onSave={(title) => onRename(module.id, title)} />
|
||||
</div>
|
||||
<div>
|
||||
{spaces.length > 1 && (
|
||||
<select
|
||||
className="module-space-select nds-select"
|
||||
data-size="sm"
|
||||
value=""
|
||||
aria-label={`${moveText} — ${module.title || label}`}
|
||||
title={moveText}
|
||||
onChange={(event) => onMoveToSpace(module.id, event.target.value)}
|
||||
>
|
||||
<option value="" disabled>{moveText}</option>
|
||||
{spaces.filter((space) => space.id !== activeSpaceId).map((space) => <option key={space.id} value={space.id}>{space.name}</option>)}
|
||||
</select>
|
||||
)}
|
||||
{definition.scrollable && (
|
||||
<button
|
||||
className={`module-scroll-button nds-switch ${scrollable ? "active" : ""}`}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue