Skip to content

DeepSeek Harness Tauri 桌面版 | Only 8mb installer, zero environment setup, preset plugins, Windows / macOS / Linux.

refactor(extension): per-component cssr + shared index

hairyf562649d55269
diff --git a/packages/dsh-tauri-panel-extension/src/client/components/extension-panel.cssr.ts b/packages/dsh-tauri-panel-extension/src/client/components/extension-panel.cssr.ts
new file mode 100644
index 00000000..07a7483d
--- /dev/null
+++ b/packages/dsh-tauri-panel-extension/src/client/components/extension-panel.cssr.ts
@@ -0,0 +1,53 @@
+import { cssr, styles as sharedStyles } from 'dsh-tauri-ui/client'
+
+const { c, bem: { b, e } } = cssr
+const { primary, tertiary, borderL2: border, business } = sharedStyles
+
+/** 扩展面板外壳(extension-panel.tsx):Tabs 布局。 */
+export default b('extension', [
+ e('section', {
+ display: 'flex',
+ flexDirection: 'column',
+ gap: '14px',
+ width: '100%',
+ maxWidth: '760px',
+ color: primary,
+ }),
+ e('tabs', {
+ display: 'flex',
+ alignItems: 'flex-end',
+ gap: '22px',
+ borderBottom: `1px solid ${border}`,
+ marginTop: '2px',
+ }),
+ e('tab', {
+ position: 'relative',
+ border: '0',
+ padding: '7px 1px 9px',
+ background: 'transparent',
+ color: tertiary,
+ font: 'inherit',
+ fontSize: '13px',
+ lineHeight: '20px',
+ cursor: 'pointer',
+ }, [
+ c('&:hover, &[data-active="true"]', { color: primary }),
+ c('&[data-active="true"]::after, &:focus-visible::after', {
+ position: 'absolute',
+ right: '0',
+ bottom: '-1px',
+ left: '0',
+ height: '2px',
+ borderRadius: '2px 2px 0 0',
+ background: primary,
+ content: '""',
+ }),
+ c('&:focus-visible', {
+ outline: `2px solid ${business}`,
+ outlineOffset: '2px',
+ borderRadius: '2px',
+ color: primary,
+ }),
+ ]),
+ e('tab-panel', { minWidth: '0', paddingTop: '2px' }),
+])
diff --git a/packages/dsh-tauri-panel-extension/src/client/components/extension-panel.tsx b/packages/dsh-tauri-panel-extension/src/client/components/extension-panel.tsx
index f1dacc97..b42010ec 100644
--- a/packages/dsh-tauri-panel-extension/src/client/components/extension-panel.tsx
+++ b/packages/dsh-tauri-panel-extension/src/client/components/extension-panel.tsx
@@ -7,7 +7,10 @@
import type { ReactElement } from 'react'
import type { McpInjected, SkillsInjected, Translate } from '../types'
+import { useMountStyle } from 'dsh-tauri-ui/client'
import { useEffect, useId, useRef, useState } from 'react'
+import { EXTENSION_PANEL_STYLE_ID } from '../constants'
+import extensionPanelStyle from './extension-panel.cssr'
import { McpTab } from './mcp-tab'
import { SkillsTab } from './skills-tab'
@@ -19,6 +22,7 @@ export interface ExtensionPanelProps {
}
export function ExtensionPanel({ t, skills, mcp, createSkill }: ExtensionPanelProps): ReactElement {
+ useMountStyle(extensionPanelStyle, EXTENSION_PANEL_STYLE_ID)
const tabsId = useId()
const tabRefs = useRef<Array<HTMLButtonElement | null>>([])
const rows = [{ id: 'skills', label: t('skillsTab') }, { id: 'mcp', label: t('mcpTab') }]
diff --git a/packages/dsh-tauri-panel-extension/src/client/components/markdown.cssr.ts b/packages/dsh-tauri-panel-extension/src/client/components/markdown.cssr.ts
new file mode 100644
index 00000000..5eb3b4a0
--- /dev/null
+++ b/packages/dsh-tauri-panel-extension/src/client/components/markdown.cssr.ts
@@ -0,0 +1,43 @@
+import { cssr, styles as sharedStyles } from 'dsh-tauri-ui/client'
+
+const { c, bem: { b, e } } = cssr
+const { primary, borderL2: border, business, layer1, layer3 } = sharedStyles
+
+/** 技能详情 Markdown 预览(markdown.tsx)。 */
+export default b('extension', [
+ e('md-preview', {
+ minHeight: '320px',
+ maxHeight: '60vh',
+ overflowY: 'auto',
+ border: `1px solid ${border}`,
+ borderRadius: '8px',
+ padding: '8px 12px',
+ background: layer1,
+ fontSize: '13px',
+ }),
+ e('md-body', [
+ c('& h1, & h2, & h3, & h4', { margin: '14px 0 6px', color: primary, lineHeight: '1.4' }),
+ c('& h1', { fontSize: '18px' }),
+ c('& h2', { fontSize: '16px' }),
+ c('& h3', { fontSize: '14px' }),
+ c('& h4', { fontSize: '13px' }),
+ c('& p', { margin: '6px 0', lineHeight: '20px' }),
+ c('& ul, & ol', { margin: '6px 0', paddingLeft: '20px' }),
+ c('& code', {
+ fontFamily: 'var(--ds-font-family-code)',
+ fontSize: '12px',
+ background: layer3,
+ borderRadius: '4px',
+ padding: '1px 5px',
+ }),
+ c('& pre', {
+ margin: '8px 0',
+ padding: '10px 12px',
+ overflowX: 'auto',
+ border: `1px solid ${border}`,
+ borderRadius: '8px',
+ background: layer3,
+ }),
+ c('& a', { color: business }),
+ ]),
+])
diff --git a/packages/dsh-tauri-panel-extension/src/client/components/markdown.tsx b/packages/dsh-tauri-panel-extension/src/client/components/markdown.tsx
index 983b815b..24a375b1 100644
--- a/packages/dsh-tauri-panel-extension/src/client/components/markdown.tsx
+++ b/packages/dsh-tauri-panel-extension/src/client/components/markdown.tsx
@@ -1,13 +1,17 @@
import type { ReactElement } from 'react'
import DOMPurify from 'dompurify'
+import { useMountStyle } from 'dsh-tauri-ui/client'
import { marked } from 'marked'
import { useMemo } from 'react'
+import { MARKDOWN_STYLE_ID } from '../constants'
+import markdownStyle from './markdown.cssr'
function parseMarkdown(text: string): string {
return DOMPurify.sanitize(marked.parse(text, { async: false, gfm: true, breaks: false }) as string)
}
export function MarkdownPreview(props: { text: string }): ReactElement {
+ useMountStyle(markdownStyle, MARKDOWN_STYLE_ID)
const html = useMemo(() => parseMarkdown(props.text), [props.text])
return <div className="dshp-extension__md-body" dangerouslySetInnerHTML={{ __html: html }} />
}
diff --git a/packages/dsh-tauri-panel-extension/src/client/components/mcp-editor-form.cssr.ts b/packages/dsh-tauri-panel-extension/src/client/components/mcp-editor-form.cssr.ts
new file mode 100644
index 00000000..6f6be0e3
--- /dev/null
+++ b/packages/dsh-tauri-panel-extension/src/client/components/mcp-editor-form.cssr.ts
@@ -0,0 +1,135 @@
+import { cssr, styles as sharedStyles } from 'dsh-tauri-ui/client'
+
+const { c, bem: { b, e, m } } = cssr
+const { primary, secondary, tertiary, borderL2: border, business, layer1 } = sharedStyles
+
+/** MCP 服务器编辑器(mcp-editor-form.tsx):表单 + 编辑器页签。 */
+export default b('extension', [
+ e('form', { display: 'flex', flexDirection: 'column', gap: '10px' }),
+ e('editor-tabs', { display: 'flex', gap: '4px', borderBottom: `1px solid ${border}` }),
+ e('editor-tab', {
+ position: 'relative',
+ border: '0',
+ padding: '7px 10px 9px',
+ background: 'transparent',
+ color: tertiary,
+ font: 'inherit',
+ fontSize: '13px',
+ lineHeight: '20px',
+ cursor: 'pointer',
+ }, [
+ c('&:hover, &[data-active="true"]', { color: primary }),
+ c('&[data-active="true"]::after', {
+ position: 'absolute',
+ right: '8px',
+ bottom: '-1px',
+ left: '8px',
+ height: '2px',
+ borderRadius: '2px 2px 0 0',
+ background: primary,
+ content: '""',
+ }),
+ c('&:focus-visible', {
+ outline: `2px solid ${business}`,
+ outlineOffset: '-2px',
+ borderRadius: '4px',
+ color: primary,
+ }),
+ ]),
+ e('label', {
+ display: 'flex',
+ flexDirection: 'column',
+ gap: '4px',
+ fontSize: '12px',
+ lineHeight: '18px',
+ color: secondary,
+ }, [
+ c('& > span:first-child', { color: tertiary }),
+ ]),
+ e('input', {
+ width: '100%',
+ boxSizing: 'border-box',
+ border: `1px solid ${border}`,
+ borderRadius: '8px',
+ padding: '7px 10px',
+ outline: 'none',
+ background: layer1,
+ color: primary,
+ font: 'inherit',
+ fontSize: '13px',
+ }, [
+ c('&:focus-visible', {
+ borderColor: business,
+ boxShadow: `0 0 0 2px color-mix(in srgb,${business} 18%,transparent)`,
+ }),
+ ]),
+ e('textarea', {
+ width: '100%',
+ boxSizing: 'border-box',
+ border: `1px solid ${border}`,
+ borderRadius: '8px',
+ padding: '7px 10px',
+ outline: 'none',
+ background: layer1,
+ color: primary,
+ font: 'inherit',
+ fontSize: '13px',
+ minHeight: '320px',
+ resize: 'vertical',
+ fontFamily: 'var(--ds-font-family-code)',
+ lineHeight: '1.5',
+ }, [
+ c('&[data-short="true"]', { minHeight: '96px' }),
+ c('&:focus-visible', {
+ borderColor: business,
+ boxShadow: `0 0 0 2px color-mix(in srgb,${business} 18%,transparent)`,
+ }),
+ ]),
+ e('select', {
+ width: '100%',
+ boxSizing: 'border-box',
+ border: `1px solid ${border}`,
+ borderRadius: '8px',
+ padding: '7px 10px',
+ outline: 'none',
+ background: layer1,
+ color: primary,
+ font: 'inherit',
+ fontSize: '13px',
+ }, [
+ c('&:focus-visible', {
+ borderColor: business,
+ boxShadow: `0 0 0 2px color-mix(in srgb,${business} 18%,transparent)`,
+ }),
+ ]),
+ e('json-editor', { minHeight: '260px' }),
+ e('checks', {
+ display: 'flex',
+ gap: '16px',
+ fontSize: '13px',
+ lineHeight: '20px',
+ }, [
+ c('& label', {
+ display: 'inline-flex',
+ alignItems: 'center',
+ gap: '8px',
+ cursor: 'pointer',
+ minWidth: '0',
+ }),
+ ]),
+ e('import-choice', {
+ display: 'inline-flex',
+ alignItems: 'center',
+ gap: '8px',
+ cursor: 'pointer',
+ minWidth: '0',
+ }, [
+ m('disabled', { cursor: 'default' }),
+ ]),
+ e('form-error', {
+ margin: '0',
+ color: 'var(--dsw-alias-state-error-primary)',
+ fontSize: '12px',
+ lineHeight: '18px',
+ }),
+])
diff --git a/packages/dsh-tauri-panel-extension/src/client/components/mcp-editor-form.tsx b/packages/dsh-tauri-panel-extension/src/client/components/mcp-editor-form.tsx
index 6c9f3066..b028f4f0 100644
--- a/packages/dsh-tauri-panel-extension/src/client/components/mcp-editor-form.tsx
+++ b/packages/dsh-tauri-panel-extension/src/client/components/mcp-editor-form.tsx
@@ -7,6 +7,9 @@
import type { ReactElement } from 'react'
import type { McpEditorMode, McpEditorState, Translate } from '../types'
import { Button } from '@deepseek-ai/dsh-client-ui-primitives'
+import { useMountStyle } from 'dsh-tauri-ui/client'
+import { MCP_EDITOR_FORM_STYLE_ID } from '../constants'
+import mcpEditorFormStyle from './mcp-editor-form.cssr'
export interface McpEditorFormProps {
t: Translate
@@ -25,6 +28,7 @@ export interface McpEditorFormProps {
}
export function McpEditorForm(props: McpEditorFormProps): ReactElement {
+ useMountStyle(mcpEditorFormStyle, MCP_EDITOR_FORM_STYLE_ID)
const { t, editor, mode, busy, pasteJson, pasteError, formError, onModeChange, onEditorChange, onPasteJsonChange, onPasteFill, onCancel, onSave } = props
return (
<div className="dshp-extension__form">
diff --git a/packages/dsh-tauri-panel-extension/src/client/components/mcp-import-dialog.cssr.ts b/packages/dsh-tauri-panel-extension/src/client/components/mcp-import-dialog.cssr.ts
new file mode 100644
index 00000000..771da316
--- /dev/null
+++ b/packages/dsh-tauri-panel-extension/src/client/components/mcp-import-dialog.cssr.ts
@@ -0,0 +1,32 @@
+import { cssr, styles as sharedStyles } from 'dsh-tauri-ui/client'
+
+const { c, bem: { b, e } } = cssr
+const { secondary, tertiary } = sharedStyles
+
+/** MCP 批量导入弹窗(mcp-import-dialog.tsx):分组滚动列表。 */
+export default b('extension', [
+ // Modal className 需高于官方 Modal 内部宽度的特异性,保持双重类。
+ c('.dshp-extension__modal-wide.dshp-extension__modal-wide', { width: 'min(680px,100%)' }),
+ c('.dshp-extension__modal-form.dshp-extension__modal-form', { width: 'min(760px,100%)' }),
+ c('.dshp-extension__modal-scroll.dshp-extension__modal-scroll', { maxHeight: 'calc(100vh - 160px)', overflowY: 'auto' }),
+ e('import-scroll', {
+ display: 'flex',
+ flexDirection: 'column',
+ gap: '14px',
+ maxHeight: 'min(400px,52vh)',
+ overflowY: 'auto',
+ padding: '2px 4px 2px 2px',
+ }),
+ e('import-group', { display: 'flex', flexDirection: 'column', gap: '8px' }),
+ e('import-head', { display: 'flex', alignItems: 'center', gap: '8px', padding: '0 2px' }),
+ e('import-count', { fontSize: '12px', lineHeight: '18px', color: tertiary }),
+ e('import-all', {
+ marginLeft: 'auto',
+ display: 'inline-flex',
+ alignItems: 'center',
+ gap: '6px',
+ fontSize: '12px',
+ color: secondary,
+ cursor: 'pointer',
+ }),
+])
diff --git a/packages/dsh-tauri-panel-extension/src/client/components/mcp-import-dialog.tsx b/packages/dsh-tauri-panel-extension/src/client/components/mcp-import-dialog.tsx
index b886dc78..6b838037 100644
--- a/packages/dsh-tauri-panel-extension/src/client/components/mcp-import-dialog.tsx
+++ b/packages/dsh-tauri-panel-extension/src/client/components/mcp-import-dialog.tsx
@@ -7,7 +7,10 @@
import type { ReactElement } from 'react'
import type { McpImportItem, Translate } from '../types'
import { Button, Modal } from '@deepseek-ai/dsh-client-ui-primitives'
+import { useMountStyle } from 'dsh-tauri-ui/client'
+import { MCP_IMPORT_DIALOG_STYLE_ID } from '../constants'
import { importGroups } from '../utils/mcp'
+import mcpImportDialogStyle from './mcp-import-dialog.cssr'
export interface McpImportDialogProps {
t: Translate
@@ -22,6 +25,7 @@ export interface McpImportDialogProps {
}
export function McpImportDialog(props: McpImportDialogProps): ReactElement {
+ useMountStyle(mcpImportDialogStyle, MCP_IMPORT_DIALOG_STYLE_ID)
const { t, open, items, busy, formError, onClose, onToggle, onToggleGroup, onImport } = props
return (
<Modal
diff --git a/packages/dsh-tauri-panel-extension/src/client/components/mcp-tab.cssr.ts b/packages/dsh-tauri-panel-extension/src/client/components/mcp-tab.cssr.ts
new file mode 100644
index 00000000..0a9fa004
--- /dev/null
+++ b/packages/dsh-tauri-panel-extension/src/client/components/mcp-tab.cssr.ts
@@ -0,0 +1,90 @@
+import { cssr, styles as sharedStyles } from 'dsh-tauri-ui/client'
+
+const { c, bem: { b, e } } = cssr
+const { primary, secondary, tertiary, borderL2: border, business, layer1, hover } = sharedStyles
+
+/** MCP 列表(mcp-tab.tsx):格式分段 + 标签 chips + 开关 + 链接。 */
+export default b('extension', [
+ e('segments', {
+ display: 'inline-flex',
+ gap: '4px',
+ border: `1px solid ${border}`,
+ borderRadius: '8px',
+ padding: '3px',
+ background: layer1,
+ }),
+ e('segment', {
+ border: '0',
+ borderRadius: '6px',
+ padding: '4px 14px',
+ background: 'transparent',
+ color: secondary,
+ font: 'inherit',
+ fontSize: '12px',
+ cursor: 'pointer',
+ }, [
+ c('&[data-active="true"]', { background: hover, color: primary, fontWeight: '600' }),
+ ]),
+ e('format', {
+ border: `1px solid ${border}`,
+ borderRadius: '8px',
+ padding: '8px 12px',
+ background: layer1,
+ }, [
+ c('& summary', { fontSize: '12px', color: secondary, cursor: 'pointer' }),
+ ]),
+ e('format-hint', { margin: '2px 0 0', fontSize: '12px', color: tertiary }),
+ e('chips', { display: 'flex', alignItems: 'center', gap: '6px', flexWrap: 'wrap' }),
+ e('chip', {
+ border: `1px solid ${border}`,
+ borderRadius: '999px',
+ padding: '2px 10px',
+ background: 'transparent',
+ color: secondary,
+ font: 'inherit',
+ fontSize: '12px',
+ cursor: 'pointer',
+ }, [
+ c('&:hover, &[data-active="true"]', { color: business, background: hover }),
+ ]),
+ e('switch', {
+ position: 'relative',
+ flex: 'none',
+ width: '30px',
+ height: '18px',
+ border: '0',
+ borderRadius: '999px',
+ background: layer1,
+ boxShadow: `inset 0 0 0 1px ${border}`,
+ cursor: 'pointer',
+ }, [
+ c('&[aria-checked="true"]', {
+ background: `color-mix(in srgb,${business} 55%,transparent)`,
+ boxShadow: 'none',
+ }),
+ c('&[aria-checked="true"] .dshp-extension__switch-knob', { left: '14px', background: '#fff' }),
+ ]),
+ e('switch-knob', {
+ position: 'absolute',
+ top: '2px',
+ left: '2px',
+ width: '14px',
+ height: '14px',
+ borderRadius: '50%',
+ background: primary,
+ transition: 'left .15s',
+ }),
+ e('link', {
+ border: '0',
+ padding: '0',
+ background: 'transparent',
+ font: 'inherit',
+ fontSize: '12px',
+ lineHeight: '18px',
+ cursor: 'pointer',
+ textDecoration: 'none',
+ color: business,
+ }, [
+ c('&:hover', { textDecoration: 'underline' }),
+ ]),
+])
diff --git a/packages/dsh-tauri-panel-extension/src/client/components/mcp-tab.tsx b/packages/dsh-tauri-panel-extension/src/client/components/mcp-tab.tsx
index e97a110c..6cad2ac1 100644
--- a/packages/dsh-tauri-panel-extension/src/client/components/mcp-tab.tsx
+++ b/packages/dsh-tauri-panel-extension/src/client/components/mcp-tab.tsx
@@ -11,16 +11,18 @@
import type { ReactElement } from 'react'
import type { McpEditorMode, McpEditorState, McpImportItem, McpRow, McpTabProps } from '../types'
import { Button, Modal, StateDot } from '@deepseek-ai/dsh-client-ui-primitives'
-import { ArrowRotateRight, Icon, PlugConnection } from 'dsh-tauri-ui/client'
+import { ArrowRotateRight, Icon, PlugConnection, useMountStyle } from 'dsh-tauri-ui/client'
import { useEffect, useState } from 'react'
-import { MCP_RESTART_INITIAL_DELAY_MS, MCP_RESTART_POLL_INTERVAL_MS, MCP_RESTART_TIMEOUT_MS } from '../constants'
+import { MCP_RESTART_INITIAL_DELAY_MS, MCP_RESTART_POLL_INTERVAL_MS, MCP_RESTART_TIMEOUT_MS, MCP_TAB_STYLE_ID } from '../constants'
import { useTimers } from '../hooks/use-timers'
import { mapToPairs, parseMcpJson, parsePairs } from '../utils/mcp'
import { McpEditorForm } from './mcp-editor-form'
import { McpImportDialog } from './mcp-import-dialog'
+import mcpTabStyle from './mcp-tab.cssr'
export function McpTab(props: McpTabProps): ReactElement {
const { t, injected } = props
+ useMountStyle(mcpTabStyle, MCP_TAB_STYLE_ID)
const [servers, setServers] = useState<McpRow[] | null>(null)
const [editor, setEditor] = useState<McpEditorState | null>(null)
const [confirmId, setConfirmId] = useState<string | null>(null)
diff --git a/packages/dsh-tauri-panel-extension/src/client/components/skills-tab.cssr.ts b/packages/dsh-tauri-panel-extension/src/client/components/skills-tab.cssr.ts
new file mode 100644
index 00000000..bf368472
--- /dev/null
+++ b/packages/dsh-tauri-panel-extension/src/client/components/skills-tab.cssr.ts
@@ -0,0 +1,93 @@
+import { cssr, styles as sharedStyles } from 'dsh-tauri-ui/client'
+
+const { c, bem: { b, e } } = cssr
+const { primary, secondary, tertiary, borderL2: border, business, layer3, hover } = sharedStyles
+
+/** 技能列表(skills-tab.tsx):头部 + 横幅 + 刷新。 */
+export default b('extension', [
+ e('head', {
+ display: 'flex',
+ alignItems: 'center',
+ gap: '8px',
+ flexWrap: 'wrap',
+ }, [
+ c('& h3', { margin: '0', fontSize: '13px', lineHeight: '20px', fontWeight: '600' }),
+ c('& > svg', { flex: 'none', color: tertiary }),
+ ]),
+ e('list-head', {
+ display: 'flex',
+ alignItems: 'baseline',
+ gap: '7px',
+ padding: '0 2px',
+ marginTop: '2px',
+ }, [
+ c('& h3', { margin: '0', fontSize: '13px', lineHeight: '20px', fontWeight: '600' }),
+ ]),
+ e('count', { fontSize: '12px', lineHeight: '18px', color: tertiary, fontVariantNumeric: 'tabular-nums' }),
+ e('refresh', {
+ display: 'inline-flex',
+ alignItems: 'center',
+ justifyContent: 'center',
+ width: '26px',
+ height: '26px',
+ border: '0',
+ borderRadius: '6px',
+ background: 'transparent',
+ color: tertiary,
+ cursor: 'pointer',
+ textDecoration: 'none',
+ }, [
+ c('&:hover', { background: hover, color: primary }),
+ c('&:focus-visible', { outline: `2px solid ${business}`, outlineOffset: '-2px' }),
+ ]),
+ e('icon-link', {
+ display: 'inline-flex',
+ alignItems: 'center',
+ justifyContent: 'center',
+ width: '26px',
+ height: '26px',
+ border: '0',
+ borderRadius: '6px',
+ background: 'transparent',
+ color: tertiary,
+ cursor: 'pointer',
+ textDecoration: 'none',
+ }, [
+ c('&:hover', { background: hover, color: primary }),
+ c('&:focus-visible', { outline: `2px solid ${business}`, outlineOffset: '-2px' }),
+ ]),
+ e('banner', {
+ display: 'flex',
+ alignItems: 'flex-start',
+ gap: '8px',
+ border: `1px solid ${border}`,
+ borderRadius: '8px',
+ padding: '10px 12px',
+ background: layer3,
+ fontSize: '13px',
+ lineHeight: '20px',
+ }, [
+ c('&[data-kind="ok"]', {
+ borderColor: 'color-mix(in srgb,var(--dsw-alias-state-success-primary) 35%,transparent)',
+ background: 'color-mix(in srgb,var(--dsw-alias-state-success-primary) 8%,transparent)',
+ }),
+ c('&[data-kind="error"]', {
+ borderColor: 'color-mix(in srgb,var(--dsw-alias-state-error-primary) 35%,transparent)',
+ background: 'color-mix(in srgb,var(--dsw-alias-state-error-primary) 8%,transparent)',
+ }),
+ c('&[data-kind="info"]', {
+ borderColor: `color-mix(in srgb,${business} 35%,transparent)`,
+ background: `color-mix(in srgb,${business} 8%,transparent)`,
+ }),
+ ]),
+ e('banner-body', { flex: '1', minWidth: '0', display: 'flex', flexDirection: 'column', gap: '4px' }),
+ e('banner-hint', {
+ display: 'flex',
+ alignItems: 'center',
+ gap: '8px',
+ flexWrap: 'wrap',
+ color: secondary,
+ fontSize: '12px',
+ lineHeight: '18px',
+ }),
+])
diff --git a/packages/dsh-tauri-panel-extension/src/client/components/skills-tab.tsx b/packages/dsh-tauri-panel-extension/src/client/components/skills-tab.tsx
index 949e86bb..2024ff0e 100644
--- a/packages/dsh-tauri-panel-extension/src/client/components/skills-tab.tsx
+++ b/packages/dsh-tauri-panel-extension/src/client/components/skills-tab.tsx
@@ -9,14 +9,16 @@
import type { ReactElement } from 'react'
import type { OpenTarget, SkillEditorState, SkillRowView, SkillsTabProps } from '../types'
import { Button, Modal, StateDot } from '@deepseek-ai/dsh-client-ui-primitives'
-import { ArrowRotateRight, GraduationCap, Icon, LogoGithub } from 'dsh-tauri-ui/client'
+import { ArrowRotateRight, GraduationCap, Icon, LogoGithub, useMountStyle } from 'dsh-tauri-ui/client'
import { useEffect, useMemo, useState } from 'react'
import { MarkdownPreview } from '../components/markdown'
-import { IMPORT_REFRESH_DELAYS_MS, SKILL_REFRESH_INTERVAL_MS, SKILL_REFRESH_TIMEOUT_MS, SOURCE_LOCALE_KEYS } from '../constants'
+import { IMPORT_REFRESH_DELAYS_MS, SKILL_REFRESH_INTERVAL_MS, SKILL_REFRESH_TIMEOUT_MS, SKILLS_TAB_STYLE_ID, SOURCE_LOCALE_KEYS } from '../constants'
import { useTimers } from '../hooks/use-timers'
import { normalizeRepository, policyTag } from '../utils/skills'
+import skillsTabStyle from './skills-tab.cssr'
export function SkillsTab({ t, injected, createSkill }: SkillsTabProps): ReactElement {
+ useMountStyle(skillsTabStyle, SKILLS_TAB_STYLE_ID)
const [skills, setSkills] = useState<SkillRowView[] | null>(null)
const [editor, setEditor] = useState<SkillEditorState | null>(null)
const [preview, setPreview] = useState(false)
diff --git a/packages/dsh-tauri-panel-extension/src/client/constants/index.ts b/packages/dsh-tauri-panel-extension/src/client/constants/index.ts
index 0ebd335d..1547dc1b 100644
--- a/packages/dsh-tauri-panel-extension/src/client/constants/index.ts
+++ b/packages/dsh-tauri-panel-extension/src/client/constants/index.ts
@@ -14,6 +14,12 @@ export const INPUT_PREFILL_ID = 'dsh-tauri-panel-extension.skill-prefill'
export const INPUT_PREFILL_ORDER = 40
export const INPUT_PREFILL_PRIORITY = 0
export const STYLE_ID = 'dsh-tauri-panel-extension-styles'
+export const EXTENSION_PANEL_STYLE_ID = 'dsh-tauri-panel-extension-panel-styles'
+export const SKILLS_TAB_STYLE_ID = 'dsh-tauri-panel-extension-skills-tab-styles'
+export const MCP_TAB_STYLE_ID = 'dsh-tauri-panel-extension-mcp-tab-styles'
+export const MARKDOWN_STYLE_ID = 'dsh-tauri-panel-extension-markdown-styles'
+export const MCP_EDITOR_FORM_STYLE_ID = 'dsh-tauri-panel-extension-editor-form-styles'
+export const MCP_IMPORT_DIALOG_STYLE_ID = 'dsh-tauri-panel-extension-import-dialog-styles'
export const SKILL_CREATOR_DRAFT = '/skill-creator '
export const SKILL_REFRESH_INTERVAL_MS = 300
export const SKILL_REFRESH_TIMEOUT_MS = 5_000
diff --git a/packages/dsh-tauri-panel-extension/src/client/index.ts b/packages/dsh-tauri-panel-extension/src/client/index.ts
index 01e58396..1a87c512 100644
--- a/packages/dsh-tauri-panel-extension/src/client/index.ts
+++ b/packages/dsh-tauri-panel-extension/src/client/index.ts
@@ -15,7 +15,7 @@ import { installExtensionPanel } from './register/extension-panel'
import { registerSkillCreatorPrefill } from './register/skill-creator-prefill'
import { createMcpInjected } from './service/mcp'
import { createSkillsInjected } from './service/skills'
-import extensionPanelStyle from './styles/extension-panel.cssr'
+import extensionIndexStyle from './styles/index.cssr'
export const name = PLUGIN_ID
export const inject = ['slots', 'locale', 'sessions', 'workspaces']
@@ -23,7 +23,7 @@ export const inject = ['slots', 'locale', 'sessions', 'workspaces']
export function apply(ctx: ExtensionClientContext): void {
const cx = compat(ctx)
installExtensionLocale(ctx)
- ctx.effect(() => mountStyle(extensionPanelStyle, STYLE_ID), `${PLUGIN_ID}: styles`)
+ ctx.effect(() => mountStyle(extensionIndexStyle, STYLE_ID), `${PLUGIN_ID}: styles`)
const t = ctx.locale.bind(LOCALE_NAMESPACE) as Translate
registerSkillCreatorPrefill(ctx)
installExtensionPanel(cx as ExtensionClientContext, t, createSkillsInjected(), createMcpInjected())
diff --git a/packages/dsh-tauri-panel-extension/src/client/styles/extension-panel.cssr.ts b/packages/dsh-tauri-panel-extension/src/client/styles/extension-panel.cssr.ts
deleted file mode 100644
index a6d17742..00000000
--- a/packages/dsh-tauri-panel-extension/src/client/styles/extension-panel.cssr.ts
+++ /dev/null
@@ -1,560 +0,0 @@
-import { cssr, styles as sharedStyles } from 'dsh-tauri-ui/client'
-
-const { c, bem: { b, e, m } } = cssr
-const {
- primary,
- secondary,
- tertiary,
- borderL2: border,
- business,
- layer1,
- layer3,
- hover,
-} = sharedStyles
-
-/** 扩展面板:Tabs 布局 + 技能/MCP 卡片 + 编辑器/导入弹窗内容。 */
-export default b('extension', [
- e('section', {
- display: 'flex',
- flexDirection: 'column',
- gap: '14px',
- width: '100%',
- maxWidth: '760px',
- color: primary,
- }),
- e('tabs', {
- display: 'flex',
- alignItems: 'flex-end',
- gap: '22px',
- borderBottom: `1px solid ${border}`,
- marginTop: '2px',
- }),
- e('tab', {
- position: 'relative',
- border: '0',
- padding: '7px 1px 9px',
- background: 'transparent',
- color: tertiary,
- font: 'inherit',
- fontSize: '13px',
- lineHeight: '20px',
- cursor: 'pointer',
- }, [
- c('&:hover, &[data-active="true"]', { color: primary }),
- c('&[data-active="true"]::after, &:focus-visible::after', {
- position: 'absolute',
- right: '0',
- bottom: '-1px',
- left: '0',
- height: '2px',
- borderRadius: '2px 2px 0 0',
- background: primary,
- content: '""',
- }),
- c('&:focus-visible', {
- outline: `2px solid ${business}`,
- outlineOffset: '2px',
- borderRadius: '2px',
- color: primary,
- }),
- ]),
- e('tab-panel', { minWidth: '0', paddingTop: '2px' }),
- e('head', {
- display: 'flex',
- alignItems: 'center',
- gap: '8px',
- flexWrap: 'wrap',
- }, [
- c('& h3', { margin: '0', fontSize: '13px', lineHeight: '20px', fontWeight: '600' }),
- c('& > svg', { flex: 'none', color: tertiary }),
- ]),
- e('list-head', {
- display: 'flex',
- alignItems: 'baseline',
- gap: '7px',
- padding: '0 2px',
- marginTop: '2px',
- }, [
- c('& h3', { margin: '0', fontSize: '13px', lineHeight: '20px', fontWeight: '600' }),
- ]),
- e('intro', {
- margin: '0',
- fontSize: '13px',
- lineHeight: '20px',
- color: tertiary,
- }),
- e('empty', {
- margin: '0',
- fontSize: '13px',
- lineHeight: '20px',
- color: tertiary,
- }),
- e('count', {
- fontSize: '12px',
- lineHeight: '18px',
- color: tertiary,
- fontVariantNumeric: 'tabular-nums',
- }),
- e('spacer', { flex: '1' }),
- e('refresh', {
- display: 'inline-flex',
- alignItems: 'center',
- justifyContent: 'center',
- width: '26px',
- height: '26px',
- border: '0',
- borderRadius: '6px',
- background: 'transparent',
- color: tertiary,
- cursor: 'pointer',
- textDecoration: 'none',
- }, [
- c('&:hover', { background: hover, color: primary }),
- c('&:focus-visible', { outline: `2px solid ${business}`, outlineOffset: '-2px' }),
- ]),
- e('icon-link', {
- display: 'inline-flex',
- alignItems: 'center',
- justifyContent: 'center',
- width: '26px',
- height: '26px',
- border: '0',
- borderRadius: '6px',
- background: 'transparent',
- color: tertiary,
- cursor: 'pointer',
- textDecoration: 'none',
- }, [
- c('&:hover', { background: hover, color: primary }),
- c('&:focus-visible', { outline: `2px solid ${business}`, outlineOffset: '-2px' }),
- ]),
- e('cards', {
- display: 'grid',
- gridTemplateColumns: 'repeat(2,minmax(0,1fr))',
- alignItems: 'stretch',
- gap: '10px',
- margin: '0',
- padding: '0',
- listStyle: 'none',
- }, [
- m('single', { gridTemplateColumns: 'minmax(0,1fr)' }),
- ]),
- e('card', {
- display: 'flex',
- flexDirection: 'column',
- gap: '8px',
- minWidth: '0',
- border: `1px solid ${border}`,
- borderRadius: '10px',
- background: layer3,
- padding: '12px 14px',
- }, [
- c('&:hover', { background: hover }),
- m('muted', { opacity: '.55' }),
- ]),
- e('card-top', {
- display: 'flex',
- alignItems: 'center',
- gap: '6px',
- flexWrap: 'wrap',
- }),
- e('card-row', {
- display: 'flex',
- alignItems: 'center',
- gap: '6px',
- flexWrap: 'wrap',
- }),
- e('card-title', {
- flex: '1',
- minWidth: '0',
- overflow: 'hidden',
- textOverflow: 'ellipsis',
- whiteSpace: 'nowrap',
- fontSize: '14px',
- lineHeight: '20px',
- fontWeight: '600',
- fontFamily: 'var(--ds-font-family-code)',
- }),
- e('card-desc', {
- margin: '0',
- fontSize: '12px',
- lineHeight: '18px',
- color: secondary,
- display: '-webkit-box',
- WebkitLineClamp: '2',
- WebkitBoxOrient: 'vertical',
- overflow: 'hidden',
- }),
- e('tag', {
- display: 'inline-flex',
- alignItems: 'center',
- minHeight: '20px',
- borderRadius: '5px',
- padding: '1px 6px',
- background: layer1,
- color: secondary,
- fontSize: '11px',
- lineHeight: '16px',
- whiteSpace: 'nowrap',
- }, [
- c('&[data-kind="source"]', {
- background: `color-mix(in srgb,${business} 10%,transparent)`,
- color: business,
- }),
- c('&[data-kind="off"]', {
- background: 'color-mix(in srgb,var(--dsw-alias-state-warning-primary,var(--dsw-alias-label-tertiary)) 12%,transparent)',
- color: secondary,
- }),
- ]),
- e('banner', {
- display: 'flex',
- alignItems: 'flex-start',
- gap: '8px',
- border: `1px solid ${border}`,
- borderRadius: '8px',
- padding: '10px 12px',
- background: layer3,
- fontSize: '13px',
- lineHeight: '20px',
- }, [
- c('&[data-kind="ok"]', {
- borderColor: 'color-mix(in srgb,var(--dsw-alias-state-success-primary) 35%,transparent)',
- background: 'color-mix(in srgb,var(--dsw-alias-state-success-primary) 8%,transparent)',
- }),
- c('&[data-kind="error"]', {
- borderColor: 'color-mix(in srgb,var(--dsw-alias-state-error-primary) 35%,transparent)',
- background: 'color-mix(in srgb,var(--dsw-alias-state-error-primary) 8%,transparent)',
- }),
- c('&[data-kind="info"]', {
- borderColor: `color-mix(in srgb,${business} 35%,transparent)`,
- background: `color-mix(in srgb,${business} 8%,transparent)`,
- }),
- ]),
- e('banner-body', {
- flex: '1',
- minWidth: '0',
- display: 'flex',
- flexDirection: 'column',
- gap: '4px',
- }),
- e('banner-hint', {
- display: 'flex',
- alignItems: 'center',
- gap: '8px',
- flexWrap: 'wrap',
- color: secondary,
- fontSize: '12px',
- lineHeight: '18px',
- }),
- e('form', { display: 'flex', flexDirection: 'column', gap: '10px' }),
- e('editor-tabs', {
- display: 'flex',
- gap: '4px',
- borderBottom: `1px solid ${border}`,
- }),
- e('editor-tab', {
- position: 'relative',
- border: '0',
- padding: '7px 10px 9px',
- background: 'transparent',
- color: tertiary,
- font: 'inherit',
- fontSize: '13px',
- lineHeight: '20px',
- cursor: 'pointer',
- }, [
- c('&:hover, &[data-active="true"]', { color: primary }),
- c('&[data-active="true"]::after', {
- position: 'absolute',
- right: '8px',
- bottom: '-1px',
- left: '8px',
- height: '2px',
- borderRadius: '2px 2px 0 0',
- background: primary,
- content: '""',
- }),
- c('&:focus-visible', {
- outline: `2px solid ${business}`,
- outlineOffset: '-2px',
- borderRadius: '4px',
- color: primary,
- }),
- ]),
- e('label', {
- display: 'flex',
- flexDirection: 'column',
- gap: '4px',
- fontSize: '12px',
- lineHeight: '18px',
- color: secondary,
- }, [
- c('& > span:first-child', { color: tertiary }),
- ]),
- e('input', {
- width: '100%',
- boxSizing: 'border-box',
- border: `1px solid ${border}`,
- borderRadius: '8px',
- padding: '7px 10px',
- outline: 'none',
- background: layer1,
- color: primary,
- font: 'inherit',
- fontSize: '13px',
- }, [
- c('&:focus-visible', {
- borderColor: business,
- boxShadow: `0 0 0 2px color-mix(in srgb,${business} 18%,transparent)`,
- }),
- ]),
- e('textarea', {
- width: '100%',
- boxSizing: 'border-box',
- border: `1px solid ${border}`,
- borderRadius: '8px',
- padding: '7px 10px',
- outline: 'none',
- background: layer1,
- color: primary,
- font: 'inherit',
- fontSize: '13px',
- minHeight: '320px',
- resize: 'vertical',
- fontFamily: 'var(--ds-font-family-code)',
- lineHeight: '1.5',
- }, [
- c('&[data-short="true"]', { minHeight: '96px' }),
- c('&:focus-visible', {
- borderColor: business,
- boxShadow: `0 0 0 2px color-mix(in srgb,${business} 18%,transparent)`,
- }),
- ]),
- e('select', {
- width: '100%',
- boxSizing: 'border-box',
- border: `1px solid ${border}`,
- borderRadius: '8px',
- padding: '7px 10px',
- outline: 'none',
- background: layer1,
- color: primary,
- font: 'inherit',
- fontSize: '13px',
- }, [
- c('&:focus-visible', {
- borderColor: business,
- boxShadow: `0 0 0 2px color-mix(in srgb,${business} 18%,transparent)`,
- }),
- ]),
- e('search', {
- width: '200px',
- boxSizing: 'border-box',
- border: `1px solid ${border}`,
- borderRadius: '8px',
- padding: '4px 10px',
- outline: 'none',
- background: layer1,
- color: primary,
- font: 'inherit',
- fontSize: '12px',
- lineHeight: '18px',
- }, [
- c('&:focus-visible', {
- borderColor: business,
- boxShadow: `0 0 0 2px color-mix(in srgb,${business} 18%,transparent)`,
- }),
- ]),
- e('json-editor', { minHeight: '260px' }),
- e('checks', {
- display: 'flex',
- gap: '16px',
- fontSize: '13px',
- lineHeight: '20px',
- }, [
- c('& label', {
- display: 'inline-flex',
- alignItems: 'center',
- gap: '8px',
- cursor: 'pointer',
- minWidth: '0',
- }),
- ]),
- e('import-choice', {
- display: 'inline-flex',
- alignItems: 'center',
- gap: '8px',
- cursor: 'pointer',
- minWidth: '0',
- }, [
- m('disabled', { cursor: 'default' }),
- ]),
- e('form-error', {
- margin: '0',
- color: 'var(--dsw-alias-state-error-primary)',
- fontSize: '12px',
- lineHeight: '18px',
- }),
- // Modal className 需高于官方 Modal 内部宽度的特异性,保持双重类。
- c('.dshp-extension__modal-wide.dshp-extension__modal-wide', { width: 'min(680px,100%)' }),
- c('.dshp-extension__modal-form.dshp-extension__modal-form', { width: 'min(760px,100%)' }),
- c('.dshp-extension__modal-scroll.dshp-extension__modal-scroll', { maxHeight: 'calc(100vh - 160px)', overflowY: 'auto' }),
- e('md-preview', {
- minHeight: '320px',
- maxHeight: '60vh',
- overflowY: 'auto',
- border: `1px solid ${border}`,
- borderRadius: '8px',
- padding: '8px 12px',
- background: layer1,
- fontSize: '13px',
- }),
- e('md-body', [
- c('& h1, & h2, & h3, & h4', { margin: '14px 0 6px', color: primary, lineHeight: '1.4' }),
- c('& h1', { fontSize: '18px' }),
- c('& h2', { fontSize: '16px' }),
- c('& h3', { fontSize: '14px' }),
- c('& h4', { fontSize: '13px' }),
- c('& p', { margin: '6px 0', lineHeight: '20px' }),
- c('& ul, & ol', { margin: '6px 0', paddingLeft: '20px' }),
- c('& code', {
- fontFamily: 'var(--ds-font-family-code)',
- fontSize: '12px',
- background: layer3,
- borderRadius: '4px',
- padding: '1px 5px',
- }),
- c('& pre', {
- margin: '8px 0',
- padding: '10px 12px',
- overflowX: 'auto',
- border: `1px solid ${border}`,
- borderRadius: '8px',
- background: layer3,
- }),
- c('& a', { color: business }),
- ]),
- e('code', {
- fontFamily: 'var(--ds-font-family-code)',
- fontSize: '11px',
- lineHeight: '17px',
- whiteSpace: 'pre',
- margin: '8px 0',
- padding: '10px 12px',
- overflowX: 'auto',
- border: `1px solid ${border}`,
- borderRadius: '8px',
- background: layer3,
- }),
- e('import-scroll', {
- display: 'flex',
- flexDirection: 'column',
- gap: '14px',
- maxHeight: 'min(400px,52vh)',
- overflowY: 'auto',
- padding: '2px 4px 2px 2px',
- }),
- e('import-group', { display: 'flex', flexDirection: 'column', gap: '8px' }),
- e('import-head', { display: 'flex', alignItems: 'center', gap: '8px', padding: '0 2px' }),
- e('import-count', { fontSize: '12px', lineHeight: '18px', color: tertiary }),
- e('import-all', {
- marginLeft: 'auto',
- display: 'inline-flex',
- alignItems: 'center',
- gap: '6px',
- fontSize: '12px',
- color: secondary,
- cursor: 'pointer',
- }),
- e('chips', {
- display: 'flex',
- alignItems: 'center',
- gap: '6px',
- flexWrap: 'wrap',
- }),
- e('chip', {
- border: `1px solid ${border}`,
- borderRadius: '999px',
- padding: '2px 10px',
- background: 'transparent',
- color: secondary,
- font: 'inherit',
- fontSize: '12px',
- cursor: 'pointer',
- }, [
- c('&:hover, &[data-active="true"]', { color: business, background: hover }),
- ]),
- e('switch', {
- position: 'relative',
- flex: 'none',
- width: '30px',
- height: '18px',
- border: '0',
- borderRadius: '999px',
- background: layer1,
- boxShadow: `inset 0 0 0 1px ${border}`,
- cursor: 'pointer',
- }, [
- c('&[aria-checked="true"]', {
- background: `color-mix(in srgb,${business} 55%,transparent)`,
- boxShadow: 'none',
- }),
- c('&[aria-checked="true"] .dshp-extension__switch-knob', { left: '14px', background: '#fff' }),
- ]),
- e('switch-knob', {
- position: 'absolute',
- top: '2px',
- left: '2px',
- width: '14px',
- height: '14px',
- borderRadius: '50%',
- background: primary,
- transition: 'left .15s',
- }),
- e('link', {
- border: '0',
- padding: '0',
- background: 'transparent',
- font: 'inherit',
- fontSize: '12px',
- lineHeight: '18px',
- cursor: 'pointer',
- textDecoration: 'none',
- color: business,
- }, [
- c('&:hover', { textDecoration: 'underline' }),
- ]),
- e('segments', {
- display: 'inline-flex',
- gap: '4px',
- border: `1px solid ${border}`,
- borderRadius: '8px',
- padding: '3px',
- background: layer1,
- }),
- e('segment', {
- border: '0',
- borderRadius: '6px',
- padding: '4px 14px',
- background: 'transparent',
- color: secondary,
- font: 'inherit',
- fontSize: '12px',
- cursor: 'pointer',
- }, [
- c('&[data-active="true"]', { background: hover, color: primary, fontWeight: '600' }),
- ]),
- e('format', {
- border: `1px solid ${border}`,
- borderRadius: '8px',
- padding: '8px 12px',
- background: layer1,
- }, [
- c('& summary', { fontSize: '12px', color: secondary, cursor: 'pointer' }),
- ]),
- e('format-hint', { margin: '2px 0 0', fontSize: '12px', color: tertiary }),
- c('@media (max-width: 680px)', [
- c('.dshp-extension__cards', { gridTemplateColumns: 'minmax(0,1fr)' }),
- c('.dshp-extension__search', { width: '140px' }),
- ]),
-])
diff --git a/packages/dsh-tauri-panel-extension/src/client/styles/index.cssr.ts b/packages/dsh-tauri-panel-extension/src/client/styles/index.cssr.ts
new file mode 100644
index 00000000..8ae21206
--- /dev/null
+++ b/packages/dsh-tauri-panel-extension/src/client/styles/index.cssr.ts
@@ -0,0 +1,113 @@
+import { cssr, styles as sharedStyles } from 'dsh-tauri-ui/client'
+
+const { c, bem: { b, e, m } } = cssr
+const { primary, secondary, tertiary, borderL2: border, business, layer1, layer3, hover } = sharedStyles
+
+/** 跨组件通用:卡片列表 / 标签 / 空态文案 / 代码块(技能与 MCP 页共享)。 */
+export default b('extension', [
+ e('intro', { margin: '0', fontSize: '13px', lineHeight: '20px', color: tertiary }),
+ e('empty', { margin: '0', fontSize: '13px', lineHeight: '20px', color: tertiary }),
+ e('spacer', { flex: '1' }),
+ e('search', {
+ width: '200px',
+ boxSizing: 'border-box',
+ border: `1px solid ${border}`,
+ borderRadius: '8px',
+ padding: '4px 10px',
+ outline: 'none',
+ background: layer1,
+ color: primary,
+ font: 'inherit',
+ fontSize: '12px',
+ lineHeight: '18px',
+ }, [
+ c('&:focus-visible', {
+ borderColor: business,
+ boxShadow: `0 0 0 2px color-mix(in srgb,${business} 18%,transparent)`,
+ }),
+ ]),
+ e('cards', {
+ display: 'grid',
+ gridTemplateColumns: 'repeat(2,minmax(0,1fr))',
+ alignItems: 'stretch',
+ gap: '10px',
+ margin: '0',
+ padding: '0',
+ listStyle: 'none',
+ }, [
+ m('single', { gridTemplateColumns: 'minmax(0,1fr)' }),
+ ]),
+ e('card', {
+ display: 'flex',
+ flexDirection: 'column',
+ gap: '8px',
+ minWidth: '0',
+ border: `1px solid ${border}`,
+ borderRadius: '10px',
+ background: layer3,
+ padding: '12px 14px',
+ }, [
+ c('&:hover', { background: hover }),
+ m('muted', { opacity: '.55' }),
+ ]),
+ e('card-top', { display: 'flex', alignItems: 'center', gap: '6px', flexWrap: 'wrap' }),
+ e('card-row', { display: 'flex', alignItems: 'center', gap: '6px', flexWrap: 'wrap' }),
+ e('card-title', {
+ flex: '1',
+ minWidth: '0',
+ overflow: 'hidden',
+ textOverflow: 'ellipsis',
+ whiteSpace: 'nowrap',
+ fontSize: '14px',
+ lineHeight: '20px',
+ fontWeight: '600',
+ fontFamily: 'var(--ds-font-family-code)',
+ }),
+ e('card-desc', {
+ margin: '0',
+ fontSize: '12px',
+ lineHeight: '18px',
+ color: secondary,
+ display: '-webkit-box',
+ WebkitLineClamp: '2',
+ WebkitBoxOrient: 'vertical',
+ overflow: 'hidden',
+ }),
+ e('tag', {
+ display: 'inline-flex',
+ alignItems: 'center',
+ minHeight: '20px',
+ borderRadius: '5px',
+ padding: '1px 6px',
+ background: layer1,
+ color: secondary,
+ fontSize: '11px',
+ lineHeight: '16px',
+ whiteSpace: 'nowrap',
+ }, [
+ c('&[data-kind="source"]', {
+ background: `color-mix(in srgb,${business} 10%,transparent)`,
+ color: business,
+ }),
+ c('&[data-kind="off"]', {
+ background: 'color-mix(in srgb,var(--dsw-alias-state-warning-primary,var(--dsw-alias-label-tertiary)) 12%,transparent)',
+ color: secondary,
+ }),
+ ]),
+ e('code', {
+ fontFamily: 'var(--ds-font-family-code)',
+ fontSize: '11px',
+ lineHeight: '17px',
+ whiteSpace: 'pre',
+ margin: '8px 0',
+ padding: '10px 12px',
+ overflowX: 'auto',
+ border: `1px solid ${border}`,
+ borderRadius: '8px',
+ background: layer3,
+ }),
+ c('@media (max-width: 680px)', [
+ c('.dshp-extension__cards', { gridTemplateColumns: 'minmax(0,1fr)' }),
+ c('.dshp-extension__search', { width: '140px' }),
+ ]),
+])