Skip to content

Commit f811b99

Browse files
committed
Merge branch 'chore/all-my-stuffs' of https://github.com/sharevb/it-tools into chore/all-my-stuffs
2 parents 811e52f + 2781815 commit f811b99

File tree

4 files changed

+22
-6
lines changed

4 files changed

+22
-6
lines changed

components.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// Read more: https://github.com/vuejs/core/pull/3399
66
import '@vue/runtime-core'
77

8-
export {}
8+
export { }
99

1010
declare module '@vue/runtime-core' {
1111
export interface GlobalComponents {
@@ -357,6 +357,7 @@ declare module '@vue/runtime-core' {
357357
MttdlCalculator: typeof import('./src/tools/mttdl-calculator/mttdl-calculator.vue')['default']
358358
MultiLinkDownloader: typeof import('./src/tools/multi-link-downloader/multi-link-downloader.vue')['default']
359359
MyIp: typeof import('./src/tools/my-ip/my-ip.vue')['default']
360+
NA: typeof import('naive-ui')['NA']
360361
NanoidGenerator: typeof import('./src/tools/nanoid-generator/nanoid-generator.vue')['default']
361362
NanoMemo: typeof import('./src/tools/nano-memo/nano-memo.vue')['default']
362363
'NanoMemo.content': typeof import('./src/tools/nano-memo/nano-memo.content.md')['default']

locales/en.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3236,7 +3236,7 @@ tools:
32363236
tag-category: Category
32373237
tag-html: Html
32383238
tag-name: Name
3239-
tag-gt-more-info: '> More info'
3239+
tag-gt-more-info: 'More info about this character'
32403240
url-cleaner:
32413241
title: Url Cleaner
32423242
description: >-

locales/zh.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3075,7 +3075,7 @@ tools:
30753075
tag-category: 类别
30763076
tag-html: HTML
30773077
tag-name: 名称
3078-
tag-gt-more-info: "> 更多信息"
3078+
tag-gt-more-info: '关于这个角色的更多信息'
30793079
url-cleaner:
30803080
title: URL清理器
30813081
description: |

src/tools/unicode-search/unicode-search.vue

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,21 @@ function toUTF8(codePoint: number) {
2121
2222
const searchQuery = useDebouncedRef('', 250);
2323
const parsedSearchQuery = computed(() => {
24+
const trimmedQuery = searchQuery.value.trim();
25+
26+
// Check if input is a single character (or a multi-byte Unicode character)
27+
if (trimmedQuery.length > 0) {
28+
const firstCodePoint = trimmedQuery.codePointAt(0);
29+
if (firstCodePoint != null) {
30+
// If it's a single character, convert to hex for exact search
31+
const charLength = firstCodePoint > 0xFFFF ? 2 : 1;
32+
if (trimmedQuery.length === charLength) {
33+
return `=${toPaddedHex(firstCodePoint)}`;
34+
}
35+
}
36+
}
37+
38+
// Check for various Unicode notation formats
2439
const parsedRegex = /^\s*(?:\&#x(?<hex1>[\da-f]+);|\&#(?<dec>\d+);|(?:U\+|\\u)?\s*(?<hex2>[\da-f]+))\s*$/gi; // NOSONAR
2540
const parsedQuery = parsedRegex.exec(searchQuery.value);
2641
if (parsedQuery) {
@@ -31,20 +46,20 @@ const parsedSearchQuery = computed(() => {
3146
return `=${toPaddedHex(Number.parseInt(parsedQuery.groups.dec, 10))}`;
3247
}
3348
}
49+
3450
return searchQuery.value;
3551
});
3652
3753
const unicodeSearchData = [...unicodeNames].map(([codePoint, characterName]) => {
3854
const hex = toPaddedHex(codePoint);
3955
return {
4056
codePoint,
41-
characterName: `${characterName} (U+${hex})`,
57+
characterName,
4258
hex,
4359
};
4460
});
4561
4662
const limit = ref(40);
47-
// Using FlexSearch instead of FuzzySearch for better performance
4863
const { searchResult } = useFlexSearch({
4964
search: parsedSearchQuery,
5065
data: unicodeSearchData,
@@ -119,7 +134,7 @@ const { searchResult } = useFlexSearch({
119134
<input-copyable :value="`\&\#x${toPaddedHex(result.codePoint)};`" :readonly="true" mb-1 />
120135
<input-copyable :value="`\&\#${result.codePoint};`" :readonly="true" />
121136
</td>
122-
<td><input-copyable :value="result.characterName" :readonly="true" /></td>
137+
<td><input-copyable :value="`${result.characterName} (U+${result.hex})`" :readonly="true" /></td>
123138
</tr>
124139
</tbody>
125140
</n-table>

0 commit comments

Comments
 (0)