meowtail 0.0.0-stage → 0.2.0-alpha.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/AGENT-COMPONENTS.md +117 -0
- package/ASSISTANT.md +72 -0
- package/JSON.md +55 -0
- package/LICENSE +21 -0
- package/README.md +575 -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 +244 -0
- package/dist/src/chat/assistant-content.d.ts +22 -0
- package/dist/src/chat/assistant-content.js +114 -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 +212 -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 +297 -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 +19 -0
- package/dist/src/chat/conversation.js +65 -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 +17 -0
- package/dist/src/chat/index.js +16 -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/task.d.ts +29 -0
- package/dist/src/chat/task.js +53 -0
- package/dist/src/chat/tool-call.d.ts +46 -0
- package/dist/src/chat/tool-call.js +84 -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 +30 -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 +89 -0
- package/dist/src/components/index.js +88 -0
- package/dist/src/components/inline.d.ts +14 -0
- package/dist/src/components/inline.js +24 -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 +17 -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 +22 -0
- package/dist/src/components/output-block.js +76 -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 +23 -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/status.d.ts +16 -0
- package/dist/src/components/status.js +8 -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 +255 -0
- package/dist/src/json/catalog.js +196 -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 +848 -0
- package/dist/src/registry/index.js +240 -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/execution-state.d.ts +7 -0
- package/dist/src/shared/execution-state.js +36 -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 +41 -0
- package/dist/src/theme/chat/assistant.styles.d.ts +2 -0
- package/dist/src/theme/chat/assistant.styles.js +301 -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 +520 -0
- package/dist/src/theme/chat/conversation.styles.d.ts +1 -0
- package/dist/src/theme/chat/conversation.styles.js +65 -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 +618 -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/chat/task.styles.d.ts +1 -0
- package/dist/src/theme/chat/task.styles.js +87 -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 +114 -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 +35 -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 +96 -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 +234 -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 +110 -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/status.styles.d.ts +1 -0
- package/dist/src/theme/components/status.styles.js +25 -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 +151 -0
- package/dist/src/theme/index.js +174 -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 +68 -4
package/README.md
CHANGED
|
@@ -1,3 +1,576 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Meowtail
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`meowtail` 提供跨应用组件、语义布局、标准主题和完整 Assistant 组合。网络、执行、权限与持久化由宿主适配,库不携带 Rossovia 的业务状态或后端。
|
|
4
|
+
|
|
5
|
+
## 演示包
|
|
6
|
+
|
|
7
|
+
演示播放器、Reveal、媒体生命周期、演示内容布局和主题已迁入独立 [MeowSlides](../meowslides/README.md)。Meowtail 不反向依赖演示包,旧 `meowtail/presentation` 与根演示导出已移除;通用 UI 和布局仍由本包提供。
|
|
8
|
+
|
|
9
|
+
本包的 npm 名称是 `meowtail`;既有 `createMeowUI`、`installMeowUI`、`createMeowUICatalog` 等 API 和运行时样式身份保持不变。使用新的包导入路径,不能据包名推导新的函数名、`data-*` 标记或 CSS 变量。
|
|
10
|
+
|
|
11
|
+
完整组合的使用合同见 [Assistant](ASSISTANT.md),有限 JSON 入口见 [JSON catalog](JSON.md)。两者的实现与独立验收仍在进行;本页的 API 说明和早期产物验证不等于当前全部源码的同源验收通过。
|
|
12
|
+
|
|
13
|
+
## 最小浏览器接入
|
|
14
|
+
|
|
15
|
+
在包含 `<main id="app"></main>` 的浏览器入口中,先完成同一 runtime 的组件注册、完整 CSS 加载和主题根绑定,再渲染内容。
|
|
16
|
+
仅导入组件、仅安装 registry 或只用 `Theme` 都不能代替这三项;缺少任意一项,页面仍可能显示原生控件,却没有标准主题的尺寸与状态。
|
|
17
|
+
|
|
18
|
+
```tsx
|
|
19
|
+
import { createRuntime, h } from "meowjsx";
|
|
20
|
+
import { createWebRenderer } from "meowjsx/web";
|
|
21
|
+
import { Button, Inline, Stack, createMeowUI } from "meowtail";
|
|
22
|
+
import { standardTheme, standardOptions } from "meowtail/theme";
|
|
23
|
+
import { applyTheme, mountStyles } from "meowcss/web";
|
|
24
|
+
|
|
25
|
+
const root = document.querySelector<HTMLElement>("#app");
|
|
26
|
+
if (!root) throw new Error("Missing app root");
|
|
27
|
+
const runtime = createRuntime();
|
|
28
|
+
const uninstall = runtime.use(createMeowUI());
|
|
29
|
+
const removeStyles = mountStyles(root.ownerDocument, standardTheme.cssText);
|
|
30
|
+
const removeTheme = applyTheme(root, standardTheme, standardOptions.select({ scheme: "light" }));
|
|
31
|
+
const mounted = createWebRenderer(runtime).render(
|
|
32
|
+
<Stack align="start">
|
|
33
|
+
<strong>连接设置</strong>
|
|
34
|
+
<Inline gap="compact">
|
|
35
|
+
<Button>保存</Button>
|
|
36
|
+
<Button variant="quiet">取消</Button>
|
|
37
|
+
</Inline>
|
|
38
|
+
</Stack>,
|
|
39
|
+
root,
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
// Dispose with the host that owns this mount.
|
|
43
|
+
const dispose = () => {
|
|
44
|
+
mounted.unmount();
|
|
45
|
+
removeTheme();
|
|
46
|
+
removeStyles();
|
|
47
|
+
uninstall();
|
|
48
|
+
};
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
主题根提供可继承的正文 font、字号、行高与文字颜色;局部主题配置继承外层排版,组件仍拥有自己的控件与标题尺度。
|
|
52
|
+
这不包含全局 `html/body` margin 重置、页面背景、页面留白,也不自动重置任意 `h1/h2/p`。
|
|
53
|
+
页面空间用 `PageFrame` / `Container`,相关内容用 `Stack`,一组操作用 `Inline`;完整 Assistant 可直接用 `AssistantView`,不必从裸 Card 重搭一页。
|
|
54
|
+
`CardHeader/Title/Content/Footer` 表达卡片内关系,原生内容则按文档语义排版;不要把每层内容都包成独立表面。
|
|
55
|
+
可比较 Meowbook 的 `buttons`、`card-composition`、`workspace-composition`;它们分别展示操作关系、卡片结构与滚动工作区,压力态不等于产品必须同时展示所有状态。
|
|
56
|
+
静态 CSS 交付与局部配置见[组件安装与样式交付](#组件安装与样式交付);`examples/browser` 的 Increment 仅是包接合 smoke,不是页面设计模板。
|
|
57
|
+
|
|
58
|
+
## 目录
|
|
59
|
+
|
|
60
|
+
```text
|
|
61
|
+
src/
|
|
62
|
+
components/ # Button、Card、Input、Dialog 等基础组件;一个组件一个文件
|
|
63
|
+
chat/ # ChatFrame、ChatMessage、ChatComposer 等对话组件
|
|
64
|
+
icons/ # 品牌标记和小图标;一个图标一个文件
|
|
65
|
+
registry/ # contract 聚合、meowjsx 类型声明和安装入口
|
|
66
|
+
shared/ # 组件内部共享的小工具
|
|
67
|
+
theme/ # 标准主题的 token 定义和按 part 组织的 TS 样式
|
|
68
|
+
tests/
|
|
69
|
+
unit/ # Bun,按 components/chat/icons/shared/theme 分组
|
|
70
|
+
types/ # 公共类型合同,使用 *.types.ts / *.types.tsx,由 tsc 验证
|
|
71
|
+
browser/ # Playwright,按 components/chat/theme/catalog 分组
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
产品事实、导航适配和应用专属样式留在宿主;通用活动面板、完整 Assistant 组合、共同页面壳和区域布局由本包提供,不要求消费者重新搭整页。
|
|
75
|
+
通用组件通过
|
|
76
|
+
className 保留宿主应用的视觉扩展点,标准主题由同一 package 的 `meowtail/theme`
|
|
77
|
+
根据 registry 的 component/part 身份提供默认样式。MeowUI 的 registry 是运行时 contract
|
|
78
|
+
和安装入口,不是 shadcn 式的源码分发目录。
|
|
79
|
+
|
|
80
|
+
## 当前组件
|
|
81
|
+
|
|
82
|
+
`PageFrame` 接收 header、toolbar 和 children,分配页头与 body 的可用高度,并提供共同页面外缘。
|
|
83
|
+
业务和 iframe 放入 body,不再各自按 viewport 减去页头高度。
|
|
84
|
+
默认 `variant="page"` 提供有限宽度与页面外缘;`variant="workspace"` 用于全宽工具栏和
|
|
85
|
+
连续阅读/输入工作区,外壳不重复添加页面 inset,内容组件继续拥有阅读宽度和安全底缘。
|
|
86
|
+
两种外壳都约束 body 高度;页头自然取高,动作可换行,就地展开内容可覆盖主体。
|
|
87
|
+
`scrollOwner="content"` 是默认值,body 将滚动交给既有内部容器;`scrollOwner="layout"`
|
|
88
|
+
让 body 自己承接自然文流与滚动。标题、关闭与其他 header 动作不放进 body 滚动区。
|
|
89
|
+
仅 `content` 模式向直属内容根分配伸缩空间;`layout` 模式保留控件自身的默认尺寸。
|
|
90
|
+
`RegionLayoutDescription` 用命名矩阵声明页面区域,浏览器宿主调用
|
|
91
|
+
`mountRegionLayout(host, layout, options)`,获得 `regions` 内容根、`showGroup`、`back` 和 `dispose`。
|
|
92
|
+
作者把内容放入这些根;矩形区域、有限尺寸、局部排列与滚动归属共享同一校验和 renderer。
|
|
93
|
+
`content` 行按自然内容领取空间,`fill` 行领取余量;空间不足时 content 区域按其滚动 owner
|
|
94
|
+
保持动作可达。组件应限制自身长内容,不能依靠外壳默认裁切来保住阅读空间。
|
|
95
|
+
多列在窄窗投影为一列;区域的 `compactRow="content" | "fill"` 可指定该投影中的自然高或
|
|
96
|
+
剩余高度,省略时沿原矩阵行推导。它不改变分组、桌面几何、内容挂载或滚动 owner。
|
|
97
|
+
跨模块合同和内置/扩展的共同使用见
|
|
98
|
+
统一 Extension 的区域布局(原产品仓库历史参考)。
|
|
99
|
+
原产品的接线和 UI 验收属于历史证据,不能代替本库迁移后的独立验证。
|
|
100
|
+
|
|
101
|
+
`CodeBlock` 接收原始 `code` 和可选 `language`,已知语法按需加载 Shiki 高亮,提供独立复制与自动换行开关。
|
|
102
|
+
换行只改变显示,复制保留原始空白;浏览器剪贴板失败时显示反馈。`onCopy` 可由宿主绑定其他
|
|
103
|
+
剪贴板实现,组件不执行代码。无语言时显示“代码”,`defaultWrap` 设置初始换行状态。
|
|
104
|
+
未知语言或高亮加载失败时保留纯文本显示。
|
|
105
|
+
|
|
106
|
+
`Checkbox`、`Switch` 和 `SegmentedControl` 提供原生表单选择;`Tabs` 负责保留挂载的面板切换。
|
|
107
|
+
`Menu`、`HoverCard`、`Toast`、`RiskConfirmation` 提供菜单、预览和反馈,业务操作与显示寿命由宿主负责。
|
|
108
|
+
Menu 的 Tab / Shift+Tab 关闭整个菜单链并沿原生顺序离开,不执行菜单项;Escape 逐层关闭并返回该层入口。
|
|
109
|
+
`TerminalBlock`、`ReadBlock`、`DiffBlock`、`SearchBlock`、`WebBlock` 与 `JsonBlock/JsonTree`
|
|
110
|
+
展示宿主提供的输出;组件不执行工具或读取文件。`ReadBlock` 可传 `lang`,首次进入视口时加载高亮,未知语言保留纯文本。
|
|
111
|
+
`ImagePreview` 统一图片加载、失败与预览框,`ImageLightbox` 提供单图查看,
|
|
112
|
+
`ShortcutKeys`、`PathLabel`、`StateDot` 和 `TextShimmer` 提供辅助呈现。
|
|
113
|
+
|
|
114
|
+
`Pill` 用于紧凑胶囊标签或操作,选中状态由宿主提供;静态标签沿用 `Badge`,支持 outline、solid 和 quiet 呈现。
|
|
115
|
+
|
|
116
|
+
界面改版(系统设计稿(原产品仓库历史参考))新增的通用组件:
|
|
117
|
+
`StatusDot` 以 processing(accent 脉冲)、success、returned(空心绿,执行返回不等于目标完成)、
|
|
118
|
+
warning、danger、unknown(空心灰,不假装知道)、idle 表达状态,点本身不带文字。
|
|
119
|
+
`Status` 接收 `state` 与必填 `label`,把装饰点与可见状态文字作为一个内容单元,标准主题统一点为 7px,
|
|
120
|
+
不提供 `size` 或 `halo`。`label` 保留 `Child` 的组合能力并排除直接空值与布尔值;调用方须保证
|
|
121
|
+
字符串、数组及动态内容实际非空且可见,并使用适合行内呈现的内容。`ListRow.status` 与
|
|
122
|
+
`ResourceCard.status` 仍接收 `Child`,可传入 `Status`;`WorkCard`、`Timeline` 等组件继续拥有内部标记,
|
|
123
|
+
不机械替换命令式改写、信号独立点或无逐点文字的装饰点阵。状态文字的非空语义仍由调用方审查。
|
|
124
|
+
`Tag` 是挨着内容的静态事实
|
|
125
|
+
(中性、强调、橙色计数、等宽路径),可选择与筛选仍用 `Pill`;`ProcessGroup` 与 `ProcessStep` 是折叠的步骤记录;
|
|
126
|
+
`WorkCard` 是对话里指向一件工作的单个控件;`IconRail`、`RailItem` 与 `RailSection` 是 56px 图标栏,悬停或键盘
|
|
127
|
+
聚焦时展开为覆盖在内容上的 256px 抽屉,分组收起时折成一个图标并显示子项的当前位置与橙点。
|
|
128
|
+
`Button` 的 `outline` 是次要层级,另有 `accent`(关于当前活动的软底)与 `stop`(打断运行中的工作)。
|
|
129
|
+
第二阶段补齐的详情与页面结构:`DetailSection`(带发丝线的分块,标题是小标签而非页面标题)、`Timeline` 与
|
|
130
|
+
`TimelineItem`(一条线串起的事件,标记点沿用 `StatusDot` 语义)、`ResourceLink`(指向一个可打开对象的整行引用,
|
|
131
|
+
有 href 时是链接,否则是按钮);`PageHeader`(页名、一句用途与页面级操作)、`ListGroup` 与 `ListRow`(并列条目共用一圈
|
|
132
|
+
轮廓,可在行下展开编辑区,单独使用并设 `tone="accent"` 是摘要行)、`ResourceCard`(概览页里的一项能力,停用态用虚线
|
|
133
|
+
低对比);`Drawer` 是窄屏从起始边滑入的原生模态面板,遮罩点击与 Escape 都交给宿主更新 `open`。`SegmentedControl` 的
|
|
134
|
+
轨道与选中态按设计稿收紧。窄屏的 `ChatComposer` 堆叠布局把「添加、输入、发送」放在一行,模型选择留在下方。
|
|
135
|
+
色板与层级只在 `theme/palette.ts`:`accentTokens`、`statusTokens`、`radiusTokens`(8/10/14/22)、`lineTokens`
|
|
136
|
+
(0.5px 发丝线)、`layerTokens`;accent 只表达「正在发生」与「当前所在」,primary 仍为黑白。
|
|
137
|
+
|
|
138
|
+
`ChatToolCall` 用 `label` 表示动作,`summary` 表示折叠时仍可见的简短目标;输入/输出是可响应更新的惰性文本,
|
|
139
|
+
超长结果沿共享 `OutputBlock` 折叠并完整复制。queued/running/waiting/success/error/cancelled/unknown
|
|
140
|
+
分别表示宿主事实,complete 保留兼容。onRetry/onCancel 只通知宿主,组件不执行工具或自动更新业务状态。
|
|
141
|
+
`ChatTask` 提供标题、状态、公开执行摘要、独立的 executionText/replyText、可选原生进度与 children/footer;
|
|
142
|
+
执行成功但公开答复未收到仍可准确呈现。默认 unknown;未知进度省略,不伪造百分比。
|
|
143
|
+
`ChatProcess` 用原生 details 聚合记录,任务与工具继续复用 Stack/Inline/Grid、来源、附件、产物和代码组件。
|
|
144
|
+
完整生命周期的已有/补齐/宿主边界与连贯组合规则见 [Agent 组件说明](AGENT-COMPONENTS.md),
|
|
145
|
+
真实默认组合见 Meowbook 的 agent-workflow、agent-workflow-narrow 与 agent-workflow-assistant。
|
|
146
|
+
已有 AssistantView JSON catalog 同步增加有限 tool/task parts 与 onToolAction,复用同一组件;
|
|
147
|
+
不新增独立 ChatTask/ChatToolCall JSON entry、递归任务树或任意对象解释,支持集见 [JSON 合同](JSON.md)。
|
|
148
|
+
|
|
149
|
+
`ChatMessageList` 的行距由列声明、由行读取:列在每个非首行上给出 `--chat-row-pitch`,行按它设置
|
|
150
|
+
上边距,首行的上边距来自列表自身的内距。宿主逐条挂载消息时可以在列与行之间插入无布局容器
|
|
151
|
+
(`display: contents`),行距与直接子项一致。工具调用、过程分组与来源共用同一组行度量
|
|
152
|
+
(leading 盒、间隙与行盒),并随 `--chat-font-body` 相对 14px 的增量一起缩放:改变对话字号时
|
|
153
|
+
字形盒、字形、行盒与展开体缩进一起移动。行所拥有的内容(展开体、分组内的行)挂在行标签的
|
|
154
|
+
轴线上,与标签本身区分层级;与行并列的条目留在同一轴线上。
|
|
155
|
+
|
|
156
|
+
连续回复传入同一头像与 `continuation`,主题保留头像列并隐藏重复头像,正文轴线不依赖相邻 DOM 结构;未传头像的组继续使用无头像布局。
|
|
157
|
+
|
|
158
|
+
默认尺度与组件开发顺序见 [组件开发约定](AGENTS.md)。新组件先在 Meowbook 与现有控件同屏校准,
|
|
159
|
+
再接入应用;主题的字号、控件高度和三层间距是一套关系,不分别为每个组件选择一组新尺寸。
|
|
160
|
+
默认按钮高 36px,紧凑按钮高 28px,输入控件高 32px。信息块内部紧凑;页面边缘、独立区块与阅读区域应有充分留白。
|
|
161
|
+
局部间距 token 不是页面留白的上限,不将所有层级统一压紧。
|
|
162
|
+
|
|
163
|
+
界面正文使用 `uiTokens.fontBody`,辅助说明使用 `uiTokens.fontCaption`,长文与对话正文使用
|
|
164
|
+
`uiTokens.fontReading`,局部标题使用 `uiTokens.fontTitle`,完整页面标题使用
|
|
165
|
+
`uiTokens.fontPageTitle`,不把页面标题尺度用于字段标签。普通控件的水平内距由
|
|
166
|
+
`uiTokens.controlPaddingInline` 决定;group、section、panel 分别表达组内、区域之间和容器边缘的留白。
|
|
167
|
+
阅读段落的相对缩进、媒体尺寸、图谱坐标与触摸目标仍按真实用途设置,不套用控件尺度。
|
|
168
|
+
|
|
169
|
+
`PageFrame` 的页面边缘使用 `pageInsetBlock` / `pageInsetInline`,窄窗使用对应的
|
|
170
|
+
`pageInsetCompactBlock` / `pageInsetCompactInline`;页面留白不压成局部 panel 内距。
|
|
171
|
+
`ResourceCard` 使用统一的局部标题、正文、辅助文字与 card 圆角;紧凑概览对象的内距和
|
|
172
|
+
纵向节奏只在组件主题 token 中定义,不增加任意像素或 density 参数。需要核对的 identity
|
|
173
|
+
使用辅助文字色与等宽字体,停用状态不抹去名称与操作原因。
|
|
174
|
+
Meowbook 的 `page-structure-long-content` 补充长名称、准确标识、邻接状态与禁用动作的组合;
|
|
175
|
+
`EmptyState` 透传调用方的原生属性,状态紧急度与加载事实仍由宿主提供。
|
|
176
|
+
|
|
177
|
+
从仓库根运行 `bun test packages/meowtail/tests/unit` 执行 `tests/unit` 的 Bun 测试;类型检查与 `tests/browser` 的组件行为回归分别执行。文件归属与命名遵循测试文件组织规范(原产品仓库历史参考)。
|
|
178
|
+
浏览器测试只启动本包的 Meowbook 场景,不需要 Dashboard。组件交互、布局、对话组件和主题
|
|
179
|
+
回归统一位于 `tests/browser`;其中 catalog 验证本包展示配置作为 Meowbook 消费者的实际接合。
|
|
180
|
+
Meowbook 自身的工具与独立夹具测试仍由 `test:meowbook` 负责。
|
|
181
|
+
完整 UI 回归还需运行 Meowbook 测试及本包 `playwright.config.ts` 的浏览器场景。
|
|
182
|
+
|
|
183
|
+
`ChoiceGroup` 直接展示少量单选项,复用原生 radio 的键盘、表单和必填校验。
|
|
184
|
+
支持选项说明、禁用、受控值及表单重置;不负责提交。
|
|
185
|
+
`ChatQuestion` 提供问题、补充说明、回答内容、反馈和操作的布局;回答方式、异步提交和取消的业务含义
|
|
186
|
+
由宿主负责。标准主题遵循紧凑工作尺度,相关操作集中排列,不默认拉到容器两端。
|
|
187
|
+
|
|
188
|
+
### 布局与内容组合
|
|
189
|
+
|
|
190
|
+
`Stack` 纵向排列,`Inline` 横向排列且默认允许换行。共同提供 `gap`(none/compact/normal/relaxed)、
|
|
191
|
+
`align` 和 `justify`;`Inline wrap={false}` 可明确保持单行。组件保留方向与排列结构,theme 决定语义间距。
|
|
192
|
+
`Grid` 默认按容器宽度自动排列,`minColumnWidth` 为 compact/normal/wide;也可指定 `columns={1|2|3|4}`。
|
|
193
|
+
固定列数不会偷偷变成响应式列数。`Container width` 为 narrow/content/wide/page/full,主题控制内容最大宽度。
|
|
194
|
+
Stack 默认 stretch 便于表单与内容区域填满宽度;混合标签和按钮时用 `align="start"` 保留自然尺寸,
|
|
195
|
+
或把行动放入 Inline。字段、动作与长文字按内容关系明确选择 stretch、start 或 baseline 对齐。
|
|
196
|
+
|
|
197
|
+
局部布局可以自由嵌套这些 JSX 组件:先选择横向、纵向或并列关系,再在需要分配余量时使用
|
|
198
|
+
`LayoutItem`,内容和原生语义仍由真实组件承载。页壳与命名区域矩阵分配页面空间,
|
|
199
|
+
不限制区域内部的组件组合;没有新增可序列化的递归布局模板或另一套布局引擎。
|
|
200
|
+
|
|
201
|
+
沿用这套布局原语,不在应用中重复实现方向、对齐和间距。Stack/Inline/Grid 的 `rowGap`、
|
|
202
|
+
`columnGap` 默认 auto(沿用 gap),可单独使用同一套语义间距。布局可用 `as="header"` 或
|
|
203
|
+
`as="footer"` 保留区域语义;组件不会代替宿主选择业务断点、文字截断或换行策略。
|
|
204
|
+
|
|
205
|
+
`Toolbar` 默认横向并允许换行;`orientation="vertical"` 沿纵向排列。它为自身按钮、原生输入型按钮和有 href 的链接动作集合提供一个 Tab 停靠,方向键、Home / End 在当前集合内移动,横向尊重 RTL。原生 Input、Textarea、Select 和自管键盘的组合控件保留独立 Tab 与编辑键;嵌套 Toolbar 不重复消费。隐藏、disabled、inert 或作者显式 `tabIndex=-1` 的入口不入动作集合,动态成员变化不主动夺焦点。Enter / Space 仍沿控件原生激活,不自动将复杂输入折进 overflow 菜单;卸载恢复本组件管理过的 tabindex,保调用方后续有效属性。
|
|
206
|
+
|
|
207
|
+
`LayoutItem` 控制直接子项的空间分配:`grow` 默认 false,`shrink` 默认 true,
|
|
208
|
+
`basis` 默认 auto,`alignSelf` 默认 auto。它与 Stack/Inline/Grid 的根保留 min-width:0、min-height:0,
|
|
209
|
+
让嵌套子项能够接受父容器分配的有限空间;长标识符
|
|
210
|
+
是否断行、正文是否截断由内容决定。只在需要控制子项空间时使用,不要求每个元素包一层。
|
|
211
|
+
|
|
212
|
+
纵向工作区先由宿主或 PageFrame 提供有限高度,再用 `LayoutItem grow` 分配正文余量。
|
|
213
|
+
实际滚动内容明确使用 `overflow: auto`;布局组件不会默认裁切内容,也不会自动选择滚动 owner。
|
|
214
|
+
中间继续用 Stack 等布局组件时沿用可收缩的根;插入原生 div 等宿主包装时,仍须自行处理其
|
|
215
|
+
高度和最小尺寸。无高度限制的 Stack 保持自然文流,`shrink={false}` 的动作仍保留自然尺寸。
|
|
216
|
+
|
|
217
|
+
```tsx
|
|
218
|
+
// 标签与值属于一组,混合字号沿文字基线对齐。
|
|
219
|
+
<Inline gap="compact" align="baseline">
|
|
220
|
+
<small>默认连接</small>
|
|
221
|
+
<strong>Codex</strong>
|
|
222
|
+
<small>gpt-6-luna</small>
|
|
223
|
+
</Inline>
|
|
224
|
+
|
|
225
|
+
// 正文使用剩余宽度,动作保留自然尺寸。
|
|
226
|
+
<Inline wrap={false}>
|
|
227
|
+
<LayoutItem grow><Stack gap="compact">{title}{description}</Stack></LayoutItem>
|
|
228
|
+
<LayoutItem shrink={false}><Button>编辑连接</Button></LayoutItem>
|
|
229
|
+
</Inline>
|
|
230
|
+
|
|
231
|
+
// 操作靠近排列,换行后留出更清楚的行距。
|
|
232
|
+
<Inline as="footer" gap="compact" rowGap="normal">{actions}</Inline>
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
Meowbook 的“布局组合 · 文本基线与固定动作”同时覆盖这些组合与长模型标识符。
|
|
236
|
+
|
|
237
|
+
`DescriptionList` / `DescriptionItem term={...}` 用原生 `dl` / `dt` / `dd` 组织相关的标签与值。
|
|
238
|
+
同组标签自然取宽并有上限,值共享列起点;局部容器宽度不足时,每项按标签、值上下排列,
|
|
239
|
+
不按整个窗口宽度判断。默认保留语义字号与可换行长文本,不提供表面、内距或独立滚动。
|
|
240
|
+
需要父容器分配可用宽度,不承诺按内容收紧宽度的布局;当前 Web 主题使用 CSS subgrid 与容器查询。
|
|
241
|
+
标签和任意值都可传 `Child`,值内继续组合已有布局与控件,不提供元数据 schema 或额外动作插槽。
|
|
242
|
+
代码字体、截断和固定尺寸子内容由消费者决定;普通文字与长标识默认可断行。
|
|
243
|
+
公开 parts 为 `description-list/root`、`description-item/root/term/value`,原生属性透传到各组件 root。
|
|
244
|
+
|
|
245
|
+
```tsx
|
|
246
|
+
<DescriptionList>
|
|
247
|
+
<DescriptionItem term="工作目录">
|
|
248
|
+
<Inline wrap={false} gap="compact" align="start">
|
|
249
|
+
<LayoutItem grow>
|
|
250
|
+
<code>{workspacePath}</code>
|
|
251
|
+
</LayoutItem>
|
|
252
|
+
<LayoutItem shrink={false}>
|
|
253
|
+
<Button size="small">复制目录</Button>
|
|
254
|
+
</LayoutItem>
|
|
255
|
+
</Inline>
|
|
256
|
+
</DescriptionItem>
|
|
257
|
+
<DescriptionItem term="访问方式">只读</DescriptionItem>
|
|
258
|
+
</DescriptionList>
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
Meowbook 的 `description-list-composition` 在同一视口展示宽、窄局部容器、长标签与标识、
|
|
262
|
+
值内动作和输入,用于核对共享列、自然重排、原生语义与草稿连续性;它不代表业务页面已验收。
|
|
263
|
+
|
|
264
|
+
`Card` 支持 CardHeader、CardTitle、CardDescription、CardAction、CardContent、CardFooter。
|
|
265
|
+
默认 `variant="auto"` 通过渲染树 Context 取得深度:标准主题将顶层呈现为独立表面、后代融入父级;显式 variant 优先。
|
|
266
|
+
深度跟随逻辑组件树,浮层不会因为视觉上离开父卡片而自动变成新根;需要独立表面的弹层内容显式使用 surface。
|
|
267
|
+
Title 可以指定 h2–h6,标题等级仍由文档结构决定,不根据卡片嵌套自动猜测。
|
|
268
|
+
内部普通分组使用共享表面,独立事项可以明确使用 `variant="surface"`;`variant="embedded"` 明确融入父表面。
|
|
269
|
+
嵌套关系不等于必须重复外框和阴影。复杂内容仍使用 Stack/Inline/Grid 排版,不把 Card 变成万能布局组件。
|
|
270
|
+
|
|
271
|
+
`FieldGroup` 使用原生 fieldset/legend 组织字段,支持整组 disabled;Field 继续负责单个字段关联。
|
|
272
|
+
`AspectRatio ratio={16/9}` 控制布局比例,媒体的 object-fit 与裁切由调用方选择。
|
|
273
|
+
`Separator` 保留横向/纵向分隔语义。
|
|
274
|
+
|
|
275
|
+
`Tabs` 使用必需的 id、label 与 items(value/label/content/disabled)创建关联的 tab/tabpanel;
|
|
276
|
+
支持方向键、Home/End、受控 value Signal 与 defaultValue。切换时面板保持挂载,草稿不丢失。
|
|
277
|
+
`Breadcrumb items` 为 label/href 数组,最后一项标记当前位置。
|
|
278
|
+
`Tooltip` 使用 `trigger(bindings)` 为有名称的可聚焦控件补充文字说明,鼠标延迟出现、键盘聚焦立即出现,
|
|
279
|
+
Escape 关闭;不要把必要信息或可交互内容只放进 Tooltip,后者使用 Popover。
|
|
280
|
+
`Alert tone` 表达视觉状态,`role` 明确选择 status/alert,紧急度不由颜色推断。
|
|
281
|
+
`Skeleton` 是 aria-hidden 的占位;调用方提供内容区域的 aria-busy 和加载文案。
|
|
282
|
+
`SkeletonBoundary active={loading} label="正在更新资料"` 对已挂载的内容应用骨架呈现,
|
|
283
|
+
`active` 接收 boolean 或 Signal;切换不会卸载 children,保留输入草稿与组件状态。
|
|
284
|
+
加载时区域标记 aria-busy、内容 inert,屏幕阅读器从区域外的 status 获取调用方提供的加载文案。
|
|
285
|
+
开始加载时释放内容内的焦点;完成后不自动抢回焦点。调用方应把取消、重试等可用操作放在边界外。
|
|
286
|
+
底层使用 MeowJSX Web 的共享骨架控制器,对文字、图片、图标及输入统一去细节;这只是加载呈现,
|
|
287
|
+
不负责发起请求、计时或判断完成。首次加载尚无内容几何时,仍由调用方使用 `Skeleton` 提供占位结构。
|
|
288
|
+
宿主显式给 Web renderer 接入 `observation` hub 时,边界从渲染树 Context 取得来源并订阅自己的
|
|
289
|
+
组件子树;嵌套边界按 contract 与节点归属定位,不依赖函数名。普通未观察的 renderer 仍用局部 DOM
|
|
290
|
+
方式呈现,不强制开启组件索引。两种方式都保留外部 DOM 与主题变化的补充监听。
|
|
291
|
+
`Spinner label` 提供可读加载状态,不宣称真实进度。
|
|
292
|
+
|
|
293
|
+
原生选择控件 `Select` 复用浏览器的选项、键盘与表单语义,提供 `root` part;视觉由 theme 决定。它同时用于 Meowbook 工具外观与场景主题选择。控件保留原生 `size`(行数)语义,不把它复用成视觉尺寸。
|
|
294
|
+
|
|
295
|
+
`Popover` 是非模态的通用弹层,不默认设置菜单角色或锁住焦点。必需 `id` 和
|
|
296
|
+
`trigger(bindings)`;触发按钮展开 bindings,内容放 children。支持 `open` Signal / `defaultOpen`、
|
|
297
|
+
`onOpenChange`、`align`、`matchTriggerWidth`、`role` 和 `labelledBy`。`triggerId` 可与外部 Field 关联。
|
|
298
|
+
使用浏览器 Popover API 的顶层承载,依赖支持该 API 的浏览器;定位采用 `@floating-ui/dom`
|
|
299
|
+
的 offset/flip/shift/size 与打开期间的 autoUpdate,关闭或卸载时清理。外部点击关闭最上层,
|
|
300
|
+
Escape 返回当前层入口;焦点移到外部时不抢回焦点。内容按普通 Tab 顺序访问,菜单键盘规则由消费者提供。
|
|
301
|
+
局部 DOM 控件先处理 Escape;子 `preventDefault()` 表示消费,未消费时只由原 topmost 调用一次既有 `onKeyDown` 并尝试关闭,回调后重核原层,不能同一键再关 parent。单独 `stopPropagation()` 阻断自定义派发,不承诺阻止原生 Dialog 默认取消。正常回焦仍要求成功关闭且 trigger 可用,controlled 拒绝关闭、外部主动转焦和卸载不被强行覆盖;不吞调用方异常。
|
|
302
|
+
定位与限高完成后,仅最上层弹层把内部当前聚焦项滚入可见区域,不移动焦点或滚动外层。
|
|
303
|
+
parts 为 `root/panel`,表面、间距与动效归 theme。
|
|
304
|
+
|
|
305
|
+
`ChoiceSelect` 在 Popover 上实现自定义单选,原生 `Select` 继续用于系统选择器与多选。
|
|
306
|
+
`options` 为 `{ value, label, disabled?, group? }[]`,支持 `defaultValue` 或受控 `value` Signal,
|
|
307
|
+
用 `onValueChange` 接收选择。方向键、Home/End、字符定位、Enter/Space、Escape 和 Tab 可用。
|
|
308
|
+
`id` 用于 Field 关联;`name/required/disabled/form` 接到原生表单控件,必填失败阻止提交并聚焦
|
|
309
|
+
触发按钮。错误消息使用浏览器的原生校验文案。重置恢复非受控默认值,受控值仍归调用方。
|
|
310
|
+
主题视觉隐藏原生表单载体;不以 hidden input 冒充 required 校验。不提供自定义多选或异步搜索。
|
|
311
|
+
parts 为 `root/trigger/value/indicator/list/group/option/native/validation`。
|
|
312
|
+
|
|
313
|
+
- 基础:Button、AddButton、IconButton、Card、Badge、Input、Textarea、Select、Field、
|
|
314
|
+
SearchInput、Disclosure、Separator、NavItem、EmptyState。
|
|
315
|
+
- 对话框:Dialog、DialogPanel、DialogHeader、DialogActions。
|
|
316
|
+
- Chat:ChatFrame、ChatHeader、ChatStatus、ChatConversation、ChatMessageList、ChatMessage、ChatBubble、
|
|
317
|
+
ChatMessageActions、ChatComposer、ChatToolCall、ChatAttachments、ChatProcess、ChatSources。
|
|
318
|
+
- 图标:统一 Lucide 子集 `Icon` 与 `iconNames`,以及 MeowlandMark、DoodleCat、NotesIcon、TasksIcon、SearchIcon、PlusIcon、
|
|
319
|
+
GithubIcon、ExternalArrowIcon。
|
|
320
|
+
|
|
321
|
+
新增组件前先确认它能在两个以上的应用或场景中复用;应用只使用一次的页面组件不要
|
|
322
|
+
为了“提取”而迁入这里。
|
|
323
|
+
|
|
324
|
+
`Field` 在只有一个控制子节点且能从 `htmlFor`、`descriptionId` 或 `errorId` 解析关联
|
|
325
|
+
时,会把描述和错误节点的 id 连接到控制节点的 `aria-describedby`,并在有错误时设置
|
|
326
|
+
`aria-invalid`。多个控制节点或自定义组合仍由调用方显式传递关联属性。
|
|
327
|
+
|
|
328
|
+
`Dialog` 只负责原生 `<dialog>` 的结构、标签关联和 panel/header/actions 分区;打开、关闭、
|
|
329
|
+
Escape、焦点返回和提交结果仍由应用控制。它没有仿 Radix 的 context、portal 或 focus trap,
|
|
330
|
+
不要把这些行为默认为组件已经提供。
|
|
331
|
+
`DialogPanel header={...}` 与 `Drawer header={...}` 显式组合共享 `PageFrame`,标题和关闭
|
|
332
|
+
同处固定 header,body 是唯一的主滚动区。`DialogPanel as="form"` 保留原生表单归属与提交,
|
|
333
|
+
短内容自然取高,长内容继承宿主 dialog 的最大高度;不扫描 children 猜标题,也不重复计算页头高度。
|
|
334
|
+
消费者将 `DialogHeader` 放进 header 属性,正文与原有末尾动作放进 children;原生窗口、
|
|
335
|
+
取消、草稿及打开方式仍归宿主。正文滚动引用沿公开 `page-frame/body` part 获取。
|
|
336
|
+
DialogPanel 在直属 header 与 body 内分配标准留白,保证正文首末控件的焦点轮廓位于其滚动视口内;任意 Child header 使用同一 `spaceSection` 分隔,无 header 时 body 四边取 panel 留白。既有 DialogHeader 组合保持原内容几何,不承诺任意自定义 header 总高不变;没有新增 gap 属性。固定标题、退出与唯一 body 滚动仍分开,任何极小高度都足够阅读不是承诺。原生 Dialog 的打开、取消与 caller 焦点前提不变,主题留白修复不表示所有指针/系统焦点路径均已验证。
|
|
337
|
+
|
|
338
|
+
`EmptyState size="compact"` 用于局部空列表或未选内容区域,沿用标题、说明和动作,去掉装饰插图。
|
|
339
|
+
默认 `size="default"` 保留整页空态;加载与失败仍使用各自已有反馈,不改成空态。
|
|
340
|
+
|
|
341
|
+
`ChatAttachments` 接收 `items: readonly ChatAttachmentItem[]`,每项包含
|
|
342
|
+
`id`、`name`、`url`、`mediaType` 和可选的 `sizeBytes`;`label` 默认是“消息附件”。
|
|
343
|
+
调用方提供 URL,组件不获取数据。图片默认以可访问的新窗口链接和懒加载预览展示,提供 `onPreview` 时改为预览按钮;
|
|
344
|
+
文件链接使用原文件名下载,提供有效大小时显示 B / KB / MB。
|
|
345
|
+
主题通过 `partSelector(chatAttachmentsContract, part)` 使用 `chat-attachments` 的
|
|
346
|
+
`root/entry/image/preview/file/icon/details/name/size/previewButton/remove` parts。
|
|
347
|
+
每项可提供 `onRemove`,只有草稿需要移除操作时才传入;上传、删除文件和 URL 生命周期仍归宿主。
|
|
348
|
+
|
|
349
|
+
`ChatFrame` 只为直属 `ChatComposer` 提供阅读边距;若 footer、Card 或其他包装容器负责该区域的空间,
|
|
350
|
+
其内部 Composer 使用容器内的自然宽度,不再受到祖先 Frame 的额外收窄与外边距影响。
|
|
351
|
+
|
|
352
|
+
`ChatComposer` 的 `hintId` 会把提示节点和输入框通过 `aria-describedby` 关联;`onInput`
|
|
353
|
+
绑定在 textarea 上,`onSubmit` 绑定在外层 form 上。`value` 支持 Signal,`submitDisabled`
|
|
354
|
+
仅禁止提交,适合等待结果时继续编辑;`disabled` 同时禁止编辑与提交。请求状态、已提交快照和
|
|
355
|
+
最新草稿由调用方管理。`attachments` 放待发送材料,`inputLabel` 提供输入名称。
|
|
356
|
+
标准主题把附件、输入、辅助操作和提交组织在同一书写面中。
|
|
357
|
+
`layout="inline"` 让短草稿与操作同排,长草稿保持增高;聚焦时显示提示,默认 `stacked` 保留独立工具行。
|
|
358
|
+
`layout="hero"` 使用桌面母版空白对话的输入高度。`trailing` 在发送按钮左侧组合 provider、模型等选择入口;
|
|
359
|
+
可传入受控 `ChoiceSelect`,用 `placement="top"`、`align="end"`、`matchTriggerWidth={false}`
|
|
360
|
+
向上展开分组选项。选项来源、当前值与运行配置的实际切换仍由宿主负责。
|
|
361
|
+
|
|
362
|
+
`ChatMessage` 管身份、排列与状态,默认在内容中包装 `ChatBubble`,保留原调用方式。
|
|
363
|
+
需要将附件、过程和文字分别展示时,设置 `surface="none"`,自行组合 `ChatBubble` 与其他组件。
|
|
364
|
+
Bubble 的 `auto` 通过 Context 读取消息角色,主题决定底色;也可显式选择 `plain` / `filled`。
|
|
365
|
+
`header` / `footer` 是补充材料和送达反馈的插槽,业务状态仍由宿主提供。
|
|
366
|
+
|
|
367
|
+
`ChatConversation` 是可选的滚动容器,宿主必须提供受约束的高度。
|
|
368
|
+
它在靠近底部时跟随追加内容,上翻时保留位置,并提供返回最新的按钮。
|
|
369
|
+
返回动作在消息视口之后参与正常布局,显示时领取自身高度,隐藏后把空间归还消息;不会浮在历史正文之上。
|
|
370
|
+
它不实现历史前插、逐消息锚点或持久化阅读恢复。不要与应用已有滚动控制器叠加;
|
|
371
|
+
Dashboard 继续使用自身控制器。`ChatMessageList` 仍只提供消息记录语义。
|
|
372
|
+
|
|
373
|
+
已有滚动 owner 的宿主可以单用 `ChatConversationLatest`。它是正常流按钮,不安装控制器、不设置定位容器,也不会独自给任意宿主视口分配高度。
|
|
374
|
+
例如下面的 `transcript`、`latestHidden` 与三个回调都来自宿主现有控制器:
|
|
375
|
+
|
|
376
|
+
```tsx
|
|
377
|
+
import { h } from "meowjsx";
|
|
378
|
+
import { Stack, LayoutItem } from "meowtail";
|
|
379
|
+
import { ChatMessageList, ChatConversationLatest } from "meowtail/chat";
|
|
380
|
+
|
|
381
|
+
<Stack gap="none" style={{ height: "100%" }}>
|
|
382
|
+
<LayoutItem
|
|
383
|
+
grow
|
|
384
|
+
basis={0}
|
|
385
|
+
role="region"
|
|
386
|
+
aria-label="消息阅读区"
|
|
387
|
+
tabIndex={0}
|
|
388
|
+
style={{ overflowY: "auto", overflowAnchor: "none" }}
|
|
389
|
+
ref={connectTranscriptViewport}
|
|
390
|
+
onScroll={readTranscriptPosition}
|
|
391
|
+
>
|
|
392
|
+
<ChatMessageList>{transcript}</ChatMessageList>
|
|
393
|
+
</LayoutItem>
|
|
394
|
+
<ChatConversationLatest hidden={latestHidden} onClick={returnToLatest} />
|
|
395
|
+
</Stack>;
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
父容器必须提供有限高度;上例的 LayoutItem 是唯一滚动视口,按钮是它的兄弟项。
|
|
399
|
+
宿主负责读取位置、显隐、追加跟随与保位;`returnToLatest` 应滚到末端,并以 `preventScroll` 将焦点交回该视口再隐藏动作。
|
|
400
|
+
不要把片段改成绝对定位后期待它自动避让正文,也不要靠消息末端 padding 或设备偏移量保护历史中段。
|
|
401
|
+
|
|
402
|
+
`SearchInput` 提供搜索图标与原生 search input 的共同外壳,`label` 是必需的可访问名称。
|
|
403
|
+
`className` 作用于外壳,`inputClassName` 作用于输入;`id/name/value/disabled/readOnly/aria-*`
|
|
404
|
+
及事件都传给 input,保留 Field 的说明和错误关联。筛选、提交与结果状态仍由消费者负责。
|
|
405
|
+
parts 为 `root/icon/control`,默认表面、焦点和错误边界由 theme 决定。
|
|
406
|
+
|
|
407
|
+
`PathPicker` 组合受控路径输入与可选的浏览按钮。调用方提供 `value/onValueChange`、
|
|
408
|
+
可访问名称 `label`,以及返回路径或 `null`(取消)的异步 `onChoose`;`kind="file" | "directory"`
|
|
409
|
+
只确定按钮文字,实际选择能力由宿主注入。不提供 `onChoose` 时仍可手动输入。
|
|
410
|
+
组件负责等待、失败反馈与卸载后忽略结果;在途时暂时锁定输入,父值或禁用/只读状态变化后不写回旧选择。
|
|
411
|
+
选择只填写路径,不读取文件、上传文件或授予访问权限。说明、校验与保存仍归调用方。
|
|
412
|
+
|
|
413
|
+
`Disclosure` 使用原生 details/summary,接收 `summary: Child` 与内容 children,支持
|
|
414
|
+
`open/name/onToggle` 等原生属性。`summaryClassName`、`contentClassName` 用于宿主布局;
|
|
415
|
+
parts 为 `root/summary/icon/content`。它不维护另一份展开状态,也不是多项 Accordion。
|
|
416
|
+
|
|
417
|
+
## 标准主题(meowtail/theme)
|
|
418
|
+
|
|
419
|
+
标准主题导出 `standardTheme`、`standardOptions` 和类型化的 `uiTokens`。只读 `standardThemeTokens`、`standardThemeStyles` 是主题组装原件,供 MeowSlides 等扩展主题复用同一 token/fragment 对象;它们不安装组件或操作 DOM。token 与样式
|
|
420
|
+
都由 TypeScript 定义;组件通过稳定的 part 标记与样式选项匹配 CSS,不再由主题插件
|
|
421
|
+
生成视觉类名。完整设计见 TypeScript token 与参数化配置(原产品仓库历史参考)。
|
|
422
|
+
|
|
423
|
+
样式文件统一采用 `<职责>.styles.ts`,标准主题按组件与对话职责分组,应用样式随应用模块维护。
|
|
424
|
+
命名、组件族边界与层叠整理见样式文件组织(原产品仓库历史参考)。
|
|
425
|
+
现有样式已按此规范迁移,历史对话覆写已并回消息与输入框负责文件。
|
|
426
|
+
|
|
427
|
+
### 组件安装与样式交付
|
|
428
|
+
|
|
429
|
+
组件安装和样式加载是两个明确的步骤。`createMeowUI()` 注册组件及样式属性适配器;
|
|
430
|
+
`standardTheme.cssText` 提供包含变量声明和组件规则的完整 CSS。动态宿主可以这样组装:
|
|
431
|
+
|
|
432
|
+
```tsx
|
|
433
|
+
import { createRuntime, h } from "meowjsx";
|
|
434
|
+
import { createWebRenderer } from "meowjsx/web";
|
|
435
|
+
import { Button, createMeowUI } from "meowtail";
|
|
436
|
+
import { standardTheme, standardOptions } from "meowtail/theme";
|
|
437
|
+
import { applyTheme, mountStyles } from "meowcss/web";
|
|
438
|
+
|
|
439
|
+
const runtime = createRuntime({ plugins: [createMeowUI()] });
|
|
440
|
+
const web = createWebRenderer(runtime);
|
|
441
|
+
const removeStyles = mountStyles(container.ownerDocument, standardTheme.cssText);
|
|
442
|
+
const removeTheme = applyTheme(
|
|
443
|
+
container,
|
|
444
|
+
standardTheme,
|
|
445
|
+
standardOptions.select({ scheme: "light" }),
|
|
446
|
+
);
|
|
447
|
+
const mounted = web.render(<Button variant="quiet">取消</Button>, container);
|
|
448
|
+
|
|
449
|
+
// 宿主销毁时:
|
|
450
|
+
mounted.unmount();
|
|
451
|
+
removeTheme();
|
|
452
|
+
removeStyles();
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
使用 defaultRuntime 时调用 `installMeowUI(defaultRuntime)`,并让初次渲染和动态控件
|
|
456
|
+
使用同一个 runtime。无需另外安装标准主题插件。样式属性的合法值、默认值和承载 part
|
|
457
|
+
由组件 contract 的 `defineStyleProps` 声明;适配器负责消费属性,避免将 variant 等
|
|
458
|
+
样式选项当作普通 DOM 属性透传。`ThemedProps` 提供联合类型及 Signal 输入;组件沿用
|
|
459
|
+
开放的原生 Props,因此不承诺拒绝所有未知属性。
|
|
460
|
+
|
|
461
|
+
静态宿主在构建时组合 `standardTheme.cssText` 与应用 CSS,写出 `.css` 文件并由 HTML
|
|
462
|
+
加载,同时通过 `themeAttributes(standardTheme, config)` 输出根属性。样式在客户端
|
|
463
|
+
JavaScript 执行前即可加载。Dashboard 和 Meowbook 使用这条交付路径;
|
|
464
|
+
动态预览使用 `mountStyles(document, cssText)`,由宿主持有返回的清理函数。
|
|
465
|
+
源码不维护 `.css` 文件,生成的 CSS 仍是浏览器资源。模块导入本身不访问 DOM,
|
|
466
|
+
`mountStyles` 不负责跨调用去重,宿主应在文档或应用生命周期内组装一次。
|
|
467
|
+
|
|
468
|
+
### 根配置与局部覆盖
|
|
469
|
+
|
|
470
|
+
`standardOptions` 内置 scheme,当前标准主题默认 `auto`,支持 light/dark/auto。
|
|
471
|
+
标准视觉以 DeepSeek Harness 为基准:系统字体、正文 14px、辅助 12px、标题 16px;按钮
|
|
472
|
+
small/default/large 使用 28/36/44px,输入框默认 32px。控件、菜单和大面板分别使用对应的
|
|
473
|
+
圆角与材质,应用从同一语言组合页面。参考来源与许可证见 [第三方说明](THIRD_PARTY_NOTICES.md),
|
|
474
|
+
实施范围及尚未完成的验证见 迁移记录(原产品仓库历史参考)。
|
|
475
|
+
|
|
476
|
+
```tsx
|
|
477
|
+
import { Theme } from "meowcss/web";
|
|
478
|
+
|
|
479
|
+
<Theme theme={standardTheme} config={standardOptions.select({ scheme: "dark" })}>
|
|
480
|
+
<Button>保存</Button>
|
|
481
|
+
<Theme config={standardOptions.select({ scheme: "light" })}>
|
|
482
|
+
<Preview />
|
|
483
|
+
</Theme>
|
|
484
|
+
</Theme>;
|
|
485
|
+
```
|
|
486
|
+
|
|
487
|
+
`Theme` 只绑定配置,不加载 CSS。局部 config 省略的维度继承父级;移除局部选择恢复
|
|
488
|
+
继承,组件实例和草稿不需要重建。已有 DOM 根使用 `applyTheme`,静态 HTML 使用
|
|
489
|
+
`themeAttributes`,三者共享属性语义。不要为每套主题创建新的 Theme 组件。
|
|
490
|
+
|
|
491
|
+
### 样式与组件选项
|
|
492
|
+
|
|
493
|
+
普通 CSS 保持模板形式;token 与 part 在 TypeScript 中引用,避免手写生成后的名称:
|
|
494
|
+
|
|
495
|
+
```ts
|
|
496
|
+
import { buttonContract, buttonOptions } from "meowtail";
|
|
497
|
+
import { css, partSelector } from "meowcss/meowjsx";
|
|
498
|
+
import { uiTokens } from "meowtail/theme";
|
|
499
|
+
|
|
500
|
+
const applicationStyles = css`
|
|
501
|
+
.toolbar ${partSelector(buttonContract, "root")} {
|
|
502
|
+
border-radius: ${uiTokens.controlRadius};
|
|
503
|
+
${buttonOptions.when({ variant: "quiet" })} {
|
|
504
|
+
color: ${uiTokens.info};
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
`;
|
|
508
|
+
```
|
|
509
|
+
|
|
510
|
+
宿主显式按标准主题、应用基础、应用覆写的顺序组合 CSS。hover、focus、媒体查询与动画
|
|
511
|
+
继续由 CSS 执行;原生状态用原生属性匹配,组件样式选项使用 `when`。`className` 和
|
|
512
|
+
`style` 保留为应用扩展入口,业务布局不进入标准主题。
|
|
513
|
+
|
|
514
|
+
自定义 token 使用 `defineTokens`,通过 `defineTheme` 一次组合选项、完整默认值、token
|
|
515
|
+
集合和 CSS 片段。组件绑定从片段中的 typed part 引用取得;不要提前将片段转成字符串而
|
|
516
|
+
丢失这些信息。无默认值的测量变量使用 `tokenRef`,通过 `.name` 交给 `setProperty`。
|
|
517
|
+
纯生成与 typed adapter 的写法和作用域边界见 [MeowCSS](../meowcss/README.md)。
|
|
518
|
+
|
|
519
|
+
构建并安装本地包后,从仓库根运行 `bunx --no-install meowbook serve --config packages/meowtail/meowbook.config.ts`
|
|
520
|
+
打开组件场景,核对明暗、桌面与窄屏、输入草稿和状态切换。尺寸是 Web 适配,
|
|
521
|
+
当前视觉基准见上述 DeepSeek 迁移记录;设计判断与打磨方法见
|
|
522
|
+
meow-design(原产品仓库历史参考),其历史探索配方不作为标准主题规范。
|
|
523
|
+
|
|
524
|
+
### 生命周期扩展
|
|
525
|
+
|
|
526
|
+
静态视觉使用 CSS。只有需要真实 DOM、实例状态、监听或清理时才使用 shadow:
|
|
527
|
+
|
|
528
|
+
```ts
|
|
529
|
+
// Web shadow:context.element 是真实 Element。
|
|
530
|
+
import { defineShadow } from "meowjsx/web";
|
|
531
|
+
|
|
532
|
+
runtime.use({
|
|
533
|
+
shadows: [
|
|
534
|
+
defineShadow(Button, "root", (props, context) => {
|
|
535
|
+
const active = context.signal(false);
|
|
536
|
+
context.effect(() => {
|
|
537
|
+
context.element.classList.toggle("is-active", active.value);
|
|
538
|
+
});
|
|
539
|
+
const enter = () => {
|
|
540
|
+
active.value = true;
|
|
541
|
+
};
|
|
542
|
+
const leave = () => {
|
|
543
|
+
active.value = false;
|
|
544
|
+
};
|
|
545
|
+
context.element.addEventListener("pointerenter", enter);
|
|
546
|
+
context.element.addEventListener("pointerleave", leave);
|
|
547
|
+
context.onCleanup(() => {
|
|
548
|
+
context.element.removeEventListener("pointerenter", enter);
|
|
549
|
+
context.element.removeEventListener("pointerleave", leave);
|
|
550
|
+
});
|
|
551
|
+
}),
|
|
552
|
+
],
|
|
553
|
+
});
|
|
554
|
+
```
|
|
555
|
+
|
|
556
|
+
集中注册,不生成包装组件。shadow 与组件共享 signal/effect/onCleanup 生命周期 API。
|
|
557
|
+
插件卸载阻止后续应用;现有元素的实例清理由其 mount 的 unmount 负责。不要用
|
|
558
|
+
renderToHtml + innerHTML 代替需要生命周期的浏览器挂载。
|
|
559
|
+
|
|
560
|
+
### 文件与验证
|
|
561
|
+
|
|
562
|
+
- `meowcss`:通用 token/选项/CSS 生成;`meowcss/meowjsx` 负责 typed parts 与自动 carrier;`meowcss/web` 负责 DOM 主题生命周期,详见 [MeowCSS](../meowcss/README.md)。
|
|
563
|
+
- `src/theme/tokens.ts`、`palette.ts`:共享参数与语义色板。
|
|
564
|
+
- `src/theme/base.styles.ts` 与 `components/chat/icons/shared` 下的 `*.styles.ts`:按职责编写的 CSS 模板;
|
|
565
|
+
专属高亮 token 在 `shared/code-highlight.tokens.ts`。
|
|
566
|
+
- `src/theme/index.ts`:标准主题的显式组装与公共导出。
|
|
567
|
+
- `bun test packages/meowtail/tests/unit`:组件与标准主题合同;通用 token/选项合同在 MeowCSS 测试中验证。
|
|
568
|
+
- `tsc --noEmit --project packages/meowtail/tsconfig.json`:检查实现、展示场景、浏览器测试和
|
|
569
|
+
`tests/types/` 的公共类型合同;类型用例不由 Bun 执行。
|
|
570
|
+
- `tests/browser/theme/parameterized-theme.spec.ts`:参数化主题、局部覆盖及真实组件组合回归,针对
|
|
571
|
+
`tests/fixtures/theme-prototype-demo.tsx` 与 `tests/fixtures/real-controls-demo.tsx` 的独立测试场景,
|
|
572
|
+
由本包 Playwright 专用测试配置加载,不进入组件 gallery。
|
|
573
|
+
- Rossovia 的 Dashboard 组合验证仍由产品仓库维护,不是本库的可运行命令;库内不保留依赖产品 checkout 的测试。
|
|
574
|
+
|
|
575
|
+
浏览器验收覆盖对应场景,不能用类型或构建通过替代。组件注册必须作用于实际渲染的
|
|
576
|
+
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.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type AssistantViewProps } from "./assistant-types.js";
|
|
2
|
+
export declare const assistantComposerContract: {
|
|
3
|
+
readonly name: "assistant-composer";
|
|
4
|
+
readonly parts: readonly ["root", "choices", "feedback", "file"];
|
|
5
|
+
};
|
|
6
|
+
export declare const AssistantComposer: import("meowjsx").Component<{
|
|
7
|
+
options: AssistantViewProps;
|
|
8
|
+
}, "assistant-composer", "choices" | "feedback" | "file" | "root">;
|