@springbrand/message-panel 0.1.3-alpha.14 → 0.1.3-alpha.15

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.
@@ -11,10 +11,8 @@ import {
11
11
  } from "./tool-presentation";
12
12
 
13
13
  /**
14
- * 工作行(work rows)。整块从 cloudflare-os-main ChatInterface.tsx 拷来:
15
- * WorkIcon / ToolCallDetails / NestedToolCallRow / ToolGroupRow / ThinkingTraceRow
16
- * className 一个字没改;改的只有取数——从 gadgets 的 AiToolCall 换成
17
- * UIMessage 归一化后的 CloudOsToolCall。
14
+ * 工作行(work rows): WorkIcon / ToolCallDetails / NestedToolCallRow /
15
+ * ToolGroupRow / ThinkingTraceRow。渲染 UIMessage 归一化后的 CloudOsToolCall
18
16
  */
19
17
 
20
18
  export function WorkIcon({ Icon }: { Icon: PhosphorIcon }) {
@@ -153,7 +151,7 @@ export const ThinkingTraceRow = memo(function ThinkingTraceRow({
153
151
  <button
154
152
  type="button"
155
153
  onClick={() => setOpen((current) => !current)}
156
- className="group -ml-0.5 flex w-full min-w-0 items-center gap-1.5 rounded-xl px-1.5 py-1 text-left text-[14px] leading-5 text-kumo-inactive transition-colors hover:text-kumo-default focus-visible:text-kumo-default focus-visible:outline-none"
154
+ className="group -ml-0.5 flex min-w-0 items-center gap-1.5 rounded-xl px-1.5 py-1 text-left text-[14px] leading-5 text-kumo-inactive transition-colors hover:text-kumo-default focus-visible:text-kumo-default focus-visible:outline-none"
157
155
  aria-expanded={open}
158
156
  aria-controls={contentId}
159
157
  >
@@ -59,6 +59,8 @@ const isComposingKeyEvent = (event: {
59
59
  export interface CloudOsModelOption {
60
60
  id: string;
61
61
  name: string;
62
+ disabled?: boolean;
63
+ disabledLabel?: string;
62
64
  }
63
65
 
64
66
  export interface CloudOsComposerCommand {
@@ -602,10 +604,16 @@ function CloudOsChatInputContent({
602
604
  {models.map((model) => (
603
605
  <DropdownMenu.Item
604
606
  key={model.id}
605
- onClick={() => onModelChange(model.id)}
606
- className="!h-auto rounded-xl !px-2 !py-1.5 text-[12px] leading-4 font-normal tracking-[-0.15px] text-kumo-subtle transition-colors data-highlighted:bg-kumo-tint/70 data-highlighted:text-kumo-default"
607
+ disabled={model.disabled}
608
+ onClick={model.disabled ? undefined : () => onModelChange(model.id)}
609
+ className="!h-auto rounded-xl !px-2 !py-1.5 text-[12px] leading-4 font-normal tracking-[-0.15px] text-kumo-subtle transition-colors data-highlighted:bg-kumo-tint/70 data-highlighted:text-kumo-default data-disabled:cursor-not-allowed data-disabled:opacity-50"
607
610
  >
608
611
  <span className="min-w-0 flex-1 truncate">{model.name}</span>
612
+ {model.disabledLabel && (
613
+ <span className="ml-3 flex-shrink-0 text-[10px] text-kumo-inactive">
614
+ {model.disabledLabel}
615
+ </span>
616
+ )}
609
617
  {selectedModel === model.id && (
610
618
  <Check
611
619
  size={12}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@springbrand/message-panel",
3
- "version": "0.1.3-alpha.14",
3
+ "version": "0.1.3-alpha.15",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src",