Removed a circular dependency

This commit is contained in:
2025-06-21 13:56:38 +02:00
parent 833d89dea8
commit fc847b02b5
6 changed files with 46 additions and 54 deletions
+16 -19
View File
@@ -1,6 +1,8 @@
<script lang="ts">
import { showExcerpt } from '../settings/index'
import { setIcon, TFile } from 'obsidian'
import { onMount } from 'svelte'
import type { ResultNote } from '../globals'
import type LocatorPlugin from '../main'
import {
getExtension,
isFileCanvas,
@@ -10,17 +12,14 @@
pathWithoutFilename,
} from '../tools/utils'
import ResultItemContainer from './ResultItemContainer.svelte'
import type LocatorPlugin from '../main'
import { setIcon, TFile } from 'obsidian'
import { onMount } from 'svelte'
// Import icon utility functions
import { showExcerpt } from 'src/settings/utils'
import {
loadIconData,
initializeIconPacks,
getIconNameForPath,
loadIconSVG,
getDefaultIconSVG,
getIconNameForPath,
initializeIconPacks,
loadIconData,
loadIconSVG,
} from '../tools/icon-utils'
export let selected = false
@@ -148,25 +147,24 @@
</script>
<ResultItemContainer
glyph="{glyph}"
id="{note.path}"
{glyph}
id={note.path}
cssClass=" {note.isEmbed ? 'omnisearch-result__embed' : ''}"
on:auxclick
on:click
on:mousemove
selected="{selected}">
{selected}>
<div>
<div class="omnisearch-result__title-container">
<span class="omnisearch-result__title">
{#if note.isEmbed}
<span
bind:this="{elEmbedIcon}"
title="The document above is embedded in this note"></span>
bind:this={elEmbedIcon}
title="The document above is embedded in this note" />
{:else}
<!-- File Icon -->
{#if fileIconSVG}
<span class="omnisearch-result__icon" use:renderSVG="{fileIconSVG}"
></span>
<span class="omnisearch-result__icon" use:renderSVG={fileIconSVG} />
{/if}
{/if}
<span>
@@ -194,8 +192,7 @@
<div class="omnisearch-result__folder-path">
<!-- Folder Icon -->
{#if folderIconSVG}
<span class="omnisearch-result__icon" use:renderSVG="{folderIconSVG}"
></span>
<span class="omnisearch-result__icon" use:renderSVG={folderIconSVG} />
{/if}
<span>
{@html plugin.textProcessor.highlightText(notePath, matchesNotePath)}
@@ -218,7 +215,7 @@
<!-- Image -->
{#if imagePath}
<div class="omnisearch-result__image-container">
<img style="width: 100px" src="{imagePath}" alt="" />
<img style="width: 100px" src={imagePath} alt="" />
</div>
{/if}
</div>