dsh-design-studio 0.19.1 → 0.20.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 +2 -1
- package/README.md +2 -1
- package/cordis.patch.yml +2 -2
- package/lib/client.js +45 -17
- package/lib/core.js +3 -2
- package/lib/gallery/policy.js +2 -2
- package/lib/index.js +8 -7
- package/lib/look.js +10 -5
- package/lib/picker.js +107 -5
- package/lib/styles.js +1 -1
- package/package.json +1 -1
- package/skills/ui-design/SKILL.md +6 -5
- package/skills/ui-design/diagram.css +1047 -0
- package/skills/ui-design/references/diagram.md +150 -0
- package/skills/ui-design/tokens.css +1 -1
package/README.en.md
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
</div>
|
|
17
17
|
|
|
18
|
-
**Design Studio** is a DeepSeek Harness (DSH) plugin. Say what you want to make, and the model's web pages, app screens, mini programs, desktop apps, posters and
|
|
18
|
+
**Design Studio** is a DeepSeek Harness (DSH) plugin. Say what you want to make, and the model's web pages, app screens, mini programs, desktop apps, posters, slides, mind maps and roadmaps appear one by one on a canvas in the right sidebar, inside phone, browser or app-window frames. Click the direction you like, or click whatever looks off and add a sentence, and the model edits it.
|
|
19
19
|
|
|
20
20
|

|
|
21
21
|
|
|
@@ -43,6 +43,7 @@ If DSH can't reach the npm registry, it falls back to a mirror in China. To upda
|
|
|
43
43
|
- **Design check:** one click finds overflowing text, low contrast, small tap targets and tiny text, marked right on the page. In Design mode the model also checks its own work and fixes what it finds.
|
|
44
44
|
- **Versions and compare:** every turn is saved; drag a slider to compare, and go back to any version.
|
|
45
45
|
- **Export and phone preview:** showcase images, PDF and PowerPoint (links between screens still work); scan a QR code to see it on your phone at real size. Slides and posters larger than the default canvas now use the page's real size. You can also set it by adding `WIDTHxHEIGHT` after the type, for example `<meta name="dsh-design" content="slides 1440x810">`. Export options let you pick the page size (16:9, 4:3, A3 landscape or custom), what each page shows (one screen, full page or a set height) and two screens per page. If anything would be cut off, you get a checklist first, with a one-click fix that fits the canvas to the content.
|
|
46
|
+
- **Diagrams:** mind maps, technical route charts (the kind in grant proposals and theses), product roadmaps and system architecture diagrams. Lines, branches and arrows are laid out for you and re-flow when you change text or add nodes; colors follow the design style, and a high-resolution PNG or PDF export drops straight into Word or PowerPoint.
|
|
46
47
|
- **Design library and gallery:** everything you've designed, plus saved references and styles, lives in the Library. Browse templates, design systems and style cards others shared, and "Start from this" copies one for you to keep editing. Share your own with "Share to the gallery": it's checked, zipped and submitted on a web page, and listed once reviewed. The gallery catalog comes from npm mirrors and is used only when its signature and checksums match; to keep it offline, turn on "Design library offline" on the Plugins page.
|
|
47
48
|
- **Your brand, and real code:** give a site URL to extract a brand design system and design with it from then on; turn a finished design into React / Vue / HTML (mini programs straight into uni-app or native WeChat code, HBuilderX projects included), compared screen by screen against the design.
|
|
48
49
|
- **Built-in photo library:** for designs that rely on photos (hotels, food, cafes, fitness, beauty, fashion, education, travel), the model uses real-looking photos instead of only drawing illustrations. About 8 MB is downloaded the first time it is needed. All of them are AI-generated placeholders, so replace them with real photos before launch.
|
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
</div>
|
|
17
17
|
|
|
18
|
-
**设计工作台**是 DeepSeek Harness(DSH)的插件:说一句要做什么,模型做的网页、App
|
|
18
|
+
**设计工作台**是 DeepSeek Harness(DSH)的插件:说一句要做什么,模型做的网页、App 界面、小程序、桌面软件、海报、幻灯片、思维导图和路线图在右边画布上一屏屏长出来,套着手机、浏览器或软件窗口外框。看中哪个方向点一下,哪里不对点一下说一句,模型就照着改。
|
|
19
19
|
|
|
20
20
|

