meowtail 0.0.0-stage → 0.1.0
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/ASSISTANT.md +52 -0
- package/JSON.md +48 -0
- package/LICENSE +21 -0
- package/README.md +474 -2
- package/THIRD_PARTY_NOTICES.md +27 -0
- package/dist/src/chat/assistant-composer.d.ts +8 -0
- package/dist/src/chat/assistant-composer.js +246 -0
- package/dist/src/chat/assistant-content.d.ts +20 -0
- package/dist/src/chat/assistant-content.js +66 -0
- package/dist/src/chat/assistant-draft.d.ts +5 -0
- package/dist/src/chat/assistant-draft.js +23 -0
- package/dist/src/chat/assistant-markdown.d.ts +11 -0
- package/dist/src/chat/assistant-markdown.js +33 -0
- package/dist/src/chat/assistant-question.d.ts +12 -0
- package/dist/src/chat/assistant-question.js +95 -0
- package/dist/src/chat/assistant-scroll.d.ts +7 -0
- package/dist/src/chat/assistant-scroll.js +72 -0
- package/dist/src/chat/assistant-types.d.ts +174 -0
- package/dist/src/chat/assistant-types.js +40 -0
- package/dist/src/chat/assistant.d.ts +9 -0
- package/dist/src/chat/assistant.js +294 -0
- package/dist/src/chat/attachments.d.ts +23 -0
- package/dist/src/chat/attachments.js +81 -0
- package/dist/src/chat/bubble.d.ts +17 -0
- package/dist/src/chat/bubble.js +18 -0
- package/dist/src/chat/composer.d.ts +36 -0
- package/dist/src/chat/composer.js +31 -0
- package/dist/src/chat/conversation-scroll.d.ts +9 -0
- package/dist/src/chat/conversation-scroll.js +36 -0
- package/dist/src/chat/conversation.d.ts +16 -0
- package/dist/src/chat/conversation.js +62 -0
- package/dist/src/chat/frame.d.ts +9 -0
- package/dist/src/chat/frame.js +6 -0
- package/dist/src/chat/header.d.ts +14 -0
- package/dist/src/chat/header.js +15 -0
- package/dist/src/chat/index.d.ts +15 -0
- package/dist/src/chat/index.js +15 -0
- package/dist/src/chat/message-actions.d.ts +9 -0
- package/dist/src/chat/message-actions.js +6 -0
- package/dist/src/chat/message-context.d.ts +2 -0
- package/dist/src/chat/message-context.js +2 -0
- package/dist/src/chat/message-list.d.ts +25 -0
- package/dist/src/chat/message-list.js +23 -0
- package/dist/src/chat/message.d.ts +24 -0
- package/dist/src/chat/message.js +36 -0
- package/dist/src/chat/process.d.ts +11 -0
- package/dist/src/chat/process.js +9 -0
- package/dist/src/chat/question.d.ts +15 -0
- package/dist/src/chat/question.js +7 -0
- package/dist/src/chat/sources.d.ts +15 -0
- package/dist/src/chat/sources.js +19 -0
- package/dist/src/chat/status.d.ts +18 -0
- package/dist/src/chat/status.js +16 -0
- package/dist/src/chat/tool-call.d.ts +21 -0
- package/dist/src/chat/tool-call.js +40 -0
- package/dist/src/clipboard.d.ts +2 -0
- package/dist/src/clipboard.js +44 -0
- package/dist/src/components/add-button.d.ts +4 -0
- package/dist/src/components/add-button.js +8 -0
- package/dist/src/components/alert.d.ts +20 -0
- package/dist/src/components/alert.js +16 -0
- package/dist/src/components/aspect-ratio.d.ts +11 -0
- package/dist/src/components/aspect-ratio.js +19 -0
- package/dist/src/components/badge.d.ts +18 -0
- package/dist/src/components/badge.js +16 -0
- package/dist/src/components/breadcrumb.d.ts +15 -0
- package/dist/src/components/breadcrumb.js +10 -0
- package/dist/src/components/button.d.ts +31 -0
- package/dist/src/components/button.js +26 -0
- package/dist/src/components/card-action.d.ts +9 -0
- package/dist/src/components/card-action.js +6 -0
- package/dist/src/components/card-content.d.ts +9 -0
- package/dist/src/components/card-content.js +6 -0
- package/dist/src/components/card-description.d.ts +9 -0
- package/dist/src/components/card-description.js +6 -0
- package/dist/src/components/card-footer.d.ts +9 -0
- package/dist/src/components/card-footer.js +6 -0
- package/dist/src/components/card-header.d.ts +9 -0
- package/dist/src/components/card-header.js +6 -0
- package/dist/src/components/card-title.d.ts +10 -0
- package/dist/src/components/card-title.js +6 -0
- package/dist/src/components/card.d.ts +17 -0
- package/dist/src/components/card.js +19 -0
- package/dist/src/components/checkbox.d.ts +18 -0
- package/dist/src/components/checkbox.js +44 -0
- package/dist/src/components/choice-group.d.ts +27 -0
- package/dist/src/components/choice-group.js +85 -0
- package/dist/src/components/choice-select.d.ts +31 -0
- package/dist/src/components/choice-select.js +353 -0
- package/dist/src/components/code-block.d.ts +13 -0
- package/dist/src/components/code-block.js +71 -0
- package/dist/src/components/container.d.ts +17 -0
- package/dist/src/components/container.js +16 -0
- package/dist/src/components/credential-source.d.ts +22 -0
- package/dist/src/components/credential-source.js +34 -0
- package/dist/src/components/description-list.d.ts +20 -0
- package/dist/src/components/description-list.js +13 -0
- package/dist/src/components/detail-section.d.ts +16 -0
- package/dist/src/components/detail-section.js +12 -0
- package/dist/src/components/dialog.d.ts +43 -0
- package/dist/src/components/dialog.js +29 -0
- package/dist/src/components/diff-block.d.ts +21 -0
- package/dist/src/components/diff-block.js +24 -0
- package/dist/src/components/disclosure.d.ts +15 -0
- package/dist/src/components/disclosure.js +14 -0
- package/dist/src/components/drawer.d.ts +19 -0
- package/dist/src/components/drawer.js +56 -0
- package/dist/src/components/empty-state.d.ts +19 -0
- package/dist/src/components/empty-state.js +11 -0
- package/dist/src/components/field-group.d.ts +13 -0
- package/dist/src/components/field-group.js +20 -0
- package/dist/src/components/field.d.ts +16 -0
- package/dist/src/components/field.js +48 -0
- package/dist/src/components/grid.d.ts +27 -0
- package/dist/src/components/grid.js +29 -0
- package/dist/src/components/hover-card.d.ts +22 -0
- package/dist/src/components/hover-card.js +147 -0
- package/dist/src/components/icon-button.d.ts +17 -0
- package/dist/src/components/icon-button.js +17 -0
- package/dist/src/components/icon-rail.d.ts +20 -0
- package/dist/src/components/icon-rail.js +14 -0
- package/dist/src/components/image-lightbox.d.ts +14 -0
- package/dist/src/components/image-lightbox.js +51 -0
- package/dist/src/components/image-preview.d.ts +16 -0
- package/dist/src/components/image-preview.js +42 -0
- package/dist/src/components/index.d.ts +88 -0
- package/dist/src/components/index.js +87 -0
- package/dist/src/components/inline.d.ts +14 -0
- package/dist/src/components/inline.js +23 -0
- package/dist/src/components/input.d.ts +10 -0
- package/dist/src/components/input.js +6 -0
- package/dist/src/components/item.d.ts +26 -0
- package/dist/src/components/item.js +19 -0
- package/dist/src/components/json-block.d.ts +18 -0
- package/dist/src/components/json-block.js +49 -0
- package/dist/src/components/json-tree.d.ts +16 -0
- package/dist/src/components/json-tree.js +76 -0
- package/dist/src/components/layout-item.d.ts +15 -0
- package/dist/src/components/layout-item.js +16 -0
- package/dist/src/components/layout-types.d.ts +18 -0
- package/dist/src/components/layout-types.js +13 -0
- package/dist/src/components/list-group.d.ts +30 -0
- package/dist/src/components/list-group.js +32 -0
- package/dist/src/components/menu.d.ts +45 -0
- package/dist/src/components/menu.js +227 -0
- package/dist/src/components/nav-item.d.ts +13 -0
- package/dist/src/components/nav-item.js +19 -0
- package/dist/src/components/output-block.d.ts +20 -0
- package/dist/src/components/output-block.js +66 -0
- package/dist/src/components/page-frame.d.ts +21 -0
- package/dist/src/components/page-frame.js +16 -0
- package/dist/src/components/page-header.d.ts +15 -0
- package/dist/src/components/page-header.js +9 -0
- package/dist/src/components/path-label.d.ts +11 -0
- package/dist/src/components/path-label.js +37 -0
- package/dist/src/components/path-picker.d.ts +18 -0
- package/dist/src/components/path-picker.js +83 -0
- package/dist/src/components/pill.d.ts +11 -0
- package/dist/src/components/pill.js +14 -0
- package/dist/src/components/popover.d.ts +31 -0
- package/dist/src/components/popover.js +232 -0
- package/dist/src/components/process-group.d.ts +17 -0
- package/dist/src/components/process-group.js +8 -0
- package/dist/src/components/process-step.d.ts +13 -0
- package/dist/src/components/process-step.js +7 -0
- package/dist/src/components/rail-item.d.ts +25 -0
- package/dist/src/components/rail-item.js +16 -0
- package/dist/src/components/rail-section.d.ts +18 -0
- package/dist/src/components/rail-section.js +11 -0
- package/dist/src/components/read-block.d.ts +24 -0
- package/dist/src/components/read-block.js +82 -0
- package/dist/src/components/region-layout-types.d.ts +19 -0
- package/dist/src/components/region-layout-types.js +78 -0
- package/dist/src/components/region-layout.d.ts +19 -0
- package/dist/src/components/region-layout.js +254 -0
- package/dist/src/components/resource-card.d.ts +22 -0
- package/dist/src/components/resource-card.js +20 -0
- package/dist/src/components/resource-link.d.ts +18 -0
- package/dist/src/components/resource-link.js +14 -0
- package/dist/src/components/risk-confirmation.d.ts +22 -0
- package/dist/src/components/risk-confirmation.js +45 -0
- package/dist/src/components/search-block.d.ts +28 -0
- package/dist/src/components/search-block.js +40 -0
- package/dist/src/components/search-input.d.ts +18 -0
- package/dist/src/components/search-input.js +13 -0
- package/dist/src/components/segmented-control.d.ts +24 -0
- package/dist/src/components/segmented-control.js +63 -0
- package/dist/src/components/select.d.ts +17 -0
- package/dist/src/components/select.js +6 -0
- package/dist/src/components/separator.d.ts +10 -0
- package/dist/src/components/separator.js +11 -0
- package/dist/src/components/shortcut-keys.d.ts +12 -0
- package/dist/src/components/shortcut-keys.js +7 -0
- package/dist/src/components/skeleton-boundary.d.ts +12 -0
- package/dist/src/components/skeleton-boundary.js +73 -0
- package/dist/src/components/skeleton.d.ts +17 -0
- package/dist/src/components/skeleton.js +15 -0
- package/dist/src/components/spinner.d.ts +10 -0
- package/dist/src/components/spinner.js +7 -0
- package/dist/src/components/stack.d.ts +13 -0
- package/dist/src/components/stack.js +22 -0
- package/dist/src/components/state-dot.d.ts +14 -0
- package/dist/src/components/state-dot.js +28 -0
- package/dist/src/components/status-dot.d.ts +34 -0
- package/dist/src/components/status-dot.js +25 -0
- package/dist/src/components/switch.d.ts +9 -0
- package/dist/src/components/switch.js +8 -0
- package/dist/src/components/tabs.d.ts +24 -0
- package/dist/src/components/tabs.js +90 -0
- package/dist/src/components/tag.d.ts +23 -0
- package/dist/src/components/tag.js +16 -0
- package/dist/src/components/terminal-block.d.ts +24 -0
- package/dist/src/components/terminal-block.js +103 -0
- package/dist/src/components/text-shimmer.d.ts +15 -0
- package/dist/src/components/text-shimmer.js +17 -0
- package/dist/src/components/textarea.d.ts +9 -0
- package/dist/src/components/textarea.js +6 -0
- package/dist/src/components/timeline.d.ts +26 -0
- package/dist/src/components/timeline.js +17 -0
- package/dist/src/components/toast.d.ts +14 -0
- package/dist/src/components/toast.js +7 -0
- package/dist/src/components/toolbar.d.ts +12 -0
- package/dist/src/components/toolbar.js +155 -0
- package/dist/src/components/tooltip.d.ts +19 -0
- package/dist/src/components/tooltip.js +81 -0
- package/dist/src/components/web-block.d.ts +24 -0
- package/dist/src/components/web-block.js +40 -0
- package/dist/src/components/window-title-bar.d.ts +25 -0
- package/dist/src/components/window-title-bar.js +16 -0
- package/dist/src/components/work-card.d.ts +21 -0
- package/dist/src/components/work-card.js +11 -0
- package/dist/src/icons/LUCIDE-LICENSE +43 -0
- package/dist/src/icons/README.md +9 -0
- package/dist/src/icons/doodle-cat.d.ts +5 -0
- package/dist/src/icons/doodle-cat.js +8 -0
- package/dist/src/icons/external-arrow.d.ts +2 -0
- package/dist/src/icons/external-arrow.js +5 -0
- package/dist/src/icons/file-type-icon.d.ts +29 -0
- package/dist/src/icons/file-type-icon.js +211 -0
- package/dist/src/icons/github.d.ts +2 -0
- package/dist/src/icons/github.js +5 -0
- package/dist/src/icons/icon.d.ts +51 -0
- package/dist/src/icons/icon.js +135 -0
- package/dist/src/icons/index.d.ts +10 -0
- package/dist/src/icons/index.js +10 -0
- package/dist/src/icons/meowland-mark.d.ts +5 -0
- package/dist/src/icons/meowland-mark.js +5 -0
- package/dist/src/icons/notes.d.ts +2 -0
- package/dist/src/icons/notes.js +5 -0
- package/dist/src/icons/plus.d.ts +2 -0
- package/dist/src/icons/plus.js +5 -0
- package/dist/src/icons/search.d.ts +2 -0
- package/dist/src/icons/search.js +5 -0
- package/dist/src/icons/tasks.d.ts +2 -0
- package/dist/src/icons/tasks.js +5 -0
- package/dist/src/index.d.ts +5 -0
- package/dist/src/index.js +5 -0
- package/dist/src/json/catalog.d.ts +169 -0
- package/dist/src/json/catalog.js +164 -0
- package/dist/src/json/index.d.ts +1 -0
- package/dist/src/json/index.js +1 -0
- package/dist/src/registry/index.d.ts +833 -0
- package/dist/src/registry/index.js +235 -0
- package/dist/src/registry.d.ts +1 -0
- package/dist/src/registry.js +1 -0
- package/dist/src/shared/dom-root.d.ts +3 -0
- package/dist/src/shared/dom-root.js +8 -0
- package/dist/src/shared/layout-style.d.ts +4 -0
- package/dist/src/shared/layout-style.js +13 -0
- package/dist/src/syntax-highlight.d.ts +26 -0
- package/dist/src/syntax-highlight.js +116 -0
- package/dist/src/theme/base.styles.d.ts +2 -0
- package/dist/src/theme/base.styles.js +26 -0
- package/dist/src/theme/chat/assistant.styles.d.ts +2 -0
- package/dist/src/theme/chat/assistant.styles.js +289 -0
- package/dist/src/theme/chat/attachments.styles.d.ts +1 -0
- package/dist/src/theme/chat/attachments.styles.js +255 -0
- package/dist/src/theme/chat/composer.styles.d.ts +1 -0
- package/dist/src/theme/chat/composer.styles.js +519 -0
- package/dist/src/theme/chat/conversation.styles.d.ts +1 -0
- package/dist/src/theme/chat/conversation.styles.js +57 -0
- package/dist/src/theme/chat/frame.styles.d.ts +1 -0
- package/dist/src/theme/chat/frame.styles.js +107 -0
- package/dist/src/theme/chat/header.styles.d.ts +1 -0
- package/dist/src/theme/chat/header.styles.js +93 -0
- package/dist/src/theme/chat/message.styles.d.ts +1 -0
- package/dist/src/theme/chat/message.styles.js +423 -0
- package/dist/src/theme/chat/question.styles.d.ts +1 -0
- package/dist/src/theme/chat/question.styles.js +57 -0
- package/dist/src/theme/chat/records.styles.d.ts +1 -0
- package/dist/src/theme/chat/records.styles.js +546 -0
- package/dist/src/theme/chat/status.styles.d.ts +1 -0
- package/dist/src/theme/chat/status.styles.js +75 -0
- package/dist/src/theme/components/alert.styles.d.ts +1 -0
- package/dist/src/theme/components/alert.styles.js +28 -0
- package/dist/src/theme/components/badge.styles.d.ts +1 -0
- package/dist/src/theme/components/badge.styles.js +66 -0
- package/dist/src/theme/components/breadcrumb.styles.d.ts +1 -0
- package/dist/src/theme/components/breadcrumb.styles.js +44 -0
- package/dist/src/theme/components/button.styles.d.ts +1 -0
- package/dist/src/theme/components/button.styles.js +143 -0
- package/dist/src/theme/components/card.styles.d.ts +1 -0
- package/dist/src/theme/components/card.styles.js +108 -0
- package/dist/src/theme/components/choice-group.styles.d.ts +1 -0
- package/dist/src/theme/components/choice-group.styles.js +87 -0
- package/dist/src/theme/components/choice-select.styles.d.ts +1 -0
- package/dist/src/theme/components/choice-select.styles.js +182 -0
- package/dist/src/theme/components/code-block.styles.d.ts +1 -0
- package/dist/src/theme/components/code-block.styles.js +77 -0
- package/dist/src/theme/components/description-list.styles.d.ts +1 -0
- package/dist/src/theme/components/description-list.styles.js +39 -0
- package/dist/src/theme/components/detail-section.styles.d.ts +1 -0
- package/dist/src/theme/components/detail-section.styles.js +43 -0
- package/dist/src/theme/components/dialog.styles.d.ts +1 -0
- package/dist/src/theme/components/dialog.styles.js +91 -0
- package/dist/src/theme/components/disclosure.styles.d.ts +1 -0
- package/dist/src/theme/components/disclosure.styles.js +79 -0
- package/dist/src/theme/components/drawer.styles.d.ts +2 -0
- package/dist/src/theme/components/drawer.styles.js +67 -0
- package/dist/src/theme/components/empty-state.styles.d.ts +1 -0
- package/dist/src/theme/components/empty-state.styles.js +51 -0
- package/dist/src/theme/components/field-group.styles.d.ts +1 -0
- package/dist/src/theme/components/field-group.styles.js +31 -0
- package/dist/src/theme/components/field.styles.d.ts +1 -0
- package/dist/src/theme/components/field.styles.js +31 -0
- package/dist/src/theme/components/hover-card.styles.d.ts +1 -0
- package/dist/src/theme/components/hover-card.styles.js +59 -0
- package/dist/src/theme/components/icon-rail.styles.d.ts +1 -0
- package/dist/src/theme/components/icon-rail.styles.js +236 -0
- package/dist/src/theme/components/image-lightbox.styles.d.ts +1 -0
- package/dist/src/theme/components/image-lightbox.styles.js +67 -0
- package/dist/src/theme/components/image-preview.styles.d.ts +1 -0
- package/dist/src/theme/components/image-preview.styles.js +68 -0
- package/dist/src/theme/components/item.styles.d.ts +1 -0
- package/dist/src/theme/components/item.styles.js +101 -0
- package/dist/src/theme/components/json.styles.d.ts +1 -0
- package/dist/src/theme/components/json.styles.js +127 -0
- package/dist/src/theme/components/layout.styles.d.ts +1 -0
- package/dist/src/theme/components/layout.styles.js +103 -0
- package/dist/src/theme/components/list-group.styles.d.ts +1 -0
- package/dist/src/theme/components/list-group.styles.js +98 -0
- package/dist/src/theme/components/menu.styles.d.ts +1 -0
- package/dist/src/theme/components/menu.styles.js +77 -0
- package/dist/src/theme/components/native-input.styles.d.ts +1 -0
- package/dist/src/theme/components/native-input.styles.js +113 -0
- package/dist/src/theme/components/nav-item.styles.d.ts +1 -0
- package/dist/src/theme/components/nav-item.styles.js +68 -0
- package/dist/src/theme/components/output-block.styles.d.ts +1 -0
- package/dist/src/theme/components/output-block.styles.js +226 -0
- package/dist/src/theme/components/page-frame.styles.d.ts +1 -0
- package/dist/src/theme/components/page-frame.styles.js +57 -0
- package/dist/src/theme/components/page-header.styles.d.ts +1 -0
- package/dist/src/theme/components/page-header.styles.js +39 -0
- package/dist/src/theme/components/path-label.styles.d.ts +1 -0
- package/dist/src/theme/components/path-label.styles.js +27 -0
- package/dist/src/theme/components/path-picker.styles.d.ts +1 -0
- package/dist/src/theme/components/path-picker.styles.js +33 -0
- package/dist/src/theme/components/pill.styles.d.ts +1 -0
- package/dist/src/theme/components/pill.styles.js +39 -0
- package/dist/src/theme/components/popover.styles.d.ts +1 -0
- package/dist/src/theme/components/popover.styles.js +49 -0
- package/dist/src/theme/components/process-group.styles.d.ts +1 -0
- package/dist/src/theme/components/process-group.styles.js +141 -0
- package/dist/src/theme/components/region-layout.styles.d.ts +1 -0
- package/dist/src/theme/components/region-layout.styles.js +57 -0
- package/dist/src/theme/components/resource-card.styles.d.ts +1 -0
- package/dist/src/theme/components/resource-card.styles.js +105 -0
- package/dist/src/theme/components/resource-card.tokens.d.ts +5 -0
- package/dist/src/theme/components/resource-card.tokens.js +6 -0
- package/dist/src/theme/components/resource-link.styles.d.ts +1 -0
- package/dist/src/theme/components/resource-link.styles.js +78 -0
- package/dist/src/theme/components/risk-confirmation.styles.d.ts +1 -0
- package/dist/src/theme/components/risk-confirmation.styles.js +9 -0
- package/dist/src/theme/components/search-input.styles.d.ts +1 -0
- package/dist/src/theme/components/search-input.styles.js +63 -0
- package/dist/src/theme/components/segmented-control.styles.d.ts +1 -0
- package/dist/src/theme/components/segmented-control.styles.js +63 -0
- package/dist/src/theme/components/separator.styles.d.ts +1 -0
- package/dist/src/theme/components/separator.styles.js +15 -0
- package/dist/src/theme/components/shortcut-keys.styles.d.ts +1 -0
- package/dist/src/theme/components/shortcut-keys.styles.js +34 -0
- package/dist/src/theme/components/skeleton.styles.d.ts +1 -0
- package/dist/src/theme/components/skeleton.styles.js +43 -0
- package/dist/src/theme/components/spinner.styles.d.ts +1 -0
- package/dist/src/theme/components/spinner.styles.js +27 -0
- package/dist/src/theme/components/state-dot.styles.d.ts +1 -0
- package/dist/src/theme/components/state-dot.styles.js +68 -0
- package/dist/src/theme/components/status-dot.styles.d.ts +1 -0
- package/dist/src/theme/components/status-dot.styles.js +72 -0
- package/dist/src/theme/components/tabs.styles.d.ts +1 -0
- package/dist/src/theme/components/tabs.styles.js +93 -0
- package/dist/src/theme/components/tag.styles.d.ts +1 -0
- package/dist/src/theme/components/tag.styles.js +55 -0
- package/dist/src/theme/components/text-shimmer.styles.d.ts +1 -0
- package/dist/src/theme/components/text-shimmer.styles.js +59 -0
- package/dist/src/theme/components/timeline.styles.d.ts +1 -0
- package/dist/src/theme/components/timeline.styles.js +87 -0
- package/dist/src/theme/components/toast.styles.d.ts +1 -0
- package/dist/src/theme/components/toast.styles.js +48 -0
- package/dist/src/theme/components/toggle.styles.d.ts +1 -0
- package/dist/src/theme/components/toggle.styles.js +85 -0
- package/dist/src/theme/components/toolbar.styles.d.ts +1 -0
- package/dist/src/theme/components/toolbar.styles.js +22 -0
- package/dist/src/theme/components/tooltip.styles.d.ts +1 -0
- package/dist/src/theme/components/tooltip.styles.js +26 -0
- package/dist/src/theme/components/web-block.styles.d.ts +1 -0
- package/dist/src/theme/components/web-block.styles.js +48 -0
- package/dist/src/theme/components/window-title-bar.styles.d.ts +6 -0
- package/dist/src/theme/components/window-title-bar.styles.js +57 -0
- package/dist/src/theme/components/work-card.styles.d.ts +1 -0
- package/dist/src/theme/components/work-card.styles.js +78 -0
- package/dist/src/theme/icons/icons.styles.d.ts +1 -0
- package/dist/src/theme/icons/icons.styles.js +29 -0
- package/dist/src/theme/index.d.ts +3 -0
- package/dist/src/theme/index.js +168 -0
- package/dist/src/theme/palette.d.ts +55 -0
- package/dist/src/theme/palette.js +56 -0
- package/dist/src/theme/shared/code-highlight.styles.d.ts +1 -0
- package/dist/src/theme/shared/code-highlight.styles.js +20 -0
- package/dist/src/theme/shared/code-highlight.tokens.d.ts +12 -0
- package/dist/src/theme/shared/code-highlight.tokens.js +13 -0
- package/dist/src/theme/tokens.d.ts +111 -0
- package/dist/src/theme/tokens.js +128 -0
- package/package.json +62 -4
package/ASSISTANT.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# 完整 Assistant 组合
|
|
2
|
+
|
|
3
|
+
状态:新增组合已实现,作者的局部行为回归与独立源码/页面验收进行中;第一阶段五包 tarball 不含本页新能力,不能用其安装通过代替本组合验收。当前尚未正式发布,也未切换 Rossovia 的消费。
|
|
4
|
+
|
|
5
|
+
`meowtail/chat` 的 `AssistantView` 提供消息、安全 Markdown、代码、过程、输入框、附件、模型与思考选项、当前活动、后台工作详情及待答问题。默认结构和视觉都在库中;Meowbook 的 `assistant-complete` 场景只提供本地数据和动作。
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { h, signal } from "meowjsx";
|
|
9
|
+
import { AssistantView, type AssistantDraft, type AssistantMessage } from "meowtail/chat";
|
|
10
|
+
|
|
11
|
+
const messages = signal<readonly AssistantMessage[]>([]);
|
|
12
|
+
const draft = signal<AssistantDraft>({ text: "", attachments: [] });
|
|
13
|
+
|
|
14
|
+
const view = (
|
|
15
|
+
<AssistantView
|
|
16
|
+
messages={messages}
|
|
17
|
+
draft={draft}
|
|
18
|
+
onDraftChange={(next) => {
|
|
19
|
+
draft.value = next;
|
|
20
|
+
}}
|
|
21
|
+
onSubmit={async (snapshot) => {
|
|
22
|
+
const accepted = await hostSend(snapshot);
|
|
23
|
+
return { accepted };
|
|
24
|
+
}}
|
|
25
|
+
/>
|
|
26
|
+
);
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
组件由父容器取得受约束高度;标准安装仍需 `createMeowUI` 与 `standardTheme.cssText`,不依赖 Rossovia 的 CSS 或 controller。消息和 composer 使用同一阅读列,回最新只锚定消息区域。活动在宽容器旁显,在窄容器变为同一个原生模态对话框,不重挂消息和草稿。
|
|
30
|
+
|
|
31
|
+
## 数据与动作的归属
|
|
32
|
+
|
|
33
|
+
- 传 `draft` 时,宿主是唯一 owner,必须给 `onDraftChange` 或显式 `readOnly`。组件不直接写传入 Signal;不传 `draft` 时,`defaultDraft` 初始化组件自己的临时草稿。宿主拥有持久化。
|
|
34
|
+
- `onSubmit` 必须显式返回 `{accepted: true}` 才消费已提交快照。等待时允许继续编辑;没有新编辑的文本可清空,原快照中的附件单独消费,后来添加或替换的附件保留。拒绝和异常保留草稿并显示反馈。该接纳只代表宿主接纳消息,不代表 Agent 已处理或任务完成。
|
|
35
|
+
- 默认选文件只在本地保留 `File` 和预览 URL,不上传、不执行、不持久化。宿主提供 `onAttach` 时可返回归一化附件;也可以直接更新受控草稿并返回空值。不要在同一回调中既追加草稿又返回相同附件。预览 URL 由组件卸载时释放;持久消息附件应由宿主换成自己的资源地址。
|
|
36
|
+
- 只支持已有序列化附件的宿主可设 `allowAttachments={false}`,不呈现本地文件选择入口;已有附件仍可显示、移除和随消息提交。JSON catalog 的首片使用这一明确边界,不把 File 混入 JSON 草稿。
|
|
37
|
+
- `messages`、`activity`、`work`、`questions`、模型与思考选项支持 `MaybeSignal`。用不可变数组更新驱动视图。同一消息和 part 的稳定 `id` 保留其节点;改变 part 的 `kind` 会重建该 part。
|
|
38
|
+
- 工作的 `statusText`、`executionText`、`replyText` 都由宿主提供;UI 不将 pending 解释成 running,不把 returned 当目标完成,也不从执行结果推断公开答复已发布。状态点只辅助对应文字。
|
|
39
|
+
- 问题状态由宿主的 `open/submitting/answered/unavailable` 事实决定。`onAnswer` 返回不自动把问题标为 answered;异常保留局部答案。`onDismissQuestion` 只通知宿主,没有隐式业务关闭或重试。
|
|
40
|
+
- `readState="error"` 保留已给消息并显示失败;`loading`、真实空消息与刷新失败分别呈现。工作详情 `error` 保留正文;`unavailable` 隐去正文。授权与数据撤回仍是宿主职责。
|
|
41
|
+
|
|
42
|
+
## 内容与局部定制
|
|
43
|
+
|
|
44
|
+
消息 `parts` 包含 `text`、`code`、`process` 和 `attachments`。`text` 默认安全 Markdown:原始 HTML 与图片作为文字,只有明确的 HTTP、HTTPS、mailto 链接可导航;代码 part 使用共享 `CodeBlock`。过程使用原生 disclosure,过程步骤只接归一化的标题、说明、状态文字与视觉 tone。
|
|
45
|
+
|
|
46
|
+
`renderPart` 可只替换一个 part,返回 `undefined` 使用默认实现;`renderWorkDetail` 只替换详情正文。`composerTrailing` 和 `headerActions` 放局部控件,无需替换整页。自定义组件仍在原渲染树中消费祖先 Context,不另建 renderer root。
|
|
47
|
+
|
|
48
|
+
新增默认文案集中在 `assistantCopy`;宿主可用 `labels={{ latest: "回到最新", send: "发送" }}` 覆盖局部文字,不需要另装国际化运行时。数据中的标题、状态与说明仍由宿主提供。
|
|
49
|
+
|
|
50
|
+
宿主传历史消息时直接前插 `messages`,组件保留可见消息锚点;向上阅读时追加与流式更新不强制跳到底。`onLoadOlder` 只请求宿主加载,UI 不拥有分页、网络或记录权限。列表使用同一 MeowJSX keyed 机制;删除项释放其组件生命周期。
|
|
51
|
+
|
|
52
|
+
模型选择、文件、路径、URL、回调名字及 UI 状态都不授予后端权限。连接、上传、执行、停止、发布、授权与恢复由应用 adapter 接入;这里没有 Agent 执行框架。
|
package/JSON.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# 有限 JSON UI catalog
|
|
2
|
+
|
|
3
|
+
`meowtail/json` 的 `createMeowUICatalog()` 注册原有 `AssistantView`、`Button`、`Input`、`Stack`,由 `meowjsx/json` 构造同一 MeowJSX VNode。它不复制 renderer、主题、组件实现或业务 store,不从 TypeScript 开放 Props 反射任意属性。
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { createJsonView, parseJsonView } from "meowjsx/json";
|
|
7
|
+
import { signal, type ReadableSignal } from "meowjsx";
|
|
8
|
+
import type { AssistantDraft, AssistantMessage } from "meowtail/chat";
|
|
9
|
+
import { createMeowUICatalog } from "meowtail/json";
|
|
10
|
+
|
|
11
|
+
const catalog = createMeowUICatalog();
|
|
12
|
+
const messages = signal<readonly AssistantMessage[]>([]);
|
|
13
|
+
const draft = signal<AssistantDraft>({ text: "", attachments: [] });
|
|
14
|
+
const view = parseJsonView(
|
|
15
|
+
{
|
|
16
|
+
component: "AssistantView",
|
|
17
|
+
props: {
|
|
18
|
+
messages: { $binding: "messages" },
|
|
19
|
+
draft: { $binding: "draft" },
|
|
20
|
+
onDraftChange: { $action: "draft.change" },
|
|
21
|
+
onSubmit: { $action: "submit" },
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
catalog,
|
|
25
|
+
);
|
|
26
|
+
const child = createJsonView(view, {
|
|
27
|
+
catalog,
|
|
28
|
+
bindings: new Map<string, ReadableSignal<unknown>>([
|
|
29
|
+
["messages", messages],
|
|
30
|
+
["draft", draft],
|
|
31
|
+
]),
|
|
32
|
+
actions: new Map<string, (...args: any[]) => unknown>([
|
|
33
|
+
[
|
|
34
|
+
"draft.change",
|
|
35
|
+
(next: AssistantDraft) => {
|
|
36
|
+
draft.value = next;
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
["submit", (snapshot: AssistantDraft) => ({ accepted: snapshot.text.trim().length > 0 })],
|
|
40
|
+
]),
|
|
41
|
+
});
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
`messages` 是必填项。消息支持 text/code/process/attachments 四个明确分支;过程步骤、活动、后台工作、问题、模型选项、读取状态、草稿和发送快照使用有限 schema。`assistantJsonSchemas` 与 catalog 复用相同定义,校验、描述与类型关联不会各维护一份。controlled 草稿必须接 `onDraftChange` 或设只读;发送是否接受仍由宿主显式返回 `{accepted:true}` 决定。
|
|
45
|
+
|
|
46
|
+
本片支持序列化附件元数据(id/name/url/mediaType/sizeBytes),不支持 File、本地文件上传、附件回调、renderPart/renderWorkDetail、headerActions/composerTrailing slots。需要这些能力时使用完整 `meowtail/chat` JSX API。JSON 不提供 `onAttach`,并用有限 `allowAttachments: false` 默认值关闭本地文件选择入口,显式 true 会被拒绝;文本编辑、发送和已有附件的显示/移除仍可使用。网络、权限、持久化、数据协议和上传始终属于宿主。
|
|
47
|
+
|
|
48
|
+
Button 的点击 action 不传原生事件;Input 的 input action 只传经校验的当前字符串值。仅列出的属性可用,开放 JSX native props、HTML 标签名、ref/raw HTML、任意事件对象、任意代码、路径表达式、动态 import 均不在 catalog 内。其他 MeowUI 组件尚未提供 JSON metadata;本片不声称完整 UI 属性自动序列化。
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Lidessen
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,475 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Meowtail
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`meowtail` 提供跨应用组件、语义布局、标准主题和完整 Assistant 组合。网络、执行、权限与持久化由宿主适配,库不携带 Rossovia 的业务状态或后端。
|
|
4
|
+
|
|
5
|
+
本包的 npm 名称是 `meowtail`;既有 `createMeowUI`、`installMeowUI`、`createMeowUICatalog` 等 API 和运行时样式身份保持不变。使用新的包导入路径,不能据包名推导新的函数名、`data-*` 标记或 CSS 变量。
|
|
6
|
+
|
|
7
|
+
完整组合的使用合同见 [Assistant](ASSISTANT.md),有限 JSON 入口见 [JSON catalog](JSON.md)。两者的实现与独立验收仍在进行;本页的 API 说明和早期产物验证不等于当前全部源码的同源验收通过。
|
|
8
|
+
|
|
9
|
+
## 目录
|
|
10
|
+
|
|
11
|
+
```text
|
|
12
|
+
src/
|
|
13
|
+
components/ # Button、Card、Input、Dialog 等基础组件;一个组件一个文件
|
|
14
|
+
chat/ # ChatFrame、ChatMessage、ChatComposer 等对话组件
|
|
15
|
+
icons/ # 品牌标记和小图标;一个图标一个文件
|
|
16
|
+
registry/ # contract 聚合、meowjsx 类型声明和安装入口
|
|
17
|
+
shared/ # 组件内部共享的小工具
|
|
18
|
+
theme/ # 标准主题的 token 定义和按 part 组织的 TS 样式
|
|
19
|
+
tests/
|
|
20
|
+
unit/ # Bun,按 components/chat/icons/shared/theme 分组
|
|
21
|
+
types/ # 公共类型合同,使用 *.types.ts / *.types.tsx,由 tsc 验证
|
|
22
|
+
browser/ # Playwright,按 components/chat/theme/catalog 分组
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
产品事实、导航适配和应用专属样式留在宿主;通用活动面板、完整 Assistant 组合、共同页面壳和区域布局由本包提供,不要求消费者重新搭整页。
|
|
26
|
+
通用组件通过
|
|
27
|
+
className 保留宿主应用的视觉扩展点,标准主题由同一 package 的 `meowtail/theme`
|
|
28
|
+
根据 registry 的 component/part 身份提供默认样式。MeowUI 的 registry 是运行时 contract
|
|
29
|
+
和安装入口,不是 shadcn 式的源码分发目录。
|
|
30
|
+
|
|
31
|
+
## 当前组件
|
|
32
|
+
|
|
33
|
+
`PageFrame` 接收 header、toolbar 和 children,分配页头与 body 的可用高度,并提供共同页面外缘。
|
|
34
|
+
业务和 iframe 放入 body,不再各自按 viewport 减去页头高度。
|
|
35
|
+
默认 `variant="page"` 提供有限宽度与页面外缘;`variant="workspace"` 用于全宽工具栏和
|
|
36
|
+
连续阅读/输入工作区,外壳不重复添加页面 inset,内容组件继续拥有阅读宽度和安全底缘。
|
|
37
|
+
两种外壳都约束 body 高度;页头自然取高,动作可换行,就地展开内容可覆盖主体。
|
|
38
|
+
`scrollOwner="content"` 是默认值,body 将滚动交给既有内部容器;`scrollOwner="layout"`
|
|
39
|
+
让 body 自己承接自然文流与滚动。标题、关闭与其他 header 动作不放进 body 滚动区。
|
|
40
|
+
仅 `content` 模式向直属内容根分配伸缩空间;`layout` 模式保留控件自身的默认尺寸。
|
|
41
|
+
`RegionLayoutDescription` 用命名矩阵声明页面区域,浏览器宿主调用
|
|
42
|
+
`mountRegionLayout(host, layout, options)`,获得 `regions` 内容根、`showGroup`、`back` 和 `dispose`。
|
|
43
|
+
作者把内容放入这些根;矩形区域、有限尺寸、局部排列与滚动归属共享同一校验和 renderer。
|
|
44
|
+
`content` 行按自然内容领取空间,`fill` 行领取余量;空间不足时 content 区域按其滚动 owner
|
|
45
|
+
保持动作可达。组件应限制自身长内容,不能依靠外壳默认裁切来保住阅读空间。
|
|
46
|
+
多列在窄窗投影为一列;区域的 `compactRow="content" | "fill"` 可指定该投影中的自然高或
|
|
47
|
+
剩余高度,省略时沿原矩阵行推导。它不改变分组、桌面几何、内容挂载或滚动 owner。
|
|
48
|
+
跨模块合同和内置/扩展的共同使用见
|
|
49
|
+
统一 Extension 的区域布局(原产品仓库历史参考)。
|
|
50
|
+
原产品的接线和 UI 验收属于历史证据,不能代替本库迁移后的独立验证。
|
|
51
|
+
|
|
52
|
+
`CodeBlock` 接收原始 `code` 和可选 `language`,已知语法按需加载 Shiki 高亮,提供独立复制与自动换行开关。
|
|
53
|
+
换行只改变显示,复制保留原始空白;浏览器剪贴板失败时显示反馈。`onCopy` 可由宿主绑定其他
|
|
54
|
+
剪贴板实现,组件不执行代码。无语言时显示“代码”,`defaultWrap` 设置初始换行状态。
|
|
55
|
+
未知语言或高亮加载失败时保留纯文本显示。
|
|
56
|
+
|
|
57
|
+
`Checkbox`、`Switch` 和 `SegmentedControl` 提供原生表单选择;`Tabs` 负责保留挂载的面板切换。
|
|
58
|
+
`Menu`、`HoverCard`、`Toast`、`RiskConfirmation` 提供菜单、预览和反馈,业务操作与显示寿命由宿主负责。
|
|
59
|
+
`TerminalBlock`、`ReadBlock`、`DiffBlock`、`SearchBlock`、`WebBlock` 与 `JsonBlock/JsonTree`
|
|
60
|
+
展示宿主提供的输出;组件不执行工具或读取文件。`ReadBlock` 可传 `lang`,首次进入视口时加载高亮,未知语言保留纯文本。
|
|
61
|
+
`ImagePreview` 统一图片加载、失败与预览框,`ImageLightbox` 提供单图查看,
|
|
62
|
+
`ShortcutKeys`、`PathLabel`、`StateDot` 和 `TextShimmer` 提供辅助呈现。
|
|
63
|
+
|
|
64
|
+
`Pill` 用于紧凑胶囊标签或操作,选中状态由宿主提供;静态标签沿用 `Badge`,支持 outline、solid 和 quiet 呈现。
|
|
65
|
+
|
|
66
|
+
界面改版(系统设计稿(原产品仓库历史参考))新增的通用组件:
|
|
67
|
+
`StatusDot` 以 processing(accent 脉冲)、success、returned(空心绿,执行返回不等于目标完成)、
|
|
68
|
+
warning、danger、unknown(空心灰,不假装知道)、idle 表达状态,点本身不带文字;`Tag` 是挨着内容的静态事实
|
|
69
|
+
(中性、强调、橙色计数、等宽路径),可选择与筛选仍用 `Pill`;`ProcessGroup` 与 `ProcessStep` 是折叠的步骤记录;
|
|
70
|
+
`WorkCard` 是对话里指向一件工作的单个控件;`IconRail`、`RailItem` 与 `RailSection` 是 56px 图标栏,悬停或键盘
|
|
71
|
+
聚焦时展开为覆盖在内容上的 256px 抽屉,分组收起时折成一个图标并显示子项的当前位置与橙点。
|
|
72
|
+
`Button` 的 `outline` 是次要层级,另有 `accent`(关于当前活动的软底)与 `stop`(打断运行中的工作)。
|
|
73
|
+
第二阶段补齐的详情与页面结构:`DetailSection`(带发丝线的分块,标题是小标签而非页面标题)、`Timeline` 与
|
|
74
|
+
`TimelineItem`(一条线串起的事件,标记点沿用 `StatusDot` 语义)、`ResourceLink`(指向一个可打开对象的整行引用,
|
|
75
|
+
有 href 时是链接,否则是按钮);`PageHeader`(页名、一句用途与页面级操作)、`ListGroup` 与 `ListRow`(并列条目共用一圈
|
|
76
|
+
轮廓,可在行下展开编辑区,单独使用并设 `tone="accent"` 是摘要行)、`ResourceCard`(概览页里的一项能力,停用态用虚线
|
|
77
|
+
低对比);`Drawer` 是窄屏从起始边滑入的原生模态面板,遮罩点击与 Escape 都交给宿主更新 `open`。`SegmentedControl` 的
|
|
78
|
+
轨道与选中态按设计稿收紧。窄屏的 `ChatComposer` 堆叠布局把「添加、输入、发送」放在一行,模型选择留在下方。
|
|
79
|
+
色板与层级只在 `theme/palette.ts`:`accentTokens`、`statusTokens`、`radiusTokens`(8/10/14/22)、`lineTokens`
|
|
80
|
+
(0.5px 发丝线)、`layerTokens`;accent 只表达「正在发生」与「当前所在」,primary 仍为黑白。
|
|
81
|
+
|
|
82
|
+
`ChatToolCall` 用 `label` 表示动作,`summary` 表示折叠时仍可见的简短目标;`detail` 与结果 children
|
|
83
|
+
在展开后显示。完成状态保留可访问描述,运行、等待、失败和未确认状态始终可见。
|
|
84
|
+
`ChatProcess` 用原生 details 聚合过程,可传 `icon` 表示动作类别,展开时显示向上折叠图标。
|
|
85
|
+
工具名称、摘要与结果均由宿主提供,组件不推断执行事实。
|
|
86
|
+
|
|
87
|
+
`ChatMessageList` 的行距由列声明、由行读取:列在每个非首行上给出 `--chat-row-pitch`,行按它设置
|
|
88
|
+
上边距,首行的上边距来自列表自身的内距。宿主逐条挂载消息时可以在列与行之间插入无布局容器
|
|
89
|
+
(`display: contents`),行距与直接子项一致。工具调用、过程分组与来源共用同一组行度量
|
|
90
|
+
(leading 盒、间隙与行盒),并随 `--chat-font-body` 相对 14px 的增量一起缩放:改变对话字号时
|
|
91
|
+
字形盒、字形、行盒与展开体缩进一起移动。行所拥有的内容(展开体、分组内的行)挂在行标签的
|
|
92
|
+
轴线上,与标签本身区分层级;与行并列的条目留在同一轴线上。
|
|
93
|
+
|
|
94
|
+
连续回复传入同一头像与 `continuation`,主题保留头像列并隐藏重复头像,正文轴线不依赖相邻 DOM 结构;未传头像的组继续使用无头像布局。
|
|
95
|
+
|
|
96
|
+
默认尺度与组件开发顺序见 [组件开发约定](AGENTS.md)。新组件先在 Meowbook 与现有控件同屏校准,
|
|
97
|
+
再接入应用;主题的字号、控件高度和三层间距是一套关系,不分别为每个组件选择一组新尺寸。
|
|
98
|
+
默认按钮高 36px,紧凑按钮高 28px,输入控件高 32px。信息块内部紧凑;页面边缘、独立区块与阅读区域应有充分留白。
|
|
99
|
+
局部间距 token 不是页面留白的上限,不将所有层级统一压紧。
|
|
100
|
+
|
|
101
|
+
界面正文使用 `uiTokens.fontBody`,辅助说明使用 `uiTokens.fontCaption`,长文与对话正文使用
|
|
102
|
+
`uiTokens.fontReading`,局部标题使用 `uiTokens.fontTitle`,完整页面标题使用
|
|
103
|
+
`uiTokens.fontPageTitle`,不把页面标题尺度用于字段标签。普通控件的水平内距由
|
|
104
|
+
`uiTokens.controlPaddingInline` 决定;group、section、panel 分别表达组内、区域之间和容器边缘的留白。
|
|
105
|
+
阅读段落的相对缩进、媒体尺寸、图谱坐标与触摸目标仍按真实用途设置,不套用控件尺度。
|
|
106
|
+
|
|
107
|
+
`PageFrame` 的页面边缘使用 `pageInsetBlock` / `pageInsetInline`,窄窗使用对应的
|
|
108
|
+
`pageInsetCompactBlock` / `pageInsetCompactInline`;页面留白不压成局部 panel 内距。
|
|
109
|
+
`ResourceCard` 使用统一的局部标题、正文、辅助文字与 card 圆角;紧凑概览对象的内距和
|
|
110
|
+
纵向节奏只在组件主题 token 中定义,不增加任意像素或 density 参数。需要核对的 identity
|
|
111
|
+
使用辅助文字色与等宽字体,停用状态不抹去名称与操作原因。
|
|
112
|
+
Meowbook 的 `page-structure-long-content` 补充长名称、准确标识、邻接状态与禁用动作的组合;
|
|
113
|
+
`EmptyState` 透传调用方的原生属性,状态紧急度与加载事实仍由宿主提供。
|
|
114
|
+
|
|
115
|
+
从仓库根运行 `bun test packages/meowtail/tests/unit` 执行 `tests/unit` 的 Bun 测试;类型检查与 `tests/browser` 的组件行为回归分别执行。文件归属与命名遵循测试文件组织规范(原产品仓库历史参考)。
|
|
116
|
+
浏览器测试只启动本包的 Meowbook 场景,不需要 Dashboard。组件交互、布局、对话组件和主题
|
|
117
|
+
回归统一位于 `tests/browser`;其中 catalog 验证本包展示配置作为 Meowbook 消费者的实际接合。
|
|
118
|
+
Meowbook 自身的工具与独立夹具测试仍由 `test:meowbook` 负责。
|
|
119
|
+
完整 UI 回归还需运行 Meowbook 测试及本包 `playwright.config.ts` 的浏览器场景。
|
|
120
|
+
|
|
121
|
+
`ChoiceGroup` 直接展示少量单选项,复用原生 radio 的键盘、表单和必填校验。
|
|
122
|
+
支持选项说明、禁用、受控值及表单重置;不负责提交。
|
|
123
|
+
`ChatQuestion` 提供问题、补充说明、回答内容、反馈和操作的布局;回答方式、异步提交和取消的业务含义
|
|
124
|
+
由宿主负责。标准主题遵循紧凑工作尺度,相关操作集中排列,不默认拉到容器两端。
|
|
125
|
+
|
|
126
|
+
### 布局与内容组合
|
|
127
|
+
|
|
128
|
+
`Stack` 纵向排列,`Inline` 横向排列且默认允许换行。共同提供 `gap`(none/compact/normal/relaxed)、
|
|
129
|
+
`align` 和 `justify`;`Inline wrap={false}` 可明确保持单行。组件保留方向与排列结构,theme 决定语义间距。
|
|
130
|
+
`Grid` 默认按容器宽度自动排列,`minColumnWidth` 为 compact/normal/wide;也可指定 `columns={1|2|3|4}`。
|
|
131
|
+
固定列数不会偷偷变成响应式列数。`Container width` 为 narrow/content/wide/full,主题控制内容最大宽度。
|
|
132
|
+
Stack 默认 stretch 便于表单与内容区域填满宽度;混合标签和按钮时用 `align="start"` 保留自然尺寸,
|
|
133
|
+
或把行动放入 Inline。字段、动作与长文字按内容关系明确选择 stretch、start 或 baseline 对齐。
|
|
134
|
+
|
|
135
|
+
局部布局可以自由嵌套这些 JSX 组件:先选择横向、纵向或并列关系,再在需要分配余量时使用
|
|
136
|
+
`LayoutItem`,内容和原生语义仍由真实组件承载。页壳与命名区域矩阵分配页面空间,
|
|
137
|
+
不限制区域内部的组件组合;没有新增可序列化的递归布局模板或另一套布局引擎。
|
|
138
|
+
|
|
139
|
+
沿用这套布局原语,不在应用中重复实现方向、对齐和间距。Stack/Inline/Grid 的 `rowGap`、
|
|
140
|
+
`columnGap` 默认 auto(沿用 gap),可单独使用同一套语义间距。布局可用 `as="header"` 或
|
|
141
|
+
`as="footer"` 保留区域语义;组件不会代替宿主选择业务断点、文字截断或换行策略。
|
|
142
|
+
|
|
143
|
+
`Toolbar` 默认横向并允许换行;`orientation="vertical"` 沿纵向排列。它为自身按钮、原生输入型按钮和有 href 的链接动作集合提供一个 Tab 停靠,方向键、Home / End 在当前集合内移动,横向尊重 RTL。原生 Input、Textarea、Select 和自管键盘的组合控件保留独立 Tab 与编辑键;嵌套 Toolbar 不重复消费。隐藏、disabled、inert 或作者显式 `tabIndex=-1` 的入口不入动作集合,动态成员变化不主动夺焦点。Enter / Space 仍沿控件原生激活,不自动将复杂输入折进 overflow 菜单;卸载恢复本组件管理过的 tabindex,保调用方后续有效属性。
|
|
144
|
+
|
|
145
|
+
`LayoutItem` 控制直接子项的空间分配:`grow` 默认 false,`shrink` 默认 true,
|
|
146
|
+
`basis` 默认 auto,`alignSelf` 默认 auto。它保留 min-width:0,让长内容能收缩;长标识符
|
|
147
|
+
是否断行、正文是否截断由内容决定。只在需要控制子项空间时使用,不要求每个元素包一层。
|
|
148
|
+
|
|
149
|
+
```tsx
|
|
150
|
+
// 标签与值属于一组,混合字号沿文字基线对齐。
|
|
151
|
+
<Inline gap="compact" align="baseline">
|
|
152
|
+
<small>默认连接</small>
|
|
153
|
+
<strong>Codex</strong>
|
|
154
|
+
<small>gpt-6-luna</small>
|
|
155
|
+
</Inline>
|
|
156
|
+
|
|
157
|
+
// 正文使用剩余宽度,动作保留自然尺寸。
|
|
158
|
+
<Inline wrap={false}>
|
|
159
|
+
<LayoutItem grow><Stack gap="compact">{title}{description}</Stack></LayoutItem>
|
|
160
|
+
<LayoutItem shrink={false}><Button>编辑连接</Button></LayoutItem>
|
|
161
|
+
</Inline>
|
|
162
|
+
|
|
163
|
+
// 操作靠近排列,换行后留出更清楚的行距。
|
|
164
|
+
<Inline as="footer" gap="compact" rowGap="normal">{actions}</Inline>
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Meowbook 的“布局组合 · 文本基线与固定动作”同时覆盖这些组合与长模型标识符。
|
|
168
|
+
|
|
169
|
+
`DescriptionList` / `DescriptionItem term={...}` 用原生 `dl` / `dt` / `dd` 组织相关的标签与值。
|
|
170
|
+
同组标签自然取宽并有上限,值共享列起点;局部容器宽度不足时,每项按标签、值上下排列,
|
|
171
|
+
不按整个窗口宽度判断。默认保留语义字号与可换行长文本,不提供表面、内距或独立滚动。
|
|
172
|
+
需要父容器分配可用宽度,不承诺按内容收紧宽度的布局;当前 Web 主题使用 CSS subgrid 与容器查询。
|
|
173
|
+
标签和任意值都可传 `Child`,值内继续组合已有布局与控件,不提供元数据 schema 或额外动作插槽。
|
|
174
|
+
代码字体、截断和固定尺寸子内容由消费者决定;普通文字与长标识默认可断行。
|
|
175
|
+
公开 parts 为 `description-list/root`、`description-item/root/term/value`,原生属性透传到各组件 root。
|
|
176
|
+
|
|
177
|
+
```tsx
|
|
178
|
+
<DescriptionList>
|
|
179
|
+
<DescriptionItem term="工作目录">
|
|
180
|
+
<Inline wrap={false} gap="compact" align="start">
|
|
181
|
+
<LayoutItem grow>
|
|
182
|
+
<code>{workspacePath}</code>
|
|
183
|
+
</LayoutItem>
|
|
184
|
+
<LayoutItem shrink={false}>
|
|
185
|
+
<Button size="small">复制目录</Button>
|
|
186
|
+
</LayoutItem>
|
|
187
|
+
</Inline>
|
|
188
|
+
</DescriptionItem>
|
|
189
|
+
<DescriptionItem term="访问方式">只读</DescriptionItem>
|
|
190
|
+
</DescriptionList>
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Meowbook 的 `description-list-composition` 在同一视口展示宽、窄局部容器、长标签与标识、
|
|
194
|
+
值内动作和输入,用于核对共享列、自然重排、原生语义与草稿连续性;它不代表业务页面已验收。
|
|
195
|
+
|
|
196
|
+
`Card` 支持 CardHeader、CardTitle、CardDescription、CardAction、CardContent、CardFooter。
|
|
197
|
+
默认 `variant="auto"` 通过渲染树 Context 取得深度:标准主题将顶层呈现为独立表面、后代融入父级;显式 variant 优先。
|
|
198
|
+
深度跟随逻辑组件树,浮层不会因为视觉上离开父卡片而自动变成新根;需要独立表面的弹层内容显式使用 surface。
|
|
199
|
+
Title 可以指定 h2–h6,标题等级仍由文档结构决定,不根据卡片嵌套自动猜测。
|
|
200
|
+
内部普通分组使用共享表面,独立事项可以明确使用 `variant="surface"`;`variant="embedded"` 明确融入父表面。
|
|
201
|
+
嵌套关系不等于必须重复外框和阴影。复杂内容仍使用 Stack/Inline/Grid 排版,不把 Card 变成万能布局组件。
|
|
202
|
+
|
|
203
|
+
`FieldGroup` 使用原生 fieldset/legend 组织字段,支持整组 disabled;Field 继续负责单个字段关联。
|
|
204
|
+
`AspectRatio ratio={16/9}` 控制布局比例,媒体的 object-fit 与裁切由调用方选择。
|
|
205
|
+
`Separator` 保留横向/纵向分隔语义。
|
|
206
|
+
|
|
207
|
+
`Tabs` 使用必需的 id、label 与 items(value/label/content/disabled)创建关联的 tab/tabpanel;
|
|
208
|
+
支持方向键、Home/End、受控 value Signal 与 defaultValue。切换时面板保持挂载,草稿不丢失。
|
|
209
|
+
`Breadcrumb items` 为 label/href 数组,最后一项标记当前位置。
|
|
210
|
+
`Tooltip` 使用 `trigger(bindings)` 为有名称的可聚焦控件补充文字说明,鼠标延迟出现、键盘聚焦立即出现,
|
|
211
|
+
Escape 关闭;不要把必要信息或可交互内容只放进 Tooltip,后者使用 Popover。
|
|
212
|
+
`Alert tone` 表达视觉状态,`role` 明确选择 status/alert,紧急度不由颜色推断。
|
|
213
|
+
`Skeleton` 是 aria-hidden 的占位;调用方提供内容区域的 aria-busy 和加载文案。
|
|
214
|
+
`SkeletonBoundary active={loading} label="正在更新资料"` 对已挂载的内容应用骨架呈现,
|
|
215
|
+
`active` 接收 boolean 或 Signal;切换不会卸载 children,保留输入草稿与组件状态。
|
|
216
|
+
加载时区域标记 aria-busy、内容 inert,屏幕阅读器从区域外的 status 获取调用方提供的加载文案。
|
|
217
|
+
开始加载时释放内容内的焦点;完成后不自动抢回焦点。调用方应把取消、重试等可用操作放在边界外。
|
|
218
|
+
底层使用 MeowJSX Web 的共享骨架控制器,对文字、图片、图标及输入统一去细节;这只是加载呈现,
|
|
219
|
+
不负责发起请求、计时或判断完成。首次加载尚无内容几何时,仍由调用方使用 `Skeleton` 提供占位结构。
|
|
220
|
+
宿主显式给 Web renderer 接入 `observation` hub 时,边界从渲染树 Context 取得来源并订阅自己的
|
|
221
|
+
组件子树;嵌套边界按 contract 与节点归属定位,不依赖函数名。普通未观察的 renderer 仍用局部 DOM
|
|
222
|
+
方式呈现,不强制开启组件索引。两种方式都保留外部 DOM 与主题变化的补充监听。
|
|
223
|
+
`Spinner label` 提供可读加载状态,不宣称真实进度。
|
|
224
|
+
|
|
225
|
+
原生选择控件 `Select` 复用浏览器的选项、键盘与表单语义,提供 `root` part;视觉由 theme 决定。它同时用于 Meowbook 工具外观与场景主题选择。控件保留原生 `size`(行数)语义,不把它复用成视觉尺寸。
|
|
226
|
+
|
|
227
|
+
`Popover` 是非模态的通用弹层,不默认设置菜单角色或锁住焦点。必需 `id` 和
|
|
228
|
+
`trigger(bindings)`;触发按钮展开 bindings,内容放 children。支持 `open` Signal / `defaultOpen`、
|
|
229
|
+
`onOpenChange`、`align`、`matchTriggerWidth`、`role` 和 `labelledBy`。`triggerId` 可与外部 Field 关联。
|
|
230
|
+
使用浏览器 Popover API 的顶层承载,依赖支持该 API 的浏览器;定位采用 `@floating-ui/dom`
|
|
231
|
+
的 offset/flip/shift/size 与打开期间的 autoUpdate,关闭或卸载时清理。外部点击关闭最上层,
|
|
232
|
+
Escape 返回当前层入口;焦点移到外部时不抢回焦点。内容按普通 Tab 顺序访问,菜单键盘规则由消费者提供。
|
|
233
|
+
局部 DOM 控件先处理 Escape;子 `preventDefault()` 表示消费,未消费时只由原 topmost 调用一次既有 `onKeyDown` 并尝试关闭,回调后重核原层,不能同一键再关 parent。单独 `stopPropagation()` 阻断自定义派发,不承诺阻止原生 Dialog 默认取消。正常回焦仍要求成功关闭且 trigger 可用,controlled 拒绝关闭、外部主动转焦和卸载不被强行覆盖;不吞调用方异常。
|
|
234
|
+
定位与限高完成后,仅最上层弹层把内部当前聚焦项滚入可见区域,不移动焦点或滚动外层。
|
|
235
|
+
parts 为 `root/panel`,表面、间距与动效归 theme。
|
|
236
|
+
|
|
237
|
+
`ChoiceSelect` 在 Popover 上实现自定义单选,原生 `Select` 继续用于系统选择器与多选。
|
|
238
|
+
`options` 为 `{ value, label, disabled?, group? }[]`,支持 `defaultValue` 或受控 `value` Signal,
|
|
239
|
+
用 `onValueChange` 接收选择。方向键、Home/End、字符定位、Enter/Space、Escape 和 Tab 可用。
|
|
240
|
+
`id` 用于 Field 关联;`name/required/disabled/form` 接到原生表单控件,必填失败阻止提交并聚焦
|
|
241
|
+
触发按钮。错误消息使用浏览器的原生校验文案。重置恢复非受控默认值,受控值仍归调用方。
|
|
242
|
+
主题视觉隐藏原生表单载体;不以 hidden input 冒充 required 校验。不提供自定义多选或异步搜索。
|
|
243
|
+
parts 为 `root/trigger/value/indicator/list/group/option/native/validation`。
|
|
244
|
+
|
|
245
|
+
- 基础:Button、AddButton、IconButton、Card、Badge、Input、Textarea、Select、Field、
|
|
246
|
+
SearchInput、Disclosure、Separator、NavItem、EmptyState。
|
|
247
|
+
- 对话框:Dialog、DialogPanel、DialogHeader、DialogActions。
|
|
248
|
+
- Chat:ChatFrame、ChatHeader、ChatStatus、ChatConversation、ChatMessageList、ChatMessage、ChatBubble、
|
|
249
|
+
ChatMessageActions、ChatComposer、ChatToolCall、ChatAttachments、ChatProcess、ChatSources。
|
|
250
|
+
- 图标:统一 Lucide 子集 `Icon` 与 `iconNames`,以及 MeowlandMark、DoodleCat、NotesIcon、TasksIcon、SearchIcon、PlusIcon、
|
|
251
|
+
GithubIcon、ExternalArrowIcon。
|
|
252
|
+
|
|
253
|
+
新增组件前先确认它能在两个以上的应用或场景中复用;应用只使用一次的页面组件不要
|
|
254
|
+
为了“提取”而迁入这里。
|
|
255
|
+
|
|
256
|
+
`Field` 在只有一个控制子节点且能从 `htmlFor`、`descriptionId` 或 `errorId` 解析关联
|
|
257
|
+
时,会把描述和错误节点的 id 连接到控制节点的 `aria-describedby`,并在有错误时设置
|
|
258
|
+
`aria-invalid`。多个控制节点或自定义组合仍由调用方显式传递关联属性。
|
|
259
|
+
|
|
260
|
+
`Dialog` 只负责原生 `<dialog>` 的结构、标签关联和 panel/header/actions 分区;打开、关闭、
|
|
261
|
+
Escape、焦点返回和提交结果仍由应用控制。它没有仿 Radix 的 context、portal 或 focus trap,
|
|
262
|
+
不要把这些行为默认为组件已经提供。
|
|
263
|
+
`DialogPanel header={...}` 与 `Drawer header={...}` 显式组合共享 `PageFrame`,标题和关闭
|
|
264
|
+
同处固定 header,body 是唯一的主滚动区。`DialogPanel as="form"` 保留原生表单归属与提交,
|
|
265
|
+
短内容自然取高,长内容继承宿主 dialog 的最大高度;不扫描 children 猜标题,也不重复计算页头高度。
|
|
266
|
+
消费者将 `DialogHeader` 放进 header 属性,正文与原有末尾动作放进 children;原生窗口、
|
|
267
|
+
取消、草稿及打开方式仍归宿主。正文滚动引用沿公开 `page-frame/body` part 获取。
|
|
268
|
+
DialogPanel 在直属 header 与 body 内分配标准留白,保证正文首末控件的焦点轮廓位于其滚动视口内;任意 Child header 使用同一 `spaceSection` 分隔,无 header 时 body 四边取 panel 留白。既有 DialogHeader 组合保持原内容几何,不承诺任意自定义 header 总高不变;没有新增 gap 属性。固定标题、退出与唯一 body 滚动仍分开,任何极小高度都足够阅读不是承诺。原生 Dialog 的打开、取消与 caller 焦点前提不变,主题留白修复不表示所有指针/系统焦点路径均已验证。
|
|
269
|
+
|
|
270
|
+
`EmptyState size="compact"` 用于局部空列表或未选内容区域,沿用标题、说明和动作,去掉装饰插图。
|
|
271
|
+
默认 `size="default"` 保留整页空态;加载与失败仍使用各自已有反馈,不改成空态。
|
|
272
|
+
|
|
273
|
+
`ChatAttachments` 接收 `items: readonly ChatAttachmentItem[]`,每项包含
|
|
274
|
+
`id`、`name`、`url`、`mediaType` 和可选的 `sizeBytes`;`label` 默认是“消息附件”。
|
|
275
|
+
调用方提供 URL,组件不获取数据。图片默认以可访问的新窗口链接和懒加载预览展示,提供 `onPreview` 时改为预览按钮;
|
|
276
|
+
文件链接使用原文件名下载,提供有效大小时显示 B / KB / MB。
|
|
277
|
+
主题通过 `partSelector(chatAttachmentsContract, part)` 使用 `chat-attachments` 的
|
|
278
|
+
`root/entry/image/preview/file/icon/details/name/size/previewButton/remove` parts。
|
|
279
|
+
每项可提供 `onRemove`,只有草稿需要移除操作时才传入;上传、删除文件和 URL 生命周期仍归宿主。
|
|
280
|
+
|
|
281
|
+
`ChatComposer` 的 `hintId` 会把提示节点和输入框通过 `aria-describedby` 关联;`onInput`
|
|
282
|
+
绑定在 textarea 上,`onSubmit` 绑定在外层 form 上。`value` 支持 Signal,`submitDisabled`
|
|
283
|
+
仅禁止提交,适合等待结果时继续编辑;`disabled` 同时禁止编辑与提交。请求状态、已提交快照和
|
|
284
|
+
最新草稿由调用方管理。`attachments` 放待发送材料,`inputLabel` 提供输入名称。
|
|
285
|
+
标准主题把附件、输入、辅助操作和提交组织在同一书写面中。
|
|
286
|
+
`layout="inline"` 让短草稿与操作同排,长草稿保持增高;聚焦时显示提示,默认 `stacked` 保留独立工具行。
|
|
287
|
+
`layout="hero"` 使用桌面母版空白对话的输入高度。`trailing` 在发送按钮左侧组合 provider、模型等选择入口;
|
|
288
|
+
可传入受控 `ChoiceSelect`,用 `placement="top"`、`align="end"`、`matchTriggerWidth={false}`
|
|
289
|
+
向上展开分组选项。选项来源、当前值与运行配置的实际切换仍由宿主负责。
|
|
290
|
+
|
|
291
|
+
`ChatMessage` 管身份、排列与状态,默认在内容中包装 `ChatBubble`,保留原调用方式。
|
|
292
|
+
需要将附件、过程和文字分别展示时,设置 `surface="none"`,自行组合 `ChatBubble` 与其他组件。
|
|
293
|
+
Bubble 的 `auto` 通过 Context 读取消息角色,主题决定底色;也可显式选择 `plain` / `filled`。
|
|
294
|
+
`header` / `footer` 是补充材料和送达反馈的插槽,业务状态仍由宿主提供。
|
|
295
|
+
|
|
296
|
+
`ChatConversation` 是可选的滚动容器,宿主必须提供受约束的高度。
|
|
297
|
+
它在靠近底部时跟随追加内容,上翻时保留位置,并提供返回最新的按钮。
|
|
298
|
+
它不实现历史前插、逐消息锚点或持久化阅读恢复。不要与应用已有滚动控制器叠加;
|
|
299
|
+
Dashboard 继续使用自身控制器。`ChatMessageList` 仍只提供消息记录语义。
|
|
300
|
+
|
|
301
|
+
`SearchInput` 提供搜索图标与原生 search input 的共同外壳,`label` 是必需的可访问名称。
|
|
302
|
+
`className` 作用于外壳,`inputClassName` 作用于输入;`id/name/value/disabled/readOnly/aria-*`
|
|
303
|
+
及事件都传给 input,保留 Field 的说明和错误关联。筛选、提交与结果状态仍由消费者负责。
|
|
304
|
+
parts 为 `root/icon/control`,默认表面、焦点和错误边界由 theme 决定。
|
|
305
|
+
|
|
306
|
+
`PathPicker` 组合受控路径输入与可选的浏览按钮。调用方提供 `value/onValueChange`、
|
|
307
|
+
可访问名称 `label`,以及返回路径或 `null`(取消)的异步 `onChoose`;`kind="file" | "directory"`
|
|
308
|
+
只确定按钮文字,实际选择能力由宿主注入。不提供 `onChoose` 时仍可手动输入。
|
|
309
|
+
组件负责等待、失败反馈与卸载后忽略结果;在途时暂时锁定输入,父值或禁用/只读状态变化后不写回旧选择。
|
|
310
|
+
选择只填写路径,不读取文件、上传文件或授予访问权限。说明、校验与保存仍归调用方。
|
|
311
|
+
|
|
312
|
+
`Disclosure` 使用原生 details/summary,接收 `summary: Child` 与内容 children,支持
|
|
313
|
+
`open/name/onToggle` 等原生属性。`summaryClassName`、`contentClassName` 用于宿主布局;
|
|
314
|
+
parts 为 `root/summary/icon/content`。它不维护另一份展开状态,也不是多项 Accordion。
|
|
315
|
+
|
|
316
|
+
## 标准主题(meowtail/theme)
|
|
317
|
+
|
|
318
|
+
标准主题导出 `standardTheme`、`standardOptions` 和类型化的 `uiTokens`。token 与样式
|
|
319
|
+
都由 TypeScript 定义;组件通过稳定的 part 标记与样式选项匹配 CSS,不再由主题插件
|
|
320
|
+
生成视觉类名。完整设计见 TypeScript token 与参数化配置(原产品仓库历史参考)。
|
|
321
|
+
|
|
322
|
+
样式文件统一采用 `<职责>.styles.ts`,标准主题按组件与对话职责分组,应用样式随应用模块维护。
|
|
323
|
+
命名、组件族边界与层叠整理见样式文件组织(原产品仓库历史参考)。
|
|
324
|
+
现有样式已按此规范迁移,历史对话覆写已并回消息与输入框负责文件。
|
|
325
|
+
|
|
326
|
+
### 组件安装与样式交付
|
|
327
|
+
|
|
328
|
+
组件安装和样式加载是两个明确的步骤。`createMeowUI()` 注册组件及样式属性适配器;
|
|
329
|
+
`standardTheme.cssText` 提供包含变量声明和组件规则的完整 CSS。动态宿主可以这样组装:
|
|
330
|
+
|
|
331
|
+
```tsx
|
|
332
|
+
import { createRuntime, h } from "meowjsx";
|
|
333
|
+
import { createWebRenderer } from "meowjsx/web";
|
|
334
|
+
import { Button, createMeowUI } from "meowtail";
|
|
335
|
+
import { standardTheme, standardOptions } from "meowtail/theme";
|
|
336
|
+
import { applyTheme, mountStyles } from "meowcss/web";
|
|
337
|
+
|
|
338
|
+
const runtime = createRuntime({ plugins: [createMeowUI()] });
|
|
339
|
+
const web = createWebRenderer(runtime);
|
|
340
|
+
const removeStyles = mountStyles(container.ownerDocument, standardTheme.cssText);
|
|
341
|
+
const removeTheme = applyTheme(
|
|
342
|
+
container,
|
|
343
|
+
standardTheme,
|
|
344
|
+
standardOptions.select({ scheme: "light" }),
|
|
345
|
+
);
|
|
346
|
+
const mounted = web.render(<Button variant="quiet">取消</Button>, container);
|
|
347
|
+
|
|
348
|
+
// 宿主销毁时:
|
|
349
|
+
mounted.unmount();
|
|
350
|
+
removeTheme();
|
|
351
|
+
removeStyles();
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
使用 defaultRuntime 时调用 `installMeowUI(defaultRuntime)`,并让初次渲染和动态控件
|
|
355
|
+
使用同一个 runtime。无需另外安装标准主题插件。样式属性的合法值、默认值和承载 part
|
|
356
|
+
由组件 contract 的 `defineStyleProps` 声明;适配器负责消费属性,避免将 variant 等
|
|
357
|
+
样式选项当作普通 DOM 属性透传。`ThemedProps` 提供联合类型及 Signal 输入;组件沿用
|
|
358
|
+
开放的原生 Props,因此不承诺拒绝所有未知属性。
|
|
359
|
+
|
|
360
|
+
静态宿主在构建时组合 `standardTheme.cssText` 与应用 CSS,写出 `.css` 文件并由 HTML
|
|
361
|
+
加载,同时通过 `themeAttributes(standardTheme, config)` 输出根属性。样式在客户端
|
|
362
|
+
JavaScript 执行前即可加载。Dashboard 和 Meowbook 使用这条交付路径;
|
|
363
|
+
动态预览使用 `mountStyles(document, cssText)`,由宿主持有返回的清理函数。
|
|
364
|
+
源码不维护 `.css` 文件,生成的 CSS 仍是浏览器资源。模块导入本身不访问 DOM,
|
|
365
|
+
`mountStyles` 不负责跨调用去重,宿主应在文档或应用生命周期内组装一次。
|
|
366
|
+
|
|
367
|
+
### 根配置与局部覆盖
|
|
368
|
+
|
|
369
|
+
`standardOptions` 内置 scheme,当前标准主题默认 `auto`,支持 light/dark/auto。
|
|
370
|
+
标准视觉以 DeepSeek Harness 为基准:系统字体、正文 14px、辅助 12px、标题 16px;按钮
|
|
371
|
+
small/default/large 使用 28/36/44px,输入框默认 32px。控件、菜单和大面板分别使用对应的
|
|
372
|
+
圆角与材质,应用从同一语言组合页面。参考来源与许可证见 [第三方说明](THIRD_PARTY_NOTICES.md),
|
|
373
|
+
实施范围及尚未完成的验证见 迁移记录(原产品仓库历史参考)。
|
|
374
|
+
|
|
375
|
+
```tsx
|
|
376
|
+
import { Theme } from "meowcss/web";
|
|
377
|
+
|
|
378
|
+
<Theme theme={standardTheme} config={standardOptions.select({ scheme: "dark" })}>
|
|
379
|
+
<Button>保存</Button>
|
|
380
|
+
<Theme config={standardOptions.select({ scheme: "light" })}>
|
|
381
|
+
<Preview />
|
|
382
|
+
</Theme>
|
|
383
|
+
</Theme>;
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
`Theme` 只绑定配置,不加载 CSS。局部 config 省略的维度继承父级;移除局部选择恢复
|
|
387
|
+
继承,组件实例和草稿不需要重建。已有 DOM 根使用 `applyTheme`,静态 HTML 使用
|
|
388
|
+
`themeAttributes`,三者共享属性语义。不要为每套主题创建新的 Theme 组件。
|
|
389
|
+
|
|
390
|
+
### 样式与组件选项
|
|
391
|
+
|
|
392
|
+
普通 CSS 保持模板形式;token 与 part 在 TypeScript 中引用,避免手写生成后的名称:
|
|
393
|
+
|
|
394
|
+
```ts
|
|
395
|
+
import { buttonContract, buttonOptions } from "meowtail";
|
|
396
|
+
import { css, partSelector } from "meowcss/meowjsx";
|
|
397
|
+
import { uiTokens } from "meowtail/theme";
|
|
398
|
+
|
|
399
|
+
const applicationStyles = css`
|
|
400
|
+
.toolbar ${partSelector(buttonContract, "root")} {
|
|
401
|
+
border-radius: ${uiTokens.controlRadius};
|
|
402
|
+
${buttonOptions.when({ variant: "quiet" })} {
|
|
403
|
+
color: ${uiTokens.info};
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
`;
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
宿主显式按标准主题、应用基础、应用覆写的顺序组合 CSS。hover、focus、媒体查询与动画
|
|
410
|
+
继续由 CSS 执行;原生状态用原生属性匹配,组件样式选项使用 `when`。`className` 和
|
|
411
|
+
`style` 保留为应用扩展入口,业务布局不进入标准主题。
|
|
412
|
+
|
|
413
|
+
自定义 token 使用 `defineTokens`,通过 `defineTheme` 一次组合选项、完整默认值、token
|
|
414
|
+
集合和 CSS 片段。组件绑定从片段中的 typed part 引用取得;不要提前将片段转成字符串而
|
|
415
|
+
丢失这些信息。无默认值的测量变量使用 `tokenRef`,通过 `.name` 交给 `setProperty`。
|
|
416
|
+
纯生成与 typed adapter 的写法和作用域边界见 [MeowCSS](../meowcss/README.md)。
|
|
417
|
+
|
|
418
|
+
构建并安装本地包后,从仓库根运行 `bunx --no-install meowbook serve --config packages/meowtail/meowbook.config.ts`
|
|
419
|
+
打开组件场景,核对明暗、桌面与窄屏、输入草稿和状态切换。尺寸是 Web 适配,
|
|
420
|
+
当前视觉基准见上述 DeepSeek 迁移记录;设计判断与打磨方法见
|
|
421
|
+
meow-design(原产品仓库历史参考),其历史探索配方不作为标准主题规范。
|
|
422
|
+
|
|
423
|
+
### 生命周期扩展
|
|
424
|
+
|
|
425
|
+
静态视觉使用 CSS。只有需要真实 DOM、实例状态、监听或清理时才使用 shadow:
|
|
426
|
+
|
|
427
|
+
```ts
|
|
428
|
+
// Web shadow:context.element 是真实 Element。
|
|
429
|
+
import { defineShadow } from "meowjsx/web";
|
|
430
|
+
|
|
431
|
+
runtime.use({
|
|
432
|
+
shadows: [
|
|
433
|
+
defineShadow(Button, "root", (props, context) => {
|
|
434
|
+
const active = context.signal(false);
|
|
435
|
+
context.effect(() => {
|
|
436
|
+
context.element.classList.toggle("is-active", active.value);
|
|
437
|
+
});
|
|
438
|
+
const enter = () => {
|
|
439
|
+
active.value = true;
|
|
440
|
+
};
|
|
441
|
+
const leave = () => {
|
|
442
|
+
active.value = false;
|
|
443
|
+
};
|
|
444
|
+
context.element.addEventListener("pointerenter", enter);
|
|
445
|
+
context.element.addEventListener("pointerleave", leave);
|
|
446
|
+
context.onCleanup(() => {
|
|
447
|
+
context.element.removeEventListener("pointerenter", enter);
|
|
448
|
+
context.element.removeEventListener("pointerleave", leave);
|
|
449
|
+
});
|
|
450
|
+
}),
|
|
451
|
+
],
|
|
452
|
+
});
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
集中注册,不生成包装组件。shadow 与组件共享 signal/effect/onCleanup 生命周期 API。
|
|
456
|
+
插件卸载阻止后续应用;现有元素的实例清理由其 mount 的 unmount 负责。不要用
|
|
457
|
+
renderToHtml + innerHTML 代替需要生命周期的浏览器挂载。
|
|
458
|
+
|
|
459
|
+
### 文件与验证
|
|
460
|
+
|
|
461
|
+
- `meowcss`:通用 token/选项/CSS 生成;`meowcss/meowjsx` 负责 typed parts 与自动 carrier;`meowcss/web` 负责 DOM 主题生命周期,详见 [MeowCSS](../meowcss/README.md)。
|
|
462
|
+
- `src/theme/tokens.ts`、`palette.ts`:共享参数与语义色板。
|
|
463
|
+
- `src/theme/base.styles.ts` 与 `components/chat/icons/shared` 下的 `*.styles.ts`:按职责编写的 CSS 模板;
|
|
464
|
+
专属高亮 token 在 `shared/code-highlight.tokens.ts`。
|
|
465
|
+
- `src/theme/index.ts`:标准主题的显式组装与公共导出。
|
|
466
|
+
- `bun test packages/meowtail/tests/unit`:组件与标准主题合同;通用 token/选项合同在 MeowCSS 测试中验证。
|
|
467
|
+
- `tsc --noEmit --project packages/meowtail/tsconfig.json`:检查实现、展示场景、浏览器测试和
|
|
468
|
+
`tests/types/` 的公共类型合同;类型用例不由 Bun 执行。
|
|
469
|
+
- `tests/browser/theme/parameterized-theme.spec.ts`:参数化主题、局部覆盖及真实组件组合回归,针对
|
|
470
|
+
`tests/fixtures/theme-prototype-demo.tsx` 与 `tests/fixtures/real-controls-demo.tsx` 的独立测试场景,
|
|
471
|
+
由本包 Playwright 专用测试配置加载,不进入组件 gallery。
|
|
472
|
+
- Rossovia 的 Dashboard 组合验证仍由产品仓库维护,不是本库的可运行命令;库内不保留依赖产品 checkout 的测试。
|
|
473
|
+
|
|
474
|
+
浏览器验收覆盖对应场景,不能用类型或构建通过替代。组件注册必须作用于实际渲染的
|
|
475
|
+
runtime;需要生命周期的内容使用 render 挂载,而非 HTML 字符串插入。
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# DeepSeek Harness
|
|
2
|
+
|
|
3
|
+
The standard theme and UI designs are adapted from DeepSeek Harness
|
|
4
|
+
(reference revision `639ed01539`), including `packages/client/ui-theme`,
|
|
5
|
+
`ui-primitives`, and conversation components.
|
|
6
|
+
|
|
7
|
+
MIT License
|
|
8
|
+
|
|
9
|
+
Copyright (c) 2026 DeepSeek
|
|
10
|
+
|
|
11
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
13
|
+
in the Software without restriction, including without limitation the rights
|
|
14
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
16
|
+
furnished to do so, subject to the following conditions:
|
|
17
|
+
|
|
18
|
+
The above copyright notice and this permission notice shall be included in all
|
|
19
|
+
copies or substantial portions of the Software.
|
|
20
|
+
|
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
+
SOFTWARE.
|