mirror of
https://github.com/stablyai/orca.git
synced 2026-11-14 09:57:48 +00:00
* plugins: components catalog 2 (forms, tabs, table, tree, markdown, code, images)
Adds 18 components to TSX components panels, drawn with Orca's own
primitives and gated by ui.catalog 2 / ui.has() (Orca 1.4.247):
Textarea, Checkbox, RadioGroup, Slider, Field, Tabs/Tab, Collapsible,
Toolbar, Grid, a virtualized Table with sort, selection and pull-based
paging, a keyboard Tree with lazy children, Markdown (sanitized, links
through the checked open path), CodeView (Orca's highlighter), Image
(header-checked plugin files read by main), KeyValue, Callout and
Skeleton, plus a tooltip prop on Button and IconButton.
Value controls share the edit protocol; handlers get plain JSON event
args, including small objects ({ keys }, { key, expanded }). The test kit
gains matching actions and hides unselected tabs and closed collapsibles;
a components-gallery example and e2e cover the catalog end to end.
* plugins: worker test harness, host refusals in tests and check
- orca/testing gains mountWorker(main, { host, events, commands }): it calls
the default-exported activate(orca) with the orca object Orca itself builds
(createPluginWorkerOrcaApi, moved to shared so the kit reuses it), backed by
mockHost. emit() checks payloads against Orca's event schemas and only
delivers subscribed events; command(), request() (the worker's
orca.panels.handle, as a panel's plugin.request), posts, logs, refusals and
deactivate(). Storage and settings share the mock host's in-memory store.
- orca plugin test loads a worker main's module graph as Orca's worker host
does (.ts/.mts transform, Node resolution, no runtime orca import).
- mockHost records refusals (capability_denied, not_permitted, ...) even
when plugin code catches them; panel.refusals exposes them and
orca plugin check reports them as warnings. Check dedupes repeated issues.
- Typings, docs and a generated references/testing.md skill reference; the
reference generator reads the split orca typings.
52 lines
1.8 KiB
TypeScript
52 lines
1.8 KiB
TypeScript
// Orca components panel catalog 2 (since Orca 1.4.247): layout and feedback components. Part of
|
|
// the `orca` module with orca.d.ts, orca-components.d.ts and orca-components-data.d.ts.
|
|
|
|
declare module 'orca' {
|
|
import type { Gap, IconName, Leaf, OrcaComponent, Tone, WithChildren } from 'orca'
|
|
|
|
/** Holds only `Tab`; Orca draws the selected tab's children. */
|
|
export type TabsProps = WithChildren & {
|
|
label: string
|
|
value?: string
|
|
defaultValue?: string
|
|
onChange?: (value: string) => void
|
|
}
|
|
export type TabProps = WithChildren & {
|
|
value: string
|
|
label: string
|
|
icon?: IconName
|
|
disabled?: boolean
|
|
}
|
|
export type CollapsibleProps = WithChildren & {
|
|
title: string
|
|
description?: string
|
|
open?: boolean
|
|
defaultOpen?: boolean
|
|
disabled?: boolean
|
|
onChange?: (open: boolean) => void
|
|
}
|
|
/** A row of controls; arrow keys move between them. */
|
|
export type ToolbarProps = WithChildren & { label: string; gap?: Gap }
|
|
export type GridProps = WithChildren & {
|
|
columns?: 1 | 2 | 3 | 4 | 5 | 6
|
|
/** As many columns as fit, each at least this wide; overrides `columns`. */
|
|
minItemWidth?: 'xs' | 'sm' | 'md' | 'lg'
|
|
gap?: Gap
|
|
}
|
|
export type CalloutProps = WithChildren & { tone?: Tone; title?: string; icon?: IconName }
|
|
/** A placeholder while content loads; `label` names it for screen readers. */
|
|
export type SkeletonProps = Leaf & {
|
|
shape?: 'text' | 'block' | 'circle'
|
|
lines?: number
|
|
label?: string
|
|
}
|
|
|
|
export const Tabs: OrcaComponent<TabsProps>
|
|
export const Tab: OrcaComponent<TabProps>
|
|
export const Collapsible: OrcaComponent<CollapsibleProps>
|
|
export const Toolbar: OrcaComponent<ToolbarProps>
|
|
export const Grid: OrcaComponent<GridProps>
|
|
export const Callout: OrcaComponent<CalloutProps>
|
|
export const Skeleton: OrcaComponent<SkeletonProps>
|
|
}
|