Skip to content

Commit 03239c9

Browse files
zhensherlockcodex
andcommitted
feat(yoink-ios): add Yoink for iOS URL scheme support
Co-Authored-By: Codex <267193182+codex@users.noreply.github.com>
1 parent 92b94ed commit 03239c9

22 files changed

Lines changed: 625 additions & 0 deletions

.changeset/bright-yoinks-tap.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(yoink-ios): add Yoink for iOS URL scheme support

apps/docs/.vitepress/config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ export default defineConfig({
265265
'en/apps/xcode.md': 'apps/xcode.md',
266266
'en/apps/yandex-maps.md': 'apps/yandex-maps.md',
267267
'en/apps/yandex-navigator.md': 'apps/yandex-navigator.md',
268+
'en/apps/yoink-ios.md': 'apps/yoink-ios.md',
268269
'en/apps/zed.md': 'apps/zed.md',
269270
'en/apps/zoom.md': 'apps/zoom.md',
270271
},
@@ -556,6 +557,7 @@ export default defineConfig({
556557
{ text: 'Xcode', link: '/apps/xcode' },
557558
{ text: 'Yandex Maps', link: '/apps/yandex-maps' },
558559
{ text: 'Yandex Navigator', link: '/apps/yandex-navigator' },
560+
{ text: 'Yoink for iOS', link: '/apps/yoink-ios' },
559561
{ text: 'Zed', link: '/apps/zed' },
560562
{ text: 'Zoom', link: '/apps/zoom' },
561563
],
@@ -853,6 +855,7 @@ export default defineConfig({
853855
{ text: 'Xcode', link: '/apps/xcode' },
854856
{ text: 'Yandex Maps', link: '/apps/yandex-maps' },
855857
{ text: 'Yandex Navigator', link: '/apps/yandex-navigator' },
858+
{ text: 'Yoink for iOS', link: '/apps/yoink-ios' },
856859
{ text: 'Zed', link: '/apps/zed' },
857860
{ text: 'Zoom', link: '/apps/zoom' },
858861
],
@@ -1115,6 +1118,7 @@ export default defineConfig({
11151118
{ text: 'Xcode', link: '/zh/apps/xcode' },
11161119
{ text: 'Yandex Maps', link: '/zh/apps/yandex-maps' },
11171120
{ text: 'Yandex Navigator', link: '/zh/apps/yandex-navigator' },
1121+
{ text: 'Yoink for iOS', link: '/zh/apps/yoink-ios' },
11181122
{ text: 'Zed', link: '/zh/apps/zed' },
11191123
{ text: 'Zoom', link: '/zh/apps/zoom' },
11201124
],

apps/docs/.vitepress/constants/app-logos.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ export const appLogoFiles = {
245245
xcode: 'xcode.png',
246246
'yandex-maps': 'yandex-maps.webp',
247247
'yandex-navigator': 'yandex-navi-navigation-maps.webp',
248+
'yoink-ios': 'yoink.webp',
248249
zed: 'zed.png',
249250
zoom: 'zoom.webp',
250251
} as const
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
export const pasteFromClipboardParams = {
2+
title: 'My Title',
3+
createStack: 0,
4+
} as const
5+
6+
export const copyToClipboardParams = {
7+
index: 0,
8+
}
9+
10+
export const downloadUrlParams = {
11+
url: 'https://eternalstorms.at/yoink/Yoink.zip',
12+
}
13+
14+
export const addStringParams = {
15+
string: 'Yoink is available on\u0002iOS and macOS',
16+
title: 'Yoink Availability',
17+
}

apps/docs/en/apps/yoink-ios.md

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
---
2+
layout: doc
3+
---
4+
5+
<script setup lang="ts">
6+
import { ref, computed } from 'vue';
7+
import VPLink from 'vitepress/dist/client/theme-default/components/VPLink.vue';
8+
import {
9+
addString,
10+
copyToClipboard,
11+
downloadUrl,
12+
pasteFromClipboard,
13+
showDownloadUi,
14+
} from 'protocol-launcher/yoink-ios';
15+
import { SelectInstallationMethod } from '../../.vitepress/components';
16+
import {
17+
addStringParams,
18+
copyToClipboardParams,
19+
downloadUrlParams,
20+
pasteFromClipboardParams,
21+
} from '../../.vitepress/constants/yoink-ios';
22+
23+
const currentMethod = ref('On-Demand');
24+
const importPath = computed(() => currentMethod.value === 'On-Demand' ? 'protocol-launcher/yoink-ios' : 'protocol-launcher');
25+
</script>
26+
27+
# Yoink for iOS
28+
29+
[Yoink for iPad and iPhone](https://eternalstorms.at/yoink/ios/) is a shelf app for collecting files and snippets on iPad and iPhone. **Protocol Launcher** allows you to generate official Yoink for iOS URL scheme actions.
30+
31+
## Usage
32+
33+
There are two ways to use this library:
34+
35+
- On-Demand import from subpaths enables tree-shaking and keeps bundles small.
36+
- Full Import from the root package is convenient but includes all app modules.
37+
38+
Pick On-Demand for production builds; Full Import is fine for quick scripts or demos.
39+
40+
<SelectInstallationMethod v-model="currentMethod" />
41+
42+
## Notes
43+
44+
This module only wraps the URL scheme actions documented in Yoink for iPad and iPhone Usage Tips: `pastefromclipboard`, `copytoclipboard`, `showdownloadui`, `downloadurl`, and `addstring`.
45+
46+
The official page documents `x-success` and `x-error` callback parameters for the scheme. `showdownloadui` does not accept callbacks because Yoink states that this action does not call back to the calling app.
47+
48+
The official page shows its generic format as `yoink://[action]...`, while every concrete action example uses `yoinkios://...`; this module follows those concrete action examples.
49+
50+
## URL Methods
51+
52+
### Paste From Clipboard
53+
54+
Paste the current clipboard contents into Yoink.
55+
56+
```ts-vue [{{currentMethod}}]
57+
import { {{ currentMethod === 'On-Demand' ? 'pasteFromClipboard' : 'yoinkIos' }} } from '{{ importPath }}'
58+
59+
const url = {{currentMethod === 'On-Demand' ? '' : 'yoinkIos.'}}pasteFromClipboard({
60+
title: 'My Title',
61+
createStack: 0,
62+
})
63+
```
64+
65+
<div class="flex justify-center">
66+
<VPLink :href="pasteFromClipboard(pasteFromClipboardParams)" target="_self">
67+
Paste Clipboard Into Yoink
68+
</VPLink>
69+
</div>
70+
71+
### Copy To Clipboard
72+
73+
Copy an item from Yoink to the clipboard by index. In Yoink, `0` is the topmost item.
74+
75+
```ts-vue [{{currentMethod}}]
76+
import { {{ currentMethod === 'On-Demand' ? 'copyToClipboard' : 'yoinkIos' }} } from '{{ importPath }}'
77+
78+
const url = {{currentMethod === 'On-Demand' ? '' : 'yoinkIos.'}}copyToClipboard({
79+
index: 0,
80+
})
81+
```
82+
83+
<div class="flex justify-center">
84+
<VPLink :href="copyToClipboard(copyToClipboardParams)" target="_self">
85+
Copy First Yoink Item
86+
</VPLink>
87+
</div>
88+
89+
### Show Download UI
90+
91+
Show Yoink's download UI.
92+
93+
```ts-vue [{{currentMethod}}]
94+
import { {{ currentMethod === 'On-Demand' ? 'showDownloadUi' : 'yoinkIos' }} } from '{{ importPath }}'
95+
96+
const url = {{currentMethod === 'On-Demand' ? '' : 'yoinkIos.'}}showDownloadUi()
97+
```
98+
99+
<div class="flex justify-center">
100+
<VPLink :href="showDownloadUi()" target="_self">
101+
Show Yoink Download UI
102+
</VPLink>
103+
</div>
104+
105+
### Download URL
106+
107+
Download a URL in Yoink.
108+
109+
```ts-vue [{{currentMethod}}]
110+
import { {{ currentMethod === 'On-Demand' ? 'downloadUrl' : 'yoinkIos' }} } from '{{ importPath }}'
111+
112+
const url = {{currentMethod === 'On-Demand' ? '' : 'yoinkIos.'}}downloadUrl({
113+
url: 'https://eternalstorms.at/yoink/Yoink.zip',
114+
})
115+
```
116+
117+
<div class="flex justify-center">
118+
<VPLink :href="downloadUrl(downloadUrlParams)" target="_self">
119+
Download URL in Yoink
120+
</VPLink>
121+
</div>
122+
123+
### Add String
124+
125+
Save a string in Yoink.
126+
127+
```ts-vue [{{currentMethod}}]
128+
import { {{ currentMethod === 'On-Demand' ? 'addString' : 'yoinkIos' }} } from '{{ importPath }}'
129+
130+
const url = {{currentMethod === 'On-Demand' ? '' : 'yoinkIos.'}}addString({
131+
string: 'Yoink is available on\u0002iOS and macOS',
132+
title: 'Yoink Availability',
133+
})
134+
```
135+
136+
<div class="flex justify-center">
137+
<VPLink :href="addString(addStringParams)" target="_self">
138+
Add String to Yoink
139+
</VPLink>
140+
</div>
141+
142+
## Generated URLs
143+
144+
```ts
145+
pasteFromClipboard(pasteFromClipboardParams)
146+
// => 'yoinkios://pastefromclipboard?title=My%20Title&createStack=0'
147+
148+
copyToClipboard(copyToClipboardParams)
149+
// => 'yoinkios://copytoclipboard?index=0'
150+
151+
showDownloadUi()
152+
// => 'yoinkios://showdownloadui'
153+
154+
downloadUrl(downloadUrlParams)
155+
// => 'yoinkios://downloadurl?url=https%3A%2F%2Feternalstorms.at%2Fyoink%2FYoink.zip'
156+
157+
addString(addStringParams)
158+
// => 'yoinkios://addstring?string=Yoink%20is%20available%20on%02iOS%20and%20macOS&title=Yoink%20Availability'
159+
```
160+
161+
## Official Documentation
162+
163+
- [Yoink for iPad and iPhone Usage Tips](https://eternalstorms.at/yoink/ios/tips/)

apps/docs/en/guide/getting-started.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,5 +364,6 @@ For detailed usage instructions for each application, please refer to their resp
364364
- [Xcode](../apps/xcode.md)
365365
- [Yandex Maps](../apps/yandex-maps.md)
366366
- [Yandex Navigator](../apps/yandex-navigator.md)
367+
- [Yoink for iOS](../apps/yoink-ios.md)
367368
- [Zed](../apps/zed.md)
368369
- [Zoom](../apps/zoom.md)

apps/docs/en/guide/what-is-it.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ Currently, we support the following applications:
273273
- [Xcode](../apps/xcode.md)
274274
- [Yandex Maps](../apps/yandex-maps.md)
275275
- [Yandex Navigator](../apps/yandex-navigator.md)
276+
- [Yoink for iOS](../apps/yoink-ios.md)
276277
- [Zed](../apps/zed.md)
277278
- [Zoom](../apps/zoom.md)
278279

7.39 KB
Loading

0 commit comments

Comments
 (0)