diff --git a/packages/nc-gui/components/feed/Changelog/Item.vue b/packages/nc-gui/components/feed/Changelog/Item.vue index 05ff49ae09..8fe0158197 100644 --- a/packages/nc-gui/components/feed/Changelog/Item.vue +++ b/packages/nc-gui/components/feed/Changelog/Item.vue @@ -9,14 +9,13 @@ import type { ProductFeedItem } from '../../../lib/types' const props = defineProps<{ item: ProductFeedItem + index: number }>() const { - item: { 'Published Time': CreatedAt, Description, Title, Tags }, + item: { 'Published Time': CreatedAt, Description, Title, Tags, Images }, } = props -const truncate = ref(true) - const iconColorMap = { 'Hotfix': { icon: iconMap.ncTool, @@ -32,94 +31,112 @@ const iconColorMap = { }, } -const tags = computed(() => { - return Tags?.split(',').map((tag) => ({ +const tags = computed(() => [ + ...(props.index === 0 + ? [ + { + text: 'Latest Release', + color: 'purple', + }, + ] + : []), + ...(Tags?.split(',').map((tag) => ({ text: tag, - href: `/tags/${tag}`, - ...(iconColorMap[tag as any] || {}), - })) -}) + ...(iconColorMap[tag] || {}), + })) || []), +]) + +const { getPossibleAttachmentSrc } = useAttachment() const renderMarkdown = async (markdown: string) => { return await unified().use(remarkParse).use(remarkRehype).use(rehypeSanitize).use(rehypeStringify).process(markdown) } +const truncate = ref(true) + const renderedText = computedAsync(async () => { - return await renderMarkdown(truncate.value ? Description.substring(0, 300).concat('...') : Description) + return await renderMarkdown( + truncate.value + ? Description.replace(/[*_~]|\[.*?\]|<\/?[^>]+(>|$)/g, '') + .replace(/\(https?:\/\/[^\s)]+\)\]\(https?:\/\/[^\s)]+\)/g, '') + .replace(/^(\*\*)?#?\s*(\p{Emoji})\s*NocoDB\s*v[\d.]+(\s*-\s*|\*\*$)/u, '# ') + .replace(/(!?\(https?:\/\/[^\s)]+\)(?:\]\(https?:\/\/[^\s)]+(?:\s+"[^"]*")?\))?)/g, '') + .replace('-', '') + .substring(0, 100) + .concat('...') + : Description.replace(/^\[!\[.*?\]\(https?:\/\/.*?\)\]\(https?:\/\/.*?\)/m, '').replace( + /^(\*\*)?#?\s*(\p{Emoji})\s*NocoDB\s*v[\d.]+(\s*-\s*|\*\*$)/u, + '# ', + ), + ) }) @@ -128,75 +145,43 @@ const renderedText = computedAsync(async () => { width: fit-content; } -.vertical-line { - @apply ml-47.5; - height: 24px; - width: 2px; - background-color: #e7e7e9; +.changelog-card { + @apply transform transition-all ease-in-out; + &:hover { + box-shadow: 0px 4px 8px -2px rgba(0, 0, 0, 0.08), 0px 2px 4px -2px rgba(0, 0, 0, 0.04); + } } -.changelog-item { - box-shadow: 0px 2px 4px -2px rgba(51, 102, 255, 0.08), 0px 4px 4px -2px rgba(51, 102, 255, 0.04); +a { + @apply !no-underline; } -.content { - @apply !pl-52; - +:deep(.prose) { + @apply !max-w-auto; a { - @apply !no-underline; + @apply text-gray-900; } - :deep(.prose) { - a { - @apply text-gray-900; - } - - h1 { - @apply text-2xl text-nc-content-gray-emphasis leading-9 mb-0; - font-weight: 700; - } - p { - @apply text-nc-content-gray-emphasis leading-6; - font-size: 14px !important; - } - - li { - @apply text-nc-content-gray-emphasis leading-6; - font-size: 14px !important; - } - - h3 { - @apply text-nc-content-gray-emphasis text-lg leading-5 mb-0; - } + h1 { + @apply text-3xl text-nc-content-gray-emphasis leading-9 mb-0; + font-weight: 700; } -} -.aside { - @apply absolute left-0 top-0 bottom-0 w-52; + h2 { + @apply text-nc-content-gray-emphasis text-xl leading-6 mb-0; + } + p { + @apply text-nc-content-gray-emphasis leading-6; + font-size: 14px !important; + } - .aside-inner { - @apply sticky top-0 pt-5 pb-4; + li { + @apply text-nc-content-gray-emphasis leading-6; + font-size: 14px !important; } - .aside-divider { - @apply absolute top-0 right-0 bottom-0 w-1.5 mr-3; - &:before { - @apply absolute bg-[#E7E7E9] left-0 transform -translate-x-1/2; - content: ''; - top: 0px; - bottom: 0px; - width: 2px; - border-radius: 2px; - } - - .aside-divider-dot { - @apply sticky h-5 mr-3 top-9; - transform: translateY(calc(-50% + 3px)) translateX(50%); - &:before { - @apply bg-brand-500 absolute w-2 h-2 border-2 border-white left-0 rounded-full transform -translate-x-1/2; - content: ''; - } - } + h3 { + @apply text-nc-content-gray-emphasis text-lg leading-6 mb-0; } } diff --git a/packages/nc-gui/components/feed/Changelog/index.vue b/packages/nc-gui/components/feed/Changelog/index.vue index 0a3a14e070..9e9ba5ac98 100644 --- a/packages/nc-gui/components/feed/Changelog/index.vue +++ b/packages/nc-gui/components/feed/Changelog/index.vue @@ -31,8 +31,8 @@ const { isLoading } = useInfiniteScroll( -
- +
+
diff --git a/packages/nc-gui/components/feed/Recents/Card.vue b/packages/nc-gui/components/feed/Recents/Card.vue index 700884f979..e1ae05e122 100644 --- a/packages/nc-gui/components/feed/Recents/Card.vue +++ b/packages/nc-gui/components/feed/Recents/Card.vue @@ -37,7 +37,7 @@ const renderedText = computedAsync(async () => { ? Description.replace(/!\[.*?\]\(.*?\)/g, '') .substring(0, 250) .concat('...') - : Description, + : Description.replace(/^\[!\[.*?\]\(https?:\/\/.*?\)\]\(https?:\/\/.*?\)/m, ''), ) }) @@ -103,18 +103,26 @@ const { width } = useWindowSize() a { @apply text-gray-900; } - h1 { - @apply text-2xl text-nc-content-gray-emphasis truncate leading-9 mb-0; + @apply text-3xl text-nc-content-gray-emphasis truncate leading-9 mb-0; font-weight: 700; } + + h2 { + @apply text-nc-content-gray-emphasis text-xl leading-6 !mb-0; + } p { - @apply text-nc-content-gray-emphasis leading-5; + @apply text-nc-content-gray-emphasis leading-6; + font-size: 14px !important; + } + + li { + @apply text-nc-content-gray-emphasis leading-6; font-size: 14px !important; } h3 { - @apply text-nc-content-gray-emphasis text-lg leading-5 mb-0; + @apply text-nc-content-gray-emphasis text-lg leading-6 mb-0; } } } diff --git a/packages/nc-gui/components/feed/View.vue b/packages/nc-gui/components/feed/View.vue index d7343e660d..5fb2f8ff12 100644 --- a/packages/nc-gui/components/feed/View.vue +++ b/packages/nc-gui/components/feed/View.vue @@ -96,7 +96,7 @@ const tabs: Array<{ } .changelog-left { - left: calc(50% + 400px); + @apply xl:left-[calc(50%+350px)] left-[calc(50%+300px)]; } .changelog-twitter { diff --git a/packages/nc-gui/components/nc/Popover.vue b/packages/nc-gui/components/nc/Popover.vue new file mode 100644 index 0000000000..980467739f --- /dev/null +++ b/packages/nc-gui/components/nc/Popover.vue @@ -0,0 +1,183 @@ + + + + + diff --git a/packages/nc-gui/plugins/animation.ts b/packages/nc-gui/plugins/animation.ts new file mode 100644 index 0000000000..bd045cee44 --- /dev/null +++ b/packages/nc-gui/plugins/animation.ts @@ -0,0 +1,5 @@ +import { MotionPlugin } from '@vueuse/motion' + +export default defineNuxtPlugin((nuxtApp) => { + nuxtApp.vueApp.use(MotionPlugin) +})