dsh-design-studio 0.21.0 → 0.23.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/README.en.md +1 -0
- package/README.md +1 -0
- package/lib/browser.js +6 -6
- package/lib/canvthumb.js +1 -1
- package/lib/client.js +67 -100
- package/lib/core.js +3 -1
- package/lib/gallery/policy.js +2 -2
- package/lib/handoff.js +12 -15
- package/lib/index.js +4 -4
- package/lib/kinds.js +11 -0
- package/lib/look.js +22 -9
- package/lib/picker.js +58 -3
- package/lib/styles.js +1 -0
- package/lib/system.js +0 -1
- package/package.json +1 -1
- package/skills/ui-design/SKILL.md +2 -1
- package/skills/ui-design/frames/dsh/dsh-shell.css +132 -0
- package/skills/ui-design/frames/dsh/frame.json +59 -0
- package/skills/ui-design/frames/dsh/panel.html +51 -0
- package/skills/ui-design/frames/dsh/settings.html +57 -0
- package/skills/ui-design/frames/dsh/sidebar.html +36 -0
- package/skills/ui-design/frames/dsh/view.html +40 -0
- package/skills/ui-design/references/dshplugin.md +66 -0
package/lib/core.js
CHANGED
|
@@ -35,7 +35,8 @@ const MAX_SCREENS = 60 // 右侧最多显示几屏,再多的收起来并提示
|
|
|
35
35
|
const MAX_ROUTES = 300 // 开发服务器的路由先都记着(只为算出收起了几屏);再多就是写飞了
|
|
36
36
|
|
|
37
37
|
// 设计类型:决定右侧用什么画幅显示(网页框、手机、小程序、平板、桌面软件窗口、海报、幻灯片、邮件、图表)
|
|
38
|
-
|
|
38
|
+
import { KINDS } from './kinds.js'
|
|
39
|
+
export { KINDS }
|
|
39
40
|
const KIND_ALIAS = {
|
|
40
41
|
website: 'web', site: 'web', page: 'web', landing: 'web', dashboard: 'web',
|
|
41
42
|
phone: 'app', mobile: 'app', ios: 'app', android: 'app',
|
|
@@ -46,6 +47,7 @@ const KIND_ALIAS = {
|
|
|
46
47
|
slide: 'slides', deck: 'slides', ppt: 'slides', presentation: 'slides',
|
|
47
48
|
mail: 'email', newsletter: 'email', edm: 'email',
|
|
48
49
|
mindmap: 'diagram', 'mind-map': 'diagram', roadmap: 'diagram', architecture: 'diagram', arch: 'diagram', flowchart: 'diagram', 思维导图: 'diagram', 导图: 'diagram', 脑图: 'diagram', 路线图: 'diagram', 技术路线图: 'diagram', 架构图: 'diagram', 图表: 'diagram',
|
|
50
|
+
dsh: 'dshplugin', 'dsh-plugin': 'dshplugin', dshplug: 'dshplugin', harness: 'dshplugin', dsh插件: 'dshplugin', 'dsh 插件': 'dshplugin',
|
|
49
51
|
}
|
|
50
52
|
|
|
51
53
|
/** 类型名(含常见别名)→ KINDS 里的一个;认不出返回 '' */
|
package/lib/gallery/policy.js
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
import crypto from 'node:crypto'
|
|
14
14
|
import { tokenize, scanTags, decodeEntities, lineAt, visibleText, rawEnd } from './html.js'
|
|
15
15
|
import { scanCss, cssTokens, URL_FUNCS } from './css.js'
|
|
16
|
+
import { KINDS, META_ALIAS } from '../kinds.js'
|
|
16
17
|
|
|
17
18
|
export const FORMAT = 1
|
|
18
19
|
export const LIMITS = {
|
|
@@ -38,10 +39,9 @@ export const capsOf = (mode) => (mode === 'share' || mode === 'ci'
|
|
|
38
39
|
: { files: LIMITS.localFiles, screens: LIMITS.localScreens, total: LIMITS.localTotal })
|
|
39
40
|
export const TYPES = ['template', 'system', 'style']
|
|
40
41
|
export const LICENSES = ['CC0-1.0', 'CC-BY-4.0']
|
|
41
|
-
export
|
|
42
|
+
export { KINDS }
|
|
42
43
|
export const STYLE_IDS = ['minimal', 'warm', 'editorial', 'dark', 'playful', 'fresh', 'tech', 'glass', 'soft', 'guochao', 'ink', 'cyber', 'cute', 'retro', 'sale', 'japandi', 'swiss', 'brutal', 'cream', 'sport']
|
|
43
44
|
export const HEADS = ['SANS', 'SERIF', 'ROUND', 'MONO', 'GROTESK'] // 风格卡的字体只能是这几种系统字体栈
|
|
44
|
-
const META_ALIAS = { phone: 'app', mobile: 'app', ios: 'app', android: 'app', mini: 'miniprogram', miniapp: 'miniprogram', weapp: 'miniprogram', wechat: 'miniprogram', 小程序: 'miniprogram', pad: 'tablet', ipad: 'tablet', pc: 'desktop', electron: 'desktop', tauri: 'desktop', mac: 'desktop', macos: 'desktop', windows: 'desktop', win: 'desktop', 桌面: 'desktop', 桌面软件: 'desktop', social: 'poster', image: 'poster', slide: 'slides', deck: 'slides', ppt: 'slides', mail: 'email', mindmap: 'diagram', roadmap: 'diagram', architecture: 'diagram', flowchart: 'diagram', 思维导图: 'diagram', 导图: 'diagram', 路线图: 'diagram', 架构图: 'diagram', 图表: 'diagram' }
|
|
45
45
|
|
|
46
46
|
const EXT = { html: 'html', css: 'css', svg: 'svg', png: 'image', jpg: 'image', jpeg: 'image', webp: 'image', gif: 'image', avif: 'image', json: 'json', md: 'md' }
|
|
47
47
|
const DATA_IMAGE = /^data:image\/(png|jpe?g|webp|gif|avif)(;[a-z0-9=._-]+)*(;base64)?,/i
|
package/lib/handoff.js
CHANGED
|
@@ -677,7 +677,7 @@ export function localOnly(u) {
|
|
|
677
677
|
|
|
678
678
|
/* eslint-disable no-undef */
|
|
679
679
|
/** 在空白页里比两张无损截图:逐像素,每个点三个通道差加起来超过 24 就算不一样 → 差异比例、差得多的几块、拼图 */
|
|
680
|
-
async function diffIn(a, b, labels) {
|
|
680
|
+
export async function diffIn(a, b, labels) {
|
|
681
681
|
const load = (src) => new Promise((res, rej) => { const i = new Image(); i.onload = () => res(i); i.onerror = () => rej(new Error('图片载不出来')); i.src = 'data:image/png;base64,' + src })
|
|
682
682
|
const [A, B] = await Promise.all([load(a), load(b)])
|
|
683
683
|
const w = A.width, h = A.height
|
|
@@ -693,19 +693,21 @@ async function diffIn(a, b, labels) {
|
|
|
693
693
|
const CELL = 16
|
|
694
694
|
const cw = Math.ceil(w / CELL), ch = Math.ceil(h / CELL)
|
|
695
695
|
const cells = new Float32Array(cw * ch)
|
|
696
|
-
|
|
696
|
+
// 差异照样逐点算(1px 的线也不能漏);热力图大图按 st×st 一格画(#21:省掉一张全尺寸的图),格子里有一点不一样就标红
|
|
697
|
+
const st = Math.max(1, Math.round(Math.sqrt((w * h) / 1e6)))
|
|
698
|
+
const hw = Math.ceil(w / st), hh = Math.ceil(h / st)
|
|
699
|
+
const heat = g.createImageData(hw, hh)
|
|
697
700
|
let bad = 0
|
|
698
701
|
for (let y = 0; y < h; y++) {
|
|
702
|
+
const hy = (y / st) | 0
|
|
699
703
|
for (let x = 0; x < w; x++) {
|
|
700
|
-
const i = (y * w + x) * 4
|
|
704
|
+
const i = (y * w + x) * 4, j = (hy * hw + ((x / st) | 0)) * 4
|
|
701
705
|
const d = Math.abs(da[i] - db[i]) + Math.abs(da[i + 1] - db[i + 1]) + Math.abs(da[i + 2] - db[i + 2])
|
|
702
706
|
const hit = d > 24
|
|
703
707
|
const l = (da[i] * 0.3 + da[i + 1] * 0.59 + da[i + 2] * 0.11) * 0.3 + 175
|
|
704
708
|
if (hit) { bad++; cells[((y / CELL) | 0) * cw + ((x / CELL) | 0)]++ }
|
|
705
|
-
heat.data[
|
|
706
|
-
heat.data[
|
|
707
|
-
heat.data[i + 2] = hit ? 48 : l
|
|
708
|
-
heat.data[i + 3] = 255
|
|
709
|
+
if (hit) { heat.data[j] = 232; heat.data[j + 1] = 56; heat.data[j + 2] = 48; heat.data[j + 3] = 255 }
|
|
710
|
+
else if (y % st === 0 && x % st === 0 && !heat.data[j + 3]) { heat.data[j] = l; heat.data[j + 1] = l; heat.data[j + 2] = l; heat.data[j + 3] = 255 }
|
|
709
711
|
}
|
|
710
712
|
}
|
|
711
713
|
// 差得多的格子连成块,按差的像素数排
|
|
@@ -743,8 +745,8 @@ async function diffIn(a, b, labels) {
|
|
|
743
745
|
o.fillStyle = '#eef0f3'
|
|
744
746
|
o.fillRect(0, 0, w * 3 + PAD * 4, h + HEAD + PAD)
|
|
745
747
|
const hc = document.createElement('canvas')
|
|
746
|
-
hc.width =
|
|
747
|
-
hc.height =
|
|
748
|
+
hc.width = hw
|
|
749
|
+
hc.height = hh
|
|
748
750
|
hc.getContext('2d').putImageData(heat, 0, 0)
|
|
749
751
|
const pct = (bad / (w * h)) * 100
|
|
750
752
|
;[[A, labels[0]], [B, labels[1]], [hc, labels[2].replace('{pct}', pct.toFixed(1))]].forEach(([img, label], k) => {
|
|
@@ -752,7 +754,7 @@ async function diffIn(a, b, labels) {
|
|
|
752
754
|
o.fillStyle = '#1f2329'
|
|
753
755
|
o.font = '600 22px -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif'
|
|
754
756
|
o.fillText(label, x, 30)
|
|
755
|
-
o.drawImage(img, x, HEAD)
|
|
757
|
+
o.drawImage(img, x, HEAD, w, h) // 热力图是取样大小、做出来的截图可能不一样大:都画成设计稿那么大
|
|
756
758
|
o.strokeStyle = 'rgba(0,0,0,.12)'
|
|
757
759
|
o.lineWidth = 1
|
|
758
760
|
o.strokeRect(x - 0.5, HEAD - 0.5, w + 1, h + 1)
|
|
@@ -848,8 +850,3 @@ export async function compareScreens(browser, { design, impl, size, at = 'top',
|
|
|
848
850
|
} else lines.push('没有成片的差异。')
|
|
849
851
|
return { pct: r.pct, boxes, jpg: Buffer.from(r.jpg, 'base64'), text: lines.join('\n') }
|
|
850
852
|
}
|
|
851
|
-
|
|
852
|
-
/** 设计目录里的几屏(交接、对比时按文件名找) */
|
|
853
|
-
export function screensOf(root) {
|
|
854
|
-
return allScreens(root)
|
|
855
|
-
}
|
package/lib/index.js
CHANGED
|
@@ -99,7 +99,7 @@ export const studio = { tracker: null, autoOpen: 0, offline: 0, annotations: 0,
|
|
|
99
99
|
export const designSkill = {
|
|
100
100
|
name: 'ui-design',
|
|
101
101
|
description:
|
|
102
|
-
'做网页、App 界面、小程序、平板界面、桌面软件、海报 /
|
|
102
|
+
'做网页、App 界面、小程序、平板界面、桌面软件、海报 / 社媒图、幻灯片、邮件、图表(思维导图、技术路线图、产品路线图、架构图)、DSH 插件界面、组件这类设计之前先加载:' +
|
|
103
103
|
'配合右侧「设计工作台」画布的做法(一屏一个文件、设计变量、类型标记)、现代设计原则、中文排版、各类型画幅要点、避免 AI 味、设计自查清单。' +
|
|
104
104
|
'只是把回答做成一页给用户看或用(对比、表格、清单、数据图表、计算器这类,或者在对话里随手看一张导图)不算设计:有 show_page 工具就直接用它,不加载这个技能;' +
|
|
105
105
|
'要「设计」、做好看的、要导出成图片 / PDF / PPT 的思维导图、路线图、架构图才用这个技能。',
|
|
@@ -130,7 +130,7 @@ export const previewTool = {
|
|
|
130
130
|
name: 'preview_page',
|
|
131
131
|
description:
|
|
132
132
|
'在右侧栏「设计工作台」里实时打开一个页面,用户能边看边点选要改的地方。' +
|
|
133
|
-
'做网页、App
|
|
133
|
+
'做网页、App 界面、小程序、海报、幻灯片、邮件、图表(思维导图、路线图、架构图)、DSH 插件界面这类设计时用:写好第一个 HTML 文件、或启动开发服务器后调一次就行,之后改文件会自动刷新,不用再调。' +
|
|
134
134
|
'只是把回答做成一页(对比、表格、清单、数据图表、计算器)给用户看或用时,有 show_page 工具就用它,不用这里。' +
|
|
135
135
|
'本地 HTML 写文件路径;开发服务器写地址或端口(如 http://localhost:5173)。只能预览本机页面。' +
|
|
136
136
|
'kind 说明是哪类设计,右侧按它的画幅显示(App 套手机外框、幻灯片 16:9 …)。' +
|
|
@@ -143,7 +143,7 @@ export const previewTool = {
|
|
|
143
143
|
kind: {
|
|
144
144
|
type: 'string',
|
|
145
145
|
enum: KINDS,
|
|
146
|
-
description: '设计类型:web 网页(默认)、app 手机 App 界面(390×844)、miniprogram 微信小程序(375×812,外框带右上角胶囊)、tablet 平板、desktop 桌面软件(1280×800 的 Mac 窗口;Windows 软件在页面 meta 写 desktop windows)、poster 海报 / 社媒图(1080×1350)、slides 幻灯片(16:9)、email 邮件、diagram 图表(思维导图、技术路线图、产品路线图、架构图,默认 1600×1000
|
|
146
|
+
description: '设计类型:web 网页(默认)、app 手机 App 界面(390×844)、miniprogram 微信小程序(375×812,外框带右上角胶囊)、tablet 平板、desktop 桌面软件(1280×800 的 Mac 窗口;Windows 软件在页面 meta 写 desktop windows)、poster 海报 / 社媒图(1080×1350)、slides 幻灯片(16:9)、email 邮件、diagram 图表(思维导图、技术路线图、产品路线图、架构图,默认 1600×1000,图多大画幅跟着多大)、dshplugin DSH 插件(1280×800,套 DSH 桌面端外框,只设计插件那块:左侧栏入口 / 设置分区 / 会话标签页 / 右侧栏面板)',
|
|
147
147
|
},
|
|
148
148
|
size: { type: 'string', description: '画幅尺寸,可选,如 1080x1920;不填按类型的默认尺寸' },
|
|
149
149
|
screens: {
|
|
@@ -612,7 +612,7 @@ export const styleTool = {
|
|
|
612
612
|
'用户点了风格卡(消息里有〔风格〕)、自己定了具体的风格或配色、或有默认的品牌设计系统时不用调;只说「你定」「帮我推荐一个」「出几个风格挑」算没定,要调。',
|
|
613
613
|
parameters: specToJsonSchema({
|
|
614
614
|
subject: { type: 'string', required: true, description: '这次要做什么,直接写用户的原话' },
|
|
615
|
-
kind: { type: 'string', enum:
|
|
615
|
+
kind: { type: 'string', enum: KINDS, description: '设计类型' },
|
|
616
616
|
count: { type: 'number', description: '要几个方向,1–3,默认 1;要先出三个方向时填 3,每个方向一张不同的卡' },
|
|
617
617
|
}),
|
|
618
618
|
output: {
|
package/lib/kinds.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// 设计类型的唯一一份表(服务端用):加新类型改这里,core / look / gallery/policy 都从这里取。
|
|
2
|
+
// client.js 是单独打包进页面的,有自己的一份,靠 test-client 里的对照测试看住。
|
|
3
|
+
|
|
4
|
+
/** 设计类型和默认画幅(宽, 高) */
|
|
5
|
+
export const KIND_SIZE = { web: [1280, 800], app: [390, 844], miniprogram: [375, 812], tablet: [820, 1180], desktop: [1280, 800], poster: [1080, 1350], slides: [1280, 720], email: [640, 960], diagram: [1600, 1000], dshplugin: [1280, 800] }
|
|
6
|
+
|
|
7
|
+
/** 全部类型(顺序 = 界面里列出的顺序) */
|
|
8
|
+
export const KINDS = Object.keys(KIND_SIZE)
|
|
9
|
+
|
|
10
|
+
/** 页面 <meta name="dsh-design"> 里认的类型别名(比 core 的 parseKind 少,故意不合并) */
|
|
11
|
+
export const META_ALIAS = { phone: 'app', mobile: 'app', ios: 'app', android: 'app', mini: 'miniprogram', miniapp: 'miniprogram', weapp: 'miniprogram', wechat: 'miniprogram', 小程序: 'miniprogram', pad: 'tablet', ipad: 'tablet', pc: 'desktop', electron: 'desktop', tauri: 'desktop', mac: 'desktop', macos: 'desktop', windows: 'desktop', win: 'desktop', 桌面: 'desktop', 桌面软件: 'desktop', social: 'poster', image: 'poster', slide: 'slides', deck: 'slides', ppt: 'slides', mail: 'email', mindmap: 'diagram', roadmap: 'diagram', architecture: 'diagram', flowchart: 'diagram', 思维导图: 'diagram', 导图: 'diagram', 路线图: 'diagram', 架构图: 'diagram', 图表: 'diagram', dsh: 'dshplugin', 'dsh-plugin': 'dshplugin', dsh插件: 'dshplugin' }
|
package/lib/look.js
CHANGED
|
@@ -8,10 +8,20 @@
|
|
|
8
8
|
|
|
9
9
|
import fs from 'node:fs'
|
|
10
10
|
import path from 'node:path'
|
|
11
|
+
import { KIND_SIZE, KINDS as KIND_LIST, META_ALIAS } from './kinds.js'
|
|
12
|
+
export { KIND_SIZE }
|
|
13
|
+
|
|
14
|
+
// 体检一次最多几个页面任务一起跑(#21:12 屏 × 4 尺寸一下全铺开会挤满事件循环;浏览器那边本来也只开 3 个页面)
|
|
15
|
+
const LOOK_PAR = 4
|
|
16
|
+
/** 最多 n 个一起跑,结果按原来的顺序 */
|
|
17
|
+
async function mapLimit(list, n, fn) {
|
|
18
|
+
const out = new Array(list.length)
|
|
19
|
+
let next = 0
|
|
20
|
+
const run = async () => { while (next < list.length) { const i = next++; out[i] = await fn(list[i], i) } }
|
|
21
|
+
await Promise.all(Array.from({ length: Math.min(n, list.length) }, run))
|
|
22
|
+
return out
|
|
23
|
+
}
|
|
11
24
|
|
|
12
|
-
export const KIND_SIZE = { web: [1280, 800], app: [390, 844], miniprogram: [375, 812], tablet: [820, 1180], desktop: [1280, 800], poster: [1080, 1350], slides: [1280, 720], email: [640, 960], diagram: [1600, 1000] }
|
|
13
|
-
const KIND_LIST = Object.keys(KIND_SIZE)
|
|
14
|
-
const META_ALIAS = { phone: 'app', mobile: 'app', ios: 'app', android: 'app', mini: 'miniprogram', miniapp: 'miniprogram', weapp: 'miniprogram', wechat: 'miniprogram', 小程序: 'miniprogram', pad: 'tablet', ipad: 'tablet', pc: 'desktop', electron: 'desktop', tauri: 'desktop', mac: 'desktop', macos: 'desktop', windows: 'desktop', win: 'desktop', 桌面: 'desktop', 桌面软件: 'desktop', social: 'poster', image: 'poster', slide: 'slides', deck: 'slides', ppt: 'slides', mail: 'email', mindmap: 'diagram', roadmap: 'diagram', architecture: 'diagram', flowchart: 'diagram', 思维导图: 'diagram', 导图: 'diagram', 路线图: 'diagram', 架构图: 'diagram', 图表: 'diagram' }
|
|
15
25
|
// 只给宽度时的高:常见真机的屏幕高;别的宽度按这一类默认的宽高比
|
|
16
26
|
const PHONE_H = { 320: 568, 360: 780, 375: 667, 390: 844, 393: 852, 402: 874, 412: 915, 414: 896, 428: 926, 430: 932, 440: 956 }
|
|
17
27
|
const TABLET_H = { 744: 1133, 768: 1024, 810: 1080, 820: 1180, 834: 1194, 1024: 1366, 1032: 1376 }
|
|
@@ -135,7 +145,7 @@ export async function prepare(page, dark) {
|
|
|
135
145
|
/** 没写尺寸的幻灯片 / 海报:开页面量一下,比默认画幅大就按页面实际大小(和右侧栏的画幅一样)。量不到就还是默认 */
|
|
136
146
|
export async function fitSize(browser, screens, kind, size) {
|
|
137
147
|
const [w, h] = size
|
|
138
|
-
const seen = await
|
|
148
|
+
const seen = await mapLimit(screens, LOOK_PAR, (sc) => browser.withPage({ url: sc.url, w, h }, async (page) => (await prepare(page, false)).info.natural).catch(() => null))
|
|
139
149
|
return sizeOf(autoSize(seen, kind), kind) || size
|
|
140
150
|
}
|
|
141
151
|
|
|
@@ -163,7 +173,7 @@ export async function measureAll(browser, { screens, sizes, kind, dark, fetcher
|
|
|
163
173
|
}
|
|
164
174
|
return gone.get(url)
|
|
165
175
|
}
|
|
166
|
-
const rows = await
|
|
176
|
+
const rows = await mapLimit(jobs, LOOK_PAR, async ({ sc, w, h }, i) => {
|
|
167
177
|
const row = { key: sc.key, label: sc.label || sc.key, w, h, issues: [], metrics: null, error: '' }
|
|
168
178
|
try {
|
|
169
179
|
await browser.withPage({ url: sc.url, w, h, dark }, async (page) => {
|
|
@@ -193,7 +203,7 @@ export async function measureAll(browser, { screens, sizes, kind, dark, fetcher
|
|
|
193
203
|
row.error = String((e && e.message) || e).slice(0, 160)
|
|
194
204
|
}
|
|
195
205
|
return row
|
|
196
|
-
})
|
|
206
|
+
})
|
|
197
207
|
// 规则 → 文件和行号(一次问完)
|
|
198
208
|
if (locate) {
|
|
199
209
|
const withRule = rows.flatMap((r) => r.issues.filter((it) => it.rule && it.rule.sel))
|
|
@@ -232,7 +242,7 @@ export async function shootAll(browser, { screens, size, at, selector, dark, kin
|
|
|
232
242
|
const scale = scaleFor(w, h)
|
|
233
243
|
const out = []
|
|
234
244
|
const perScreen = at === 'full' ? Math.max(1, Math.floor(max / Math.max(1, screens.length))) : 1
|
|
235
|
-
await
|
|
245
|
+
await mapLimit(screens, LOOK_PAR, async (sc, si) => {
|
|
236
246
|
const shots = []
|
|
237
247
|
const base = { key: sc.key, label: sc.label || sc.key, w, h }
|
|
238
248
|
try {
|
|
@@ -282,7 +292,7 @@ export async function shootAll(browser, { screens, size, at, selector, dark, kin
|
|
|
282
292
|
shots.push({ ...base, at, error: String((e && e.message) || e).slice(0, 160) })
|
|
283
293
|
}
|
|
284
294
|
out[si] = shots
|
|
285
|
-
})
|
|
295
|
+
})
|
|
286
296
|
return out.flat().filter(Boolean)
|
|
287
297
|
}
|
|
288
298
|
|
|
@@ -403,7 +413,7 @@ const TYPE = {
|
|
|
403
413
|
tiny: '字太小', img: '图片没加载出来', fonts: '字号太杂', distort: '图片被拉变形', long: '一行太长', wrap: '文字被挤断行',
|
|
404
414
|
covered: '被固定栏压住', tight: '离固定栏太近', jserr: '页面脚本报错', missing: '文件没载出来', deadlink: '跳到的页面不存在',
|
|
405
415
|
capsule: '被小程序胶囊挡住', island: '被灵动岛挡住', homebar: '伸进底部横条区', tabbar: '标签栏项太多', navbar: '没有导航栏',
|
|
406
|
-
winctl: '被窗口按钮挡住', dgsize: '图比画幅大', dgli: '导图节点写法不对', dgmany: '一层放太多', dgbar: '横条超出时间轴', dgtext: '节点字太多', dgsmall: '字偏小', dglink: '箭头没对着模块',
|
|
416
|
+
winctl: '被窗口按钮挡住', dgsize: '图比画幅大', dgli: '导图节点写法不对', dgmany: '一层放太多', dgbar: '横条超出时间轴', dgtext: '节点字太多', dgsmall: '字偏小', dglink: '箭头没对着模块', frame: '外框被改动',
|
|
407
417
|
}
|
|
408
418
|
const EDGE = { top: '顶栏', bottom: '底栏' }
|
|
409
419
|
const WHAT = { css: '样式表', script: '脚本', font: '字体', link: '文件', video: '视频', audio: '音频', source: '媒体', iframe: '内嵌页' }
|
|
@@ -455,6 +465,9 @@ export function detailOf(it) {
|
|
|
455
465
|
: `伸进左上角红绿灯 ${it.px}px(外框画的、盖在页面上面,在 x 20–72、y 20–32:工具栏 / 侧栏顶上左边空出 80px,标题、按钮从 x 80 以后放)`
|
|
456
466
|
case 'jserr': return `${it.msg}${it.src ? `(${it.src}${it.line ? `:${it.line}` : ''})` : ''}`
|
|
457
467
|
case 'missing': return `${WHAT[it.what] || '文件'} ${it.src} 载不出来(路径写错了,或者文件不在)`
|
|
468
|
+
case 'frame': return it.what === 'style'
|
|
469
|
+
? `外框的样式被改了:${it.sel} 的 ${it.prop} 应该是 ${it.want},现在是 ${it.got}。多半是插件样式写了 body / * / button 这种不带前缀的选择器,或者改了 dsh-shell.css:插件样式都从 [data-slot="main"] 开头,dsh-shell.css 从技能目录 frames/dsh/ 重新原样复制`
|
|
470
|
+
: `外框(${it.frame})的结构或文字被改了:外框只能原样复制(技能目录 frames/dsh/),插件只写 data-slot 里面。重新复制外框,再把槽位里的内容放回去`
|
|
458
471
|
case 'dgsize': return `图有 ${it.w}×${it.h},画幅只有 ${it.vw}×${it.vh}:把 meta 改成 diagram ${it.w}x${it.h}(preview_page 的 size 也改),或者删减节点、改小间距`
|
|
459
472
|
case 'dgli': return '字直接写在 li 里,或者 li 的第一个孩子不是 <span class="mm-node">:连线会对不上,改成 <li><span class="mm-node">…</span><ul>…</ul></li>'
|
|
460
473
|
case 'dgmany': return it.what === 'box' ? `一行 ${it.n} 个框(最多 ${it.max} 个):拆成两行,或者合并几个` : `这一层 ${it.n} 个分支(最多 ${it.max} 个):合并几个、往下多分一层,或者拆成两张图`
|
package/lib/picker.js
CHANGED
|
@@ -3245,7 +3245,7 @@ background:rgba(20,20,22,.86);color:#e8e8ea;font:12px/18px -apple-system,system-
|
|
|
3245
3245
|
const all = body.getElementsByTagName('*')
|
|
3246
3246
|
for (let i = 0; i < all.length && atoms.length < CHECK_ATOMS; i++) {
|
|
3247
3247
|
const el = all[i]
|
|
3248
|
-
if (isOurs(el) || el.closest('dsh-design-picker,dsh-design-fx,dsh-design-edit,script,style,noscript,template,svg')) continue
|
|
3248
|
+
if (isOurs(el) || el.closest('dsh-design-picker,dsh-design-fx,dsh-design-edit,script,style,noscript,template,svg') || inFrame(el)) continue
|
|
3249
3249
|
if (!ownText(el)) continue
|
|
3250
3250
|
const cs = getComputedStyle(el)
|
|
3251
3251
|
if (cs.display === 'none' || cs.visibility !== 'visible') continue
|
|
@@ -3377,11 +3377,11 @@ background:rgba(20,20,22,.86);color:#e8e8ea;font:12px/18px -apple-system,system-
|
|
|
3377
3377
|
} })
|
|
3378
3378
|
|
|
3379
3379
|
// 5. 点击区太小(App / 小程序 / 平板 44,网页 24;文字中间的链接不算)
|
|
3380
|
-
const minTap = kind === 'app' || kind === 'miniprogram' || kind === 'tablet' ? 44 : kind === 'web' || kind === 'email' || kind === 'desktop' ? 24 : 0
|
|
3380
|
+
const minTap = kind === 'app' || kind === 'miniprogram' || kind === 'tablet' ? 44 : kind === 'web' || kind === 'email' || kind === 'desktop' || kind === 'dshplugin' ? 24 : 0
|
|
3381
3381
|
if (minTap) {
|
|
3382
3382
|
const small = []
|
|
3383
3383
|
for (const el of body.querySelectorAll(CLICKABLE)) {
|
|
3384
|
-
if (isOurs(el) || el.closest('dsh-design-picker,dsh-design-fx,dsh-design-edit')) continue
|
|
3384
|
+
if (isOurs(el) || el.closest('dsh-design-picker,dsh-design-fx,dsh-design-edit') || inFrame(el)) continue
|
|
3385
3385
|
const r = el.getBoundingClientRect()
|
|
3386
3386
|
if (r.width < 1 || r.height < 1 || (r.width >= minTap && r.height >= minTap)) continue
|
|
3387
3387
|
const cs = getComputedStyle(el)
|
|
@@ -3478,6 +3478,8 @@ background:rgba(20,20,22,.86);color:#e8e8ea;font:12px/18px -apple-system,system-
|
|
|
3478
3478
|
// 16. 图表:比画幅大、导图节点写法、一层太多、横条超出时间轴、节点字太多、字偏小(贴进 Word 看不清)
|
|
3479
3479
|
if (kind === 'diagram' || document.querySelector('.dg.mm, .dg.tr, .dg.rm, .dg.ar')) diagramCheck(add, kind, vw)
|
|
3480
3480
|
if (kind === 'diagram') smallTextCheck(add, vw)
|
|
3481
|
+
// 17. DSH 插件:外框被改动(结构、文字、样式和模板对不上)
|
|
3482
|
+
frameCheck(add)
|
|
3481
3483
|
|
|
3482
3484
|
issues.sort((x, y) => y.sev - x.sev)
|
|
3483
3485
|
const se0 = se()
|
|
@@ -3604,6 +3606,59 @@ background:rgba(20,20,22,.86);color:#e8e8ea;font:12px/18px -apple-system,system-
|
|
|
3604
3606
|
}
|
|
3605
3607
|
}
|
|
3606
3608
|
|
|
3609
|
+
/**
|
|
3610
|
+
* DSH 插件外框(skills/ui-design/frames/dsh)锁住:模型只写 data-slot 里面。
|
|
3611
|
+
* 结构指纹 = 外框里槽位以外的标签、class、style、data-slot 名和自己的字;和模板对不上就是外框被改了。
|
|
3612
|
+
* 样式:量几处外框的算出来的样式(宽高、底色、字号),插件样式漏到外框上(body / * / button 这种选择器)、改了 dsh-shell.css 都会变。
|
|
3613
|
+
* 改了外框文件要重算 FRAME_SIGS(test-look 会报出新指纹)。
|
|
3614
|
+
*/
|
|
3615
|
+
const FRAME_SIGS = { 'dsh/sidebar': 'f6cf6564', 'dsh/settings': 'e85d0eca', 'dsh/view': '2522b3ea', 'dsh/panel': '0ea5d6de' }
|
|
3616
|
+
const FRAME_PROBES = [ // [选择器, 样式, 浅色值, 深色值(一样就省略)]
|
|
3617
|
+
['.dsh-app', 'font-size', '14px'],
|
|
3618
|
+
['.dsh-side', 'width', '280px'],
|
|
3619
|
+
['.dsh-side', 'background-color', 'rgb(249, 250, 251)', 'rgb(27, 27, 28)'],
|
|
3620
|
+
['.dsh-new', 'height', '38px'],
|
|
3621
|
+
['.dsh-row', 'font-size', '15px'],
|
|
3622
|
+
['.dsh-row', 'color', 'rgb(15, 17, 21)', 'rgb(249, 250, 251)'],
|
|
3623
|
+
['.dsh-head', 'height', '76px'],
|
|
3624
|
+
['.dsh-tab.on', 'color', 'rgb(65, 118, 230)', 'rgb(122, 170, 255)'],
|
|
3625
|
+
['.dsh-right', 'width', '575px'],
|
|
3626
|
+
['.dsh-modal', 'width', '800px'],
|
|
3627
|
+
['.dsh-scell', 'font-size', '14px'],
|
|
3628
|
+
]
|
|
3629
|
+
const inFrame = (el) => !!(el.closest && el.closest('.dsh-app[data-frame]') && !el.closest('[data-slot="main"]')) // 入口图标、名字那些小槽位跟着外框的样式走,也不查
|
|
3630
|
+
function frameSig(root) {
|
|
3631
|
+
const out = []
|
|
3632
|
+
const walk = (el) => {
|
|
3633
|
+
if (SIG_SKIP.has(el.tagName) || /^DSH-DESIGN-/.test(el.tagName)) return
|
|
3634
|
+
const slot = el.getAttribute('data-slot')
|
|
3635
|
+
// 槽位本身只记标签和名字:槽位上的 class、style(调样式改的内边距、底色)算插件的
|
|
3636
|
+
out.push(slot === null ? [el.tagName.toLowerCase(), el.getAttribute('class') || '', el.getAttribute('style') || '', '', ownText(el)].join('|') : [el.tagName.toLowerCase(), '', '', slot, ''].join('|'))
|
|
3637
|
+
if (slot === null) for (const c of el.children) walk(c)
|
|
3638
|
+
}
|
|
3639
|
+
walk(root)
|
|
3640
|
+
const s = out.join('\n')
|
|
3641
|
+
let h = 0x811c9dc5
|
|
3642
|
+
for (let i = 0; i < s.length; i++) { h ^= s.charCodeAt(i); h = Math.imul(h, 0x01000193) }
|
|
3643
|
+
return (h >>> 0).toString(16).padStart(8, '0')
|
|
3644
|
+
}
|
|
3645
|
+
function frameCheck(add) {
|
|
3646
|
+
const root = document.querySelector('.dsh-app[data-frame]')
|
|
3647
|
+
if (!root) return
|
|
3648
|
+
const id = root.getAttribute('data-frame')
|
|
3649
|
+
if (!Object.prototype.hasOwnProperty.call(FRAME_SIGS, id)) return // 以后的自定外框:还没有模板指纹
|
|
3650
|
+
const got = frameSig(root)
|
|
3651
|
+
if (got !== FRAME_SIGS[id]) { add('frame', root, { what: 'dom', frame: id, got }, 2); return }
|
|
3652
|
+
const dark = document.documentElement.getAttribute('data-theme') === 'dark'
|
|
3653
|
+
for (const [sel, prop, light, darkV] of FRAME_PROBES) {
|
|
3654
|
+
const el = [root, ...root.querySelectorAll(sel)].find((x) => x.matches(sel) && !x.closest('[data-slot]')) // 只量外框自己的(槽位里插件也可能用同名类)
|
|
3655
|
+
if (!el) continue
|
|
3656
|
+
const want = dark && darkV ? darkV : light
|
|
3657
|
+
const v = getComputedStyle(el).getPropertyValue(prop)
|
|
3658
|
+
if (v !== want) { add('frame', el, { what: 'style', frame: id, sel, prop, want, got: v }, 2); return }
|
|
3659
|
+
}
|
|
3660
|
+
}
|
|
3661
|
+
|
|
3607
3662
|
/** 图表(diagram.css)的结构问题:连线是样式按结构画的,结构写错了线就对不上 */
|
|
3608
3663
|
function diagramCheck(add, kind, vw) {
|
|
3609
3664
|
const de = document.scrollingElement || document.documentElement
|
package/lib/styles.js
CHANGED
|
@@ -137,6 +137,7 @@ export const SAID_STYLE = /风格|配色|色调|主色|色系|[红橙黄绿青
|
|
|
137
137
|
export function autoStyle(text, kind) {
|
|
138
138
|
const s = String(text || '')
|
|
139
139
|
if (!s.trim()) return null
|
|
140
|
+
if (kind === 'dshplugin') return null // DSH 插件默认用 DSH 自己的样子(外框的 --dsh-* 变量),不替它挑风格卡
|
|
140
141
|
const said = s.replace(NOT_STYLE_FENG, ' ')
|
|
141
142
|
if (SAID_STYLE.test(said) || STYLES.some((x) => said.includes(x.zh) || new RegExp(`\\b${x.en}\\s+(style|look|theme|aesthetic|vibe)\\b`, 'i').test(said))) return null
|
|
142
143
|
return topicStyle(s, kind)
|
package/lib/system.js
CHANGED
|
@@ -533,7 +533,6 @@ function hinted(vars) {
|
|
|
533
533
|
return out
|
|
534
534
|
}
|
|
535
535
|
|
|
536
|
-
const roundTo = (v, step = 1) => Math.round(v / step) * step
|
|
537
536
|
const familyOf = (ff) => String(ff || '').split(',')[0].trim().replace(/^["']|["']$/g, '')
|
|
538
537
|
const isSerif = (ff) => /(^|,)\s*serif\s*$/i.test(String(ff || '')) || /serif|song|ming|georgia|times|garamond|playfair|lora|merriweather|noto serif/i.test(familyOf(ff))
|
|
539
538
|
|
package/package.json
CHANGED
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
| `slides` | 1280×720(16:9) | 卡片 | `references/slides.md` |
|
|
32
32
|
| `email` | 600 宽 | 卡片 | `references/email.md` |
|
|
33
33
|
| `diagram` | 1600×1000 起,图多大画幅跟着多大 | 卡片 | `references/diagram.md`(思维导图、技术路线图、产品路线图、架构图;连线自动排,先读) |
|
|
34
|
+
| `dshplugin` | 1280×800(DSH 桌面端) | 卡片(外框是页面自己带的) | `references/dshplugin.md`(DSH 插件:4 个位置的外框,只写槽位,先读) |
|
|
34
35
|
|
|
35
36
|
细则只在做那一类时再读。
|
|
36
37
|
|
|
@@ -39,7 +40,7 @@
|
|
|
39
40
|
3. **一屏一个 HTML 文件,放同一个目录**。新做一套设计时先建这套设计自己的文件夹(英文短名,如 `murmur-landing/`;工作区里已有项目就放在 `design/` 下),`tokens.css`、每一屏都放进去。**不要把文件直接写在工作区最外层**——用户的项目里很可能已经有 `index.html`、`style.css`,会被覆盖。按用户会看的顺序一屏一屏写(画布按创建顺序排:登录 → 首页 → 详情 → …)。文件名用英文小写(`login.html`、`home.html`),`<title>` 写「屏名 · 产品名」,用界面的语言(如「首页 · 梅林练」「Home · Pedal」,每屏的产品名写成一样的):画布上只显示屏名,导出整套展示图时产品名做大标题。临时试验的页面用 `_` 开头(`_test.html`),不会上画布。每屏 `<head>` 里写:
|
|
40
41
|
|
|
41
42
|
```html
|
|
42
|
-
<meta name="dsh-design" content="app"> <!-- 类型;小程序写 miniprogram;Windows 软件写 desktop windows;海报可带尺寸:poster 1080x1920;图表写 diagram 1600x1000 -->
|
|
43
|
+
<meta name="dsh-design" content="app"> <!-- 类型;小程序写 miniprogram;Windows 软件写 desktop windows;海报可带尺寸:poster 1080x1920;图表写 diagram 1600x1000;DSH 插件写 dshplugin 1280x800 -->
|
|
43
44
|
```
|
|
44
45
|
|
|
45
46
|
**几屏共用的东西只写一份**:样式放 `tokens.css` 和一个公共的 `app.css`;图标、书封这类 SVG 放进一个 `icons.svg`(每个图标一个 `<symbol id="…">`),页面里用 `<svg><use href="icons.svg#cart"></use></svg>` 引用——换风格时改一处所有屏一起变,不会漏改。状态栏、标签栏这种 HTML 结构每屏照抄一份,保持一模一样。
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/* DSH 桌面端外框(照 DSH 0.2.2 网页版 1280×800 量的)。原样复制、原样引用,别改这个文件——体检会报「外框被改动」。
|
|
2
|
+
插件只写在 data-slot 里面;插件里想跟 DSH 一个样子,就用下面这些 --dsh-* 变量。
|
|
3
|
+
深色:<html data-theme="dark">。 */
|
|
4
|
+
:root {
|
|
5
|
+
--dsh-bg: #ffffff; /* 主区底色 */
|
|
6
|
+
--dsh-side: #f9fafb; /* 左侧栏底色 */
|
|
7
|
+
--dsh-card: #ffffff; /* 卡片 / 弹窗底色 */
|
|
8
|
+
--dsh-fg: #0f1115; /* 正文 */
|
|
9
|
+
--dsh-muted: #81858c; /* 次要字 */
|
|
10
|
+
--dsh-line: rgba(0, 0, 0, 0.12);
|
|
11
|
+
--dsh-hover: #ebeef2; /* 选中行 / 悬停 */
|
|
12
|
+
--dsh-accent: #4176e6; /* 选中标签、链接 */
|
|
13
|
+
--dsh-btn: #0f1115; /* 主按钮(黑底白字) */
|
|
14
|
+
--dsh-btn-fg: #ffffff;
|
|
15
|
+
--dsh-folder: #4176e6;
|
|
16
|
+
--dsh-scrim: rgba(15, 17, 21, 0.24);
|
|
17
|
+
--dsh-radius-sm: 8px;
|
|
18
|
+
--dsh-radius-md: 12px;
|
|
19
|
+
--dsh-radius-lg: 16px;
|
|
20
|
+
--dsh-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
21
|
+
--dsh-font-brand: "Montserrat", var(--dsh-font);
|
|
22
|
+
--dsh-font-code: "SF Mono", "JetBrains Mono", "Fira Code", Consolas, Menlo, monospace;
|
|
23
|
+
}
|
|
24
|
+
[data-theme="dark"] {
|
|
25
|
+
--dsh-bg: #151517;
|
|
26
|
+
--dsh-side: #1b1b1c;
|
|
27
|
+
--dsh-card: #1f1f22;
|
|
28
|
+
--dsh-fg: #f9fafb;
|
|
29
|
+
--dsh-muted: #adb2b8;
|
|
30
|
+
--dsh-line: rgba(255, 255, 255, 0.16);
|
|
31
|
+
--dsh-hover: #2c2c2f;
|
|
32
|
+
--dsh-accent: #7aaaff;
|
|
33
|
+
--dsh-btn: #f9fafb;
|
|
34
|
+
--dsh-btn-fg: #0f1115;
|
|
35
|
+
--dsh-folder: #7aaaff;
|
|
36
|
+
--dsh-scrim: rgba(0, 0, 0, 0.56);
|
|
37
|
+
color-scheme: dark;
|
|
38
|
+
}
|
|
39
|
+
html, body { margin: 0; padding: 0; background: var(--dsh-bg); }
|
|
40
|
+
|
|
41
|
+
/* ── 整个窗口 ── */
|
|
42
|
+
.dsh-app {
|
|
43
|
+
position: relative; display: flex; width: 1280px; height: 800px; overflow: hidden; box-sizing: border-box;
|
|
44
|
+
background: var(--dsh-bg); color: var(--dsh-fg); font: 400 14px/1.5 var(--dsh-font); text-align: left; letter-spacing: 0;
|
|
45
|
+
}
|
|
46
|
+
.dsh-app .dsh-i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; display: block; }
|
|
47
|
+
|
|
48
|
+
/* ── 左侧栏 ── */
|
|
49
|
+
.dsh-app .dsh-side {
|
|
50
|
+
position: relative; flex: none; width: 280px; height: 800px; box-sizing: border-box; padding: 0 8px;
|
|
51
|
+
background: var(--dsh-side); border-right: 1px solid var(--dsh-line); display: flex; flex-direction: column;
|
|
52
|
+
}
|
|
53
|
+
.dsh-app .dsh-brand { height: 66px; display: flex; align-items: center; justify-content: space-between; padding: 0 8px; box-sizing: border-box; }
|
|
54
|
+
.dsh-app .dsh-logo { display: flex; align-items: center; gap: 8px; font: 700 21px/1 var(--dsh-font-brand); letter-spacing: -0.02em; color: var(--dsh-fg); }
|
|
55
|
+
.dsh-app .dsh-logo-tag { font: 700 10px/1 var(--dsh-font); letter-spacing: 0.06em; padding: 3px 5px; border-radius: 3px; background: var(--dsh-fg); color: var(--dsh-side); }
|
|
56
|
+
.dsh-app .dsh-iconbtn { width: 28px; height: 28px; border-radius: var(--dsh-radius-sm); display: flex; align-items: center; justify-content: center; color: var(--dsh-muted); box-sizing: border-box; }
|
|
57
|
+
.dsh-app .dsh-iconbtn.on { background: var(--dsh-hover); color: var(--dsh-fg); }
|
|
58
|
+
.dsh-app .dsh-new {
|
|
59
|
+
margin: 0 4px; height: 38px; box-sizing: border-box; border: 1px solid var(--dsh-line); border-radius: var(--dsh-radius-md);
|
|
60
|
+
display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 15px; font-weight: 500; background: var(--dsh-bg); color: var(--dsh-fg);
|
|
61
|
+
}
|
|
62
|
+
[data-theme="dark"] .dsh-app .dsh-new { background: #3a3a3e; }
|
|
63
|
+
.dsh-app .dsh-nav { margin-top: 10px; display: flex; flex-direction: column; }
|
|
64
|
+
.dsh-app .dsh-row {
|
|
65
|
+
height: 38px; box-sizing: border-box; padding: 0 12px; border-radius: var(--dsh-radius-md); display: flex; align-items: center; gap: 8px;
|
|
66
|
+
font-size: 15px; color: var(--dsh-fg); white-space: nowrap; overflow: hidden;
|
|
67
|
+
}
|
|
68
|
+
.dsh-app .dsh-row.on { background: var(--dsh-hover); }
|
|
69
|
+
.dsh-app .dsh-sec { margin-top: 10px; height: 36px; padding: 0 4px 0 12px; display: flex; align-items: center; justify-content: space-between; color: var(--dsh-muted); font-size: 15px; }
|
|
70
|
+
.dsh-app .dsh-sec-acts { display: flex; gap: 4px; }
|
|
71
|
+
.dsh-app .dsh-folder { color: var(--dsh-folder); }
|
|
72
|
+
.dsh-app .dsh-sess { height: 34px; padding: 0 12px 0 34px; border-radius: var(--dsh-radius-md); display: flex; align-items: center; justify-content: space-between; font-size: 15px; color: var(--dsh-fg); white-space: nowrap; }
|
|
73
|
+
.dsh-app .dsh-sess.on { background: var(--dsh-hover); }
|
|
74
|
+
.dsh-app .dsh-time { font-size: 12px; color: var(--dsh-muted); }
|
|
75
|
+
.dsh-app .dsh-acct { margin-top: auto; height: 48px; padding: 0 8px; display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--dsh-fg); }
|
|
76
|
+
.dsh-app .dsh-avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--dsh-hover); color: var(--dsh-muted); display: flex; align-items: center; justify-content: center; font-size: 12px; }
|
|
77
|
+
|
|
78
|
+
/* ── 主区 ── */
|
|
79
|
+
.dsh-app .dsh-main { position: relative; flex: 1 1 auto; min-width: 0; height: 800px; display: flex; flex-direction: column; background: var(--dsh-bg); }
|
|
80
|
+
.dsh-app .dsh-bar { flex: none; height: 40px; position: relative; }
|
|
81
|
+
.dsh-app .dsh-corner { position: absolute; top: 6px; right: 12px; }
|
|
82
|
+
/* 会话顶栏:标题一行 + 标签一行 */
|
|
83
|
+
.dsh-app .dsh-head { flex: none; height: 76px; box-sizing: border-box; border-bottom: 1px solid var(--dsh-line); position: relative; padding: 0 20px; }
|
|
84
|
+
.dsh-app .dsh-crumbs { position: absolute; top: 11px; left: 20px; height: 28px; display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 500; white-space: nowrap; }
|
|
85
|
+
.dsh-app .dsh-mode { display: flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 400; color: var(--dsh-muted); }
|
|
86
|
+
.dsh-app .dsh-utils { position: absolute; top: 11px; right: 48px; height: 28px; display: flex; align-items: center; gap: 4px; }
|
|
87
|
+
.dsh-app .dsh-split { height: 28px; display: flex; align-items: center; border-radius: var(--dsh-radius-sm); background: var(--dsh-accent); color: #fff; font-size: 13px; padding: 0 8px; gap: 4px; }
|
|
88
|
+
.dsh-app .dsh-tabs { position: absolute; left: 18px; bottom: 0; height: 35px; display: flex; gap: 12px; }
|
|
89
|
+
.dsh-app .dsh-tab { height: 35px; padding: 0 8px; box-sizing: border-box; display: flex; align-items: center; font-size: 13px; font-weight: 500; color: var(--dsh-muted); border-bottom: 2px solid transparent; white-space: nowrap; }
|
|
90
|
+
.dsh-app .dsh-tab.on { color: var(--dsh-accent); border-bottom-color: var(--dsh-accent); }
|
|
91
|
+
/* 会话正文(占位) */
|
|
92
|
+
.dsh-app .dsh-chat { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; align-items: center; padding: 28px 24px 0; box-sizing: border-box; gap: 16px; overflow: hidden; }
|
|
93
|
+
.dsh-app .dsh-msg-me { align-self: flex-end; max-width: 70%; padding: 8px 14px; border-radius: var(--dsh-radius-lg); background: var(--dsh-hover); font-size: 14px; }
|
|
94
|
+
.dsh-app .dsh-msg-ai { align-self: stretch; font-size: 14px; color: var(--dsh-fg); }
|
|
95
|
+
.dsh-app .dsh-msg-ai p { margin: 0 0 8px; }
|
|
96
|
+
.dsh-app .dsh-composer {
|
|
97
|
+
flex: none; margin: 0 24px 20px; height: 112px; box-sizing: border-box; border: 1px solid var(--dsh-line); border-radius: 20px; background: var(--dsh-card);
|
|
98
|
+
display: flex; flex-direction: column; justify-content: space-between; padding: 14px 12px 10px 14px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
|
|
99
|
+
}
|
|
100
|
+
.dsh-app .dsh-ph { font-size: 14px; color: var(--dsh-muted); }
|
|
101
|
+
.dsh-app .dsh-cbar { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--dsh-muted); }
|
|
102
|
+
.dsh-app .dsh-cl, .dsh-app .dsh-cr { display: flex; align-items: center; gap: 12px; }
|
|
103
|
+
.dsh-app .dsh-send { width: 32px; height: 32px; border-radius: 50%; background: var(--dsh-accent); opacity: 0.5; color: #fff; display: flex; align-items: center; justify-content: center; }
|
|
104
|
+
|
|
105
|
+
/* ── 右侧栏 ── */
|
|
106
|
+
.dsh-app .dsh-right { flex: none; width: 575px; height: 800px; box-sizing: border-box; border-left: 1px solid var(--dsh-line); display: flex; flex-direction: column; background: var(--dsh-bg); }
|
|
107
|
+
.dsh-app .dsh-rtabs { flex: none; height: 38px; display: flex; align-items: flex-end; padding: 0 10px; gap: 4px; border-bottom: 1px solid var(--dsh-line); }
|
|
108
|
+
.dsh-app .dsh-rtab { height: 28px; max-width: 160px; box-sizing: border-box; padding: 0 10px; border-radius: var(--dsh-radius-sm) var(--dsh-radius-sm) 0 0; display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--dsh-muted); white-space: nowrap; overflow: hidden; }
|
|
109
|
+
.dsh-app .dsh-rtab.on { background: var(--dsh-hover); color: var(--dsh-fg); }
|
|
110
|
+
|
|
111
|
+
/* ── 设置弹窗 ── */
|
|
112
|
+
.dsh-app .dsh-scrim { position: absolute; inset: 0; background: var(--dsh-scrim); }
|
|
113
|
+
.dsh-app .dsh-modal {
|
|
114
|
+
position: absolute; left: 240px; top: 24px; width: 800px; height: 752px; box-sizing: border-box; border-radius: 24px; background: var(--dsh-card);
|
|
115
|
+
border: 1px solid var(--dsh-line); box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18); display: flex; overflow: hidden;
|
|
116
|
+
}
|
|
117
|
+
.dsh-app .dsh-snav { flex: none; width: 188px; display: flex; flex-direction: column; }
|
|
118
|
+
.dsh-app .dsh-stitle { height: 54px; padding: 0 24px; display: flex; align-items: center; font-size: 16px; font-weight: 500; }
|
|
119
|
+
.dsh-app .dsh-slist { padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
|
|
120
|
+
.dsh-app .dsh-scell { height: 40px; box-sizing: border-box; padding: 0 12px; border-radius: var(--dsh-radius-md); display: flex; align-items: center; gap: 8px; font-size: 14px; white-space: nowrap; overflow: hidden; }
|
|
121
|
+
.dsh-app .dsh-scell.on { background: var(--dsh-hover); }
|
|
122
|
+
.dsh-app .dsh-sbody { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
|
|
123
|
+
.dsh-app .dsh-stop { flex: none; height: 62px; padding: 0 16px 0 24px; display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
|
|
124
|
+
.dsh-app .dsh-ghost { height: 28px; box-sizing: border-box; padding: 0 10px; border: 1px solid var(--dsh-line); border-radius: var(--dsh-radius-sm); display: flex; align-items: center; font-size: 13px; }
|
|
125
|
+
|
|
126
|
+
/* ── 槽位:插件写在这里面 ── */
|
|
127
|
+
.dsh-app [data-slot] { box-sizing: border-box; min-width: 0; }
|
|
128
|
+
.dsh-app [data-slot="main"] { flex: 1 1 auto; min-height: 0; overflow: auto; position: relative; color: var(--dsh-fg); font: 400 14px/1.5 var(--dsh-font); }
|
|
129
|
+
.dsh-app .dsh-main > [data-slot="main"] { background: var(--dsh-bg); }
|
|
130
|
+
.dsh-app .dsh-sbody > [data-slot="main"] { padding: 0 24px 24px; }
|
|
131
|
+
.dsh-app [data-slot$="-icon"] { width: 16px; height: 16px; flex: none; display: flex; align-items: center; justify-content: center; overflow: hidden; }
|
|
132
|
+
.dsh-app [data-slot$="-label"], .dsh-app [data-slot$="-title"] { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "dsh",
|
|
3
|
+
"name": "DSH 插件",
|
|
4
|
+
"nameEn": "DSH plugin",
|
|
5
|
+
"desc": "DeepSeek Harness 桌面端的外框(照 DSH 0.2.2 量的),插件只设计槽位里那块",
|
|
6
|
+
"size": [1280, 800],
|
|
7
|
+
"css": "dsh-shell.css",
|
|
8
|
+
"themes": ["light", "dark"],
|
|
9
|
+
"darkAttr": "data-theme=\"dark\"",
|
|
10
|
+
"frames": [
|
|
11
|
+
{
|
|
12
|
+
"id": "sidebar",
|
|
13
|
+
"file": "sidebar.html",
|
|
14
|
+
"name": "左侧栏入口",
|
|
15
|
+
"dshSlot": "sidebar.panellist",
|
|
16
|
+
"desc": "左侧栏「插件 / 自动化任务」那一排多一行,点开主区是插件整页",
|
|
17
|
+
"slots": {
|
|
18
|
+
"entry-icon": "那一行的图标,16×16(放一个 svg)",
|
|
19
|
+
"entry-label": "那一行的字(插件名,2–6 个字)",
|
|
20
|
+
"main": "主区整页,1000×760(顶上 40px 留给 DSH 的右上角按钮)"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"id": "settings",
|
|
25
|
+
"file": "settings.html",
|
|
26
|
+
"name": "设置分区",
|
|
27
|
+
"dshSlot": "settings.section",
|
|
28
|
+
"desc": "设置弹窗左边导航多一项,右边是插件的设置",
|
|
29
|
+
"slots": {
|
|
30
|
+
"entry-icon": "导航那一项的图标,16×16",
|
|
31
|
+
"entry-label": "导航那一项的字",
|
|
32
|
+
"main": "右边设置内容,约 610×690,左右已留 24px"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"id": "view",
|
|
37
|
+
"file": "view.html",
|
|
38
|
+
"name": "会话标签页",
|
|
39
|
+
"dshSlot": "conversation.view",
|
|
40
|
+
"desc": "会话顶上「对话 / 轨迹」旁边多一个标签,下面整块是插件视图",
|
|
41
|
+
"slots": {
|
|
42
|
+
"tab-label": "标签上的字(2–6 个字)",
|
|
43
|
+
"main": "标签下面整块,1000×724"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"id": "panel",
|
|
48
|
+
"file": "panel.html",
|
|
49
|
+
"name": "右侧栏面板",
|
|
50
|
+
"dshSlot": "conversation.session.header.utilities + sidebarRightTabs",
|
|
51
|
+
"desc": "会话顶栏多一个按钮,点开右侧栏是插件面板",
|
|
52
|
+
"slots": {
|
|
53
|
+
"button-icon": "顶栏按钮的图标,16×16",
|
|
54
|
+
"panel-title": "右侧栏标签上的字",
|
|
55
|
+
"main": "右侧栏面板,574×762"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}
|