From c3458eef4cd7ed48823a851359e6634f1ff691da Mon Sep 17 00:00:00 2001 From: XiaoDaiGua-Ray <51957438+XiaoDaiGua-Ray@users.noreply.github.com> Date: Wed, 2 Dec 2026 10:58:42 +0800 Subject: [PATCH] fix(layout): simplify dividers and clarify designer labels --- apps/admin/src/layout/blocks/index.scss | 27 ++++++++++++++++++- .../src/layout/components/Menu/index.scss | 3 --- .../src/layout/components/SiderBar/index.scss | 1 - .../layout/default/FooterWrapper/index.scss | 1 - apps/admin/src/locales/lang/en-US/layout.json | 14 +++++----- apps/admin/src/locales/lang/zh-CN/layout.json | 16 +++++------ apps/docs/en/guide/layout.md | 4 +-- apps/docs/guide/layout.md | 4 +-- 8 files changed, 45 insertions(+), 25 deletions(-) diff --git a/apps/admin/src/layout/blocks/index.scss b/apps/admin/src/layout/blocks/index.scss index e44ba88c..da90ed92 100644 --- a/apps/admin/src/layout/blocks/index.scss +++ b/apps/admin/src/layout/blocks/index.scss @@ -58,6 +58,31 @@ &:has(> *) { min-block-size: $layoutHeaderHeight; - border-block-end: 1px solid var(--r-line); } } + +:is(.r-layout-header-region, .r-layout-footer-region, .r-layout-row) + > .r-layout-top-navigation, +.r-layout-footer-region > .menu-tag { + border-block-end: 0; +} + +.r-layout-header-region:has( + > :is(.layout-header, .r-layout-top-navigation), + > .r-layout-row > * + ):not( + :has( + + .r-layout-tabs-region > *, + + .r-layout-full__body .r-layout-tabs-region > * + ) + ) { + border-block-end: 1px solid var(--r-line); +} + +.r-layout-footer-region:has( + > .r-layout-row > *, + > .menu-tag, + > .r-layout-top-navigation +) { + border-block-start: 1px solid var(--r-line); +} diff --git a/apps/admin/src/layout/components/Menu/index.scss b/apps/admin/src/layout/components/Menu/index.scss index 09841f1c..eefbd7dc 100644 --- a/apps/admin/src/layout/components/Menu/index.scss +++ b/apps/admin/src/layout/components/Menu/index.scss @@ -28,8 +28,6 @@ .r-menu__logo { color: inherit; - border-block-end: 1px solid var(--r-line); - border-block-end-color: color-mix(in srgb, currentColor 15%, transparent); } .n-menu-item-content { @@ -78,7 +76,6 @@ flex: 1; min-inline-size: 0; padding-inline: 16px 8px; - border-block-end: 0; } .app-menu__close { diff --git a/apps/admin/src/layout/components/SiderBar/index.scss b/apps/admin/src/layout/components/SiderBar/index.scss index 65f5b019..1447e2a9 100644 --- a/apps/admin/src/layout/components/SiderBar/index.scss +++ b/apps/admin/src/layout/components/SiderBar/index.scss @@ -3,7 +3,6 @@ padding-inline: $layoutRouterViewContainer; display: flex; align-items: center; - border-block-end: 1px solid var(--r-line); > .layout-header__method { inline-size: 100%; diff --git a/apps/admin/src/layout/default/FooterWrapper/index.scss b/apps/admin/src/layout/default/FooterWrapper/index.scss index 428c4fd7..46716f87 100644 --- a/apps/admin/src/layout/default/FooterWrapper/index.scss +++ b/apps/admin/src/layout/default/FooterWrapper/index.scss @@ -3,7 +3,6 @@ display: flex; align-items: center; justify-content: center; - border-top: 1px solid var(--r-line); background: var(--r-surface); color: var(--r-text-muted); font-size: 12px; diff --git a/apps/admin/src/locales/lang/en-US/layout.json b/apps/admin/src/locales/lang/en-US/layout.json index 3851e985..fee70df4 100644 --- a/apps/admin/src/locales/lang/en-US/layout.json +++ b/apps/admin/src/locales/lang/en-US/layout.json @@ -39,10 +39,10 @@ "title": "Custom layout designer", "defaultName": "My workspace", "position": "Placement", - "actions": "Actions", + "actions": "Global toolbar", "tabs": "Page tabs", - "navigation": "Top navigation", - "breadcrumb": "Breadcrumb", + "navigation": "Horizontal menu", + "breadcrumb": "Page path", "left": "Move left", "right": "Move right", "id": "Layout ID", @@ -66,8 +66,8 @@ "autoRegister": "Register automatically", "tryExample": "Try the two-row top layout", "duplicate": "This layout ID is already registered. Choose another ID.", - "sidebar": "Sidebar", - "footer": "Footer", + "sidebar": "Side menu", + "footer": "Copyright footer", "library": "Block library", "libraryHint": "Click a block to add it or drag it onto the canvas. Select a placed block to move or remove it.", "addBlock": "Add {block}", @@ -82,8 +82,8 @@ "rowUp": "Move row up", "rowDown": "Move row down", "remove": "Remove block", - "sidebarLeft": "Sidebar on left", - "sidebarRight": "Sidebar on right", + "sidebarLeft": "Menu on the left", + "sidebarRight": "Menu on the right", "added": "Added {block}", "tryPreview": "Try layout", "endPreview": "End preview" diff --git a/apps/admin/src/locales/lang/zh-CN/layout.json b/apps/admin/src/locales/lang/zh-CN/layout.json index 16083898..c78155b3 100644 --- a/apps/admin/src/locales/lang/zh-CN/layout.json +++ b/apps/admin/src/locales/lang/zh-CN/layout.json @@ -39,10 +39,10 @@ "title": "自定义布局", "defaultName": "我的工作区", "position": "放置位置", - "actions": "操作栏", - "tabs": "页面标签", - "navigation": "顶部导航", - "breadcrumb": "面包屑", + "actions": "全局工具栏", + "tabs": "页面标签栏", + "navigation": "横向菜单", + "breadcrumb": "页面路径", "left": "向左移", "right": "向右移", "id": "布局 ID", @@ -66,8 +66,8 @@ "autoRegister": "自动注册", "tryExample": "切换到双行顶部示例", "duplicate": "此布局 ID 已注册,请使用新 ID。", - "sidebar": "侧栏", - "footer": "页脚", + "sidebar": "侧边菜单", + "footer": "版权页脚", "library": "积木库", "libraryHint": "点击添加积木,或拖入画布。选中画布上的积木可调整位置或移除。", "addBlock": "添加{block}", @@ -82,8 +82,8 @@ "rowUp": "整行上移", "rowDown": "整行下移", "remove": "移除积木", - "sidebarLeft": "侧栏靠左", - "sidebarRight": "侧栏靠右", + "sidebarLeft": "菜单放左侧", + "sidebarRight": "菜单放右侧", "added": "已添加{block}", "tryPreview": "试用布局", "endPreview": "结束试用" diff --git a/apps/docs/en/guide/layout.md b/apps/docs/en/guide/layout.md index a3011820..9041a592 100644 --- a/apps/docs/en/guide/layout.md +++ b/apps/docs/en/guide/layout.md @@ -21,9 +21,9 @@ Press Tab to focus menu items and Enter or Space to expand a group or open a pag ## Custom layouts and source generation {#自定义布局与源码生成} -The designer starts with a fixed area for the current page. Click a block to add it or drag it into position. Place breadcrumbs, actions, tabs and navigation above or below the page. Combine blocks in a row, reorder them, or move the whole row. Add a left or right sidebar and an optional footer. Selecting a block exposes the same placement and ordering controls for keyboard and touch. +The designer starts with a fixed area for the current page. Click a block to add it or drag it into position. Place **Page path**, **Global toolbar**, **Page tabs**, or **Horizontal menu** above or below the page. Combine blocks in a row, reorder them, or move the whole row. Place **Side menu** on either side and add **Copyright footer** as needed. Selecting a block exposes the same placement and ordering controls for keyboard and touch. -At desktop widths, try the draft to see its actual components around the current page. You can continue editing while trying it and return to your saved layout when done. If the embedded example is too narrow, choose **Run this example in a new tab** to try a desktop layout. The built-in **Two-row top** puts tabs beside the actions in the first row and navigation in the second. +At desktop widths, try the draft to see its actual components around the current page. You can continue editing while trying it and return to your saved layout when done. If the embedded example is too narrow, choose **Run this example in a new tab** to try a desktop layout. The built-in **Two-row top** puts the page tabs beside the global toolbar in the first row and the horizontal menu in the second. Enter a unique layout ID and display name. In a top-level page on a loopback Vite development server, **Generate into project** creates `apps/admin/src/layout/definitions/.layout.tsx`. Existing files are protected. Production pages, remote previews and embedded previews offer **Download layout source**. Place the downloaded file in the same directory. The next build includes the new layout in your deployment. Discovery imports layout modules as executable project code. Review third-party TSX before placing it in this directory. diff --git a/apps/docs/guide/layout.md b/apps/docs/guide/layout.md index 8c0c32d9..57e84a8f 100644 --- a/apps/docs/guide/layout.md +++ b/apps/docs/guide/layout.md @@ -21,9 +21,9 @@ import AdminExample from '../examples/AdminExample.vue' ## 自定义布局与源码生成 -「布局实验室」从一块固定的路由内容区开始。点击积木将其加入画布,或直接拖到目标位置。面包屑、操作栏、页面标签和导航都能放在内容上方或下方,可合并到同一行、调整行内顺序或移动整行。侧栏可放在左侧或右侧,页脚可单独添加。选中画布里的积木,也可以用位置菜单和移动按钮完成这些操作。 +「布局实验室」从一块固定的路由内容区开始。点击积木将其加入画布,或直接拖到目标位置。「页面路径」「全局工具栏」「页面标签栏」和「横向菜单」都能放在内容上方或下方,可合并到同一行、调整行内顺序或移动整行。「侧边菜单」可放在左侧或右侧,「版权页脚」可单独添加。选中画布里的积木,也可以用位置菜单和移动按钮完成这些操作。 -在桌面宽度点击「试用布局」,当前页面就会使用草稿中的真实组件。可以边试用边编辑,结束试用后返回原布局。下方文档示例宽度较窄时,请点「在新标签页运行此示例」试用桌面布局。内置的「双行顶部」将页面标签和操作栏放在第一行,导航放在第二行。 +在桌面宽度点击「试用布局」,当前页面就会使用草稿中的真实组件。可以边试用边编辑,结束试用后返回原布局。下方文档示例宽度较窄时,请点「在新标签页运行此示例」试用桌面布局。内置的「双行顶部」将页面标签栏和全局工具栏放在第一行,横向菜单放在第二行。 填写唯一的布局 ID 和显示名称。独立打开本机回环地址的 Vite 开发页面时,「生成到工程」会在 `apps/admin/src/layout/definitions/.layout.tsx` 创建源码文件,同名文件会提示冲突。生产页面、远程访问及嵌入预览提供「下载布局源码」,将文件放入该目录即可参与发现。部署站点在下次构建发布时包含新布局。布局定义会作为工程代码导入,来自其他人的 TSX 应先审阅再放入目录。