- Updated .env.example to include configuration for OnlyOffice Document Server. - Modified the workspace configuration to remove the drive-suite path. - Adjusted TypeScript environment imports for consistency. - Enhanced Next.js configuration to disable canvas in Webpack. - Updated package.json to include new dependencies for OnlyOffice and PDF.js. - Added global styles for OnlyOffice theme integration in the CSS. - Created new layout and page components for the Drive feature, including public sharing and editing functionalities. - Updated metadata handling across various layouts to reflect the new app structure.
23 lines
645 B
TypeScript
23 lines
645 B
TypeScript
import Fuse from "fuse.js"
|
|
import {
|
|
MAIL_SETTINGS_SEARCH_INDEX,
|
|
type MailSettingsSearchEntry,
|
|
} from "@/lib/mail-settings/settings-search-index"
|
|
|
|
const fuse = new Fuse(MAIL_SETTINGS_SEARCH_INDEX, {
|
|
keys: [
|
|
{ name: "label", weight: 0.45 },
|
|
{ name: "sectionLabel", weight: 0.2 },
|
|
{ name: "keywords", weight: 0.25 },
|
|
{ name: "description", weight: 0.1 },
|
|
],
|
|
threshold: 0.38,
|
|
ignoreLocation: true,
|
|
})
|
|
|
|
export function searchMailSettings(query: string, limit = 8): MailSettingsSearchEntry[] {
|
|
const trimmed = query.trim()
|
|
if (!trimmed) return []
|
|
return fuse.search(trimmed, { limit }).map((result) => result.item)
|
|
}
|