diff --git a/Doc Omnisearch/Index.md b/Doc Omnisearch/Index.md index a053f96..71e1a22 100644 --- a/Doc Omnisearch/Index.md +++ b/Doc Omnisearch/Index.md @@ -5,8 +5,8 @@ - Omnisearch is available on [the official Community Plugins repository](https://obsidian.md/plugins?search=Omnisearch). - Beta releases can be installed through [BRAT](https://github.com/TfTHacker/obsidian42-brat). **Be advised that those versions can be buggy and break things.** -> [!INFO] Chinese, Japanese, Korean, ... -> If you have notes in a CJK language, you should install [this additional plugin](https://github.com/aidenlx/cm-chs-patch) +> [!INFO] Chinese users +> If you have notes in Chinese, you should install [this additional plugin](https://github.com/aidenlx/cm-chs-patch) for better search results. ## Documentation @@ -22,8 +22,9 @@ Omnisearch is licensed under [GPL-3](https://tldrlegal.com/license/gnu-general-p ## Thanks -❤ To all people who donate through [Ko-Fi](https://ko-fi.com/scambier)or [Github Sponsors](https://github.com/sponsors/scambier), to code contributors, and to Obsidian who graciously provides this Publish space ❤ +❤ To all people who donate through [Ko-Fi](https://ko-fi.com/scambier) or [Github Sponsors](https://github.com/sponsors/scambier), to code contributors, and to the Obsidian team who graciously provides this Publish space ❤ If you wish to get involved in Omnisearch's development, there are [open issues](https://github.com/scambier/obsidian-omnisearch/issues) that need to be solved, and probably several of them tagged as "[good first issue](https://github.com/scambier/obsidian-omnisearch/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)" :) - + + \ No newline at end of file diff --git a/assets/styles.css b/assets/styles.css index bdd10e7..9730110 100644 --- a/assets/styles.css +++ b/assets/styles.css @@ -5,7 +5,7 @@ white-space: normal; display: flex; flex-direction: row; - justify-content: space-between; + /* justify-content: space-between; */ flex-wrap: nowrap; } @@ -59,6 +59,11 @@ margin-inline-start: 0.5em; } +.omnisearch-result__embed { + margin-left: 1em; +} + + .omnisearch-result__image-container { flex-basis: 20%; text-align: end; diff --git a/manifest.json b/manifest.json index c3d4ce2..4fa93ed 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "id": "omnisearch", "name": "Omnisearch", "version": "1.24.1", - "minAppVersion": "1.3.0", + "minAppVersion": "1.7.2", "description": "A search engine that just works", "author": "Simon Cambier", "authorUrl": "https://github.com/scambier/obsidian-omnisearch", diff --git a/package.json b/package.json index 5c0cb98..6532329 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "esbuild-plugin-copy": "1.3.0", "esbuild-svelte": "0.7.1", "jest": "^27.5.1", - "obsidian": "1.5.7-1", + "obsidian": "1.7.2", "prettier": "^2.8.8", "prettier-plugin-svelte": "^2.10.1", "svelte": "^3.59.2", @@ -37,7 +37,7 @@ "svelte-preprocess": "^4.10.7", "tslib": "2.3.1", "typescript": "^4.9.5", - "vite": "^3.2.10" + "vite": "^3.2.11" }, "dependencies": { "cancelable-promise": "^4.3.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8c43382..3b32fcb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -76,8 +76,8 @@ importers: specifier: ^27.5.1 version: 27.5.1 obsidian: - specifier: 1.5.7-1 - version: 1.5.7-1(@codemirror/state@6.4.1)(@codemirror/view@6.26.3) + specifier: 1.7.2 + version: 1.7.2(@codemirror/state@6.4.1)(@codemirror/view@6.26.3) prettier: specifier: ^2.8.8 version: 2.8.8 @@ -89,13 +89,13 @@ importers: version: 3.59.2 svelte-check: specifier: ^2.10.3 - version: 2.10.3(@babel/core@7.25.2)(postcss@8.4.47)(sass@1.78.0)(svelte@3.59.2) + version: 2.10.3(@babel/core@7.25.2)(postcss@8.4.47)(sass@1.79.3)(svelte@3.59.2) svelte-jester: specifier: ^2.3.2 version: 2.3.2(jest@27.5.1)(svelte@3.59.2) svelte-preprocess: specifier: ^4.10.7 - version: 4.10.7(@babel/core@7.25.2)(postcss@8.4.47)(sass@1.78.0)(svelte@3.59.2)(typescript@4.9.5) + version: 4.10.7(@babel/core@7.25.2)(postcss@8.4.47)(sass@1.79.3)(svelte@3.59.2)(typescript@4.9.5) tslib: specifier: 2.3.1 version: 2.3.1 @@ -103,8 +103,8 @@ importers: specifier: ^4.9.5 version: 4.9.5 vite: - specifier: ^3.2.10 - version: 3.2.10(@types/node@16.18.108)(sass@1.78.0) + specifier: ^3.2.11 + version: 3.2.11(@types/node@16.18.108)(sass@1.79.3) packages: @@ -861,8 +861,8 @@ packages: '@types/codemirror@5.60.8': resolution: {integrity: sha512-VjFgDF/eB+Aklcy15TtOTLQeMjTo07k7KAjql8OK5Dirr7a6sJY4T1uVBDuTVG9VEmn1uUsohOpYnVfgC6/jyw==} - '@types/estree@1.0.5': - resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} + '@types/estree@1.0.6': + resolution: {integrity: sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==} '@types/graceful-fs@4.1.9': resolution: {integrity: sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==} @@ -968,8 +968,8 @@ packages: argparse@1.0.10: resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - aria-query@5.3.1: - resolution: {integrity: sha512-Z/ZeOgVl7bcSYZ/u/rh0fOpvEpq//LZmdbkXyc7syVzjPAhfOa9ebsdTSjEBDU4vs5nC98Kfduj1uFo0qyET3g==} + aria-query@5.3.2: + resolution: {integrity: sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==} engines: {node: '>= 0.4'} array-union@2.1.0: @@ -1072,8 +1072,8 @@ packages: cancelable-promise@4.3.1: resolution: {integrity: sha512-A/8PwLk/T7IJDfUdQ68NR24QHa8rIlnN/stiJEBo6dmVUkD4K14LswG0w3VwdeK/o7qOwRUR1k2MhK5Rpy2m7A==} - caniuse-lite@1.0.30001660: - resolution: {integrity: sha512-GacvNTTuATm26qC74pt+ad1fW15mlQ/zuTzzY1ZoIzECTP8HURDfF43kNxPgf7H1jmelCBQTTbBNxdSXOA7Bqg==} + caniuse-lite@1.0.30001662: + resolution: {integrity: sha512-sgMUVwLmGseH8ZIrm1d51UbrhqMCH3jvS7gF/M6byuHOnKyLOBL7W8yz5V02OHwgLGA36o/AFhWzzh4uc5aqTA==} chalk@2.4.2: resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} @@ -1102,6 +1102,10 @@ packages: resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} engines: {node: '>= 8.10.0'} + chokidar@4.0.0: + resolution: {integrity: sha512-mxIojEAQcuEvT/lyXq+jf/3cO/KoA6z4CeNDGGevTybECPOMFCnQy3OPahluUkbqgPNGw5Bi78UC7Po6Lhy+NA==} + engines: {node: '>= 14.16.0'} + ci-info@3.9.0: resolution: {integrity: sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==} engines: {node: '>=8'} @@ -1240,8 +1244,8 @@ packages: domutils@3.1.0: resolution: {integrity: sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==} - electron-to-chromium@1.5.23: - resolution: {integrity: sha512-mBhODedOXg4v5QWwl21DjM5amzjmI1zw9EPrPK/5Wx7C8jt33bpZNrC7OhHUG3pxRtbLpr3W2dXT+Ph1SsfRZA==} + electron-to-chromium@1.5.27: + resolution: {integrity: sha512-o37j1vZqCoEgBuWWXLHQgTN/KDKe7zwpiY5CPeq2RvUqOyJw9xnrULzZAEVQ5p4h+zjMk7hgtOoPdnLxr7m/jw==} emittery@0.8.1: resolution: {integrity: sha512-uDfvUjVrfGJJhymx/kz6prltenw1u7WrCg1oa94zYY8xxVpLLUu045LAT0dhDZdXG58/EpPL/5kA180fQ/qudg==} @@ -2044,8 +2048,8 @@ packages: nwsapi@2.2.12: resolution: {integrity: sha512-qXDmcVlZV4XRtKFzddidpfVP4oMSGhga+xdMc25mv8kaLUHtgzCDhUxkrN8exkGdTlLNaXj7CV3GtON7zuGZ+w==} - obsidian@1.5.7-1: - resolution: {integrity: sha512-T5ZRuQ1FnfXqEoakTTHVDYvzUEEoT8zSPnQCW31PVgYwG4D4tZCQfKHN2hTz1ifnCe8upvwa6mBTAP2WUA5Vng==} + obsidian@1.7.2: + resolution: {integrity: sha512-k9hN9brdknJC+afKr5FQzDRuEFGDKbDjfCazJwpgibwCAoZNYHYV8p/s3mM8I6AsnKrPKNXf8xGuMZ4enWelZQ==} peerDependencies: '@codemirror/state': ^6.0.0 '@codemirror/view': ^6.0.0 @@ -2169,6 +2173,10 @@ packages: resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} engines: {node: '>=8.10.0'} + readdirp@4.0.1: + resolution: {integrity: sha512-GkMg9uOTpIWWKbSsgwb5fA4EavTR+SG/PMPoAY8hkhHfEEY0/vqljY+XHqtDf2cr2IJtoNRDbrrEpZUiZCkYRw==} + engines: {node: '>= 14.16.0'} + redent@3.0.0: resolution: {integrity: sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==} engines: {node: '>=8'} @@ -2253,8 +2261,8 @@ packages: sander@0.5.1: resolution: {integrity: sha512-3lVqBir7WuKDHGrKRDn/1Ye3kwpXaDOMsiRP1wd6wpZW56gJhsbp5RqQpA6JG/P+pkXizygnr1dKR8vzWaVsfA==} - sass@1.78.0: - resolution: {integrity: sha512-AaIqGSrjo5lA2Yg7RvFZrlXDBCp3nV4XP73GrLGvdRWWwk+8H3l0SDvq/5bA4eF+0RFPLuWUk3E+P1U/YqnpsQ==} + sass@1.79.3: + resolution: {integrity: sha512-m7dZxh0W9EZ3cw50Me5GOuYm/tVAJAn91SUnohLRo9cXBixGUOdvmryN+dXpwR831bhoY3Zv7rEFt85PUwTmzA==} engines: {node: '>=14.0.0'} hasBin: true @@ -2523,8 +2531,8 @@ packages: resolution: {integrity: sha512-FGtKtv3xIpR6BYhvgH8MI/y78oT7d8Au3ww4QIxymrCtZEh5b8gCw2siywE+puhEmuWKDtmfrvF5UlB298ut3w==} engines: {node: '>=10.12.0'} - vite@3.2.10: - resolution: {integrity: sha512-Dx3olBo/ODNiMVk/cA5Yft9Ws+snLOXrhLtrI3F4XLt4syz2Yg8fayZMWScPKoz12v5BUv7VEmQHnsfpY80fYw==} + vite@3.2.11: + resolution: {integrity: sha512-K/jGKL/PgbIgKCiJo5QbASQhFiV02X9Jh+Qq0AKCRCRKZtOTVi4t6wh75FDpGf2N9rYOnzH87OEFQNaFy6pdxQ==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true peerDependencies: @@ -3659,7 +3667,7 @@ snapshots: '@adobe/css-tools': 4.4.0 '@babel/runtime': 7.25.6 '@types/testing-library__jest-dom': 5.14.9 - aria-query: 5.3.1 + aria-query: 5.3.2 chalk: 3.0.0 css.escape: 1.5.1 dom-accessibility-api: 0.5.16 @@ -3695,7 +3703,7 @@ snapshots: dependencies: '@types/tern': 0.23.9 - '@types/estree@1.0.5': {} + '@types/estree@1.0.6': {} '@types/graceful-fs@4.1.9': dependencies: @@ -3732,13 +3740,13 @@ snapshots: '@types/sass@1.45.0': dependencies: - sass: 1.78.0 + sass: 1.79.3 '@types/stack-utils@2.0.3': {} '@types/tern@0.23.9': dependencies: - '@types/estree': 1.0.5 + '@types/estree': 1.0.6 '@types/testing-library__jest-dom@5.14.9': dependencies: @@ -3794,7 +3802,7 @@ snapshots: dependencies: sprintf-js: 1.0.3 - aria-query@5.3.1: {} + aria-query@5.3.2: {} array-union@2.1.0: {} @@ -3899,8 +3907,8 @@ snapshots: browserslist@4.23.3: dependencies: - caniuse-lite: 1.0.30001660 - electron-to-chromium: 1.5.23 + caniuse-lite: 1.0.30001662 + electron-to-chromium: 1.5.27 node-releases: 2.0.18 update-browserslist-db: 1.1.0(browserslist@4.23.3) @@ -3922,7 +3930,7 @@ snapshots: cancelable-promise@4.3.1: {} - caniuse-lite@1.0.30001660: {} + caniuse-lite@1.0.30001662: {} chalk@2.4.2: dependencies: @@ -3977,6 +3985,10 @@ snapshots: optionalDependencies: fsevents: 2.3.3 + chokidar@4.0.0: + dependencies: + readdirp: 4.0.1 + ci-info@3.9.0: {} cjs-module-lexer@1.4.1: {} @@ -4097,7 +4109,7 @@ snapshots: domelementtype: 2.3.0 domhandler: 5.0.3 - electron-to-chromium@1.5.23: {} + electron-to-chromium@1.5.27: {} emittery@0.8.1: {} @@ -5049,7 +5061,7 @@ snapshots: nwsapi@2.2.12: {} - obsidian@1.5.7-1(@codemirror/state@6.4.1)(@codemirror/view@6.26.3): + obsidian@1.7.2(@codemirror/state@6.4.1)(@codemirror/view@6.26.3): dependencies: '@codemirror/state': 6.4.1 '@codemirror/view': 6.26.3 @@ -5160,6 +5172,8 @@ snapshots: dependencies: picomatch: 2.3.1 + readdirp@4.0.1: {} + redent@3.0.0: dependencies: indent-string: 4.0.0 @@ -5241,9 +5255,9 @@ snapshots: mkdirp: 0.5.6 rimraf: 2.7.1 - sass@1.78.0: + sass@1.79.3: dependencies: - chokidar: 3.6.0 + chokidar: 4.0.0 immutable: 4.3.7 source-map-js: 1.2.1 @@ -5341,7 +5355,7 @@ snapshots: supports-preserve-symlinks-flag@1.0.0: {} - svelte-check@2.10.3(@babel/core@7.25.2)(postcss@8.4.47)(sass@1.78.0)(svelte@3.59.2): + svelte-check@2.10.3(@babel/core@7.25.2)(postcss@8.4.47)(sass@1.79.3)(svelte@3.59.2): dependencies: '@jridgewell/trace-mapping': 0.3.25 chokidar: 3.6.0 @@ -5350,7 +5364,7 @@ snapshots: picocolors: 1.1.0 sade: 1.8.1 svelte: 3.59.2 - svelte-preprocess: 4.10.7(@babel/core@7.25.2)(postcss@8.4.47)(sass@1.78.0)(svelte@3.59.2)(typescript@4.9.5) + svelte-preprocess: 4.10.7(@babel/core@7.25.2)(postcss@8.4.47)(sass@1.79.3)(svelte@3.59.2)(typescript@4.9.5) typescript: 4.9.5 transitivePeerDependencies: - '@babel/core' @@ -5369,7 +5383,7 @@ snapshots: jest: 27.5.1 svelte: 3.59.2 - svelte-preprocess@4.10.7(@babel/core@7.25.2)(postcss@8.4.47)(sass@1.78.0)(svelte@3.59.2)(typescript@4.9.5): + svelte-preprocess@4.10.7(@babel/core@7.25.2)(postcss@8.4.47)(sass@1.79.3)(svelte@3.59.2)(typescript@4.9.5): dependencies: '@types/pug': 2.0.10 '@types/sass': 1.45.0 @@ -5381,7 +5395,7 @@ snapshots: optionalDependencies: '@babel/core': 7.25.2 postcss: 8.4.47 - sass: 1.78.0 + sass: 1.79.3 typescript: 4.9.5 svelte@3.59.2: {} @@ -5466,7 +5480,7 @@ snapshots: convert-source-map: 1.9.0 source-map: 0.7.4 - vite@3.2.10(@types/node@16.18.108)(sass@1.78.0): + vite@3.2.11(@types/node@16.18.108)(sass@1.79.3): dependencies: esbuild: 0.15.18 postcss: 8.4.47 @@ -5475,7 +5489,7 @@ snapshots: optionalDependencies: '@types/node': 16.18.108 fsevents: 2.3.3 - sass: 1.78.0 + sass: 1.79.3 w3c-hr-time@1.0.2: dependencies: diff --git a/src/cache-manager.ts b/src/cache-manager.ts index 5cbfb4e..60afdfd 100644 --- a/src/cache-manager.ts +++ b/src/cache-manager.ts @@ -22,7 +22,6 @@ export class CacheManager { * Show an empty input field next time the user opens Omnisearch modal */ private nextQueryIsEmpty = false - /** * The "live cache", containing all indexed vault files * in the form of IndexedDocuments @@ -45,6 +44,7 @@ export class CacheManager { return } this.documents.set(path, doc) + this.plugin.embedsRepository.refreshEmbeds(path) } catch (e) { console.warn(`Omnisearch: Error while adding "${path}" to live cache`, e) // Shouldn't be needed, but... @@ -163,16 +163,22 @@ export class CacheManager { else if ( isFileImage(path) && ((this.plugin.settings.imagesIndexing && - extractor?.canFileBeExtracted(path)) || - (this.plugin.settings.aiImageIndexing && - aiImageAnalyzer?.canBeAnalyzed(file))) + extractor?.canFileBeExtracted(path)) || + (this.plugin.settings.aiImageIndexing && + aiImageAnalyzer?.canBeAnalyzed(file))) ) { - if (this.plugin.settings.imagesIndexing && extractor?.canFileBeExtracted(path)){ + if ( + this.plugin.settings.imagesIndexing && + extractor?.canFileBeExtracted(path) + ) { content = await extractor.extractText(file) } - if (this.plugin.settings.aiImageIndexing && aiImageAnalyzer?.canBeAnalyzed(file)) { - content = await aiImageAnalyzer.analyzeImage(file) + (content ?? '') + if ( + this.plugin.settings.aiImageIndexing && + aiImageAnalyzer?.canBeAnalyzed(file) + ) { + content = (await aiImageAnalyzer.analyzeImage(file)) + (content ?? '') } } // ** PDF ** @@ -230,7 +236,8 @@ export class CacheManager { } } } - const displayTitle = metadata?.frontmatter?.[this.plugin.settings.displayTitle] ?? '' + const displayTitle = + metadata?.frontmatter?.[this.plugin.settings.displayTitle] ?? '' const tags = getTagsFromMetadata(metadata) return { basename: file.basename, diff --git a/src/components/ResultItemContainer.svelte b/src/components/ResultItemContainer.svelte index 230b396..71cdab6 100644 --- a/src/components/ResultItemContainer.svelte +++ b/src/components/ResultItemContainer.svelte @@ -4,11 +4,12 @@ export let id: string export let selected = false export let glyph = false + export let cssClass = ''