dsh-ppt 0.23.1 → 0.24.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.
@@ -1642,6 +1642,10 @@ const ARCH_TITLE_RE = /技术架构|系统架构|平台架构|总体架构|分
1642
1642
  const TAM_TITLE_RE = /市场规模|市场空间|可触达市场|\bTAM\b|\bSAM\b|\bSOM\b|addressable\s*market|market\s*sizing/i
1643
1643
  const ORG_TITLE_RE = /组织架构|团队介绍|治理架构|汇报线|核心团队|管理团队|org\s*chart|organization|leadership\s*team|team\s*structure/i
1644
1644
  const HARVEY_TITLE_RE = /竞品对比|能力矩阵|选型对比|能力评估|competitor\s*matrix|capability\s*matrix|feature\s*matrix|harvey/i
1645
+ const MARIMEKKO_TITLE_RE = /marimekko|不等宽|市场地图|市场格局|竞争版图|赛道份额|market\s*map/i
1646
+ const SANKEY_TITLE_RE = /sankey|桑基|流向图|资金流向|营收拆解|利润分配|营收转化|flow\s*diagram|revenue\s*bridge/i
1647
+ const SWOT_TITLE_RE = /\bswot\b|优劣势与机会威胁/i
1648
+ const PORTER_VALUE_CHAIN_RE = /波特价值链|porter\s*value\s*chain|辅助活动.*基本活动/i
1645
1649
 
1646
1650
  function splitLeadAndBody(bullet) {
1647
1651
  const raw = String(bullet ?? '').trim()
@@ -1679,7 +1683,9 @@ export function promoteMarkdownSlides(slides, options = {}) {
1679
1683
  }
1680
1684
 
1681
1685
  chapterIndex += 1
1682
- if (/^(?:要点|Key\s*point)$/i.test(String(slide.kicker ?? '').trim())) {
1686
+ const curKicker = String(slide.kicker ?? '').trim()
1687
+ const curTitle = String(slide.title ?? '').trim()
1688
+ if (/^(?:要点|Key\s*point)$/i.test(curKicker) || (curKicker && curTitle && curKicker === curTitle)) {
1683
1689
  slide.kicker = String(chapterIndex).padStart(2, '0')
1684
1690
  }
1685
1691
 
@@ -1791,6 +1797,24 @@ export function promoteMarkdownSlides(slides, options = {}) {
1791
1797
  continue
1792
1798
  }
1793
1799
 
1800
+ if (n >= 2 && n <= 8 && (SANKEY_TITLE_RE.test(titleText) || bullets.filter((b) => /(?:->|→)/.test(b) && /\d/.test(b)).length / n >= 0.66) && maxLen <= 96) {
1801
+ slide.layout = 'sankey'
1802
+ consecutiveBullets = 0
1803
+ continue
1804
+ }
1805
+
1806
+ if (n >= 2 && n <= 6 && MARIMEKKO_TITLE_RE.test(titleText) && maxLen <= 96) {
1807
+ slide.layout = 'marimekko'
1808
+ consecutiveBullets = 0
1809
+ continue
1810
+ }
1811
+
1812
+ if (n === 4 && SWOT_TITLE_RE.test(titleText) && maxLen <= 80) {
1813
+ slide.layout = 'swot'
1814
+ consecutiveBullets = 0
1815
+ continue
1816
+ }
1817
+
1794
1818
  if (n === 4 && MATRIX_TITLE_RE.test(titleText) && maxLen <= 68) {
1795
1819
  slide.layout = 'matrix'
1796
1820
  slide.variant = '2x2'
@@ -1805,6 +1829,12 @@ export function promoteMarkdownSlides(slides, options = {}) {
1805
1829
  continue
1806
1830
  }
1807
1831
 
1832
+ if (n >= 3 && n <= 8 && PORTER_VALUE_CHAIN_RE.test(titleText + ' ' + bullets.join(' ')) && maxLen <= 90) {
1833
+ slide.layout = 'value-chain'
1834
+ consecutiveBullets = 0
1835
+ continue
1836
+ }
1837
+
1808
1838
  if (n >= 3 && n <= 6 && /价值链|端到端|全链路|研产销|产业链|业务链路|value\s*chain|end-to-end/i.test(titleText) && maxLen <= 74) {
1809
1839
  slide.layout = 'process'
1810
1840
  slide.variant = 'chevron'