From 4904fbe1f7ae89d1a64ff898eb457e0de1240548 Mon Sep 17 00:00:00 2001 From: DCCONSTRUCTIONS Date: Thu, 5 Nov 2026 12:07:32 +0300 Subject: [PATCH 1/8] docs: record DC CMS package adoption and adapter ownership --- docs/ADOPTION.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/ADOPTION.md b/docs/ADOPTION.md index b8efb7e..6ee2f55 100644 --- a/docs/ADOPTION.md +++ b/docs/ADOPTION.md @@ -87,3 +87,21 @@ The component contract and catalog example are in `ENVIRONMENT_SETTINGS.md`. ## 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 не публиковался, исходники компонентов в приложение не копируются. + +## 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. From 8addef187b316c98751a7d080a7fc37927f9e001 Mon Sep 17 00:00:00 2001 From: DCCONSTRUCTIONS Date: Thu, 5 Nov 2026 12:33:25 +0300 Subject: [PATCH 2/8] feat(ui): add flat surfaces and compact profile/site controls --- apps/catalog/src/CatalogApp.tsx | 10 +++++--- docs/ADOPTION.md | 7 ++++++ docs/COMPONENTS.md | 6 +++++ docs/THEMING.md | 4 ++++ package.json | 5 ++-- packages/ui-core/src/theme.ts | 5 +++- packages/ui-core/styles.css | 28 +++++++++++++++++++++++ packages/ui-react/src/Select.tsx | 5 +++- packages/ui-react/src/UserProfileMenu.tsx | 4 ++++ registry/components.json | 9 +++++--- registry/registry.json | 4 ++++ scripts/flat-theme.test.mjs | 21 +++++++++++++++++ 12 files changed, 98 insertions(+), 10 deletions(-) create mode 100644 scripts/flat-theme.test.mjs diff --git a/apps/catalog/src/CatalogApp.tsx b/apps/catalog/src/CatalogApp.tsx index 0715ebd..9bc6bfe 100644 --- a/apps/catalog/src/CatalogApp.tsx +++ b/apps/catalog/src/CatalogApp.tsx @@ -410,6 +410,7 @@ export function CatalogApp() { const [sidePanelDemoOpen, setSidePanelDemoOpen] = useState(true); const [createModalOpen, setCreateModalOpen] = useState(false); const [missionAppearance, setMissionAppearance] = useState(false); + const [flatEdges, setFlatEdges] = useState(false); const [featureSettingsDemoOpen, setFeatureSettingsDemoOpen] = useState(false); const [featureSettingsDemoSection, setFeatureSettingsDemoSection] = useState('general'); const [confirmOpen, setConfirmOpen] = useState(false); @@ -549,6 +550,7 @@ export function CatalogApp() { applyNodedcTheme(document.documentElement, { theme, appearance: missionAppearance ? "mission" : "default", + edges: flatEdges ? "flat" : "default", accent, material: { panel: panelMaterial, @@ -558,7 +560,7 @@ export function CatalogApp() { }, }); 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(() => { applyGlassMaterial(document.documentElement, glassMaterial); @@ -1408,7 +1410,7 @@ export function CatalogApp() { + + ; + return }> + {fields} + Сохранено + + Вложенные формы используют GlassSurface tone="soft"; поля остаются различимыми на любой глубине. + setOpen(false)} title="Настройки темы" identity={{title:'Профиль',subtitle:'Mission Core',avatarLabel:'DC'}} sections={[{id:'appearance',label:'Оформление',group:'Общие'}]} activeSection="appearance" onSectionChange={()=>{}}> + {fields} + + ; +} diff --git a/apps/catalog/src/styles.css b/apps/catalog/src/styles.css index e517c63..e0fb345 100644 --- a/apps/catalog/src/styles.css +++ b/apps/catalog/src/styles.css @@ -2304,3 +2304,4 @@ textarea { grid-template-columns: 1fr; } } +.catalog-theme-fields { display: grid; gap: var(--nodedc-space-4); } diff --git a/docs/ADOPTION.md b/docs/ADOPTION.md index 0611c13..a8cc659 100644 --- a/docs/ADOPTION.md +++ b/docs/ADOPTION.md @@ -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. diff --git a/docs/COMPONENTS.md b/docs/COMPONENTS.md index 4ce5afb..907a434 100644 --- a/docs/COMPONENTS.md +++ b/docs/COMPONENTS.md @@ -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 содержит форму и её портальную версию. diff --git a/docs/THEMING.md b/docs/THEMING.md index 9869d7c..7ce6ce2 100644 --- a/docs/THEMING.md +++ b/docs/THEMING.md @@ -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-дубли зафиксированы как миграционный долг: перенос +зависимости требует отдельной проверки приложения, а не незаметной замены пакетов. diff --git a/package.json b/package.json index 4732651..6f1b0ef 100644 --- a/package.json +++ b/package.json @@ -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" diff --git a/packages/tokens/themes.css b/packages/tokens/themes.css index 19efd01..e1c94aa 100644 --- a/packages/tokens/themes.css +++ b/packages/tokens/themes.css @@ -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; +} diff --git a/packages/ui-core/src/theme.ts b/packages/ui-core/src/theme.ts index 8575e95..f64614a 100644 --- a/packages/ui-core/src/theme.ts +++ b/packages/ui-core/src/theme.ts @@ -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; diff --git a/packages/ui-core/styles.css b/packages/ui-core/styles.css index 3ca4295..a80af78 100644 --- a/packages/ui-core/styles.css +++ b/packages/ui-core/styles.css @@ -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); } diff --git a/packages/ui-dom/src/index.ts b/packages/ui-dom/src/index.ts index 3fecfcb..cfc342d 100644 --- a/packages/ui-dom/src/index.ts +++ b/packages/ui-dom/src/index.ts @@ -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"; diff --git a/registry/components.json b/registry/components.json index 882c661..cf4095d 100644 --- a/registry/components.json +++ b/registry/components.json @@ -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.", diff --git a/registry/registry.json b/registry/registry.json index 60204f2..1090498 100644 --- a/registry/registry.json +++ b/registry/registry.json @@ -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" + } } } diff --git a/registry/sources.json b/registry/sources.json index fdcbfa6..b07aa61 100644 --- a/registry/sources.json +++ b/registry/sources.json @@ -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" + ] } ] } diff --git a/scripts/flat-theme.test.mjs b/scripts/flat-theme.test.mjs index ba38897..ce9f64c 100644 --- a/scripts/flat-theme.test.mjs +++ b/scripts/flat-theme.test.mjs @@ -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:[]})); diff --git a/scripts/mission-theme.test.mjs b/scripts/mission-theme.test.mjs new file mode 100644 index 0000000..05a376c --- /dev/null +++ b/scripts/mission-theme.test.mjs @@ -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'); +}); From 189bb7037740f577cc65e72f2b7c07651201ef19 Mon Sep 17 00:00:00 2001 From: DCCONSTRUCTIONS Date: Thu, 5 Nov 2026 16:00:16 +0300 Subject: [PATCH 7/8] fix(ui): match Mission Core form grouping without recessed canvases --- apps/catalog/src/MissionThemeExample.tsx | 9 ++++++--- docs/ADOPTION.md | 11 +++++++++++ docs/COMPONENTS.md | 5 +++-- docs/THEMING.md | 18 ++++++++++++------ packages/ui-core/styles.css | 6 ++++++ packages/ui-react/src/Glass.tsx | 2 +- registry/components.json | 7 ++++--- 7 files changed, 43 insertions(+), 15 deletions(-) diff --git a/apps/catalog/src/MissionThemeExample.tsx b/apps/catalog/src/MissionThemeExample.tsx index 7abcfa7..3e72594 100644 --- a/apps/catalog/src/MissionThemeExample.tsx +++ b/apps/catalog/src/MissionThemeExample.tsx @@ -7,17 +7,20 @@ export function MissionThemeExample() { const [name,setName]=useState('Mission Core'); const [enabled,setEnabled]=useState(true); const [mode,setMode]=useState('review'); - const fields= + const fields=
setName(event.target.value)}/>