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

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 w-fit max-w-[80%] 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}
@@ -631,25 +639,27 @@ function CloudOsChatInputContent({
631
639
  </svg>
632
640
  </WorkshopIconButton>
633
641
  ) : (
634
- <WorkshopIconButton
642
+ <button
643
+ type="button"
635
644
  onClick={onSubmit}
636
645
  disabled={!canSend}
637
- tone="primary"
638
- className="!h-8 !w-8 disabled:cursor-not-allowed disabled:opacity-30"
646
+ className="grid size-8 shrink-0 place-items-center rounded-full bg-[var(--primary,var(--color-kumo-brand))] text-[var(--primary-foreground,var(--text-color-kumo-inverse))] shadow-sm transition-colors enabled:hover:bg-[var(--primary-hover,var(--color-kumo-brand-hover))] disabled:cursor-not-allowed disabled:opacity-20"
639
647
  aria-label="Send message"
640
648
  >
641
649
  <svg
642
- width="16"
643
- height="16"
650
+ className="size-4"
644
651
  viewBox="0 0 24 24"
645
652
  fill="none"
646
653
  stroke="currentColor"
647
- strokeWidth="2.5"
654
+ strokeWidth="1.8"
655
+ strokeLinecap="round"
656
+ strokeLinejoin="round"
657
+ aria-hidden="true"
648
658
  >
649
- <line x1="12" y1="19" x2="12" y2="5" />
650
- <polyline points="5 12 12 5 19 12" />
659
+ <path d="m5 12 7-7 7 7" />
660
+ <path d="M12 19V5" />
651
661
  </svg>
652
- </WorkshopIconButton>
662
+ </button>
653
663
  )}
654
664
  </div>
655
665
  </div>
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.16",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src",