Skip to content

Commit 6121c83

Browse files
committed
feat(macos): add support for launching Apple Password, Font Book, and iWork apps
1 parent 9794291 commit 6121c83

12 files changed

Lines changed: 276 additions & 6 deletions

File tree

.changeset/moody-cooks-knock.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'protocol-launcher': minor
3+
---
4+
5+
feat(macos): add support for launching Apple Password, Font Book, and iWork apps

apps/docs/.vitepress/constants/macos.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,13 @@ export const printerParams = {}
9393
export const printerWithHostParams = {
9494
host: '192.168.1.100',
9595
}
96+
97+
export const appleOtpauthParams = {}
98+
99+
export const fontbookParams = {}
100+
101+
export const keynoteParams = {}
102+
103+
export const numbersParams = {}
104+
105+
export const pagesParams = {}

apps/docs/en/apps/macos.md

Lines changed: 86 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ layout: doc
55
<script setup lang="ts">
66
import { ref, computed } from 'vue';
77
import VPLink from 'vitepress/dist/client/theme-default/components/VPLink.vue';
8-
import { addressbook, airport, books, calendar, dictionary, facetime, feedback, findMy, freeform, helpViewer, mail, music, notes, photos, podcasts, printer, reminders, sms, stocks, systemPreferences, videos, wallet, weather } from 'protocol-launcher/macos';
8+
import { addressbook, airport, appleOtpauth, books, calendar, dictionary, facetime, feedback, findMy, fontbook, freeform, helpViewer, keynote, mail, music, notes, numbers, pages, photos, podcasts, printer, reminders, sms, stocks, systemPreferences, videos, wallet, weather } from 'protocol-launcher/macos';
99
import { SelectInstallationMethod } from '../../.vitepress/components';
1010
import { useAppStore } from '../../.vitepress/stores/app';
1111
import {
1212
addressBookParams,
1313
airportParams,
14+
appleOtpauthParams,
1415
booksParams,
1516
calendarParams,
1617
calendarWithLinkParams,
@@ -23,12 +24,16 @@ import {
2324
findMyDevicesParams,
2425
findMyItemsParams,
2526
findMyFriendsParams,
27+
fontbookParams,
2628
freeformParams,
2729
helpViewerParams,
2830
helpViewerWithCollectionParams,
31+
keynoteParams,
2932
mailParams,
3033
musicParams,
3134
notesParams,
35+
numbersParams,
36+
pagesParams,
3237
photosParams,
3338
podcastsParams,
3439
printerParams,
@@ -540,3 +545,83 @@ const url = {{currentMethod === 'On-Demand' ? '' : 'macos.'}}printer({
540545
Add Printer with Host
541546
</VPLink>
542547
</div>
548+
549+
### Open Apple Password (OTP Auth)
550+
551+
Open the Apple Password (OTP Auth) app.
552+
553+
```ts-vue [{{currentMethod}}]
554+
import { {{ currentMethod === 'On-Demand' ? 'appleOtpauth' : 'macos' }} } from '{{ importPath }}'
555+
556+
const url = {{currentMethod === 'On-Demand' ? '' : 'macos.'}}appleOtpauth()
557+
```
558+
559+
<div class="flex justify-center">
560+
<VPLink :href="appleOtpauth(appleOtpauthParams)" target="_self">
561+
Open Apple Password
562+
</VPLink>
563+
</div>
564+
565+
### Open Font Book
566+
567+
Open the Font Book app.
568+
569+
```ts-vue [{{currentMethod}}]
570+
import { {{ currentMethod === 'On-Demand' ? 'fontbook' : 'macos' }} } from '{{ importPath }}'
571+
572+
const url = {{currentMethod === 'On-Demand' ? '' : 'macos.'}}fontbook()
573+
```
574+
575+
<div class="flex justify-center">
576+
<VPLink :href="fontbook(fontbookParams)" target="_self">
577+
Open Font Book
578+
</VPLink>
579+
</div>
580+
581+
### Open Keynote
582+
583+
Open the Keynote app.
584+
585+
```ts-vue [{{currentMethod}}]
586+
import { {{ currentMethod === 'On-Demand' ? 'keynote' : 'macos' }} } from '{{ importPath }}'
587+
588+
const url = {{currentMethod === 'On-Demand' ? '' : 'macos.'}}keynote()
589+
```
590+
591+
<div class="flex justify-center">
592+
<VPLink :href="keynote(keynoteParams)" target="_self">
593+
Open Keynote
594+
</VPLink>
595+
</div>
596+
597+
### Open Numbers
598+
599+
Open the Numbers app.
600+
601+
```ts-vue [{{currentMethod}}]
602+
import { {{ currentMethod === 'On-Demand' ? 'numbers' : 'macos' }} } from '{{ importPath }}'
603+
604+
const url = {{currentMethod === 'On-Demand' ? '' : 'macos.'}}numbers()
605+
```
606+
607+
<div class="flex justify-center">
608+
<VPLink :href="numbers(numbersParams)" target="_self">
609+
Open Numbers
610+
</VPLink>
611+
</div>
612+
613+
### Open Pages
614+
615+
Open the Pages app.
616+
617+
```ts-vue [{{currentMethod}}]
618+
import { {{ currentMethod === 'On-Demand' ? 'pages' : 'macos' }} } from '{{ importPath }}'
619+
620+
const url = {{currentMethod === 'On-Demand' ? '' : 'macos.'}}pages()
621+
```
622+
623+
<div class="flex justify-center">
624+
<VPLink :href="pages(pagesParams)" target="_self">
625+
Open Pages
626+
</VPLink>
627+
</div>

apps/docs/zh/apps/macos.md

Lines changed: 86 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ layout: doc
55
<script setup lang="ts">
66
import { ref, computed } from 'vue';
77
import VPLink from 'vitepress/dist/client/theme-default/components/VPLink.vue';
8-
import { addressbook, airport, books, calendar, dictionary, facetime, feedback, findMy, freeform, helpViewer, mail, music, notes, photos, podcasts, printer, reminders, sms, stocks, systemPreferences, videos, wallet, weather } from 'protocol-launcher/macos';
8+
import { addressbook, airport, appleOtpauth, books, calendar, dictionary, facetime, feedback, findMy, fontbook, freeform, helpViewer, keynote, mail, music, notes, numbers, pages, photos, podcasts, printer, reminders, sms, stocks, systemPreferences, videos, wallet, weather } from 'protocol-launcher/macos';
99
import { SelectInstallationMethod } from '../../.vitepress/components';
1010
import { useAppStore } from '../../.vitepress/stores/app';
1111
import {
1212
addressBookParams,
1313
airportParams,
14+
appleOtpauthParams,
1415
booksParams,
1516
calendarParams,
1617
calendarWithLinkParams,
@@ -23,12 +24,16 @@ import {
2324
findMyDevicesParams,
2425
findMyItemsParams,
2526
findMyFriendsParams,
27+
fontbookParams,
2628
freeformParams,
2729
helpViewerParams,
2830
helpViewerWithCollectionParams,
31+
keynoteParams,
2932
mailParams,
3033
musicParams,
3134
notesParams,
35+
numbersParams,
36+
pagesParams,
3237
photosParams,
3338
podcastsParams,
3439
printerParams,
@@ -540,3 +545,83 @@ const url = {{currentMethod === 'On-Demand' ? '' : 'macos.'}}printer({
540545
添加带主机的打印机
541546
</VPLink>
542547
</div>
548+
549+
### 打开 Apple 密码 (OTP Auth)
550+
551+
打开 Apple 密码 (OTP Auth) 应用。
552+
553+
```ts-vue [{{currentMethod}}]
554+
import { {{ currentMethod === 'On-Demand' ? 'appleOtpauth' : 'macos' }} } from '{{ importPath }}'
555+
556+
const url = {{currentMethod === 'On-Demand' ? '' : 'macos.'}}appleOtpauth()
557+
```
558+
559+
<div class="flex justify-center">
560+
<VPLink :href="appleOtpauth(appleOtpauthParams)" target="_self">
561+
打开 Apple 密码
562+
</VPLink>
563+
</div>
564+
565+
### 打开字体册
566+
567+
打开字体册应用。
568+
569+
```ts-vue [{{currentMethod}}]
570+
import { {{ currentMethod === 'On-Demand' ? 'fontbook' : 'macos' }} } from '{{ importPath }}'
571+
572+
const url = {{currentMethod === 'On-Demand' ? '' : 'macos.'}}fontbook()
573+
```
574+
575+
<div class="flex justify-center">
576+
<VPLink :href="fontbook(fontbookParams)" target="_self">
577+
打开字体册
578+
</VPLink>
579+
</div>
580+
581+
### 打开 Keynote
582+
583+
打开 Keynote 应用。
584+
585+
```ts-vue [{{currentMethod}}]
586+
import { {{ currentMethod === 'On-Demand' ? 'keynote' : 'macos' }} } from '{{ importPath }}'
587+
588+
const url = {{currentMethod === 'On-Demand' ? '' : 'macos.'}}keynote()
589+
```
590+
591+
<div class="flex justify-center">
592+
<VPLink :href="keynote(keynoteParams)" target="_self">
593+
打开 Keynote
594+
</VPLink>
595+
</div>
596+
597+
### 打开 Numbers
598+
599+
打开 Numbers 应用。
600+
601+
```ts-vue [{{currentMethod}}]
602+
import { {{ currentMethod === 'On-Demand' ? 'numbers' : 'macos' }} } from '{{ importPath }}'
603+
604+
const url = {{currentMethod === 'On-Demand' ? '' : 'macos.'}}numbers()
605+
```
606+
607+
<div class="flex justify-center">
608+
<VPLink :href="numbers(numbersParams)" target="_self">
609+
打开 Numbers
610+
</VPLink>
611+
</div>
612+
613+
### 打开 Pages
614+
615+
打开 Pages 应用。
616+
617+
```ts-vue [{{currentMethod}}]
618+
import { {{ currentMethod === 'On-Demand' ? 'pages' : 'macos' }} } from '{{ importPath }}'
619+
620+
const url = {{currentMethod === 'On-Demand' ? '' : 'macos.'}}pages()
621+
```
622+
623+
<div class="flex justify-center">
624+
<VPLink :href="pages(pagesParams)" target="_self">
625+
打开 Pages
626+
</VPLink>
627+
</div>

packages/protocol-launcher/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,14 +174,14 @@
174174
"types": "./dist/types/macvim/index.d.ts",
175175
"import": "./dist/macvim/index.js"
176176
},
177-
"./motrix": {
178-
"types": "./dist/types/motrix/index.d.ts",
179-
"import": "./dist/motrix/index.js"
180-
},
181177
"./microsoft-edge": {
182178
"types": "./dist/types/microsoft-edge/index.d.ts",
183179
"import": "./dist/microsoft-edge/index.js"
184180
},
181+
"./motrix": {
182+
"types": "./dist/types/motrix/index.d.ts",
183+
"import": "./dist/motrix/index.js"
184+
},
185185
"./navicat": {
186186
"types": "./dist/types/navicat/index.d.ts",
187187
"import": "./dist/navicat/index.js"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* Open Apple Password (OTP Auth) app.
3+
*
4+
* @returns Apple Password open URL.
5+
* @example
6+
* appleOtpauth()
7+
* // => 'apple-otpauth://'
8+
*/
9+
export function appleOtpauth() {
10+
return 'apple-otpauth://'
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* Open Font Book app.
3+
*
4+
* @returns Font Book open URL.
5+
* @example
6+
* fontbook()
7+
* // => 'fontbook://'
8+
*/
9+
export function fontbook() {
10+
return 'fontbook://'
11+
}

packages/protocol-launcher/src/macos/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
export { addressbook } from './addressbook'
22
export { airport } from './airport'
3+
export { appleOtpauth } from './appleOtpauth'
34
export { books } from './books'
45
export { calendar } from './calendar'
56
export { dictionary } from './dictionary'
67
export { facetime } from './facetime'
78
export { feedback } from './feedback'
89
export { findMy } from './findMy'
10+
export { fontbook } from './fontbook'
911
export { freeform } from './freeform'
1012
export { helpViewer } from './helpviewer'
13+
export { keynote } from './keynote'
1114
export { mail } from './mail'
1215
export { music } from './music'
1316
export { notes } from './notes'
17+
export { numbers } from './numbers'
18+
export { pages } from './pages'
1419
export { photos } from './photos'
1520
export { podcasts } from './podcasts'
1621
export { printer } from './printer'
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* Open Keynote app.
3+
*
4+
* @returns Keynote open URL.
5+
* @example
6+
* keynote()
7+
* // => 'com.apple.iwork.keynote-share://'
8+
*/
9+
export function keynote() {
10+
return 'com.apple.iwork.keynote-share://'
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* Open Numbers app.
3+
*
4+
* @returns Numbers open URL.
5+
* @example
6+
* numbers()
7+
* // => 'com.apple.iwork.numbers-share://'
8+
*/
9+
export function numbers() {
10+
return 'com.apple.iwork.numbers-share://'
11+
}

0 commit comments

Comments
 (0)