Compare commits
5
Commits
3473cd9ef1
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bd08ac46f5 | ||
|
|
bcc121e7b2 | ||
|
|
13309f3209 | ||
|
|
d96eba824a | ||
|
|
6bf22988c5 |
@@ -11,8 +11,8 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nodedc/page-patterns": "0.1.0",
|
"@nodedc/page-patterns": "0.1.0",
|
||||||
"@nodedc/ui-core": "0.7.2",
|
"@nodedc/ui-core": "0.7.4",
|
||||||
"@nodedc/ui-react": "0.7.5",
|
"@nodedc/ui-react": "0.7.10",
|
||||||
"cesium": "1.147.0",
|
"cesium": "1.147.0",
|
||||||
"react": "^19.1.0",
|
"react": "^19.1.0",
|
||||||
"react-dom": "^19.1.0"
|
"react-dom": "^19.1.0"
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ import {
|
|||||||
ShareLinkModal,
|
ShareLinkModal,
|
||||||
SplitPane,
|
SplitPane,
|
||||||
SortableItem,
|
SortableItem,
|
||||||
|
SortableList,
|
||||||
SortableScope,
|
SortableScope,
|
||||||
SettingsCard,
|
SettingsCard,
|
||||||
Switch,
|
Switch,
|
||||||
@@ -64,6 +65,7 @@ import {
|
|||||||
TextField,
|
TextField,
|
||||||
ToastCard,
|
ToastCard,
|
||||||
ToastStack,
|
ToastStack,
|
||||||
|
ToastObserver,
|
||||||
Toolbar,
|
Toolbar,
|
||||||
NavigationCube,
|
NavigationCube,
|
||||||
UserProfileMenu,
|
UserProfileMenu,
|
||||||
@@ -361,6 +363,7 @@ export function CatalogApp() {
|
|||||||
const [applicationSaveState, setApplicationSaveState] = useState<ApplicationDraftSaveState>("idle");
|
const [applicationSaveState, setApplicationSaveState] = useState<ApplicationDraftSaveState>("idle");
|
||||||
const [applicationError, setApplicationError] = useState("");
|
const [applicationError, setApplicationError] = useState("");
|
||||||
const [toasts, setToasts] = useState<ToastItem[]>([]);
|
const [toasts, setToasts] = useState<ToastItem[]>([]);
|
||||||
|
const [observedToasts, setObservedToasts] = useState<ToastItem[]>([]);
|
||||||
const toastSequenceRef = useRef(0);
|
const toastSequenceRef = useRef(0);
|
||||||
const [sessionProfile, setSessionProfile] = useState<FoundrySessionProfile | null>(null);
|
const [sessionProfile, setSessionProfile] = useState<FoundrySessionProfile | null>(null);
|
||||||
const [foundrySettingsOpen, setFoundrySettingsOpen] = useState(false);
|
const [foundrySettingsOpen, setFoundrySettingsOpen] = useState(false);
|
||||||
@@ -406,6 +409,9 @@ export function CatalogApp() {
|
|||||||
const [strokeColor, setStrokeColor] = useState("#2b2b36");
|
const [strokeColor, setStrokeColor] = useState("#2b2b36");
|
||||||
const [strokeOpacity, setStrokeOpacity] = useState(100);
|
const [strokeOpacity, setStrokeOpacity] = useState(100);
|
||||||
const [treeDemoOpen,setTreeDemoOpen]=useState(false);
|
const [treeDemoOpen,setTreeDemoOpen]=useState(false);
|
||||||
|
const [gridOrder,setGridOrder]=useState(["Первое изображение","Второе изображение","Третье изображение"]);
|
||||||
|
const [detailFloating,setDetailFloating]=useState(false);
|
||||||
|
const [detailRect,setDetailRect]=useState<import("@nodedc/ui-react").WindowRect>();
|
||||||
const [treeDemoRect,setTreeDemoRect]=useState({left:32,top:96,width:380,height:480});
|
const [treeDemoRect,setTreeDemoRect]=useState({left:32,top:96,width:380,height:480});
|
||||||
const [treeSelected,setTreeSelected]=useState<string|null>('cells');
|
const [treeSelected,setTreeSelected]=useState<string|null>('cells');
|
||||||
const [treeVisible,setTreeVisible]=useState(true);
|
const [treeVisible,setTreeVisible]=useState(true);
|
||||||
@@ -1468,6 +1474,7 @@ export function CatalogApp() {
|
|||||||
<div className="catalog-form">
|
<div className="catalog-form">
|
||||||
<TextField label="Название проекта" hint="обязательно" value={projectName} onChange={(event) => setProjectName(event.target.value)} />
|
<TextField label="Название проекта" hint="обязательно" value={projectName} onChange={(event) => setProjectName(event.target.value)} />
|
||||||
<TextAreaField label="Описание" value={notes} onChange={(event) => setNotes(event.target.value)} />
|
<TextAreaField label="Описание" value={notes} onChange={(event) => setNotes(event.target.value)} />
|
||||||
|
<TextAreaField appearance="plain" label="" aria-label="Текст заметки" value={notes} onChange={(event) => setNotes(event.target.value)} />
|
||||||
</div>
|
</div>
|
||||||
</Preview>
|
</Preview>
|
||||||
<Preview title="Действия" note="общая геометрия" className="catalog-preview--compact">
|
<Preview title="Действия" note="общая геометрия" className="catalog-preview--compact">
|
||||||
@@ -1549,6 +1556,7 @@ export function CatalogApp() {
|
|||||||
</ResourceList>
|
</ResourceList>
|
||||||
<Button onClick={()=>setTreeDemoOpen(true)}>Дерево объектов · изменяемый размер</Button>
|
<Button onClick={()=>setTreeDemoOpen(true)}>Дерево объектов · изменяемый размер</Button>
|
||||||
<DragDropRoot onDragEnd={()=>{}}><DraggableItem id="whole-material-tile">{({activator})=><Button {...activator.attributes} {...activator.listeners}>Перенос за всю плитку</Button>}</DraggableItem></DragDropRoot>
|
<DragDropRoot onDragEnd={()=>{}}><DraggableItem id="whole-material-tile">{({activator})=><Button {...activator.attributes} {...activator.listeners}>Перенос за всю плитку</Button>}</DraggableItem></DragDropRoot>
|
||||||
|
<SortableList handleSurface="control" layout="grid" className="catalog-sortable-grid" items={gridOrder} getId={item=>item} onReorder={setGridOrder}>{(item,{handle})=><GlassSurface padding="sm">{handle}<Icon name="image"/><Description>{item}</Description></GlassSurface>}</SortableList>
|
||||||
<SettingsCard title="Устройства не обнаружены" description="Подключите устройство, чтобы оно появилось в списке." />
|
<SettingsCard title="Устройства не обнаружены" description="Подключите устройство, чтобы оно появилось в списке." />
|
||||||
<SettingsCard align="center" role="status" title="Настройки применены" description="Проверьте подключение устройства." />
|
<SettingsCard align="center" role="status" title="Настройки применены" description="Проверьте подключение устройства." />
|
||||||
</Preview>
|
</Preview>
|
||||||
@@ -1651,6 +1659,7 @@ export function CatalogApp() {
|
|||||||
eyebrow="MAP / SETTINGS"
|
eyebrow="MAP / SETTINGS"
|
||||||
title="Настройки карты"
|
title="Настройки карты"
|
||||||
description="Theme-aware application panel"
|
description="Theme-aware application panel"
|
||||||
|
headerActions={<IconButton label="Настройки панели" onClick={() => setInspectorOpen(true)}><Icon name="settings" /></IconButton>}
|
||||||
onClose={() => setSidePanelDemoOpen(false)}
|
onClose={() => setSidePanelDemoOpen(false)}
|
||||||
>
|
>
|
||||||
<Inspector variant="panel" sections={environmentSections.slice(0, 3).map(section=>({...section,action:{label:`Действие секции ${section.label}`,icon:<Icon name="edit"/>,onAction:()=>setInspectorOpen(true)}}))} defaultOpen={[environmentSections[0]?.id ?? ""]} singleOpen />
|
<Inspector variant="panel" sections={environmentSections.slice(0, 3).map(section=>({...section,action:{label:`Действие секции ${section.label}`,icon:<Icon name="edit"/>,onAction:()=>setInspectorOpen(true)}}))} defaultOpen={[environmentSections[0]?.id ?? ""]} singleOpen />
|
||||||
@@ -1795,6 +1804,7 @@ export function CatalogApp() {
|
|||||||
</div>
|
</div>
|
||||||
</SettingsCard>
|
</SettingsCard>
|
||||||
<SettingsCard eyebrow="LIVE STATES" title="Проверка стека" description="Кнопки используют тот же bottom-right viewport, что и реальные save/update flows.">
|
<SettingsCard eyebrow="LIVE STATES" title="Проверка стека" description="Кнопки используют тот же bottom-right viewport, что и реальные save/update flows.">
|
||||||
|
<Description>Последняя передача приложению: {observedToasts.map(item => item.title).join(', ') || 'нет уведомлений'}</Description>
|
||||||
<div className="catalog-inline catalog-inline--wrap">
|
<div className="catalog-inline catalog-inline--wrap">
|
||||||
<Button onClick={() => pushToast("success", "Изменения сохранены", "Статус автоматически исчезнет.")}>Success</Button>
|
<Button onClick={() => pushToast("success", "Изменения сохранены", "Статус автоматически исчезнет.")}>Success</Button>
|
||||||
<Button onClick={() => pushToast("info", "Профиль применён", "Application использует выбранную версию.")}>Info</Button>
|
<Button onClick={() => pushToast("info", "Профиль применён", "Application использует выбранную версию.")}>Info</Button>
|
||||||
@@ -2198,6 +2208,7 @@ export function CatalogApp() {
|
|||||||
<UserProfileMenu
|
<UserProfileMenu
|
||||||
triggerLabel="Профиль"
|
triggerLabel="Профиль"
|
||||||
triggerIcon="inbox"
|
triggerIcon="inbox"
|
||||||
|
headerAction={{label: 'Правая панель', pressed: sidePanelDemoOpen, onSelect: () => setSidePanelDemoOpen(open => !open)}}
|
||||||
displayName={sessionProfile?.user?.displayName || "Профиль"}
|
displayName={sessionProfile?.user?.displayName || "Профиль"}
|
||||||
subtitle={sessionProfile?.user?.email || "NODE.DC Foundry"}
|
subtitle={sessionProfile?.user?.email || "NODE.DC Foundry"}
|
||||||
avatarUrl={sessionProfile?.user?.avatarUrl || undefined}
|
avatarUrl={sessionProfile?.user?.avatarUrl || undefined}
|
||||||
@@ -2401,6 +2412,8 @@ export function CatalogApp() {
|
|||||||
|
|
||||||
<Window
|
<Window
|
||||||
open={createModuleOpen}
|
open={createModuleOpen}
|
||||||
|
floating={detailFloating} onFloatingChange={setDetailFloating}
|
||||||
|
rect={detailRect} onRectCommit={setDetailRect}
|
||||||
title="Создать модуль"
|
title="Создать модуль"
|
||||||
headerActionsPlacement="before-close"
|
headerActionsPlacement="before-close"
|
||||||
headerActions={<IconButton label="Очистить форму" onClick={() => {setCreateModuleName("");setCreateModuleSlug("");}}><Icon name="trash"/></IconButton>}
|
headerActions={<IconButton label="Очистить форму" onClick={() => {setCreateModuleName("");setCreateModuleSlug("");}}><Icon name="trash"/></IconButton>}
|
||||||
@@ -2637,7 +2650,9 @@ export function CatalogApp() {
|
|||||||
onClose={() => setConfirmOpen(false)}
|
onClose={() => setConfirmOpen(false)}
|
||||||
onConfirm={() => setConfirmOpen(false)}
|
onConfirm={() => setConfirmOpen(false)}
|
||||||
/>
|
/>
|
||||||
|
<ToastObserver onPresent={setObservedToasts}>
|
||||||
<ToastStack items={toasts} onDismiss={dismissToast} />
|
<ToastStack items={toasts} onDismiss={dismissToast} />
|
||||||
|
</ToastObserver>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2307,3 +2307,5 @@ textarea {
|
|||||||
.catalog-theme-fields { display: grid; gap: var(--nodedc-space-4); }
|
.catalog-theme-fields { display: grid; gap: var(--nodedc-space-4); }
|
||||||
|
|
||||||
.catalog-viewport-actions {position:absolute;top:var(--nodedc-space-3);right:var(--nodedc-space-3);display:flex;gap:var(--nodedc-space-2);padding:var(--nodedc-space-2);}
|
.catalog-viewport-actions {position:absolute;top:var(--nodedc-space-3);right:var(--nodedc-space-3);display:flex;gap:var(--nodedc-space-2);padding:var(--nodedc-space-2);}
|
||||||
|
|
||||||
|
.catalog-sortable-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--nodedc-space-3,12px)}
|
||||||
|
|||||||
+21
-1
@@ -46,7 +46,7 @@ Icon-only action по умолчанию круглый. Квадратная к
|
|||||||
|
|
||||||
## Field
|
## Field
|
||||||
|
|
||||||
FieldFrame объединяет label, control, hint и description. `labelPlacement="below"` ставит компактную приглушённую подпись под контролом в заголовке; доступное имя контрола остаётся прежним. TextField/TextAreaField реализуют стандартные текстовые поля. Автозаполнение браузера сохраняет материал поля, цвет текста и каретки текущей темы; синяя системная заливка не используется. Клавиатурный фокус остаётся видимым.
|
FieldFrame объединяет label, control, hint и description. `labelPlacement="below"` ставит компактную приглушённую подпись под контролом в заголовке; доступное имя контрола остаётся прежним. TextField/TextAreaField реализуют стандартные текстовые поля. `appearance="plain"` сохраняет вид обычного текста без подложки и позволяет сразу поставить каретку; при пустой подписи нужен `aria-label`. TextAreaField в этом режиме растёт по содержимому и ширине окна, нативные выделение, вставка и undo сохраняются. Автозаполнение браузера сохраняет материал поля, цвет текста и каретки текущей темы; синяя системная заливка не используется. Клавиатурный фокус остаётся видимым.
|
||||||
|
|
||||||
Приложение не должно вручную собирать label и input, если подходит Field. Ошибка и validation state будут расширением этого контракта, а не локальным классом приложения.
|
Приложение не должно вручную собирать label и input, если подходит Field. Ошибка и validation state будут расширением этого контракта, а не локальным классом приложения.
|
||||||
|
|
||||||
@@ -296,6 +296,13 @@ setup-команды, сохранение, API и права принадлеж
|
|||||||
|
|
||||||
## SettingsCard и Switch
|
## SettingsCard и Switch
|
||||||
|
|
||||||
|
В `UserProfileMenu` необязательный `headerAction={{label, onSelect}}` отделяет
|
||||||
|
действие средней иконки от меню профиля. Аватар и текст профиля сохраняют меню.
|
||||||
|
`ToastObserver onPresent` сообщает приложению новые и изменённые завершённые
|
||||||
|
уведомления из вложенных `ToastStack`; хранение, даты и история принадлежат
|
||||||
|
приложению. `ToastStack observe={false}` исключает повторную регистрацию
|
||||||
|
сообщений, уже записанных сервером. Отображение и таймеры не изменяются.
|
||||||
|
|
||||||
`SettingsCard` фиксирует нейтральную структуру админской группы: eyebrow/title/description/actions/body. `Switch` покрывает компактное включение/видимость внутри таких групп. Данные секции, сохранение и права остаются в consumer.
|
`SettingsCard` фиксирует нейтральную структуру админской группы: eyebrow/title/description/actions/body. `Switch` покрывает компактное включение/видимость внутри таких групп. Данные секции, сохранение и права остаются в consumer.
|
||||||
|
|
||||||
Промежуточный loading-контейнер не должен обнулять вертикальный ритм тела
|
Промежуточный loading-контейнер не должен обнулять вертикальный ритм тела
|
||||||
@@ -343,6 +350,8 @@ Reduced motion отключает анимацию. На узком экране
|
|||||||
|
|
||||||
## ApplicationSidePanel
|
## ApplicationSidePanel
|
||||||
|
|
||||||
|
Перед кнопкой закрытия можно разместить действия через `headerActions`. Кнопка `UserProfileMenu.headerAction` принимает `pressed` и `controls` для связи с выдвижной панелью.
|
||||||
|
|
||||||
`ApplicationSidePanel` — правая application-level пара к `AdminNavigationPanel`.
|
`ApplicationSidePanel` — правая application-level пара к `AdminNavigationPanel`.
|
||||||
Она использует ту же ширину `332–352 px`, радиус, theme-aware surface, тень и
|
Она использует ту же ширину `332–352 px`, радиус, theme-aware surface, тень и
|
||||||
круглые действия, но появляется справа налево. `ApplicationShell` размещает её
|
круглые действия, но появляется справа налево. `ApplicationShell` размещает её
|
||||||
@@ -617,3 +626,14 @@ ColorField screen sampling (owner direction, 2026-11-14): the shared palette inc
|
|||||||
Floating EditorDockLayout tools honor minimumSize on restore, all eight resize edges and keyboard resize. If the available viewport is smaller, they fit that viewport; Inspector fields stack below a 330px content width instead of clipping. Tool footer is separate from the scrolling body; a Button width="full" is the canonical adaptive bottom action. The catalog's scene editor example demonstrates minimum size, a ColorField and fixed reset footer.
|
Floating EditorDockLayout tools honor minimumSize on restore, all eight resize edges and keyboard resize. If the available viewport is smaller, they fit that viewport; Inspector fields stack below a 330px content width instead of clipping. Tool footer is separate from the scrolling body; a Button width="full" is the canonical adaptive bottom action. The catalog's scene editor example demonstrates minimum size, a ColorField and fixed reset footer.
|
||||||
|
|
||||||
EditorDockLayout: every floating or actively detached tool uses context="scene" Glass V4 (shared scene tint/blur); docking removes that context and retains tiled surface/corner rules. Applies to hierarchy, layers, settings and any other editor tool. No application tint/blur overrides.
|
EditorDockLayout: every floating or actively detached tool uses context="scene" Glass V4 (shared scene tint/blur); docking removes that context and retains tiled surface/corner rules. Applies to hierarchy, layers, settings and any other editor tool. No application tint/blur overrides.
|
||||||
|
|
||||||
|
### Remembered detail windows and sortable image grids
|
||||||
|
|
||||||
|
`Window.floating/onFloatingChange` lets the host persist modal/floating mode by
|
||||||
|
window kind alongside `rect/onRectCommit`. See WINDOWS_AND_LAYERS.md.
|
||||||
|
`SortableList` and `SortableScope` accept `layout="grid"`; rectangular sorting
|
||||||
|
keeps the shared drag handle and activation threshold. The default stays vertical.
|
||||||
|
|
||||||
|
Для ручки поверх фотографии используйте `DragHandle surface="control"` или `SortableList handleSurface="control"`: видимый круг с общим стеклом внутри `nodedc-viewport-controls`. Bare-ручка остаётся вариантом по умолчанию для обычных строк.
|
||||||
|
|
||||||
|
Window `headerLayout="adaptive"` keeps contextual actions on one trailing row. The complete title moves below actions before clipping. The measured action width sets the minimum for all resize edges, keyboard resizing and restored layout; only an undersized device viewport allows horizontal action scrolling. `expanded` temporarily opens media at a moderate viewport-fitted size while retaining modal/floating presentation. Users can resize the expanded window; restoration returns the previous geometry without changing the regular rectangle. `expandedRect` / `onExpandedRectCommit` persist the user’s separate expanded position and dimensions; first expansion uses a moderate 960×800 ceiling within 80%/82% of the viewport.
|
||||||
|
|||||||
@@ -175,3 +175,13 @@ ColorField spectrum has no decorative perimeter stroke; retain its visible sampl
|
|||||||
## Focus of movable headers
|
## Focus of movable headers
|
||||||
|
|
||||||
Window, WorkspaceWindow and EditorDockLayout share the same drag-header focus contract. A pointer grab never inherits a keyboard focus ring or filled header from the previously focused input. Headers have no perimeter outline in any theme; keyboard focus uses the canonical contrasting surface. Pointer capture, focus ownership, Arrow/Shift+Arrow movement/resizing, Enter/Space docking and Escape cancellation remain unchanged. Check both direct grabbing and input → Tab → grabbing, in docked/floating and fullscreen contexts.
|
Window, WorkspaceWindow and EditorDockLayout share the same drag-header focus contract. A pointer grab never inherits a keyboard focus ring or filled header from the previously focused input. Headers have no perimeter outline in any theme; keyboard focus uses the canonical contrasting surface. Pointer capture, focus ownership, Arrow/Shift+Arrow movement/resizing, Enter/Space docking and Escape cancellation remain unchanged. Check both direct grabbing and input → Tab → grabbing, in docked/floating and fullscreen contexts.
|
||||||
|
|
||||||
|
## Remembered presentation
|
||||||
|
|
||||||
|
Entity/detail windows persist presentation **by window kind**, not title or entity ID.
|
||||||
|
The application stores `floating` and `rect` in its durable user preferences;
|
||||||
|
`Window` consumes `floating`/`onFloatingChange` and `rect`/`onRectCommit`.
|
||||||
|
Opening the next entity restores the same mode, position and size. Return to modal
|
||||||
|
keeps the last floating rectangle for the next detachment. Viewport fitting does
|
||||||
|
not overwrite saved geometry. Switching view/edit keeps the same mounted Window.
|
||||||
|
Confirmation dialogs remain modal (`allowFloating=false`) and never inherit it.
|
||||||
|
|||||||
Generated
+6
-6
@@ -28,8 +28,8 @@
|
|||||||
"version": "0.7.0",
|
"version": "0.7.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nodedc/page-patterns": "0.1.0",
|
"@nodedc/page-patterns": "0.1.0",
|
||||||
"@nodedc/ui-core": "0.7.2",
|
"@nodedc/ui-core": "0.7.4",
|
||||||
"@nodedc/ui-react": "0.7.5",
|
"@nodedc/ui-react": "0.7.10",
|
||||||
"cesium": "1.147.0",
|
"cesium": "1.147.0",
|
||||||
"react": "^19.1.0",
|
"react": "^19.1.0",
|
||||||
"react-dom": "^19.1.0"
|
"react-dom": "^19.1.0"
|
||||||
@@ -2516,7 +2516,7 @@
|
|||||||
},
|
},
|
||||||
"packages/ui-core": {
|
"packages/ui-core": {
|
||||||
"name": "@nodedc/ui-core",
|
"name": "@nodedc/ui-core",
|
||||||
"version": "0.7.2",
|
"version": "0.7.4",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nodedc/tokens": "0.6.0"
|
"@nodedc/tokens": "0.6.0"
|
||||||
}
|
}
|
||||||
@@ -2525,17 +2525,17 @@
|
|||||||
"name": "@nodedc/ui-dom",
|
"name": "@nodedc/ui-dom",
|
||||||
"version": "0.7.0",
|
"version": "0.7.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nodedc/ui-core": "0.7.2"
|
"@nodedc/ui-core": "0.7.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"packages/ui-react": {
|
"packages/ui-react": {
|
||||||
"name": "@nodedc/ui-react",
|
"name": "@nodedc/ui-react",
|
||||||
"version": "0.7.6",
|
"version": "0.7.10",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@dnd-kit/core": "^6.3.1",
|
"@dnd-kit/core": "^6.3.1",
|
||||||
"@dnd-kit/sortable": "^10.0.0",
|
"@dnd-kit/sortable": "^10.0.0",
|
||||||
"@dnd-kit/utilities": "^3.2.2",
|
"@dnd-kit/utilities": "^3.2.2",
|
||||||
"@nodedc/ui-core": "0.7.2",
|
"@nodedc/ui-core": "0.7.4",
|
||||||
"lucide-react": "^0.468.0"
|
"lucide-react": "^0.468.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nodedc/ui-core",
|
"name": "@nodedc/ui-core",
|
||||||
"version": "0.7.2",
|
"version": "0.7.4",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"files": [
|
"files": [
|
||||||
"dist",
|
"dist",
|
||||||
|
|||||||
@@ -364,7 +364,8 @@
|
|||||||
color: var(--nodedc-text-primary);
|
color: var(--nodedc-text-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.nodedc-icon-button[aria-pressed="true"] {
|
.nodedc-icon-button[aria-pressed="true"],
|
||||||
|
.nodedc-header__profile .nodedc-icon-button[aria-pressed="true"] {
|
||||||
background: var(--nodedc-glass-control-active);
|
background: var(--nodedc-glass-control-active);
|
||||||
color: var(--nodedc-glass-control-active-text);
|
color: var(--nodedc-glass-control-active-text);
|
||||||
}
|
}
|
||||||
@@ -1632,6 +1633,8 @@ textarea.nodedc-field__control {
|
|||||||
.nodedc-app-shell__end-panel {
|
.nodedc-app-shell__end-panel {
|
||||||
right: var(--nodedc-app-page-pad);
|
right: var(--nodedc-app-page-pad);
|
||||||
width: var(--nodedc-app-nav-width);
|
width: var(--nodedc-app-nav-width);
|
||||||
|
transform: translateX(calc(100% + var(--nodedc-app-page-pad)));
|
||||||
|
transition: transform var(--nodedc-app-navigation-motion), visibility 0s linear 440ms;
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
@@ -1642,6 +1645,8 @@ textarea.nodedc-field__control {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.nodedc-app-shell[data-end-panel-open="true"] .nodedc-app-shell__end-panel {
|
.nodedc-app-shell[data-end-panel-open="true"] .nodedc-app-shell__end-panel {
|
||||||
|
transform: translateX(0);
|
||||||
|
transition-delay: 0s;
|
||||||
visibility: visible;
|
visibility: visible;
|
||||||
pointer-events: auto;
|
pointer-events: auto;
|
||||||
}
|
}
|
||||||
@@ -4885,3 +4890,32 @@ textarea.nodedc-field__control {
|
|||||||
background: transparent;
|
background: transparent;
|
||||||
color: var(--nodedc-text-primary);
|
color: var(--nodedc-text-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Directly editable detail copy: no permanent field plate. */
|
||||||
|
.nodedc-field--unlabelled > .nodedc-field__label-row {display:none;}
|
||||||
|
.nodedc-field--plain {gap:0;}
|
||||||
|
.nodedc-field--plain .nodedc-field__control {
|
||||||
|
min-height:0; padding:0; border-radius:var(--nodedc-radius-control-compact);
|
||||||
|
background:transparent; box-shadow:none; color:inherit; font:inherit; line-height:inherit;
|
||||||
|
}
|
||||||
|
.nodedc-field--plain .nodedc-field__control:focus-visible {background:var(--nodedc-focus-surface);}
|
||||||
|
.nodedc-field--plain textarea.nodedc-field__control {resize:none;overflow:hidden;}
|
||||||
|
.nodedc-drag-handle[data-surface="control"] {background:var(--nodedc-glass-control-bg);color:var(--nodedc-text-primary);}
|
||||||
|
:is(.nodedc-viewport-controls,.nodedc-scene-controls) .nodedc-drag-handle[data-surface="control"] {
|
||||||
|
background:rgb(var(--nodedc-modal-glass-tint-rgb) / var(--nodedc-scene-glass-opacity));
|
||||||
|
backdrop-filter:blur(var(--nodedc-scene-glass-blur)) saturate(var(--nodedc-modal-glass-saturation));
|
||||||
|
-webkit-backdrop-filter:blur(var(--nodedc-scene-glass-blur)) saturate(var(--nodedc-modal-glass-saturation));
|
||||||
|
}
|
||||||
|
.nodedc-drag-handle[data-surface="control"]:hover {background:var(--nodedc-glass-control-hover);}
|
||||||
|
|
||||||
|
/* An adaptive action row defines the minimum resizable width. */
|
||||||
|
.nodedc-window[data-header-layout="adaptive"]>.nodedc-window__head>.nodedc-window__actions{flex-wrap:nowrap;width:max-content;max-width:100%;justify-self:end;overflow-x:auto}
|
||||||
|
.nodedc-window[data-header-stacked="true"]>.nodedc-window__head{grid-template-columns:minmax(0,1fr)}
|
||||||
|
.nodedc-window[data-header-stacked="true"]>.nodedc-window__head>.nodedc-window__actions{grid-row:1}
|
||||||
|
.nodedc-window[data-header-stacked="true"]>.nodedc-window__head>.nodedc-window__titles{grid-row:2}
|
||||||
|
|
||||||
|
.nodedc-window[data-header-layout="adaptive"]>.nodedc-window__head>.nodedc-window__actions>*{flex-shrink:0}
|
||||||
|
|
||||||
|
@media (prefers-reduced-motion: reduce) {
|
||||||
|
.nodedc-app-shell__end-panel { transition: none; }
|
||||||
|
}
|
||||||
|
|||||||
@@ -20,6 +20,6 @@
|
|||||||
"typecheck": "tsc -p tsconfig.json --noEmit"
|
"typecheck": "tsc -p tsconfig.json --noEmit"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nodedc/ui-core": "0.7.2"
|
"@nodedc/ui-core": "0.7.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nodedc/ui-react",
|
"name": "@nodedc/ui-react",
|
||||||
"version": "0.7.6",
|
"version": "0.7.10",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"files": [
|
"files": [
|
||||||
"dist"
|
"dist"
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
"@dnd-kit/core": "^6.3.1",
|
"@dnd-kit/core": "^6.3.1",
|
||||||
"@dnd-kit/sortable": "^10.0.0",
|
"@dnd-kit/sortable": "^10.0.0",
|
||||||
"@dnd-kit/utilities": "^3.2.2",
|
"@dnd-kit/utilities": "^3.2.2",
|
||||||
"@nodedc/ui-core": "0.7.2",
|
"@nodedc/ui-core": "0.7.4",
|
||||||
"lucide-react": "^0.468.0"
|
"lucide-react": "^0.468.0"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ export interface ApplicationSidePanelProps extends Omit<HTMLAttributes<HTMLEleme
|
|||||||
title: ReactNode;
|
title: ReactNode;
|
||||||
description?: ReactNode;
|
description?: ReactNode;
|
||||||
closeLabel?: string;
|
closeLabel?: string;
|
||||||
|
headerActions?: ReactNode;
|
||||||
footer?: ReactNode;
|
footer?: ReactNode;
|
||||||
onClose: () => void;
|
onClose: () => void;
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
@@ -23,6 +24,7 @@ export function ApplicationSidePanel({
|
|||||||
title,
|
title,
|
||||||
description,
|
description,
|
||||||
closeLabel = "Закрыть панель",
|
closeLabel = "Закрыть панель",
|
||||||
|
headerActions,
|
||||||
footer,
|
footer,
|
||||||
onClose,
|
onClose,
|
||||||
children,
|
children,
|
||||||
@@ -42,6 +44,7 @@ export function ApplicationSidePanel({
|
|||||||
{description ? <span className="nodedc-application-side-panel__description">{description}</span> : null}
|
{description ? <span className="nodedc-application-side-panel__description">{description}</span> : null}
|
||||||
</div>
|
</div>
|
||||||
<div className="nodedc-admin-panel__head-actions">
|
<div className="nodedc-admin-panel__head-actions">
|
||||||
|
{headerActions}
|
||||||
<button type="button" className="nodedc-admin-panel__close" aria-label={closeLabel} onClick={onClose}>
|
<button type="button" className="nodedc-admin-panel__close" aria-label={closeLabel} onClick={onClose}>
|
||||||
<Icon name="close" size={16} strokeWidth={1.6} />
|
<Icon name="close" size={16} strokeWidth={1.6} />
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import {
|
|||||||
arrayMove,
|
arrayMove,
|
||||||
useSortable,
|
useSortable,
|
||||||
verticalListSortingStrategy,
|
verticalListSortingStrategy,
|
||||||
|
rectSortingStrategy,
|
||||||
} from "@dnd-kit/sortable";
|
} from "@dnd-kit/sortable";
|
||||||
import { CSS } from "@dnd-kit/utilities";
|
import { CSS } from "@dnd-kit/utilities";
|
||||||
import { cn } from "./cn.js";
|
import { cn } from "./cn.js";
|
||||||
@@ -51,8 +52,9 @@ const copyRect = (rect: DragRect | null | undefined): DragRect | undefined => re
|
|||||||
height: rect.height,
|
height: rect.height,
|
||||||
}) : undefined;
|
}) : undefined;
|
||||||
|
|
||||||
export function DragHandle({ label = "Перетащить", listeners, attributes, className }: {
|
export function DragHandle({ label = "Перетащить", listeners, attributes, className, surface="none" }: {
|
||||||
label?: string;
|
label?: string;
|
||||||
|
surface?: "none" | "control";
|
||||||
listeners?: ReturnType<typeof useDraggable>["listeners"];
|
listeners?: ReturnType<typeof useDraggable>["listeners"];
|
||||||
attributes?: ReturnType<typeof useDraggable>["attributes"];
|
attributes?: ReturnType<typeof useDraggable>["attributes"];
|
||||||
className?: string;
|
className?: string;
|
||||||
@@ -61,6 +63,7 @@ export function DragHandle({ label = "Перетащить", listeners, attribut
|
|||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className={cn("nodedc-drag-handle", className)}
|
className={cn("nodedc-drag-handle", className)}
|
||||||
|
data-surface={surface}
|
||||||
aria-label={label}
|
aria-label={label}
|
||||||
{...attributes}
|
{...attributes}
|
||||||
{...listeners}
|
{...listeners}
|
||||||
@@ -120,31 +123,36 @@ export function DropZone({ id, data, className, children }: { id: string; data?:
|
|||||||
return <div ref={setNodeRef} className={cn(className, isOver && "is-drag-over")}>{children}</div>;
|
return <div ref={setNodeRef} className={cn(className, isOver && "is-drag-over")}>{children}</div>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function SortableScope({ ids, children }: { ids: string[]; children: ReactNode }) {
|
const SortableLayoutContext=createContext<"list"|"grid">("list");
|
||||||
return <SortableContext items={ids} strategy={verticalListSortingStrategy}>{children}</SortableContext>;
|
export function SortableScope({ ids, children, layout="list" }: { ids: string[]; children: ReactNode; layout?:"list"|"grid" }) {
|
||||||
|
return <SortableLayoutContext.Provider value={layout}><SortableContext items={ids} strategy={layout==="grid"?rectSortingStrategy:verticalListSortingStrategy}>{children}</SortableContext></SortableLayoutContext.Provider>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function SortableItem({ id, data, className, children }: {
|
export function SortableItem({ id, data, className, children, handleSurface="none" }: {
|
||||||
id: string;
|
id: string;
|
||||||
|
handleSurface?: "none" | "control";
|
||||||
data?: NodedcDragData;
|
data?: NodedcDragData;
|
||||||
className?: string;
|
className?: string;
|
||||||
children: (state: { handle: ReactNode; isDragging: boolean }) => ReactNode;
|
children: (state: { handle: ReactNode; isDragging: boolean }) => ReactNode;
|
||||||
}) {
|
}) {
|
||||||
const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({ id, data });
|
const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({ id, data });
|
||||||
const verticalTransform = transform ? { ...transform, x: 0 } : null;
|
const layout=useContext(SortableLayoutContext);
|
||||||
|
const verticalTransform = transform && layout!=="grid" ? { ...transform, x: 0 } : transform;
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
ref={setNodeRef}
|
ref={setNodeRef}
|
||||||
className={cn(className, isDragging && "is-dragging")}
|
className={cn(className, isDragging && "is-dragging")}
|
||||||
style={{ transform: CSS.Transform.toString(verticalTransform), transition, opacity: isDragging ? 0.65 : undefined }}
|
style={{ transform: CSS.Transform.toString(verticalTransform), transition, opacity: isDragging ? 0.65 : undefined }}
|
||||||
>
|
>
|
||||||
{children({ handle: <DragHandle listeners={listeners} attributes={attributes} />, isDragging })}
|
{children({ handle: <DragHandle surface={handleSurface} listeners={listeners} attributes={attributes} />, isDragging })}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function SortableList<T>({ items, getId, className, onReorder, children }: {
|
export function SortableList<T>({ items, getId, className, onReorder, children, layout="list", handleSurface="none" }: {
|
||||||
items: T[];
|
items: T[];
|
||||||
|
handleSurface?: "none" | "control";
|
||||||
|
layout?: "list" | "grid";
|
||||||
getId: (item: T) => string;
|
getId: (item: T) => string;
|
||||||
className?: string;
|
className?: string;
|
||||||
onReorder: (items: T[]) => void;
|
onReorder: (items: T[]) => void;
|
||||||
@@ -158,10 +166,10 @@ export function SortableList<T>({ items, getId, className, onReorder, children }
|
|||||||
const to = ids.indexOf(overId);
|
const to = ids.indexOf(overId);
|
||||||
if (from >= 0 && to >= 0) onReorder(arrayMove(items, from, to));
|
if (from >= 0 && to >= 0) onReorder(arrayMove(items, from, to));
|
||||||
}}>
|
}}>
|
||||||
<SortableScope ids={ids}>
|
<SortableScope ids={ids} layout={layout}>
|
||||||
<div className={className}>
|
<div className={className}>
|
||||||
{items.map((item) => (
|
{items.map((item) => (
|
||||||
<SortableItem key={getId(item)} id={getId(item)}>
|
<SortableItem key={getId(item)} id={getId(item)} handleSurface={handleSurface}>
|
||||||
{(state) => children(item, state)}
|
{(state) => children(item, state)}
|
||||||
</SortableItem>
|
</SortableItem>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useId, type InputHTMLAttributes, type ReactNode, type TextareaHTMLAttributes } from "react";
|
import { useId, useLayoutEffect, useRef, type InputHTMLAttributes, type ReactNode, type TextareaHTMLAttributes } from "react";
|
||||||
import { cn } from "./cn.js";
|
import { cn } from "./cn.js";
|
||||||
|
|
||||||
export interface FieldFrameProps {
|
export interface FieldFrameProps {
|
||||||
@@ -29,6 +29,8 @@ export interface TextFieldProps extends InputHTMLAttributes<HTMLInputElement> {
|
|||||||
hint?: string;
|
hint?: string;
|
||||||
description?: string;
|
description?: string;
|
||||||
fieldClassName?: string;
|
fieldClassName?: string;
|
||||||
|
/** Plain text appearance for directly editable detail content. Keep an accessible name. */
|
||||||
|
appearance?: "default" | "plain";
|
||||||
}
|
}
|
||||||
|
|
||||||
export function TextField({
|
export function TextField({
|
||||||
@@ -36,6 +38,7 @@ export function TextField({
|
|||||||
hint,
|
hint,
|
||||||
description,
|
description,
|
||||||
fieldClassName,
|
fieldClassName,
|
||||||
|
appearance = "default",
|
||||||
className,
|
className,
|
||||||
id,
|
id,
|
||||||
...props
|
...props
|
||||||
@@ -43,7 +46,7 @@ export function TextField({
|
|||||||
const generatedId = useId();
|
const generatedId = useId();
|
||||||
const controlId = id ?? generatedId;
|
const controlId = id ?? generatedId;
|
||||||
return (
|
return (
|
||||||
<FieldFrame label={label} hint={hint} description={description} htmlFor={controlId} className={fieldClassName}>
|
<FieldFrame label={label} hint={hint} description={description} htmlFor={controlId} className={cn(fieldClassName, appearance === "plain" && "nodedc-field--plain", !label && "nodedc-field--unlabelled")}>
|
||||||
<input id={controlId} className={cn("nodedc-field__control", className)} {...props} />
|
<input id={controlId} className={cn("nodedc-field__control", className)} {...props} />
|
||||||
</FieldFrame>
|
</FieldFrame>
|
||||||
);
|
);
|
||||||
@@ -54,6 +57,8 @@ export interface TextAreaFieldProps extends TextareaHTMLAttributes<HTMLTextAreaE
|
|||||||
hint?: string;
|
hint?: string;
|
||||||
description?: string;
|
description?: string;
|
||||||
fieldClassName?: string;
|
fieldClassName?: string;
|
||||||
|
/** Plain text appearance for directly editable detail content. Keep an accessible name. */
|
||||||
|
appearance?: "default" | "plain";
|
||||||
}
|
}
|
||||||
|
|
||||||
export function TextAreaField({
|
export function TextAreaField({
|
||||||
@@ -61,15 +66,29 @@ export function TextAreaField({
|
|||||||
hint,
|
hint,
|
||||||
description,
|
description,
|
||||||
fieldClassName,
|
fieldClassName,
|
||||||
|
appearance = "default",
|
||||||
className,
|
className,
|
||||||
id,
|
id,
|
||||||
...props
|
...props
|
||||||
}: TextAreaFieldProps) {
|
}: TextAreaFieldProps) {
|
||||||
const generatedId = useId();
|
const generatedId = useId();
|
||||||
const controlId = id ?? generatedId;
|
const controlId = id ?? generatedId;
|
||||||
|
const area = useRef<HTMLTextAreaElement>(null);
|
||||||
|
useLayoutEffect(() => {
|
||||||
|
const el = area.current;
|
||||||
|
if (!el || appearance !== "plain") return;
|
||||||
|
const resize = () => { el.style.height = "auto"; el.style.height = el.scrollHeight + "px"; };
|
||||||
|
resize();
|
||||||
|
let width = el.clientWidth;
|
||||||
|
const observer = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(() => {
|
||||||
|
if (el.clientWidth !== width) { width = el.clientWidth; resize(); }
|
||||||
|
});
|
||||||
|
observer?.observe(el);
|
||||||
|
return () => observer?.disconnect();
|
||||||
|
}, [appearance, props.value]);
|
||||||
return (
|
return (
|
||||||
<FieldFrame label={label} hint={hint} description={description} htmlFor={controlId} className={fieldClassName}>
|
<FieldFrame label={label} hint={hint} description={description} htmlFor={controlId} className={cn(fieldClassName, appearance === "plain" && "nodedc-field--plain", !label && "nodedc-field--unlabelled")}>
|
||||||
<textarea id={controlId} className={cn("nodedc-field__control", className)} {...props} />
|
<textarea ref={area} id={controlId} className={cn("nodedc-field__control", className)} {...props} />
|
||||||
</FieldFrame>
|
</FieldFrame>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useEffect, useRef, type HTMLAttributes } from "react";
|
import { createContext, useContext, useEffect, useRef, type HTMLAttributes, type ReactNode } from "react";
|
||||||
import { createPortal } from "react-dom";
|
import { createPortal } from "react-dom";
|
||||||
import { cn } from "./cn.js";
|
import { cn } from "./cn.js";
|
||||||
import { Icon, type IconName } from "./Icon.js";
|
import { Icon, type IconName } from "./Icon.js";
|
||||||
@@ -13,6 +13,13 @@ export type ToastItem = {
|
|||||||
durationMs?: number | null;
|
durationMs?: number | null;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const ToastObservation = createContext<((items: ToastItem[]) => void) | null>(null);
|
||||||
|
|
||||||
|
/** The application owns history/storage; this only reports terminal presentations. */
|
||||||
|
export function ToastObserver({onPresent, children}: {onPresent: (items: ToastItem[]) => void; children: ReactNode}) {
|
||||||
|
return <ToastObservation.Provider value={onPresent}>{children}</ToastObservation.Provider>;
|
||||||
|
}
|
||||||
|
|
||||||
const toastIcons: Record<ToastTone, IconName> = {
|
const toastIcons: Record<ToastTone, IconName> = {
|
||||||
success: "check",
|
success: "check",
|
||||||
error: "alert",
|
error: "alert",
|
||||||
@@ -69,7 +76,21 @@ function TimedToastCard({ item, onDismiss }: { item: ToastItem; onDismiss: (id:
|
|||||||
return <ToastCard item={item} onDismiss={onDismiss} />;
|
return <ToastCard item={item} onDismiss={onDismiss} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function ToastStack({ items, onDismiss }: { items: ToastItem[]; onDismiss: (id: string) => void }) {
|
export function ToastStack({ items, onDismiss, observe = true }: { items: ToastItem[]; onDismiss: (id: string) => void; observe?: boolean }) {
|
||||||
|
const observer = useContext(ToastObservation);
|
||||||
|
const presented = useRef(new Map<string, string>());
|
||||||
|
useEffect(() => {
|
||||||
|
const next = new Map<string, string>();
|
||||||
|
const fresh: ToastItem[] = [];
|
||||||
|
for (const item of items) {
|
||||||
|
if (item.tone === 'loading') continue;
|
||||||
|
const identity = JSON.stringify([item.tone, item.title, item.description]);
|
||||||
|
next.set(item.id, identity);
|
||||||
|
if (presented.current.get(item.id) !== identity) fresh.push(item);
|
||||||
|
}
|
||||||
|
presented.current = next;
|
||||||
|
if (observe && fresh.length) observer?.(fresh);
|
||||||
|
}, [items, observer, observe]);
|
||||||
if (typeof document === "undefined" || items.length === 0) return null;
|
if (typeof document === "undefined" || items.length === 0) return null;
|
||||||
return createPortal(
|
return createPortal(
|
||||||
<div className="nodedc-toast-viewport nodedc-ui-root" aria-live="polite" aria-relevant="additions removals">
|
<div className="nodedc-toast-viewport nodedc-ui-root" aria-live="polite" aria-relevant="additions removals">
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ export interface UserProfileMenuProps {
|
|||||||
triggerLabel?: ReactNode;
|
triggerLabel?: ReactNode;
|
||||||
/** Optional status glyph between the label and avatar. */
|
/** Optional status glyph between the label and avatar. */
|
||||||
triggerIcon?: IconName;
|
triggerIcon?: IconName;
|
||||||
|
/** Independent header action; the avatar still opens the profile menu. */
|
||||||
|
headerAction?: { label: string; pressed?: boolean; controls?: string; onSelect: () => void };
|
||||||
actions: readonly UserProfileMenuAction[];
|
actions: readonly UserProfileMenuAction[];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -35,6 +37,7 @@ export function UserProfileMenu({
|
|||||||
coverImageUrl,
|
coverImageUrl,
|
||||||
triggerLabel,
|
triggerLabel,
|
||||||
triggerIcon,
|
triggerIcon,
|
||||||
|
headerAction,
|
||||||
actions,
|
actions,
|
||||||
}: UserProfileMenuProps) {
|
}: UserProfileMenuProps) {
|
||||||
const label = displayName || "NODE.DC";
|
const label = displayName || "NODE.DC";
|
||||||
@@ -51,11 +54,15 @@ export function UserProfileMenu({
|
|||||||
</HeaderProfileButton>
|
</HeaderProfileButton>
|
||||||
<IconButton
|
<IconButton
|
||||||
ref={setTriggerRef}
|
ref={setTriggerRef}
|
||||||
label={`Меню пользователя ${label}`}
|
label={headerAction?.label ?? `Меню пользователя ${label}`}
|
||||||
aria-haspopup="menu"
|
aria-haspopup={headerAction ? undefined : "menu"}
|
||||||
aria-expanded={open}
|
aria-pressed={headerAction?.pressed}
|
||||||
aria-controls={surfaceId}
|
aria-expanded={headerAction ? headerAction.pressed : open}
|
||||||
onClick={(event) => { setTriggerRef(event.currentTarget); toggle(); }}
|
aria-controls={headerAction ? headerAction.controls : surfaceId}
|
||||||
|
onClick={(event) => {
|
||||||
|
if (headerAction) { if (open) toggle(); headerAction.onSelect(); }
|
||||||
|
else { setTriggerRef(event.currentTarget); toggle(); }
|
||||||
|
}}
|
||||||
><Icon name={triggerIcon ?? "inbox"} size={20} strokeWidth={1.7} /></IconButton>
|
><Icon name={triggerIcon ?? "inbox"} size={20} strokeWidth={1.7} /></IconButton>
|
||||||
<button type="button" className="nodedc-user-profile-menu__trigger" aria-label={`Профиль ${label}`} aria-haspopup="menu" aria-expanded={open} aria-controls={surfaceId}
|
<button type="button" className="nodedc-user-profile-menu__trigger" aria-label={`Профиль ${label}`} aria-haspopup="menu" aria-expanded={open} aria-controls={surfaceId}
|
||||||
onClick={(event) => { setTriggerRef(event.currentTarget); toggle(); }}>
|
onClick={(event) => { setTriggerRef(event.currentTarget); toggle(); }}>
|
||||||
|
|||||||
@@ -40,6 +40,13 @@ export interface WindowProps extends Omit<HTMLAttributes<HTMLDivElement>, "title
|
|||||||
footer?: ReactNode;
|
footer?: ReactNode;
|
||||||
/** Context actions beside close, using canonical IconButton controls. */
|
/** Context actions beside close, using canonical IconButton controls. */
|
||||||
headerActions?: ReactNode;
|
headerActions?: ReactNode;
|
||||||
|
/** Keep actions on one line; place title below them when space is limited. */
|
||||||
|
headerLayout?: "inline" | "adaptive";
|
||||||
|
/** Temporarily enlarge within the viewport; restoring retains prior geometry and presentation. */
|
||||||
|
expanded?: boolean;
|
||||||
|
/** Separate durable layout for expanded media, committed only after a user gesture. */
|
||||||
|
expandedRect?: WindowRect;
|
||||||
|
onExpandedRectCommit?: (rect: WindowRect) => void;
|
||||||
/** Keep contextual actions immediately before close when requested. */
|
/** Keep contextual actions immediately before close when requested. */
|
||||||
headerActionsPlacement?: "before-move" | "before-close";
|
headerActionsPlacement?: "before-move" | "before-close";
|
||||||
size?: WindowSize;
|
size?: WindowSize;
|
||||||
@@ -59,6 +66,9 @@ export interface WindowProps extends Omit<HTMLAttributes<HTMLDivElement>, "title
|
|||||||
onRectCommit?: (rect: WindowRect) => void;
|
onRectCommit?: (rect: WindowRect) => void;
|
||||||
/** Centered windows can become modeless without remounting their contents. */
|
/** Centered windows can become modeless without remounting their contents. */
|
||||||
allowFloating?: boolean;
|
allowFloating?: boolean;
|
||||||
|
/** App-owned presentation, persisted by window kind alongside rect. */
|
||||||
|
floating?: boolean;
|
||||||
|
onFloatingChange?: (floating: boolean) => void;
|
||||||
onClose: () => void;
|
onClose: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,6 +79,10 @@ export function Window({
|
|||||||
children,
|
children,
|
||||||
footer,
|
footer,
|
||||||
headerActions,
|
headerActions,
|
||||||
|
headerLayout = "inline",
|
||||||
|
expanded = false,
|
||||||
|
expandedRect,
|
||||||
|
onExpandedRectCommit,
|
||||||
headerActionsPlacement = "before-move",
|
headerActionsPlacement = "before-move",
|
||||||
size = "md",
|
size = "md",
|
||||||
placement = "center",
|
placement = "center",
|
||||||
@@ -83,6 +97,8 @@ export function Window({
|
|||||||
rect,
|
rect,
|
||||||
onRectCommit,
|
onRectCommit,
|
||||||
allowFloating = true,
|
allowFloating = true,
|
||||||
|
floating: controlledFloating,
|
||||||
|
onFloatingChange,
|
||||||
onClose,
|
onClose,
|
||||||
className,
|
className,
|
||||||
style,
|
style,
|
||||||
@@ -94,6 +110,9 @@ export function Window({
|
|||||||
const titleId = useId();
|
const titleId = useId();
|
||||||
const descriptionId = useId();
|
const descriptionId = useId();
|
||||||
const dialogRef = useRef<HTMLDivElement>(null);
|
const dialogRef = useRef<HTMLDivElement>(null);
|
||||||
|
const minimumRef = useRef({width:320,height:200});
|
||||||
|
const [headerMinimum,setHeaderMinimum]=useState(320);
|
||||||
|
const [stackedTitle,setStackedTitle]=useState(false);
|
||||||
const portalHostRef = useRef<Element | null>(null);
|
const portalHostRef = useRef<Element | null>(null);
|
||||||
const onCloseRef = useRef(onClose);
|
const onCloseRef = useRef(onClose);
|
||||||
const dragRef = useRef<{ pointerId: number; offsetX: number; offsetY: number } | null>(null);
|
const dragRef = useRef<{ pointerId: number; offsetX: number; offsetY: number } | null>(null);
|
||||||
@@ -102,13 +121,15 @@ export function Window({
|
|||||||
const [floatingRect, setFloatingRect] = useState<WindowRect | null>(null);
|
const [floatingRect, setFloatingRect] = useState<WindowRect | null>(null);
|
||||||
const rectRef = useRef<WindowRect | null>(null);
|
const rectRef = useRef<WindowRect | null>(null);
|
||||||
const initialRectRef = useRef<WindowRect | null>(null);
|
const initialRectRef = useRef<WindowRect | null>(null);
|
||||||
|
const expansionRestoreRef = useRef<WindowRect | null>(null);
|
||||||
const commitRef = useRef(onRectCommit);
|
const commitRef = useRef(onRectCommit);
|
||||||
commitRef.current = onRectCommit;
|
// Temporary media expansion never replaces the application-owned window layout.
|
||||||
|
commitRef.current = expanded ? onExpandedRectCommit : onRectCommit;
|
||||||
const changeRect = (next: WindowRect | null) => { rectRef.current = next; setFloatingRect(next); };
|
const changeRect = (next: WindowRect | null) => { rectRef.current = next; setFloatingRect(next); };
|
||||||
const gestureChanged = useRef(false);
|
const gestureChanged = useRef(false);
|
||||||
const resizeRef = useRef<{ pointerId: number; x: number; y: number; rect: WindowRect; edge: ResizeEdge } | null>(null);
|
const resizeRef = useRef<{ pointerId: number; x: number; y: number; rect: WindowRect; edge: ResizeEdge } | null>(null);
|
||||||
const isFloating = floating && allowFloating && placement === "center";
|
const isFloating = (controlledFloating ?? floating) && allowFloating && placement === "center";
|
||||||
const freeGeometry = isFloating || (resizable && placement === "end");
|
const freeGeometry = expanded || isFloating || (resizable && placement === "end");
|
||||||
const canDrag = draggable || freeGeometry;
|
const canDrag = draggable || freeGeometry;
|
||||||
const shouldLockBodyScroll = !suspended && !isFloating && (lockBodyScroll ?? placement === "center");
|
const shouldLockBodyScroll = !suspended && !isFloating && (lockBodyScroll ?? placement === "center");
|
||||||
const shouldTrapFocus = !suspended && !isFloating && (trapFocus ?? placement === "center");
|
const shouldTrapFocus = !suspended && !isFloating && (trapFocus ?? placement === "center");
|
||||||
@@ -116,6 +137,31 @@ export function Window({
|
|||||||
modeRef.current = { shouldTrapFocus, isFloating, suspended };
|
modeRef.current = { shouldTrapFocus, isFloating, suspended };
|
||||||
onCloseRef.current = onClose;
|
onCloseRef.current = onClose;
|
||||||
|
|
||||||
|
useLayoutEffect(()=>{
|
||||||
|
if(!open || headerLayout!=="adaptive")return;
|
||||||
|
const dialog=dialogRef.current,head=dialog?.querySelector<HTMLElement>(".nodedc-window__head"),actions=head?.querySelector<HTMLElement>(".nodedc-window__actions"),heading=head?.querySelector<HTMLElement>(".nodedc-window__title");
|
||||||
|
if(!dialog||!head||!actions||!heading)return;
|
||||||
|
const measure=()=>{
|
||||||
|
const headStyle=window.getComputedStyle(head),input=heading.querySelector<HTMLInputElement>("input"),copyStyle=window.getComputedStyle(input??heading);
|
||||||
|
const sample=document.createElement("span");
|
||||||
|
Object.assign(sample.style,{position:"fixed",visibility:"hidden",pointerEvents:"none",whiteSpace:"pre",font:copyStyle.font,letterSpacing:copyStyle.letterSpacing});
|
||||||
|
sample.textContent=input?.value??heading.textContent??"";head.appendChild(sample);
|
||||||
|
const titleWidth=sample.getBoundingClientRect().width+(parseFloat(copyStyle.paddingLeft)||0)+(parseFloat(copyStyle.paddingRight)||0);sample.remove();
|
||||||
|
const padding=(parseFloat(headStyle.paddingLeft)||0)+(parseFloat(headStyle.paddingRight)||0),actionWidth=actions.scrollWidth;
|
||||||
|
const minimum=Math.max(320,Math.ceil(actionWidth+padding+2));
|
||||||
|
minimumRef.current={width:minimum,height:200};setHeaderMinimum(minimum);
|
||||||
|
setStackedTitle(head.clientWidth < padding+actionWidth+titleWidth+(parseFloat(headStyle.columnGap)||0)+2);
|
||||||
|
if(freeGeometry&&rectRef.current){
|
||||||
|
const fitted=fitWindow(rectRef.current,{width:window.innerWidth,height:window.innerHeight},minimumRef.current);
|
||||||
|
if(fitted.left!==rectRef.current.left||fitted.top!==rectRef.current.top||fitted.width!==rectRef.current.width||fitted.height!==rectRef.current.height){changeRect(fitted);if(!resizeRef.current&&!dragRef.current)commitRef.current?.(fitted);}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
measure();
|
||||||
|
const observer=typeof ResizeObserver!=="undefined"?new ResizeObserver(measure):null;
|
||||||
|
observer?.observe(head);observer?.observe(actions);window.addEventListener("resize",measure);
|
||||||
|
return()=>{observer?.disconnect();window.removeEventListener("resize",measure);};
|
||||||
|
},[open,headerLayout,title,headerActions,freeGeometry]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!open || typeof document === "undefined") return;
|
if (!open || typeof document === "undefined") return;
|
||||||
const previousActiveElement = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
const previousActiveElement = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
||||||
@@ -178,20 +224,39 @@ export function Window({
|
|||||||
}, [open, shouldLockBodyScroll]);
|
}, [open, shouldLockBodyScroll]);
|
||||||
|
|
||||||
useLayoutEffect(() => {
|
useLayoutEffect(() => {
|
||||||
if (open && freeGeometry && !dragRef.current && !resizeRef.current) {
|
if (!open) return;
|
||||||
|
const viewport={width:window.innerWidth,height:window.innerHeight};
|
||||||
|
if(expanded){
|
||||||
|
if(!expansionRestoreRef.current){
|
||||||
|
const bounds=dialogRef.current?.getBoundingClientRect();
|
||||||
|
if(bounds){
|
||||||
|
expansionRestoreRef.current=rectRef.current??{left:bounds.left,top:bounds.top,width:bounds.width,height:bounds.height};
|
||||||
|
const width=Math.min(960,viewport.width*0.8),height=Math.min(800,viewport.height*0.82);
|
||||||
|
const prior=expansionRestoreRef.current;
|
||||||
|
changeRect(fitWindow(expandedRect??{left:prior.left+(prior.width-width)/2,top:prior.top+(prior.height-height)/2,width,height},viewport,minimumRef.current));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(expansionRestoreRef.current){
|
||||||
|
changeRect(fitWindow(expansionRestoreRef.current,viewport,minimumRef.current));
|
||||||
|
expansionRestoreRef.current=null;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (freeGeometry && !dragRef.current && !resizeRef.current) {
|
||||||
// The modal move toggle already restores its local rectangle. An
|
// The modal move toggle already restores its local rectangle. An
|
||||||
// uncontrolled floating window must retain it when toggled twice.
|
// uncontrolled floating window must retain it when toggled twice.
|
||||||
if (placement === "center" && !onRectCommit && !rect && rectRef.current) return;
|
if (placement === "center" && !onRectCommit && !rect && rectRef.current) return;
|
||||||
const bounds=dialogRef.current?.getBoundingClientRect();
|
const bounds=dialogRef.current?.getBoundingClientRect();
|
||||||
if(bounds){
|
if(bounds){
|
||||||
initialRectRef.current ??= initialRect??{left:bounds.left,top:bounds.top,width:bounds.width,height:bounds.height};
|
initialRectRef.current ??= initialRect??{left:bounds.left,top:bounds.top,width:bounds.width,height:bounds.height};
|
||||||
changeRect(fitWindow(rect??initialRectRef.current,{width:window.innerWidth,height:window.innerHeight}));
|
changeRect(fitWindow(rect??initialRectRef.current,{width:window.innerWidth,height:window.innerHeight},minimumRef.current));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},[open,freeGeometry,rect?.left,rect?.top,rect?.width,rect?.height]);
|
},[open,expanded,freeGeometry,rect?.left,rect?.top,rect?.width,rect?.height]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!open) { setDragPosition(null); setFloating(false); changeRect(null); initialRectRef.current = null; dragRef.current = null; resizeRef.current = null; }
|
if (!open) { setDragPosition(null); setFloating(false); changeRect(null); initialRectRef.current = null; expansionRestoreRef.current = null; dragRef.current = null; resizeRef.current = null; }
|
||||||
}, [open]);
|
}, [open]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -200,7 +265,7 @@ export function Window({
|
|||||||
const resizing = resizeRef.current;
|
const resizing = resizeRef.current;
|
||||||
if (resizing && event.pointerId === resizing.pointerId) {
|
if (resizing && event.pointerId === resizing.pointerId) {
|
||||||
gestureChanged.current = true;
|
gestureChanged.current = true;
|
||||||
changeRect(resizeWindow(resizing.rect, resizing.edge, event.clientX - resizing.x, event.clientY - resizing.y, { width: window.innerWidth, height: window.innerHeight }));
|
changeRect(resizeWindow(resizing.rect, resizing.edge, event.clientX - resizing.x, event.clientY - resizing.y, { width: window.innerWidth, height: window.innerHeight },minimumRef.current));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const drag = dragRef.current;
|
const drag = dragRef.current;
|
||||||
@@ -209,7 +274,7 @@ export function Window({
|
|||||||
const bounds = dialog.getBoundingClientRect();
|
const bounds = dialog.getBoundingClientRect();
|
||||||
if (freeGeometry) {
|
if (freeGeometry) {
|
||||||
gestureChanged.current = true;
|
gestureChanged.current = true;
|
||||||
changeRect(fitWindow({ left: event.clientX - drag.offsetX, top: event.clientY - drag.offsetY, width: bounds.width, height: bounds.height }, { width: window.innerWidth, height: window.innerHeight }));
|
changeRect(fitWindow({ left: event.clientX - drag.offsetX, top: event.clientY - drag.offsetY, width: bounds.width, height: bounds.height }, { width: window.innerWidth, height: window.innerHeight },minimumRef.current));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const left = Math.max(8, Math.min(window.innerWidth - bounds.width - 8, event.clientX - drag.offsetX));
|
const left = Math.max(8, Math.min(window.innerWidth - bounds.width - 8, event.clientX - drag.offsetX));
|
||||||
@@ -234,10 +299,10 @@ export function Window({
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!freeGeometry || !open) return;
|
if (!freeGeometry || !open) return;
|
||||||
const fit = () => { if(rectRef.current) changeRect(fitWindow(rect ?? rectRef.current, { width: window.innerWidth, height: window.innerHeight })); };
|
const fit = () => { if(rectRef.current) changeRect(fitWindow((expanded ? expandedRect : rect) ?? rectRef.current, { width: window.innerWidth, height: window.innerHeight },minimumRef.current)); };
|
||||||
window.addEventListener("resize", fit);
|
window.addEventListener("resize", fit);
|
||||||
return () => window.removeEventListener("resize", fit);
|
return () => window.removeEventListener("resize", fit);
|
||||||
}, [freeGeometry, open, rect]);
|
}, [freeGeometry, open, rect, expanded, expandedRect]);
|
||||||
|
|
||||||
if (!open || typeof document === "undefined") return null;
|
if (!open || typeof document === "undefined") return null;
|
||||||
|
|
||||||
@@ -253,12 +318,16 @@ export function Window({
|
|||||||
if (!portalHostRef.current || !fullscreen || !dialogRef.current?.contains(fullscreen)) {
|
if (!portalHostRef.current || !fullscreen || !dialogRef.current?.contains(fullscreen)) {
|
||||||
portalHostRef.current = fullscreen ?? document.body;
|
portalHostRef.current = fullscreen ?? document.body;
|
||||||
}
|
}
|
||||||
|
const baseStyle={...style,...(headerLayout==="adaptive"?{minWidth:Math.min(headerMinimum,Math.max(1,window.innerWidth-16))}:{})};
|
||||||
return createPortal(
|
return createPortal(
|
||||||
<LoadingContext.Provider value={null}><InspectorSelectPolicyContext.Provider value={false}>
|
<LoadingContext.Provider value={null}><InspectorSelectPolicyContext.Provider value={false}>
|
||||||
<WindowSuspensionContext.Provider value={suspend}><div className="nodedc-overlay nodedc-ui-root" style={suspended ? {display:"none"} : undefined} data-placement={placement} data-floating={isFloating || undefined} onPointerDown={handleBackdropPointerDown}>
|
<WindowSuspensionContext.Provider value={suspend}><div className="nodedc-overlay nodedc-ui-root" style={suspended ? {display:"none"} : undefined} data-placement={placement} data-floating={isFloating || undefined} onPointerDown={handleBackdropPointerDown}>
|
||||||
<div
|
<div
|
||||||
ref={dialogRef}
|
ref={dialogRef}
|
||||||
className={cn("nodedc-window nodedc-glass-material nodedc-material-rim", className)}
|
className={cn("nodedc-window nodedc-glass-material nodedc-material-rim", className)}
|
||||||
|
data-expanded={expanded||undefined}
|
||||||
|
data-header-layout={headerLayout}
|
||||||
|
data-header-stacked={stackedTitle||undefined}
|
||||||
data-material="glass-v4"
|
data-material="glass-v4"
|
||||||
data-glass-context={isFloating ? "scene" : undefined}
|
data-glass-context={isFloating ? "scene" : undefined}
|
||||||
data-size={size === "md" ? undefined : size}
|
data-size={size === "md" ? undefined : size}
|
||||||
@@ -271,7 +340,7 @@ export function Window({
|
|||||||
aria-labelledby={titleId}
|
aria-labelledby={titleId}
|
||||||
aria-describedby={subtitle ? descriptionId : undefined}
|
aria-describedby={subtitle ? descriptionId : undefined}
|
||||||
tabIndex={-1}
|
tabIndex={-1}
|
||||||
style={freeGeometry && floatingRect ? { ...style, position: "fixed", ...floatingRect, right: "auto", bottom: "auto", maxWidth: "none", maxHeight: "none" } : dragPosition ? { ...style, position: "fixed", left: dragPosition.left, top: dragPosition.top, right: "auto", bottom: "auto" } : style}
|
style={freeGeometry && floatingRect ? { ...baseStyle, position: "fixed", ...floatingRect, right: "auto", bottom: "auto", maxWidth: "none", maxHeight: "none" } : dragPosition ? { ...baseStyle, position: "fixed", left: dragPosition.left, top: dragPosition.top, right: "auto", bottom: "auto" } : baseStyle}
|
||||||
{...props}
|
{...props}
|
||||||
>
|
>
|
||||||
<header
|
<header
|
||||||
@@ -285,7 +354,7 @@ export function Window({
|
|||||||
const dx = event.key === "ArrowLeft" ? -10 : event.key === "ArrowRight" ? 10 : 0;
|
const dx = event.key === "ArrowLeft" ? -10 : event.key === "ArrowRight" ? 10 : 0;
|
||||||
const dy = event.key === "ArrowUp" ? -10 : event.key === "ArrowDown" ? 10 : 0;
|
const dy = event.key === "ArrowUp" ? -10 : event.key === "ArrowDown" ? 10 : 0;
|
||||||
const bounds = { width: window.innerWidth, height: window.innerHeight };
|
const bounds = { width: window.innerWidth, height: window.innerHeight };
|
||||||
const next = event.shiftKey ? resizeWindow(floatingRect, "se", dx, dy, bounds) : fitWindow({ ...floatingRect, left: floatingRect.left + dx, top: floatingRect.top + dy }, bounds);
|
const next = event.shiftKey ? resizeWindow(floatingRect, "se", dx, dy, bounds,minimumRef.current) : fitWindow({ ...floatingRect, left: floatingRect.left + dx, top: floatingRect.top + dy }, bounds,minimumRef.current);
|
||||||
changeRect(next); commitRef.current?.(next);
|
changeRect(next); commitRef.current?.(next);
|
||||||
}}
|
}}
|
||||||
onPointerDown={(event) => {
|
onPointerDown={(event) => {
|
||||||
@@ -308,9 +377,11 @@ export function Window({
|
|||||||
dragRef.current = null; resizeRef.current = null;
|
dragRef.current = null; resizeRef.current = null;
|
||||||
if (!isFloating) {
|
if (!isFloating) {
|
||||||
const rect = dialogRef.current?.getBoundingClientRect();
|
const rect = dialogRef.current?.getBoundingClientRect();
|
||||||
if (rect) changeRect(fitWindow(rectRef.current ?? { left: rect.left, top: rect.top, width: rect.width, height: rect.height }, { width: window.innerWidth, height: window.innerHeight }));
|
if (rect) changeRect(fitWindow(rectRef.current ?? { left: rect.left, top: rect.top, width: rect.width, height: rect.height }, { width: window.innerWidth, height: window.innerHeight },minimumRef.current));
|
||||||
}
|
}
|
||||||
|
if (rectRef.current) commitRef.current?.({...rectRef.current});
|
||||||
setFloating(!isFloating);
|
setFloating(!isFloating);
|
||||||
|
onFloatingChange?.(!isFloating);
|
||||||
}}><Icon name="move" /></IconButton>}
|
}}><Icon name="move" /></IconButton>}
|
||||||
{headerActionsPlacement === "before-close" && headerActions}
|
{headerActionsPlacement === "before-close" && headerActions}
|
||||||
<button type="button" className="nodedc-window__close" aria-label={closeLabel} onClick={onClose}>
|
<button type="button" className="nodedc-window__close" aria-label={closeLabel} onClick={onClose}>
|
||||||
|
|||||||
@@ -257,7 +257,8 @@
|
|||||||
"Labels and validation copy are part of the field contract.",
|
"Labels and validation copy are part of the field contract.",
|
||||||
"Keyboard focus changes the surface and remains visible without a browser-blue outline.",
|
"Keyboard focus changes the surface and remains visible without a browser-blue outline.",
|
||||||
"Browser autofill retains the canonical field material, text and caret; keyboard focus remains visible.",
|
"Browser autofill retains the canonical field material, text and caret; keyboard focus remains visible.",
|
||||||
"FieldFrame labelPlacement=below is the compact muted caption variant for header selectors; above remains the default."
|
"FieldFrame labelPlacement=below is the compact muted caption variant for header selectors; above remains the default.",
|
||||||
|
"appearance=plain renders immediately editable detail copy without a permanent plate; empty labels require aria-label, textarea grows to content, keyboard focus remains visible."
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -464,14 +465,16 @@
|
|||||||
"A draggable inspector moves by its header and remains clamped to the viewport.",
|
"A draggable inspector moves by its header and remains clamped to the viewport.",
|
||||||
"Closing a modeless inspector is never gated by autosave; preserve the draft, close immediately and report persistence failure through ToastStack.",
|
"Closing a modeless inspector is never gated by autosave; preserve the draft, close immediately and report persistence failure through ToastStack.",
|
||||||
"Operational copy inside Window uses component typography tokens; browser-default paragraph or heading sizes are forbidden.",
|
"Operational copy inside Window uses component typography tokens; browser-default paragraph or heading sizes are forbidden.",
|
||||||
"Centered windows expose the move toggle by default; allowFloating opts a workflow out. Returning to modal restores canonical centered geometry; closing clears floating geometry.",
|
"Centered windows expose the move toggle by default; allowFloating opts a workflow out. Returning to modal restores canonical centered geometry; uncontrolled windows clear floating geometry on close.",
|
||||||
"Floating header supports arrow-key movement and Shift+arrow resizing. Bounds stay inside the viewport. Resize affordances have no hover decoration.",
|
"Floating header supports arrow-key movement and Shift+arrow resizing. Bounds stay inside the viewport. Resize affordances have no hover decoration.",
|
||||||
"Inspectors inside a Window use its full available content width.",
|
"Inspectors inside a Window use its full available content width.",
|
||||||
"End inspectors opt into resizable with an optional initialRect; existing eight edge geometry and keyboard resize are shared with floating windows.",
|
"End inspectors opt into resizable with an optional initialRect; existing eight edge geometry and keyboard resize are shared with floating windows.",
|
||||||
"Application-owned rect restores modeless window geometry on reopen and external undo/import. onRectCommit reports one completed drag/resize or keyboard step; viewport fitting never overwrites saved geometry.",
|
"Application-owned rect restores modeless window geometry on reopen and external undo/import. onRectCommit reports one completed drag/resize or keyboard step; viewport fitting never overwrites saved geometry.",
|
||||||
"Enforced operational typography: independent md/13px base for UI roots and portals; section/value text md, Description/status/error copy sm/12px, only canonical page/window titles use title/18px. Shared build-time typography contract and catalog example prevent browser-default size regressions.",
|
"Enforced operational typography: independent md/13px base for UI roots and portals; section/value text md, Description/status/error copy sm/12px, only canonical page/window titles use title/18px. Shared build-time typography contract and catalog example prevent browser-default size regressions.",
|
||||||
"Drag headers never draw perimeter outlines or inherit keyboard-focus fill on pointer grab. Keyboard focus remains visible through the canonical surface; arrows, Shift+arrows and docking shortcuts remain available.",
|
"Drag headers never draw perimeter outlines or inherit keyboard-focus fill on pointer grab. Keyboard focus remains visible through the canonical surface; arrows, Shift+arrows and docking shortcuts remain available.",
|
||||||
"Detached center windows automatically use scene Glass V4; fixed confirmations opt out of detachment with allowFloating=false. Unsaved profile confirmation is owned by the application."
|
"Detached center windows automatically use scene Glass V4; fixed confirmations opt out of detachment with allowFloating=false. Unsaved profile confirmation is owned by the application.",
|
||||||
|
"floating/onFloatingChange and rect/onRectCommit allow durable application-owned presentation by window kind, independent of the currently displayed entity. Reopening restores mode and fitted geometry. Fixed confirmations do not inherit this state.",
|
||||||
|
"Adaptive headers keep actions on one row, place the full title below before clipping, and derive the resize minimum from actual actions. Expanded media opens at a moderate size and remains resizable. Separate expandedRect/onExpandedRectCommit preferences restore its user-chosen position and dimensions; returning restores regular geometry."
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -705,6 +708,7 @@
|
|||||||
"behavior": [
|
"behavior": [
|
||||||
"portal dropdown",
|
"portal dropdown",
|
||||||
"profile identity card",
|
"profile identity card",
|
||||||
|
"optional pressed state and controlled region on independent header action; its selected circle and glyph use the active IconButton colors, including on hover",
|
||||||
"theme-independent cover",
|
"theme-independent cover",
|
||||||
"action links and callbacks",
|
"action links and callbacks",
|
||||||
"outside pointer and Escape close",
|
"outside pointer and Escape close",
|
||||||
@@ -714,7 +718,8 @@
|
|||||||
"The component owns menu geometry and profile presentation; the application owns settings, profile and logout actions.",
|
"The component owns menu geometry and profile presentation; the application owns settings, profile and logout actions.",
|
||||||
"Use the existing Dropdown engine so the menu is never clipped by the fixed application header.",
|
"Use the existing Dropdown engine so the menu is never clipped by the fixed application header.",
|
||||||
"Do not embed product permissions or sharing rules in the visual menu.",
|
"Do not embed product permissions or sharing rules in the visual menu.",
|
||||||
"The default header composes HeaderProfileButton, an independent menu IconButton and HeaderAvatar using the existing header geometry. Application settings belong inside this menu; do not add an adjacent settings button or another HeaderProfile wrapper."
|
"The default header composes HeaderProfileButton, an independent menu IconButton and HeaderAvatar using the existing header geometry. Application settings belong inside this menu; do not add an adjacent settings button or another HeaderProfile wrapper.",
|
||||||
|
"Optional headerAction separates the middle icon action from the avatar/profile trigger; without it legacy behavior is preserved."
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -905,7 +910,7 @@
|
|||||||
"nodedc-application-side-panel",
|
"nodedc-application-side-panel",
|
||||||
"nodedc-app-shell__end-panel"
|
"nodedc-app-shell__end-panel"
|
||||||
],
|
],
|
||||||
"summary": "Theme-aware trailing application panel paired with AdminNavigationPanel and hosted in a separate ApplicationShell end column.",
|
"summary": "Theme-aware trailing application panel with optional header actions before close, hosted in a separate ApplicationShell end column.",
|
||||||
"anatomy": [
|
"anatomy": [
|
||||||
"eyebrow and title",
|
"eyebrow and title",
|
||||||
"optional description",
|
"optional description",
|
||||||
@@ -1010,7 +1015,8 @@
|
|||||||
"ToastCard",
|
"ToastCard",
|
||||||
"ToastStack",
|
"ToastStack",
|
||||||
"ToastItem",
|
"ToastItem",
|
||||||
"ToastTone"
|
"ToastTone",
|
||||||
|
"ToastObserver"
|
||||||
],
|
],
|
||||||
"domContract": [
|
"domContract": [
|
||||||
"nodedc-toast-viewport",
|
"nodedc-toast-viewport",
|
||||||
@@ -1038,7 +1044,8 @@
|
|||||||
"Errors and status copy use the compact Toast typography; consumers do not substitute browser-default paragraphs or title-sized text.",
|
"Errors and status copy use the compact Toast typography; consumers do not substitute browser-default paragraphs or title-sized text.",
|
||||||
"Adding or updating another notification never restarts the lifetime of an existing item; each item owns its timer by stable id.",
|
"Adding or updating another notification never restarts the lifetime of an existing item; each item owns its timer by stable id.",
|
||||||
"Loading notifications remain until the operation updates or dismisses them.",
|
"Loading notifications remain until the operation updates or dismisses them.",
|
||||||
"Status notifications never replace a blocking confirmation modal."
|
"Status notifications never replace a blocking confirmation modal.",
|
||||||
|
"ToastObserver reports new or changed terminal presentations to the consumer; storage and history belong to the application. Set observe=false for server-originated items already recorded in history."
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1126,7 +1133,9 @@
|
|||||||
"A reordered application page array is the single source of truth for both composition and navigation order.",
|
"A reordered application page array is the single source of truth for both composition and navigation order.",
|
||||||
"Optional renderOverlay portals the drag preview above scroll clipping without moving source layout; cancellation clears it.",
|
"Optional renderOverlay portals the drag preview above scroll clipping without moving source layout; cancellation clears it.",
|
||||||
"Pointer drops report client coordinates for consumer-owned canvas hit testing; dropping on empty space never implies an object target.",
|
"Pointer drops report client coordinates for consumer-owned canvas hit testing; dropping on empty space never implies an object target.",
|
||||||
"DraggableItem exposes activator attributes/listeners for whole-tile dragging without a separate handle; the same activation threshold distinguishes clicks from drags."
|
"DraggableItem exposes activator attributes/listeners for whole-tile dragging without a separate handle; the same activation threshold distinguishes clicks from drags.",
|
||||||
|
"SortableList/SortableScope layout=grid uses rectangular sorting and two-axis movement with the same handle-only interaction; list remains vertical by default.",
|
||||||
|
"DragHandle surface=control and SortableList handleSurface=control put the grip in a visible circle; viewport contexts use the shared glass material."
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user