termcast 1.3.18 → 1.3.21
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/dist/apis/environment.d.ts +7 -0
- package/dist/apis/environment.d.ts.map +1 -1
- package/dist/apis/environment.js +38 -0
- package/dist/apis/environment.js.map +1 -1
- package/dist/cli.js +82 -3
- package/dist/cli.js.map +1 -1
- package/dist/compile.d.ts.map +1 -1
- package/dist/compile.js +2 -1
- package/dist/compile.js.map +1 -1
- package/dist/components/actions.d.ts +5 -4
- package/dist/components/actions.d.ts.map +1 -1
- package/dist/components/actions.js.map +1 -1
- package/dist/components/list.d.ts.map +1 -1
- package/dist/components/list.js +11 -0
- package/dist/components/list.js.map +1 -1
- package/dist/examples/list-with-toast.d.ts +2 -0
- package/dist/examples/list-with-toast.d.ts.map +1 -0
- package/dist/examples/list-with-toast.js +24 -0
- package/dist/examples/list-with-toast.js.map +1 -0
- package/dist/extensions/dev.js +1 -1
- package/dist/extensions/dev.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/internal/dialog.d.ts.map +1 -1
- package/dist/internal/dialog.js +1 -1
- package/dist/internal/dialog.js.map +1 -1
- package/dist/internal/navigation.d.ts +2 -0
- package/dist/internal/navigation.d.ts.map +1 -1
- package/dist/internal/navigation.js +28 -1
- package/dist/internal/navigation.js.map +1 -1
- package/dist/keyboard.d.ts +38 -0
- package/dist/keyboard.d.ts.map +1 -0
- package/dist/keyboard.js +25 -0
- package/dist/keyboard.js.map +1 -0
- package/dist/release.d.ts.map +1 -1
- package/dist/release.js +5 -0
- package/dist/release.js.map +1 -1
- package/dist/utils/run-command.d.ts.map +1 -1
- package/dist/utils/run-command.js +9 -0
- package/dist/utils/run-command.js.map +1 -1
- package/package.json +3 -2
- package/src/apis/environment.tsx +60 -0
- package/src/cli.tsx +92 -4
- package/src/compile.tsx +2 -1
- package/src/components/actions.tsx +11 -6
- package/src/components/list.tsx +13 -0
- package/src/examples/list-with-toast.tsx +35 -0
- package/src/examples/list-with-toast.vitest.tsx +134 -0
- package/src/extensions/dev.tsx +1 -1
- package/src/index.tsx +12 -0
- package/src/internal/dialog.tsx +3 -1
- package/src/internal/navigation.tsx +33 -1
- package/src/keyboard.tsx +118 -0
- package/src/release.tsx +5 -0
- package/src/utils/run-command.tsx +10 -0
package/src/keyboard.tsx
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
export type KeyEquivalent =
|
|
2
|
+
| 'a'
|
|
3
|
+
| 'b'
|
|
4
|
+
| 'c'
|
|
5
|
+
| 'd'
|
|
6
|
+
| 'e'
|
|
7
|
+
| 'f'
|
|
8
|
+
| 'g'
|
|
9
|
+
| 'h'
|
|
10
|
+
| 'i'
|
|
11
|
+
| 'j'
|
|
12
|
+
| 'k'
|
|
13
|
+
| 'l'
|
|
14
|
+
| 'm'
|
|
15
|
+
| 'n'
|
|
16
|
+
| 'o'
|
|
17
|
+
| 'p'
|
|
18
|
+
| 'q'
|
|
19
|
+
| 'r'
|
|
20
|
+
| 's'
|
|
21
|
+
| 't'
|
|
22
|
+
| 'u'
|
|
23
|
+
| 'v'
|
|
24
|
+
| 'w'
|
|
25
|
+
| 'x'
|
|
26
|
+
| 'y'
|
|
27
|
+
| 'z'
|
|
28
|
+
| '0'
|
|
29
|
+
| '1'
|
|
30
|
+
| '2'
|
|
31
|
+
| '3'
|
|
32
|
+
| '4'
|
|
33
|
+
| '5'
|
|
34
|
+
| '6'
|
|
35
|
+
| '7'
|
|
36
|
+
| '8'
|
|
37
|
+
| '9'
|
|
38
|
+
| '.'
|
|
39
|
+
| ','
|
|
40
|
+
| ';'
|
|
41
|
+
| '='
|
|
42
|
+
| '+'
|
|
43
|
+
| '-'
|
|
44
|
+
| '['
|
|
45
|
+
| ']'
|
|
46
|
+
| '{'
|
|
47
|
+
| '}'
|
|
48
|
+
| '«'
|
|
49
|
+
| '»'
|
|
50
|
+
| '('
|
|
51
|
+
| ')'
|
|
52
|
+
| '/'
|
|
53
|
+
| '\\'
|
|
54
|
+
| "'"
|
|
55
|
+
| '`'
|
|
56
|
+
| '§'
|
|
57
|
+
| '^'
|
|
58
|
+
| '@'
|
|
59
|
+
| '$'
|
|
60
|
+
| 'return'
|
|
61
|
+
| 'delete'
|
|
62
|
+
| 'deleteForward'
|
|
63
|
+
| 'tab'
|
|
64
|
+
| 'arrowUp'
|
|
65
|
+
| 'arrowDown'
|
|
66
|
+
| 'arrowLeft'
|
|
67
|
+
| 'arrowRight'
|
|
68
|
+
| 'pageUp'
|
|
69
|
+
| 'pageDown'
|
|
70
|
+
| 'home'
|
|
71
|
+
| 'end'
|
|
72
|
+
| 'space'
|
|
73
|
+
| 'escape'
|
|
74
|
+
| 'enter'
|
|
75
|
+
| 'backspace'
|
|
76
|
+
|
|
77
|
+
export type KeyModifier = 'cmd' | 'ctrl' | 'opt' | 'shift' | 'alt' | 'windows'
|
|
78
|
+
|
|
79
|
+
export interface Shortcut {
|
|
80
|
+
key: KeyEquivalent
|
|
81
|
+
modifiers: KeyModifier[]
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface CrossPlatformShortcut {
|
|
85
|
+
macOS: Shortcut
|
|
86
|
+
Windows: Shortcut
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const CommonShortcuts = {
|
|
90
|
+
Copy: { modifiers: ['cmd', 'shift'], key: 'c' } as Shortcut,
|
|
91
|
+
CopyDeeplink: { modifiers: ['cmd', 'shift'], key: 'c' } as Shortcut,
|
|
92
|
+
CopyName: { modifiers: ['cmd', 'shift'], key: '.' } as Shortcut,
|
|
93
|
+
CopyPath: { modifiers: ['cmd', 'shift'], key: ',' } as Shortcut,
|
|
94
|
+
Save: { modifiers: ['cmd'], key: 's' } as Shortcut,
|
|
95
|
+
Duplicate: { modifiers: ['cmd'], key: 'd' } as Shortcut,
|
|
96
|
+
Edit: { modifiers: ['cmd'], key: 'e' } as Shortcut,
|
|
97
|
+
MoveDown: { modifiers: ['cmd', 'shift'], key: 'arrowDown' } as Shortcut,
|
|
98
|
+
MoveUp: { modifiers: ['cmd', 'shift'], key: 'arrowUp' } as Shortcut,
|
|
99
|
+
New: { modifiers: ['cmd'], key: 'n' } as Shortcut,
|
|
100
|
+
Open: { modifiers: ['cmd'], key: 'o' } as Shortcut,
|
|
101
|
+
OpenWith: { modifiers: ['cmd', 'shift'], key: 'o' } as Shortcut,
|
|
102
|
+
Pin: { modifiers: ['cmd', 'shift'], key: 'p' } as Shortcut,
|
|
103
|
+
Refresh: { modifiers: ['cmd'], key: 'r' } as Shortcut,
|
|
104
|
+
Remove: { modifiers: ['ctrl'], key: 'x' } as Shortcut,
|
|
105
|
+
RemoveAll: { modifiers: ['ctrl', 'shift'], key: 'x' } as Shortcut,
|
|
106
|
+
ToggleQuickLook: { modifiers: ['cmd'], key: 'y' } as Shortcut,
|
|
107
|
+
} as const
|
|
108
|
+
|
|
109
|
+
export const Keyboard = {
|
|
110
|
+
Shortcut: {
|
|
111
|
+
Common: CommonShortcuts,
|
|
112
|
+
},
|
|
113
|
+
} as const
|
|
114
|
+
|
|
115
|
+
export type { KeyEquivalent as KeyboardKeyEquivalent }
|
|
116
|
+
export type { KeyModifier as KeyboardKeyModifier }
|
|
117
|
+
export type { Shortcut as KeyboardShortcut }
|
|
118
|
+
export type { CrossPlatformShortcut as KeyboardCrossPlatformShortcut }
|
package/src/release.tsx
CHANGED
|
@@ -66,6 +66,11 @@ export async function releaseExtension({
|
|
|
66
66
|
if (error.message?.includes('already exists')) {
|
|
67
67
|
throw error
|
|
68
68
|
}
|
|
69
|
+
const stderr = error.stderr?.toString() || ''
|
|
70
|
+
const isNotFound = stderr.includes('release not found') || stderr.includes('Not Found')
|
|
71
|
+
if (!isNotFound) {
|
|
72
|
+
throw new Error(`Failed to check release status: ${stderr || error.message}`)
|
|
73
|
+
}
|
|
69
74
|
}
|
|
70
75
|
|
|
71
76
|
// Install dependencies for all platforms
|
|
@@ -122,6 +122,16 @@ export async function runCommand(options: RunCommandOptions): Promise<void> {
|
|
|
122
122
|
launchContext: undefined,
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
+
// Menu bar commands are not supported in termcast
|
|
126
|
+
if (command.mode === 'menu-bar') {
|
|
127
|
+
await showToast({
|
|
128
|
+
style: Toast.Style.Failure,
|
|
129
|
+
title: 'Unsupported command type',
|
|
130
|
+
message: 'Menu bar commands are not supported',
|
|
131
|
+
})
|
|
132
|
+
return
|
|
133
|
+
}
|
|
134
|
+
|
|
125
135
|
// Handle no-view commands (they export an async function, not a component)
|
|
126
136
|
if (command.mode === 'no-view') {
|
|
127
137
|
if (typeof CommandComponent === 'function') {
|