Establish Mission Core as the shared theme foundation

This commit is contained in:
DCCONSTRUCTIONS
2026-11-05 13:46:35 +03:00
parent 06cb8ad4cd
commit 3750a94200
17 changed files with 240 additions and 107 deletions
+2
View File
@@ -12,6 +12,8 @@ Before adding UI to a NODE.DC application:
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.
- 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.
+9 -6
View File
@@ -1,6 +1,7 @@
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 { createTemplateFeatures, getPageTemplate, pageTemplates, type PageTemplateDefinition } from "@nodedc/page-patterns";
import {MissionThemeExample} from './MissionThemeExample';
import {EditorDockExample} from './EditorDockExample';
import {
ActivityIndicator,
@@ -121,7 +122,8 @@ const designProfileDocumentPath = (reference: { id: string; version: string; sta
);
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: "Blush", value: [255, 108, 175], hex: "#ff6caf" },
{ label: "Magenta", value: [215, 70, 255], hex: "#d746ff" },
@@ -147,7 +149,7 @@ const materialDefaults: Record<NodedcTheme, MaterialDraft> = {
panelOpacity: 100,
fieldHex: "#2a2a2c",
fieldOpacity: 100,
nestedHex: "#0b0b0d",
nestedHex: "#0d0d0f",
},
light: {
panelHex: "#ffffff",
@@ -334,7 +336,7 @@ function Preview({ title, note, children, className }: {
export function CatalogApp() {
const [theme, setTheme] = useState<NodedcTheme>("dark");
const [accentHex, setAccentHex] = useState("#ff2f92");
const [accentHex, setAccentHex] = useState("#f7f8f4");
const [materialByTheme, setMaterialByTheme] = useState<Record<NodedcTheme, MaterialDraft>>(() => ({
dark: { ...materialDefaults.dark },
light: { ...materialDefaults.light },
@@ -387,7 +389,7 @@ export function CatalogApp() {
const [glowDistance, setGlowDistance] = useState(105);
const [usePortColors, setUsePortColors] = useState(false);
const [connectionType, setConnectionType] = useState("spline");
const [lightColor, setLightColor] = useState("#ff2f92");
const [lightColor, setLightColor] = useState("#f7f8f4");
const [connectionColor, setConnectionColor] = useState("#404040");
const [fillColor, setFillColor] = useState("#ff6caf");
const [fillOpacity, setFillOpacity] = useState(100);
@@ -408,8 +410,8 @@ export function CatalogApp() {
const [splitPaneDemoSize, setSplitPaneDemoSize] = useState(50);
const [sidePanelDemoOpen, setSidePanelDemoOpen] = useState(true);
const [createModalOpen, setCreateModalOpen] = useState(false);
const [missionAppearance, setMissionAppearance] = useState(false);
const [flatEdges, setFlatEdges] = useState(false);
const [missionAppearance, setMissionAppearance] = useState(true);
const [flatEdges, setFlatEdges] = useState(true);
const [featureSettingsDemoOpen, setFeatureSettingsDemoOpen] = useState(false);
const [featureSettingsDemoSection, setFeatureSettingsDemoSection] = useState('general');
const [confirmOpen, setConfirmOpen] = useState(false);
@@ -1393,6 +1395,7 @@ export function CatalogApp() {
case "controls":
return (
<div className="catalog-grid">
<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 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">
<div className="catalog-form">
+25
View File
@@ -0,0 +1,25 @@
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=<GlassSurface className="catalog-theme-fields" tone="soft" padding="md" materialRim={false}>
<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/>
</GlassSurface>;
return <SettingsCard title="Фундамент Mission Core" description="Единая тёмная тема: поверхности, поля, действия и окна." actions={<Switch label="Включено" checked={enabled} onChange={setEnabled}/>}>
{fields}
<StatusBadge tone="success">Сохранено</StatusBadge>
<Button variant="primary" onClick={()=>setOpen(true)}>Открыть настройки</Button>
<Description>Вложенные формы используют GlassSurface tone="soft"; поля остаются различимыми на любой глубине.</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>;
}
+1
View File
@@ -2304,3 +2304,4 @@ textarea {
grid-template-columns: 1fr;
}
}
.catalog-theme-fields { display: grid; gap: var(--nodedc-space-4); }
+10
View File
@@ -124,3 +124,13 @@ already in AppHeader, HeaderProfileButton, IconButton and HeaderAvatar. The owne
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 and opaque GlassSurface soft; no CMS palette.
Mission Core itself remains on its existing local package state; its duplicated base overrides are recorded migration debt, not silently updated.
+5
View File
@@ -537,3 +537,8 @@ Window: `rect` / `onRectCommit` — восстановление и фиксац
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 использует семантическую поверхность группы, GlassSurface tone="soft" — непрозрачную вложенную область. Ни CMS, ни другой потребитель не повторяет палитру локально. Living catalog содержит форму и её портальную версию.
+61 -67
View File
@@ -1,82 +1,76 @@
# Темы и цвет приложения
## Основное правило
## Один фундамент
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;
- основной и вторичный текст;
- accent и автоматически вычисляемый on-accent;
- цвет непрозрачных application surfaces;
- field/control surfaces;
- overlay;
- тени controls и modal material;
- semantic success/warning/danger tones при необходимости.
Те же exports доступны из `@nodedc/ui-dom`. `applyNodedcTheme(root)` по умолчанию
выбирает `dark / mission / flat`. `missionLightTheme` сохраняет общую геометрию
и даёт светлую тему. Установка на `document.documentElement` обязательна для
приложения с порталами: меню и модальные окна получают тот же профиль.
## Что тема не меняет
## Роли поверхностей
- высоту контролов;
- радиусы по классам компонентов;
- положение логотипа;
- механику окна и dropdown;
- DOM anatomy;
- keyboard behavior;
- расположение footer actions;
- API React/DOM компонентов.
| Роль | Тёмная тема | Компонент |
| --- | --- | --- |
| Фон приложения | `#050506` | ApplicationShell |
| Рабочая сцена | `#08090b` | доменный viewport, token `--nodedc-stage` |
| Панель | `#151517` | ApplicationPanel, AdminNavigationPanel |
| Группа | нейтральный слой `110 110 110 / .07` | SettingsCard |
| Вложенная область | `#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 → GlassSurface tone="soft" → поля — общая
композиция вложенной формы. Каждая роль выбирается компонентом, а не локальной
заливкой. Не накладывать всё новые полупрозрачные карточки: на глубине их цвет
приближается к полю. Вложенная область имеет непрозрачную подложку.
Не помещать дополнительную карточку вокруг каждого отдельного поля.
В baseline включены `dark` и `light`. Это не два отдельных продукта, а примеры одного контракта:
Основной/вторичный/приглушённый/недоступный текст использует оттенок
`247 248 244` с непрозрачностью `.96 / .72 / .48 / .34`. Состояния hover,
active, focus, disabled задаёт библиотека; приложения не переопределяют их.
Hover поля использует собственный непрозрачный материал, а не полупрозрачную
заливку кнопки: поле не исчезает при наведении.
Декоративные рамки и контуры отсутствуют. Клавиатурный фокус остаётся видимым
через контрастную заливку. Success/warning/danger сохраняют смысловые цвета
индикаторов; цвет акцента не подменяет состояние ошибки.
- dark соответствует текущей основной семье Launcher/Hub/CMS;
- light воспроизводит SEO-поверхности: `#ececec` canvas, белые панели и поля, тёмный текст, чёрные primary actions и мягкую тень у белых secondary controls;
- конкретный продукт может поверх preset задать свой accent и surface variables.
## Акцент и настройки
## Accent
Базовый акцент тёмной темы — `247 248 244`, светлой — `24 25 28`.
Пользовательский `accent` остаётся допустимой настройкой активных контролов.
`on-accent` вычисляется библиотекой по яркости. Нейтральное основное действие
остаётся нейтральным. Возврат к теме вызывает `clearNodedcAccent(root)`, затем
`applyNodedcTheme`; удалять пользовательское значение без явного сброса нельзя.
Материалы можно исследовать в каталоге; приложения не должны хранить собственный
набор цветов для восстановления стандартной темы.
Accent задаётся RGB tuple. On-accent вычисляется по luminance и не должен вручную прописываться белым или чёрным в отдельном компоненте.
В светлой теме canvas — `#ececec`, панели и поля — белые, группы и вложенные
области — `#f4f4f4`. Белое поле различимо внутри группы.
Map-glass остаётся отдельным светлым полупрозрачным материалом над изображением;
он не заменяет обычную тему форм, панелей и портальных окон.
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.
## Проверка и совместимость
Semantic status не обязан совпадать с accent. Например, ошибка остаётся danger, даже если приложение использует красный брендовый accent.
Living catalog: Controls → Mission Core. Проверяются вложенная форма, текст,
select, textarea, disabled, переключатель, статус и то же содержимое в портальном
окне; дополнительно проверяются клавиатура и обе темы. CMS использует этот же
профиль и immutable npm-пакеты, не копию исходников компонентов.
## Область применения
Тема может быть установлена:
- на корневом `html/body` для всего приложения;
- на контейнере embedded-модуля;
- на 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.
## Flat surfaces
`applyNodedcTheme(root, { theme, accent, edges: "flat" })` removes decorative borders and rims from controls, navigation and portal surfaces. Focus uses a contrasting fill; geometry and focus behavior remain unchanged. CMS uses flat surfaces with a white default accent. Other consumers keep `edges: "default"`.
`appearance: "default", edges: "default"` оставлены для явной совместимости
со старой презентацией компонентов. Новые потребители используют Mission.
Эта ревизия не меняет локальный Mission Core и его незакоммиченные эксперименты.
Его прежние локальные CSS-дубли зафиксированы как миграционный долг: перенос
зависимости требует отдельной проверки приложения, а не незаметной замены пакетов.
+3 -2
View File
@@ -11,7 +11,7 @@
"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: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 && npm run test:flat-theme",
"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 && npm run test:flat-theme && npm run test:mission-theme",
"dev": "npm run build:packages && npm run dev --workspace @nodedc/ui-catalog",
"serve": "node server/catalog-server.mjs",
"validate:registry": "node scripts/validate-registry.mjs",
@@ -46,7 +46,8 @@
"test:settings-surfaces": "node --test scripts/settings-surfaces.test.mjs",
"test:window-geometry": "node --test scripts/window-geometry.test.mjs",
"test:editor-dock": "node --test scripts/editor-dock.test.mjs",
"test:flat-theme": "node --test scripts/flat-theme.test.mjs"
"test:flat-theme": "node --test scripts/flat-theme.test.mjs",
"test:mission-theme": "node --test scripts/mission-theme.test.mjs"
},
"engines": {
"node": ">=20"
+31 -5
View File
@@ -1,4 +1,5 @@
: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-hover: #fff;
--nodedc-neutral-action-color: rgba(8, 8, 10, 0.96);
@@ -9,14 +10,16 @@
:root,
[data-nodedc-theme="dark"] {
color-scheme: dark;
--nodedc-accent-rgb: 255 47 146;
--nodedc-on-accent-rgb: 11 17 23;
--nodedc-accent-rgb: 247 248 244;
--nodedc-on-accent-rgb: 8 8 10;
--nodedc-danger-rgb: 255 116 116;
--nodedc-warning-rgb: 255 209 102;
--nodedc-success-rgb: 181 255 90;
--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-secondary: rgba(247, 248, 244, 0.72);
--nodedc-text-muted: rgba(247, 248, 244, 0.48);
@@ -82,14 +85,16 @@
[data-nodedc-theme="light"] {
color-scheme: light;
--nodedc-accent-rgb: 255 47 146;
--nodedc-on-accent-rgb: 11 17 23;
--nodedc-accent-rgb: 24 25 28;
--nodedc-on-accent-rgb: 247 248 244;
--nodedc-danger-rgb: 205 47 67;
--nodedc-warning-rgb: 173 111 0;
--nodedc-success-rgb: 46 125 76;
--nodedc-canvas: #ececec;
--nodedc-canvas-soft: #f4f4f4;
--nodedc-stage: #ececec;
--nodedc-surface-group: #f4f4f4;
--nodedc-text-primary: rgba(18, 20, 22, 0.96);
--nodedc-text-secondary: rgba(18, 20, 22, 0.7);
--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-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;
}
+11 -2
View File
@@ -15,7 +15,7 @@ export interface NodedcMaterial {
export interface ApplyThemeOptions {
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";
/** Flat surfaces remove decorative edges; keyboard focus uses a contrasting fill. */
edges?: "default" | "flat";
@@ -23,6 +23,15 @@ export interface ApplyThemeOptions {
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 {
return `${red} ${green} ${blue}`;
}
@@ -33,7 +42,7 @@ function clampOpacity(value: number): number {
export function applyNodedcTheme(
target: HTMLElement,
{ theme = "dark", accent, material, appearance = "default", edges = "default" }: ApplyThemeOptions = {},
{ theme = "dark", accent, material, appearance = "mission", edges = "flat" }: ApplyThemeOptions = {},
): void {
target.dataset.nodedcTheme = theme;
target.dataset.nodedcAppearance = appearance;
+5 -20
View File
@@ -422,7 +422,7 @@
}
.nodedc-field__control:hover:not(:disabled) {
background: var(--nodedc-glass-control-hover);
background: var(--nodedc-field-hover-bg);
}
.nodedc-field__control:focus-visible {
@@ -647,7 +647,7 @@ textarea.nodedc-field__control {
min-width: 0;
gap: 1rem;
border-radius: var(--nodedc-radius-card);
background: var(--nodedc-glass-control-bg);
background: var(--nodedc-surface-group);
padding: 1rem;
}
@@ -4380,26 +4380,11 @@ textarea.nodedc-field__control {
.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; }
/* 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. */
[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"][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"][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); }
+1 -1
View File
@@ -1,4 +1,4 @@
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 "./floating.js";
export * from "./mediaSource.js";
+23 -1
View File
@@ -1,6 +1,28 @@
{
"schemaVersion": "1.0.0",
"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 → GlassSurface tone=soft → field is the admitted nested form hierarchy. Never synthesize translucent app-local cards.",
"No decorative outlines; keyboard focus, disabled states and semantic error/success indicators remain visible."
],
"documentation": "../docs/THEMING.md"
},
{
"id": "progress-button",
"status": "baseline",
@@ -109,7 +131,7 @@
],
"rules": [
"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.",
"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.",
+14 -2
View File
@@ -66,11 +66,23 @@
"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.",
"appearanceProfiles": {
"default": "Existing theme/material behavior",
"mission": "Opt-in operator appearance, qualified against live Mission Core 2026-09-30; shared modal/floating surfaces, neutral avatars and dot statuses"
"default": "Explicit legacy component presentation; no application-local overrides.",
"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"
}
}
}
+15
View File
@@ -108,6 +108,21 @@
"docs/ARCHITECTURE.md"
],
"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"
]
}
]
}
+1 -1
View File
@@ -11,7 +11,7 @@ test('flat profile can be switched back and keeps legible white accent in both t
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'}); assert.equal(element.dataset.nodedcEdges,'default');
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:[]}));
+23
View File
@@ -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');
});