dsh-ppt 0.24.2 → 0.26.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 +16 -0
- package/README.en.md +13 -13
- package/README.md +13 -13
- package/docs/DATA.md +2 -2
- package/docs/REFERENCE.en.md +8 -8
- package/docs/REFERENCE.zh.md +8 -8
- package/docs/USAGE.en.md +11 -7
- package/docs/USAGE.md +11 -7
- package/docs/VALIDATION.md +4 -0
- package/docs/WORKBENCH.md +4 -4
- package/docs/assets/intro/workflow-en-dark.svg +1 -1
- package/docs/assets/intro/workflow-en-light.svg +1 -1
- package/docs/assets/intro/workflow-en-mobile-dark.svg +1 -1
- package/docs/assets/intro/workflow-en-mobile-light.svg +1 -1
- package/docs/assets/intro/workflow-zh-dark.svg +1 -1
- package/docs/assets/intro/workflow-zh-light.svg +1 -1
- package/docs/assets/intro/workflow-zh-mobile-dark.svg +1 -1
- package/docs/assets/intro/workflow-zh-mobile-light.svg +1 -1
- package/lib/client.js +3435 -467
- package/lib/ecosystem.d.ts +73 -0
- package/lib/ecosystem.js +1352 -0
- package/lib/execution.d.ts +6 -1
- package/lib/execution.js +69 -0
- package/lib/tools.js +77 -0
- package/lib/types.d.ts +57 -1
- package/lib/workbench-language.js +4 -0
- package/lib/workbench.d.ts +2 -0
- package/lib/workbench.js +331 -8
- package/package.json +1 -1
- package/skills/dsh-ppt/SKILL.md +3 -3
- package/skills/dsh-ppt/package.json +1 -1
- package/skills/dsh-ppt/references/advanced.md +10 -5
- package/skills/dsh-ppt/references/syntax.md +1 -0
- package/skills/dsh-ppt/scripts/build-deck.mjs +39 -8
- package/skills/dsh-ppt/scripts/deck-advanced.mjs +50 -13
- package/skills/dsh-ppt/scripts/deck-chrome.mjs +1706 -0
- package/skills/dsh-ppt/scripts/deck-core.mjs +116 -6
- package/skills/dsh-ppt/scripts/deck-delivery.mjs +636 -41
- package/skills/dsh-ppt/scripts/deck-diagrams.mjs +2842 -0
- package/skills/dsh-ppt/scripts/deck-director.mjs +49 -3
- package/skills/dsh-ppt/scripts/deck-layouts.mjs +482 -5270
- package/skills/dsh-ppt/scripts/deck-mermaid.mjs +2737 -0
- package/skills/dsh-ppt/scripts/deck-office.mjs +1541 -0
|
@@ -1660,16 +1660,55 @@ function splitLeadAndBody(bullet) {
|
|
|
1660
1660
|
return { title: stripInlineMarkdown(raw), text: '' }
|
|
1661
1661
|
}
|
|
1662
1662
|
|
|
1663
|
+
function extractMermaidFromSlide(slide) {
|
|
1664
|
+
if (typeof slide?.mermaid === 'string' && slide.mermaid.trim()) {
|
|
1665
|
+
return slide.mermaid.trim()
|
|
1666
|
+
}
|
|
1667
|
+
const textRaw = typeof slide?.text === 'string' ? slide.text : ''
|
|
1668
|
+
const fenceMatch = /```mermaid\s*\n([\s\S]*?)```/i.exec(textRaw)
|
|
1669
|
+
if (fenceMatch && fenceMatch[1].trim()) {
|
|
1670
|
+
return fenceMatch[1].trim()
|
|
1671
|
+
}
|
|
1672
|
+
const bullets = Array.isArray(slide?.bullets) ? slide.bullets : []
|
|
1673
|
+
const joined = [textRaw, ...bullets].filter(Boolean).join('\n')
|
|
1674
|
+
const joinedFence = /```mermaid\s*\n([\s\S]*?)```/i.exec(joined)
|
|
1675
|
+
if (joinedFence && joinedFence[1].trim()) {
|
|
1676
|
+
return joinedFence[1].trim()
|
|
1677
|
+
}
|
|
1678
|
+
if (bullets.length >= 2) {
|
|
1679
|
+
const first = String(bullets[0] ?? '').trim()
|
|
1680
|
+
const isMermaidHeader = /^(?:flowchart\s+(?:TD|TB|LR|RL)|graph\s+(?:TD|TB|LR|RL)|sequenceDiagram)\b/i.test(first)
|
|
1681
|
+
const hasEdges = bullets.slice(1).some((b) => /(?:-->|-.->|==>|---|<-->|->>|-->>)/.test(String(b)))
|
|
1682
|
+
if (isMermaidHeader && hasEdges) {
|
|
1683
|
+
return bullets.map((b) => String(b).trim()).join('\n')
|
|
1684
|
+
}
|
|
1685
|
+
}
|
|
1686
|
+
if (/^(?:flowchart\s+(?:TD|TB|LR|RL)|graph\s+(?:TD|TB|LR|RL)|sequenceDiagram)\b/i.test(textRaw.trim()) && /(?:-->|-.->|==>|->>|-->>)/.test(textRaw)) {
|
|
1687
|
+
return textRaw.trim()
|
|
1688
|
+
}
|
|
1689
|
+
return ''
|
|
1690
|
+
}
|
|
1691
|
+
|
|
1663
1692
|
export function promoteMarkdownSlides(slides, options = {}) {
|
|
1664
1693
|
if (!Array.isArray(slides) || slides.length === 0) return slides
|
|
1694
|
+
|
|
1695
|
+
const result = slides.map((s) => {
|
|
1696
|
+
const copy = { ...s }
|
|
1697
|
+
const mermaidCode = extractMermaidFromSlide(copy)
|
|
1698
|
+
if (mermaidCode && (!copy.layout || copy.layout === 'bullets' || copy.layout === 'mermaid' || copy.layout === 'flowchart' || copy.layout === 'sequence')) {
|
|
1699
|
+
copy.layout = 'mermaid'
|
|
1700
|
+
copy.mermaid = mermaidCode
|
|
1701
|
+
}
|
|
1702
|
+
return copy
|
|
1703
|
+
})
|
|
1704
|
+
|
|
1665
1705
|
const minBodySlides = options.explicitSmartLayout ? 2 : 4
|
|
1666
|
-
const bodyIndices =
|
|
1706
|
+
const bodyIndices = result
|
|
1667
1707
|
.map((s, idx) => (!['cover', 'section', 'closing', 'agenda'].includes(s.layout) ? idx : -1))
|
|
1668
1708
|
.filter((idx) => idx >= 0)
|
|
1669
1709
|
|
|
1670
|
-
if (bodyIndices.length < minBodySlides) return
|
|
1710
|
+
if (bodyIndices.length < minBodySlides) return result
|
|
1671
1711
|
|
|
1672
|
-
const result = slides.map((s) => ({ ...s }))
|
|
1673
1712
|
let chapterIndex = 0
|
|
1674
1713
|
let consecutiveBullets = 0
|
|
1675
1714
|
let cardStyleToggle = 0
|
|
@@ -1689,6 +1728,13 @@ export function promoteMarkdownSlides(slides, options = {}) {
|
|
|
1689
1728
|
slide.kicker = String(chapterIndex).padStart(2, '0')
|
|
1690
1729
|
}
|
|
1691
1730
|
|
|
1731
|
+
if (slide.layout === 'mermaid' || (typeof slide.mermaid === 'string' && slide.mermaid.trim())) {
|
|
1732
|
+
slide.layout = 'mermaid'
|
|
1733
|
+
slide.mermaid = String(slide.mermaid).trim()
|
|
1734
|
+
consecutiveBullets = 0
|
|
1735
|
+
continue
|
|
1736
|
+
}
|
|
1737
|
+
|
|
1692
1738
|
if (slide.layout !== 'bullets' || !Array.isArray(slide.bullets) || slide.bullets.length === 0) {
|
|
1693
1739
|
consecutiveBullets = 0
|
|
1694
1740
|
continue
|