From 51fc7d4c057252d8c8896b8286702a8124a13c4b Mon Sep 17 00:00:00 2001 From: codytseng Date: Fri, 12 Dec 2025 10:23:02 +0800 Subject: [PATCH] feat: add support for thumbhash --- package-lock.json | 7 +++ package.json | 1 + src/components/Collapsible/index.tsx | 4 +- src/components/Image/index.tsx | 66 ++++++++++++++++++++++++---- src/lib/tag.ts | 51 +++++++++++++-------- src/types/index.d.ts | 1 + 6 files changed, 101 insertions(+), 29 deletions(-) diff --git a/package-lock.json b/package-lock.json index d771e731..8f178e2d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -74,6 +74,7 @@ "sonner": "^2.0.5", "tailwind-merge": "^2.5.5", "tailwindcss-animate": "^1.0.7", + "thumbhash": "^0.1.1", "tippy.js": "^6.3.7", "uri-templates": "^0.2.0", "vaul": "^1.1.2", @@ -11813,6 +11814,12 @@ "node": ">=0.8" } }, + "node_modules/thumbhash": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/thumbhash/-/thumbhash-0.1.1.tgz", + "integrity": "sha512-kH5pKeIIBPQXAOni2AiY/Cu/NKdkFREdpH+TLdM0g6WA7RriCv0kPLgP731ady67MhTAqrVG/4mnEeibVuCJcg==", + "license": "MIT" + }, "node_modules/tinyglobby": { "version": "0.2.10", "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.10.tgz", diff --git a/package.json b/package.json index 7b01ce20..9e6afa2c 100644 --- a/package.json +++ b/package.json @@ -84,6 +84,7 @@ "sonner": "^2.0.5", "tailwind-merge": "^2.5.5", "tailwindcss-animate": "^1.0.7", + "thumbhash": "^0.1.1", "tippy.js": "^6.3.7", "uri-templates": "^0.2.0", "vaul": "^1.1.2", diff --git a/src/components/Collapsible/index.tsx b/src/components/Collapsible/index.tsx index 0fa4af53..9a718887 100644 --- a/src/components/Collapsible/index.tsx +++ b/src/components/Collapsible/index.tsx @@ -57,8 +57,8 @@ export default function Collapsible({ > {children} {shouldCollapse && !expanded && ( -
-
+
+