|
|
21
21
|
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
- **设计体检**:一键查文字溢出、对比度不够、按钮太小、字太小,问题直接标在页面上;模型做完也会自己查一遍再改。
|
|
44
44
|
- **版本和对比**:每轮自动存一版,左右拖动对比,随时回到任意一版。
|
|
45
45
|
- **导出和手机上看**:导出展示图、PDF、PPT(屏和屏之间的跳转照样能点);扫码在手机上按真机尺寸看。页面比默认画幅大的幻灯片、海报,画幅自动跟页面走;也可以在类型后面跟 `宽x高` 指定,比如 `<meta name="dsh-design" content="slides 1440x810">`。导出选项里可以选版面(16:9、4:3、A3 横向、自定义)、每页取景(一屏、整页、指定高度)和每页拼 2 屏;有内容会被裁时,导出前先给一张清单,可以一键按内容改画幅。
|
|
46
|
+
- **图表**:思维导图、技术路线图(申报书、开题报告那种)、产品路线图、系统架构图。连线、分叉、箭头自动排好,改字、加节点自己重排;配色跟着设计风格走,导出高清 PNG 或 PDF 贴进 Word / PPT。
|
|
46
47
|
- **设计库和设计市场**:以前做过的设计、收的参考图和风格都在「设计库」里;市场里逛大家分享的模板、设计系统和风格卡,点「用这个开始」复制一份接着改。自己做的点「分享到设计市场」,查过打成 zip,在网页里交上去,审过就上架。市场目录从 npm 镜像取,签了名、核对过才用;不想让它联网,在插件页打开「设计库不联网」。
|
|
47
48
|
- **照品牌风格做、转成代码**:给官网地址,提一套品牌设计系统,以后都照它做;做好的设计转成 React / Vue / HTML,小程序直接转成 uni-app 或原生小程序代码(HBuilderX 建的项目也认得出),逐屏和设计稿比对。
|
|
48
49
|
- **自带照片库**:民宿酒店、餐饮、奶茶咖啡、健身、美妆、服饰、教育、旅行风景这些靠照片说话的设计,模型会直接用上照片,不再只画插画。第一次用到时下载约 8 MB。都是 AI 生成的示意图,上线前请换成真实照片。
|
package/cordis.patch.yml
CHANGED
|
@@ -29,14 +29,14 @@
|
|
|
29
29
|
config:
|
|
30
30
|
id: design
|
|
31
31
|
name: 设计模式
|
|
32
|
-
description: 做网页、App
|
|
32
|
+
description: 做网页、App 界面、小程序、海报、幻灯片、图表(思维导图、路线图、架构图):标准模式的全部工具,加上设计技能和右侧「设计工作台」实时预览。
|
|
33
33
|
order: 1.5
|
|
34
34
|
plugins:
|
|
35
35
|
- id: persona
|
|
36
36
|
name: '@deepseek-ai/dsh-persona'
|
|
37
37
|
config:
|
|
38
38
|
prefix: |-
|
|
39
|
-
You are a design agent powered by the {{model}} model. You design user interfaces and visuals — web pages, app and tablet screens, WeChat mini programs, posters and social images, slides, emails, components — and build them as real HTML/CSS, or inside the user's front-end project.
|
|
39
|
+
You are a design agent powered by the {{model}} model. You design user interfaces and visuals — web pages, app and tablet screens, WeChat mini programs, posters and social images, slides, emails, components, and diagrams (mind maps, technical routes, roadmaps, architecture) — and build them as real HTML/CSS, or inside the user's front-end project.
|
|
40
40
|
Before designing, load the ui-design skill and follow its process and self-check list. For a new design, first ask the two or three questions that matter and show three clearly different directions of one key screen, as the skill describes, unless the user asked you to just build it. Once the first HTML file is written, or a dev server is up, call preview_page so the user can watch the design live in the Design Studio sidebar; later edits refresh on their own. After writing or changing screens, call check_design to measure them at real sizes and fix what it lists, and call look_design to see real screenshots for the visual pass; do not build your own inspection pages, servers or browser screenshots. Stop after at most three measure-and-fix rounds and tell the user what is left. When a message starts with an element or region the user selected in the preview, or with a design-check list, change exactly those parts in the source. If the user points you at their own website or project as the brand to follow, call extract_design_system; when the ui-design skill names a default design system, build new designs on its tokens.css and components.css. When a message asks to turn the design into real code, call handoff_design, follow its HANDOFF.md, and after each screen call compare_design until it matches. If the user only wants an answer shown as a page (a comparison, table, checklist, chart or calculator) and the show_page tool is available, call show_page instead of this design process.
|
|
41
41
|
- id: agent-instructions
|
|
42
42
|
name: '@deepseek-ai/dsh-agent-instructions'
|
package/lib/client.js
CHANGED
|
@@ -60,6 +60,7 @@ window.__ModuleLoader__.load({
|
|
|
60
60
|
exPoster: '周末城市夜跑活动的海报,清爽运动风',
|
|
61
61
|
exSlides: '新品发布会的五页幻灯片:问题、方案、数字、价格、下一步',
|
|
62
62
|
exEmail: '会员生日月的优惠邮件:一张大图、一段祝福、一个按钮',
|
|
63
|
+
exDiagram: '「产品经理入门」的思维导图:用户研究、需求分析、原型、数据、项目管理',
|
|
63
64
|
askKindLine: '类型:{k}',
|
|
64
65
|
askMore: '更多开始方式',
|
|
65
66
|
askMoreD: '打开已有的 HTML、用自己的品牌、从设计库打开',
|
|
@@ -150,7 +151,7 @@ window.__ModuleLoader__.load({
|
|
|
150
151
|
canvas: '画布:几屏并排看',
|
|
151
152
|
single: '单页:只看一屏',
|
|
152
153
|
sizes: '多尺寸:同一屏在手机 / 平板 / 电脑上并排看',
|
|
153
|
-
sizesNo: '
|
|
154
|
+
sizesNo: '海报、幻灯片、邮件、图表是固定画幅,没有多尺寸',
|
|
154
155
|
szPhone: '手机',
|
|
155
156
|
szTablet: '平板',
|
|
156
157
|
szDesktop: '电脑',
|
|
@@ -166,6 +167,7 @@ window.__ModuleLoader__.load({
|
|
|
166
167
|
kindPoster: '海报',
|
|
167
168
|
kindSlides: '幻灯片',
|
|
168
169
|
kindEmail: '邮件',
|
|
170
|
+
kindDiagram: '图表',
|
|
169
171
|
tokens: '设计规范',
|
|
170
172
|
tokensTip: '点一个放进输入框,补一句怎么改;改它所有屏一起变',
|
|
171
173
|
tokensEmpty: '这套设计还没有设计变量(:root 上的 CSS 变量),颜色字号散在各处,改起来不统一。',
|
|
@@ -264,6 +266,11 @@ window.__ModuleLoader__.load({
|
|
|
264
266
|
ck_tabbar: '标签栏项太多',
|
|
265
267
|
ck_navbar: '没有导航栏',
|
|
266
268
|
ck_winctl: '被窗口按钮挡住',
|
|
269
|
+
ck_dgsize: '图比画幅大',
|
|
270
|
+
ck_dgli: '导图节点写法不对',
|
|
271
|
+
ck_dgmany: '一层放太多',
|
|
272
|
+
ck_dgbar: '横条超出时间轴',
|
|
273
|
+
ck_dgtext: '节点字太多',
|
|
267
274
|
cd_hscroll: '伸出屏幕 {px}px',
|
|
268
275
|
cd_clipped: '被切掉 {px}px',
|
|
269
276
|
cd_overflow: '伸出框 {px}px',
|
|
@@ -286,6 +293,11 @@ window.__ModuleLoader__.load({
|
|
|
286
293
|
cd_tabbar: '标签栏有 {n} 项(最多 5 项)',
|
|
287
294
|
cd_navbar: '顶上 y {t}–{b}(导航栏)是空的:一级页放标题或品牌,二级页标题居中加返回',
|
|
288
295
|
cd_winctl: '伸进{osName}窗口按钮 {px}px(外框画的、盖在页面上面:{zone}空着)',
|
|
296
|
+
cd_dgsize: '图有 {w}×{h},画幅只有 {vw}×{vh}:把画幅改大,或者删减节点',
|
|
297
|
+
cd_dgli: '字要包在 <span class="mm-node"> 里,不然连线对不上',
|
|
298
|
+
cd_dgmany: '{n} 个(最多 {max} 个):合并几个或拆开',
|
|
299
|
+
cd_dgbar: '从第 {from} 段起占 {span} 段,时间轴只有 {cols} 段',
|
|
300
|
+
cd_dgtext: '{chars} 个字(最好 ≤ {max}):写关键词,补充放小字',
|
|
289
301
|
ckOs_mac: ' Mac ',
|
|
290
302
|
ckOs_win: ' Windows ',
|
|
291
303
|
ckZone_mac: '左上角 x 80、y 40 以内',
|
|
@@ -927,6 +939,7 @@ window.__ModuleLoader__.load({
|
|
|
927
939
|
exPoster: 'Poster for a weekend night run in the city, fresh sporty style',
|
|
928
940
|
exSlides: 'Five-slide launch deck: problem, solution, numbers, pricing, next steps',
|
|
929
941
|
exEmail: 'Birthday-month offer email for members: one big image, a short note, one button',
|
|
942
|
+
exDiagram: 'A mind map for "Product management 101": user research, requirements, prototyping, data, project management',
|
|
930
943
|
askKindLine: 'Type: {k}',
|
|
931
944
|
askMore: 'More ways to start',
|
|
932
945
|
askMoreD: 'Open existing HTML, use your own brand, open from the library',
|
|
@@ -1017,7 +1030,7 @@ window.__ModuleLoader__.load({
|
|
|
1017
1030
|
canvas: 'Canvas: screens side by side',
|
|
1018
1031
|
single: 'Single: one screen',
|
|
1019
1032
|
sizes: 'Sizes: the same screen on phone, tablet and desktop side by side',
|
|
1020
|
-
sizesNo: 'Posters, slides and
|
|
1033
|
+
sizesNo: 'Posters, slides, emails and diagrams have a fixed size',
|
|
1021
1034
|
szPhone: 'Phone',
|
|
1022
1035
|
szTablet: 'Tablet',
|
|
1023
1036
|
szDesktop: 'Desktop',
|
|
@@ -1033,6 +1046,7 @@ window.__ModuleLoader__.load({
|
|
|
1033
1046
|
kindPoster: 'Poster',
|
|
1034
1047
|
kindSlides: 'Slides',
|
|
1035
1048
|
kindEmail: 'Email',
|
|
1049
|
+
kindDiagram: 'Diagram',
|
|
1036
1050
|
tokens: 'Design tokens',
|
|
1037
1051
|
tokensTip: 'Click one to put it in the input, then say how to change it. All screens follow',
|
|
1038
1052
|
tokensEmpty: 'This design has no tokens yet (CSS variables on :root), so colors and sizes are scattered.',
|
|
@@ -1131,6 +1145,11 @@ window.__ModuleLoader__.load({
|
|
|
1131
1145
|
ck_tabbar: 'Too many tabs',
|
|
1132
1146
|
ck_navbar: 'No navigation bar',
|
|
1133
1147
|
ck_winctl: 'Under the window buttons',
|
|
1148
|
+
ck_dgsize: 'Diagram bigger than the canvas',
|
|
1149
|
+
ck_dgli: 'Mind map node written wrong',
|
|
1150
|
+
ck_dgmany: 'Too many in one level',
|
|
1151
|
+
ck_dgbar: 'Bar runs past the timeline',
|
|
1152
|
+
ck_dgtext: 'Node text too long',
|
|
1134
1153
|
cd_hscroll: 'sticks out {px}px',
|
|
1135
1154
|
cd_clipped: '{px}px cut off',
|
|
1136
1155
|
cd_overflow: 'sticks out {px}px',
|
|
@@ -1153,6 +1172,11 @@ window.__ModuleLoader__.load({
|
|
|
1153
1172
|
cd_tabbar: 'the tab bar has {n} items (5 at most)',
|
|
1154
1173
|
cd_navbar: 'nothing at y {t}–{b} (the navigation bar): top-level pages show a title or brand, other pages a centered title and a back button',
|
|
1155
1174
|
cd_winctl: '{px}px under the{osName}window buttons (the frame draws them on top: keep {zone} clear)',
|
|
1175
|
+
cd_dgsize: 'the diagram is {w}×{h} but the canvas is {vw}×{vh}: make the canvas bigger or trim nodes',
|
|
1176
|
+
cd_dgli: 'wrap the text in <span class="mm-node">, or the lines will not meet it',
|
|
1177
|
+
cd_dgmany: '{n} of them ({max} at most): merge some or split them up',
|
|
1178
|
+
cd_dgbar: 'starts at period {from} and spans {span}, but the timeline has only {cols}',
|
|
1179
|
+
cd_dgtext: '{chars} characters ({max} at most): use keywords, put details in small text',
|
|
1156
1180
|
ckOs_mac: ' Mac ',
|
|
1157
1181
|
ckOs_win: ' Windows ',
|
|
1158
1182
|
ckZone_mac: 'the top-left 80×40',
|
|
@@ -2103,6 +2127,7 @@ window.__ModuleLoader__.load({
|
|
|
2103
2127
|
.ddp-wait .card.k-poster{width:auto;height:min(62%,560px);aspect-ratio:3/4}
|
|
2104
2128
|
.ddp-wait .card.k-slides{aspect-ratio:16/9}
|
|
2105
2129
|
.ddp-wait .card.k-email{width:min(60%,380px);aspect-ratio:3/4}
|
|
2130
|
+
.ddp-wait .card.k-diagram{aspect-ratio:16/10}
|
|
2106
2131
|
.ddp-wait .card:has(.ddp-gd){animation:none}
|
|
2107
2132
|
.ddp-wait p{margin:0;color:var(--dsw-alias-label-tertiary);text-align:center;line-height:1.6}
|
|
2108
2133
|
.ddp-toast{position:absolute;left:12px;right:12px;top:14px;width:fit-content;max-width:calc(100% - 24px);margin-inline:auto;z-index:7;padding:7px 14px;border-radius:14px;background:var(--dsw-alias-label-primary);color:var(--dsw-alias-bg-layer-1);font-size:12px;line-height:1.5;text-align:center;overflow-wrap:anywhere;box-shadow:0 6px 20px rgba(0,0,0,.2);animation:ddp-in .2s ease}
|
|
@@ -2788,6 +2813,7 @@ ${Object.entries(CHIP_ICON).map(([k, d]) => `[data-composer-chip="${chipSrc(k)}"
|
|
|
2788
2813
|
poster: () => svg([h('rect', { key: 1, x: 5, y: 3, width: 14, height: 18, rx: 1.8 }), h('path', { key: 2, d: 'M5 16l4-4 3 3 2-2 5 5' }), h('circle', { key: 3, cx: 14.5, cy: 8, r: 1.6 })]),
|
|
2789
2814
|
slides: () => svg([h('rect', { key: 1, x: 2.5, y: 4, width: 19, height: 12, rx: 1.8 }), h('path', { key: 2, d: 'M12 16v3M8.5 20.5h7' }), h('path', { key: 3, d: 'M6.5 8h6M6.5 11h4' })]),
|
|
2790
2815
|
email: () => svg([h('rect', { key: 1, x: 3, y: 5, width: 18, height: 14, rx: 2.2 }), h('path', { key: 2, d: 'M3.5 6.5l8.5 6.5 8.5-6.5' })]),
|
|
2816
|
+
diagram: () => svg([h('rect', { key: 1, x: 2.5, y: 9.5, width: 6, height: 5, rx: 1.4 }), h('rect', { key: 2, x: 15.5, y: 3.5, width: 6, height: 4, rx: 1.2 }), h('rect', { key: 3, x: 15.5, y: 10, width: 6, height: 4, rx: 1.2 }), h('rect', { key: 4, x: 15.5, y: 16.5, width: 6, height: 4, rx: 1.2 }), h('path', { key: 5, d: 'M8.5 12h3.5M12 5.5v13M12 5.5h3.5M12 12h3.5M12 18.5h3.5' })]),
|
|
2791
2817
|
caret: () => svg([h('path', { key: 1, d: 'M6 9.5l6 6 6-6', strokeWidth: 2.4 })], { className: 'cr' }),
|
|
2792
2818
|
palette: () => svg([h('path', { key: 1, d: 'M12 3a9 9 0 1 0 0 18c1.1 0 1.7-.8 1.7-1.6 0-.9-.8-1.3-.8-2.1 0-.9.8-1.6 1.7-1.6H17a4 4 0 0 0 4-4C21 6.8 17 3 12 3z' }),
|
|
2793
2819
|
h('circle', { key: 2, cx: 7.6, cy: 11.2, r: 1.25, fill: 'currentColor', stroke: 'none' }), h('circle', { key: 3, cx: 10.2, cy: 7.4, r: 1.25, fill: 'currentColor', stroke: 'none' }),
|
|
@@ -3735,7 +3761,7 @@ ${Object.entries(CHIP_ICON).map(([k, d]) => `[data-composer-chip="${chipSrc(k)}"
|
|
|
3735
3761
|
['editorial', /新闻|杂志|博客|阅读|读书|书店|媒体|播客|\b(news|magazine|blog|reading|books?|media|newsletter)\b/i],
|
|
3736
3762
|
['swiss', /设计工作室|建筑|展览|美术馆|画廊|作品集|\b(agency|studio|architecture|exhibition|gallery|museum|portfolio)\b/i],
|
|
3737
3763
|
]
|
|
3738
|
-
const AUTO_BY_KIND = { slides: 'swiss', web: 'minimal', desktop: 'tech', email: 'minimal', poster: 'playful', tablet: 'minimal' }
|
|
3764
|
+
const AUTO_BY_KIND = { slides: 'swiss', web: 'minimal', desktop: 'tech', email: 'minimal', poster: 'playful', tablet: 'minimal', diagram: 'tech' }
|
|
3739
3765
|
const AUTO_SPREAD = ['minimal', 'editorial', 'playful', 'fresh', 'tech', 'glass', 'dark', 'sport']
|
|
3740
3766
|
// 「北欧风」「清新风:首页…」「中国风的界面」算说了风格;先去掉「通风」「台风」「新风系统」「风控」「风景」这类不是风格的词
|
|
3741
3767
|
const NOT_STYLE_FENG = /通风|台风|新风(系统|机|量)|风险|风控|风景|风扇|风味|风暴|风光|风速|风向|风筝|风铃|风车|吹风|防风|挡风|避风|屏风|旋风|狂风|微风|寒风|疾风|顺风|逆风|作风|中风|风湿|风水/g
|
|
@@ -4040,7 +4066,7 @@ ${Object.entries(CHIP_ICON).map(([k, d]) => `[data-composer-chip="${chipSrc(k)}"
|
|
|
4040
4066
|
|
|
4041
4067
|
// ── 导出图片:设备外框、整套展示图 ───────────────────────────────────────
|
|
4042
4068
|
|
|
4043
|
-
const SHOW_COLS = { app: 4, miniprogram: 4, tablet: 3, desktop: 2, web: 2, poster: 3, slides: 2, email: 3 }
|
|
4069
|
+
const SHOW_COLS = { app: 4, miniprogram: 4, tablet: 3, desktop: 2, web: 2, poster: 3, slides: 2, email: 3, diagram: 2 }
|
|
4044
4070
|
const CANVAS_FONT = '-apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif'
|
|
4045
4071
|
const FRAMED = { app: 1, miniprogram: 1, tablet: 1, desktop: 1, web: 1 }
|
|
4046
4072
|
|
|
@@ -4521,12 +4547,12 @@ ${Object.entries(CHIP_ICON).map(([k, d]) => `[data-composer-chip="${chipSrc(k)}"
|
|
|
4521
4547
|
|
|
4522
4548
|
// ── 设计类型:画幅和外框 ─────────────────────────────────────────────────
|
|
4523
4549
|
|
|
4524
|
-
const KIND_LIST = ['web', 'app', 'miniprogram', 'tablet', 'desktop', 'poster', 'slides', 'email']
|
|
4525
|
-
const KIND_KEY = { web: 'kindWeb', app: 'kindApp', miniprogram: 'kindMini', tablet: 'kindTablet', desktop: 'kindDesktop', poster: 'kindPoster', slides: 'kindSlides', email: 'kindEmail' }
|
|
4550
|
+
const KIND_LIST = ['web', 'app', 'miniprogram', 'tablet', 'desktop', 'poster', 'slides', 'email', 'diagram']
|
|
4551
|
+
const KIND_KEY = { web: 'kindWeb', app: 'kindApp', miniprogram: 'kindMini', tablet: 'kindTablet', desktop: 'kindDesktop', poster: 'kindPoster', slides: 'kindSlides', email: 'kindEmail', diagram: 'kindDiagram' }
|
|
4526
4552
|
const GHOST_MS = 90000 // 这么久没出新屏就撤掉「生成中…」占位
|
|
4527
4553
|
const HOLD_MAX = 15000 // 草稿放到一半真文件就落地了:最多再放这么久(一般几秒放完自己说一声)
|
|
4528
4554
|
const EDIT_GRACE_MS = 3000 // 退出改字后这么久里,页面交上来的最后一处改动还收
|
|
4529
|
-
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] }
|
|
4555
|
+
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] }
|
|
4530
4556
|
// 外框:pad 边框厚度、top 顶上一条(浏览器栏)、r 外圆角、ir 屏幕圆角、island 灵动岛离顶的距离、capsule 小程序右上角的胶囊、win 桌面软件的窗口按钮
|
|
4531
4557
|
const FRAME = {
|
|
4532
4558
|
web: { pad: 0, top: 34, r: 10, ir: 0 },
|
|
@@ -4537,6 +4563,7 @@ ${Object.entries(CHIP_ICON).map(([k, d]) => `[data-composer-chip="${chipSrc(k)}"
|
|
|
4537
4563
|
poster: { pad: 0, top: 0, r: 6, ir: 6 },
|
|
4538
4564
|
slides: { pad: 0, top: 0, r: 8, ir: 8 },
|
|
4539
4565
|
email: { pad: 0, top: 0, r: 10, ir: 10 },
|
|
4566
|
+
diagram: { pad: 0, top: 0, r: 8, ir: 8 },
|
|
4540
4567
|
}
|
|
4541
4568
|
|
|
4542
4569
|
/** 某个大小的外框:矮的手机(SE 那种,高不到宽的 1.9 倍)没有灵动岛,不然压住页面最上面 */
|
|
@@ -4549,7 +4576,7 @@ ${Object.entries(CHIP_ICON).map(([k, d]) => `[data-composer-chip="${chipSrc(k)}"
|
|
|
4549
4576
|
// 桌面软件的窗口按钮(和 picker.js 的一样):Mac 红绿灯在左上 x 20、y 20 起,三个 12px 圆点隔 8;Windows 最小化 / 最大化 / 关闭在右上角,各 46×32
|
|
4550
4577
|
const LIGHTS = { x: 20, y: 20, d: 12, gap: 8 }
|
|
4551
4578
|
const WINBTN = { w: 46, h: 32 }
|
|
4552
|
-
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' }
|
|
4579
|
+
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' }
|
|
4553
4580
|
|
|
4554
4581
|
/** 页面里 <meta name="dsh-design" content="app"> / "poster 1080x1920" / "desktop windows" → { kind, size, os }(os:win,不写是 Mac) */
|
|
4555
4582
|
function parseMeta(content) {
|
|
@@ -4571,7 +4598,7 @@ ${Object.entries(CHIP_ICON).map(([k, d]) => `[data-composer-chip="${chipSrc(k)}"
|
|
|
4571
4598
|
}
|
|
4572
4599
|
|
|
4573
4600
|
// 定死画面的类型:页面比默认画幅大(写死了 1440×810 又没写进 meta)就按页面实际大小。比例不像一页的(几页竖着堆的)不算
|
|
4574
|
-
const AUTO_RATIO = { slides: [1.2, 2.4], poster: [0.45, 2.5] }
|
|
4601
|
+
const AUTO_RATIO = { slides: [1.2, 2.4], poster: [0.45, 2.5], diagram: [0.3, 4] }
|
|
4575
4602
|
|
|
4576
4603
|
/** 各屏量到的实际大小 → 'WxH'(都没比默认大:'')。和 look.js 的 autoSize 一样 */
|
|
4577
4604
|
function autoSize(list, kind) {
|
|
@@ -5029,6 +5056,7 @@ ${Object.entries(CHIP_ICON).map(([k, d]) => `[data-composer-chip="${chipSrc(k)}"
|
|
|
5029
5056
|
poster: [[8, 6, 84, 50], [8, 61, 70, 8], [8, 72, 50, 4], [8, 84, 36, 7]],
|
|
5030
5057
|
slides: [[6, 10, 60, 13], [6, 32, 40, 52], [52, 32, 42, 52]],
|
|
5031
5058
|
email: [[10, 4, 80, 7], [10, 14, 80, 30], [10, 48, 60, 5], [10, 56, 80, 14], [10, 75, 30, 6]],
|
|
5059
|
+
diagram: [[38, 40, 24, 18], [6, 14, 22, 10], [6, 45, 22, 10], [6, 76, 22, 10], [72, 14, 22, 10], [72, 45, 22, 10], [72, 76, 22, 10]],
|
|
5032
5060
|
}
|
|
5033
5061
|
const GD_C = ['#4d6bfe', '#e8590c', '#0ca678']
|
|
5034
5062
|
/** 占位里的鼠标什么时候动:换了在做的事、或者又写了 15 行就加一;不在生成就不动 */
|
|
@@ -7001,7 +7029,7 @@ ${Object.entries(CHIP_ICON).map(([k, d]) => `[data-composer-chip="${chipSrc(k)}"
|
|
|
7001
7029
|
const n = { name: name || t('exThisName') } // 写出是哪一屏,别只说「这一屏」
|
|
7002
7030
|
if (FRAMED[kind]) items.push(['frame', I.single, t('exFrame', n)])
|
|
7003
7031
|
items.push(['raw', I.image, t('exRaw', n)])
|
|
7004
|
-
if (kind !== 'poster' && kind !== 'slides') items.push(['long', I.long, t('exLong', n)]) //
|
|
7032
|
+
if (kind !== 'poster' && kind !== 'slides' && kind !== 'diagram') items.push(['long', I.long, t('exLong', n)]) // 海报、幻灯片、图表画幅是定的,没有「整页」
|
|
7005
7033
|
if (count > 1) items.push(['show', I.canvas, t('exShow')])
|
|
7006
7034
|
items.push(['pdf', I.pdf, t('exPdf')], ['pptx', I.deck, t('exPptx')], ['opts', I.sliders, t('exOpts')])
|
|
7007
7035
|
return items
|
|
@@ -7364,7 +7392,7 @@ ${Object.entries(CHIP_ICON).map(([k, d]) => `[data-composer-chip="${chipSrc(k)}"
|
|
|
7364
7392
|
|
|
7365
7393
|
// ── 设计库 › 市场 ──
|
|
7366
7394
|
const GALLERY_REPO = 'https://github.com/OrderG-X/dsh-design-gallery'
|
|
7367
|
-
const MK_KINDS = ['web', 'app', 'miniprogram', 'tablet', 'desktop', 'poster', 'slides', 'email']
|
|
7395
|
+
const MK_KINDS = ['web', 'app', 'miniprogram', 'tablet', 'desktop', 'poster', 'slides', 'email', 'diagram']
|
|
7368
7396
|
const mkPick = (t, x) => { const o = x || {}; return String((t('lang') === 'en' ? o.en || o.zh : o.zh || o.en) || '') }
|
|
7369
7397
|
const mkUrl = (e) => e.submission || `${GALLERY_REPO}/tree/main/${e.type === 'system' ? 'systems' : e.type === 'style' ? 'styles' : 'templates'}/${e.id}`
|
|
7370
7398
|
const mkErr = (t, e) => { const k = String((e && e.message) || e || ''); const m = t('mkErr_' + k); return m && m !== 'mkErr_' + k ? m : k }
|
|
@@ -7428,8 +7456,8 @@ ${Object.entries(CHIP_ICON).map(([k, d]) => `[data-composer-chip="${chipSrc(k)}"
|
|
|
7428
7456
|
}
|
|
7429
7457
|
|
|
7430
7458
|
// 首页大输入框:说一句 + 类型 + 风格 → onSend(发给模型)。没写字时 Tab 用占位里的例子
|
|
7431
|
-
const ASK_KINDS = ['app', 'miniprogram', 'web', 'poster', 'slides', 'tablet', 'desktop', 'email']
|
|
7432
|
-
const ASK_EX = { web: 'exWeb', app: 'exApp', miniprogram: 'exMini', tablet: 'exTablet', desktop: 'exDesktop', poster: 'exPoster', slides: 'exSlides', email: 'exEmail' }
|
|
7459
|
+
const ASK_KINDS = ['app', 'miniprogram', 'web', 'poster', 'slides', 'diagram', 'tablet', 'desktop', 'email']
|
|
7460
|
+
const ASK_EX = { web: 'exWeb', app: 'exApp', miniprogram: 'exMini', tablet: 'exTablet', desktop: 'exDesktop', poster: 'exPoster', slides: 'exSlides', email: 'exEmail', diagram: 'exDiagram' }
|
|
7433
7461
|
function HomeAsk({ t, onSend, onRef, plus, draft, note, autoFocus }) {
|
|
7434
7462
|
const d0 = (draft && draft.current) || {}
|
|
7435
7463
|
const [text, setText] = useState(d0.text || '')
|
|
@@ -7646,8 +7674,8 @@ ${Object.entries(CHIP_ICON).map(([k, d]) => `[data-composer-chip="${chipSrc(k)}"
|
|
|
7646
7674
|
h('div', { className: 'acts' },
|
|
7647
7675
|
isTpl ? h('button', { className: 'ddp-pbtn', disabled: busy, title: t('mkUseTip'), onClick: use }, t('mkUse')) : null,
|
|
7648
7676
|
e.type === 'system' ? h('button', { className: 'ddp-pbtn', disabled: busy, onClick: install }, t('mkInstall')) : null,
|
|
7649
|
-
//
|
|
7650
|
-
!err && e.type !== 'style' && e.kind !== 'poster' && e.kind !== 'slides' ? h('button', { className: 'ddp-sbtn', disabled: busy, title: t('mkLiveTip'), onClick: () => (live ? setLive(null) : goLive()) }, live ? t('mkShotsBack') : t('mkLive')) : null,
|
|
7677
|
+
// 海报、幻灯片、图表是定尺寸的画面、没什么可点的:只看截图(实时看会按原尺寸撑出框)
|
|
7678
|
+
!err && e.type !== 'style' && e.kind !== 'poster' && e.kind !== 'slides' && e.kind !== 'diagram' ? h('button', { className: 'ddp-sbtn', disabled: busy, title: t('mkLiveTip'), onClick: () => (live ? setLive(null) : goLive()) }, live ? t('mkShotsBack') : t('mkLive')) : null,
|
|
7651
7679
|
e.type !== 'style' ? h('button', { className: 'ddp-sbtn' + (fav ? ' on' : ''), title: t('mkFavTip'), 'aria-pressed': !!fav, onClick: toggleFav }, fav ? '★ ' + t('mkFaved') : '☆ ' + t('mkFav')) : null),
|
|
7652
7680
|
h('ul', { className: 'facts' },
|
|
7653
7681
|
h('li', null, t('mkSafe')),
|
|
@@ -7686,7 +7714,7 @@ ${Object.entries(CHIP_ICON).map(([k, d]) => `[data-composer-chip="${chipSrc(k)}"
|
|
|
7686
7714
|
* over 比画幅大(横向永远会被裁;幻灯片、海报竖向也算);long 长页只截到一部分;dead 点了没反应的链接
|
|
7687
7715
|
*/
|
|
7688
7716
|
function precheckOf(list, kind, limit) {
|
|
7689
|
-
const fixed = kind === 'slides' || kind === 'poster'
|
|
7717
|
+
const fixed = kind === 'slides' || kind === 'poster' || kind === 'diagram'
|
|
7690
7718
|
const r = { over: 0, long: 0, moved: 0, dead: 0, fail: 0, ai: new Set(list.flatMap((m) => (Array.isArray(m.aiPhotos) ? m.aiPhotos : []))).size }
|
|
7691
7719
|
for (const m of list) {
|
|
7692
7720
|
if (m.failed) { r.fail++; continue }
|
|
@@ -7702,7 +7730,7 @@ ${Object.entries(CHIP_ICON).map(([k, d]) => `[data-composer-chip="${chipSrc(k)}"
|
|
|
7702
7730
|
|
|
7703
7731
|
/** 「按内容改画幅」改成多大:'宽x高',不用改或改不了返回 ''。幻灯片、海报按量到的版面,别的只把宽度加上去;竖着堆了好几页的不改高 */
|
|
7704
7732
|
function fitCanvas(list, kind, size) {
|
|
7705
|
-
const fixed = kind === 'slides' || kind === 'poster'
|
|
7733
|
+
const fixed = kind === 'slides' || kind === 'poster' || kind === 'diagram'
|
|
7706
7734
|
let [W, H] = size
|
|
7707
7735
|
for (const m of list) {
|
|
7708
7736
|
if (m.failed) continue
|
package/lib/core.js
CHANGED
|
@@ -34,8 +34,8 @@ const BG_JOB = /\bbackground job\s+`?([\w.:-]{3,})/i
|
|
|
34
34
|
const MAX_SCREENS = 60 // 右侧最多显示几屏,再多的收起来并提示(画布同时只挂 24 屏,见 client.js 的 LIVE_MAX)
|
|
35
35
|
const MAX_ROUTES = 300 // 开发服务器的路由先都记着(只为算出收起了几屏);再多就是写飞了
|
|
36
36
|
|
|
37
|
-
//
|
|
38
|
-
export const KINDS = ['web', 'app', 'miniprogram', 'tablet', 'desktop', 'poster', 'slides', 'email']
|
|
37
|
+
// 设计类型:决定右侧用什么画幅显示(网页框、手机、小程序、平板、桌面软件窗口、海报、幻灯片、邮件、图表)
|
|
38
|
+
export const KINDS = ['web', 'app', 'miniprogram', 'tablet', 'desktop', 'poster', 'slides', 'email', 'diagram']
|
|
39
39
|
const KIND_ALIAS = {
|
|
40
40
|
website: 'web', site: 'web', page: 'web', landing: 'web', dashboard: 'web',
|
|
41
41
|
phone: 'app', mobile: 'app', ios: 'app', android: 'app',
|
|
@@ -45,6 +45,7 @@ const KIND_ALIAS = {
|
|
|
45
45
|
social: 'poster', image: 'poster', banner: 'poster', card: 'poster', flyer: 'poster', cover: 'poster',
|
|
46
46
|
slide: 'slides', deck: 'slides', ppt: 'slides', presentation: 'slides',
|
|
47
47
|
mail: 'email', newsletter: 'email', edm: 'email',
|
|
48
|
+
mindmap: 'diagram', 'mind-map': 'diagram', roadmap: 'diagram', architecture: 'diagram', arch: 'diagram', flowchart: 'diagram', 思维导图: 'diagram', 导图: 'diagram', 脑图: 'diagram', 路线图: 'diagram', 技术路线图: 'diagram', 架构图: 'diagram', 图表: 'diagram',
|
|
48
49
|
}
|
|
49
50
|
|
|
50
51
|
/** 类型名(含常见别名)→ KINDS 里的一个;认不出返回 '' */
|
package/lib/gallery/policy.js
CHANGED
|
@@ -38,10 +38,10 @@ export const capsOf = (mode) => (mode === 'share' || mode === 'ci'
|
|
|
38
38
|
: { files: LIMITS.localFiles, screens: LIMITS.localScreens, total: LIMITS.localTotal })
|
|
39
39
|
export const TYPES = ['template', 'system', 'style']
|
|
40
40
|
export const LICENSES = ['CC0-1.0', 'CC-BY-4.0']
|
|
41
|
-
export const KINDS = ['web', 'app', 'miniprogram', 'tablet', 'desktop', 'poster', 'slides', 'email']
|
|
41
|
+
export const KINDS = ['web', 'app', 'miniprogram', 'tablet', 'desktop', 'poster', 'slides', 'email', 'diagram']
|
|
42
42
|
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
43
|
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' }
|
|
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/index.js
CHANGED
|
@@ -99,10 +99,11 @@ 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 界面、小程序、平板界面、桌面软件、海报 / 社媒图、幻灯片、邮件、图表(思维导图、技术路线图、产品路线图、架构图)、组件这类设计之前先加载:' +
|
|
103
103
|
'配合右侧「设计工作台」画布的做法(一屏一个文件、设计变量、类型标记)、现代设计原则、中文排版、各类型画幅要点、避免 AI 味、设计自查清单。' +
|
|
104
|
-
'
|
|
105
|
-
|
|
104
|
+
'只是把回答做成一页给用户看或用(对比、表格、清单、数据图表、计算器这类,或者在对话里随手看一张导图)不算设计:有 show_page 工具就直接用它,不加载这个技能;' +
|
|
105
|
+
'要「设计」、做好看的、要导出成图片 / PDF / PPT 的思维导图、路线图、架构图才用这个技能。',
|
|
106
|
+
whenToUse: '用户要做或改网站 / App / 海报 / 幻灯片 / 思维导图 / 路线图 / 架构图这类界面或视觉设计时(把回答做成一页、有 show_page 工具时用 show_page)',
|
|
106
107
|
invocation: { modelInvocable: true, userInvocable: true },
|
|
107
108
|
provider: 'dsh-design-studio',
|
|
108
109
|
source: 'bundled',
|
|
@@ -129,8 +130,8 @@ export const previewTool = {
|
|
|
129
130
|
name: 'preview_page',
|
|
130
131
|
description:
|
|
131
132
|
'在右侧栏「设计工作台」里实时打开一个页面,用户能边看边点选要改的地方。' +
|
|
132
|
-
'做网页、App
|
|
133
|
-
'
|
|
133
|
+
'做网页、App 界面、小程序、海报、幻灯片、邮件、图表(思维导图、路线图、架构图)这类设计时用:写好第一个 HTML 文件、或启动开发服务器后调一次就行,之后改文件会自动刷新,不用再调。' +
|
|
134
|
+
'只是把回答做成一页(对比、表格、清单、数据图表、计算器)给用户看或用时,有 show_page 工具就用它,不用这里。' +
|
|
134
135
|
'本地 HTML 写文件路径;开发服务器写地址或端口(如 http://localhost:5173)。只能预览本机页面。' +
|
|
135
136
|
'kind 说明是哪类设计,右侧按它的画幅显示(App 套手机外框、幻灯片 16:9 …)。' +
|
|
136
137
|
'动手设计前先加载 ui-design 技能(设计流程、规范和自查清单)。' +
|
|
@@ -142,7 +143,7 @@ export const previewTool = {
|
|
|
142
143
|
kind: {
|
|
143
144
|
type: 'string',
|
|
144
145
|
enum: KINDS,
|
|
145
|
-
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
|
|
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
147
|
},
|
|
147
148
|
size: { type: 'string', description: '画幅尺寸,可选,如 1080x1920;不填按类型的默认尺寸' },
|
|
148
149
|
screens: {
|
|
@@ -611,7 +612,7 @@ export const styleTool = {
|
|
|
611
612
|
'用户点了风格卡(消息里有〔风格〕)、自己定了具体的风格或配色、或有默认的品牌设计系统时不用调;只说「你定」「帮我推荐一个」「出几个风格挑」算没定,要调。',
|
|
612
613
|
parameters: specToJsonSchema({
|
|
613
614
|
subject: { type: 'string', required: true, description: '这次要做什么,直接写用户的原话' },
|
|
614
|
-
kind: { type: 'string', enum: ['web', 'app', 'miniprogram', 'tablet', 'desktop', 'poster', 'slides', 'email'], description: '设计类型' },
|
|
615
|
+
kind: { type: 'string', enum: ['web', 'app', 'miniprogram', 'tablet', 'desktop', 'poster', 'slides', 'email', 'diagram'], description: '设计类型' },
|
|
615
616
|
count: { type: 'number', description: '要几个方向,1–3,默认 1;要先出三个方向时填 3,每个方向一张不同的卡' },
|
|
616
617
|
}),
|
|
617
618
|
output: {
|
package/lib/look.js
CHANGED
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
import fs from 'node:fs'
|
|
10
10
|
import path from 'node:path'
|
|
11
11
|
|
|
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] }
|
|
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
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' }
|
|
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
15
|
// 只给宽度时的高:常见真机的屏幕高;别的宽度按这一类默认的宽高比
|
|
16
16
|
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
17
|
const TABLET_H = { 744: 1133, 768: 1024, 810: 1080, 820: 1180, 834: 1194, 1024: 1366, 1032: 1376 }
|
|
@@ -51,8 +51,8 @@ export function sizeOf(v, kind) {
|
|
|
51
51
|
return [w, dh]
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
// 定死画面的类型:页面比默认画幅大(写死了 1440×810 又没写进 meta
|
|
55
|
-
const AUTO_RATIO = { slides: [1.2, 2.4], poster: [0.45, 2.5] }
|
|
54
|
+
// 定死画面的类型:页面比默认画幅大(写死了 1440×810 又没写进 meta)就按页面实际大小。比例不像一页的(几页竖着堆的)不算。图表:图多大画幅多大
|
|
55
|
+
const AUTO_RATIO = { slides: [1.2, 2.4], poster: [0.45, 2.5], diagram: [0.3, 4] }
|
|
56
56
|
|
|
57
57
|
/** 各屏量到的实际大小 → 'WxH'(都没比默认大:'')。和右侧栏 client.js 的 autoSize 一样 */
|
|
58
58
|
export function autoSize(list, kind) {
|
|
@@ -403,7 +403,7 @@ const TYPE = {
|
|
|
403
403
|
tiny: '字太小', img: '图片没加载出来', fonts: '字号太杂', distort: '图片被拉变形', long: '一行太长', wrap: '文字被挤断行',
|
|
404
404
|
covered: '被固定栏压住', tight: '离固定栏太近', jserr: '页面脚本报错', missing: '文件没载出来', deadlink: '跳到的页面不存在',
|
|
405
405
|
capsule: '被小程序胶囊挡住', island: '被灵动岛挡住', homebar: '伸进底部横条区', tabbar: '标签栏项太多', navbar: '没有导航栏',
|
|
406
|
-
winctl: '被窗口按钮挡住',
|
|
406
|
+
winctl: '被窗口按钮挡住', dgsize: '图比画幅大', dgli: '导图节点写法不对', dgmany: '一层放太多', dgbar: '横条超出时间轴', dgtext: '节点字太多',
|
|
407
407
|
}
|
|
408
408
|
const EDGE = { top: '顶栏', bottom: '底栏' }
|
|
409
409
|
const WHAT = { css: '样式表', script: '脚本', font: '字体', link: '文件', video: '视频', audio: '音频', source: '媒体', iframe: '内嵌页' }
|
|
@@ -455,6 +455,11 @@ export function detailOf(it) {
|
|
|
455
455
|
: `伸进左上角红绿灯 ${it.px}px(外框画的、盖在页面上面,在 x 20–72、y 20–32:工具栏 / 侧栏顶上左边空出 80px,标题、按钮从 x 80 以后放)`
|
|
456
456
|
case 'jserr': return `${it.msg}${it.src ? `(${it.src}${it.line ? `:${it.line}` : ''})` : ''}`
|
|
457
457
|
case 'missing': return `${WHAT[it.what] || '文件'} ${it.src} 载不出来(路径写错了,或者文件不在)`
|
|
458
|
+
case 'dgsize': return `图有 ${it.w}×${it.h},画幅只有 ${it.vw}×${it.vh}:把 meta 改成 diagram ${it.w}x${it.h}(preview_page 的 size 也改),或者删减节点、改小间距`
|
|
459
|
+
case 'dgli': return '字直接写在 li 里,或者 li 的第一个孩子不是 <span class="mm-node">:连线会对不上,改成 <li><span class="mm-node">…</span><ul>…</ul></li>'
|
|
460
|
+
case 'dgmany': return it.what === 'box' ? `一行 ${it.n} 个框(最多 ${it.max} 个):拆成两行,或者合并几个` : `这一层 ${it.n} 个分支(最多 ${it.max} 个):合并几个、往下多分一层,或者拆成两张图`
|
|
461
|
+
case 'dgbar': return `从第 ${it.from} 段起占 ${it.span} 段,可时间轴只有 ${it.cols} 段(--cols):改小 --span / --from,或者加大 --cols 并补上表头`
|
|
462
|
+
case 'dgtext': return `${it.chars} 个字(最好 ≤ ${it.max}):节点写关键词,补充放 <small>,或者拆成下一级`
|
|
458
463
|
default: return ''
|
|
459
464
|
}
|
|
460
465
|
}
|