dsh-ppt 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/CHANGELOG.md +5 -0
- package/README.en.md +1 -0
- package/README.md +1 -0
- package/docs/WORKBENCH.md +6 -0
- package/lib/client.js +40 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
[历史英文记录](docs/CHANGELOG.en.md)
|
|
6
6
|
|
|
7
|
+
## 0.20.0 (2026-10-29)
|
|
8
|
+
|
|
9
|
+
- 工程库新增关键词搜索和最近 / 最早更新、自然标题排序;保留返回列表时的筛选条件,提供无匹配提示和清空搜索。
|
|
10
|
+
- Add project search and updated / oldest / natural-title sorting, retained filters on return, and a clear no-results state.
|
|
11
|
+
|
|
7
12
|
## 0.19.1 (2026-10-29)
|
|
8
13
|
|
|
9
14
|
- 同步仓库与 npm 的简明介绍、中英文 README 和反馈入口;本次为文档与包元数据更新。
|
package/README.en.md
CHANGED
|
@@ -14,6 +14,7 @@ Open the workbench from the native DSH sidebar. See the [workbench guide](docs/W
|
|
|
14
14
|
|
|
15
15
|
## What it does
|
|
16
16
|
|
|
17
|
+
- Search projects and sort by update time or natural title; keep filters when returning to the library.
|
|
17
18
|
Optional **visual review and repair** inspects images rendered from the actual PPTX, highlights problem regions, creates a formatting-only copy and renders it again for rechecking. The original stays intact. See [visual review](docs/VISUAL.md#english).
|
|
18
19
|
|
|
19
20
|
Optional **AI review** and **rehearsal** reuse models configured in DSH. Both are off by default: download the finished presentation directly, or explicitly start a bounded rehearsal. Compare proposed wording edits, save selected changes and backup Q&A slides to an undoable copy, and export Q&A with an evidence checklist. See [the rehearsal guide](docs/COACHING.md#english). AI suggestions are not fact checks.
|
package/README.md
CHANGED
package/docs/WORKBENCH.md
CHANGED
|
@@ -39,3 +39,9 @@ Edit the template sources and run pnpm run build. Commit generated lib/client.js
|
|
|
39
39
|
邮件使用受控 AgentMail HTTP 服务,日历使用受控 CalDAV 协议传输;插件处理器、存储、校验和原生宿主均实际运行。未使用真实邮箱、真实日历账号或付费模型。RSS 访问 Node.js 官方公开来源。PPT 实际生成并渲染 PPTX、下载 ZIP;两个视频插件实际运行官方引擎并播放 MP4。
|
|
40
40
|
|
|
41
41
|
这些是 Web 共用界面的验收结果,不代表已验收 Electron 专属菜单、系统权限、真实账号、全部外部来源或所有可选模型/引擎。Docker、Slack、钉钉继续按用户约定搁置。
|
|
42
|
+
|
|
43
|
+
## 工程查找 / Find projects
|
|
44
|
+
|
|
45
|
+
工程列表可按关键词筛选,并按最近更新、最早更新或自然标题顺序排列;多个词需要同时匹配。PPT 只查目录中的标题和工程路径;视频查标题、正文和模板,当前列表与归档列表各自保留筛选条件。清空搜索会恢复完整列表,返回工程库会保留刚才的搜索和排序。筛选只在本机列表中执行,不读取未选工程的完整文件,也不修改工程内容。
|
|
46
|
+
|
|
47
|
+
Search the local project list and sort by newest update, oldest update or natural title. Multiple terms must all match. PPT searches catalog titles and paths; video searches titles, text and templates, with separate active/archive filters. Clear restores the full list; returning from editing preserves filters. Filtering does not load unselected project files or change project contents.
|
package/lib/client.js
CHANGED
|
@@ -613,6 +613,44 @@ const PPT_WORKBENCH_CSS = `
|
|
|
613
613
|
@media(max-width:700px){.ppt-workbench.pptw[data-main=true]{padding:calc(16px + var(--dsh-frame-top-clearance,0px)) 16px 0 max(16px,var(--dsh-frame-leading-clearance,0px))}}
|
|
614
614
|
`;
|
|
615
615
|
|
|
616
|
+
// Per-view preferences stay in this plugin instance; user files are never changed.
|
|
617
|
+
const projectLibraryPreferences = new Map();
|
|
618
|
+
function ProjectLibrary({ items, scope = 'projects', language = 'zh', searchText, updatedAt, renderItem, t, searchHint }) {
|
|
619
|
+
const saved = projectLibraryPreferences.get(scope);
|
|
620
|
+
const [query, setQuery] = React.useState(saved?.query || '');
|
|
621
|
+
const [order, setOrder] = React.useState(saved?.order || 'updated');
|
|
622
|
+
const controlId = React.useId();
|
|
623
|
+
const normalize = text => String(text ?? '').normalize('NFKC').toLocaleLowerCase(language);
|
|
624
|
+
const words = normalize(query).trim().split(/\s+/).filter(Boolean);
|
|
625
|
+
const collator = new Intl.Collator(language, { numeric: true, sensitivity: 'base' });
|
|
626
|
+
const timestamp = row => { const value = Date.parse(updatedAt(row)); return Number.isFinite(value) ? value : 0; };
|
|
627
|
+
const visible = items.filter(row => words.every(word => normalize(searchText(row)).includes(word))).sort((a, b) => {
|
|
628
|
+
const tie = collator.compare(String(a.title || ''), String(b.title || '')) || String(a.id).localeCompare(String(b.id));
|
|
629
|
+
return order === 'title' ? tie : (order === 'oldest' ? timestamp(a) - timestamp(b) : timestamp(b) - timestamp(a)) || tie;
|
|
630
|
+
});
|
|
631
|
+
function change(nextQuery, nextOrder) {
|
|
632
|
+
projectLibraryPreferences.set(scope, { query: nextQuery, order: nextOrder });
|
|
633
|
+
setQuery(nextQuery); setOrder(nextOrder);
|
|
634
|
+
}
|
|
635
|
+
return h('section', { className: 'project-library', 'aria-label': t('工程查找', 'Find projects') },
|
|
636
|
+
h('style', null, PROJECT_LIBRARY_CSS),
|
|
637
|
+
h('div', { className: 'project-library-controls' },
|
|
638
|
+
h('label', { htmlFor: controlId + '-query' }, t('搜索工程', 'Search projects'),
|
|
639
|
+
h('input', { id: controlId + '-query', type: 'search', value: query, placeholder: searchHint, maxLength: 200,
|
|
640
|
+
onChange: e => change(e.target.value, order), onKeyDown: e => { if (e.key === 'Escape' && query) { e.preventDefault(); e.stopPropagation(); change('', order); } } })),
|
|
641
|
+
h('label', { htmlFor: controlId + '-order' }, t('排序', 'Sort by'),
|
|
642
|
+
h('select', { id: controlId + '-order', value: order, onChange: e => change(query, e.target.value) },
|
|
643
|
+
h('option', { value: 'updated' }, t('最近更新', 'Recently updated')),
|
|
644
|
+
h('option', { value: 'oldest' }, t('最早更新', 'Oldest updated')),
|
|
645
|
+
h('option', { value: 'title' }, t('标题', 'Title')))),
|
|
646
|
+
query ? h(W.Button, { variant: 'ghost', onClick: () => change('', order) }, t('清空搜索', 'Clear search')) : null),
|
|
647
|
+
h('p', { className: 'w-muted project-library-count', role: 'status', 'aria-live': 'polite' },
|
|
648
|
+
t('显示 ', 'Showing ') + visible.length + ' / ' + items.length + t(' 个工程', ' projects')),
|
|
649
|
+
visible.length ? visible.map(renderItem) : h(W.Empty, { title: t('没有匹配的工程', 'No matching projects'), icon: 'folder' },
|
|
650
|
+
t('换个关键词,或清空搜索查看全部工程。', 'Try another keyword or clear the search to show all projects.')));
|
|
651
|
+
}
|
|
652
|
+
const PROJECT_LIBRARY_CSS = `.project-library{min-width:0}.project-library-controls{display:flex;gap:12px;align-items:end;flex-wrap:wrap;padding:12px 0}.project-library-controls>label{display:grid;gap:6px;margin:0!important;min-width:0;color:var(--w-muted);font-size:13px}.project-library-controls>label:first-child{flex:1 1 240px}.project-library-controls>label:nth-child(2){flex:0 1 180px}.project-library-controls input,.project-library-controls select{width:100%;min-width:0;min-height:38px;font:inherit;color:var(--w-text);background:var(--w-bg);border:1px solid var(--w-border);border-radius:8px;padding:8px 10px}.project-library-count{margin:4px 0 12px;font-size:12px}.project-library-controls :focus-visible{outline:2px solid var(--w-accent);outline-offset:3px}@media(max-width:520px){.project-library-controls>label:first-child{flex-basis:100%}.project-library-controls>label:nth-child(2){flex:1 1 160px}}`;
|
|
653
|
+
|
|
616
654
|
const { useState, useEffect, useRef, useMemo } = React;
|
|
617
655
|
const h = React.createElement;
|
|
618
656
|
// Interface language follows DSH; user content and stored records keep their original text.
|
|
@@ -1630,7 +1668,7 @@ if(!rootElement.current?.contains(event.target) || event.target?.closest?.('[rol
|
|
|
1630
1668
|
h(W.Button,{icon:'download',disabled:busy || dirty || dataDirty || imagePending,title:dirty || dataDirty?pptText('先保存当前修改','Save changes first'):undefined,onClick:()=>setDownloadOpen(true)},pptText('下载成品','Download output'))) : h(W.IconButton,{icon:'refresh',label:t('刷新项目'),disabled:busy,onClick:refreshList})},
|
|
1631
1669
|
h('style',null,css),h('style',null,PPT_WORKBENCH_CSS),error && h('div', { role: 'alert', className: 'notice error' }, error, ' ', h('button', { disabled: busy || dataDirty, onClick: () => project ? open(project.id) : refreshList() }, t("重试"))),conflict && project && h('button', { disabled: busy || dataDirty, onClick: keepInputsAndReload }, t("载入最新版本,保留我的输入")),h(W.Status,{tone:'success'},message),busy?h(W.Status,null,job):null,
|
|
1632
1670
|
dataDirty ? h(W.Status,null,h('div',{className:'ppt-data-warning'},pptText('数据推演或材料尚未保存,成品仍是已保存版本。','Scenario or source changes are unsaved. Output still uses saved values.'),h(W.Button,{variant:'ghost',onClick:()=>setActiveTab('data')},pptText('前往数据与推演','Open data and what-if')))) : null,
|
|
1633
|
-
!project ? projects.length ? h('div',{className:'ppt-library'},projects
|
|
1671
|
+
!project ? projects.length ? h('div',{className:'ppt-library'},h(ProjectLibrary,{items:projects,language:languageOf(),t:pptText,searchHint:pptText('搜索标题或工程路径','Search titles or project paths'),searchText:row=>row.title+' '+row.path,updatedAt:row=>row.updatedAt,renderItem:row=>h(W.Row,{key:row.id,title:row.title,description:row.path,disabled:busy,onClick:()=>{setActiveTab('content');open(row.id);}})})) : h('div', { className: 'card' }, h('h3', null, t("还没有可以编辑的项目")), h('p', null, t("先在对话中让助手生成演示文稿。已有项目可以让助手调用 ppt_check 检查一次,它会出现在这里。")), h('p', { className: 'muted' }, t("示例:请把这份材料制作成可直接交付的演示文稿,生成 HTML、PPTX 和工程文件。")), h('div', { className: 'tools' }, h('button', { onClick: copyExample }, t("复制示例")))) :
|
|
1634
1672
|
h(W.Tabs,{label:pptText('演示文稿工作台视图','Presentation workbench views'),value:activeTab,onChange:value=>{setActiveTab(value);if(value==='data' && project.dataModel)setMode('html');},items:[{id:'content',label:pptText('内容编辑','Edit content')},{id:'visual',label:pptText('视觉检查','Visual review')},{id:'rehearsal',label:pptText('演练','Rehearsal')},{id:'data',label:pptText('数据与推演','Data and what-if')}]},
|
|
1635
1673
|
h('div',{className:'ppt-editor','data-view':activeTab},
|
|
1636
1674
|
h(PptPages,{project,selected,busy,imagePending,dirty,dataDirty,onChoose:choose,onDuplicate:()=>structure('duplicate')}),
|
|
@@ -1674,7 +1712,7 @@ W.register(ctx,{id:'dsh-ppt.workbench',label:()=>t('演示文稿'),icon:'slides'
|
|
|
1674
1712
|
ctx.slots.inject('settings.section', () => ctx.slots.register({ name: 'settings.section', id: 'dsh-ppt', order: 58, label: () => t("演示文稿"), inject: () => ({ locale: localeService }) }, Workbench));
|
|
1675
1713
|
}
|
|
1676
1714
|
return { inject: ['slots', 'locale'], apply, __internals: { draftFor, editorHtml, createImageLoader, modelRouteKey, findModelRoute, reconcileModelRoute } };
|
|
1677
|
-
} },{"name":"dsh-ppt","version":"0.1.0","hasWorkbench":true,"packageVersion":"0.
|
|
1715
|
+
} },{"name":"dsh-ppt","version":"0.1.0","hasWorkbench":true,"packageVersion":"0.20.0","label":"演示文稿","labelEn":"PPT","suiteComponent":true}));
|
|
1678
1716
|
|
|
1679
1717
|
})();
|
|
1680
1718
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-ppt",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "DSH 演示文稿:HTML / 可编辑 PPTX /
|
|
3
|
+
"version": "0.20.0",
|
|
4
|
+
"description": "DSH 演示文稿:HTML / 可编辑 PPTX / 工程包、工程检索与轻量编辑、数字溯源和现场推演,可选 AI 审阅。欢迎提交 issues 和 PR。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "lib/index.d.ts",
|