meowtail 0.2.0-alpha.0 → 0.2.0-alpha.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/AGENT-COMPONENTS.md +65 -65
- package/ASSISTANT.md +35 -35
- package/JSON.md +11 -11
- package/README.md +397 -385
- package/THIRD_PARTY_NOTICES.md +8 -0
- package/dist/src/chat/attachments.js +9 -5
- package/dist/src/chat/composer-panel.d.ts +17 -0
- package/dist/src/chat/composer-panel.js +12 -0
- package/dist/src/chat/composer.d.ts +2 -0
- package/dist/src/chat/composer.js +5 -2
- package/dist/src/chat/conversation.js +2 -2
- package/dist/src/chat/index.d.ts +1 -0
- package/dist/src/chat/index.js +1 -0
- package/dist/src/chat/message-list.js +1 -1
- package/dist/src/chat/message.js +3 -3
- package/dist/src/chat/question.js +1 -1
- package/dist/src/chat/sources.js +1 -1
- package/dist/src/chat/tool-call.js +6 -6
- package/dist/src/components/action-rail.d.ts +19 -0
- package/dist/src/components/action-rail.js +13 -0
- package/dist/src/components/add-button.js +1 -1
- package/dist/src/components/alert.d.ts +2 -0
- package/dist/src/components/alert.js +2 -1
- package/dist/src/components/app-bar.d.ts +17 -0
- package/dist/src/components/app-bar.js +10 -0
- package/dist/src/components/breadcrumb.js +1 -1
- package/dist/src/components/choice-select.js +1 -1
- package/dist/src/components/code-block.js +6 -6
- package/dist/src/components/credential-source.js +12 -12
- package/dist/src/components/diff-block.js +1 -1
- package/dist/src/components/hover-card.js +2 -2
- package/dist/src/components/image-lightbox.js +3 -3
- package/dist/src/components/image-preview.js +1 -1
- package/dist/src/components/index.d.ts +3 -0
- package/dist/src/components/index.js +3 -0
- package/dist/src/components/json-block.js +2 -2
- package/dist/src/components/json-tree.js +3 -3
- package/dist/src/components/list-group.d.ts +1 -1
- package/dist/src/components/meta-row.d.ts +33 -0
- package/dist/src/components/meta-row.js +45 -0
- package/dist/src/components/output-block.js +7 -7
- package/dist/src/components/page-frame.d.ts +6 -2
- package/dist/src/components/page-frame.js +2 -2
- package/dist/src/components/path-picker.js +4 -4
- package/dist/src/components/process-group.d.ts +2 -2
- package/dist/src/components/rail-item.d.ts +2 -2
- package/dist/src/components/rail-section.d.ts +1 -1
- package/dist/src/components/read-block.js +2 -2
- package/dist/src/components/resource-card.d.ts +1 -1
- package/dist/src/components/resource-link.d.ts +1 -1
- package/dist/src/components/search-block.js +2 -3
- package/dist/src/components/terminal-block.js +6 -6
- package/dist/src/components/web-block.js +3 -3
- package/dist/src/components/work-card.d.ts +2 -2
- package/dist/src/components/work-card.js +1 -1
- package/dist/src/icons/README.md +13 -2
- package/dist/src/icons/icon-frame.d.ts +11 -0
- package/dist/src/icons/icon-frame.js +4 -0
- package/dist/src/icons/icon-source.d.ts +17 -0
- package/dist/src/icons/icon-source.js +6 -0
- package/dist/src/icons/icon.d.ts +44 -37
- package/dist/src/icons/icon.js +55 -128
- package/dist/src/icons/index.d.ts +1 -0
- package/dist/src/icons/index.js +1 -0
- package/dist/src/icons/lucide.d.ts +1 -0
- package/dist/src/icons/lucide.js +4 -0
- package/dist/src/registry/index.d.ts +38 -3
- package/dist/src/registry/index.js +11 -2
- package/dist/src/shared/execution-state.js +7 -7
- package/dist/src/theme/chat/composer-panel.styles.d.ts +1 -0
- package/dist/src/theme/chat/composer-panel.styles.js +44 -0
- package/dist/src/theme/chat/composer.styles.js +37 -6
- package/dist/src/theme/components/action-rail.styles.d.ts +1 -0
- package/dist/src/theme/components/action-rail.styles.js +47 -0
- package/dist/src/theme/components/alert.styles.js +42 -1
- package/dist/src/theme/components/app-bar.styles.d.ts +1 -0
- package/dist/src/theme/components/app-bar.styles.js +48 -0
- package/dist/src/theme/components/code-block.styles.js +7 -0
- package/dist/src/theme/components/dialog.styles.js +7 -0
- package/dist/src/theme/components/list-group.styles.js +1 -0
- package/dist/src/theme/components/meta-row.styles.d.ts +1 -0
- package/dist/src/theme/components/meta-row.styles.js +66 -0
- package/dist/src/theme/components/output-block.styles.js +9 -0
- package/dist/src/theme/components/page-frame.styles.js +7 -1
- package/dist/src/theme/components/page-header.styles.js +7 -0
- package/dist/src/theme/components/resource-card.styles.js +7 -0
- package/dist/src/theme/components/tag.styles.js +3 -3
- package/dist/src/theme/components/toolbar.styles.js +7 -0
- package/dist/src/theme/index.d.ts +15 -15
- package/dist/src/theme/index.js +8 -0
- package/dist/src/theme/palette.d.ts +1 -1
- package/dist/src/theme/palette.js +1 -1
- package/dist/src/theme/shared/code-highlight.tokens.d.ts +6 -6
- package/dist/src/theme/shared/code-highlight.tokens.js +6 -6
- package/dist/src/theme/tokens.d.ts +7 -7
- package/dist/src/theme/tokens.js +14 -8
- package/package.json +7 -2
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -25,3 +25,11 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
25
25
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
26
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
27
|
SOFTWARE.
|
|
28
|
+
|
|
29
|
+
# Lucide
|
|
30
|
+
|
|
31
|
+
Functional icon geometry in `Icon` and the `meowtail/icons/lucide` pass-through
|
|
32
|
+
is provided by Lucide (https://lucide.dev), version 1.59.0, under the ISC
|
|
33
|
+
license; icons derived from the Feather project are under the MIT license. The
|
|
34
|
+
full license text, including the Feather attribution list, ships in
|
|
35
|
+
`dist/src/icons/LUCIDE-LICENSE` and in the installed `lucide` package.
|
|
@@ -18,7 +18,7 @@ export const chatAttachmentsContract = {
|
|
|
18
18
|
"remove",
|
|
19
19
|
],
|
|
20
20
|
};
|
|
21
|
-
export const ChatAttachments = defineComponent(chatAttachmentsContract, ({ items, label = "
|
|
21
|
+
export const ChatAttachments = defineComponent(chatAttachmentsContract, ({ items, label = "Message attachments", className, ...props }, context) => context.part("root", "div", {
|
|
22
22
|
...props,
|
|
23
23
|
className,
|
|
24
24
|
role: "group",
|
|
@@ -28,7 +28,7 @@ export const ChatAttachments = defineComponent(chatAttachmentsContract, ({ items
|
|
|
28
28
|
? context.part("remove", "button", {
|
|
29
29
|
type: "button",
|
|
30
30
|
onClick: item.onRemove,
|
|
31
|
-
"aria-label":
|
|
31
|
+
"aria-label": `Remove ${item.name}`,
|
|
32
32
|
}, h(Icon, { name: "x" }))
|
|
33
33
|
: null;
|
|
34
34
|
return item.mediaType.startsWith("image/")
|
|
@@ -36,13 +36,13 @@ export const ChatAttachments = defineComponent(chatAttachmentsContract, ({ items
|
|
|
36
36
|
? {
|
|
37
37
|
type: "button",
|
|
38
38
|
onClick: item.onPreview,
|
|
39
|
-
"aria-label":
|
|
39
|
+
"aria-label": `Preview ${item.name}`,
|
|
40
40
|
}
|
|
41
41
|
: {
|
|
42
42
|
href: item.url,
|
|
43
43
|
target: "_blank",
|
|
44
44
|
rel: "noreferrer",
|
|
45
|
-
"aria-label":
|
|
45
|
+
"aria-label": `Open image ${item.name}`,
|
|
46
46
|
}, context.part("preview", "span", null, h(ImagePreview, { src: item.url, alt: item.name }))), remove)
|
|
47
47
|
: context.part("entry", "div", { key: item.id, "data-kind": "file" }, context.part("file", "a", {
|
|
48
48
|
key: item.id,
|
|
@@ -64,7 +64,11 @@ export const ChatAttachments = defineComponent(chatAttachmentsContract, ({ items
|
|
|
64
64
|
.filter(Boolean)
|
|
65
65
|
.join(" "))
|
|
66
66
|
: null)), item.onPreview
|
|
67
|
-
? context.part("previewButton", "button", {
|
|
67
|
+
? context.part("previewButton", "button", {
|
|
68
|
+
type: "button",
|
|
69
|
+
onClick: item.onPreview,
|
|
70
|
+
"aria-label": `Preview ${item.name}`,
|
|
71
|
+
}, "Preview")
|
|
68
72
|
: null, remove);
|
|
69
73
|
})));
|
|
70
74
|
function formatBytes(value) {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type Child } from "meowjsx";
|
|
2
|
+
import { type ChatComposerProps } from "./composer.js";
|
|
3
|
+
export declare const composerPanelContract: {
|
|
4
|
+
readonly name: "composer-panel";
|
|
5
|
+
readonly parts: readonly ["root", "surface", "meta"];
|
|
6
|
+
};
|
|
7
|
+
export interface ComposerPanelProps extends Omit<ChatComposerProps, "surface" | "className"> {
|
|
8
|
+
/** Page-level facts below the writing surface, usually a MetaRow. */
|
|
9
|
+
meta?: Child;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Composer chrome: one surface around a bare ChatComposer, plus an optional
|
|
14
|
+
* page-level meta row below it. Behavior, draft and submission stay in
|
|
15
|
+
* ChatComposer; this component only owns the surrounding composition.
|
|
16
|
+
*/
|
|
17
|
+
export declare const ComposerPanel: import("meowjsx").Component<ComposerPanelProps, "composer-panel", "meta" | "root" | "surface">;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { defineComponent, h } from "meowjsx";
|
|
2
|
+
import { ChatComposer } from "./composer.js";
|
|
3
|
+
export const composerPanelContract = {
|
|
4
|
+
name: "composer-panel",
|
|
5
|
+
parts: ["root", "surface", "meta"],
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Composer chrome: one surface around a bare ChatComposer, plus an optional
|
|
9
|
+
* page-level meta row below it. Behavior, draft and submission stay in
|
|
10
|
+
* ChatComposer; this component only owns the surrounding composition.
|
|
11
|
+
*/
|
|
12
|
+
export const ComposerPanel = defineComponent(composerPanelContract, ({ meta, className, ...props }, context) => context.part("root", "div", { className, "data-pattern": "composer-panel" }, context.part("surface", "div", null, h(ChatComposer, { ...props, surface: "none" })), meta !== undefined && meta !== null ? context.part("meta", "div", null, meta) : null));
|
|
@@ -2,12 +2,14 @@ import { type ThemedProps } from "meowcss/meowjsx";
|
|
|
2
2
|
import { type Child, type MaybeSignal, type Props } from "meowjsx";
|
|
3
3
|
export declare const chatComposerOptions: import("meowcss").Options<{
|
|
4
4
|
readonly layout: readonly ["stacked", "inline", "hero"];
|
|
5
|
+
readonly surface: readonly ["default", "none"];
|
|
5
6
|
}>;
|
|
6
7
|
export declare const chatComposerContract: {
|
|
7
8
|
readonly name: "chat-composer";
|
|
8
9
|
readonly parts: readonly ["root", "attachments", "field", "input", "hint", "actions", "trailing", "submit"];
|
|
9
10
|
readonly styleProps: import("meowcss/meowjsx").StylePropsBinding<import("meowcss").Options<{
|
|
10
11
|
readonly layout: readonly ["stacked", "inline", "hero"];
|
|
12
|
+
readonly surface: readonly ["default", "none"];
|
|
11
13
|
}>>;
|
|
12
14
|
};
|
|
13
15
|
export type ChatComposerSubmit = (event: SubmitEvent) => void;
|
|
@@ -4,13 +4,16 @@ import { defineComponent, h } from "meowjsx";
|
|
|
4
4
|
import { Icon } from "../icons/icon.js";
|
|
5
5
|
export const chatComposerOptions = defineOptions("chat-composer", {
|
|
6
6
|
layout: ["stacked", "inline", "hero"],
|
|
7
|
+
surface: ["default", "none"],
|
|
7
8
|
});
|
|
8
9
|
export const chatComposerContract = {
|
|
9
10
|
name: "chat-composer",
|
|
10
11
|
parts: ["root", "attachments", "field", "input", "hint", "actions", "trailing", "submit"],
|
|
11
|
-
styleProps: defineStyleProps(chatComposerOptions, {
|
|
12
|
+
styleProps: defineStyleProps(chatComposerOptions, {
|
|
13
|
+
defaults: { layout: "stacked", surface: "default" },
|
|
14
|
+
}),
|
|
12
15
|
};
|
|
13
|
-
export const ChatComposer = defineComponent(chatComposerContract, ({ value = "", placeholder = "
|
|
16
|
+
export const ChatComposer = defineComponent(chatComposerContract, ({ value = "", placeholder = "Write a message…", inputLabel = "Message", attachments, trailing, hint, hintId, submitLabel = "Send", submitContent, disabled = false, submitDisabled = false, onSubmit, onInput, children, className, ...props }, context) => context.part("root", "form", {
|
|
14
17
|
...props,
|
|
15
18
|
className,
|
|
16
19
|
onSubmit,
|
|
@@ -8,11 +8,11 @@ export const chatConversationContract = {
|
|
|
8
8
|
* Place it beside the host viewport in a height-constrained column; the host
|
|
9
9
|
* owns visibility, returning to the end and restoring viewport focus.
|
|
10
10
|
*/
|
|
11
|
-
export const ChatConversationLatest = defineComponent(chatConversationContract, ({ children, ...props }, context) => context.part("latest", "button", { type: "button", ...props }, children ?? "
|
|
11
|
+
export const ChatConversationLatest = defineComponent(chatConversationContract, ({ children, ...props }, context) => context.part("latest", "button", { type: "button", ...props }, children ?? "Back to latest message"));
|
|
12
12
|
/** Optional scroll owner for append-only transcripts. Give the root a constrained height.
|
|
13
13
|
* Do not combine with an application-owned scroll controller. Children can use ChatMessageList.
|
|
14
14
|
*/
|
|
15
|
-
export const ChatConversation = defineComponent(chatConversationContract, ({ children, ariaLabel = "
|
|
15
|
+
export const ChatConversation = defineComponent(chatConversationContract, ({ children, ariaLabel = "Conversation reading area", latestLabel = "Back to latest message", className, ...props }, context) => {
|
|
16
16
|
const hidden = context.signal(true);
|
|
17
17
|
let jump;
|
|
18
18
|
const mount = (root) => {
|
package/dist/src/chat/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { ChatAttachments, type ChatAttachmentItem, type ChatAttachmentsProps, chatAttachmentsContract, } from "./attachments.js";
|
|
2
2
|
export { ChatComposer, type ChatComposerProps, type ChatComposerInput, type ChatComposerSubmit, chatComposerContract, chatComposerOptions, } from "./composer.js";
|
|
3
|
+
export { ComposerPanel, type ComposerPanelProps, composerPanelContract } from "./composer-panel.js";
|
|
3
4
|
export { ChatFrame, type ChatFrameProps, chatFrameContract } from "./frame.js";
|
|
4
5
|
export { AssistantView, assistantViewContract, assistantCopy, type AssistantViewProps, type AssistantDraft, type AssistantAttachment, type AssistantMessage, type AssistantMessagePart, type AssistantToolPart, type AssistantTaskPart, type AssistantProcessStep, type AssistantActivity, type AssistantWork, type AssistantQuestion, type AssistantChoice, type AssistantLabels, } from "./assistant.js";
|
|
5
6
|
export { ChatHeader, type ChatHeaderProps, chatHeaderContract } from "./header.js";
|
package/dist/src/chat/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { ChatAttachments, chatAttachmentsContract, } from "./attachments.js";
|
|
2
2
|
export { ChatComposer, chatComposerContract, chatComposerOptions, } from "./composer.js";
|
|
3
|
+
export { ComposerPanel, composerPanelContract } from "./composer-panel.js";
|
|
3
4
|
export { ChatFrame, chatFrameContract } from "./frame.js";
|
|
4
5
|
export { AssistantView, assistantViewContract, assistantCopy, } from "./assistant.js";
|
|
5
6
|
export { ChatHeader, chatHeaderContract } from "./header.js";
|
|
@@ -3,7 +3,7 @@ export const chatMessageListContract = {
|
|
|
3
3
|
name: "chat-message-list",
|
|
4
4
|
parts: ["root", "content", "item", "date"],
|
|
5
5
|
};
|
|
6
|
-
export const ChatMessageList = defineComponent(chatMessageListContract, ({ children, className, ariaLabel = "
|
|
6
|
+
export const ChatMessageList = defineComponent(chatMessageListContract, ({ children, className, ariaLabel = "Message log", ...props }, context) => context.part("root", "div", {
|
|
7
7
|
...props,
|
|
8
8
|
className,
|
|
9
9
|
role: "log",
|
package/dist/src/chat/message.js
CHANGED
|
@@ -29,8 +29,8 @@ export const ChatMessage = defineComponent(chatMessageContract, ({ children, rol
|
|
|
29
29
|
? context.part("header", "div", null, header)
|
|
30
30
|
: context.part("meta", "div", null, context.part("author", "strong", null, author), timestamp ? context.part("time", "time", { datetime: dateTime }, timestamp) : null, status !== "complete"
|
|
31
31
|
? context.part("status", "span", null, status === "streaming"
|
|
32
|
-
? "
|
|
32
|
+
? "Generating"
|
|
33
33
|
: status === "pending"
|
|
34
|
-
? "
|
|
35
|
-
: "
|
|
34
|
+
? "Waiting"
|
|
35
|
+
: "Incomplete")
|
|
36
36
|
: null), context.part("content", "div", null, surface === "none" ? children : h(ChatBubble, null, children)), footer !== undefined ? context.part("footer", "div", null, footer) : null, actions ? context.part("actions", "div", null, actions) : null)))));
|
|
@@ -4,4 +4,4 @@ export const chatQuestionContract = {
|
|
|
4
4
|
parts: ["root", "eyebrow", "title", "description", "content", "feedback", "actions"],
|
|
5
5
|
};
|
|
6
6
|
/** Presentation only: submission, cancellation and question lifetime belong to the host. */
|
|
7
|
-
export const ChatQuestion = defineComponent(chatQuestionContract, ({ label = "
|
|
7
|
+
export const ChatQuestion = defineComponent(chatQuestionContract, ({ label = "Needs your answer", question, questionId, description, feedback, actions, children, ...props }, context) => context.part("root", "section", { ...props, "aria-labelledby": questionId ?? props["aria-labelledby"] }, context.part("eyebrow", "div", null, label), question ? context.part("title", "p", { id: questionId }, question) : null, description ? context.part("description", "p", null, description) : null, context.part("content", "div", null, children), feedback ? context.part("feedback", "div", { role: "status" }, feedback) : null, actions ? context.part("actions", "div", null, actions) : null));
|
package/dist/src/chat/sources.js
CHANGED
|
@@ -4,7 +4,7 @@ export const chatSourcesContract = {
|
|
|
4
4
|
name: "chat-sources",
|
|
5
5
|
parts: ["root", "summary", "icon", "list", "item", "link", "description"],
|
|
6
6
|
};
|
|
7
|
-
export const ChatSources = defineComponent(chatSourcesContract, ({ items, label = "
|
|
7
|
+
export const ChatSources = defineComponent(chatSourcesContract, ({ items, label = "Sources", ...props }, context) => {
|
|
8
8
|
const links = items.filter(({ url }) => {
|
|
9
9
|
try {
|
|
10
10
|
return ["http:", "https:"].includes(new URL(url).protocol);
|
|
@@ -30,12 +30,12 @@ export const ChatToolCall = defineComponent(chatToolCallContract, ({ children, l
|
|
|
30
30
|
return value;
|
|
31
31
|
};
|
|
32
32
|
const copy = {
|
|
33
|
-
input: "
|
|
34
|
-
output: "
|
|
35
|
-
emptyInput: "
|
|
36
|
-
emptyOutput: "
|
|
37
|
-
retry: "
|
|
38
|
-
cancel: "
|
|
33
|
+
input: "Input",
|
|
34
|
+
output: "Output",
|
|
35
|
+
emptyInput: "No input content",
|
|
36
|
+
emptyOutput: "Empty output",
|
|
37
|
+
retry: "Retry",
|
|
38
|
+
cancel: "Cancel",
|
|
39
39
|
...labels,
|
|
40
40
|
};
|
|
41
41
|
const status = derived(() => unwrap(statusLabel) ?? executionStateLabel(unwrap(state)));
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type Child, type Props } from "meowjsx";
|
|
2
|
+
export declare const actionRailContract: {
|
|
3
|
+
readonly name: "action-rail";
|
|
4
|
+
readonly parts: readonly ["root", "leading", "trailing", "submit"];
|
|
5
|
+
};
|
|
6
|
+
export interface ActionRailProps extends Props {
|
|
7
|
+
/** Actions anchored to the start of the row. */
|
|
8
|
+
leading?: Child;
|
|
9
|
+
/** Selection or secondary actions that stay together before the submit action. */
|
|
10
|
+
trailing?: Child;
|
|
11
|
+
/** The final action; flexible leading and trailing actions wrap to keep it visible. */
|
|
12
|
+
submit?: Child;
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* An action row with wrapping groups. The rail owns order, start/end anchoring, the gap between
|
|
17
|
+
* groups and the rule that the submit action stays visible; callers pass actions.
|
|
18
|
+
*/
|
|
19
|
+
export declare const ActionRail: import("meowjsx").Component<ActionRailProps, "action-rail", "leading" | "root" | "submit" | "trailing">;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { defineComponent } from "meowjsx";
|
|
2
|
+
export const actionRailContract = {
|
|
3
|
+
name: "action-rail",
|
|
4
|
+
parts: ["root", "leading", "trailing", "submit"],
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* An action row with wrapping groups. The rail owns order, start/end anchoring, the gap between
|
|
8
|
+
* groups and the rule that the submit action stays visible; callers pass actions.
|
|
9
|
+
*/
|
|
10
|
+
export const ActionRail = defineComponent(actionRailContract, ({ leading, trailing, submit, children, className, ...props }, context) => {
|
|
11
|
+
void children;
|
|
12
|
+
return context.part("root", "div", { ...props, className }, context.part("leading", "div", null, leading), context.part("trailing", "div", null, trailing), context.part("submit", "div", null, submit));
|
|
13
|
+
});
|
|
@@ -2,12 +2,14 @@ import { type Child, type Props } from "meowjsx";
|
|
|
2
2
|
import { type ThemedProps } from "meowcss/meowjsx";
|
|
3
3
|
export declare const alertOptions: import("meowcss").Options<{
|
|
4
4
|
readonly tone: readonly ["info", "success", "warning", "danger"];
|
|
5
|
+
readonly layout: readonly ["block", "bar"];
|
|
5
6
|
}>;
|
|
6
7
|
export declare const alertContract: {
|
|
7
8
|
readonly name: "alert";
|
|
8
9
|
readonly parts: readonly ["root", "title", "body", "actions"];
|
|
9
10
|
readonly styleProps: import("meowcss/meowjsx").StylePropsBinding<import("meowcss").Options<{
|
|
10
11
|
readonly tone: readonly ["info", "success", "warning", "danger"];
|
|
12
|
+
readonly layout: readonly ["block", "bar"];
|
|
11
13
|
}>>;
|
|
12
14
|
};
|
|
13
15
|
export interface AlertProps extends Props, ThemedProps<typeof alertOptions> {
|
|
@@ -3,12 +3,13 @@ import { defineOptions } from "meowcss";
|
|
|
3
3
|
import { defineStyleProps } from "meowcss/meowjsx";
|
|
4
4
|
export const alertOptions = defineOptions("alert", {
|
|
5
5
|
tone: ["info", "success", "warning", "danger"],
|
|
6
|
+
layout: ["block", "bar"],
|
|
6
7
|
});
|
|
7
8
|
export const alertContract = {
|
|
8
9
|
name: "alert",
|
|
9
10
|
parts: ["root", "title", "body", "actions"],
|
|
10
11
|
styleProps: defineStyleProps(alertOptions, {
|
|
11
|
-
defaults: { tone: "info" },
|
|
12
|
+
defaults: { tone: "info", layout: "block" },
|
|
12
13
|
parts: ["root", "title"],
|
|
13
14
|
}),
|
|
14
15
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type Child, type Props } from "meowjsx";
|
|
2
|
+
export declare const appBarContract: {
|
|
3
|
+
readonly name: "app-bar";
|
|
4
|
+
readonly parts: readonly ["root", "identity", "title", "status", "actions"];
|
|
5
|
+
};
|
|
6
|
+
export interface AppBarProps extends Props {
|
|
7
|
+
title: Child;
|
|
8
|
+
/** A short status line under the title, typically ChatStatus. */
|
|
9
|
+
status?: Child;
|
|
10
|
+
actions?: Child;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Compact application chrome: one title, one optional status line, and the
|
|
15
|
+
* actions that belong to the whole screen. The page body keeps its own scroll.
|
|
16
|
+
*/
|
|
17
|
+
export declare const AppBar: import("meowjsx").Component<AppBarProps, "app-bar", "actions" | "identity" | "root" | "status" | "title">;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { defineComponent } from "meowjsx";
|
|
2
|
+
export const appBarContract = {
|
|
3
|
+
name: "app-bar",
|
|
4
|
+
parts: ["root", "identity", "title", "status", "actions"],
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Compact application chrome: one title, one optional status line, and the
|
|
8
|
+
* actions that belong to the whole screen. The page body keeps its own scroll.
|
|
9
|
+
*/
|
|
10
|
+
export const AppBar = defineComponent(appBarContract, ({ title, status, actions, className, ...props }, context) => context.part("root", "header", { ...props, className }, context.part("identity", "div", null, context.part("title", "h1", null, title), status !== undefined && status !== null ? context.part("status", "div", null, status) : null), actions ? context.part("actions", "div", null, actions) : null));
|
|
@@ -3,7 +3,7 @@ export const breadcrumbContract = {
|
|
|
3
3
|
name: "breadcrumb",
|
|
4
4
|
parts: ["root", "list", "item", "link", "current", "separator"],
|
|
5
5
|
};
|
|
6
|
-
export const Breadcrumb = defineComponent(breadcrumbContract, ({ items, label = "
|
|
6
|
+
export const Breadcrumb = defineComponent(breadcrumbContract, ({ items, label = "Current location", className, ...props }, context) => context.part("root", "nav", { ...props, className, "aria-label": label }, context.part("list", "ol", null, items.map((item, index) => context.part("item", "li", null, index ? context.part("separator", "span", { "aria-hidden": "true" }, "/") : null, index === items.length - 1
|
|
7
7
|
? context.part("current", "span", { "aria-current": "page" }, item.label)
|
|
8
8
|
: item.href
|
|
9
9
|
? context.part("link", "a", { href: item.href }, item.label)
|
|
@@ -20,7 +20,7 @@ export const choiceSelectContract = {
|
|
|
20
20
|
};
|
|
21
21
|
let nextChoiceId = 0;
|
|
22
22
|
/** Single-choice listbox. Form participation remains native; data fetching belongs to callers. */
|
|
23
|
-
export const ChoiceSelect = defineComponent(choiceSelectContract, ({ options, value, defaultValue = "", onValueChange, name, id = `choice-${++nextChoiceId}`, disabled = false, required = false, placeholder = "
|
|
23
|
+
export const ChoiceSelect = defineComponent(choiceSelectContract, ({ options, value, defaultValue = "", onValueChange, name, id = `choice-${++nextChoiceId}`, disabled = false, required = false, placeholder = "Select an option", searchable = false, searchPlaceholder = "Search options", emptyMessage = "No matching options", className, placement = "bottom", align = "start", matchTriggerWidth = true, ...props }, context) => {
|
|
24
24
|
const selected = context.signal(value === undefined ? defaultValue : unwrap(value));
|
|
25
25
|
const open = context.signal(false);
|
|
26
26
|
const caption = context.signal(placeholder);
|
|
@@ -27,11 +27,11 @@ export const CodeBlock = defineComponent(codeBlockContract, ({ code, language, d
|
|
|
27
27
|
else
|
|
28
28
|
await copyTextToClipboard(code);
|
|
29
29
|
if (!disposed)
|
|
30
|
-
feedback.value = "
|
|
30
|
+
feedback.value = "Copied";
|
|
31
31
|
}
|
|
32
32
|
catch {
|
|
33
33
|
if (!disposed)
|
|
34
|
-
feedback.value = "
|
|
34
|
+
feedback.value = "Copy failed; select the code and copy it manually.";
|
|
35
35
|
}
|
|
36
36
|
finally {
|
|
37
37
|
if (!disposed)
|
|
@@ -40,15 +40,15 @@ export const CodeBlock = defineComponent(codeBlockContract, ({ code, language, d
|
|
|
40
40
|
};
|
|
41
41
|
return context.part("root", "figure", props, [
|
|
42
42
|
context.part("header", "figcaption", {}, [
|
|
43
|
-
context.part("language", "span", {}, language?.trim() || "
|
|
43
|
+
context.part("language", "span", {}, language?.trim() || "Code"),
|
|
44
44
|
context.part("actions", "div", {}, [
|
|
45
45
|
h(Button, { variant: "quiet", size: "small", "aria-pressed": wrap, onClick: () => {
|
|
46
46
|
wrap.value = wrap.value === "true" ? "false" : "true";
|
|
47
|
-
} }, "
|
|
48
|
-
h(Button, { variant: "quiet", size: "small", disabled: copying, onClick: copy }, "
|
|
47
|
+
} }, "Soft wrap"),
|
|
48
|
+
h(Button, { variant: "quiet", size: "small", disabled: copying, onClick: copy }, "Copy code"),
|
|
49
49
|
]),
|
|
50
50
|
]),
|
|
51
|
-
context.part("content", "pre", { tabIndex: 0, "aria-label": "
|
|
51
|
+
context.part("content", "pre", { tabIndex: 0, "aria-label": "Code content", "data-wrap": wrap }, context.part("code", "code", {
|
|
52
52
|
ref: () => {
|
|
53
53
|
let active = true;
|
|
54
54
|
void highlightCode(code, language).then((spans) => {
|
|
@@ -8,27 +8,27 @@ import { Stack } from "./stack.js";
|
|
|
8
8
|
export function CredentialSource(props) {
|
|
9
9
|
const { id, disabled } = props;
|
|
10
10
|
return (h(Stack, { gap: "compact" },
|
|
11
|
-
h(Field, { label: "API Key
|
|
11
|
+
h(Field, { label: "API Key source", htmlFor: `${id}-source` },
|
|
12
12
|
h(Select, { id: `${id}-source`, value: props.source, disabled: disabled, onChange: (event) => props.onSourceChange(event.target.value) },
|
|
13
|
-
h("option", { value: "stored" }, "
|
|
14
|
-
h("option", { value: "environment" }, "
|
|
13
|
+
h("option", { value: "stored" }, "Enter an API key"),
|
|
14
|
+
h("option", { value: "environment" }, "Use an environment variable"))),
|
|
15
15
|
props.source === "environment" ? (h(Stack, { gap: "compact" },
|
|
16
|
-
h(Field, { label: "
|
|
17
|
-
h(Input, { id: `${id}-environment`, value: props.environmentName, disabled: disabled, autoComplete: "off", list: `${id}-variables`, placeholder: "
|
|
16
|
+
h(Field, { label: "Environment variable name", htmlFor: `${id}-environment`, description: "Stores only the variable name reference; never copies the key. Reads the service runtime environment, independent of the browser machine." },
|
|
17
|
+
h(Input, { id: `${id}-environment`, value: props.environmentName, disabled: disabled, autoComplete: "off", list: `${id}-variables`, placeholder: "For example, KIMI_API_KEY", onInput: (event) => props.onEnvironmentChange(event.target.value) })),
|
|
18
18
|
h("datalist", { id: `${id}-variables` }, props.variables?.map((variable) => (h("option", { value: variable.name })))),
|
|
19
|
-
h(Button, { type: "button", variant: "outline", style: { alignSelf: "start" }, disabled: disabled, onClick: props.onCheck }, "
|
|
19
|
+
h(Button, { type: "button", variant: "outline", style: { alignSelf: "start" }, disabled: disabled, onClick: props.onCheck }, "Check environment variable"),
|
|
20
20
|
props.variables?.map((variable) => (h("span", null,
|
|
21
21
|
variable.name,
|
|
22
22
|
" \u00B7",
|
|
23
23
|
" ",
|
|
24
24
|
variable.available === null
|
|
25
|
-
? "
|
|
25
|
+
? "Read from the WorkCell runtime environment"
|
|
26
26
|
: variable.available
|
|
27
|
-
? "
|
|
28
|
-
: "
|
|
29
|
-
h("span", null, "
|
|
30
|
-
h(Button, { type: "button", variant: "outline", style: { alignSelf: "start" }, disabled: disabled, onClick: props.onReplace }, "
|
|
27
|
+
? "Available"
|
|
28
|
+
: "Not set"))))) : props.keepStored && props.hasStored ? (h(Stack, { gap: "compact" },
|
|
29
|
+
h("span", null, "Saved API Key"),
|
|
30
|
+
h(Button, { type: "button", variant: "outline", style: { alignSelf: "start" }, disabled: disabled, onClick: props.onReplace }, "Replace API Key"))) : (h(Field, { label: "API Key", htmlFor: `${id}-key`, description: "Saved to the credential store; never shown again after saving." },
|
|
31
31
|
h(Input, { id: `${id}-key`, type: "password", value: props.apiKey, disabled: disabled, autoComplete: "new-password", onInput: (event) => props.onKeyChange(event.target.value) }),
|
|
32
|
-
props.hasStored && props.onKeep ? (h(Button, { type: "button", variant: "outline", disabled: disabled, onClick: props.onKeep }, "
|
|
32
|
+
props.hasStored && props.onKeep ? (h(Button, { type: "button", variant: "outline", disabled: disabled, onClick: props.onKeep }, "Keep the saved API Key")) : null)),
|
|
33
33
|
props.status ? h("span", { role: "status" }, props.status) : null));
|
|
34
34
|
}
|
|
@@ -14,7 +14,7 @@ export function diffBlockText(files) {
|
|
|
14
14
|
export const DiffBlock = defineComponent(diffBlockContract, ({ files, maxLines, onCopy, ...props }, context) => {
|
|
15
15
|
const added = files.reduce((sum, file) => sum + file.lines.filter((line) => line.kind === "added").length, 0);
|
|
16
16
|
const removed = files.reduce((sum, file) => sum + file.lines.filter((line) => line.kind === "removed").length, 0);
|
|
17
|
-
return context.part("root", "div", props, h(OutputBlock, { title:
|
|
17
|
+
return context.part("root", "div", props, h(OutputBlock, { title: `Changes · +${added} −${removed}`, maxLines: maxLines, onCopy: onCopy, copyText: diffBlockText(files), rows: files.flatMap((file) => [
|
|
18
18
|
context.part("path", "div", {}, file.path),
|
|
19
19
|
...file.lines.map((line) => context.part("line", "div", { "data-diff-kind": line.kind }, [
|
|
20
20
|
marker[line.kind],
|
|
@@ -6,7 +6,7 @@ export const hoverCardContract = {
|
|
|
6
6
|
parts: ["root", "content", "feedback"],
|
|
7
7
|
};
|
|
8
8
|
/** Selectable preview. Popover owns positioning, Escape, outside dismissal and focus. */
|
|
9
|
-
export const HoverCard = defineComponent(hoverCardContract, ({ id, trigger, content, openDelay = 500, disabled = false, className, variant = "compact", widthAnchor, copyText, copyLabel = "
|
|
9
|
+
export const HoverCard = defineComponent(hoverCardContract, ({ id, trigger, content, openDelay = 500, disabled = false, className, variant = "compact", widthAnchor, copyText, copyLabel = "Copy", copiedLabel = "Copied", onCopy, }, context) => {
|
|
10
10
|
const open = context.signal(false);
|
|
11
11
|
let timer;
|
|
12
12
|
let hovered = false;
|
|
@@ -53,7 +53,7 @@ export const HoverCard = defineComponent(hoverCardContract, ({ id, trigger, cont
|
|
|
53
53
|
}
|
|
54
54
|
catch {
|
|
55
55
|
if (alive && open.value && session === copySession)
|
|
56
|
-
feedback.value = "
|
|
56
|
+
feedback.value = "Copy failed; select the text and try again.";
|
|
57
57
|
}
|
|
58
58
|
finally {
|
|
59
59
|
copying = false;
|
|
@@ -5,7 +5,7 @@ export const imageLightboxContract = {
|
|
|
5
5
|
parts: ["root", "trigger", "dialog", "image", "caption", "close"],
|
|
6
6
|
};
|
|
7
7
|
/** Native modal top layer keeps the preview independent of transformed ancestors. */
|
|
8
|
-
export const ImageLightbox = defineComponent(imageLightboxContract, ({ src, alt, caption, trigger = "
|
|
8
|
+
export const ImageLightbox = defineComponent(imageLightboxContract, ({ src, alt, caption, trigger = "Preview image", onClose, ...props }, context) => {
|
|
9
9
|
let dialog;
|
|
10
10
|
let opener;
|
|
11
11
|
return context.part("root", "div", props, [
|
|
@@ -20,7 +20,7 @@ export const ImageLightbox = defineComponent(imageLightboxContract, ({ src, alt,
|
|
|
20
20
|
onClick: () => dialog?.showModal(),
|
|
21
21
|
}, trigger),
|
|
22
22
|
context.part("dialog", "dialog", {
|
|
23
|
-
"aria-label": alt || "
|
|
23
|
+
"aria-label": alt || "Image preview",
|
|
24
24
|
ref: (node) => {
|
|
25
25
|
dialog = node;
|
|
26
26
|
return () => {
|
|
@@ -41,7 +41,7 @@ export const ImageLightbox = defineComponent(imageLightboxContract, ({ src, alt,
|
|
|
41
41
|
context.part("close", "button", {
|
|
42
42
|
type: "button",
|
|
43
43
|
autoFocus: true,
|
|
44
|
-
"aria-label": "
|
|
44
|
+
"aria-label": "Close image preview",
|
|
45
45
|
onClick: () => dialog?.close(),
|
|
46
46
|
}, "×"),
|
|
47
47
|
context.part("image", "div", null, h(ImagePreview, { src: src, alt: alt })),
|
|
@@ -5,7 +5,7 @@ export const imagePreviewContract = {
|
|
|
5
5
|
parts: ["root", "image", "status"],
|
|
6
6
|
};
|
|
7
7
|
/** Passive media display; navigation, preview activation and URL authorization belong to the host. */
|
|
8
|
-
export const ImagePreview = defineComponent(imagePreviewContract, ({ src, alt, loading = "lazy", loadingLabel = "
|
|
8
|
+
export const ImagePreview = defineComponent(imagePreviewContract, ({ src, alt, loading = "lazy", loadingLabel = "Loading image", failedLabel = "Failed to load image", onLoad, onError, ...props }, context) => {
|
|
9
9
|
const state = context.signal("loading");
|
|
10
10
|
return context.part("root", "span", { ...props, "data-image-state": state }, [
|
|
11
11
|
context.part("image", "img", {
|
|
@@ -17,6 +17,8 @@ export { Field, type FieldProps, fieldContract } from "./field.js";
|
|
|
17
17
|
export { CredentialSource, type CredentialSourceProps } from "./credential-source.js";
|
|
18
18
|
export { IconButton, type IconButtonProps, iconButtonContract, iconButtonOptions, } from "./icon-button.js";
|
|
19
19
|
export { Toolbar, type ToolbarProps, toolbarContract } from "./toolbar.js";
|
|
20
|
+
export { ActionRail, type ActionRailProps, actionRailContract } from "./action-rail.js";
|
|
21
|
+
export { MetaRow, type MetaItem, type MetaRowProps, metaRowContract, metaRowOptions, } from "./meta-row.js";
|
|
20
22
|
export { Input, type InputProps, inputContract } from "./input.js";
|
|
21
23
|
export { Checkbox, type CheckboxProps, checkboxContract } from "./checkbox.js";
|
|
22
24
|
export { Switch, type SwitchProps, switchContract } from "./switch.js";
|
|
@@ -31,6 +33,7 @@ export { Separator, type SeparatorProps, separatorContract } from "./separator.j
|
|
|
31
33
|
export { Textarea, type TextareaProps, textareaContract } from "./textarea.js";
|
|
32
34
|
export { Stack, type StackProps, stackContract } from "./stack.js";
|
|
33
35
|
export { PageFrame, type PageFrameProps, pageFrameContract, pageFrameOptions } from "./page-frame.js";
|
|
36
|
+
export { AppBar, type AppBarProps, appBarContract } from "./app-bar.js";
|
|
34
37
|
export { mountRegionLayout, regionLayoutContract, type RegionRoots, type RegionLayoutSurface, type RegionLayoutOptions, } from "./region-layout.js";
|
|
35
38
|
export { validateRegionLayout, type RegionDescription, type RegionLayoutDescription, } from "./region-layout-types.js";
|
|
36
39
|
export { LayoutItem, type LayoutItemProps, layoutItemContract } from "./layout-item.js";
|
|
@@ -17,6 +17,8 @@ export { Field, fieldContract } from "./field.js";
|
|
|
17
17
|
export { CredentialSource } from "./credential-source.js";
|
|
18
18
|
export { IconButton, iconButtonContract, iconButtonOptions, } from "./icon-button.js";
|
|
19
19
|
export { Toolbar, toolbarContract } from "./toolbar.js";
|
|
20
|
+
export { ActionRail, actionRailContract } from "./action-rail.js";
|
|
21
|
+
export { MetaRow, metaRowContract, metaRowOptions, } from "./meta-row.js";
|
|
20
22
|
export { Input, inputContract } from "./input.js";
|
|
21
23
|
export { Checkbox, checkboxContract } from "./checkbox.js";
|
|
22
24
|
export { Switch, switchContract } from "./switch.js";
|
|
@@ -31,6 +33,7 @@ export { Separator, separatorContract } from "./separator.js";
|
|
|
31
33
|
export { Textarea, textareaContract } from "./textarea.js";
|
|
32
34
|
export { Stack, stackContract } from "./stack.js";
|
|
33
35
|
export { PageFrame, pageFrameContract, pageFrameOptions } from "./page-frame.js";
|
|
36
|
+
export { AppBar, appBarContract } from "./app-bar.js";
|
|
34
37
|
export { mountRegionLayout, regionLayoutContract, } from "./region-layout.js";
|
|
35
38
|
export { validateRegionLayout, } from "./region-layout-types.js";
|
|
36
39
|
export { LayoutItem, layoutItemContract } from "./layout-item.js";
|
|
@@ -19,7 +19,7 @@ export const JsonBlock = defineComponent(jsonBlockContract, ({ text, payload, la
|
|
|
19
19
|
JSON.parse(text);
|
|
20
20
|
}
|
|
21
21
|
catch {
|
|
22
|
-
error = "JSON
|
|
22
|
+
error = "Invalid JSON; showing the original text.";
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
else {
|
|
@@ -28,7 +28,7 @@ export const JsonBlock = defineComponent(jsonBlockContract, ({ text, payload, la
|
|
|
28
28
|
}
|
|
29
29
|
catch {
|
|
30
30
|
content = String(payload);
|
|
31
|
-
error = "
|
|
31
|
+
error = "Cannot serialize to JSON; showing the value's text representation.";
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
body.value = [
|
|
@@ -37,11 +37,11 @@ export const JsonTree = defineComponent(jsonTreeContract, ({ data, label = "JSON
|
|
|
37
37
|
try {
|
|
38
38
|
await (onCopy ?? copyTextToClipboard)(JSON.stringify(data, null, 2));
|
|
39
39
|
if (alive)
|
|
40
|
-
feedback.value = "
|
|
40
|
+
feedback.value = "Copied";
|
|
41
41
|
}
|
|
42
42
|
catch {
|
|
43
43
|
if (alive)
|
|
44
|
-
feedback.value = "
|
|
44
|
+
feedback.value = "Copy failed";
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
47
|
const copyButton = context.part("copy", "button", {
|
|
@@ -50,7 +50,7 @@ export const JsonTree = defineComponent(jsonTreeContract, ({ data, label = "JSON
|
|
|
50
50
|
event.stopPropagation();
|
|
51
51
|
void copy();
|
|
52
52
|
},
|
|
53
|
-
"aria-label":
|
|
53
|
+
"aria-label": `Copy ${label}`,
|
|
54
54
|
}, h(Icon, { name: "copy", size: 12 }));
|
|
55
55
|
const summary = container
|
|
56
56
|
? `${Array.isArray(data) ? "Array" : "Object"}(${Object.keys(data).length})`
|
|
@@ -14,7 +14,7 @@ export declare const listRowContract: {
|
|
|
14
14
|
};
|
|
15
15
|
export interface ListRowProps extends Props {
|
|
16
16
|
title: Child;
|
|
17
|
-
/** Tags beside the title, such as "CLI" or "
|
|
17
|
+
/** Tags beside the title, such as "CLI" or "Default". */
|
|
18
18
|
tags?: Child;
|
|
19
19
|
description?: Child;
|
|
20
20
|
/** A state in words with its dot; the row's only status. */
|