fix(cms): reuse canonical profile and nested form surfaces
DC CMS qualification / qualify (push) Successful in 1m39s

This commit is contained in:
DCCONSTRUCTIONS
2026-11-05 13:09:58 +03:00
parent 73bf4639a2
commit 10c2d6a70d
13 changed files with 48 additions and 39 deletions
-7
View File
@@ -254,13 +254,6 @@ p {
font-size: var(--nodedc-font-size-sm);
font-weight: var(--nodedc-font-weight-strong);
}
.collection-item-card,
.json-details {
border: 0;
border-radius: var(--nodedc-radius-card);
padding: var(--nodedc-space-4);
background: var(--nodedc-panel-item-bg);
}
.collection-summary,
.json-details > summary {
cursor: pointer;
+11
View File
@@ -135,6 +135,17 @@ function fields() {
for (const input of all("input:not([type=hidden]):not([type=checkbox]):not([type=file]):not([type=range]),textarea")) if (!input.closest(".cms-ui-island")) addClass(input, "nodedc-field__control");
}
function cards() {
// Use the library's opaque nested surface: translucent local layers made
// collection backgrounds converge with the field material at greater depth.
for (const region of all(".collection-item-card,.json-details")) {
if (region.dataset.dsSurface) continue;
const surface = clone("nestedSurface");
for (const attribute of surface.attributes) {
if (attribute.name === "class") addClass(region, attribute.value);
else region.setAttribute(attribute.name, attribute.value);
}
region.dataset.dsSurface = "true";
}
for (const card of all(".settings-card,.content-group,.content-panel")) {
if (card.dataset.dsCard) continue;
card.dataset.dsCard = "true";
+2 -5
View File
@@ -2,7 +2,7 @@ import React, { useEffect, useState } from "react";
import { createRoot } from "react-dom/client";
import { flushSync } from "react-dom";
import { applyNodedcTheme } from "@nodedc/ui-dom";
import { HeaderProfile, UserProfileMenu, IconButton, Icon, FeatureSettingsWindow, SettingsCard, Select, ColorField, Button } from "@nodedc/ui-react";
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" };
@@ -39,10 +39,7 @@ function Preferences({ initial }) {
const actions = [{ id: "appearance", label: "Настройки интерфейса", icon: "settings", onSelect: () => setOpen(true) }];
if (session?.authEnabled) actions.push({ id: "logout", label: "Выйти", icon: "external", href: "/auth/logout" });
return h(React.Fragment, null,
h(HeaderProfile, null,
h(UserProfileMenu, { displayName: name, subtitle: user?.email || undefined, avatarUrl: user?.picture || undefined, triggerLabel: "Профиль", triggerIcon: "inbox", actions }),
h(IconButton, { label: "Настройки интерфейса", onClick: () => setOpen(true) }, h(Icon, { name: "settings" }))
),
h(UserProfileMenu, { displayName: name, subtitle: user?.email || undefined, avatarUrl: user?.picture || undefined, triggerLabel: "Профиль", triggerIcon: "inbox", actions }),
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 }) })) }),