From c8460da13cfe3ac0d6972b84a86d15fe1b5886df Mon Sep 17 00:00:00 2001 From: Innei Date: Tue, 26 Nov 2024 23:45:39 +0800 Subject: [PATCH] chore: update changelog Signed-off-by: Innei --- apps/renderer/src/lib/parse-markdown.ts | 11 +++ .../src/modules/upgrade/container.tsx | 74 +++++++++---------- changelog/next.md | 4 + packages/components/src/ui/toast/index.tsx | 2 +- 4 files changed, 53 insertions(+), 38 deletions(-) diff --git a/apps/renderer/src/lib/parse-markdown.ts b/apps/renderer/src/lib/parse-markdown.ts index ff49fd7d7..f0e0b06aa 100644 --- a/apps/renderer/src/lib/parse-markdown.ts +++ b/apps/renderer/src/lib/parse-markdown.ts @@ -18,6 +18,7 @@ import { unified } from "unified" import { VFile } from "vfile" import { MarkdownLink } from "~/components/ui/markdown/renderers/MarkdownLink" +import { VideoPlayer } from "~/components/ui/media/VideoPlayer" export interface RemarkOptions { components: Partial @@ -78,6 +79,16 @@ export const parseMarkdown = (content: string, options?: Partial) passNode: true, components: { a: ({ node, ...props }) => createElement(MarkdownLink, { ...props } as any), + img: ({ node, ...props }) => { + const { src } = props + const isVideo = src?.endsWith(".mp4") + if (isVideo) { + return createElement(VideoPlayer, { + src: src as string, + }) + } + return createElement("img", { ...props } as any) + }, ...components, }, }), diff --git a/apps/renderer/src/modules/upgrade/container.tsx b/apps/renderer/src/modules/upgrade/container.tsx index cfba7f7b9..4e1510d07 100644 --- a/apps/renderer/src/modules/upgrade/container.tsx +++ b/apps/renderer/src/modules/upgrade/container.tsx @@ -54,45 +54,45 @@ const AppNotificationContainer: FC = () => { useOnce(() => { const toaster = () => { - toast.success( -
- App is upgraded to{" "} - - {APP_VERSION} - - , enjoy the new features! 🎉 -
, - { - closeButton: true, - duration: 5000, - action: CHANGELOG_CONTENT - ? { - label: "What's new?", - onClick: () => { - nextFrame(() => { - present({ - clickOutsideToDismiss: true, - title: "What's new?", - autoFocus: false, - modalClassName: - "relative mx-auto mt-[10vh] scrollbar-none max-w-full overflow-auto px-2 lg:max-w-[65rem] lg:p-0", + toast.success("", { + description: ( +
+ App is upgraded to{" "} + + {APP_VERSION} + + , enjoy the new features! 🎉 +
+ ), + closeButton: true, + duration: 5000, + action: CHANGELOG_CONTENT + ? { + label: "What's new?", + onClick: () => { + nextFrame(() => { + present({ + clickOutsideToDismiss: true, + title: "What's new?", + autoFocus: false, + modalClassName: + "relative mx-auto mt-[10vh] scrollbar-none max-w-full overflow-auto px-2 lg:max-w-[65rem] lg:p-0", - CustomModalComponent: ({ children }) => { - return {children} - }, - content: Changelog, - overlay: true, - }) + CustomModalComponent: ({ children }) => { + return {children} + }, + content: Changelog, + overlay: true, }) - }, - } - : undefined, - }, - ) + }) + }, + } + : undefined, + }) } if (window.__app_is_upgraded__) { setTimeout(toaster) diff --git a/changelog/next.md b/changelog/next.md index 17888d80b..f62ec5968 100644 --- a/changelog/next.md +++ b/changelog/next.md @@ -2,6 +2,10 @@ ## New Features +- Customizable columns for masonry view + +![](https://fastly.jsdelivr.net/gh/RSSNext/assets@main/masonry.mp4) + ## Improvements ## Bug Fixes diff --git a/packages/components/src/ui/toast/index.tsx b/packages/components/src/ui/toast/index.tsx index e22b9b72b..8afecc4c9 100644 --- a/packages/components/src/ui/toast/index.tsx +++ b/packages/components/src/ui/toast/index.tsx @@ -14,7 +14,7 @@ export const Toaster = ({ ...props }: ToasterProps) => ( classNames: { content: "min-w-0", icon: tw`self-start translate-y-[2px]`, - closeButton: tw`!border-border bg-background transition-opacity hover:!bg-background will-change-opacity duration-200 opacity-0 group-hover:opacity-100`, + closeButton: tw`!border-border !bg-background transition-opacity will-change-opacity duration-200 opacity-0 group-hover:opacity-100`, }, }} {...props}