@@ -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<Components>
|
||||
@@ -78,6 +79,16 @@ export const parseMarkdown = (content: string, options?: Partial<RemarkOptions>)
|
||||
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,
|
||||
},
|
||||
}),
|
||||
|
||||
@@ -54,45 +54,45 @@ const AppNotificationContainer: FC = () => {
|
||||
|
||||
useOnce(() => {
|
||||
const toaster = () => {
|
||||
toast.success(
|
||||
<div>
|
||||
App is upgraded to{" "}
|
||||
<a
|
||||
href={`${repository.url}/releases/tag/v${APP_VERSION}`}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
{APP_VERSION}
|
||||
</a>
|
||||
, enjoy the new features! 🎉
|
||||
</div>,
|
||||
{
|
||||
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: (
|
||||
<div>
|
||||
App is upgraded to{" "}
|
||||
<a
|
||||
href={`${repository.url}/releases/tag/v${APP_VERSION}`}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
{APP_VERSION}
|
||||
</a>
|
||||
, enjoy the new features! 🎉
|
||||
</div>
|
||||
),
|
||||
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 <PeekModal>{children}</PeekModal>
|
||||
},
|
||||
content: Changelog,
|
||||
overlay: true,
|
||||
})
|
||||
CustomModalComponent: ({ children }) => {
|
||||
return <PeekModal>{children}</PeekModal>
|
||||
},
|
||||
content: Changelog,
|
||||
overlay: true,
|
||||
})
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
},
|
||||
)
|
||||
})
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
})
|
||||
}
|
||||
if (window.__app_is_upgraded__) {
|
||||
setTimeout(toaster)
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
|
||||
## New Features
|
||||
|
||||
- Customizable columns for masonry view
|
||||
|
||||

|
||||
|
||||
## Improvements
|
||||
|
||||
## Bug Fixes
|
||||
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user