Merge branch 'main' into feat/knowledge-dark-mode

This commit is contained in:
twwu
2025-01-23 15:10:46 +08:00
18 changed files with 263 additions and 114 deletions

View File

@ -10,6 +10,7 @@ import {
import { Tab } from '@headlessui/react'
import { Tag } from './tag'
import classNames from '@/utils/classnames'
import { writeTextToClipboard } from '@/utils/clipboard'
const languageNames = {
js: 'JavaScript',
@ -71,7 +72,7 @@ function CopyButton({ code }: { code: string }) {
: 'bg-white/5 hover:bg-white/7.5 dark:bg-white/2.5 dark:hover:bg-white/5',
)}
onClick={() => {
window.navigator.clipboard.writeText(code).then(() => {
writeTextToClipboard(code).then(() => {
setCopyCount(count => count + 1)
})
}}

View File

@ -46,7 +46,7 @@ const ProviderList = () => {
if (tagFilterValue.length > 0 && (!collection.labels || collection.labels.every(label => !tagFilterValue.includes(label))))
return false
if (keywords)
return collection.name.toLowerCase().includes(keywords.toLowerCase())
return Object.values(collection.label).some(value => value.toLowerCase().includes(keywords.toLowerCase()))
return true
})
}, [activeTab, tagFilterValue, keywords, collectionList])

View File

@ -546,7 +546,9 @@ export const getVarType = ({
else {
(valueSelector as ValueSelector).slice(1).forEach((key, i) => {
const isLast = i === valueSelector.length - 2
curr = curr?.find((v: any) => v.variable === key)
if (Array.isArray(curr))
curr = curr?.find((v: any) => v.variable === key)
if (isLast) {
type = curr?.type
}