pimelon-ui 0.1.123 → 0.1.124

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pimelon-ui",
3
- "version": "0.1.123",
3
+ "version": "0.1.124",
4
4
  "description": "A set of components and utilities for rapid UI development",
5
5
  "main": "./src/index.js",
6
6
  "scripts": {
@@ -25,6 +25,24 @@ export default Extension.create({
25
25
  .filter((item) =>
26
26
  item.name.toLowerCase().includes(query.toLowerCase()),
27
27
  )
28
+ .sort((a, b) => {
29
+ const aName = a.name.toLowerCase()
30
+ const bName = b.name.toLowerCase()
31
+ const queryLower = query.toLowerCase()
32
+
33
+ // Exact matches first
34
+ if (aName === queryLower && bName !== queryLower) return -1
35
+ if (bName === queryLower && aName !== queryLower) return 1
36
+
37
+ // Then names starting with the query
38
+ if (aName.startsWith(queryLower) && !bName.startsWith(queryLower))
39
+ return -1
40
+ if (bName.startsWith(queryLower) && !aName.startsWith(queryLower))
41
+ return 1
42
+
43
+ // Then sort by name length (shorter first)
44
+ return aName.length - bName.length
45
+ })
28
46
  .slice(0, 5)
29
47
  },
30
48
  render: () => {