Compare commits
48
Commits
972944e6f2
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bd08ac46f5 | ||
|
|
bcc121e7b2 | ||
|
|
13309f3209 | ||
|
|
d96eba824a | ||
|
|
6bf22988c5 | ||
|
|
3473cd9ef1 | ||
|
|
753d4d6edc | ||
|
|
533723883d | ||
|
|
8539a211ed | ||
|
|
872f01cd27 | ||
|
|
f4e7369eec | ||
|
|
f8aa8022f1 | ||
|
|
ae82c01049 | ||
|
|
d0648014f5 | ||
|
|
4390d1350d | ||
|
|
fea966a3f0 | ||
|
|
8b49296efa | ||
|
|
70d5d8b385 | ||
|
|
cb49932706 | ||
|
|
5f93defabf | ||
|
|
d7885fe098 | ||
|
|
d8ed37e09d | ||
|
|
9a00d0bb06 | ||
|
|
616ec9160a | ||
|
|
1cc360f99a | ||
|
|
31ed774529 | ||
|
|
6f2f9644fe | ||
|
|
91a5ebe8da | ||
|
|
ce1b707348 | ||
|
|
64908711a4 | ||
|
|
3d4c4aaa08 | ||
|
|
541fb2a2c3 | ||
|
|
1326ec6cc9 | ||
|
|
1ec17b3098 | ||
|
|
661ca2afd2 | ||
|
|
59411f4937 | ||
|
|
601ca62e9a | ||
|
|
633b0db7b3 | ||
|
|
189bb70377 | ||
|
|
3750a94200 | ||
|
|
06cb8ad4cd | ||
|
|
55fa5fa6bc | ||
|
|
fdc93a3136 | ||
|
|
8addef187b | ||
|
|
4904fbe1f7 | ||
|
|
be929f9d8e | ||
|
|
8ff33a6a17 | ||
|
|
bbbfa8912f |
@@ -12,6 +12,8 @@ Before adding UI to a NODE.DC application:
|
|||||||
|
|
||||||
Canonical source limits:
|
Canonical source limits:
|
||||||
|
|
||||||
|
- Mission Core is the owner-approved dark-theme reference (2026-11-05). Its audited palette and shared operator presentation are maintained here; apps consume `missionDarkTheme`, not copied CSS.
|
||||||
|
|
||||||
- Launcher/Hub, CMS and SEO are the reference product family for application shell, headers, windows and common controls.
|
- Launcher/Hub, CMS and SEO are the reference product family for application shell, headers, windows and common controls.
|
||||||
- From Engine, only the redesigned environment settings, shared glass controls and NDC agent inspector are approved reference sources.
|
- From Engine, only the redesigned environment settings, shared glass controls and NDC agent inspector are approved reference sources.
|
||||||
- Legacy Engine inspectors and legacy Engine plates are explicitly non-canonical.
|
- Legacy Engine inspectors and legacy Engine plates are explicitly non-canonical.
|
||||||
@@ -37,3 +39,8 @@ All subagent work in this repository follows
|
|||||||
deploy, install dependencies or expand their own scope.
|
deploy, install dependencies or expand their own scope.
|
||||||
- Do not invent per-agent token measurements. Report measured usage only when the
|
- Do not invent per-agent token measurements. Report measured usage only when the
|
||||||
product exposes it; otherwise report model, task, state, turns and outcome.
|
product exposes it; otherwise report model, task, state, turns and outcome.
|
||||||
|
|
||||||
|
|
||||||
|
## Enforced compact typography
|
||||||
|
|
||||||
|
Operational values/section headings use md (13 px), explanatory/status/error copy uses Description/sm (12 px). Only canonical window/page title roles use title (18 px). Do not add browser-default paragraphs, local larger sizes, font shorthand or inline fontSize. Typography checks are mandatory build gates; never extend the frozen compact legacy baseline or generalize scene/display exceptions to satisfy a feature. Run the typography contract tests and verify computed sizes in centered/floating and narrow windows. See Design Guideline docs/OPERATIONAL_TYPOGRAPHY.md.
|
||||||
|
|||||||
@@ -6,13 +6,14 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite --host 127.0.0.1",
|
"dev": "vite --host 127.0.0.1",
|
||||||
"build": "tsc -b && vite build",
|
"build": "tsc -b && vite build",
|
||||||
"typecheck": "tsc -b --pretty false"
|
"typecheck": "tsc -b --pretty false",
|
||||||
|
"prebuild": "node --test ../../scripts/operational-typography.test.mjs"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nodedc/page-patterns": "0.1.0",
|
"@nodedc/page-patterns": "0.1.0",
|
||||||
"@nodedc/ui-core": "0.7.0",
|
"@nodedc/ui-core": "0.7.4",
|
||||||
"@nodedc/ui-react": "0.7.0",
|
"@nodedc/ui-react": "0.7.10",
|
||||||
"cesium": "^1.143.0",
|
"cesium": "1.147.0",
|
||||||
"react": "^19.1.0",
|
"react": "^19.1.0",
|
||||||
"react-dom": "^19.1.0"
|
"react-dom": "^19.1.0"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,14 +1,19 @@
|
|||||||
|
import { OperationalTypographyDemo } from "./OperationalTypographyDemo";
|
||||||
|
import { ModalSizeExample } from './ModalSizeExample';
|
||||||
import { useCallback, useEffect, useMemo, useRef, useState, type CSSProperties, type ReactNode } from "react";
|
import { useCallback, useEffect, useMemo, useRef, useState, type CSSProperties, type ReactNode } from "react";
|
||||||
import { applyGlassMaterial, applyNodedcTheme, defaultGlassMaterial, type GlassMaterialSettings, type NodedcTheme, type RgbTuple } from "@nodedc/ui-core";
|
import { applyGlassMaterial, applyNodedcTheme, defaultGlassMaterial, type GlassMaterialSettings, type NodedcTheme, type RgbTuple } from "@nodedc/ui-core";
|
||||||
import { createTemplateFeatures, getPageTemplate, pageTemplates, type PageTemplateDefinition } from "@nodedc/page-patterns";
|
import { createTemplateFeatures, getPageTemplate, pageTemplates, type PageTemplateDefinition } from "@nodedc/page-patterns";
|
||||||
|
import {MissionThemeExample} from './MissionThemeExample';
|
||||||
import {EditorDockExample} from './EditorDockExample';
|
import {EditorDockExample} from './EditorDockExample';
|
||||||
import {
|
import {
|
||||||
ActivityIndicator,
|
ActivityIndicator,
|
||||||
|
Tooltip,
|
||||||
LoadingRegion,
|
LoadingRegion,
|
||||||
Description,
|
Description,
|
||||||
ComparisonTable,
|
ComparisonTable,
|
||||||
StatusBadge,
|
StatusBadge,
|
||||||
ProgressBar,
|
ProgressBar,
|
||||||
|
LevelButton,
|
||||||
ProgressButton,
|
ProgressButton,
|
||||||
LayerStackIndicator,
|
LayerStackIndicator,
|
||||||
AdminNavigationPanel,
|
AdminNavigationPanel,
|
||||||
@@ -34,7 +39,6 @@ import {
|
|||||||
ResizableViewport,
|
ResizableViewport,
|
||||||
SceneAnnotation,
|
SceneAnnotation,
|
||||||
HeaderNavigation,
|
HeaderNavigation,
|
||||||
HeaderProfile,
|
|
||||||
HeaderWorkspace,
|
HeaderWorkspace,
|
||||||
Icon,
|
Icon,
|
||||||
IconButton,
|
IconButton,
|
||||||
@@ -53,6 +57,7 @@ import {
|
|||||||
ShareLinkModal,
|
ShareLinkModal,
|
||||||
SplitPane,
|
SplitPane,
|
||||||
SortableItem,
|
SortableItem,
|
||||||
|
SortableList,
|
||||||
SortableScope,
|
SortableScope,
|
||||||
SettingsCard,
|
SettingsCard,
|
||||||
Switch,
|
Switch,
|
||||||
@@ -60,6 +65,7 @@ import {
|
|||||||
TextField,
|
TextField,
|
||||||
ToastCard,
|
ToastCard,
|
||||||
ToastStack,
|
ToastStack,
|
||||||
|
ToastObserver,
|
||||||
Toolbar,
|
Toolbar,
|
||||||
NavigationCube,
|
NavigationCube,
|
||||||
UserProfileMenu,
|
UserProfileMenu,
|
||||||
@@ -121,7 +127,8 @@ const designProfileDocumentPath = (reference: { id: string; version: string; sta
|
|||||||
);
|
);
|
||||||
|
|
||||||
const accents: Array<{ label: string; value: RgbTuple; hex: string }> = [
|
const accents: Array<{ label: string; value: RgbTuple; hex: string }> = [
|
||||||
{ label: "NODE.DC", value: [255, 47, 146], hex: "#ff2f92" },
|
{ label: "Mission Core", value: [247, 248, 244], hex: "#f7f8f4" },
|
||||||
|
{ label: "Rose", value: [255, 47, 146], hex: "#ff2f92" },
|
||||||
{ label: "Rose", value: [255, 62, 108], hex: "#ff3e6c" },
|
{ label: "Rose", value: [255, 62, 108], hex: "#ff3e6c" },
|
||||||
{ label: "Blush", value: [255, 108, 175], hex: "#ff6caf" },
|
{ label: "Blush", value: [255, 108, 175], hex: "#ff6caf" },
|
||||||
{ label: "Magenta", value: [215, 70, 255], hex: "#d746ff" },
|
{ label: "Magenta", value: [215, 70, 255], hex: "#d746ff" },
|
||||||
@@ -147,7 +154,7 @@ const materialDefaults: Record<NodedcTheme, MaterialDraft> = {
|
|||||||
panelOpacity: 100,
|
panelOpacity: 100,
|
||||||
fieldHex: "#2a2a2c",
|
fieldHex: "#2a2a2c",
|
||||||
fieldOpacity: 100,
|
fieldOpacity: 100,
|
||||||
nestedHex: "#0b0b0d",
|
nestedHex: "#0d0d0f",
|
||||||
},
|
},
|
||||||
light: {
|
light: {
|
||||||
panelHex: "#ffffff",
|
panelHex: "#ffffff",
|
||||||
@@ -225,17 +232,17 @@ const iconGroups: Array<{ title: string; note: string; icons: IconName[] }> = [
|
|||||||
{
|
{
|
||||||
title: "Редактирование",
|
title: "Редактирование",
|
||||||
note: "Launcher / SEO",
|
note: "Launcher / SEO",
|
||||||
icons: ["save", "edit", "trash", "copy", "upload", "download", "external", "rotate-clockwise", "add-point", "orthographic", "perspective", "select", "pen", "rectangle", "curve", "undo", "redo"],
|
icons: ["save", "edit", "trash", "copy", "upload", "download", "external", "rotate-clockwise", "add-point", "ruler", "section", "isolate", "orthographic", "perspective", "fit-view", "select", "pen", "rectangle", "curve", "undo", "redo"],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Состояние и доступ",
|
title: "Состояние и доступ",
|
||||||
note: "Вся платформа",
|
note: "Вся платформа",
|
||||||
icons: ["check", "alert", "info", "activity", "lock", "key", "shield", "circle", "eye", "eye-off"],
|
icons: ["check", "alert", "info", "info-plain", "activity", "lock", "unlock", "key", "shield", "circle", "eye", "eye-off", "star"],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Сущности",
|
title: "Сущности",
|
||||||
note: "Общий словарь",
|
note: "Общий словарь",
|
||||||
icons: ["profile", "users", "building", "globe", "target", "database", "network", "inbox", "mail"],
|
icons: ["profile", "users", "building", "globe", "target", "database", "pin", "network", "inbox", "mail"],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Контент",
|
title: "Контент",
|
||||||
@@ -245,6 +252,10 @@ const iconGroups: Array<{ title: string; note: string; icons: IconName[] }> = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
const iconLabels: Record<IconName, string> = {
|
const iconLabels: Record<IconName, string> = {
|
||||||
|
star: "Избранное",
|
||||||
|
pipette: "Пипетка",
|
||||||
|
ruler: "Линейка", section: "Секущая плоскость", isolate: "Изолировать элемент",
|
||||||
|
power: "Питание",
|
||||||
move: "Свободное окно",
|
move: "Свободное окно",
|
||||||
"add-point":"Добавить точку",orthographic:"Ортографическая проекция",perspective:"Перспективная проекция",select:"Выделение",pen:"Перо",rectangle:"Прямоугольник",curve:"Кривая",undo:"Отменить",redo:"Повторить",
|
"add-point":"Добавить точку",orthographic:"Ортографическая проекция",perspective:"Перспективная проекция",select:"Выделение",pen:"Перо",rectangle:"Прямоугольник",curve:"Кривая",undo:"Отменить",redo:"Повторить",
|
||||||
activity: "Активность",
|
activity: "Активность",
|
||||||
@@ -262,6 +273,7 @@ const iconLabels: Record<IconName, string> = {
|
|||||||
close: "Закрыть",
|
close: "Закрыть",
|
||||||
copy: "Копировать",
|
copy: "Копировать",
|
||||||
database: "База данных",
|
database: "База данных",
|
||||||
|
pin: "Закрепить",
|
||||||
download: "Скачать",
|
download: "Скачать",
|
||||||
edit: "Редактировать",
|
edit: "Редактировать",
|
||||||
eye: "Показать",
|
eye: "Показать",
|
||||||
@@ -275,10 +287,13 @@ const iconLabels: Record<IconName, string> = {
|
|||||||
image: "Изображение",
|
image: "Изображение",
|
||||||
inbox: "Уведомления",
|
inbox: "Уведомления",
|
||||||
info: "Информация",
|
info: "Информация",
|
||||||
|
"info-plain": "Информация без окружности",
|
||||||
|
"fit-view": "Вписать модель",
|
||||||
key: "Ключ",
|
key: "Ключ",
|
||||||
layers: "Слои",
|
layers: "Слои",
|
||||||
list: "Список задач",
|
list: "Список задач",
|
||||||
lock: "Закрыто",
|
lock: "Закрыто",
|
||||||
|
unlock: "Открыто",
|
||||||
mail: "Приглашение",
|
mail: "Приглашение",
|
||||||
minimize: "Свернуть",
|
minimize: "Свернуть",
|
||||||
network: "Связи",
|
network: "Связи",
|
||||||
@@ -333,7 +348,7 @@ function Preview({ title, note, children, className }: {
|
|||||||
|
|
||||||
export function CatalogApp() {
|
export function CatalogApp() {
|
||||||
const [theme, setTheme] = useState<NodedcTheme>("dark");
|
const [theme, setTheme] = useState<NodedcTheme>("dark");
|
||||||
const [accentHex, setAccentHex] = useState("#ff2f92");
|
const [accentHex, setAccentHex] = useState("#f7f8f4");
|
||||||
const [materialByTheme, setMaterialByTheme] = useState<Record<NodedcTheme, MaterialDraft>>(() => ({
|
const [materialByTheme, setMaterialByTheme] = useState<Record<NodedcTheme, MaterialDraft>>(() => ({
|
||||||
dark: { ...materialDefaults.dark },
|
dark: { ...materialDefaults.dark },
|
||||||
light: { ...materialDefaults.light },
|
light: { ...materialDefaults.light },
|
||||||
@@ -348,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);
|
||||||
@@ -386,16 +402,20 @@ export function CatalogApp() {
|
|||||||
const [glowDistance, setGlowDistance] = useState(105);
|
const [glowDistance, setGlowDistance] = useState(105);
|
||||||
const [usePortColors, setUsePortColors] = useState(false);
|
const [usePortColors, setUsePortColors] = useState(false);
|
||||||
const [connectionType, setConnectionType] = useState("spline");
|
const [connectionType, setConnectionType] = useState("spline");
|
||||||
const [lightColor, setLightColor] = useState("#ff2f92");
|
const [lightColor, setLightColor] = useState("#f7f8f4");
|
||||||
const [connectionColor, setConnectionColor] = useState("#404040");
|
const [connectionColor, setConnectionColor] = useState("#404040");
|
||||||
const [fillColor, setFillColor] = useState("#ff6caf");
|
const [fillColor, setFillColor] = useState("#ff6caf");
|
||||||
const [fillOpacity, setFillOpacity] = useState(100);
|
const [fillOpacity, setFillOpacity] = useState(100);
|
||||||
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);
|
||||||
|
const [treeSelectedIds,setTreeSelectedIds]=useState<string[]>(['cells']);
|
||||||
const [inspectorOpen, setInspectorOpen] = useState(false);
|
const [inspectorOpen, setInspectorOpen] = useState(false);
|
||||||
const workspaceWindowDemoRef = useRef<HTMLDivElement>(null);
|
const workspaceWindowDemoRef = useRef<HTMLDivElement>(null);
|
||||||
const [sceneDemoHeight, setSceneDemoHeight] = useState(480);
|
const [sceneDemoHeight, setSceneDemoHeight] = useState(480);
|
||||||
@@ -407,7 +427,8 @@ export function CatalogApp() {
|
|||||||
const [splitPaneDemoSize, setSplitPaneDemoSize] = useState(50);
|
const [splitPaneDemoSize, setSplitPaneDemoSize] = useState(50);
|
||||||
const [sidePanelDemoOpen, setSidePanelDemoOpen] = useState(true);
|
const [sidePanelDemoOpen, setSidePanelDemoOpen] = useState(true);
|
||||||
const [createModalOpen, setCreateModalOpen] = useState(false);
|
const [createModalOpen, setCreateModalOpen] = useState(false);
|
||||||
const [missionAppearance, setMissionAppearance] = useState(false);
|
const [missionAppearance, setMissionAppearance] = useState(true);
|
||||||
|
const [flatEdges, setFlatEdges] = useState(true);
|
||||||
const [featureSettingsDemoOpen, setFeatureSettingsDemoOpen] = useState(false);
|
const [featureSettingsDemoOpen, setFeatureSettingsDemoOpen] = useState(false);
|
||||||
const [featureSettingsDemoSection, setFeatureSettingsDemoSection] = useState('general');
|
const [featureSettingsDemoSection, setFeatureSettingsDemoSection] = useState('general');
|
||||||
const [confirmOpen, setConfirmOpen] = useState(false);
|
const [confirmOpen, setConfirmOpen] = useState(false);
|
||||||
@@ -547,6 +568,7 @@ export function CatalogApp() {
|
|||||||
applyNodedcTheme(document.documentElement, {
|
applyNodedcTheme(document.documentElement, {
|
||||||
theme,
|
theme,
|
||||||
appearance: missionAppearance ? "mission" : "default",
|
appearance: missionAppearance ? "mission" : "default",
|
||||||
|
edges: flatEdges ? "flat" : "default",
|
||||||
accent,
|
accent,
|
||||||
material: {
|
material: {
|
||||||
panel: panelMaterial,
|
panel: panelMaterial,
|
||||||
@@ -556,7 +578,7 @@ export function CatalogApp() {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
document.documentElement.style.setProperty("--nodedc-canvas-soft", material.nestedHex);
|
document.documentElement.style.setProperty("--nodedc-canvas-soft", material.nestedHex);
|
||||||
}, [accent, fieldMaterial, material.fieldOpacity, material.nestedHex, material.panelOpacity, panelMaterial, theme, missionAppearance]);
|
}, [accent, fieldMaterial, material.fieldOpacity, material.nestedHex, material.panelOpacity, panelMaterial, theme, missionAppearance, flatEdges]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
applyGlassMaterial(document.documentElement, glassMaterial);
|
applyGlassMaterial(document.documentElement, glassMaterial);
|
||||||
@@ -1342,6 +1364,7 @@ export function CatalogApp() {
|
|||||||
<>
|
<>
|
||||||
<ControlRow label="Цвет"><ColorField value={lightColor} onChange={setLightColor} /></ControlRow>
|
<ControlRow label="Цвет"><ColorField value={lightColor} onChange={setLightColor} /></ControlRow>
|
||||||
<RangeControl label="Яркость" value={brightness} min={0} max={100} formatValue={(value) => `${value}%`} onChange={setBrightness} />
|
<RangeControl label="Яркость" value={brightness} min={0} max={100} formatValue={(value) => `${value}%`} onChange={setBrightness} />
|
||||||
|
<RangeControl variant="rail" label="Тонкая горизонтальная шкала" value={brightness} min={0} max={100} formatValue={v=>`${v}%`} onChange={setBrightness}/>
|
||||||
<div style={{ height: 180 }} title="Тонкая шкала: две границы двигаются независимо; без центрального текста"><RangeControl orientation="vertical" label="Срез" value={sliceBand} min={-1.2} max={51.5} step="any" formatValue={(value) => `${value.toFixed(1).replace('.', ',')} м`} formatLimit={(value) => value.toFixed(1).replace('.', ',')} onChange={setSliceBand} /></div>
|
<div style={{ height: 180 }} title="Тонкая шкала: две границы двигаются независимо; без центрального текста"><RangeControl orientation="vertical" label="Срез" value={sliceBand} min={-1.2} max={51.5} step="any" formatValue={(value) => `${value.toFixed(1).replace('.', ',')} м`} formatLimit={(value) => value.toFixed(1).replace('.', ',')} onChange={setSliceBand} /></div>
|
||||||
<div style={{ height: 180, display: 'flex', justifyContent: 'flex-end' }} title="Шкала справа: границы слева; фокус подчёркивает выбранную границу"><RangeControl orientation="vertical" limitSide="left" label="Срез" value={sliceBand} min={-1.2} max={51.5} step="any" formatValue={(value) => `${value.toFixed(1).replace('.', ',')} м`} formatLimit={(value) => value.toFixed(1).replace('.', ',')} onChange={setSliceBand} /></div>
|
<div style={{ height: 180, display: 'flex', justifyContent: 'flex-end' }} title="Шкала справа: границы слева; фокус подчёркивает выбранную границу"><RangeControl orientation="vertical" limitSide="left" label="Срез" value={sliceBand} min={-1.2} max={51.5} step="any" formatValue={(value) => `${value.toFixed(1).replace('.', ',')} м`} formatLimit={(value) => value.toFixed(1).replace('.', ',')} onChange={setSliceBand} /></div>
|
||||||
<RangeControl label="Дистанция свечения" value={glowDistance} min={0} max={200} exactValueBounds={{ min: 0 }} formatValue={(value) => `${value}%`} onChange={setGlowDistance} />
|
<RangeControl label="Дистанция свечения" value={glowDistance} min={0} max={200} exactValueBounds={{ min: 0 }} formatValue={(value) => `${value}%`} onChange={setGlowDistance} />
|
||||||
@@ -1390,7 +1413,8 @@ export function CatalogApp() {
|
|||||||
case "controls":
|
case "controls":
|
||||||
return (
|
return (
|
||||||
<div className="catalog-grid">
|
<div className="catalog-grid">
|
||||||
<Preview title="Navigation cube" note="faces / edges / corners"><NavigationCube edgeOpacity={cubeEdgeOpacity} size={cubeSize} quaternion={[.28,-.36,.12,.88]} onSelect={setCubeDirection}/><RangeControl label="Размер 3D-куба" value={cubeSize} min={48} max={160} step={1} onChange={setCubeSize} formatValue={v=>`${v} px`}/><RangeControl label="Прозрачность линий куба" value={1-cubeEdgeOpacity} min={0} max={1} step={.05} onChange={v=>setCubeEdgeOpacity(1-v)} formatValue={v=>`${Math.round(v*100)}%`}/><p>{cubeDirection.join(" · ")}</p></Preview>
|
<Preview title="Mission Core" note="canonical foundation / nested fields / portal" className="catalog-preview--wide"><MissionThemeExample/></Preview>
|
||||||
|
<Preview title="Navigation cube" note="faces / edges / corners"><NavigationCube faceOpacity={.65} edgeOpacity={cubeEdgeOpacity} size={cubeSize} quaternion={[.28,-.36,.12,.88]} onSelect={setCubeDirection}/><RangeControl label="Размер 3D-куба" value={cubeSize} min={48} max={160} step={1} onChange={setCubeSize} formatValue={v=>`${v} px`}/><RangeControl label="Прозрачность линий куба" value={1-cubeEdgeOpacity} min={0} max={1} step={.05} onChange={v=>setCubeEdgeOpacity(1-v)} formatValue={v=>`${Math.round(v*100)}%`}/><p>{cubeDirection.join(" · ")}</p></Preview>
|
||||||
<Preview title="Selection" note="integrated / split / inline">
|
<Preview title="Selection" note="integrated / split / inline">
|
||||||
<div className="catalog-form">
|
<div className="catalog-form">
|
||||||
<FieldFrame label="Hub / integrated select" labelPlacement="below">
|
<FieldFrame label="Hub / integrated select" labelPlacement="below">
|
||||||
@@ -1406,7 +1430,7 @@ export function CatalogApp() {
|
|||||||
</FieldFrame>
|
</FieldFrame>
|
||||||
<FieldFrame label="Engine / split select">
|
<FieldFrame label="Engine / split select">
|
||||||
<Select
|
<Select
|
||||||
variant="split"
|
variant="split" shape="pill"
|
||||||
label="Тип связи"
|
label="Тип связи"
|
||||||
value={connectionType}
|
value={connectionType}
|
||||||
options={[
|
options={[
|
||||||
@@ -1450,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">
|
||||||
@@ -1464,6 +1489,15 @@ export function CatalogApp() {
|
|||||||
<KeyButton label="Клавиша S недоступна" disabled>S</KeyButton>
|
<KeyButton label="Клавиша S недоступна" disabled>S</KeyButton>
|
||||||
</div>
|
</div>
|
||||||
</Preview>
|
</Preview>
|
||||||
|
<Preview title="Подсказки" note="Скруглённое стекло без обводки · hover / focus / touch" className="catalog-preview--compact">
|
||||||
|
<div className="catalog-inline catalog-inline--wrap">
|
||||||
|
<IconButton label="Инспектор"><Icon name="network" /></IconButton>
|
||||||
|
<Button title="Общая подсказка для существующего title">Подсказка приложения</Button>
|
||||||
|
<Tooltip content="Короткое пояснение. Escape закрывает только подсказку."><Button>Подробнее</Button></Tooltip>
|
||||||
|
<Tooltip focusable label="Текущий уровень" content="Доступно мышью, клавиатурой и касанием."><StatusBadge tone="neutral">Нормальный уровень</StatusBadge></Tooltip>
|
||||||
|
<Tooltip disabled content="Эта подсказка отключена"><Button disabled>Недоступно</Button></Tooltip>
|
||||||
|
</div>
|
||||||
|
</Preview>
|
||||||
<Preview title="Активность" note="default / compact" className="catalog-preview--compact">
|
<Preview title="Активность" note="default / compact" className="catalog-preview--compact">
|
||||||
<div className="catalog-inline catalog-inline--wrap">
|
<div className="catalog-inline catalog-inline--wrap">
|
||||||
<span className="catalog-inline">
|
<span className="catalog-inline">
|
||||||
@@ -1500,6 +1534,15 @@ export function CatalogApp() {
|
|||||||
<SegmentedControl selectionMode="multiple" label="Слои сцены" value={previewLayers} onChange={setPreviewLayers}
|
<SegmentedControl selectionMode="multiple" label="Слои сцены" value={previewLayers} onChange={setPreviewLayers}
|
||||||
items={[{value:"source",label:"Источник"},{value:"geometry",label:"Геометрия"},{value:"unavailable",label:"Недоступно",disabled:true}]} />
|
items={[{value:"source",label:"Источник"},{value:"geometry",label:"Геометрия"},{value:"unavailable",label:"Недоступно",disabled:true}]} />
|
||||||
</Preview>
|
</Preview>
|
||||||
|
<Preview title="Уровень ресурса" note="измерение / последние данные / неизвестно">
|
||||||
|
<LevelButton label="Заряд аккумулятора" value={.82} levelTone="success" onClick={()=>setProjectName("Аккумулятор · 82%")}/>
|
||||||
|
<LevelButton label="Заряд аккумулятора" value={.17} levelTone="warning" freshness="stale"/>
|
||||||
|
<LevelButton label="Заряд аккумулятора" value={null} freshness="unknown" disabled/>
|
||||||
|
<LevelButton label="Белая заливка" value={.82} fillColor="#ffffff"/>
|
||||||
|
<LevelButton label="Чёрная заливка" value={.82} fillColor="#000000"/>
|
||||||
|
<LevelButton label="Минимальный индикатор" value={1} valueText="100%" fillColor="#ffffff" geometry={{width:32,height:12,radius:4}}/>
|
||||||
|
<LevelButton label="Широкий индикатор" value={.82} geometry={{width:160,height:24,radius:8}}/>
|
||||||
|
</Preview>
|
||||||
<Preview title="Линейный прогресс" note="измеренный / неизвестный / завершённый">
|
<Preview title="Линейный прогресс" note="измеренный / неизвестный / завершённый">
|
||||||
<ProgressBar label="Подготовка" value={0.6} valueText="Три этапа из пяти" />
|
<ProgressBar label="Подготовка" value={0.6} valueText="Три этапа из пяти" />
|
||||||
<ProgressBar label="Получение сведений" />
|
<ProgressBar label="Получение сведений" />
|
||||||
@@ -1513,9 +1556,12 @@ 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>
|
||||||
|
<Preview title="Операционная типографика" note="единый размер во всех состояниях"><OperationalTypographyDemo /></Preview>
|
||||||
|
<Preview title="Размер DOM-окна" note="геометрия с сохранением в приложении"><ModalSizeExample /></Preview>
|
||||||
<Preview title="Главная и окружение" note="единые компоненты · сохранение в памяти каталога">
|
<Preview title="Главная и окружение" note="единые компоненты · сохранение в памяти каталога">
|
||||||
<EnvironmentCatalogDemo />
|
<EnvironmentCatalogDemo />
|
||||||
</Preview>
|
</Preview>
|
||||||
@@ -1583,7 +1629,7 @@ export function CatalogApp() {
|
|||||||
</div>
|
</div>
|
||||||
<p className="catalog-preview__explanation">Rectangle, maximize, close и stacking остаются состоянием приложения; дизайн-система владеет одинаковой bounded-геометрией и доступным управлением.</p>
|
<p className="catalog-preview__explanation">Rectangle, maximize, close и stacking остаются состоянием приложения; дизайн-система владеет одинаковой bounded-геометрией и доступным управлением.</p>
|
||||||
</Preview>
|
</Preview>
|
||||||
<Preview title="Split pane" note="pointer / keyboard / controlled" className="catalog-preview--wide catalog-split-pane-preview">
|
<Preview title="Split pane" note="pointer resize: invisible / keyboard focus: visible" className="catalog-preview--wide catalog-split-pane-preview">
|
||||||
<Switch label="Скрыть линию разделителя" checked={splitPaneInvisible} onChange={setSplitPaneInvisible} />
|
<Switch label="Скрыть линию разделителя" checked={splitPaneInvisible} onChange={setSplitPaneInvisible} />
|
||||||
<div className="catalog-split-pane-demo">
|
<div className="catalog-split-pane-demo">
|
||||||
<SplitPane
|
<SplitPane
|
||||||
@@ -1613,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 />
|
||||||
@@ -1714,6 +1761,11 @@ export function CatalogApp() {
|
|||||||
<ResizableViewport className="catalog-glass-stage" resizeIndicator={false} height={sceneDemoHeight} minHeight={360} maxHeight={900} onHeightChange={setSceneDemoHeight}>
|
<ResizableViewport className="catalog-glass-stage" resizeIndicator={false} height={sceneDemoHeight} minHeight={360} maxHeight={900} onHeightChange={setSceneDemoHeight}>
|
||||||
<video key={stageMediaSrc} autoPlay muted loop playsInline aria-hidden="true"><source src={stageMediaSrc} type="video/mp4" /></video>
|
<video key={stageMediaSrc} autoPlay muted loop playsInline aria-hidden="true"><source src={stageMediaSrc} type="video/mp4" /></video>
|
||||||
<div className="catalog-glass-stage__shade" />
|
<div className="catalog-glass-stage__shade" />
|
||||||
|
<div className="catalog-viewport-actions nodedc-viewport-controls">
|
||||||
|
<IconButton label="Приблизить пример" onClick={()=>setSceneDemoHeight(value=>Math.min(900,value+40))}><Icon name="plus"/></IconButton>
|
||||||
|
<IconButton label="Отдалить пример" onClick={()=>setSceneDemoHeight(value=>Math.max(360,value-40))}><Icon name="minus"/></IconButton>
|
||||||
|
<IconButton label="Вернуть размер примера" onClick={()=>setSceneDemoHeight(480)}><Icon name="select"/></IconButton>
|
||||||
|
</div>
|
||||||
<GlassMaterialSurface context="scene" radius="panel" material={glassMaterial} radiusPx={24} className="catalog-glass-stage__sample">
|
<GlassMaterialSurface context="scene" radius="panel" material={glassMaterial} radiusPx={24} className="catalog-glass-stage__sample">
|
||||||
<span>CANONICAL GLASS</span>
|
<span>CANONICAL GLASS</span>
|
||||||
<h2>Прозрачная плашка над сценой</h2>
|
<h2>Прозрачная плашка над сценой</h2>
|
||||||
@@ -1752,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>
|
||||||
@@ -1776,7 +1829,7 @@ export function CatalogApp() {
|
|||||||
<p className="catalog-preview__explanation">Destructive-цвет появляется только у подтверждения.</p>
|
<p className="catalog-preview__explanation">Destructive-цвет появляется только у подтверждения.</p>
|
||||||
<Button variant="danger" shape="pill" icon={<Icon name="trash" />} onClick={() => setConfirmOpen(true)}>Проверить удаление</Button>
|
<Button variant="danger" shape="pill" icon={<Icon name="trash" />} onClick={() => setConfirmOpen(true)}>Проверить удаление</Button>
|
||||||
</Preview>
|
</Preview>
|
||||||
<Preview title="Настройки модуля" note="адаптивное меню и форма" className="catalog-modal-preview"><Switch label="Визуальный профиль Mission Core" checked={missionAppearance} onChange={setMissionAppearance} />
|
<Preview title="Настройки модуля" note="адаптивное меню и форма" className="catalog-modal-preview"><Switch label="Без декоративных обводок" checked={flatEdges} onChange={setFlatEdges} /><Switch label="Визуальный профиль Mission Core" checked={missionAppearance} onChange={setMissionAppearance} />
|
||||||
<Button icon={<Icon name="settings" />} onClick={() => setFeatureSettingsDemoOpen(true)}>Открыть настройки модуля</Button>
|
<Button icon={<Icon name="settings" />} onClick={() => setFeatureSettingsDemoOpen(true)}>Открыть настройки модуля</Button>
|
||||||
</Preview>
|
</Preview>
|
||||||
<Preview title="Workflow sharing" note="ENGINE / access" className="catalog-modal-preview">
|
<Preview title="Workflow sharing" note="ENGINE / access" className="catalog-modal-preview">
|
||||||
@@ -1817,6 +1870,8 @@ export function CatalogApp() {
|
|||||||
<div className="catalog-icon-catalog">
|
<div className="catalog-icon-catalog">
|
||||||
<Preview title="Размеры и поверхности" note="glyph 16 px" className="catalog-preview--wide">
|
<Preview title="Размеры и поверхности" note="glyph 16 px" className="catalog-preview--wide">
|
||||||
<div className="catalog-window-actions-demo">
|
<div className="catalog-window-actions-demo">
|
||||||
|
<IconButton surface="none" label="В избранное" aria-pressed="false"><Icon name="star" /></IconButton>
|
||||||
|
<IconButton surface="none" label="Убрать из избранного" aria-pressed="true"><Icon name="star" fill="currentColor" /></IconButton>
|
||||||
<IconButton label="Камера включена" aria-pressed="true"><Icon name="camera" /></IconButton>
|
<IconButton label="Камера включена" aria-pressed="true"><Icon name="camera" /></IconButton>
|
||||||
<IconButton label="План"><Icon name="plan" /></IconButton>
|
<IconButton label="План"><Icon name="plan" /></IconButton>
|
||||||
<IconButton label="Добавить"><Icon name="plus" /></IconButton>
|
<IconButton label="Добавить"><Icon name="plus" /></IconButton>
|
||||||
@@ -2148,10 +2203,12 @@ export function CatalogApp() {
|
|||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
|
// The shared profile owns its responsive label; consumers do not size it.
|
||||||
right={
|
right={
|
||||||
<HeaderProfile>
|
|
||||||
<IconButton label="Уведомления"><Icon name="inbox" size={20} strokeWidth={1.7} /></IconButton>
|
|
||||||
<UserProfileMenu
|
<UserProfileMenu
|
||||||
|
triggerLabel="Профиль"
|
||||||
|
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}
|
||||||
@@ -2161,7 +2218,6 @@ export function CatalogApp() {
|
|||||||
{ id: "logout", label: "Выйти", icon: "external", href: "/auth/logout" },
|
{ id: "logout", label: "Выйти", icon: "external", href: "/auth/logout" },
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
</HeaderProfile>
|
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
@@ -2183,6 +2239,8 @@ export function CatalogApp() {
|
|||||||
eyebrow="NODE.DC"
|
eyebrow="NODE.DC"
|
||||||
title={studioContext === "applications" ? "Applications" : studioContext === "pages" ? "Page Library" : "Visual Library"}
|
title={studioContext === "applications" ? "Applications" : studioContext === "pages" ? "Page Library" : "Visual Library"}
|
||||||
closeLabel="Закрыть Module Foundry"
|
closeLabel="Закрыть Module Foundry"
|
||||||
|
collapseLabel="Свернуть панель навигации"
|
||||||
|
expandLabel="Развернуть панель навигации"
|
||||||
navigationLabel={studioContext === "applications" ? "Application Drafts" : studioContext === "pages" ? "Page Templates" : "Разделы Visual Library"}
|
navigationLabel={studioContext === "applications" ? "Application Drafts" : studioContext === "pages" ? "Page Templates" : "Разделы Visual Library"}
|
||||||
onClose={closeGuideline}
|
onClose={closeGuideline}
|
||||||
headerActions={studioContext === "applications" ? (
|
headerActions={studioContext === "applications" ? (
|
||||||
@@ -2324,7 +2382,7 @@ export function CatalogApp() {
|
|||||||
maxSize={toolbarMaxSize}
|
maxSize={toolbarMaxSize}
|
||||||
lensCount={toolbarLensCount}
|
lensCount={toolbarLensCount}
|
||||||
autoHide={toolbarAutoHide}
|
autoHide={toolbarAutoHide}
|
||||||
hideDelay={toolbarHideDelay} gap={toolbarGap}
|
hideDelay={toolbarHideDelay} gap={toolbarGap} menuWidth={320}
|
||||||
items={[{id:"hold",label:toolbarAutoHide?"Hold · Закрепить тулбар":"Hold · Открепить тулбар",icon:"lock",active:!toolbarAutoHide,onSelect:()=>setToolbarAutoHide(v=>!v)}, ...(Object.entries(sectionDefinitions) as Array<[CatalogSection, (typeof sectionDefinitions)[CatalogSection]]>).map(([id, item]) => ({
|
items={[{id:"hold",label:toolbarAutoHide?"Hold · Закрепить тулбар":"Hold · Открепить тулбар",icon:"lock",active:!toolbarAutoHide,onSelect:()=>setToolbarAutoHide(v=>!v)}, ...(Object.entries(sectionDefinitions) as Array<[CatalogSection, (typeof sectionDefinitions)[CatalogSection]]>).map(([id, item]) => ({
|
||||||
id,
|
id,
|
||||||
label: item.title,
|
label: item.title,
|
||||||
@@ -2337,7 +2395,8 @@ export function CatalogApp() {
|
|||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
<Window open={treeDemoOpen} title="Объекты сцены" placement="end" resizable draggable rect={treeDemoRect} onRectCommit={setTreeDemoRect} onClose={()=>setTreeDemoOpen(false)}>
|
<Window open={treeDemoOpen} title="Объекты сцены" placement="end" resizable draggable rect={treeDemoRect} onRectCommit={setTreeDemoRect} onClose={()=>setTreeDemoOpen(false)}>
|
||||||
<Tree label="Пример дерева объектов" selected={treeSelected} onSelect={setTreeSelected} onVisibilityChange={(_,visible)=>setTreeVisible(visible)} nodes={[{id:'scene',label:'Сцена',children:[{id:'model',label:'Модель',children:[{id:'cells',label:'Ячейки / внутренний блок',visible:treeVisible},{id:'panel',label:'Боковая панель корпуса / длинное название детали'}]}]}]}/>
|
<div className="nodedc-viewport-surface" data-glass-context="scene"><IconButton label="Проверить fullscreen внутри окна" onClick={event=>{const viewport=event.currentTarget.parentElement!;void (document.fullscreenElement===viewport?document.exitFullscreen():viewport.requestFullscreen());}}><Icon name="expand"/></IconButton><Description>Окно и дерево сохраняются при развороте этого viewport и возврате.</Description></div>
|
||||||
|
<Tree defaultExpandedDepth={2} renderActions={node=><Dropdown width={320} trigger={({setTriggerRef,show,open})=><IconButton ref={setTriggerRef} label={`Информация: ${node.label}`} aria-expanded={open} onMouseEnter={show} onClick={show}><Icon name="info-plain" size={14}/></IconButton>}><Description>{node.label}</Description></Dropdown>} label="Пример дерева объектов: стрелка раскрывает, глазик меняет видимость без прокрутки" selected={treeSelected} selectedIds={treeSelectedIds} onSelect={(id,gesture)=>{setTreeSelected(id);setTreeSelectedIds(old=>gesture.shiftKey?gesture.rangeIds:gesture.metaKey?(old.includes(id)?old.filter(key=>key!==id):[...old,id]):gesture.ctrlKey?[...new Set([...old,id])]:[id]);}} onVisibilityChange={(_,visible)=>setTreeVisible(visible)} nodes={[{id:'scene',label:'Сцена',children:[{id:'model',label:'Модель',children:[{id:'cells',label:'Ячейки / внутренний блок',visible:treeVisible},{id:'panel',label:'Боковая панель корпуса / длинное название детали'}]}]}]}/>
|
||||||
</Window>
|
</Window>
|
||||||
<Window
|
<Window
|
||||||
open={inspectorOpen}
|
open={inspectorOpen}
|
||||||
@@ -2348,12 +2407,16 @@ export function CatalogApp() {
|
|||||||
draggable
|
draggable
|
||||||
onClose={() => setInspectorOpen(false)}
|
onClose={() => setInspectorOpen(false)}
|
||||||
>
|
>
|
||||||
<Inspector sections={environmentSections} defaultOpen={["application-material"]} />
|
<Inspector header={<Description>Поля и секции разделены единым шагом 12 px.</Description>} footer={<Button variant="primary" tone="neutral" onClick={()=>setInspectorOpen(false)}>Готово</Button>} sections={environmentSections} defaultOpen={["application-material"]} />
|
||||||
</Window>
|
</Window>
|
||||||
|
|
||||||
<Window
|
<Window
|
||||||
open={createModuleOpen}
|
open={createModuleOpen}
|
||||||
|
floating={detailFloating} onFloatingChange={setDetailFloating}
|
||||||
|
rect={detailRect} onRectCommit={setDetailRect}
|
||||||
title="Создать модуль"
|
title="Создать модуль"
|
||||||
|
headerActionsPlacement="before-close"
|
||||||
|
headerActions={<IconButton label="Очистить форму" onClick={() => {setCreateModuleName("");setCreateModuleSlug("");}}><Icon name="trash"/></IconButton>}
|
||||||
subtitle="Свободное окно · шапка: перемещение · края: размер"
|
subtitle="Свободное окно · шапка: перемещение · края: размер"
|
||||||
size="sm"
|
size="sm"
|
||||||
onClose={() => setCreateModuleOpen(false)}
|
onClose={() => setCreateModuleOpen(false)}
|
||||||
@@ -2448,7 +2511,7 @@ export function CatalogApp() {
|
|||||||
|
|
||||||
<FoundrySettingsModal open={foundrySettingsOpen} isAdmin={isFoundryAdmin} onClose={() => setFoundrySettingsOpen(false)} />
|
<FoundrySettingsModal open={foundrySettingsOpen} isAdmin={isFoundryAdmin} onClose={() => setFoundrySettingsOpen(false)} />
|
||||||
|
|
||||||
<FeatureSettingsWindow open={featureSettingsDemoOpen} title="Настройки модуля" subtitle="Настройки и меню доступны также в полноэкранном просмотре"
|
<FeatureSettingsWindow open={featureSettingsDemoOpen} title="Настройки модуля" subtitle="При откреплении окно использует стекло viewport; настройки доступны в полноэкранном просмотре"
|
||||||
identity={{ title: 'Модуль', subtitle: 'Пример общего компонента', avatarLabel: 'DC' }}
|
identity={{ title: 'Модуль', subtitle: 'Пример общего компонента', avatarLabel: 'DC' }}
|
||||||
sections={[{ id: 'general', label: 'Основное', icon: 'settings' }, ...Array.from({length:16}, (_,i)=>({id:`details-${i}`,label:`Раздел ${i+1}`,group:'Сведения'}))]}
|
sections={[{ id: 'general', label: 'Основное', icon: 'settings' }, ...Array.from({length:16}, (_,i)=>({id:`details-${i}`,label:`Раздел ${i+1}`,group:'Сведения'}))]}
|
||||||
activeSection={featureSettingsDemoSection} onSectionChange={setFeatureSettingsDemoSection}
|
activeSection={featureSettingsDemoSection} onSectionChange={setFeatureSettingsDemoSection}
|
||||||
@@ -2587,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>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
import {useState} from 'react';
|
import {useState} from 'react';
|
||||||
import {Button,Description,EditorDockLayout,EditorWorkspace,type EditorDockState} from '@nodedc/ui-react';
|
import {Button,Window,Description,ColorField,ControlRow,Inspector,EditorDockLayout,EditorWorkspace,type EditorDockState} from '@nodedc/ui-react';
|
||||||
export function EditorDockExample(){
|
export function EditorDockExample({inWindow=false}:{inWindow?:boolean}){
|
||||||
|
const [color,setColor]=useState('#292929');
|
||||||
|
const [modal,setModal]=useState(false),[purpose,setPurpose]=useState<'edit'|'view'>('edit');
|
||||||
const [editing,setEditing]=useState(false),[open,setOpen]=useState({objects:true,materials:true});
|
const [editing,setEditing]=useState(false),[open,setOpen]=useState({objects:true,materials:true});
|
||||||
const [layout,setLayout]=useState<EditorDockState>({tree:{axis:'y',ratio:70,first:{axis:'x',ratio:25,first:{id:'objects'},second:{id:'viewport'}},second:{id:'materials'}},floating:{}});
|
const [layout,setLayout]=useState<EditorDockState>({tree:{axis:'y',ratio:70,first:{axis:'x',ratio:25,first:{id:'objects'},second:{id:'viewport'}},second:{id:'materials'}},floating:{}});
|
||||||
return <><Button onClick={()=>{setOpen({objects:true,materials:true});setEditing(true);}}>Открыть редактор сцены</Button><div style={{height:480}}>
|
return <>{!inWindow&&<><Button onClick={()=>setModal(true)}>Сцена в модальном окне</Button><Window open={modal} title="Просмотр сцены" onClose={()=>setModal(false)}><EditorDockExample inWindow/></Window></>}<Button onClick={()=>{setPurpose('edit');setOpen({objects:true,materials:true});setEditing(true);}}>Открыть редактор сцены</Button><Button onClick={()=>{setPurpose('view');setEditing(true);}}>Отдельное окно просмотра</Button><div style={{height:480}}>
|
||||||
<EditorWorkspace editing={editing} title="Редактор сцены" subtitle="Общая оконная система" onBack={()=>setEditing(false)}>
|
<EditorWorkspace editing={editing} purpose={purpose} title={purpose==='view'?'Просмотр сцены':'Редактор сцены'} subtitle="Общая оконная система" onBack={()=>setEditing(false)} headerActions={purpose==='view'?<Button onClick={()=>setOpen({objects:true,materials:true})}>Показать инструменты</Button>:undefined}>
|
||||||
<EditorDockLayout value={layout} onChange={setLayout} enabled={editing} primary={<div style={{display:'grid',height:'100%',placeContent:'center'}}><Description>Закреплённая сцена</Description><Button onClick={()=>setOpen({objects:true,materials:true})}>Показать инструменты</Button></div>}
|
<EditorDockLayout value={layout} onChange={setLayout} enabled={editing} primary={<div style={{display:'grid',height:'100%',placeContent:'center'}}><Description>Закреплённая сцена · откреплённые инструменты используют scene Glass V4</Description><Button onClick={()=>setOpen({objects:true,materials:true})}>Показать инструменты</Button></div>}
|
||||||
tools={[{id:'objects',title:'Объекты',label:'Объекты',open:open.objects,onClose:()=>setOpen(v=>({...v,objects:false})),content:<Description>Сцена → Модель → Детали</Description>},
|
tools={[{id:'objects',title:'Объекты',label:'Объекты',open:open.objects,onClose:()=>setOpen(v=>({...v,objects:false})),content:<Description>Сцена → Модель → Детали. Захват шапки — без рамки; Tab и стрелки — клавиатурное управление.</Description>},
|
||||||
{id:'materials',title:'Материалы',label:'Материалы',open:open.materials,onClose:()=>setOpen(v=>({...v,materials:false})),content:<Description>Перетащите шапку к краю, рядом с другим инструментом или в центр сцены.</Description>}]}/>
|
{id:'materials',title:'Материалы',label:'Материалы',minimumSize:{width:380,height:280},footer:<Button width="full" onClick={()=>setColor('#292929')}>Сбросить настройки</Button>,open:open.materials,onClose:()=>setOpen(v=>({...v,materials:false})),content:<Inspector sections={[{id:"color",label:"Цвет без обводки и пипетка",content:<ControlRow label="Цвет"><ColorField label="Цвет материала" value={color} onChange={setColor}/></ControlRow>}]} defaultOpen={["color"]} header={<Description>Минимум 380 × 280. Пипетка берёт цвет с экрана после нажатия; Escape отменяет выбор. Нижняя кнопка не прокручивается.</Description>}/>}]}/>
|
||||||
</EditorWorkspace>
|
</EditorWorkspace>
|
||||||
</div></>;
|
</div></>;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,13 +15,14 @@ export function EnvironmentCatalogDemo() {
|
|||||||
useEffect(() => () => urls.current.forEach(url => URL.revokeObjectURL(url)), []);
|
useEffect(() => () => urls.current.forEach(url => URL.revokeObjectURL(url)), []);
|
||||||
return <>
|
return <>
|
||||||
<div className="catalog-environment-actions">
|
<div className="catalog-environment-actions">
|
||||||
<UserProfileMenu displayName="DC" subtitle="Каталог компонентов" triggerLabel={null}
|
<UserProfileMenu variant="default" displayName="DC" subtitle="Каталог компонентов" triggerLabel={null}
|
||||||
actions={[{ id: "settings", label: "Настройки", icon: "settings", onSelect: () => setOpen(true) }]} />
|
actions={[{ id: "settings", label: "Настройки", icon: "settings", onSelect: () => setOpen(true) }]} />
|
||||||
<Button variant="primary" tone="neutral" onClick={() => setOpen(true)}>Настройки окружения</Button>
|
<Button variant="primary" tone="neutral" onClick={() => setOpen(true)}>Настройки окружения</Button>
|
||||||
<Button variant="primary" tone="neutral" disabled>Неактивное действие</Button>
|
<Button variant="primary" tone="neutral" disabled>Неактивное действие</Button>
|
||||||
</div>
|
</div>
|
||||||
<div className="catalog-environment-stage"><LandingStage page={settings.pages.home} /></div>
|
<div className="catalog-environment-stage"><LandingStage page={settings.pages.home} /></div>
|
||||||
<EnvironmentSettingsWindow open={open} onClose={() => setOpen(false)} productName="Продукт"
|
<EnvironmentSettingsWindow open={open} onClose={() => setOpen(false)} productName="Продукт"
|
||||||
|
additionalSections={[{ id: "storage", label: "Хранилище", icon: "database", content: <p>Настройки хранения продукта используют общий каркас окна.</p> }]}
|
||||||
surfaces={[{ id: "home", home: true, description: "Главная страница продукта", actions: [] }]}
|
surfaces={[{ id: "home", home: true, description: "Главная страница продукта", actions: [] }]}
|
||||||
settings={settings} state="ready" error={null}
|
settings={settings} state="ready" error={null}
|
||||||
onSave={async draft => { const next = { ...draft, revision: draft.revision + 1 }; setSettings(next); return next; }}
|
onSave={async draft => { const next = { ...draft, revision: draft.revision + 1 }; setSettings(next); return next; }}
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
import {useState} from 'react';
|
||||||
|
import {Button, Description, FeatureSettingsWindow, GlassSurface, Select, SettingsCard, StatusBadge, Switch, TextAreaField, TextField} from '@nodedc/ui-react';
|
||||||
|
|
||||||
|
/** Living acceptance fixture. All materials and control states come from the library. */
|
||||||
|
export function MissionThemeExample() {
|
||||||
|
const [open,setOpen]=useState(false);
|
||||||
|
const [name,setName]=useState('Mission Core');
|
||||||
|
const [enabled,setEnabled]=useState(true);
|
||||||
|
const [mode,setMode]=useState('review');
|
||||||
|
const fields=<div className="catalog-theme-fields">
|
||||||
|
<TextField label="Название" value={name} onChange={event=>setName(event.target.value)}/>
|
||||||
|
<TextAreaField label="Описание" defaultValue="Панель, группа и поле сохраняют собственные поверхности."/>
|
||||||
|
<Select label="Режим" value={mode} options={[{value:'review',label:'Просмотр'},{value:'edit',label:'Редактирование'}]} onChange={setMode}/>
|
||||||
|
<TextField label="Недоступное поле" value="Только чтение" disabled/>
|
||||||
|
</div>;
|
||||||
|
return <SettingsCard title="Фундамент Mission Core" description="Единая тёмная тема: поверхности, поля, действия и окна." actions={<Switch label="Включено" checked={enabled} onChange={setEnabled}/>}>
|
||||||
|
{fields}
|
||||||
|
<GlassSurface tone="group" padding="md" materialRim={false}>
|
||||||
|
<TextField label="Элемент коллекции" defaultValue="Дополнительная ссылка"/>
|
||||||
|
</GlassSurface>
|
||||||
|
<StatusBadge tone="success">Сохранено</StatusBadge>
|
||||||
|
<Button variant="primary" onClick={()=>setOpen(true)}>Открыть настройки</Button>
|
||||||
|
<Description>Поля лежат прямо в SettingsCard; самостоятельный элемент коллекции использует тот же серый материал через GlassSurface tone="group".</Description>
|
||||||
|
<FeatureSettingsWindow open={open} onClose={()=>setOpen(false)} title="Настройки темы" identity={{title:'Профиль',subtitle:'Mission Core',avatarLabel:'DC'}} sections={[{id:'appearance',label:'Оформление',group:'Общие'}]} activeSection="appearance" onSectionChange={()=>{}}>
|
||||||
|
<SettingsCard title="Форма в окне" description="Тот же материал полей в портальном окне.">{fields}</SettingsCard>
|
||||||
|
</FeatureSettingsWindow>
|
||||||
|
</SettingsCard>;
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
import { createPortal } from 'react-dom';
|
||||||
|
import { useEffect, useRef } from 'react';
|
||||||
|
import { createModalController, createModalSizeController, renderPathBar } from '@nodedc/ui-dom';
|
||||||
|
import { renderToStaticMarkup } from 'react-dom/server';
|
||||||
|
import '@nodedc/ui-dom/styles.css';
|
||||||
|
import { Button, Description, Icon } from '@nodedc/ui-react';
|
||||||
|
|
||||||
|
export function ModalSizeExample() {
|
||||||
|
const overlay = useRef<HTMLDivElement>(null), dialog = useRef<HTMLDivElement>(null);
|
||||||
|
const modal = useRef<ReturnType<typeof createModalController> | null>(null);
|
||||||
|
const path = useRef<HTMLDivElement>(null);
|
||||||
|
const saved = useRef({ width: 800, height: 500 });
|
||||||
|
useEffect(() => {
|
||||||
|
renderPathBar(path.current!, [{label:'Файлы',path:'',kind:'folder'},{label:'Изображения',path:'images',kind:'folder'},{label:'example.png',path:'images/example.png',kind:'file',current:true}], {onNavigate: () => {}, icon: kind => { const span=document.createElement('span'); span.innerHTML=renderToStaticMarkup(<Icon name={kind}/>); return span.firstElementChild!; }});
|
||||||
|
const size = createModalSizeController({ dialog: dialog.current!, initialSize: saved.current, onSizeCommit: value => { saved.current = value; } });
|
||||||
|
modal.current = createModalController({ overlay: overlay.current!, dialog: dialog.current!, onOpenChange: open => { if (open) size.refresh(); } });
|
||||||
|
return () => { modal.current?.destroy(); size.destroy(); };
|
||||||
|
}, []);
|
||||||
|
return <><Button onClick={() => modal.current?.open()}>Окно с сохранением размера</Button>
|
||||||
|
{createPortal(<div ref={overlay} hidden><div ref={dialog} className="nodedc-glass" aria-labelledby="modal-size-example-title">
|
||||||
|
<header className="nodedc-window__head"><h2 id="modal-size-example-title" className="nodedc-window__title">Размер модального окна</h2></header>
|
||||||
|
<div className="nodedc-window__body"><Description>Перетаскивание за края и углы. Для клавиатуры: фокус на шапке, Shift + стрелки. Повторное открытие сохраняет размер; уменьшение экрана не меняет предпочтение.</Description><div ref={path}/></div>
|
||||||
|
<footer className="nodedc-window__footer"><Button onClick={() => modal.current?.close()}>Закрыть</Button></footer>
|
||||||
|
</div></div>, document.body)}</>;
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
import { useState } from "react";
|
||||||
|
import { Button, Description, SettingsCard, Window, WindowFooterActions } from "@nodedc/ui-react";
|
||||||
|
|
||||||
|
/** Catalog-only sample: verify host-size independence and centered/floating status copy. */
|
||||||
|
export function OperationalTypographyDemo() {
|
||||||
|
const [open, setOpen] = useState(false);
|
||||||
|
return <>
|
||||||
|
<SettingsCard title="Компактная типографика" description="Значения и секции — 13 px, пояснения — 12 px, заголовок окна — 18 px.">
|
||||||
|
<h3>Подключение</h3>
|
||||||
|
<div>192.168.1.1</div>
|
||||||
|
<Description>Нет сведений о подключении.</Description>
|
||||||
|
<Description role="alert">Не удалось получить ответ устройства.</Description>
|
||||||
|
<Button onClick={() => setOpen(true)}>Проверить типографику окна</Button>
|
||||||
|
</SettingsCard>
|
||||||
|
<Window open={open} size="sm" title="Состояние подключения" onClose={() => setOpen(false)}
|
||||||
|
footer={<WindowFooterActions><Button onClick={() => setOpen(false)}>Понятно</Button></WindowFooterActions>}>
|
||||||
|
<Description role="status">Связь прервалась после приёма команды. Проверьте, выключился ли борт.</Description>
|
||||||
|
</Window>
|
||||||
|
</>;
|
||||||
|
}
|
||||||
@@ -2,11 +2,12 @@ import { StrictMode } from "react";
|
|||||||
import { createRoot } from "react-dom/client";
|
import { createRoot } from "react-dom/client";
|
||||||
import "@nodedc/ui-core/styles.css";
|
import "@nodedc/ui-core/styles.css";
|
||||||
import "./styles.css";
|
import "./styles.css";
|
||||||
|
import { TooltipProvider } from "@nodedc/ui-react";
|
||||||
import { CatalogApp } from "./CatalogApp";
|
import { CatalogApp } from "./CatalogApp";
|
||||||
|
|
||||||
createRoot(document.getElementById("root")!).render(
|
createRoot(document.getElementById("root")!).render(
|
||||||
<StrictMode>
|
<StrictMode>
|
||||||
<CatalogApp />
|
<TooltipProvider><CatalogApp /></TooltipProvider>
|
||||||
</StrictMode>,
|
</StrictMode>,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -2304,3 +2304,8 @@ textarea {
|
|||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.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-sortable-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--nodedc-space-3,12px)}
|
||||||
|
|||||||
+80
-3
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
## Текущее состояние
|
## Текущее состояние
|
||||||
|
|
||||||
Первый этап не меняет существующие приложения. Репозиторий фиксирует baseline и создаёт пакетный контракт. Это позволяет продолжать текущую разработку без одномоментной переделки Engine, Ops, BIM, CMS, SEO и Launcher.
|
Пакетный контракт действует: CMS использует общие tokens, ui-core, ui-dom и ui-react, включая принятую тему Mission Core; Device Core использует общую шапку. Точные consumer pins и границы приведены ниже. Остальные приложения переводятся по отдельным проверенным этапам; наличие общего компонента не означает автоматическую миграцию всех consumer.
|
||||||
|
|
||||||
## Рекомендуемый порядок
|
## Рекомендуемый порядок
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
### 3. CMS и SEO
|
### 3. CMS и SEO
|
||||||
|
|
||||||
Используют те же компоненты и механику окон. CMS подключает DOM-layer, SEO — React-layer. Первым общим admin pattern подключается `MediaSourceField`/`createMediaSourceController`; storage API остаётся в приложении. Цветовые различия оформляются theme overrides.
|
Используют те же компоненты и механику окон. CMS уже подключает DOM-layer и контролируемые React islands; целевой слой SEO — React. Общий admin pattern `MediaSourceField`/`createMediaSourceController`; storage API остаётся в приложении. Цветовые сочетания определяются библиотечным theme preset, без локальных копий палитры.
|
||||||
|
|
||||||
### 4. Engine
|
### 4. Engine
|
||||||
|
|
||||||
@@ -62,7 +62,8 @@
|
|||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- |
|
||||||
| Launcher/Hub | React/local shared | React | header, button, dropdown, window |
|
| Launcher/Hub | React/local shared | React | header, button, dropdown, window |
|
||||||
| SEO | React/local overrides | React | theme, window, field, select |
|
| SEO | React/local overrides | React | theme, window, field, select |
|
||||||
| CMS | Vanilla DOM | DOM | theme, header, modal, select |
|
| CMS | Пакеты + тонкий DOM/React adapter | Подключено, domain UI остаётся в CMS | Mission theme, shell/header, forms, modal, controls |
|
||||||
|
| Device Core | Общий UserProfileMenu, pin 06cb8ad | Шапка подключена, формы без изменений | responsive profile, menu, avatar |
|
||||||
| Engine | React/mixed generations | React | new inspector and environment settings only |
|
| Engine | React/mixed generations | React | new inspector and environment settings only |
|
||||||
| Ops | React/Plane packages | React | floating behavior and modal primitives |
|
| Ops | React/Plane packages | React | floating behavior and modal primitives |
|
||||||
| BIM Viewer | Vanilla JS | DOM | tokens, glass select, settings surfaces |
|
| BIM Viewer | Vanilla JS | DOM | tokens, glass select, settings surfaces |
|
||||||
@@ -87,3 +88,79 @@ The component contract and catalog example are in `ENVIRONMENT_SETTINGS.md`.
|
|||||||
## Mission Core loading (2026-09-08)
|
## Mission Core loading (2026-09-08)
|
||||||
|
|
||||||
Core и Node используют общий sensor-ui/X4 frontend с Button.loading, IconButton.loading и LoadingRegion из Design Guideline. SDK/network semantics остаются в consumer, геометрия ожидания принадлежит DG. Этот локальный кандидат передаётся через source manifest с hashes вместе с Node installer; public npm release не публиковался, исходники компонентов в приложение не копируются.
|
Core и Node используют общий sensor-ui/X4 frontend с Button.loading, IconButton.loading и LoadingRegion из Design Guideline. SDK/network semantics остаются в consumer, геометрия ожидания принадлежит DG. Этот локальный кандидат передаётся через source manifest с hashes вместе с Node installer; public npm release не публиковался, исходники компонентов в приложение не копируются.
|
||||||
|
|
||||||
|
## DC CMS package adoption (2026-11-05)
|
||||||
|
|
||||||
|
DC_CMS now consumes the immutable npm distributions of tokens, ui-core, ui-dom
|
||||||
|
and ui-react, pinned to a canonical source SHA plus package hashes in the
|
||||||
|
consumer's `ui/design-system.lock.json`. Its build renders AppHeader,
|
||||||
|
ApplicationShell, AdminNavigationPanel, ApplicationPanel and control templates
|
||||||
|
from exports. Select, Switch, RangeControl, ProgressBar, StatusBadge and Dropdown
|
||||||
|
run directly as controlled React islands. Core CSS and tokens are bundled once.
|
||||||
|
|
||||||
|
The thin compatibility adapter is `DC_CMS/ui/src/design-system.mjs`: it retains
|
||||||
|
native CMS form/model bindings and listeners, adopts generated field/card/button
|
||||||
|
anatomy, uses ui-dom modal/workspace controllers and connects MediaSourceField's
|
||||||
|
DOM contract to the existing CMS file manager. Folder columns, editable block
|
||||||
|
collections and knowledge content remain domain UI. No package source is copied
|
||||||
|
or maintained as a local component fork. Remove this adapter as those domain
|
||||||
|
renderers move to direct component composition. CMS CI rejects stale generated
|
||||||
|
assets; the existing Git-to-canonical-runner deployment foundation is unchanged.
|
||||||
|
|
||||||
|
CMS visual follow-up, 2026-11-05: flat theme edges, neutral white default accent,
|
||||||
|
UserProfileMenu with a session avatar and inbox glyph, FeatureSettingsWindow,
|
||||||
|
ColorField, pill-shaped split Select, and the canonical six-dot DragHandle.
|
||||||
|
UI preferences belong to authenticated per-user server metadata; site content and deployment
|
||||||
|
credentials stay in the existing CMS model. Immutable npm snapshots retain
|
||||||
|
package semver and are identified by source commit plus archive SHA-256.
|
||||||
|
|
||||||
|
CMS uses `UserProfileMenu`: profile label, menu icon, avatar.
|
||||||
|
The menu opens settings; the application does not add a fourth action.
|
||||||
|
|
||||||
|
|
||||||
|
Device Core and CMS share the complete `UserProfileMenu` header, not local copies.
|
||||||
|
The reference composition is the existing rounded profile group in Launcher/Hub
|
||||||
|
and Engine (`EnginePlatformHeader.tsx` / `TopBar.tsx`); its reusable geometry is
|
||||||
|
already in AppHeader, HeaderProfileButton, IconButton and HeaderAvatar. The owner
|
||||||
|
confirmed the order profile → inbox → avatar and settings inside the middle
|
||||||
|
icon's menu on 2026-11-05. No application CSS overrides are needed.
|
||||||
|
Device Core retains session identity, profile URL, permissions and logout actions.
|
||||||
|
|
||||||
|
|
||||||
|
### 2026-11-05 — Mission dark foundation → CMS
|
||||||
|
|
||||||
|
Owner selected the running local Mission Core as the canonical dark reference.
|
||||||
|
Source audit: b0332fa, styles/base.css and main.tsx; uncommitted simulation changes excluded.
|
||||||
|
The complete Mission/flat preset now lives in tokens + ui-core, exported for React and DOM consumers.
|
||||||
|
CMS consumes the immutable packages and retains only domain layout/event adapters.
|
||||||
|
Nested forms use SettingsCard with a transparent layout grid and opaque fields; collection entries use GlassSurface group. The soft canvas is not a form-group material; no CMS palette.
|
||||||
|
Mission Core itself remains on its existing local package state; its duplicated base overrides are recorded migration debt, not silently updated.
|
||||||
|
|
||||||
|
|
||||||
|
### CMS form composition correction — 2026-11-05
|
||||||
|
|
||||||
|
Mission Core environment settings were verified in the running app: SettingsCard
|
||||||
|
uses the neutral group material, its form grid is transparent, fields are opaque.
|
||||||
|
CMS removes the extra field-grid surface and the card around the full list of
|
||||||
|
content cards. Collection entries and native JSON disclosures adopt the shared
|
||||||
|
GlassSurface group material. No local palette, field colors or business logic
|
||||||
|
are introduced. The prior soft-canvas composition is superseded in THEMING and
|
||||||
|
the living catalog; soft itself remains available for recessed non-form areas.
|
||||||
|
|
||||||
|
## CMS: размеры модальных окон
|
||||||
|
|
||||||
|
CMS подключает `createModalSizeController` из immutable ui-dom package, без копии resize-кода. Тонкий адаптер связывает `media-library` с серверным пользовательским GUI JSON; оформление и размеры записываются через аутентифицированный API. Медиатека остаётся привязанной к сайту, геометрия — к пользователю.
|
||||||
|
|
||||||
|
## CMS: строка пути файлов
|
||||||
|
|
||||||
|
CMS подключает `renderPathBar` и его stylesheet из ui-dom, source `1326ec6`,
|
||||||
|
immutable archive `nodedc-ui-dom-0.7.0-modal.2.tgz`. Адаптер передаёт пути
|
||||||
|
выбранного сайта, стандартный Icon и callback перехода в папку. Общий компонент
|
||||||
|
владеет компактной строкой Finder, разделителями и нейтральными иконками.
|
||||||
|
Сетка файлов, поиск и фильтрация по нескольким типам остаются доменной логикой
|
||||||
|
CMS; переключатели используют общий IconButton. Проверены выбор глубокого
|
||||||
|
пути, переход в каталог, dark/light и узкое окно 390 px.
|
||||||
|
|
||||||
|
## Общие подсказки · 2026-11-16
|
||||||
|
|
||||||
|
Mission Core подключает `TooltipProvider` из ui-react 0.7.1 один раз над приложением. BIM Mod 0.2.45 подключает его в переносимом workspace и переиспользует provider хоста. Существующие HTML `title` обрабатываются через общий портал, SVG-подсказки — через `data-nodedc-tooltip` с доступным именем `aria-label`. Богатый контент использует `Tooltip`. Вложенные приложения не создают второй слой подсказок. Общий материал: скруглённое стекло без border, outline и декоративного rim; keyboard focus самих контролов сохраняется.
|
||||||
|
|||||||
+123
-5
@@ -8,7 +8,8 @@
|
|||||||
|
|
||||||
- `default` — обычная карточка/панель;
|
- `default` — обычная карточка/панель;
|
||||||
- `strong` — dropdown, modal и поверхность над сложным фоном;
|
- `strong` — dropdown, modal и поверхность над сложным фоном;
|
||||||
- `soft` — вложенная или вторичная область.
|
- `soft` — утопленная вторичная область / canvas, не подложка формы;
|
||||||
|
- `group` — нейтральная группа как SettingsCard, для самостоятельного элемента коллекции.
|
||||||
|
|
||||||
`radius="pill"` задаёт каноническую капсульную геометрию через `--nodedc-radius-circle`. Она предназначена, в частности, для компактных вертикальных и горизонтальных реек из круглых действий: верхняя и нижняя части поверхности повторяют круг кнопок без прямых торцевых пролётов. Consumer не воспроизводит этот радиус локальным CSS.
|
`radius="pill"` задаёт каноническую капсульную геометрию через `--nodedc-radius-circle`. Она предназначена, в частности, для компактных вертикальных и горизонтальных реек из круглых действий: верхняя и нижняя части поверхности повторяют круг кнопок без прямых торцевых пролётов. Consumer не воспроизводит этот радиус локальным CSS.
|
||||||
|
|
||||||
@@ -45,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 будут расширением этого контракта, а не локальным классом приложения.
|
||||||
|
|
||||||
@@ -57,6 +58,8 @@ FieldFrame объединяет label, control, hint и description. `labelPlace
|
|||||||
|
|
||||||
## RangeControl
|
## RangeControl
|
||||||
|
|
||||||
|
`RangeControl variant="rail"` — горизонтальный односторонний вариант тонкой шкалы среза: та же толщина `0.2 × --nodedc-control-height`, заполнение слева и текущее `formatValue` над шкалой. Общей подложки, стекла, рамки и тени нет; прозрачная область захвата не ниже 24 px. Native range сохраняет стрелки, Home/End, доступное имя и disabled; focus-visible подчёркивает значение. Точный ввод остаётся у обычного варианта `field`. Позиционирование в viewport и время показа задаёт приложение.
|
||||||
|
|
||||||
Вертикальная шкала занимает `0.2 × --nodedc-control-height` (9.2 px при 46 px), вдвое тоньше предыдущей. Прозрачная область захвата не уже 24 px.
|
Вертикальная шкала занимает `0.2 × --nodedc-control-height` (9.2 px при 46 px), вдвое тоньше предыдущей. Прозрачная область захвата не уже 24 px.
|
||||||
|
|
||||||
Pill-range с заполнением акцентным цветом, встроенной подписью и значением. Домен определяет min/max/step и формат числа. `min/max` задают только рабочий диапазон перетаскивания; ручной ввод по умолчанию принимает любое конечное число и не меняет геометрию ползунка. Опциональный `exactValueBounds` независимо задаёт жёсткие границы ручного ввода: например, `{ min: 0 }` сохраняет неотрицательное значение, но не ограничивает верхнюю границу ползунком.
|
Pill-range с заполнением акцентным цветом, встроенной подписью и значением. Домен определяет min/max/step и формат числа. `min/max` задают только рабочий диапазон перетаскивания; ручной ввод по умолчанию принимает любое конечное число и не меняет геометрию ползунка. Опциональный `exactValueBounds` независимо задаёт жёсткие границы ручного ввода: например, `{ min: 0 }` сохраняет неотрицательное значение, но не ограничивает верхнюю границу ползунком.
|
||||||
@@ -77,9 +80,9 @@ Engine/BIM-геометрия color field: круглый swatch и HEX-знач
|
|||||||
|
|
||||||
## Dropdown
|
## Dropdown
|
||||||
|
|
||||||
Every viewer toolbar uses `nodedc-viewport-controls`: scene, camera, map, replay and observation panes share 70% of standard control geometry (46 → 32.2 px), including icons, typography, padding and rims. The scope normalizes old `compact`/`dense` props and never multiplies scaling in nested groups. Apply it only to action groups, not the renderer, titles, settings or portaled menus. It does not change the material. Floating media WorkspaceWindow consumers may apply this class to their root; their header actions use the same viewport size, while ordinary settings windows retain their own density.
|
Every viewer toolbar uses `nodedc-viewport-controls`: scene, camera, map, replay and observation panes share 70% of standard control geometry (46 → 32.2 px), including icons, typography, padding and rims. The scope normalizes old `compact`/`dense` props and never multiplies scaling in nested groups. Apply it only to action groups, not the renderer, titles, settings or portaled menus. The same scope now supplies scene Glass V4 to control backgrounds (owner revision 2026-11-14). Floating media WorkspaceWindow consumers may apply this class to their root; their header actions use the same viewport size, while ordinary settings windows retain their own density.
|
||||||
|
|
||||||
For opaque controls directly above imagery, `nodedc-scene-controls` adds the same geometry plus a common opaque field surface. Both names consume `--nodedc-viewport-control-scale`; applications must not choose local sizes. Segmented docks align with Select and IconButton.
|
`nodedc-scene-controls` is the compatibility alias for the same geometry and scene Glass V4 material. Both names consume `--nodedc-viewport-control-scale`; applications must not choose local sizes. Segmented docks align with Select and IconButton.
|
||||||
|
|
||||||
Dropdown владеет floating-layer поведением:
|
Dropdown владеет floating-layer поведением:
|
||||||
|
|
||||||
@@ -126,12 +129,16 @@ Window — единая механика открытия modal и правой
|
|||||||
|
|
||||||
Содержание, сохранение и запросы принадлежат приложению.
|
Содержание, сохранение и запросы принадлежат приложению.
|
||||||
|
|
||||||
|
Отсоединённое центральное окно автоматически получает `data-glass-context="scene"` и каноническое стекло viewport. Подтверждение несохранённого профиля использует `allowFloating={false}` и отдельные действия отмены, отказа и сохранения.
|
||||||
|
|
||||||
`WindowFooterActions` размещает группу действий справа, в том числе когда это единственная группа в footer. На узком экране действия переносятся внутри окна. Вспомогательный текст footer может оставаться слева.
|
`WindowFooterActions` размещает группу действий справа, в том числе когда это единственная группа в footer. На узком экране действия переносятся внутри окна. Вспомогательный текст footer может оставаться слева.
|
||||||
|
|
||||||
Modeless Inspector закрывается независимо от результата автосохранения. Приложение сначала закрывает controlled `Window`, затем завершает сохранение асинхронно; сбой сообщает через компактный `ToastStack` с tone `error`, сохраняя draft текущего просмотра. Нельзя удерживать окно открытым, выводить внутри него browser-default `p`/heading или увеличивать текст ошибки до title-размера.
|
Modeless Inspector закрывается независимо от результата автосохранения. Приложение сначала закрывает controlled `Window`, затем завершает сохранение асинхронно; сбой сообщает через компактный `ToastStack` с tone `error`, сохраняя draft текущего просмотра. Нельзя удерживать окно открытым, выводить внутри него browser-default `p`/heading или увеличивать текст ошибки до title-размера.
|
||||||
|
|
||||||
Для modeless Inspector доступен `draggable`: окно двигается за header, не блокирует приложение и ограничивается viewport. Modal-окна не становятся draggable автоматически.
|
Для modeless Inspector доступен `draggable`: окно двигается за header, не блокирует приложение и ограничивается viewport. Modal-окна не становятся draggable автоматически.
|
||||||
|
|
||||||
|
DOM: `createModalSizeController({dialog, initialSize, minimum, onSizeCommit})` дополняет `createModalController` изменением размера за восемь краёв/углов. Шапка получает клавиатурный resize через Shift + стрелки. `setSize` восстанавливает сохранённый размер, `refresh` подгоняет окно после открытия. Подгонка под экран и pointercancel не записывают новое предпочтение. Контроллер не меняет modal/focus contract; приложение хранит размер отдельно для текущего пользователя. Живой пример: «Размер DOM-окна».
|
||||||
|
|
||||||
## WorkspaceWindow
|
## WorkspaceWindow
|
||||||
|
|
||||||
`WorkspaceWindow` — modeless-окно внутри рабочей сцены приложения. Оно рендерится непосредственно в переданном workspace, не использует portal и не может перекрыть шапку, навигацию или соседние панели за пределами этого workspace.
|
`WorkspaceWindow` — modeless-окно внутри рабочей сцены приложения. Оно рендерится непосредственно в переданном workspace, не использует portal и не может перекрыть шапку, навигацию или соседние панели за пределами этого workspace.
|
||||||
@@ -182,6 +189,8 @@ ConfirmationModal оборачивает Window и защищает async-confir
|
|||||||
|
|
||||||
## SplitPane
|
## SplitPane
|
||||||
|
|
||||||
|
Невидимый разделитель остаётся прозрачным при наведении и pointer-resize, даже после ввода в текстовом поле. Клавиатурное изменение размера сохраняет видимый focus cue.
|
||||||
|
|
||||||
`SplitPane` — контролируемая раскладка двух синхронных представлений с общей регулируемой границей. Приложение передаёт содержимое обеих панелей, процент primary-панели и callback изменения; дизайн-система владеет pointer capture, ограничениями размеров, focus-state и доступностью `role="separator"`.
|
`SplitPane` — контролируемая раскладка двух синхронных представлений с общей регулируемой границей. Приложение передаёт содержимое обеих панелей, процент primary-панели и callback изменения; дизайн-система владеет pointer capture, ограничениями размеров, focus-state и доступностью `role="separator"`.
|
||||||
|
|
||||||
Локальные toolbar и overlay каждого viewport являются содержимым соответствующей панели. Их нельзя позиционировать от общего workspace или вычислять по cursor/event-эвристике вложенного renderer. Если renderer хранит свою раскладку, приложение передаёт ему тот же controlled процент из `SplitPane`, чтобы renderer и локальный UI использовали одну геометрию.
|
Локальные toolbar и overlay каждого viewport являются содержимым соответствующей панели. Их нельзя позиционировать от общего workspace или вычислять по cursor/event-эвристике вложенного renderer. Если renderer хранит свою раскладку, приложение передаёт ему тот же controlled процент из `SplitPane`, чтобы renderer и локальный UI использовали одну геометрию.
|
||||||
@@ -228,7 +237,14 @@ Pill navigation для верхней панели и компактного п
|
|||||||
|
|
||||||
## UserProfileMenu
|
## UserProfileMenu
|
||||||
|
|
||||||
Каноническая выпадашка профиля для правой группы `AppHeader`. Она использует
|
Каноническая правая группа `AppHeader`: «Профиль» → inbox → аватар.
|
||||||
|
`UserProfileMenu` владеет всей группой, включая `HeaderProfile`; приложение
|
||||||
|
передаёт только identity и действия. Настройки находятся в меню, отдельной
|
||||||
|
шестерёнки после аватара нет. Нельзя добавлять внешнюю обёртку или локальные
|
||||||
|
отступы. Все три элемента открывают меню; Escape возвращает фокус на вызвавшую кнопку.
|
||||||
|
На узком экране подпись скрывается по общей адаптивной механике; иконка и аватар остаются доступны.
|
||||||
|
|
||||||
|
Она использует
|
||||||
общий portal `Dropdown`, показывает identity cover с аватаром, именем и
|
общий portal `Dropdown`, показывает identity cover с аватаром, именем и
|
||||||
подписью и принимает список application-owned действий.
|
подписью и принимает список application-owned действий.
|
||||||
|
|
||||||
@@ -280,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-контейнер не должен обнулять вертикальный ритм тела
|
||||||
@@ -306,8 +329,29 @@ setup-команды, сохранение, API и права принадлеж
|
|||||||
|
|
||||||
`AdminNavigationPanel` поддерживает сортируемые route-items через общий Drag & Drop contract. Приложение передаёт новый порядок id, а панель использует каноническую шеститочечную ручку Engine. Порядок не хранится отдельно внутри navigation-компонента.
|
`AdminNavigationPanel` поддерживает сортируемые route-items через общий Drag & Drop contract. Приложение передаёт новый порядок id, а панель использует каноническую шеститочечную ручку Engine. Порядок не хранится отдельно внутри navigation-компонента.
|
||||||
|
|
||||||
|
### Сворачивание левой навигации — общий стандарт
|
||||||
|
|
||||||
|
Все левые `AdminNavigationPanel` имеют круглую стрелку рядом с крестиком.
|
||||||
|
В компактном состоянии остаются круги с иконками и стрелка вправо: заголовок,
|
||||||
|
подписи, крестик и вторичные действия скрыты, в том числе от клавиатурного фокуса.
|
||||||
|
Иконки сохраняют доступные имена, выбранный маршрут и Tooltip при наведении/фокусе.
|
||||||
|
Раскрытие возвращает контекстные селекторы, сортировку и дополнительные действия.
|
||||||
|
|
||||||
|
`ApplicationShell` синхронно сжимает колонку до `4.55rem` и расширяет рабочую область
|
||||||
|
на канонической кривой анимации оболочки; содержимое workspace не перемонтируется.
|
||||||
|
Состояние общее для переходов между разделами и открытия/закрытия рабочих поверхностей.
|
||||||
|
Для управляемого состояния: `navigationCollapsed`, `onNavigationCollapsedChange`;
|
||||||
|
начальное — `defaultNavigationCollapsed`. Без shell панель поддерживает `collapsed`,
|
||||||
|
`defaultCollapsed`, `onCollapsedChange`. Приоритет внутри shell принадлежит shell.
|
||||||
|
Библиотека не пишет в localStorage: долговременная персонализация принадлежит приложению.
|
||||||
|
`collapseLabel`/`expandLabel` локализуют подписи. Footer с каноническим
|
||||||
|
`nodedc-admin-panel__nav-icon` сохраняет только этот круг. Right/end panel не сужается.
|
||||||
|
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` размещает её
|
||||||
@@ -356,6 +400,11 @@ Sortable-строки ограничены вертикальной осью: г
|
|||||||
|
|
||||||
Единая accordion-панель для settings и definition controls. Источник — только новый Environment Settings и NDC Agent Inspector.
|
Единая accordion-панель для settings и definition controls. Источник — только новый Environment Settings и NDC Agent Inspector.
|
||||||
|
|
||||||
|
Inspector принимает `header` для полей перед секциями и `footer` для действий после них.
|
||||||
|
Поля header и соседние секции разделяет `--nodedc-space-3` (12 px); footer
|
||||||
|
центрирует действия. Вложенные Inspector сохраняют тот же шаг. Это общий контракт,
|
||||||
|
а не локальные margin-правки потребителя. Вариант `panel` сохраняет компактные строки.
|
||||||
|
|
||||||
Inspector владеет:
|
Inspector владеет:
|
||||||
|
|
||||||
- заголовками разделов;
|
- заголовками разделов;
|
||||||
@@ -413,6 +462,8 @@ StatusBadge `variant="indicator"` отображает только одну л
|
|||||||
|
|
||||||
React `Window` (including `FeatureSettingsWindow`) and `Dropdown` (including Select and ColorField) mount into the active native fullscreen element, falling back to document.body. Menu geometry remains viewport-fixed. Consumers must let an open dialog/menu handle Escape before restoring the fullscreen viewer.
|
React `Window` (including `FeatureSettingsWindow`) and `Dropdown` (including Select and ColorField) mount into the active native fullscreen element, falling back to document.body. Menu geometry remains viewport-fixed. Consumers must let an open dialog/menu handle Escape before restoring the fullscreen viewer.
|
||||||
|
|
||||||
|
A window containing the fullscreen viewport keeps its original portal host and mounted content. Escape restores that viewport first; Tab stays within its visible controls. Newly opened child windows and menus still mount inside fullscreen.
|
||||||
|
|
||||||
### Scene window and accordion actions
|
### Scene window and accordion actions
|
||||||
|
|
||||||
`WorkspaceWindow resizeIndicator={false}` скрывает только видимый уголок. Размер по-прежнему меняется перетаскиванием правого нижнего угла или стрелками при фокусе на ручке; фокус остаётся видимым.
|
`WorkspaceWindow resizeIndicator={false}` скрывает только видимый уголок. Размер по-прежнему меняется перетаскиванием правого нижнего угла или стрелками при фокусе на ручке; фокус остаётся видимым.
|
||||||
@@ -494,6 +545,8 @@ The first optional Hold action controls the existing persisted `autoHide` settin
|
|||||||
|
|
||||||
### Tree · compact outliner
|
### Tree · compact outliner
|
||||||
|
|
||||||
|
Visibility is independent of disclosure. Data/eye updates never re-open selected ancestors or scroll to an old selection. Disclosure uses its arrow (or ArrowLeft/ArrowRight), preserves the scroll position, and does not expand on row double-click. Only a new external selected ID/revealKey requests automatic reveal; asynchronous nodes can complete that pending request.
|
||||||
|
|
||||||
`Tree` accepts stable `TreeNode` IDs, a selected ID and `onSelect`, optional query and visibility callback. Rows stay on one line with ellipsis. Selection reveals ancestors and scrolls only the tree, avoiding page/camera jumps. Arrow keys, Home/End, Enter/Space support navigation. Use the canonical `Window resizable initialRect` for a movable object outliner.
|
`Tree` accepts stable `TreeNode` IDs, a selected ID and `onSelect`, optional query and visibility callback. Rows stay on one line with ellipsis. Selection reveals ancestors and scrolls only the tree, avoiding page/camera jumps. Arrow keys, Home/End, Enter/Space support navigation. Use the canonical `Window resizable initialRect` for a movable object outliner.
|
||||||
|
|
||||||
`Window` end inspectors can opt into `resizable`; the same eight-edge geometry and header Shift+arrow keyboard sizing are used. Existing windows keep their defaults. `DraggableItem` also exposes `activator.attributes` and `activator.listeners` to attach directly to a tile button; separate handles remain the default for existing consumers.
|
`Window` end inspectors can opt into `resizable`; the same eight-edge geometry and header Shift+arrow keyboard sizing are used. Existing windows keep their defaults. `DraggableItem` also exposes `activator.attributes` and `activator.listeners` to attach directly to a tile button; separate handles remain the default for existing consumers.
|
||||||
@@ -519,3 +572,68 @@ Exact `RangeControl` editors synchronize external controlled-value changes while
|
|||||||
Window: `rect` / `onRectCommit` — восстановление и фиксация геометрии инструментов; см. WINDOWS_AND_LAYERS.md. Иконка `minus` дополняет `plus` для управления масштабом содержимого.
|
Window: `rect` / `onRectCommit` — восстановление и фиксация геометрии инструментов; см. WINDOWS_AND_LAYERS.md. Иконка `minus` дополняет `plus` для управления масштабом содержимого.
|
||||||
|
|
||||||
`EditorDockLayout` / `EditorWorkspace`: переносимый редактор с закреплённым основным видом, четырьмя зонами стыковки, разделителями и отрываемыми панелями. Управляемый `EditorDockState` хранится в документе приложения. Шапка редактора не участвует в стыковке; возврат восстанавливает исходный вид. Контракт, keyboard и минимумы — в WINDOWS_AND_LAYERS.md.
|
`EditorDockLayout` / `EditorWorkspace`: переносимый редактор с закреплённым основным видом, четырьмя зонами стыковки, разделителями и отрываемыми панелями. Управляемый `EditorDockState` хранится в документе приложения. Шапка редактора не участвует в стыковке; возврат восстанавливает исходный вид. Контракт, keyboard и минимумы — в WINDOWS_AND_LAYERS.md.
|
||||||
|
|
||||||
|
Размер поясняющего текста `Description` можно задать через
|
||||||
|
`--nodedc-description-font-size`; по умолчанию используется `--nodedc-font-size-sm`.
|
||||||
|
|
||||||
|
Window header actions default to before the move toggle. `headerActionsPlacement="before-close"` places supplied canonical IconButtons between move and close, preserving DOM/Tab order. Deletion confirmation remains application-owned content in the same mounted Window.
|
||||||
|
|
||||||
|
|
||||||
|
## Tooltip
|
||||||
|
|
||||||
|
Общий стандарт: скруглённое стекло Scene Glass без декоративной рамки, outline и обводки. `TooltipProvider` подключается один раз на корне приложения и заменяет браузерные квадратные подсказки `title`, в том числе в старых экранах. Вложенный переносимый модуль использует уже установленный provider. Rich-content `Tooltip` сохраняет собственный триггер; две подсказки одновременно не появляются. `aria-describedby`, клавиатурный фокус, Escape, fullscreen и положение у границ окна сохраняются.
|
||||||
|
|
||||||
|
Нейтральная подсказка с `content`, `children`, необязательными `label`, `focusable`, `disabled` и `placement`. Оборачивает триггер; `focusable` делает читаемую графику доступной клавиатуре, обычная кнопка сохраняет собственный фокус. Hover, focus и touch показывают один общий portal над окном; Escape закрывает подсказку, не родительское окно. Можно перевести курсор в подсказку. Позиция пересчитывается при scroll/resize, с общим clamp/flip. Не содержит действий: для меню используется Dropdown. Нет рамки, акцентных цветов или анимации при reduced motion.
|
||||||
|
|
||||||
|
Принят для запрошенных владельцем пояснений шкал сигнала,10.11.2026; приложение владеет диапазонами и текстом, общий компонент — формой и взаимодействием.
|
||||||
|
|
||||||
|
|
||||||
|
Window, WorkspaceWindow, ApplicationPanel and AdminPanel establish an independent compact md text base, including portals. Native semantic headings inside operational surfaces use md unless an explicit canonical title rule applies. Use Description for result/error/pending paragraphs. The living catalog includes a typography example with values, nested headings and a status dialog. See OPERATIONAL_TYPOGRAPHY.md and the exported build-time `@nodedc/ui-core/typography` contract.
|
||||||
|
|
||||||
|
## Flat surface profile and profile trigger
|
||||||
|
|
||||||
|
The shared theme supports `edges: "flat"` for borderless surfaces, including portal windows. Keyboard focus changes the fill and foreground instead of adding an outline. The living catalog exposes this alongside the Mission appearance switch. `UserProfileMenu` composes the canonical profile label, independent inbox/menu button and avatar. CMS puts settings inside that menu. No additional settings button or HeaderProfile wrapper is needed; spacing comes from existing HeaderProfileButton and IconButton geometry.
|
||||||
|
|
||||||
|
`Select variant="split" shape="pill"` aligns a compact workspace/site selector with adjacent round actions, preserving the shared dimensions and keyboard behavior.
|
||||||
|
|
||||||
|
|
||||||
|
## Mission Core theme foundation
|
||||||
|
|
||||||
|
`missionDarkTheme` и `missionLightTheme` — общий профиль из `@nodedc/ui-core` / `@nodedc/ui-dom`. `applyNodedcTheme` по умолчанию выбирает Mission и flat. Полный контракт цветов и композиции вложенных форм находится в [THEMING.md](THEMING.md). SettingsCard использует семантическую поверхность группы; поля расположены непосредственно в его body, как в Mission Core. GlassSurface tone="group" использует тот же материал для элементов коллекций. tone="soft" не применяется к формам. Ни CMS, ни другой потребитель не повторяет палитру локально. Living catalog содержит форму и её портальную версию.
|
||||||
|
|
||||||
|
## Viewport UI — правило владельца 14.11.2026
|
||||||
|
|
||||||
|
Все элементы интерфейса с подложкой внутри viewport используют общий Glass V4: карты, BIM, LAS/облака точек, 3DGS, PlayCanvas, камеры и replay. Поиск, отдельные кнопки прозрачного action rail, информационные плашки и меню относятся к этому правилу независимо от движка. Обычные панели вне viewport остаются matte. См. [контракт, применение и проверку](VIEWPORT_UI.md).
|
||||||
|
|
||||||
|
## PathBar (DOM)
|
||||||
|
|
||||||
|
`renderPathBar(target, items, {icon, onNavigate})` — компактная строка пути в стиле Finder: нейтральные иконки папок, текст и разделители `›`, без pill-кнопок. Подключается `@nodedc/ui-dom/styles.css`. Папки — клавиатурно доступные кнопки; конечный файл — текст с `aria-current`. Длинный путь прокручивается по горизонтали. Consumer передаёт пути и существующий Icon, хранение и навигация остаются в приложении. Живой пример: «Размер DOM-окна».
|
||||||
|
|
||||||
|
Toolbar `menuWidth` controls inspector menu width (default 220 px, bounded 180–600 px); Dropdown retains viewport clamping. Tree `renderActions(node)` supports per-item information menus without duplicating the outliner. `defaultExpandedDepth` limits initial expansion; selecting an item still reveals and scrolls to its ancestors. BIM uses canonical `ruler` (dimension line), `section` (model/plane), and `isolate` (temporary visibility) glyphs.
|
||||||
|
|
||||||
|
Open Dropdown surfaces observe content size changes and recompute their viewport bounds, including asynchronous property/volume results. Information triggers open on hover or explicit pointer/keyboard activation with `show`. Do not open on focus alone: Escape restores trigger focus and must keep the menu closed.
|
||||||
|
|
||||||
|
|
||||||
|
EditorDockLayout rounds only the external corners of its complete tiled area using the shared panel radius. A left stack has a rounded top-left on its first pane and bottom-left on its last; a bottom row has only the outer lower corners. Internal joins remain square. Corners recompute after docking, closing, resizing or restoring panels. Floating tools retain all four window corners. The primary viewport follows the same outside-edge rule.
|
||||||
|
|
||||||
|
Viewport-scoped Toolbar buttons use the same scene Glass V4 material as the top viewport controls, preserving pressed, disabled and keyboard states. Its rail remains transparent. Compact Tree information actions use `info-plain` at 14 px beside the existing eye.
|
||||||
|
|
||||||
|
Tree supports optional controlled `selectedIds` for multi-selection. Its selection callback includes keyboard modifiers and the Shift range across displayed rows only. Consumers own set semantics and geometry identities; existing single-selection callers remain unchanged. Pointer and keyboard selection share the same path. Visibility and information actions do not alter the selection. The living Tree example demonstrates Shift range, Ctrl add and Command toggle.
|
||||||
|
|
||||||
|
|
||||||
|
ColorField screen sampling (owner direction, 2026-11-14): the shared palette includes a Pipette action. In secure browsers supporting EyeDropper, click “Цвет с экрана”, then any screen pixel, including another application or desktop. Escape cancels without a change. Sampling never starts on pointer leave, never captures a screenshot, and is aborted when the control closes, disables or unmounts. Unsupported browsers expose “Системная палитра”; desktop sampling there depends on the native browser/OS picker. Palette/HEX remain usable regardless. This explicit fallback is the approved exception to the old no-native-dialog rule.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
### 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.
|
||||||
|
|||||||
@@ -17,3 +17,16 @@ The application validates URLs/media bytes, persists uploads and document revisi
|
|||||||
Mission Core passes all existing page definitions and its current operator-environment API. Mission Core Node passes home only and authenticated local presentation storage. Device control never depends on this document. The catalog EnvironmentCatalogDemo exercises the same exported components with an explicitly in-memory save/upload adapter; it is not a persistence service.
|
Mission Core passes all existing page definitions and its current operator-environment API. Mission Core Node passes home only and authenticated local presentation storage. Device control never depends on this document. The catalog EnvironmentCatalogDemo exercises the same exported components with an explicitly in-memory save/upload adapter; it is not a persistence service.
|
||||||
|
|
||||||
Validate the source migration, TypeScript builds, playlist functions, neutral enabled/disabled DOM contract, dark/light and multiple accents, modal Escape, media order/timing and both consumer persistence adapters. Long-running or physical device acceptance remains application-owned.
|
Validate the source migration, TypeScript builds, playlist functions, neutral enabled/disabled DOM contract, dark/light and multiple accents, modal Escape, media order/timing and both consumer persistence adapters. Long-running or physical device acceptance remains application-owned.
|
||||||
|
|
||||||
|
## Product sections (2026-11-08)
|
||||||
|
|
||||||
|
`additionalSections` accepts `{ id, label, icon, group?, content, footer? }`.
|
||||||
|
Use unique IDs other than `environment`. Content and footer are product-owned;
|
||||||
|
the shared shell retains navigation, focus, dragging, Escape and geometry.
|
||||||
|
Environment drafts remain intact when switching sections. Each section owns its
|
||||||
|
loading/error/saving states. No product API is called by the shared library.
|
||||||
|
Mission Core uses this extension for the owner-requested Storage section.
|
||||||
|
|
||||||
|
The canonical `pin` icon is the Lucide Pin glyph. Pair it with IconButton and
|
||||||
|
`aria-pressed` for pinned state; use a busy/disabled state during preparation.
|
||||||
|
An absent local copy and an unpinned copy are separate states.
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
# Favorites
|
||||||
|
|
||||||
|
Use the registered `star` icon in an IconButton with `aria-pressed`. The unset state is outline-only; the selected glyph uses `fill="currentColor"`. Keep the same hit target in both states. Place a card favorite action in its upper trailing corner, independent of opening the card. Persist the domain value at its owner; filtering favorites must not change it.
|
||||||
|
|
||||||
|
For a star without a surrounding disc, use `IconButton surface="none"`. The shared component owns the transparent surface and foreground; applications only position it. Keyboard focus and the hit target remain unchanged.
|
||||||
@@ -59,3 +59,6 @@
|
|||||||
## Владение
|
## Владение
|
||||||
|
|
||||||
У дизайн-системы должен быть явный code owner. Product team может предлагать компоненты, но общий API и theme contract проходят отдельное review, потому что изменение распространяется на все будущие приложения.
|
У дизайн-системы должен быть явный code owner. Product team может предлагать компоненты, но общий API и theme contract проходят отдельное review, потому что изменение распространяется на все будущие приложения.
|
||||||
|
|
||||||
|
|
||||||
|
Typography is a build gate, not a recommendation. See `OPERATIONAL_TYPOGRAPHY.md`: operational values/sections 13 px, descriptions/status/error copy 12 px, canonical window/page titles 18 px. Browser defaults, new local sizes and inline font overrides fail validation. The frozen compact legacy list cannot be expanded for new UI; exceptions require an explicit owner decision.
|
||||||
|
|||||||
@@ -49,3 +49,17 @@ hover, focus, disabled и pending принадлежат кнопке. `activity
|
|||||||
Раскрытие строки вниз: `chevron-down` в закрытом состоянии, `chevron-up` в открытом; кнопка сообщает `aria-expanded` и `aria-controls`.
|
Раскрытие строки вниз: `chevron-down` в закрытом состоянии, `chevron-up` в открытом; кнопка сообщает `aria-expanded` и `aria-controls`.
|
||||||
|
|
||||||
`rotate-clockwise` — поворот изображения по часовой стрелке. Применение: независимая ориентация объективов Insta360 в Центре наблюдения Mission Core, по запросу владельца 09.10.2026. Шаг задаёт приложение; подпись кнопки сообщает угол. Состояния и геометрия принадлежат каноническому `IconButton`.
|
`rotate-clockwise` — поворот изображения по часовой стрелке. Применение: независимая ориентация объективов Insta360 в Центре наблюдения Mission Core, по запросу владельца 09.10.2026. Шаг задаёт приложение; подпись кнопки сообщает угол. Состояния и геометрия принадлежат каноническому `IconButton`.
|
||||||
|
|
||||||
|
`power` — штатное выключение компьютера. Запрошено владельцем Mission Core 04.11.2026 для шапки окна «Бортовой компьютер». Используется в стандартном `IconButton` с доступной подписью; недоступность и выполняемое действие блокируют кнопку. Нажатие открывает `ConfirmationModal`; сам glyph не запускает выключение. Живой каталог получает иконку из `registry/icons.json`.
|
||||||
|
|
||||||
|
BIM controls use `ruler` (dimension line with extension lines/arrows), `section` (model intersected by a plane), `isolate` (temporary visibility/glasses), `perspective`/`orthographic` (projection cubes), and `fit-view` (frame extents). `info-plain` is an unframed i for compact tree actions next to the visibility eye; use 14 px for both glyphs. They share the canonical stroke and accessible control behavior.
|
||||||
|
|
||||||
|
Semantic references: [Revit measurement](https://help.autodesk.com/cloudhelp/2024/ENU/Revit-Model/files/GUID-65EA44EC-C777-4C97-8718-5783C3A80B0A.htm), [temporary hide/isolate](https://help.autodesk.com/cloudhelp/2014/ENU/Revit-LT/files/GUID-A5E51D5E-8E18-4834-8A2F-8B4E3E6379A1.htm), [section box](https://help.autodesk.com/cloudhelp/2024/ENU/Revit-GetStarted/files/GUID-C9EA51CB-3214-4BD8-AD55-3BEB1CCD15B6.htm). Glyphs are original monochrome NODE.DC vectors; this does not claim copied Autodesk artwork or full Section Box functionality.
|
||||||
|
|
||||||
|
|
||||||
|
### Блокировка в дереве
|
||||||
|
|
||||||
|
`lock` / `unlock` показывают закрытый / открытый замок. Компактное действие
|
||||||
|
дерева использует прозрачную кнопку без `aria-pressed` и без белой активной
|
||||||
|
подложки; доступное имя описывает действие «Разблокировать» / «Заблокировать».
|
||||||
|
Состояние передаётся формой замка. Уменьшение glyph не уменьшает область нажатия.
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
# LevelButton
|
||||||
|
|
||||||
|
Measured resource level inside the standard pill Button. Initial consumer: Mission
|
||||||
|
Core battery state in the observatory header. Width is 2.5 canonical controls;
|
||||||
|
height, focus, keyboard, disabled and hover grammar remain Button-owned.
|
||||||
|
|
||||||
|
`value` is a fraction in [0,1]; unknown/NaN has no fill and displays an em dash.
|
||||||
|
`valueText` supplies the visible value; `label` names the resource. `freshness`
|
||||||
|
is live, stale or unknown. Stale retains the reading, neutralises fill and adds
|
||||||
|
accessible last-reading text. No animation, no fabricated progress, no nested
|
||||||
|
interactive elements. `levelTone` uses semantic tokens, never a local palette.
|
||||||
|
|
||||||
|
Click opens domain details supplied by the consumer. The consumer decides which
|
||||||
|
physical resource is selected; it must not average unrelated batteries or treat
|
||||||
|
a stale number as fresh. Catalog includes normal, stale and unavailable states.
|
||||||
|
|
||||||
|
An explicit operator-selected `fillColor` (#RRGGBB) overrides semantic tint.
|
||||||
|
The measured fraction clips a solid fill and a second, aria-hidden copy of its
|
||||||
|
label. WCAG luminance chooses black/white text independently over the filled
|
||||||
|
part, while the unfilled part keeps the normal theme text. Unknown has no fill;
|
||||||
|
stale retains the chosen colour and its accessible stale label. Colour-range
|
||||||
|
configuration belongs to the domain profile, not the visual component.
|
||||||
|
|
||||||
|
`geometry={{width, height, radius}}` задаёт операторские размеры с минимумом
|
||||||
|
32 × 12 px. Ниже 64 × 24 текст и padding уменьшаются пропорционально
|
||||||
|
ограничивающему размеру; длинная подпись также учитывается. Оба слоя текста
|
||||||
|
наследуют одинаковые размеры. Без geometry сохраняется прежний размер Button.
|
||||||
|
Внешний отступ от соседних действий остаётся ответственностью композиции шапки.
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
# Shared Cesium React adapter
|
# Shared Cesium React adapter
|
||||||
|
|
||||||
`@nodedc/map-cesium-react 0.1.0` is the shared renderer boundary for the
|
`@nodedc/map-cesium-react 0.1.2` is the shared renderer boundary for the
|
||||||
canonical `Map Page 0.1.0` and CesiumJS `1.143.0`.
|
canonical `Map Page 0.1.0` and CesiumJS `1.147.0`.
|
||||||
|
|
||||||
It is not a Foundry application component and does not own product navigation,
|
It is not a Foundry application component and does not own product navigation,
|
||||||
Inspector fields, tokens, provider allowlists, TileCache storage or admin
|
Inspector fields, tokens, provider allowlists, TileCache storage or admin
|
||||||
@@ -25,7 +25,7 @@ must not be used as a substitute for the `DC Default` treatment.
|
|||||||
|
|
||||||
- The browser receives only same-origin BFF paths.
|
- The browser receives only same-origin BFF paths.
|
||||||
- Runtime config must use `missioncore.map-runtime/v1`, Map Page `0.1.0` and
|
- Runtime config must use `missioncore.map-runtime/v1`, Map Page `0.1.0` and
|
||||||
Cesium `1.143.0`.
|
Cesium `1.147.0`.
|
||||||
- Canonical assets are fixed to imagery `2`, terrain `1` and buildings
|
- Canonical assets are fixed to imagery `2`, terrain `1` and buildings
|
||||||
`96188`.
|
`96188`.
|
||||||
- Provider endpoint documents must declare `credentialMode=gateway`.
|
- Provider endpoint documents must declare `credentialMode=gateway`.
|
||||||
@@ -95,3 +95,11 @@ height must not leave a visible head with its stem hidden below terrain.
|
|||||||
|
|
||||||
Motion never recreates the Cesium viewer or any provider. A renderer teardown
|
Motion never recreates the Cesium viewer or any provider. A renderer teardown
|
||||||
stops its single animation frame loop.
|
stops its single animation frame loop.
|
||||||
|
|
||||||
|
## Визуальные настройки и профили · 17.11.2026
|
||||||
|
|
||||||
|
`MapVisualSettings` дополнен необязательными полями `MapSceneEffects`: небо/солнце/луна, цвет света и тени, детализация рельефа, разрешение, FXAA, HDR/exposure/tonemapper, Bloom и HBAO. `DEFAULT_MAP_SCENE_EFFECTS` соответствует исходным значениям Cesium 1.147. Отсутствующие поля не меняют поведение других потребителей. Применение обновляет живую сцену; viewer, camera, providers, тайловые маршруты и доменные объекты не пересоздаются. HBAO включается только при поддержке графического контекста.
|
||||||
|
|
||||||
|
Для большого набора настроек используется `FeatureSettingsWindow`, слева разделы; контролы — `Checker`, `RangeControl` с exactValueBounds, `ColorField`, `Select`. Настройки спутниковой подложки не являются цветокоррекцией BIM/гауссов; OSM style не меняет их материалы. HDR exposure/tonemapper действует только при включённом HDR. Нативные API сверены с исходниками 1.147 и [Cesium PostProcessStageCollection](https://cesium.com/learn/cesiumjs/ref-doc/PostProcessStageCollection.html).
|
||||||
|
|
||||||
|
Профили сохраняет host через revision/atomic JSON. Снимок содержит только визуальные настройки и слои; не копирует камеру, размещение, токены, routing или cache intent. Применение профиля не меняет пространственный контекст. Выбор доступен в модалке и в стеклянном меню слоёв (`Dropdown surfaceClassName="nodedc-viewport-surface"`).
|
||||||
|
|||||||
+19
-2
@@ -231,9 +231,9 @@ Page/Visual/Application previews не содержат shipped domain fixtures.
|
|||||||
|
|
||||||
Во внутренней sandbox-сборке Map Page временно скрывает визуальный credit overlay renderer, потому что он перекрывает рабочую композицию во время настройки шаблона. Метаданные provider attribution не удаляются из runtime. Перед любым внешним, пользовательским или коммерческим развёртыванием overlay должен быть возвращён в соответствии с условиями выбранного provider. Это зафиксированный технический долг, а не правило production-интерфейса.
|
Во внутренней sandbox-сборке Map Page временно скрывает визуальный credit overlay renderer, потому что он перекрывает рабочую композицию во время настройки шаблона. Метаданные provider attribution не удаляются из runtime. Перед любым внешним, пользовательским или коммерческим развёртыванием overlay должен быть возвращён в соответствии с условиями выбранного provider. Это зафиксированный технический долг, а не правило production-интерфейса.
|
||||||
|
|
||||||
## Cesium adapter 1.143
|
## Cesium adapter 1.147
|
||||||
|
|
||||||
Текущий reference adapter использует CesiumJS `1.143.0`. Он загружается отдельным lazy chunk только при открытии Map Page и преобразует только declared Application bindings в реальные Cesium entities. Пустая Map Page не содержит domain entities.
|
Текущий reference adapter использует CesiumJS `1.147.0`. Он загружается отдельным lazy chunk только при открытии Map Page и преобразует только declared Application bindings в реальные Cesium entities. Пустая Map Page не содержит domain entities.
|
||||||
|
|
||||||
Server-side runtime contract:
|
Server-side runtime contract:
|
||||||
|
|
||||||
@@ -319,3 +319,20 @@ Data Plane, а не Map Template.
|
|||||||
факте для quality/diagnostics, но не образуют дополнительные UI-фильтры. Цвет,
|
факте для quality/diagnostics, но не образуют дополнительные UI-фильтры. Цвет,
|
||||||
геометрия таргета, label и порядок фильтров остаются в Foundry presentation
|
геометрия таргета, label и порядок фильтров остаются в Foundry presentation
|
||||||
profile.
|
profile.
|
||||||
|
|
||||||
|
## Domain geometry in the existing renderer
|
||||||
|
|
||||||
|
`@nodedc/map-cesium-react` 0.1.1 adds optional `onSceneReady(context)`;
|
||||||
|
Version 0.1.2 pins CesiumJS to **1.147.0**, retaining this callback contract. Existing consumers need no changes.
|
||||||
|
`context` contains the existing `Cesium` namespace, renderer-owned `viewer`,
|
||||||
|
and an abort `signal`. A consumer can attach ready domain geometry, pick
|
||||||
|
objects and move the camera, returning synchronous cleanup for its own
|
||||||
|
entities, primitives and listeners. Cleanup runs after abort and before
|
||||||
|
viewer destruction, including provider toggles and renderer recovery.
|
||||||
|
Asynchronous work must check the signal before attaching anything.
|
||||||
|
|
||||||
|
The callback must not create another Viewer, replace providers, introduce
|
||||||
|
upstream credentials, or bypass the same-origin runtime/Map Gateway. Prepared
|
||||||
|
BIM mesh residency, product leases, geometry budgets and project placement
|
||||||
|
belong to the portable BIM consumer. The shared adapter retains sole ownership
|
||||||
|
of imagery, terrain, buildings, network/cache intent and render recovery.
|
||||||
|
|||||||
@@ -11,3 +11,5 @@ Visible hit regions have native tooltips, hover, keyboard focus, Enter/Space act
|
|||||||
Presentation props: `size` in CSS pixels (default 66), `face`, `text`, `edge`, `hover`, `hoverText`, `opacity`. Consumer preferences may persist these; omitted colors inherit theme tokens. Core exposes these under viewport settings → 3D-куб.
|
Presentation props: `size` in CSS pixels (default 66), `face`, `text`, `edge`, `hover`, `hoverText`, `opacity`. Consumer preferences may persist these; omitted colors inherit theme tokens. Core exposes these under viewport settings → 3D-куб.
|
||||||
|
|
||||||
Face labels use the projected face-local right/up basis, including foreshortening and rotation; they never billboard towards the screen. `edgeOpacity` (0–1, default 1) independently controls structural grid/edge strokes without fading faces or labels.
|
Face labels use the projected face-local right/up basis, including foreshortening and rotation; they never billboard towards the screen. `edgeOpacity` (0–1, default 1) independently controls structural grid/edge strokes without fading faces or labels.
|
||||||
|
|
||||||
|
`faceOpacity` (0–1, default 1) controls polygon fill only. It is independent of `edgeOpacity`, text and the legacy overall `opacity`; a transparent face remains a navigation target.
|
||||||
|
|||||||
@@ -29,3 +29,38 @@ Explanatory paragraphs use `Description`, the same contract as `SettingsCard.des
|
|||||||
пояснения вне карточки также используют `Description` с `role="status"`, если
|
пояснения вне карточки также используют `Description` с `role="status"`, если
|
||||||
нужно объявление для скринридера. Заголовки, значения полей и кнопки сохраняют
|
нужно объявление для скринридера. Заголовки, значения полей и кнопки сохраняют
|
||||||
собственную типографику; глобальный стиль для всех `p` страницы не вводится.
|
собственную типографику; глобальный стиль для всех `p` страницы не вводится.
|
||||||
|
|
||||||
|
|
||||||
|
## Обязательная проверка сборки — 10.11.2026
|
||||||
|
|
||||||
|
Операционный UI имеет собственный базовый `md` (13 px), в том числе портальные
|
||||||
|
`Window`, `WorkspaceWindow`, `ApplicationPanel` и `AdminPanel`. Размер body
|
||||||
|
внешнего приложения не является контрактом. Корневой размер `html` не меняется:
|
||||||
|
rem и пользовательское масштабирование остаются доступными. Семантические
|
||||||
|
h1–h6 внутри этих поверхностей по умолчанию используют md, а явные канонические
|
||||||
|
заголовки страницы/окна — title (18 px). Значения и заголовки секций — md;
|
||||||
|
пояснения, ошибки, ожидание и результат команды — `Description` / sm (12 px).
|
||||||
|
|
||||||
|
Правило исполняется модулем `@nodedc/ui-core/typography` и обязательным
|
||||||
|
`npm run test:typography` Design Guideline. Mission Core запускает
|
||||||
|
`check:typography` перед сборкой Control Station и Node UI, а также в полном
|
||||||
|
наборе unit-тестов. Проверяется исходный код всех экранов, общих пакетов и
|
||||||
|
frontend-плагинов, а не только последний изменённый компонент.
|
||||||
|
|
||||||
|
Проверка запрещает новые локальные размеры вместо токенов, lg/title для данных,
|
||||||
|
увеличивающие calc/clamp/em, font shorthand, inline fontSize и обычные p без
|
||||||
|
явного класса. Сохранившиеся компактные значения старого UI (не более 13 px)
|
||||||
|
зафиксированы по файлу, селектору и значению в `typography-policy.json`;
|
||||||
|
добавлять туда новый UI запрещено. При изменении такого правила его переводят
|
||||||
|
на токен, запись удаляют. Список не допускает крупных значений даже при ошибочном
|
||||||
|
добавлении. Исключения перечислены отдельно с причиной и точным выражением:
|
||||||
|
существующая обложка LandingStage, подписи в координатах SVG и управляемый
|
||||||
|
пользователем масштаб сцены. Они не разрешают увеличивать текст рабочих панелей.
|
||||||
|
Начальный размер значений батареи — 13 px; сохранённый пользователем масштаб
|
||||||
|
3D-сцены не перезаписывается.
|
||||||
|
|
||||||
|
Изменение шкалы токенов, списка ролей или исключений требует явного решения
|
||||||
|
владельца продукта и обновления живого каталога. Нельзя ослаблять проверку ради
|
||||||
|
одного экрана, закрывать проблему локальным font-size или менять масштаб html.
|
||||||
|
При приёмке проверяют computed font-size в обычном и плавающем окне, на узкой
|
||||||
|
ширине, а также ожидание, ошибку, пустое состояние и результат команды.
|
||||||
|
|||||||
@@ -13,3 +13,6 @@ aria-valuenow отсутствует. `label` обязателен; `valueText`
|
|||||||
ResourceRow.progress занимает свободное место между текстом и actions, скрывает
|
ResourceRow.progress занимает свободное место между текстом и actions, скрывает
|
||||||
status, на узком экране переносится ниже текста. Готовность не вычисляется
|
status, на узком экране переносится ниже текста. Готовность не вычисляется
|
||||||
компонентом. Каталог содержит завершённый, определённый и неизвестный прогресс.
|
компонентом. Каталог содержит завершённый, определённый и неизвестный прогресс.
|
||||||
|
|
||||||
|
Размер полосы задаётся опциональным `--nodedc-progress-height`; по умолчанию
|
||||||
|
используется `--nodedc-space-2`. Плотность не меняет поведение и ARIA-состояния.
|
||||||
|
|||||||
+66
-62
@@ -1,78 +1,82 @@
|
|||||||
# Темы и цвет приложения
|
# Темы и цвет приложения
|
||||||
|
|
||||||
## Основное правило
|
## Один фундамент
|
||||||
|
|
||||||
NODE.DC-приложения отличаются цветовой схемой, а не набором заново нарисованных компонентов. Тема задаёт значения CSS custom properties. Компоненты сохраняют геометрию, состояния и поведение.
|
С 2026-11-05 основа тёмной темы — проверенный локальный Mission Core
|
||||||
|
(`b0332fa`, `apps/control-station/src/styles/base.css`, работающий интерфейс
|
||||||
|
`127.0.0.1:8000`). Цвета находятся только в `@nodedc/tokens/themes.css`,
|
||||||
|
геометрия и состояния — в `@nodedc/ui-core`, компоненты — в `@nodedc/ui-react`.
|
||||||
|
Приложение выбирает тему, а не повторяет цвета, селекторы или устройство компонентов.
|
||||||
|
|
||||||
## Что меняет тема
|
```ts
|
||||||
|
import {applyNodedcTheme, missionDarkTheme} from '@nodedc/ui-core';
|
||||||
|
applyNodedcTheme(document.documentElement, missionDarkTheme);
|
||||||
|
```
|
||||||
|
|
||||||
- canvas/background;
|
Те же exports доступны из `@nodedc/ui-dom`. `applyNodedcTheme(root)` по умолчанию
|
||||||
- основной и вторичный текст;
|
выбирает `dark / mission / flat`. `missionLightTheme` сохраняет общую геометрию
|
||||||
- accent и автоматически вычисляемый on-accent;
|
и даёт светлую тему. Установка на `document.documentElement` обязательна для
|
||||||
- цвет непрозрачных application surfaces;
|
приложения с порталами: меню и модальные окна получают тот же профиль.
|
||||||
- field/control surfaces;
|
|
||||||
- overlay;
|
|
||||||
- тени controls и modal material;
|
|
||||||
- semantic success/warning/danger tones при необходимости.
|
|
||||||
|
|
||||||
## Что тема не меняет
|
## Роли поверхностей
|
||||||
|
|
||||||
- высоту контролов;
|
| Роль | Тёмная тема | Компонент |
|
||||||
- радиусы по классам компонентов;
|
| --- | --- | --- |
|
||||||
- положение логотипа;
|
| Фон приложения | `#050506` | ApplicationShell |
|
||||||
- механику окна и dropdown;
|
| Рабочая сцена | `#08090b` | доменный viewport, token `--nodedc-stage` |
|
||||||
- DOM anatomy;
|
| Панель | `#151517` | ApplicationPanel, AdminNavigationPanel |
|
||||||
- keyboard behavior;
|
| Группа | нейтральный слой `110 110 110 / .07` | SettingsCard |
|
||||||
- расположение footer actions;
|
| Элемент коллекции | нейтральный слой `110 110 110 / .07` | GlassSurface tone="group" |
|
||||||
- API React/DOM компонентов.
|
| Утопленная вторичная область | `#0d0d0f` | GlassSurface tone="soft", вне форм |
|
||||||
|
| Поле | `#2a2a2c`, непрозрачное | TextField, TextAreaField, Select, MediaSourceField |
|
||||||
|
| Модальное окно | `15 15 17 / .97` | FeatureSettingsWindow, Window |
|
||||||
|
| Выпадающее меню | `15 15 17 / .98` | Dropdown, Select portal |
|
||||||
|
| Основное действие | `247 248 244 / .96`; тёмный текст | Button |
|
||||||
|
|
||||||
## Presets
|
ApplicationPanel → SettingsCard → поля — композиция, проверенная в работающих
|
||||||
|
настройках Mission Core. Сетка полей прозрачная, без отдельной подложки и отступов.
|
||||||
|
Самостоятельный элемент коллекции может использовать GlassSurface tone="group":
|
||||||
|
тот же нейтральный материал SettingsCard, а не почти чёрный canvas-soft.
|
||||||
|
Не добавлять карточку вокруг списка карточек или вокруг каждого поля; максимум
|
||||||
|
два уровня групп сохраняют отличие непрозрачного поля от подложки.
|
||||||
|
|
||||||
В baseline включены `dark` и `light`. Это не два отдельных продукта, а примеры одного контракта:
|
Исправление 2026-11-05: прежний пример с tone="soft" ошибочно переносил цвет
|
||||||
|
вторичного canvas в формы. Значение soft сохранено для его исходной роли;
|
||||||
|
приложения исправляют композицию, а не перекрашивают canvas локальным CSS.
|
||||||
|
|
||||||
- dark соответствует текущей основной семье Launcher/Hub/CMS;
|
Основной/вторичный/приглушённый/недоступный текст использует оттенок
|
||||||
- light воспроизводит SEO-поверхности: `#ececec` canvas, белые панели и поля, тёмный текст, чёрные primary actions и мягкую тень у белых secondary controls;
|
`247 248 244` с непрозрачностью `.96 / .72 / .48 / .34`. Состояния hover,
|
||||||
- конкретный продукт может поверх preset задать свой accent и surface variables.
|
active, focus, disabled задаёт библиотека; приложения не переопределяют их.
|
||||||
|
Hover поля использует собственный непрозрачный материал, а не полупрозрачную
|
||||||
|
заливку кнопки: поле не исчезает при наведении.
|
||||||
|
Декоративные рамки и контуры отсутствуют. Клавиатурный фокус остаётся видимым
|
||||||
|
через контрастную заливку. Success/warning/danger сохраняют смысловые цвета
|
||||||
|
индикаторов; цвет акцента не подменяет состояние ошибки.
|
||||||
|
|
||||||
## Accent
|
## Акцент и настройки
|
||||||
|
|
||||||
Accent задаётся RGB tuple. On-accent вычисляется по luminance и не должен вручную прописываться белым или чёрным в отдельном компоненте.
|
Базовый акцент тёмной темы — `247 248 244`, светлой — `24 25 28`.
|
||||||
|
Пользовательский `accent` остаётся допустимой настройкой активных контролов.
|
||||||
|
`on-accent` вычисляется библиотекой по яркости. Нейтральное основное действие
|
||||||
|
остаётся нейтральным. Возврат к теме вызывает `clearNodedcAccent(root)`, затем
|
||||||
|
`applyNodedcTheme`; удалять пользовательское значение без явного сброса нельзя.
|
||||||
|
Материалы можно исследовать в каталоге; приложения не должны хранить собственный
|
||||||
|
набор цветов для восстановления стандартной темы.
|
||||||
|
|
||||||
Default accent текущего NODE.DC shell — `#ff2f92`. `ColorField` открывает единый portal-picker с saturation/value plane, hue slider, HEX и быстрыми цветами — системный `input[type=color]` не является runtime UI. Изменение accent сразу меняет Environment Settings, active actions, range fill, media file action и theme-aware window states без создания новой темы или fork компонентов. Blur, gloss и material rim не наследуются application panels: это материал только для floating modal и portal-dropdown/select.
|
В светлой теме canvas — `#ececec`, панели и поля — белые, группы и вложенные
|
||||||
|
области — `#f4f4f4`. Белое поле различимо внутри группы.
|
||||||
|
Map-glass остаётся отдельным светлым полупрозрачным материалом над изображением;
|
||||||
|
он не заменяет обычную тему форм, панелей и портальных окон.
|
||||||
|
|
||||||
Semantic status не обязан совпадать с accent. Например, ошибка остаётся danger, даже если приложение использует красный брендовый accent.
|
## Проверка и совместимость
|
||||||
|
|
||||||
## Область применения
|
Living catalog: Controls → Mission Core. Проверяются вложенная форма, текст,
|
||||||
|
select, textarea, disabled, переключатель, статус и то же содержимое в портальном
|
||||||
|
окне; дополнительно проверяются клавиатура и обе темы. CMS использует этот же
|
||||||
|
профиль и immutable npm-пакеты, не копию исходников компонентов.
|
||||||
|
|
||||||
Тема может быть установлена:
|
`appearance: "default", edges: "default"` оставлены для явной совместимости
|
||||||
|
со старой презентацией компонентов. Новые потребители используют Mission.
|
||||||
- на корневом `html/body` для всего приложения;
|
Эта ревизия не меняет локальный Mission Core и его незакоммиченные эксперименты.
|
||||||
- на контейнере embedded-модуля;
|
Его прежние локальные CSS-дубли зафиксированы как миграционный долг: перенос
|
||||||
- на catalog preview для сравнения схем.
|
зависимости требует отдельной проверки приложения, а не незаметной замены пакетов.
|
||||||
|
|
||||||
Portal-компоненты рендерятся в `document.body`, поэтому приложение должно либо задавать тему на `document.documentElement`, либо передавать согласованные переменные на body. Локальная тема глубоко внутри React subtree не сможет автоматически охватить portal без отдельного theme portal root.
|
|
||||||
|
|
||||||
Map-glass overlays являются отдельной, независимой от application theme
|
|
||||||
поверхностью поверх imagery. Их светлые translucent controls используют
|
|
||||||
`--nodedc-map-glass-text`, а непрозрачное светлое поле поиска обязано брать
|
|
||||||
тёмный foreground из `--nodedc-map-field-text` и placeholder из
|
|
||||||
`--nodedc-map-field-text-muted`. Светлый field не наследует белый текст
|
|
||||||
map-glass родителя. `ApplicationSidePanel`, напротив, находится вне imagery и
|
|
||||||
всегда наследует обычные theme-aware application panel/text tokens; при смене
|
|
||||||
dark/light она меняется синхронно с `AdminNavigationPanel`.
|
|
||||||
|
|
||||||
## Совместимость
|
|
||||||
|
|
||||||
Существующие `--nodedc-*` имена сохранены намеренно. Это уменьшает стоимость будущего подключения Launcher, Engine, Task Manager и BIM Viewer.
|
|
||||||
|
|
||||||
## Mission Core operator appearance
|
|
||||||
|
|
||||||
`applyNodedcTheme(document.documentElement, { theme, accent, appearance: "mission" })`
|
|
||||||
selects the shared visual profile qualified against Mission Core on 2026-09-30.
|
|
||||||
It covers body portals, dark modal/floating fills, plain avatar surfaces,
|
|
||||||
neutral actions and semantic dot statuses. `default` remains compatible with
|
|
||||||
other consumers. Light theme retains its legible light surfaces. Reapplying
|
|
||||||
`default` removes the profile through the data attribute, without CSS cleanup.
|
|
||||||
Feature settings use the same geometry, focus, scrolling and responsive behavior.
|
|
||||||
Application code owns section names and icons; tracker/VPS sections follow the
|
|
||||||
text-only Mission equipment menu. Environment settings may retain their icons.
|
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
# Интерфейс внутри viewport
|
||||||
|
|
||||||
|
Правило владельца от 14.11.2026. Любая подложка интерфейса поверх изображения viewport — общий **Glass V4**, тот же материал, что информационные плашки аппаратов. Правило одинаково для MapLibre/Cesium, IFC/BIM, point cloud/LAS, 3DGS, PlayCanvas, камер и replay; новые движки не создают новый материал.
|
||||||
|
|
||||||
|
## Применение
|
||||||
|
|
||||||
|
- Поиск, панели действий, легенды, статусы и плавающие плашки: `GlassMaterialSurface context="scene"`. `radius="panel"` для текста/поиска. У рейки круглых действий фон получают сами кнопки; общий контейнер остаётся прозрачным, без общей капсулы (уточнение владельца 14.11). На существующий семантический overlay разрешён DOM-контракт `className="nodedc-viewport-surface" data-glass-context="scene"`; позиционирование и радиус остаются у композиции.
|
||||||
|
- `nodedc-viewport-controls` и совместимый `nodedc-scene-controls` сохраняют масштаб 0.7 и задают Glass V4 кнопкам, select и segmented. Нельзя оборачивать этим scope весь renderer ради изменения размеров текста.
|
||||||
|
- Стекло меняет фон, а не opacity всей кнопки: иконки/текст сохраняют контраст. Общие scene tokens задают плотность 52% и blur 18px, отдельно от модальных окон. Настройки материала через публичный `material` contract; приложения не копируют blur/tint CSS.
|
||||||
|
- Открытые Dropdown/Select/Window используют canonical floating Glass V4, в том числе при fullscreen portal. Hover, pressed, disabled, focus и видимость меню сохраняются. Активная кнопка может использовать существующую контрастную заливку: это состояние общего контрола.
|
||||||
|
- Canvas, video, геометрия, текстуры/цвета модели, карта и содержимое изображения не покрываются стеклом. Полноэкранный пустой renderer/background не является плашкой. Обычный список, каталог и настройки за пределами viewport остаются matte.
|
||||||
|
|
||||||
|
## Эталон и проверка
|
||||||
|
|
||||||
|
Живой каталог → Glassy material: общий материал плашки и компактная панель управления над тем же фоном. Проверять на тёмном и светлом изображении, без наведения и при hover/focus, узком размере и fullscreen. Для BIM и центра наблюдения отдельно проверять реальные action rails; изменение CSS не является доказательством связи с устройством или работоспособности renderer.
|
||||||
|
|
||||||
|
Миграция начинается с BIM-карты/viewer и Центра наблюдения. Общий action scope охватывает существующие scene/map/replay controls; оставшиеся собственные подложки переводятся на тот же surface contract. Не создавать глобальную непрозрачную плашку вокруг всех viewports.
|
||||||
|
|
||||||
|
Уточнение 15.11.2026: все откреплённые панели `EditorDockLayout` (иерархия, слои, настройки и другие инструменты) автоматически получают `data-glass-context="scene"`. Материал действует уже во время отрыва/перетаскивания и после восстановления плавающего положения. Повторная стыковка возвращает материал и наружные углы tiled-панелей. Приложение не задаёт свои tint/blur/opacity.
|
||||||
|
|
||||||
|
Уточнение 17.11.2026: `Dropdown surfaceClassName="nodedc-viewport-surface"` получает тот же scene Glass V4 на самой portal-поверхности. Это применяется к меню слоёв карт; не добавлять под ним непрозрачную карточку. Настройки большого объёма открываются через `FeatureSettingsWindow` с навигацией слева, а не через отдельный draggable inspector.
|
||||||
@@ -151,3 +151,37 @@ Turning the free mode off returns the same contents to the normal centered size
|
|||||||
Drag a tool header to any of four outer edges to create a full-side area; drop over another tool to split beside it. Drop in the primary center to detach. An exact destination preview is shown only during placement. A 24 px outer zone wins over panel targets; broader magnets reach 160 px horizontally / 96 px vertically, capped at 16% of the workspace. The center of a tool chooses its nearest side, never swaps it with the primary. Split minima protect content; small viewports scroll the bounded layout. Invisible floating edges resize, and only the cursor changes.
|
Drag a tool header to any of four outer edges to create a full-side area; drop over another tool to split beside it. Drop in the primary center to detach. An exact destination preview is shown only during placement. A 24 px outer zone wins over panel targets; broader magnets reach 160 px horizontally / 96 px vertically, capped at 16% of the workspace. The center of a tool chooses its nearest side, never swaps it with the primary. Split minima protect content; small viewports scroll the bounded layout. Invisible floating edges resize, and only the cursor changes.
|
||||||
|
|
||||||
Header Enter/Space begins keyboard docking, arrows choose an edge, Shift+arrows choose the whole workspace, Tab selects a tool, Home selects floating, Enter commits and Escape cancels. Floating headers also accept arrows to move and Shift+arrows to resize. Pointer cancellation and Escape restore the uncommitted layout. Automatic viewport fitting does not overwrite stored rectangles. The living catalog includes the same workspace with a fixed scene, outliner and material palette.
|
Header Enter/Space begins keyboard docking, arrows choose an edge, Shift+arrows choose the whole workspace, Tab selects a tool, Home selects floating, Enter commits and Escape cancels. Floating headers also accept arrows to move and Shift+arrows to resize. Pointer cancellation and Escape restore the uncommitted layout. Automatic viewport fitting does not overwrite stored rectangles. The living catalog includes the same workspace with a fixed scene, outliner and material palette.
|
||||||
|
|
||||||
|
When an EditorWorkspace detaches from a Window, the owning overlay is suspended
|
||||||
|
without unmounting its children. Its backdrop and focus trap are inactive until
|
||||||
|
the editor returns. Escape/Tab belong to the focused dialog, so nested settings
|
||||||
|
close without also closing the battery/detail window.
|
||||||
|
|
||||||
|
|
||||||
|
Portal typography is self-contained: Window text base is md/13 px, its title is title/18 px, and explanatory/status paragraphs use Description/sm/12 px. This stays identical in centered and floating modes and is independent of the host body size.
|
||||||
|
|
||||||
|
`EditorWorkspace purpose="view"` reuses the same stable host and docking grammar for viewers. Back/close return the mounted view to its inline slot; no edit-completion action is shown. Optional `headerActions` keeps application actions in the fixed window header. The default `purpose="edit"` preserves existing editors. The living docking example demonstrates both purposes.
|
||||||
|
|
||||||
|
Dock tool headings inherit the focused drag-header foreground, including title and subtitle, so the canonical inverted keyboard-focus fill retains readable text.
|
||||||
|
|
||||||
|
Keyboard-focused dock headers keep their action/close glyphs on the inherited contrast color, as well as title/subtitle.
|
||||||
|
|
||||||
|
Tool minimumSize governs floating and docked geometry alike, including restored JSON, pointer and keyboard resize. Screen bounds take priority when smaller. Put fixed bottom actions in EditorDockTool.footer; never append them to scrollable inspector content.
|
||||||
|
|
||||||
|
The primary scene owns an isolated stacking context so its toolbars stay behind floating tools. A tool outer shell clips without scrolling; only its body scrolls, keeping header/footer fixed even when a field receives focus.
|
||||||
|
|
||||||
|
ColorField spectrum has no decorative perimeter stroke; retain its visible sampling marker and keyboard focus. UserProfileMenu variant=header owns its HeaderProfile surface; consumers must not wrap it in another HeaderProfile.
|
||||||
|
|
||||||
|
## 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.
|
||||||
|
|
||||||
|
## 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
+90
-58
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "nodedc-design-guideline",
|
"name": "nodedc-design-guideline",
|
||||||
"version": "0.7.0",
|
"version": "0.7.1",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "nodedc-design-guideline",
|
"name": "nodedc-design-guideline",
|
||||||
"version": "0.7.0",
|
"version": "0.7.1",
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
"packages/*",
|
"packages/*",
|
||||||
"apps/*"
|
"apps/*"
|
||||||
@@ -28,9 +28,9 @@
|
|||||||
"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.0",
|
"@nodedc/ui-core": "0.7.4",
|
||||||
"@nodedc/ui-react": "0.7.0",
|
"@nodedc/ui-react": "0.7.10",
|
||||||
"cesium": "^1.143.0",
|
"cesium": "1.147.0",
|
||||||
"react": "^19.1.0",
|
"react": "^19.1.0",
|
||||||
"react-dom": "^19.1.0"
|
"react-dom": "^19.1.0"
|
||||||
},
|
},
|
||||||
@@ -325,36 +325,63 @@
|
|||||||
"node": ">=6.9.0"
|
"node": ">=6.9.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@cesium/engine": {
|
"node_modules/@cesium/core": {
|
||||||
"version": "26.1.0",
|
"version": "0.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/@cesium/engine/-/engine-26.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/@cesium/core/-/core-0.1.1.tgz",
|
||||||
"integrity": "sha512-WzeJEcmGD7/htBJ8JEZt95OgZjErPwUHqyAlJY/mCzmDm7hfwpuucLBSUhiynWW3khqBT1C7dhibjb7tdic7oA==",
|
"integrity": "sha512-2twC6bAYWdrJ4YVS2UPCpgkE7EZWHl+GVuh5n9IT6gVL9W9OYPas29Vh+wrUVI/9Hs8TeiNtis+Du2U9b+ce6A==",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"earcut": "3.0.2",
|
||||||
|
"mersenne-twister": "^1.1.0",
|
||||||
|
"urijs": "^1.19.7"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=22.17.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@cesium/engine": {
|
||||||
|
"version": "26.5.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@cesium/engine/-/engine-26.5.0.tgz",
|
||||||
|
"integrity": "sha512-vpMuIOQ7QXNVrVTCCPWQ9y0zyfR+lhKLUOWt8XRCrDibtsASVpXGRFKQEdONf2D2EznIAQZ09sGOC8LwhvOeIQ==",
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"dependencies": {
|
||||||
|
"@cesium/core": "^0.1.1",
|
||||||
|
"@cesium/gltf": "^0.1.1",
|
||||||
"@cesium/wasm-splats": "^0.1.0-alpha.2",
|
"@cesium/wasm-splats": "^0.1.0-alpha.2",
|
||||||
"@spz-loader/core": "0.3.1",
|
"@spz-loader/core": "0.3.1",
|
||||||
"@tweenjs/tween.js": "^25.0.0",
|
"@tweenjs/tween.js": "^25.0.0",
|
||||||
"@zip.js/zip.js": "^2.8.1",
|
"@zip.js/zip.js": "^2.9.0",
|
||||||
"autolinker": "^4.0.0",
|
"autolinker": "^4.0.0",
|
||||||
"bitmap-sdf": "^1.0.3",
|
"bitmap-sdf": "^1.0.3",
|
||||||
"dompurify": "^3.3.0",
|
"dompurify": "^3.4.14",
|
||||||
"draco3d": "^1.5.1",
|
"draco3d": "1.5.7",
|
||||||
"earcut": "3.0.2",
|
|
||||||
"grapheme-splitter": "^1.0.4",
|
"grapheme-splitter": "^1.0.4",
|
||||||
"jsep": "^1.3.8",
|
"jsep": "^1.3.8",
|
||||||
"kdbush": "^4.0.1",
|
"kdbush": "^4.1.0",
|
||||||
"ktx-parse": "^1.0.0",
|
"ktx-parse": "^2.0.0",
|
||||||
"lerc": "^2.0.0",
|
"lerc": "^2.0.0",
|
||||||
"mersenne-twister": "^1.1.0",
|
"mersenne-twister": "^1.1.0",
|
||||||
"meshoptimizer": "^1.0.1",
|
"meshoptimizer": "^1.2.0",
|
||||||
"pako": "^3.0.0",
|
"pako": "^3.0.0",
|
||||||
"protobufjs": "^8.6.5",
|
"protobufjs": "^8.8.0",
|
||||||
"rbush": "^4.0.1",
|
"rbush": "^4.0.1",
|
||||||
"topojson-client": "^3.1.0",
|
"topojson-client": "^3.1.0",
|
||||||
"urijs": "^1.19.7"
|
"urijs": "^1.19.7"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=22.0.0"
|
"node": ">=22.17.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@cesium/gltf": {
|
||||||
|
"version": "0.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@cesium/gltf/-/gltf-0.1.1.tgz",
|
||||||
|
"integrity": "sha512-tACM+dBXm+hXU4iyMynEK11ymce6GqUaB8TjF7jbtqBfxVYh45C2zBjNnv3ElpwhlwjLjwbc25zKZrO8oGYegw==",
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"dependencies": {
|
||||||
|
"@cesium/core": "^0.1.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=22.17.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@cesium/wasm-splats": {
|
"node_modules/@cesium/wasm-splats": {
|
||||||
@@ -364,16 +391,17 @@
|
|||||||
"license": "Apache-2.0"
|
"license": "Apache-2.0"
|
||||||
},
|
},
|
||||||
"node_modules/@cesium/widgets": {
|
"node_modules/@cesium/widgets": {
|
||||||
"version": "16.1.0",
|
"version": "16.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/@cesium/widgets/-/widgets-16.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/@cesium/widgets/-/widgets-16.3.1.tgz",
|
||||||
"integrity": "sha512-c+jt8F3YIZs2x6+X+HS4q0S9nd2jVcbPVShUmlrDK1s+C7IlEvXceDGrkjivHRElAVCzfaWEEwY1g7Lg5HCGmA==",
|
"integrity": "sha512-eyAGPYYL4v/WeLasmphRwxFcCl/qeTcRhncbBlOzMTSTLjgjZSea0IcEDCKC2ip/mHPeGe887X84xi1SV8mcEQ==",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@cesium/engine": "^26.1.0",
|
"@cesium/core": "^0.1.1",
|
||||||
|
"@cesium/engine": "^26.5.0",
|
||||||
"nosleep.js": "^0.12.0"
|
"nosleep.js": "^0.12.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=22.0.0"
|
"node": ">=22.17.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@dnd-kit/accessibility": {
|
"node_modules/@dnd-kit/accessibility": {
|
||||||
@@ -1433,9 +1461,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@zip.js/zip.js": {
|
"node_modules/@zip.js/zip.js": {
|
||||||
"version": "2.8.26",
|
"version": "2.25.0",
|
||||||
"resolved": "https://registry.npmjs.org/@zip.js/zip.js/-/zip.js-2.8.26.tgz",
|
"resolved": "https://registry.npmjs.org/@zip.js/zip.js/-/zip.js-2.25.0.tgz",
|
||||||
"integrity": "sha512-RQ4h9F6DOiHxpdocUDrOl6xBM+yOtz+LkUol47AVWcfebGBDpZ7w7Xvz9PS24JgXvLGiXXzSAfdCdVy1tPlaFA==",
|
"integrity": "sha512-oNRqUuU1XFu6G5d7Z0jufJ9dS9WteO0xiU/PNxsUrb4itZCsSbn191jpJzU00Gmc6S680X3DPZeF5EV4zAEMAg==",
|
||||||
"license": "BSD-3-Clause",
|
"license": "BSD-3-Clause",
|
||||||
"engines": {
|
"engines": {
|
||||||
"bun": ">=0.7.0",
|
"bun": ">=0.7.0",
|
||||||
@@ -1583,22 +1611,26 @@
|
|||||||
"license": "CC-BY-4.0"
|
"license": "CC-BY-4.0"
|
||||||
},
|
},
|
||||||
"node_modules/cesium": {
|
"node_modules/cesium": {
|
||||||
"version": "1.143.0",
|
"version": "1.147.0",
|
||||||
"resolved": "https://registry.npmjs.org/cesium/-/cesium-1.143.0.tgz",
|
"resolved": "https://registry.npmjs.org/cesium/-/cesium-1.147.0.tgz",
|
||||||
"integrity": "sha512-EHz61NBp/2UPYE4iWCZ+YK9Jcb0d2hzRfqkj4DRaUM3cJmA9hE2FTmcPPZ2iL7w+W0YUScI0gc9XeSTXlPIQtA==",
|
"integrity": "sha512-gY5TF0rSyIMtnSIFHUuiHnrCuhdKaHUzLWFcjxytsdheKfKtYYOWicIWMypGjwYfnmJrgPgNF7HNjO9SK/JIkw==",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
|
"packages/core",
|
||||||
|
"packages/gltf",
|
||||||
"packages/engine",
|
"packages/engine",
|
||||||
"packages/widgets",
|
"packages/widgets",
|
||||||
"packages/sandcastle"
|
"packages/sandcastle"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@cesium/engine": "^26.1.0",
|
"@cesium/core": "^0.1.1",
|
||||||
"@cesium/widgets": "^16.1.0",
|
"@cesium/engine": "^26.5.0",
|
||||||
"protobufjs": "^8.6.5"
|
"@cesium/gltf": "^0.1.1",
|
||||||
|
"@cesium/widgets": "^16.3.1",
|
||||||
|
"protobufjs": "^8.8.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=22.0.0"
|
"node": ">=22.17.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/chokidar": {
|
"node_modules/chokidar": {
|
||||||
@@ -1665,9 +1697,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/dompurify": {
|
"node_modules/dompurify": {
|
||||||
"version": "3.4.12",
|
"version": "3.4.18",
|
||||||
"resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.4.12.tgz",
|
"resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.4.18.tgz",
|
||||||
"integrity": "sha512-zQvGet8Z2sWbQhCmfFz/T5QWH2oBmjnqK3qvOjaqaNLrLEF912WamU+ohnTp0TCep/MFVHpdJuCZEdFOdTnEFg==",
|
"integrity": "sha512-ofe3wI/uNm68HInABYFJYqQxRw1EaKAjNdrFVKqjUY+UZurvNd2L/HuQe097s/4RivWiZyP6tT7aoT8atjfhwg==",
|
||||||
"license": "(MPL-2.0 OR Apache-2.0)",
|
"license": "(MPL-2.0 OR Apache-2.0)",
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@types/trusted-types": "^2.0.7"
|
"@types/trusted-types": "^2.0.7"
|
||||||
@@ -1873,12 +1905,12 @@
|
|||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/jsep": {
|
"node_modules/jsep": {
|
||||||
"version": "1.4.0",
|
"version": "1.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/jsep/-/jsep-1.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/jsep/-/jsep-1.6.0.tgz",
|
||||||
"integrity": "sha512-B7qPcEVE3NVkmSJbaYxvv4cHkVW7DQsZz13pUMrfS8z8Q/BuShN+gcTXrUlPiGqM2/t/EEaI030bpxMqY8gMlw==",
|
"integrity": "sha512-Y8Tr54CX7B5YGAwo7/n8eumidEX3Opx98RyyQVnlHqUaZcPA8uUzL2v1rshr9ypW9Q6hNjfJtg3sL+8kaNE7TA==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 10.16.0"
|
"node": ">= 20.16.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/jsesc": {
|
"node_modules/jsesc": {
|
||||||
@@ -1914,9 +1946,9 @@
|
|||||||
"license": "ISC"
|
"license": "ISC"
|
||||||
},
|
},
|
||||||
"node_modules/ktx-parse": {
|
"node_modules/ktx-parse": {
|
||||||
"version": "1.1.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/ktx-parse/-/ktx-parse-1.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/ktx-parse/-/ktx-parse-2.0.0.tgz",
|
||||||
"integrity": "sha512-mKp3y+FaYgR7mXWAbyyzpa/r1zDWeaunH+INJO4fou3hb45XuNSwar+7llrRyvpMWafxSIi99RNFJ05MHedaJQ==",
|
"integrity": "sha512-PW38i6SBZagE7c4yCYru636ICCkhJ8FNjOzAdjGkC65BZ0gElQJvFenSGc62SHFj5Fg0ft+U38PPhMZsWYQLCg==",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/lerc": {
|
"node_modules/lerc": {
|
||||||
@@ -1957,9 +1989,9 @@
|
|||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/meshoptimizer": {
|
"node_modules/meshoptimizer": {
|
||||||
"version": "1.2.0",
|
"version": "1.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/meshoptimizer/-/meshoptimizer-1.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/meshoptimizer/-/meshoptimizer-1.3.0.tgz",
|
||||||
"integrity": "sha512-davRZeIJbxJrE24cwQle7ZDsxjdk/OphNOV83oX+efQinyoHY9Jcyz3MHbaoG0qySZajldGztNZ1RN/T19PZsg==",
|
"integrity": "sha512-2oZqMAcEEiCtXWUjIGtZ71oPx1B0ZxYGTqIKsXB1wzWFhleNsCFxQuUJzgCV706bRcwPWtMGf1odmQvAcqKkIw==",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/ms": {
|
"node_modules/ms": {
|
||||||
@@ -2028,9 +2060,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/pako": {
|
"node_modules/pako": {
|
||||||
"version": "3.0.1",
|
"version": "3.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/pako/-/pako-3.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/pako/-/pako-3.0.3.tgz",
|
||||||
"integrity": "sha512-GupotUUI0mlhugKjUs4bjOwLt3nrehy9Ys2dxC0GtgVef5cnKggkDMmf2bq2poCCuVXopWPmqsc9VDT2iJUy+w==",
|
"integrity": "sha512-tmrebBBYI5FOw8QICGwJNqE8fotC8R+gwcxOvoFNv+GKehOI6Lc6YBolNcQNnC4v96l1wt7rh102ifD4kVeZAQ==",
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"type": "github",
|
"type": "github",
|
||||||
@@ -2093,9 +2125,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/protobufjs": {
|
"node_modules/protobufjs": {
|
||||||
"version": "8.7.0",
|
"version": "8.8.1",
|
||||||
"resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-8.7.0.tgz",
|
"resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-8.8.1.tgz",
|
||||||
"integrity": "sha512-uu52JNxLh3vsL7tXU/h0gDaywufvuUCTbGSi0NKQKBZ2ZopkmrWQJSQO/EFqzu/5YhiwgVM8rq/a/iVpx4eZ0g==",
|
"integrity": "sha512-d9e9179bjXSJdpJ3+R9fP8hzXsnKLyxTjHLG1dUzje8a27pPyXCe6PrcRtgx2rjoM3IZzHd2vAs+6J/BsO1k7Q==",
|
||||||
"license": "BSD-3-Clause",
|
"license": "BSD-3-Clause",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"long": "^5.3.2"
|
"long": "^5.3.2"
|
||||||
@@ -2462,9 +2494,9 @@
|
|||||||
},
|
},
|
||||||
"packages/map-cesium-react": {
|
"packages/map-cesium-react": {
|
||||||
"name": "@nodedc/map-cesium-react",
|
"name": "@nodedc/map-cesium-react",
|
||||||
"version": "0.1.0",
|
"version": "0.1.4",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"cesium": "1.143.0"
|
"cesium": "1.147.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/react": "^19.1.0",
|
"@types/react": "^19.1.0",
|
||||||
@@ -2484,7 +2516,7 @@
|
|||||||
},
|
},
|
||||||
"packages/ui-core": {
|
"packages/ui-core": {
|
||||||
"name": "@nodedc/ui-core",
|
"name": "@nodedc/ui-core",
|
||||||
"version": "0.7.0",
|
"version": "0.7.4",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nodedc/tokens": "0.6.0"
|
"@nodedc/tokens": "0.6.0"
|
||||||
}
|
}
|
||||||
@@ -2493,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.0"
|
"@nodedc/ui-core": "0.7.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"packages/ui-react": {
|
"packages/ui-react": {
|
||||||
"name": "@nodedc/ui-react",
|
"name": "@nodedc/ui-react",
|
||||||
"version": "0.7.0",
|
"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.0",
|
"@nodedc/ui-core": "0.7.4",
|
||||||
"lucide-react": "^0.468.0"
|
"lucide-react": "^0.468.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
+9
-3
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "nodedc-design-guideline",
|
"name": "nodedc-design-guideline",
|
||||||
"version": "0.7.0",
|
"version": "0.7.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "Canonical NODE.DC design system, reusable UI packages and living component catalog.",
|
"description": "Canonical NODE.DC design system, reusable UI packages and living component catalog.",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "npm run build --workspace @nodedc/ui-core && npm run build --workspace @nodedc/ui-dom && npm run build --workspace @nodedc/ui-react && npm run build --workspace @nodedc/page-patterns && npm run build --workspace @nodedc/map-cesium-react && npm run build --workspace @nodedc/ui-catalog",
|
"build": "npm run build --workspace @nodedc/ui-core && npm run build --workspace @nodedc/ui-dom && npm run build --workspace @nodedc/ui-react && npm run build --workspace @nodedc/page-patterns && npm run build --workspace @nodedc/map-cesium-react && npm run build --workspace @nodedc/ui-catalog",
|
||||||
"build:packages": "npm run build --workspace @nodedc/ui-core && npm run build --workspace @nodedc/ui-dom && npm run build --workspace @nodedc/ui-react && npm run build --workspace @nodedc/page-patterns && npm run build --workspace @nodedc/map-cesium-react",
|
"build:packages": "npm run build --workspace @nodedc/ui-core && npm run build --workspace @nodedc/ui-dom && npm run build --workspace @nodedc/ui-react && npm run build --workspace @nodedc/page-patterns && npm run build --workspace @nodedc/map-cesium-react",
|
||||||
"check": "npm run build:packages && npm run typecheck --workspaces --if-present && npm run validate:registry && npm run test:spark-governance && npm run test:analysis-controls && npm run test:activity-indicator && npm run test:control-density && npm run test:icon-contract && npm run test:toast-contract && npm run test:floating-position && npm run test:inspector-select && npm run test:range-control && npm run test:split-pane && npm run test:dock-layout && npm run test:hgeozone-projection && npm run test:map-grid-lod && npm run test:map-filters && npm run test:map-object-layers && npm run test:map-inspector-overlay-state && npm run test:map-reference-stations && npm run test:map-search && npm run test:map-subject-card && npm run test:map-subject-detail-profile && npm run test:environment-settings && npm run test:settings-surfaces && npm run test:window-geometry && npm run test:editor-dock",
|
"check": "npm run test:typography && npm run build:packages && npm run typecheck --workspaces --if-present && npm run validate:registry && npm run test:spark-governance && npm run test:analysis-controls && npm run test:activity-indicator && npm run test:control-density && npm run test:icon-contract && npm run test:toast-contract && npm run test:floating-position && npm run test:tooltip && npm run test:inspector-select && npm run test:range-control && npm run test:split-pane && npm run test:dock-layout && npm run test:hgeozone-projection && npm run test:map-grid-lod && npm run test:map-filters && npm run test:map-object-layers && npm run test:map-inspector-overlay-state && npm run test:map-reference-stations && npm run test:map-search && npm run test:map-subject-card && npm run test:map-subject-detail-profile && npm run test:environment-settings && npm run test:settings-surfaces && npm run test:window-geometry && npm run test:editor-dock && npm run test:flat-theme && npm run test:mission-theme && npm run test:modal-size",
|
||||||
"dev": "npm run build:packages && npm run dev --workspace @nodedc/ui-catalog",
|
"dev": "npm run build:packages && npm run dev --workspace @nodedc/ui-catalog",
|
||||||
"serve": "node server/catalog-server.mjs",
|
"serve": "node server/catalog-server.mjs",
|
||||||
"validate:registry": "node scripts/validate-registry.mjs",
|
"validate:registry": "node scripts/validate-registry.mjs",
|
||||||
@@ -45,7 +45,13 @@
|
|||||||
"test:analysis-controls": "node --test scripts/analysis-controls.test.mjs",
|
"test:analysis-controls": "node --test scripts/analysis-controls.test.mjs",
|
||||||
"test:settings-surfaces": "node --test scripts/settings-surfaces.test.mjs",
|
"test:settings-surfaces": "node --test scripts/settings-surfaces.test.mjs",
|
||||||
"test:window-geometry": "node --test scripts/window-geometry.test.mjs",
|
"test:window-geometry": "node --test scripts/window-geometry.test.mjs",
|
||||||
"test:editor-dock": "node --test scripts/editor-dock.test.mjs"
|
"test:editor-dock": "node --test scripts/editor-dock.test.mjs",
|
||||||
|
"test:typography": "node --test scripts/operational-typography.test.mjs",
|
||||||
|
"prebuild": "npm run test:typography",
|
||||||
|
"test:flat-theme": "node --test scripts/flat-theme.test.mjs",
|
||||||
|
"test:mission-theme": "node --test scripts/mission-theme.test.mjs",
|
||||||
|
"test:modal-size": "node --test scripts/modal-size.test.mjs",
|
||||||
|
"test:tooltip": "node --test scripts/tooltip-titles.test.mjs"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=20"
|
"node": ">=20"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nodedc/map-cesium-react",
|
"name": "@nodedc/map-cesium-react",
|
||||||
"version": "0.1.0",
|
"version": "0.1.4",
|
||||||
"description": "Shared credential-free Cesium adapter for NODE.DC Map Page consumers.",
|
"description": "Shared credential-free Cesium adapter for NODE.DC Map Page consumers.",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
"typecheck": "tsc -p tsconfig.json --noEmit"
|
"typecheck": "tsc -p tsconfig.json --noEmit"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"cesium": "1.143.0"
|
"cesium": "1.147.0"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"react": ">=18"
|
"react": ">=18"
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import type {
|
|||||||
MapProviderId,
|
MapProviderId,
|
||||||
MapRuntimeState,
|
MapRuntimeState,
|
||||||
} from "./contracts.js";
|
} from "./contracts.js";
|
||||||
|
import {applyMapSceneEffects} from "./sceneEffects.js";
|
||||||
import { advanceGhostPins } from "./ghostPins.js";
|
import { advanceGhostPins } from "./ghostPins.js";
|
||||||
import {
|
import {
|
||||||
parseProviderEndpoint,
|
parseProviderEndpoint,
|
||||||
@@ -60,10 +61,13 @@ export const CesiumMapRenderer = forwardRef<
|
|||||||
className,
|
className,
|
||||||
onRuntimeStateChange,
|
onRuntimeStateChange,
|
||||||
onCameraChange,
|
onCameraChange,
|
||||||
|
onSceneReady,
|
||||||
}, forwardedRef) {
|
}, forwardedRef) {
|
||||||
const containerRef = useRef<HTMLDivElement | null>(null);
|
const containerRef = useRef<HTMLDivElement | null>(null);
|
||||||
const stateCallbackRef = useRef(onRuntimeStateChange);
|
const stateCallbackRef = useRef(onRuntimeStateChange);
|
||||||
const cameraCallbackRef = useRef(onCameraChange);
|
const cameraCallbackRef = useRef(onCameraChange);
|
||||||
|
const sceneCallbackRef = useRef(onSceneReady);
|
||||||
|
sceneCallbackRef.current = onSceneReady;
|
||||||
const runtimeRef = useRef<RendererRuntime | null>(null);
|
const runtimeRef = useRef<RendererRuntime | null>(null);
|
||||||
const settingsRef = useRef(settings);
|
const settingsRef = useRef(settings);
|
||||||
const layersRef = useRef(layers);
|
const layersRef = useRef(layers);
|
||||||
@@ -116,6 +120,7 @@ export const CesiumMapRenderer = forwardRef<
|
|||||||
const abortController = new AbortController();
|
const abortController = new AbortController();
|
||||||
let disposed = false;
|
let disposed = false;
|
||||||
let viewer: CesiumModule.Viewer | null = null;
|
let viewer: CesiumModule.Viewer | null = null;
|
||||||
|
let disposeConsumer: (() => void) | void;
|
||||||
let removeCameraListener: (() => void) | undefined;
|
let removeCameraListener: (() => void) | undefined;
|
||||||
let removeRenderListener: (() => void) | undefined;
|
let removeRenderListener: (() => void) | undefined;
|
||||||
let runtimeState = initialMapRuntimeState();
|
let runtimeState = initialMapRuntimeState();
|
||||||
@@ -191,6 +196,8 @@ export const CesiumMapRenderer = forwardRef<
|
|||||||
);
|
);
|
||||||
removeRenderListener = bindRenderRecovery(viewer, publish);
|
removeRenderListener = bindRenderRecovery(viewer, publish);
|
||||||
|
|
||||||
|
disposeConsumer = sceneCallbackRef.current?.({Cesium, viewer, signal: abortController.signal});
|
||||||
|
|
||||||
const providerJobs = (["imagery", "terrain", "buildings"] as const).map(
|
const providerJobs = (["imagery", "terrain", "buildings"] as const).map(
|
||||||
async (providerId) => {
|
async (providerId) => {
|
||||||
const visible = layers[providerId];
|
const visible = layers[providerId];
|
||||||
@@ -265,6 +272,7 @@ export const CesiumMapRenderer = forwardRef<
|
|||||||
return () => {
|
return () => {
|
||||||
disposed = true;
|
disposed = true;
|
||||||
abortController.abort();
|
abortController.abort();
|
||||||
|
try { disposeConsumer?.(); } finally {
|
||||||
removeCameraListener?.();
|
removeCameraListener?.();
|
||||||
removeRenderListener?.();
|
removeRenderListener?.();
|
||||||
runtimeRef.current?.stopGhostPinAnimation?.();
|
runtimeRef.current?.stopGhostPinAnimation?.();
|
||||||
@@ -272,6 +280,7 @@ export const CesiumMapRenderer = forwardRef<
|
|||||||
viewer?.destroy();
|
viewer?.destroy();
|
||||||
viewer = null;
|
viewer = null;
|
||||||
container.replaceChildren();
|
container.replaceChildren();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}, [
|
}, [
|
||||||
runtimeConfigUrl,
|
runtimeConfigUrl,
|
||||||
@@ -487,7 +496,9 @@ function applyPresentation(
|
|||||||
buildings.maximumScreenSpaceError =
|
buildings.maximumScreenSpaceError =
|
||||||
settings.buildings_maximum_screen_space_error;
|
settings.buildings_maximum_screen_space_error;
|
||||||
buildings.style = new Cesium.Cesium3DTileStyle({
|
buildings.style = new Cesium.Cesium3DTileStyle({
|
||||||
color: `color('${settings.buildings_color}', ${settings.buildings_opacity})`,
|
color: settings.buildings_style_default
|
||||||
|
? `Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}, ${settings.buildings_opacity}) : color('#ffffff', ${settings.buildings_opacity})`
|
||||||
|
: `color('${settings.buildings_color}', ${settings.buildings_opacity})`,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
runtime.ghostPins.show = layers.targets;
|
runtime.ghostPins.show = layers.targets;
|
||||||
@@ -533,9 +544,9 @@ function applyPresentation(
|
|||||||
}
|
}
|
||||||
viewer.shadows = settings.shadows_enabled;
|
viewer.shadows = settings.shadows_enabled;
|
||||||
const sunDate = Cesium.JulianDate.toDate(Cesium.JulianDate.now());
|
const sunDate = Cesium.JulianDate.toDate(Cesium.JulianDate.now());
|
||||||
sunDate.setUTCHours(
|
if (!settings.sun_time_current) sunDate.setUTCHours(
|
||||||
clamp(Math.round(settings.sun_hour), 0, 24),
|
Math.floor(clamp(settings.sun_hour, 0, 24)),
|
||||||
0,
|
Math.round((settings.sun_hour % 1) * 60),
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
);
|
);
|
||||||
@@ -548,6 +559,7 @@ function applyPresentation(
|
|||||||
2,
|
2,
|
||||||
);
|
);
|
||||||
viewer.scene.light = sun;
|
viewer.scene.light = sun;
|
||||||
|
applyMapSceneEffects(runtime, settings);
|
||||||
viewer.scene.requestRender();
|
viewer.scene.requestRender();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
|
import type * as Cesium from "cesium";
|
||||||
export const MAP_RUNTIME_SCHEMA_VERSION = "missioncore.map-runtime/v1" as const;
|
export const MAP_RUNTIME_SCHEMA_VERSION = "missioncore.map-runtime/v1" as const;
|
||||||
export const MAP_PAGE_VERSION = "0.1.0" as const;
|
export const MAP_PAGE_VERSION = "0.1.0" as const;
|
||||||
export const CESIUM_RENDERER_VERSION = "1.143.0" as const;
|
export const CESIUM_RENDERER_VERSION = "1.147.0" as const;
|
||||||
|
|
||||||
export type MapProviderId = "imagery" | "terrain" | "buildings";
|
export type MapProviderId = "imagery" | "terrain" | "buildings";
|
||||||
export type MapProviderPhase = "idle" | "loading" | "ready" | "disabled" | "error";
|
export type MapProviderPhase = "idle" | "loading" | "ready" | "disabled" | "error";
|
||||||
@@ -111,7 +112,7 @@ export type MapLayerVisibility = {
|
|||||||
targets: boolean;
|
targets: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type MapVisualSettings = {
|
export type MapVisualSettings = Partial<MapSceneEffects> & {
|
||||||
atmosphere_enabled: boolean;
|
atmosphere_enabled: boolean;
|
||||||
atmosphere_hue: number;
|
atmosphere_hue: number;
|
||||||
atmosphere_saturation: number;
|
atmosphere_saturation: number;
|
||||||
@@ -119,6 +120,7 @@ export type MapVisualSettings = {
|
|||||||
fog_enabled: boolean;
|
fog_enabled: boolean;
|
||||||
fog_density: number;
|
fog_density: number;
|
||||||
sun_enabled: boolean;
|
sun_enabled: boolean;
|
||||||
|
sun_time_current?: boolean;
|
||||||
sun_hour: number;
|
sun_hour: number;
|
||||||
sun_intensity: number;
|
sun_intensity: number;
|
||||||
shadows_enabled: boolean;
|
shadows_enabled: boolean;
|
||||||
@@ -133,6 +135,7 @@ export type MapVisualSettings = {
|
|||||||
globe_color: string;
|
globe_color: string;
|
||||||
background_color: string;
|
background_color: string;
|
||||||
terrain_exaggeration: number;
|
terrain_exaggeration: number;
|
||||||
|
buildings_style_default?: boolean;
|
||||||
buildings_color: string;
|
buildings_color: string;
|
||||||
buildings_opacity: number;
|
buildings_opacity: number;
|
||||||
buildings_maximum_screen_space_error: number;
|
buildings_maximum_screen_space_error: number;
|
||||||
@@ -154,12 +157,47 @@ export type MapVisualSettings = {
|
|||||||
camera_animation_enabled: boolean;
|
camera_animation_enabled: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** Optional controls preserve presentation in existing hosts until explicitly supplied. */
|
||||||
|
export type MapSceneEffects = {
|
||||||
|
skybox_enabled: boolean;
|
||||||
|
sun_visible: boolean;
|
||||||
|
moon_visible: boolean;
|
||||||
|
ground_atmosphere_enabled: boolean;
|
||||||
|
sun_color: string;
|
||||||
|
shadow_darkness: number;
|
||||||
|
shadow_soft: boolean;
|
||||||
|
terrain_maximum_screen_space_error: number;
|
||||||
|
resolution_scale: number;
|
||||||
|
fxaa_enabled: boolean;
|
||||||
|
hdr_enabled: boolean;
|
||||||
|
exposure: number;
|
||||||
|
tonemapper: "PBR_NEUTRAL" | "ACES" | "FILMIC" | "REINHARD" | "MODIFIED_REINHARD";
|
||||||
|
bloom_enabled: boolean;
|
||||||
|
bloom_contrast: number;
|
||||||
|
bloom_brightness: number;
|
||||||
|
bloom_sigma: number;
|
||||||
|
bloom_step_size: number;
|
||||||
|
ao_enabled: boolean;
|
||||||
|
ao_intensity: number;
|
||||||
|
ao_bias: number;
|
||||||
|
ao_length_cap: number;
|
||||||
|
};
|
||||||
|
|
||||||
export type MapCacheIntent = {
|
export type MapCacheIntent = {
|
||||||
enabled: boolean;
|
enabled: boolean;
|
||||||
no_overwrite: boolean;
|
no_overwrite: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** A consumer may attach domain objects to this renderer-owned scene. It must
|
||||||
|
* remove its objects/listeners in the returned synchronous cleanup. Pending
|
||||||
|
* work must observe signal; it may never destroy the viewer or change providers. */
|
||||||
|
export type MapSceneContext = {
|
||||||
|
Cesium: typeof Cesium;
|
||||||
|
viewer: Cesium.Viewer;
|
||||||
|
signal: AbortSignal;
|
||||||
|
};
|
||||||
export type CesiumMapRendererProps = {
|
export type CesiumMapRendererProps = {
|
||||||
|
onSceneReady?: (context: MapSceneContext) => (() => void) | void;
|
||||||
runtimeConfigUrl: string;
|
runtimeConfigUrl: string;
|
||||||
camera: MapCamera | null;
|
camera: MapCamera | null;
|
||||||
layers: MapLayerVisibility;
|
layers: MapLayerVisibility;
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ export {
|
|||||||
export type {
|
export type {
|
||||||
CesiumMapRendererHandle,
|
CesiumMapRendererHandle,
|
||||||
CesiumMapRendererProps,
|
CesiumMapRendererProps,
|
||||||
|
MapSceneContext,
|
||||||
MapCacheIntent,
|
MapCacheIntent,
|
||||||
MapCamera,
|
MapCamera,
|
||||||
MapGeoPoint,
|
MapGeoPoint,
|
||||||
@@ -22,6 +23,7 @@ export type {
|
|||||||
MapRuntimeConfiguration,
|
MapRuntimeConfiguration,
|
||||||
MapRuntimeState,
|
MapRuntimeState,
|
||||||
MapVisualSettings,
|
MapVisualSettings,
|
||||||
|
MapSceneEffects,
|
||||||
} from "./contracts.js";
|
} from "./contracts.js";
|
||||||
export {
|
export {
|
||||||
advanceGhostPins,
|
advanceGhostPins,
|
||||||
@@ -37,3 +39,5 @@ export {
|
|||||||
readSafeErrorCode,
|
readSafeErrorCode,
|
||||||
withProviderState,
|
withProviderState,
|
||||||
} from "./runtime.js";
|
} from "./runtime.js";
|
||||||
|
|
||||||
|
export {DEFAULT_MAP_SCENE_EFFECTS} from "./sceneEffects.js";
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
import type {MapSceneContext, MapSceneEffects, MapVisualSettings} from './contracts.js';
|
||||||
|
|
||||||
|
/** Native Cesium 1.147 defaults; adding a settings window does not change the scene. */
|
||||||
|
export const DEFAULT_MAP_SCENE_EFFECTS: Readonly<MapSceneEffects> = Object.freeze({
|
||||||
|
skybox_enabled:true, sun_visible:true, moon_visible:true, ground_atmosphere_enabled:true,
|
||||||
|
sun_color:'#ffffff', shadow_darkness:0.3, shadow_soft:false,
|
||||||
|
terrain_maximum_screen_space_error:2, resolution_scale:1, fxaa_enabled:false,
|
||||||
|
hdr_enabled:false, exposure:1, tonemapper:'PBR_NEUTRAL',
|
||||||
|
bloom_enabled:false, bloom_contrast:128, bloom_brightness:-0.3, bloom_sigma:2, bloom_step_size:1,
|
||||||
|
ao_enabled:false, ao_intensity:3, ao_bias:0.1, ao_length_cap:0.26,
|
||||||
|
});
|
||||||
|
|
||||||
|
/** Mutates visual properties only: never touches sources, camera, cache or domain objects. */
|
||||||
|
export function applyMapSceneEffects({Cesium,viewer}:Pick<MapSceneContext,'Cesium'|'viewer'>,s:MapVisualSettings):void {
|
||||||
|
const scene=viewer.scene, stages=scene.postProcessStages;
|
||||||
|
if(s.skybox_enabled!==undefined && scene.skyBox)scene.skyBox.show=s.skybox_enabled;
|
||||||
|
if(s.sun_visible!==undefined && scene.sun)scene.sun.show=s.sun_visible;
|
||||||
|
if(s.moon_visible!==undefined && scene.moon)scene.moon.show=s.moon_visible;
|
||||||
|
if(s.ground_atmosphere_enabled!==undefined)scene.globe.showGroundAtmosphere=s.ground_atmosphere_enabled;
|
||||||
|
if(s.sun_color!==undefined)scene.light.color=Cesium.Color.fromCssColorString(s.sun_color)??Cesium.Color.WHITE;
|
||||||
|
if(s.shadow_darkness!==undefined)viewer.shadowMap.darkness=s.shadow_darkness;
|
||||||
|
if(s.shadow_soft!==undefined)viewer.shadowMap.softShadows=s.shadow_soft;
|
||||||
|
if(s.terrain_maximum_screen_space_error!==undefined)scene.globe.maximumScreenSpaceError=s.terrain_maximum_screen_space_error;
|
||||||
|
if(s.resolution_scale!==undefined)viewer.resolutionScale=s.resolution_scale;
|
||||||
|
if(s.fxaa_enabled!==undefined)stages.fxaa.enabled=s.fxaa_enabled;
|
||||||
|
if(s.hdr_enabled!==undefined)scene.highDynamicRange=s.hdr_enabled;
|
||||||
|
if(s.exposure!==undefined)stages.exposure=s.exposure;
|
||||||
|
if(s.tonemapper!==undefined)stages.tonemapper=Cesium.Tonemapper[s.tonemapper];
|
||||||
|
if(s.bloom_enabled!==undefined)stages.bloom.enabled=s.bloom_enabled;
|
||||||
|
if(s.bloom_contrast!==undefined)stages.bloom.uniforms.contrast=s.bloom_contrast;
|
||||||
|
if(s.bloom_brightness!==undefined)stages.bloom.uniforms.brightness=s.bloom_brightness;
|
||||||
|
if(s.bloom_sigma!==undefined)stages.bloom.uniforms.sigma=s.bloom_sigma;
|
||||||
|
if(s.bloom_step_size!==undefined)stages.bloom.uniforms.stepSize=s.bloom_step_size;
|
||||||
|
if(s.ao_enabled!==undefined)stages.ambientOcclusion.enabled=s.ao_enabled && Cesium.PostProcessStageLibrary.isAmbientOcclusionSupported(scene);
|
||||||
|
if(s.ao_intensity!==undefined)stages.ambientOcclusion.uniforms.intensity=s.ao_intensity;
|
||||||
|
if(s.ao_bias!==undefined)stages.ambientOcclusion.uniforms.bias=s.ao_bias;
|
||||||
|
if(s.ao_length_cap!==undefined)stages.ambientOcclusion.uniforms.lengthCap=s.ao_length_cap;
|
||||||
|
}
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
import assert from "node:assert/strict";
|
||||||
|
import test from "node:test";
|
||||||
|
import { DefaultProxy, Resource, VERSION } from "cesium";
|
||||||
|
import { CESIUM_RENDERER_VERSION } from "../dist/contracts.js";
|
||||||
|
import { applyCacheIntent, fetchMapRuntimeConfiguration } from "../dist/runtime.js";
|
||||||
|
|
||||||
|
test("installed Cesium and the runtime contract agree", () => {
|
||||||
|
assert.equal(VERSION, CESIUM_RENDERER_VERSION);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("Cesium derived terrain and building resources retain the existing cache route", () => {
|
||||||
|
for (const [root, child] of [
|
||||||
|
["https://assets.ion.cesium.com/1/", "12/124/113.terrain?v=1"],
|
||||||
|
["https://assets.ion.cesium.com/96188/tileset.json", "12/124/113.b3dm"],
|
||||||
|
]) {
|
||||||
|
const resource = new Resource({
|
||||||
|
url: applyCacheIntent(root, { enabled: true, no_overwrite: true }, false),
|
||||||
|
proxy: new DefaultProxy("/api/v1/map/gateway/cache?url="),
|
||||||
|
});
|
||||||
|
const derived = resource.getDerivedResource({ url: child });
|
||||||
|
const proxied = new URL(derived.getUrlComponent(true, true), "http://127.0.0.1:8000");
|
||||||
|
assert.equal(proxied.pathname, "/api/v1/map/gateway/cache");
|
||||||
|
const upstream = new URL(proxied.searchParams.get("url"));
|
||||||
|
assert.equal(upstream.searchParams.get("nodedc_cache_profile"), "live");
|
||||||
|
assert.equal(upstream.searchParams.has("nodedc_cache_refresh"), false);
|
||||||
|
assert.equal(upstream.searchParams.has("access_token"), false);
|
||||||
|
assert.equal(upstream.pathname, new URL(child, root).pathname);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
test("a mismatched renderer cannot silently start against another runtime release", async (t) => {
|
||||||
|
const originalWindow = globalThis.window;
|
||||||
|
globalThis.window = { location: { origin: "http://127.0.0.1:8000" } };
|
||||||
|
t.after(() => {
|
||||||
|
if (originalWindow === undefined) delete globalThis.window;
|
||||||
|
else globalThis.window = originalWindow;
|
||||||
|
});
|
||||||
|
const configuration = {
|
||||||
|
schema_version: "missioncore.map-runtime/v1",
|
||||||
|
map_page_version: "0.1.0",
|
||||||
|
renderer: { id: "cesium", version: CESIUM_RENDERER_VERSION },
|
||||||
|
gateway: {
|
||||||
|
configured: true,
|
||||||
|
health_url: "/api/v1/map/gateway/health",
|
||||||
|
asset_endpoint_template: "/api/v1/map/gateway/ion/assets/{asset_id}/endpoint",
|
||||||
|
cache_proxy_prefix: "/api/v1/map/gateway/cache?url=",
|
||||||
|
},
|
||||||
|
assets: { imagery: 2, terrain: 1, buildings: 96188 },
|
||||||
|
};
|
||||||
|
t.mock.method(globalThis, "fetch", async () => Response.json(configuration));
|
||||||
|
assert.equal((await fetchMapRuntimeConfiguration("/api/v1/map/runtime-config", new AbortController().signal)).renderer.version, CESIUM_RENDERER_VERSION);
|
||||||
|
configuration.renderer.version = "1.143.0";
|
||||||
|
await assert.rejects(fetchMapRuntimeConfiguration("/api/v1/map/runtime-config", new AbortController().signal), { code: "map_runtime_contract_mismatch" });
|
||||||
|
});
|
||||||
|
|
||||||
|
test("project focus keeps its range and survives the persisted camera round trip", async () => {
|
||||||
|
const C = await import("cesium");
|
||||||
|
const scene = {
|
||||||
|
drawingBufferWidth: 840, drawingBufferHeight: 461,
|
||||||
|
mapProjection: new C.GeographicProjection(), ellipsoid: C.Ellipsoid.WGS84,
|
||||||
|
mode: C.SceneMode.SCENE3D,
|
||||||
|
screenSpaceCameraController: { minimumZoomDistance: 1, maximumZoomDistance: Infinity },
|
||||||
|
};
|
||||||
|
const camera = new C.Camera(scene);
|
||||||
|
scene.camera = camera;
|
||||||
|
camera.update(C.SceneMode.SCENE3D);
|
||||||
|
for (const [lon, lat, height] of [[3.711, 51.065, 10], [37.58, 55.75, 160], [-97.736, 30.287, 180]]) {
|
||||||
|
const target = C.Cartesian3.fromDegrees(lon, lat, height);
|
||||||
|
camera.flyToBoundingSphere(new C.BoundingSphere(target, 160), {
|
||||||
|
duration: 0, offset: new C.HeadingPitchRange(0, -Math.PI / 4, 600),
|
||||||
|
});
|
||||||
|
assert.ok(Math.abs(C.Cartesian3.distance(camera.positionWC, target) - 600) < 1e-5);
|
||||||
|
const position = C.Cartographic.clone(camera.positionCartographic);
|
||||||
|
const orientation = { heading: camera.heading, pitch: camera.pitch, roll: camera.roll };
|
||||||
|
camera.setView({ destination: C.Cartesian3.fromRadians(position.longitude, position.latitude, position.height), orientation });
|
||||||
|
const toward = C.Cartesian3.normalize(C.Cartesian3.subtract(target, camera.positionWC, new C.Cartesian3()), new C.Cartesian3());
|
||||||
|
assert.ok(C.Cartesian3.dot(camera.directionWC, toward) > 0.999999);
|
||||||
|
assert.ok(Math.abs(C.Cartesian3.distance(camera.positionWC, target) - 600) < 1e-5);
|
||||||
|
}
|
||||||
|
});
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
import test from 'node:test';
|
||||||
|
import assert from 'node:assert/strict';
|
||||||
|
import {applyMapSceneEffects,DEFAULT_MAP_SCENE_EFFECTS} from '../dist/sceneEffects.js';
|
||||||
|
|
||||||
|
function context(supported=true){
|
||||||
|
const viewer={resolutionScale:1,shadowMap:{},scene:{skyBox:{},sun:{},moon:{},globe:{},light:{},postProcessStages:{fxaa:{},bloom:{uniforms:{}},ambientOcclusion:{uniforms:{}}}}};
|
||||||
|
const Cesium={Color:{fromCssColorString:value=>value,WHITE:'white'},Tonemapper:{ACES:'ACES',PBR_NEUTRAL:'PBR_NEUTRAL'},PostProcessStageLibrary:{isAmbientOcclusionSupported:()=>supported}};
|
||||||
|
return {viewer,Cesium};
|
||||||
|
}
|
||||||
|
test('optional effects leave legacy consumers unchanged',()=>{
|
||||||
|
const c=context(),before=structuredClone(c.viewer);applyMapSceneEffects(c,{});assert.deepEqual(c.viewer,before);
|
||||||
|
});
|
||||||
|
test('effects apply live and reset without changing camera or providers',()=>{
|
||||||
|
const c=context();c.viewer.camera={position:'unchanged'};c.viewer.terrainProvider={id:'cache'};
|
||||||
|
applyMapSceneEffects(c,{...DEFAULT_MAP_SCENE_EFFECTS,bloom_enabled:true,bloom_contrast:64,hdr_enabled:true,exposure:2,tonemapper:'ACES',ao_enabled:true,ao_intensity:6,sun_visible:false,resolution_scale:.7});
|
||||||
|
const {scene}=c.viewer;
|
||||||
|
assert.equal(scene.postProcessStages.bloom.enabled,true);assert.equal(scene.postProcessStages.bloom.uniforms.contrast,64);
|
||||||
|
assert.equal(scene.postProcessStages.ambientOcclusion.uniforms.intensity,6);assert.equal(scene.postProcessStages.ambientOcclusion.enabled,true);
|
||||||
|
assert.equal(scene.highDynamicRange,true);assert.equal(scene.postProcessStages.exposure,2);assert.equal(scene.postProcessStages.tonemapper,'ACES');
|
||||||
|
assert.equal(scene.sun.show,false);assert.equal(c.viewer.resolutionScale,.7);
|
||||||
|
applyMapSceneEffects(c,DEFAULT_MAP_SCENE_EFFECTS);
|
||||||
|
assert.equal(scene.postProcessStages.bloom.enabled,false);assert.equal(scene.highDynamicRange,false);assert.equal(scene.sun.show,true);
|
||||||
|
assert.deepEqual(c.viewer.camera,{position:'unchanged'});assert.deepEqual(c.viewer.terrainProvider,{id:'cache'});
|
||||||
|
});
|
||||||
|
test('unsupported ambient occlusion stays off',()=>{
|
||||||
|
const c=context(false);applyMapSceneEffects(c,{ao_enabled:true});assert.equal(c.viewer.scene.postProcessStages.ambientOcclusion.enabled,false);
|
||||||
|
});
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
:root {
|
:root {
|
||||||
|
--nodedc-field-hover-bg: color-mix(in srgb, var(--nodedc-field-bg) 94%, var(--nodedc-text-primary));
|
||||||
--nodedc-neutral-action-bg: rgba(247, 248, 244, 0.96);
|
--nodedc-neutral-action-bg: rgba(247, 248, 244, 0.96);
|
||||||
--nodedc-neutral-action-hover: #fff;
|
--nodedc-neutral-action-hover: #fff;
|
||||||
--nodedc-neutral-action-color: rgba(8, 8, 10, 0.96);
|
--nodedc-neutral-action-color: rgba(8, 8, 10, 0.96);
|
||||||
@@ -9,14 +10,16 @@
|
|||||||
:root,
|
:root,
|
||||||
[data-nodedc-theme="dark"] {
|
[data-nodedc-theme="dark"] {
|
||||||
color-scheme: dark;
|
color-scheme: dark;
|
||||||
--nodedc-accent-rgb: 255 47 146;
|
--nodedc-accent-rgb: 247 248 244;
|
||||||
--nodedc-on-accent-rgb: 11 17 23;
|
--nodedc-on-accent-rgb: 8 8 10;
|
||||||
--nodedc-danger-rgb: 255 116 116;
|
--nodedc-danger-rgb: 255 116 116;
|
||||||
--nodedc-warning-rgb: 255 209 102;
|
--nodedc-warning-rgb: 255 209 102;
|
||||||
--nodedc-success-rgb: 181 255 90;
|
--nodedc-success-rgb: 181 255 90;
|
||||||
|
|
||||||
--nodedc-canvas: #050506;
|
--nodedc-canvas: #050506;
|
||||||
--nodedc-canvas-soft: #0b0b0d;
|
--nodedc-canvas-soft: #0d0d0f;
|
||||||
|
--nodedc-stage: #08090b;
|
||||||
|
--nodedc-surface-group: rgba(110, 110, 110, 0.07);
|
||||||
--nodedc-text-primary: rgba(247, 248, 244, 0.96);
|
--nodedc-text-primary: rgba(247, 248, 244, 0.96);
|
||||||
--nodedc-text-secondary: rgba(247, 248, 244, 0.72);
|
--nodedc-text-secondary: rgba(247, 248, 244, 0.72);
|
||||||
--nodedc-text-muted: rgba(247, 248, 244, 0.48);
|
--nodedc-text-muted: rgba(247, 248, 244, 0.48);
|
||||||
@@ -82,14 +85,16 @@
|
|||||||
|
|
||||||
[data-nodedc-theme="light"] {
|
[data-nodedc-theme="light"] {
|
||||||
color-scheme: light;
|
color-scheme: light;
|
||||||
--nodedc-accent-rgb: 255 47 146;
|
--nodedc-accent-rgb: 24 25 28;
|
||||||
--nodedc-on-accent-rgb: 11 17 23;
|
--nodedc-on-accent-rgb: 247 248 244;
|
||||||
--nodedc-danger-rgb: 205 47 67;
|
--nodedc-danger-rgb: 205 47 67;
|
||||||
--nodedc-warning-rgb: 173 111 0;
|
--nodedc-warning-rgb: 173 111 0;
|
||||||
--nodedc-success-rgb: 46 125 76;
|
--nodedc-success-rgb: 46 125 76;
|
||||||
|
|
||||||
--nodedc-canvas: #ececec;
|
--nodedc-canvas: #ececec;
|
||||||
--nodedc-canvas-soft: #f4f4f4;
|
--nodedc-canvas-soft: #f4f4f4;
|
||||||
|
--nodedc-stage: #ececec;
|
||||||
|
--nodedc-surface-group: #f4f4f4;
|
||||||
--nodedc-text-primary: rgba(18, 20, 22, 0.96);
|
--nodedc-text-primary: rgba(18, 20, 22, 0.96);
|
||||||
--nodedc-text-secondary: rgba(18, 20, 22, 0.7);
|
--nodedc-text-secondary: rgba(18, 20, 22, 0.7);
|
||||||
--nodedc-text-muted: rgba(18, 20, 22, 0.48);
|
--nodedc-text-muted: rgba(18, 20, 22, 0.48);
|
||||||
@@ -152,3 +157,24 @@
|
|||||||
--nodedc-modal-shadow: 0 24px 72px rgb(0 0 0 / var(--nodedc-modal-glass-shadow-light-opacity)), inset 0 1px 0 rgba(255, 255, 255, 0.8);
|
--nodedc-modal-shadow: 0 24px 72px rgb(0 0 0 / var(--nodedc-modal-glass-shadow-light-opacity)), inset 0 1px 0 rgba(255, 255, 255, 0.8);
|
||||||
--nodedc-floating-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.72)), rgba(255, 255, 255, 0.94);
|
--nodedc-floating-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.72)), rgba(255, 255, 255, 0.94);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[data-nodedc-appearance="mission"][data-nodedc-theme="dark"] {
|
||||||
|
--nodedc-modal-surface: rgb(15 15 17 / .97);
|
||||||
|
--nodedc-floating-surface: rgb(15 15 17 / .98);
|
||||||
|
--nodedc-primary-action-bg: rgb(247 248 244 / .96);
|
||||||
|
--nodedc-primary-action-hover: rgb(255 255 255);
|
||||||
|
--nodedc-primary-action-color: rgb(8 8 10 / .96);
|
||||||
|
--nodedc-primary-action-shadow: none;
|
||||||
|
--nodedc-focus-surface: rgb(255 255 255 / .09);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[data-nodedc-appearance="mission"][data-nodedc-theme="light"] {
|
||||||
|
--nodedc-modal-surface: rgb(247 248 250 / .97);
|
||||||
|
--nodedc-floating-surface: rgb(247 248 250 / .98);
|
||||||
|
--nodedc-primary-action-bg: rgb(24 25 28 / .96);
|
||||||
|
--nodedc-primary-action-hover: rgb(8 8 10);
|
||||||
|
--nodedc-primary-action-color: rgb(247 248 244);
|
||||||
|
--nodedc-primary-action-shadow: none;
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
{
|
{
|
||||||
"name": "@nodedc/ui-core",
|
"name": "@nodedc/ui-core",
|
||||||
"version": "0.7.0",
|
"version": "0.7.4",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"files": [
|
"files": [
|
||||||
"dist",
|
"dist",
|
||||||
"styles.css"
|
"styles.css",
|
||||||
|
"typography.mjs"
|
||||||
],
|
],
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
"types": "./dist/index.d.ts",
|
"types": "./dist/index.d.ts",
|
||||||
@@ -13,11 +14,13 @@
|
|||||||
"types": "./dist/index.d.ts",
|
"types": "./dist/index.d.ts",
|
||||||
"import": "./dist/index.js"
|
"import": "./dist/index.js"
|
||||||
},
|
},
|
||||||
"./styles.css": "./styles.css"
|
"./styles.css": "./styles.css",
|
||||||
|
"./typography": "./typography.mjs"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc -p tsconfig.json",
|
"build": "tsc -p tsconfig.json",
|
||||||
"typecheck": "tsc -p tsconfig.json --noEmit"
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
||||||
|
"prebuild": "node --test ../../scripts/operational-typography.test.mjs"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nodedc/tokens": "0.6.0"
|
"@nodedc/tokens": "0.6.0"
|
||||||
|
|||||||
@@ -15,12 +15,23 @@ export interface NodedcMaterial {
|
|||||||
|
|
||||||
export interface ApplyThemeOptions {
|
export interface ApplyThemeOptions {
|
||||||
theme?: NodedcTheme;
|
theme?: NodedcTheme;
|
||||||
/** Operator UI qualified against Mission Core; opt-in across portals. */
|
/** Mission Core is the canonical foundation. `default` is legacy compatibility. */
|
||||||
appearance?: "default" | "mission";
|
appearance?: "default" | "mission";
|
||||||
|
/** Flat surfaces remove decorative edges; keyboard focus uses a contrasting fill. */
|
||||||
|
edges?: "default" | "flat";
|
||||||
accent?: RgbTuple;
|
accent?: RgbTuple;
|
||||||
material?: NodedcMaterial;
|
material?: NodedcMaterial;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Complete shared foundation; colors live exclusively in @nodedc/tokens/themes.css. */
|
||||||
|
export const missionDarkTheme = Object.freeze({
|
||||||
|
theme: "dark", appearance: "mission", edges: "flat",
|
||||||
|
} as const satisfies ApplyThemeOptions);
|
||||||
|
|
||||||
|
export const missionLightTheme = Object.freeze({
|
||||||
|
theme: "light", appearance: "mission", edges: "flat",
|
||||||
|
} as const satisfies ApplyThemeOptions);
|
||||||
|
|
||||||
function formatRgb([red, green, blue]: RgbTuple): string {
|
function formatRgb([red, green, blue]: RgbTuple): string {
|
||||||
return `${red} ${green} ${blue}`;
|
return `${red} ${green} ${blue}`;
|
||||||
}
|
}
|
||||||
@@ -31,10 +42,11 @@ function clampOpacity(value: number): number {
|
|||||||
|
|
||||||
export function applyNodedcTheme(
|
export function applyNodedcTheme(
|
||||||
target: HTMLElement,
|
target: HTMLElement,
|
||||||
{ theme = "dark", accent, material, appearance = "default" }: ApplyThemeOptions = {},
|
{ theme = "dark", accent, material, appearance = "mission", edges = "flat" }: ApplyThemeOptions = {},
|
||||||
): void {
|
): void {
|
||||||
target.dataset.nodedcTheme = theme;
|
target.dataset.nodedcTheme = theme;
|
||||||
target.dataset.nodedcAppearance = appearance;
|
target.dataset.nodedcAppearance = appearance;
|
||||||
|
target.dataset.nodedcEdges = edges;
|
||||||
target.dataset.nodedcUi = "true";
|
target.dataset.nodedcUi = "true";
|
||||||
|
|
||||||
if (accent) {
|
if (accent) {
|
||||||
|
|||||||
+310
-53
@@ -1,7 +1,7 @@
|
|||||||
@import "@nodedc/tokens/tokens.css";
|
@import "@nodedc/tokens/tokens.css";
|
||||||
@import "@nodedc/tokens/themes.css";
|
@import "@nodedc/tokens/themes.css";
|
||||||
|
|
||||||
:where([data-nodedc-ui], .nodedc-ui-root) {
|
:where([data-nodedc-ui], .nodedc-ui-root, .nodedc-window, .nodedc-workspace-window, .nodedc-application-panel, .nodedc-admin-panel) {
|
||||||
color: var(--nodedc-text-primary);
|
color: var(--nodedc-text-primary);
|
||||||
font-family: var(--nodedc-font-family);
|
font-family: var(--nodedc-font-family);
|
||||||
font-synthesis: none;
|
font-synthesis: none;
|
||||||
@@ -9,6 +9,18 @@
|
|||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Theme attributes may live on html. Set the text base on body instead, so
|
||||||
|
rem tokens and user zoom never get multiplied by the operational base. */
|
||||||
|
:where([data-nodedc-ui]:not(html), .nodedc-ui-root:not(html), html[data-nodedc-ui] > body, html.nodedc-ui-root > body, .nodedc-window, .nodedc-workspace-window, .nodedc-application-panel, .nodedc-admin-panel) {
|
||||||
|
font-size: var(--nodedc-font-size-md);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Semantic headings inside operational surfaces do not inherit browser h1–h6 scaling.
|
||||||
|
Explicit canonical window/page titles retain their title token. */
|
||||||
|
:where([data-nodedc-ui], .nodedc-ui-root, .nodedc-window, .nodedc-workspace-window, .nodedc-application-panel, .nodedc-admin-panel) :where(h1, h2, h3, h4, h5, h6) {
|
||||||
|
font-size: var(--nodedc-font-size-md);
|
||||||
|
}
|
||||||
|
|
||||||
:where([data-nodedc-ui], .nodedc-ui-root) *,
|
:where([data-nodedc-ui], .nodedc-ui-root) *,
|
||||||
:where([data-nodedc-ui], .nodedc-ui-root) *::before,
|
:where([data-nodedc-ui], .nodedc-ui-root) *::before,
|
||||||
:where([data-nodedc-ui], .nodedc-ui-root) *::after {
|
:where([data-nodedc-ui], .nodedc-ui-root) *::after {
|
||||||
@@ -65,6 +77,12 @@
|
|||||||
box-shadow: var(--nodedc-glass-control-shadow);
|
box-shadow: var(--nodedc-glass-control-shadow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Form collections share SettingsCard's neutral group, not the recessed canvas. */
|
||||||
|
.nodedc-glass[data-tone="group"] {
|
||||||
|
background: var(--nodedc-surface-group);
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
.nodedc-glass[data-radius="panel"] {
|
.nodedc-glass[data-radius="panel"] {
|
||||||
border-radius: var(--nodedc-radius-panel);
|
border-radius: var(--nodedc-radius-panel);
|
||||||
}
|
}
|
||||||
@@ -346,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);
|
||||||
}
|
}
|
||||||
@@ -422,7 +441,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.nodedc-field__control:hover:not(:disabled) {
|
.nodedc-field__control:hover:not(:disabled) {
|
||||||
background: var(--nodedc-glass-control-hover);
|
background: var(--nodedc-field-hover-bg);
|
||||||
}
|
}
|
||||||
|
|
||||||
.nodedc-field__control:focus-visible {
|
.nodedc-field__control:focus-visible {
|
||||||
@@ -647,7 +666,7 @@ textarea.nodedc-field__control {
|
|||||||
min-width: 0;
|
min-width: 0;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
border-radius: var(--nodedc-radius-card);
|
border-radius: var(--nodedc-radius-card);
|
||||||
background: var(--nodedc-glass-control-bg);
|
background: var(--nodedc-surface-group);
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -693,7 +712,7 @@ textarea.nodedc-field__control {
|
|||||||
font-family: inherit;
|
font-family: inherit;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: var(--nodedc-text-muted);
|
color: var(--nodedc-text-muted);
|
||||||
font-size: var(--nodedc-font-size-sm);
|
font-size: var(--nodedc-description-font-size, var(--nodedc-font-size-sm));
|
||||||
line-height: 1.4;
|
line-height: 1.4;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1020,7 +1039,7 @@ textarea.nodedc-field__control {
|
|||||||
position: relative;
|
position: relative;
|
||||||
aspect-ratio: 1.5 / 1;
|
aspect-ratio: 1.5 / 1;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
border: 1px solid var(--nodedc-glass-outline);
|
border: 0;
|
||||||
border-radius: var(--nodedc-radius-control);
|
border-radius: var(--nodedc-radius-control);
|
||||||
outline: 0;
|
outline: 0;
|
||||||
background:
|
background:
|
||||||
@@ -1431,7 +1450,7 @@ textarea.nodedc-field__control {
|
|||||||
|
|
||||||
.nodedc-user-profile-card__cover strong {
|
.nodedc-user-profile-card__cover strong {
|
||||||
margin-top: 0.25rem;
|
margin-top: 0.25rem;
|
||||||
font-size: 0.92rem;
|
font-size: var(--nodedc-font-size-md);
|
||||||
}
|
}
|
||||||
|
|
||||||
.nodedc-user-profile-card__cover > span:not(.nodedc-header__avatar) {
|
.nodedc-user-profile-card__cover > span:not(.nodedc-header__avatar) {
|
||||||
@@ -1458,7 +1477,7 @@ textarea.nodedc-field__control {
|
|||||||
text-align: left;
|
text-align: left;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
font: inherit;
|
font: inherit;
|
||||||
font-size: 0.82rem;
|
font-size: var(--nodedc-font-size-md);
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
@@ -1552,14 +1571,21 @@ textarea.nodedc-field__control {
|
|||||||
--nodedc-app-page-pad: 1.25rem;
|
--nodedc-app-page-pad: 1.25rem;
|
||||||
--nodedc-app-panel-gap: 1.25rem;
|
--nodedc-app-panel-gap: 1.25rem;
|
||||||
--nodedc-app-nav-width: clamp(20.75rem, 19.5vw, 22rem);
|
--nodedc-app-nav-width: clamp(20.75rem, 19.5vw, 22rem);
|
||||||
|
--nodedc-app-nav-current-width: var(--nodedc-app-nav-width);
|
||||||
|
--nodedc-app-nav-rail-width: 4.55rem;
|
||||||
|
--nodedc-app-navigation-motion: 440ms cubic-bezier(0.22, 1, 0.36, 1);
|
||||||
--nodedc-app-content-width: calc(
|
--nodedc-app-content-width: calc(
|
||||||
100vw - (var(--nodedc-app-page-pad) * 2) - (var(--nodedc-app-panel-gap) * 2) - (var(--nodedc-app-nav-width) * 2)
|
100vw - (var(--nodedc-app-page-pad) * 2) - (var(--nodedc-app-panel-gap) * 2) - var(--nodedc-app-nav-current-width) - var(--nodedc-app-nav-width)
|
||||||
);
|
);
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
background: var(--nodedc-canvas);
|
background: var(--nodedc-canvas);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.nodedc-app-shell[data-navigation-collapsed="true"] {
|
||||||
|
--nodedc-app-nav-current-width: var(--nodedc-app-nav-rail-width);
|
||||||
|
}
|
||||||
|
|
||||||
.nodedc-app-shell__main {
|
.nodedc-app-shell__main {
|
||||||
position: relative;
|
position: relative;
|
||||||
height: calc(100vh - var(--nodedc-app-header-height));
|
height: calc(100vh - var(--nodedc-app-header-height));
|
||||||
@@ -1594,18 +1620,21 @@ textarea.nodedc-field__control {
|
|||||||
|
|
||||||
.nodedc-app-shell__navigation {
|
.nodedc-app-shell__navigation {
|
||||||
left: var(--nodedc-app-page-pad);
|
left: var(--nodedc-app-page-pad);
|
||||||
width: var(--nodedc-app-nav-width);
|
width: var(--nodedc-app-nav-current-width);
|
||||||
|
transition: width var(--nodedc-app-navigation-motion);
|
||||||
}
|
}
|
||||||
|
|
||||||
.nodedc-app-shell__content {
|
.nodedc-app-shell__content {
|
||||||
left: calc(var(--nodedc-app-page-pad) + var(--nodedc-app-nav-width) + var(--nodedc-app-panel-gap));
|
left: calc(var(--nodedc-app-page-pad) + var(--nodedc-app-nav-current-width) + var(--nodedc-app-panel-gap));
|
||||||
width: max(32rem, var(--nodedc-app-content-width));
|
width: max(32rem, var(--nodedc-app-content-width));
|
||||||
transition: width 500ms cubic-bezier(0.22, 1, 0.36, 1), right 500ms cubic-bezier(0.22, 1, 0.36, 1);
|
transition: left var(--nodedc-app-navigation-motion), width var(--nodedc-app-navigation-motion), right var(--nodedc-app-navigation-motion);
|
||||||
}
|
}
|
||||||
|
|
||||||
.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;
|
||||||
}
|
}
|
||||||
@@ -1616,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;
|
||||||
}
|
}
|
||||||
@@ -1625,12 +1656,12 @@ textarea.nodedc-field__control {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.nodedc-app-shell[data-navigation-open="true"] .nodedc-app-shell__stage {
|
.nodedc-app-shell[data-navigation-open="true"] .nodedc-app-shell__stage {
|
||||||
padding-left: calc(var(--nodedc-app-page-pad) + var(--nodedc-app-nav-width) + var(--nodedc-app-panel-gap));
|
padding-left: calc(var(--nodedc-app-page-pad) + var(--nodedc-app-nav-current-width) + var(--nodedc-app-panel-gap));
|
||||||
}
|
}
|
||||||
|
|
||||||
.nodedc-app-shell[data-content-open="true"]:not([data-content-expanded="true"]) .nodedc-app-shell__stage {
|
.nodedc-app-shell[data-content-open="true"]:not([data-content-expanded="true"]) .nodedc-app-shell__stage {
|
||||||
padding-left: calc(
|
padding-left: calc(
|
||||||
var(--nodedc-app-page-pad) + var(--nodedc-app-nav-width) + var(--nodedc-app-panel-gap) +
|
var(--nodedc-app-page-pad) + var(--nodedc-app-nav-current-width) + var(--nodedc-app-panel-gap) +
|
||||||
max(32rem, var(--nodedc-app-content-width)) + var(--nodedc-app-panel-gap)
|
max(32rem, var(--nodedc-app-content-width)) + var(--nodedc-app-panel-gap)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -1703,7 +1734,7 @@ textarea.nodedc-field__control {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.nodedc-application-panel__titles h1 {
|
.nodedc-application-panel__titles h1 {
|
||||||
font-size: 1.15rem;
|
font-size: var(--nodedc-font-size-title);
|
||||||
font-weight: 780;
|
font-weight: 780;
|
||||||
line-height: 1.15;
|
line-height: 1.15;
|
||||||
}
|
}
|
||||||
@@ -1711,7 +1742,7 @@ textarea.nodedc-field__control {
|
|||||||
.nodedc-application-panel__titles p {
|
.nodedc-application-panel__titles p {
|
||||||
max-width: 42rem;
|
max-width: 42rem;
|
||||||
color: var(--nodedc-text-muted);
|
color: var(--nodedc-text-muted);
|
||||||
font-size: 0.75rem;
|
font-size: var(--nodedc-font-size-sm);
|
||||||
line-height: 1.35;
|
line-height: 1.35;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1847,7 +1878,7 @@ textarea.nodedc-field__control {
|
|||||||
|
|
||||||
.nodedc-admin-panel__head p {
|
.nodedc-admin-panel__head p {
|
||||||
color: var(--nodedc-text-muted);
|
color: var(--nodedc-text-muted);
|
||||||
font-size: 0.68rem;
|
font-size: var(--nodedc-font-size-sm);
|
||||||
font-weight: 850;
|
font-weight: 850;
|
||||||
letter-spacing: 0.04em;
|
letter-spacing: 0.04em;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
@@ -1855,7 +1886,7 @@ textarea.nodedc-field__control {
|
|||||||
|
|
||||||
.nodedc-admin-panel__head h2 {
|
.nodedc-admin-panel__head h2 {
|
||||||
margin-top: 0.55rem;
|
margin-top: 0.55rem;
|
||||||
font-size: 1.15rem;
|
font-size: var(--nodedc-font-size-title);
|
||||||
font-weight: 780;
|
font-weight: 780;
|
||||||
line-height: 1.1;
|
line-height: 1.1;
|
||||||
}
|
}
|
||||||
@@ -2008,7 +2039,7 @@ textarea.nodedc-field__control {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.nodedc-admin-context__body strong {
|
.nodedc-admin-context__body strong {
|
||||||
font-size: 0.92rem;
|
font-size: var(--nodedc-font-size-md);
|
||||||
font-weight: 800;
|
font-weight: 800;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2047,7 +2078,7 @@ textarea.nodedc-field__control {
|
|||||||
color: var(--nodedc-text-secondary);
|
color: var(--nodedc-text-secondary);
|
||||||
padding: 5px 0.9rem 5px calc(5px + 2.92rem + 0.86rem);
|
padding: 5px 0.9rem 5px calc(5px + 2.92rem + 0.86rem);
|
||||||
font: inherit;
|
font: inherit;
|
||||||
font-size: 0.91rem;
|
font-size: var(--nodedc-font-size-md);
|
||||||
font-weight: 570;
|
font-weight: 570;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
opacity: 0.66;
|
opacity: 0.66;
|
||||||
@@ -2112,7 +2143,7 @@ textarea.nodedc-field__control {
|
|||||||
padding-right: 3rem;
|
padding-right: 3rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nodedc-admin-panel__sortable-row > .nodedc-drag-handle {
|
.nodedc-admin-panel__sortable-row > span > .nodedc-drag-handle {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
right: 0.72rem;
|
right: 0.72rem;
|
||||||
@@ -2149,6 +2180,72 @@ textarea.nodedc-field__control {
|
|||||||
opacity: 0.82;
|
opacity: 0.82;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Shared collapsible left navigation; the right application panel is independent. */
|
||||||
|
.nodedc-admin-panel--navigation {
|
||||||
|
--nodedc-app-nav-rail-width: 4.55rem;
|
||||||
|
transition: width var(--nodedc-app-navigation-motion, 440ms cubic-bezier(0.22, 1, 0.36, 1));
|
||||||
|
}
|
||||||
|
.nodedc-admin-panel--navigation .nodedc-admin-panel__head { min-height: 3.55rem; }
|
||||||
|
.nodedc-admin-panel__titles { min-width: 0; padding-right: 4.5rem; }
|
||||||
|
.nodedc-admin-panel__titles,
|
||||||
|
.nodedc-admin-panel__item-label,
|
||||||
|
.nodedc-admin-panel--navigation .nodedc-admin-context__body,
|
||||||
|
.nodedc-admin-panel--navigation .nodedc-admin-panel__footer > :not(.nodedc-admin-panel__nav-icon) {
|
||||||
|
transition: opacity 160ms ease;
|
||||||
|
}
|
||||||
|
.nodedc-admin-panel__item-label { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
|
||||||
|
.nodedc-admin-panel__extra-actions { display: contents; }
|
||||||
|
.nodedc-admin-panel__extra-actions:empty { display: none; }
|
||||||
|
.nodedc-admin-panel__extra-actions > .nodedc-icon-button { width: 2.92rem; height: 2.92rem; flex-basis: 2.92rem; }
|
||||||
|
.nodedc-admin-panel__context-area { display: grid; gap: .48rem; }
|
||||||
|
.nodedc-admin-panel--navigation .nodedc-admin-panel__item-tooltip { display: block; width: 100%; min-width: 0; }
|
||||||
|
.nodedc-admin-panel--navigation [hidden] { display: none; }
|
||||||
|
.nodedc-admin-panel--navigation[data-collapsed="true"] { width: var(--nodedc-app-nav-rail-width); }
|
||||||
|
.nodedc-admin-panel--navigation .nodedc-admin-context__main { width: 100%; }
|
||||||
|
.nodedc-admin-panel--navigation[data-collapsed="true"] .nodedc-admin-panel__titles { height: 0; }
|
||||||
|
.nodedc-admin-panel--navigation[data-collapsed="true"] .nodedc-admin-panel__titles,
|
||||||
|
.nodedc-admin-panel--navigation[data-collapsed="true"] .nodedc-admin-panel__item-label,
|
||||||
|
.nodedc-admin-panel--navigation[data-collapsed="true"] .nodedc-admin-context__body,
|
||||||
|
.nodedc-admin-panel--navigation[data-collapsed="true"] .nodedc-admin-panel__footer > :not(.nodedc-admin-panel__nav-icon) {
|
||||||
|
opacity: 0;
|
||||||
|
pointer-events: none;
|
||||||
|
width: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
.nodedc-admin-panel--navigation[data-collapsed="true"] .nodedc-admin-panel__head-actions {
|
||||||
|
left: 0; right: 0; justify-content: center;
|
||||||
|
}
|
||||||
|
.nodedc-admin-panel--navigation[data-collapsed="true"] :is(.nodedc-admin-panel__nav-item, .nodedc-admin-panel__footer, .nodedc-admin-context__main) {
|
||||||
|
justify-content: center; gap: 0; padding-inline: 0;
|
||||||
|
}
|
||||||
|
.nodedc-admin-panel--navigation[data-collapsed="true"] :is(.nodedc-admin-panel__nav-item, .nodedc-admin-panel__footer, .nodedc-admin-context) {
|
||||||
|
background: transparent; box-shadow: none;
|
||||||
|
}
|
||||||
|
.nodedc-admin-panel--navigation[data-collapsed="true"] .nodedc-admin-context { grid-template-columns: minmax(0, 1fr); }
|
||||||
|
.nodedc-admin-panel--navigation[data-collapsed="true"] .nodedc-admin-panel__nav-icon {
|
||||||
|
position: static; transform: none;
|
||||||
|
}
|
||||||
|
.nodedc-admin-panel--navigation[data-collapsed="true"] .nodedc-admin-panel__nav-item:focus-visible .nodedc-admin-panel__nav-icon,
|
||||||
|
.nodedc-admin-panel--navigation .nodedc-admin-context__main:focus-visible .nodedc-admin-context__icon {
|
||||||
|
background: var(--nodedc-glass-control-hover); color: var(--nodedc-text-primary);
|
||||||
|
}
|
||||||
|
.nodedc-admin-panel--navigation[data-collapsed="true"] :is(.nodedc-admin-panel__nav-item, .nodedc-admin-context__main):focus-visible {
|
||||||
|
background: transparent; box-shadow: none;
|
||||||
|
}
|
||||||
|
.nodedc-admin-panel--navigation[data-collapsed="true"] .nodedc-admin-panel__nav-item:focus-visible .nodedc-admin-panel__nav-icon,
|
||||||
|
.nodedc-admin-panel--navigation[data-collapsed="true"] .nodedc-admin-context__main:focus-visible .nodedc-admin-context__icon {
|
||||||
|
background: var(--nodedc-text-primary); color: var(--nodedc-canvas);
|
||||||
|
}
|
||||||
|
.nodedc-admin-panel--navigation[data-collapsed="true"] .nodedc-admin-panel__nav-item:focus-visible .nodedc-admin-panel__nav-icon > svg { color: inherit; }
|
||||||
|
@media (prefers-reduced-motion: reduce) {
|
||||||
|
.nodedc-admin-panel--navigation,
|
||||||
|
.nodedc-admin-panel--navigation *,
|
||||||
|
.nodedc-app-shell__navigation,
|
||||||
|
.nodedc-app-shell__content,
|
||||||
|
.nodedc-app-shell__stage { transition: none; animation: none; }
|
||||||
|
}
|
||||||
|
|
||||||
.nodedc-dropdown-anchor {
|
.nodedc-dropdown-anchor {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
}
|
}
|
||||||
@@ -2910,7 +3007,7 @@ textarea.nodedc-field__control {
|
|||||||
|
|
||||||
.nodedc-workspace-window__head:focus-visible {
|
.nodedc-workspace-window__head:focus-visible {
|
||||||
background: var(--nodedc-focus-surface);
|
background: var(--nodedc-focus-surface);
|
||||||
box-shadow: inset 0 0 0 1px rgb(var(--nodedc-accent-rgb) / 0.22);
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nodedc-workspace-window[data-maximized="true"] .nodedc-workspace-window__head {
|
.nodedc-workspace-window[data-maximized="true"] .nodedc-workspace-window__head {
|
||||||
@@ -3151,7 +3248,9 @@ textarea.nodedc-field__control {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Keep the full hit area and keyboard focus cue without a visible divider. */
|
/* Keep the full hit area and keyboard focus cue without a visible divider. */
|
||||||
.nodedc-split-pane[data-separator-appearance="invisible"] > .nodedc-split-pane__separator:not(:focus-visible)::before {
|
.nodedc-split-pane[data-separator-appearance="invisible"] > .nodedc-split-pane__separator:not(:focus-visible)::before,
|
||||||
|
.nodedc-split-pane[data-separator-appearance="invisible"] > .nodedc-split-pane__separator[data-pointer-focus]::before,
|
||||||
|
.nodedc-split-pane[data-separator-appearance="invisible"][data-dragging="true"] > .nodedc-split-pane__separator::before {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
@@ -3549,20 +3648,29 @@ textarea.nodedc-field__control {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.nodedc-inspector {
|
.nodedc-inspector {
|
||||||
|
container-type: inline-size;
|
||||||
|
container-name: nodedc-inspector;
|
||||||
display: grid;
|
display: grid;
|
||||||
|
min-width: 0;
|
||||||
|
grid-template-columns: minmax(0, 1fr);
|
||||||
width: min(var(--nodedc-inspector-inner-width), 100%);
|
width: min(var(--nodedc-inspector-inner-width), 100%);
|
||||||
gap: 1px;
|
gap: var(--nodedc-space-3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.nodedc-inspector__header { display: grid; min-width: 0; gap: var(--nodedc-space-3); }
|
||||||
|
.nodedc-inspector__footer { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: var(--nodedc-space-3); }
|
||||||
|
|
||||||
.nodedc-inspector__group {
|
.nodedc-inspector__group {
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: 1px;
|
min-width: 0;
|
||||||
|
grid-template-columns: minmax(0, 1fr);
|
||||||
|
gap: var(--nodedc-space-3);
|
||||||
}
|
}
|
||||||
|
|
||||||
.nodedc-inspector__section {
|
.nodedc-inspector__section {
|
||||||
display: grid;
|
display: grid;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
gap: 1px;
|
gap: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nodedc-inspector__section-trigger {
|
.nodedc-inspector__section-trigger {
|
||||||
@@ -3637,6 +3745,8 @@ textarea.nodedc-field__control {
|
|||||||
|
|
||||||
.nodedc-inspector__section-content {
|
.nodedc-inspector__section-content {
|
||||||
display: grid;
|
display: grid;
|
||||||
|
min-width: 0;
|
||||||
|
grid-template-columns: minmax(0, 1fr);
|
||||||
gap: var(--nodedc-space-3);
|
gap: var(--nodedc-space-3);
|
||||||
padding: var(--nodedc-space-3) 0 var(--nodedc-space-2);
|
padding: var(--nodedc-space-3) 0 var(--nodedc-space-2);
|
||||||
animation: nodedc-section-in var(--nodedc-duration-fast) ease;
|
animation: nodedc-section-in var(--nodedc-duration-fast) ease;
|
||||||
@@ -3734,7 +3844,7 @@ textarea.nodedc-field__control {
|
|||||||
display: grid;
|
display: grid;
|
||||||
width: min(var(--nodedc-inspector-inner-width), 100%);
|
width: min(var(--nodedc-inspector-inner-width), 100%);
|
||||||
min-height: var(--nodedc-control-height);
|
min-height: var(--nodedc-control-height);
|
||||||
grid-template-columns: var(--nodedc-inspector-label-width) var(--nodedc-inspector-control-width);
|
grid-template-columns: minmax(0, 1fr) minmax(0, var(--nodedc-inspector-control-width));
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: var(--nodedc-inspector-control-gap);
|
gap: var(--nodedc-inspector-control-gap);
|
||||||
}
|
}
|
||||||
@@ -3845,6 +3955,11 @@ textarea.nodedc-field__control {
|
|||||||
width: auto;
|
width: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.nodedc-app-shell[data-navigation-collapsed="true"] .nodedc-app-shell__navigation {
|
||||||
|
right: auto;
|
||||||
|
width: var(--nodedc-app-nav-rail-width);
|
||||||
|
}
|
||||||
|
|
||||||
.nodedc-app-shell[data-end-panel-open="true"] .nodedc-app-shell__content {
|
.nodedc-app-shell[data-end-panel-open="true"] .nodedc-app-shell__content {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
@@ -3914,6 +4029,7 @@ textarea.nodedc-field__control {
|
|||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.nodedc-header__profile-button,
|
||||||
.nodedc-user-profile-menu__trigger-label {
|
.nodedc-user-profile-menu__trigger-label {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
@@ -4003,7 +4119,7 @@ textarea.nodedc-field__control {
|
|||||||
[data-nodedc-theme="light"] :is(.nodedc-header__brand, .nodedc-header__workspace)[data-monochrome="true"] img { filter: brightness(0); }
|
[data-nodedc-theme="light"] :is(.nodedc-header__brand, .nodedc-header__workspace)[data-monochrome="true"] img { filter: brightness(0); }
|
||||||
|
|
||||||
/* Owner-admitted linear progress in the shared resource row. */
|
/* Owner-admitted linear progress in the shared resource row. */
|
||||||
.nodedc-progress-bar { min-width: 3rem; height: var(--nodedc-space-2); overflow: hidden; border-radius: var(--nodedc-radius-circle); background: var(--nodedc-glass-control-bg); }
|
.nodedc-progress-bar { min-width: 3rem; height: var(--nodedc-progress-height, var(--nodedc-space-2)); overflow: hidden; border-radius: var(--nodedc-radius-circle); background: var(--nodedc-glass-control-bg); }
|
||||||
.nodedc-progress-bar__fill { display: block; width: 100%; height: 100%; background: var(--nodedc-text-secondary); border-radius: inherit; transform: scaleX(var(--nodedc-progress-fraction)); transform-origin: left; transition: transform var(--nodedc-duration-normal) var(--nodedc-ease-standard); }
|
.nodedc-progress-bar__fill { display: block; width: 100%; height: 100%; background: var(--nodedc-text-secondary); border-radius: inherit; transform: scaleX(var(--nodedc-progress-fraction)); transform-origin: left; transition: transform var(--nodedc-duration-normal) var(--nodedc-ease-standard); }
|
||||||
.nodedc-progress-bar[data-indeterminate] > .nodedc-progress-bar__fill { width: 35%; animation: nodedc-progress-travel 1.5s ease-in-out infinite alternate; }
|
.nodedc-progress-bar[data-indeterminate] > .nodedc-progress-bar__fill { width: 35%; animation: nodedc-progress-travel 1.5s ease-in-out infinite alternate; }
|
||||||
@keyframes nodedc-progress-travel { from { transform: translateX(-100%); } to { transform: translateX(285%); } }
|
@keyframes nodedc-progress-travel { from { transform: translateX(-100%); } to { transform: translateX(285%); } }
|
||||||
@@ -4096,7 +4212,7 @@ textarea.nodedc-field__control {
|
|||||||
max-width: 34rem;
|
max-width: 34rem;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
color: var(--nodedc-text-secondary);
|
color: var(--nodedc-text-secondary);
|
||||||
font-size: clamp(0.8rem, 1vw, 1rem);
|
font-size: var(--nodedc-font-size-sm);
|
||||||
line-height: 1.6;
|
line-height: 1.6;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4131,7 +4247,7 @@ textarea.nodedc-field__control {
|
|||||||
.nodedc-landing-stage__status p {
|
.nodedc-landing-stage__status p {
|
||||||
margin: 0.15rem 0 0;
|
margin: 0.15rem 0 0;
|
||||||
color: var(--nodedc-text-muted);
|
color: var(--nodedc-text-muted);
|
||||||
font-size: 0.66rem;
|
font-size: var(--nodedc-font-size-sm);
|
||||||
line-height: 1.45;
|
line-height: 1.45;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4238,7 +4354,7 @@ textarea.nodedc-field__control {
|
|||||||
.nodedc-environment-media-playlist__error {
|
.nodedc-environment-media-playlist__error {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
color: var(--nodedc-text-muted);
|
color: var(--nodedc-text-muted);
|
||||||
font-size: var(--nodedc-font-size-xs);
|
font-size: var(--nodedc-font-size-sm);
|
||||||
line-height: 1.4;
|
line-height: 1.4;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4350,7 +4466,7 @@ textarea.nodedc-field__control {
|
|||||||
}
|
}
|
||||||
@media (max-height: 720px) and (min-width: 761px) {
|
@media (max-height: 720px) and (min-width: 761px) {
|
||||||
.nodedc-landing-stage__copy p {
|
.nodedc-landing-stage__copy p {
|
||||||
font-size: 0.76rem;
|
font-size: var(--nodedc-font-size-sm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@media (max-height: 720px) and (min-width: 761px) {
|
@media (max-height: 720px) and (min-width: 761px) {
|
||||||
@@ -4376,26 +4492,11 @@ textarea.nodedc-field__control {
|
|||||||
.nodedc-key-button:disabled { opacity:.4; cursor:not-allowed; }
|
.nodedc-key-button:disabled { opacity:.4; cursor:not-allowed; }
|
||||||
.nodedc-key-button:focus-visible { outline:2px solid rgb(var(--nodedc-accent-rgb)); outline-offset:3px; }
|
.nodedc-key-button:focus-visible { outline:2px solid rgb(var(--nodedc-accent-rgb)); outline-offset:3px; }
|
||||||
|
|
||||||
/* Shared operator appearance, qualified against Mission Core 2026-09-30.
|
/* Canonical operator appearance, audited against Mission Core 2026-11-05.
|
||||||
Set on documentElement so modal and dropdown portals share the same profile. */
|
Set on documentElement so modal and dropdown portals share the same profile. */
|
||||||
[data-nodedc-appearance="mission"][data-nodedc-theme="dark"] {
|
|
||||||
--nodedc-modal-surface: rgb(15 15 17 / .97);
|
|
||||||
--nodedc-floating-surface: rgb(15 15 17 / .98);
|
|
||||||
--nodedc-primary-action-bg: rgb(247 248 244 / .96);
|
|
||||||
--nodedc-primary-action-hover: rgb(255 255 255);
|
|
||||||
--nodedc-primary-action-color: rgb(8 8 10 / .96);
|
|
||||||
--nodedc-primary-action-shadow: none;
|
|
||||||
--nodedc-focus-surface: rgb(255 255 255 / .09);
|
|
||||||
}
|
|
||||||
[data-nodedc-appearance="mission"] .nodedc-glass-material::before { display: none; }
|
[data-nodedc-appearance="mission"] .nodedc-glass-material::before { display: none; }
|
||||||
[data-nodedc-appearance="mission"][data-nodedc-theme="light"] {
|
|
||||||
--nodedc-modal-surface: rgb(247 248 250 / .97);
|
|
||||||
--nodedc-floating-surface: rgb(247 248 250 / .98);
|
|
||||||
--nodedc-primary-action-bg: rgb(24 25 28 / .96);
|
|
||||||
--nodedc-primary-action-hover: rgb(8 8 10);
|
|
||||||
--nodedc-primary-action-color: rgb(247 248 244);
|
|
||||||
--nodedc-primary-action-shadow: none;
|
|
||||||
}
|
|
||||||
[data-nodedc-appearance="mission"] .nodedc-header__avatar { background: rgb(226 226 226); }
|
[data-nodedc-appearance="mission"] .nodedc-header__avatar { background: rgb(226 226 226); }
|
||||||
[data-nodedc-appearance="mission"][data-nodedc-theme="dark"] .nodedc-feature-settings__section[data-active="true"] { background: rgb(247 248 244 / .14); }
|
[data-nodedc-appearance="mission"][data-nodedc-theme="dark"] .nodedc-feature-settings__section[data-active="true"] { background: rgb(247 248 244 / .14); }
|
||||||
[data-nodedc-appearance="mission"][data-nodedc-theme="light"] .nodedc-feature-settings__section[data-active="true"] { background: rgb(8 8 10 / .09); }
|
[data-nodedc-appearance="mission"][data-nodedc-theme="light"] .nodedc-feature-settings__section[data-active="true"] { background: rgb(8 8 10 / .09); }
|
||||||
@@ -4530,14 +4631,19 @@ textarea.nodedc-field__control {
|
|||||||
.nodedc-editor-workspace__body {position:relative;flex:1;min-height:0;min-width:0;overflow:hidden;}
|
.nodedc-editor-workspace__body {position:relative;flex:1;min-height:0;min-width:0;overflow:hidden;}
|
||||||
.nodedc-editor-dock {position:absolute;inset:0;overflow:auto;overscroll-behavior:contain;isolation:isolate;}
|
.nodedc-editor-dock {position:absolute;inset:0;overflow:auto;overscroll-behavior:contain;isolation:isolate;}
|
||||||
.nodedc-editor-dock__canvas {position:relative;width:100%;height:100%;}
|
.nodedc-editor-dock__canvas {position:relative;width:100%;height:100%;}
|
||||||
.nodedc-editor-dock__primary {position:absolute;overflow:hidden;min-width:0;min-height:0;}
|
.nodedc-editor-dock__primary {position:absolute;isolation:isolate;overflow:hidden;min-width:0;min-height:0;}
|
||||||
.nodedc-editor-dock__tool {position:absolute;display:flex;flex-direction:column;box-sizing:border-box;min-width:0;min-height:0;}
|
.nodedc-editor-dock__tool {position:absolute;display:flex;flex-direction:column;box-sizing:border-box;min-width:0;min-height:0;}
|
||||||
.nodedc-editor-dock__tool[hidden] {display:none;}
|
.nodedc-editor-dock__tool[hidden] {display:none;}
|
||||||
.nodedc-editor-dock__tool:not([data-floating]) {border-radius:0;box-shadow:none;}
|
.nodedc-editor-dock__tool:not([data-floating]) {border-radius:0;box-shadow:none;}
|
||||||
.nodedc-editor-dock__tool::before {display:none;}
|
.nodedc-editor-dock__tool::before {display:none;}
|
||||||
|
.nodedc-editor-dock :is(.nodedc-editor-dock__tool,.nodedc-editor-dock__primary)[data-dock-corners~="top-left"] {border-top-left-radius:var(--nodedc-radius-panel);}
|
||||||
|
.nodedc-editor-dock :is(.nodedc-editor-dock__tool,.nodedc-editor-dock__primary)[data-dock-corners~="top-right"] {border-top-right-radius:var(--nodedc-radius-panel);}
|
||||||
|
.nodedc-editor-dock :is(.nodedc-editor-dock__tool,.nodedc-editor-dock__primary)[data-dock-corners~="bottom-right"] {border-bottom-right-radius:var(--nodedc-radius-panel);}
|
||||||
|
.nodedc-editor-dock :is(.nodedc-editor-dock__tool,.nodedc-editor-dock__primary)[data-dock-corners~="bottom-left"] {border-bottom-left-radius:var(--nodedc-radius-panel);}
|
||||||
.nodedc-editor-dock__tool>.nodedc-window__head {flex:none;cursor:grab;touch-action:none;user-select:none;}
|
.nodedc-editor-dock__tool>.nodedc-window__head {flex:none;cursor:grab;touch-action:none;user-select:none;}
|
||||||
.nodedc-editor-dock__tool>.nodedc-window__head:active {cursor:grabbing;}
|
.nodedc-editor-dock__tool>.nodedc-window__head:active {cursor:grabbing;}
|
||||||
.nodedc-editor-dock__tool>.nodedc-window__head:focus-visible {outline:2px solid var(--nodedc-text-primary);outline-offset:-3px;}
|
|
||||||
|
.nodedc-editor-dock__tool>.nodedc-window__head:focus-visible :is(.nodedc-window__title,.nodedc-window__subtitle,.nodedc-window__actions,.nodedc-window__close,.nodedc-icon-button) {color:inherit;}
|
||||||
.nodedc-editor-dock__body {flex:1;min-height:0;min-width:0;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;padding:0 var(--nodedc-space-3) var(--nodedc-space-3);}
|
.nodedc-editor-dock__body {flex:1;min-height:0;min-width:0;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;padding:0 var(--nodedc-space-3) var(--nodedc-space-3);}
|
||||||
.nodedc-editor-dock__tool .nodedc-inspector {width:100%;max-width:none;}
|
.nodedc-editor-dock__tool .nodedc-inspector {width:100%;max-width:none;}
|
||||||
.nodedc-editor-dock__tool>.nodedc-window__footer {flex:none;}
|
.nodedc-editor-dock__tool>.nodedc-window__footer {flex:none;}
|
||||||
@@ -4565,7 +4671,7 @@ textarea.nodedc-field__control {
|
|||||||
|
|
||||||
/* Structural cube edges communicate face/edge/corner hit zones. */
|
/* Structural cube edges communicate face/edge/corner hit zones. */
|
||||||
.nodedc-navigation-cube { width: 66px; height: 66px; overflow: visible; user-select: none; }
|
.nodedc-navigation-cube { width: 66px; height: 66px; overflow: visible; user-select: none; }
|
||||||
.nodedc-navigation-cube polygon { fill: var(--cube-face, var(--nodedc-surface-raised, #292929)); stroke: var(--cube-edge, var(--nodedc-text-muted, #888)); stroke-width: .55; stroke-opacity: var(--cube-edge-opacity, 1); }
|
.nodedc-navigation-cube polygon { fill: var(--cube-face, var(--nodedc-surface-raised, #292929)); stroke: var(--cube-edge, var(--nodedc-text-muted, #888)); stroke-width: .55; stroke-opacity: var(--cube-edge-opacity, 1); fill-opacity:var(--cube-face-opacity,1); }
|
||||||
.nodedc-navigation-cube text { fill: var(--cube-text, var(--nodedc-text-primary, #eee)); font: 600 9px var(--nodedc-font-family); pointer-events: none; }
|
.nodedc-navigation-cube text { fill: var(--cube-text, var(--nodedc-text-primary, #eee)); font: 600 9px var(--nodedc-font-family); pointer-events: none; }
|
||||||
.nodedc-navigation-cube g { cursor: pointer; }
|
.nodedc-navigation-cube g { cursor: pointer; }
|
||||||
.nodedc-navigation-cube g.is-hovered polygon, .nodedc-navigation-cube g:focus-visible polygon { fill: var(--cube-hover, var(--nodedc-control-selected-bg, #eee)); }
|
.nodedc-navigation-cube g.is-hovered polygon, .nodedc-navigation-cube g:focus-visible polygon { fill: var(--cube-hover, var(--nodedc-control-selected-bg, #eee)); }
|
||||||
@@ -4662,3 +4768,154 @@ textarea.nodedc-field__control {
|
|||||||
.nodedc-scene-annotation[aria-pressed="true"] { box-shadow:var(--nodedc-glass-control-shadow); }
|
.nodedc-scene-annotation[aria-pressed="true"] { box-shadow:var(--nodedc-glass-control-shadow); }
|
||||||
|
|
||||||
.nodedc-scene-annotation.nodedc-button[hidden] { display:none; }
|
.nodedc-scene-annotation.nodedc-button[hidden] { display:none; }
|
||||||
|
|
||||||
|
/* A measured resource capsule; its containing row never owns a surface. */
|
||||||
|
.nodedc-level-button.nodedc-button{min-width:calc(var(--nodedc-control-height) * 2.5);font-variant-numeric:tabular-nums;--nodedc-level-color:var(--nodedc-text-secondary)}
|
||||||
|
.nodedc-level-button[data-level-tone="success"]{--nodedc-level-color:rgb(var(--nodedc-success-rgb))}
|
||||||
|
.nodedc-level-button[data-level-tone="warning"]{--nodedc-level-color:rgb(var(--nodedc-warning-rgb))}
|
||||||
|
.nodedc-level-button[data-level-tone="danger"]{--nodedc-level-color:rgb(var(--nodedc-danger-rgb))}
|
||||||
|
.nodedc-level-button[data-freshness="stale"],.nodedc-level-button[data-freshness="unknown"]{--nodedc-level-color:var(--nodedc-text-secondary)}
|
||||||
|
.nodedc-level-button.nodedc-button,.nodedc-level-button.nodedc-button:hover{background-image:linear-gradient(90deg,color-mix(in srgb,var(--nodedc-level-color) 26%,transparent) var(--nodedc-level-percent),transparent var(--nodedc-level-percent))}
|
||||||
|
|
||||||
|
.nodedc-level-button[data-custom-fill].nodedc-button{position:relative;overflow:hidden;background-image:none}
|
||||||
|
.nodedc-level-button__fill{position:absolute;inset:0;display:grid;place-items:center;pointer-events:none;background:var(--nodedc-level-custom);color:var(--nodedc-level-ink);clip-path:inset(0 calc(100% - var(--nodedc-level-percent)) 0 0)}
|
||||||
|
|
||||||
|
|
||||||
|
.nodedc-tooltip-anchor { display: inline-flex; min-width: 0; }
|
||||||
|
.nodedc-tooltip-anchor[tabindex] { border-radius: var(--nodedc-radius-control-compact); }
|
||||||
|
.nodedc-tooltip-anchor[tabindex]:focus-visible { outline: 2px solid var(--nodedc-text-primary); outline-offset: 3px; }
|
||||||
|
.nodedc-tooltip {
|
||||||
|
position: fixed; z-index: var(--nodedc-layer-popover); box-sizing: border-box;
|
||||||
|
width: max-content; max-width: min(280px, calc(100vw - 16px)); overflow: auto;
|
||||||
|
padding: var(--nodedc-space-3) var(--nodedc-space-4);
|
||||||
|
border-radius: var(--nodedc-radius-control-compact);
|
||||||
|
border: 0; outline: 0;
|
||||||
|
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)); color: var(--nodedc-text-primary);
|
||||||
|
box-shadow: none; font-family: var(--nodedc-font-family);
|
||||||
|
font-size: var(--nodedc-font-size-sm); font-weight: var(--nodedc-font-weight-regular); line-height: 1.4;
|
||||||
|
animation: nodedc-tooltip-in var(--nodedc-duration-fast) var(--nodedc-ease-standard);
|
||||||
|
}
|
||||||
|
@keyframes nodedc-tooltip-in { from { opacity: 0; } to { opacity: 1; } }
|
||||||
|
@media (prefers-reduced-motion: reduce) { .nodedc-tooltip { animation: none; } }
|
||||||
|
|
||||||
|
/* Opt-in flat material. Applies at the document root, including portal layers.
|
||||||
|
Focus remains visible through a high-contrast fill instead of a contour. */
|
||||||
|
[data-nodedc-edges="flat"] {
|
||||||
|
--nodedc-glass-outline: transparent;
|
||||||
|
--nodedc-glass-control-shadow: none;
|
||||||
|
--nodedc-panel-action-border: transparent;
|
||||||
|
--nodedc-panel-action-border-hover: transparent;
|
||||||
|
--nodedc-panel-action-shadow: none;
|
||||||
|
}
|
||||||
|
[data-nodedc-edges="flat"] .nodedc-material-rim::after,
|
||||||
|
[data-nodedc-edges="flat"] .nodedc-glass-material::before { display: none; }
|
||||||
|
[data-nodedc-edges="flat"] :is(.nodedc-admin-panel__nav-item, .nodedc-application-panel__action, .nodedc-admin-panel__close, .nodedc-media-source-button, .nodedc-media-preview, .nodedc-color-field__swatch) {
|
||||||
|
border: 0;
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
[data-nodedc-edges="flat"] :is(button, input, textarea, [tabindex]):focus-visible {
|
||||||
|
outline: 0;
|
||||||
|
box-shadow: none;
|
||||||
|
background-color: var(--nodedc-text-primary);
|
||||||
|
color: var(--nodedc-canvas);
|
||||||
|
}
|
||||||
|
[data-nodedc-edges="flat"] .nodedc-admin-panel__nav-item:focus-visible .nodedc-admin-panel__nav-icon {
|
||||||
|
background: var(--nodedc-canvas);
|
||||||
|
color: var(--nodedc-text-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.nodedc-select[data-shape="pill"] :is(.nodedc-select__value,.nodedc-select__toggle) { border-radius: var(--nodedc-radius-circle); }
|
||||||
|
|
||||||
|
/* Owner canon 2026-11-14: all viewport-backed UI shares scene Glass V4.
|
||||||
|
Geometry, disabled opacity, pressed selection and keyboard focus are retained.
|
||||||
|
The DOM surface class is for existing semantic overlays, never the renderer. */
|
||||||
|
.nodedc-toolbar-wrap[data-scope="viewport"] .nodedc-toolbar__button:not([data-active="true"]),
|
||||||
|
.nodedc-viewport-surface[data-glass-context="scene"],
|
||||||
|
.nodedc-dropdown-surface.nodedc-viewport-surface,
|
||||||
|
:is(.nodedc-viewport-controls, .nodedc-scene-controls) :is(.nodedc-icon-button:not([aria-pressed="true"]), .nodedc-button:is([data-variant="secondary"], [data-variant="ghost"]):not([aria-pressed="true"]), .nodedc-select__toggle, .nodedc-segmented, .nodedc-workspace-window__action:not([aria-pressed="true"])) {
|
||||||
|
background: rgb(var(--nodedc-modal-glass-tint-rgb) / var(--nodedc-scene-glass-opacity));
|
||||||
|
color: var(--nodedc-text-primary);
|
||||||
|
backdrop-filter: blur(var(--nodedc-scene-glass-blur)) saturate(var(--nodedc-modal-glass-saturation)) brightness(var(--nodedc-modal-glass-brightness));
|
||||||
|
-webkit-backdrop-filter: blur(var(--nodedc-scene-glass-blur)) saturate(var(--nodedc-modal-glass-saturation)) brightness(var(--nodedc-modal-glass-brightness));
|
||||||
|
}
|
||||||
|
.nodedc-toolbar-wrap[data-scope="viewport"] .nodedc-toolbar__button:hover:not(:disabled):not([data-active="true"]),
|
||||||
|
:is(.nodedc-viewport-controls, .nodedc-scene-controls) :is(.nodedc-icon-button, .nodedc-button:is([data-variant="secondary"], [data-variant="ghost"]), .nodedc-workspace-window__action):hover:not(:disabled):not([aria-pressed="true"]) {
|
||||||
|
background: color-mix(in srgb, var(--nodedc-text-primary) 12%, rgb(var(--nodedc-modal-glass-tint-rgb) / var(--nodedc-scene-glass-opacity)));
|
||||||
|
}
|
||||||
|
|
||||||
|
.nodedc-tree__actions {display:flex;flex:none;align-items:center;}
|
||||||
|
.nodedc-tree__actions .nodedc-icon-button {flex:0 0 24px;width:24px;height:24px;min-width:24px;padding:0;}
|
||||||
|
|
||||||
|
/* A backdrop root on the transparent rail would prevent button glass sampling the scene. */
|
||||||
|
.nodedc-toolbar-wrap[data-scope="viewport"] .nodedc-toolbar {will-change:transform;}
|
||||||
|
|
||||||
|
/* Floating inspectors may be narrower than the browser; respond to their own width. */
|
||||||
|
@container nodedc-inspector (max-width: 329px) {
|
||||||
|
.nodedc-control-row { grid-template-columns: minmax(0, 1fr); gap: var(--nodedc-space-2); }
|
||||||
|
}
|
||||||
|
.nodedc-editor-dock__tool.nodedc-glass-material { overflow: clip; }
|
||||||
|
|
||||||
|
/* Same thin scale as the vertical section rail, with one horizontal boundary. */
|
||||||
|
.nodedc-range-rail { display: flex; flex-direction: column; gap: var(--nodedc-space-2); width: 100%; padding-block: var(--nodedc-space-2); }
|
||||||
|
.nodedc-range-rail__value { text-align: center; color: var(--nodedc-text-primary); font-size: var(--nodedc-font-size-md); line-height: var(--nodedc-line-height-normal); font-weight: var(--nodedc-font-weight-medium); font-variant-numeric: tabular-nums; pointer-events: none; }
|
||||||
|
.nodedc-range[data-variant="rail"] { height: calc(var(--nodedc-control-height) * 0.2); overflow: visible; border: 0; outline: 0; box-shadow: none; }
|
||||||
|
.nodedc-range[data-variant="rail"] input[type="range"] { top: 50%; height: max(100%, 24px); transform: translateY(-50%); }
|
||||||
|
.nodedc-range-rail:has(input:focus-visible) .nodedc-range-rail__value { text-decoration: underline; text-underline-offset: 2px; }
|
||||||
|
.nodedc-range-rail[data-disabled] { opacity: var(--nodedc-disabled-opacity, 0.5); }
|
||||||
|
|
||||||
|
/* Shared move handles: no browser perimeter or pointer-inherited focus flash.
|
||||||
|
Keyboard navigation retains the canonical focus surface in every window. */
|
||||||
|
:is(.nodedc-window__head, .nodedc-workspace-window__head)[tabindex] {
|
||||||
|
outline: 0;
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
:is(.nodedc-window__head, .nodedc-workspace-window__head)[tabindex]:focus-visible {
|
||||||
|
outline: 0;
|
||||||
|
box-shadow: none;
|
||||||
|
background: var(--nodedc-focus-surface);
|
||||||
|
}
|
||||||
|
[data-nodedc-edges="flat"] :is(.nodedc-window__head, .nodedc-workspace-window__head)[tabindex]:focus-visible {
|
||||||
|
background: var(--nodedc-text-primary);
|
||||||
|
color: var(--nodedc-canvas);
|
||||||
|
}
|
||||||
|
:is(.nodedc-window__head, .nodedc-workspace-window__head)[tabindex]:focus-visible :is(.nodedc-window__title, .nodedc-window__subtitle, .nodedc-workspace-window__title, .nodedc-workspace-window__subtitle) {
|
||||||
|
color: inherit;
|
||||||
|
}
|
||||||
|
[data-nodedc-edges] :is(.nodedc-window__head, .nodedc-workspace-window__head)[tabindex][data-pointer-focus="true"],
|
||||||
|
:is(.nodedc-window__head, .nodedc-workspace-window__head)[tabindex][data-pointer-focus="true"] {
|
||||||
|
outline: 0;
|
||||||
|
box-shadow: none;
|
||||||
|
background: transparent;
|
||||||
|
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; }
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
/** Build-time typography contract. CSS parsers/TypeScript are supplied by the consumer. */
|
||||||
|
export const operationalFontSizes = Object.freeze({xs: 11, sm: 12, md: 13, dense: 7.2});
|
||||||
|
export const titleFontSize = 18;
|
||||||
|
export function declarationKey({file, selector, property, value}) {
|
||||||
|
return [file, selector.replace(/\s+/g,' ').trim(), property, value].join(' | ');
|
||||||
|
}
|
||||||
|
export function typographyViolation(declaration, policy={}) {
|
||||||
|
const {property,value}=declaration,key=declarationKey(declaration);
|
||||||
|
if(property.startsWith('--nodedc-font-size-'))return 'Do not redefine canonical size tokens in a consumer';
|
||||||
|
if(property!=='font-size'&&property!=='font'&&!/font-size$/.test(property))return null;
|
||||||
|
if(property==='font-size'&&/(^|[,\s])(?:html|:root)(?=$|[,\s])/.test(declaration.selector))return 'Do not resize html/rem to make operational UI smaller';
|
||||||
|
if(policy.exceptions?.some(e=>e.key===key&&e.reason))return null;
|
||||||
|
if(property==='font-size'&&declaration.selector.split(',').some(s=>/(?:^|[\s>+~])p$|\.nodedc-description$/.test(s.trim()))&&value!=='var(--nodedc-font-size-sm)')return 'Explanatory paragraphs use sm/12px; do not restyle Description per feature';
|
||||||
|
if(property==='font')return value==='inherit'?null:'Use inherited typography; font shorthand can reintroduce browser/large sizes';
|
||||||
|
if(/^var\(--nodedc-font-size-(xs|sm|md|dense)\)$/.test(value))return null;
|
||||||
|
if(value==='var(--nodedc-font-size-title)'&&policy.titles?.includes(declaration.selector))return null;
|
||||||
|
// Existing compact custom geometry is frozen by exact declaration, never an open size allowance.
|
||||||
|
if(policy.compactLegacy?.includes(key)){
|
||||||
|
const literal=/^([\d.]+)(px|rem)$/.exec(value);
|
||||||
|
if(literal&&Number(literal[1])*(literal[2]==='rem'?16:1)<=13)return null;
|
||||||
|
}
|
||||||
|
return 'Use xs/sm/md tokens (11/12/13 px); title is reserved for canonical page/window titles';
|
||||||
|
}
|
||||||
|
export function auditStyles(postcss, text, file, policy) {
|
||||||
|
const violations=[];
|
||||||
|
postcss.parse(text,{from:file}).walkDecls(d=>{
|
||||||
|
const declaration={file,selector:d.parent.selector||d.parent.name||'',property:d.prop,value:d.value};
|
||||||
|
const reason=typographyViolation(declaration,policy);
|
||||||
|
if(reason)violations.push(`${file}:${d.source.start.line}: ${d.parent.selector}: ${d.prop}: ${d.value}: ${reason}`);
|
||||||
|
});
|
||||||
|
return violations;
|
||||||
|
}
|
||||||
|
export function auditMarkup(ts,text,file,{allowBareParagraphs=false,inlineExceptions=[]}={}) {
|
||||||
|
const source=ts.createSourceFile(file,text,ts.ScriptTarget.Latest,true,file.endsWith('tsx')?ts.ScriptKind.TSX:ts.ScriptKind.TS),violations=[];
|
||||||
|
function report(n,reason){const fragment=n.getText(source);if(!inlineExceptions.some(e=>e.file===file&&e.fragment===fragment&&e.reason))violations.push(`${file}:${source.getLineAndCharacterOfPosition(n.getStart(source)).line+1}: ${reason}`);}
|
||||||
|
function visit(n){
|
||||||
|
if(ts.isJsxOpeningElement(n)||ts.isJsxSelfClosingElement(n)){
|
||||||
|
if(!allowBareParagraphs&&n.tagName.getText(source)==='p'&&!n.attributes.properties.some(p=>ts.isJsxAttribute(p)&&p.name.text==='className'))report(n,'Use Description for explanatory/status copy, or an explicitly styled data paragraph');
|
||||||
|
for(const a of n.attributes.properties)if(ts.isJsxAttribute(a)&&/^(fontSize|style)$/.test(a.name.text)&&a.initializer){
|
||||||
|
if(a.name.text==='fontSize'||(ts.isStringLiteral(a.initializer)&&/font(?:-size)?\s*:/.test(a.initializer.text)))report(a,'Inline typography bypasses the shared contract');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(ts.isPropertyAssignment(n)&&(/^(fontSize|font|--nodedc-font-size-.+)$/.test(n.name.getText(source).replace(/['"]/g,''))))report(n,'Inline typography bypasses the shared contract');
|
||||||
|
ts.forEachChild(n,visit);
|
||||||
|
}visit(source);return violations;
|
||||||
|
}
|
||||||
@@ -3,7 +3,8 @@
|
|||||||
"version": "0.7.0",
|
"version": "0.7.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"files": [
|
"files": [
|
||||||
"dist"
|
"dist",
|
||||||
|
"styles.css"
|
||||||
],
|
],
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
"types": "./dist/index.d.ts",
|
"types": "./dist/index.d.ts",
|
||||||
@@ -11,13 +12,14 @@
|
|||||||
".": {
|
".": {
|
||||||
"types": "./dist/index.d.ts",
|
"types": "./dist/index.d.ts",
|
||||||
"import": "./dist/index.js"
|
"import": "./dist/index.js"
|
||||||
}
|
},
|
||||||
|
"./styles.css": "./styles.css"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc -p tsconfig.json",
|
"build": "tsc -p tsconfig.json",
|
||||||
"typecheck": "tsc -p tsconfig.json --noEmit"
|
"typecheck": "tsc -p tsconfig.json --noEmit"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nodedc/ui-core": "0.7.0"
|
"@nodedc/ui-core": "0.7.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
export { applyNodedcTheme, clearNodedcAccent, createAccentVariables, readableTextRgb } from "@nodedc/ui-core";
|
export { applyNodedcTheme, missionDarkTheme, missionLightTheme, clearNodedcAccent, createAccentVariables, readableTextRgb } from "@nodedc/ui-core";
|
||||||
export * from "./applicationWorkspace.js";
|
export * from "./applicationWorkspace.js";
|
||||||
export * from "./floating.js";
|
export * from "./floating.js";
|
||||||
export * from "./mediaSource.js";
|
export * from "./mediaSource.js";
|
||||||
export * from "./modal.js";
|
export * from "./modal.js";
|
||||||
|
export * from "./modalSize.js";
|
||||||
|
export * from "./pathBar.js";
|
||||||
export * from "./select.js";
|
export * from "./select.js";
|
||||||
export * from "./shareLink.js";
|
export * from "./shareLink.js";
|
||||||
export * from "./toolbar.js";
|
export * from "./toolbar.js";
|
||||||
|
|||||||
@@ -0,0 +1,69 @@
|
|||||||
|
export type ModalSize = { width: number; height: number };
|
||||||
|
export function fitModalSize(size: ModalSize, viewport: ModalSize, minimum: ModalSize = { width: 320, height: 200 }): ModalSize {
|
||||||
|
const fit = (value: number, available: number, min: number) => Math.max(Math.min(min, Math.max(1, available - 32)), Math.min(value, Math.max(1, available - 32)));
|
||||||
|
return { width: fit(size.width, viewport.width, minimum.width), height: fit(size.height, viewport.height, minimum.height) };
|
||||||
|
}
|
||||||
|
/** Resize a centered DOM modal without changing its focus/layer controller.
|
||||||
|
* Persistence belongs to the consumer; only completed user gestures commit.
|
||||||
|
*/
|
||||||
|
export function createModalSizeController({ dialog, initialSize, minimum, onSizeCommit }: {
|
||||||
|
dialog: HTMLElement; initialSize: ModalSize; minimum?: ModalSize; onSizeCommit?: (size: ModalSize) => void;
|
||||||
|
}) {
|
||||||
|
const head = dialog.querySelector<HTMLElement>('.nodedc-window__head');
|
||||||
|
const previous = { width: dialog.style.width, height: dialog.style.height, maxHeight: dialog.style.maxHeight, tab: head?.getAttribute('tabindex'), title: head?.getAttribute('title') };
|
||||||
|
let desired = { ...initialSize };
|
||||||
|
let gesture: { id: number; x: number; y: number; edge: string; size: ModalSize; before: ModalSize } | null = null;
|
||||||
|
const viewport = () => ({ width: window.innerWidth, height: window.innerHeight });
|
||||||
|
const visible = () => dialog.getClientRects().length > 0;
|
||||||
|
const apply = (size = desired) => {
|
||||||
|
const fitted = fitModalSize(size, viewport(), minimum);
|
||||||
|
dialog.style.width = `${fitted.width}px`;
|
||||||
|
dialog.style.height = `${fitted.height}px`;
|
||||||
|
dialog.style.maxHeight = 'calc(100dvh - 2rem)';
|
||||||
|
return fitted;
|
||||||
|
};
|
||||||
|
const handles = ['n', 's', 'e', 'w', 'ne', 'nw', 'se', 'sw'].map(edge => {
|
||||||
|
const handle = document.createElement('div');
|
||||||
|
handle.className = 'nodedc-window__resize'; handle.dataset.edge = edge; handle.setAttribute('aria-hidden', 'true');
|
||||||
|
handle.addEventListener('pointerdown', event => {
|
||||||
|
if (event.button !== 0 || gesture) return;
|
||||||
|
const rect = dialog.getBoundingClientRect();
|
||||||
|
gesture = { id: event.pointerId, x: event.clientX, y: event.clientY, edge, size: { width: rect.width, height: rect.height }, before: desired };
|
||||||
|
handle.setPointerCapture(event.pointerId); event.preventDefault();
|
||||||
|
});
|
||||||
|
dialog.append(handle); return handle;
|
||||||
|
});
|
||||||
|
const move = (event: PointerEvent) => {
|
||||||
|
if (!gesture || event.pointerId !== gesture.id) return;
|
||||||
|
const { size, edge, x, y } = gesture;
|
||||||
|
desired = apply({ width: size.width + (event.clientX - x) * (edge.includes('e') ? 2 : edge.includes('w') ? -2 : 0), height: size.height + (event.clientY - y) * (edge.includes('s') ? 2 : edge.includes('n') ? -2 : 0) });
|
||||||
|
event.preventDefault();
|
||||||
|
};
|
||||||
|
const end = (event: PointerEvent) => {
|
||||||
|
if (!gesture || event.pointerId !== gesture.id) return;
|
||||||
|
const before = gesture.before; gesture = null;
|
||||||
|
if (event.type === 'pointercancel') { desired = before; apply(); return; }
|
||||||
|
if (desired.width !== before.width || desired.height !== before.height) onSizeCommit?.({ ...desired });
|
||||||
|
};
|
||||||
|
const key = (event: KeyboardEvent) => {
|
||||||
|
if (event.target !== head || !event.shiftKey || !event.key.startsWith('Arrow')) return;
|
||||||
|
event.preventDefault();
|
||||||
|
const size = fitModalSize(desired, viewport(), minimum);
|
||||||
|
desired = apply({ width: size.width + (event.key === 'ArrowRight' ? 20 : event.key === 'ArrowLeft' ? -20 : 0), height: size.height + (event.key === 'ArrowDown' ? 20 : event.key === 'ArrowUp' ? -20 : 0) });
|
||||||
|
onSizeCommit?.({ ...desired });
|
||||||
|
};
|
||||||
|
const refresh = () => { if (visible() && !gesture) apply(); };
|
||||||
|
if (head) { head.tabIndex = 0; head.title = 'Размер окна: Shift + стрелки. Мышью — за край или угол.'; head.addEventListener('keydown', key); }
|
||||||
|
window.addEventListener('pointermove', move); window.addEventListener('pointerup', end); window.addEventListener('pointercancel', end); window.addEventListener('resize', refresh);
|
||||||
|
apply();
|
||||||
|
return {
|
||||||
|
refresh,
|
||||||
|
setSize(size: ModalSize) { if (!gesture) { desired = { ...size }; apply(); } },
|
||||||
|
destroy() {
|
||||||
|
window.removeEventListener('pointermove', move); window.removeEventListener('pointerup', end); window.removeEventListener('pointercancel', end); window.removeEventListener('resize', refresh);
|
||||||
|
head?.removeEventListener('keydown', key); handles.forEach(handle => handle.remove());
|
||||||
|
for (const name of ['width', 'height', 'maxHeight'] as const) dialog.style[name] = previous[name];
|
||||||
|
if (head) for (const [name, value] of [['tabindex', previous.tab], ['title', previous.title]]) { if (value == null) head.removeAttribute(name!); else head.setAttribute(name!, value); }
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
export type PathBarItem = { label: string; path: string; kind: 'folder' | 'file'; current?: boolean };
|
||||||
|
/** Compact Finder-style path row. Navigation and icon source belong to the app. */
|
||||||
|
export function renderPathBar(target: HTMLElement, items: PathBarItem[], options: { onNavigate: (path: string) => void; icon: (kind: 'folder' | 'file') => Node }) {
|
||||||
|
target.classList.add('nodedc-path-bar');
|
||||||
|
target.setAttribute('role', 'navigation'); target.setAttribute('aria-label', 'Путь к файлу');
|
||||||
|
const nodes: Node[] = [];
|
||||||
|
items.forEach((item, index) => {
|
||||||
|
if (index) { const separator = document.createElement('span'); separator.className = 'nodedc-path-bar__separator'; separator.textContent = '›'; separator.setAttribute('aria-hidden', 'true'); nodes.push(separator); }
|
||||||
|
const part = document.createElement(item.kind === 'folder' ? 'button' : 'span');
|
||||||
|
part.className = 'nodedc-path-bar__item'; part.title = item.path || item.label;
|
||||||
|
if (item.current) part.setAttribute('aria-current', 'location');
|
||||||
|
const icon = document.createElement('span'); icon.className = 'nodedc-path-bar__icon'; icon.setAttribute('aria-hidden', 'true'); icon.append(options.icon(item.kind));
|
||||||
|
const text = document.createElement('span'); text.textContent = item.label;
|
||||||
|
part.append(icon, text);
|
||||||
|
if (part instanceof HTMLButtonElement) { part.type = 'button'; part.addEventListener('click', () => options.onNavigate(item.path)); }
|
||||||
|
nodes.push(part);
|
||||||
|
});
|
||||||
|
target.replaceChildren(...nodes);
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
.nodedc-path-bar {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: var(--nodedc-space-1);
|
||||||
|
overflow-x: auto;
|
||||||
|
flex: none;
|
||||||
|
padding: var(--nodedc-space-2) var(--nodedc-space-3);
|
||||||
|
color: var(--nodedc-text-secondary);
|
||||||
|
font-size: var(--nodedc-font-size-sm);
|
||||||
|
background: var(--nodedc-surface-group);
|
||||||
|
}
|
||||||
|
.nodedc-path-bar__item {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: var(--nodedc-space-1);
|
||||||
|
flex: none;
|
||||||
|
white-space: nowrap;
|
||||||
|
padding: 0;
|
||||||
|
background: transparent;
|
||||||
|
border: 0;
|
||||||
|
color: inherit;
|
||||||
|
font-family: inherit;
|
||||||
|
font-size: var(--nodedc-font-size-sm);
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
button.nodedc-path-bar__item { cursor: pointer; }
|
||||||
|
button.nodedc-path-bar__item:hover { color: var(--nodedc-text-primary); }
|
||||||
|
button.nodedc-path-bar__item:focus-visible { outline: 2px solid var(--nodedc-text-primary); outline-offset: 2px; }
|
||||||
|
.nodedc-path-bar__icon { display: inline-flex; color: var(--nodedc-text-primary); }
|
||||||
|
.nodedc-path-bar__icon svg { width: 14px; height: 14px; }
|
||||||
|
.nodedc-path-bar__separator { flex: none; color: var(--nodedc-text-muted); }
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nodedc/ui-react",
|
"name": "@nodedc/ui-react",
|
||||||
"version": "0.7.0",
|
"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.0",
|
"@nodedc/ui-core": "0.7.4",
|
||||||
"lucide-react": "^0.468.0"
|
"lucide-react": "^0.468.0"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
import type { HTMLAttributes, ReactNode } from "react";
|
import {useContext, useState, type HTMLAttributes, type ReactNode} from "react";
|
||||||
|
import {IconButton} from "./Button.js";
|
||||||
|
import {NavigationPanelState} from "./NavigationPanelState.js";
|
||||||
|
import {Tooltip} from "./Tooltip.js";
|
||||||
import { cn } from "./cn.js";
|
import { cn } from "./cn.js";
|
||||||
import { SortableList } from "./DragDrop.js";
|
import { SortableList } from "./DragDrop.js";
|
||||||
import { Icon } from "./Icon.js";
|
import { Icon } from "./Icon.js";
|
||||||
@@ -31,6 +34,12 @@ export interface AdminNavigationPanelProps extends Omit<HTMLAttributes<HTMLEleme
|
|||||||
activeId?: string;
|
activeId?: string;
|
||||||
footer?: ReactNode;
|
footer?: ReactNode;
|
||||||
closeLabel?: string;
|
closeLabel?: string;
|
||||||
|
collapseLabel?: string;
|
||||||
|
expandLabel?: string;
|
||||||
|
/** Standalone state. Inside ApplicationShell, use its navigationCollapsed API. */
|
||||||
|
collapsed?: boolean;
|
||||||
|
defaultCollapsed?: boolean;
|
||||||
|
onCollapsedChange?: (collapsed: boolean) => void;
|
||||||
navigationLabel?: string;
|
navigationLabel?: string;
|
||||||
onClose: () => void;
|
onClose: () => void;
|
||||||
onItemChange: (id: string) => void;
|
onItemChange: (id: string) => void;
|
||||||
@@ -47,6 +56,11 @@ export function AdminNavigationPanel({
|
|||||||
activeId,
|
activeId,
|
||||||
footer,
|
footer,
|
||||||
closeLabel = "Закрыть администрирование",
|
closeLabel = "Закрыть администрирование",
|
||||||
|
collapseLabel = "Свернуть панель навигации",
|
||||||
|
expandLabel = "Развернуть панель навигации",
|
||||||
|
collapsed: controlledCollapsed,
|
||||||
|
defaultCollapsed = false,
|
||||||
|
onCollapsedChange,
|
||||||
navigationLabel = "Разделы администрирования",
|
navigationLabel = "Разделы администрирования",
|
||||||
onClose,
|
onClose,
|
||||||
onItemChange,
|
onItemChange,
|
||||||
@@ -54,40 +68,66 @@ export function AdminNavigationPanel({
|
|||||||
className,
|
className,
|
||||||
...props
|
...props
|
||||||
}: AdminNavigationPanelProps) {
|
}: AdminNavigationPanelProps) {
|
||||||
|
const shell = useContext(NavigationPanelState);
|
||||||
|
const [localCollapsed, setLocalCollapsed] = useState(defaultCollapsed);
|
||||||
|
const collapsed = shell?.collapsed ?? controlledCollapsed ?? localCollapsed;
|
||||||
|
const toggleCollapsed = () => {
|
||||||
|
const next = !collapsed;
|
||||||
|
if (shell) shell.onCollapsedChange(next);
|
||||||
|
else if (controlledCollapsed === undefined) setLocalCollapsed(next);
|
||||||
|
onCollapsedChange?.(next);
|
||||||
|
};
|
||||||
|
const renderItem = (item: AdminNavigationItem) => (
|
||||||
|
<Tooltip content={item.label} disabled={!collapsed} placement="right-start" className="nodedc-admin-panel__item-tooltip">
|
||||||
|
<button type="button" className="nodedc-admin-panel__nav-item"
|
||||||
|
aria-label={item.label} aria-current={activeId === item.id ? "page" : undefined}
|
||||||
|
data-active={activeId === item.id ? "true" : undefined} onClick={() => onItemChange(item.id)}>
|
||||||
|
<span className="nodedc-admin-panel__nav-icon" aria-hidden="true">{item.icon ?? <Icon name="grid" />}</span>
|
||||||
|
<span className="nodedc-admin-panel__item-label" aria-hidden={collapsed || undefined}>{item.label}</span>
|
||||||
|
</button>
|
||||||
|
</Tooltip>
|
||||||
|
);
|
||||||
return (
|
return (
|
||||||
<aside className={cn("nodedc-admin-panel", className)} data-has-contexts={contexts.length > 0 || contextSlot ? "true" : undefined} {...props}>
|
<aside className={cn("nodedc-admin-panel", "nodedc-admin-panel--navigation", className)} data-collapsed={collapsed ? "true" : undefined} data-has-contexts={contexts.length > 0 || contextSlot ? "true" : undefined} {...props}>
|
||||||
<header className="nodedc-admin-panel__head">
|
<header className="nodedc-admin-panel__head">
|
||||||
<div>
|
<div className="nodedc-admin-panel__titles" aria-hidden={collapsed || undefined}>
|
||||||
<p>{eyebrow}</p>
|
<p>{eyebrow}</p>
|
||||||
<h2>{title}</h2>
|
<h2>{title}</h2>
|
||||||
</div>
|
</div>
|
||||||
<div className="nodedc-admin-panel__head-actions">
|
<div className="nodedc-admin-panel__head-actions">
|
||||||
{headerActions}
|
<span className="nodedc-admin-panel__extra-actions" hidden={collapsed}>{headerActions}</span>
|
||||||
<button type="button" className="nodedc-admin-panel__close" aria-label={closeLabel} onClick={onClose}>
|
<IconButton label={collapsed ? expandLabel : collapseLabel} aria-expanded={!collapsed}
|
||||||
|
className="nodedc-admin-panel__collapse" onClick={toggleCollapsed}>
|
||||||
|
<Icon name={collapsed ? "chevron-right" : "chevron-left"} />
|
||||||
|
</IconButton>
|
||||||
|
<button hidden={collapsed} 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>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
{contextSlot ? <div className="nodedc-admin-panel__context-slot">{contextSlot}</div> : null}
|
{contexts.length > 0 || contextSlot ? <div className="nodedc-admin-panel__context-area">
|
||||||
|
{contextSlot ? <div className="nodedc-admin-panel__context-slot" hidden={collapsed}>{contextSlot}</div> : null}
|
||||||
|
|
||||||
{contexts.length > 0 ? <div className="nodedc-admin-panel__contexts">
|
{contexts.length > 0 ? <div className="nodedc-admin-panel__contexts">
|
||||||
{contexts.map((context) => (
|
{contexts.map((context) => (
|
||||||
<div className="nodedc-admin-panel__context-group" key={context.id}>
|
<div className="nodedc-admin-panel__context-group" key={context.id}>
|
||||||
{context.groupLabel ? <span className="nodedc-admin-panel__group-label">{context.groupLabel}</span> : null}
|
{context.groupLabel ? <span className="nodedc-admin-panel__group-label" hidden={collapsed}>{context.groupLabel}</span> : null}
|
||||||
<div
|
<div
|
||||||
className={cn("nodedc-admin-context", context.onToggle && "nodedc-admin-context--split")}
|
className={cn("nodedc-admin-context", context.onToggle && "nodedc-admin-context--split")}
|
||||||
data-active={context.active ? "true" : undefined}
|
data-active={context.active ? "true" : undefined}
|
||||||
>
|
>
|
||||||
<button type="button" className="nodedc-admin-context__main" onClick={context.onSelect}>
|
<Tooltip content={context.label} disabled={!collapsed} placement="right-start" className="nodedc-admin-panel__item-tooltip">
|
||||||
<span className="nodedc-admin-context__icon" aria-hidden="true">{context.icon}</span>
|
<button type="button" className="nodedc-admin-context__main" aria-label={context.label} onClick={context.onSelect ?? context.onToggle}>
|
||||||
<span className="nodedc-admin-context__body">
|
<span className="nodedc-admin-context__icon" aria-hidden="true">{context.icon ?? <Icon name="grid" />}</span>
|
||||||
|
<span className="nodedc-admin-context__body" aria-hidden={collapsed || undefined}>
|
||||||
<strong>{context.label}</strong>
|
<strong>{context.label}</strong>
|
||||||
{context.description ? <small>{context.description}</small> : null}
|
{context.description ? <small>{context.description}</small> : null}
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
|
</Tooltip>
|
||||||
{context.onToggle ? (
|
{context.onToggle ? (
|
||||||
<button type="button" className="nodedc-admin-context__toggle" aria-label={`Выбрать: ${context.label}`} onClick={context.onToggle}>
|
<button hidden={collapsed} type="button" className="nodedc-admin-context__toggle" aria-label={`Выбрать: ${context.label}`} onClick={context.onToggle}>
|
||||||
<span className="nodedc-select-trigger__chevron" aria-hidden="true" />
|
<span className="nodedc-select-trigger__chevron" aria-hidden="true" />
|
||||||
</button>
|
</button>
|
||||||
) : null}
|
) : null}
|
||||||
@@ -95,20 +135,10 @@ export function AdminNavigationPanel({
|
|||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div> : null}
|
</div> : null}
|
||||||
|
</div> : null}
|
||||||
|
|
||||||
<nav className="nodedc-admin-panel__nav" aria-label={navigationLabel}>
|
<nav className="nodedc-admin-panel__nav" aria-label={navigationLabel}>
|
||||||
{items.filter((item) => !item.sortable).map((item) => (
|
{items.filter((item) => !item.sortable).map((item) => <div key={item.id}>{renderItem(item)}</div>)}
|
||||||
<button
|
|
||||||
key={item.id}
|
|
||||||
type="button"
|
|
||||||
className="nodedc-admin-panel__nav-item"
|
|
||||||
data-active={activeId === item.id ? "true" : undefined}
|
|
||||||
onClick={() => onItemChange(item.id)}
|
|
||||||
>
|
|
||||||
<span className="nodedc-admin-panel__nav-icon" aria-hidden="true">{item.icon}</span>
|
|
||||||
<span>{item.label}</span>
|
|
||||||
</button>
|
|
||||||
))}
|
|
||||||
{items.some((item) => item.sortable) ? (
|
{items.some((item) => item.sortable) ? (
|
||||||
<SortableList
|
<SortableList
|
||||||
className="nodedc-admin-panel__sortable-nav"
|
className="nodedc-admin-panel__sortable-nav"
|
||||||
@@ -118,23 +148,15 @@ export function AdminNavigationPanel({
|
|||||||
>
|
>
|
||||||
{(item, { handle }) => (
|
{(item, { handle }) => (
|
||||||
<div className="nodedc-admin-panel__sortable-row">
|
<div className="nodedc-admin-panel__sortable-row">
|
||||||
<button
|
{renderItem(item)}
|
||||||
type="button"
|
<span hidden={collapsed}>{handle}</span>
|
||||||
className="nodedc-admin-panel__nav-item"
|
|
||||||
data-active={activeId === item.id ? "true" : undefined}
|
|
||||||
onClick={() => onItemChange(item.id)}
|
|
||||||
>
|
|
||||||
<span className="nodedc-admin-panel__nav-icon" aria-hidden="true">{item.icon}</span>
|
|
||||||
<span>{item.label}</span>
|
|
||||||
</button>
|
|
||||||
{handle}
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</SortableList>
|
</SortableList>
|
||||||
) : null}
|
) : null}
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
{footer ? <footer className="nodedc-admin-panel__footer">{footer}</footer> : null}
|
{footer ? <footer className="nodedc-admin-panel__footer" aria-hidden={collapsed || undefined}>{footer}</footer> : null}
|
||||||
</aside>
|
</aside>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { ButtonHTMLAttributes, ReactNode } from "react";
|
import type { ButtonHTMLAttributes, ReactNode, Ref } from "react";
|
||||||
|
|
||||||
export interface AppHeaderProps {
|
export interface AppHeaderProps {
|
||||||
brand: ReactNode;
|
brand: ReactNode;
|
||||||
@@ -74,10 +74,11 @@ export function HeaderNavigation<T extends string>({ label, value, items, onChan
|
|||||||
|
|
||||||
export interface HeaderProfileProps {
|
export interface HeaderProfileProps {
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
|
ref?: Ref<HTMLDivElement>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function HeaderProfile({ children }: HeaderProfileProps) {
|
export function HeaderProfile({ children, ref }: HeaderProfileProps) {
|
||||||
return <div className="nodedc-header__profile">{children}</div>;
|
return <div ref={ref} className="nodedc-header__profile">{children}</div>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface HeaderProfileButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "className" | "style"> {}
|
export interface HeaderProfileButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "className" | "style"> {}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import type { HTMLAttributes, ReactNode } from "react";
|
import {useCallback, useMemo, useState, type HTMLAttributes, type ReactNode} from "react";
|
||||||
|
import {NavigationPanelState} from "./NavigationPanelState.js";
|
||||||
import { cn } from "./cn.js";
|
import { cn } from "./cn.js";
|
||||||
import {ApplicationPanelFullscreen} from "./ApplicationPanelFullscreen.js";
|
import {ApplicationPanelFullscreen} from "./ApplicationPanelFullscreen.js";
|
||||||
import { Icon, type IconName } from "./Icon.js";
|
import { Icon, type IconName } from "./Icon.js";
|
||||||
@@ -10,6 +11,10 @@ export interface ApplicationShellProps extends Omit<HTMLAttributes<HTMLDivElemen
|
|||||||
content?: ReactNode;
|
content?: ReactNode;
|
||||||
endPanel?: ReactNode;
|
endPanel?: ReactNode;
|
||||||
navigationOpen?: boolean;
|
navigationOpen?: boolean;
|
||||||
|
/** Shared across navigation routes; closing a workspace does not reset it. */
|
||||||
|
navigationCollapsed?: boolean;
|
||||||
|
defaultNavigationCollapsed?: boolean;
|
||||||
|
onNavigationCollapsedChange?: (collapsed: boolean) => void;
|
||||||
contentOpen?: boolean;
|
contentOpen?: boolean;
|
||||||
contentExpanded?: boolean;
|
contentExpanded?: boolean;
|
||||||
endPanelOpen?: boolean;
|
endPanelOpen?: boolean;
|
||||||
@@ -22,16 +27,27 @@ export function ApplicationShell({
|
|||||||
content,
|
content,
|
||||||
endPanel,
|
endPanel,
|
||||||
navigationOpen = false,
|
navigationOpen = false,
|
||||||
|
navigationCollapsed,
|
||||||
|
defaultNavigationCollapsed = false,
|
||||||
|
onNavigationCollapsedChange,
|
||||||
contentOpen = false,
|
contentOpen = false,
|
||||||
contentExpanded = false,
|
contentExpanded = false,
|
||||||
endPanelOpen = false,
|
endPanelOpen = false,
|
||||||
className,
|
className,
|
||||||
...props
|
...props
|
||||||
}: ApplicationShellProps) {
|
}: ApplicationShellProps) {
|
||||||
|
const [localCollapsed, setLocalCollapsed] = useState(defaultNavigationCollapsed);
|
||||||
|
const collapsed = navigationCollapsed ?? localCollapsed;
|
||||||
|
const onCollapsedChange = useCallback((next: boolean) => {
|
||||||
|
if (navigationCollapsed === undefined) setLocalCollapsed(next);
|
||||||
|
onNavigationCollapsedChange?.(next);
|
||||||
|
}, [navigationCollapsed, onNavigationCollapsedChange]);
|
||||||
|
const navigationState = useMemo(() => ({collapsed, onCollapsedChange}), [collapsed, onCollapsedChange]);
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={cn("nodedc-app-shell", className)}
|
className={cn("nodedc-app-shell", className)}
|
||||||
data-navigation-open={navigationOpen ? "true" : undefined}
|
data-navigation-open={navigationOpen ? "true" : undefined}
|
||||||
|
data-navigation-collapsed={collapsed ? "true" : undefined}
|
||||||
data-content-open={contentOpen ? "true" : undefined}
|
data-content-open={contentOpen ? "true" : undefined}
|
||||||
data-content-expanded={contentOpen && contentExpanded ? "true" : undefined}
|
data-content-expanded={contentOpen && contentExpanded ? "true" : undefined}
|
||||||
data-end-panel-open={endPanelOpen ? "true" : undefined}
|
data-end-panel-open={endPanelOpen ? "true" : undefined}
|
||||||
@@ -40,7 +56,7 @@ export function ApplicationShell({
|
|||||||
{header}
|
{header}
|
||||||
<main className="nodedc-app-shell__main">
|
<main className="nodedc-app-shell__main">
|
||||||
<div className="nodedc-app-shell__stage">{stage}</div>
|
<div className="nodedc-app-shell__stage">{stage}</div>
|
||||||
{navigationOpen && navigation ? <div className="nodedc-app-shell__navigation">{navigation}</div> : null}
|
{navigationOpen && navigation ? <div className="nodedc-app-shell__navigation"><NavigationPanelState.Provider value={navigationState}>{navigation}</NavigationPanelState.Provider></div> : null}
|
||||||
{contentOpen && content ? <div className="nodedc-app-shell__content">{content}</div> : null}
|
{contentOpen && content ? <div className="nodedc-app-shell__content">{content}</div> : null}
|
||||||
{endPanel ? <div className="nodedc-app-shell__end-panel">{endPanel}</div> : null}
|
{endPanel ? <div className="nodedc-app-shell__end-panel">{endPanel}</div> : null}
|
||||||
</main>
|
</main>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -65,12 +65,16 @@ export const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button
|
|||||||
export interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
export interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
||||||
label: string;
|
label: string;
|
||||||
shape?: "circle" | "rounded";
|
shape?: "circle" | "rounded";
|
||||||
|
/** Glyph-only action; keeps the normal hit target and keyboard focus. */
|
||||||
|
surface?: "default" | "none";
|
||||||
loading?: boolean;
|
loading?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(function IconButton({
|
export const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(function IconButton({
|
||||||
label,
|
label,
|
||||||
shape = "circle",
|
shape = "circle",
|
||||||
|
surface = "default",
|
||||||
|
style,
|
||||||
className,
|
className,
|
||||||
children,
|
children,
|
||||||
type = "button",
|
type = "button",
|
||||||
@@ -84,6 +88,7 @@ export const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(functio
|
|||||||
type={type}
|
type={type}
|
||||||
className={cn("nodedc-icon-button", className)}
|
className={cn("nodedc-icon-button", className)}
|
||||||
data-shape={shape === "circle" ? undefined : shape}
|
data-shape={shape === "circle" ? undefined : shape}
|
||||||
|
style={surface === "none" ? { ...style, background: "transparent", boxShadow: "none", color: "var(--nodedc-text-primary)" } : style}
|
||||||
aria-label={label}
|
aria-label={label}
|
||||||
title={label}
|
title={label}
|
||||||
{...props}
|
{...props}
|
||||||
|
|||||||
@@ -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>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@@ -126,6 +126,13 @@ export function Dropdown({
|
|||||||
updatePosition();
|
updatePosition();
|
||||||
}, [isOpen, updatePosition]);
|
}, [isOpen, updatePosition]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!isOpen || !surfaceRef.current) return;
|
||||||
|
const observer = new ResizeObserver(updatePosition);
|
||||||
|
observer.observe(surfaceRef.current);
|
||||||
|
return () => observer.disconnect();
|
||||||
|
}, [isOpen, updatePosition]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!isOpen || !getAnchorRect) return;
|
if (!isOpen || !getAnchorRect) return;
|
||||||
let frame:number;
|
let frame:number;
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import {dragHandleFocus} from './dragHandleFocus.js';
|
||||||
import {useEffect,useLayoutEffect,useRef,useState,type KeyboardEvent,type PointerEvent,type ReactNode} from 'react';
|
import {useEffect,useLayoutEffect,useRef,useState,type KeyboardEvent,type PointerEvent,type ReactNode} from 'react';
|
||||||
import {constrainDockTree,dockIds,dockMinimum,dockRects,dockEditorTool,editorDockTarget,mergeEditorDockRatios,pruneDockTree,resizeDockSplit,type DockMinimum,type DockMove,type DockRect,type DockTree,type EditorDockState} from '@nodedc/ui-core';
|
import {constrainDockTree,dockIds,dockMinimum,dockRects,dockEditorTool,editorDockTarget,mergeEditorDockRatios,pruneDockTree,resizeDockSplit,type DockMinimum,type DockMove,type DockRect,type DockTree,type EditorDockState} from '@nodedc/ui-core';
|
||||||
import {IconButton} from './Button.js';
|
import {IconButton} from './Button.js';
|
||||||
@@ -7,6 +8,7 @@ import {InspectorSelectPolicyContext} from './InspectorContext.js';
|
|||||||
import {LoadingContext} from './LoadingContext.js';
|
import {LoadingContext} from './LoadingContext.js';
|
||||||
import {fitWindow,resizeWindow,windowResizeEdges,type ResizeEdge} from './windowGeometry.js';
|
import {fitWindow,resizeWindow,windowResizeEdges,type ResizeEdge} from './windowGeometry.js';
|
||||||
import {cn} from './cn.js';
|
import {cn} from './cn.js';
|
||||||
|
import {editorDockCorners} from './editorDockCorners.js';
|
||||||
|
|
||||||
export interface EditorDockTool {
|
export interface EditorDockTool {
|
||||||
id:string;title:ReactNode;label:string;open:boolean;onClose:()=>void;content:ReactNode;
|
id:string;title:ReactNode;label:string;open:boolean;onClose:()=>void;content:ReactNode;
|
||||||
@@ -38,7 +40,7 @@ export function EditorDockLayout({value,onChange,primary,primaryId='viewport',pr
|
|||||||
const required=dockMinimum(visibleTree,minimums),area={...bounds,width:Math.max(bounds.width,required.width),height:Math.max(bounds.height,required.height)};
|
const required=dockMinimum(visibleTree,minimums),area={...bounds,width:Math.max(bounds.width,required.width),height:Math.max(bounds.height,required.height)};
|
||||||
const constrained=constrainDockTree(visibleTree,area,minimums)!;
|
const constrained=constrainDockTree(visibleTree,area,minimums)!;
|
||||||
const rects=dockRects(constrained,area);
|
const rects=dockRects(constrained,area);
|
||||||
const floatingRect=(id:string)=>fitWindow(value.floating[id]??tools.find(t=>t.id===id)?.initialRect??{left:Math.max(8,bounds.width-380),top:24,width:360,height:540},bounds);
|
const floatingRect=(id:string)=>fitWindow(value.floating[id]??tools.find(t=>t.id===id)?.initialRect??{left:Math.max(8,bounds.width-380),top:24,width:360,height:540},bounds,tools.find(t=>t.id===id)?.minimumSize);
|
||||||
const latest=useRef({value,onChange,rects,bounds,enabled,tools});latest.current={value,onChange,rects,bounds,enabled,tools};
|
const latest=useRef({value,onChange,rects,bounds,enabled,tools});latest.current={value,onChange,rects,bounds,enabled,tools};
|
||||||
const activate=(id:string)=>setOrder(v=>[...v.filter(x=>x!==id),id]);
|
const activate=(id:string)=>setOrder(v=>[...v.filter(x=>x!==id),id]);
|
||||||
useLayoutEffect(()=>{const v=viewport.current!;const measure=()=>setBounds({left:0,top:0,width:v.clientWidth,height:v.clientHeight});measure();const ro=new ResizeObserver(measure);ro.observe(v);return()=>ro.disconnect();},[]);
|
useLayoutEffect(()=>{const v=viewport.current!;const measure=()=>setBounds({left:0,top:0,width:v.clientWidth,height:v.clientHeight});measure();const ro=new ResizeObserver(measure);ro.observe(v);return()=>ro.disconnect();},[]);
|
||||||
@@ -56,8 +58,8 @@ export function EditorDockLayout({value,onChange,primary,primaryId='viewport',pr
|
|||||||
const p=point(e),dx=p.x-g.x,dy=p.y-g.y;
|
const p=point(e),dx=p.x-g.x,dy=p.y-g.y;
|
||||||
if(!g.moved&&Math.hypot(dx,dy)<6)return;
|
if(!g.moved&&Math.hypot(dx,dy)<6)return;
|
||||||
g.moved=true;
|
g.moved=true;
|
||||||
const b=latest.current.bounds;
|
const b=latest.current.bounds,minimum=latest.current.tools.find(t=>t.id===g.id)?.minimumSize;
|
||||||
g.current=g.edge?resizeWindow(g.rect,g.edge,dx,dy,b):fitWindow({...g.rect,left:g.rect.left+dx,top:g.rect.top+dy},b);
|
g.current=g.edge?resizeWindow(g.rect,g.edge,dx,dy,b,minimum):fitWindow({...g.rect,left:g.rect.left+dx,top:g.rect.top+dy},b,minimum);
|
||||||
const visibleBounds={...b,left:viewport.current?.scrollLeft??0,top:viewport.current?.scrollTop??0};
|
const visibleBounds={...b,left:viewport.current?.scrollLeft??0,top:viewport.current?.scrollTop??0};
|
||||||
g.target=g.edge?null:editorDockTarget(visibleBounds,latest.current.rects,primaryId,g.id,p.x,p.y);
|
g.target=g.edge?null:editorDockTarget(visibleBounds,latest.current.rects,primaryId,g.id,p.x,p.y);
|
||||||
setDrag({...g});e.preventDefault();
|
setDrag({...g});e.preventDefault();
|
||||||
@@ -84,7 +86,7 @@ export function EditorDockLayout({value,onChange,primary,primaryId='viewport',pr
|
|||||||
else if(position)setKeyboard({id,target:{activeId:id,overId:keyboard.target?.overId??primaryId,position,scope:e.shiftKey||!keyboard.target?'workspace':keyboard.target.scope}});
|
else if(position)setKeyboard({id,target:{activeId:id,overId:keyboard.target?.overId??primaryId,position,scope:e.shiftKey||!keyboard.target?'workspace':keyboard.target.scope}});
|
||||||
else return;
|
else return;
|
||||||
}else if(e.key==='Enter'||e.key===' '){setKeyboard({id,target:null});activate(id);}
|
}else if(e.key==='Enter'||e.key===' '){setKeyboard({id,target:null});activate(id);}
|
||||||
else if(position&&!rects[id]){const r=floatingRect(id),delta=e.altKey?1:10,dx=position==='left'?-delta:position==='right'?delta:0,dy=position==='top'?-delta:position==='bottom'?delta:0;onChange({...value,floating:{...value.floating,[id]:e.shiftKey?resizeWindow(r,'se',dx,dy,bounds):fitWindow({...r,left:r.left+dx,top:r.top+dy},bounds)}});}
|
else if(position&&!rects[id]){const r=floatingRect(id),delta=e.altKey?1:10,dx=position==='left'?-delta:position==='right'?delta:0,dy=position==='top'?-delta:position==='bottom'?delta:0;onChange({...value,floating:{...value.floating,[id]:e.shiftKey?resizeWindow(r,'se',dx,dy,bounds,tools.find(t=>t.id===id)?.minimumSize):fitWindow({...r,left:r.left+dx,top:r.top+dy},bounds,tools.find(t=>t.id===id)?.minimumSize)}});}
|
||||||
else return;
|
else return;
|
||||||
e.preventDefault();e.stopPropagation();
|
e.preventDefault();e.stopPropagation();
|
||||||
};
|
};
|
||||||
@@ -97,14 +99,14 @@ export function EditorDockLayout({value,onChange,primary,primaryId='viewport',pr
|
|||||||
return <div ref={viewport} className={cn('nodedc-editor-dock',className)} data-editing={enabled||undefined} data-dragging={!!drag||undefined}>
|
return <div ref={viewport} className={cn('nodedc-editor-dock',className)} data-editing={enabled||undefined} data-dragging={!!drag||undefined}>
|
||||||
<div ref={host} className="nodedc-editor-dock__canvas" style={{minWidth:required.width,minHeight:required.height}}>
|
<div ref={host} className="nodedc-editor-dock__canvas" style={{minWidth:required.width,minHeight:required.height}}>
|
||||||
<EditorSplits tree={constrained} bounds={area} minimums={minimums} onResize={(path,ratio)=>onChange({...value,tree:mergeEditorDockRatios(value.tree,resizeDockSplit(constrained,path,ratio))})}/>
|
<EditorSplits tree={constrained} bounds={area} minimums={minimums} onResize={(path,ratio)=>onChange({...value,tree:mergeEditorDockRatios(value.tree,resizeDockSplit(constrained,path,ratio))})}/>
|
||||||
<div className="nodedc-editor-dock__primary" data-editor-primary={primaryId} style={rects[primaryId]}>{primary}</div>
|
<div className="nodedc-editor-dock__primary" data-editor-primary={primaryId} data-dock-corners={editorDockCorners(rects[primaryId],area)} style={rects[primaryId]}>{primary}</div>
|
||||||
{tools.map(tool=>{
|
{tools.map(tool=>{
|
||||||
const moving=drag?.id===tool.id,free=!rects[tool.id]||moving;
|
const moving=drag?.id===tool.id,free=!rects[tool.id]||moving;
|
||||||
const rect=moving?drag.current:rects[tool.id]??floatingRect(tool.id);
|
const rect=moving?drag.current:rects[tool.id]??floatingRect(tool.id);
|
||||||
return <div key={tool.id} className={cn('nodedc-editor-dock__tool nodedc-glass-material nodedc-ui-root',tool.className)} data-editor-tool={tool.id} data-floating={free||undefined} data-active={order.at(-1)===tool.id||undefined}
|
return <div key={tool.id} className={cn('nodedc-editor-dock__tool nodedc-glass-material nodedc-ui-root',tool.className)} data-editor-tool={tool.id} data-floating={free||undefined} data-glass-context={free?'scene':undefined} data-dock-corners={free?undefined:editorDockCorners(rect,area)} data-active={order.at(-1)===tool.id||undefined}
|
||||||
role="region" aria-label={tool.label} hidden={!enabled||!tool.open} style={{...rect,zIndex:moving?40:free?10+Math.max(0,order.indexOf(tool.id)):1}}
|
role="region" aria-label={tool.label} hidden={!enabled||!tool.open} style={{...rect,zIndex:moving?40:free?10+Math.max(0,order.indexOf(tool.id)):1}}
|
||||||
onPointerDownCapture={()=>activate(tool.id)} onFocusCapture={()=>activate(tool.id)}>
|
onPointerDownCapture={()=>activate(tool.id)} onFocusCapture={()=>activate(tool.id)}>
|
||||||
<header className="nodedc-window__head" tabIndex={0} aria-label={`Переместить · ${tool.label}`} aria-roledescription="Перемещаемая панель" onPointerDown={e=>begin(tool.id,e)} onKeyDown={e=>key(tool.id,e)}>
|
<header {...dragHandleFocus} className="nodedc-window__head" tabIndex={0} aria-label={`Переместить · ${tool.label}`} aria-roledescription="Перемещаемая панель" onPointerDown={e=>begin(tool.id,e)} onKeyDown={e=>key(tool.id,e)}>
|
||||||
<div className="nodedc-window__titles"><h2 className="nodedc-window__title">{tool.title}</h2>{tool.subtitle&&<p className="nodedc-window__subtitle">{tool.subtitle}</p>}</div>
|
<div className="nodedc-window__titles"><h2 className="nodedc-window__title">{tool.title}</h2>{tool.subtitle&&<p className="nodedc-window__subtitle">{tool.subtitle}</p>}</div>
|
||||||
<div className="nodedc-window__actions">{tool.actions}<IconButton label={`Закрыть · ${tool.label}`} onClick={tool.onClose}><Icon name="close"/></IconButton></div>
|
<div className="nodedc-window__actions">{tool.actions}<IconButton label={`Закрыть · ${tool.label}`} onClick={tool.onClose}><Icon name="close"/></IconButton></div>
|
||||||
</header>
|
</header>
|
||||||
|
|||||||
@@ -1,12 +1,15 @@
|
|||||||
import {useEffect,useId,useLayoutEffect,useRef,useState,type ReactNode} from 'react';
|
import {useContext,useEffect,useId,useLayoutEffect,useRef,useState,type ReactNode} from 'react';
|
||||||
import {createPortal} from 'react-dom';
|
import {createPortal} from 'react-dom';
|
||||||
import {IconButton} from './Button.js';
|
import {IconButton} from './Button.js';
|
||||||
import {Icon} from './Icon.js';
|
import {Icon} from './Icon.js';
|
||||||
|
import {WindowSuspensionContext} from './WindowSuspensionContext.js';
|
||||||
import {cn} from './cn.js';
|
import {cn} from './cn.js';
|
||||||
|
|
||||||
export interface EditorWorkspaceProps {editing:boolean;title:ReactNode;subtitle?:ReactNode;onBack:()=>void;children:ReactNode;className?:string}
|
export interface EditorWorkspaceProps {editing:boolean;title:ReactNode;subtitle?:ReactNode;onBack:()=>void;children:ReactNode;className?:string;purpose?:'edit'|'view';headerActions?:ReactNode}
|
||||||
/** One mounted renderer moves between its original slot and a modeless editor window. */
|
/** One mounted renderer moves between its original slot and a modeless editor window. */
|
||||||
export function EditorWorkspace({editing,title,subtitle,onBack,children,className}:EditorWorkspaceProps){
|
export function EditorWorkspace({editing,title,subtitle,onBack,children,className,purpose='edit',headerActions}:EditorWorkspaceProps){
|
||||||
|
const suspend=useContext(WindowSuspensionContext);
|
||||||
|
useLayoutEffect(()=>{if(editing)return suspend?.();},[editing,suspend]);
|
||||||
const inline=useRef<HTMLDivElement>(null),[host]=useState(()=>document.createElement('div'));
|
const inline=useRef<HTMLDivElement>(null),[host]=useState(()=>document.createElement('div'));
|
||||||
const [expanded,setExpanded]=useState(false),opener=useRef<HTMLElement|null>(null),titleId=useId();
|
const [expanded,setExpanded]=useState(false),opener=useRef<HTMLElement|null>(null),titleId=useId();
|
||||||
useLayoutEffect(()=>{host.className='nodedc-editor-workspace__host';inline.current!.append(host);return()=>host.remove();},[host]);
|
useLayoutEffect(()=>{host.className='nodedc-editor-workspace__host';inline.current!.append(host);return()=>host.remove();},[host]);
|
||||||
@@ -16,7 +19,7 @@ export function EditorWorkspace({editing,title,subtitle,onBack,children,classNam
|
|||||||
if(host.parentElement!==target){if(target.moveBefore&&host.isConnected)target.moveBefore(host,null);else target.append(host);}
|
if(host.parentElement!==target){if(target.moveBefore&&host.isConnected)target.moveBefore(host,null);else target.append(host);}
|
||||||
host.dataset.editing=String(editing);
|
host.dataset.editing=String(editing);
|
||||||
if(editing)host.querySelector<HTMLElement>('[data-editor-back]')?.focus({preventScroll:true});
|
if(editing)host.querySelector<HTMLElement>('[data-editor-back]')?.focus({preventScroll:true});
|
||||||
else {setExpanded(false);if(opener.current?.isConnected)opener.current.focus({preventScroll:true});}
|
else {setExpanded(false);const frame=requestAnimationFrame(()=>{if(opener.current?.isConnected)opener.current.focus({preventScroll:true});});return()=>cancelAnimationFrame(frame);}
|
||||||
},[editing,host]);
|
},[editing,host]);
|
||||||
useEffect(()=>{host.dataset.expanded=String(expanded);},[expanded,host]);
|
useEffect(()=>{host.dataset.expanded=String(expanded);},[expanded,host]);
|
||||||
return <div ref={inline} className={cn('nodedc-editor-workspace__slot',className)}>{createPortal(
|
return <div ref={inline} className={cn('nodedc-editor-workspace__slot',className)}>{createPortal(
|
||||||
@@ -25,10 +28,11 @@ export function EditorWorkspace({editing,title,subtitle,onBack,children,classNam
|
|||||||
{editing&&<header className="nodedc-window__head nodedc-editor-workspace__head">
|
{editing&&<header className="nodedc-window__head nodedc-editor-workspace__head">
|
||||||
<div className="nodedc-window__titles"><h1 id={titleId} className="nodedc-window__title">{title}</h1>{subtitle&&<p className="nodedc-window__subtitle">{subtitle}</p>}</div>
|
<div className="nodedc-window__titles"><h1 id={titleId} className="nodedc-window__title">{title}</h1>{subtitle&&<p className="nodedc-window__subtitle">{subtitle}</p>}</div>
|
||||||
<div className="nodedc-window__actions">
|
<div className="nodedc-window__actions">
|
||||||
<IconButton data-editor-back label="Вернуться из редактора сцены" onClick={onBack}><Icon name="chevron-left"/></IconButton>
|
{headerActions}
|
||||||
<IconButton label={expanded?'Восстановить окно редактора':'Развернуть окно редактора'} onClick={()=>setExpanded(v=>!v)}><Icon name={expanded?'minimize':'expand'}/></IconButton>
|
<IconButton data-editor-back label={purpose==='view'?'Вернуть просмотр в рабочую область':'Вернуться из редактора сцены'} onClick={onBack}><Icon name="chevron-left"/></IconButton>
|
||||||
<IconButton label="Завершить редактирование сцены" aria-pressed onClick={onBack}><Icon name="edit"/></IconButton>
|
<IconButton label={expanded?(purpose==='view'?'Восстановить окно просмотра':'Восстановить окно редактора'):(purpose==='view'?'Развернуть окно просмотра':'Развернуть окно редактора')} onClick={()=>setExpanded(v=>!v)}><Icon name={expanded?'minimize':'expand'}/></IconButton>
|
||||||
<IconButton label="Закрыть редактор сцены" onClick={onBack}><Icon name="close"/></IconButton>
|
{purpose==='edit'&&<IconButton label="Завершить редактирование сцены" aria-pressed onClick={onBack}><Icon name="edit"/></IconButton>}
|
||||||
|
<IconButton label={purpose==='view'?'Закрыть отдельное окно просмотра':'Закрыть редактор сцены'} onClick={onBack}><Icon name="close"/></IconButton>
|
||||||
</div>
|
</div>
|
||||||
</header>}
|
</header>}
|
||||||
<div className="nodedc-editor-workspace__body">{children}</div>
|
<div className="nodedc-editor-workspace__body">{children}</div>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useEffect, useMemo, useState } from "react";
|
import { useEffect, useMemo, useState, type ReactNode } from "react";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
FeatureSettingsWindow,
|
FeatureSettingsWindow,
|
||||||
@@ -18,9 +18,12 @@ import {
|
|||||||
type EnvironmentSurface,
|
type EnvironmentSurface,
|
||||||
type UploadedEnvironmentMedia,
|
type UploadedEnvironmentMedia,
|
||||||
} from "@nodedc/ui-core";
|
} from "@nodedc/ui-core";
|
||||||
|
import type { FeatureSettingsSection } from "./FeatureSettingsWindow.js";
|
||||||
import { EnvironmentMediaPlaylistEditor } from "./EnvironmentMediaPlaylistEditor.js";
|
import { EnvironmentMediaPlaylistEditor } from "./EnvironmentMediaPlaylistEditor.js";
|
||||||
|
|
||||||
export interface EnvironmentSettingsWindowProps {
|
export interface EnvironmentSettingsWindowProps {
|
||||||
|
/** Product-owned sections reuse this shell; each owns its content and save lifecycle. */
|
||||||
|
additionalSections?: readonly (FeatureSettingsSection & { content: ReactNode; footer?: ReactNode })[];
|
||||||
productName: string;
|
productName: string;
|
||||||
surfaces: readonly EnvironmentSurface[];
|
surfaces: readonly EnvironmentSurface[];
|
||||||
initialSurfaceId?: string;
|
initialSurfaceId?: string;
|
||||||
@@ -70,6 +73,7 @@ function patchBackground(
|
|||||||
|
|
||||||
export function EnvironmentSettingsWindow({
|
export function EnvironmentSettingsWindow({
|
||||||
productName,
|
productName,
|
||||||
|
additionalSections = [],
|
||||||
surfaces,
|
surfaces,
|
||||||
initialSurfaceId,
|
initialSurfaceId,
|
||||||
open,
|
open,
|
||||||
@@ -80,6 +84,8 @@ export function EnvironmentSettingsWindow({
|
|||||||
onSave,
|
onSave,
|
||||||
onUpload,
|
onUpload,
|
||||||
}: EnvironmentSettingsWindowProps) {
|
}: EnvironmentSettingsWindowProps) {
|
||||||
|
const [activeSection, setActiveSection] = useState("environment");
|
||||||
|
const extension = additionalSections.find(section => section.id === activeSection);
|
||||||
const [draft, setDraft] = useState(() => cloneEnvironmentSettings(settings));
|
const [draft, setDraft] = useState(() => cloneEnvironmentSettings(settings));
|
||||||
const [surfaceId, setSurfaceId] = useState(initialSurfaceId ?? surfaces[0]?.id ?? "home");
|
const [surfaceId, setSurfaceId] = useState(initialSurfaceId ?? surfaces[0]?.id ?? "home");
|
||||||
const [uploading, setUploading] = useState(false);
|
const [uploading, setUploading] = useState(false);
|
||||||
@@ -196,11 +202,12 @@ export function EnvironmentSettingsWindow({
|
|||||||
group: productName.toUpperCase(),
|
group: productName.toUpperCase(),
|
||||||
icon: "settings",
|
icon: "settings",
|
||||||
},
|
},
|
||||||
|
...additionalSections,
|
||||||
]}
|
]}
|
||||||
activeSection="environment"
|
activeSection={extension ? activeSection : "environment"}
|
||||||
onSectionChange={() => undefined}
|
onSectionChange={setActiveSection}
|
||||||
onClose={onClose}
|
onClose={onClose}
|
||||||
footer={(
|
footer={extension ? extension.footer : (
|
||||||
<WindowFooterActions>
|
<WindowFooterActions>
|
||||||
<Button
|
<Button
|
||||||
variant="secondary"
|
variant="secondary"
|
||||||
@@ -223,7 +230,7 @@ export function EnvironmentSettingsWindow({
|
|||||||
</WindowFooterActions>
|
</WindowFooterActions>
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<div className="nodedc-environment-settings">
|
{extension ? extension.content : <div className="nodedc-environment-settings">
|
||||||
<SettingsCard
|
<SettingsCard
|
||||||
eyebrow="ОКРУЖЕНИЕ"
|
eyebrow="ОКРУЖЕНИЕ"
|
||||||
title="Основные элементы управления"
|
title="Основные элементы управления"
|
||||||
@@ -349,7 +356,7 @@ export function EnvironmentSettingsWindow({
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</SettingsCard>
|
</SettingsCard>
|
||||||
</div>
|
</div>}
|
||||||
</FeatureSettingsWindow>
|
</FeatureSettingsWindow>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { createGlassMaterialVariables, type GlassMaterialSettings } from "@noded
|
|||||||
import type { CSSProperties, HTMLAttributes, ReactNode } from "react";
|
import type { CSSProperties, HTMLAttributes, ReactNode } from "react";
|
||||||
import { cn } from "./cn.js";
|
import { cn } from "./cn.js";
|
||||||
|
|
||||||
export type GlassTone = "default" | "strong" | "soft";
|
export type GlassTone = "default" | "strong" | "soft" | "group";
|
||||||
export type GlassRadius = "card" | "panel" | "modal" | "pill";
|
export type GlassRadius = "card" | "panel" | "modal" | "pill";
|
||||||
export type GlassPadding = "none" | "sm" | "md" | "lg";
|
export type GlassPadding = "none" | "sm" | "md" | "lg";
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
import {
|
import {
|
||||||
MousePointer2,
|
MousePointer2,
|
||||||
|
Pipette,
|
||||||
|
createLucideIcon,
|
||||||
|
Glasses,
|
||||||
|
Cuboid,
|
||||||
Move,
|
Move,
|
||||||
CirclePlus,
|
CirclePlus,
|
||||||
Box,
|
Box,
|
||||||
@@ -39,6 +43,7 @@ import {
|
|||||||
ListChecks,
|
ListChecks,
|
||||||
LocateFixed,
|
LocateFixed,
|
||||||
LockKeyhole,
|
LockKeyhole,
|
||||||
|
LockKeyholeOpen,
|
||||||
MailPlus,
|
MailPlus,
|
||||||
Map,
|
Map,
|
||||||
Maximize2,
|
Maximize2,
|
||||||
@@ -47,6 +52,8 @@ import {
|
|||||||
PanelTop,
|
PanelTop,
|
||||||
Pencil,
|
Pencil,
|
||||||
Play,
|
Play,
|
||||||
|
Pin,
|
||||||
|
Power,
|
||||||
Plus,
|
Plus,
|
||||||
Minus,
|
Minus,
|
||||||
RefreshCw,
|
RefreshCw,
|
||||||
@@ -57,6 +64,7 @@ import {
|
|||||||
ShieldCheck,
|
ShieldCheck,
|
||||||
SlidersHorizontal,
|
SlidersHorizontal,
|
||||||
Square,
|
Square,
|
||||||
|
Star,
|
||||||
Terminal,
|
Terminal,
|
||||||
Trash2,
|
Trash2,
|
||||||
UploadCloud,
|
UploadCloud,
|
||||||
@@ -68,10 +76,26 @@ import {
|
|||||||
type LucideProps,
|
type LucideProps,
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
|
|
||||||
|
// CAD vocabulary: dimension line, cutting plane and unframed information glyph.
|
||||||
|
const DimensionLine = createLucideIcon('DimensionLine', [
|
||||||
|
['path', {d:'M4 5v14M20 5v14M4 12h16M8 9l-4 3 4 3M16 9l4 3-4 3',key:'dimension'}],
|
||||||
|
]);
|
||||||
|
const SectionPlane = createLucideIcon('SectionPlane', [
|
||||||
|
['path', {d:'m5 7 7-4 7 4v10l-7 4-7-4V7m0 0 7 4 7-4M12 11v10',key:'model'}],
|
||||||
|
['path', {d:'m2 12 10-5 10 5-10 5-10-5Z',key:'plane'}],
|
||||||
|
]);
|
||||||
|
const InformationPlain = createLucideIcon('InformationPlain', [
|
||||||
|
['path', {d:'M12 4h.01M10 9h2v11M9 20h6',key:'information'}],
|
||||||
|
]);
|
||||||
const icons = {
|
const icons = {
|
||||||
|
pipette: Pipette,
|
||||||
"add-point": CirclePlus,
|
"add-point": CirclePlus,
|
||||||
perspective: Box,
|
ruler: DimensionLine,
|
||||||
orthographic: Scan,
|
section: SectionPlane,
|
||||||
|
isolate: Glasses,
|
||||||
|
perspective: Cuboid,
|
||||||
|
orthographic: Box,
|
||||||
|
"fit-view": Scan,
|
||||||
select: MousePointer2,
|
select: MousePointer2,
|
||||||
move: Move,
|
move: Move,
|
||||||
pen: PenTool,
|
pen: PenTool,
|
||||||
@@ -94,6 +118,7 @@ const icons = {
|
|||||||
close: X,
|
close: X,
|
||||||
copy: Copy,
|
copy: Copy,
|
||||||
database: Database,
|
database: Database,
|
||||||
|
pin: Pin,
|
||||||
download: Download,
|
download: Download,
|
||||||
edit: Pencil,
|
edit: Pencil,
|
||||||
eye: Eye,
|
eye: Eye,
|
||||||
@@ -107,17 +132,20 @@ const icons = {
|
|||||||
image: Image,
|
image: Image,
|
||||||
inbox: Inbox,
|
inbox: Inbox,
|
||||||
info: Info,
|
info: Info,
|
||||||
|
"info-plain": InformationPlain,
|
||||||
key: KeyRound,
|
key: KeyRound,
|
||||||
layers: Layers,
|
layers: Layers,
|
||||||
list: ListChecks,
|
list: ListChecks,
|
||||||
target: LocateFixed,
|
target: LocateFixed,
|
||||||
lock: LockKeyhole,
|
lock: LockKeyhole,
|
||||||
|
unlock: LockKeyholeOpen,
|
||||||
mail: MailPlus,
|
mail: MailPlus,
|
||||||
minimize: Minimize2,
|
minimize: Minimize2,
|
||||||
network: Network,
|
network: Network,
|
||||||
panel: PanelTop,
|
panel: PanelTop,
|
||||||
plan: Map,
|
plan: Map,
|
||||||
play: Play,
|
play: Play,
|
||||||
|
power: Power,
|
||||||
plus: Plus,
|
plus: Plus,
|
||||||
minus: Minus,
|
minus: Minus,
|
||||||
profile: UserCircle,
|
profile: UserCircle,
|
||||||
@@ -129,6 +157,7 @@ const icons = {
|
|||||||
shield: ShieldCheck,
|
shield: ShieldCheck,
|
||||||
sliders: SlidersHorizontal,
|
sliders: SlidersHorizontal,
|
||||||
stop: Square,
|
stop: Square,
|
||||||
|
star: Star,
|
||||||
terminal: Terminal,
|
terminal: Terminal,
|
||||||
trash: Trash2,
|
trash: Trash2,
|
||||||
upload: UploadCloud,
|
upload: UploadCloud,
|
||||||
|
|||||||
@@ -19,6 +19,9 @@ export interface InspectorSectionSpec {
|
|||||||
|
|
||||||
export interface InspectorProps {
|
export interface InspectorProps {
|
||||||
sections: InspectorSectionSpec[];
|
sections: InspectorSectionSpec[];
|
||||||
|
/** Spaced form fields above sections and centered actions below them. */
|
||||||
|
header?: ReactNode;
|
||||||
|
footer?: ReactNode;
|
||||||
defaultOpen?: string[];
|
defaultOpen?: string[];
|
||||||
openSections?: string[];
|
openSections?: string[];
|
||||||
activeId?: string;
|
activeId?: string;
|
||||||
@@ -31,6 +34,8 @@ export interface InspectorProps {
|
|||||||
|
|
||||||
export function Inspector({
|
export function Inspector({
|
||||||
sections,
|
sections,
|
||||||
|
header,
|
||||||
|
footer,
|
||||||
defaultOpen = [],
|
defaultOpen = [],
|
||||||
openSections,
|
openSections,
|
||||||
activeId,
|
activeId,
|
||||||
@@ -70,6 +75,7 @@ export function Inspector({
|
|||||||
return (
|
return (
|
||||||
<InspectorSelectPolicyContext.Provider value>
|
<InspectorSelectPolicyContext.Provider value>
|
||||||
<div className={cn("nodedc-inspector", className)} data-variant={variant === "default" ? undefined : variant}>
|
<div className={cn("nodedc-inspector", className)} data-variant={variant === "default" ? undefined : variant}>
|
||||||
|
{header ? <div className="nodedc-inspector__header">{header}</div> : null}
|
||||||
{groups.map((group, groupIndex) => (
|
{groups.map((group, groupIndex) => (
|
||||||
<div className="nodedc-inspector__group" key={`${group.label ?? "root"}-${groupIndex}`}>
|
<div className="nodedc-inspector__group" key={`${group.label ?? "root"}-${groupIndex}`}>
|
||||||
{group.sections.map((section) => {
|
{group.sections.map((section) => {
|
||||||
@@ -107,6 +113,7 @@ export function Inspector({
|
|||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
|
{footer ? <div className="nodedc-inspector__footer">{footer}</div> : null}
|
||||||
</div>
|
</div>
|
||||||
</InspectorSelectPolicyContext.Provider>
|
</InspectorSelectPolicyContext.Provider>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
import {levelButtonGeometry,type LevelButtonGeometry} from './levelButtonGeometry.js';
|
||||||
|
export type {LevelButtonGeometry} from './levelButtonGeometry.js';
|
||||||
|
import type {CSSProperties} from 'react';
|
||||||
|
import {Button,type ButtonProps} from './Button.js';
|
||||||
|
import {cn} from './cn.js';
|
||||||
|
|
||||||
|
export interface LevelButtonProps extends Omit<ButtonProps,'children'|'shape'|'value'> {
|
||||||
|
label:string;
|
||||||
|
/** Optional operator geometry; text and padding shrink together below 64 × 24. */
|
||||||
|
geometry?:LevelButtonGeometry;
|
||||||
|
/** Measured fraction. Missing is unknown, never zero or animated progress. */
|
||||||
|
value?:number|null;
|
||||||
|
valueText?:string;
|
||||||
|
freshness?:'live'|'stale'|'unknown';
|
||||||
|
levelTone?:'neutral'|'success'|'warning'|'danger';
|
||||||
|
/** Explicit operator-selected fill; labels retain contrast over both parts. */
|
||||||
|
fillColor?:string;
|
||||||
|
}
|
||||||
|
/** Compact measured resource level which opens details, with native button semantics. */
|
||||||
|
export function LevelButton({label,value,valueText,freshness='live',levelTone='neutral',fillColor,geometry,className,style,...props}:LevelButtonProps){
|
||||||
|
const fraction=typeof value==='number'&&Number.isFinite(value)?Math.max(0,Math.min(1,value)):null;
|
||||||
|
const custom=typeof fillColor==='string'&&/^#[0-9a-f]{6}$/i.test(fillColor)?fillColor:null;
|
||||||
|
const channels=custom?.slice(1).match(/../g)?.map(v=>{const c=parseInt(v,16)/255;return c<=.04045?c/12.92:((c+.055)/1.055)**2.4;});
|
||||||
|
const ink=channels&&(.2126*channels[0]+.7152*channels[1]+.0722*channels[2])>.179?'#000000':'#ffffff';
|
||||||
|
const text=valueText??(fraction===null?'—':`${Math.round(fraction*100)}%`);
|
||||||
|
return <Button {...props} shape="pill" className={cn('nodedc-level-button',className)}
|
||||||
|
aria-label={`${label}: ${text}${freshness==='stale'?' · последние показания':''}`}
|
||||||
|
data-level-tone={levelTone} data-freshness={freshness} data-custom-fill={custom?true:undefined}
|
||||||
|
style={{...style,...levelButtonGeometry(geometry,text.length),'--nodedc-level-percent':`${(fraction??0)*100}%`,...(custom?{'--nodedc-level-custom':custom,'--nodedc-level-ink':ink}:{})} as CSSProperties}><span aria-hidden="true">{text}</span>{custom&&fraction!==null&&<span aria-hidden="true" className="nodedc-level-button__fill">{text}</span>}</Button>;
|
||||||
|
}
|
||||||
@@ -4,7 +4,7 @@ export interface NavigationCubeProps {
|
|||||||
/** Camera world quaternion, Y up. Directions point from target toward camera. */
|
/** Camera world quaternion, Y up. Directions point from target toward camera. */
|
||||||
quaternion: readonly [number,number,number,number];
|
quaternion: readonly [number,number,number,number];
|
||||||
onSelect: (direction:CubeDirection)=>void;
|
onSelect: (direction:CubeDirection)=>void;
|
||||||
size?:number; face?:string; text?:string; edge?:string; hover?:string; hoverText?:string; opacity?:number; edgeOpacity?:number;
|
size?:number; face?:string; text?:string; edge?:string; hover?:string; hoverText?:string; opacity?:number; edgeOpacity?:number; faceOpacity?:number;
|
||||||
disabled?:boolean;
|
disabled?:boolean;
|
||||||
label?:string;
|
label?:string;
|
||||||
}
|
}
|
||||||
@@ -42,9 +42,9 @@ export function cubeRegions(quaternion:NavigationCubeProps["quaternion"]) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
/** BIM-style face / edge / corner navigation, independent of the scene engine. */
|
/** BIM-style face / edge / corner navigation, independent of the scene engine. */
|
||||||
export function NavigationCube({quaternion,onSelect,disabled=false,label="Навигационный куб",size=66,face,text,edge,hover:highlight,hoverText,opacity=1,edgeOpacity=1}:NavigationCubeProps) {
|
export function NavigationCube({quaternion,onSelect,disabled=false,label="Навигационный куб",size=66,face,text,edge,hover:highlight,hoverText,opacity=1,edgeOpacity=1,faceOpacity=1}:NavigationCubeProps) {
|
||||||
const [hover,setHover]=useState<string|null>(null);
|
const [hover,setHover]=useState<string|null>(null);
|
||||||
return <svg className="nodedc-navigation-cube" style={{width:size,height:size,opacity,"--cube-face":face,"--cube-text":text,"--cube-edge":edge,"--cube-edge-opacity":edgeOpacity,"--cube-hover":highlight,"--cube-hover-text":hoverText} as CSSProperties} viewBox="0 0 120 120" role="group" aria-label={label}>
|
return <svg className="nodedc-navigation-cube" style={{width:size,height:size,opacity,"--cube-face":face,"--cube-face-opacity":faceOpacity,"--cube-text":text,"--cube-edge":edge,"--cube-edge-opacity":edgeOpacity,"--cube-hover":highlight,"--cube-hover-text":hoverText} as CSSProperties} viewBox="0 0 120 120" role="group" aria-label={label}>
|
||||||
{cubeRegions(quaternion).map(r=><g key={r.id} role="button" aria-label={`Ракурс: ${r.label}`} aria-disabled={disabled}
|
{cubeRegions(quaternion).map(r=><g key={r.id} role="button" aria-label={`Ракурс: ${r.label}`} aria-disabled={disabled}
|
||||||
tabIndex={disabled?-1:0} className={hover===r.label?"is-hovered":""}
|
tabIndex={disabled?-1:0} className={hover===r.label?"is-hovered":""}
|
||||||
onPointerEnter={()=>setHover(r.label)} onPointerLeave={()=>setHover(null)}
|
onPointerEnter={()=>setHover(r.label)} onPointerLeave={()=>setHover(null)}
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
import {createContext} from "react";
|
||||||
|
|
||||||
|
/** The shell owns rail width and panel presentation as one state. */
|
||||||
|
export const NavigationPanelState = createContext<{
|
||||||
|
collapsed: boolean;
|
||||||
|
onCollapsedChange: (collapsed: boolean) => void;
|
||||||
|
} | null>(null);
|
||||||
@@ -3,10 +3,16 @@ import { VerticalRangeBand, type RangeBandControlProps } from "./VerticalRangeBa
|
|||||||
export type { RangeBandControlProps } from "./VerticalRangeBand.js";
|
export type { RangeBandControlProps } from "./VerticalRangeBand.js";
|
||||||
import { cn } from "./cn.js";
|
import { cn } from "./cn.js";
|
||||||
import { Dropdown } from "./Dropdown.js";
|
import { Dropdown } from "./Dropdown.js";
|
||||||
|
import { Button } from "./Button.js";
|
||||||
|
import { Icon } from "./Icon.js";
|
||||||
|
import { Description } from "./Description.js";
|
||||||
|
import { screenColorPicker } from "./screenColorPicker.js";
|
||||||
|
|
||||||
export interface RangeControlProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "value" | "onChange"> {
|
export interface RangeControlProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "value" | "onChange"> {
|
||||||
label: string;
|
label: string;
|
||||||
orientation?: "horizontal" | "vertical";
|
orientation?: "horizontal" | "vertical";
|
||||||
|
/** Thin horizontal single-value rail; no containing surface or exact editor. */
|
||||||
|
variant?: "field" | "rail";
|
||||||
value: number;
|
value: number;
|
||||||
min: number;
|
min: number;
|
||||||
max: number;
|
max: number;
|
||||||
@@ -69,6 +75,7 @@ export function RangeControl(props: RangeControlProps | RangeBandControlProps) {
|
|||||||
function SingleRangeControl({
|
function SingleRangeControl({
|
||||||
label,
|
label,
|
||||||
orientation = "horizontal",
|
orientation = "horizontal",
|
||||||
|
variant = "field",
|
||||||
value,
|
value,
|
||||||
min,
|
min,
|
||||||
max,
|
max,
|
||||||
@@ -155,6 +162,17 @@ function SingleRangeControl({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (orientation === "horizontal" && variant === "rail") return (
|
||||||
|
<div className={cn("nodedc-range-rail", className)} data-disabled={disabled || undefined}>
|
||||||
|
<span className="nodedc-range-rail__value" aria-hidden="true">{displayValue}</span>
|
||||||
|
<div ref={rootRef} className="nodedc-range" style={style} data-variant="rail">
|
||||||
|
<input ref={rangeRef} {...props} type="range" value={value} min={min} max={safeMax} step={step}
|
||||||
|
disabled={disabled} tabIndex={tabIndex} aria-label={label} aria-orientation="horizontal"
|
||||||
|
aria-valuetext={displayValue} onChange={event => onChange(Number(event.target.value))}/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
|
||||||
if (orientation === "vertical") return (
|
if (orientation === "vertical") return (
|
||||||
<div className="nodedc-range-scale" data-limit-side={limitSide} style={style}>
|
<div className="nodedc-range-scale" data-limit-side={limitSide} style={style}>
|
||||||
<div ref={rootRef} className={cn("nodedc-range", className)} style={style} data-orientation="vertical">
|
<div ref={rootRef} className={cn("nodedc-range", className)} style={style} data-orientation="vertical">
|
||||||
@@ -277,7 +295,27 @@ function hsvToHex({ h, s, v }: Hsv): string {
|
|||||||
|
|
||||||
export function ColorField({ value, onChange, label = "Цвет", className, disabled = false, onBlur, onKeyDown, ...props }: ColorFieldProps) {
|
export function ColorField({ value, onChange, label = "Цвет", className, disabled = false, onBlur, onKeyDown, ...props }: ColorFieldProps) {
|
||||||
const [draft, setDraft] = useState(value);
|
const [draft, setDraft] = useState(value);
|
||||||
|
const [paletteOpen, setPaletteOpen] = useState(false), [picking, setPicking] = useState(false), [pickError, setPickError] = useState(false);
|
||||||
|
const nativePicker = useRef<HTMLInputElement>(null), sampling = useRef<AbortController | null>(null);
|
||||||
|
const screenPicker = screenColorPicker();
|
||||||
|
useEffect(() => () => { sampling.current?.abort(); }, []);
|
||||||
|
useEffect(() => { if (disabled || !paletteOpen) { sampling.current?.abort(); sampling.current = null; setPicking(false); } }, [disabled, paletteOpen]);
|
||||||
useEffect(() => setDraft(value), [value]);
|
useEffect(() => setDraft(value), [value]);
|
||||||
|
const sampleScreen = async () => {
|
||||||
|
if (disabled || sampling.current) return;
|
||||||
|
setPickError(false);
|
||||||
|
if (!screenPicker) { nativePicker.current?.click(); return; }
|
||||||
|
const controller = new AbortController(); sampling.current = controller; setPicking(true);
|
||||||
|
try {
|
||||||
|
// open() executes synchronously in this trusted click before the first await.
|
||||||
|
const result = await new screenPicker().open({ signal: controller.signal });
|
||||||
|
if (!controller.signal.aborted && parseHexColor(result.sRGBHex)) { setDraft(result.sRGBHex.toLowerCase()); onChange(result.sRGBHex.toLowerCase()); }
|
||||||
|
} catch (error) {
|
||||||
|
if (!controller.signal.aborted && !(error instanceof Error && error.name === 'AbortError')) setPickError(true);
|
||||||
|
} finally {
|
||||||
|
if (!controller.signal.aborted) { setPicking(false); sampling.current = null; }
|
||||||
|
}
|
||||||
|
};
|
||||||
const validColor = hexToHsv(value);
|
const validColor = hexToHsv(value);
|
||||||
const [hsv, setHsv] = useState<Hsv>(() => validColor ?? { h: 330, s: 82, v: 100 });
|
const [hsv, setHsv] = useState<Hsv>(() => validColor ?? { h: 330, s: 82, v: 100 });
|
||||||
const style = { "--nodedc-color-value": validColor ? hsvToHex(validColor) : hsvToHex(hsv) } as CSSProperties;
|
const style = { "--nodedc-color-value": validColor ? hsvToHex(validColor) : hsvToHex(hsv) } as CSSProperties;
|
||||||
@@ -302,6 +340,7 @@ export function ColorField({ value, onChange, label = "Цвет", className, dis
|
|||||||
<div className={cn("nodedc-color-field", className)} style={style}>
|
<div className={cn("nodedc-color-field", className)} style={style}>
|
||||||
<Dropdown
|
<Dropdown
|
||||||
className="nodedc-color-field__dropdown"
|
className="nodedc-color-field__dropdown"
|
||||||
|
onOpenChange={setPaletteOpen}
|
||||||
placement="bottom-start"
|
placement="bottom-start"
|
||||||
minWidth={296}
|
minWidth={296}
|
||||||
width={296}
|
width={296}
|
||||||
@@ -354,6 +393,10 @@ export function ColorField({ value, onChange, label = "Цвет", className, dis
|
|||||||
<span>Оттенок</span>
|
<span>Оттенок</span>
|
||||||
<input type="range" min={0} max={360} value={Math.round(hsv.h)} aria-label={`${label}: оттенок`} disabled={disabled} onChange={(event) => commit({ ...hsv, h: Number(event.target.value) })} />
|
<input type="range" min={0} max={360} value={Math.round(hsv.h)} aria-label={`${label}: оттенок`} disabled={disabled} onChange={(event) => commit({ ...hsv, h: Number(event.target.value) })} />
|
||||||
</label>
|
</label>
|
||||||
|
<Button width="full" icon={<Icon name="pipette"/>} disabled={disabled} loading={picking} onClick={() => void sampleScreen()} title={screenPicker ? 'Выбрать цвет в любой точке экрана; Escape — отменить' : 'В этом браузере выбор цвета с экрана доступен через системную палитру, если она поддерживает пипетку'}>
|
||||||
|
{screenPicker ? 'Цвет с экрана' : 'Системная палитра'}
|
||||||
|
</Button>
|
||||||
|
{pickError && <Description role="status">Не удалось включить пипетку. Повторите попытку.</Description>}
|
||||||
<div className="nodedc-color-palette__presets" aria-label="Быстрые цвета">
|
<div className="nodedc-color-palette__presets" aria-label="Быстрые цвета">
|
||||||
{palettePresets.map((preset) => (
|
{palettePresets.map((preset) => (
|
||||||
<button
|
<button
|
||||||
@@ -371,6 +414,7 @@ export function ColorField({ value, onChange, label = "Цвет", className, dis
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
|
<input ref={nativePicker} type="color" hidden tabIndex={-1} aria-hidden="true" disabled={disabled} value={validColor ? hsvToHex(validColor) : '#000000'} onChange={event => { setDraft(event.target.value); onChange(event.target.value); }}/>
|
||||||
<input
|
<input
|
||||||
className="nodedc-color-field__text"
|
className="nodedc-color-field__text"
|
||||||
{...props}
|
{...props}
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ export interface SelectProps<T extends string> {
|
|||||||
menuWidth?: number | "anchor";
|
menuWidth?: number | "anchor";
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
variant?: SelectVariant;
|
variant?: SelectVariant;
|
||||||
|
/** Split site/workspace selectors can align with adjacent circular actions. */
|
||||||
|
shape?: "default" | "pill";
|
||||||
className?: string;
|
className?: string;
|
||||||
triggerClassName?: string;
|
triggerClassName?: string;
|
||||||
menuClassName?: string;
|
menuClassName?: string;
|
||||||
@@ -47,6 +49,7 @@ export function Select<T extends string>({
|
|||||||
menuWidth = "anchor",
|
menuWidth = "anchor",
|
||||||
disabled = false,
|
disabled = false,
|
||||||
variant = "integrated",
|
variant = "integrated",
|
||||||
|
shape = "default",
|
||||||
className,
|
className,
|
||||||
triggerClassName,
|
triggerClassName,
|
||||||
menuClassName,
|
menuClassName,
|
||||||
@@ -88,7 +91,7 @@ export function Select<T extends string>({
|
|||||||
};
|
};
|
||||||
if (resolvedVariant === "split") {
|
if (resolvedVariant === "split") {
|
||||||
return (
|
return (
|
||||||
<div className={cn("nodedc-select", triggerClassName)} data-disabled={disabled ? "true" : undefined}>
|
<div className={cn("nodedc-select", triggerClassName)} data-shape={shape === "pill" ? "pill" : undefined} data-disabled={disabled ? "true" : undefined}>
|
||||||
<div ref={setAnchorRef} className="nodedc-select__control">
|
<div ref={setAnchorRef} className="nodedc-select__control">
|
||||||
<div className="nodedc-select__value">
|
<div className="nodedc-select__value">
|
||||||
{selected?.icon ? <span className="nodedc-select__value-icon">{selected.icon}</span> : null}
|
{selected?.icon ? <span className="nodedc-select__value-icon">{selected.icon}</span> : null}
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ export function SplitPane({
|
|||||||
const rootRef = useRef<HTMLDivElement>(null);
|
const rootRef = useRef<HTMLDivElement>(null);
|
||||||
const activePointerIdRef = useRef<number | null>(null);
|
const activePointerIdRef = useRef<number | null>(null);
|
||||||
const [dragging, setDragging] = useState(false);
|
const [dragging, setDragging] = useState(false);
|
||||||
|
const [pointerFocus, setPointerFocus] = useState(false);
|
||||||
const limits = normalizedLimits(minPrimarySize, minSecondarySize);
|
const limits = normalizedLimits(minPrimarySize, minSecondarySize);
|
||||||
const size = clamp(Number.isFinite(primarySize) ? primarySize : 50, limits.minimum, limits.maximum);
|
const size = clamp(Number.isFinite(primarySize) ? primarySize : 50, limits.minimum, limits.maximum);
|
||||||
const keyboardIncrement = Number.isFinite(step) && step > 0 ? step : 2;
|
const keyboardIncrement = Number.isFinite(step) && step > 0 ? step : 2;
|
||||||
@@ -74,6 +75,7 @@ export function SplitPane({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleKeyDown = (event: KeyboardEvent<HTMLElement>) => {
|
const handleKeyDown = (event: KeyboardEvent<HTMLElement>) => {
|
||||||
|
setPointerFocus(false);
|
||||||
const multiplier = event.shiftKey ? 5 : 1;
|
const multiplier = event.shiftKey ? 5 : 1;
|
||||||
const decrement = orientation === "vertical" ? "ArrowLeft" : "ArrowUp";
|
const decrement = orientation === "vertical" ? "ArrowLeft" : "ArrowUp";
|
||||||
const increment = orientation === "vertical" ? "ArrowRight" : "ArrowDown";
|
const increment = orientation === "vertical" ? "ArrowRight" : "ArrowDown";
|
||||||
@@ -119,10 +121,13 @@ export function SplitPane({
|
|||||||
aria-valuemax={Math.round(limits.maximum)}
|
aria-valuemax={Math.round(limits.maximum)}
|
||||||
aria-valuenow={Math.round(size)}
|
aria-valuenow={Math.round(size)}
|
||||||
aria-valuetext={`${Math.round(size)}% / ${Math.round(100 - size)}%`}
|
aria-valuetext={`${Math.round(size)}% / ${Math.round(100 - size)}%`}
|
||||||
|
data-pointer-focus={pointerFocus || undefined}
|
||||||
|
onBlur={() => setPointerFocus(false)}
|
||||||
onKeyDown={handleKeyDown}
|
onKeyDown={handleKeyDown}
|
||||||
onPointerDown={(event) => {
|
onPointerDown={(event) => {
|
||||||
if (event.button !== 0) return;
|
if (event.button !== 0) return;
|
||||||
event.currentTarget.focus();
|
setPointerFocus(true);
|
||||||
|
event.currentTarget.focus({ preventScroll: true });
|
||||||
activePointerIdRef.current = event.pointerId;
|
activePointerIdRef.current = event.pointerId;
|
||||||
event.currentTarget.setPointerCapture(event.pointerId);
|
event.currentTarget.setPointerCapture(event.pointerId);
|
||||||
setDragging(true);
|
setDragging(true);
|
||||||
|
|||||||
@@ -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">
|
||||||
|
|||||||
@@ -38,6 +38,8 @@ export interface ToolbarProps<T extends string = string> {
|
|||||||
hideDelay?: number;
|
hideDelay?: number;
|
||||||
gap?: number;
|
gap?: number;
|
||||||
label?: string;
|
label?: string;
|
||||||
|
/** Dropdown width; placement still clamps to the visible viewport. */
|
||||||
|
menuWidth?: number;
|
||||||
className?: string;
|
className?: string;
|
||||||
/** Render inside a positioned viewport; edge reveal follows that viewport. */
|
/** Render inside a positioned viewport; edge reveal follows that viewport. */
|
||||||
container?: HTMLElement;
|
container?: HTMLElement;
|
||||||
@@ -66,6 +68,7 @@ export function Toolbar<T extends string = string>({
|
|||||||
hideDelay = NODEDC_TOOLBAR_DEFAULTS.hideDelay,
|
hideDelay = NODEDC_TOOLBAR_DEFAULTS.hideDelay,
|
||||||
gap = NODEDC_TOOLBAR_DEFAULTS.gap,
|
gap = NODEDC_TOOLBAR_DEFAULTS.gap,
|
||||||
label = "Панель инструментов",
|
label = "Панель инструментов",
|
||||||
|
menuWidth = 220,
|
||||||
className,
|
className,
|
||||||
container,
|
container,
|
||||||
}: ToolbarProps<T>) {
|
}: ToolbarProps<T>) {
|
||||||
@@ -392,7 +395,7 @@ export function Toolbar<T extends string = string>({
|
|||||||
if(placement==="left")return {...b.toJSON(),left:t.left,right:t.left+pad,width:pad};
|
if(placement==="left")return {...b.toJSON(),left:t.left,right:t.left+pad,width:pad};
|
||||||
if(placement==="bottom")return {...b.toJSON(),top:t.bottom-pad,bottom:t.bottom,height:pad};
|
if(placement==="bottom")return {...b.toJSON(),top:t.bottom-pad,bottom:t.bottom,height:pad};
|
||||||
return {...b.toJSON(),top:t.top,bottom:t.top+pad,height:pad};
|
return {...b.toJSON(),top:t.top,bottom:t.top+pad,height:pad};
|
||||||
}} width={220} trigger={button} onPointerDownOutside={event=>{
|
}} width={Number.isFinite(menuWidth)?Math.max(180,Math.min(600,menuWidth)):220} trigger={button} onPointerDownOutside={event=>{
|
||||||
const target=event.target as Element;
|
const target=event.target as Element;
|
||||||
// Dismiss a menu before a viewport tool can turn this same click into an edit.
|
// Dismiss a menu before a viewport tool can turn this same click into an edit.
|
||||||
if(container?.contains(target)&&!target.closest('button,input,select,textarea,a,[role="button"],[role="tab"]')){
|
if(container?.contains(target)&&!target.closest('button,input,select,textarea,a,[role="button"],[role="tab"]')){
|
||||||
|
|||||||
@@ -0,0 +1,69 @@
|
|||||||
|
import {cloneElement,isValidElement,useCallback,useEffect,useId,useLayoutEffect,useRef,useState,type CSSProperties,type ReactNode,type ReactElement} from 'react';
|
||||||
|
import {createPortal} from 'react-dom';
|
||||||
|
import {computeFloatingPosition,type FloatingPlacement} from '@nodedc/ui-core';
|
||||||
|
import {cn} from './cn.js';
|
||||||
|
|
||||||
|
export interface TooltipProps {
|
||||||
|
children:ReactNode;
|
||||||
|
content:ReactNode;
|
||||||
|
label?:string;
|
||||||
|
/** Use for a read-only graphic; buttons already supply their own focus target. */
|
||||||
|
focusable?:boolean;
|
||||||
|
disabled?:boolean;
|
||||||
|
placement?:FloatingPlacement;
|
||||||
|
className?:string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Non-interactive explanation; selection/actions belong to Dropdown. */
|
||||||
|
export function Tooltip({children,content,label,focusable=false,disabled=false,placement='top-start',className}:TooltipProps){
|
||||||
|
const id=`tooltip-${useId().replaceAll(':','')}`;
|
||||||
|
const anchor=useRef<HTMLSpanElement>(null),surface=useRef<HTMLDivElement>(null);
|
||||||
|
const timer=useRef<ReturnType<typeof setTimeout>|undefined>(undefined);
|
||||||
|
const [open,setOpen]=useState(false),[style,setStyle]=useState<CSSProperties>({visibility:'hidden'});
|
||||||
|
const clear=useCallback(()=>{clearTimeout(timer.current);},[]);
|
||||||
|
const close=useCallback(()=>{clear();setOpen(false);},[clear]);
|
||||||
|
const show=useCallback(()=>{clear();if(!disabled)setOpen(true);},[clear,disabled]);
|
||||||
|
const leave=()=>{
|
||||||
|
clear();
|
||||||
|
if(anchor.current?.contains(document.activeElement))return;
|
||||||
|
timer.current=setTimeout(close,140);
|
||||||
|
};
|
||||||
|
useEffect(()=>()=>clear(),[clear]);
|
||||||
|
useEffect(()=>{if(disabled)close();},[disabled,close]);
|
||||||
|
useLayoutEffect(()=>{
|
||||||
|
if(!open)return;
|
||||||
|
const position=()=>{
|
||||||
|
if(!anchor.current||!surface.current)return;
|
||||||
|
const rect=anchor.current.getBoundingClientRect(),size=surface.current.getBoundingClientRect();
|
||||||
|
if(rect.bottom<=0||rect.top>=window.innerHeight||rect.right<=0||rect.left>=window.innerWidth){close();return;}
|
||||||
|
const p=computeFloatingPosition({anchor:rect,surfaceWidth:size.width,surfaceHeight:size.height,placement,offset:8});
|
||||||
|
setStyle({left:p.left,top:p.top,maxHeight:p.maxHeight,visibility:'visible'});
|
||||||
|
};
|
||||||
|
position();
|
||||||
|
const observer=new ResizeObserver(position);
|
||||||
|
if(anchor.current)observer.observe(anchor.current);
|
||||||
|
if(surface.current)observer.observe(surface.current);
|
||||||
|
window.addEventListener('resize',position);window.addEventListener('scroll',position,true);
|
||||||
|
document.addEventListener('fullscreenchange',close);
|
||||||
|
return()=>{observer.disconnect();window.removeEventListener('resize',position);window.removeEventListener('scroll',position,true);document.removeEventListener('fullscreenchange',close);};
|
||||||
|
},[open,placement,close]);
|
||||||
|
useEffect(()=>{
|
||||||
|
if(!open)return;
|
||||||
|
const key=(e:KeyboardEvent)=>{if(e.key==='Escape'){close();e.preventDefault();e.stopImmediatePropagation();}};
|
||||||
|
const outside=(e:PointerEvent)=>{if(e.target instanceof Node&&!anchor.current?.contains(e.target)&&!surface.current?.contains(e.target))close();};
|
||||||
|
const other=(e:Event)=>{if((e as CustomEvent<string>).detail!==id)close();};
|
||||||
|
document.addEventListener('keydown',key,true);document.addEventListener('pointerdown',outside,true);
|
||||||
|
window.addEventListener('nodedc-tooltip-open',other);
|
||||||
|
window.dispatchEvent(new CustomEvent('nodedc-tooltip-open',{detail:id}));
|
||||||
|
return()=>{document.removeEventListener('keydown',key,true);document.removeEventListener('pointerdown',outside,true);window.removeEventListener('nodedc-tooltip-open',other);};
|
||||||
|
},[open,id,close]);
|
||||||
|
return <span ref={anchor} className={cn('nodedc-tooltip-anchor',className)}
|
||||||
|
tabIndex={focusable&&!disabled?0:undefined} role={focusable?'img':undefined} aria-label={label}
|
||||||
|
aria-describedby={open?id:undefined} onPointerEnter={e=>{if(e.pointerType!=='touch')show();}}
|
||||||
|
onPointerLeave={leave} onFocus={show} onBlur={e=>{if(!e.currentTarget.contains(e.relatedTarget)&&!e.currentTarget.matches(':hover'))close();}}
|
||||||
|
onPointerDown={e=>{if(e.pointerType==='touch'){if(open)close();else show();}}}>
|
||||||
|
{focusable||!isValidElement(children)?children:cloneElement(children as ReactElement<{'aria-describedby'?:string;title?:string}>,{title:undefined,'aria-describedby':[children.props && (children.props as {'aria-describedby'?:string})['aria-describedby'],open?id:undefined].filter(Boolean).join(' ')||undefined})}
|
||||||
|
{open&&typeof document!=='undefined'&&createPortal(<div ref={surface} id={id} role="tooltip"
|
||||||
|
className="nodedc-tooltip" style={style} onPointerEnter={clear} onPointerLeave={leave}>{content}</div>,document.fullscreenElement??document.body)}
|
||||||
|
</span>;
|
||||||
|
}
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
import {createContext,useContext,useEffect,useId,useLayoutEffect,useRef,useState,type CSSProperties,type ReactNode} from 'react';
|
||||||
|
import {createPortal} from 'react-dom';
|
||||||
|
import {computeFloatingPosition} from '@nodedc/ui-core';
|
||||||
|
import {TooltipTitles} from './tooltipTitles.js';
|
||||||
|
|
||||||
|
const Installed=createContext(false);
|
||||||
|
/** One application-wide bridge for native title hints. Nested modules reuse the host. */
|
||||||
|
export function TooltipProvider({children}:{children?:ReactNode}){
|
||||||
|
const installed=useContext(Installed);
|
||||||
|
return installed?<>{children}</>:<Installed.Provider value={true}><TitleTooltips/>{children}</Installed.Provider>;
|
||||||
|
}
|
||||||
|
function TitleTooltips(){
|
||||||
|
const id=`tooltip-layer-${useId().replaceAll(':','')}`;
|
||||||
|
const [target,setTarget]=useState<{element:Element;text:string}|null>(null);
|
||||||
|
const [style,setStyle]=useState<CSSProperties>({visibility:'hidden'});
|
||||||
|
const surface=useRef<HTMLDivElement>(null),titles=useRef(new TooltipTitles());
|
||||||
|
const hide=useRef(()=>{});
|
||||||
|
useEffect(()=>{
|
||||||
|
let anchor:Element|null=null,timer:ReturnType<typeof setTimeout>|undefined,leaving:ReturnType<typeof setTimeout>|undefined,observer:MutationObserver|null=null;
|
||||||
|
const clear=()=>{clearTimeout(timer);clearTimeout(leaving);};
|
||||||
|
const close=()=>{clear();observer?.disconnect();observer=null;anchor=null;titles.current.restore();setTarget(null);};hide.current=close;
|
||||||
|
const show=(element:Element,text:string)=>{
|
||||||
|
titles.current.describe(element,id);setTarget({element,text});
|
||||||
|
window.dispatchEvent(new CustomEvent('nodedc-tooltip-open',{detail:id}));
|
||||||
|
};
|
||||||
|
const enter=(node:EventTarget|null,keyboard=false)=>{
|
||||||
|
if(!(node instanceof Element))return;
|
||||||
|
if(surface.current?.contains(node)){clear();return;}
|
||||||
|
if(anchor?.contains(node)){clearTimeout(leaving);if(keyboard){const text=titles.current.text(anchor);if(text)show(anchor,text);}return;}
|
||||||
|
close();
|
||||||
|
// Explicit Tooltip already owns rich content and its accessible description.
|
||||||
|
if(node.closest('.nodedc-tooltip-anchor,[data-nodedc-tooltip="off"]'))return;
|
||||||
|
const found=titles.current.find(node);if(!found)return;
|
||||||
|
anchor=found.element;titles.current.suppress(anchor);
|
||||||
|
observer=new MutationObserver(()=>{
|
||||||
|
if(!anchor)return;
|
||||||
|
const updated=anchor.getAttribute('data-nodedc-tooltip')??anchor.getAttribute('title');if(updated===null)return;
|
||||||
|
titles.current.suppress(anchor);if(updated.trim())show(anchor,updated);else close();
|
||||||
|
});observer.observe(anchor,{attributes:true,attributeFilter:['title','data-nodedc-tooltip']});
|
||||||
|
if(keyboard)show(anchor,found.text);else timer=setTimeout(()=>{if(anchor)show(anchor,found.text);},220);
|
||||||
|
};
|
||||||
|
const leave=(related:EventTarget|null)=>{
|
||||||
|
if(related instanceof Node&&(anchor?.contains(related)||surface.current?.contains(related)))return;
|
||||||
|
if(anchor?.contains(document.activeElement))return;
|
||||||
|
clearTimeout(leaving);leaving=setTimeout(close,140);
|
||||||
|
};
|
||||||
|
const over=(event:PointerEvent)=>{if(event.pointerType!=='touch')enter(event.composedPath()[0]??event.target);};
|
||||||
|
const out=(event:PointerEvent)=>leave(event.relatedTarget);
|
||||||
|
const focus=(event:FocusEvent)=>enter(event.composedPath()[0]??event.target,true);
|
||||||
|
const blur=(event:FocusEvent)=>{if(!(event.relatedTarget instanceof Node)||!anchor?.contains(event.relatedTarget))close();};
|
||||||
|
const down=()=>{clear();setTarget(null);};
|
||||||
|
const key=(event:KeyboardEvent)=>{if(event.key==='Escape'&&anchor){close();event.preventDefault();event.stopImmediatePropagation();}};
|
||||||
|
const other=(event:Event)=>{if((event as CustomEvent<string>).detail!==id)close();};
|
||||||
|
document.addEventListener('pointerover',over,true);document.addEventListener('pointerout',out,true);
|
||||||
|
document.addEventListener('focusin',focus,true);document.addEventListener('focusout',blur,true);
|
||||||
|
document.addEventListener('pointerdown',down,true);document.addEventListener('keydown',key,true);
|
||||||
|
document.addEventListener('fullscreenchange',close);window.addEventListener('blur',close);window.addEventListener('nodedc-tooltip-open',other);
|
||||||
|
return()=>{close();document.removeEventListener('pointerover',over,true);document.removeEventListener('pointerout',out,true);document.removeEventListener('focusin',focus,true);document.removeEventListener('focusout',blur,true);document.removeEventListener('pointerdown',down,true);document.removeEventListener('keydown',key,true);document.removeEventListener('fullscreenchange',close);window.removeEventListener('blur',close);window.removeEventListener('nodedc-tooltip-open',other);};
|
||||||
|
},[id]);
|
||||||
|
useLayoutEffect(()=>{
|
||||||
|
if(!target)return;
|
||||||
|
const position=()=>{
|
||||||
|
if(!surface.current||!target.element.isConnected){hide.current();return;}
|
||||||
|
const rect=target.element.getBoundingClientRect();if(rect.bottom<=0||rect.top>=window.innerHeight||rect.right<=0||rect.left>=window.innerWidth){hide.current();return;}
|
||||||
|
const size=surface.current.getBoundingClientRect(),p=computeFloatingPosition({anchor:rect,surfaceWidth:size.width,surfaceHeight:size.height,placement:'bottom-start',offset:8});
|
||||||
|
setStyle({left:p.left,top:p.top,maxHeight:p.maxHeight,visibility:'visible'});
|
||||||
|
};
|
||||||
|
position();const observer=new ResizeObserver(position);observer.observe(target.element);if(surface.current)observer.observe(surface.current);
|
||||||
|
window.addEventListener('resize',position);window.addEventListener('scroll',position,true);
|
||||||
|
return()=>{observer.disconnect();window.removeEventListener('resize',position);window.removeEventListener('scroll',position,true);};
|
||||||
|
},[target]);
|
||||||
|
return target&&typeof document!=='undefined'?createPortal(<div ref={surface} id={id} role="tooltip" className="nodedc-tooltip" style={style}>{target.text}</div>,document.fullscreenElement??document.body):null;
|
||||||
|
}
|
||||||
@@ -1,27 +1,49 @@
|
|||||||
import {useLayoutEffect,useRef,useState,type CSSProperties} from 'react';
|
import {useLayoutEffect,useRef,useState,type CSSProperties,type ReactNode} from 'react';
|
||||||
|
import {treeSelectionRange} from './treeSelectionRange.js';
|
||||||
import {Icon,type IconName} from './Icon.js';
|
import {Icon,type IconName} from './Icon.js';
|
||||||
|
|
||||||
export interface TreeNode {id:string;label:string;children?:TreeNode[];icon?:IconName;visible?:boolean}
|
export interface TreeNode {id:string;label:string;children?:TreeNode[];icon?:IconName;visible?:boolean}
|
||||||
export interface TreeProps {nodes:TreeNode[];selected:string|null;onSelect:(id:string)=>void;onVisibilityChange?:(id:string,visible:boolean)=>void;label:string;query?:string;revealKey?:number}
|
export interface TreeSelectionGesture {ctrlKey:boolean;metaKey:boolean;shiftKey:boolean;rangeIds:string[]}
|
||||||
|
export interface TreeProps {nodes:TreeNode[];selected:string|null;selectedIds?:readonly string[];onSelect:(id:string,gesture:TreeSelectionGesture)=>void;onVisibilityChange?:(id:string,visible:boolean)=>void;label:string;query?:string;revealKey?:number;defaultExpandedDepth?:number;renderActions?:(node:TreeNode)=>ReactNode}
|
||||||
|
|
||||||
/** Compact outliner. Selection reveals ancestors without scrolling its host page. */
|
/** Compact outliner. Selection reveals ancestors without scrolling its host page. */
|
||||||
export function Tree({nodes,selected,onSelect,onVisibilityChange,label,query='',revealKey}:TreeProps){
|
export function Tree({nodes,selected,selectedIds,onSelect,onVisibilityChange,label,query='',revealKey,defaultExpandedDepth=Infinity,renderActions}:TreeProps){
|
||||||
const [collapsed,setCollapsed]=useState<Set<string>>(()=>new Set());
|
const [collapsed,setCollapsed]=useState<Map<string,boolean>>(()=>new Map());
|
||||||
const [focus,setFocus]=useState<string|null>(null);
|
const [focus,setFocus]=useState<string|null>(null);
|
||||||
|
const anchor=useRef<string|null>(null);
|
||||||
|
const lastReveal=useRef<{selected:string;key:number|undefined}|null>(null),pendingReveal=useRef<string|null>(null);
|
||||||
|
const disclosureScroll=useRef<number|null>(null);
|
||||||
const host=useRef<HTMLDivElement>(null),elements=useRef(new Map<string,HTMLDivElement>());
|
const host=useRef<HTMLDivElement>(null),elements=useRef(new Map<string,HTMLDivElement>());
|
||||||
const parents=new Map<string,string>(),index=new Map<string,TreeNode>();
|
const parents=new Map<string,string>(),index=new Map<string,TreeNode>();
|
||||||
const visit=(items:TreeNode[],parent?:string)=>{for(const item of items){index.set(item.id,item);if(parent)parents.set(item.id,parent);visit(item.children??[],item.id);}};visit(nodes);
|
const visit=(items:TreeNode[],parent?:string)=>{for(const item of items){index.set(item.id,item);if(parent)parents.set(item.id,parent);visit(item.children??[],item.id);}};visit(nodes);
|
||||||
const ancestors=new Set<string>();let parent=selected?parents.get(selected):undefined;while(parent){ancestors.add(parent);parent=parents.get(parent);}
|
const ancestors=new Set<string>();let parent=selected?parents.get(selected):undefined;while(parent){ancestors.add(parent);parent=parents.get(parent);}
|
||||||
const matches=(item:TreeNode):boolean=>!query||item.label.toLocaleLowerCase().includes(query.toLocaleLowerCase())||!!item.children?.some(matches);
|
const matches=(item:TreeNode):boolean=>!query||item.label.toLocaleLowerCase().includes(query.toLocaleLowerCase())||!!item.children?.some(matches);
|
||||||
const rows:{node:TreeNode;depth:number;open:boolean}[]=[];
|
const rows:{node:TreeNode;depth:number;open:boolean}[]=[];
|
||||||
const flatten=(items:TreeNode[],depth=0)=>{for(const node of items){if(!matches(node))continue;const open=!!query||!collapsed.has(node.id);rows.push({node,depth,open});if(open)flatten(node.children??[],depth+1);}};flatten(nodes);
|
const flatten=(items:TreeNode[],depth=0)=>{for(const node of items){if(!matches(node))continue;const open=!!query||!(collapsed.get(node.id)??depth>=defaultExpandedDepth);rows.push({node,depth,open});if(open)flatten(node.children??[],depth+1);}};flatten(nodes);
|
||||||
const reveal=(id:string)=>{const target=elements.current.get(id),container=host.current;if(!target||!container)return;const row=target.getBoundingClientRect(),box=container.getBoundingClientRect();if(row.top<box.top)container.scrollTop-=box.top-row.top;else if(row.bottom>box.bottom)container.scrollTop+=row.bottom-box.bottom;};
|
const reveal=(id:string)=>{const target=elements.current.get(id),container=host.current;if(!target||!container)return;const row=target.getBoundingClientRect(),box=container.getBoundingClientRect();if(row.top<box.top)container.scrollTop-=box.top-row.top;else if(row.bottom>box.bottom)container.scrollTop+=row.bottom-box.bottom;};
|
||||||
useLayoutEffect(()=>{if(selected){setFocus(selected);setCollapsed(old=>{if(![...ancestors].some(id=>old.has(id)))return old;const next=new Set(old);for(const id of ancestors)next.delete(id);return next;});}},[selected,revealKey]);
|
// Data/visibility refreshes are not a new selection. An unresolved external
|
||||||
useLayoutEffect(()=>{if(selected)reveal(selected);},[selected,revealKey,query,collapsed]);
|
// selection may wait for async nodes, but a manual disclosure always wins.
|
||||||
const toggle=(id:string)=>setCollapsed(old=>{const next=new Set(old);if(next.has(id))next.delete(id);else next.add(id);return next;});
|
useLayoutEffect(()=>{
|
||||||
const select=(id:string)=>{setFocus(id);onSelect(id);elements.current.get(id)?.focus({preventScroll:true});reveal(id);};
|
if(!selected){lastReveal.current=null;pendingReveal.current=null;return;}
|
||||||
return <div ref={host} className="nodedc-tree" role="tree" aria-label={label}>
|
if(lastReveal.current?.selected===selected&&lastReveal.current.key===revealKey)return;
|
||||||
{rows.map(({node,depth,open},position)=><div key={node.id} ref={element=>{if(element)elements.current.set(node.id,element);else elements.current.delete(node.id);}} role="treeitem" aria-level={depth+1} aria-selected={selected===node.id} aria-expanded={node.children?.length?open:undefined} tabIndex={(focus??selected??rows[0]?.node.id)===node.id?0:-1} className="nodedc-tree__row" style={{'--tree-depth':depth} as CSSProperties} title={node.label} onFocus={()=>setFocus(node.id)} onClick={()=>select(node.id)} onDoubleClick={()=>node.children?.length&&toggle(node.id)} onKeyDown={event=>{
|
if(!index.has(selected))return;
|
||||||
|
lastReveal.current={selected,key:revealKey};pendingReveal.current=selected;setFocus(selected);
|
||||||
|
setCollapsed(old=>{if([...ancestors].every(id=>old.get(id)===false))return old;const next=new Map(old);for(const id of ancestors)next.set(id,false);return next;});
|
||||||
|
},[selected,revealKey,nodes]);
|
||||||
|
useLayoutEffect(()=>{
|
||||||
|
if(disclosureScroll.current!==null){if(host.current)host.current.scrollTop=disclosureScroll.current;disclosureScroll.current=null;return;}
|
||||||
|
const id=pendingReveal.current;if(id&&elements.current.has(id)){reveal(id);pendingReveal.current=null;}
|
||||||
|
},[selected,revealKey,nodes,query,collapsed]);
|
||||||
|
const toggle=(id:string)=>{
|
||||||
|
pendingReveal.current=null;disclosureScroll.current=host.current?.scrollTop??null;
|
||||||
|
setCollapsed(old=>{const next=new Map(old);const depth=rows.find(row=>row.node.id===id)?.depth??0;next.set(id,!(old.get(id)??depth>=defaultExpandedDepth));return next;});
|
||||||
|
};
|
||||||
|
const select=(id:string,event:{ctrlKey:boolean;metaKey:boolean;shiftKey:boolean})=>{setFocus(id);
|
||||||
|
const rangeIds=event.shiftKey&&selectedIds?treeSelectionRange(rows.map(row=>row.node.id),anchor.current,id):[id];
|
||||||
|
if(!event.shiftKey)anchor.current=id;
|
||||||
|
onSelect(id,{ctrlKey:event.ctrlKey,metaKey:event.metaKey,shiftKey:event.shiftKey,rangeIds});elements.current.get(id)?.focus({preventScroll:true});reveal(id);};
|
||||||
|
return <div ref={host} className="nodedc-tree" role="tree" aria-label={label} aria-multiselectable={selectedIds?true:undefined}>
|
||||||
|
{rows.map(({node,depth,open},position)=><div key={node.id} ref={element=>{if(element)elements.current.set(node.id,element);else elements.current.delete(node.id);}} role="treeitem" aria-level={depth+1} aria-selected={selectedIds?selectedIds.includes(node.id):selected===node.id} aria-expanded={node.children?.length?open:undefined} tabIndex={(focus??selected??rows[0]?.node.id)===node.id?0:-1} className="nodedc-tree__row" style={{'--tree-depth':depth} as CSSProperties} title={node.label} onFocus={()=>setFocus(node.id)} onClick={event=>select(node.id,event)} onKeyDown={event=>{
|
||||||
if(event.target!==event.currentTarget)return;
|
if(event.target!==event.currentTarget)return;
|
||||||
let next:string|undefined;
|
let next:string|undefined;
|
||||||
if(event.key==='ArrowDown')next=rows[Math.min(rows.length-1,position+1)]?.node.id;
|
if(event.key==='ArrowDown')next=rows[Math.min(rows.length-1,position+1)]?.node.id;
|
||||||
@@ -32,11 +54,12 @@ export function Tree({nodes,selected,onSelect,onVisibilityChange,label,query='',
|
|||||||
else if(event.key==='ArrowLeft'){if(open&&node.children?.length)toggle(node.id);else next=parents.get(node.id);}
|
else if(event.key==='ArrowLeft'){if(open&&node.children?.length)toggle(node.id);else next=parents.get(node.id);}
|
||||||
else if(event.key==='Enter'||event.key===' ')next=node.id;
|
else if(event.key==='Enter'||event.key===' ')next=node.id;
|
||||||
else return;
|
else return;
|
||||||
event.preventDefault();event.stopPropagation();if(next)select(next);
|
event.preventDefault();event.stopPropagation();if(next)select(next,event);
|
||||||
}}>
|
}}>
|
||||||
<span className="nodedc-tree__branch">{node.children?.length?<button type="button" tabIndex={-1} aria-label={`${open?'Свернуть':'Развернуть'} ${node.label}`} onClick={event=>{event.stopPropagation();toggle(node.id);}}><Icon name={open?'chevron-down':'chevron-right'} size={14}/></button>:null}</span>
|
<span className="nodedc-tree__branch">{node.children?.length?<button type="button" tabIndex={-1} aria-label={`${open?'Свернуть':'Развернуть'} ${node.label}`} onClick={event=>{event.stopPropagation();toggle(node.id);}}><Icon name={open?'chevron-down':'chevron-right'} size={14}/></button>:null}</span>
|
||||||
<Icon name={node.icon??(node.children?.length?'folder':'layers')} size={14}/>
|
<Icon name={node.icon??(node.children?.length?'folder':'layers')} size={14}/>
|
||||||
<span className="nodedc-tree__label">{node.label}</span>
|
<span className="nodedc-tree__label">{node.label}</span>
|
||||||
|
{renderActions&&<span className="nodedc-tree__actions" onClick={event=>event.stopPropagation()} onDoubleClick={event=>event.stopPropagation()}>{renderActions(node)}</span>}
|
||||||
{onVisibilityChange&&node.visible!==undefined&&<button type="button" className="nodedc-tree__visibility" tabIndex={focus===node.id?0:-1} aria-label={`${node.visible?'Скрыть':'Показать'} ${node.label}`} aria-pressed={node.visible} onClick={event=>{event.stopPropagation();onVisibilityChange(node.id,!node.visible);}}><Icon name={node.visible?'eye':'eye-off'} size={14}/></button>}
|
{onVisibilityChange&&node.visible!==undefined&&<button type="button" className="nodedc-tree__visibility" tabIndex={focus===node.id?0:-1} aria-label={`${node.visible?'Скрыть':'Показать'} ${node.label}`} aria-pressed={node.visible} onClick={event=>{event.stopPropagation();onVisibilityChange(node.id,!node.visible);}}><Icon name={node.visible?'eye':'eye-off'} size={14}/></button>}
|
||||||
</div>)}
|
</div>)}
|
||||||
</div>;
|
</div>;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import type { ReactNode } from "react";
|
import type { ReactNode } from "react";
|
||||||
import { Dropdown } from "./Dropdown.js";
|
import { Dropdown } from "./Dropdown.js";
|
||||||
import { HeaderAvatar } from "./AppHeader.js";
|
import { HeaderAvatar, HeaderProfile, HeaderProfileButton } from "./AppHeader.js";
|
||||||
|
import { IconButton } from "./Button.js";
|
||||||
import { Icon, type IconName } from "./Icon.js";
|
import { Icon, type IconName } from "./Icon.js";
|
||||||
|
|
||||||
export interface UserProfileMenuAction {
|
export interface UserProfileMenuAction {
|
||||||
@@ -15,19 +16,28 @@ export interface UserProfileMenuAction {
|
|||||||
|
|
||||||
export interface UserProfileMenuProps {
|
export interface UserProfileMenuProps {
|
||||||
displayName: string;
|
displayName: string;
|
||||||
|
/** Header is canonical. "default" retains the legacy compact trigger outside headers. */
|
||||||
|
variant?: "default" | "header";
|
||||||
subtitle?: string;
|
subtitle?: string;
|
||||||
avatarUrl?: string;
|
avatarUrl?: string;
|
||||||
coverImageUrl?: string;
|
coverImageUrl?: string;
|
||||||
triggerLabel?: ReactNode;
|
triggerLabel?: ReactNode;
|
||||||
|
/** Optional status glyph between the label and avatar. */
|
||||||
|
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[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export function UserProfileMenu({
|
export function UserProfileMenu({
|
||||||
displayName,
|
displayName,
|
||||||
|
variant = "header",
|
||||||
subtitle,
|
subtitle,
|
||||||
avatarUrl,
|
avatarUrl,
|
||||||
coverImageUrl,
|
coverImageUrl,
|
||||||
triggerLabel,
|
triggerLabel,
|
||||||
|
triggerIcon,
|
||||||
|
headerAction,
|
||||||
actions,
|
actions,
|
||||||
}: UserProfileMenuProps) {
|
}: UserProfileMenuProps) {
|
||||||
const label = displayName || "NODE.DC";
|
const label = displayName || "NODE.DC";
|
||||||
@@ -37,7 +47,29 @@ export function UserProfileMenu({
|
|||||||
width={296}
|
width={296}
|
||||||
offset={10}
|
offset={10}
|
||||||
surfaceClassName="nodedc-user-profile-menu"
|
surfaceClassName="nodedc-user-profile-menu"
|
||||||
trigger={({ open, toggle, setTriggerRef, surfaceId }) => (
|
trigger={({ open, toggle, setTriggerRef, setAnchorRef, surfaceId }) => variant === "header" ? (
|
||||||
|
<HeaderProfile ref={setAnchorRef}>
|
||||||
|
<HeaderProfileButton aria-haspopup="menu" aria-expanded={open} aria-controls={surfaceId} onClick={(event) => { setTriggerRef(event.currentTarget); toggle(); }}>
|
||||||
|
{triggerLabel ?? "Профиль"}
|
||||||
|
</HeaderProfileButton>
|
||||||
|
<IconButton
|
||||||
|
ref={setTriggerRef}
|
||||||
|
label={headerAction?.label ?? `Меню пользователя ${label}`}
|
||||||
|
aria-haspopup={headerAction ? undefined : "menu"}
|
||||||
|
aria-pressed={headerAction?.pressed}
|
||||||
|
aria-expanded={headerAction ? headerAction.pressed : open}
|
||||||
|
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>
|
||||||
|
<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(); }}>
|
||||||
|
<HeaderAvatar label={label} imageUrl={avatarUrl} />
|
||||||
|
</button>
|
||||||
|
</HeaderProfile>
|
||||||
|
) : (
|
||||||
<button
|
<button
|
||||||
ref={setTriggerRef}
|
ref={setTriggerRef}
|
||||||
type="button"
|
type="button"
|
||||||
@@ -49,6 +81,7 @@ export function UserProfileMenu({
|
|||||||
onClick={toggle}
|
onClick={toggle}
|
||||||
>
|
>
|
||||||
{triggerLabel === null ? null : <span className="nodedc-user-profile-menu__trigger-label">{triggerLabel ?? label}</span>}
|
{triggerLabel === null ? null : <span className="nodedc-user-profile-menu__trigger-label">{triggerLabel ?? label}</span>}
|
||||||
|
{triggerIcon ? <Icon name={triggerIcon} size={18} /> : null}
|
||||||
<HeaderAvatar label={label} imageUrl={avatarUrl} />
|
<HeaderAvatar label={label} imageUrl={avatarUrl} />
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
|
import {dragHandleFocus} from './dragHandleFocus.js';
|
||||||
import {
|
import {
|
||||||
|
useCallback,
|
||||||
useEffect,
|
useEffect,
|
||||||
useId,
|
useId,
|
||||||
useLayoutEffect,
|
useLayoutEffect,
|
||||||
@@ -11,6 +13,7 @@ import {
|
|||||||
import { createPortal } from "react-dom";
|
import { createPortal } from "react-dom";
|
||||||
import { InspectorSelectPolicyContext } from "./InspectorContext.js";
|
import { InspectorSelectPolicyContext } from "./InspectorContext.js";
|
||||||
import { LoadingContext } from "./LoadingContext.js";
|
import { LoadingContext } from "./LoadingContext.js";
|
||||||
|
import { WindowSuspensionContext } from "./WindowSuspensionContext.js";
|
||||||
import { cn } from "./cn.js";
|
import { cn } from "./cn.js";
|
||||||
import { Icon } from "./Icon.js";
|
import { Icon } from "./Icon.js";
|
||||||
import { IconButton } from "./Button.js";
|
import { IconButton } from "./Button.js";
|
||||||
@@ -37,6 +40,15 @@ 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. */
|
||||||
|
headerActionsPlacement?: "before-move" | "before-close";
|
||||||
size?: WindowSize;
|
size?: WindowSize;
|
||||||
placement?: WindowPlacement;
|
placement?: WindowPlacement;
|
||||||
closeLabel?: string;
|
closeLabel?: string;
|
||||||
@@ -54,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,6 +79,11 @@ export function Window({
|
|||||||
children,
|
children,
|
||||||
footer,
|
footer,
|
||||||
headerActions,
|
headerActions,
|
||||||
|
headerLayout = "inline",
|
||||||
|
expanded = false,
|
||||||
|
expandedRect,
|
||||||
|
onExpandedRectCommit,
|
||||||
|
headerActionsPlacement = "before-move",
|
||||||
size = "md",
|
size = "md",
|
||||||
placement = "center",
|
placement = "center",
|
||||||
closeLabel = "Закрыть",
|
closeLabel = "Закрыть",
|
||||||
@@ -77,14 +97,23 @@ export function Window({
|
|||||||
rect,
|
rect,
|
||||||
onRectCommit,
|
onRectCommit,
|
||||||
allowFloating = true,
|
allowFloating = true,
|
||||||
|
floating: controlledFloating,
|
||||||
|
onFloatingChange,
|
||||||
onClose,
|
onClose,
|
||||||
className,
|
className,
|
||||||
style,
|
style,
|
||||||
...props
|
...props
|
||||||
}: WindowProps) {
|
}: WindowProps) {
|
||||||
|
const [suspensions, setSuspensions] = useState(0);
|
||||||
|
const suspend = useCallback(() => {setSuspensions(value => value + 1); return () => setSuspensions(value => Math.max(0, value - 1));}, []);
|
||||||
|
const suspended = suspensions > 0;
|
||||||
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 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);
|
||||||
const [dragPosition, setDragPosition] = useState<{ left: number; top: number } | null>(null);
|
const [dragPosition, setDragPosition] = useState<{ left: number; top: number } | null>(null);
|
||||||
@@ -92,20 +121,47 @@ 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 = !isFloating && (lockBodyScroll ?? placement === "center");
|
const shouldLockBodyScroll = !suspended && !isFloating && (lockBodyScroll ?? placement === "center");
|
||||||
const shouldTrapFocus = !isFloating && (trapFocus ?? placement === "center");
|
const shouldTrapFocus = !suspended && !isFloating && (trapFocus ?? placement === "center");
|
||||||
const modeRef = useRef({ shouldTrapFocus, isFloating });
|
const modeRef = useRef({ shouldTrapFocus, isFloating, suspended });
|
||||||
modeRef.current = { shouldTrapFocus, isFloating };
|
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;
|
||||||
@@ -116,14 +172,26 @@ export function Window({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const handleKeyDown = (event: KeyboardEvent) => {
|
const handleKeyDown = (event: KeyboardEvent) => {
|
||||||
if (event.defaultPrevented) return;
|
if (event.defaultPrevented || modeRef.current.suspended) return;
|
||||||
|
// Portalled child dialogs own their Escape/Tab keys. A parent listener
|
||||||
|
// can run first, so event.defaultPrevented alone cannot guard nesting.
|
||||||
|
const focusedDialog = document.activeElement?.closest('[role="dialog"]');
|
||||||
|
if (focusedDialog && focusedDialog !== dialogRef.current) return;
|
||||||
|
if (!focusedDialog) {
|
||||||
|
const topModal = Array.from(document.querySelectorAll<HTMLElement>('[role="dialog"][aria-modal="true"]')).filter(dialog => dialog.getClientRects().length > 0).at(-1);
|
||||||
|
if (topModal && topModal !== dialogRef.current) return;
|
||||||
|
}
|
||||||
|
const ownedFullscreen = document.fullscreenElement && dialogRef.current?.contains(document.fullscreenElement);
|
||||||
|
// Escape restores the embedded viewport, never closes its owning form.
|
||||||
|
if (event.key === "Escape" && ownedFullscreen) return;
|
||||||
if (event.key === "Escape" && closeOnEscape && (!modeRef.current.isFloating || dialogRef.current?.contains(document.activeElement))) {
|
if (event.key === "Escape" && closeOnEscape && (!modeRef.current.isFloating || dialogRef.current?.contains(document.activeElement))) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
onCloseRef.current();
|
onCloseRef.current();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (event.key !== "Tab" || !modeRef.current.shouldTrapFocus || !dialogRef.current) return;
|
if (event.key !== "Tab" || !modeRef.current.shouldTrapFocus || !dialogRef.current) return;
|
||||||
const focusable = Array.from(dialogRef.current.querySelectorAll<HTMLElement>(focusableSelector)).filter(element => element.getClientRects().length > 0);
|
const focusScope = ownedFullscreen ? document.fullscreenElement! : dialogRef.current;
|
||||||
|
const focusable = Array.from(focusScope.querySelectorAll<HTMLElement>(focusableSelector)).filter(element => element.getClientRects().length > 0);
|
||||||
if (focusable.length === 0) {
|
if (focusable.length === 0) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
dialogRef.current.focus();
|
dialogRef.current.focus();
|
||||||
@@ -156,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(() => {
|
||||||
@@ -178,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;
|
||||||
@@ -187,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));
|
||||||
@@ -212,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;
|
||||||
|
|
||||||
@@ -225,13 +312,24 @@ export function Window({
|
|||||||
if (allowBackdropClose && event.target === event.currentTarget) onClose();
|
if (allowBackdropClose && event.target === event.currentTarget) onClose();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Keep an owning window in its existing portal while its child is fullscreen.
|
||||||
|
// Reparenting it into that child would form a DOM cycle and remount the renderer.
|
||||||
|
const fullscreen = document.fullscreenElement;
|
||||||
|
if (!portalHostRef.current || !fullscreen || !dialogRef.current?.contains(fullscreen)) {
|
||||||
|
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}>
|
||||||
<div className="nodedc-overlay nodedc-ui-root" 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-size={size === "md" ? undefined : size}
|
data-size={size === "md" ? undefined : size}
|
||||||
data-placement={placement}
|
data-placement={placement}
|
||||||
data-draggable={canDrag ? "true" : undefined}
|
data-draggable={canDrag ? "true" : undefined}
|
||||||
@@ -242,10 +340,11 @@ 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
|
||||||
|
{...dragHandleFocus}
|
||||||
className="nodedc-window__head"
|
className="nodedc-window__head"
|
||||||
tabIndex={freeGeometry ? 0 : undefined}
|
tabIndex={freeGeometry ? 0 : undefined}
|
||||||
aria-label={freeGeometry ? "Перемещение окна: стрелки; изменение размера: Shift и стрелки" : undefined}
|
aria-label={freeGeometry ? "Перемещение окна: стрелки; изменение размера: Shift и стрелки" : undefined}
|
||||||
@@ -255,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) => {
|
||||||
@@ -273,15 +372,18 @@ export function Window({
|
|||||||
{subtitle ? <p id={descriptionId} className="nodedc-window__subtitle">{subtitle}</p> : null}
|
{subtitle ? <p id={descriptionId} className="nodedc-window__subtitle">{subtitle}</p> : null}
|
||||||
</div>
|
</div>
|
||||||
<div className="nodedc-window__actions">
|
<div className="nodedc-window__actions">
|
||||||
{headerActions}
|
{headerActionsPlacement === "before-move" && headerActions}
|
||||||
{allowFloating && placement === "center" && <IconButton label={isFloating ? "Вернуть модальный режим" : "Свободное окно"} aria-pressed={isFloating} onClick={() => {
|
{allowFloating && placement === "center" && <IconButton label={isFloating ? "Вернуть модальный режим" : "Свободное окно"} aria-pressed={isFloating} onClick={() => {
|
||||||
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}
|
||||||
<button type="button" className="nodedc-window__close" aria-label={closeLabel} onClick={onClose}>
|
<button type="button" className="nodedc-window__close" aria-label={closeLabel} onClick={onClose}>
|
||||||
<Icon name="close" size={16} strokeWidth={1.6} />
|
<Icon name="close" size={16} strokeWidth={1.6} />
|
||||||
</button>
|
</button>
|
||||||
@@ -298,8 +400,8 @@ export function Window({
|
|||||||
{footer ? <footer className="nodedc-window__footer">{footer}</footer> : null}
|
{footer ? <footer className="nodedc-window__footer">{footer}</footer> : null}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</InspectorSelectPolicyContext.Provider></LoadingContext.Provider>,
|
</WindowSuspensionContext.Provider></InspectorSelectPolicyContext.Provider></LoadingContext.Provider>,
|
||||||
document.fullscreenElement ?? document.body,
|
portalHostRef.current,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
import {createContext} from 'react';
|
||||||
|
/** A detached editor hides its owning window without unmounting its contents. */
|
||||||
|
export const WindowSuspensionContext=createContext<null|(()=>()=>void)>(null);
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import {dragHandleFocus} from './dragHandleFocus.js';
|
||||||
import {
|
import {
|
||||||
useEffect,
|
useEffect,
|
||||||
useId,
|
useId,
|
||||||
@@ -397,6 +398,7 @@ export function WorkspaceWindow({
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<header
|
<header
|
||||||
|
{...dragHandleFocus}
|
||||||
ref={headRef}
|
ref={headRef}
|
||||||
className="nodedc-workspace-window__head"
|
className="nodedc-workspace-window__head"
|
||||||
tabIndex={maximized ? -1 : 0}
|
tabIndex={maximized ? -1 : 0}
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
import type {FocusEvent, KeyboardEvent, PointerEvent} from 'react';
|
||||||
|
|
||||||
|
/** A pointer grab must not inherit the previous input's keyboard focus ring. */
|
||||||
|
export const dragHandleFocus = {
|
||||||
|
onPointerDownCapture(event: PointerEvent<HTMLElement>) {
|
||||||
|
if (event.button !== 0 || (event.target as HTMLElement).closest('button,input,select,textarea,a,[role=slider]')) return;
|
||||||
|
event.currentTarget.dataset.pointerFocus = 'true';
|
||||||
|
},
|
||||||
|
onKeyDownCapture(event: KeyboardEvent<HTMLElement>) {
|
||||||
|
if (event.target === event.currentTarget) delete event.currentTarget.dataset.pointerFocus;
|
||||||
|
},
|
||||||
|
onBlur(event: FocusEvent<HTMLElement>) {
|
||||||
|
if (event.target === event.currentTarget) delete event.currentTarget.dataset.pointerFocus;
|
||||||
|
},
|
||||||
|
};
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import type {DockRect} from '@nodedc/ui-core';
|
||||||
|
/** Only corners on both outer edges are rounded; all internal seams stay square. */
|
||||||
|
export function editorDockCorners(rect:DockRect,area:DockRect):string {
|
||||||
|
const same=(a:number,b:number)=>Math.abs(a-b)<.01;
|
||||||
|
const left=same(rect.left,area.left),top=same(rect.top,area.top);
|
||||||
|
const right=same(rect.left+rect.width,area.left+area.width),bottom=same(rect.top+rect.height,area.top+area.height);
|
||||||
|
return [top&&left?'top-left':'',top&&right?'top-right':'',bottom&&right?'bottom-right':'',bottom&&left?'bottom-left':''].filter(Boolean).join(' ');
|
||||||
|
}
|
||||||
@@ -48,9 +48,15 @@ export {KeyButton, type KeyButtonProps} from './KeyButton.js';
|
|||||||
|
|
||||||
export type {DockMinimum, DockMinimums} from "@nodedc/ui-core";
|
export type {DockMinimum, DockMinimums} from "@nodedc/ui-core";
|
||||||
|
|
||||||
export {Tree,type TreeNode,type TreeProps} from "./Tree.js";
|
export {Tree,type TreeNode,type TreeProps,type TreeSelectionGesture} from "./Tree.js";
|
||||||
|
|
||||||
export * from "./ResizableViewport.js";
|
export * from "./ResizableViewport.js";
|
||||||
export {useApplicationPanelFullscreen} from "./ApplicationPanelFullscreen.js";
|
export {useApplicationPanelFullscreen} from "./ApplicationPanelFullscreen.js";
|
||||||
|
|
||||||
export {SceneAnnotation} from "./SceneAnnotation.js";
|
export {SceneAnnotation} from "./SceneAnnotation.js";
|
||||||
|
|
||||||
|
export {LevelButton,type LevelButtonProps} from "./LevelButton.js";
|
||||||
|
|
||||||
|
export {Tooltip,type TooltipProps} from "./Tooltip.js";
|
||||||
|
|
||||||
|
export {TooltipProvider} from "./TooltipProvider.js";
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
import type {CSSProperties} from 'react';
|
||||||
|
export type LevelButtonGeometry={width:number;height:number;radius?:number};
|
||||||
|
/** Keep type and padding proportional when the operator chooses a tiny indicator. */
|
||||||
|
export function levelButtonGeometry(value:LevelButtonGeometry|undefined,characters:number):CSSProperties{
|
||||||
|
if(!value)return {};
|
||||||
|
const bounded=(n:number|undefined,fallback:number,min:number,max:number)=>typeof n==='number'&&Number.isFinite(n)?Math.max(min,Math.min(max,n)):fallback;
|
||||||
|
const width=bounded(value.width,115,32,4096),height=bounded(value.height,46,12,1024),radius=bounded(value.radius,999,0,4096);
|
||||||
|
const scale=Math.min(1,height/24,width/Math.max(64,(characters+2)*8));
|
||||||
|
return {width,minWidth:width,height,minHeight:height,borderRadius:radius,flexShrink:0,fontSize:`calc(var(--nodedc-font-size-md) * ${scale})`,lineHeight:1,padding:`calc(0.25rem * ${scale}) calc(var(--nodedc-space-2) * ${scale})`};
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
/** Screen sampling requires a secure context and an explicit trusted click. No screenshots are retained. */
|
||||||
|
export type ScreenColorPicker = new () => { open(options: { signal: AbortSignal }): Promise<{ sRGBHex: string }> };
|
||||||
|
export function screenColorPicker(): ScreenColorPicker | undefined {
|
||||||
|
return (globalThis as typeof globalThis & { EyeDropper?: ScreenColorPicker }).EyeDropper;
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
/** Suppress native tooltips only during interaction; preserve changing titles and ARIA. */
|
||||||
|
export class TooltipTitles {
|
||||||
|
private titles=new Map<Element,string>();
|
||||||
|
private description:{element:Element;id:string;label?:string}|null=null;
|
||||||
|
text(element:Element){return element.getAttribute('data-nodedc-tooltip')??this.titles.get(element)??element.getAttribute('title');}
|
||||||
|
find(start:Element){for(let element:Element|null=start;element;element=element.parentElement){const text=element.getAttribute('data-nodedc-tooltip')??element.getAttribute('title');if(text!==null)return text.trim()?{element,text}:null;}return null;}
|
||||||
|
suppress(start:Element){for(let element:Element|null=start;element;element=element.parentElement){const text=element.getAttribute('title');if(text!==null){this.titles.set(element,text);element.removeAttribute('title');}}}
|
||||||
|
describe(element:Element,id:string){
|
||||||
|
const ids=new Set((element.getAttribute('aria-describedby')??'').split(/\s+/).filter(Boolean));ids.add(id);element.setAttribute('aria-describedby',[...ids].join(' '));
|
||||||
|
let label=this.description?.label;
|
||||||
|
if(!element.hasAttribute('aria-label')&&!element.hasAttribute('aria-labelledby')&&!element.textContent?.trim()){
|
||||||
|
label=this.text(element)??undefined;if(label)element.setAttribute('aria-label',label);
|
||||||
|
}
|
||||||
|
this.description={element,id,label};
|
||||||
|
}
|
||||||
|
restore(){
|
||||||
|
for(const [element,text] of this.titles)if(!element.hasAttribute('title'))element.setAttribute('title',text);this.titles.clear();
|
||||||
|
if(this.description){const {element,id,label}=this.description;const ids=(element.getAttribute('aria-describedby')??'').split(/\s+/).filter(value=>value&&value!==id);if(ids.length)element.setAttribute('aria-describedby',ids.join(' '));else element.removeAttribute('aria-describedby');if(label&&element.getAttribute('aria-label')===label)element.removeAttribute('aria-label');this.description=null;}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
/** Range follows displayed rows only; folded/filtered-out branches cannot leak in. */
|
||||||
|
export function treeSelectionRange(rows:readonly string[],anchor:string|null,target:string):string[]{
|
||||||
|
const a=rows.indexOf(anchor??target),b=rows.indexOf(target);
|
||||||
|
return a<0||b<0?[target]:rows.slice(Math.min(a,b),Math.max(a,b)+1);
|
||||||
|
}
|
||||||
@@ -3,15 +3,16 @@ export type WindowRect = { left: number; top: number; width: number; height: num
|
|||||||
export type ResizeEdge = 'n' | 's' | 'e' | 'w' | 'ne' | 'nw' | 'se' | 'sw';
|
export type ResizeEdge = 'n' | 's' | 'e' | 'w' | 'ne' | 'nw' | 'se' | 'sw';
|
||||||
export const windowResizeEdges: ResizeEdge[] = ['n', 's', 'e', 'w', 'ne', 'nw', 'se', 'sw'];
|
export const windowResizeEdges: ResizeEdge[] = ['n', 's', 'e', 'w', 'ne', 'nw', 'se', 'sw'];
|
||||||
type Bounds = { width: number; height: number };
|
type Bounds = { width: number; height: number };
|
||||||
|
const defaultMinimum: Bounds = { width: 320, height: 200 };
|
||||||
const clamp = (value: number, min: number, max: number) => Math.max(min, Math.min(max, value));
|
const clamp = (value: number, min: number, max: number) => Math.max(min, Math.min(max, value));
|
||||||
export function fitWindow(rect: WindowRect, bounds: Bounds): WindowRect {
|
export function fitWindow(rect: WindowRect, bounds: Bounds, minimum: Bounds = defaultMinimum): WindowRect {
|
||||||
const width = clamp(rect.width, Math.min(320, bounds.width - 16), Math.max(1, bounds.width - 16));
|
const width = clamp(rect.width, Math.max(1, Math.min(minimum.width, bounds.width - 16)), Math.max(1, bounds.width - 16));
|
||||||
const height = clamp(rect.height, Math.min(200, bounds.height - 16), Math.max(1, bounds.height - 16));
|
const height = clamp(rect.height, Math.max(1, Math.min(minimum.height, bounds.height - 16)), Math.max(1, bounds.height - 16));
|
||||||
return { width, height, left: clamp(rect.left, 8, Math.max(8, bounds.width - width - 8)), top: clamp(rect.top, 8, Math.max(8, bounds.height - height - 8)) };
|
return { width, height, left: clamp(rect.left, 8, Math.max(8, bounds.width - width - 8)), top: clamp(rect.top, 8, Math.max(8, bounds.height - height - 8)) };
|
||||||
}
|
}
|
||||||
export function resizeWindow(rect: WindowRect, edge: ResizeEdge, dx: number, dy: number, bounds: Bounds): WindowRect {
|
export function resizeWindow(rect: WindowRect, edge: ResizeEdge, dx: number, dy: number, bounds: Bounds, minimum: Bounds = defaultMinimum): WindowRect {
|
||||||
const r = fitWindow(rect, bounds), right = r.left + r.width, bottom = r.top + r.height;
|
const r = fitWindow(rect, bounds, minimum), right = r.left + r.width, bottom = r.top + r.height;
|
||||||
const minWidth = Math.min(320, bounds.width - 16), minHeight = Math.min(200, bounds.height - 16);
|
const minWidth = Math.max(1, Math.min(minimum.width, bounds.width - 16)), minHeight = Math.max(1, Math.min(minimum.height, bounds.height - 16));
|
||||||
const left = edge.includes('w') ? clamp(r.left + dx, 8, right - minWidth) : r.left;
|
const left = edge.includes('w') ? clamp(r.left + dx, 8, right - minWidth) : r.left;
|
||||||
const top = edge.includes('n') ? clamp(r.top + dy, 8, bottom - minHeight) : r.top;
|
const top = edge.includes('n') ? clamp(r.top + dy, 8, bottom - minHeight) : r.top;
|
||||||
const endX = edge.includes('e') ? clamp(right + dx, left + minWidth, bounds.width - 8) : right;
|
const endX = edge.includes('e') ? clamp(right + dx, left + minWidth, bounds.width - 8) : right;
|
||||||
|
|||||||
+121
-34
@@ -6,90 +6,177 @@
|
|||||||
"id": "calendar-popover",
|
"id": "calendar-popover",
|
||||||
"classification": "planned-primitive",
|
"classification": "planned-primitive",
|
||||||
"priority": "P1",
|
"priority": "P1",
|
||||||
"referenceSources": ["launcher", "task-manager"],
|
"referenceSources": [
|
||||||
|
"launcher",
|
||||||
|
"task-manager"
|
||||||
|
],
|
||||||
"expectedPackage": "@nodedc/ui-react",
|
"expectedPackage": "@nodedc/ui-react",
|
||||||
"dependsOn": ["dropdown", "button", "field"],
|
"dependsOn": [
|
||||||
"requiredBehavior": ["portal", "locale-aware labels", "single date", "date range", "keyboard navigation"],
|
"dropdown",
|
||||||
|
"button",
|
||||||
|
"field"
|
||||||
|
],
|
||||||
|
"requiredBehavior": [
|
||||||
|
"portal",
|
||||||
|
"locale-aware labels",
|
||||||
|
"single date",
|
||||||
|
"date range",
|
||||||
|
"keyboard navigation"
|
||||||
|
],
|
||||||
"reasonNotBaseline": "Current Launcher and Task Manager implementations must be reconciled before one API is declared canonical."
|
"reasonNotBaseline": "Current Launcher and Task Manager implementations must be reconciled before one API is declared canonical."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "profile-menu",
|
"id": "profile-menu",
|
||||||
"classification": "planned-pattern",
|
"classification": "planned-pattern",
|
||||||
"priority": "P1",
|
"priority": "P1",
|
||||||
"referenceSources": ["launcher", "task-manager"],
|
"referenceSources": [
|
||||||
|
"launcher",
|
||||||
|
"task-manager"
|
||||||
|
],
|
||||||
"expectedPackage": "@nodedc/ui-react",
|
"expectedPackage": "@nodedc/ui-react",
|
||||||
"dependsOn": ["dropdown", "button", "status-badge"],
|
"dependsOn": [
|
||||||
"requiredBehavior": ["avatar trigger", "identity summary", "role/workspace switch", "logout action"],
|
"dropdown",
|
||||||
|
"button",
|
||||||
|
"status-badge"
|
||||||
|
],
|
||||||
|
"requiredBehavior": [
|
||||||
|
"avatar trigger",
|
||||||
|
"identity summary",
|
||||||
|
"role/workspace switch",
|
||||||
|
"logout action"
|
||||||
|
],
|
||||||
"reasonNotBaseline": "Identity and role data contracts differ between Hub and Ops and must remain application-owned."
|
"reasonNotBaseline": "Identity and role data contracts differ between Hub and Ops and must remain application-owned."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "action-dropdown",
|
"id": "action-dropdown",
|
||||||
"classification": "planned-pattern",
|
"classification": "planned-pattern",
|
||||||
"priority": "P1",
|
"priority": "P1",
|
||||||
"referenceSources": ["task-manager", "launcher"],
|
"referenceSources": [
|
||||||
|
"task-manager",
|
||||||
|
"launcher"
|
||||||
|
],
|
||||||
"expectedPackage": "@nodedc/ui-react",
|
"expectedPackage": "@nodedc/ui-react",
|
||||||
"dependsOn": ["dropdown"],
|
"dependsOn": [
|
||||||
"requiredBehavior": ["commands", "disabled rows", "danger row", "optional groups", "keyboard navigation"],
|
"dropdown"
|
||||||
|
],
|
||||||
|
"requiredBehavior": [
|
||||||
|
"commands",
|
||||||
|
"disabled rows",
|
||||||
|
"danger row",
|
||||||
|
"optional groups",
|
||||||
|
"keyboard navigation"
|
||||||
|
],
|
||||||
"reasonNotBaseline": "Floating behavior is stable; command-row API still needs validation against Ops consumers."
|
"reasonNotBaseline": "Floating behavior is stable; command-row API still needs validation against Ops consumers."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "data-table",
|
"id": "data-table",
|
||||||
"classification": "planned-pattern",
|
"classification": "planned-pattern",
|
||||||
"priority": "P1",
|
"priority": "P1",
|
||||||
"referenceSources": ["launcher", "task-manager"],
|
"referenceSources": [
|
||||||
|
"launcher",
|
||||||
|
"task-manager"
|
||||||
|
],
|
||||||
"expectedPackage": "@nodedc/ui-react",
|
"expectedPackage": "@nodedc/ui-react",
|
||||||
"dependsOn": ["button", "select", "status-badge", "field"],
|
"dependsOn": [
|
||||||
"requiredBehavior": ["toolbar", "responsive overflow", "row actions", "editable cells", "loading", "empty state"],
|
"button",
|
||||||
|
"select",
|
||||||
|
"status-badge",
|
||||||
|
"field"
|
||||||
|
],
|
||||||
|
"requiredBehavior": [
|
||||||
|
"toolbar",
|
||||||
|
"responsive overflow",
|
||||||
|
"row actions",
|
||||||
|
"editable cells",
|
||||||
|
"loading",
|
||||||
|
"empty state"
|
||||||
|
],
|
||||||
"reasonNotBaseline": "The library should own presentation and interaction slots, not adopt Launcher entity schemas or Plane table models."
|
"reasonNotBaseline": "The library should own presentation and interaction slots, not adopt Launcher entity schemas or Plane table models."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "avatar-stack",
|
"id": "avatar-stack",
|
||||||
"classification": "planned-primitive",
|
"classification": "planned-primitive",
|
||||||
"priority": "P1",
|
"priority": "P1",
|
||||||
"referenceSources": ["engine", "task-manager"],
|
"referenceSources": [
|
||||||
|
"engine",
|
||||||
|
"task-manager"
|
||||||
|
],
|
||||||
"expectedPackage": "@nodedc/ui-react",
|
"expectedPackage": "@nodedc/ui-react",
|
||||||
"dependsOn": ["dropdown"],
|
"dependsOn": [
|
||||||
"requiredBehavior": ["overflow count", "presence", "picker mode", "fallback initials"],
|
"dropdown"
|
||||||
|
],
|
||||||
|
"requiredBehavior": [
|
||||||
|
"overflow count",
|
||||||
|
"presence",
|
||||||
|
"picker mode",
|
||||||
|
"fallback initials"
|
||||||
|
],
|
||||||
"reasonNotBaseline": "Engine picker behavior and Task Manager presence semantics must not be coupled accidentally."
|
"reasonNotBaseline": "Engine picker behavior and Task Manager presence semantics must not be coupled accidentally."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "service-rail-card",
|
"id": "service-rail-card",
|
||||||
"classification": "product-pattern",
|
"classification": "product-pattern",
|
||||||
"priority": "P2",
|
"priority": "P2",
|
||||||
"referenceSources": ["launcher"],
|
"referenceSources": [
|
||||||
|
"launcher"
|
||||||
|
],
|
||||||
"expectedPackage": "@nodedc/ui-react",
|
"expectedPackage": "@nodedc/ui-react",
|
||||||
"dependsOn": ["glass-surface", "status-badge", "button"],
|
"dependsOn": [
|
||||||
"requiredBehavior": ["ambient media", "access status", "selected state", "open/request action"],
|
"glass-surface",
|
||||||
|
"status-badge",
|
||||||
|
"button"
|
||||||
|
],
|
||||||
|
"requiredBehavior": [
|
||||||
|
"ambient media",
|
||||||
|
"access status",
|
||||||
|
"selected state",
|
||||||
|
"open/request action"
|
||||||
|
],
|
||||||
"reasonNotBaseline": "Likely reusable for product catalogs, but current contract is tightly connected to Launcher service data."
|
"reasonNotBaseline": "Likely reusable for product catalogs, but current contract is tightly connected to Launcher service data."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "work-item-card",
|
"id": "work-item-card",
|
||||||
"classification": "product-pattern",
|
"classification": "product-pattern",
|
||||||
"priority": "P2",
|
"priority": "P2",
|
||||||
"referenceSources": ["task-manager"],
|
"referenceSources": [
|
||||||
|
"task-manager"
|
||||||
|
],
|
||||||
"expectedPackage": "@nodedc/ui-react",
|
"expectedPackage": "@nodedc/ui-react",
|
||||||
"dependsOn": ["glass-surface", "avatar-stack", "status-badge", "action-dropdown"],
|
"dependsOn": [
|
||||||
"requiredBehavior": ["selected state", "drag state", "assignees", "dates", "quick actions"],
|
"glass-surface",
|
||||||
|
"avatar-stack",
|
||||||
|
"status-badge",
|
||||||
|
"action-dropdown"
|
||||||
|
],
|
||||||
|
"requiredBehavior": [
|
||||||
|
"selected state",
|
||||||
|
"drag state",
|
||||||
|
"assignees",
|
||||||
|
"dates",
|
||||||
|
"quick actions"
|
||||||
|
],
|
||||||
"reasonNotBaseline": "The visual pattern is mature, but task-domain fields must be separated from the reusable card shell."
|
"reasonNotBaseline": "The visual pattern is mature, but task-domain fields must be separated from the reusable card shell."
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"id": "tooltip",
|
|
||||||
"classification": "missing-primitive",
|
|
||||||
"priority": "P2",
|
|
||||||
"referenceSources": ["launcher", "task-manager", "engine"],
|
|
||||||
"expectedPackage": "@nodedc/ui-react",
|
|
||||||
"dependsOn": ["dropdown"],
|
|
||||||
"requiredBehavior": ["hover", "focus", "delay", "viewport placement"],
|
|
||||||
"reasonNotBaseline": "Needs a small dedicated accessibility contract rather than reuse of an application tooltip."
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"id": "empty-loading-error",
|
"id": "empty-loading-error",
|
||||||
"classification": "planned-pattern",
|
"classification": "planned-pattern",
|
||||||
"priority": "P2",
|
"priority": "P2",
|
||||||
"referenceSources": ["launcher", "seo", "task-manager"],
|
"referenceSources": [
|
||||||
|
"launcher",
|
||||||
|
"seo",
|
||||||
|
"task-manager"
|
||||||
|
],
|
||||||
"expectedPackage": "@nodedc/ui-react",
|
"expectedPackage": "@nodedc/ui-react",
|
||||||
"dependsOn": ["button", "status-badge"],
|
"dependsOn": [
|
||||||
"requiredBehavior": ["empty message", "retry", "loading progress", "fatal error"],
|
"button",
|
||||||
|
"status-badge"
|
||||||
|
],
|
||||||
|
"requiredBehavior": [
|
||||||
|
"empty message",
|
||||||
|
"retry",
|
||||||
|
"loading progress",
|
||||||
|
"fatal error"
|
||||||
|
],
|
||||||
"reasonNotBaseline": "Copy and domain actions vary; the layout contract still needs examples from all product families."
|
"reasonNotBaseline": "Copy and domain actions vary; the layout contract still needs examples from all product families."
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
+192
-38
@@ -1,6 +1,28 @@
|
|||||||
{
|
{
|
||||||
"schemaVersion": "1.0.0",
|
"schemaVersion": "1.0.0",
|
||||||
"components": [
|
"components": [
|
||||||
|
{
|
||||||
|
"id": "mission-theme",
|
||||||
|
"status": "baseline",
|
||||||
|
"package": "@nodedc/ui-core",
|
||||||
|
"exports": [
|
||||||
|
"applyNodedcTheme",
|
||||||
|
"missionDarkTheme",
|
||||||
|
"missionLightTheme"
|
||||||
|
],
|
||||||
|
"domContract": [
|
||||||
|
"data-nodedc-theme",
|
||||||
|
"data-nodedc-appearance",
|
||||||
|
"data-nodedc-edges"
|
||||||
|
],
|
||||||
|
"summary": "Canonical Mission Core theme foundation shared by React, DOM and body portals.",
|
||||||
|
"rules": [
|
||||||
|
"Colors belong to tokens/themes.css; applications select a preset and may provide an explicit user accent.",
|
||||||
|
"ApplicationPanel → SettingsCard → fields matches Mission Core forms. Collection entries may use GlassSurface tone=group; never wrap field grids in recessed soft surfaces or add a card around a list of cards.",
|
||||||
|
"No decorative outlines; keyboard focus, disabled states and semantic error/success indicators remain visible."
|
||||||
|
],
|
||||||
|
"documentation": "../docs/THEMING.md"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "progress-button",
|
"id": "progress-button",
|
||||||
"status": "baseline",
|
"status": "baseline",
|
||||||
@@ -83,7 +105,8 @@
|
|||||||
"nodedc-glass",
|
"nodedc-glass",
|
||||||
"nodedc-glass-material",
|
"nodedc-glass-material",
|
||||||
"nodedc-map-glass",
|
"nodedc-map-glass",
|
||||||
"nodedc-material-rim"
|
"nodedc-material-rim",
|
||||||
|
"nodedc-viewport-surface"
|
||||||
],
|
],
|
||||||
"summary": "Matte application surfaces, the Engine V4 modal material and the light translucent surface used over Cesium imagery. Scene overlays reuse V4 blur and tint with independent translucent density.",
|
"summary": "Matte application surfaces, the Engine V4 modal material and the light translucent surface used over Cesium imagery. Scene overlays reuse V4 blur and tint with independent translucent density.",
|
||||||
"anatomy": [
|
"anatomy": [
|
||||||
@@ -109,12 +132,14 @@
|
|||||||
],
|
],
|
||||||
"rules": [
|
"rules": [
|
||||||
"Geometry is invariant across application themes.",
|
"Geometry is invariant across application themes.",
|
||||||
"Opt-in appearance=mission applies the qualified Mission Core operator surfaces, avatars and dot statuses across portals without changing geometry.",
|
"The default Mission Core foundation supplies surfaces, avatars and dot statuses across portals without changing geometry.",
|
||||||
"Compact rails of canonical round actions use the pill radius; consumers do not recreate it with a local border radius.",
|
"Compact rails of canonical round actions use the pill radius; consumers do not recreate it with a local border radius.",
|
||||||
"A material rim is a glass highlight, not a hard product-colored border.",
|
"A material rim is a glass highlight, not a hard product-colored border.",
|
||||||
"Nested surfaces must use a softer tone to avoid card-inside-card noise.",
|
"Form collections use tone=group, the same neutral material as SettingsCard. tone=soft is a recessed secondary canvas, never a form-grid background.",
|
||||||
"GlassMaterialSurface supports modal/Inspector floating material and explicit context=scene telemetry overlays over rendered imagery; ordinary panels remain matte. Optional material and radiusPx apply appearance to one instance without changing the global theme.",
|
"GlassMaterialSurface supports modal/Inspector floating material and explicit context=scene telemetry overlays over rendered imagery; ordinary panels remain matte. Optional material and radiusPx apply appearance to one instance without changing the global theme.",
|
||||||
"MapGlassSurface is restricted to overlays over Cesium/map imagery and must match the map Toolbar translucency."
|
"MapGlassSurface is restricted to overlays over Cesium/map imagery and must match the map Toolbar translucency.",
|
||||||
|
"Theme edges=flat removes decorative rims and active outlines across portals; keyboard focus uses contrasting fill without changing geometry.",
|
||||||
|
"Owner 2026-11-14: all backed UI inside every map/3D/camera/replay viewport uses scene Glass V4, independent of renderer. Use GlassMaterialSurface context=scene or nodedc-viewport-surface for an existing semantic overlay. Never tint the renderer itself. See docs/VIEWPORT_UI.md."
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -151,13 +176,16 @@
|
|||||||
],
|
],
|
||||||
"rules": [
|
"rules": [
|
||||||
"Icon-only actions are circular by default.",
|
"Icon-only actions are circular by default.",
|
||||||
|
"IconButton surface=none keeps the normal hit target and focus while removing the disc. Favorite stars use outline/filled glyph states; see docs/FAVORITES.md.",
|
||||||
"Groups over rendered imagery use nodedc-scene-controls: Button, IconButton, Select and SegmentedControl share the opaque field surface and interaction states; all viewport controls use the same 70-percent geometry, and rails must not inherit the translucent header background.",
|
"Groups over rendered imagery use nodedc-scene-controls: Button, IconButton, Select and SegmentedControl share the opaque field surface and interaction states; all viewport controls use the same 70-percent geometry, and rails must not inherit the translucent header background.",
|
||||||
"Controlled toggle actions expose aria-pressed and use the canonical active surface without changing geometry.",
|
"Controlled toggle actions expose aria-pressed and use the canonical active surface without changing geometry.",
|
||||||
"Filled accent actions derive foreground contrast from the actual accent.",
|
"Filled accent actions derive foreground contrast from the actual accent.",
|
||||||
"Destructive actions remain neutral until confirmation unless danger is the principal message.",
|
"Destructive actions remain neutral until confirmation unless danger is the principal message.",
|
||||||
"loading displays one centered indicator inside the initiating action, disables repeat activation and preserves dimensions and accessible name. Never place its spinner beside or below the action group.",
|
"loading displays one centered indicator inside the initiating action, disables repeat activation and preserves dimensions and accessible name. Never place its spinner beside or below the action group.",
|
||||||
"Primary tone=neutral is white when enabled and gray when disabled in every theme/accent; use it for accent-independent operator actions without local CSS overrides.",
|
"Primary tone=neutral is white when enabled and gray when disabled in every theme/accent; use it for accent-independent operator actions without local CSS overrides.",
|
||||||
"nodedc-viewport-controls is the shared geometry context for every viewer toolbar: 0.7 times standard controls, including icons, fonts and rims. It normalizes legacy compact/dense variants, never compounds in nested groups, and excludes portaled menus/settings and scene content."
|
"nodedc-viewport-controls is the shared geometry context for every viewer toolbar: 0.7 times standard controls, including icons, fonts and rims. It normalizes legacy compact/dense variants, never compounds in nested groups, and excludes portaled menus/settings and scene content.",
|
||||||
|
"Viewport action scopes apply scene Glass V4 to normal backgrounds; selected/disabled/hover and focus semantics are preserved. No local nearly transparent substitutes.",
|
||||||
|
"Viewport round action rails keep their group container transparent: glass belongs to each circle, not a shared capsule."
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -229,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."
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -285,7 +314,8 @@
|
|||||||
"The browser places the caret at the clicked character, preserves native drag or keyboard selection, and replaces the selected substring on typing without pointer-state interception.",
|
"The browser places the caret at the clicked character, preserves native drag or keyboard selection, and replaces the selected substring on typing without pointer-state interception.",
|
||||||
"Editor foreground and caret switch automatically between theme text and on-accent tokens according to the actual fill edge beneath the value area.",
|
"Editor foreground and caret switch automatically between theme text and on-accent tokens according to the actual fill edge beneath the value area.",
|
||||||
"The editor has no separate background box and keeps focus across parent window rerenders and pointer leave.",
|
"The editor has no separate background box and keeps focus across parent window rerenders and pointer leave.",
|
||||||
"Editor keyboard events do not bubble into enclosing Window shortcuts."
|
"Editor keyboard events do not bubble into enclosing Window shortcuts.",
|
||||||
|
"variant=rail is the single-value horizontal counterpart of the thin vertical section scale: 0.2 control-height shaft, minimum 24 px transparent target, value above, native arrows/Home/End, disabled and value underline focus. No enclosing surface, glass, outline, shadow or exact-value editor. Consumer owns placement and visibility timing."
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -305,12 +335,14 @@
|
|||||||
"hue slider",
|
"hue slider",
|
||||||
"quick colors",
|
"quick colors",
|
||||||
"portal palette",
|
"portal palette",
|
||||||
"keyboard spectrum adjustment"
|
"keyboard spectrum adjustment",
|
||||||
|
"explicit screen eyedropper with cancellation; system palette fallback when EyeDropper is unavailable"
|
||||||
],
|
],
|
||||||
"rules": [
|
"rules": [
|
||||||
"Do not expose a browser-native color dialog as the product runtime UI.",
|
|
||||||
"The palette owns choice geometry; the consumer owns color validation, persistence and domain reaction.",
|
"The palette owns choice geometry; the consumer owns color validation, persistence and domain reaction.",
|
||||||
"HEX text keeps incomplete drafts; valid six-digit colors apply live, invalid drafts revert on blur/Escape, Enter commits; external undo updates the field."
|
"HEX text keeps incomplete drafts; valid six-digit colors apply live, invalid drafts revert on blur/Escape, Enter commits; external undo updates the field.",
|
||||||
|
"The themed palette remains primary. Screen sampling starts only on a trusted button click, never pointer leave; unsupported browsers expose an explicit system-palette fallback. No screenshots are captured or stored. Escape, closing or unmount cancels sampling without applying a color.",
|
||||||
|
"Spectrum has no decorative perimeter border; sampling marker and keyboard focus remain visible."
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -326,12 +358,15 @@
|
|||||||
],
|
],
|
||||||
"domContract": [
|
"domContract": [
|
||||||
"nodedc-dropdown-surface",
|
"nodedc-dropdown-surface",
|
||||||
"nodedc-dropdown-option"
|
"nodedc-dropdown-option",
|
||||||
|
"nodedc-viewport-surface"
|
||||||
],
|
],
|
||||||
"summary": "Shared portal/fixed floating layer for action and selection menus.",
|
"summary": "Shared portal/fixed floating layer for action and selection menus.",
|
||||||
"behavior": [
|
"behavior": [
|
||||||
"portal to active fullscreen element or document body",
|
"portal to active fullscreen element or document body",
|
||||||
"viewport clamp",
|
"viewport clamp",
|
||||||
|
"scene Glass V4 via surfaceClassName nodedc-viewport-surface",
|
||||||
|
"content resize repositions an open dropdown within viewport bounds",
|
||||||
"vertical flip",
|
"vertical flip",
|
||||||
"capture-phase outside pointer close before scene tool interception",
|
"capture-phase outside pointer close before scene tool interception",
|
||||||
"optional outside-pointer consumer for editing viewports",
|
"optional outside-pointer consumer for editing viewports",
|
||||||
@@ -382,7 +417,8 @@
|
|||||||
"Split is the Engine form: a separate value surface and a 46 px toggle separated by an 8 px gap.",
|
"Split is the Engine form: a separate value surface and a 46 px toggle separated by an 8 px gap.",
|
||||||
"Inline is a compact label-only toolbar trigger without a persistent surface or chevron; its menu and keyboard behavior remain canonical.",
|
"Inline is a compact label-only toolbar trigger without a persistent surface or chevron; its menu and keyboard behavior remain canonical.",
|
||||||
"Integrated Select is forbidden inside Inspector; use InspectorSelectField so the visible label is above a full-width split control.",
|
"Integrated Select is forbidden inside Inspector; use InspectorSelectField so the visible label is above a full-width split control.",
|
||||||
"The portal menu preserves its source-family row geometry instead of inheriting card radii."
|
"The portal menu preserves its source-family row geometry instead of inheriting card radii.",
|
||||||
|
"Split Select accepts shape=pill to align its separate toggle with circular workspace actions."
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -396,7 +432,9 @@
|
|||||||
],
|
],
|
||||||
"domPackage": "@nodedc/ui-dom",
|
"domPackage": "@nodedc/ui-dom",
|
||||||
"domExports": [
|
"domExports": [
|
||||||
"createModalController"
|
"createModalController",
|
||||||
|
"createModalSizeController",
|
||||||
|
"fitModalSize"
|
||||||
],
|
],
|
||||||
"domContract": [
|
"domContract": [
|
||||||
"nodedc-overlay",
|
"nodedc-overlay",
|
||||||
@@ -412,9 +450,13 @@
|
|||||||
"backdrop close policy",
|
"backdrop close policy",
|
||||||
"modal-only body scroll lock",
|
"modal-only body scroll lock",
|
||||||
"optional bounded dragging for modeless inspectors",
|
"optional bounded dragging for modeless inspectors",
|
||||||
"move toggle: preserve mounted contents and current size; remove dimming, backdrop close, scroll lock and focus trap; header drag and eight invisible resize regions"
|
"move toggle: preserve mounted contents and current size; remove dimming, backdrop close, scroll lock and focus trap; header drag and eight invisible resize regions",
|
||||||
|
"Escape and Tab belong to the focused or topmost visible modal; parent windows do not dismiss behind nested settings.",
|
||||||
|
"An embedded fullscreen viewport keeps its owning window mounted at the existing portal host; Escape restores the viewport and Tab stays inside its visible controls.",
|
||||||
|
"DOM modal resizing shares eight canonical edge handles, centered viewport bounds and keyboard Shift+arrow control; onSizeCommit runs only for completed user changes."
|
||||||
],
|
],
|
||||||
"rules": [
|
"rules": [
|
||||||
|
"headerActionsPlacement=before-close places context actions between the move toggle and close in both visual and keyboard order; the default preserves existing consumers.",
|
||||||
"WindowFooterActions aligns modal actions to the trailing edge, including a footer with only one action group; actions wrap within narrow windows.",
|
"WindowFooterActions aligns modal actions to the trailing edge, including a footer with only one action group; actions wrap within narrow windows.",
|
||||||
"Centered windows at narrow widths subtract both overlay gutters from their maximum width and height.",
|
"Centered windows at narrow widths subtract both overlay gutters from their maximum width and height.",
|
||||||
"Open state belongs to the application; focus/layer behavior belongs to the component.",
|
"Open state belongs to the application; focus/layer behavior belongs to the component.",
|
||||||
@@ -423,11 +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.",
|
||||||
|
"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.",
|
||||||
|
"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."
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -465,7 +512,9 @@
|
|||||||
"Rectangle, maximized state, visibility, activation and z-order are controlled by the application.",
|
"Rectangle, maximized state, visibility, activation and z-order are controlled by the application.",
|
||||||
"resizeIndicator=false hides only the corner glyph; pointer hit area, cursor and keyboard resizing remain available.",
|
"resizeIndicator=false hides only the corner glyph; pointer hit area, cursor and keyboard resizing remain available.",
|
||||||
"Use WorkspaceWindow for auxiliary views inside a stage; modal workflows and viewport inspectors continue to use Window.",
|
"Use WorkspaceWindow for auxiliary views inside a stage; modal workflows and viewport inspectors continue to use Window.",
|
||||||
"Dragging and resizing remain clamped when the workspace changes size, including when it becomes smaller than the requested minimum."
|
"Dragging and resizing remain clamped when the workspace changes size, including when it becomes smaller than the requested minimum.",
|
||||||
|
"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."
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -509,7 +558,7 @@
|
|||||||
"behavior": [
|
"behavior": [
|
||||||
"controlled percentage",
|
"controlled percentage",
|
||||||
"optional resizable separator",
|
"optional resizable separator",
|
||||||
"line or invisible separator appearance with retained keyboard focus",
|
"line or invisible separator appearance with retained keyboard focus; pointer resize never paints the invisible divider",
|
||||||
"pointer capture drag",
|
"pointer capture drag",
|
||||||
"Arrow/Home/End keyboard sizing",
|
"Arrow/Home/End keyboard sizing",
|
||||||
"ARIA separator range",
|
"ARIA separator range",
|
||||||
@@ -659,14 +708,18 @@
|
|||||||
"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",
|
||||||
|
"responsive profile label hides with the shared mobile header layout"
|
||||||
],
|
],
|
||||||
"rules": [
|
"rules": [
|
||||||
"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.",
|
||||||
|
"Optional headerAction separates the middle icon action from the avatar/profile trigger; without it legacy behavior is preserved."
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -738,10 +791,12 @@
|
|||||||
"rules": [
|
"rules": [
|
||||||
"The bottom Launcher service rail is product-specific and is not part of the general application template.",
|
"The bottom Launcher service rail is product-specific and is not part of the general application template.",
|
||||||
"Desktop page gap is 20 px and navigation width follows the Launcher 332–352 px range.",
|
"Desktop page gap is 20 px and navigation width follows the Launcher 332–352 px range.",
|
||||||
|
"Shared navigationCollapsed state contracts the left column to a 4.55rem icon rail, preserves workspace identity and leaves the end column full-width. Width and content offset animate together with reduced-motion support.",
|
||||||
"Applications supply routes, profile data, stage media and panel content without changing shell geometry.",
|
"Applications supply routes, profile data, stage media and panel content without changing shell geometry.",
|
||||||
"Light panels use the SEO white surface and shadow tokens rather than a dark shell with inverted text.",
|
"Light panels use the SEO white surface and shadow tokens rather than a dark shell with inverted text.",
|
||||||
"A layout-level save action belongs to ApplicationPanel.utilityActions and is never duplicated inside individual content cards.",
|
"A layout-level save action belongs to ApplicationPanel.utilityActions and is never duplicated inside individual content cards.",
|
||||||
"ApplicationPanel allowFullscreen exposes an owned full-window context; the whole panel and its header move atomically, preserving the renderer and body-portaled inspectors."
|
"ApplicationPanel allowFullscreen exposes an owned full-window context; the whole panel and its header move atomically, preserving the renderer and body-portaled inspectors.",
|
||||||
|
"ApplicationPanel establishes md/13px operational typography independent of the host; its page title alone uses title/18px. Semantic section headings remain md; explanatory copy uses Description/sm."
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -775,6 +830,8 @@
|
|||||||
"viewport container scope with local edge reveal",
|
"viewport container scope with local edge reveal",
|
||||||
"native tooltips with keyboard shortcut hints",
|
"native tooltips with keyboard shortcut hints",
|
||||||
"optional canonical dropdown for toolbar item menus",
|
"optional canonical dropdown for toolbar item menus",
|
||||||
|
"viewport-scoped buttons share scene Glass V4; the rail stays transparent",
|
||||||
|
"bounded menuWidth for rich inspectors; default remains 220 px",
|
||||||
"theme-independent geometry",
|
"theme-independent geometry",
|
||||||
"menus outside maximum magnified icon envelope",
|
"menus outside maximum magnified icon envelope",
|
||||||
"bounded triangle intent corridor before sibling menu activation",
|
"bounded triangle intent corridor before sibling menu activation",
|
||||||
@@ -823,10 +880,10 @@
|
|||||||
"domContract": [
|
"domContract": [
|
||||||
"nodedc-admin-panel"
|
"nodedc-admin-panel"
|
||||||
],
|
],
|
||||||
"summary": "Hub-derived left administration panel with context selectors, route navigation, close action and footer identity.",
|
"summary": "Shared collapsible left administration panel with context selectors, accessible icon rail, route navigation and footer identity.",
|
||||||
"anatomy": [
|
"anatomy": [
|
||||||
"eyebrow and title",
|
"eyebrow and title",
|
||||||
"close action",
|
"collapse/expand and close actions",
|
||||||
"workspace context",
|
"workspace context",
|
||||||
"company context",
|
"company context",
|
||||||
"route items",
|
"route items",
|
||||||
@@ -835,7 +892,10 @@
|
|||||||
"rules": [
|
"rules": [
|
||||||
"The panel shell, full-bleed pills and icon circles are library geometry; routes and identity data remain application-owned.",
|
"The panel shell, full-bleed pills and icon circles are library geometry; routes and identity data remain application-owned.",
|
||||||
"The desktop panel follows the Launcher 332–352 px width range with a 21.6 px shell radius and a 20 px page gap.",
|
"The desktop panel follows the Launcher 332–352 px width range with a 21.6 px shell radius and a 20 px page gap.",
|
||||||
"Active route state uses the active surface and icon contrast from the theme."
|
"Active route state uses the active surface and icon contrast from the theme.",
|
||||||
|
"All left navigation panels collapse to the shared 4.55rem icon rail; title, labels, close and secondary actions disappear. Icon names and hover/focus tooltips remain.",
|
||||||
|
"ApplicationShell owns synchronized rail/content width and route-independent collapse state without remounting the workspace. Right panels retain their width.",
|
||||||
|
"Use shell navigationCollapsed/onNavigationCollapsedChange for controlled state; standalone panels accept collapsed/onCollapsedChange. Respect reduced motion."
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -850,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",
|
||||||
@@ -923,7 +983,8 @@
|
|||||||
"Section and empty-state titles use the compact md token; descriptions use sm. Page/window title sizes and browser heading defaults are forbidden inside cards.",
|
"Section and empty-state titles use the compact md token; descriptions use sm. Page/window title sizes and browser heading defaults are forbidden inside cards.",
|
||||||
"Unclassed paragraphs in the body, including nested layout groups, share Description typography as a compatibility safeguard. New explanatory copy must use Description; headings and controls retain their own typography.",
|
"Unclassed paragraphs in the body, including nested layout groups, share Description typography as a compatibility safeguard. New explanatory copy must use Description; headings and controls retain their own typography.",
|
||||||
"Use Switch for compact visibility/enable states; use Checker for the Engine inspector treatment.",
|
"Use Switch for compact visibility/enable states; use Checker for the Engine inspector treatment.",
|
||||||
"Switch keeps its track width beside wrapped labels. The checked thumb uses on-accent contrast; the unchecked track follows theme text instead of a fixed white tint."
|
"Switch keeps its track width beside wrapped labels. The checked thumb uses on-accent contrast; the unchecked track follows theme text instead of a fixed white tint.",
|
||||||
|
"Fields sit directly in the card body, as in Mission Core. Layout grids are transparent; use at most one additional neutral group for a collection entry, not a card around the entire form."
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -954,7 +1015,8 @@
|
|||||||
"ToastCard",
|
"ToastCard",
|
||||||
"ToastStack",
|
"ToastStack",
|
||||||
"ToastItem",
|
"ToastItem",
|
||||||
"ToastTone"
|
"ToastTone",
|
||||||
|
"ToastObserver"
|
||||||
],
|
],
|
||||||
"domContract": [
|
"domContract": [
|
||||||
"nodedc-toast-viewport",
|
"nodedc-toast-viewport",
|
||||||
@@ -982,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."
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1070,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."
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1095,7 +1160,9 @@
|
|||||||
"Inspector selection fields use InspectorSelectField only: a stacked visible label and the 276/8/46 px split control; integrated pills are prohibited.",
|
"Inspector selection fields use InspectorSelectField only: a stacked visible label and the 276/8/46 px split control; integrated pills are prohibited.",
|
||||||
"The panel variant reuses AdminNavigationPanel pill, icon and theme tokens while retaining the same controlled accordion state and domain-owned content.",
|
"The panel variant reuses AdminNavigationPanel pill, icon and theme tokens while retaining the same controlled accordion state and domain-owned content.",
|
||||||
"A section action is a sibling IconButton before the disclosure chevron, never nested in the trigger. It does not toggle the section. Panel chevrons point down when collapsed and up when expanded.",
|
"A section action is a sibling IconButton before the disclosure chevron, never nested in the trigger. It does not toggle the section. Panel chevrons point down when collapsed and up when expanded.",
|
||||||
"Accent-filled section headers belong to Environment Settings; neutral headers remain available for other approved inspector contexts."
|
"Accent-filled section headers belong to Environment Settings; neutral headers remain available for other approved inspector contexts.",
|
||||||
|
"Default sections and optional header fields use the canonical 12 px spacing token; footer actions are centered with the same gap. Nested Inspectors retain this rhythm; the panel variant retains its compact row geometry.",
|
||||||
|
"Inspector responds to its own container width: fields stack below 330px and intrinsic tracks must not clip content."
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1110,14 +1177,15 @@
|
|||||||
"nodedc-environment-settings",
|
"nodedc-environment-settings",
|
||||||
"nodedc-environment-media-playlist"
|
"nodedc-environment-media-playlist"
|
||||||
],
|
],
|
||||||
"summary": "Shared avatar Settings → Environment composition for product/home copy, quick actions and image/video playlists.",
|
"summary": "Shared avatar Settings composition with Environment editing and optional consumer-owned settings sections.",
|
||||||
"behavior": [
|
"behavior": [
|
||||||
"product-configured page list",
|
"product-configured page list",
|
||||||
"draft/reset/save",
|
"draft/reset/save",
|
||||||
"upload adapter",
|
"upload adapter",
|
||||||
"ordered media playlist",
|
"ordered media playlist",
|
||||||
"image timing",
|
"image timing",
|
||||||
"parent save/upload disabled state"
|
"parent save/upload disabled state",
|
||||||
|
"additionalSections extends shared navigation with consumer-owned content and footer while preserving the Environment draft"
|
||||||
],
|
],
|
||||||
"rules": [
|
"rules": [
|
||||||
"Reuse FeatureSettingsWindow and existing form primitives; never fork an application-specific settings form.",
|
"Reuse FeatureSettingsWindow and existing form primitives; never fork an application-specific settings form.",
|
||||||
@@ -1188,7 +1256,8 @@
|
|||||||
"summary": "Secondary explanatory copy matching SettingsCard descriptions.",
|
"summary": "Secondary explanatory copy matching SettingsCard descriptions.",
|
||||||
"rules": [
|
"rules": [
|
||||||
"Use the same inherited family, regular 400 weight, small font token, muted text token and 1.4 line height for explanatory paragraphs. Do not restyle per feature.",
|
"Use the same inherited family, regular 400 weight, small font token, muted text token and 1.4 line height for explanatory paragraphs. Do not restyle per feature.",
|
||||||
"Use role=status for explanatory pending/result copy. SettingsCard applies the same contract to unclassed body paragraphs as a fallback, without changing headings or controls."
|
"Use role=status for explanatory pending/result copy. SettingsCard applies the same contract to unclassed body paragraphs as a fallback, without changing headings or controls.",
|
||||||
|
"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."
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1224,6 +1293,7 @@
|
|||||||
],
|
],
|
||||||
"summary": "Renderer-independent BIM-style orientation cube; six faces, twelve edges, eight corners.",
|
"summary": "Renderer-independent BIM-style orientation cube; six faces, twelve edges, eight corners.",
|
||||||
"behavior": [
|
"behavior": [
|
||||||
|
"independent faceOpacity, edgeOpacity and text colors; overall opacity remains compatible",
|
||||||
"Tracks camera quaternion; never changes projection implicitly",
|
"Tracks camera quaternion; never changes projection implicitly",
|
||||||
"Visible regions support hover, focus, Enter/Space and disabled state",
|
"Visible regions support hover, focus, Enter/Space and disabled state",
|
||||||
"Consumer owns camera navigation and coordinate conversion",
|
"Consumer owns camera navigation and coordinate conversion",
|
||||||
@@ -1239,7 +1309,8 @@
|
|||||||
"exports": [
|
"exports": [
|
||||||
"Tree",
|
"Tree",
|
||||||
"TreeNode",
|
"TreeNode",
|
||||||
"TreeProps"
|
"TreeProps",
|
||||||
|
"TreeSelectionGesture"
|
||||||
],
|
],
|
||||||
"domContract": [
|
"domContract": [
|
||||||
"nodedc-tree",
|
"nodedc-tree",
|
||||||
@@ -1247,14 +1318,19 @@
|
|||||||
],
|
],
|
||||||
"summary": "Compact hierarchical outliner with single-line rows, selection, visibility and keyboard navigation.",
|
"summary": "Compact hierarchical outliner with single-line rows, selection, visibility and keyboard navigation.",
|
||||||
"behavior": [
|
"behavior": [
|
||||||
"selection expands ancestors and scrolls only the tree container",
|
"new external selection expands ancestors and scrolls only the tree container",
|
||||||
|
"visibility/data refresh keeps disclosure state; arrow disclosure keeps scroll position; row double-click does not expand",
|
||||||
"Arrow/Home/End navigation, disclosure and optional visibility actions",
|
"Arrow/Home/End navigation, disclosure and optional visibility actions",
|
||||||
"long names ellipsize without growing row height",
|
"long names ellipsize without growing row height",
|
||||||
"filter retains matching ancestors"
|
"filter retains matching ancestors",
|
||||||
|
"optional renderActions slot composes canonical controls without selecting the row",
|
||||||
|
"defaultExpandedDepth limits initial expansion; external selection reveals ancestors"
|
||||||
],
|
],
|
||||||
"rules": [
|
"rules": [
|
||||||
"Use for object hierarchies; no nested ResourceRow cards.",
|
"Use for object hierarchies; no nested ResourceRow cards.",
|
||||||
"Host owns model identity and visibility; the tree owns navigation presentation."
|
"Host owns model identity and visibility; the tree owns navigation presentation.",
|
||||||
|
"Compact information uses info-plain at 14px beside the independent visibility eye.",
|
||||||
|
"Optional controlled selectedIds and modifier/range callback support multiple selection; Shift ranges use displayed rows only. Existing single-selection consumers remain compatible."
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1343,7 +1419,9 @@
|
|||||||
"behavior": [
|
"behavior": [
|
||||||
"four outer magnetic edges",
|
"four outer magnetic edges",
|
||||||
"nested adjacent tool splits",
|
"nested adjacent tool splits",
|
||||||
|
"only exterior workspace corners are rounded; adjoining pane seams remain square and update after dock, resize or close",
|
||||||
"drag header to detach over primary",
|
"drag header to detach over primary",
|
||||||
|
"floating and dragged tools use canonical scene Glass V4; docking restores tiled surface context",
|
||||||
"invisible resize regions",
|
"invisible resize regions",
|
||||||
"controlled JSON layout",
|
"controlled JSON layout",
|
||||||
"stable mounted renderer",
|
"stable mounted renderer",
|
||||||
@@ -1357,7 +1435,83 @@
|
|||||||
"Header Enter/Space starts keyboard docking; arrows select edges, Shift+arrows the whole workspace, Tab cycles tools, Home floats, Escape cancels. Floating headers also support arrows and Shift+arrows for move/resize.",
|
"Header Enter/Space starts keyboard docking; arrows select edges, Shift+arrows the whole workspace, Tab cycles tools, Home floats, Escape cancels. Floating headers also support arrows and Shift+arrows for move/resize.",
|
||||||
"Hidden tools retain their docking placement and remembered floating rectangle. Viewport clamps never overwrite preferred geometry.",
|
"Hidden tools retain their docking placement and remembered floating rectangle. Viewport clamps never overwrite preferred geometry.",
|
||||||
"EditorWorkspace keeps one mounted portal host, moves it atomically when supported, and restores its original slot on return. It never changes the source-view layout.",
|
"EditorWorkspace keeps one mounted portal host, moves it atomically when supported, and restores its original slot on return. It never changes the source-view layout.",
|
||||||
"The fixed editor header is outside docking bounds. Back, edit completion and close return to the original view."
|
"The fixed editor header is outside docking bounds. Back, edit completion and close return to the original view.",
|
||||||
|
"When opened inside Window, the editor suspends that overlay, backdrop and focus trap without unmounting; returning restores the same window.",
|
||||||
|
"EditorWorkspace purpose=view uses the same mounted host, return/fullscreen behavior and optional fixed headerActions; purpose=edit remains the compatible default.",
|
||||||
|
"Tool minimumSize applies to floating restore, pointer and keyboard resize as well as docked splits; small screens clamp to available space. Footer remains outside the body scroller.",
|
||||||
|
"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."
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "level-button",
|
||||||
|
"status": "baseline",
|
||||||
|
"package": "@nodedc/ui-react",
|
||||||
|
"exports": [
|
||||||
|
"LevelButton",
|
||||||
|
"LevelButtonProps",
|
||||||
|
"LevelButtonGeometry"
|
||||||
|
],
|
||||||
|
"domContract": [
|
||||||
|
"nodedc-level-button"
|
||||||
|
],
|
||||||
|
"summary": "Compact measured resource level inside a canonical pill button opening details.",
|
||||||
|
"rules": [
|
||||||
|
"Consumer supplies a measured fraction and freshness; unknown is not zero.",
|
||||||
|
"Stale retains the last number and accessible stale text; explicit user fill colours are retained.",
|
||||||
|
"Keyboard, focus, disabled and pointer behavior come from Button. Explicit fillColor uses contrast-correct text on the filled portion.",
|
||||||
|
"Optional geometry sets width, height and radius with a 32 × 12 px minimum. At small dimensions the text and padding shrink proportionally; both contrast layers share the same type geometry. Consumer owns header-group offset."
|
||||||
|
],
|
||||||
|
"documentation": "../docs/LEVEL_BUTTON.md"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "tooltip",
|
||||||
|
"status": "baseline",
|
||||||
|
"package": "@nodedc/ui-react",
|
||||||
|
"exports": [
|
||||||
|
"Tooltip",
|
||||||
|
"TooltipProps",
|
||||||
|
"TooltipProvider"
|
||||||
|
],
|
||||||
|
"domContract": [
|
||||||
|
"nodedc-tooltip-anchor",
|
||||||
|
"nodedc-tooltip"
|
||||||
|
],
|
||||||
|
"summary": "Neutral non-interactive explanation on hover, focus or touch.",
|
||||||
|
"behavior": [
|
||||||
|
"portal to active fullscreen element or body",
|
||||||
|
"shared viewport clamp and flip",
|
||||||
|
"hoverable content and focus persistence",
|
||||||
|
"Escape dismisses tooltip without closing its parent",
|
||||||
|
"one tooltip at a time",
|
||||||
|
"scroll/resize reposition",
|
||||||
|
"reduced-motion fade disabled"
|
||||||
|
],
|
||||||
|
"rules": [
|
||||||
|
"Use focusable for read-only graphics; action triggers own their focus.",
|
||||||
|
"Content is descriptive, never a menu or interactive form.",
|
||||||
|
"No new app-local tooltip geometry or layer management.",
|
||||||
|
"All tooltip surfaces use rounded scene glass without decorative border, outline or rim.",
|
||||||
|
"Mount TooltipProvider once at the application root to present legacy native title hints through the same accessible portal. Nested reusable modules reuse the host provider."
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "path-bar",
|
||||||
|
"status": "baseline",
|
||||||
|
"package": "@nodedc/ui-dom",
|
||||||
|
"exports": [
|
||||||
|
"renderPathBar",
|
||||||
|
"PathBarItem"
|
||||||
|
],
|
||||||
|
"domContract": [
|
||||||
|
"nodedc-path-bar"
|
||||||
|
],
|
||||||
|
"summary": "Compact Finder-style path navigation with neutral folder icons, separators and native folder buttons.",
|
||||||
|
"behavior": [
|
||||||
|
"Application supplies items, icon factory and navigation callback.",
|
||||||
|
"Current location uses aria-current; long paths scroll without wrapping."
|
||||||
|
],
|
||||||
|
"rules": [
|
||||||
|
"Use ui-dom/styles.css, theme tokens and textContent labels; no application-local breadcrumb pills."
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
+13
-3
@@ -32,7 +32,9 @@
|
|||||||
"panel",
|
"panel",
|
||||||
"apps",
|
"apps",
|
||||||
"layers",
|
"layers",
|
||||||
"move"
|
"move",
|
||||||
|
"power",
|
||||||
|
"pipette"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -53,6 +55,7 @@
|
|||||||
"sliders",
|
"sliders",
|
||||||
"search",
|
"search",
|
||||||
"orthographic",
|
"orthographic",
|
||||||
|
"fit-view",
|
||||||
"perspective"
|
"perspective"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -78,7 +81,10 @@
|
|||||||
"curve",
|
"curve",
|
||||||
"undo",
|
"undo",
|
||||||
"redo",
|
"redo",
|
||||||
"add-point"
|
"add-point",
|
||||||
|
"ruler",
|
||||||
|
"section",
|
||||||
|
"isolate"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -93,13 +99,16 @@
|
|||||||
"check",
|
"check",
|
||||||
"alert",
|
"alert",
|
||||||
"info",
|
"info",
|
||||||
|
"info-plain",
|
||||||
"activity",
|
"activity",
|
||||||
"lock",
|
"lock",
|
||||||
|
"unlock",
|
||||||
"key",
|
"key",
|
||||||
"shield",
|
"shield",
|
||||||
"circle",
|
"circle",
|
||||||
"eye",
|
"eye",
|
||||||
"eye-off"
|
"eye-off",
|
||||||
|
"star"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -115,6 +124,7 @@
|
|||||||
"building",
|
"building",
|
||||||
"globe",
|
"globe",
|
||||||
"database",
|
"database",
|
||||||
|
"pin",
|
||||||
"network",
|
"network",
|
||||||
"inbox",
|
"inbox",
|
||||||
"mail"
|
"mail"
|
||||||
|
|||||||
+22
-5
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"schemaVersion": "1.0.0",
|
"schemaVersion": "1.0.0",
|
||||||
"libraryVersion": "0.7.0",
|
"libraryVersion": "0.7.1",
|
||||||
"name": "NODE.DC Design System",
|
"name": "NODE.DC Design System",
|
||||||
"purpose": "Canonical code-level UI system for current and future NODE.DC applications.",
|
"purpose": "Canonical code-level UI system for current and future NODE.DC applications.",
|
||||||
"packages": [
|
"packages": [
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@nodedc/map-cesium-react",
|
"name": "@nodedc/map-cesium-react",
|
||||||
"path": "packages/map-cesium-react",
|
"path": "packages/map-cesium-react",
|
||||||
"role": "credential-free Cesium renderer adapter for the canonical Map Page and same-origin Platform Map Gateway BFFs"
|
"role": "credential-free Cesium 1.147.0 renderer adapter for canonical Map Page and same-origin Map Gateway BFFs; optional lifetime-scoped ready-domain geometry hook"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"sourceRegistry": "sources.json",
|
"sourceRegistry": "sources.json",
|
||||||
@@ -56,7 +56,8 @@
|
|||||||
"mapTemplate": "../docs/MAP_TEMPLATE.md",
|
"mapTemplate": "../docs/MAP_TEMPLATE.md",
|
||||||
"icons": "../docs/ICONS.md",
|
"icons": "../docs/ICONS.md",
|
||||||
"consumption": "../docs/CONSUMPTION.md",
|
"consumption": "../docs/CONSUMPTION.md",
|
||||||
"environmentSettings": "../docs/ENVIRONMENT_SETTINGS.md"
|
"environmentSettings": "../docs/ENVIRONMENT_SETTINGS.md",
|
||||||
|
"viewportUi": "../docs/VIEWPORT_UI.md"
|
||||||
},
|
},
|
||||||
"applicationManifestSchema": "schemas/application-manifest-v0.1.schema.json",
|
"applicationManifestSchema": "schemas/application-manifest-v0.1.schema.json",
|
||||||
"designProfileSchema": "schemas/design-profile-v0.1.schema.json",
|
"designProfileSchema": "schemas/design-profile-v0.1.schema.json",
|
||||||
@@ -66,7 +67,23 @@
|
|||||||
"mapSubjectDetailProfileRegistry": "map-subject-detail-profiles.json",
|
"mapSubjectDetailProfileRegistry": "map-subject-detail-profiles.json",
|
||||||
"operatingRule": "Check this registry before creating a NODE.DC interface element. Reuse or extend the canonical export instead of creating an application-local copy.",
|
"operatingRule": "Check this registry before creating a NODE.DC interface element. Reuse or extend the canonical export instead of creating an application-local copy.",
|
||||||
"appearanceProfiles": {
|
"appearanceProfiles": {
|
||||||
"default": "Existing theme/material behavior",
|
"default": "Explicit legacy component presentation; no application-local overrides.",
|
||||||
"mission": "Opt-in operator appearance, qualified against live Mission Core 2026-09-30; shared modal/floating surfaces, neutral avatars and dot statuses"
|
"mission": "Canonical Mission Core foundation, audited on 2026-11-05: complete dark palette, surface hierarchy, neutral actions, portal materials, semantic dots and flat edges. Default for new applications."
|
||||||
|
},
|
||||||
|
"surfaceEdgeProfiles": {
|
||||||
|
"default": "Existing surface edges",
|
||||||
|
"flat": "No decorative borders or rims; contrasting keyboard focus fill"
|
||||||
|
},
|
||||||
|
"themePresets": {
|
||||||
|
"missionDarkTheme": {
|
||||||
|
"theme": "dark",
|
||||||
|
"appearance": "mission",
|
||||||
|
"edges": "flat"
|
||||||
|
},
|
||||||
|
"missionLightTheme": {
|
||||||
|
"theme": "light",
|
||||||
|
"appearance": "mission",
|
||||||
|
"edges": "flat"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,6 +108,21 @@
|
|||||||
"docs/ARCHITECTURE.md"
|
"docs/ARCHITECTURE.md"
|
||||||
],
|
],
|
||||||
"policy": "architecture-context"
|
"policy": "architecture-context"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "mission-core",
|
||||||
|
"repository": "https://git.dcserve.ru/SILVER/NODEDC_MISSION_CORE.git",
|
||||||
|
"auditedRevision": "b0332fa",
|
||||||
|
"role": "Owner-approved canonical dark theme and shared operator presentation, 2026-11-05; source and running canonical localhost:8000 audited.",
|
||||||
|
"approvedPaths": [
|
||||||
|
"apps/control-station/src/styles/base.css",
|
||||||
|
"apps/control-station/src/main.tsx"
|
||||||
|
],
|
||||||
|
"policy": "reference",
|
||||||
|
"excludedPaths": [
|
||||||
|
"domain scene renderers",
|
||||||
|
"uncommitted simulation work"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
const fs = require('node:fs'), path = require('node:path'), os = require('node:os'), assert = require('node:assert/strict');
|
||||||
|
const root = process.env.DG_ROOT || path.resolve(__dirname, '..');
|
||||||
|
const {JSDOM} = require('jsdom'), React = require(root + '/node_modules/react'), {act} = React;
|
||||||
|
const {createRoot} = require(root + '/node_modules/react-dom/client');
|
||||||
|
const dom = new JSDOM('<div id="app"></div>', {pretendToBeVisual: true});
|
||||||
|
for (const name of ['window','document','HTMLElement','Element','Node','Event','MouseEvent','KeyboardEvent','CustomEvent']) global[name] = dom.window[name];
|
||||||
|
global.ResizeObserver = class {observe() {} disconnect() {}};
|
||||||
|
global.IS_REACT_ACT_ENVIRONMENT = true;
|
||||||
|
HTMLElement.prototype.getBoundingClientRect = () => ({top: 20, bottom: 60, left: 20, right: 80, width: 60, height: 40});
|
||||||
|
const scratch = fs.mkdtempSync(path.join(os.tmpdir(), 'nodedc-sidebar-'));
|
||||||
|
require(root + '/node_modules/esbuild').buildSync({stdin: {contents: `export {AdminNavigationPanel} from './AdminNavigationPanel.tsx'; export {ApplicationShell} from './ApplicationShell.tsx';`, resolveDir: root + '/packages/ui-react/src'}, outfile: scratch + '/sidebar.cjs', bundle: true, platform: 'node', format: 'cjs', external: ['react','react/*','react-dom','react-dom/*'], jsx: 'automatic'});
|
||||||
|
const {ApplicationShell, AdminNavigationPanel} = require(scratch + '/sidebar.cjs');
|
||||||
|
const ui = createRoot(document.getElementById('app')), h = React.createElement;
|
||||||
|
let selected = 'one', section = 'Data', open = true, mounts = 0, closes = 0, notified = [];
|
||||||
|
function Workspace() {React.useEffect(() => {mounts++;}, []); return h('input', {defaultValue: 'keep draft', 'aria-label': 'Draft'});}
|
||||||
|
const panel = () => h(AdminNavigationPanel, {key: section, title: section, onClose: () => closes++, closeLabel: 'Close navigation', activeId: selected, onItemChange: id => selected = id, contexts: [{id: 'context', label: 'Context', onToggle: () => {}, icon: 'C'}], headerActions: h('button', null, 'Extra'), items: [{id: 'one', label: 'One', icon: '1'}, {id: 'two', label: 'Two', icon: '2', sortable: true}], onItemsReorder: () => {}});
|
||||||
|
const render = (extra = {}) => act(async () => ui.render(h(ApplicationShell, {header: null, stage: null, navigation: panel(), navigationOpen: open, contentOpen: true, contentExpanded: true, content: h(Workspace), endPanel: h('div', {'data-testid': 'right'}, 'Right'), onNavigationCollapsedChange: value => notified.push(value), ...extra})));
|
||||||
|
const button = label => [...document.querySelectorAll('button')].find(b => b.getAttribute('aria-label') === label);
|
||||||
|
const click = el => act(async () => el.dispatchEvent(new MouseEvent('click', {bubbles: true})));
|
||||||
|
const shell = () => document.querySelector('.nodedc-app-shell');
|
||||||
|
(async () => {
|
||||||
|
await render(); const draft = document.querySelector('input'); draft.value = 'unsaved text';
|
||||||
|
await click(button('Свернуть панель навигации'));
|
||||||
|
assert.equal(shell().dataset.navigationCollapsed, 'true');
|
||||||
|
assert.equal(document.querySelector('aside').dataset.collapsed, 'true');
|
||||||
|
assert.equal(button('Развернуть панель навигации').getAttribute('aria-expanded'), 'false');
|
||||||
|
assert(button('Close navigation').hidden); assert.equal(closes, 0);
|
||||||
|
assert(button('Выбрать: Context').hidden); assert(document.querySelector('.nodedc-admin-panel__extra-actions').hidden);
|
||||||
|
assert.equal(button('One').getAttribute('aria-current'), 'page');
|
||||||
|
await click(button('Two')); assert.equal(selected, 'two');
|
||||||
|
section = 'System'; await render(); assert.equal(document.querySelector('aside').dataset.collapsed, 'true', 'new root uses retained shell state');
|
||||||
|
open = false; await render(); open = true; await render(); assert.equal(document.querySelector('aside').dataset.collapsed, 'true', 'close/reopen preserves rail');
|
||||||
|
await act(async () => button('Two').focus()); assert.equal(document.querySelector('[role=tooltip]').textContent, 'Two');
|
||||||
|
await act(async () => document.dispatchEvent(new KeyboardEvent('keydown', {key: 'Escape', bubbles: true})));
|
||||||
|
assert.equal(document.querySelector('[role=tooltip]'), null); assert.equal(closes, 0, 'Escape closes tooltip only');
|
||||||
|
await click(button('Развернуть панель навигации')); assert.equal(shell().dataset.navigationCollapsed, undefined);
|
||||||
|
assert.equal(button('Close navigation').hidden, false);
|
||||||
|
assert.equal(mounts, 1); assert.equal(document.querySelector('input'), draft); assert.equal(draft.value, 'unsaved text');
|
||||||
|
assert.deepEqual(notified, [true, false]);
|
||||||
|
await render({navigationCollapsed: false}); await click(button('Свернуть панель навигации'));
|
||||||
|
assert.equal(shell().dataset.navigationCollapsed, undefined, 'controlled shell awaits owner acceptance');
|
||||||
|
await render({navigationCollapsed: true}); assert.equal(document.querySelector('aside').dataset.collapsed, 'true');
|
||||||
|
assert.equal(document.querySelector('[data-testid=right]').textContent, 'Right');
|
||||||
|
await act(async () => ui.render(h(AdminNavigationPanel, {title: 'Standalone', items: [], onClose: () => {}, onItemChange: () => {}, defaultCollapsed: true})));
|
||||||
|
assert(button('Развернуть панель навигации')); await click(button('Развернуть панель навигации')); assert(button('Свернуть панель навигации'));
|
||||||
|
await act(async () => ui.unmount());
|
||||||
|
console.log('PASS: shared/standalone/controlled collapse, root and reopen persistence, hidden actions, icon navigation, accessible names and Escape tooltip, workspace remains mounted with its draft.');
|
||||||
|
})().catch(e => {console.error(e); process.exitCode = 1;}).finally(() => {fs.rmSync(scratch, {recursive: true, force: true}); dom.window.close();});
|
||||||
@@ -47,3 +47,19 @@ test("viewport controls share one scale without scaling nested controls twice",
|
|||||||
assert.match(styles, /\.nodedc-segmented\) :is\([^}]+zoom: 1;/);
|
assert.match(styles, /\.nodedc-segmented\) :is\([^}]+zoom: 1;/);
|
||||||
assert.ok(JSON.parse(registrySource).components.find(c=>c.id==='button').domContract.includes('nodedc-viewport-controls'));
|
assert.ok(JSON.parse(registrySource).components.find(c=>c.id==='button').domContract.includes('nodedc-viewport-controls'));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
import { LevelButton } from "../packages/ui-react/dist/index.js";
|
||||||
|
import { levelButtonGeometry } from "../packages/ui-react/dist/levelButtonGeometry.js";
|
||||||
|
test("compact level indicators fit both contrast layers with proportional text and padding", () => {
|
||||||
|
const tiny=levelButtonGeometry({width:32,height:12,radius:4},4);
|
||||||
|
const normal=levelButtonGeometry({width:64,height:24,radius:8},4);
|
||||||
|
assert.equal(tiny.fontSize,'calc(var(--nodedc-font-size-md) * 0.5)');
|
||||||
|
assert.equal(tiny.padding,'calc(0.25rem * 0.5) calc(var(--nodedc-space-2) * 0.5)');
|
||||||
|
assert.equal(normal.fontSize,'calc(var(--nodedc-font-size-md) * 1)');
|
||||||
|
assert.equal(levelButtonGeometry({width:-1,height:NaN},4).width,32);
|
||||||
|
assert.equal(levelButtonGeometry({width:-1,height:NaN},4).height,46);
|
||||||
|
const markup=renderToStaticMarkup(createElement(LevelButton,{value:1,label:'Battery',fillColor:'#ffffff',geometry:{width:32,height:12,radius:4}}));
|
||||||
|
assert.match(markup,/width:32px/);assert.match(markup,/height:12px/);
|
||||||
|
assert.match(markup,/nodedc-level-button__fill/);
|
||||||
|
assert.match(markup,/100/);assert.match(markup,/aria-label="Battery: 100%"/);
|
||||||
|
});
|
||||||
|
|||||||
@@ -54,3 +54,21 @@ test('repeated dock and float transitions retain unique tools and tile the full
|
|||||||
const free=dockEditorTool(state,'viewport',null,id,rect);assert.ok(!dockIds(free.tree).includes(id));assert.deepEqual(free.floating[id],rect);
|
const free=dockEditorTool(state,'viewport',null,id,rect);assert.ok(!dockIds(free.tree).includes(id));assert.deepEqual(free.floating[id],rect);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
import {editorDockCorners} from '../packages/ui-react/dist/editorDockCorners.js';
|
||||||
|
test('left stacked panels round only the outer top and bottom; close restores both corners',()=>{
|
||||||
|
const tree={axis:'x',ratio:25,first:{axis:'y',ratio:50,first:{id:'a'},second:{id:'b'}},second:{id:'viewport'}};
|
||||||
|
const r=dockRects(tree,bounds);
|
||||||
|
assert.equal(editorDockCorners(r.a,bounds),'top-left');assert.equal(editorDockCorners(r.b,bounds),'bottom-left');
|
||||||
|
assert.equal(editorDockCorners(r.viewport,bounds),'top-right bottom-right');
|
||||||
|
const remaining=dockRects(pruneDockTree(tree,['a','viewport']),bounds);
|
||||||
|
assert.equal(editorDockCorners(remaining.a,bounds),'top-left bottom-left');
|
||||||
|
});
|
||||||
|
test('top and bottom rows retain square seams at every size and canvas origin',()=>{
|
||||||
|
for(const position of ['top','bottom'])for(const area of [bounds,{left:80,top:45,width:713.5,height:528.3}]){
|
||||||
|
const first=dockEditorTool(start,'viewport',{activeId:'a',overId:'viewport',position,scope:'workspace'},'a',rect);
|
||||||
|
const split=dockEditorTool(first,'viewport',{activeId:'b',overId:'a',position:'right',scope:'panel'},'b',rect);
|
||||||
|
const r=dockRects(split.tree,area);
|
||||||
|
assert.equal(editorDockCorners(r.a,area),position+'-left');assert.equal(editorDockCorners(r.b,area),position+'-right');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
import test from 'node:test';
|
||||||
|
import assert from 'node:assert/strict';
|
||||||
|
import {createElement as h} from 'react';
|
||||||
|
import {renderToStaticMarkup} from 'react-dom/server';
|
||||||
|
import {applyNodedcTheme} from '../packages/ui-core/dist/index.js';
|
||||||
|
import {UserProfileMenu} from '../packages/ui-react/dist/index.js';
|
||||||
|
test('flat profile can be switched back and keeps legible white accent in both themes',()=>{
|
||||||
|
const values=new Map(); const element={dataset:{},style:{setProperty:(k,v)=>values.set(k,v)}};
|
||||||
|
for(const theme of ['dark','light']) {
|
||||||
|
applyNodedcTheme(element,{theme,edges:'flat',accent:[255,255,255]});
|
||||||
|
assert.equal(element.dataset.nodedcEdges,'flat'); assert.equal(element.dataset.nodedcTheme,theme);
|
||||||
|
assert.equal(values.get('--nodedc-on-accent-rgb'),'11 17 23');
|
||||||
|
}
|
||||||
|
applyNodedcTheme(element,{theme:'dark',appearance:'default',edges:'default'}); assert.equal(element.dataset.nodedcEdges,'default');
|
||||||
|
});
|
||||||
|
test('profile glyph stays between label and real session avatar',()=>{
|
||||||
|
const markup=renderToStaticMarkup(h(UserProfileMenu,{displayName:'Operator',triggerLabel:'Профиль',triggerIcon:'inbox',avatarUrl:'/avatar.png',actions:[]}));
|
||||||
|
assert.ok(markup.indexOf('Профиль')<markup.indexOf('<svg'));
|
||||||
|
assert.ok(markup.indexOf('<svg')<markup.indexOf('class="nodedc-header__avatar"'));
|
||||||
|
assert.match(markup,/src="\/avatar.png"/); assert.match(markup,/Меню пользователя Operator/);
|
||||||
|
});
|
||||||
@@ -59,3 +59,12 @@ test("Foundry Inspector screens consume the semantic selection field", async ()
|
|||||||
assert.equal((catalog.match(/<InspectorSelectField/g) ?? []).length, 2);
|
assert.equal((catalog.match(/<InspectorSelectField/g) ?? []).length, 2);
|
||||||
assert.match(coreStyles, /\.nodedc-inspector \.nodedc-control-row:has\(\.nodedc-select-anchor\)/);
|
assert.match(coreStyles, /\.nodedc-inspector \.nodedc-control-row:has\(\.nodedc-select-anchor\)/);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("Inspector owns form header and centered action footer around its sections",async()=>{
|
||||||
|
const markup=renderToStaticMarkup(createElement(Inspector,{header:'Form fields',footer:'Action',sections:[{id:'surface',label:'Surface',content:'Controls'},{id:'textures',label:'Textures',content:'Slots'}]}));
|
||||||
|
assert.ok(markup.indexOf('nodedc-inspector__header')<markup.indexOf('nodedc-inspector__group'));
|
||||||
|
assert.ok(markup.indexOf('nodedc-inspector__footer')>markup.lastIndexOf('nodedc-inspector__section'));
|
||||||
|
const css=await readFile(new URL('../packages/ui-core/styles.css',import.meta.url),'utf8');
|
||||||
|
assert.match(css,/\.nodedc-inspector__group\s*\{[^}]*gap: var\(--nodedc-space-3\)/);
|
||||||
|
assert.match(css,/\.nodedc-inspector__footer\s*\{[^}]*justify-content: center/);
|
||||||
|
});
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import test from 'node:test';
|
||||||
|
import assert from 'node:assert/strict';
|
||||||
|
import {applyNodedcTheme, clearNodedcAccent, missionDarkTheme, missionLightTheme} from '../packages/ui-core/dist/index.js';
|
||||||
|
import * as dom from '../packages/ui-dom/dist/index.js';
|
||||||
|
|
||||||
|
test('React-independent and DOM consumers use one full preset, including portals at document root',()=>{
|
||||||
|
const values=new Map();
|
||||||
|
const root={dataset:{},style:{setProperty:(k,v)=>values.set(k,v),removeProperty:k=>values.delete(k)}};
|
||||||
|
assert.equal(dom.missionDarkTheme,missionDarkTheme);
|
||||||
|
assert.ok(Object.isFrozen(missionDarkTheme));
|
||||||
|
applyNodedcTheme(root);
|
||||||
|
assert.deepEqual(root.dataset,{nodedcTheme:'dark',nodedcAppearance:'mission',nodedcEdges:'flat',nodedcUi:'true'});
|
||||||
|
applyNodedcTheme(root,{...missionDarkTheme,accent:[255,255,255]});
|
||||||
|
assert.equal(values.get('--nodedc-on-accent-rgb'),'11 17 23');
|
||||||
|
clearNodedcAccent(root);
|
||||||
|
applyNodedcTheme(root,missionLightTheme);
|
||||||
|
assert.equal(root.dataset.nodedcTheme,'light');
|
||||||
|
assert.equal(root.dataset.nodedcAppearance,'mission');
|
||||||
|
assert.equal(values.size,0,'return to preset must not retain a previous custom accent');
|
||||||
|
applyNodedcTheme(root,{appearance:'default',edges:'default'});
|
||||||
|
assert.equal(root.dataset.nodedcAppearance,'default');
|
||||||
|
assert.equal(root.dataset.nodedcEdges,'default');
|
||||||
|
});
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
import test from 'node:test';
|
||||||
|
import assert from 'node:assert/strict';
|
||||||
|
import { fitModalSize, createModalSizeController } from '../packages/ui-dom/dist/modalSize.js';
|
||||||
|
test('modal dimensions fit narrow and desktop screens without mutating preference', () => {
|
||||||
|
const requested = { width: 1600, height: 900 };
|
||||||
|
assert.deepEqual(fitModalSize(requested, { width: 375, height: 667 }), { width: 343, height: 635 });
|
||||||
|
assert.deepEqual(fitModalSize(requested, { width: 1920, height: 1080 }), requested);
|
||||||
|
assert.deepEqual(requested, { width: 1600, height: 900 });
|
||||||
|
});
|
||||||
|
test('only completed gestures commit; viewport fitting and cancellation preserve preference', () => {
|
||||||
|
class Element extends EventTarget {
|
||||||
|
style = { width: '', height: '', maxHeight: '' }; dataset = {}; attributes = new Map(); children = [];
|
||||||
|
setAttribute(k,v) { this.attributes.set(k,v); } getAttribute(k) { return this.attributes.get(k) ?? null; } removeAttribute(k) { this.attributes.delete(k); }
|
||||||
|
append(value) { this.children.push(value); } remove() {} setPointerCapture() {}
|
||||||
|
getClientRects() { return [1]; } getBoundingClientRect() { return { width: parseFloat(this.style.width), height: parseFloat(this.style.height) }; }
|
||||||
|
querySelector() { return head; }
|
||||||
|
}
|
||||||
|
const head = new Element(), dialog = new Element(), commits = [];
|
||||||
|
const oldWindow = globalThis.window, oldDocument = globalThis.document;
|
||||||
|
globalThis.window = Object.assign(new EventTarget(), { innerWidth: 1600, innerHeight: 1000 });
|
||||||
|
globalThis.document = { createElement: () => new Element() };
|
||||||
|
const dispatch = (target, type, values) => target.dispatchEvent(Object.assign(new Event(type, { cancelable: true }), values));
|
||||||
|
try {
|
||||||
|
const controller = createModalSizeController({ dialog, initialSize: { width: 800, height: 500 }, onSizeCommit: s => commits.push(s) });
|
||||||
|
const edge = dialog.children.find(node => node.dataset.edge === 'se');
|
||||||
|
dispatch(edge, 'pointerdown', {button: 0, pointerId: 1, clientX: 500, clientY: 500});
|
||||||
|
dispatch(window, 'pointermove', {pointerId: 1, clientX: 650, clientY: 600});
|
||||||
|
assert.equal(commits.length, 0);
|
||||||
|
dispatch(window, 'pointerup', {pointerId: 1});
|
||||||
|
assert.deepEqual(commits, [{width: 1100, height: 700}]);
|
||||||
|
window.innerWidth = 500; window.innerHeight = 400; window.dispatchEvent(new Event('resize'));
|
||||||
|
assert.equal(dialog.style.width, '468px'); assert.equal(commits.length, 1);
|
||||||
|
window.innerWidth = 1600; window.innerHeight = 1000; window.dispatchEvent(new Event('resize'));
|
||||||
|
assert.equal(dialog.style.width, '1100px');
|
||||||
|
dispatch(edge, 'pointerdown', {button: 0, pointerId: 2, clientX: 500, clientY: 500});
|
||||||
|
dispatch(window, 'pointermove', {pointerId: 2, clientX: 650, clientY: 600});
|
||||||
|
dispatch(window, 'pointercancel', {pointerId: 2}); assert.equal(dialog.style.width, '1100px'); assert.equal(commits.length, 1);
|
||||||
|
controller.destroy(); assert.equal(dialog.style.width, '');
|
||||||
|
} finally { globalThis.window = oldWindow; globalThis.document = oldDocument; }
|
||||||
|
});
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
import assert from 'node:assert/strict';
|
||||||
|
import test from 'node:test';
|
||||||
|
import postcss from 'postcss';
|
||||||
|
import {readFileSync,readdirSync} from 'node:fs';
|
||||||
|
import {fileURLToPath} from 'node:url';
|
||||||
|
import path from 'node:path';
|
||||||
|
import {auditStyles,typographyViolation,operationalFontSizes,titleFontSize} from '../packages/ui-core/typography.mjs';
|
||||||
|
const root=fileURLToPath(new URL('../',import.meta.url));
|
||||||
|
const policy=JSON.parse(readFileSync(new URL('./typography-policy.json',import.meta.url),'utf8'));
|
||||||
|
function walk(dir){return readdirSync(dir,{withFileTypes:true}).flatMap(e=>['dist','node_modules','tokens'].includes(e.name)?[]:e.isDirectory()?walk(path.join(dir,e.name)):[path.join(dir,e.name)]);}
|
||||||
|
test('all shared CSS uses compact operational roles and canonical title exceptions',()=>{
|
||||||
|
const violations=[];for(const file of walk(path.join(root,'packages')).filter(f=>f.endsWith('.css')))violations.push(...auditStyles(postcss,readFileSync(file,'utf8'),path.relative(root,file),policy));assert.deepEqual(violations,[]);
|
||||||
|
});
|
||||||
|
test('UI roots and portaled windows establish their own 13px typography, independent of host body',()=>{
|
||||||
|
const css=postcss.parse(readFileSync(path.join(root,'packages/ui-core/styles.css'),'utf8'));
|
||||||
|
for(const scope of ['.nodedc-ui-root','.nodedc-window','.nodedc-workspace-window','.nodedc-application-panel','.nodedc-admin-panel']){
|
||||||
|
let base=false,headings=false;css.walkRules(rule=>{if(rule.selector.includes(scope)){if(!rule.selector.includes(' :where(')&&rule.nodes.some(d=>d.prop==='font-size'&&d.value==='var(--nodedc-font-size-md)'))base=true;if(rule.selector.includes(':where(h1, h2, h3, h4, h5, h6)')&&rule.nodes.some(d=>d.prop==='font-size'&&d.value==='var(--nodedc-font-size-md)'))headings=true;}});assert.ok(base,scope+' independent base');assert.ok(headings,scope+' semantic heading reset');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
test('token values cannot silently make all operational consumers larger',()=>{
|
||||||
|
const css=postcss.parse(readFileSync(path.join(root,'packages/tokens/tokens.css'),'utf8'));
|
||||||
|
for(const [role,px] of Object.entries({...operationalFontSizes,title:titleFontSize})){
|
||||||
|
const values=[];css.walkDecls('--nodedc-font-size-'+role,d=>values.push(d.value));assert.ok(values.length,role);for(const value of values)assert.equal(parseFloat(value)*16,px,role);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
test('title role never grants large typography to a data field or nested card',()=>{
|
||||||
|
assert.equal(typographyViolation({file:'example.css',selector:'.nodedc-window__title',property:'font-size',value:'var(--nodedc-font-size-title)'},policy),null);
|
||||||
|
for(const selector of ['.value','.settings-card h2','.nodedc-window__body'])assert.ok(typographyViolation({file:'example.css',selector,property:'font-size',value:'var(--nodedc-font-size-title)'},policy));
|
||||||
|
assert.ok(typographyViolation({file:'example.css',selector:'.value',property:'font-size',value:'16px'},{compactLegacy:['example.css | .value | font-size | 16px']}));
|
||||||
|
});
|
||||||
|
|
||||||
|
test('theme attributes on html cannot shrink the rem coordinate system',()=>{
|
||||||
|
const css=postcss.parse(readFileSync(path.join(root,'packages/ui-core/styles.css'),'utf8'));
|
||||||
|
css.walkRules(rule=>{
|
||||||
|
if(rule.nodes.some(d=>d.prop==='font-size')&&rule.selector.startsWith(':where([data-nodedc-ui]')&&!rule.selector.includes(' :where(')){
|
||||||
|
assert.ok(rule.selector.includes('[data-nodedc-ui]:not(html)'));
|
||||||
|
assert.ok(rule.selector.includes('.nodedc-ui-root:not(html)'));
|
||||||
|
assert.ok(rule.selector.includes('html[data-nodedc-ui] > body'));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -117,3 +117,15 @@ test("both boundaries move, clamp independently, separate after coincidence and
|
|||||||
assert.deepEqual(move([0, 10], 1, 7.3, 0, 10, .5), [0, 7.5]);
|
assert.deepEqual(move([0, 10], 1, 7.3, 0, 10, .5), [0, 7.5]);
|
||||||
assert.deepEqual(move([0, 9], 1, 10.1, 0, 10.1, 3), [0, 10.1]);
|
assert.deepEqual(move([0, 9], 1, 10.1, 0, 10.1, 3), [0, 10.1]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("horizontal thin rail has one native boundary and a formatted value, without field chrome", () => {
|
||||||
|
for(const disabled of [false,true]){
|
||||||
|
const markup=renderToStaticMarkup(createElement(RangeControl,{variant:"rail",label:"Скорость",value:5,min:.1,max:100,step:.1,disabled,formatValue:n=>`${n} м/с`,onChange(){}}));
|
||||||
|
assert.equal((markup.match(/type="range"/g)||[]).length,1);
|
||||||
|
assert.match(markup,/aria-label="Скорость" aria-orientation="horizontal"/);
|
||||||
|
assert.match(markup,/aria-valuetext="5 м\/с"/);
|
||||||
|
assert.match(markup,/nodedc-range-rail__value/);
|
||||||
|
assert.equal(markup.includes('disabled=""'),disabled);
|
||||||
|
assert.doesNotMatch(markup,/nodedc-range__label|nodedc-range__editor|nodedc-glass/);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ test('legacy card paragraphs and live descriptions share small muted typography,
|
|||||||
assert.ok(copy);
|
assert.ok(copy);
|
||||||
assert.match(copy.selectors,/\.nodedc-settings-card__titles p/);
|
assert.match(copy.selectors,/\.nodedc-settings-card__titles p/);
|
||||||
assert.match(copy.selectors,/\.nodedc-settings-card__body :where\(p:not\(\[class\]\)\)/);
|
assert.match(copy.selectors,/\.nodedc-settings-card__body :where\(p:not\(\[class\]\)\)/);
|
||||||
for(const declaration of ['font-family: inherit','font-weight: 400','color: var(--nodedc-text-muted)','font-size: var(--nodedc-font-size-sm)','line-height: 1.4'])assert.ok(copy.body.includes(declaration),declaration);
|
for(const declaration of ['font-family: inherit','font-weight: 400','color: var(--nodedc-text-muted)','font-size: var(--nodedc-description-font-size, var(--nodedc-font-size-sm))','line-height: 1.4'])assert.ok(copy.body.includes(declaration),declaration);
|
||||||
assert.doesNotMatch(copy.selectors,/h[1-6]|button|input|select/);
|
assert.doesNotMatch(copy.selectors,/h[1-6]|button|input|select/);
|
||||||
const markup=renderToStaticMarkup(h(Description,{role:'status','aria-live':'polite'},'Waiting for device'));
|
const markup=renderToStaticMarkup(h(Description,{role:'status','aria-live':'polite'},'Waiting for device'));
|
||||||
assert.match(markup,/role="status"/);assert.match(markup,/aria-live="polite"/);assert.match(markup,/class="nodedc-description"/);
|
assert.match(markup,/role="status"/);assert.match(markup,/aria-live="polite"/);assert.match(markup,/class="nodedc-description"/);
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
import test from 'node:test';
|
||||||
|
import assert from 'node:assert/strict';
|
||||||
|
import {TooltipTitles} from '../packages/ui-react/dist/tooltipTitles.js';
|
||||||
|
class Node {
|
||||||
|
constructor(attributes={},parentElement=null){this.attributes=new Map(Object.entries(attributes));this.parentElement=parentElement;this.textContent='';}
|
||||||
|
getAttribute(name){return this.attributes.get(name)??null;}
|
||||||
|
hasAttribute(name){return this.attributes.has(name);}
|
||||||
|
setAttribute(name,value){this.attributes.set(name,value);}
|
||||||
|
removeAttribute(name){this.attributes.delete(name);}
|
||||||
|
}
|
||||||
|
test('native titles are suppressed through ancestor chain and restored without a duplicate bubble',()=>{
|
||||||
|
const parent=new Node({title:'Parent'}),button=new Node({title:'Inspector','aria-label':'Inspector','aria-describedby':'help'},parent),svg=new Node({},button),titles=new TooltipTitles();
|
||||||
|
assert.deepEqual(titles.find(svg),{element:button,text:'Inspector'});titles.suppress(button);titles.describe(button,'tip');
|
||||||
|
assert.equal(button.getAttribute('title'),null);assert.equal(parent.getAttribute('title'),null);assert.equal(button.getAttribute('aria-describedby'),'help tip');
|
||||||
|
titles.restore();assert.equal(button.getAttribute('title'),'Inspector');assert.equal(parent.getAttribute('title'),'Parent');assert.equal(button.getAttribute('aria-label'),'Inspector');assert.equal(button.getAttribute('aria-describedby'),'help');
|
||||||
|
});
|
||||||
|
test('new titles and external ARIA changes survive cleanup; empty title blocks inherited hints',()=>{
|
||||||
|
const parent=new Node({title:'Parent'}),button=new Node({title:''},parent),titles=new TooltipTitles();assert.equal(titles.find(button),null);
|
||||||
|
button.setAttribute('title','Before');titles.suppress(button);titles.describe(button,'tip');assert.equal(button.getAttribute('aria-label'),'Before');
|
||||||
|
button.setAttribute('title','After');titles.suppress(button);button.setAttribute('aria-label','External');button.setAttribute('aria-describedby','tip extra');
|
||||||
|
titles.restore();assert.equal(button.getAttribute('title'),'After');assert.equal(button.getAttribute('aria-label'),'External');assert.equal(button.getAttribute('aria-describedby'),'extra');
|
||||||
|
});
|
||||||
|
test('SVG controls use the same tooltip channel without a native title element',()=>{
|
||||||
|
const control=new Node({'data-nodedc-tooltip':'Повернуть элемент'}),shape=new Node({},control),titles=new TooltipTitles();
|
||||||
|
assert.deepEqual(titles.find(shape),{element:control,text:'Повернуть элемент'});
|
||||||
|
titles.suppress(control);titles.describe(control,'tip');assert.equal(control.getAttribute('aria-label'),'Повернуть элемент');
|
||||||
|
titles.restore();assert.equal(control.getAttribute('data-nodedc-tooltip'),'Повернуть элемент');assert.equal(control.getAttribute('aria-label'),null);
|
||||||
|
});
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
const fs=require('node:fs'),path=require('node:path'),os=require('node:os'),assert=require('node:assert/strict');
|
||||||
|
// Supply jsdom through the QA NODE_PATH when it is not installed locally.
|
||||||
|
const root=process.env.DG_ROOT||path.resolve(__dirname,'..');
|
||||||
|
const {JSDOM}=require('jsdom'),React=require(root+'/node_modules/react'),{act}=React,{createRoot}=require(root+'/node_modules/react-dom/client');
|
||||||
|
const dom=new JSDOM('<div id="app"></div>',{pretendToBeVisual:true});
|
||||||
|
for(const name of ['window','document','HTMLElement','Element','Node','Event','MouseEvent','KeyboardEvent'])global[name]=dom.window[name];global.IS_REACT_ACT_ENVIRONMENT=true;
|
||||||
|
const scratch=fs.mkdtempSync(path.join(os.tmpdir(),'nodedc-tree-check-'));
|
||||||
|
require(root+'/node_modules/esbuild').buildSync({entryPoints:[root+'/packages/ui-react/src/Tree.tsx'],outfile:scratch+'/tree.cjs',bundle:true,platform:'node',format:'cjs',external:['react','react/*'],jsx:'automatic'});
|
||||||
|
const {Tree}=require(scratch+'/tree.cjs');
|
||||||
|
HTMLElement.prototype.getBoundingClientRect=function(){
|
||||||
|
const host=this.closest('[role=tree]');if(this===host)return{top:0,bottom:140,left:0,right:400,width:400,height:140};
|
||||||
|
const i=host?[...host.querySelectorAll('[role=treeitem]')].indexOf(this):0,top=i*28-(host?.scrollTop||0);return{top,bottom:top+28,left:0,right:400,width:400,height:28};
|
||||||
|
};
|
||||||
|
let visible=true,selected='leaf99',revision=0,selectedCalls=0,available=true;
|
||||||
|
const nodes=()=>[{id:'root',label:'Root',visible,children:available?Array.from({length:100},(_,i)=>({id:'leaf'+i,label:'Leaf '+i})):[]}];
|
||||||
|
const ui=createRoot(document.getElementById('app'));
|
||||||
|
const render=()=>act(async()=>ui.render(React.createElement(Tree,{nodes:nodes(),selected,revealKey:revision,label:'Tree test',defaultExpandedDepth:1,onSelect:()=>selectedCalls++,onVisibilityChange:(_,v)=>{visible=v;}})));
|
||||||
|
const button=label=>[...document.querySelectorAll('button')].find(b=>b.getAttribute('aria-label')===label);
|
||||||
|
const send=(target,type='click',props={})=>act(async()=>target.dispatchEvent(new MouseEvent(type,{bubbles:true,...props})));
|
||||||
|
(async()=>{
|
||||||
|
await render();const host=document.querySelector('[role=tree]');assert(host.scrollTop>0,'external leaf selection reveals the leaf');
|
||||||
|
await send(button('Свернуть Root'));host.scrollTop=0;assert.equal(document.querySelectorAll('[role=treeitem]').length,1);
|
||||||
|
await send(button('Скрыть Root'));await render();assert.equal(document.querySelectorAll('[role=treeitem]').length,1,'visibility refresh cannot re-open selected ancestors');assert.equal(host.scrollTop,0);assert.equal(selectedCalls,0);
|
||||||
|
await send(button('Развернуть Root'));assert.equal(document.querySelectorAll('[role=treeitem]').length,101);assert.equal(host.scrollTop,0,'disclosure must not reveal old selected leaf');
|
||||||
|
await send(button('Свернуть Root'));await send(document.querySelector('[role=treeitem]'),'dblclick');assert.equal(document.querySelectorAll('[role=treeitem]').length,1,'only disclosure, not row double-click, expands');
|
||||||
|
revision++;await render();assert.equal(document.querySelectorAll('[role=treeitem]').length,101);assert(host.scrollTop>0,'explicit external reveal still works');
|
||||||
|
selected='later';available=false;await render();selected='leaf99';await render();assert.equal(document.querySelectorAll('[role=treeitem]').length,1);available=true;await render();assert.equal(document.querySelectorAll('[role=treeitem]').length,101);assert(host.scrollTop>0,'pending selection is revealed when async children arrive');
|
||||||
|
await act(async()=>ui.unmount());console.log('PASS: 6 Tree DOM scenarios — visibility/disclosure independence, no disclosure scroll jump, eye does not select, row double-click does not expand, explicit reveal, async reveal.');
|
||||||
|
})().catch(e=>{console.error(e);process.exitCode=1;}).finally(()=>{fs.rmSync(scratch,{recursive:true,force:true});dom.window.close();});
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
import {test} from 'node:test';
|
||||||
|
import assert from 'node:assert/strict';
|
||||||
|
import {treeSelectionRange} from '../packages/ui-react/dist/treeSelectionRange.js';
|
||||||
|
test('tree ranges include endpoints in both directions and only visible rows',()=>{
|
||||||
|
const visible=['project','group','first','last','other'];
|
||||||
|
assert.deepEqual(treeSelectionRange(visible,'first','last'),['first','last']);
|
||||||
|
assert.deepEqual(treeSelectionRange(visible,'last','first'),['first','last']);
|
||||||
|
assert.deepEqual(treeSelectionRange(visible,'filtered-out','last'),['last']);
|
||||||
|
assert.deepEqual(treeSelectionRange(visible,null,'first'),['first']);
|
||||||
|
});
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user