feat(ui): support storage settings, pinned copies and contextual window actions

This commit is contained in:
Codex
2026-11-10 01:04:24 +03:00
parent be929f9d8e
commit 601ca62e9a
12 changed files with 54 additions and 13 deletions
+5 -1
View File
@@ -39,6 +39,8 @@ export interface WindowProps extends Omit<HTMLAttributes<HTMLDivElement>, "title
footer?: ReactNode;
/** Context actions beside close, using canonical IconButton controls. */
headerActions?: ReactNode;
/** Keep contextual actions immediately before close when requested. */
headerActionsPlacement?: "before-move" | "before-close";
size?: WindowSize;
placement?: WindowPlacement;
closeLabel?: string;
@@ -66,6 +68,7 @@ export function Window({
children,
footer,
headerActions,
headerActionsPlacement = "before-move",
size = "md",
placement = "center",
closeLabel = "Закрыть",
@@ -286,7 +289,7 @@ export function Window({
{subtitle ? <p id={descriptionId} className="nodedc-window__subtitle">{subtitle}</p> : null}
</div>
<div className="nodedc-window__actions">
{headerActions}
{headerActionsPlacement === "before-move" && headerActions}
{allowFloating && placement === "center" && <IconButton label={isFloating ? "Вернуть модальный режим" : "Свободное окно"} aria-pressed={isFloating} onClick={() => {
dragRef.current = null; resizeRef.current = null;
if (!isFloating) {
@@ -295,6 +298,7 @@ export function Window({
}
setFloating(!isFloating);
}}><Icon name="move" /></IconButton>}
{headerActionsPlacement === "before-close" && headerActions}
<button type="button" className="nodedc-window__close" aria-label={closeLabel} onClick={onClose}>
<Icon name="close" size={16} strokeWidth={1.6} />
</button>