Release 2025-05-23-JSHi

This commit is contained in:
pluja
2025-05-23 12:25:07 +00:00
parent 8deb9acb93
commit ffe0653bb5

View File

@@ -30,14 +30,14 @@ export const {
{ {
type: 'email', type: 'email',
label: 'Email', label: 'Email',
matcher: /mailto:(.*)/, matcher: /mailto:(.+)/,
formatter: (value) => value, formatter: (value) => value,
icon: 'ri:mail-line', icon: 'ri:mail-line',
}, },
{ {
type: 'telephone', type: 'telephone',
label: 'Telephone', label: 'Telephone',
matcher: /tel:(.*)/, matcher: /tel:(.+)/,
formatter: (value) => { formatter: (value) => {
return parsePhoneNumberWithError(value).formatInternational() return parsePhoneNumberWithError(value).formatInternational()
}, },
@@ -46,7 +46,7 @@ export const {
{ {
type: 'whatsapp', type: 'whatsapp',
label: 'WhatsApp', label: 'WhatsApp',
matcher: /https?:\/\/(?:www\.)?wa\.me\/(.*)?/, matcher: /https?:\/\/(?:www\.)?wa\.me\/(.+)/,
formatter: (value) => { formatter: (value) => {
return parsePhoneNumberWithError(value).formatInternational() return parsePhoneNumberWithError(value).formatInternational()
}, },
@@ -55,42 +55,35 @@ export const {
{ {
type: 'telegram', type: 'telegram',
label: 'Telegram', label: 'Telegram',
matcher: /https?:\/\/(?:www\.)?t\.me\/(.*)?/, matcher: /https?:\/\/(?:www\.)?t\.me\/(.+)/,
formatter: (value) => `t.me/${value}`, formatter: (value) => `t.me/${value}`,
icon: 'ri:telegram-line', icon: 'ri:telegram-line',
}, },
{ {
type: 'linkedin', type: 'linkedin',
label: 'LinkedIn', label: 'LinkedIn',
matcher: /https?:\/\/(?:www\.)?linkedin\.com\/(?:in|company)\/(.*)?/, matcher: /https?:\/\/(?:www\.)?linkedin\.com\/(?:in|company)\/(.+)/,
formatter: (value) => `in/${value}`, formatter: (value) => `in/${value}`,
icon: 'ri:linkedin-box-line', icon: 'ri:linkedin-box-line',
}, },
{
type: 'website',
label: 'Website',
matcher: /https?:\/\/(?:www\.)?((?:[a-zA-Z0-9-]+\.)+[a-zA-Z]+)/,
formatter: (value) => value,
icon: 'ri:global-line',
},
{ {
type: 'x', type: 'x',
label: 'X', label: 'X',
matcher: /https?:\/\/(?:www\.)?x\.com\/(.*)?/, matcher: /https?:\/\/(?:www\.)?x\.com\/(.+)/,
formatter: (value) => `@${value}`, formatter: (value) => `@${value}`,
icon: 'ri:twitter-x-line', icon: 'ri:twitter-x-line',
}, },
{ {
type: 'instagram', type: 'instagram',
label: 'Instagram', label: 'Instagram',
matcher: /https?:\/\/(?:www\.)?instagram\.com\/(.*)?/, matcher: /https?:\/\/(?:www\.)?instagram\.com\/(.+)/,
formatter: (value) => `@${value}`, formatter: (value) => `@${value}`,
icon: 'ri:instagram-line', icon: 'ri:instagram-line',
}, },
{ {
type: 'matrix', type: 'matrix',
label: 'Matrix', label: 'Matrix',
matcher: /https?:\/\/(?:www\.)?matrix\.to\/#\/(.*)?/, matcher: /https?:\/\/(?:www\.)?matrix\.to\/#\/(.+)/,
formatter: (value) => value, formatter: (value) => value,
icon: 'ri:hashtag', icon: 'ri:hashtag',
}, },
@@ -101,6 +94,14 @@ export const {
formatter: () => 'BitcoinTalk', formatter: () => 'BitcoinTalk',
icon: 'ri:btc-line', icon: 'ri:btc-line',
}, },
// Website must go last because it's a catch-all
{
type: 'website',
label: 'Website',
matcher: /https?:\/\/(?:www\.)?((?:[a-zA-Z0-9-]+\.)+[a-zA-Z]+)/,
formatter: (value) => value,
icon: 'ri:global-line',
},
] as const satisfies ContactMethodInfo[] ] as const satisfies ContactMethodInfo[]
) )