termcast 1.3.9 → 1.3.10
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/action-utils.js +1 -1
- package/dist/action-utils.js.map +1 -1
- package/dist/apis/ai.js +1 -1
- package/dist/apis/ai.js.map +1 -1
- package/dist/apis/clipboard.js +2 -2
- package/dist/apis/clipboard.js.map +1 -1
- package/dist/apis/hud.d.ts +2 -2
- package/dist/apis/hud.d.ts.map +1 -1
- package/dist/apis/hud.js +5 -5
- package/dist/apis/hud.js.map +1 -1
- package/dist/apis/oauth.d.ts +1 -1
- package/dist/apis/oauth.d.ts.map +1 -1
- package/dist/apis/oauth.js +8 -8
- package/dist/apis/oauth.js.map +1 -1
- package/dist/apis/preferences.js +4 -4
- package/dist/apis/preferences.js.map +1 -1
- package/dist/apis/toast.js +3 -3
- package/dist/apis/toast.js.map +1 -1
- package/dist/build.js +6 -6
- package/dist/build.js.map +1 -1
- package/dist/cli.js +2 -2
- package/dist/cli.js.map +1 -1
- package/dist/components/actions.d.ts +1 -1
- package/dist/components/actions.d.ts.map +1 -1
- package/dist/components/actions.js +7 -7
- package/dist/components/actions.js.map +1 -1
- package/dist/components/alert.js +4 -4
- package/dist/components/alert.js.map +1 -1
- package/dist/components/detail.d.ts +2 -2
- package/dist/components/detail.d.ts.map +1 -1
- package/dist/components/detail.js +5 -5
- package/dist/components/detail.js.map +1 -1
- package/dist/components/dropdown.d.ts +1 -1
- package/dist/components/dropdown.d.ts.map +1 -1
- package/dist/components/dropdown.js +4 -4
- package/dist/components/dropdown.js.map +1 -1
- package/dist/components/extension-preferences.js +5 -5
- package/dist/components/extension-preferences.js.map +1 -1
- package/dist/components/form/checkbox.js +2 -2
- package/dist/components/form/checkbox.js.map +1 -1
- package/dist/components/form/date-picker.js +3 -3
- package/dist/components/form/date-picker.js.map +1 -1
- package/dist/components/form/description.js +1 -1
- package/dist/components/form/description.js.map +1 -1
- package/dist/components/form/dropdown.js +4 -4
- package/dist/components/form/dropdown.js.map +1 -1
- package/dist/components/form/file-autocomplete.js +2 -2
- package/dist/components/form/file-autocomplete.js.map +1 -1
- package/dist/components/form/file-picker.js +2 -2
- package/dist/components/form/file-picker.js.map +1 -1
- package/dist/components/form/form-end.js +1 -1
- package/dist/components/form/form-end.js.map +1 -1
- package/dist/components/form/index.js +5 -5
- package/dist/components/form/index.js.map +1 -1
- package/dist/components/form/password-field.js +1 -1
- package/dist/components/form/password-field.js.map +1 -1
- package/dist/components/form/separator.js +1 -1
- package/dist/components/form/separator.js.map +1 -1
- package/dist/components/form/tagpicker.d.ts +1 -1
- package/dist/components/form/tagpicker.d.ts.map +1 -1
- package/dist/components/form/text-area.js +1 -1
- package/dist/components/form/text-area.js.map +1 -1
- package/dist/components/form/text-field.js +1 -1
- package/dist/components/form/text-field.js.map +1 -1
- package/dist/components/form/with-left-border.js +1 -1
- package/dist/components/form/with-left-border.js.map +1 -1
- package/dist/components/image.js +1 -1
- package/dist/components/image.js.map +1 -1
- package/dist/components/list.d.ts +1 -1
- package/dist/components/list.d.ts.map +1 -1
- package/dist/components/list.js +7 -7
- package/dist/components/list.js.map +1 -1
- package/dist/components/loading-bar.js +1 -1
- package/dist/components/loading-bar.js.map +1 -1
- package/dist/components/menubar-extra.d.ts +1 -1
- package/dist/components/menubar-extra.d.ts.map +1 -1
- package/dist/components/menubar-extra.js +2 -2
- package/dist/components/menubar-extra.js.map +1 -1
- package/dist/e2e-node.d.ts +2 -0
- package/dist/e2e-node.d.ts.map +1 -1
- package/dist/e2e-node.js +14 -0
- package/dist/e2e-node.js.map +1 -1
- package/dist/examples/action-show-in-finder.js +2 -2
- package/dist/examples/action-show-in-finder.js.map +1 -1
- package/dist/examples/environment-test.js +3 -3
- package/dist/examples/environment-test.js.map +1 -1
- package/dist/examples/error-boundary.js +4 -4
- package/dist/examples/error-boundary.js.map +1 -1
- package/dist/examples/form-basic.js +4 -4
- package/dist/examples/form-basic.js.map +1 -1
- package/dist/examples/form-basic.vitest.js +103 -103
- package/dist/examples/form-basic.vitest.js.map +1 -1
- package/dist/examples/form-dropdown.js +2 -2
- package/dist/examples/form-dropdown.js.map +1 -1
- package/dist/examples/form-dropdown.vitest.js +1 -1
- package/dist/examples/form-dropdown.vitest.js.map +1 -1
- package/dist/examples/form-tagpicker.js +2 -2
- package/dist/examples/form-tagpicker.js.map +1 -1
- package/dist/examples/form-tagpicker.vitest.js +1 -1
- package/dist/examples/form-tagpicker.vitest.js.map +1 -1
- package/dist/examples/internal/descendants-filtering.js +2 -2
- package/dist/examples/internal/descendants-filtering.js.map +1 -1
- package/dist/examples/internal/descendants.js +3 -3
- package/dist/examples/internal/descendants.js.map +1 -1
- package/dist/examples/internal/scrollbox-demo.js +1 -1
- package/dist/examples/internal/scrollbox-demo.js.map +1 -1
- package/dist/examples/internal/simple-dialog.js +6 -6
- package/dist/examples/internal/simple-dialog.js.map +1 -1
- package/dist/examples/internal/simple-scrollbox.d.ts +2 -0
- package/dist/examples/internal/simple-scrollbox.d.ts.map +1 -0
- package/dist/examples/internal/simple-scrollbox.js +26 -0
- package/dist/examples/internal/simple-scrollbox.js.map +1 -0
- package/dist/examples/internal/simple-scrollbox.vitest.d.ts +2 -0
- package/dist/examples/internal/simple-scrollbox.vitest.d.ts.map +1 -0
- package/dist/examples/internal/simple-scrollbox.vitest.js +88 -0
- package/dist/examples/internal/simple-scrollbox.vitest.js.map +1 -0
- package/dist/examples/list-dropdown-default.js +2 -2
- package/dist/examples/list-dropdown-default.js.map +1 -1
- package/dist/examples/list-dropdown-default.vitest.js +1 -1
- package/dist/examples/list-dropdown-default.vitest.js.map +1 -1
- package/dist/examples/list-fetch-data.js +2 -2
- package/dist/examples/list-fetch-data.js.map +1 -1
- package/dist/examples/list-fetch-data.vitest.js +1 -1
- package/dist/examples/list-fetch-data.vitest.js.map +1 -1
- package/dist/examples/list-with-detail.js +1 -1
- package/dist/examples/list-with-detail.js.map +1 -1
- package/dist/examples/list-with-detail.vitest.js +1 -1
- package/dist/examples/list-with-detail.vitest.js.map +1 -1
- package/dist/examples/list-with-dropdown.js +1 -1
- package/dist/examples/list-with-dropdown.js.map +1 -1
- package/dist/examples/list-with-dropdown.vitest.js +1 -1
- package/dist/examples/list-with-dropdown.vitest.js.map +1 -1
- package/dist/examples/list-with-sections.js +3 -3
- package/dist/examples/list-with-sections.js.map +1 -1
- package/dist/examples/list-with-sections.vitest.js +1 -1
- package/dist/examples/list-with-sections.vitest.js.map +1 -1
- package/dist/examples/miscellaneous.js +13 -13
- package/dist/examples/miscellaneous.js.map +1 -1
- package/dist/examples/nested-navigation.js +5 -5
- package/dist/examples/nested-navigation.js.map +1 -1
- package/dist/examples/preferences-test.js +3 -3
- package/dist/examples/preferences-test.js.map +1 -1
- package/dist/examples/simple-dropdown.js +3 -3
- package/dist/examples/simple-dropdown.js.map +1 -1
- package/dist/examples/simple-file-picker.js +2 -2
- package/dist/examples/simple-file-picker.js.map +1 -1
- package/dist/examples/simple-file-picker.vitest.js +26 -26
- package/dist/examples/simple-file-picker.vitest.js.map +1 -1
- package/dist/examples/simple-grid.js +1 -1
- package/dist/examples/simple-grid.js.map +1 -1
- package/dist/examples/simple-grid.vitest.js +1 -1
- package/dist/examples/simple-grid.vitest.js.map +1 -1
- package/dist/examples/simple-hud.js +3 -3
- package/dist/examples/simple-hud.js.map +1 -1
- package/dist/examples/simple-list-search.js +20 -4
- package/dist/examples/simple-list-search.js.map +1 -1
- package/dist/examples/simple-list.js +3 -3
- package/dist/examples/simple-list.js.map +1 -1
- package/dist/examples/simple-navigation.js +5 -5
- package/dist/examples/simple-navigation.js.map +1 -1
- package/dist/examples/simple-navigation.vitest.js +1 -1
- package/dist/examples/simple-navigation.vitest.js.map +1 -1
- package/dist/examples/store.vitest.js +1 -5
- package/dist/examples/store.vitest.js.map +1 -1
- package/dist/examples/tanstack-demo.js +2 -2
- package/dist/examples/tanstack-demo.js.map +1 -1
- package/dist/examples/use-promise-demo.js +2 -2
- package/dist/examples/use-promise-demo.js.map +1 -1
- package/dist/extensions/dev.js +7 -7
- package/dist/extensions/dev.js.map +1 -1
- package/dist/extensions/home.js +8 -8
- package/dist/extensions/home.js.map +1 -1
- package/dist/extensions/store.js +2 -2
- package/dist/extensions/store.js.map +1 -1
- package/dist/globals.js +1 -1
- package/dist/globals.js.map +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/use-action-panel.js +1 -1
- package/dist/hooks/use-action-panel.js.map +1 -1
- package/dist/hooks/use-unstable-ai.js +1 -1
- package/dist/hooks/use-unstable-ai.js.map +1 -1
- package/dist/index.d.ts +55 -55
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +38 -38
- package/dist/index.js.map +1 -1
- package/dist/internal/dialog.d.ts +3 -3
- package/dist/internal/dialog.d.ts.map +1 -1
- package/dist/internal/dialog.js +3 -3
- package/dist/internal/dialog.js.map +1 -1
- package/dist/internal/error-handler.js +2 -2
- package/dist/internal/error-handler.js.map +1 -1
- package/dist/internal/focus-context.d.ts +1 -1
- package/dist/internal/focus-context.d.ts.map +1 -1
- package/dist/internal/navigation.d.ts +1 -1
- package/dist/internal/navigation.d.ts.map +1 -1
- package/dist/internal/navigation.js +2 -2
- package/dist/internal/navigation.js.map +1 -1
- package/dist/internal/providers.d.ts +2 -2
- package/dist/internal/providers.d.ts.map +1 -1
- package/dist/internal/providers.js +9 -9
- package/dist/internal/providers.js.map +1 -1
- package/dist/internal/scrollbox.d.ts +11 -0
- package/dist/internal/scrollbox.d.ts.map +1 -0
- package/dist/internal/scrollbox.js +28 -0
- package/dist/internal/scrollbox.js.map +1 -0
- package/dist/preload.js +1 -1
- package/dist/preload.js.map +1 -1
- package/dist/utils.js +2 -2
- package/dist/utils.js.map +1 -1
- package/package.json +4 -2
- package/src/e2e-node.tsx +16 -0
- package/src/examples/form-basic.vitest.tsx +102 -102
- package/src/examples/internal/simple-scrollbox.tsx +55 -0
- package/src/examples/internal/simple-scrollbox.vitest.tsx +94 -0
- package/src/examples/nested-navigation.tsx +3 -3
- package/src/examples/simple-file-picker.vitest.tsx +25 -25
- package/src/examples/simple-list-search.tsx +41 -0
- package/src/examples/simple-navigation.tsx +3 -3
- package/src/examples/store.vitest.tsx +0 -4
- package/src/extensions/dev.tsx +2 -2
- package/src/extensions/home.tsx +3 -3
- package/src/index.tsx +6 -25
- package/src/internal/providers.tsx +1 -1
- package/src/internal/scrollbox.tsx +53 -0
- package/src/utils.tsx +2 -2
|
@@ -48,10 +48,6 @@ test('Store extension - searching for spiceblow shows Database', async () => {
|
|
|
48
48
|
spiceblow
|
|
49
49
|
|
|
50
50
|
›Spiceblow - Sql Database Management Search, update, insert and delete rows in
|
|
51
|
-
Spike Resolve incidents, check who is on-call, and add overrides from Raycast
|
|
52
|
-
Image Modification Apply filters and transformations to various image formats
|
|
53
|
-
Next Run Spin up a Next.js project from Raycast
|
|
54
|
-
Donut Show an animation of a donut
|
|
55
51
|
|
|
56
52
|
|
|
57
53
|
↵ select ↑↓ navigate ^k actions"
|
package/src/extensions/dev.tsx
CHANGED
|
@@ -5,7 +5,7 @@ import { render } from '@opentui/react'
|
|
|
5
5
|
import { List, useStore } from 'termcast'
|
|
6
6
|
import { Action, ActionPanel } from 'termcast'
|
|
7
7
|
import { useNavigation } from 'termcast/src/internal/navigation'
|
|
8
|
-
import {
|
|
8
|
+
import { TermcastProvider } from 'termcast/src/internal/providers'
|
|
9
9
|
import { showToast, Toast } from 'termcast/src/apis/toast'
|
|
10
10
|
import { Icon } from 'termcast'
|
|
11
11
|
import { getCommandsWithFiles, CommandWithFile } from '../package-json'
|
|
@@ -170,7 +170,7 @@ export async function startDevMode({
|
|
|
170
170
|
const devElement = useStore((state) => state.devElement)
|
|
171
171
|
const devRebuildCount = useStore((state) => state.devRebuildCount)
|
|
172
172
|
|
|
173
|
-
return <
|
|
173
|
+
return <TermcastProvider key={String(devRebuildCount)}>{devElement}</TermcastProvider>
|
|
174
174
|
}
|
|
175
175
|
|
|
176
176
|
await render(<App />)
|
package/src/extensions/home.tsx
CHANGED
|
@@ -4,7 +4,7 @@ import { render } from '@opentui/react'
|
|
|
4
4
|
import { List, logger, useStore } from 'termcast'
|
|
5
5
|
import { Action, ActionPanel } from 'termcast'
|
|
6
6
|
import { useNavigation } from 'termcast/src/internal/navigation'
|
|
7
|
-
import {
|
|
7
|
+
import { TermcastProvider } from 'termcast/src/internal/providers'
|
|
8
8
|
import { showToast, Toast } from 'termcast/src/apis/toast'
|
|
9
9
|
import { Icon } from 'termcast'
|
|
10
10
|
import { getStoredExtensions } from '../utils'
|
|
@@ -285,9 +285,9 @@ export async function runHomeCommand(): Promise<void> {
|
|
|
285
285
|
logger.log(`preparing to render the home command component`)
|
|
286
286
|
|
|
287
287
|
await render(
|
|
288
|
-
<
|
|
288
|
+
<TermcastProvider>
|
|
289
289
|
<Home />
|
|
290
|
-
</
|
|
290
|
+
</TermcastProvider>,
|
|
291
291
|
)
|
|
292
292
|
logger.log(`rendered home command component`)
|
|
293
293
|
}
|
package/src/index.tsx
CHANGED
|
@@ -95,11 +95,7 @@ export type {
|
|
|
95
95
|
} from 'termcast/src/components/form/types'
|
|
96
96
|
|
|
97
97
|
// Icons and Images
|
|
98
|
-
export {
|
|
99
|
-
Icon,
|
|
100
|
-
getIconEmoji,
|
|
101
|
-
IconComponent,
|
|
102
|
-
} from 'termcast/src/components/icon'
|
|
98
|
+
export { Icon, getIconEmoji, IconComponent } from 'termcast/src/components/icon'
|
|
103
99
|
export { Image, ImageMask } from 'termcast/src/components/image'
|
|
104
100
|
export type {
|
|
105
101
|
ImageProps,
|
|
@@ -138,29 +134,17 @@ export {
|
|
|
138
134
|
} from 'termcast/src/internal/navigation'
|
|
139
135
|
|
|
140
136
|
// Hooks
|
|
141
|
-
export {
|
|
142
|
-
useActionPanel,
|
|
143
|
-
useId,
|
|
144
|
-
useUnstableAI,
|
|
145
|
-
} from 'termcast/src/hooks/index'
|
|
137
|
+
export { useActionPanel, useId, useUnstableAI } from 'termcast/src/hooks/index'
|
|
146
138
|
export type { ActionPanelState } from 'termcast/src/hooks/index'
|
|
147
139
|
|
|
148
140
|
// Focus Context
|
|
149
141
|
export { InFocus, useIsInFocus } from 'termcast/src/internal/focus-context'
|
|
150
142
|
|
|
151
143
|
// Dialog
|
|
152
|
-
export {
|
|
153
|
-
Dialog,
|
|
154
|
-
DialogProvider,
|
|
155
|
-
useDialog,
|
|
156
|
-
} from 'termcast/src/internal/dialog'
|
|
144
|
+
export { Dialog, DialogProvider, useDialog } from 'termcast/src/internal/dialog'
|
|
157
145
|
|
|
158
146
|
// Toast
|
|
159
|
-
export {
|
|
160
|
-
Toast,
|
|
161
|
-
showToast,
|
|
162
|
-
showFailureToast,
|
|
163
|
-
} from 'termcast/src/apis/toast'
|
|
147
|
+
export { Toast, showToast, showFailureToast } from 'termcast/src/apis/toast'
|
|
164
148
|
|
|
165
149
|
// Clipboard
|
|
166
150
|
export {
|
|
@@ -199,10 +183,7 @@ export {
|
|
|
199
183
|
getSelectedFinderItems,
|
|
200
184
|
getSelectedText,
|
|
201
185
|
} from 'termcast/src/apis/environment'
|
|
202
|
-
export type {
|
|
203
|
-
Environment,
|
|
204
|
-
LaunchProps,
|
|
205
|
-
} from 'termcast/src/apis/environment'
|
|
186
|
+
export type { Environment, LaunchProps } from 'termcast/src/apis/environment'
|
|
206
187
|
|
|
207
188
|
export { LaunchType }
|
|
208
189
|
|
|
@@ -228,7 +209,7 @@ export { useStore } from 'termcast/src/state'
|
|
|
228
209
|
export type { DialogPosition } from 'termcast/src/state'
|
|
229
210
|
|
|
230
211
|
// Providers (for app setup)
|
|
231
|
-
export {
|
|
212
|
+
export { TermcastProvider } from 'termcast/src/internal/providers'
|
|
232
213
|
|
|
233
214
|
// Helper function for rendering examples
|
|
234
215
|
export { renderWithProviders } from 'termcast/src/utils'
|
|
@@ -406,7 +406,7 @@ function ErrorDisplay({
|
|
|
406
406
|
|
|
407
407
|
const ErrorBoundary = ErrorBoundaryClass as any
|
|
408
408
|
|
|
409
|
-
export function
|
|
409
|
+
export function TermcastProvider(props: ProvidersProps): any {
|
|
410
410
|
return (
|
|
411
411
|
<ErrorBoundary>
|
|
412
412
|
<Suspense fallback={<LoadingFallback />}>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
interface ScrollBoxProps {
|
|
4
|
+
children?: React.ReactNode
|
|
5
|
+
focused?: boolean
|
|
6
|
+
flexGrow?: number
|
|
7
|
+
flexShrink?: number
|
|
8
|
+
style?: any
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function ScrollBox({
|
|
12
|
+
children,
|
|
13
|
+
focused = false,
|
|
14
|
+
flexGrow,
|
|
15
|
+
flexShrink,
|
|
16
|
+
style,
|
|
17
|
+
...props
|
|
18
|
+
}: ScrollBoxProps): any {
|
|
19
|
+
return (
|
|
20
|
+
<scrollbox
|
|
21
|
+
focused={focused}
|
|
22
|
+
flexGrow={flexGrow}
|
|
23
|
+
flexShrink={flexShrink}
|
|
24
|
+
style={{
|
|
25
|
+
rootOptions: {
|
|
26
|
+
backgroundColor: '#1a1b26',
|
|
27
|
+
...(style?.rootOptions || {}),
|
|
28
|
+
},
|
|
29
|
+
viewportOptions: {
|
|
30
|
+
flexGrow: 1,
|
|
31
|
+
flexShrink: 1,
|
|
32
|
+
...(style?.viewportOptions || {}),
|
|
33
|
+
},
|
|
34
|
+
contentOptions: {
|
|
35
|
+
flexShrink: 0,
|
|
36
|
+
...(style?.contentOptions || {}),
|
|
37
|
+
},
|
|
38
|
+
scrollbarOptions: {
|
|
39
|
+
visible: true,
|
|
40
|
+
showArrows: true,
|
|
41
|
+
trackOptions: {
|
|
42
|
+
foregroundColor: '#7aa2f7',
|
|
43
|
+
backgroundColor: '#414868',
|
|
44
|
+
},
|
|
45
|
+
...(style?.scrollbarOptions || {}),
|
|
46
|
+
},
|
|
47
|
+
}}
|
|
48
|
+
{...props}
|
|
49
|
+
>
|
|
50
|
+
{children}
|
|
51
|
+
</scrollbox>
|
|
52
|
+
)
|
|
53
|
+
}
|
package/src/utils.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { type ReactNode } from 'react'
|
|
2
2
|
import { render } from '@opentui/react'
|
|
3
|
-
import {
|
|
3
|
+
import { TermcastProvider } from 'termcast/src/internal/providers'
|
|
4
4
|
import path from 'node:path'
|
|
5
5
|
import fs from 'node:fs'
|
|
6
6
|
import os from 'node:os'
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
import { logger } from './logger'
|
|
14
14
|
|
|
15
15
|
export function renderWithProviders(element: ReactNode): void {
|
|
16
|
-
render(<
|
|
16
|
+
render(<TermcastProvider>{element}</TermcastProvider>)
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export type CommonProps = {
|