From 2de7085949c21ecf7e62a17f54be9685f876c8f1 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 19 Dec 2025 21:00:18 +0000 Subject: [PATCH 1/2] Fix mobile table scroll: add horizontal scroll and prevent text wrap --- .../src/components/mdx/components/Table/index.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/landing/src/components/mdx/components/Table/index.tsx b/apps/landing/src/components/mdx/components/Table/index.tsx index e82196ff..015b0537 100644 --- a/apps/landing/src/components/mdx/components/Table/index.tsx +++ b/apps/landing/src/components/mdx/components/Table/index.tsx @@ -3,8 +3,14 @@ import { type ComponentProps } from 'react' export const Table = ({ ...props }: ComponentProps<'table'>) => { return ( - - + + ) } From b56208c5f20a85d467f699e501463a737363ecd3 Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Fri, 26 Dec 2025 22:10:59 +0900 Subject: [PATCH 2/2] Fix sidebar issue Change order --- .../changepack_log_12NXRn5ZQpHYxcD1MAsmg.json | 5 + .../src/app/(detail)/docs/RightIndex.tsx | 293 ++++++++++-------- libs/sheet/src/lib.rs | 6 +- 3 files changed, 169 insertions(+), 135 deletions(-) create mode 100644 .changepacks/changepack_log_12NXRn5ZQpHYxcD1MAsmg.json diff --git a/.changepacks/changepack_log_12NXRn5ZQpHYxcD1MAsmg.json b/.changepacks/changepack_log_12NXRn5ZQpHYxcD1MAsmg.json new file mode 100644 index 00000000..55060544 --- /dev/null +++ b/.changepacks/changepack_log_12NXRn5ZQpHYxcD1MAsmg.json @@ -0,0 +1,5 @@ +{ + "changes": { "bindings/devup-ui-wasm/package.json": "Patch" }, + "note": "Change layer order", + "date": "2025-12-26T13:09:51.486654900Z" +} diff --git a/apps/landing/src/app/(detail)/docs/RightIndex.tsx b/apps/landing/src/app/(detail)/docs/RightIndex.tsx index 8132ee85..271eb8de 100644 --- a/apps/landing/src/app/(detail)/docs/RightIndex.tsx +++ b/apps/landing/src/app/(detail)/docs/RightIndex.tsx @@ -1,132 +1,161 @@ -'use client' -import { Box, css, Flex, Text, VStack } from '@devup-ui/react' -import Link from 'next/link' -import { usePathname } from 'next/navigation' -import { useEffect, useState } from 'react' - -function IndexMenu({ - children, - selected, - sub, - onClick, -}: { - children: React.ReactNode - selected?: boolean - sub?: boolean - onClick?: () => void -}) { - return ( - - {selected && } - - {children} - - - ) -} - -export function RightIndex() { - const pathname = usePathname() - const editUrl = `https://github.com/dev-five-git/devup-ui/tree/main/apps/landing/src/app/(detail)/components/${pathname.split('components')[1]}/` - const [menus, setMenus] = useState< - { - text: string - sub?: boolean - onClick?: () => void - }[] - >([]) - useEffect(() => { - const elements = document.querySelectorAll( - '.markdown-body h4, .markdown-body h6', - ) - // eslint-disable-next-line react-hooks/set-state-in-effect - setMenus( - [...elements].map((element) => ({ - text: element.textContent!, - sub: element.tagName === 'H6', - onClick: () => { - element.scrollIntoView({ behavior: 'smooth' }) - }, - })), - ) - }, [pathname]) - - return ( - - - - - Contents - - - {menus.map((menu, idx) => ( - - {menu.text} - - ))} - - - - - - Edit this page - - - - - - - - - ) -} +'use client' +import { Box, css, Flex, Text, VStack } from '@devup-ui/react' +import Link from 'next/link' +import { usePathname } from 'next/navigation' +import { useEffect, useState } from 'react' + +function IndexMenu({ + children, + selected, + sub, + onClick, +}: { + children: React.ReactNode + selected?: boolean + sub?: boolean + onClick?: () => void +}) { + return ( + + {selected && } + + {children} + + + ) +} + +export function RightIndex() { + const pathname = usePathname() + const isDocs = pathname.startsWith('/docs/') + const isComponents = pathname.startsWith('/components/') + const editUrl = isDocs + ? `https://github.com/dev-five-git/devup-ui/tree/main/apps/landing/src/app/(detail)/docs${pathname.replace('/docs', '')}/page.mdx` + : isComponents + ? `https://github.com/dev-five-git/devup-ui/tree/main/apps/landing/src/app/(detail)/components${pathname.replace('/components', '')}/` + : '' + const [menus, setMenus] = useState< + { + text: string + sub?: boolean + onClick?: () => void + }[] + >([]) + useEffect(() => { + const updateMenus = () => { + const elements = document.querySelectorAll( + '.markdown-body h2, .markdown-body h3, .markdown-body h4, .markdown-body h6', + ) + + setMenus( + [...elements].map((element) => ({ + text: element.textContent!, + sub: + element.tagName === 'H3' || + element.tagName === 'H4' || + element.tagName === 'H6', + onClick: () => { + element.scrollIntoView({ behavior: 'smooth' }) + }, + })), + ) + } + + updateMenus() + + const timeoutId = setTimeout(updateMenus, 100) + const observer = new MutationObserver(updateMenus) + + const markdownBody = document.querySelector('.markdown-body') + if (markdownBody) { + observer.observe(markdownBody, { + childList: true, + subtree: true, + }) + } + + return () => { + clearTimeout(timeoutId) + observer.disconnect() + } + }, [pathname]) + + return ( + + + + + Contents + + + {menus.map((menu, idx) => ( + + {menu.text} + + ))} + + + + + + Edit this page + + + + + + + + + ) +} diff --git a/libs/sheet/src/lib.rs b/libs/sheet/src/lib.rs index a75f994d..cf1f23f9 100644 --- a/libs/sheet/src/lib.rs +++ b/libs/sheet/src/lib.rs @@ -592,12 +592,12 @@ impl StyleSheet { let theme_css = self.theme.to_css(); let mut layers_vec = Vec::new(); - if !theme_css.is_empty() { - layers_vec.push("t".to_string()); - } if style_orders.remove(&0) { layers_vec.push("b".to_string()); } + if !theme_css.is_empty() { + layers_vec.push("t".to_string()); + } layers_vec.extend(style_orders.iter().map(|v| format!("o{v}"))); if !layers_vec.is_empty() { css.push_str(&format!("@layer {};", layers_vec.join(",")));