fix(cms): align setting label and switch in the shared horizontal row
DC CMS qualification / qualify (push) Successful in 1m29s

This commit is contained in:
DCCONSTRUCTIONS
2026-11-05 21:36:59 +03:00
parent be8ebe43e7
commit d86be605a8
5 changed files with 5 additions and 4 deletions
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -278,7 +278,7 @@
</form> </form>
</dialog> </dialog>
<template id="ds-settingRow"><section class="nodedc-settings-card" data-align="center"><header class="nodedc-settings-card__head"><div class="nodedc-settings-card__titles"><h2>Настройка</h2></div><div class="nodedc-settings-card__actions"><span data-slot="control"></span></div></header></section></template> <template id="ds-settingRow"><section class="nodedc-settings-card"><header class="nodedc-settings-card__head"><div class="nodedc-settings-card__titles"><h2>Настройка</h2></div><div class="nodedc-settings-card__actions"><span data-slot="control"></span></div></header><div class="nodedc-settings-card__body"></div></section></template>
<template id="ds-nestedSurface"><div class="nodedc-glass" data-tone="group" data-radius="card" data-padding="md"><span></span></div></template> <template id="ds-nestedSurface"><div class="nodedc-glass" data-tone="group" data-radius="card" data-padding="md"><span></span></div></template>
<template id="ds-dragHandle"><button type="button" class="nodedc-drag-handle" aria-label="Перетащить блок"><svg width="16" height="16" viewBox="0 0 16 16" aria-hidden="true"><circle cx="4" cy="4" r="0.75"></circle><circle cx="8" cy="4" r="0.75"></circle><circle cx="12" cy="4" r="0.75"></circle><circle cx="4" cy="8" r="0.75"></circle><circle cx="8" cy="8" r="0.75"></circle><circle cx="12" cy="8" r="0.75"></circle></svg></button></template> <template id="ds-dragHandle"><button type="button" class="nodedc-drag-handle" aria-label="Перетащить блок"><svg width="16" height="16" viewBox="0 0 16 16" aria-hidden="true"><circle cx="4" cy="4" r="0.75"></circle><circle cx="8" cy="4" r="0.75"></circle><circle cx="12" cy="4" r="0.75"></circle><circle cx="4" cy="8" r="0.75"></circle><circle cx="8" cy="8" r="0.75"></circle><circle cx="12" cy="8" r="0.75"></circle></svg></button></template>
<template id="ds-button"><button type="button" class="nodedc-button" data-variant="secondary"><span class="nodedc-button__content">Действие</span></button></template> <template id="ds-button"><button type="button" class="nodedc-button" data-variant="secondary"><span class="nodedc-button__content">Действие</span></button></template>
+1 -1
View File
@@ -119,7 +119,7 @@ through the profile menu, custom accent, reset, and Escape focus restoration.
## Full-width boolean setting rows ## Full-width boolean setting rows
A boolean editable field can declare `layout: "row"` and an optional `title`. A boolean editable field can declare `layout: "row"` and an optional `title`.
The editor uses the shared SettingsCard (centered header-only layout) and Switch, The editor uses the shared SettingsCard (title left, Switch right) and Switch,
above the following field in schema order. Values continue through the standard above the following field in schema order. Values continue through the standard
model save/render/publish flow; no carousel-specific CMS state or new CSS is model save/render/publish flow; no carousel-specific CMS state or new CSS is
introduced. Mission Core uses this for its per-carousel image-opening setting. introduced. Mission Core uses this for its per-carousel image-opening setting.
+1 -1
View File
@@ -36,7 +36,7 @@ const actions = h("div", { className: "cms-editor-actions" }, h(StatusBadge, { i
const content = h(ApplicationPanel, { eyebrow: h("span", { id: "editor-heading" }, "\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u0441\u0430\u0439\u0442\u0430"), title: "\u041A\u043E\u043D\u0442\u0435\u043D\u0442", description: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0440\u0430\u0437\u0434\u0435\u043B", headerTools: actions, expanded: true, onClose: noop }, h("div", { className: "cms-editor", dangerouslySetInnerHTML: { __html: await read("editor.html") } })); const content = h(ApplicationPanel, { eyebrow: h("span", { id: "editor-heading" }, "\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u0441\u0430\u0439\u0442\u0430"), title: "\u041A\u043E\u043D\u0442\u0435\u043D\u0442", description: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0440\u0430\u0437\u0434\u0435\u043B", headerTools: actions, expanded: true, onClose: noop }, h("div", { className: "cms-editor", dangerouslySetInnerHTML: { __html: await read("editor.html") } }));
const shell = html(h(ApplicationShell, { id: "cms-shell", header, stage: h("div", { className: "cms-stage" }, h("p", null, "\u0423\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0441\u0430\u0439\u0442\u0430\u043C\u0438 NODE.DC"), btn("open-navigation", "\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0440\u0430\u0437\u0434\u0435\u043B\u044B")), navigation: nav, content, navigationOpen: true, contentOpen: true, contentExpanded: true })); const shell = html(h(ApplicationShell, { id: "cms-shell", header, stage: h("div", { className: "cms-stage" }, h("p", null, "\u0423\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0441\u0430\u0439\u0442\u0430\u043C\u0438 NODE.DC"), btn("open-navigation", "\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0440\u0430\u0437\u0434\u0435\u043B\u044B")), navigation: nav, content, navigationOpen: true, contentOpen: true, contentExpanded: true }));
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 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({ settingRow: h(SettingsCard, { title: "Настройка", align: "center", actions: h("span", { "data-slot": "control" }) }), nestedSurface: h(GlassSurface, {tone:"group", 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 templates = Object.entries({ settingRow: h(SettingsCard, { title: "Настройка", actions: h("span", { "data-slot": "control" }) }), nestedSurface: h(GlassSurface, {tone:"group", 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> const page = `<!doctype html>
<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} <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")} ${await read("modals.html")}
+1
View File
@@ -4391,6 +4391,7 @@ function renderBooleanField({ block, editableField, grid }) {
if (editableField.layout === "row") { if (editableField.layout === "row") {
const row = document.querySelector("#ds-settingRow").content.firstElementChild.cloneNode(true); const row = document.querySelector("#ds-settingRow").content.firstElementChild.cloneNode(true);
row.classList.add("wide"); row.classList.add("wide");
row.querySelector(".nodedc-settings-card__body").remove();
row.querySelector("h2").textContent = editableField.title || editableField.label || editableField.path; row.querySelector("h2").textContent = editableField.title || editableField.label || editableField.path;
row.querySelector('[data-slot="control"]').replaceWith(label); row.querySelector('[data-slot="control"]').replaceWith(label);
grid.append(row); grid.append(row);