unvendor: Replace Fuse

This commit is contained in:
Cohee
2024-10-16 22:15:38 +03:00
parent 4725b869eb
commit e6d8f0a33e
15 changed files with 26 additions and 2401 deletions

View File

@ -1,3 +1,5 @@
import { Fuse } from '../lib.js';
import {
saveSettingsDebounced,
scrollChatToBottom,
@ -1823,7 +1825,7 @@ async function loadContextSettings() {
/**
* Fuzzy search characters by a search term
* @param {string} searchValue - The search term
* @returns {FuseResult[]} Results as items with their score
* @returns {import('fuse.js').FuseResult<any>[]} Results as items with their score
*/
export function fuzzySearchCharacters(searchValue) {
// @ts-ignore
@ -1856,7 +1858,7 @@ export function fuzzySearchCharacters(searchValue) {
* Fuzzy search world info entries by a search term
* @param {*[]} data - WI items data array
* @param {string} searchValue - The search term
* @returns {FuseResult[]} Results as items with their score
* @returns {import('fuse.js').FuseResult<any>[]} Results as items with their score
*/
export function fuzzySearchWorldInfo(data, searchValue) {
// @ts-ignore
@ -1885,7 +1887,7 @@ export function fuzzySearchWorldInfo(data, searchValue) {
* Fuzzy search persona entries by a search term
* @param {*[]} data - persona data array
* @param {string} searchValue - The search term
* @returns {FuseResult[]} Results as items with their score
* @returns {import('fuse.js').FuseResult<any>[]} Results as items with their score
*/
export function fuzzySearchPersonas(data, searchValue) {
data = data.map(x => ({ key: x, name: power_user.personas[x] ?? '', description: power_user.persona_descriptions[x]?.description ?? '' }));
@ -1909,7 +1911,7 @@ export function fuzzySearchPersonas(data, searchValue) {
/**
* Fuzzy search tags by a search term
* @param {string} searchValue - The search term
* @returns {FuseResult[]} Results as items with their score
* @returns {import('fuse.js').FuseResult<any>[]} Results as items with their score
*/
export function fuzzySearchTags(searchValue) {
// @ts-ignore
@ -1931,7 +1933,7 @@ export function fuzzySearchTags(searchValue) {
/**
* Fuzzy search groups by a search term
* @param {string} searchValue - The search term
* @returns {FuseResult[]} Results as items with their score
* @returns {import('fuse.js').FuseResult<any>[]} Results as items with their score
*/
export function fuzzySearchGroups(searchValue) {
// @ts-ignore