Use the shared Mission Core theme foundation in CMS
DC CMS qualification / qualify (push) Successful in 1m48s
DC CMS qualification / qualify (push) Successful in 1m48s
This commit is contained in:
+1
-1
File diff suppressed because one or more lines are too long
+17
-17
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
@@ -99,3 +99,21 @@ in both themes without adding borders or changing input tokens.
|
||||
Form groups outside collections use the same nested surface so light-theme
|
||||
white inputs remain separated from white outer panels; collections already
|
||||
provide that surface and do not receive a second wrapper or double padding.
|
||||
|
||||
|
||||
## Mission Core foundation — 2026-11-05
|
||||
|
||||
Pinned Design Guideline: `3750a9420058fb76880cd73bb9f2d106d7cd10d5`.
|
||||
CMS applies `missionDarkTheme` / `missionLightTheme` at documentElement, so menus
|
||||
and settings portals share the same profile. The library owns all palette values;
|
||||
reset clears a custom accent and returns to the preset. Existing explicit user
|
||||
accent preferences remain supported. The static HTML declares Mission/flat before
|
||||
JavaScript to avoid a flash of the legacy appearance.
|
||||
|
||||
Nested forms use the same SettingsCard → GlassSurface soft → field composition
|
||||
as the living catalog. Media-stage and dropdown materials now reference shared
|
||||
tokens. No business module, site data, deployment settings or server API changed.
|
||||
|
||||
Validation: deterministic generated build, multisite and release-contract tests;
|
||||
local browser checks of the reported navigation-link fields, dark/light, settings
|
||||
through the profile menu, custom accent, reset, and Escape focus restoration.
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ const shell = html(h(ApplicationShell, { id: "cms-shell", header, stage: h("div"
|
||||
const icons = ["close", "plus", "chevron-up", "chevron-down", "copy", "clipboard", "trash", "eye", "eye-off", "layers", "panel", "file", "settings", "folder", "image", "video", "refresh", "move", "edit"];
|
||||
const templates = Object.entries({ nestedSurface: h(GlassSurface, {tone:"soft", padding:"md", materialRim:false}, h("span")), dragHandle: h(DragHandle, {label:"Перетащить блок"}), button: h(Button, null, "\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0435"), iconButton: h(IconButton, { label: "\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0435" }, icon("plus")), field: h(FieldFrame, { label: "\u041F\u043E\u043B\u0435" }, h("span", { "data-slot": "control" })), text: h(TextField, { id: "template-field", label: "\u041F\u043E\u043B\u0435" }), card: h(SettingsCard, { eyebrow: "\u0420\u0430\u0437\u0434\u0435\u043B", title: "\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435", description: "\u041E\u043F\u0438\u0441\u0430\u043D\u0438\u0435" }, h("div", { "data-slot": "body" })), media: h(MediaSourceField, { label: "\u041C\u0435\u0434\u0438\u0430", source: "file", url: "", onSourceChange: noop, onUrlChange: noop, onFileChange: noop }), ...Object.fromEntries(icons.map((name) => ["icon-" + name, icon(name)])) }).map(([name, node]) => `<template id="ds-${name}">${html(node)}</template>`).join("\n");
|
||||
const page = `<!doctype html>
|
||||
<html lang="ru" data-nodedc-ui="true" data-nodedc-theme="dark"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="design-system-commit" content="${lock.sourceCommit}"><title>NODE.DC \u2014 CMS</title><link rel="stylesheet" href="./admin.css"></head><body>${shell}
|
||||
<html lang="ru" data-nodedc-ui="true" data-nodedc-theme="dark" data-nodedc-appearance="mission" data-nodedc-edges="flat"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="design-system-commit" content="${lock.sourceCommit}"><title>NODE.DC \u2014 CMS</title><link rel="stylesheet" href="./admin.css"></head><body>${shell}
|
||||
${await read("modals.html")}
|
||||
${templates}
|
||||
<script type="module" src="./admin.js"><\/script></body></html>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"repository": "https://git.dcserve.ru/SILVER/NODEDC_DESIGN_GUIDELINE.git",
|
||||
"sourceCommit": "06cb8ad4cd193ae1b4b1ac40a513fd642e12b878",
|
||||
"sourceCommit": "3750a9420058fb76880cd73bb9f2d106d7cd10d5",
|
||||
"distribution": "immutable npm pack artifacts; no copied component sources",
|
||||
"packages": {
|
||||
"nodedc-tokens-0.6.0.tgz": "3cfbcec8a10d367688eb1d6e93b774cf2c06b360f465cef6f9866719e5db4616",
|
||||
"nodedc-ui-dom-0.7.0.tgz": "9a5b01a9e2ee42d52ed94184db0297c047c19783fccd44618cc0dc7ac5f9d6df",
|
||||
"nodedc-ui-react-0.7.0-header.2.tgz": "75663592cfc1cb4fab77454801a6d9e053a8f4a30b52c5ad24e6b100c231fc6c",
|
||||
"nodedc-ui-core-0.7.0-header.1.tgz": "381fdca20fb9eed453d2cfdd1e0519dddc11bbf87fc79d27c158e7edd94ce899"
|
||||
"nodedc-tokens-0.6.0-mission.1.tgz": "2ed76a0e68edacac0ad6c105e8f382730f4bc87ae437728f02b17fe71c63354a",
|
||||
"nodedc-ui-core-0.7.0-mission.1.tgz": "e533d936aaf46cfd0f0cc7681de2df6db47434c5cf922d456b9dc2a4d37431e8",
|
||||
"nodedc-ui-dom-0.7.0-mission.1.tgz": "7865b0fabe13e08196e9edecf02bf74443385986b4aa636cb422b2f7a4bc7228",
|
||||
"nodedc-ui-react-0.7.0-mission.1.tgz": "75663592cfc1cb4fab77454801a6d9e053a8f4a30b52c5ad24e6b100c231fc6c"
|
||||
}
|
||||
}
|
||||
|
||||
Generated
+11
-11
@@ -6,10 +6,10 @@
|
||||
"": {
|
||||
"name": "dc-cms-ui-build",
|
||||
"dependencies": {
|
||||
"@nodedc/tokens": "file:vendor/nodedc-tokens-0.6.0.tgz",
|
||||
"@nodedc/ui-core": "file:vendor/nodedc-ui-core-0.7.0-header.1.tgz",
|
||||
"@nodedc/ui-dom": "file:vendor/nodedc-ui-dom-0.7.0.tgz",
|
||||
"@nodedc/ui-react": "file:vendor/nodedc-ui-react-0.7.0-header.2.tgz",
|
||||
"@nodedc/tokens": "file:vendor/nodedc-tokens-0.6.0-mission.1.tgz",
|
||||
"@nodedc/ui-core": "file:vendor/nodedc-ui-core-0.7.0-mission.1.tgz",
|
||||
"@nodedc/ui-dom": "file:vendor/nodedc-ui-dom-0.7.0-mission.1.tgz",
|
||||
"@nodedc/ui-react": "file:vendor/nodedc-ui-react-0.7.0-mission.1.tgz",
|
||||
"esbuild": "0.28.1",
|
||||
"react": "19.2.7",
|
||||
"react-dom": "19.2.7"
|
||||
@@ -486,28 +486,28 @@
|
||||
},
|
||||
"node_modules/@nodedc/tokens": {
|
||||
"version": "0.6.0",
|
||||
"resolved": "file:vendor/nodedc-tokens-0.6.0.tgz",
|
||||
"integrity": "sha512-wDI3AzIfax+TDGYDokTSRyKhCGTXzaXZxFqiY7QHrI1oDln0NPYBmORKwp2jQP6i436OC1XpEhQ9CTqrIyCpbg=="
|
||||
"resolved": "file:vendor/nodedc-tokens-0.6.0-mission.1.tgz",
|
||||
"integrity": "sha512-8hoq5hjMTvcCZMFRnKHD9/DYIJ4MaywBn69y7dgJI1Kwtuj2AtoxI9fRN8JTZ6hBiRv0lvmi23ogmzLkF4EWLg=="
|
||||
},
|
||||
"node_modules/@nodedc/ui-core": {
|
||||
"version": "0.7.0",
|
||||
"resolved": "file:vendor/nodedc-ui-core-0.7.0-header.1.tgz",
|
||||
"integrity": "sha512-p+U7KdHfb7vbEW0eQIjU6bno/rKjlHp/lLtLC0xM7gY7MdmIO+hbqYBGPTjDG78255wq/UltJt+Fa35g1y62YA==",
|
||||
"resolved": "file:vendor/nodedc-ui-core-0.7.0-mission.1.tgz",
|
||||
"integrity": "sha512-C3/orF7aUvrFq5fAOxrWd8a+uxLvpj9QppDf1kJyERsDTScHRwWIaMDhBzxytQc5rV4lZ/Ovp5wYTMC9PyhMWQ==",
|
||||
"dependencies": {
|
||||
"@nodedc/tokens": "0.6.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@nodedc/ui-dom": {
|
||||
"version": "0.7.0",
|
||||
"resolved": "file:vendor/nodedc-ui-dom-0.7.0.tgz",
|
||||
"integrity": "sha512-oFF7gX3VmaT0677knAPoEijnqkOHCbObkc4744mHGH8MshSUAMT6ZJOmioJ3iLdWECYHXtRR+z+OnCK7ENa8DA==",
|
||||
"resolved": "file:vendor/nodedc-ui-dom-0.7.0-mission.1.tgz",
|
||||
"integrity": "sha512-s744E1rpjhVVwGqvEzZCwewkk67hetrOz5exSfXILMKKwnz0hhFoXyhUfZhAEvO8aCiWeBr4sH56P/lCck1bIA==",
|
||||
"dependencies": {
|
||||
"@nodedc/ui-core": "0.7.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@nodedc/ui-react": {
|
||||
"version": "0.7.0",
|
||||
"resolved": "file:vendor/nodedc-ui-react-0.7.0-header.2.tgz",
|
||||
"resolved": "file:vendor/nodedc-ui-react-0.7.0-mission.1.tgz",
|
||||
"integrity": "sha512-aJ/5dq7Yoghk9GP3+uJRxPnCQHTdhU8lgE0p/+/8OZiE+5GnT71ElFZyCwtTgFcysunM4xcnVThzfY2UXkEOmw==",
|
||||
"dependencies": {
|
||||
"@dnd-kit/core": "^6.3.1",
|
||||
|
||||
+4
-4
@@ -7,10 +7,10 @@
|
||||
"check": "node build.mjs --check"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nodedc/tokens": "file:vendor/nodedc-tokens-0.6.0.tgz",
|
||||
"@nodedc/ui-core": "file:vendor/nodedc-ui-core-0.7.0-header.1.tgz",
|
||||
"@nodedc/ui-dom": "file:vendor/nodedc-ui-dom-0.7.0.tgz",
|
||||
"@nodedc/ui-react": "file:vendor/nodedc-ui-react-0.7.0-header.2.tgz",
|
||||
"@nodedc/tokens": "file:vendor/nodedc-tokens-0.6.0-mission.1.tgz",
|
||||
"@nodedc/ui-core": "file:vendor/nodedc-ui-core-0.7.0-mission.1.tgz",
|
||||
"@nodedc/ui-dom": "file:vendor/nodedc-ui-dom-0.7.0-mission.1.tgz",
|
||||
"@nodedc/ui-react": "file:vendor/nodedc-ui-react-0.7.0-mission.1.tgz",
|
||||
"react": "19.2.7",
|
||||
"react-dom": "19.2.7",
|
||||
"esbuild": "0.28.1"
|
||||
|
||||
+2
-2
@@ -324,7 +324,7 @@ input[type=range] {
|
||||
font-size: var(--nodedc-font-size-sm);
|
||||
}
|
||||
.service-media-preview.is-solid-dark {
|
||||
background: #080808;
|
||||
background: var(--nodedc-stage);
|
||||
}
|
||||
.media-upload-error:empty,
|
||||
.media-upload-hint:empty {
|
||||
@@ -581,7 +581,7 @@ dialog.site-dialog p {
|
||||
padding: var(--nodedc-space-2);
|
||||
border-radius: var(--nodedc-radius-card);
|
||||
background: var(--nodedc-canvas);
|
||||
box-shadow: 0 8px 32px #0006;
|
||||
box-shadow: var(--nodedc-glass-dropdown-shadow);
|
||||
}
|
||||
.media-context-menu button {
|
||||
text-align: left;
|
||||
|
||||
+10
-6
@@ -1,20 +1,24 @@
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { createRoot } from "react-dom/client";
|
||||
import { flushSync } from "react-dom";
|
||||
import { applyNodedcTheme } from "@nodedc/ui-dom";
|
||||
import { applyNodedcTheme, missionDarkTheme, missionLightTheme, clearNodedcAccent } from "@nodedc/ui-dom";
|
||||
import { UserProfileMenu, FeatureSettingsWindow, SettingsCard, Select, ColorField, Button } from "@nodedc/ui-react";
|
||||
const h = React.createElement;
|
||||
const storageKey = "dc-cms.ui-preferences.v1";
|
||||
const defaults = { theme: "dark", accent: "#ffffff" };
|
||||
const defaults = { theme: "dark", accent: null };
|
||||
function normalize(value) {
|
||||
return { theme: value?.theme === "light" ? "light" : "dark", accent: /^#[\da-f]{6}$/i.test(value?.accent || "") ? value.accent.toLowerCase() : defaults.accent };
|
||||
return { theme: value?.theme === "light" ? "light" : "dark", accent: /^#[\da-f]{6}$/i.test(value?.accent || "") ? value.accent.toLowerCase() : null };
|
||||
}
|
||||
function read() {
|
||||
try { return normalize(JSON.parse(localStorage.getItem(storageKey))); } catch { return { ...defaults }; }
|
||||
}
|
||||
function apply(preferences) {
|
||||
const accent = preferences.accent.match(/[\da-f]{2}/gi).map(v => parseInt(v, 16));
|
||||
applyNodedcTheme(document.documentElement, { theme: preferences.theme, accent, edges: "flat" });
|
||||
const accent = preferences.accent?.match(/[\da-f]{2}/gi).map(v => parseInt(v, 16));
|
||||
clearNodedcAccent(document.documentElement);
|
||||
applyNodedcTheme(document.documentElement, { ...(preferences.theme === "light" ? missionLightTheme : missionDarkTheme), accent });
|
||||
}
|
||||
function themeAccent() {
|
||||
return "#" + getComputedStyle(document.documentElement).getPropertyValue("--nodedc-accent-rgb").trim().split(/\s+/).map(v => Number(v).toString(16).padStart(2, "0")).join("");
|
||||
}
|
||||
function Preferences({ initial }) {
|
||||
const [preferences, setPreferences] = useState(initial);
|
||||
@@ -43,7 +47,7 @@ function Preferences({ initial }) {
|
||||
h(FeatureSettingsWindow, { open, title: "Настройки", subtitle: "Интерфейс CMS", identity: { title: name, subtitle: "NODE.DC CMS", avatarLabel: name, avatarUrl: user?.picture || undefined }, sections: [{ id: "appearance", label: "Оформление", icon: "settings", group: "Общие" }], activeSection: "appearance", onSectionChange: () => {}, onClose: () => setOpen(false),
|
||||
footer: h(Button, { onClick: () => update(defaults), tone: "neutral" }, "Сбросить оформление") },
|
||||
h("div", {className:"cms-preferences-fields"}, h(SettingsCard, { title: "Тема", description: "Светлый или тёмный интерфейс", actions: h("div", { className: "cms-preference-controls" }, h(Select, { label: "Тема интерфейса", value: preferences.theme, options: [{ value: "dark", label: "Тёмная" }, { value: "light", label: "Светлая" }], onChange: theme => update({ theme }) })) }),
|
||||
h(SettingsCard, { title: "Акцентный цвет", description: "Цвет активных элементов", actions: h("div", { className: "cms-preference-controls" }, h(ColorField, { label: "Акцентный цвет", value: preferences.accent, onChange: accent => update({ accent }) })) })),
|
||||
h(SettingsCard, { title: "Акцентный цвет", description: "Цвет активных элементов", actions: h("div", { className: "cms-preference-controls" }, h(ColorField, { label: "Акцентный цвет", value: preferences.accent || themeAccent(), onChange: accent => update({ accent }) })) })),
|
||||
h("p", { className: "nodedc-description", role: "status" }, storageError ? "Настройки действуют в этой вкладке. Браузер не разрешил сохранить их для следующего входа." : "Изменения сохраняются автоматически в этом браузере.")
|
||||
)
|
||||
);
|
||||
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Reference in New Issue
Block a user