chore(format): normalize repository files

This commit is contained in:
Maofeng
2026-09-20 15:54:12 +08:00
parent dc80bd8ae0
commit 2dbf51ba24
17 changed files with 57 additions and 42 deletions
@@ -1,7 +1,7 @@
import { Icon } from "@icones/react";
import { Button } from "@workspace/ui/components/button";
import { cn } from "@workspace/ui/lib/utils";
import React from "react";
import { Icon } from "@icones/react"
import { Button } from "@workspace/ui/components/button"
import { cn } from "@workspace/ui/lib/utils"
import React from "react"
type Props = {
children: React.ReactNode
@@ -29,30 +29,26 @@ export function Layout({ children, className }: Props) {
"[--app-header-height:--spacing(18)]",
"[--app-aside-width:--spacing(56)]",
"[--app-split-gap:--spacing(4)]",
className,
className
)}
data-slot="root"
>
<header className="z-10 sticky top-0 h-0" data-slot="header">
<div className="h-(--app-header-height)">
header
</div>
<div className="border-t h-0 absolute inset-x-0 top-(--app-header-height)" />
<header className="sticky top-0 z-10 h-0" data-slot="header">
<div className="h-(--app-header-height)">header</div>
<div className="absolute inset-x-0 top-(--app-header-height) h-0 border-t" />
</header>
<div className="flex gap-(--app-split-gap)">
<aside
className="w-(--app-aside-width) h-svh pt-(--app-header-height) shrink-0"
className="h-svh w-(--app-aside-width) shrink-0 pt-(--app-header-height)"
data-slot="aside"
>
<div className="flex flex-col items-stretch h-full py-4">
<div className="flex h-full flex-col items-stretch py-4">
<Navigation items={groups} />
<Navigation className="mt-auto" items={[links[1]]} />
</div>
</aside>
<main className="pt-(--app-header-height)" data-slot="main">
<div className="p-4">
{children}
</div>
<div className="p-4">{children}</div>
</main>
</div>
</div>
@@ -61,7 +57,11 @@ export function Layout({ children, className }: Props) {
const links = [
{ key: "inbox", label: "收件箱", icon: <Icon name="tabler:inbox" /> },
{ key: "starred", label: "已加星标", icon: <Icon name="tabler:star-filled" /> },
{
key: "starred",
label: "已加星标",
icon: <Icon name="tabler:star-filled" />,
},
{ key: "sent", label: "已发送", icon: <Icon name="tabler:send" /> },
{ key: "drafts", label: "草稿", icon: <Icon name="tabler:edit" /> },
{ key: "deleted", label: "已删除", icon: <Icon name="tabler:trash" /> },
@@ -90,7 +90,13 @@ function isGroup(item: NavGroup | NavItem): item is NavGroup {
return (item as NavGroup).items !== undefined
}
function Navigation({ items, className }: { items: NavItems; className?: string }) {
function Navigation({
items,
className,
}: {
items: NavItems
className?: string
}) {
return (
<ul className={className}>
{items.map((item, index) => {
@@ -104,12 +110,14 @@ function Navigation({ items, className }: { items: NavItems; className?: string
"not-last:mb-4",
previousItem && isGroup(previousItem)
? "mt-0"
: "not-first:mt-4",
: "not-first:mt-4"
)}
>
<span className="text-xs px-2.5 text-muted-foreground">{item.label}</span>
<span className="px-2.5 text-xs text-muted-foreground">
{item.label}
</span>
<ul>
{item.items.map(subItem => (
{item.items.map((subItem) => (
<li key={subItem.key}>
<NavigationItem
label={subItem.label}
@@ -120,7 +128,7 @@ function Navigation({ items, className }: { items: NavItems; className?: string
))}
</ul>
</li>
);
)
}
return (
@@ -131,13 +139,17 @@ function Navigation({ items, className }: { items: NavItems; className?: string
current={item.key === "drafts"}
/>
</li>
);
)
})}
</ul>
)
}
function NavigationItem({ label, icon, current }: {
function NavigationItem({
label,
icon,
current,
}: {
label: string
icon: React.ReactNode
current: boolean
@@ -146,7 +158,7 @@ function NavigationItem({ label, icon, current }: {
<Button
variant="ghost"
aria-current={current ? "page" : undefined}
className="flex w-full justify-start rounded-l-none rounded-r-full aria-[current=page]:text-red-600 aria-[current=page]:bg-current/10 [&_svg:not([class*='size-'])]:size-5"
className="flex w-full justify-start rounded-l-none rounded-r-full aria-[current=page]:bg-current/10 aria-[current=page]:text-red-600 [&_svg:not([class*='size-'])]:size-5"
size="lg"
>
{icon}
@@ -24,7 +24,8 @@ export const messages = {
"blocks.media.copy.failed": "复制失败,请检查浏览器剪贴板权限。",
"blocks.media.deleteAsset.description": "该媒体将不再显示在媒体库中。",
"blocks.media.deleteAsset.title": "删除媒体",
"blocks.media.deleteFolder.description": "该目录及其子目录将被删除,其中的媒体会变为未分类。",
"blocks.media.deleteFolder.description":
"该目录及其子目录将被删除,其中的媒体会变为未分类。",
"blocks.media.deleteFolder.title": "删除目录",
"blocks.media.details.dimensions": "尺寸",
"blocks.media.details.fileName": "文件名称",
@@ -40,7 +41,8 @@ export const messages = {
"blocks.media.filters.image": "图片",
"blocks.media.filters.unclassified": "未分类",
"blocks.media.filters.video": "视频",
"blocks.media.folders.classification": "目录仅用于媒体库内分类,不会改变文件链接。",
"blocks.media.folders.classification":
"目录仅用于媒体库内分类,不会改变文件链接。",
"blocks.media.folders.create": "新建目录",
"blocks.media.folders.empty": "暂无目录,点击新建。",
"blocks.media.folders.name": "目录名称",
@@ -54,7 +56,8 @@ export const messages = {
"blocks.media.picker.selectedCount": "已选择 {count} 项",
"blocks.media.picker.title": "选择媒体",
"blocks.media.picker.useSelected": "使用所选媒体",
"blocks.media.renameMedia.description": "仅修改展示名称,不会改变文件或已有链接。",
"blocks.media.renameMedia.description":
"仅修改展示名称,不会改变文件或已有链接。",
"blocks.media.renameMedia.title": "修改媒体名称",
"blocks.media.search": "搜索媒体文件",
"blocks.media.title": "媒体库",
+1 -1
View File
@@ -17,4 +17,4 @@
},
"include": ["src"],
"exclude": ["node_modules", "dist"]
}
}
+1 -1
View File
@@ -16,4 +16,4 @@
},
"include": ["src"],
"exclude": ["node_modules", "dist", "locales"]
}
}
+1 -1
View File
@@ -195,4 +195,4 @@ Delete 或 Backspace 删除。该能力同时复用 Lexical 的文件拖放命
没有可见控件、只提供编辑行为的能力也可以声明为 `hidden` action。包内的
`<DraggableBlocks />` 就使用这种方式,因此它会启用拖拽 plugin,但不会占据
任何工具栏位置。
任何工具栏位置。
+1 -1
View File
@@ -19,4 +19,4 @@
},
"include": ["src"],
"exclude": ["node_modules", "dist"]
}
}
+1 -1
View File
@@ -20,4 +20,4 @@
"rtl": true,
"menuColor": "default",
"menuAccent": "subtle"
}
}
+1 -1
View File
@@ -14,4 +14,4 @@
},
"include": ["."],
"exclude": ["node_modules", "dist"]
}
}
+1 -1
View File
@@ -11,4 +11,4 @@
},
"include": ["src"],
"exclude": ["node_modules", "dist"]
}
}