diff --git a/package-lock.json b/package-lock.json index 35b112d..2203591 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,9 +8,13 @@ "name": "torrust-website", "version": "1.0.0", "dependencies": { - "@fontsource-variable/roboto-mono": "^5.0.9", - "@fontsource-variable/roboto-slab": "^5.0.12", - "shiki": "^1.5.2" + "@fontsource-variable/roboto-mono": "^5.0.19", + "@fontsource-variable/roboto-slab": "^5.0.20", + "flexsearch": "^0.7.43", + "shiki": "^1.6.1", + "shiki-es": "^0.14.0", + "vscode-oniguruma": "^2.0.1", + "vscode-textmate": "^9.0.0" }, "devDependencies": { "@histoire/plugin-svelte": "^0.16.1", @@ -644,6 +648,21 @@ "shiki-es": "^0.2.0" } }, + "node_modules/@histoire/app/node_modules/flexsearch": { + "version": "0.7.21", + "resolved": "https://registry.npmjs.org/flexsearch/-/flexsearch-0.7.21.tgz", + "integrity": "sha512-W7cHV7Hrwjid6lWmy0IhsWDFQboWSng25U3VVywpHOTJnnAZNPScog67G+cVpeX9f7yDD21ih0WDrMMT+JoaYg==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/@histoire/app/node_modules/shiki-es": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/shiki-es/-/shiki-es-0.2.0.tgz", + "integrity": "sha512-RbRMD+IuJJseSZljDdne9ThrUYrwBwJR04FvN4VXpfsU3MNID5VJGHLAD5je/HGThCyEKNgH+nEkSFEWKD7C3Q==", + "deprecated": "Please migrate to https://github.com/antfu/shikiji", + "dev": true, + "license": "MIT" + }, "node_modules/@histoire/controls": { "version": "0.16.5", "resolved": "https://registry.npmjs.org/@histoire/controls/-/controls-0.16.5.tgz", @@ -980,9 +999,9 @@ "license": "MIT" }, "node_modules/@shikijs/core": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-1.6.0.tgz", - "integrity": "sha512-NIEAi5U5R7BLkbW1pG/ZKu3eb1lzc3/+jD0lFsuxMT7zjaf9bbNwdNyMr7zh/Zl8EXQtQ+MYBAt5G+JLu+5DlA==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-1.6.1.tgz", + "integrity": "sha512-CqYyepN4SnBopaoXYwng4NO8riB5ask/LTCkhOFq+GNGtr2X+aKeD767eYdqYukeixEUvv4bXdyTYVaogj7KBw==", "license": "MIT" }, "node_modules/@sveltejs/adapter-static": { @@ -3005,10 +3024,9 @@ "license": "ISC" }, "node_modules/flexsearch": { - "version": "0.7.21", - "resolved": "https://registry.npmjs.org/flexsearch/-/flexsearch-0.7.21.tgz", - "integrity": "sha512-W7cHV7Hrwjid6lWmy0IhsWDFQboWSng25U3VVywpHOTJnnAZNPScog67G+cVpeX9f7yDD21ih0WDrMMT+JoaYg==", - "dev": true, + "version": "0.7.43", + "resolved": "https://registry.npmjs.org/flexsearch/-/flexsearch-0.7.43.tgz", + "integrity": "sha512-c5o/+Um8aqCSOXGcZoqZOm+NqtVwNsvVpWv6lfmSclU954O3wvQKxxK8zj74fPaSJbXpSLTs4PRhh+wnoCXnKg==", "license": "Apache-2.0" }, "node_modules/form-data": { @@ -3421,6 +3439,13 @@ "vite": "^2.9.0 || ^3.0.0 || ^4.0.0" } }, + "node_modules/histoire/node_modules/flexsearch": { + "version": "0.7.21", + "resolved": "https://registry.npmjs.org/flexsearch/-/flexsearch-0.7.21.tgz", + "integrity": "sha512-W7cHV7Hrwjid6lWmy0IhsWDFQboWSng25U3VVywpHOTJnnAZNPScog67G+cVpeX9f7yDD21ih0WDrMMT+JoaYg==", + "dev": true, + "license": "Apache-2.0" + }, "node_modules/histoire/node_modules/fs-extra": { "version": "10.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", @@ -3449,6 +3474,14 @@ "graceful-fs": "^4.1.6" } }, + "node_modules/histoire/node_modules/shiki-es": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/shiki-es/-/shiki-es-0.2.0.tgz", + "integrity": "sha512-RbRMD+IuJJseSZljDdne9ThrUYrwBwJR04FvN4VXpfsU3MNID5VJGHLAD5je/HGThCyEKNgH+nEkSFEWKD7C3Q==", + "deprecated": "Please migrate to https://github.com/antfu/shikiji", + "dev": true, + "license": "MIT" + }, "node_modules/histoire/node_modules/universalify": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", @@ -5424,20 +5457,19 @@ } }, "node_modules/shiki": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-1.6.0.tgz", - "integrity": "sha512-P31ROeXcVgW/k3Z+vUUErcxoTah7ZRaimctOpzGuqAntqnnSmx1HOsvnbAB8Z2qfXPRhw61yptAzCsuKOhTHwQ==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-1.6.1.tgz", + "integrity": "sha512-1Pu/A1rtsG6HZvQm4W0NExQ45e02og+rPog7PDaFDiMumZgOYnZIu4JtGQeAIfMwdbKSjJQoCUr79vDLKUUxWA==", "license": "MIT", "dependencies": { - "@shikijs/core": "1.6.0" + "@shikijs/core": "1.6.1" } }, "node_modules/shiki-es": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/shiki-es/-/shiki-es-0.2.0.tgz", - "integrity": "sha512-RbRMD+IuJJseSZljDdne9ThrUYrwBwJR04FvN4VXpfsU3MNID5VJGHLAD5je/HGThCyEKNgH+nEkSFEWKD7C3Q==", + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/shiki-es/-/shiki-es-0.14.0.tgz", + "integrity": "sha512-e+/aueHx0YeIEut6RXC6K8gSf0PykwZiHD7q7AHtpTW8Kd8TpFUIWqTwhAnrGjOyOMyrwv+syr5WPagMpDpVYQ==", "deprecated": "Please migrate to https://github.com/antfu/shikiji", - "dev": true, "license": "MIT" }, "node_modules/simple-concat": { @@ -6492,6 +6524,18 @@ } } }, + "node_modules/vscode-oniguruma": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-2.0.1.tgz", + "integrity": "sha512-poJU8iHIWnC3vgphJnrLZyI3YdqRlR27xzqDmpPXYzA93R4Gk8z7T6oqDzDoHjoikA2aS82crdXFkjELCdJsjQ==", + "license": "MIT" + }, + "node_modules/vscode-textmate": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-9.0.0.tgz", + "integrity": "sha512-Cl65diFGxz7gpwbav10HqiY/eVYTO1sjQpmRmV991Bj7wAoOAjGQ97PpQcXorDE2Uc4hnGWLY17xme+5t6MlSg==", + "license": "MIT" + }, "node_modules/w3c-keyname": { "version": "2.2.8", "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.8.tgz", diff --git a/package.json b/package.json index d3a885d..ed7d673 100644 --- a/package.json +++ b/package.json @@ -48,9 +48,13 @@ }, "type": "module", "dependencies": { - "@fontsource-variable/roboto-mono": "^5.0.9", - "@fontsource-variable/roboto-slab": "^5.0.12", - "shiki": "^1.5.2" + "@fontsource-variable/roboto-mono": "^5.0.19", + "@fontsource-variable/roboto-slab": "^5.0.20", + "flexsearch": "^0.7.43", + "shiki": "^1.6.1", + "shiki-es": "^0.14.0", + "vscode-oniguruma": "^2.0.1", + "vscode-textmate": "^9.0.0" }, "packageManager": "yarn@4.1.0" } diff --git a/src/app.html b/src/app.html index acd28d2..825a81a 100644 --- a/src/app.html +++ b/src/app.html @@ -30,7 +30,7 @@ - + diff --git a/src/lib/components/organisms/Header.story.svelte b/src/lib/components/organisms/Header.story.svelte index 05c94f5..ac0e3c7 100644 --- a/src/lib/components/organisms/Header.story.svelte +++ b/src/lib/components/organisms/Header.story.svelte @@ -2,6 +2,9 @@ import '$lib/scss/global.scss'; import type { Hst as HstType } from '@histoire/plugin-svelte'; import Header from './Header.svelte'; + import type { BlogPost } from '$lib/utils/types'; + + export let posts: BlogPost[]; export let Hst: HstType; @@ -12,10 +15,10 @@ layout={{ type: 'single', iframe: true }} > -
+
-
+
diff --git a/src/lib/components/organisms/Header.svelte b/src/lib/components/organisms/Header.svelte index 4fecb26..860dfa9 100644 --- a/src/lib/components/organisms/Header.svelte +++ b/src/lib/components/organisms/Header.svelte @@ -4,9 +4,12 @@ import RssLink from '$lib/components/atoms/RssLink.svelte'; import Socials from '$lib/components/molecules/Socials.svelte'; import AnimatedHamburger from '$lib/components/singletons/AnimatedHamburger.svelte'; - import Strap from '../singletons/Strap.svelte'; + import Strap from '$lib/components/singletons/Strap.svelte'; + import SearchBar from '$lib/components/singletons/SearchBar.svelte'; + import type { BlogPost } from '$lib/utils/types'; export let showBackground = false; + export let posts: BlogPost[]; let isMenuOpen = false; @@ -17,6 +20,12 @@ function closeMenu() { isMenuOpen = false; } + + function handleLinkClick() { + isMenuOpen = false; + } + + let searchTerm = ''; @@ -28,6 +37,9 @@