pith-ui 0.0.0-stage → 0.1.1
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/AI.md +75 -0
- package/API.md +3688 -0
- package/LICENSE +661 -0
- package/README.md +80 -2
- package/dist/composer.d.ts +38 -0
- package/dist/composer.d.ts.map +1 -0
- package/dist/composer.js +123 -0
- package/dist/composer.js.map +1 -0
- package/dist/content/conversation-reader.d.ts +19 -0
- package/dist/content/conversation-reader.d.ts.map +1 -0
- package/dist/content/conversation-reader.js +280 -0
- package/dist/content/conversation-reader.js.map +1 -0
- package/dist/content/conversation-view.d.ts +65 -0
- package/dist/content/conversation-view.d.ts.map +1 -0
- package/dist/content/conversation-view.js +140 -0
- package/dist/content/conversation-view.js.map +1 -0
- package/dist/content/image-viewer.d.ts +25 -0
- package/dist/content/image-viewer.d.ts.map +1 -0
- package/dist/content/image-viewer.js +114 -0
- package/dist/content/image-viewer.js.map +1 -0
- package/dist/content/markdown.d.ts +12 -0
- package/dist/content/markdown.d.ts.map +1 -0
- package/dist/content/markdown.js +68 -0
- package/dist/content/markdown.js.map +1 -0
- package/dist/content/paged-preview.d.ts +15 -0
- package/dist/content/paged-preview.d.ts.map +1 -0
- package/dist/content/paged-preview.js +108 -0
- package/dist/content/paged-preview.js.map +1 -0
- package/dist/content/views.d.ts +9 -0
- package/dist/content/views.d.ts.map +1 -0
- package/dist/content/views.js +53 -0
- package/dist/content/views.js.map +1 -0
- package/dist/content/welcome.d.ts +18 -0
- package/dist/content/welcome.d.ts.map +1 -0
- package/dist/content/welcome.js +54 -0
- package/dist/content/welcome.js.map +1 -0
- package/dist/core.d.ts +36 -0
- package/dist/core.d.ts.map +1 -0
- package/dist/core.js +44 -0
- package/dist/core.js.map +1 -0
- package/dist/dom.d.ts +14 -0
- package/dist/dom.d.ts.map +1 -0
- package/dist/dom.js +69 -0
- package/dist/dom.js.map +1 -0
- package/dist/files/panels.d.ts +100 -0
- package/dist/files/panels.d.ts.map +1 -0
- package/dist/files/panels.js +286 -0
- package/dist/files/panels.js.map +1 -0
- package/dist/files/systems.d.ts +91 -0
- package/dist/files/systems.d.ts.map +1 -0
- package/dist/files/systems.js +273 -0
- package/dist/files/systems.js.map +1 -0
- package/dist/forms/actions.d.ts +27 -0
- package/dist/forms/actions.d.ts.map +1 -0
- package/dist/forms/actions.js +39 -0
- package/dist/forms/actions.js.map +1 -0
- package/dist/forms/custom-connection.d.ts +62 -0
- package/dist/forms/custom-connection.d.ts.map +1 -0
- package/dist/forms/custom-connection.js +72 -0
- package/dist/forms/custom-connection.js.map +1 -0
- package/dist/forms/dialog-frame.d.ts +41 -0
- package/dist/forms/dialog-frame.d.ts.map +1 -0
- package/dist/forms/dialog-frame.js +95 -0
- package/dist/forms/dialog-frame.js.map +1 -0
- package/dist/forms/history.d.ts +16 -0
- package/dist/forms/history.d.ts.map +1 -0
- package/dist/forms/history.js +21 -0
- package/dist/forms/history.js.map +1 -0
- package/dist/forms/identity.d.ts +16 -0
- package/dist/forms/identity.d.ts.map +1 -0
- package/dist/forms/identity.js +53 -0
- package/dist/forms/identity.js.map +1 -0
- package/dist/forms/model-editor.d.ts +40 -0
- package/dist/forms/model-editor.d.ts.map +1 -0
- package/dist/forms/model-editor.js +89 -0
- package/dist/forms/model-editor.js.map +1 -0
- package/dist/forms/panels.d.ts +146 -0
- package/dist/forms/panels.d.ts.map +1 -0
- package/dist/forms/panels.js +339 -0
- package/dist/forms/panels.js.map +1 -0
- package/dist/forms/provider-login.d.ts +22 -0
- package/dist/forms/provider-login.d.ts.map +1 -0
- package/dist/forms/provider-login.js +116 -0
- package/dist/forms/provider-login.js.map +1 -0
- package/dist/forms/resource-editor.d.ts +27 -0
- package/dist/forms/resource-editor.d.ts.map +1 -0
- package/dist/forms/resource-editor.js +34 -0
- package/dist/forms/resource-editor.js.map +1 -0
- package/dist/foundations.d.ts +95 -0
- package/dist/foundations.d.ts.map +1 -0
- package/dist/foundations.js +315 -0
- package/dist/foundations.js.map +1 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/dist/navigation/context-menu.d.ts +26 -0
- package/dist/navigation/context-menu.d.ts.map +1 -0
- package/dist/navigation/context-menu.js +81 -0
- package/dist/navigation/context-menu.js.map +1 -0
- package/dist/navigation/navigation.d.ts +92 -0
- package/dist/navigation/navigation.d.ts.map +1 -0
- package/dist/navigation/navigation.js +368 -0
- package/dist/navigation/navigation.js.map +1 -0
- package/dist/primitives.d.ts +310 -0
- package/dist/primitives.d.ts.map +1 -0
- package/dist/primitives.js +633 -0
- package/dist/primitives.js.map +1 -0
- package/dist/styles.css +853 -0
- package/dist/surface.d.ts +29 -0
- package/dist/surface.d.ts.map +1 -0
- package/dist/surface.js +154 -0
- package/dist/surface.js.map +1 -0
- package/dist/tasks/approval.d.ts +25 -0
- package/dist/tasks/approval.d.ts.map +1 -0
- package/dist/tasks/approval.js +64 -0
- package/dist/tasks/approval.js.map +1 -0
- package/dist/tasks/permission.d.ts +37 -0
- package/dist/tasks/permission.d.ts.map +1 -0
- package/dist/tasks/permission.js +73 -0
- package/dist/tasks/permission.js.map +1 -0
- package/dist/tasks/runtime.d.ts +31 -0
- package/dist/tasks/runtime.d.ts.map +1 -0
- package/dist/tasks/runtime.js +34 -0
- package/dist/tasks/runtime.js.map +1 -0
- package/dist/theme.d.ts +4 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +6 -0
- package/dist/theme.js.map +1 -0
- package/dist/workspace.d.ts +92 -0
- package/dist/workspace.d.ts.map +1 -0
- package/dist/workspace.js +288 -0
- package/dist/workspace.js.map +1 -0
- package/package.json +27 -4
package/API.md
ADDED
|
@@ -0,0 +1,3688 @@
|
|
|
1
|
+
# Public API reference
|
|
2
|
+
|
|
3
|
+
Generated for `pith-ui@0.1.1` by `node scripts/api-docs.ts` from TypeScript declaration emit. Do not edit this file by hand. The installed public declarations are authoritative; this reference reproduces every public declaration, including all 73 create/install/mount factories and their state, options, callback and handle types.
|
|
4
|
+
|
|
5
|
+
Use the [catalog](https://github.com/minifish-org/pith-ui/blob/main/docs/catalog.md) to choose a complete block first, then inspect its exact signature and linked types here. Gallery links are related experiences; adapter APIs may point to their preferred replacement. Source links point to the implementation, not a second usage contract.
|
|
6
|
+
|
|
7
|
+
Types such as `HTMLElement`, `Node`, `Event`, `Promise` and TypeScript utility types are standard platform types. Named Pith UI references below link to their exact public definitions. Node slots require trusted DOM nodes; there is no arbitrary-HTML extension interface. See [AI.md](./AI.md) for lifecycle, host boundaries and composition rules.
|
|
8
|
+
|
|
9
|
+
Regenerate: `node scripts/api-docs.ts`. Verify without writing: `node scripts/api-docs.ts --check`.
|
|
10
|
+
|
|
11
|
+
## Factory index
|
|
12
|
+
|
|
13
|
+
| Factory | Related gallery |
|
|
14
|
+
|---|---|
|
|
15
|
+
| [`createActions`](#createactions) | [actions](https://minifish-org.github.io/pith-ui/?item=actions) |
|
|
16
|
+
| [`createApprovalPanel`](#createapprovalpanel) | [approval-panel](https://minifish-org.github.io/pith-ui/?item=approval-panel) |
|
|
17
|
+
| [`createArtifactPanel`](#createartifactpanel) | [artifact-panel](https://minifish-org.github.io/pith-ui/?item=artifact-panel) |
|
|
18
|
+
| [`createAttachments`](#createattachments) | [attachments](https://minifish-org.github.io/pith-ui/?item=attachments) |
|
|
19
|
+
| [`createBranchHistory`](#createbranchhistory) | [branch-history](https://minifish-org.github.io/pith-ui/?item=branch-history) |
|
|
20
|
+
| [`createButton`](#createbutton) | [actions](https://minifish-org.github.io/pith-ui/?item=actions), [button](https://minifish-org.github.io/pith-ui/?item=button), [confirmation](https://minifish-org.github.io/pith-ui/?item=confirmation), [context-menu](https://minifish-org.github.io/pith-ui/?item=context-menu), [conversation-reader](https://minifish-org.github.io/pith-ui/?item=conversation-reader), [copy-feedback](https://minifish-org.github.io/pith-ui/?item=copy-feedback), [dialog](https://minifish-org.github.io/pith-ui/?item=dialog), [drop-feedback](https://minifish-org.github.io/pith-ui/?item=drop-feedback), [feature-dialog](https://minifish-org.github.io/pith-ui/?item=feature-dialog), [foundation-colors](https://minifish-org.github.io/pith-ui/?item=foundation-colors), [foundation-focus](https://minifish-org.github.io/pith-ui/?item=foundation-focus), [foundation-motion](https://minifish-org.github.io/pith-ui/?item=foundation-motion), [foundation-sizing](https://minifish-org.github.io/pith-ui/?item=foundation-sizing), [foundation-spacing](https://minifish-org.github.io/pith-ui/?item=foundation-spacing), [image-viewer](https://minifish-org.github.io/pith-ui/?item=image-viewer), [list-row](https://minifish-org.github.io/pith-ui/?item=list-row), [runtime-panel](https://minifish-org.github.io/pith-ui/?item=runtime-panel), [text-edit-dialog](https://minifish-org.github.io/pith-ui/?item=text-edit-dialog), [toolbar](https://minifish-org.github.io/pith-ui/?item=toolbar) |
|
|
21
|
+
| [`createCheckbox`](#createcheckbox) | [checkbox](https://minifish-org.github.io/pith-ui/?item=checkbox), [foundation-focus](https://minifish-org.github.io/pith-ui/?item=foundation-focus), [foundation-motion](https://minifish-org.github.io/pith-ui/?item=foundation-motion) |
|
|
22
|
+
| [`createCollectionState`](#createcollectionstate) | [collection-state](https://minifish-org.github.io/pith-ui/?item=collection-state) |
|
|
23
|
+
| [`createCompletionNotices`](#createcompletionnotices) | [completion-notices](https://minifish-org.github.io/pith-ui/?item=completion-notices) |
|
|
24
|
+
| [`createComposerView`](#createcomposerview) | [composer](https://minifish-org.github.io/pith-ui/?item=composer), [drop-feedback](https://minifish-org.github.io/pith-ui/?item=drop-feedback) |
|
|
25
|
+
| [`createConfirmDialog`](#createconfirmdialog) | [confirmation](https://minifish-org.github.io/pith-ui/?item=confirmation) |
|
|
26
|
+
| [`createContextMenu`](#createcontextmenu) | [context-menu](https://minifish-org.github.io/pith-ui/?item=context-menu) |
|
|
27
|
+
| [`createConversationView`](#createconversationview) | [conversation-messages](https://minifish-org.github.io/pith-ui/?item=conversation-messages), [conversation-reader](https://minifish-org.github.io/pith-ui/?item=conversation-reader), [foundation-motion](https://minifish-org.github.io/pith-ui/?item=foundation-motion) |
|
|
28
|
+
| [`createCopyFeedback`](#createcopyfeedback) | [copy-feedback](https://minifish-org.github.io/pith-ui/?item=copy-feedback) |
|
|
29
|
+
| [`createCostLedger`](#createcostledger) | [cost-ledger](https://minifish-org.github.io/pith-ui/?item=cost-ledger) |
|
|
30
|
+
| [`createCustomConnectionEditor`](#createcustomconnectioneditor) | [custom-connection](https://minifish-org.github.io/pith-ui/?item=custom-connection) |
|
|
31
|
+
| [`createCustomModelRow`](#createcustommodelrow) | [custom-connection](https://minifish-org.github.io/pith-ui/?item=custom-connection), [provider-resource-actions](https://minifish-org.github.io/pith-ui/?item=provider-resource-actions), [settings-panel](https://minifish-org.github.io/pith-ui/?item=settings-panel) |
|
|
32
|
+
| [`createDialog`](#createdialog) | [dialog](https://minifish-org.github.io/pith-ui/?item=dialog) |
|
|
33
|
+
| [`createDisclosure`](#createdisclosure) | [disclosure](https://minifish-org.github.io/pith-ui/?item=disclosure) |
|
|
34
|
+
| [`createDivider`](#createdivider) | [divider](https://minifish-org.github.io/pith-ui/?item=divider) |
|
|
35
|
+
| [`createDropFeedback`](#createdropfeedback) | [drop-feedback](https://minifish-org.github.io/pith-ui/?item=drop-feedback) |
|
|
36
|
+
| [`createFeatureDialogFrame`](#createfeaturedialogframe) | [feature-dialog](https://minifish-org.github.io/pith-ui/?item=feature-dialog) |
|
|
37
|
+
| [`createFeatureStatus`](#createfeaturestatus) | [feature-dialog](https://minifish-org.github.io/pith-ui/?item=feature-dialog) |
|
|
38
|
+
| [`createField`](#createfield) | [number-input](https://minifish-org.github.io/pith-ui/?item=number-input), [search-input](https://minifish-org.github.io/pith-ui/?item=search-input), [secret-input](https://minifish-org.github.io/pith-ui/?item=secret-input), [text-area](https://minifish-org.github.io/pith-ui/?item=text-area), [text-input](https://minifish-org.github.io/pith-ui/?item=text-input) |
|
|
39
|
+
| [`createFileActions`](#createfileactions) | [file-actions](https://minifish-org.github.io/pith-ui/?item=file-actions) |
|
|
40
|
+
| [`createFilePreview`](#createfilepreview) | [file-preview](https://minifish-org.github.io/pith-ui/?item=file-preview) |
|
|
41
|
+
| [`createFormSection`](#createformsection) | [form-section](https://minifish-org.github.io/pith-ui/?item=form-section) |
|
|
42
|
+
| [`createFullAccessConfirmation`](#createfullaccessconfirmation) | [full-access-confirmation](https://minifish-org.github.io/pith-ui/?item=full-access-confirmation) |
|
|
43
|
+
| [`createIcon`](#createicon) | [foundation-sizing](https://minifish-org.github.io/pith-ui/?item=foundation-sizing), [icons](https://minifish-org.github.io/pith-ui/?item=icons) |
|
|
44
|
+
| [`createIconButton`](#createiconbutton) | [icon-button](https://minifish-org.github.io/pith-ui/?item=icon-button), [toolbar](https://minifish-org.github.io/pith-ui/?item=toolbar) |
|
|
45
|
+
| [`createImageViewer`](#createimageviewer) | [image-viewer](https://minifish-org.github.io/pith-ui/?item=image-viewer) |
|
|
46
|
+
| [`createKeyValue`](#createkeyvalue) | [foundation-motion](https://minifish-org.github.io/pith-ui/?item=foundation-motion), [key-value](https://minifish-org.github.io/pith-ui/?item=key-value) |
|
|
47
|
+
| [`createListRow`](#createlistrow) | [collection-state](https://minifish-org.github.io/pith-ui/?item=collection-state), [list-row](https://minifish-org.github.io/pith-ui/?item=list-row) |
|
|
48
|
+
| [`createMCPConnectionList`](#createmcpconnectionlist) | [mcp-connections](https://minifish-org.github.io/pith-ui/?item=mcp-connections) |
|
|
49
|
+
| [`createMCPConnectionsPanel`](#createmcpconnectionspanel) | [mcp-connections](https://minifish-org.github.io/pith-ui/?item=mcp-connections) |
|
|
50
|
+
| [`createMenu`](#createmenu) | [menu](https://minifish-org.github.io/pith-ui/?item=menu) |
|
|
51
|
+
| [`createModelEditor`](#createmodeleditor) | [model-picker](https://minifish-org.github.io/pith-ui/?item=model-picker) |
|
|
52
|
+
| [`createModelPicker`](#createmodelpicker) | [model-picker](https://minifish-org.github.io/pith-ui/?item=model-picker) |
|
|
53
|
+
| [`createNotice`](#createnotice) | [notice](https://minifish-org.github.io/pith-ui/?item=notice) |
|
|
54
|
+
| [`createNumberInput`](#createnumberinput) | [number-input](https://minifish-org.github.io/pith-ui/?item=number-input) |
|
|
55
|
+
| [`createPagedPreview`](#createpagedpreview) | [markdown-content](https://minifish-org.github.io/pith-ui/?item=markdown-content), [paged-preview](https://minifish-org.github.io/pith-ui/?item=paged-preview) |
|
|
56
|
+
| [`createPendingMessages`](#creatependingmessages) | [pending-messages](https://minifish-org.github.io/pith-ui/?item=pending-messages) |
|
|
57
|
+
| [`createPermissionControl`](#createpermissioncontrol) | [permission-control](https://minifish-org.github.io/pith-ui/?item=permission-control) |
|
|
58
|
+
| [`createPopover`](#createpopover) | [popover](https://minifish-org.github.io/pith-ui/?item=popover) |
|
|
59
|
+
| [`createProgress`](#createprogress) | [progress](https://minifish-org.github.io/pith-ui/?item=progress) |
|
|
60
|
+
| [`createProviderActions`](#createprovideractions) | [provider-resource-actions](https://minifish-org.github.io/pith-ui/?item=provider-resource-actions) |
|
|
61
|
+
| [`createProviderLoginPanel`](#createproviderloginpanel) | [provider-login](https://minifish-org.github.io/pith-ui/?item=provider-login) |
|
|
62
|
+
| [`createRenameConversation`](#createrenameconversation) | [rename-conversation](https://minifish-org.github.io/pith-ui/?item=rename-conversation) |
|
|
63
|
+
| [`createResourceActions`](#createresourceactions) | [provider-resource-actions](https://minifish-org.github.io/pith-ui/?item=provider-resource-actions), [resources-panel](https://minifish-org.github.io/pith-ui/?item=resources-panel) |
|
|
64
|
+
| [`createResourceEditor`](#createresourceeditor) | [resource-editor](https://minifish-org.github.io/pith-ui/?item=resource-editor) |
|
|
65
|
+
| [`createResourcesPanel`](#createresourcespanel) | [resources-panel](https://minifish-org.github.io/pith-ui/?item=resources-panel) |
|
|
66
|
+
| [`createRuntimePanel`](#createruntimepanel) | [runtime-panel](https://minifish-org.github.io/pith-ui/?item=runtime-panel) |
|
|
67
|
+
| [`createSDKDialogElements`](#createsdkdialogelements) | [feature-dialog](https://minifish-org.github.io/pith-ui/?item=feature-dialog) |
|
|
68
|
+
| [`createScrollArea`](#createscrollarea) | [scroll-area](https://minifish-org.github.io/pith-ui/?item=scroll-area) |
|
|
69
|
+
| [`createSearchInput`](#createsearchinput) | [search-input](https://minifish-org.github.io/pith-ui/?item=search-input) |
|
|
70
|
+
| [`createSecretInput`](#createsecretinput) | [secret-input](https://minifish-org.github.io/pith-ui/?item=secret-input) |
|
|
71
|
+
| [`createSelect`](#createselect) | [foundation-sizing](https://minifish-org.github.io/pith-ui/?item=foundation-sizing), [foundation-spacing](https://minifish-org.github.io/pith-ui/?item=foundation-spacing), [select](https://minifish-org.github.io/pith-ui/?item=select) |
|
|
72
|
+
| [`createSettingsPanel`](#createsettingspanel) | [settings-panel](https://minifish-org.github.io/pith-ui/?item=settings-panel) |
|
|
73
|
+
| [`createStatus`](#createstatus) | [status](https://minifish-org.github.io/pith-ui/?item=status) |
|
|
74
|
+
| [`createTaskFailure`](#createtaskfailure) | [task-failure](https://minifish-org.github.io/pith-ui/?item=task-failure) |
|
|
75
|
+
| [`createTextAction`](#createtextaction) | [text-action](https://minifish-org.github.io/pith-ui/?item=text-action) |
|
|
76
|
+
| [`createTextArea`](#createtextarea) | [foundation-typography](https://minifish-org.github.io/pith-ui/?item=foundation-typography), [text-area](https://minifish-org.github.io/pith-ui/?item=text-area) |
|
|
77
|
+
| [`createTextEditDialog`](#createtexteditdialog) | [pending-messages](https://minifish-org.github.io/pith-ui/?item=pending-messages), [text-edit-dialog](https://minifish-org.github.io/pith-ui/?item=text-edit-dialog) |
|
|
78
|
+
| [`createTextInput`](#createtextinput) | [form-section](https://minifish-org.github.io/pith-ui/?item=form-section), [foundation-focus](https://minifish-org.github.io/pith-ui/?item=foundation-focus), [foundation-sizing](https://minifish-org.github.io/pith-ui/?item=foundation-sizing), [popover](https://minifish-org.github.io/pith-ui/?item=popover), [text-input](https://minifish-org.github.io/pith-ui/?item=text-input) |
|
|
79
|
+
| [`createToolbar`](#createtoolbar) | [button](https://minifish-org.github.io/pith-ui/?item=button), [foundation-motion](https://minifish-org.github.io/pith-ui/?item=foundation-motion), [foundation-spacing](https://minifish-org.github.io/pith-ui/?item=foundation-spacing), [icon-button](https://minifish-org.github.io/pith-ui/?item=icon-button), [icons](https://minifish-org.github.io/pith-ui/?item=icons), [toolbar](https://minifish-org.github.io/pith-ui/?item=toolbar) |
|
|
80
|
+
| [`createUpdatePanel`](#createupdatepanel) | [settings-panel](https://minifish-org.github.io/pith-ui/?item=settings-panel), [updates](https://minifish-org.github.io/pith-ui/?item=updates) |
|
|
81
|
+
| [`createWelcomeView`](#createwelcomeview) | [welcome](https://minifish-org.github.io/pith-ui/?item=welcome) |
|
|
82
|
+
| [`createWorkspaceNavigation`](#createworkspacenavigation) | [workspace-navigation](https://minifish-org.github.io/pith-ui/?item=workspace-navigation) |
|
|
83
|
+
| [`createWorkspacePicker`](#createworkspacepicker) | [workspace-picker](https://minifish-org.github.io/pith-ui/?item=workspace-picker) |
|
|
84
|
+
| [`createWorkspaceShell`](#createworkspaceshell) | [workspace-chat](https://minifish-org.github.io/pith-ui/?item=workspace-chat) |
|
|
85
|
+
| [`installConversationReader`](#installconversationreader) | [conversation-reader](https://minifish-org.github.io/pith-ui/?item=conversation-reader) |
|
|
86
|
+
| [`installImageViewer`](#installimageviewer) | [image-viewer](https://minifish-org.github.io/pith-ui/?item=image-viewer) |
|
|
87
|
+
| [`mountPagedPreview`](#mountpagedpreview) | [markdown-content](https://minifish-org.github.io/pith-ui/?item=markdown-content), [paged-preview](https://minifish-org.github.io/pith-ui/?item=paged-preview) |
|
|
88
|
+
|
|
89
|
+
## src/composer.ts
|
|
90
|
+
|
|
91
|
+
### createAttachments
|
|
92
|
+
|
|
93
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/composer.ts#L66)
|
|
94
|
+
|
|
95
|
+
```ts
|
|
96
|
+
export declare function createAttachments(options?: {
|
|
97
|
+
container?: HTMLElement;
|
|
98
|
+
onRemove?: (id: string) => void;
|
|
99
|
+
onOpen?: (image: HTMLImageElement) => void;
|
|
100
|
+
}): UIBlock<AttachmentsState>;
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Referenced public types and APIs: [`AttachmentsState`](#attachmentsstate), [`UIBlock`](#uiblock).
|
|
104
|
+
|
|
105
|
+
Related gallery: [attachments](https://minifish-org.github.io/pith-ui/?item=attachments).
|
|
106
|
+
|
|
107
|
+
### createDropFeedback
|
|
108
|
+
|
|
109
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/composer.ts#L56)
|
|
110
|
+
|
|
111
|
+
```ts
|
|
112
|
+
export declare function createDropFeedback(options: {
|
|
113
|
+
container: HTMLElement;
|
|
114
|
+
}): UIBlock<{
|
|
115
|
+
active: boolean;
|
|
116
|
+
disabled?: boolean;
|
|
117
|
+
}>;
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Referenced public types and APIs: [`UIBlock`](#uiblock).
|
|
121
|
+
|
|
122
|
+
Related gallery: [drop-feedback](https://minifish-org.github.io/pith-ui/?item=drop-feedback).
|
|
123
|
+
|
|
124
|
+
### createPendingMessages
|
|
125
|
+
|
|
126
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/composer.ts#L11)
|
|
127
|
+
|
|
128
|
+
```ts
|
|
129
|
+
export declare function createPendingMessages(options?: PendingMessagesOptions): UIBlock<PendingMessagesState>;
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Referenced public types and APIs: [`PendingMessagesOptions`](#pendingmessagesoptions), [`PendingMessagesState`](#pendingmessagesstate), [`UIBlock`](#uiblock).
|
|
133
|
+
|
|
134
|
+
Related gallery: [pending-messages](https://minifish-org.github.io/pith-ui/?item=pending-messages).
|
|
135
|
+
|
|
136
|
+
### AttachmentItem
|
|
137
|
+
|
|
138
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/composer.ts#L54)
|
|
139
|
+
|
|
140
|
+
```ts
|
|
141
|
+
export interface AttachmentItem {
|
|
142
|
+
id: string;
|
|
143
|
+
url: string;
|
|
144
|
+
name: string;
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### AttachmentsState
|
|
149
|
+
|
|
150
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/composer.ts#L65)
|
|
151
|
+
|
|
152
|
+
```ts
|
|
153
|
+
export interface AttachmentsState {
|
|
154
|
+
items: readonly AttachmentItem[];
|
|
155
|
+
disabled?: boolean;
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Referenced public types and APIs: [`AttachmentItem`](#attachmentitem).
|
|
160
|
+
|
|
161
|
+
### PendingMessage
|
|
162
|
+
|
|
163
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/composer.ts#L5)
|
|
164
|
+
|
|
165
|
+
```ts
|
|
166
|
+
export interface PendingMessage {
|
|
167
|
+
id: string;
|
|
168
|
+
text: string;
|
|
169
|
+
mode: string;
|
|
170
|
+
imageCount?: number;
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### PendingMessagesOptions
|
|
175
|
+
|
|
176
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/composer.ts#L7)
|
|
177
|
+
|
|
178
|
+
```ts
|
|
179
|
+
export interface PendingMessagesOptions {
|
|
180
|
+
container?: HTMLElement;
|
|
181
|
+
onAction?: (action: 'edit' | 'delete' | 'steer', id: string) => void;
|
|
182
|
+
}
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### PendingMessagesState
|
|
186
|
+
|
|
187
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/composer.ts#L6)
|
|
188
|
+
|
|
189
|
+
```ts
|
|
190
|
+
export interface PendingMessagesState {
|
|
191
|
+
items: readonly PendingMessage[];
|
|
192
|
+
running: boolean;
|
|
193
|
+
busy: boolean;
|
|
194
|
+
}
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
Referenced public types and APIs: [`PendingMessage`](#pendingmessage).
|
|
198
|
+
|
|
199
|
+
## src/content/conversation-reader.ts
|
|
200
|
+
|
|
201
|
+
### installConversationReader
|
|
202
|
+
|
|
203
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/content/conversation-reader.ts#L18)
|
|
204
|
+
|
|
205
|
+
```ts
|
|
206
|
+
export declare function installConversationReader(scroll: HTMLElement, messages: HTMLElement, bar: HTMLElement, latest: HTMLButtonElement, options?: ConversationReaderOptions): {
|
|
207
|
+
beforeRender(id: string): void;
|
|
208
|
+
afterRender(): void;
|
|
209
|
+
prune(ids: string[]): void;
|
|
210
|
+
followLatest: () => void;
|
|
211
|
+
openFind: () => void;
|
|
212
|
+
closeFind: () => void;
|
|
213
|
+
destroy(): void;
|
|
214
|
+
};
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
Referenced public types and APIs: [`ConversationReaderOptions`](#conversationreaderoptions).
|
|
218
|
+
|
|
219
|
+
Related gallery: [conversation-reader](https://minifish-org.github.io/pith-ui/?item=conversation-reader).
|
|
220
|
+
|
|
221
|
+
### ConversationReaderOptions
|
|
222
|
+
|
|
223
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/content/conversation-reader.ts#L13)
|
|
224
|
+
|
|
225
|
+
```ts
|
|
226
|
+
export interface ConversationReaderOptions {
|
|
227
|
+
keyboardTarget?: EventTarget;
|
|
228
|
+
isKeyboardBlocked?: () => boolean;
|
|
229
|
+
}
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### findRanges
|
|
233
|
+
|
|
234
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/content/conversation-reader.ts#L4)
|
|
235
|
+
|
|
236
|
+
```ts
|
|
237
|
+
export declare function findRanges(text: string, query: string): TextRange[];
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
Referenced public types and APIs: [`TextRange`](#textrange).
|
|
241
|
+
|
|
242
|
+
### TextRange
|
|
243
|
+
|
|
244
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/content/conversation-reader.ts#L1)
|
|
245
|
+
|
|
246
|
+
```ts
|
|
247
|
+
export interface TextRange {
|
|
248
|
+
start: number;
|
|
249
|
+
end: number;
|
|
250
|
+
}
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
## src/content/conversation-view.ts
|
|
254
|
+
|
|
255
|
+
### createConversationView
|
|
256
|
+
|
|
257
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/content/conversation-view.ts#L43)
|
|
258
|
+
|
|
259
|
+
```ts
|
|
260
|
+
export declare function createConversationView(options?: ConversationViewOptions): ConversationViewBlock;
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
Referenced public types and APIs: [`ConversationViewBlock`](#conversationviewblock), [`ConversationViewOptions`](#conversationviewoptions).
|
|
264
|
+
|
|
265
|
+
Related gallery: [conversation-messages](https://minifish-org.github.io/pith-ui/?item=conversation-messages), [conversation-reader](https://minifish-org.github.io/pith-ui/?item=conversation-reader), [foundation-motion](https://minifish-org.github.io/pith-ui/?item=foundation-motion).
|
|
266
|
+
|
|
267
|
+
### ConversationAction
|
|
268
|
+
|
|
269
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/content/conversation-view.ts#L26)
|
|
270
|
+
|
|
271
|
+
```ts
|
|
272
|
+
export interface ConversationAction {
|
|
273
|
+
action: 'copy' | 'edit' | 'branch';
|
|
274
|
+
messageId: string;
|
|
275
|
+
branchKey?: string;
|
|
276
|
+
}
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
### ConversationActionAvailability
|
|
280
|
+
|
|
281
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/content/conversation-view.ts#L27)
|
|
282
|
+
|
|
283
|
+
```ts
|
|
284
|
+
export interface ConversationActionAvailability {
|
|
285
|
+
copy?: boolean;
|
|
286
|
+
edit?: boolean;
|
|
287
|
+
branch?: boolean;
|
|
288
|
+
}
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
### ConversationImageState
|
|
292
|
+
|
|
293
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/content/conversation-view.ts#L28)
|
|
294
|
+
|
|
295
|
+
```ts
|
|
296
|
+
export type ConversationImageState = {
|
|
297
|
+
status: 'ready';
|
|
298
|
+
src: string;
|
|
299
|
+
} | {
|
|
300
|
+
status: 'unavailable';
|
|
301
|
+
};
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
### ConversationMessage
|
|
305
|
+
|
|
306
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/content/conversation-view.ts#L8)
|
|
307
|
+
|
|
308
|
+
```ts
|
|
309
|
+
/** UI data only. Hosts decide copy/edit/branch eligibility and resolve images. */
|
|
310
|
+
export interface ConversationMessage {
|
|
311
|
+
id: string;
|
|
312
|
+
role: string;
|
|
313
|
+
text: string;
|
|
314
|
+
timestamp?: number;
|
|
315
|
+
toolName?: string;
|
|
316
|
+
toolCallId?: string;
|
|
317
|
+
status?: string;
|
|
318
|
+
images?: Array<{
|
|
319
|
+
index: number;
|
|
320
|
+
mimeType?: string;
|
|
321
|
+
}>;
|
|
322
|
+
command?: {
|
|
323
|
+
text: string;
|
|
324
|
+
cwd: string;
|
|
325
|
+
exitCode?: number;
|
|
326
|
+
};
|
|
327
|
+
actions?: {
|
|
328
|
+
copy?: boolean | string;
|
|
329
|
+
edit?: boolean;
|
|
330
|
+
branch?: {
|
|
331
|
+
key: string;
|
|
332
|
+
label?: string;
|
|
333
|
+
};
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
Related gallery: [conversation-messages](https://minifish-org.github.io/pith-ui/?item=conversation-messages), [conversation-reader](https://minifish-org.github.io/pith-ui/?item=conversation-reader).
|
|
339
|
+
|
|
340
|
+
### ConversationViewBlock
|
|
341
|
+
|
|
342
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/content/conversation-view.ts#L29)
|
|
343
|
+
|
|
344
|
+
```ts
|
|
345
|
+
export interface ConversationViewBlock extends UIBlock<ConversationViewState> {
|
|
346
|
+
/** Disabled state, separate from whether an action exists for a message. */
|
|
347
|
+
updateActionAvailability(disabled: Readonly<ConversationActionAvailability>): void;
|
|
348
|
+
images(): readonly HTMLImageElement[];
|
|
349
|
+
setImageState(image: HTMLImageElement, state: ConversationImageState): void;
|
|
350
|
+
}
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
Referenced public types and APIs: [`ConversationActionAvailability`](#conversationactionavailability), [`ConversationImageState`](#conversationimagestate), [`ConversationViewState`](#conversationviewstate), [`UIBlock`](#uiblock).
|
|
354
|
+
|
|
355
|
+
### ConversationViewOptions
|
|
356
|
+
|
|
357
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/content/conversation-view.ts#L35)
|
|
358
|
+
|
|
359
|
+
```ts
|
|
360
|
+
export interface ConversationViewOptions {
|
|
361
|
+
container?: HTMLElement;
|
|
362
|
+
markdown?: (conversationId: string) => MarkdownOptions;
|
|
363
|
+
onAction?: (action: ConversationAction, button: HTMLButtonElement) => void;
|
|
364
|
+
onCopyCode?: (text: string, button: HTMLButtonElement) => void;
|
|
365
|
+
}
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
Referenced public types and APIs: [`ConversationAction`](#conversationaction), [`MarkdownOptions`](#markdownoptions).
|
|
369
|
+
|
|
370
|
+
### ConversationViewState
|
|
371
|
+
|
|
372
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/content/conversation-view.ts#L20)
|
|
373
|
+
|
|
374
|
+
```ts
|
|
375
|
+
export interface ConversationViewState {
|
|
376
|
+
id: string;
|
|
377
|
+
messages: readonly ConversationMessage[];
|
|
378
|
+
working: boolean;
|
|
379
|
+
folds?: ReadonlyMap<string, boolean>;
|
|
380
|
+
}
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
Referenced public types and APIs: [`ConversationMessage`](#conversationmessage).
|
|
384
|
+
|
|
385
|
+
## src/content/image-viewer.ts
|
|
386
|
+
|
|
387
|
+
### createImageViewer
|
|
388
|
+
|
|
389
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/content/image-viewer.ts#L9)
|
|
390
|
+
|
|
391
|
+
```ts
|
|
392
|
+
/** A modal above either a generated-file preview or a conversation attachment. */
|
|
393
|
+
export declare function createImageViewer(options?: ImageViewerOptions): {
|
|
394
|
+
element: HTMLDialogElement;
|
|
395
|
+
open(target: HTMLImageElement | ImageViewerInput): void;
|
|
396
|
+
close: () => void;
|
|
397
|
+
destroy(): void;
|
|
398
|
+
};
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
Referenced public types and APIs: [`ImageViewerInput`](#imageviewerinput), [`ImageViewerOptions`](#imagevieweroptions).
|
|
402
|
+
|
|
403
|
+
Related gallery: [image-viewer](https://minifish-org.github.io/pith-ui/?item=image-viewer).
|
|
404
|
+
|
|
405
|
+
### installImageViewer
|
|
406
|
+
|
|
407
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/content/image-viewer.ts#L88)
|
|
408
|
+
|
|
409
|
+
```ts
|
|
410
|
+
export declare function installImageViewer(dialog: HTMLDialogElement, options?: {
|
|
411
|
+
triggerRoot?: HTMLElement;
|
|
412
|
+
}): {
|
|
413
|
+
destroy(): void;
|
|
414
|
+
element: HTMLDialogElement;
|
|
415
|
+
open(target: HTMLImageElement | ImageViewerInput): void;
|
|
416
|
+
close: () => void;
|
|
417
|
+
};
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
Referenced public types and APIs: [`ImageViewerInput`](#imageviewerinput).
|
|
421
|
+
|
|
422
|
+
Related gallery: [image-viewer](https://minifish-org.github.io/pith-ui/?item=image-viewer).
|
|
423
|
+
|
|
424
|
+
### ImageViewerInput
|
|
425
|
+
|
|
426
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/content/image-viewer.ts#L5)
|
|
427
|
+
|
|
428
|
+
```ts
|
|
429
|
+
export interface ImageViewerInput {
|
|
430
|
+
src: string;
|
|
431
|
+
alt?: string;
|
|
432
|
+
returnFocus?: HTMLElement;
|
|
433
|
+
}
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
### ImageViewerOptions
|
|
437
|
+
|
|
438
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/content/image-viewer.ts#L4)
|
|
439
|
+
|
|
440
|
+
```ts
|
|
441
|
+
export interface ImageViewerOptions {
|
|
442
|
+
dialog?: HTMLDialogElement;
|
|
443
|
+
headingId?: string;
|
|
444
|
+
}
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
## src/content/markdown.ts
|
|
448
|
+
|
|
449
|
+
### LocalContentLink
|
|
450
|
+
|
|
451
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/content/markdown.ts#L5)
|
|
452
|
+
|
|
453
|
+
```ts
|
|
454
|
+
export interface LocalContentLink {
|
|
455
|
+
path: string;
|
|
456
|
+
conversationId: string;
|
|
457
|
+
}
|
|
458
|
+
```
|
|
459
|
+
|
|
460
|
+
### MarkdownOptions
|
|
461
|
+
|
|
462
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/content/markdown.ts#L6)
|
|
463
|
+
|
|
464
|
+
```ts
|
|
465
|
+
export interface MarkdownOptions {
|
|
466
|
+
/** The host validates its own file identity and download permissions. */
|
|
467
|
+
resolveLocalLink?: (href: string) => LocalContentLink | null;
|
|
468
|
+
}
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
Referenced public types and APIs: [`LocalContentLink`](#localcontentlink).
|
|
472
|
+
|
|
473
|
+
### renderDiff
|
|
474
|
+
|
|
475
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/content/markdown.ts#L67)
|
|
476
|
+
|
|
477
|
+
```ts
|
|
478
|
+
export declare function renderDiff(diff: string): string;
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
### renderMarkdown
|
|
482
|
+
|
|
483
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/content/markdown.ts#L12)
|
|
484
|
+
|
|
485
|
+
```ts
|
|
486
|
+
/** Sanitized content only: embedded images, executable markup and forms are excluded. */
|
|
487
|
+
export declare function renderMarkdown(value: string, options?: MarkdownOptions): string;
|
|
488
|
+
```
|
|
489
|
+
|
|
490
|
+
Referenced public types and APIs: [`MarkdownOptions`](#markdownoptions).
|
|
491
|
+
|
|
492
|
+
## src/content/paged-preview.ts
|
|
493
|
+
|
|
494
|
+
### createPagedPreview
|
|
495
|
+
|
|
496
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/content/paged-preview.ts#L31)
|
|
497
|
+
|
|
498
|
+
```ts
|
|
499
|
+
export declare function createPagedPreview(options: PagedPreviewOptions): UIBlock<PagedPreviewState>;
|
|
500
|
+
```
|
|
501
|
+
|
|
502
|
+
Referenced public types and APIs: [`PagedPreviewOptions`](#pagedpreviewoptions), [`PagedPreviewState`](#pagedpreviewstate), [`UIBlock`](#uiblock).
|
|
503
|
+
|
|
504
|
+
Related gallery: [markdown-content](https://minifish-org.github.io/pith-ui/?item=markdown-content), [paged-preview](https://minifish-org.github.io/pith-ui/?item=paged-preview).
|
|
505
|
+
|
|
506
|
+
### mountPagedPreview
|
|
507
|
+
|
|
508
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/content/paged-preview.ts#L60)
|
|
509
|
+
|
|
510
|
+
```ts
|
|
511
|
+
export declare function mountPagedPreview(container: HTMLElement, text: string, kind: PreviewKind): void;
|
|
512
|
+
```
|
|
513
|
+
|
|
514
|
+
Referenced public types and APIs: [`PreviewKind`](#previewkind).
|
|
515
|
+
|
|
516
|
+
Related gallery: [markdown-content](https://minifish-org.github.io/pith-ui/?item=markdown-content), [paged-preview](https://minifish-org.github.io/pith-ui/?item=paged-preview).
|
|
517
|
+
|
|
518
|
+
### PagedPreviewOptions
|
|
519
|
+
|
|
520
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/content/paged-preview.ts#L29)
|
|
521
|
+
|
|
522
|
+
```ts
|
|
523
|
+
export interface PagedPreviewOptions extends PagedPreviewState {
|
|
524
|
+
container?: HTMLElement;
|
|
525
|
+
onCopyCode?: (text: string) => void;
|
|
526
|
+
}
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
Referenced public types and APIs: [`PagedPreviewState`](#pagedpreviewstate).
|
|
530
|
+
|
|
531
|
+
### PagedPreviewState
|
|
532
|
+
|
|
533
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/content/paged-preview.ts#L28)
|
|
534
|
+
|
|
535
|
+
```ts
|
|
536
|
+
export interface PagedPreviewState {
|
|
537
|
+
text: string;
|
|
538
|
+
kind: PreviewKind;
|
|
539
|
+
}
|
|
540
|
+
```
|
|
541
|
+
|
|
542
|
+
Referenced public types and APIs: [`PreviewKind`](#previewkind).
|
|
543
|
+
|
|
544
|
+
### PreviewKind
|
|
545
|
+
|
|
546
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/content/paged-preview.ts#L27)
|
|
547
|
+
|
|
548
|
+
```ts
|
|
549
|
+
export type PreviewKind = 'text' | 'markdown' | 'diff';
|
|
550
|
+
```
|
|
551
|
+
|
|
552
|
+
### previewPageBytes
|
|
553
|
+
|
|
554
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/content/paged-preview.ts#L7)
|
|
555
|
+
|
|
556
|
+
```ts
|
|
557
|
+
export declare const previewPageBytes: number;
|
|
558
|
+
```
|
|
559
|
+
|
|
560
|
+
### previewPageRanges
|
|
561
|
+
|
|
562
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/content/paged-preview.ts#L9)
|
|
563
|
+
|
|
564
|
+
```ts
|
|
565
|
+
export declare function previewPageRanges(bytes: Uint8Array, window?: number): Array<[
|
|
566
|
+
number,
|
|
567
|
+
number
|
|
568
|
+
]>;
|
|
569
|
+
```
|
|
570
|
+
|
|
571
|
+
## src/content/welcome.ts
|
|
572
|
+
|
|
573
|
+
### createWelcomeView
|
|
574
|
+
|
|
575
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/content/welcome.ts#L17)
|
|
576
|
+
|
|
577
|
+
```ts
|
|
578
|
+
export declare function createWelcomeView(options?: WelcomeOptions): UIBlock<WelcomeState>;
|
|
579
|
+
```
|
|
580
|
+
|
|
581
|
+
Referenced public types and APIs: [`UIBlock`](#uiblock), [`WelcomeOptions`](#welcomeoptions), [`WelcomeState`](#welcomestate).
|
|
582
|
+
|
|
583
|
+
Related gallery: [welcome](https://minifish-org.github.io/pith-ui/?item=welcome).
|
|
584
|
+
|
|
585
|
+
### WelcomeOptions
|
|
586
|
+
|
|
587
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/content/welcome.ts#L10)
|
|
588
|
+
|
|
589
|
+
```ts
|
|
590
|
+
export interface WelcomeOptions {
|
|
591
|
+
container?: HTMLElement;
|
|
592
|
+
logo?: Node;
|
|
593
|
+
onAction?: (action: 'model' | 'settings' | 'workspace') => void;
|
|
594
|
+
onPrompt?: (text: string) => void;
|
|
595
|
+
}
|
|
596
|
+
```
|
|
597
|
+
|
|
598
|
+
### WelcomeState
|
|
599
|
+
|
|
600
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/content/welcome.ts#L4)
|
|
601
|
+
|
|
602
|
+
```ts
|
|
603
|
+
export interface WelcomeState {
|
|
604
|
+
workspace?: {
|
|
605
|
+
name: string;
|
|
606
|
+
path: string;
|
|
607
|
+
};
|
|
608
|
+
hasApiKey: boolean;
|
|
609
|
+
hasConnections: boolean;
|
|
610
|
+
modelName: string;
|
|
611
|
+
}
|
|
612
|
+
```
|
|
613
|
+
|
|
614
|
+
## src/core.ts
|
|
615
|
+
|
|
616
|
+
### ActionResult
|
|
617
|
+
|
|
618
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/core.ts#L8)
|
|
619
|
+
|
|
620
|
+
```ts
|
|
621
|
+
export type ActionResult = {
|
|
622
|
+
ok: true;
|
|
623
|
+
} | {
|
|
624
|
+
ok: false;
|
|
625
|
+
error: string;
|
|
626
|
+
};
|
|
627
|
+
```
|
|
628
|
+
|
|
629
|
+
### controlDisabled
|
|
630
|
+
|
|
631
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/core.ts#L42)
|
|
632
|
+
|
|
633
|
+
```ts
|
|
634
|
+
/** Combine business availability with pending state owned by the control. */
|
|
635
|
+
export declare function controlDisabled(button: Pick<HTMLButtonElement, 'dataset'>, unavailable: boolean): boolean;
|
|
636
|
+
```
|
|
637
|
+
|
|
638
|
+
### Density
|
|
639
|
+
|
|
640
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/core.ts#L10)
|
|
641
|
+
|
|
642
|
+
```ts
|
|
643
|
+
export type Density = 'normal' | 'compact';
|
|
644
|
+
```
|
|
645
|
+
|
|
646
|
+
### Generation
|
|
647
|
+
|
|
648
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/core.ts#L14)
|
|
649
|
+
|
|
650
|
+
```ts
|
|
651
|
+
/** Invalidates UI responses without cancelling an already-started business write. */
|
|
652
|
+
export declare class Generation {
|
|
653
|
+
private revision;
|
|
654
|
+
private disposed;
|
|
655
|
+
next(): number;
|
|
656
|
+
current(revision: number): boolean;
|
|
657
|
+
invalidate(): void;
|
|
658
|
+
destroy(): void;
|
|
659
|
+
}
|
|
660
|
+
```
|
|
661
|
+
|
|
662
|
+
### Intent
|
|
663
|
+
|
|
664
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/core.ts#L11)
|
|
665
|
+
|
|
666
|
+
```ts
|
|
667
|
+
export type Intent = 'neutral' | 'primary' | 'danger';
|
|
668
|
+
```
|
|
669
|
+
|
|
670
|
+
### Lifetime
|
|
671
|
+
|
|
672
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/core.ts#L24)
|
|
673
|
+
|
|
674
|
+
```ts
|
|
675
|
+
/** All listeners and observers belong to the instance, including document listeners. */
|
|
676
|
+
export declare class Lifetime {
|
|
677
|
+
private cleanups;
|
|
678
|
+
private disposed;
|
|
679
|
+
add(cleanup: () => void): void;
|
|
680
|
+
listen(target: EventTarget, type: string, listener: EventListenerOrEventListenerObject, options?: AddEventListenerOptions): void;
|
|
681
|
+
destroy(): void;
|
|
682
|
+
}
|
|
683
|
+
```
|
|
684
|
+
|
|
685
|
+
### setControlPending
|
|
686
|
+
|
|
687
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/core.ts#L46)
|
|
688
|
+
|
|
689
|
+
```ts
|
|
690
|
+
export declare function setControlPending(button: HTMLButtonElement, pending: boolean): void;
|
|
691
|
+
```
|
|
692
|
+
|
|
693
|
+
### UIAction
|
|
694
|
+
|
|
695
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/core.ts#L9)
|
|
696
|
+
|
|
697
|
+
```ts
|
|
698
|
+
export type UIAction = () => void | ActionResult | Promise<void | ActionResult>;
|
|
699
|
+
```
|
|
700
|
+
|
|
701
|
+
Referenced public types and APIs: [`ActionResult`](#actionresult).
|
|
702
|
+
|
|
703
|
+
### UIBlock
|
|
704
|
+
|
|
705
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/core.ts#L2)
|
|
706
|
+
|
|
707
|
+
```ts
|
|
708
|
+
/** An owned DOM instance. Call destroy before releasing or replacing its host. */
|
|
709
|
+
export interface UIBlock<State> {
|
|
710
|
+
readonly element: HTMLElement;
|
|
711
|
+
update(state: Readonly<State>): void;
|
|
712
|
+
destroy(): void;
|
|
713
|
+
}
|
|
714
|
+
```
|
|
715
|
+
|
|
716
|
+
## src/dom.ts
|
|
717
|
+
|
|
718
|
+
### dialogHeading
|
|
719
|
+
|
|
720
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/dom.ts#L34)
|
|
721
|
+
|
|
722
|
+
```ts
|
|
723
|
+
export declare function dialogHeading(title: string, id: string, dialogId: string, eyebrow?: string): string;
|
|
724
|
+
```
|
|
725
|
+
|
|
726
|
+
### DOMChild
|
|
727
|
+
|
|
728
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/dom.ts#L38)
|
|
729
|
+
|
|
730
|
+
```ts
|
|
731
|
+
export type DOMChild = Node | string | null | undefined;
|
|
732
|
+
```
|
|
733
|
+
|
|
734
|
+
### element
|
|
735
|
+
|
|
736
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/dom.ts#L40)
|
|
737
|
+
|
|
738
|
+
```ts
|
|
739
|
+
/** Safe DOM construction; strings are always text nodes. */
|
|
740
|
+
export declare function element<K extends keyof HTMLElementTagNameMap>(tag: K, className?: string, ...children: DOMChild[]): HTMLElementTagNameMap[K];
|
|
741
|
+
```
|
|
742
|
+
|
|
743
|
+
Referenced public types and APIs: [`DOMChild`](#domchild).
|
|
744
|
+
|
|
745
|
+
Related gallery: [actions](https://minifish-org.github.io/pith-ui/?item=actions), [artifact-panel](https://minifish-org.github.io/pith-ui/?item=artifact-panel), [button](https://minifish-org.github.io/pith-ui/?item=button), [collection-state](https://minifish-org.github.io/pith-ui/?item=collection-state), [completion-notices](https://minifish-org.github.io/pith-ui/?item=completion-notices), [composer](https://minifish-org.github.io/pith-ui/?item=composer), [context-menu](https://minifish-org.github.io/pith-ui/?item=context-menu), [conversation-messages](https://minifish-org.github.io/pith-ui/?item=conversation-messages), [conversation-reader](https://minifish-org.github.io/pith-ui/?item=conversation-reader), [copy-feedback](https://minifish-org.github.io/pith-ui/?item=copy-feedback), [dialog](https://minifish-org.github.io/pith-ui/?item=dialog), [disclosure](https://minifish-org.github.io/pith-ui/?item=disclosure), [drop-feedback](https://minifish-org.github.io/pith-ui/?item=drop-feedback), [feature-dialog](https://minifish-org.github.io/pith-ui/?item=feature-dialog), [file-actions](https://minifish-org.github.io/pith-ui/?item=file-actions), [file-preview](https://minifish-org.github.io/pith-ui/?item=file-preview), [form-section](https://minifish-org.github.io/pith-ui/?item=form-section), [foundation-borders](https://minifish-org.github.io/pith-ui/?item=foundation-borders), [foundation-colors](https://minifish-org.github.io/pith-ui/?item=foundation-colors), [foundation-focus](https://minifish-org.github.io/pith-ui/?item=foundation-focus), [foundation-motion](https://minifish-org.github.io/pith-ui/?item=foundation-motion), [foundation-sizing](https://minifish-org.github.io/pith-ui/?item=foundation-sizing), [foundation-spacing](https://minifish-org.github.io/pith-ui/?item=foundation-spacing), [foundation-surfaces](https://minifish-org.github.io/pith-ui/?item=foundation-surfaces), [foundation-typography](https://minifish-org.github.io/pith-ui/?item=foundation-typography), [icon-button](https://minifish-org.github.io/pith-ui/?item=icon-button), [icons](https://minifish-org.github.io/pith-ui/?item=icons), [image-viewer](https://minifish-org.github.io/pith-ui/?item=image-viewer), [list-row](https://minifish-org.github.io/pith-ui/?item=list-row), [mcp-connections](https://minifish-org.github.io/pith-ui/?item=mcp-connections), [pending-messages](https://minifish-org.github.io/pith-ui/?item=pending-messages), [permission-control](https://minifish-org.github.io/pith-ui/?item=permission-control), [popover](https://minifish-org.github.io/pith-ui/?item=popover), [provider-resource-actions](https://minifish-org.github.io/pith-ui/?item=provider-resource-actions), [resources-panel](https://minifish-org.github.io/pith-ui/?item=resources-panel), [runtime-panel](https://minifish-org.github.io/pith-ui/?item=runtime-panel), [scroll-area](https://minifish-org.github.io/pith-ui/?item=scroll-area), [toolbar](https://minifish-org.github.io/pith-ui/?item=toolbar), [updates](https://minifish-org.github.io/pith-ui/?item=updates), [workspace-navigation](https://minifish-org.github.io/pith-ui/?item=workspace-navigation).
|
|
746
|
+
|
|
747
|
+
### escape
|
|
748
|
+
|
|
749
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/dom.ts#L29)
|
|
750
|
+
|
|
751
|
+
```ts
|
|
752
|
+
export declare const escape: (value: unknown) => string;
|
|
753
|
+
```
|
|
754
|
+
|
|
755
|
+
### escapeHTML
|
|
756
|
+
|
|
757
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/dom.ts#L30)
|
|
758
|
+
|
|
759
|
+
```ts
|
|
760
|
+
export declare const escapeHTML: (value: unknown) => string;
|
|
761
|
+
```
|
|
762
|
+
|
|
763
|
+
### focusableElements
|
|
764
|
+
|
|
765
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/dom.ts#L58)
|
|
766
|
+
|
|
767
|
+
```ts
|
|
768
|
+
export declare function focusableElements(owner: HTMLElement): HTMLElement[];
|
|
769
|
+
```
|
|
770
|
+
|
|
771
|
+
### icon
|
|
772
|
+
|
|
773
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/dom.ts#L32)
|
|
774
|
+
|
|
775
|
+
```ts
|
|
776
|
+
/** Compatibility markup from a closed, trusted icon registry. */
|
|
777
|
+
export declare const icon: (name: string, className?: string) => string;
|
|
778
|
+
```
|
|
779
|
+
|
|
780
|
+
Related gallery: [collection-state](https://minifish-org.github.io/pith-ui/?item=collection-state), [foundation-sizing](https://minifish-org.github.io/pith-ui/?item=foundation-sizing), [icon-button](https://minifish-org.github.io/pith-ui/?item=icon-button), [list-row](https://minifish-org.github.io/pith-ui/?item=list-row), [toolbar](https://minifish-org.github.io/pith-ui/?item=toolbar).
|
|
781
|
+
|
|
782
|
+
### iconElement
|
|
783
|
+
|
|
784
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/dom.ts#L47)
|
|
785
|
+
|
|
786
|
+
```ts
|
|
787
|
+
export declare function iconElement(name: string): SVGSVGElement;
|
|
788
|
+
```
|
|
789
|
+
|
|
790
|
+
### setText
|
|
791
|
+
|
|
792
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/dom.ts#L53)
|
|
793
|
+
|
|
794
|
+
```ts
|
|
795
|
+
export declare function setText(node: HTMLElement, value: unknown): void;
|
|
796
|
+
```
|
|
797
|
+
|
|
798
|
+
### showDialogError
|
|
799
|
+
|
|
800
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/dom.ts#L66)
|
|
801
|
+
|
|
802
|
+
```ts
|
|
803
|
+
export declare function showDialogError(owner: HTMLElement, message: string): void;
|
|
804
|
+
```
|
|
805
|
+
|
|
806
|
+
### uniqueId
|
|
807
|
+
|
|
808
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/dom.ts#L64)
|
|
809
|
+
|
|
810
|
+
```ts
|
|
811
|
+
export declare function uniqueId(prefix?: string): string;
|
|
812
|
+
```
|
|
813
|
+
|
|
814
|
+
Related gallery: [foundation-focus](https://minifish-org.github.io/pith-ui/?item=foundation-focus).
|
|
815
|
+
|
|
816
|
+
## src/files/panels.ts
|
|
817
|
+
|
|
818
|
+
### createArtifactPanel
|
|
819
|
+
|
|
820
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/files/panels.ts#L33)
|
|
821
|
+
|
|
822
|
+
```ts
|
|
823
|
+
export declare function createArtifactPanel(options: ArtifactPanelOptions): {
|
|
824
|
+
element: HTMLElement;
|
|
825
|
+
setOpen: (value: boolean, restoreFocus?: boolean) => void;
|
|
826
|
+
readonly open: boolean;
|
|
827
|
+
update(state: Readonly<ArtifactPanelState>): void;
|
|
828
|
+
destroy(): void;
|
|
829
|
+
};
|
|
830
|
+
```
|
|
831
|
+
|
|
832
|
+
Referenced public types and APIs: [`ArtifactPanelOptions`](#artifactpaneloptions), [`ArtifactPanelState`](#artifactpanelstate).
|
|
833
|
+
|
|
834
|
+
Related gallery: [artifact-panel](https://minifish-org.github.io/pith-ui/?item=artifact-panel).
|
|
835
|
+
|
|
836
|
+
### createFileActions
|
|
837
|
+
|
|
838
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/files/panels.ts#L19)
|
|
839
|
+
|
|
840
|
+
```ts
|
|
841
|
+
export declare function createFileActions(options: FileActionOptions): {
|
|
842
|
+
element: HTMLElement;
|
|
843
|
+
destroy(): void;
|
|
844
|
+
};
|
|
845
|
+
```
|
|
846
|
+
|
|
847
|
+
Referenced public types and APIs: [`FileActionOptions`](#fileactionoptions).
|
|
848
|
+
|
|
849
|
+
Related gallery: [file-actions](https://minifish-org.github.io/pith-ui/?item=file-actions).
|
|
850
|
+
|
|
851
|
+
### createFilePreview
|
|
852
|
+
|
|
853
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/files/panels.ts#L179)
|
|
854
|
+
|
|
855
|
+
```ts
|
|
856
|
+
export declare function createFilePreview(options?: FilePreviewOptions): {
|
|
857
|
+
element: HTMLElement;
|
|
858
|
+
clear: () => void;
|
|
859
|
+
open(input: {
|
|
860
|
+
name: string;
|
|
861
|
+
path: string;
|
|
862
|
+
actions: Node;
|
|
863
|
+
}): void;
|
|
864
|
+
update(state: Readonly<FilePreviewState>): void;
|
|
865
|
+
destroy(): void;
|
|
866
|
+
};
|
|
867
|
+
```
|
|
868
|
+
|
|
869
|
+
Referenced public types and APIs: [`FilePreviewOptions`](#filepreviewoptions), [`FilePreviewState`](#filepreviewstate).
|
|
870
|
+
|
|
871
|
+
Related gallery: [file-preview](https://minifish-org.github.io/pith-ui/?item=file-preview).
|
|
872
|
+
|
|
873
|
+
### createResourcesPanel
|
|
874
|
+
|
|
875
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/files/panels.ts#L105)
|
|
876
|
+
|
|
877
|
+
```ts
|
|
878
|
+
export declare function createResourcesPanel(options?: ResourcesPanelOptions): {
|
|
879
|
+
element: HTMLElement;
|
|
880
|
+
open(workspaceName: string, toolbar?: Node): void;
|
|
881
|
+
setError(message: string): void;
|
|
882
|
+
setCreateDisabled(disabled: boolean): void;
|
|
883
|
+
update(state: Readonly<ResourcesPanelState>): void;
|
|
884
|
+
destroy(): void;
|
|
885
|
+
};
|
|
886
|
+
```
|
|
887
|
+
|
|
888
|
+
Referenced public types and APIs: [`ResourcesPanelOptions`](#resourcespaneloptions), [`ResourcesPanelState`](#resourcespanelstate).
|
|
889
|
+
|
|
890
|
+
Related gallery: [resources-panel](https://minifish-org.github.io/pith-ui/?item=resources-panel).
|
|
891
|
+
|
|
892
|
+
### ArtifactPanelOptions
|
|
893
|
+
|
|
894
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/files/panels.ts#L32)
|
|
895
|
+
|
|
896
|
+
```ts
|
|
897
|
+
export interface ArtifactPanelOptions {
|
|
898
|
+
container: HTMLElement;
|
|
899
|
+
control: HTMLElement;
|
|
900
|
+
toggle: HTMLElement;
|
|
901
|
+
count: HTMLElement;
|
|
902
|
+
headingId?: string;
|
|
903
|
+
dismissExclusions?: readonly HTMLElement[];
|
|
904
|
+
}
|
|
905
|
+
```
|
|
906
|
+
|
|
907
|
+
### ArtifactPanelState
|
|
908
|
+
|
|
909
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/files/panels.ts#L31)
|
|
910
|
+
|
|
911
|
+
```ts
|
|
912
|
+
export interface ArtifactPanelState {
|
|
913
|
+
ownerId: string;
|
|
914
|
+
files: readonly {
|
|
915
|
+
name: string;
|
|
916
|
+
path: string;
|
|
917
|
+
}[];
|
|
918
|
+
loading: boolean;
|
|
919
|
+
error: string;
|
|
920
|
+
copyMode: 'file' | 'path';
|
|
921
|
+
}
|
|
922
|
+
```
|
|
923
|
+
|
|
924
|
+
### FileActionOptions
|
|
925
|
+
|
|
926
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/files/panels.ts#L7)
|
|
927
|
+
|
|
928
|
+
```ts
|
|
929
|
+
export interface FileActionOptions {
|
|
930
|
+
kind: string;
|
|
931
|
+
ownerId: string;
|
|
932
|
+
path: string;
|
|
933
|
+
preview?: boolean;
|
|
934
|
+
copyMode?: 'file' | 'path' | 'none';
|
|
935
|
+
onAction?: (action: 'preview' | 'open' | 'reveal' | 'copy' | 'copy-path') => void;
|
|
936
|
+
}
|
|
937
|
+
```
|
|
938
|
+
|
|
939
|
+
### fileActionsMarkup
|
|
940
|
+
|
|
941
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/files/panels.ts#L12)
|
|
942
|
+
|
|
943
|
+
```ts
|
|
944
|
+
export declare function fileActionsMarkup(options: FileActionOptions): string;
|
|
945
|
+
```
|
|
946
|
+
|
|
947
|
+
Referenced public types and APIs: [`FileActionOptions`](#fileactionoptions).
|
|
948
|
+
|
|
949
|
+
### FilePreviewOptions
|
|
950
|
+
|
|
951
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/files/panels.ts#L178)
|
|
952
|
+
|
|
953
|
+
```ts
|
|
954
|
+
export interface FilePreviewOptions {
|
|
955
|
+
container?: HTMLElement;
|
|
956
|
+
titleId?: string;
|
|
957
|
+
dialogId?: string;
|
|
958
|
+
bodyId?: string;
|
|
959
|
+
onClose?: () => void;
|
|
960
|
+
}
|
|
961
|
+
```
|
|
962
|
+
|
|
963
|
+
### FilePreviewState
|
|
964
|
+
|
|
965
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/files/panels.ts#L177)
|
|
966
|
+
|
|
967
|
+
```ts
|
|
968
|
+
export interface FilePreviewState {
|
|
969
|
+
kind: PreviewKind | 'image';
|
|
970
|
+
text?: string;
|
|
971
|
+
imageSrc?: string;
|
|
972
|
+
imageAlt?: string;
|
|
973
|
+
truncated?: boolean;
|
|
974
|
+
error?: string;
|
|
975
|
+
}
|
|
976
|
+
```
|
|
977
|
+
|
|
978
|
+
Referenced public types and APIs: [`PreviewKind`](#previewkind).
|
|
979
|
+
|
|
980
|
+
### ResourceDisplayEntry
|
|
981
|
+
|
|
982
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/files/panels.ts#L99)
|
|
983
|
+
|
|
984
|
+
```ts
|
|
985
|
+
export interface ResourceDisplayEntry {
|
|
986
|
+
name: string;
|
|
987
|
+
path: string;
|
|
988
|
+
description?: string;
|
|
989
|
+
content?: string;
|
|
990
|
+
fileActions?: Node;
|
|
991
|
+
actions?: Node;
|
|
992
|
+
}
|
|
993
|
+
```
|
|
994
|
+
|
|
995
|
+
### ResourcesPanelOptions
|
|
996
|
+
|
|
997
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/files/panels.ts#L104)
|
|
998
|
+
|
|
999
|
+
```ts
|
|
1000
|
+
export interface ResourcesPanelOptions {
|
|
1001
|
+
container?: HTMLElement;
|
|
1002
|
+
titleId?: string;
|
|
1003
|
+
dialogId?: string;
|
|
1004
|
+
listId?: string;
|
|
1005
|
+
errorId?: string;
|
|
1006
|
+
onClose?: () => void;
|
|
1007
|
+
onRefresh?: () => void;
|
|
1008
|
+
onCreate?: (kind: 'instructions' | 'skill' | 'template') => void;
|
|
1009
|
+
}
|
|
1010
|
+
```
|
|
1011
|
+
|
|
1012
|
+
### ResourcesPanelState
|
|
1013
|
+
|
|
1014
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/files/panels.ts#L100)
|
|
1015
|
+
|
|
1016
|
+
```ts
|
|
1017
|
+
export interface ResourcesPanelState {
|
|
1018
|
+
instructions: readonly ResourceDisplayEntry[];
|
|
1019
|
+
skills: readonly ResourceDisplayEntry[];
|
|
1020
|
+
templates: readonly ResourceDisplayEntry[];
|
|
1021
|
+
diagnostics: readonly string[];
|
|
1022
|
+
createInstructions?: Node;
|
|
1023
|
+
canCreateInstructions?: boolean;
|
|
1024
|
+
}
|
|
1025
|
+
```
|
|
1026
|
+
|
|
1027
|
+
Referenced public types and APIs: [`ResourceDisplayEntry`](#resourcedisplayentry).
|
|
1028
|
+
|
|
1029
|
+
## src/files/systems.ts
|
|
1030
|
+
|
|
1031
|
+
### createCompletionNotices
|
|
1032
|
+
|
|
1033
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/files/systems.ts#L123)
|
|
1034
|
+
|
|
1035
|
+
```ts
|
|
1036
|
+
export declare function createCompletionNotices(options?: {
|
|
1037
|
+
container?: HTMLElement;
|
|
1038
|
+
onOpen?: (id: string) => void;
|
|
1039
|
+
onDismiss?: (runID: string) => void;
|
|
1040
|
+
}): UIBlock<readonly CompletionNoticeDisplay[]>;
|
|
1041
|
+
```
|
|
1042
|
+
|
|
1043
|
+
Referenced public types and APIs: [`CompletionNoticeDisplay`](#completionnoticedisplay), [`UIBlock`](#uiblock).
|
|
1044
|
+
|
|
1045
|
+
Related gallery: [completion-notices](https://minifish-org.github.io/pith-ui/?item=completion-notices).
|
|
1046
|
+
|
|
1047
|
+
### createCopyFeedback
|
|
1048
|
+
|
|
1049
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/files/systems.ts#L166)
|
|
1050
|
+
|
|
1051
|
+
```ts
|
|
1052
|
+
export declare function createCopyFeedback(options: {
|
|
1053
|
+
status: HTMLElement;
|
|
1054
|
+
isDisabled: (button: HTMLButtonElement) => boolean;
|
|
1055
|
+
onError: (error: unknown) => void;
|
|
1056
|
+
}): {
|
|
1057
|
+
copy(button: HTMLButtonElement, action: () => Promise<void>, announcement: string): Promise<void>;
|
|
1058
|
+
destroy(): void;
|
|
1059
|
+
};
|
|
1060
|
+
```
|
|
1061
|
+
|
|
1062
|
+
Related gallery: [copy-feedback](https://minifish-org.github.io/pith-ui/?item=copy-feedback).
|
|
1063
|
+
|
|
1064
|
+
### createCostLedger
|
|
1065
|
+
|
|
1066
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/files/systems.ts#L23)
|
|
1067
|
+
|
|
1068
|
+
```ts
|
|
1069
|
+
export declare function createCostLedger(options?: {
|
|
1070
|
+
container?: HTMLElement;
|
|
1071
|
+
}): {
|
|
1072
|
+
element: HTMLElement;
|
|
1073
|
+
clear(): void;
|
|
1074
|
+
loading(): void;
|
|
1075
|
+
setError(message: string): void;
|
|
1076
|
+
update(report: Readonly<CostLedgerState>): void;
|
|
1077
|
+
destroy(): void;
|
|
1078
|
+
};
|
|
1079
|
+
```
|
|
1080
|
+
|
|
1081
|
+
Referenced public types and APIs: [`CostLedgerState`](#costledgerstate).
|
|
1082
|
+
|
|
1083
|
+
Related gallery: [cost-ledger](https://minifish-org.github.io/pith-ui/?item=cost-ledger).
|
|
1084
|
+
|
|
1085
|
+
### createUpdatePanel
|
|
1086
|
+
|
|
1087
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/files/systems.ts#L82)
|
|
1088
|
+
|
|
1089
|
+
```ts
|
|
1090
|
+
export declare function createUpdatePanel(options?: {
|
|
1091
|
+
container?: HTMLElement;
|
|
1092
|
+
productName?: string;
|
|
1093
|
+
onCheck?: () => void;
|
|
1094
|
+
onInstall?: () => void;
|
|
1095
|
+
}): {
|
|
1096
|
+
element: HTMLElement;
|
|
1097
|
+
update(value: Readonly<UpdatePanelState>): void;
|
|
1098
|
+
setPending(value: boolean): void;
|
|
1099
|
+
setError(value: string, options?: {
|
|
1100
|
+
allowCheckRetry?: boolean;
|
|
1101
|
+
}): void;
|
|
1102
|
+
destroy(): void;
|
|
1103
|
+
};
|
|
1104
|
+
```
|
|
1105
|
+
|
|
1106
|
+
Referenced public types and APIs: [`UpdatePanelState`](#updatepanelstate).
|
|
1107
|
+
|
|
1108
|
+
Related gallery: [settings-panel](https://minifish-org.github.io/pith-ui/?item=settings-panel), [updates](https://minifish-org.github.io/pith-ui/?item=updates).
|
|
1109
|
+
|
|
1110
|
+
### CompletionNoticeDisplay
|
|
1111
|
+
|
|
1112
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/files/systems.ts#L116)
|
|
1113
|
+
|
|
1114
|
+
```ts
|
|
1115
|
+
export interface CompletionNoticeDisplay {
|
|
1116
|
+
id: string;
|
|
1117
|
+
runID: string;
|
|
1118
|
+
title: string;
|
|
1119
|
+
workspace: string;
|
|
1120
|
+
}
|
|
1121
|
+
```
|
|
1122
|
+
|
|
1123
|
+
Related gallery: [completion-notices](https://minifish-org.github.io/pith-ui/?item=completion-notices).
|
|
1124
|
+
|
|
1125
|
+
### CostLedgerState
|
|
1126
|
+
|
|
1127
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/files/systems.ts#L22)
|
|
1128
|
+
|
|
1129
|
+
```ts
|
|
1130
|
+
export interface CostLedgerState {
|
|
1131
|
+
unknownRequests: number;
|
|
1132
|
+
requests: readonly CostRequestDisplay[] | null;
|
|
1133
|
+
}
|
|
1134
|
+
```
|
|
1135
|
+
|
|
1136
|
+
Referenced public types and APIs: [`CostRequestDisplay`](#costrequestdisplay).
|
|
1137
|
+
|
|
1138
|
+
### CostRequestDisplay
|
|
1139
|
+
|
|
1140
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/files/systems.ts#L17)
|
|
1141
|
+
|
|
1142
|
+
```ts
|
|
1143
|
+
export interface CostRequestDisplay {
|
|
1144
|
+
id: string;
|
|
1145
|
+
purpose: string;
|
|
1146
|
+
status: string;
|
|
1147
|
+
provider: string;
|
|
1148
|
+
providerName?: string;
|
|
1149
|
+
model: string;
|
|
1150
|
+
modelName?: string;
|
|
1151
|
+
time: string;
|
|
1152
|
+
source: string;
|
|
1153
|
+
price: unknown;
|
|
1154
|
+
known: boolean;
|
|
1155
|
+
usage: {
|
|
1156
|
+
input: number;
|
|
1157
|
+
output: number;
|
|
1158
|
+
cacheRead: number;
|
|
1159
|
+
cacheWrite: number;
|
|
1160
|
+
reasoning?: number;
|
|
1161
|
+
cost: {
|
|
1162
|
+
total: number;
|
|
1163
|
+
};
|
|
1164
|
+
};
|
|
1165
|
+
}
|
|
1166
|
+
```
|
|
1167
|
+
|
|
1168
|
+
### CostSummaryDisplay
|
|
1169
|
+
|
|
1170
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/files/systems.ts#L8)
|
|
1171
|
+
|
|
1172
|
+
```ts
|
|
1173
|
+
export interface CostSummaryDisplay {
|
|
1174
|
+
unavailable?: boolean;
|
|
1175
|
+
requestCount: number;
|
|
1176
|
+
unknownRequests: number;
|
|
1177
|
+
runRequests: number;
|
|
1178
|
+
runUnknownRequests: number;
|
|
1179
|
+
total: number;
|
|
1180
|
+
runTotal: number;
|
|
1181
|
+
}
|
|
1182
|
+
```
|
|
1183
|
+
|
|
1184
|
+
### formatCost
|
|
1185
|
+
|
|
1186
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/files/systems.ts#L9)
|
|
1187
|
+
|
|
1188
|
+
```ts
|
|
1189
|
+
export declare function formatCost(cost: CostSummaryDisplay | undefined, latestTask?: boolean): string;
|
|
1190
|
+
```
|
|
1191
|
+
|
|
1192
|
+
Referenced public types and APIs: [`CostSummaryDisplay`](#costsummarydisplay).
|
|
1193
|
+
|
|
1194
|
+
### historyStatusMarkup
|
|
1195
|
+
|
|
1196
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/files/systems.ts#L117)
|
|
1197
|
+
|
|
1198
|
+
```ts
|
|
1199
|
+
export declare function historyStatusMarkup(status: 'approval' | 'running' | 'unread' | 'idle'): string;
|
|
1200
|
+
```
|
|
1201
|
+
|
|
1202
|
+
Related gallery: [completion-notices](https://minifish-org.github.io/pith-ui/?item=completion-notices).
|
|
1203
|
+
|
|
1204
|
+
### UpdatePanelState
|
|
1205
|
+
|
|
1206
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/files/systems.ts#L81)
|
|
1207
|
+
|
|
1208
|
+
```ts
|
|
1209
|
+
export interface UpdatePanelState {
|
|
1210
|
+
version: string;
|
|
1211
|
+
enabled: boolean;
|
|
1212
|
+
phase: string;
|
|
1213
|
+
availableVersion: string;
|
|
1214
|
+
progress: number;
|
|
1215
|
+
message: string;
|
|
1216
|
+
}
|
|
1217
|
+
```
|
|
1218
|
+
|
|
1219
|
+
## src/forms/actions.ts
|
|
1220
|
+
|
|
1221
|
+
### createProviderActions
|
|
1222
|
+
|
|
1223
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/actions.ts#L28)
|
|
1224
|
+
|
|
1225
|
+
```ts
|
|
1226
|
+
export declare function createProviderActions(state: ProviderActionsState, options?: FeatureActionOptions): UIBlock<ProviderActionsState>;
|
|
1227
|
+
```
|
|
1228
|
+
|
|
1229
|
+
Referenced public types and APIs: [`FeatureActionOptions`](#featureactionoptions), [`ProviderActionsState`](#provideractionsstate), [`UIBlock`](#uiblock).
|
|
1230
|
+
|
|
1231
|
+
Related gallery: [provider-resource-actions](https://minifish-org.github.io/pith-ui/?item=provider-resource-actions).
|
|
1232
|
+
|
|
1233
|
+
### createResourceActions
|
|
1234
|
+
|
|
1235
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/actions.ts#L29)
|
|
1236
|
+
|
|
1237
|
+
```ts
|
|
1238
|
+
export declare function createResourceActions(state: ResourceActionsState, options?: FeatureActionOptions): UIBlock<ResourceActionsState>;
|
|
1239
|
+
```
|
|
1240
|
+
|
|
1241
|
+
Referenced public types and APIs: [`FeatureActionOptions`](#featureactionoptions), [`ResourceActionsState`](#resourceactionsstate), [`UIBlock`](#uiblock).
|
|
1242
|
+
|
|
1243
|
+
Related gallery: [provider-resource-actions](https://minifish-org.github.io/pith-ui/?item=provider-resource-actions), [resources-panel](https://minifish-org.github.io/pith-ui/?item=resources-panel).
|
|
1244
|
+
|
|
1245
|
+
### FeatureActionOptions
|
|
1246
|
+
|
|
1247
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/actions.ts#L11)
|
|
1248
|
+
|
|
1249
|
+
```ts
|
|
1250
|
+
export interface FeatureActionOptions {
|
|
1251
|
+
onAction?: (action: string, target: DOMStringMap) => ReturnType<UIAction>;
|
|
1252
|
+
onError?: (message: string) => void;
|
|
1253
|
+
}
|
|
1254
|
+
```
|
|
1255
|
+
|
|
1256
|
+
Referenced public types and APIs: [`UIAction`](#uiaction).
|
|
1257
|
+
|
|
1258
|
+
### providerActionsMarkup
|
|
1259
|
+
|
|
1260
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/actions.ts#L6)
|
|
1261
|
+
|
|
1262
|
+
```ts
|
|
1263
|
+
export declare function providerActionsMarkup(provider: ProviderActionsState): string;
|
|
1264
|
+
```
|
|
1265
|
+
|
|
1266
|
+
Referenced public types and APIs: [`ProviderActionsState`](#provideractionsstate).
|
|
1267
|
+
|
|
1268
|
+
### ProviderActionsState
|
|
1269
|
+
|
|
1270
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/actions.ts#L4)
|
|
1271
|
+
|
|
1272
|
+
```ts
|
|
1273
|
+
export interface ProviderActionsState {
|
|
1274
|
+
id: string;
|
|
1275
|
+
oauth: boolean;
|
|
1276
|
+
signedIn: boolean;
|
|
1277
|
+
custom: boolean;
|
|
1278
|
+
}
|
|
1279
|
+
```
|
|
1280
|
+
|
|
1281
|
+
### resourceActionsMarkup
|
|
1282
|
+
|
|
1283
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/actions.ts#L7)
|
|
1284
|
+
|
|
1285
|
+
```ts
|
|
1286
|
+
export declare function resourceActionsMarkup(kind: string, resource: {
|
|
1287
|
+
name: string;
|
|
1288
|
+
path: string;
|
|
1289
|
+
}, workspaceId: string): string;
|
|
1290
|
+
```
|
|
1291
|
+
|
|
1292
|
+
### ResourceActionsState
|
|
1293
|
+
|
|
1294
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/actions.ts#L5)
|
|
1295
|
+
|
|
1296
|
+
```ts
|
|
1297
|
+
export interface ResourceActionsState {
|
|
1298
|
+
kind: string;
|
|
1299
|
+
resource: {
|
|
1300
|
+
name: string;
|
|
1301
|
+
path: string;
|
|
1302
|
+
};
|
|
1303
|
+
workspaceId: string;
|
|
1304
|
+
}
|
|
1305
|
+
```
|
|
1306
|
+
|
|
1307
|
+
## src/forms/custom-connection.ts
|
|
1308
|
+
|
|
1309
|
+
### createCustomConnectionEditor
|
|
1310
|
+
|
|
1311
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/custom-connection.ts#L28)
|
|
1312
|
+
|
|
1313
|
+
```ts
|
|
1314
|
+
export declare function createCustomConnectionEditor(state: CustomConnectionState, options?: {
|
|
1315
|
+
idPrefix?: string;
|
|
1316
|
+
onSubmit?: (draft: CustomConnectionDraft) => ActionResult | Promise<ActionResult>;
|
|
1317
|
+
}): UIBlock<CustomConnectionState> & {
|
|
1318
|
+
read(): CustomConnectionDraft;
|
|
1319
|
+
readonly form: HTMLFormElement;
|
|
1320
|
+
};
|
|
1321
|
+
```
|
|
1322
|
+
|
|
1323
|
+
Referenced public types and APIs: [`ActionResult`](#actionresult), [`CustomConnectionDraft`](#customconnectiondraft), [`CustomConnectionState`](#customconnectionstate), [`UIBlock`](#uiblock).
|
|
1324
|
+
|
|
1325
|
+
Related gallery: [custom-connection](https://minifish-org.github.io/pith-ui/?item=custom-connection).
|
|
1326
|
+
|
|
1327
|
+
### createCustomModelRow
|
|
1328
|
+
|
|
1329
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/custom-connection.ts#L12)
|
|
1330
|
+
|
|
1331
|
+
```ts
|
|
1332
|
+
export declare function createCustomModelRow(model: CustomModelRowState, index?: number): UIBlock<CustomModelRowState> & {
|
|
1333
|
+
read(): CustomModelDraft;
|
|
1334
|
+
reset(model: CustomModelValue): void;
|
|
1335
|
+
};
|
|
1336
|
+
```
|
|
1337
|
+
|
|
1338
|
+
Referenced public types and APIs: [`CustomModelDraft`](#custommodeldraft), [`CustomModelRowState`](#custommodelrowstate), [`CustomModelValue`](#custommodelvalue), [`UIBlock`](#uiblock).
|
|
1339
|
+
|
|
1340
|
+
Related gallery: [custom-connection](https://minifish-org.github.io/pith-ui/?item=custom-connection), [provider-resource-actions](https://minifish-org.github.io/pith-ui/?item=provider-resource-actions), [settings-panel](https://minifish-org.github.io/pith-ui/?item=settings-panel).
|
|
1341
|
+
|
|
1342
|
+
### CustomConnectionDraft
|
|
1343
|
+
|
|
1344
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/custom-connection.ts#L8)
|
|
1345
|
+
|
|
1346
|
+
```ts
|
|
1347
|
+
export interface CustomConnectionDraft {
|
|
1348
|
+
name: string;
|
|
1349
|
+
baseUrl: string;
|
|
1350
|
+
api: string;
|
|
1351
|
+
apiKey: string;
|
|
1352
|
+
models: CustomModelDraft[];
|
|
1353
|
+
}
|
|
1354
|
+
```
|
|
1355
|
+
|
|
1356
|
+
Referenced public types and APIs: [`CustomModelDraft`](#custommodeldraft).
|
|
1357
|
+
|
|
1358
|
+
### CustomConnectionState
|
|
1359
|
+
|
|
1360
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/custom-connection.ts#L6)
|
|
1361
|
+
|
|
1362
|
+
```ts
|
|
1363
|
+
export interface CustomConnectionState {
|
|
1364
|
+
name: string;
|
|
1365
|
+
baseUrl: string;
|
|
1366
|
+
api: string;
|
|
1367
|
+
editing: boolean;
|
|
1368
|
+
models: readonly CustomModelValue[];
|
|
1369
|
+
error?: string;
|
|
1370
|
+
disabled?: boolean;
|
|
1371
|
+
}
|
|
1372
|
+
```
|
|
1373
|
+
|
|
1374
|
+
Referenced public types and APIs: [`CustomModelValue`](#custommodelvalue).
|
|
1375
|
+
|
|
1376
|
+
### CustomModelDraft
|
|
1377
|
+
|
|
1378
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/custom-connection.ts#L7)
|
|
1379
|
+
|
|
1380
|
+
```ts
|
|
1381
|
+
export interface CustomModelDraft {
|
|
1382
|
+
sourceIndex: number;
|
|
1383
|
+
id: string;
|
|
1384
|
+
name: string;
|
|
1385
|
+
contextWindow: number;
|
|
1386
|
+
maxTokens: number;
|
|
1387
|
+
reasoning: boolean;
|
|
1388
|
+
images: boolean;
|
|
1389
|
+
prices: {
|
|
1390
|
+
input: string;
|
|
1391
|
+
output: string;
|
|
1392
|
+
cacheRead: string;
|
|
1393
|
+
cacheWrite: string;
|
|
1394
|
+
};
|
|
1395
|
+
}
|
|
1396
|
+
```
|
|
1397
|
+
|
|
1398
|
+
### CustomModelRowState
|
|
1399
|
+
|
|
1400
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/custom-connection.ts#L11)
|
|
1401
|
+
|
|
1402
|
+
```ts
|
|
1403
|
+
export interface CustomModelRowState extends CustomModelValue {
|
|
1404
|
+
disabled?: boolean;
|
|
1405
|
+
error?: string;
|
|
1406
|
+
}
|
|
1407
|
+
```
|
|
1408
|
+
|
|
1409
|
+
Referenced public types and APIs: [`CustomModelValue`](#custommodelvalue).
|
|
1410
|
+
|
|
1411
|
+
### CustomModelValue
|
|
1412
|
+
|
|
1413
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/custom-connection.ts#L5)
|
|
1414
|
+
|
|
1415
|
+
```ts
|
|
1416
|
+
export interface CustomModelValue {
|
|
1417
|
+
id: string;
|
|
1418
|
+
name?: string;
|
|
1419
|
+
contextWindow?: number;
|
|
1420
|
+
maxTokens?: number;
|
|
1421
|
+
reasoning?: boolean;
|
|
1422
|
+
input?: readonly string[];
|
|
1423
|
+
cost?: {
|
|
1424
|
+
input: number;
|
|
1425
|
+
output: number;
|
|
1426
|
+
cacheRead: number;
|
|
1427
|
+
cacheWrite: number;
|
|
1428
|
+
};
|
|
1429
|
+
}
|
|
1430
|
+
```
|
|
1431
|
+
|
|
1432
|
+
## src/forms/dialog-frame.ts
|
|
1433
|
+
|
|
1434
|
+
### createFeatureDialogFrame
|
|
1435
|
+
|
|
1436
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/dialog-frame.ts#L10)
|
|
1437
|
+
|
|
1438
|
+
```ts
|
|
1439
|
+
export declare function createFeatureDialogFrame(options?: FeatureDialogOptions): UIBlock<FeatureDialogState> & {
|
|
1440
|
+
open(state: FeatureDialogState): void;
|
|
1441
|
+
close(): void;
|
|
1442
|
+
fail(message: string): void;
|
|
1443
|
+
isOpen(): boolean;
|
|
1444
|
+
};
|
|
1445
|
+
```
|
|
1446
|
+
|
|
1447
|
+
Referenced public types and APIs: [`FeatureDialogOptions`](#featuredialogoptions), [`FeatureDialogState`](#featuredialogstate), [`UIBlock`](#uiblock).
|
|
1448
|
+
|
|
1449
|
+
Related gallery: [feature-dialog](https://minifish-org.github.io/pith-ui/?item=feature-dialog).
|
|
1450
|
+
|
|
1451
|
+
### createFeatureStatus
|
|
1452
|
+
|
|
1453
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/dialog-frame.ts#L57)
|
|
1454
|
+
|
|
1455
|
+
```ts
|
|
1456
|
+
export declare function createFeatureStatus(state: {
|
|
1457
|
+
message: string;
|
|
1458
|
+
error?: boolean;
|
|
1459
|
+
}): UIBlock<{
|
|
1460
|
+
message: string;
|
|
1461
|
+
error?: boolean;
|
|
1462
|
+
}>;
|
|
1463
|
+
```
|
|
1464
|
+
|
|
1465
|
+
Referenced public types and APIs: [`UIBlock`](#uiblock).
|
|
1466
|
+
|
|
1467
|
+
Related gallery: [feature-dialog](https://minifish-org.github.io/pith-ui/?item=feature-dialog).
|
|
1468
|
+
|
|
1469
|
+
### createSDKDialogElements
|
|
1470
|
+
|
|
1471
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/dialog-frame.ts#L63)
|
|
1472
|
+
|
|
1473
|
+
```ts
|
|
1474
|
+
export declare function createSDKDialogElements(options?: {
|
|
1475
|
+
idPrefix?: string;
|
|
1476
|
+
}): {
|
|
1477
|
+
dialog: HTMLDialogElement;
|
|
1478
|
+
content: HTMLElement;
|
|
1479
|
+
oauthDialog: HTMLDialogElement;
|
|
1480
|
+
oauthContent: HTMLElement;
|
|
1481
|
+
destroy(): void;
|
|
1482
|
+
};
|
|
1483
|
+
```
|
|
1484
|
+
|
|
1485
|
+
Related gallery: [feature-dialog](https://minifish-org.github.io/pith-ui/?item=feature-dialog).
|
|
1486
|
+
|
|
1487
|
+
### DialogContent
|
|
1488
|
+
|
|
1489
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/dialog-frame.ts#L7)
|
|
1490
|
+
|
|
1491
|
+
```ts
|
|
1492
|
+
export interface DialogContent {
|
|
1493
|
+
element: HTMLElement;
|
|
1494
|
+
destroy(): void;
|
|
1495
|
+
}
|
|
1496
|
+
```
|
|
1497
|
+
|
|
1498
|
+
### FeatureDialogOptions
|
|
1499
|
+
|
|
1500
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/dialog-frame.ts#L9)
|
|
1501
|
+
|
|
1502
|
+
```ts
|
|
1503
|
+
export interface FeatureDialogOptions {
|
|
1504
|
+
dialog?: HTMLDialogElement;
|
|
1505
|
+
content?: HTMLElement;
|
|
1506
|
+
dialogId?: string;
|
|
1507
|
+
titleId?: string;
|
|
1508
|
+
errorId?: string;
|
|
1509
|
+
eyebrow?: string;
|
|
1510
|
+
onClose?: () => void;
|
|
1511
|
+
}
|
|
1512
|
+
```
|
|
1513
|
+
|
|
1514
|
+
### FeatureDialogState
|
|
1515
|
+
|
|
1516
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/dialog-frame.ts#L8)
|
|
1517
|
+
|
|
1518
|
+
```ts
|
|
1519
|
+
export interface FeatureDialogState {
|
|
1520
|
+
title: string;
|
|
1521
|
+
body: Node | DialogContent;
|
|
1522
|
+
}
|
|
1523
|
+
```
|
|
1524
|
+
|
|
1525
|
+
Referenced public types and APIs: [`DialogContent`](#dialogcontent).
|
|
1526
|
+
|
|
1527
|
+
## src/forms/history.ts
|
|
1528
|
+
|
|
1529
|
+
### createBranchHistory
|
|
1530
|
+
|
|
1531
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/history.ts#L5)
|
|
1532
|
+
|
|
1533
|
+
```ts
|
|
1534
|
+
export declare function createBranchHistory(state: BranchHistoryState, options?: {
|
|
1535
|
+
onContinue?: (id: string) => void | Promise<void>;
|
|
1536
|
+
}): UIBlock<BranchHistoryState>;
|
|
1537
|
+
```
|
|
1538
|
+
|
|
1539
|
+
Referenced public types and APIs: [`BranchHistoryState`](#branchhistorystate), [`UIBlock`](#uiblock).
|
|
1540
|
+
|
|
1541
|
+
Related gallery: [branch-history](https://minifish-org.github.io/pith-ui/?item=branch-history).
|
|
1542
|
+
|
|
1543
|
+
### BranchHistoryNode
|
|
1544
|
+
|
|
1545
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/history.ts#L3)
|
|
1546
|
+
|
|
1547
|
+
```ts
|
|
1548
|
+
export interface BranchHistoryNode {
|
|
1549
|
+
id: string;
|
|
1550
|
+
role: string;
|
|
1551
|
+
text: string;
|
|
1552
|
+
active: boolean;
|
|
1553
|
+
}
|
|
1554
|
+
```
|
|
1555
|
+
|
|
1556
|
+
### BranchHistoryState
|
|
1557
|
+
|
|
1558
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/history.ts#L4)
|
|
1559
|
+
|
|
1560
|
+
```ts
|
|
1561
|
+
export interface BranchHistoryState {
|
|
1562
|
+
nodes: readonly BranchHistoryNode[] | null;
|
|
1563
|
+
error?: string;
|
|
1564
|
+
loading?: boolean;
|
|
1565
|
+
}
|
|
1566
|
+
```
|
|
1567
|
+
|
|
1568
|
+
Referenced public types and APIs: [`BranchHistoryNode`](#branchhistorynode).
|
|
1569
|
+
|
|
1570
|
+
## src/forms/model-editor.ts
|
|
1571
|
+
|
|
1572
|
+
### createModelEditor
|
|
1573
|
+
|
|
1574
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/model-editor.ts#L37)
|
|
1575
|
+
|
|
1576
|
+
```ts
|
|
1577
|
+
export declare function createModelEditor(initial: ModelEditorState, options?: {
|
|
1578
|
+
prefix?: string;
|
|
1579
|
+
element?: HTMLElement;
|
|
1580
|
+
onChange?: (selection: ModelSelection) => void;
|
|
1581
|
+
}): ModelEditorBlock;
|
|
1582
|
+
```
|
|
1583
|
+
|
|
1584
|
+
Referenced public types and APIs: [`ModelEditorBlock`](#modeleditorblock), [`ModelEditorState`](#modeleditorstate), [`ModelSelection`](#modelselection).
|
|
1585
|
+
|
|
1586
|
+
Related gallery: [model-picker](https://minifish-org.github.io/pith-ui/?item=model-picker).
|
|
1587
|
+
|
|
1588
|
+
### ModelEditorBlock
|
|
1589
|
+
|
|
1590
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/model-editor.ts#L30)
|
|
1591
|
+
|
|
1592
|
+
```ts
|
|
1593
|
+
export interface ModelEditorBlock extends UIBlock<ModelEditorState> {
|
|
1594
|
+
read(): ModelSelection;
|
|
1595
|
+
reset(selection: ModelSelection): void;
|
|
1596
|
+
focus(): void;
|
|
1597
|
+
}
|
|
1598
|
+
```
|
|
1599
|
+
|
|
1600
|
+
Referenced public types and APIs: [`ModelEditorState`](#modeleditorstate), [`ModelSelection`](#modelselection), [`UIBlock`](#uiblock).
|
|
1601
|
+
|
|
1602
|
+
### modelEditorMarkup
|
|
1603
|
+
|
|
1604
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/model-editor.ts#L36)
|
|
1605
|
+
|
|
1606
|
+
```ts
|
|
1607
|
+
export declare function modelEditorMarkup(prefix: string): string;
|
|
1608
|
+
```
|
|
1609
|
+
|
|
1610
|
+
### ModelEditorState
|
|
1611
|
+
|
|
1612
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/model-editor.ts#L19)
|
|
1613
|
+
|
|
1614
|
+
```ts
|
|
1615
|
+
export interface ModelEditorState {
|
|
1616
|
+
providers: readonly ModelProviderOption[] | null;
|
|
1617
|
+
models: readonly ModelOption[] | null;
|
|
1618
|
+
selection: ModelSelection;
|
|
1619
|
+
disabled?: boolean;
|
|
1620
|
+
}
|
|
1621
|
+
```
|
|
1622
|
+
|
|
1623
|
+
Referenced public types and APIs: [`ModelOption`](#modeloption), [`ModelProviderOption`](#modelprovideroption), [`ModelSelection`](#modelselection).
|
|
1624
|
+
|
|
1625
|
+
### ModelOption
|
|
1626
|
+
|
|
1627
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/model-editor.ts#L10)
|
|
1628
|
+
|
|
1629
|
+
```ts
|
|
1630
|
+
export interface ModelOption {
|
|
1631
|
+
id: string;
|
|
1632
|
+
name: string;
|
|
1633
|
+
provider: string;
|
|
1634
|
+
thinkingLevels?: readonly string[] | null;
|
|
1635
|
+
supportsImages: boolean;
|
|
1636
|
+
contextWindow: number;
|
|
1637
|
+
maxTokens: number;
|
|
1638
|
+
}
|
|
1639
|
+
```
|
|
1640
|
+
|
|
1641
|
+
### ModelProviderOption
|
|
1642
|
+
|
|
1643
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/model-editor.ts#L4)
|
|
1644
|
+
|
|
1645
|
+
```ts
|
|
1646
|
+
export interface ModelProviderOption {
|
|
1647
|
+
id: string;
|
|
1648
|
+
name: string;
|
|
1649
|
+
model?: string;
|
|
1650
|
+
thinkingLevel?: string;
|
|
1651
|
+
}
|
|
1652
|
+
```
|
|
1653
|
+
|
|
1654
|
+
### ModelSelection
|
|
1655
|
+
|
|
1656
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/model-editor.ts#L25)
|
|
1657
|
+
|
|
1658
|
+
```ts
|
|
1659
|
+
export interface ModelSelection {
|
|
1660
|
+
provider: string;
|
|
1661
|
+
model: string;
|
|
1662
|
+
thinkingLevel: string;
|
|
1663
|
+
}
|
|
1664
|
+
```
|
|
1665
|
+
|
|
1666
|
+
### thinkingLabel
|
|
1667
|
+
|
|
1668
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/model-editor.ts#L35)
|
|
1669
|
+
|
|
1670
|
+
```ts
|
|
1671
|
+
export declare function thinkingLabel(level: string): string;
|
|
1672
|
+
```
|
|
1673
|
+
|
|
1674
|
+
## src/forms/panels.ts
|
|
1675
|
+
|
|
1676
|
+
### createMCPConnectionList
|
|
1677
|
+
|
|
1678
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/panels.ts#L191)
|
|
1679
|
+
|
|
1680
|
+
```ts
|
|
1681
|
+
export declare function createMCPConnectionList(initial: MCPConnectionListState): UIBlock<MCPConnectionListState>;
|
|
1682
|
+
```
|
|
1683
|
+
|
|
1684
|
+
Referenced public types and APIs: [`MCPConnectionListState`](#mcpconnectionliststate), [`UIBlock`](#uiblock).
|
|
1685
|
+
|
|
1686
|
+
Related gallery: [mcp-connections](https://minifish-org.github.io/pith-ui/?item=mcp-connections).
|
|
1687
|
+
|
|
1688
|
+
### createMCPConnectionsPanel
|
|
1689
|
+
|
|
1690
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/panels.ts#L138)
|
|
1691
|
+
|
|
1692
|
+
```ts
|
|
1693
|
+
export declare function createMCPConnectionsPanel(state?: MCPConnectionsState, options?: FormOptions & {
|
|
1694
|
+
onSubmit?: (draft: MCPConnectionDraft) => ActionResult | Promise<ActionResult>;
|
|
1695
|
+
}): MCPConnectionsPanel;
|
|
1696
|
+
```
|
|
1697
|
+
|
|
1698
|
+
Referenced public types and APIs: [`ActionResult`](#actionresult), [`FormOptions`](#formoptions), [`MCPConnectionDraft`](#mcpconnectiondraft), [`MCPConnectionsPanel`](#mcpconnectionspanel), [`MCPConnectionsState`](#mcpconnectionsstate).
|
|
1699
|
+
|
|
1700
|
+
Related gallery: [mcp-connections](https://minifish-org.github.io/pith-ui/?item=mcp-connections).
|
|
1701
|
+
|
|
1702
|
+
### createModelPicker
|
|
1703
|
+
|
|
1704
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/panels.ts#L174)
|
|
1705
|
+
|
|
1706
|
+
```ts
|
|
1707
|
+
export declare function createModelPicker(state?: ModelPickerState, options?: FormOptions & {
|
|
1708
|
+
onSubmit?: (selection: ModelSelection) => ActionResult | Promise<ActionResult>;
|
|
1709
|
+
}): ModelPicker;
|
|
1710
|
+
```
|
|
1711
|
+
|
|
1712
|
+
Referenced public types and APIs: [`ActionResult`](#actionresult), [`FormOptions`](#formoptions), [`ModelPicker`](#modelpicker), [`ModelPickerState`](#modelpickerstate), [`ModelSelection`](#modelselection).
|
|
1713
|
+
|
|
1714
|
+
Related gallery: [model-picker](https://minifish-org.github.io/pith-ui/?item=model-picker).
|
|
1715
|
+
|
|
1716
|
+
### createSettingsPanel
|
|
1717
|
+
|
|
1718
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/panels.ts#L45)
|
|
1719
|
+
|
|
1720
|
+
```ts
|
|
1721
|
+
export declare function createSettingsPanel(state: SettingsPanelState, options?: SettingsPanelOptions): SettingsPanel;
|
|
1722
|
+
```
|
|
1723
|
+
|
|
1724
|
+
Referenced public types and APIs: [`SettingsPanel`](#settingspanel), [`SettingsPanelOptions`](#settingspaneloptions), [`SettingsPanelState`](#settingspanelstate).
|
|
1725
|
+
|
|
1726
|
+
Related gallery: [settings-panel](https://minifish-org.github.io/pith-ui/?item=settings-panel).
|
|
1727
|
+
|
|
1728
|
+
### FormDOMBlock
|
|
1729
|
+
|
|
1730
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/panels.ts#L9)
|
|
1731
|
+
|
|
1732
|
+
```ts
|
|
1733
|
+
export interface FormDOMBlock<State extends FormFeedback> extends UIBlock<State> {
|
|
1734
|
+
field<T extends HTMLElement = HTMLElement>(id: string): T;
|
|
1735
|
+
id(localId: string): string;
|
|
1736
|
+
}
|
|
1737
|
+
```
|
|
1738
|
+
|
|
1739
|
+
Referenced public types and APIs: [`FormFeedback`](#formfeedback), [`UIBlock`](#uiblock).
|
|
1740
|
+
|
|
1741
|
+
### FormFeedback
|
|
1742
|
+
|
|
1743
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/panels.ts#L8)
|
|
1744
|
+
|
|
1745
|
+
```ts
|
|
1746
|
+
export interface FormFeedback {
|
|
1747
|
+
error?: string;
|
|
1748
|
+
disabled?: boolean;
|
|
1749
|
+
}
|
|
1750
|
+
```
|
|
1751
|
+
|
|
1752
|
+
### FormOptions
|
|
1753
|
+
|
|
1754
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/panels.ts#L39)
|
|
1755
|
+
|
|
1756
|
+
```ts
|
|
1757
|
+
export interface FormOptions {
|
|
1758
|
+
idPrefix?: string;
|
|
1759
|
+
}
|
|
1760
|
+
```
|
|
1761
|
+
|
|
1762
|
+
### MCPConnectionDraft
|
|
1763
|
+
|
|
1764
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/panels.ts#L135)
|
|
1765
|
+
|
|
1766
|
+
```ts
|
|
1767
|
+
export interface MCPConnectionDraft {
|
|
1768
|
+
name: string;
|
|
1769
|
+
type: 'http' | 'stdio';
|
|
1770
|
+
url: string;
|
|
1771
|
+
oauth: boolean;
|
|
1772
|
+
oauthClientId: string;
|
|
1773
|
+
oauthScope: string;
|
|
1774
|
+
command: string;
|
|
1775
|
+
args: string;
|
|
1776
|
+
enabled: boolean;
|
|
1777
|
+
bearerToken: string;
|
|
1778
|
+
clearBearerToken: boolean;
|
|
1779
|
+
env: string;
|
|
1780
|
+
clearEnv: boolean;
|
|
1781
|
+
}
|
|
1782
|
+
```
|
|
1783
|
+
|
|
1784
|
+
### MCPConnectionItem
|
|
1785
|
+
|
|
1786
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/panels.ts#L185)
|
|
1787
|
+
|
|
1788
|
+
```ts
|
|
1789
|
+
export interface MCPConnectionItem {
|
|
1790
|
+
name: string;
|
|
1791
|
+
type: string;
|
|
1792
|
+
url?: string;
|
|
1793
|
+
command?: string;
|
|
1794
|
+
args?: readonly string[];
|
|
1795
|
+
enabled: boolean;
|
|
1796
|
+
hasBearerToken?: boolean;
|
|
1797
|
+
status?: string;
|
|
1798
|
+
statusLabel: string;
|
|
1799
|
+
envKeys?: readonly string[];
|
|
1800
|
+
error?: string;
|
|
1801
|
+
oauth?: boolean;
|
|
1802
|
+
signedIn?: boolean;
|
|
1803
|
+
}
|
|
1804
|
+
```
|
|
1805
|
+
|
|
1806
|
+
### MCPConnectionListState
|
|
1807
|
+
|
|
1808
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/panels.ts#L189)
|
|
1809
|
+
|
|
1810
|
+
```ts
|
|
1811
|
+
export interface MCPConnectionListState extends FormFeedback {
|
|
1812
|
+
entries: readonly MCPConnectionItem[];
|
|
1813
|
+
}
|
|
1814
|
+
```
|
|
1815
|
+
|
|
1816
|
+
Referenced public types and APIs: [`FormFeedback`](#formfeedback), [`MCPConnectionItem`](#mcpconnectionitem).
|
|
1817
|
+
|
|
1818
|
+
### MCPConnectionsPanel
|
|
1819
|
+
|
|
1820
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/panels.ts#L137)
|
|
1821
|
+
|
|
1822
|
+
```ts
|
|
1823
|
+
export interface MCPConnectionsPanel extends FormDOMBlock<MCPConnectionsState> {
|
|
1824
|
+
renderType(): void;
|
|
1825
|
+
edit(value?: MCPEditorValue): void;
|
|
1826
|
+
read(): MCPConnectionDraft;
|
|
1827
|
+
clearBearerToken(): void;
|
|
1828
|
+
clearSecrets(): void;
|
|
1829
|
+
toggleEnvironment(): void;
|
|
1830
|
+
readonly list: HTMLElement;
|
|
1831
|
+
}
|
|
1832
|
+
```
|
|
1833
|
+
|
|
1834
|
+
Referenced public types and APIs: [`FormDOMBlock`](#formdomblock), [`MCPConnectionDraft`](#mcpconnectiondraft), [`MCPConnectionsState`](#mcpconnectionsstate), [`MCPEditorValue`](#mcpeditorvalue).
|
|
1835
|
+
|
|
1836
|
+
### MCPConnectionsState
|
|
1837
|
+
|
|
1838
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/panels.ts#L136)
|
|
1839
|
+
|
|
1840
|
+
```ts
|
|
1841
|
+
export interface MCPConnectionsState extends FormFeedback {
|
|
1842
|
+
formError?: string;
|
|
1843
|
+
}
|
|
1844
|
+
```
|
|
1845
|
+
|
|
1846
|
+
Referenced public types and APIs: [`FormFeedback`](#formfeedback).
|
|
1847
|
+
|
|
1848
|
+
### MCPEditorValue
|
|
1849
|
+
|
|
1850
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/panels.ts#L134)
|
|
1851
|
+
|
|
1852
|
+
```ts
|
|
1853
|
+
export interface MCPEditorValue {
|
|
1854
|
+
name: string;
|
|
1855
|
+
type: string;
|
|
1856
|
+
url?: string;
|
|
1857
|
+
oauth?: boolean;
|
|
1858
|
+
oauthClientId?: string;
|
|
1859
|
+
oauthScope?: string;
|
|
1860
|
+
command?: string;
|
|
1861
|
+
args?: readonly string[];
|
|
1862
|
+
enabled?: boolean;
|
|
1863
|
+
hasBearerToken?: boolean;
|
|
1864
|
+
envKeys?: readonly string[];
|
|
1865
|
+
}
|
|
1866
|
+
```
|
|
1867
|
+
|
|
1868
|
+
### ModelPicker
|
|
1869
|
+
|
|
1870
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/panels.ts#L173)
|
|
1871
|
+
|
|
1872
|
+
```ts
|
|
1873
|
+
export interface ModelPicker extends FormDOMBlock<ModelPickerState> {
|
|
1874
|
+
read(): ModelSelection;
|
|
1875
|
+
reset(selection: ModelSelection): void;
|
|
1876
|
+
focus(): void;
|
|
1877
|
+
}
|
|
1878
|
+
```
|
|
1879
|
+
|
|
1880
|
+
Referenced public types and APIs: [`FormDOMBlock`](#formdomblock), [`ModelPickerState`](#modelpickerstate), [`ModelSelection`](#modelselection).
|
|
1881
|
+
|
|
1882
|
+
### ModelPickerState
|
|
1883
|
+
|
|
1884
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/panels.ts#L172)
|
|
1885
|
+
|
|
1886
|
+
```ts
|
|
1887
|
+
export interface ModelPickerState extends FormFeedback {
|
|
1888
|
+
editor?: ModelEditorState;
|
|
1889
|
+
loading?: boolean;
|
|
1890
|
+
}
|
|
1891
|
+
```
|
|
1892
|
+
|
|
1893
|
+
Referenced public types and APIs: [`FormFeedback`](#formfeedback), [`ModelEditorState`](#modeleditorstate).
|
|
1894
|
+
|
|
1895
|
+
### SettingsCredentialView
|
|
1896
|
+
|
|
1897
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/panels.ts#L42)
|
|
1898
|
+
|
|
1899
|
+
```ts
|
|
1900
|
+
export interface SettingsCredentialView {
|
|
1901
|
+
status: string;
|
|
1902
|
+
hidden: boolean;
|
|
1903
|
+
required: boolean;
|
|
1904
|
+
placeholder: string;
|
|
1905
|
+
removeVisible: boolean;
|
|
1906
|
+
hint?: string;
|
|
1907
|
+
actions?: Node;
|
|
1908
|
+
}
|
|
1909
|
+
```
|
|
1910
|
+
|
|
1911
|
+
### SettingsDraft
|
|
1912
|
+
|
|
1913
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/panels.ts#L40)
|
|
1914
|
+
|
|
1915
|
+
```ts
|
|
1916
|
+
export interface SettingsDraft {
|
|
1917
|
+
provider: string;
|
|
1918
|
+
baseUrl: string;
|
|
1919
|
+
apiKey: string;
|
|
1920
|
+
}
|
|
1921
|
+
```
|
|
1922
|
+
|
|
1923
|
+
### SettingsPanel
|
|
1924
|
+
|
|
1925
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/panels.ts#L43)
|
|
1926
|
+
|
|
1927
|
+
```ts
|
|
1928
|
+
export interface SettingsPanel extends FormDOMBlock<SettingsPanelState> {
|
|
1929
|
+
read(): SettingsDraft;
|
|
1930
|
+
setProviders(providers: readonly SettingsProviderOption[], selected?: string): void;
|
|
1931
|
+
resetProvider(value: {
|
|
1932
|
+
provider: string;
|
|
1933
|
+
baseUrl: string;
|
|
1934
|
+
clearKey?: boolean;
|
|
1935
|
+
collapseAdvanced?: boolean;
|
|
1936
|
+
}): void;
|
|
1937
|
+
setCredential(view: SettingsCredentialView): void;
|
|
1938
|
+
clearSecrets(): void;
|
|
1939
|
+
readonly updates: HTMLElement;
|
|
1940
|
+
}
|
|
1941
|
+
```
|
|
1942
|
+
|
|
1943
|
+
Referenced public types and APIs: [`FormDOMBlock`](#formdomblock), [`SettingsCredentialView`](#settingscredentialview), [`SettingsDraft`](#settingsdraft), [`SettingsPanelState`](#settingspanelstate), [`SettingsProviderOption`](#settingsprovideroption).
|
|
1944
|
+
|
|
1945
|
+
### SettingsPanelOptions
|
|
1946
|
+
|
|
1947
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/panels.ts#L44)
|
|
1948
|
+
|
|
1949
|
+
```ts
|
|
1950
|
+
export interface SettingsPanelOptions extends FormOptions {
|
|
1951
|
+
onAppearanceChange?: (mode: string) => void;
|
|
1952
|
+
onProviderChange?: (provider: string) => void;
|
|
1953
|
+
onDraftChange?: (draft: SettingsDraft) => void;
|
|
1954
|
+
onSubmit?: (draft: SettingsDraft) => ActionResult | Promise<ActionResult>;
|
|
1955
|
+
onTest?: (draft: SettingsDraft) => void;
|
|
1956
|
+
onRemoveKey?: (draft: SettingsDraft) => ActionResult | Promise<ActionResult>;
|
|
1957
|
+
}
|
|
1958
|
+
```
|
|
1959
|
+
|
|
1960
|
+
Referenced public types and APIs: [`ActionResult`](#actionresult), [`FormOptions`](#formoptions), [`SettingsDraft`](#settingsdraft).
|
|
1961
|
+
|
|
1962
|
+
### SettingsPanelState
|
|
1963
|
+
|
|
1964
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/panels.ts#L38)
|
|
1965
|
+
|
|
1966
|
+
```ts
|
|
1967
|
+
export interface SettingsPanelState extends FormFeedback {
|
|
1968
|
+
baseUrl: string;
|
|
1969
|
+
hasApiKey: boolean;
|
|
1970
|
+
ready?: boolean;
|
|
1971
|
+
testing?: boolean;
|
|
1972
|
+
appearance?: {
|
|
1973
|
+
mode: 'light' | 'dark' | 'system';
|
|
1974
|
+
disabled?: boolean;
|
|
1975
|
+
error?: string;
|
|
1976
|
+
};
|
|
1977
|
+
testResult?: {
|
|
1978
|
+
message: string;
|
|
1979
|
+
ok?: boolean;
|
|
1980
|
+
};
|
|
1981
|
+
}
|
|
1982
|
+
```
|
|
1983
|
+
|
|
1984
|
+
Referenced public types and APIs: [`FormFeedback`](#formfeedback).
|
|
1985
|
+
|
|
1986
|
+
### SettingsProviderOption
|
|
1987
|
+
|
|
1988
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/panels.ts#L41)
|
|
1989
|
+
|
|
1990
|
+
```ts
|
|
1991
|
+
export interface SettingsProviderOption {
|
|
1992
|
+
id: string;
|
|
1993
|
+
name: string;
|
|
1994
|
+
configured?: boolean;
|
|
1995
|
+
signedIn?: boolean;
|
|
1996
|
+
}
|
|
1997
|
+
```
|
|
1998
|
+
|
|
1999
|
+
## src/forms/provider-login.ts
|
|
2000
|
+
|
|
2001
|
+
### createProviderLoginPanel
|
|
2002
|
+
|
|
2003
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/provider-login.ts#L6)
|
|
2004
|
+
|
|
2005
|
+
```ts
|
|
2006
|
+
export declare function createProviderLoginPanel(initial: ProviderLoginState, options?: {
|
|
2007
|
+
idPrefix?: string;
|
|
2008
|
+
onAnswer?: (answer: string) => void | ActionResult | Promise<void | ActionResult>;
|
|
2009
|
+
onCancel?: () => void;
|
|
2010
|
+
onClose?: () => void;
|
|
2011
|
+
}): UIBlock<ProviderLoginState>;
|
|
2012
|
+
```
|
|
2013
|
+
|
|
2014
|
+
Referenced public types and APIs: [`ActionResult`](#actionresult), [`ProviderLoginState`](#providerloginstate), [`UIBlock`](#uiblock).
|
|
2015
|
+
|
|
2016
|
+
Related gallery: [provider-login](https://minifish-org.github.io/pith-ui/?item=provider-login).
|
|
2017
|
+
|
|
2018
|
+
### ProviderLoginState
|
|
2019
|
+
|
|
2020
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/provider-login.ts#L5)
|
|
2021
|
+
|
|
2022
|
+
```ts
|
|
2023
|
+
export interface ProviderLoginState {
|
|
2024
|
+
phase: string;
|
|
2025
|
+
message: string;
|
|
2026
|
+
url?: string;
|
|
2027
|
+
code?: string;
|
|
2028
|
+
prompt?: string;
|
|
2029
|
+
promptType?: string;
|
|
2030
|
+
options?: readonly {
|
|
2031
|
+
id: string;
|
|
2032
|
+
label: string;
|
|
2033
|
+
}[] | null;
|
|
2034
|
+
error?: string;
|
|
2035
|
+
disabled?: boolean;
|
|
2036
|
+
}
|
|
2037
|
+
```
|
|
2038
|
+
|
|
2039
|
+
## src/forms/resource-editor.ts
|
|
2040
|
+
|
|
2041
|
+
### createResourceEditor
|
|
2042
|
+
|
|
2043
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/resource-editor.ts#L7)
|
|
2044
|
+
|
|
2045
|
+
```ts
|
|
2046
|
+
export declare function createResourceEditor(state: ResourceEditorState, options?: {
|
|
2047
|
+
idPrefix?: string;
|
|
2048
|
+
onSubmit?: (draft: ResourceDraft) => ActionResult | Promise<ActionResult>;
|
|
2049
|
+
onDelete?: () => void;
|
|
2050
|
+
}): UIBlock<ResourceEditorState> & {
|
|
2051
|
+
read(): ResourceDraft;
|
|
2052
|
+
readonly form: HTMLFormElement;
|
|
2053
|
+
readonly removeButton: HTMLButtonElement | null;
|
|
2054
|
+
};
|
|
2055
|
+
```
|
|
2056
|
+
|
|
2057
|
+
Referenced public types and APIs: [`ActionResult`](#actionresult), [`ResourceDraft`](#resourcedraft), [`ResourceEditorState`](#resourceeditorstate), [`UIBlock`](#uiblock).
|
|
2058
|
+
|
|
2059
|
+
Related gallery: [resource-editor](https://minifish-org.github.io/pith-ui/?item=resource-editor).
|
|
2060
|
+
|
|
2061
|
+
### ResourceDraft
|
|
2062
|
+
|
|
2063
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/resource-editor.ts#L6)
|
|
2064
|
+
|
|
2065
|
+
```ts
|
|
2066
|
+
export interface ResourceDraft {
|
|
2067
|
+
name: string;
|
|
2068
|
+
content: string;
|
|
2069
|
+
}
|
|
2070
|
+
```
|
|
2071
|
+
|
|
2072
|
+
### ResourceEditorState
|
|
2073
|
+
|
|
2074
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/forms/resource-editor.ts#L5)
|
|
2075
|
+
|
|
2076
|
+
```ts
|
|
2077
|
+
export interface ResourceEditorState {
|
|
2078
|
+
workspaceId: string;
|
|
2079
|
+
workspacePath: string;
|
|
2080
|
+
path?: string;
|
|
2081
|
+
kind: string;
|
|
2082
|
+
name?: string;
|
|
2083
|
+
content: string;
|
|
2084
|
+
editable: boolean;
|
|
2085
|
+
workspaceBusy: boolean;
|
|
2086
|
+
error?: string;
|
|
2087
|
+
disabled?: boolean;
|
|
2088
|
+
}
|
|
2089
|
+
```
|
|
2090
|
+
|
|
2091
|
+
## src/navigation/context-menu.ts
|
|
2092
|
+
|
|
2093
|
+
### createContextMenu
|
|
2094
|
+
|
|
2095
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/navigation/context-menu.ts#L9)
|
|
2096
|
+
|
|
2097
|
+
```ts
|
|
2098
|
+
export declare function createContextMenu(options?: {
|
|
2099
|
+
element?: HTMLElement;
|
|
2100
|
+
onDismiss?: (restoreFocus: boolean) => void;
|
|
2101
|
+
onAction?: (item: ContextMenuItem) => void;
|
|
2102
|
+
}): UIBlock<ContextMenuState> & {
|
|
2103
|
+
open(trigger: HTMLElement, state: ContextMenuState): void;
|
|
2104
|
+
close(restoreFocus?: boolean): void;
|
|
2105
|
+
};
|
|
2106
|
+
```
|
|
2107
|
+
|
|
2108
|
+
Referenced public types and APIs: [`ContextMenuItem`](#contextmenuitem), [`ContextMenuState`](#contextmenustate), [`UIBlock`](#uiblock).
|
|
2109
|
+
|
|
2110
|
+
Related gallery: [context-menu](https://minifish-org.github.io/pith-ui/?item=context-menu).
|
|
2111
|
+
|
|
2112
|
+
### ContextMenuItem
|
|
2113
|
+
|
|
2114
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/navigation/context-menu.ts#L4)
|
|
2115
|
+
|
|
2116
|
+
```ts
|
|
2117
|
+
export interface ContextMenuItem {
|
|
2118
|
+
id?: string;
|
|
2119
|
+
label: string;
|
|
2120
|
+
action?: string;
|
|
2121
|
+
sdkAction?: string;
|
|
2122
|
+
danger?: boolean;
|
|
2123
|
+
disabled?: boolean;
|
|
2124
|
+
idle?: {
|
|
2125
|
+
conversationId?: string;
|
|
2126
|
+
workspaceId?: string;
|
|
2127
|
+
};
|
|
2128
|
+
}
|
|
2129
|
+
```
|
|
2130
|
+
|
|
2131
|
+
### ContextMenuState
|
|
2132
|
+
|
|
2133
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/navigation/context-menu.ts#L8)
|
|
2134
|
+
|
|
2135
|
+
```ts
|
|
2136
|
+
export interface ContextMenuState {
|
|
2137
|
+
label: string;
|
|
2138
|
+
items: readonly ContextMenuItem[];
|
|
2139
|
+
}
|
|
2140
|
+
```
|
|
2141
|
+
|
|
2142
|
+
Referenced public types and APIs: [`ContextMenuItem`](#contextmenuitem).
|
|
2143
|
+
|
|
2144
|
+
## src/navigation/navigation.ts
|
|
2145
|
+
|
|
2146
|
+
### createRenameConversation
|
|
2147
|
+
|
|
2148
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/navigation/navigation.ts#L85)
|
|
2149
|
+
|
|
2150
|
+
```ts
|
|
2151
|
+
export declare function createRenameConversation(initial: RenameConversationState, options?: RenameConversationOptions): RenameConversationBlock;
|
|
2152
|
+
```
|
|
2153
|
+
|
|
2154
|
+
Referenced public types and APIs: [`RenameConversationBlock`](#renameconversationblock), [`RenameConversationOptions`](#renameconversationoptions), [`RenameConversationState`](#renameconversationstate).
|
|
2155
|
+
|
|
2156
|
+
Related gallery: [rename-conversation](https://minifish-org.github.io/pith-ui/?item=rename-conversation).
|
|
2157
|
+
|
|
2158
|
+
### createWorkspaceNavigation
|
|
2159
|
+
|
|
2160
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/navigation/navigation.ts#L11)
|
|
2161
|
+
|
|
2162
|
+
```ts
|
|
2163
|
+
export declare function createWorkspaceNavigation(initial: WorkspaceNavigationState, options?: {
|
|
2164
|
+
element?: HTMLElement;
|
|
2165
|
+
idPrefix?: string;
|
|
2166
|
+
onToggle?: (id: string) => void;
|
|
2167
|
+
onSelect?: (id: string) => void;
|
|
2168
|
+
}): UIBlock<WorkspaceNavigationState>;
|
|
2169
|
+
```
|
|
2170
|
+
|
|
2171
|
+
Referenced public types and APIs: [`UIBlock`](#uiblock), [`WorkspaceNavigationState`](#workspacenavigationstate).
|
|
2172
|
+
|
|
2173
|
+
Related gallery: [workspace-navigation](https://minifish-org.github.io/pith-ui/?item=workspace-navigation).
|
|
2174
|
+
|
|
2175
|
+
### createWorkspacePicker
|
|
2176
|
+
|
|
2177
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/navigation/navigation.ts#L137)
|
|
2178
|
+
|
|
2179
|
+
```ts
|
|
2180
|
+
export declare function createWorkspacePicker(initial: WorkspacePickerState, options?: WorkspacePickerOptions): WorkspacePickerBlock;
|
|
2181
|
+
```
|
|
2182
|
+
|
|
2183
|
+
Referenced public types and APIs: [`WorkspacePickerBlock`](#workspacepickerblock), [`WorkspacePickerOptions`](#workspacepickeroptions), [`WorkspacePickerState`](#workspacepickerstate).
|
|
2184
|
+
|
|
2185
|
+
Related gallery: [workspace-picker](https://minifish-org.github.io/pith-ui/?item=workspace-picker).
|
|
2186
|
+
|
|
2187
|
+
### NavigationConversation
|
|
2188
|
+
|
|
2189
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/navigation/navigation.ts#L6)
|
|
2190
|
+
|
|
2191
|
+
```ts
|
|
2192
|
+
export interface NavigationConversation {
|
|
2193
|
+
id: string;
|
|
2194
|
+
title?: string;
|
|
2195
|
+
active: boolean;
|
|
2196
|
+
menuOpen?: boolean;
|
|
2197
|
+
status?: Node | null;
|
|
2198
|
+
}
|
|
2199
|
+
```
|
|
2200
|
+
|
|
2201
|
+
### NavigationWorkspace
|
|
2202
|
+
|
|
2203
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/navigation/navigation.ts#L7)
|
|
2204
|
+
|
|
2205
|
+
```ts
|
|
2206
|
+
export interface NavigationWorkspace {
|
|
2207
|
+
id: string;
|
|
2208
|
+
name: string;
|
|
2209
|
+
path: string;
|
|
2210
|
+
expanded: boolean;
|
|
2211
|
+
selected: boolean;
|
|
2212
|
+
menuOpen?: boolean;
|
|
2213
|
+
children: readonly NavigationConversation[];
|
|
2214
|
+
}
|
|
2215
|
+
```
|
|
2216
|
+
|
|
2217
|
+
Referenced public types and APIs: [`NavigationConversation`](#navigationconversation).
|
|
2218
|
+
|
|
2219
|
+
### RenameConversationBlock
|
|
2220
|
+
|
|
2221
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/navigation/navigation.ts#L76)
|
|
2222
|
+
|
|
2223
|
+
```ts
|
|
2224
|
+
export interface RenameConversationBlock extends UIBlock<RenameConversationState> {
|
|
2225
|
+
readonly input: HTMLInputElement;
|
|
2226
|
+
readonly form: HTMLFormElement;
|
|
2227
|
+
read(): RenameConversationDraft;
|
|
2228
|
+
reset(state: RenameConversationState): void;
|
|
2229
|
+
open(state?: RenameConversationState): void;
|
|
2230
|
+
close(): void;
|
|
2231
|
+
focus(): void;
|
|
2232
|
+
}
|
|
2233
|
+
```
|
|
2234
|
+
|
|
2235
|
+
Referenced public types and APIs: [`RenameConversationDraft`](#renameconversationdraft), [`RenameConversationState`](#renameconversationstate), [`UIBlock`](#uiblock).
|
|
2236
|
+
|
|
2237
|
+
### RenameConversationDraft
|
|
2238
|
+
|
|
2239
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/navigation/navigation.ts#L67)
|
|
2240
|
+
|
|
2241
|
+
```ts
|
|
2242
|
+
export interface RenameConversationDraft {
|
|
2243
|
+
id: string;
|
|
2244
|
+
title: string;
|
|
2245
|
+
}
|
|
2246
|
+
```
|
|
2247
|
+
|
|
2248
|
+
### RenameConversationOptions
|
|
2249
|
+
|
|
2250
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/navigation/navigation.ts#L68)
|
|
2251
|
+
|
|
2252
|
+
```ts
|
|
2253
|
+
export interface RenameConversationOptions {
|
|
2254
|
+
idPrefix?: string;
|
|
2255
|
+
dialog?: HTMLDialogElement;
|
|
2256
|
+
unavailable?: () => boolean;
|
|
2257
|
+
onSubmit?: (draft: RenameConversationDraft) => Promise<ActionResult> | ActionResult;
|
|
2258
|
+
onSubmitted?: () => void;
|
|
2259
|
+
onCancel?: () => void;
|
|
2260
|
+
}
|
|
2261
|
+
```
|
|
2262
|
+
|
|
2263
|
+
Referenced public types and APIs: [`ActionResult`](#actionresult), [`RenameConversationDraft`](#renameconversationdraft).
|
|
2264
|
+
|
|
2265
|
+
### RenameConversationState
|
|
2266
|
+
|
|
2267
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/navigation/navigation.ts#L66)
|
|
2268
|
+
|
|
2269
|
+
```ts
|
|
2270
|
+
export interface RenameConversationState {
|
|
2271
|
+
id: string;
|
|
2272
|
+
title: string;
|
|
2273
|
+
error?: string;
|
|
2274
|
+
disabled?: boolean;
|
|
2275
|
+
}
|
|
2276
|
+
```
|
|
2277
|
+
|
|
2278
|
+
### WorkspaceNavigationState
|
|
2279
|
+
|
|
2280
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/navigation/navigation.ts#L8)
|
|
2281
|
+
|
|
2282
|
+
```ts
|
|
2283
|
+
export interface WorkspaceNavigationState {
|
|
2284
|
+
groups: readonly NavigationWorkspace[];
|
|
2285
|
+
empty: 'workspaces' | 'search' | null;
|
|
2286
|
+
disabled?: boolean;
|
|
2287
|
+
}
|
|
2288
|
+
```
|
|
2289
|
+
|
|
2290
|
+
Referenced public types and APIs: [`NavigationWorkspace`](#navigationworkspace).
|
|
2291
|
+
|
|
2292
|
+
### WorkspacePickerBlock
|
|
2293
|
+
|
|
2294
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/navigation/navigation.ts#L127)
|
|
2295
|
+
|
|
2296
|
+
```ts
|
|
2297
|
+
export interface WorkspacePickerBlock extends UIBlock<WorkspacePickerState> {
|
|
2298
|
+
readonly input: HTMLInputElement;
|
|
2299
|
+
readonly form: HTMLFormElement;
|
|
2300
|
+
readonly pickButton: HTMLButtonElement;
|
|
2301
|
+
read(): {
|
|
2302
|
+
path: string;
|
|
2303
|
+
};
|
|
2304
|
+
reset(path?: string): void;
|
|
2305
|
+
open(): void;
|
|
2306
|
+
close(): void;
|
|
2307
|
+
focus(): void;
|
|
2308
|
+
}
|
|
2309
|
+
```
|
|
2310
|
+
|
|
2311
|
+
Referenced public types and APIs: [`UIBlock`](#uiblock), [`WorkspacePickerState`](#workspacepickerstate).
|
|
2312
|
+
|
|
2313
|
+
### WorkspacePickerOptions
|
|
2314
|
+
|
|
2315
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/navigation/navigation.ts#L117)
|
|
2316
|
+
|
|
2317
|
+
```ts
|
|
2318
|
+
export interface WorkspacePickerOptions {
|
|
2319
|
+
idPrefix?: string;
|
|
2320
|
+
dialog?: HTMLDialogElement;
|
|
2321
|
+
unavailable?: () => boolean;
|
|
2322
|
+
onSubmit?: (path: string) => Promise<ActionResult> | ActionResult;
|
|
2323
|
+
onPick?: () => Promise<{
|
|
2324
|
+
path?: string;
|
|
2325
|
+
error?: string;
|
|
2326
|
+
}>;
|
|
2327
|
+
onSelect?: (id: string) => void;
|
|
2328
|
+
onSubmitted?: () => void;
|
|
2329
|
+
onCancel?: () => void;
|
|
2330
|
+
}
|
|
2331
|
+
```
|
|
2332
|
+
|
|
2333
|
+
Referenced public types and APIs: [`ActionResult`](#actionresult).
|
|
2334
|
+
|
|
2335
|
+
### WorkspacePickerState
|
|
2336
|
+
|
|
2337
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/navigation/navigation.ts#L116)
|
|
2338
|
+
|
|
2339
|
+
```ts
|
|
2340
|
+
export interface WorkspacePickerState {
|
|
2341
|
+
workspaces: readonly {
|
|
2342
|
+
id: string;
|
|
2343
|
+
name: string;
|
|
2344
|
+
path: string;
|
|
2345
|
+
}[];
|
|
2346
|
+
error?: string;
|
|
2347
|
+
disabled?: boolean;
|
|
2348
|
+
}
|
|
2349
|
+
```
|
|
2350
|
+
|
|
2351
|
+
## src/primitives.ts
|
|
2352
|
+
|
|
2353
|
+
### createActions
|
|
2354
|
+
|
|
2355
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L294)
|
|
2356
|
+
|
|
2357
|
+
```ts
|
|
2358
|
+
export declare function createActions(options?: ActionsState & {
|
|
2359
|
+
children?: readonly Node[];
|
|
2360
|
+
}): UIBlock<ActionsState>;
|
|
2361
|
+
```
|
|
2362
|
+
|
|
2363
|
+
Referenced public types and APIs: [`ActionsState`](#actionsstate), [`UIBlock`](#uiblock).
|
|
2364
|
+
|
|
2365
|
+
Related gallery: [actions](https://minifish-org.github.io/pith-ui/?item=actions).
|
|
2366
|
+
|
|
2367
|
+
### createButton
|
|
2368
|
+
|
|
2369
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L25)
|
|
2370
|
+
|
|
2371
|
+
```ts
|
|
2372
|
+
export declare function createButton(options: ButtonOptions): ButtonBlock;
|
|
2373
|
+
```
|
|
2374
|
+
|
|
2375
|
+
Referenced public types and APIs: [`ButtonBlock`](#buttonblock), [`ButtonOptions`](#buttonoptions).
|
|
2376
|
+
|
|
2377
|
+
Related gallery: [actions](https://minifish-org.github.io/pith-ui/?item=actions), [button](https://minifish-org.github.io/pith-ui/?item=button), [confirmation](https://minifish-org.github.io/pith-ui/?item=confirmation), [context-menu](https://minifish-org.github.io/pith-ui/?item=context-menu), [conversation-reader](https://minifish-org.github.io/pith-ui/?item=conversation-reader), [copy-feedback](https://minifish-org.github.io/pith-ui/?item=copy-feedback), [dialog](https://minifish-org.github.io/pith-ui/?item=dialog), [drop-feedback](https://minifish-org.github.io/pith-ui/?item=drop-feedback), [feature-dialog](https://minifish-org.github.io/pith-ui/?item=feature-dialog), [foundation-colors](https://minifish-org.github.io/pith-ui/?item=foundation-colors), [foundation-focus](https://minifish-org.github.io/pith-ui/?item=foundation-focus), [foundation-motion](https://minifish-org.github.io/pith-ui/?item=foundation-motion), [foundation-sizing](https://minifish-org.github.io/pith-ui/?item=foundation-sizing), [foundation-spacing](https://minifish-org.github.io/pith-ui/?item=foundation-spacing), [image-viewer](https://minifish-org.github.io/pith-ui/?item=image-viewer), [list-row](https://minifish-org.github.io/pith-ui/?item=list-row), [runtime-panel](https://minifish-org.github.io/pith-ui/?item=runtime-panel), [text-edit-dialog](https://minifish-org.github.io/pith-ui/?item=text-edit-dialog), [toolbar](https://minifish-org.github.io/pith-ui/?item=toolbar).
|
|
2378
|
+
|
|
2379
|
+
### createCheckbox
|
|
2380
|
+
|
|
2381
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L247)
|
|
2382
|
+
|
|
2383
|
+
```ts
|
|
2384
|
+
export declare function createCheckbox(options: CheckboxState & {
|
|
2385
|
+
checked?: boolean;
|
|
2386
|
+
onChange?: (value: boolean) => void;
|
|
2387
|
+
}): CheckboxBlock;
|
|
2388
|
+
```
|
|
2389
|
+
|
|
2390
|
+
Referenced public types and APIs: [`CheckboxBlock`](#checkboxblock), [`CheckboxState`](#checkboxstate).
|
|
2391
|
+
|
|
2392
|
+
Related gallery: [checkbox](https://minifish-org.github.io/pith-ui/?item=checkbox), [foundation-focus](https://minifish-org.github.io/pith-ui/?item=foundation-focus), [foundation-motion](https://minifish-org.github.io/pith-ui/?item=foundation-motion).
|
|
2393
|
+
|
|
2394
|
+
### createCollectionState
|
|
2395
|
+
|
|
2396
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L331)
|
|
2397
|
+
|
|
2398
|
+
```ts
|
|
2399
|
+
export declare function createCollectionState(options: CollectionState & {
|
|
2400
|
+
content?: Node;
|
|
2401
|
+
onRetry?: UIAction;
|
|
2402
|
+
}): UIBlock<CollectionState>;
|
|
2403
|
+
```
|
|
2404
|
+
|
|
2405
|
+
Referenced public types and APIs: [`CollectionState`](#collectionstate), [`UIAction`](#uiaction), [`UIBlock`](#uiblock).
|
|
2406
|
+
|
|
2407
|
+
Related gallery: [collection-state](https://minifish-org.github.io/pith-ui/?item=collection-state).
|
|
2408
|
+
|
|
2409
|
+
### createConfirmDialog
|
|
2410
|
+
|
|
2411
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L446)
|
|
2412
|
+
|
|
2413
|
+
```ts
|
|
2414
|
+
export declare function createConfirmDialog(options: ConfirmState & {
|
|
2415
|
+
dialog?: HTMLDialogElement;
|
|
2416
|
+
ids?: {
|
|
2417
|
+
form?: string;
|
|
2418
|
+
error?: string;
|
|
2419
|
+
title?: string;
|
|
2420
|
+
cancel?: string;
|
|
2421
|
+
};
|
|
2422
|
+
unavailable?: () => boolean;
|
|
2423
|
+
onConfirm: () => Promise<ActionResult> | ActionResult;
|
|
2424
|
+
onClose?: () => void;
|
|
2425
|
+
}): ConfirmBlock;
|
|
2426
|
+
```
|
|
2427
|
+
|
|
2428
|
+
Referenced public types and APIs: [`ActionResult`](#actionresult), [`ConfirmBlock`](#confirmblock), [`ConfirmState`](#confirmstate).
|
|
2429
|
+
|
|
2430
|
+
Related gallery: [confirmation](https://minifish-org.github.io/pith-ui/?item=confirmation).
|
|
2431
|
+
|
|
2432
|
+
### createDialog
|
|
2433
|
+
|
|
2434
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L353)
|
|
2435
|
+
|
|
2436
|
+
```ts
|
|
2437
|
+
export declare function createDialog(options: DialogOptions): DialogBlock;
|
|
2438
|
+
```
|
|
2439
|
+
|
|
2440
|
+
Referenced public types and APIs: [`DialogBlock`](#dialogblock), [`DialogOptions`](#dialogoptions).
|
|
2441
|
+
|
|
2442
|
+
Related gallery: [dialog](https://minifish-org.github.io/pith-ui/?item=dialog).
|
|
2443
|
+
|
|
2444
|
+
### createDisclosure
|
|
2445
|
+
|
|
2446
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L302)
|
|
2447
|
+
|
|
2448
|
+
```ts
|
|
2449
|
+
export declare function createDisclosure(options: DisclosureState & {
|
|
2450
|
+
content: Node;
|
|
2451
|
+
open?: boolean;
|
|
2452
|
+
onToggle?: (open: boolean) => void;
|
|
2453
|
+
}): DisclosureBlock;
|
|
2454
|
+
```
|
|
2455
|
+
|
|
2456
|
+
Referenced public types and APIs: [`DisclosureBlock`](#disclosureblock), [`DisclosureState`](#disclosurestate).
|
|
2457
|
+
|
|
2458
|
+
Related gallery: [disclosure](https://minifish-org.github.io/pith-ui/?item=disclosure).
|
|
2459
|
+
|
|
2460
|
+
### createDivider
|
|
2461
|
+
|
|
2462
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L73)
|
|
2463
|
+
|
|
2464
|
+
```ts
|
|
2465
|
+
export declare function createDivider(state?: {
|
|
2466
|
+
label?: string;
|
|
2467
|
+
}): UIBlock<{
|
|
2468
|
+
label?: string;
|
|
2469
|
+
}>;
|
|
2470
|
+
```
|
|
2471
|
+
|
|
2472
|
+
Referenced public types and APIs: [`UIBlock`](#uiblock).
|
|
2473
|
+
|
|
2474
|
+
Related gallery: [divider](https://minifish-org.github.io/pith-ui/?item=divider).
|
|
2475
|
+
|
|
2476
|
+
### createField
|
|
2477
|
+
|
|
2478
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L120)
|
|
2479
|
+
|
|
2480
|
+
```ts
|
|
2481
|
+
export declare function createField(options: FieldState & {
|
|
2482
|
+
control: FieldBlock['control'];
|
|
2483
|
+
}): FieldBlock;
|
|
2484
|
+
```
|
|
2485
|
+
|
|
2486
|
+
Referenced public types and APIs: [`FieldBlock`](#fieldblock), [`FieldState`](#fieldstate).
|
|
2487
|
+
|
|
2488
|
+
Related gallery: [number-input](https://minifish-org.github.io/pith-ui/?item=number-input), [search-input](https://minifish-org.github.io/pith-ui/?item=search-input), [secret-input](https://minifish-org.github.io/pith-ui/?item=secret-input), [text-area](https://minifish-org.github.io/pith-ui/?item=text-area), [text-input](https://minifish-org.github.io/pith-ui/?item=text-input).
|
|
2489
|
+
|
|
2490
|
+
### createFormSection
|
|
2491
|
+
|
|
2492
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L286)
|
|
2493
|
+
|
|
2494
|
+
```ts
|
|
2495
|
+
export declare function createFormSection(options: FormSectionState & {
|
|
2496
|
+
content?: Node;
|
|
2497
|
+
}): UIBlock<FormSectionState>;
|
|
2498
|
+
```
|
|
2499
|
+
|
|
2500
|
+
Referenced public types and APIs: [`FormSectionState`](#formsectionstate), [`UIBlock`](#uiblock).
|
|
2501
|
+
|
|
2502
|
+
Related gallery: [form-section](https://minifish-org.github.io/pith-ui/?item=form-section).
|
|
2503
|
+
|
|
2504
|
+
### createIcon
|
|
2505
|
+
|
|
2506
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L62)
|
|
2507
|
+
|
|
2508
|
+
```ts
|
|
2509
|
+
export declare function createIcon(state: IconState): UIBlock<IconState>;
|
|
2510
|
+
```
|
|
2511
|
+
|
|
2512
|
+
Referenced public types and APIs: [`IconState`](#iconstate), [`UIBlock`](#uiblock).
|
|
2513
|
+
|
|
2514
|
+
Related gallery: [foundation-sizing](https://minifish-org.github.io/pith-ui/?item=foundation-sizing), [icons](https://minifish-org.github.io/pith-ui/?item=icons).
|
|
2515
|
+
|
|
2516
|
+
### createIconButton
|
|
2517
|
+
|
|
2518
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L40)
|
|
2519
|
+
|
|
2520
|
+
```ts
|
|
2521
|
+
export declare function createIconButton(options: ButtonOptions & {
|
|
2522
|
+
icon: string;
|
|
2523
|
+
}): ButtonBlock;
|
|
2524
|
+
```
|
|
2525
|
+
|
|
2526
|
+
Referenced public types and APIs: [`ButtonBlock`](#buttonblock), [`ButtonOptions`](#buttonoptions).
|
|
2527
|
+
|
|
2528
|
+
Related gallery: [icon-button](https://minifish-org.github.io/pith-ui/?item=icon-button), [toolbar](https://minifish-org.github.io/pith-ui/?item=toolbar).
|
|
2529
|
+
|
|
2530
|
+
### createKeyValue
|
|
2531
|
+
|
|
2532
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L80)
|
|
2533
|
+
|
|
2534
|
+
```ts
|
|
2535
|
+
export declare function createKeyValue(options: KeyValueState): UIBlock<KeyValueState>;
|
|
2536
|
+
```
|
|
2537
|
+
|
|
2538
|
+
Referenced public types and APIs: [`KeyValueState`](#keyvaluestate), [`UIBlock`](#uiblock).
|
|
2539
|
+
|
|
2540
|
+
Related gallery: [foundation-motion](https://minifish-org.github.io/pith-ui/?item=foundation-motion), [key-value](https://minifish-org.github.io/pith-ui/?item=key-value).
|
|
2541
|
+
|
|
2542
|
+
### createListRow
|
|
2543
|
+
|
|
2544
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L316)
|
|
2545
|
+
|
|
2546
|
+
```ts
|
|
2547
|
+
export declare function createListRow(options: ListRowState & {
|
|
2548
|
+
actions?: Node;
|
|
2549
|
+
}): UIBlock<ListRowState>;
|
|
2550
|
+
```
|
|
2551
|
+
|
|
2552
|
+
Referenced public types and APIs: [`ListRowState`](#listrowstate), [`UIBlock`](#uiblock).
|
|
2553
|
+
|
|
2554
|
+
Related gallery: [collection-state](https://minifish-org.github.io/pith-ui/?item=collection-state), [list-row](https://minifish-org.github.io/pith-ui/?item=list-row).
|
|
2555
|
+
|
|
2556
|
+
### createMenu
|
|
2557
|
+
|
|
2558
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L518)
|
|
2559
|
+
|
|
2560
|
+
```ts
|
|
2561
|
+
export declare function createMenu(options: MenuState): PopoverBlock & UIBlock<MenuState>;
|
|
2562
|
+
```
|
|
2563
|
+
|
|
2564
|
+
Referenced public types and APIs: [`MenuState`](#menustate), [`PopoverBlock`](#popoverblock), [`UIBlock`](#uiblock).
|
|
2565
|
+
|
|
2566
|
+
Related gallery: [menu](https://minifish-org.github.io/pith-ui/?item=menu).
|
|
2567
|
+
|
|
2568
|
+
### createNotice
|
|
2569
|
+
|
|
2570
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L262)
|
|
2571
|
+
|
|
2572
|
+
```ts
|
|
2573
|
+
export declare function createNotice(state: NoticeState): UIBlock<NoticeState>;
|
|
2574
|
+
```
|
|
2575
|
+
|
|
2576
|
+
Referenced public types and APIs: [`NoticeState`](#noticestate), [`UIBlock`](#uiblock).
|
|
2577
|
+
|
|
2578
|
+
Related gallery: [notice](https://minifish-org.github.io/pith-ui/?item=notice).
|
|
2579
|
+
|
|
2580
|
+
### createNumberInput
|
|
2581
|
+
|
|
2582
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L186)
|
|
2583
|
+
|
|
2584
|
+
```ts
|
|
2585
|
+
export declare const createNumberInput: (options: InputOptions) => InputBlock;
|
|
2586
|
+
```
|
|
2587
|
+
|
|
2588
|
+
Referenced public types and APIs: [`InputBlock`](#inputblock), [`InputOptions`](#inputoptions).
|
|
2589
|
+
|
|
2590
|
+
Related gallery: [number-input](https://minifish-org.github.io/pith-ui/?item=number-input).
|
|
2591
|
+
|
|
2592
|
+
### createPopover
|
|
2593
|
+
|
|
2594
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L493)
|
|
2595
|
+
|
|
2596
|
+
```ts
|
|
2597
|
+
export declare function createPopover(options: PopoverState & {
|
|
2598
|
+
content: Node;
|
|
2599
|
+
onToggle?: (open: boolean) => void;
|
|
2600
|
+
}): PopoverBlock;
|
|
2601
|
+
```
|
|
2602
|
+
|
|
2603
|
+
Referenced public types and APIs: [`PopoverBlock`](#popoverblock), [`PopoverState`](#popoverstate).
|
|
2604
|
+
|
|
2605
|
+
Related gallery: [popover](https://minifish-org.github.io/pith-ui/?item=popover).
|
|
2606
|
+
|
|
2607
|
+
### createProgress
|
|
2608
|
+
|
|
2609
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L275)
|
|
2610
|
+
|
|
2611
|
+
```ts
|
|
2612
|
+
export declare function createProgress(state: ProgressState): UIBlock<ProgressState>;
|
|
2613
|
+
```
|
|
2614
|
+
|
|
2615
|
+
Referenced public types and APIs: [`ProgressState`](#progressstate), [`UIBlock`](#uiblock).
|
|
2616
|
+
|
|
2617
|
+
Related gallery: [progress](https://minifish-org.github.io/pith-ui/?item=progress).
|
|
2618
|
+
|
|
2619
|
+
### createScrollArea
|
|
2620
|
+
|
|
2621
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L103)
|
|
2622
|
+
|
|
2623
|
+
```ts
|
|
2624
|
+
export declare function createScrollArea(options: ScrollAreaState & {
|
|
2625
|
+
content: Node;
|
|
2626
|
+
}): UIBlock<ScrollAreaState>;
|
|
2627
|
+
```
|
|
2628
|
+
|
|
2629
|
+
Referenced public types and APIs: [`ScrollAreaState`](#scrollareastate), [`UIBlock`](#uiblock).
|
|
2630
|
+
|
|
2631
|
+
Related gallery: [scroll-area](https://minifish-org.github.io/pith-ui/?item=scroll-area).
|
|
2632
|
+
|
|
2633
|
+
### createSearchInput
|
|
2634
|
+
|
|
2635
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L185)
|
|
2636
|
+
|
|
2637
|
+
```ts
|
|
2638
|
+
export declare const createSearchInput: (options: InputOptions) => InputBlock;
|
|
2639
|
+
```
|
|
2640
|
+
|
|
2641
|
+
Referenced public types and APIs: [`InputBlock`](#inputblock), [`InputOptions`](#inputoptions).
|
|
2642
|
+
|
|
2643
|
+
Related gallery: [search-input](https://minifish-org.github.io/pith-ui/?item=search-input).
|
|
2644
|
+
|
|
2645
|
+
### createSecretInput
|
|
2646
|
+
|
|
2647
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L189)
|
|
2648
|
+
|
|
2649
|
+
```ts
|
|
2650
|
+
export declare function createSecretInput(options: InputOptions): InputBlock;
|
|
2651
|
+
```
|
|
2652
|
+
|
|
2653
|
+
Referenced public types and APIs: [`InputBlock`](#inputblock), [`InputOptions`](#inputoptions).
|
|
2654
|
+
|
|
2655
|
+
Related gallery: [secret-input](https://minifish-org.github.io/pith-ui/?item=secret-input).
|
|
2656
|
+
|
|
2657
|
+
### createSelect
|
|
2658
|
+
|
|
2659
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L217)
|
|
2660
|
+
|
|
2661
|
+
```ts
|
|
2662
|
+
export declare function createSelect(options: SelectOptions): SelectBlock;
|
|
2663
|
+
```
|
|
2664
|
+
|
|
2665
|
+
Referenced public types and APIs: [`SelectBlock`](#selectblock), [`SelectOptions`](#selectoptions).
|
|
2666
|
+
|
|
2667
|
+
Related gallery: [foundation-sizing](https://minifish-org.github.io/pith-ui/?item=foundation-sizing), [foundation-spacing](https://minifish-org.github.io/pith-ui/?item=foundation-spacing), [select](https://minifish-org.github.io/pith-ui/?item=select).
|
|
2668
|
+
|
|
2669
|
+
### createStatus
|
|
2670
|
+
|
|
2671
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L268)
|
|
2672
|
+
|
|
2673
|
+
```ts
|
|
2674
|
+
export declare function createStatus(state: StatusState): UIBlock<StatusState>;
|
|
2675
|
+
```
|
|
2676
|
+
|
|
2677
|
+
Referenced public types and APIs: [`StatusState`](#statusstate), [`UIBlock`](#uiblock).
|
|
2678
|
+
|
|
2679
|
+
Related gallery: [status](https://minifish-org.github.io/pith-ui/?item=status).
|
|
2680
|
+
|
|
2681
|
+
### createTextAction
|
|
2682
|
+
|
|
2683
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L53)
|
|
2684
|
+
|
|
2685
|
+
```ts
|
|
2686
|
+
export declare function createTextAction(options: ButtonOptions): ButtonBlock;
|
|
2687
|
+
```
|
|
2688
|
+
|
|
2689
|
+
Referenced public types and APIs: [`ButtonBlock`](#buttonblock), [`ButtonOptions`](#buttonoptions).
|
|
2690
|
+
|
|
2691
|
+
Related gallery: [text-action](https://minifish-org.github.io/pith-ui/?item=text-action).
|
|
2692
|
+
|
|
2693
|
+
### createTextArea
|
|
2694
|
+
|
|
2695
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L187)
|
|
2696
|
+
|
|
2697
|
+
```ts
|
|
2698
|
+
export declare const createTextArea: (options: InputOptions) => InputBlock;
|
|
2699
|
+
```
|
|
2700
|
+
|
|
2701
|
+
Referenced public types and APIs: [`InputBlock`](#inputblock), [`InputOptions`](#inputoptions).
|
|
2702
|
+
|
|
2703
|
+
Related gallery: [foundation-typography](https://minifish-org.github.io/pith-ui/?item=foundation-typography), [text-area](https://minifish-org.github.io/pith-ui/?item=text-area).
|
|
2704
|
+
|
|
2705
|
+
### createTextEditDialog
|
|
2706
|
+
|
|
2707
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L395)
|
|
2708
|
+
|
|
2709
|
+
```ts
|
|
2710
|
+
export declare function createTextEditDialog(options?: TextEditOptions): TextEditBlock;
|
|
2711
|
+
```
|
|
2712
|
+
|
|
2713
|
+
Referenced public types and APIs: [`TextEditBlock`](#texteditblock), [`TextEditOptions`](#texteditoptions).
|
|
2714
|
+
|
|
2715
|
+
Related gallery: [pending-messages](https://minifish-org.github.io/pith-ui/?item=pending-messages), [text-edit-dialog](https://minifish-org.github.io/pith-ui/?item=text-edit-dialog).
|
|
2716
|
+
|
|
2717
|
+
### createTextInput
|
|
2718
|
+
|
|
2719
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L184)
|
|
2720
|
+
|
|
2721
|
+
```ts
|
|
2722
|
+
export declare const createTextInput: (options: InputOptions) => InputBlock;
|
|
2723
|
+
```
|
|
2724
|
+
|
|
2725
|
+
Referenced public types and APIs: [`InputBlock`](#inputblock), [`InputOptions`](#inputoptions).
|
|
2726
|
+
|
|
2727
|
+
Related gallery: [form-section](https://minifish-org.github.io/pith-ui/?item=form-section), [foundation-focus](https://minifish-org.github.io/pith-ui/?item=foundation-focus), [foundation-sizing](https://minifish-org.github.io/pith-ui/?item=foundation-sizing), [popover](https://minifish-org.github.io/pith-ui/?item=popover), [text-input](https://minifish-org.github.io/pith-ui/?item=text-input).
|
|
2728
|
+
|
|
2729
|
+
### createToolbar
|
|
2730
|
+
|
|
2731
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L95)
|
|
2732
|
+
|
|
2733
|
+
```ts
|
|
2734
|
+
export declare function createToolbar(options: ToolbarState & {
|
|
2735
|
+
children?: readonly Node[];
|
|
2736
|
+
}): UIBlock<ToolbarState>;
|
|
2737
|
+
```
|
|
2738
|
+
|
|
2739
|
+
Referenced public types and APIs: [`ToolbarState`](#toolbarstate), [`UIBlock`](#uiblock).
|
|
2740
|
+
|
|
2741
|
+
Related gallery: [button](https://minifish-org.github.io/pith-ui/?item=button), [foundation-motion](https://minifish-org.github.io/pith-ui/?item=foundation-motion), [foundation-spacing](https://minifish-org.github.io/pith-ui/?item=foundation-spacing), [icon-button](https://minifish-org.github.io/pith-ui/?item=icon-button), [icons](https://minifish-org.github.io/pith-ui/?item=icons), [toolbar](https://minifish-org.github.io/pith-ui/?item=toolbar).
|
|
2742
|
+
|
|
2743
|
+
### ActionsState
|
|
2744
|
+
|
|
2745
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L293)
|
|
2746
|
+
|
|
2747
|
+
```ts
|
|
2748
|
+
export interface ActionsState {
|
|
2749
|
+
align?: 'start' | 'end' | 'between';
|
|
2750
|
+
}
|
|
2751
|
+
```
|
|
2752
|
+
|
|
2753
|
+
### ButtonBlock
|
|
2754
|
+
|
|
2755
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L23)
|
|
2756
|
+
|
|
2757
|
+
```ts
|
|
2758
|
+
export interface ButtonBlock extends UIBlock<ButtonState> {
|
|
2759
|
+
readonly element: HTMLButtonElement;
|
|
2760
|
+
}
|
|
2761
|
+
```
|
|
2762
|
+
|
|
2763
|
+
Referenced public types and APIs: [`ButtonState`](#buttonstate), [`UIBlock`](#uiblock).
|
|
2764
|
+
|
|
2765
|
+
### ButtonOptions
|
|
2766
|
+
|
|
2767
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L18)
|
|
2768
|
+
|
|
2769
|
+
```ts
|
|
2770
|
+
export interface ButtonOptions extends ButtonState {
|
|
2771
|
+
type?: 'button' | 'submit' | 'reset';
|
|
2772
|
+
onAction?: UIAction;
|
|
2773
|
+
onError?: (message: string) => void;
|
|
2774
|
+
}
|
|
2775
|
+
```
|
|
2776
|
+
|
|
2777
|
+
Referenced public types and APIs: [`ButtonState`](#buttonstate), [`UIAction`](#uiaction).
|
|
2778
|
+
|
|
2779
|
+
### ButtonState
|
|
2780
|
+
|
|
2781
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L7)
|
|
2782
|
+
|
|
2783
|
+
```ts
|
|
2784
|
+
export interface ButtonState {
|
|
2785
|
+
label: string;
|
|
2786
|
+
intent?: Intent;
|
|
2787
|
+
density?: Density;
|
|
2788
|
+
disabled?: boolean;
|
|
2789
|
+
pending?: boolean;
|
|
2790
|
+
icon?: string;
|
|
2791
|
+
title?: string;
|
|
2792
|
+
/** Secondary product action, including the accepted compact application style. */
|
|
2793
|
+
appearance?: 'standard' | 'secondary';
|
|
2794
|
+
}
|
|
2795
|
+
```
|
|
2796
|
+
|
|
2797
|
+
Referenced public types and APIs: [`Density`](#density), [`Intent`](#intent).
|
|
2798
|
+
|
|
2799
|
+
### CheckboxBlock
|
|
2800
|
+
|
|
2801
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L241)
|
|
2802
|
+
|
|
2803
|
+
```ts
|
|
2804
|
+
export interface CheckboxBlock extends UIBlock<CheckboxState> {
|
|
2805
|
+
readonly control: HTMLInputElement;
|
|
2806
|
+
getValue(): boolean;
|
|
2807
|
+
reset(value: boolean): void;
|
|
2808
|
+
focus(): void;
|
|
2809
|
+
}
|
|
2810
|
+
```
|
|
2811
|
+
|
|
2812
|
+
Referenced public types and APIs: [`CheckboxState`](#checkboxstate), [`UIBlock`](#uiblock).
|
|
2813
|
+
|
|
2814
|
+
### CheckboxState
|
|
2815
|
+
|
|
2816
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L240)
|
|
2817
|
+
|
|
2818
|
+
```ts
|
|
2819
|
+
export interface CheckboxState {
|
|
2820
|
+
label: string;
|
|
2821
|
+
description?: string;
|
|
2822
|
+
disabled?: boolean;
|
|
2823
|
+
}
|
|
2824
|
+
```
|
|
2825
|
+
|
|
2826
|
+
### CollectionState
|
|
2827
|
+
|
|
2828
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L330)
|
|
2829
|
+
|
|
2830
|
+
```ts
|
|
2831
|
+
export interface CollectionState {
|
|
2832
|
+
status: 'ready' | 'loading' | 'empty' | 'error';
|
|
2833
|
+
message?: string;
|
|
2834
|
+
retryLabel?: string;
|
|
2835
|
+
}
|
|
2836
|
+
```
|
|
2837
|
+
|
|
2838
|
+
### ConfirmBlock
|
|
2839
|
+
|
|
2840
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L445)
|
|
2841
|
+
|
|
2842
|
+
```ts
|
|
2843
|
+
export interface ConfirmBlock extends UIBlock<ConfirmState> {
|
|
2844
|
+
readonly element: HTMLDialogElement;
|
|
2845
|
+
readonly confirmButton: HTMLButtonElement;
|
|
2846
|
+
readonly cancelButton: HTMLButtonElement;
|
|
2847
|
+
open(state?: ConfirmState): void;
|
|
2848
|
+
close(): void;
|
|
2849
|
+
refreshAvailability(): void;
|
|
2850
|
+
}
|
|
2851
|
+
```
|
|
2852
|
+
|
|
2853
|
+
Referenced public types and APIs: [`ConfirmState`](#confirmstate), [`UIBlock`](#uiblock).
|
|
2854
|
+
|
|
2855
|
+
### ConfirmState
|
|
2856
|
+
|
|
2857
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L444)
|
|
2858
|
+
|
|
2859
|
+
```ts
|
|
2860
|
+
export interface ConfirmState extends DialogState {
|
|
2861
|
+
message?: string | Node;
|
|
2862
|
+
hint?: string;
|
|
2863
|
+
error?: string;
|
|
2864
|
+
disabled?: boolean;
|
|
2865
|
+
pending?: boolean;
|
|
2866
|
+
confirmLabel?: string;
|
|
2867
|
+
}
|
|
2868
|
+
```
|
|
2869
|
+
|
|
2870
|
+
Referenced public types and APIs: [`DialogState`](#dialogstate).
|
|
2871
|
+
|
|
2872
|
+
### DialogBlock
|
|
2873
|
+
|
|
2874
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L347)
|
|
2875
|
+
|
|
2876
|
+
```ts
|
|
2877
|
+
export interface DialogBlock extends UIBlock<DialogState> {
|
|
2878
|
+
readonly element: HTMLDialogElement;
|
|
2879
|
+
readonly body: HTMLElement;
|
|
2880
|
+
open(): void;
|
|
2881
|
+
close(): void;
|
|
2882
|
+
}
|
|
2883
|
+
```
|
|
2884
|
+
|
|
2885
|
+
Referenced public types and APIs: [`DialogState`](#dialogstate), [`UIBlock`](#uiblock).
|
|
2886
|
+
|
|
2887
|
+
### DialogOptions
|
|
2888
|
+
|
|
2889
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L346)
|
|
2890
|
+
|
|
2891
|
+
```ts
|
|
2892
|
+
export interface DialogOptions extends DialogState {
|
|
2893
|
+
dialog?: HTMLDialogElement;
|
|
2894
|
+
content?: Node;
|
|
2895
|
+
actions?: Node;
|
|
2896
|
+
closeOnBackdrop?: boolean;
|
|
2897
|
+
onClose?: () => void;
|
|
2898
|
+
}
|
|
2899
|
+
```
|
|
2900
|
+
|
|
2901
|
+
Referenced public types and APIs: [`DialogState`](#dialogstate).
|
|
2902
|
+
|
|
2903
|
+
### DialogState
|
|
2904
|
+
|
|
2905
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L345)
|
|
2906
|
+
|
|
2907
|
+
```ts
|
|
2908
|
+
export interface DialogState {
|
|
2909
|
+
title: string;
|
|
2910
|
+
description?: string;
|
|
2911
|
+
eyebrow?: string;
|
|
2912
|
+
closeDisabled?: boolean;
|
|
2913
|
+
}
|
|
2914
|
+
```
|
|
2915
|
+
|
|
2916
|
+
### DisclosureBlock
|
|
2917
|
+
|
|
2918
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L301)
|
|
2919
|
+
|
|
2920
|
+
```ts
|
|
2921
|
+
export interface DisclosureBlock extends UIBlock<DisclosureState> {
|
|
2922
|
+
setOpen(open: boolean): void;
|
|
2923
|
+
isOpen(): boolean;
|
|
2924
|
+
}
|
|
2925
|
+
```
|
|
2926
|
+
|
|
2927
|
+
Referenced public types and APIs: [`DisclosureState`](#disclosurestate), [`UIBlock`](#uiblock).
|
|
2928
|
+
|
|
2929
|
+
### DisclosureState
|
|
2930
|
+
|
|
2931
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L300)
|
|
2932
|
+
|
|
2933
|
+
```ts
|
|
2934
|
+
export interface DisclosureState {
|
|
2935
|
+
title: string;
|
|
2936
|
+
description?: string;
|
|
2937
|
+
disabled?: boolean;
|
|
2938
|
+
}
|
|
2939
|
+
```
|
|
2940
|
+
|
|
2941
|
+
### FieldBlock
|
|
2942
|
+
|
|
2943
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L116)
|
|
2944
|
+
|
|
2945
|
+
```ts
|
|
2946
|
+
export interface FieldBlock extends UIBlock<FieldState> {
|
|
2947
|
+
readonly control: HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement;
|
|
2948
|
+
}
|
|
2949
|
+
```
|
|
2950
|
+
|
|
2951
|
+
Referenced public types and APIs: [`FieldState`](#fieldstate), [`UIBlock`](#uiblock).
|
|
2952
|
+
|
|
2953
|
+
### FieldState
|
|
2954
|
+
|
|
2955
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L109)
|
|
2956
|
+
|
|
2957
|
+
```ts
|
|
2958
|
+
export interface FieldState {
|
|
2959
|
+
label: string;
|
|
2960
|
+
description?: string;
|
|
2961
|
+
error?: string;
|
|
2962
|
+
required?: boolean;
|
|
2963
|
+
disabled?: boolean;
|
|
2964
|
+
}
|
|
2965
|
+
```
|
|
2966
|
+
|
|
2967
|
+
### FormSectionState
|
|
2968
|
+
|
|
2969
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L285)
|
|
2970
|
+
|
|
2971
|
+
```ts
|
|
2972
|
+
export interface FormSectionState {
|
|
2973
|
+
title: string;
|
|
2974
|
+
description?: string;
|
|
2975
|
+
}
|
|
2976
|
+
```
|
|
2977
|
+
|
|
2978
|
+
### IconState
|
|
2979
|
+
|
|
2980
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L61)
|
|
2981
|
+
|
|
2982
|
+
```ts
|
|
2983
|
+
export interface IconState {
|
|
2984
|
+
name: string;
|
|
2985
|
+
label?: string;
|
|
2986
|
+
size?: 'small' | 'normal';
|
|
2987
|
+
}
|
|
2988
|
+
```
|
|
2989
|
+
|
|
2990
|
+
### InputBlock
|
|
2991
|
+
|
|
2992
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L155)
|
|
2993
|
+
|
|
2994
|
+
```ts
|
|
2995
|
+
export interface InputBlock extends UIBlock<InputState> {
|
|
2996
|
+
readonly control: HTMLInputElement | HTMLTextAreaElement;
|
|
2997
|
+
getValue(): string;
|
|
2998
|
+
reset(value: string): void;
|
|
2999
|
+
focus(): void;
|
|
3000
|
+
}
|
|
3001
|
+
```
|
|
3002
|
+
|
|
3003
|
+
Referenced public types and APIs: [`InputState`](#inputstate), [`UIBlock`](#uiblock).
|
|
3004
|
+
|
|
3005
|
+
### InputOptions
|
|
3006
|
+
|
|
3007
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L146)
|
|
3008
|
+
|
|
3009
|
+
```ts
|
|
3010
|
+
export interface InputOptions extends InputState {
|
|
3011
|
+
value?: string;
|
|
3012
|
+
onInput?: (value: string, event: Event) => void;
|
|
3013
|
+
onChange?: (value: string, event: Event) => void;
|
|
3014
|
+
autocomplete?: string;
|
|
3015
|
+
min?: number;
|
|
3016
|
+
max?: number;
|
|
3017
|
+
step?: number | 'any';
|
|
3018
|
+
}
|
|
3019
|
+
```
|
|
3020
|
+
|
|
3021
|
+
Referenced public types and APIs: [`InputState`](#inputstate).
|
|
3022
|
+
|
|
3023
|
+
### InputState
|
|
3024
|
+
|
|
3025
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L141)
|
|
3026
|
+
|
|
3027
|
+
```ts
|
|
3028
|
+
export interface InputState extends FieldState {
|
|
3029
|
+
placeholder?: string;
|
|
3030
|
+
readOnly?: boolean;
|
|
3031
|
+
density?: Density;
|
|
3032
|
+
}
|
|
3033
|
+
```
|
|
3034
|
+
|
|
3035
|
+
Referenced public types and APIs: [`Density`](#density), [`FieldState`](#fieldstate).
|
|
3036
|
+
|
|
3037
|
+
### KeyValueState
|
|
3038
|
+
|
|
3039
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L79)
|
|
3040
|
+
|
|
3041
|
+
```ts
|
|
3042
|
+
export interface KeyValueState {
|
|
3043
|
+
items: readonly {
|
|
3044
|
+
key: string;
|
|
3045
|
+
label: string;
|
|
3046
|
+
value: string;
|
|
3047
|
+
}[];
|
|
3048
|
+
}
|
|
3049
|
+
```
|
|
3050
|
+
|
|
3051
|
+
### ListRowState
|
|
3052
|
+
|
|
3053
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L315)
|
|
3054
|
+
|
|
3055
|
+
```ts
|
|
3056
|
+
export interface ListRowState {
|
|
3057
|
+
title: string;
|
|
3058
|
+
description?: string;
|
|
3059
|
+
meta?: string;
|
|
3060
|
+
selected?: boolean;
|
|
3061
|
+
icon?: string;
|
|
3062
|
+
}
|
|
3063
|
+
```
|
|
3064
|
+
|
|
3065
|
+
### MenuItem
|
|
3066
|
+
|
|
3067
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L516)
|
|
3068
|
+
|
|
3069
|
+
```ts
|
|
3070
|
+
export interface MenuItem {
|
|
3071
|
+
id: string;
|
|
3072
|
+
label: string;
|
|
3073
|
+
disabled?: boolean;
|
|
3074
|
+
intent?: Intent;
|
|
3075
|
+
checked?: boolean;
|
|
3076
|
+
onAction: UIAction;
|
|
3077
|
+
}
|
|
3078
|
+
```
|
|
3079
|
+
|
|
3080
|
+
Referenced public types and APIs: [`Intent`](#intent), [`UIAction`](#uiaction).
|
|
3081
|
+
|
|
3082
|
+
### MenuState
|
|
3083
|
+
|
|
3084
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L517)
|
|
3085
|
+
|
|
3086
|
+
```ts
|
|
3087
|
+
export interface MenuState extends PopoverState {
|
|
3088
|
+
items: readonly MenuItem[];
|
|
3089
|
+
}
|
|
3090
|
+
```
|
|
3091
|
+
|
|
3092
|
+
Referenced public types and APIs: [`MenuItem`](#menuitem), [`PopoverState`](#popoverstate).
|
|
3093
|
+
|
|
3094
|
+
### NoticeState
|
|
3095
|
+
|
|
3096
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L261)
|
|
3097
|
+
|
|
3098
|
+
```ts
|
|
3099
|
+
export interface NoticeState {
|
|
3100
|
+
message: string;
|
|
3101
|
+
tone?: 'info' | 'success' | 'warning' | 'error';
|
|
3102
|
+
}
|
|
3103
|
+
```
|
|
3104
|
+
|
|
3105
|
+
### PopoverBlock
|
|
3106
|
+
|
|
3107
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L486)
|
|
3108
|
+
|
|
3109
|
+
```ts
|
|
3110
|
+
export interface PopoverBlock extends UIBlock<PopoverState> {
|
|
3111
|
+
readonly trigger: HTMLButtonElement;
|
|
3112
|
+
readonly panel: HTMLElement;
|
|
3113
|
+
open(): void;
|
|
3114
|
+
close(): void;
|
|
3115
|
+
isOpen(): boolean;
|
|
3116
|
+
}
|
|
3117
|
+
```
|
|
3118
|
+
|
|
3119
|
+
Referenced public types and APIs: [`PopoverState`](#popoverstate), [`UIBlock`](#uiblock).
|
|
3120
|
+
|
|
3121
|
+
### PopoverState
|
|
3122
|
+
|
|
3123
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L485)
|
|
3124
|
+
|
|
3125
|
+
```ts
|
|
3126
|
+
export interface PopoverState {
|
|
3127
|
+
label: string;
|
|
3128
|
+
disabled?: boolean;
|
|
3129
|
+
}
|
|
3130
|
+
```
|
|
3131
|
+
|
|
3132
|
+
### ProgressState
|
|
3133
|
+
|
|
3134
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L274)
|
|
3135
|
+
|
|
3136
|
+
```ts
|
|
3137
|
+
export interface ProgressState {
|
|
3138
|
+
label: string;
|
|
3139
|
+
value?: number;
|
|
3140
|
+
max?: number;
|
|
3141
|
+
}
|
|
3142
|
+
```
|
|
3143
|
+
|
|
3144
|
+
### ScrollAreaState
|
|
3145
|
+
|
|
3146
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L102)
|
|
3147
|
+
|
|
3148
|
+
```ts
|
|
3149
|
+
export interface ScrollAreaState {
|
|
3150
|
+
label: string;
|
|
3151
|
+
size?: 'small' | 'medium' | 'fill';
|
|
3152
|
+
}
|
|
3153
|
+
```
|
|
3154
|
+
|
|
3155
|
+
### SelectBlock
|
|
3156
|
+
|
|
3157
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L211)
|
|
3158
|
+
|
|
3159
|
+
```ts
|
|
3160
|
+
export interface SelectBlock extends UIBlock<SelectState> {
|
|
3161
|
+
readonly control: HTMLSelectElement;
|
|
3162
|
+
getValue(): string;
|
|
3163
|
+
reset(value: string): void;
|
|
3164
|
+
focus(): void;
|
|
3165
|
+
}
|
|
3166
|
+
```
|
|
3167
|
+
|
|
3168
|
+
Referenced public types and APIs: [`SelectState`](#selectstate), [`UIBlock`](#uiblock).
|
|
3169
|
+
|
|
3170
|
+
### SelectOption
|
|
3171
|
+
|
|
3172
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L208)
|
|
3173
|
+
|
|
3174
|
+
```ts
|
|
3175
|
+
export interface SelectOption {
|
|
3176
|
+
value: string;
|
|
3177
|
+
label: string;
|
|
3178
|
+
disabled?: boolean;
|
|
3179
|
+
}
|
|
3180
|
+
```
|
|
3181
|
+
|
|
3182
|
+
### SelectOptions
|
|
3183
|
+
|
|
3184
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L210)
|
|
3185
|
+
|
|
3186
|
+
```ts
|
|
3187
|
+
export interface SelectOptions extends SelectState {
|
|
3188
|
+
value?: string;
|
|
3189
|
+
onChange?: (value: string) => void;
|
|
3190
|
+
multiple?: boolean;
|
|
3191
|
+
size?: number;
|
|
3192
|
+
}
|
|
3193
|
+
```
|
|
3194
|
+
|
|
3195
|
+
Referenced public types and APIs: [`SelectState`](#selectstate).
|
|
3196
|
+
|
|
3197
|
+
### SelectState
|
|
3198
|
+
|
|
3199
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L209)
|
|
3200
|
+
|
|
3201
|
+
```ts
|
|
3202
|
+
export interface SelectState extends FieldState {
|
|
3203
|
+
options: readonly SelectOption[];
|
|
3204
|
+
density?: Density;
|
|
3205
|
+
}
|
|
3206
|
+
```
|
|
3207
|
+
|
|
3208
|
+
Referenced public types and APIs: [`Density`](#density), [`FieldState`](#fieldstate), [`SelectOption`](#selectoption).
|
|
3209
|
+
|
|
3210
|
+
### StatusState
|
|
3211
|
+
|
|
3212
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L267)
|
|
3213
|
+
|
|
3214
|
+
```ts
|
|
3215
|
+
export interface StatusState {
|
|
3216
|
+
label: string;
|
|
3217
|
+
tone?: 'neutral' | 'success' | 'warning' | 'error';
|
|
3218
|
+
}
|
|
3219
|
+
```
|
|
3220
|
+
|
|
3221
|
+
### TextEditBlock
|
|
3222
|
+
|
|
3223
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L386)
|
|
3224
|
+
|
|
3225
|
+
```ts
|
|
3226
|
+
export interface TextEditBlock extends Omit<UIBlock<TextEditState>, 'element'> {
|
|
3227
|
+
readonly element: HTMLDialogElement;
|
|
3228
|
+
readonly control: HTMLTextAreaElement;
|
|
3229
|
+
readonly submitButton: HTMLButtonElement;
|
|
3230
|
+
open(input: TextEditInput): void;
|
|
3231
|
+
close(): void;
|
|
3232
|
+
getValue(): string;
|
|
3233
|
+
focus(): void;
|
|
3234
|
+
}
|
|
3235
|
+
```
|
|
3236
|
+
|
|
3237
|
+
Referenced public types and APIs: [`TextEditInput`](#texteditinput), [`TextEditState`](#texteditstate), [`UIBlock`](#uiblock).
|
|
3238
|
+
|
|
3239
|
+
### TextEditInput
|
|
3240
|
+
|
|
3241
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L377)
|
|
3242
|
+
|
|
3243
|
+
```ts
|
|
3244
|
+
export interface TextEditInput {
|
|
3245
|
+
value: string;
|
|
3246
|
+
title?: string;
|
|
3247
|
+
description?: string;
|
|
3248
|
+
note?: string;
|
|
3249
|
+
}
|
|
3250
|
+
```
|
|
3251
|
+
|
|
3252
|
+
### TextEditOptions
|
|
3253
|
+
|
|
3254
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L378)
|
|
3255
|
+
|
|
3256
|
+
```ts
|
|
3257
|
+
export interface TextEditOptions extends Partial<TextEditState> {
|
|
3258
|
+
dialog?: HTMLDialogElement;
|
|
3259
|
+
ids?: {
|
|
3260
|
+
form?: string;
|
|
3261
|
+
control?: string;
|
|
3262
|
+
submit?: string;
|
|
3263
|
+
error?: string;
|
|
3264
|
+
title?: string;
|
|
3265
|
+
cancel?: string;
|
|
3266
|
+
};
|
|
3267
|
+
label?: string;
|
|
3268
|
+
onInput?: (value: string) => void;
|
|
3269
|
+
onSubmit?: (text: string) => Promise<ActionResult> | ActionResult;
|
|
3270
|
+
onClose?: () => void;
|
|
3271
|
+
}
|
|
3272
|
+
```
|
|
3273
|
+
|
|
3274
|
+
Referenced public types and APIs: [`ActionResult`](#actionresult), [`TextEditState`](#texteditstate).
|
|
3275
|
+
|
|
3276
|
+
### TextEditState
|
|
3277
|
+
|
|
3278
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L376)
|
|
3279
|
+
|
|
3280
|
+
```ts
|
|
3281
|
+
export interface TextEditState extends DialogState {
|
|
3282
|
+
error?: string;
|
|
3283
|
+
disabled?: boolean;
|
|
3284
|
+
pending?: boolean;
|
|
3285
|
+
inputDisabled?: boolean;
|
|
3286
|
+
note?: string;
|
|
3287
|
+
submitLabel?: string;
|
|
3288
|
+
}
|
|
3289
|
+
```
|
|
3290
|
+
|
|
3291
|
+
Referenced public types and APIs: [`DialogState`](#dialogstate).
|
|
3292
|
+
|
|
3293
|
+
### ToolbarState
|
|
3294
|
+
|
|
3295
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/primitives.ts#L94)
|
|
3296
|
+
|
|
3297
|
+
```ts
|
|
3298
|
+
export interface ToolbarState {
|
|
3299
|
+
label: string;
|
|
3300
|
+
density?: Density;
|
|
3301
|
+
}
|
|
3302
|
+
```
|
|
3303
|
+
|
|
3304
|
+
Referenced public types and APIs: [`Density`](#density).
|
|
3305
|
+
|
|
3306
|
+
## src/tasks/approval.ts
|
|
3307
|
+
|
|
3308
|
+
### createApprovalPanel
|
|
3309
|
+
|
|
3310
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/tasks/approval.ts#L8)
|
|
3311
|
+
|
|
3312
|
+
```ts
|
|
3313
|
+
export declare function createApprovalPanel(initial: ApprovalPanelState, options?: {
|
|
3314
|
+
element?: HTMLElement;
|
|
3315
|
+
idPrefix?: string;
|
|
3316
|
+
onAction?: (id: string, action: 'deny' | 'always' | 'allow') => void;
|
|
3317
|
+
}): UIBlock<ApprovalPanelState>;
|
|
3318
|
+
```
|
|
3319
|
+
|
|
3320
|
+
Referenced public types and APIs: [`ApprovalPanelState`](#approvalpanelstate), [`UIBlock`](#uiblock).
|
|
3321
|
+
|
|
3322
|
+
Related gallery: [approval-panel](https://minifish-org.github.io/pith-ui/?item=approval-panel).
|
|
3323
|
+
|
|
3324
|
+
### ApprovalPanelState
|
|
3325
|
+
|
|
3326
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/tasks/approval.ts#L7)
|
|
3327
|
+
|
|
3328
|
+
```ts
|
|
3329
|
+
export interface ApprovalPanelState {
|
|
3330
|
+
approval: ApprovalView | null;
|
|
3331
|
+
disabled?: boolean;
|
|
3332
|
+
}
|
|
3333
|
+
```
|
|
3334
|
+
|
|
3335
|
+
Referenced public types and APIs: [`ApprovalView`](#approvalview).
|
|
3336
|
+
|
|
3337
|
+
### ApprovalView
|
|
3338
|
+
|
|
3339
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/tasks/approval.ts#L6)
|
|
3340
|
+
|
|
3341
|
+
```ts
|
|
3342
|
+
export interface ApprovalView {
|
|
3343
|
+
id: string;
|
|
3344
|
+
toolName: string;
|
|
3345
|
+
warning?: string;
|
|
3346
|
+
canAlwaysAllow: boolean;
|
|
3347
|
+
argsText: string;
|
|
3348
|
+
preview?: {
|
|
3349
|
+
kind: string;
|
|
3350
|
+
path: string;
|
|
3351
|
+
error?: string;
|
|
3352
|
+
diff?: string;
|
|
3353
|
+
truncated?: boolean;
|
|
3354
|
+
};
|
|
3355
|
+
}
|
|
3356
|
+
```
|
|
3357
|
+
|
|
3358
|
+
## src/tasks/permission.ts
|
|
3359
|
+
|
|
3360
|
+
### createFullAccessConfirmation
|
|
3361
|
+
|
|
3362
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/tasks/permission.ts#L7)
|
|
3363
|
+
|
|
3364
|
+
```ts
|
|
3365
|
+
export declare function createFullAccessConfirmation(initial: FullAccessState, options?: FullAccessOptions): UIBlock<FullAccessState> & {
|
|
3366
|
+
readonly confirmButton: HTMLButtonElement;
|
|
3367
|
+
};
|
|
3368
|
+
```
|
|
3369
|
+
|
|
3370
|
+
Referenced public types and APIs: [`FullAccessOptions`](#fullaccessoptions), [`FullAccessState`](#fullaccessstate), [`UIBlock`](#uiblock).
|
|
3371
|
+
|
|
3372
|
+
Related gallery: [full-access-confirmation](https://minifish-org.github.io/pith-ui/?item=full-access-confirmation).
|
|
3373
|
+
|
|
3374
|
+
### createPermissionControl
|
|
3375
|
+
|
|
3376
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/tasks/permission.ts#L24)
|
|
3377
|
+
|
|
3378
|
+
```ts
|
|
3379
|
+
export declare function createPermissionControl(initial: PermissionControlState, options?: {
|
|
3380
|
+
element?: HTMLElement;
|
|
3381
|
+
descriptionElement?: HTMLElement;
|
|
3382
|
+
onChange?: (value: string) => void;
|
|
3383
|
+
}): UIBlock<PermissionControlState>;
|
|
3384
|
+
```
|
|
3385
|
+
|
|
3386
|
+
Referenced public types and APIs: [`PermissionControlState`](#permissioncontrolstate), [`UIBlock`](#uiblock).
|
|
3387
|
+
|
|
3388
|
+
Related gallery: [permission-control](https://minifish-org.github.io/pith-ui/?item=permission-control).
|
|
3389
|
+
|
|
3390
|
+
### createTaskFailure
|
|
3391
|
+
|
|
3392
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/tasks/permission.ts#L17)
|
|
3393
|
+
|
|
3394
|
+
```ts
|
|
3395
|
+
export declare function createTaskFailure(initial: TaskFailureState, options?: {
|
|
3396
|
+
element?: HTMLElement;
|
|
3397
|
+
onContinue?: () => void;
|
|
3398
|
+
onSettings?: () => void;
|
|
3399
|
+
onDiagnostics?: () => void;
|
|
3400
|
+
}): UIBlock<TaskFailureState>;
|
|
3401
|
+
```
|
|
3402
|
+
|
|
3403
|
+
Referenced public types and APIs: [`TaskFailureState`](#taskfailurestate), [`UIBlock`](#uiblock).
|
|
3404
|
+
|
|
3405
|
+
Related gallery: [task-failure](https://minifish-org.github.io/pith-ui/?item=task-failure).
|
|
3406
|
+
|
|
3407
|
+
### FullAccessOptions
|
|
3408
|
+
|
|
3409
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/tasks/permission.ts#L6)
|
|
3410
|
+
|
|
3411
|
+
```ts
|
|
3412
|
+
export interface FullAccessOptions {
|
|
3413
|
+
idPrefix?: string;
|
|
3414
|
+
onConfirm?: () => ActionResult | Promise<ActionResult>;
|
|
3415
|
+
}
|
|
3416
|
+
```
|
|
3417
|
+
|
|
3418
|
+
Referenced public types and APIs: [`ActionResult`](#actionresult).
|
|
3419
|
+
|
|
3420
|
+
### FullAccessState
|
|
3421
|
+
|
|
3422
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/tasks/permission.ts#L5)
|
|
3423
|
+
|
|
3424
|
+
```ts
|
|
3425
|
+
export interface FullAccessState {
|
|
3426
|
+
title?: string;
|
|
3427
|
+
error?: string;
|
|
3428
|
+
disabled?: boolean;
|
|
3429
|
+
}
|
|
3430
|
+
```
|
|
3431
|
+
|
|
3432
|
+
### PermissionControlState
|
|
3433
|
+
|
|
3434
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/tasks/permission.ts#L23)
|
|
3435
|
+
|
|
3436
|
+
```ts
|
|
3437
|
+
export interface PermissionControlState {
|
|
3438
|
+
mode: string;
|
|
3439
|
+
description: string;
|
|
3440
|
+
disabled?: boolean;
|
|
3441
|
+
}
|
|
3442
|
+
```
|
|
3443
|
+
|
|
3444
|
+
### TaskFailureState
|
|
3445
|
+
|
|
3446
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/tasks/permission.ts#L16)
|
|
3447
|
+
|
|
3448
|
+
```ts
|
|
3449
|
+
export interface TaskFailureState {
|
|
3450
|
+
visible: boolean;
|
|
3451
|
+
message: string;
|
|
3452
|
+
advice: string;
|
|
3453
|
+
canContinue: boolean;
|
|
3454
|
+
workspaceId?: string;
|
|
3455
|
+
}
|
|
3456
|
+
```
|
|
3457
|
+
|
|
3458
|
+
## src/tasks/runtime.ts
|
|
3459
|
+
|
|
3460
|
+
### createRuntimePanel
|
|
3461
|
+
|
|
3462
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/tasks/runtime.ts#L5)
|
|
3463
|
+
|
|
3464
|
+
```ts
|
|
3465
|
+
export declare function createRuntimePanel(initial: RuntimePanelState, options?: {
|
|
3466
|
+
element?: HTMLElement;
|
|
3467
|
+
idPrefix?: string;
|
|
3468
|
+
costs?: Node;
|
|
3469
|
+
}): UIBlock<RuntimePanelState> & {
|
|
3470
|
+
updateTiming(value: {
|
|
3471
|
+
summary: string;
|
|
3472
|
+
duration: string;
|
|
3473
|
+
speed: string;
|
|
3474
|
+
}): void;
|
|
3475
|
+
};
|
|
3476
|
+
```
|
|
3477
|
+
|
|
3478
|
+
Referenced public types and APIs: [`RuntimePanelState`](#runtimepanelstate), [`UIBlock`](#uiblock).
|
|
3479
|
+
|
|
3480
|
+
Related gallery: [runtime-panel](https://minifish-org.github.io/pith-ui/?item=runtime-panel).
|
|
3481
|
+
|
|
3482
|
+
### RuntimePanelState
|
|
3483
|
+
|
|
3484
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/tasks/runtime.ts#L4)
|
|
3485
|
+
|
|
3486
|
+
```ts
|
|
3487
|
+
export interface RuntimePanelState {
|
|
3488
|
+
visible: boolean;
|
|
3489
|
+
summary: string;
|
|
3490
|
+
duration: string;
|
|
3491
|
+
speed: string;
|
|
3492
|
+
provider?: string;
|
|
3493
|
+
thinkingLevel?: string;
|
|
3494
|
+
inputTokens: string;
|
|
3495
|
+
outputTokens: string;
|
|
3496
|
+
cacheRead: string;
|
|
3497
|
+
cacheWrite: string;
|
|
3498
|
+
contextTokens: string;
|
|
3499
|
+
contextWindow: string;
|
|
3500
|
+
compactions: string;
|
|
3501
|
+
toolFailures: string;
|
|
3502
|
+
recordedCost: string;
|
|
3503
|
+
latestCost: string;
|
|
3504
|
+
}
|
|
3505
|
+
```
|
|
3506
|
+
|
|
3507
|
+
## src/theme.ts
|
|
3508
|
+
|
|
3509
|
+
### Appearance
|
|
3510
|
+
|
|
3511
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/theme.ts#L1)
|
|
3512
|
+
|
|
3513
|
+
```ts
|
|
3514
|
+
export type Appearance = 'light' | 'dark' | 'system';
|
|
3515
|
+
```
|
|
3516
|
+
|
|
3517
|
+
### setAppearance
|
|
3518
|
+
|
|
3519
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/theme.ts#L3)
|
|
3520
|
+
|
|
3521
|
+
```ts
|
|
3522
|
+
/** Scope tokens and styles to an explicit application or preview root. */
|
|
3523
|
+
export declare function setAppearance(root: HTMLElement, appearance?: Appearance): void;
|
|
3524
|
+
```
|
|
3525
|
+
|
|
3526
|
+
Referenced public types and APIs: [`Appearance`](#appearance).
|
|
3527
|
+
|
|
3528
|
+
Related gallery: [foundation-colors](https://minifish-org.github.io/pith-ui/?item=foundation-colors), [foundation-surfaces](https://minifish-org.github.io/pith-ui/?item=foundation-surfaces).
|
|
3529
|
+
|
|
3530
|
+
## src/workspace.ts
|
|
3531
|
+
|
|
3532
|
+
### createComposerView
|
|
3533
|
+
|
|
3534
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/workspace.ts#L31)
|
|
3535
|
+
|
|
3536
|
+
```ts
|
|
3537
|
+
export declare function createComposerView(options?: ComposerViewOptions): {
|
|
3538
|
+
element: HTMLFormElement;
|
|
3539
|
+
input: HTMLTextAreaElement;
|
|
3540
|
+
update: (state: ComposerViewState) => void;
|
|
3541
|
+
getValue: () => string;
|
|
3542
|
+
reset(value: string): void;
|
|
3543
|
+
focus: () => void;
|
|
3544
|
+
resize: () => void;
|
|
3545
|
+
pickImages(): void;
|
|
3546
|
+
destroy(): void;
|
|
3547
|
+
};
|
|
3548
|
+
```
|
|
3549
|
+
|
|
3550
|
+
Referenced public types and APIs: [`ComposerViewOptions`](#composerviewoptions), [`ComposerViewState`](#composerviewstate).
|
|
3551
|
+
|
|
3552
|
+
Related gallery: [composer](https://minifish-org.github.io/pith-ui/?item=composer), [drop-feedback](https://minifish-org.github.io/pith-ui/?item=drop-feedback).
|
|
3553
|
+
|
|
3554
|
+
### createWorkspaceShell
|
|
3555
|
+
|
|
3556
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/workspace.ts#L115)
|
|
3557
|
+
|
|
3558
|
+
```ts
|
|
3559
|
+
export declare function createWorkspaceShell(options: WorkspaceShellOptions): {
|
|
3560
|
+
element: HTMLDivElement;
|
|
3561
|
+
composer: {
|
|
3562
|
+
element: HTMLFormElement;
|
|
3563
|
+
input: HTMLTextAreaElement;
|
|
3564
|
+
update: (state: ComposerViewState) => void;
|
|
3565
|
+
getValue: () => string;
|
|
3566
|
+
reset(value: string): void;
|
|
3567
|
+
focus: () => void;
|
|
3568
|
+
resize: () => void;
|
|
3569
|
+
pickImages(): void;
|
|
3570
|
+
destroy(): void;
|
|
3571
|
+
};
|
|
3572
|
+
part: <T extends HTMLElement = HTMLElement>(name: string) => T;
|
|
3573
|
+
update(state: Readonly<WorkspaceShellState>): void;
|
|
3574
|
+
setSidebarOpen: (open: boolean) => void;
|
|
3575
|
+
openDialog(name: WorkspaceDialogName): void;
|
|
3576
|
+
closeDialog(name: WorkspaceDialogName): void;
|
|
3577
|
+
isDialogOpen(name: WorkspaceDialogName): boolean;
|
|
3578
|
+
updateActionAvailability(unavailable: (scope: ActionScope) => boolean, root?: ParentNode): void;
|
|
3579
|
+
destroy(): void;
|
|
3580
|
+
};
|
|
3581
|
+
```
|
|
3582
|
+
|
|
3583
|
+
Referenced public types and APIs: [`ActionScope`](#actionscope), [`ComposerViewState`](#composerviewstate), [`WorkspaceDialogName`](#workspacedialogname), [`WorkspaceShellOptions`](#workspaceshelloptions), [`WorkspaceShellState`](#workspaceshellstate).
|
|
3584
|
+
|
|
3585
|
+
Related gallery: [workspace-chat](https://minifish-org.github.io/pith-ui/?item=workspace-chat).
|
|
3586
|
+
|
|
3587
|
+
### ActionScope
|
|
3588
|
+
|
|
3589
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/workspace.ts#L112)
|
|
3590
|
+
|
|
3591
|
+
```ts
|
|
3592
|
+
export interface ActionScope {
|
|
3593
|
+
kind: 'global' | 'conversation' | 'workspace' | 'active';
|
|
3594
|
+
id?: string;
|
|
3595
|
+
}
|
|
3596
|
+
```
|
|
3597
|
+
|
|
3598
|
+
### ComposerViewOptions
|
|
3599
|
+
|
|
3600
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/workspace.ts#L13)
|
|
3601
|
+
|
|
3602
|
+
```ts
|
|
3603
|
+
export interface ComposerViewOptions {
|
|
3604
|
+
prefix?: string;
|
|
3605
|
+
onSubmit?: (text: string) => void | ActionResult | Promise<void | ActionResult>;
|
|
3606
|
+
onStop?: () => void | ActionResult | Promise<void | ActionResult>;
|
|
3607
|
+
onInput?: (text: string) => void;
|
|
3608
|
+
onModel?: () => void;
|
|
3609
|
+
onAttach?: () => void;
|
|
3610
|
+
onImages?: (files: File[]) => void;
|
|
3611
|
+
onThinkingChange?: (value: string) => void;
|
|
3612
|
+
}
|
|
3613
|
+
```
|
|
3614
|
+
|
|
3615
|
+
Referenced public types and APIs: [`ActionResult`](#actionresult).
|
|
3616
|
+
|
|
3617
|
+
### ComposerViewState
|
|
3618
|
+
|
|
3619
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/workspace.ts#L7)
|
|
3620
|
+
|
|
3621
|
+
```ts
|
|
3622
|
+
export interface ComposerViewState {
|
|
3623
|
+
placeholder?: string;
|
|
3624
|
+
disabled?: boolean;
|
|
3625
|
+
readOnly?: boolean;
|
|
3626
|
+
action?: 'send' | 'queue' | 'stop';
|
|
3627
|
+
actionDisabled?: boolean;
|
|
3628
|
+
model?: {
|
|
3629
|
+
label: string;
|
|
3630
|
+
description: string;
|
|
3631
|
+
disabled?: boolean;
|
|
3632
|
+
};
|
|
3633
|
+
thinking?: {
|
|
3634
|
+
options: readonly {
|
|
3635
|
+
value: string;
|
|
3636
|
+
label: string;
|
|
3637
|
+
}[];
|
|
3638
|
+
value: string;
|
|
3639
|
+
disabled?: boolean;
|
|
3640
|
+
};
|
|
3641
|
+
}
|
|
3642
|
+
```
|
|
3643
|
+
|
|
3644
|
+
### WorkspaceDialogName
|
|
3645
|
+
|
|
3646
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/workspace.ts#L111)
|
|
3647
|
+
|
|
3648
|
+
```ts
|
|
3649
|
+
export type WorkspaceDialogName = 'model' | 'settings' | 'workspace' | 'permissions' | 'delete' | 'rename' | 'queue-edit' | 'message-edit' | 'resources' | 'connections' | 'preview' | 'image';
|
|
3650
|
+
```
|
|
3651
|
+
|
|
3652
|
+
### WorkspaceShellOptions
|
|
3653
|
+
|
|
3654
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/workspace.ts#L113)
|
|
3655
|
+
|
|
3656
|
+
```ts
|
|
3657
|
+
export interface WorkspaceShellOptions {
|
|
3658
|
+
brand: Node;
|
|
3659
|
+
prefix?: string;
|
|
3660
|
+
composer?: ComposerViewOptions;
|
|
3661
|
+
onDialogClose?: (name: WorkspaceDialogName) => void;
|
|
3662
|
+
onSearch?: (query: string) => void;
|
|
3663
|
+
onBusyAction?: (key: string) => void;
|
|
3664
|
+
}
|
|
3665
|
+
```
|
|
3666
|
+
|
|
3667
|
+
Referenced public types and APIs: [`ComposerViewOptions`](#composerviewoptions), [`WorkspaceDialogName`](#workspacedialogname).
|
|
3668
|
+
|
|
3669
|
+
### WorkspaceShellState
|
|
3670
|
+
|
|
3671
|
+
[Source](https://github.com/minifish-org/pith-ui/blob/main/src/workspace.ts#L114)
|
|
3672
|
+
|
|
3673
|
+
```ts
|
|
3674
|
+
export interface WorkspaceShellState {
|
|
3675
|
+
workspace?: string;
|
|
3676
|
+
conversation?: string;
|
|
3677
|
+
reconnecting?: boolean;
|
|
3678
|
+
error?: {
|
|
3679
|
+
message: string;
|
|
3680
|
+
hidden?: boolean;
|
|
3681
|
+
};
|
|
3682
|
+
busy?: {
|
|
3683
|
+
key: string;
|
|
3684
|
+
message: string;
|
|
3685
|
+
actionLabel: string;
|
|
3686
|
+
} | null;
|
|
3687
|
+
}
|
|
3688
|
+
```
|