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.
Files changed (57) hide show
  1. package/dist/apis/environment.d.ts +7 -0
  2. package/dist/apis/environment.d.ts.map +1 -1
  3. package/dist/apis/environment.js +38 -0
  4. package/dist/apis/environment.js.map +1 -1
  5. package/dist/cli.js +82 -3
  6. package/dist/cli.js.map +1 -1
  7. package/dist/compile.d.ts.map +1 -1
  8. package/dist/compile.js +2 -1
  9. package/dist/compile.js.map +1 -1
  10. package/dist/components/actions.d.ts +5 -4
  11. package/dist/components/actions.d.ts.map +1 -1
  12. package/dist/components/actions.js.map +1 -1
  13. package/dist/components/list.d.ts.map +1 -1
  14. package/dist/components/list.js +11 -0
  15. package/dist/components/list.js.map +1 -1
  16. package/dist/examples/list-with-toast.d.ts +2 -0
  17. package/dist/examples/list-with-toast.d.ts.map +1 -0
  18. package/dist/examples/list-with-toast.js +24 -0
  19. package/dist/examples/list-with-toast.js.map +1 -0
  20. package/dist/extensions/dev.js +1 -1
  21. package/dist/extensions/dev.js.map +1 -1
  22. package/dist/index.d.ts +4 -2
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js +4 -2
  25. package/dist/index.js.map +1 -1
  26. package/dist/internal/dialog.d.ts.map +1 -1
  27. package/dist/internal/dialog.js +1 -1
  28. package/dist/internal/dialog.js.map +1 -1
  29. package/dist/internal/navigation.d.ts +2 -0
  30. package/dist/internal/navigation.d.ts.map +1 -1
  31. package/dist/internal/navigation.js +28 -1
  32. package/dist/internal/navigation.js.map +1 -1
  33. package/dist/keyboard.d.ts +38 -0
  34. package/dist/keyboard.d.ts.map +1 -0
  35. package/dist/keyboard.js +25 -0
  36. package/dist/keyboard.js.map +1 -0
  37. package/dist/release.d.ts.map +1 -1
  38. package/dist/release.js +5 -0
  39. package/dist/release.js.map +1 -1
  40. package/dist/utils/run-command.d.ts.map +1 -1
  41. package/dist/utils/run-command.js +9 -0
  42. package/dist/utils/run-command.js.map +1 -1
  43. package/package.json +3 -2
  44. package/src/apis/environment.tsx +60 -0
  45. package/src/cli.tsx +92 -4
  46. package/src/compile.tsx +2 -1
  47. package/src/components/actions.tsx +11 -6
  48. package/src/components/list.tsx +13 -0
  49. package/src/examples/list-with-toast.tsx +35 -0
  50. package/src/examples/list-with-toast.vitest.tsx +134 -0
  51. package/src/extensions/dev.tsx +1 -1
  52. package/src/index.tsx +12 -0
  53. package/src/internal/dialog.tsx +3 -1
  54. package/src/internal/navigation.tsx +33 -1
  55. package/src/keyboard.tsx +118 -0
  56. package/src/release.tsx +5 -0
  57. package/src/utils/run-command.tsx +10 -0
@@ -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') {