@litfamily/litmuse 0.1.10 → 0.1.12

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.
Files changed (1041) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +77 -11
  3. package/README_ko-KR.md +77 -11
  4. package/bin/litmuse.mjs +1 -5
  5. package/lib/bundle.mjs +1 -1
  6. package/lib/doctor.mjs +20 -31
  7. package/lib/install.mjs +26 -1
  8. package/lib/paths.mjs +1 -0
  9. package/lib/safe-write.mjs +1 -1
  10. package/package.json +2 -2
  11. package/plugin/.muse-plugin/plugin.json +11 -11
  12. package/plugin/hooks/lib/digest.mjs +4 -7
  13. package/plugin/hooks/lib/extensions.mjs +80 -0
  14. package/plugin/hooks/lib/moved.mjs +42 -0
  15. package/plugin/hooks/post-tool-use.mjs +0 -4
  16. package/plugin/hooks/session-start.mjs +6 -1
  17. package/plugin/hooks/stop.mjs +1 -7
  18. package/plugin/hooks/user-prompt-submit.mjs +6 -6
  19. package/plugin/lib/rewind/board.mjs +309 -0
  20. package/plugin/lib/rewind/collect.mjs +69 -15
  21. package/plugin/skills/frontend-ui-ux/SKILL.md +33 -228
  22. package/plugin/skills/lit-adhd/SKILL.md +50 -22
  23. package/plugin/skills/lit-adhd/references/card-examples.md +98 -0
  24. package/plugin/skills/lit-adhd/references/status-taxonomy.md +15 -0
  25. package/plugin/skills/lit-adhd/scripts/rewind.mjs +1 -1
  26. package/plugin/skills/lit-diagram-drawer/SKILL.md +35 -212
  27. package/plugin/skills/lit-docx/SKILL.md +33 -239
  28. package/plugin/skills/lit-pptx/SKILL.md +33 -281
  29. package/plugin/skills/lit-schematic/SKILL.md +35 -224
  30. package/plugin/skills/lit-scientific-visualization/SKILL.md +34 -219
  31. package/plugin/skills/lit-typographic-motion/SKILL.md +33 -165
  32. package/plugin/skills/readme-studio/SKILL.md +35 -100
  33. package/plugin/skills/visual-qa/SKILL.md +35 -175
  34. package/lib/runtime.mjs +0 -73
  35. package/plugin/hooks/lib/motion.mjs +0 -156
  36. package/plugin/lib/office-runtime-lock/package-lock.json +0 -793
  37. package/plugin/lib/office-runtime-lock/package.json +0 -12
  38. package/plugin/lib/office-runtime-lock/requirements.lock +0 -15
  39. package/plugin/lib/office-runtime.mjs +0 -274
  40. package/plugin/lib/office_data.py +0 -493
  41. package/plugin/lib/office_runtime_bootstrap.py +0 -76
  42. package/plugin/lib/ooxml_integrity.py +0 -199
  43. package/plugin/lib/pdf_fonts.py +0 -91
  44. package/plugin/lib/render_pages.py +0 -133
  45. package/plugin/lib/strict-json.mjs +0 -143
  46. package/plugin/skills/frontend-ui-ux/ATTRIBUTION.md +0 -23
  47. package/plugin/skills/frontend-ui-ux/LICENSE +0 -21
  48. package/plugin/skills/frontend-ui-ux/PROVENANCE.json +0 -38
  49. package/plugin/skills/frontend-ui-ux/SOURCE-MANIFEST.json +0 -1060
  50. package/plugin/skills/frontend-ui-ux/THIRD-PARTY-NOTICE.txt +0 -14
  51. package/plugin/skills/frontend-ui-ux/data/design-intelligence.json +0 -1
  52. package/plugin/skills/frontend-ui-ux/examples/design-contract.example.json +0 -186
  53. package/plugin/skills/frontend-ui-ux/examples/phase-3-readme-ab/README.md +0 -9
  54. package/plugin/skills/frontend-ui-ux/kit/components.css +0 -414
  55. package/plugin/skills/frontend-ui-ux/kit/fonts.json +0 -22
  56. package/plugin/skills/frontend-ui-ux/kit/layouts/landing.html +0 -164
  57. package/plugin/skills/frontend-ui-ux/kit/layouts/settings.html +0 -114
  58. package/plugin/skills/frontend-ui-ux/kit/layouts/workspace.html +0 -115
  59. package/plugin/skills/frontend-ui-ux/kit/styles/computational-brutalism.json +0 -227
  60. package/plugin/skills/frontend-ui-ux/kit/styles/field-notes.json +0 -205
  61. package/plugin/skills/frontend-ui-ux/kit/styles/graphite.json +0 -200
  62. package/plugin/skills/frontend-ui-ux/kit/styles/meadow.json +0 -199
  63. package/plugin/skills/frontend-ui-ux/kit/styles/neo-brutalism.json +0 -222
  64. package/plugin/skills/frontend-ui-ux/kit/ui.js +0 -226
  65. package/plugin/skills/frontend-ui-ux/references/_canonical-corpus/legal/frontend-ATTRIBUTION.md +0 -217
  66. package/plugin/skills/frontend-ui-ux/references/_canonical-corpus/legal/frontend-LICENSE-Apache-2.0.txt +0 -201
  67. package/plugin/skills/frontend-ui-ux/references/_canonical-corpus/legal/root-LICENSE +0 -21
  68. package/plugin/skills/frontend-ui-ux/references/_canonical-corpus/manifest.json +0 -873
  69. package/plugin/skills/frontend-ui-ux/references/adaptive-layout.md +0 -92
  70. package/plugin/skills/frontend-ui-ux/references/brand-and-imagery.md +0 -93
  71. package/plugin/skills/frontend-ui-ux/references/complete-contract.md +0 -579
  72. package/plugin/skills/frontend-ui-ux/references/composition.md +0 -85
  73. package/plugin/skills/frontend-ui-ux/references/craft-floor.md +0 -264
  74. package/plugin/skills/frontend-ui-ux/references/creative-directions.md +0 -80
  75. package/plugin/skills/frontend-ui-ux/references/default-editorial-pixel.json +0 -79
  76. package/plugin/skills/frontend-ui-ux/references/design/README.md +0 -248
  77. package/plugin/skills/frontend-ui-ux/references/design/_INDEX.md +0 -191
  78. package/plugin/skills/frontend-ui-ux/references/design/airbnb.md +0 -393
  79. package/plugin/skills/frontend-ui-ux/references/design/airtable.md +0 -92
  80. package/plugin/skills/frontend-ui-ux/references/design/apple.md +0 -250
  81. package/plugin/skills/frontend-ui-ux/references/design/aside.md +0 -209
  82. package/plugin/skills/frontend-ui-ux/references/design/binance.md +0 -348
  83. package/plugin/skills/frontend-ui-ux/references/design/bmw.md +0 -183
  84. package/plugin/skills/frontend-ui-ux/references/design/brutalist-skill.md +0 -92
  85. package/plugin/skills/frontend-ui-ux/references/design/bugatti.md +0 -271
  86. package/plugin/skills/frontend-ui-ux/references/design/cal.md +0 -262
  87. package/plugin/skills/frontend-ui-ux/references/design/claude.md +0 -315
  88. package/plugin/skills/frontend-ui-ux/references/design/clay.md +0 -307
  89. package/plugin/skills/frontend-ui-ux/references/design/clickhouse.md +0 -284
  90. package/plugin/skills/frontend-ui-ux/references/design/clone-from-url.md +0 -65
  91. package/plugin/skills/frontend-ui-ux/references/design/cohere.md +0 -269
  92. package/plugin/skills/frontend-ui-ux/references/design/coinbase.md +0 -132
  93. package/plugin/skills/frontend-ui-ux/references/design/composio.md +0 -310
  94. package/plugin/skills/frontend-ui-ux/references/design/cursor.md +0 -312
  95. package/plugin/skills/frontend-ui-ux/references/design/design-system-architecture.md +0 -244
  96. package/plugin/skills/frontend-ui-ux/references/design/elevenlabs.md +0 -268
  97. package/plugin/skills/frontend-ui-ux/references/design/expo.md +0 -284
  98. package/plugin/skills/frontend-ui-ux/references/design/ferrari.md +0 -317
  99. package/plugin/skills/frontend-ui-ux/references/design/figma.md +0 -223
  100. package/plugin/skills/frontend-ui-ux/references/design/framer.md +0 -249
  101. package/plugin/skills/frontend-ui-ux/references/design/gpt-tasteskill.md +0 -74
  102. package/plugin/skills/frontend-ui-ux/references/design/hashicorp.md +0 -281
  103. package/plugin/skills/frontend-ui-ux/references/design/ibm.md +0 -335
  104. package/plugin/skills/frontend-ui-ux/references/design/image-to-code-skill.md +0 -1228
  105. package/plugin/skills/frontend-ui-ux/references/design/imagegen-brandkit.md +0 -798
  106. package/plugin/skills/frontend-ui-ux/references/design/imagegen-frontend-mobile.md +0 -1465
  107. package/plugin/skills/frontend-ui-ux/references/design/imagegen-frontend-web.md +0 -987
  108. package/plugin/skills/frontend-ui-ux/references/design/intercom.md +0 -149
  109. package/plugin/skills/frontend-ui-ux/references/design/kraken.md +0 -128
  110. package/plugin/skills/frontend-ui-ux/references/design/lamborghini.md +0 -291
  111. package/plugin/skills/frontend-ui-ux/references/design/layout-skill.md +0 -107
  112. package/plugin/skills/frontend-ui-ux/references/design/lazyweb.md +0 -77
  113. package/plugin/skills/frontend-ui-ux/references/design/linear.app.md +0 -370
  114. package/plugin/skills/frontend-ui-ux/references/design/lovable.md +0 -301
  115. package/plugin/skills/frontend-ui-ux/references/design/mastercard.md +0 -368
  116. package/plugin/skills/frontend-ui-ux/references/design/meta.md +0 -369
  117. package/plugin/skills/frontend-ui-ux/references/design/minimalist-skill.md +0 -85
  118. package/plugin/skills/frontend-ui-ux/references/design/minimax.md +0 -260
  119. package/plugin/skills/frontend-ui-ux/references/design/mintlify.md +0 -329
  120. package/plugin/skills/frontend-ui-ux/references/design/miro.md +0 -111
  121. package/plugin/skills/frontend-ui-ux/references/design/mistral.ai.md +0 -264
  122. package/plugin/skills/frontend-ui-ux/references/design/mongodb.md +0 -269
  123. package/plugin/skills/frontend-ui-ux/references/design/nike.md +0 -366
  124. package/plugin/skills/frontend-ui-ux/references/design/notion.md +0 -312
  125. package/plugin/skills/frontend-ui-ux/references/design/nvidia.md +0 -296
  126. package/plugin/skills/frontend-ui-ux/references/design/ollama.md +0 -270
  127. package/plugin/skills/frontend-ui-ux/references/design/opencode.ai.md +0 -284
  128. package/plugin/skills/frontend-ui-ux/references/design/output-skill.md +0 -49
  129. package/plugin/skills/frontend-ui-ux/references/design/pinterest.md +0 -233
  130. package/plugin/skills/frontend-ui-ux/references/design/playstation.md +0 -367
  131. package/plugin/skills/frontend-ui-ux/references/design/posthog.md +0 -259
  132. package/plugin/skills/frontend-ui-ux/references/design/raycast.md +0 -271
  133. package/plugin/skills/frontend-ui-ux/references/design/react-dev-tooling-skill.md +0 -230
  134. package/plugin/skills/frontend-ui-ux/references/design/redesign-skill.md +0 -178
  135. package/plugin/skills/frontend-ui-ux/references/design/renault.md +0 -314
  136. package/plugin/skills/frontend-ui-ux/references/design/replicate.md +0 -264
  137. package/plugin/skills/frontend-ui-ux/references/design/resend.md +0 -306
  138. package/plugin/skills/frontend-ui-ux/references/design/revolut.md +0 -188
  139. package/plugin/skills/frontend-ui-ux/references/design/runwayml.md +0 -247
  140. package/plugin/skills/frontend-ui-ux/references/design/sanity.md +0 -360
  141. package/plugin/skills/frontend-ui-ux/references/design/sentry.md +0 -265
  142. package/plugin/skills/frontend-ui-ux/references/design/shopify.md +0 -353
  143. package/plugin/skills/frontend-ui-ux/references/design/soft-skill.md +0 -98
  144. package/plugin/skills/frontend-ui-ux/references/design/spacex.md +0 -197
  145. package/plugin/skills/frontend-ui-ux/references/design/spotify.md +0 -249
  146. package/plugin/skills/frontend-ui-ux/references/design/starbucks.md +0 -583
  147. package/plugin/skills/frontend-ui-ux/references/design/stitch-design-example.md +0 -121
  148. package/plugin/skills/frontend-ui-ux/references/design/stitch-skill.md +0 -184
  149. package/plugin/skills/frontend-ui-ux/references/design/stripe.md +0 -325
  150. package/plugin/skills/frontend-ui-ux/references/design/supabase.md +0 -258
  151. package/plugin/skills/frontend-ui-ux/references/design/superhuman.md +0 -255
  152. package/plugin/skills/frontend-ui-ux/references/design/taste-skill.md +0 -1206
  153. package/plugin/skills/frontend-ui-ux/references/design/tesla.md +0 -289
  154. package/plugin/skills/frontend-ui-ux/references/design/theverge.md +0 -342
  155. package/plugin/skills/frontend-ui-ux/references/design/together.ai.md +0 -266
  156. package/plugin/skills/frontend-ui-ux/references/design/uber.md +0 -298
  157. package/plugin/skills/frontend-ui-ux/references/design/vercel.md +0 -313
  158. package/plugin/skills/frontend-ui-ux/references/design/vodafone.md +0 -426
  159. package/plugin/skills/frontend-ui-ux/references/design/voltagent.md +0 -326
  160. package/plugin/skills/frontend-ui-ux/references/design/warp.md +0 -256
  161. package/plugin/skills/frontend-ui-ux/references/design/webflow.md +0 -95
  162. package/plugin/skills/frontend-ui-ux/references/design/wired.md +0 -281
  163. package/plugin/skills/frontend-ui-ux/references/design/wise.md +0 -176
  164. package/plugin/skills/frontend-ui-ux/references/design/x.ai.md +0 -260
  165. package/plugin/skills/frontend-ui-ux/references/design/zapier.md +0 -331
  166. package/plugin/skills/frontend-ui-ux/references/designpowers/EVIDENCE.md +0 -97
  167. package/plugin/skills/frontend-ui-ux/references/designpowers/README.md +0 -48
  168. package/plugin/skills/frontend-ui-ux/references/designpowers/UPSTREAM.md +0 -80
  169. package/plugin/skills/frontend-ui-ux/references/designpowers/lane-a-direction.md +0 -64
  170. package/plugin/skills/frontend-ui-ux/references/designpowers/lane-b-execution.md +0 -65
  171. package/plugin/skills/frontend-ui-ux/references/designpowers/lane-c-review.md +0 -65
  172. package/plugin/skills/frontend-ui-ux/references/designpowers/lane-d-memory.md +0 -83
  173. package/plugin/skills/frontend-ui-ux/references/designpowers/orchestration.md +0 -80
  174. package/plugin/skills/frontend-ui-ux/references/designpowers/routing.md +0 -79
  175. package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/LICENSE +0 -21
  176. package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/agents/accessibility-reviewer.md +0 -83
  177. package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/agents/content-writer.md +0 -132
  178. package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/agents/design-builder.md +0 -109
  179. package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/agents/design-critic.md +0 -89
  180. package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/agents/design-lead.md +0 -113
  181. package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/agents/design-scout.md +0 -78
  182. package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/agents/design-strategist.md +0 -121
  183. package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/agents/heuristic-evaluator.md +0 -268
  184. package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/agents/inspiration-scout.md +0 -107
  185. package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/agents/motion-designer.md +0 -120
  186. package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/accessible-content/reference.md +0 -101
  187. package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/adaptive-interfaces/reference.md +0 -109
  188. package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/cognitive-accessibility/reference.md +0 -107
  189. package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/design-debate/reference.md +0 -199
  190. package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/design-debt-tracker/reference.md +0 -174
  191. package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/design-handoff/reference.md +0 -125
  192. package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/design-md/reference.md +0 -106
  193. package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/design-retrospective/reference.md +0 -266
  194. package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/design-review/reference.md +0 -123
  195. package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/design-system-alignment/reference.md +0 -120
  196. package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/designpowers-critique/reference.md +0 -164
  197. package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/heuristic-evaluation/reference.md +0 -85
  198. package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/inclusive-personas/reference.md +0 -98
  199. package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/inspiration-scouting/reference.md +0 -165
  200. package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/interaction-design/reference.md +0 -122
  201. package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/motion-choreography/reference.md +0 -81
  202. package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/research-planning/reference.md +0 -96
  203. package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/responsive-patterns/reference.md +0 -77
  204. package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/synthetic-user-testing/reference.md +0 -192
  205. package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/taste-feedback/reference.md +0 -165
  206. package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/taste-report/reference.md +0 -78
  207. package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/token-architecture/reference.md +0 -75
  208. package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/ui-composition/reference.md +0 -117
  209. package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/usability-testing/reference.md +0 -78
  210. package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/verification-before-shipping/reference.md +0 -125
  211. package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/voice-and-tone/reference.md +0 -79
  212. package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/writing-design-plans/reference.md +0 -119
  213. package/plugin/skills/frontend-ui-ux/references/evidence-review.md +0 -126
  214. package/plugin/skills/frontend-ui-ux/references/house-styles.md +0 -234
  215. package/plugin/skills/frontend-ui-ux/references/implementation-platforms.md +0 -109
  216. package/plugin/skills/frontend-ui-ux/references/inclusive-interface.md +0 -92
  217. package/plugin/skills/frontend-ui-ux/references/interaction-motion.md +0 -47
  218. package/plugin/skills/frontend-ui-ux/references/motion-guide.md +0 -130
  219. package/plugin/skills/frontend-ui-ux/references/operating-lanes.md +0 -92
  220. package/plugin/skills/frontend-ui-ux/references/perfection/README.md +0 -160
  221. package/plugin/skills/frontend-ui-ux/references/perfection/react-perf-tooling.md +0 -127
  222. package/plugin/skills/frontend-ui-ux/references/performance-delivery.md +0 -93
  223. package/plugin/skills/frontend-ui-ux/references/product-direction.md +0 -84
  224. package/plugin/skills/frontend-ui-ux/references/production-interview.md +0 -17
  225. package/plugin/skills/frontend-ui-ux/references/redesign-playbook.md +0 -97
  226. package/plugin/skills/frontend-ui-ux/references/slop-register.md +0 -150
  227. package/plugin/skills/frontend-ui-ux/references/system-foundations.md +0 -84
  228. package/plugin/skills/frontend-ui-ux/references/taste-direction.md +0 -86
  229. package/plugin/skills/frontend-ui-ux/references/ui-ux-db/README.md +0 -659
  230. package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/charts.csv +0 -26
  231. package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/colors.csv +0 -162
  232. package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/icons.csv +0 -106
  233. package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/landing.csv +0 -35
  234. package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/products.csv +0 -162
  235. package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/react-performance.csv +0 -45
  236. package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/stacks/astro.csv +0 -54
  237. package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/stacks/flutter.csv +0 -53
  238. package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/stacks/html-tailwind.csv +0 -56
  239. package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/stacks/jetpack-compose.csv +0 -53
  240. package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/stacks/nextjs.csv +0 -53
  241. package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/stacks/nuxt-ui.csv +0 -51
  242. package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/stacks/nuxtjs.csv +0 -59
  243. package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/stacks/react-native.csv +0 -52
  244. package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/stacks/react.csv +0 -54
  245. package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/stacks/shadcn.csv +0 -61
  246. package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/stacks/svelte.csv +0 -54
  247. package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/stacks/swiftui.csv +0 -51
  248. package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/stacks/vue.csv +0 -50
  249. package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/styles.csv +0 -85
  250. package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/typography.csv +0 -74
  251. package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/ui-reasoning.csv +0 -162
  252. package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/ux-guidelines.csv +0 -100
  253. package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/web-interface.csv +0 -31
  254. package/plugin/skills/frontend-ui-ux/references/ui-ux-db/scripts/core.py +0 -262
  255. package/plugin/skills/frontend-ui-ux/references/ui-ux-db/scripts/design_system.py +0 -1148
  256. package/plugin/skills/frontend-ui-ux/references/ui-ux-db/scripts/search.py +0 -114
  257. package/plugin/skills/frontend-ui-ux/references/visual-language.md +0 -84
  258. package/plugin/skills/frontend-ui-ux/references/visual-reconstruction.md +0 -51
  259. package/plugin/skills/frontend-ui-ux/schemas/design-contract-v1alpha1.schema.json +0 -306
  260. package/plugin/skills/frontend-ui-ux/schemas/design-contract-v1beta1.schema.json +0 -291
  261. package/plugin/skills/frontend-ui-ux/schemas/design-contract-v1beta2.schema.json +0 -311
  262. package/plugin/skills/frontend-ui-ux/scripts/chrome-driver.mjs +0 -202
  263. package/plugin/skills/frontend-ui-ux/scripts/design-contract-format.mjs +0 -286
  264. package/plugin/skills/frontend-ui-ux/scripts/design-contract-inventory-rules.mjs +0 -354
  265. package/plugin/skills/frontend-ui-ux/scripts/design-contract-rules.mjs +0 -361
  266. package/plugin/skills/frontend-ui-ux/scripts/design-contract-surface-rules.mjs +0 -313
  267. package/plugin/skills/frontend-ui-ux/scripts/design-data.mjs +0 -68
  268. package/plugin/skills/frontend-ui-ux/scripts/design-lock.mjs +0 -400
  269. package/plugin/skills/frontend-ui-ux/scripts/errors.mjs +0 -12
  270. package/plugin/skills/frontend-ui-ux/scripts/import-design-intelligence.mjs +0 -124
  271. package/plugin/skills/frontend-ui-ux/scripts/interface-probe-lock.mjs +0 -196
  272. package/plugin/skills/frontend-ui-ux/scripts/interface-probe-page.mjs +0 -1555
  273. package/plugin/skills/frontend-ui-ux/scripts/interface-probe-rules.mjs +0 -153
  274. package/plugin/skills/frontend-ui-ux/scripts/interface-probe-server.mjs +0 -57
  275. package/plugin/skills/frontend-ui-ux/scripts/interface-probe-static.mjs +0 -133
  276. package/plugin/skills/frontend-ui-ux/scripts/interface-probe.mjs +0 -341
  277. package/plugin/skills/frontend-ui-ux/scripts/json-boundary.mjs +0 -63
  278. package/plugin/skills/frontend-ui-ux/scripts/pixel-art.mjs +0 -60
  279. package/plugin/skills/frontend-ui-ux/scripts/query-design-intelligence.mjs +0 -106
  280. package/plugin/skills/frontend-ui-ux/scripts/search.mjs +0 -43
  281. package/plugin/skills/frontend-ui-ux/scripts/source-replay.mjs +0 -153
  282. package/plugin/skills/frontend-ui-ux/scripts/validate-design-contract.mjs +0 -52
  283. package/plugin/skills/frontend-ui-ux/scripts/verify-corpus.mjs +0 -90
  284. package/plugin/skills/lit-diagram-drawer/NOTICE +0 -33
  285. package/plugin/skills/lit-diagram-drawer/assets/examples/type-architecture-dark.html +0 -1
  286. package/plugin/skills/lit-diagram-drawer/assets/examples/type-architecture-full.html +0 -1
  287. package/plugin/skills/lit-diagram-drawer/assets/examples/type-architecture-light.html +0 -1
  288. package/plugin/skills/lit-diagram-drawer/assets/examples/type-bar-dark.html +0 -1
  289. package/plugin/skills/lit-diagram-drawer/assets/examples/type-bar-full.html +0 -1
  290. package/plugin/skills/lit-diagram-drawer/assets/examples/type-bar-light.html +0 -1
  291. package/plugin/skills/lit-diagram-drawer/assets/examples/type-beeswarm-dark.html +0 -1
  292. package/plugin/skills/lit-diagram-drawer/assets/examples/type-beeswarm-full.html +0 -1
  293. package/plugin/skills/lit-diagram-drawer/assets/examples/type-beeswarm-light.html +0 -1
  294. package/plugin/skills/lit-diagram-drawer/assets/examples/type-bubble-dark.html +0 -1
  295. package/plugin/skills/lit-diagram-drawer/assets/examples/type-bubble-full.html +0 -1
  296. package/plugin/skills/lit-diagram-drawer/assets/examples/type-bubble-light.html +0 -1
  297. package/plugin/skills/lit-diagram-drawer/assets/examples/type-bump-dark.html +0 -1
  298. package/plugin/skills/lit-diagram-drawer/assets/examples/type-bump-full.html +0 -1
  299. package/plugin/skills/lit-diagram-drawer/assets/examples/type-bump-light.html +0 -1
  300. package/plugin/skills/lit-diagram-drawer/assets/examples/type-data-flow-dark.html +0 -1
  301. package/plugin/skills/lit-diagram-drawer/assets/examples/type-data-flow-full.html +0 -1
  302. package/plugin/skills/lit-diagram-drawer/assets/examples/type-data-flow-light.html +0 -1
  303. package/plugin/skills/lit-diagram-drawer/assets/examples/type-datalake-dark.html +0 -1
  304. package/plugin/skills/lit-diagram-drawer/assets/examples/type-datalake-full.html +0 -1
  305. package/plugin/skills/lit-diagram-drawer/assets/examples/type-datalake-light.html +0 -1
  306. package/plugin/skills/lit-diagram-drawer/assets/examples/type-db-schema-dark.html +0 -1
  307. package/plugin/skills/lit-diagram-drawer/assets/examples/type-db-schema-full.html +0 -1
  308. package/plugin/skills/lit-diagram-drawer/assets/examples/type-db-schema-light.html +0 -1
  309. package/plugin/skills/lit-diagram-drawer/assets/examples/type-dependency-dark.html +0 -1
  310. package/plugin/skills/lit-diagram-drawer/assets/examples/type-dependency-full.html +0 -1
  311. package/plugin/skills/lit-diagram-drawer/assets/examples/type-dependency-light.html +0 -1
  312. package/plugin/skills/lit-diagram-drawer/assets/examples/type-deployment-dark.html +0 -1
  313. package/plugin/skills/lit-diagram-drawer/assets/examples/type-deployment-full.html +0 -1
  314. package/plugin/skills/lit-diagram-drawer/assets/examples/type-deployment-light.html +0 -1
  315. package/plugin/skills/lit-diagram-drawer/assets/examples/type-dp-integration-dark.html +0 -1
  316. package/plugin/skills/lit-diagram-drawer/assets/examples/type-dp-integration-full.html +0 -1
  317. package/plugin/skills/lit-diagram-drawer/assets/examples/type-dp-integration-light.html +0 -1
  318. package/plugin/skills/lit-diagram-drawer/assets/examples/type-dp-security-matrix-dark.html +0 -1
  319. package/plugin/skills/lit-diagram-drawer/assets/examples/type-dp-security-matrix-full.html +0 -1
  320. package/plugin/skills/lit-diagram-drawer/assets/examples/type-dp-security-matrix-light.html +0 -1
  321. package/plugin/skills/lit-diagram-drawer/assets/examples/type-er-dark.html +0 -1
  322. package/plugin/skills/lit-diagram-drawer/assets/examples/type-er-full.html +0 -1
  323. package/plugin/skills/lit-diagram-drawer/assets/examples/type-er-light.html +0 -1
  324. package/plugin/skills/lit-diagram-drawer/assets/examples/type-fishbone-dark.html +0 -1
  325. package/plugin/skills/lit-diagram-drawer/assets/examples/type-fishbone-full.html +0 -1
  326. package/plugin/skills/lit-diagram-drawer/assets/examples/type-fishbone-light.html +0 -1
  327. package/plugin/skills/lit-diagram-drawer/assets/examples/type-flowchart-dark.html +0 -1
  328. package/plugin/skills/lit-diagram-drawer/assets/examples/type-flowchart-full.html +0 -1
  329. package/plugin/skills/lit-diagram-drawer/assets/examples/type-flowchart-light.html +0 -1
  330. package/plugin/skills/lit-diagram-drawer/assets/examples/type-gantt-dark.html +0 -1
  331. package/plugin/skills/lit-diagram-drawer/assets/examples/type-gantt-full.html +0 -1
  332. package/plugin/skills/lit-diagram-drawer/assets/examples/type-gantt-light.html +0 -1
  333. package/plugin/skills/lit-diagram-drawer/assets/examples/type-heatmap-dark.html +0 -1
  334. package/plugin/skills/lit-diagram-drawer/assets/examples/type-heatmap-full.html +0 -1
  335. package/plugin/skills/lit-diagram-drawer/assets/examples/type-heatmap-light.html +0 -1
  336. package/plugin/skills/lit-diagram-drawer/assets/examples/type-high-level-dark.html +0 -1
  337. package/plugin/skills/lit-diagram-drawer/assets/examples/type-high-level-full.html +0 -1
  338. package/plugin/skills/lit-diagram-drawer/assets/examples/type-high-level-light.html +0 -1
  339. package/plugin/skills/lit-diagram-drawer/assets/examples/type-high-level-vertical-dark.html +0 -1
  340. package/plugin/skills/lit-diagram-drawer/assets/examples/type-high-level-vertical-full.html +0 -1
  341. package/plugin/skills/lit-diagram-drawer/assets/examples/type-high-level-vertical-light.html +0 -1
  342. package/plugin/skills/lit-diagram-drawer/assets/examples/type-import-drawio-dark.html +0 -1
  343. package/plugin/skills/lit-diagram-drawer/assets/examples/type-import-drawio-full.html +0 -1
  344. package/plugin/skills/lit-diagram-drawer/assets/examples/type-import-drawio-light.html +0 -1
  345. package/plugin/skills/lit-diagram-drawer/assets/examples/type-import-excalidraw-dark.html +0 -1
  346. package/plugin/skills/lit-diagram-drawer/assets/examples/type-import-excalidraw-full.html +0 -1
  347. package/plugin/skills/lit-diagram-drawer/assets/examples/type-import-excalidraw-light.html +0 -1
  348. package/plugin/skills/lit-diagram-drawer/assets/examples/type-import-mermaid-dark.html +0 -1
  349. package/plugin/skills/lit-diagram-drawer/assets/examples/type-import-mermaid-full.html +0 -1
  350. package/plugin/skills/lit-diagram-drawer/assets/examples/type-import-mermaid-light.html +0 -1
  351. package/plugin/skills/lit-diagram-drawer/assets/examples/type-it-state-dark.html +0 -1
  352. package/plugin/skills/lit-diagram-drawer/assets/examples/type-it-state-full.html +0 -1
  353. package/plugin/skills/lit-diagram-drawer/assets/examples/type-it-state-light.html +0 -1
  354. package/plugin/skills/lit-diagram-drawer/assets/examples/type-journey-dark.html +0 -1
  355. package/plugin/skills/lit-diagram-drawer/assets/examples/type-journey-full.html +0 -1
  356. package/plugin/skills/lit-diagram-drawer/assets/examples/type-journey-light.html +0 -1
  357. package/plugin/skills/lit-diagram-drawer/assets/examples/type-kanban-dark.html +0 -1
  358. package/plugin/skills/lit-diagram-drawer/assets/examples/type-kanban-full.html +0 -1
  359. package/plugin/skills/lit-diagram-drawer/assets/examples/type-kanban-light.html +0 -1
  360. package/plugin/skills/lit-diagram-drawer/assets/examples/type-layers-dark.html +0 -1
  361. package/plugin/skills/lit-diagram-drawer/assets/examples/type-layers-full.html +0 -1
  362. package/plugin/skills/lit-diagram-drawer/assets/examples/type-layers-light.html +0 -1
  363. package/plugin/skills/lit-diagram-drawer/assets/examples/type-line-dark.html +0 -1
  364. package/plugin/skills/lit-diagram-drawer/assets/examples/type-line-full.html +0 -1
  365. package/plugin/skills/lit-diagram-drawer/assets/examples/type-line-light.html +0 -1
  366. package/plugin/skills/lit-diagram-drawer/assets/examples/type-loop-dark.html +0 -1
  367. package/plugin/skills/lit-diagram-drawer/assets/examples/type-loop-full.html +0 -1
  368. package/plugin/skills/lit-diagram-drawer/assets/examples/type-loop-light.html +0 -1
  369. package/plugin/skills/lit-diagram-drawer/assets/examples/type-loop-terminal-dark.html +0 -1
  370. package/plugin/skills/lit-diagram-drawer/assets/examples/type-loop-terminal-full.html +0 -1
  371. package/plugin/skills/lit-diagram-drawer/assets/examples/type-loop-terminal-light.html +0 -1
  372. package/plugin/skills/lit-diagram-drawer/assets/examples/type-marimekko-dark.html +0 -1
  373. package/plugin/skills/lit-diagram-drawer/assets/examples/type-marimekko-full.html +0 -1
  374. package/plugin/skills/lit-diagram-drawer/assets/examples/type-marimekko-light.html +0 -1
  375. package/plugin/skills/lit-diagram-drawer/assets/examples/type-medallion-dark.html +0 -1
  376. package/plugin/skills/lit-diagram-drawer/assets/examples/type-medallion-full.html +0 -1
  377. package/plugin/skills/lit-diagram-drawer/assets/examples/type-medallion-light.html +0 -1
  378. package/plugin/skills/lit-diagram-drawer/assets/examples/type-nested-dark.html +0 -1
  379. package/plugin/skills/lit-diagram-drawer/assets/examples/type-nested-full.html +0 -1
  380. package/plugin/skills/lit-diagram-drawer/assets/examples/type-nested-light.html +0 -1
  381. package/plugin/skills/lit-diagram-drawer/assets/examples/type-org-chart-dark.html +0 -1
  382. package/plugin/skills/lit-diagram-drawer/assets/examples/type-org-chart-full.html +0 -1
  383. package/plugin/skills/lit-diagram-drawer/assets/examples/type-org-chart-light.html +0 -1
  384. package/plugin/skills/lit-diagram-drawer/assets/examples/type-paved-road-animated-dark.html +0 -1
  385. package/plugin/skills/lit-diagram-drawer/assets/examples/type-paved-road-animated-full.html +0 -1
  386. package/plugin/skills/lit-diagram-drawer/assets/examples/type-paved-road-animated-light.html +0 -1
  387. package/plugin/skills/lit-diagram-drawer/assets/examples/type-polar-dark.html +0 -1
  388. package/plugin/skills/lit-diagram-drawer/assets/examples/type-polar-full.html +0 -1
  389. package/plugin/skills/lit-diagram-drawer/assets/examples/type-polar-light.html +0 -1
  390. package/plugin/skills/lit-diagram-drawer/assets/examples/type-policy-trace-animated-dark.html +0 -1
  391. package/plugin/skills/lit-diagram-drawer/assets/examples/type-policy-trace-animated-full.html +0 -1
  392. package/plugin/skills/lit-diagram-drawer/assets/examples/type-policy-trace-animated-light.html +0 -1
  393. package/plugin/skills/lit-diagram-drawer/assets/examples/type-process-dark.html +0 -1
  394. package/plugin/skills/lit-diagram-drawer/assets/examples/type-process-full.html +0 -1
  395. package/plugin/skills/lit-diagram-drawer/assets/examples/type-process-light.html +0 -1
  396. package/plugin/skills/lit-diagram-drawer/assets/examples/type-pyramid-dark.html +0 -1
  397. package/plugin/skills/lit-diagram-drawer/assets/examples/type-pyramid-full.html +0 -1
  398. package/plugin/skills/lit-diagram-drawer/assets/examples/type-pyramid-light.html +0 -1
  399. package/plugin/skills/lit-diagram-drawer/assets/examples/type-quadrant-consultant-dark.html +0 -1
  400. package/plugin/skills/lit-diagram-drawer/assets/examples/type-quadrant-consultant-full.html +0 -1
  401. package/plugin/skills/lit-diagram-drawer/assets/examples/type-quadrant-consultant-light.html +0 -1
  402. package/plugin/skills/lit-diagram-drawer/assets/examples/type-quadrant-dark.html +0 -1
  403. package/plugin/skills/lit-diagram-drawer/assets/examples/type-quadrant-full.html +0 -1
  404. package/plugin/skills/lit-diagram-drawer/assets/examples/type-quadrant-light.html +0 -1
  405. package/plugin/skills/lit-diagram-drawer/assets/examples/type-queue-animated-dark.html +0 -1
  406. package/plugin/skills/lit-diagram-drawer/assets/examples/type-queue-animated-full.html +0 -1
  407. package/plugin/skills/lit-diagram-drawer/assets/examples/type-queue-animated-light.html +0 -1
  408. package/plugin/skills/lit-diagram-drawer/assets/examples/type-radar-dark.html +0 -1
  409. package/plugin/skills/lit-diagram-drawer/assets/examples/type-radar-full.html +0 -1
  410. package/plugin/skills/lit-diagram-drawer/assets/examples/type-radar-light.html +0 -1
  411. package/plugin/skills/lit-diagram-drawer/assets/examples/type-ridgeline-dark.html +0 -1
  412. package/plugin/skills/lit-diagram-drawer/assets/examples/type-ridgeline-full.html +0 -1
  413. package/plugin/skills/lit-diagram-drawer/assets/examples/type-ridgeline-light.html +0 -1
  414. package/plugin/skills/lit-diagram-drawer/assets/examples/type-sankey-dark.html +0 -1
  415. package/plugin/skills/lit-diagram-drawer/assets/examples/type-sankey-full.html +0 -1
  416. package/plugin/skills/lit-diagram-drawer/assets/examples/type-sankey-light.html +0 -1
  417. package/plugin/skills/lit-diagram-drawer/assets/examples/type-scatter-dark.html +0 -1
  418. package/plugin/skills/lit-diagram-drawer/assets/examples/type-scatter-full.html +0 -1
  419. package/plugin/skills/lit-diagram-drawer/assets/examples/type-scatter-light.html +0 -1
  420. package/plugin/skills/lit-diagram-drawer/assets/examples/type-sequence-dark.html +0 -1
  421. package/plugin/skills/lit-diagram-drawer/assets/examples/type-sequence-full.html +0 -1
  422. package/plugin/skills/lit-diagram-drawer/assets/examples/type-sequence-light.html +0 -1
  423. package/plugin/skills/lit-diagram-drawer/assets/examples/type-sequence-oauth-dark.html +0 -1
  424. package/plugin/skills/lit-diagram-drawer/assets/examples/type-sequence-oauth-full.html +0 -1
  425. package/plugin/skills/lit-diagram-drawer/assets/examples/type-sequence-oauth-light.html +0 -1
  426. package/plugin/skills/lit-diagram-drawer/assets/examples/type-slopegraph-dark.html +0 -1
  427. package/plugin/skills/lit-diagram-drawer/assets/examples/type-slopegraph-full.html +0 -1
  428. package/plugin/skills/lit-diagram-drawer/assets/examples/type-slopegraph-light.html +0 -1
  429. package/plugin/skills/lit-diagram-drawer/assets/examples/type-state-dark.html +0 -1
  430. package/plugin/skills/lit-diagram-drawer/assets/examples/type-state-full.html +0 -1
  431. package/plugin/skills/lit-diagram-drawer/assets/examples/type-state-lifecycle-dark.html +0 -1
  432. package/plugin/skills/lit-diagram-drawer/assets/examples/type-state-lifecycle-full.html +0 -1
  433. package/plugin/skills/lit-diagram-drawer/assets/examples/type-state-lifecycle-light.html +0 -1
  434. package/plugin/skills/lit-diagram-drawer/assets/examples/type-state-light.html +0 -1
  435. package/plugin/skills/lit-diagram-drawer/assets/examples/type-story-map-dark.html +0 -1
  436. package/plugin/skills/lit-diagram-drawer/assets/examples/type-story-map-full.html +0 -1
  437. package/plugin/skills/lit-diagram-drawer/assets/examples/type-story-map-light.html +0 -1
  438. package/plugin/skills/lit-diagram-drawer/assets/examples/type-streamgraph-dark.html +0 -1
  439. package/plugin/skills/lit-diagram-drawer/assets/examples/type-streamgraph-full.html +0 -1
  440. package/plugin/skills/lit-diagram-drawer/assets/examples/type-streamgraph-light.html +0 -1
  441. package/plugin/skills/lit-diagram-drawer/assets/examples/type-swimlane-dark.html +0 -1
  442. package/plugin/skills/lit-diagram-drawer/assets/examples/type-swimlane-full.html +0 -1
  443. package/plugin/skills/lit-diagram-drawer/assets/examples/type-swimlane-light.html +0 -1
  444. package/plugin/skills/lit-diagram-drawer/assets/examples/type-timeline-dark.html +0 -1
  445. package/plugin/skills/lit-diagram-drawer/assets/examples/type-timeline-full.html +0 -1
  446. package/plugin/skills/lit-diagram-drawer/assets/examples/type-timeline-light.html +0 -1
  447. package/plugin/skills/lit-diagram-drawer/assets/examples/type-tree-block-decomposition-dark.html +0 -1
  448. package/plugin/skills/lit-diagram-drawer/assets/examples/type-tree-block-decomposition-full.html +0 -1
  449. package/plugin/skills/lit-diagram-drawer/assets/examples/type-tree-block-decomposition-light.html +0 -1
  450. package/plugin/skills/lit-diagram-drawer/assets/examples/type-tree-dark.html +0 -1
  451. package/plugin/skills/lit-diagram-drawer/assets/examples/type-tree-full.html +0 -1
  452. package/plugin/skills/lit-diagram-drawer/assets/examples/type-tree-light.html +0 -1
  453. package/plugin/skills/lit-diagram-drawer/assets/examples/type-treemap-dark.html +0 -1
  454. package/plugin/skills/lit-diagram-drawer/assets/examples/type-treemap-full.html +0 -1
  455. package/plugin/skills/lit-diagram-drawer/assets/examples/type-treemap-light.html +0 -1
  456. package/plugin/skills/lit-diagram-drawer/assets/examples/type-uml-class-dark.html +0 -1
  457. package/plugin/skills/lit-diagram-drawer/assets/examples/type-uml-class-full.html +0 -1
  458. package/plugin/skills/lit-diagram-drawer/assets/examples/type-uml-class-light.html +0 -1
  459. package/plugin/skills/lit-diagram-drawer/assets/examples/type-venn-dark.html +0 -1
  460. package/plugin/skills/lit-diagram-drawer/assets/examples/type-venn-full.html +0 -1
  461. package/plugin/skills/lit-diagram-drawer/assets/examples/type-venn-light.html +0 -1
  462. package/plugin/skills/lit-diagram-drawer/assets/examples/type-wardley-dark.html +0 -1
  463. package/plugin/skills/lit-diagram-drawer/assets/examples/type-wardley-full.html +0 -1
  464. package/plugin/skills/lit-diagram-drawer/assets/examples/type-wardley-light.html +0 -1
  465. package/plugin/skills/lit-diagram-drawer/assets/examples/type-waterfall-dark.html +0 -1
  466. package/plugin/skills/lit-diagram-drawer/assets/examples/type-waterfall-full.html +0 -1
  467. package/plugin/skills/lit-diagram-drawer/assets/examples/type-waterfall-light.html +0 -1
  468. package/plugin/skills/lit-diagram-drawer/assets/fonts/OFL.txt +0 -94
  469. package/plugin/skills/lit-diagram-drawer/assets/fonts/PretendardVariable.woff2 +0 -0
  470. package/plugin/skills/lit-diagram-drawer/assets/fonts/provenance.json +0 -22
  471. package/plugin/skills/lit-diagram-drawer/assets/icons.html +0 -231
  472. package/plugin/skills/lit-diagram-drawer/assets/index.html +0 -1
  473. package/plugin/skills/lit-diagram-drawer/assets/licenses/devicon-MIT.txt +0 -20
  474. package/plugin/skills/lit-diagram-drawer/assets/licenses/diagram-design-MIT.txt +0 -21
  475. package/plugin/skills/lit-diagram-drawer/assets/licenses/log-z-MIT.txt +0 -21
  476. package/plugin/skills/lit-diagram-drawer/assets/licenses/simple-icons-CC0.md +0 -30
  477. package/plugin/skills/lit-diagram-drawer/assets/licenses/tabler-MIT.txt +0 -21
  478. package/plugin/skills/lit-diagram-drawer/examples/01-service-architecture/after.html +0 -1
  479. package/plugin/skills/lit-diagram-drawer/examples/01-service-architecture/brief.md +0 -33
  480. package/plugin/skills/lit-diagram-drawer/examples/01-service-architecture/constructed-naive-foil.html +0 -1
  481. package/plugin/skills/lit-diagram-drawer/examples/02-release-decision/after.html +0 -1
  482. package/plugin/skills/lit-diagram-drawer/examples/02-release-decision/brief.md +0 -18
  483. package/plugin/skills/lit-diagram-drawer/examples/02-release-decision/constructed-naive-foil.html +0 -1
  484. package/plugin/skills/lit-diagram-drawer/examples/03-data-retention/after.html +0 -1
  485. package/plugin/skills/lit-diagram-drawer/examples/03-data-retention/brief.md +0 -19
  486. package/plugin/skills/lit-diagram-drawer/examples/03-data-retention/constructed-naive-foil.html +0 -1
  487. package/plugin/skills/lit-diagram-drawer/examples/04-oauth-sequence/after.html +0 -1
  488. package/plugin/skills/lit-diagram-drawer/examples/04-oauth-sequence/brief.md +0 -17
  489. package/plugin/skills/lit-diagram-drawer/examples/04-oauth-sequence/constructed-naive-foil.html +0 -1
  490. package/plugin/skills/lit-diagram-drawer/examples/05-review-lanes/after.html +0 -1
  491. package/plugin/skills/lit-diagram-drawer/examples/05-review-lanes/brief.md +0 -17
  492. package/plugin/skills/lit-diagram-drawer/examples/05-review-lanes/constructed-naive-foil.html +0 -1
  493. package/plugin/skills/lit-diagram-drawer/examples/06-rollout-gates/after.html +0 -1
  494. package/plugin/skills/lit-diagram-drawer/examples/06-rollout-gates/brief.md +0 -17
  495. package/plugin/skills/lit-diagram-drawer/examples/06-rollout-gates/constructed-naive-foil.html +0 -1
  496. package/plugin/skills/lit-diagram-drawer/examples/07-deployment-boundary/after.html +0 -1
  497. package/plugin/skills/lit-diagram-drawer/examples/07-deployment-boundary/brief.md +0 -19
  498. package/plugin/skills/lit-diagram-drawer/examples/07-deployment-boundary/constructed-naive-foil.html +0 -1
  499. package/plugin/skills/lit-diagram-drawer/examples/08-policy-traces/after.html +0 -1
  500. package/plugin/skills/lit-diagram-drawer/examples/08-policy-traces/brief.md +0 -20
  501. package/plugin/skills/lit-diagram-drawer/examples/08-policy-traces/constructed-naive-foil.html +0 -1
  502. package/plugin/skills/lit-diagram-drawer/references/accessibility.md +0 -37
  503. package/plugin/skills/lit-diagram-drawer/references/export.md +0 -29
  504. package/plugin/skills/lit-diagram-drawer/references/import-drawio.md +0 -21
  505. package/plugin/skills/lit-diagram-drawer/references/import-excalidraw.md +0 -14
  506. package/plugin/skills/lit-diagram-drawer/references/import-mermaid.md +0 -18
  507. package/plugin/skills/lit-diagram-drawer/references/import-schema.md +0 -28
  508. package/plugin/skills/lit-diagram-drawer/references/korean-typography.md +0 -34
  509. package/plugin/skills/lit-diagram-drawer/references/motion.md +0 -29
  510. package/plugin/skills/lit-diagram-drawer/references/office-pptx-docx.md +0 -42
  511. package/plugin/skills/lit-diagram-drawer/references/output-spec.md +0 -48
  512. package/plugin/skills/lit-diagram-drawer/references/primitive-annotation.md +0 -12
  513. package/plugin/skills/lit-diagram-drawer/references/primitive-icons.md +0 -21
  514. package/plugin/skills/lit-diagram-drawer/references/primitive-sketchy.md +0 -11
  515. package/plugin/skills/lit-diagram-drawer/references/primitive-terminal.md +0 -11
  516. package/plugin/skills/lit-diagram-drawer/references/profiles.md +0 -24
  517. package/plugin/skills/lit-diagram-drawer/references/semantic-patterns.md +0 -27
  518. package/plugin/skills/lit-diagram-drawer/references/style-guide.md +0 -67
  519. package/plugin/skills/lit-diagram-drawer/references/type-architecture.md +0 -51
  520. package/plugin/skills/lit-diagram-drawer/references/type-bar.md +0 -51
  521. package/plugin/skills/lit-diagram-drawer/references/type-beeswarm.md +0 -49
  522. package/plugin/skills/lit-diagram-drawer/references/type-bubble.md +0 -49
  523. package/plugin/skills/lit-diagram-drawer/references/type-bump.md +0 -49
  524. package/plugin/skills/lit-diagram-drawer/references/type-catalog.json +0 -1433
  525. package/plugin/skills/lit-diagram-drawer/references/type-data-flow.md +0 -51
  526. package/plugin/skills/lit-diagram-drawer/references/type-datalake.md +0 -49
  527. package/plugin/skills/lit-diagram-drawer/references/type-db-schema.md +0 -49
  528. package/plugin/skills/lit-diagram-drawer/references/type-dependency.md +0 -49
  529. package/plugin/skills/lit-diagram-drawer/references/type-deployment.md +0 -49
  530. package/plugin/skills/lit-diagram-drawer/references/type-dp-integration.md +0 -49
  531. package/plugin/skills/lit-diagram-drawer/references/type-dp-security-matrix.md +0 -49
  532. package/plugin/skills/lit-diagram-drawer/references/type-er.md +0 -49
  533. package/plugin/skills/lit-diagram-drawer/references/type-fishbone.md +0 -49
  534. package/plugin/skills/lit-diagram-drawer/references/type-flowchart.md +0 -49
  535. package/plugin/skills/lit-diagram-drawer/references/type-gantt.md +0 -49
  536. package/plugin/skills/lit-diagram-drawer/references/type-heatmap.md +0 -53
  537. package/plugin/skills/lit-diagram-drawer/references/type-high-level-vertical.md +0 -53
  538. package/plugin/skills/lit-diagram-drawer/references/type-high-level.md +0 -53
  539. package/plugin/skills/lit-diagram-drawer/references/type-import-drawio.md +0 -53
  540. package/plugin/skills/lit-diagram-drawer/references/type-import-excalidraw.md +0 -53
  541. package/plugin/skills/lit-diagram-drawer/references/type-import-mermaid.md +0 -53
  542. package/plugin/skills/lit-diagram-drawer/references/type-it-state.md +0 -54
  543. package/plugin/skills/lit-diagram-drawer/references/type-journey.md +0 -54
  544. package/plugin/skills/lit-diagram-drawer/references/type-kanban.md +0 -54
  545. package/plugin/skills/lit-diagram-drawer/references/type-layers.md +0 -54
  546. package/plugin/skills/lit-diagram-drawer/references/type-line.md +0 -54
  547. package/plugin/skills/lit-diagram-drawer/references/type-loop-terminal.md +0 -53
  548. package/plugin/skills/lit-diagram-drawer/references/type-loop.md +0 -54
  549. package/plugin/skills/lit-diagram-drawer/references/type-marimekko.md +0 -54
  550. package/plugin/skills/lit-diagram-drawer/references/type-medallion.md +0 -54
  551. package/plugin/skills/lit-diagram-drawer/references/type-nested.md +0 -59
  552. package/plugin/skills/lit-diagram-drawer/references/type-org-chart.md +0 -58
  553. package/plugin/skills/lit-diagram-drawer/references/type-paved-road-animated.md +0 -72
  554. package/plugin/skills/lit-diagram-drawer/references/type-polar.md +0 -67
  555. package/plugin/skills/lit-diagram-drawer/references/type-policy-trace-animated.md +0 -69
  556. package/plugin/skills/lit-diagram-drawer/references/type-process.md +0 -58
  557. package/plugin/skills/lit-diagram-drawer/references/type-pyramid.md +0 -59
  558. package/plugin/skills/lit-diagram-drawer/references/type-quadrant-consultant.md +0 -60
  559. package/plugin/skills/lit-diagram-drawer/references/type-quadrant.md +0 -57
  560. package/plugin/skills/lit-diagram-drawer/references/type-queue-animated.md +0 -63
  561. package/plugin/skills/lit-diagram-drawer/references/type-radar.md +0 -57
  562. package/plugin/skills/lit-diagram-drawer/references/type-ridgeline.md +0 -63
  563. package/plugin/skills/lit-diagram-drawer/references/type-sankey.md +0 -68
  564. package/plugin/skills/lit-diagram-drawer/references/type-scatter.md +0 -60
  565. package/plugin/skills/lit-diagram-drawer/references/type-sequence-oauth.md +0 -66
  566. package/plugin/skills/lit-diagram-drawer/references/type-sequence.md +0 -63
  567. package/plugin/skills/lit-diagram-drawer/references/type-slopegraph.md +0 -65
  568. package/plugin/skills/lit-diagram-drawer/references/type-state-lifecycle.md +0 -53
  569. package/plugin/skills/lit-diagram-drawer/references/type-state.md +0 -59
  570. package/plugin/skills/lit-diagram-drawer/references/type-story-map.md +0 -52
  571. package/plugin/skills/lit-diagram-drawer/references/type-streamgraph.md +0 -53
  572. package/plugin/skills/lit-diagram-drawer/references/type-swimlane.md +0 -52
  573. package/plugin/skills/lit-diagram-drawer/references/type-timeline.md +0 -52
  574. package/plugin/skills/lit-diagram-drawer/references/type-tree-block-decomposition.md +0 -57
  575. package/plugin/skills/lit-diagram-drawer/references/type-tree.md +0 -54
  576. package/plugin/skills/lit-diagram-drawer/references/type-treemap.md +0 -54
  577. package/plugin/skills/lit-diagram-drawer/references/type-uml-class.md +0 -52
  578. package/plugin/skills/lit-diagram-drawer/references/type-venn.md +0 -51
  579. package/plugin/skills/lit-diagram-drawer/references/type-wardley.md +0 -52
  580. package/plugin/skills/lit-diagram-drawer/references/type-waterfall.md +0 -54
  581. package/plugin/skills/lit-diagram-drawer/references/verifier-guide.md +0 -59
  582. package/plugin/skills/lit-diagram-drawer/scripts/block-registry.mjs +0 -43
  583. package/plugin/skills/lit-diagram-drawer/scripts/brief-contract.mjs +0 -94
  584. package/plugin/skills/lit-diagram-drawer/scripts/check-visible-text.mjs +0 -15
  585. package/plugin/skills/lit-diagram-drawer/scripts/diagram-craft-rules.mjs +0 -13
  586. package/plugin/skills/lit-diagram-drawer/scripts/diagram-metrics.mjs +0 -219
  587. package/plugin/skills/lit-diagram-drawer/scripts/diagram-runtime-lock/package.json +0 -9
  588. package/plugin/skills/lit-diagram-drawer/scripts/diagram-runtime.mjs +0 -275
  589. package/plugin/skills/lit-diagram-drawer/scripts/doctor.mjs +0 -25
  590. package/plugin/skills/lit-diagram-drawer/scripts/drawio-model.mjs +0 -162
  591. package/plugin/skills/lit-diagram-drawer/scripts/drawio-source.mjs +0 -147
  592. package/plugin/skills/lit-diagram-drawer/scripts/drawio-xml.mjs +0 -148
  593. package/plugin/skills/lit-diagram-drawer/scripts/export.mjs +0 -119
  594. package/plugin/skills/lit-diagram-drawer/scripts/import-common.mjs +0 -85
  595. package/plugin/skills/lit-diagram-drawer/scripts/import-drawio.mjs +0 -48
  596. package/plugin/skills/lit-diagram-drawer/scripts/import-excalidraw.mjs +0 -234
  597. package/plugin/skills/lit-diagram-drawer/scripts/import-mermaid.mjs +0 -104
  598. package/plugin/skills/lit-diagram-drawer/scripts/mermaid-common.mjs +0 -115
  599. package/plugin/skills/lit-diagram-drawer/scripts/mermaid-er.mjs +0 -70
  600. package/plugin/skills/lit-diagram-drawer/scripts/mermaid-flowchart.mjs +0 -178
  601. package/plugin/skills/lit-diagram-drawer/scripts/mermaid-sequence.mjs +0 -137
  602. package/plugin/skills/lit-diagram-drawer/scripts/mermaid-state.mjs +0 -80
  603. package/plugin/skills/lit-diagram-drawer/scripts/office-safety.mjs +0 -54
  604. package/plugin/skills/lit-diagram-drawer/scripts/runtime-probes.mjs +0 -11
  605. package/plugin/skills/lit-diagram-drawer/scripts/verify-all.mjs +0 -85
  606. package/plugin/skills/lit-diagram-drawer/scripts/verify-brief.mjs +0 -16
  607. package/plugin/skills/lit-diagram-drawer/scripts/verify-diagram.mjs +0 -27
  608. package/plugin/skills/lit-diagram-drawer/scripts/verify-motion.mjs +0 -12
  609. package/plugin/skills/lit-diagram-drawer/scripts/verify-type.mjs +0 -48
  610. package/plugin/skills/lit-diagram-drawer/scripts/visual-quality-geometry.mjs +0 -226
  611. package/plugin/skills/lit-diagram-drawer/scripts/visual-quality.mjs +0 -146
  612. package/plugin/skills/lit-docx/NOTICE +0 -33
  613. package/plugin/skills/lit-docx/references/components.md +0 -207
  614. package/plugin/skills/lit-docx/references/direction-step.md +0 -277
  615. package/plugin/skills/lit-docx/references/examples/01-report-ko.md +0 -166
  616. package/plugin/skills/lit-docx/references/examples/02-brief-ko.md +0 -105
  617. package/plugin/skills/lit-docx/references/examples/03-manual-ko.md +0 -164
  618. package/plugin/skills/lit-docx/references/examples/04-proposal-ko.md +0 -138
  619. package/plugin/skills/lit-docx/references/examples/05-memo-en.md +0 -55
  620. package/plugin/skills/lit-docx/references/examples/06-journal-en.md +0 -130
  621. package/plugin/skills/lit-docx/references/examples/07-report-en.md +0 -123
  622. package/plugin/skills/lit-docx/references/examples/08-proposal-en.md +0 -123
  623. package/plugin/skills/lit-docx/references/examples/09-memo-ko.md +0 -45
  624. package/plugin/skills/lit-docx/references/frontmatter_schema.md +0 -42
  625. package/plugin/skills/lit-docx/references/journal_style_spec.md +0 -17
  626. package/plugin/skills/lit-docx/references/markdown_quality_checklist.md +0 -37
  627. package/plugin/skills/lit-docx/references/page-composition.md +0 -221
  628. package/plugin/skills/lit-docx/references/slop_phrase_list.yaml +0 -58
  629. package/plugin/skills/lit-docx/references/slop_rules.md +0 -35
  630. package/plugin/skills/lit-docx/references/tonalities/brief.md +0 -143
  631. package/plugin/skills/lit-docx/references/tonalities/journal.md +0 -142
  632. package/plugin/skills/lit-docx/references/tonalities/manual.md +0 -148
  633. package/plugin/skills/lit-docx/references/tonalities/memo.md +0 -137
  634. package/plugin/skills/lit-docx/references/tonalities/proposal.md +0 -140
  635. package/plugin/skills/lit-docx/references/tonalities/report.md +0 -156
  636. package/plugin/skills/lit-docx/scripts/clean_markdown.py +0 -95
  637. package/plugin/skills/lit-docx/scripts/convert_md_to_docx.py +0 -1395
  638. package/plugin/skills/lit-docx/scripts/convert_md_to_pdf.py +0 -302
  639. package/plugin/skills/lit-docx/scripts/convert_pdf.py +0 -139
  640. package/plugin/skills/lit-docx/scripts/docx_design.py +0 -2449
  641. package/plugin/skills/lit-docx/scripts/docx_layout.py +0 -959
  642. package/plugin/skills/lit-docx/scripts/edit_docx.py +0 -306
  643. package/plugin/skills/lit-docx/scripts/embed_images.py +0 -78
  644. package/plugin/skills/lit-docx/scripts/generate_docx_templates.py +0 -500
  645. package/plugin/skills/lit-docx/scripts/qa_docx.py +0 -234
  646. package/plugin/skills/lit-docx/scripts/slop_lint.py +0 -573
  647. package/plugin/skills/lit-docx/scripts/visual_audit.py +0 -48
  648. package/plugin/skills/lit-docx/templates/docx/acs.docx +0 -0
  649. package/plugin/skills/lit-docx/templates/docx/elsevier.docx +0 -0
  650. package/plugin/skills/lit-docx/templates/docx/ieee.docx +0 -0
  651. package/plugin/skills/lit-docx/templates/docx/korean-generic.docx +0 -0
  652. package/plugin/skills/lit-docx/templates/docx/nature.docx +0 -0
  653. package/plugin/skills/lit-docx/templates/latex/acs/README.md +0 -5
  654. package/plugin/skills/lit-docx/templates/latex/acs/template.tex +0 -39
  655. package/plugin/skills/lit-docx/templates/latex/elsevier/README.md +0 -5
  656. package/plugin/skills/lit-docx/templates/latex/elsevier/template.tex +0 -40
  657. package/plugin/skills/lit-docx/templates/latex/ieee/README.md +0 -5
  658. package/plugin/skills/lit-docx/templates/latex/ieee/template.tex +0 -39
  659. package/plugin/skills/lit-docx/templates/latex/korean-generic/README.md +0 -5
  660. package/plugin/skills/lit-docx/templates/latex/korean-generic/template.tex +0 -39
  661. package/plugin/skills/lit-docx/templates/latex/nature/README.md +0 -5
  662. package/plugin/skills/lit-docx/templates/latex/nature/template.tex +0 -39
  663. package/plugin/skills/lit-docx/templates/registry.yaml +0 -1366
  664. package/plugin/skills/lit-docx/templates/tonalities/brief.yaml +0 -28
  665. package/plugin/skills/lit-docx/templates/tonalities/journal.yaml +0 -25
  666. package/plugin/skills/lit-docx/templates/tonalities/manual.yaml +0 -26
  667. package/plugin/skills/lit-docx/templates/tonalities/memo.yaml +0 -26
  668. package/plugin/skills/lit-docx/templates/tonalities/proposal.yaml +0 -26
  669. package/plugin/skills/lit-docx/templates/tonalities/report.yaml +0 -26
  670. package/plugin/skills/lit-pptx/NOTICE +0 -38
  671. package/plugin/skills/lit-pptx/assets/azure/circle-lg.png +0 -0
  672. package/plugin/skills/lit-pptx/assets/azure/circle-md.png +0 -0
  673. package/plugin/skills/lit-pptx/assets/azure/circle-sm.png +0 -0
  674. package/plugin/skills/lit-pptx/fonts/a2z/A2Z-Black.otf +0 -0
  675. package/plugin/skills/lit-pptx/fonts/a2z/A2Z-Bold.otf +0 -0
  676. package/plugin/skills/lit-pptx/fonts/a2z/A2Z-Light.otf +0 -0
  677. package/plugin/skills/lit-pptx/fonts/a2z/A2Z-Medium.otf +0 -0
  678. package/plugin/skills/lit-pptx/fonts/a2z/A2Z-Regular.otf +0 -0
  679. package/plugin/skills/lit-pptx/fonts/a2z/OFL.txt +0 -94
  680. package/plugin/skills/lit-pptx/fonts/a2z/SOURCE.md +0 -29
  681. package/plugin/skills/lit-pptx/fonts/jetbrains-mono/JetBrainsMono-Bold.ttf +0 -0
  682. package/plugin/skills/lit-pptx/fonts/jetbrains-mono/JetBrainsMono-Regular.ttf +0 -0
  683. package/plugin/skills/lit-pptx/fonts/jetbrains-mono/OFL.txt +0 -93
  684. package/plugin/skills/lit-pptx/fonts/pretendard/OFL.txt +0 -94
  685. package/plugin/skills/lit-pptx/fonts/pretendard/Pretendard-Bold.otf +0 -0
  686. package/plugin/skills/lit-pptx/fonts/pretendard/Pretendard-Regular.otf +0 -0
  687. package/plugin/skills/lit-pptx/fonts/provenance.json +0 -109
  688. package/plugin/skills/lit-pptx/references/agents/analyst.md +0 -49
  689. package/plugin/skills/lit-pptx/references/agents/antithesis.md +0 -59
  690. package/plugin/skills/lit-pptx/references/agents/architect.md +0 -44
  691. package/plugin/skills/lit-pptx/references/agents/critic.md +0 -42
  692. package/plugin/skills/lit-pptx/references/agents/synthesizer.md +0 -47
  693. package/plugin/skills/lit-pptx/references/agents/thesis.md +0 -33
  694. package/plugin/skills/lit-pptx/references/anti-slop-checklist.md +0 -110
  695. package/plugin/skills/lit-pptx/references/authoring-guide.md +0 -250
  696. package/plugin/skills/lit-pptx/references/consensus-protocol.md +0 -125
  697. package/plugin/skills/lit-pptx/references/data-display-cookbook.md +0 -52
  698. package/plugin/skills/lit-pptx/references/density-and-fill.md +0 -164
  699. package/plugin/skills/lit-pptx/references/design-system-azure.md +0 -61
  700. package/plugin/skills/lit-pptx/references/direction-step.md +0 -203
  701. package/plugin/skills/lit-pptx/references/examples/01-pitch-signal-ko.md +0 -210
  702. package/plugin/skills/lit-pptx/references/examples/02-pitch-studio-ko.md +0 -147
  703. package/plugin/skills/lit-pptx/references/examples/03-business-review-ledger-ko.md +0 -199
  704. package/plugin/skills/lit-pptx/references/examples/04-business-review-night-en.md +0 -203
  705. package/plugin/skills/lit-pptx/references/examples/05-research-talk-paper-en.md +0 -178
  706. package/plugin/skills/lit-pptx/references/examples/06-lecture-chalk-ko.md +0 -199
  707. package/plugin/skills/lit-pptx/references/examples/07-data-review-night-en.md +0 -194
  708. package/plugin/skills/lit-pptx/references/examples/08-image-led-atlas-ko.md +0 -175
  709. package/plugin/skills/lit-pptx/references/examples/09-briefing-gazette-ko.md +0 -204
  710. package/plugin/skills/lit-pptx/references/examples/10-status-update-ledger-ko.md +0 -179
  711. package/plugin/skills/lit-pptx/references/examples/11-portfolio-studio-en.md +0 -164
  712. package/plugin/skills/lit-pptx/references/examples/12-research-tutorial-chalk-en.md +0 -174
  713. package/plugin/skills/lit-pptx/references/examples/13-engineering-review-computational-brutalism-ko.md +0 -173
  714. package/plugin/skills/lit-pptx/references/examples/14-launch-pitch-neo-brutalism-ko.md +0 -154
  715. package/plugin/skills/lit-pptx/references/examples/15-design-lecture-bauhaus-ko.md +0 -139
  716. package/plugin/skills/lit-pptx/references/examples/16-community-programme-riso-ko.md +0 -158
  717. package/plugin/skills/lit-pptx/references/examples/17-public-data-briefing-newsroom-ko.md +0 -179
  718. package/plugin/skills/lit-pptx/references/interview-protocol.md +0 -113
  719. package/plugin/skills/lit-pptx/references/layout-families.md +0 -198
  720. package/plugin/skills/lit-pptx/references/stages/autopilot.md +0 -48
  721. package/plugin/skills/lit-pptx/references/stages/interview.md +0 -52
  722. package/plugin/skills/lit-pptx/references/stages/plan.md +0 -42
  723. package/plugin/skills/lit-pptx/references/title-treatments.md +0 -109
  724. package/plugin/skills/lit-pptx/references/tonalities/atlas.md +0 -139
  725. package/plugin/skills/lit-pptx/references/tonalities/bauhaus.md +0 -112
  726. package/plugin/skills/lit-pptx/references/tonalities/chalk.md +0 -148
  727. package/plugin/skills/lit-pptx/references/tonalities/computational-brutalism.md +0 -118
  728. package/plugin/skills/lit-pptx/references/tonalities/gazette.md +0 -149
  729. package/plugin/skills/lit-pptx/references/tonalities/ledger.md +0 -149
  730. package/plugin/skills/lit-pptx/references/tonalities/neo-brutalism.md +0 -125
  731. package/plugin/skills/lit-pptx/references/tonalities/newsroom.md +0 -115
  732. package/plugin/skills/lit-pptx/references/tonalities/night.md +0 -147
  733. package/plugin/skills/lit-pptx/references/tonalities/paper.md +0 -151
  734. package/plugin/skills/lit-pptx/references/tonalities/riso.md +0 -109
  735. package/plugin/skills/lit-pptx/references/tonalities/signal.md +0 -150
  736. package/plugin/skills/lit-pptx/references/tonalities/studio.md +0 -132
  737. package/plugin/skills/lit-pptx/scripts/compile-deck.js +0 -462
  738. package/plugin/skills/lit-pptx/scripts/craft_extras.py +0 -1078
  739. package/plugin/skills/lit-pptx/scripts/deck_craft.py +0 -363
  740. package/plugin/skills/lit-pptx/scripts/embed_fonts.py +0 -227
  741. package/plugin/skills/lit-pptx/scripts/forbidden-terms.json +0 -55
  742. package/plugin/skills/lit-pptx/scripts/layout_inventory.py +0 -418
  743. package/plugin/skills/lit-pptx/scripts/learn_template.py +0 -446
  744. package/plugin/skills/lit-pptx/scripts/lib/derive-palette.js +0 -176
  745. package/plugin/skills/lit-pptx/scripts/lib/directive-parser.js +0 -244
  746. package/plugin/skills/lit-pptx/scripts/lib/font-map.js +0 -79
  747. package/plugin/skills/lit-pptx/scripts/lib/gen-bg.js +0 -86
  748. package/plugin/skills/lit-pptx/scripts/lib/gen-gradient-assets.js +0 -37
  749. package/plugin/skills/lit-pptx/scripts/lib/grid-resolver.js +0 -510
  750. package/plugin/skills/lit-pptx/scripts/lib/layout-resolver.js +0 -1113
  751. package/plugin/skills/lit-pptx/scripts/lib/markdown-loader.js +0 -138
  752. package/plugin/skills/lit-pptx/scripts/lib/render-adapter-html.js +0 -356
  753. package/plugin/skills/lit-pptx/scripts/lib/render-adapter-pptx.js +0 -2240
  754. package/plugin/skills/lit-pptx/scripts/lib/render-pack.js +0 -3366
  755. package/plugin/skills/lit-pptx/scripts/lib/runtime-require.js +0 -28
  756. package/plugin/skills/lit-pptx/scripts/lib/slide-ast.js +0 -565
  757. package/plugin/skills/lit-pptx/scripts/lib/slide-grid.js +0 -104
  758. package/plugin/skills/lit-pptx/scripts/lib/spec-validator.js +0 -94
  759. package/plugin/skills/lit-pptx/scripts/lib/template-registry.js +0 -730
  760. package/plugin/skills/lit-pptx/scripts/package.json +0 -4
  761. package/plugin/skills/lit-pptx/scripts/qa_deck.py +0 -795
  762. package/plugin/skills/lit-pptx/scripts/validate_pptx.py +0 -230
  763. package/plugin/skills/lit-pptx/specs/markdown-slide-spec-v1.md +0 -251
  764. package/plugin/skills/lit-pptx/specs/markdown-slide-spec-v2.md +0 -214
  765. package/plugin/skills/lit-pptx/specs/slide-ast-v1.schema.json +0 -229
  766. package/plugin/skills/lit-pptx/specs/slide-ast-v2.schema.json +0 -144
  767. package/plugin/skills/lit-pptx/specs/template-enrollment-contract.md +0 -382
  768. package/plugin/skills/lit-pptx/templates/enrolled/AZURE-A2Z/capabilities.yaml +0 -146
  769. package/plugin/skills/lit-pptx/templates/enrolled/AZURE-A2Z/layout-mapping.yaml +0 -454
  770. package/plugin/skills/lit-pptx/templates/enrolled/AZURE-A2Z/template.yaml +0 -40
  771. package/plugin/skills/lit-pptx/templates/enrolled/AZURE-PRO/capabilities.yaml +0 -154
  772. package/plugin/skills/lit-pptx/templates/enrolled/AZURE-PRO/layout-mapping.yaml +0 -475
  773. package/plugin/skills/lit-pptx/templates/enrolled/AZURE-PRO/template.yaml +0 -40
  774. package/plugin/skills/lit-pptx/templates/enrolled/BOILERPLATE-A2Z/capabilities.yaml +0 -179
  775. package/plugin/skills/lit-pptx/templates/enrolled/BOILERPLATE-A2Z/layout-mapping.yaml +0 -299
  776. package/plugin/skills/lit-pptx/templates/enrolled/BOILERPLATE-A2Z/template.yaml +0 -45
  777. package/plugin/skills/lit-pptx/templates/enrolled/BOILERPLATE-PRETENDARD/capabilities.yaml +0 -181
  778. package/plugin/skills/lit-pptx/templates/enrolled/BOILERPLATE-PRETENDARD/layout-mapping.yaml +0 -299
  779. package/plugin/skills/lit-pptx/templates/enrolled/BOILERPLATE-PRETENDARD/template.yaml +0 -44
  780. package/plugin/skills/lit-pptx/templates/tonalities/atlas/pack.yaml +0 -92
  781. package/plugin/skills/lit-pptx/templates/tonalities/bauhaus/pack.yaml +0 -98
  782. package/plugin/skills/lit-pptx/templates/tonalities/chalk/pack.yaml +0 -97
  783. package/plugin/skills/lit-pptx/templates/tonalities/computational-brutalism/pack.yaml +0 -99
  784. package/plugin/skills/lit-pptx/templates/tonalities/gazette/pack.yaml +0 -93
  785. package/plugin/skills/lit-pptx/templates/tonalities/ledger/pack.yaml +0 -94
  786. package/plugin/skills/lit-pptx/templates/tonalities/neo-brutalism/pack.yaml +0 -107
  787. package/plugin/skills/lit-pptx/templates/tonalities/newsroom/pack.yaml +0 -99
  788. package/plugin/skills/lit-pptx/templates/tonalities/night/pack.yaml +0 -93
  789. package/plugin/skills/lit-pptx/templates/tonalities/paper/pack.yaml +0 -98
  790. package/plugin/skills/lit-pptx/templates/tonalities/riso/pack.yaml +0 -99
  791. package/plugin/skills/lit-pptx/templates/tonalities/signal/pack.yaml +0 -94
  792. package/plugin/skills/lit-pptx/templates/tonalities/studio/pack.yaml +0 -92
  793. package/plugin/skills/lit-schematic/examples/iso-heat-exchanger/build.mjs +0 -14
  794. package/plugin/skills/lit-schematic/examples/iso-heat-exchanger/scene.mjs +0 -8
  795. package/plugin/skills/lit-schematic/examples/journal-adsorption-rig/build.mjs +0 -22
  796. package/plugin/skills/lit-schematic/examples/pid-dosing-skid/build.mjs +0 -81
  797. package/plugin/skills/lit-schematic/references/cutaway-outputs.md +0 -25
  798. package/plugin/skills/lit-schematic/references/isometric-craft.md +0 -24
  799. package/plugin/skills/lit-schematic/references/journal-figures.md +0 -19
  800. package/plugin/skills/lit-schematic/references/kit-api.md +0 -42
  801. package/plugin/skills/lit-schematic/references/pfd-and-layout.md +0 -20
  802. package/plugin/skills/lit-schematic/references/pid-drafting.md +0 -30
  803. package/plugin/skills/lit-schematic/references/pid-symbols.md +0 -35
  804. package/plugin/skills/lit-schematic/references/verification.md +0 -31
  805. package/plugin/skills/lit-schematic/scripts/doctor.mjs +0 -13
  806. package/plugin/skills/lit-schematic/scripts/lib/figure.mjs +0 -49
  807. package/plugin/skills/lit-schematic/scripts/lib/isa.mjs +0 -18
  808. package/plugin/skills/lit-schematic/scripts/lib/iso.mjs +0 -58
  809. package/plugin/skills/lit-schematic/scripts/lib/legend-sheet.mjs +0 -10
  810. package/plugin/skills/lit-schematic/scripts/lib/qa-core.mjs +0 -349
  811. package/plugin/skills/lit-schematic/scripts/lib/sheet.mjs +0 -497
  812. package/plugin/skills/lit-schematic/scripts/lib/svg.mjs +0 -39
  813. package/plugin/skills/lit-schematic/scripts/lib/theme.mjs +0 -25
  814. package/plugin/skills/lit-schematic/scripts/motion.mjs +0 -8
  815. package/plugin/skills/lit-schematic/scripts/qa.mjs +0 -21
  816. package/plugin/skills/lit-schematic/scripts/render.mjs +0 -38
  817. package/plugin/skills/lit-schematic/scripts/scaffold.mjs +0 -73
  818. package/plugin/skills/lit-scientific-visualization/LICENSE +0 -21
  819. package/plugin/skills/lit-scientific-visualization/assets/color_palettes.py +0 -197
  820. package/plugin/skills/lit-scientific-visualization/assets/nature.mplstyle +0 -75
  821. package/plugin/skills/lit-scientific-visualization/assets/presentation.mplstyle +0 -74
  822. package/plugin/skills/lit-scientific-visualization/assets/publication.mplstyle +0 -78
  823. package/plugin/skills/lit-scientific-visualization/evals/evals.json +0 -158
  824. package/plugin/skills/lit-scientific-visualization/references/canonical-workflow.md +0 -283
  825. package/plugin/skills/lit-scientific-visualization/references/color_palettes.md +0 -380
  826. package/plugin/skills/lit-scientific-visualization/references/journal_requirements.md +0 -359
  827. package/plugin/skills/lit-scientific-visualization/references/matplotlib_examples.md +0 -608
  828. package/plugin/skills/lit-scientific-visualization/references/mdanalysis_martini_visualization.md +0 -85
  829. package/plugin/skills/lit-scientific-visualization/references/publication_guidelines.md +0 -217
  830. package/plugin/skills/lit-scientific-visualization/references/seaborn_for_publications.md +0 -293
  831. package/plugin/skills/lit-scientific-visualization/scripts/figure_export.py +0 -238
  832. package/plugin/skills/lit-scientific-visualization/scripts/sciviz-runtime-requirements.lock +0 -23
  833. package/plugin/skills/lit-scientific-visualization/scripts/sciviz-runtime.mjs +0 -225
  834. package/plugin/skills/lit-scientific-visualization/scripts/style_presets.py +0 -467
  835. package/plugin/skills/lit-scientific-visualization/tests/test_figure_export.py +0 -51
  836. package/plugin/skills/lit-scientific-visualization/tests/test_style_presets.py +0 -114
  837. package/plugin/skills/lit-typographic-motion/engine/NOTICE +0 -23
  838. package/plugin/skills/lit-typographic-motion/engine/THIRD_PARTY_NOTICES +0 -73
  839. package/plugin/skills/lit-typographic-motion/engine/audio/beat_grid.py +0 -56
  840. package/plugin/skills/lit-typographic-motion/engine/audio/requirements.lock +0 -1084
  841. package/plugin/skills/lit-typographic-motion/engine/blender/runner.py +0 -218
  842. package/plugin/skills/lit-typographic-motion/engine/core/constants.mjs +0 -246
  843. package/plugin/skills/lit-typographic-motion/engine/core/contrast.mjs +0 -90
  844. package/plugin/skills/lit-typographic-motion/engine/core/events.mjs +0 -46
  845. package/plugin/skills/lit-typographic-motion/engine/core/flash.mjs +0 -211
  846. package/plugin/skills/lit-typographic-motion/engine/core/gate-rules.mjs +0 -550
  847. package/plugin/skills/lit-typographic-motion/engine/core/presets.mjs +0 -123
  848. package/plugin/skills/lit-typographic-motion/engine/core/text.mjs +0 -100
  849. package/plugin/skills/lit-typographic-motion/engine/core/timeline.mjs +0 -142
  850. package/plugin/skills/lit-typographic-motion/engine/core/util.mjs +0 -167
  851. package/plugin/skills/lit-typographic-motion/engine/core/voices.mjs +0 -19
  852. package/plugin/skills/lit-typographic-motion/engine/models/word-timing.json +0 -198
  853. package/plugin/skills/lit-typographic-motion/engine/node/analysis.mjs +0 -108
  854. package/plugin/skills/lit-typographic-motion/engine/node/assets.mjs +0 -218
  855. package/plugin/skills/lit-typographic-motion/engine/node/blender.mjs +0 -144
  856. package/plugin/skills/lit-typographic-motion/engine/node/board.mjs +0 -136
  857. package/plugin/skills/lit-typographic-motion/engine/node/brief.mjs +0 -158
  858. package/plugin/skills/lit-typographic-motion/engine/node/chrome.mjs +0 -330
  859. package/plugin/skills/lit-typographic-motion/engine/node/cover-assets.mjs +0 -102
  860. package/plugin/skills/lit-typographic-motion/engine/node/cover-capture.mjs +0 -213
  861. package/plugin/skills/lit-typographic-motion/engine/node/cover-gate.mjs +0 -346
  862. package/plugin/skills/lit-typographic-motion/engine/node/cover-image.mjs +0 -141
  863. package/plugin/skills/lit-typographic-motion/engine/node/cover-sheet.mjs +0 -76
  864. package/plugin/skills/lit-typographic-motion/engine/node/cover-treatment.mjs +0 -106
  865. package/plugin/skills/lit-typographic-motion/engine/node/cover-worker.mjs +0 -32
  866. package/plugin/skills/lit-typographic-motion/engine/node/cover.mjs +0 -373
  867. package/plugin/skills/lit-typographic-motion/engine/node/coverage.mjs +0 -83
  868. package/plugin/skills/lit-typographic-motion/engine/node/done.mjs +0 -209
  869. package/plugin/skills/lit-typographic-motion/engine/node/encode.mjs +0 -102
  870. package/plugin/skills/lit-typographic-motion/engine/node/frame-worker.mjs +0 -36
  871. package/plugin/skills/lit-typographic-motion/engine/node/gallery.mjs +0 -120
  872. package/plugin/skills/lit-typographic-motion/engine/node/house.mjs +0 -44
  873. package/plugin/skills/lit-typographic-motion/engine/node/look.mjs +0 -164
  874. package/plugin/skills/lit-typographic-motion/engine/node/pipeline.mjs +0 -603
  875. package/plugin/skills/lit-typographic-motion/engine/node/png.mjs +0 -112
  876. package/plugin/skills/lit-typographic-motion/engine/node/report.mjs +0 -66
  877. package/plugin/skills/lit-typographic-motion/engine/node/runtime.mjs +0 -348
  878. package/plugin/skills/lit-typographic-motion/engine/node/scaffold.mjs +0 -210
  879. package/plugin/skills/lit-typographic-motion/engine/node/score.mjs +0 -639
  880. package/plugin/skills/lit-typographic-motion/engine/node/session.mjs +0 -145
  881. package/plugin/skills/lit-typographic-motion/engine/node/sound-cli.mjs +0 -77
  882. package/plugin/skills/lit-typographic-motion/engine/node/sound.mjs +0 -740
  883. package/plugin/skills/lit-typographic-motion/engine/node/stage-capture.mjs +0 -179
  884. package/plugin/skills/lit-typographic-motion/engine/node/stage-gate.mjs +0 -123
  885. package/plugin/skills/lit-typographic-motion/engine/node/stage-qa.mjs +0 -295
  886. package/plugin/skills/lit-typographic-motion/engine/node/stage-serve.mjs +0 -430
  887. package/plugin/skills/lit-typographic-motion/engine/node/stage.mjs +0 -572
  888. package/plugin/skills/lit-typographic-motion/engine/node/stills.mjs +0 -100
  889. package/plugin/skills/lit-typographic-motion/engine/node/styles.mjs +0 -214
  890. package/plugin/skills/lit-typographic-motion/engine/node/treatment.mjs +0 -645
  891. package/plugin/skills/lit-typographic-motion/engine/node/webp.mjs +0 -145
  892. package/plugin/skills/lit-typographic-motion/engine/node/ws-server.mjs +0 -132
  893. package/plugin/skills/lit-typographic-motion/engine/package-lock.json +0 -25
  894. package/plugin/skills/lit-typographic-motion/engine/package.json +0 -10
  895. package/plugin/skills/lit-typographic-motion/engine/stage/cover-init.js +0 -37
  896. package/plugin/skills/lit-typographic-motion/engine/stage/init.js +0 -288
  897. package/plugin/skills/lit-typographic-motion/engine/stage/loop-kit.js +0 -106
  898. package/plugin/skills/lit-typographic-motion/engine/stage/qa.js +0 -157
  899. package/plugin/skills/lit-typographic-motion/engine/stage/stage-kit.js +0 -741
  900. package/plugin/skills/lit-typographic-motion/engine/vendor/three/LICENSE +0 -21
  901. package/plugin/skills/lit-typographic-motion/engine/vendor/three/addons/environments/RoomEnvironment.js +0 -144
  902. package/plugin/skills/lit-typographic-motion/engine/vendor/three/addons/geometries/RoundedBoxGeometry.js +0 -155
  903. package/plugin/skills/lit-typographic-motion/engine/vendor/three/three.module.js +0 -54571
  904. package/plugin/skills/lit-typographic-motion/engine/web/boot.mjs +0 -123
  905. package/plugin/skills/lit-typographic-motion/engine/web/engine.mjs +0 -281
  906. package/plugin/skills/lit-typographic-motion/engine/web/gl.mjs +0 -319
  907. package/plugin/skills/lit-typographic-motion/engine/web/glsl-common.mjs +0 -78
  908. package/plugin/skills/lit-typographic-motion/engine/web/index.html +0 -6
  909. package/plugin/skills/lit-typographic-motion/engine/web/lines.mjs +0 -112
  910. package/plugin/skills/lit-typographic-motion/engine/web/passes/crt.mjs +0 -98
  911. package/plugin/skills/lit-typographic-motion/engine/web/passes/dither.mjs +0 -49
  912. package/plugin/skills/lit-typographic-motion/engine/web/passes/glitch.mjs +0 -77
  913. package/plugin/skills/lit-typographic-motion/engine/web/passes/swiss-grid.mjs +0 -61
  914. package/plugin/skills/lit-typographic-motion/engine/web/passes/terminal-ui.mjs +0 -88
  915. package/plugin/skills/lit-typographic-motion/engine/web/passes/tidal-gradient.mjs +0 -86
  916. package/plugin/skills/lit-typographic-motion/engine/web/post.mjs +0 -165
  917. package/plugin/skills/lit-typographic-motion/engine/web/scale.mjs +0 -15
  918. package/plugin/skills/lit-typographic-motion/engine/web/scene.mjs +0 -82
  919. package/plugin/skills/lit-typographic-motion/engine/web/scenes/end-card.mjs +0 -30
  920. package/plugin/skills/lit-typographic-motion/engine/web/scenes/index.mjs +0 -16
  921. package/plugin/skills/lit-typographic-motion/engine/web/scenes/karaoke-line.mjs +0 -47
  922. package/plugin/skills/lit-typographic-motion/engine/web/scenes/kinetic-list.mjs +0 -45
  923. package/plugin/skills/lit-typographic-motion/engine/web/scenes/number-counter.mjs +0 -29
  924. package/plugin/skills/lit-typographic-motion/engine/web/scenes/signature.mjs +0 -73
  925. package/plugin/skills/lit-typographic-motion/engine/web/scenes/title-slam.mjs +0 -73
  926. package/plugin/skills/lit-typographic-motion/engine/web/stroke.mjs +0 -236
  927. package/plugin/skills/lit-typographic-motion/engine/web/type.mjs +0 -180
  928. package/plugin/skills/lit-typographic-motion/fonts/archivo/Archivo-w100-400.ttf +0 -0
  929. package/plugin/skills/lit-typographic-motion/fonts/archivo/Archivo-w100-700.ttf +0 -0
  930. package/plugin/skills/lit-typographic-motion/fonts/archivo/Archivo-w100-900.ttf +0 -0
  931. package/plugin/skills/lit-typographic-motion/fonts/archivo/Archivo-w125-400.ttf +0 -0
  932. package/plugin/skills/lit-typographic-motion/fonts/archivo/Archivo-w125-700.ttf +0 -0
  933. package/plugin/skills/lit-typographic-motion/fonts/archivo/Archivo-w125-900.ttf +0 -0
  934. package/plugin/skills/lit-typographic-motion/fonts/archivo/Archivo-w75-400.ttf +0 -0
  935. package/plugin/skills/lit-typographic-motion/fonts/archivo/Archivo-w75-700.ttf +0 -0
  936. package/plugin/skills/lit-typographic-motion/fonts/archivo/Archivo-w75-900.ttf +0 -0
  937. package/plugin/skills/lit-typographic-motion/fonts/archivo/OFL.txt +0 -93
  938. package/plugin/skills/lit-typographic-motion/fonts/jetbrains-mono/JetBrainsMono-wght-latin.woff2 +0 -0
  939. package/plugin/skills/lit-typographic-motion/fonts/jetbrains-mono/OFL.txt +0 -93
  940. package/plugin/skills/lit-typographic-motion/fonts/manifest.json +0 -455
  941. package/plugin/skills/lit-typographic-motion/fonts/silkscreen/OFL.txt +0 -93
  942. package/plugin/skills/lit-typographic-motion/fonts/silkscreen/Silkscreen-Bold.ttf +0 -0
  943. package/plugin/skills/lit-typographic-motion/fonts/silkscreen/Silkscreen-Regular.ttf +0 -0
  944. package/plugin/skills/lit-typographic-motion/fonts/stroke/CREDITS +0 -42
  945. package/plugin/skills/lit-typographic-motion/fonts/stroke/EMSAllure.svg +0 -216
  946. package/plugin/skills/lit-typographic-motion/fonts/stroke/EMSFelix.svg +0 -216
  947. package/plugin/skills/lit-typographic-motion/fonts/stroke/EMSOsmotron.svg +0 -216
  948. package/plugin/skills/lit-typographic-motion/fonts/stroke/EMSReadability.svg +0 -216
  949. package/plugin/skills/lit-typographic-motion/fonts/stroke/EMSTech.svg +0 -217
  950. package/plugin/skills/lit-typographic-motion/fonts/stroke/OFL.txt +0 -91
  951. package/plugin/skills/lit-typographic-motion/fonts/vt323/OFL.txt +0 -93
  952. package/plugin/skills/lit-typographic-motion/fonts/vt323/VT323-Regular.ttf +0 -0
  953. package/plugin/skills/lit-typographic-motion/recipes/hero-3d/expected.json +0 -69
  954. package/plugin/skills/lit-typographic-motion/recipes/hero-3d/index.html +0 -139
  955. package/plugin/skills/lit-typographic-motion/recipes/negatives/card-scenes/expected.json +0 -16
  956. package/plugin/skills/lit-typographic-motion/recipes/negatives/card-scenes/index.html +0 -27
  957. package/plugin/skills/lit-typographic-motion/recipes/negatives/reset-sweep/expected.json +0 -16
  958. package/plugin/skills/lit-typographic-motion/recipes/negatives/reset-sweep/index.html +0 -17
  959. package/plugin/skills/lit-typographic-motion/recipes/negatives/still-glow/expected.json +0 -17
  960. package/plugin/skills/lit-typographic-motion/recipes/negatives/still-glow/index.html +0 -18
  961. package/plugin/skills/lit-typographic-motion/recipes/negatives/title-slam/expected.json +0 -17
  962. package/plugin/skills/lit-typographic-motion/recipes/negatives/title-slam/index.html +0 -30
  963. package/plugin/skills/lit-typographic-motion/recipes/orbit-loop/expected.json +0 -67
  964. package/plugin/skills/lit-typographic-motion/recipes/orbit-loop/index.html +0 -152
  965. package/plugin/skills/lit-typographic-motion/recipes/painted-light/expected.json +0 -95
  966. package/plugin/skills/lit-typographic-motion/recipes/painted-light/index.html +0 -202
  967. package/plugin/skills/lit-typographic-motion/recipes/weight-tide/expected.json +0 -67
  968. package/plugin/skills/lit-typographic-motion/recipes/weight-tide/index.html +0 -100
  969. package/plugin/skills/lit-typographic-motion/references/brief-schema.md +0 -119
  970. package/plugin/skills/lit-typographic-motion/references/cover.md +0 -475
  971. package/plugin/skills/lit-typographic-motion/references/craft-loop.md +0 -100
  972. package/plugin/skills/lit-typographic-motion/references/depth.md +0 -122
  973. package/plugin/skills/lit-typographic-motion/references/engine-contract.md +0 -124
  974. package/plugin/skills/lit-typographic-motion/references/look.md +0 -157
  975. package/plugin/skills/lit-typographic-motion/references/runtime.md +0 -98
  976. package/plugin/skills/lit-typographic-motion/references/sound.md +0 -181
  977. package/plugin/skills/lit-typographic-motion/references/stage.md +0 -310
  978. package/plugin/skills/lit-typographic-motion/references/studio.md +0 -245
  979. package/plugin/skills/lit-typographic-motion/references/style-bibles.md +0 -130
  980. package/plugin/skills/lit-typographic-motion/references/treatment.md +0 -189
  981. package/plugin/skills/lit-typographic-motion/references/type-craft.md +0 -87
  982. package/plugin/skills/lit-typographic-motion/scripts/motion-doctor.mjs +0 -99
  983. package/plugin/skills/lit-typographic-motion/scripts/motion-runtime.mjs +0 -95
  984. package/plugin/skills/lit-typographic-motion/scripts/motion.mjs +0 -206
  985. package/plugin/skills/lit-typographic-motion/styles/paper.json +0 -41
  986. package/plugin/skills/lit-typographic-motion/styles/swiss-signal.json +0 -41
  987. package/plugin/skills/lit-typographic-motion/styles/terminalcore.json +0 -42
  988. package/plugin/skills/lit-typographic-motion/styles/tidal.json +0 -41
  989. package/plugin/skills/readme-studio/references/decoration-and-navigation.md +0 -55
  990. package/plugin/skills/readme-studio/references/facts-and-assembly.md +0 -19
  991. package/plugin/skills/readme-studio/references/production-interview.md +0 -11
  992. package/plugin/skills/readme-studio/references/render-and-deliver.md +0 -44
  993. package/plugin/skills/readme-studio/references/type-and-background.md +0 -23
  994. package/plugin/skills/readme-studio/scripts/readme-runtime-lock/package-lock.json +0 -133
  995. package/plugin/skills/readme-studio/scripts/readme-runtime-lock/package.json +0 -6
  996. package/plugin/skills/readme-studio/scripts/readme-runtime.mjs +0 -77
  997. package/plugin/skills/readme-studio/scripts/validate-readme-facts.mjs +0 -28
  998. package/plugin/skills/readme-studio/templates/cover-source.json +0 -21
  999. package/plugin/skills/readme-studio/templates/hyperframes-cover/index.html +0 -30
  1000. package/plugin/skills/readme-studio/templates/hyperframes-cover/index.motion.json +0 -1
  1001. package/plugin/skills/readme-studio/templates/hyperframes-cover/package-lock.json +0 -2017
  1002. package/plugin/skills/readme-studio/templates/hyperframes-cover/package.json +0 -8
  1003. package/plugin/skills/readme-studio/templates/readme-cover-section.md +0 -75
  1004. package/plugin/skills/readme-studio/templates/readme-facts.json +0 -4
  1005. package/plugin/skills/readme-studio/templates/remotion-cover/package-lock.json +0 -3783
  1006. package/plugin/skills/readme-studio/templates/remotion-cover/package.json +0 -7
  1007. package/plugin/skills/readme-studio/templates/remotion-cover/src/index.tsx +0 -36
  1008. package/plugin/skills/readme-studio/templates/typography/package-lock.json +0 -133
  1009. package/plugin/skills/readme-studio/templates/typography/package.json +0 -6
  1010. package/plugin/skills/readme-studio/templates/typography/safe-files.mjs +0 -57
  1011. package/plugin/skills/readme-studio/templates/typography/shape-text-to-svg.mjs +0 -63
  1012. package/plugin/skills/visual-qa/references/capture-playbook.md +0 -126
  1013. package/plugin/skills/visual-qa/references/complete-contract.md +0 -677
  1014. package/plugin/skills/visual-qa/schemas/design-contract-v1alpha1.schema.json +0 -305
  1015. package/plugin/skills/visual-qa/schemas/design-contract-v1beta1.schema.json +0 -291
  1016. package/plugin/skills/visual-qa/schemas/design-contract-v1beta2.schema.json +0 -311
  1017. package/plugin/skills/visual-qa/schemas/evidence-manifest-v1alpha1.schema.json +0 -235
  1018. package/plugin/skills/visual-qa/schemas/evidence-manifest-v1beta1.schema.json +0 -208
  1019. package/plugin/skills/visual-qa/schemas/review-receipt-v1alpha1.schema.json +0 -66
  1020. package/plugin/skills/visual-qa/scripts/ansi.ts +0 -17
  1021. package/plugin/skills/visual-qa/scripts/cli.mjs +0 -101
  1022. package/plugin/skills/visual-qa/scripts/cli.ts +0 -96
  1023. package/plugin/skills/visual-qa/scripts/design-contract-shape.mjs +0 -448
  1024. package/plugin/skills/visual-qa/scripts/east-asian-width.ts +0 -72
  1025. package/plugin/skills/visual-qa/scripts/errors.mjs +0 -12
  1026. package/plugin/skills/visual-qa/scripts/evidence-io.mjs +0 -184
  1027. package/plugin/skills/visual-qa/scripts/evidence-semantic.mjs +0 -95
  1028. package/plugin/skills/visual-qa/scripts/evidence-shape.mjs +0 -163
  1029. package/plugin/skills/visual-qa/scripts/evidence.mjs +0 -421
  1030. package/plugin/skills/visual-qa/scripts/image-diff.mjs +0 -89
  1031. package/plugin/skills/visual-qa/scripts/image-diff.ts +0 -109
  1032. package/plugin/skills/visual-qa/scripts/png-chunks.mjs +0 -107
  1033. package/plugin/skills/visual-qa/scripts/png-crc.ts +0 -27
  1034. package/plugin/skills/visual-qa/scripts/png-decode.mjs +0 -143
  1035. package/plugin/skills/visual-qa/scripts/png-decode.ts +0 -206
  1036. package/plugin/skills/visual-qa/scripts/png-synth.ts +0 -57
  1037. package/plugin/skills/visual-qa/scripts/review-rules.mjs +0 -137
  1038. package/plugin/skills/visual-qa/scripts/terminal-text.mjs +0 -117
  1039. package/plugin/skills/visual-qa/scripts/tui-check.mjs +0 -74
  1040. package/plugin/skills/visual-qa/scripts/tui-grid.ts +0 -88
  1041. package/plugin/skills/visual-qa/scripts/types.ts +0 -54
@@ -1,2240 +0,0 @@
1
- "use strict";
2
-
3
- /**
4
- * render-adapter-pptx.js — Render a resolved slide spec to a PPTX file.
5
- *
6
- * Architecture: Each text line is its own separate shape (individual addText()
7
- * call). Bullet items use manual "• " prefix in green (#00AE41) Bold 16pt.
8
- * Section headers are separate shapes in Bold 18pt black.
9
- *
10
- * Input: resolved spec from layout-resolver, templateObj from registry, output path.
11
- * Output: writes a .pptx file via pptxgenjs.
12
- */
13
-
14
- const fs = require("fs");
15
- const os = require("os");
16
- const path = require("path");
17
- const { runtimeRequire } = require("./runtime-require");
18
- const { extractContent, looksLikeKpi } = require("./layout-resolver");
19
- const { LEGACY_TOKENS } = require("./template-registry");
20
-
21
- // Narrowest a KPI badge can be and still read as one glance (template token kpi.minCardWidth).
22
- let KPI_MIN_CARD_WIDTH_IN = LEGACY_TOKENS.kpi.minCardWidth;
23
- let KPI_GAP = LEGACY_TOKENS.kpi.gap;
24
-
25
- const TOOLKIT_ROOT = path.resolve(__dirname, "../..");
26
- const ASSETS_MEDIA = path.join(TOOLKIT_ROOT, "assets", "media");
27
- const ASSETS_AZURE = path.join(TOOLKIT_ROOT, "assets", "azure");
28
-
29
- /** Resolve a decoration asset path: explicit absolute override (custom-accent
30
- * regenerated gradients), then d.dir "azure" → assets/azure, else assets/media. */
31
- function decorAssetPath(d) {
32
- if (d.assetPath) return d.assetPath;
33
- if (d.dir === "azure") return path.join(ASSETS_AZURE, d.asset);
34
- return path.join(ASSETS_MEDIA, d.asset);
35
- }
36
- const hex = (c) => (c || "#000000").replace("#", "");
37
-
38
- // A template may carry its own disclaimer line (`text:` on the decoration); this
39
- // generic one names no organisation.
40
- const DEFAULT_DISCLAIMER =
41
- "\u203B \uBCF8 \uBB38\uC11C\uB294 \uB300\uC678\uBE44\uB85C, \uAD8C\uD55C\uC774 \uC5C6\uB294 \uC790\uC5D0\uAC8C \uC5F4\uB78C, \uBCF5\uC0AC, \uBC30\uD3EC, \uACF5\uAC1C, \uB610\uB294 \uC0AC\uC6A9\uC774 \uAE08\uC9C0\uB429\uB2C8\uB2E4.";
42
-
43
- function linkedTableCell(text, options) {
44
- const original = cleanMd(text);
45
- let display = original;
46
- let url = null;
47
- const markdown = original.match(/\[([^\]]+)\]\((https?:\/\/[^)\s]+)\)/i);
48
- if (markdown) {
49
- display = original.replace(markdown[0], markdown[1]);
50
- url = markdown[2];
51
- } else {
52
- const rawUrl = original.match(/https?:\/\/[^\s<>\])}]+/i);
53
- const doi = original.match(/\b10\.\d{4,9}\/[^\s<>\])}]+/i);
54
- if (rawUrl) url = rawUrl[0].replace(/[.,;:]+$/, "");
55
- else if (doi) url = `https://doi.org/${doi[0].replace(/[.,;:]+$/, "")}`;
56
- }
57
- return {
58
- text: display,
59
- options: {
60
- ...options,
61
- ...(url ? { hyperlink: { url } } : {}),
62
- },
63
- };
64
- }
65
-
66
- // ── Text style constants (defaults; every template reassigns them in render()).
67
- // These are reassigned from the template at the start of render() so the same
68
- // adapter serves any enrolled template (e.g. BOILERPLATE-PRETENDARD).
69
- let FONT_BOLD = "Pretendard";
70
- let FONT_MEDIUM = "Pretendard";
71
- let FONT_LIGHT = "Pretendard";
72
- let CHAR_SPACING = -0.7;
73
- // Chart colours and faces for templates without the rich palette; set per render().
74
- let PLAIN_CHART_STYLE = { series: ["3C3836", "689D6A", "D79921", "B16286"], ink: "3C3836", ink_muted: "6E6256", line: "CBC2B5", titleFont: "Pretendard", bodyFont: "Pretendard" };
75
-
76
- function expandHome(p) {
77
- if (p === "~") return os.homedir();
78
- if (p && p.startsWith(`~${path.sep}`)) return path.join(os.homedir(), p.slice(2));
79
- return p;
80
- }
81
-
82
- function resolveImagePath(src, sourceDir) {
83
- if (!src) throw new Error("Image source is empty");
84
- const expanded = expandHome(src);
85
- const candidates = [];
86
- if (path.isAbsolute(expanded)) candidates.push(expanded);
87
- else {
88
- if (sourceDir) candidates.push(path.resolve(sourceDir, expanded));
89
- candidates.push(path.resolve(process.cwd(), expanded));
90
- candidates.push(path.join(ASSETS_MEDIA, expanded));
91
- candidates.push(path.resolve(TOOLKIT_ROOT, expanded));
92
- }
93
- const found = candidates.find((candidate) => fs.existsSync(candidate));
94
- if (!found) {
95
- throw new Error(`Image not found: ${src}. Checked: ${candidates.join(", ")}`);
96
- }
97
- return found;
98
- }
99
-
100
- function readImageSize(filePath) {
101
- const buf = fs.readFileSync(filePath);
102
- if (buf.length >= 24 && buf.toString("ascii", 1, 4) === "PNG") {
103
- return { width: buf.readUInt32BE(16), height: buf.readUInt32BE(20) };
104
- }
105
- if (buf.length >= 4 && buf[0] === 0xff && buf[1] === 0xd8) {
106
- let offset = 2;
107
- while (offset + 9 < buf.length) {
108
- if (buf[offset] !== 0xff) { offset++; continue; }
109
- const marker = buf[offset + 1];
110
- const length = buf.readUInt16BE(offset + 2);
111
- if (length < 2) break;
112
- if ((marker >= 0xc0 && marker <= 0xc3) || (marker >= 0xc5 && marker <= 0xc7) ||
113
- (marker >= 0xc9 && marker <= 0xcb) || (marker >= 0xcd && marker <= 0xcf)) {
114
- return { width: buf.readUInt16BE(offset + 7), height: buf.readUInt16BE(offset + 5) };
115
- }
116
- offset += 2 + length;
117
- }
118
- }
119
- return null;
120
- }
121
-
122
- function containBox(x, y, w, h, imageSize) {
123
- if (!imageSize || !imageSize.width || !imageSize.height) return { x, y, w, h };
124
- const boxRatio = w / h;
125
- const imageRatio = imageSize.width / imageSize.height;
126
- if (imageRatio > boxRatio) {
127
- const fittedH = w / imageRatio;
128
- return { x, y: y + (h - fittedH) / 2, w, h: fittedH };
129
- }
130
- const fittedW = h * imageRatio;
131
- return { x: x + (w - fittedW) / 2, y, w: fittedW, h };
132
- }
133
-
134
- // Bullet items. Geometry comes from the template's tokens (bullet.*, secHeader.*, summary.*,
135
- // toc.*), reassigned in render(); these defaults are the legacy values.
136
- let BULLET_COLOR = "1D4ED8"; // bullet color (reassigned per template)
137
- let SECTION_ACCENT = "1D4ED8"; // section-card / accent color (reassigned per template)
138
- const BULLET_PREFIX = "\u2022 "; // "• " (bullet + two spaces)
139
- let BULLET_X = LEGACY_TOKENS.bullet.x;
140
- let BULLET_W = LEGACY_TOKENS.bullet.w;
141
-
142
- // Section headers
143
- let SEC_HEADER_FONT = FONT_BOLD;
144
- let SEC_HEADER_SIZE = LEGACY_TOKENS.secHeader.size;
145
- const SEC_HEADER_COLOR = "000000";
146
- let SEC_HEADER_X = LEGACY_TOKENS.secHeader.x;
147
- let SEC_HEADER_W = LEGACY_TOKENS.secHeader.w;
148
- let SEC_HEADER_H = LEGACY_TOKENS.secHeader.h;
149
-
150
- // Summary (narrow width)
151
- let SUMMARY_HEADER_W = LEGACY_TOKENS.summary.headerW;
152
- let SUMMARY_BULLET_W = LEGACY_TOKENS.summary.bulletW;
153
- let SUMMARY_BULLET_SIZE = LEGACY_TOKENS.summary.bulletSize;
154
- let SUMMARY_BULLET_H = LEGACY_TOKENS.summary.bulletH;
155
- let SUMMARY_BULLET_Y_SPACING = LEGACY_TOKENS.summary.ySpacing;
156
- let SUMMARY_BULLET_LINE_SPACING = LEGACY_TOKENS.summary.lineSpacing;
157
-
158
- // TOC items (separate shapes)
159
- let TOC_FONT = FONT_BOLD;
160
- let TOC_SIZE = LEGACY_TOKENS.toc.size;
161
- const TOC_COLOR = "000000";
162
- let TOC_X = LEGACY_TOKENS.toc.x;
163
- let TOC_W = LEGACY_TOKENS.toc.w;
164
- let TOC_H = LEGACY_TOKENS.toc.h;
165
- let TOC_Y_START = LEGACY_TOKENS.toc.yStart;
166
- let TOC_Y_SPACING = LEGACY_TOKENS.toc.ySpacing;
167
-
168
- /** Reassign the token-driven geometry from the template's pack (legacy values when absent). */
169
- function applyTokens(tokens) {
170
- const t = tokens || LEGACY_TOKENS;
171
- ({ x: BULLET_X, w: BULLET_W } = t.bullet);
172
- ({ size: SEC_HEADER_SIZE, x: SEC_HEADER_X, w: SEC_HEADER_W, h: SEC_HEADER_H } = t.secHeader);
173
- ({ headerW: SUMMARY_HEADER_W, bulletW: SUMMARY_BULLET_W, bulletSize: SUMMARY_BULLET_SIZE, bulletH: SUMMARY_BULLET_H,
174
- ySpacing: SUMMARY_BULLET_Y_SPACING, lineSpacing: SUMMARY_BULLET_LINE_SPACING } = t.summary);
175
- ({ size: TOC_SIZE, x: TOC_X, w: TOC_W, h: TOC_H, yStart: TOC_Y_START, ySpacing: TOC_Y_SPACING } = t.toc);
176
- ({ pad: CARD_PAD, chip: CARD_CHIP, minH: CARD_MIN_H, gap: CARD_GAP, radius: CARD_RADIUS } = t.card);
177
- ({ minCardWidth: KPI_MIN_CARD_WIDTH_IN, gap: KPI_GAP } = t.kpi);
178
- NOTICE = { ...t.notice };
179
- }
180
-
181
- function weightedTextLength(text) {
182
- let total = 0;
183
- for (const ch of String(text || "")) {
184
- if (/\s/.test(ch)) total += 0.35;
185
- else if (/^[\x00-\x7F]$/.test(ch)) total += 0.58;
186
- else total += 1.0;
187
- }
188
- return total;
189
- }
190
-
191
- function estimateWrappedLines(text, widthIn, fontSize) {
192
- const usablePt = Math.max(12, (widthIn || 4) * 72 - 10);
193
- // Conservative on purpose: PowerPoint wraps dense mixed
194
- // Korean-English strings earlier than a naive ASCII width estimate.
195
- const unitsPerLine = Math.max(4, usablePt / Math.max(4, fontSize * 0.95));
196
- return Math.max(1, Math.ceil(weightedTextLength(text) / unitsPerLine));
197
- }
198
-
199
- function estimateTextHeight(text, widthIn, fontSize, lineSpacingMultiple) {
200
- const lines = estimateWrappedLines(text, widthIn, fontSize);
201
- return Math.max(0.14, ((lines * fontSize * lineSpacingMultiple) / 72) * 1.4 + 0.08);
202
- }
203
-
204
- function bodyElements(items) {
205
- const elements = [];
206
- let numberedCounter = 0;
207
- for (const item of items) {
208
- if (item.type === "section") {
209
- elements.push({ kind: "section", text: item.heading || "" });
210
- numberedCounter = 0;
211
- for (const child of item.children || []) {
212
- numberedCounter++;
213
- elements.push({ kind: "numbered", text: `(${numberedCounter}) ${child.text || ""}` });
214
- }
215
- } else if (item.type === "bullet") {
216
- elements.push({ kind: "bullet", text: item.text || "" });
217
- numberedCounter = 0;
218
- for (const child of item.children || []) {
219
- numberedCounter++;
220
- elements.push({ kind: "numbered", text: `(${numberedCounter}) ${child.text || ""}` });
221
- }
222
- } else if (item.type === "numbered") {
223
- numberedCounter++;
224
- elements.push({ kind: "numbered", text: `(${numberedCounter}) ${item.text || ""}` });
225
- } else if (item.type === "text") {
226
- elements.push({ kind: "text", text: item.text || "" });
227
- }
228
- }
229
- return elements;
230
- }
231
-
232
- function chooseBodyStyle(items, widthIn, startY, bottomY) {
233
- const available = Math.max(0.5, (bottomY || 7.0) - startY);
234
- const sizes = [16, 15, 14, 13];
235
- for (const bodySize of sizes) {
236
- const sectionSize = Math.min(18, bodySize + 2);
237
- const lineSpacing = bodySize <= 10 ? 1.05 : 1.18;
238
- const gap = bodySize <= 10 ? 0.035 : 0.05;
239
- const total = bodyElements(items).reduce((sum, el) => {
240
- const size = el.kind === "section" ? sectionSize : bodySize;
241
- const w = el.kind === "section" ? Math.min(widthIn, SEC_HEADER_W) : widthIn;
242
- return sum + estimateTextHeight(el.text, w, size, lineSpacing) + gap;
243
- }, 0);
244
- if (total <= available) return { bodySize, sectionSize, lineSpacing, gap };
245
- }
246
- return { bodySize: 13, sectionSize: 15, lineSpacing: 1.08, gap: 0.04 };
247
- }
248
-
249
- function estimateSectionHeight(item, secW, bulletW, style) {
250
- let total = estimateTextHeight(item.heading || "", secW, style.sectionSize, style.lineSpacing) + style.gap;
251
- let numberedCounter = 0;
252
- for (const child of item.children || []) {
253
- numberedCounter++;
254
- total += estimateTextHeight(`(${numberedCounter}) ${child.text || ""}`, bulletW, style.bodySize, style.lineSpacing) + style.gap;
255
- }
256
- return total + 0.12;
257
- }
258
-
259
- function addSectionCard(slide, x, y, w, h) {
260
- slide.addShape("rect", {
261
- x,
262
- y: y - 0.035,
263
- w,
264
- h: Math.max(0.28, h),
265
- fill: { color: "F7F9F8", transparency: 12 },
266
- line: { color: "D8E2DD", width: 0.5, transparency: 20 },
267
- });
268
- }
269
-
270
- function bodyItemsToDiagnosticLines(items) {
271
- const lines = [];
272
- let numberedCounter = 0;
273
- for (const item of items || []) {
274
- if (item.type === "section") {
275
- lines.push(`■ ${item.heading || ""}`);
276
- numberedCounter = 0;
277
- for (const child of item.children || []) {
278
- numberedCounter++;
279
- lines.push(`(${numberedCounter}) ${child.text || ""}`);
280
- }
281
- } else if (item.type === "bullet") {
282
- lines.push(`• ${item.text || ""}`);
283
- numberedCounter = 0;
284
- for (const child of item.children || []) {
285
- numberedCounter++;
286
- lines.push(`(${numberedCounter}) ${child.text || ""}`);
287
- }
288
- } else if (item.type === "numbered") {
289
- numberedCounter++;
290
- lines.push(`(${numberedCounter}) ${item.text || ""}`);
291
- } else if (item.type === "text") {
292
- lines.push(item.text || "");
293
- }
294
- }
295
- return lines.filter(Boolean);
296
- }
297
-
298
- function bodyItemsToDiagnosticCards(items) {
299
- const cards = [];
300
- let numberedCounter = 0;
301
- for (const item of items || []) {
302
- if (item.type === "section" || item.type === "bullet") {
303
- const title = item.heading || item.text || "";
304
- const body = [];
305
- numberedCounter = 0;
306
- for (const child of item.children || []) {
307
- numberedCounter++;
308
- body.push(`(${numberedCounter}) ${child.text || ""}`);
309
- }
310
- if (title || body.length) cards.push({ title, body });
311
- } else if (item.type === "numbered") {
312
- numberedCounter++;
313
- cards.push({ title: `(${numberedCounter})`, body: [item.text || ""] });
314
- } else if (item.type === "text" && item.text) {
315
- cards.push({ title: "", body: [item.text] });
316
- }
317
- }
318
- return cards;
319
- }
320
-
321
- function splitLinesByWeight(lines, columns) {
322
- const groups = Array.from({ length: columns }, () => []);
323
- const weights = Array(columns).fill(0);
324
- for (const line of lines) {
325
- let target = 0;
326
- for (let i = 1; i < columns; i++) {
327
- if (weights[i] < weights[target]) target = i;
328
- }
329
- groups[target].push(line);
330
- weights[target] += Math.max(20, weightedTextLength(line));
331
- }
332
- return groups;
333
- }
334
-
335
- function splitCardsByWeight(cards, columns) {
336
- const groups = Array.from({ length: columns }, () => []);
337
- const weights = Array(columns).fill(0);
338
- for (const card of cards) {
339
- let target = 0;
340
- for (let i = 1; i < columns; i++) {
341
- if (weights[i] < weights[target]) target = i;
342
- }
343
- groups[target].push(card);
344
- const cardWeight = weightedTextLength(card.title || "") * 1.4
345
- + (card.body || []).reduce((sum, line) => sum + weightedTextLength(line), 0);
346
- weights[target] += Math.max(80, cardWeight);
347
- }
348
- return groups;
349
- }
350
-
351
- function renderDiagnosticCard(slide, card, x, y, w, h, idx) {
352
- slide.addShape("rect", {
353
- x,
354
- y,
355
- w,
356
- h,
357
- fill: { color: idx % 2 ? "F8FAF9" : "F3F6F4", transparency: 2 },
358
- line: { color: "D6E2DB", width: 0.35, transparency: 12 },
359
- });
360
- slide.addShape("rect", {
361
- x,
362
- y,
363
- w: 0.028,
364
- h,
365
- fill: { color: SECTION_ACCENT, transparency: 0 },
366
- line: { color: SECTION_ACCENT, transparency: 100 },
367
- });
368
-
369
- const padX = 0.055;
370
- const padY = 0.05;
371
- const titleH = card.title ? Math.min(0.28, Math.max(0.18, h * 0.16)) : 0;
372
- if (card.title) {
373
- slide.addText(card.title, {
374
- x: x + padX,
375
- y: y + padY,
376
- w: w - padX * 1.45,
377
- h: titleH,
378
- fontFace: FONT_BOLD,
379
- fontSize: 7.4,
380
- color: "002554",
381
- charSpacing: -0.25,
382
- fit: "shrink",
383
- margin: 0.01,
384
- breakLine: false,
385
- valign: "top",
386
- });
387
- }
388
-
389
- const bodyText = (card.body || []).join("\n");
390
- if (bodyText) {
391
- slide.addText(bodyText, {
392
- x: x + padX,
393
- y: y + padY + titleH + 0.015,
394
- w: w - padX * 1.45,
395
- h: Math.max(0.16, h - titleH - padY * 1.6),
396
- fontFace: FONT_MEDIUM,
397
- fontSize: 5.85,
398
- color: "1F1F1F",
399
- charSpacing: -0.18,
400
- fit: "shrink",
401
- margin: 0.008,
402
- paraSpaceAfterPt: 0,
403
- lineSpacingMultiple: 0.96,
404
- breakLine: false,
405
- valign: "top",
406
- });
407
- }
408
- }
409
-
410
- function estimateDiagnosticCardHeight(card, w) {
411
- const padY = 0.05;
412
- const titleH = card.title ? 0.24 : 0;
413
- const bodyText = (card.body || []).join("\n");
414
- const bodyH = bodyText ? estimateTextHeight(bodyText, Math.max(0.8, w - 0.12), 5.85, 1.02) : 0;
415
- return Math.max(0.56, Math.min(2.35, padY * 2 + titleH + bodyH));
416
- }
417
-
418
- function renderCramStressBody(slide, items, pageH) {
419
- const cards = bodyItemsToDiagnosticCards(items);
420
- const columns = 3;
421
- const groups = cards.length ? splitCardsByWeight(cards, columns) : splitLinesByWeight(bodyItemsToDiagnosticLines(items), columns).map((group) => [{ title: "", body: group }]);
422
- const x = 0.28;
423
- const y = 0.98;
424
- const w = 7.78;
425
- const h = pageH - y - 0.34;
426
- const gap = 0.105;
427
- const colW = (w - gap * (columns - 1)) / columns;
428
- groups.forEach((group, idx) => {
429
- const colX = x + idx * (colW + gap);
430
- const cardGap = 0.075;
431
- const availableH = h - cardGap * Math.max(0, group.length - 1);
432
- const desiredHeights = group.map((card) => estimateDiagnosticCardHeight(card, colW));
433
- const desiredTotal = desiredHeights.reduce((sum, value) => sum + value, 0) || 1;
434
- const scale = desiredTotal > availableH ? availableH / desiredTotal : 1;
435
- let cursorY = y;
436
- group.forEach((card, cardIdx) => {
437
- const remainingCards = group.length - cardIdx - 1;
438
- const rawH = desiredHeights[cardIdx] * scale;
439
- const cardH = Math.max(0.62, Math.min(rawH, h - (cursorY - y) - remainingCards * (0.62 + cardGap)));
440
- renderDiagnosticCard(slide, card, colX, cursorY, colW, cardH, idx + cardIdx);
441
- cursorY += cardH + cardGap;
442
- });
443
- });
444
- }
445
-
446
- function renderCramStressImageSheet(slide, content, sourceDir, pageW, pageH) {
447
- if (!content) return;
448
- const images = content.type === "image-grid"
449
- ? (Array.isArray(content.images) ? content.images : [])
450
- : content.type === "image" ? [content] : [];
451
- if (images.length === 0) return;
452
- const x = 8.24;
453
- const y = 0.98;
454
- const w = pageW - x - 0.25;
455
- const h = pageH - y - 0.34;
456
- const cols = images.length >= 8 ? 2 : 1;
457
- const rows = Math.ceil(images.length / cols);
458
- const gap = 0.04;
459
- const cellW = (w - gap * (cols - 1)) / cols;
460
- const headerH = 0.28;
461
- const sheetH = Math.min(h - 0.9, rows * 0.58 + gap * (rows - 1));
462
- const cellH = (sheetH - gap * (rows - 1)) / rows;
463
- const noteY = y + headerH + sheetH + 0.16;
464
- const noteH = Math.min(1.0, h - (noteY - y) - 0.08);
465
- const panelH = noteY - y + noteH;
466
- slide.addShape("rect", {
467
- x: x - 0.04,
468
- y: y - 0.04,
469
- w: w + 0.08,
470
- h: panelH + 0.08,
471
- fill: { color: "F5F8F6", transparency: 0 },
472
- line: { color: "CAD4CE", width: 0.5 },
473
- });
474
- slide.addText("RAW EVIDENCE CONTACT SHEET", {
475
- x,
476
- y: y + 0.02,
477
- w,
478
- h: 0.16,
479
- fontFace: FONT_BOLD,
480
- fontSize: 5.8,
481
- color: "002554",
482
- charSpacing: -0.15,
483
- fit: "shrink",
484
- margin: 0,
485
- });
486
- slide.addShape("rect", {
487
- x,
488
- y: y + 0.22,
489
- w,
490
- h: 0,
491
- line: { color: SECTION_ACCENT, width: 0.45 },
492
- });
493
- images.forEach((image, idx) => {
494
- const imgPath = resolveImagePath(image.src, sourceDir);
495
- const col = idx % cols;
496
- const row = Math.floor(idx / cols);
497
- const fit = containBox(
498
- x + col * (cellW + gap),
499
- y + headerH + row * (cellH + gap),
500
- cellW,
501
- cellH,
502
- readImageSize(imgPath),
503
- );
504
- slide.addImage({
505
- path: imgPath,
506
- ...fit,
507
- altText: image.caption || path.basename(image.src || imgPath),
508
- });
509
- });
510
- slide.addShape("rect", {
511
- x,
512
- y: noteY,
513
- w,
514
- h: noteH,
515
- fill: { color: "FFFFFF", transparency: 0 },
516
- line: { color: "D6E2DB", width: 0.35, transparency: 20 },
517
- });
518
- slide.addText("diagnostic cram-stress\nmicrotext is intentional\nproduction decks must synthesize\noverflow / marker / missing media = fail", {
519
- x: x + 0.06,
520
- y: noteY + 0.07,
521
- w: w - 0.12,
522
- h: Math.max(0.24, noteH - 0.14),
523
- fontFace: FONT_MEDIUM,
524
- fontSize: 5.3,
525
- color: "333333",
526
- charSpacing: -0.15,
527
- fit: "shrink",
528
- margin: 0.01,
529
- breakLine: false,
530
- lineSpacingMultiple: 1.02,
531
- valign: "mid",
532
- });
533
- }
534
-
535
- function isCramStressDeck(resolved) {
536
- const meta = (resolved && resolved.deck && resolved.deck.metadata) || {};
537
- return String(meta.render_mode || meta.renderMode || "").toLowerCase() === "cram-stress";
538
- }
539
-
540
- function renderCramStressSlide(slide, slideSpec, pageW, pageH, sourceDir) {
541
- const regions = slideSpec.regions || {};
542
- const title = regions.title && regions.title.content;
543
- if (title) {
544
- slide.addText(String(title), {
545
- x: 0.24,
546
- y: 0.24,
547
- w: pageW - 1.72,
548
- h: 0.46,
549
- fontFace: FONT_BOLD,
550
- fontSize: 13.5,
551
- color: "000000",
552
- charSpacing: CHAR_SPACING,
553
- fit: "shrink",
554
- });
555
- slide.addShape("rect", {
556
- x: 0.24,
557
- y: 0.76,
558
- w: pageW - 0.48,
559
- h: 0,
560
- line: { color: SECTION_ACCENT, width: 1.2 },
561
- });
562
- }
563
- if (regions.body && regions.body.content && regions.body.content.type === "body") {
564
- renderCramStressBody(slide, regions.body.content.items || [], pageH);
565
- }
566
- if (regions.image && regions.image.content) {
567
- renderCramStressImageSheet(slide, regions.image.content, sourceDir, pageW, pageH);
568
- }
569
- }
570
-
571
- function shouldUseDenseBodyFlow(items, widthIn, startY, bottomY) {
572
- const elements = bodyElements(items);
573
- const charCount = elements.reduce((sum, el) => sum + String(el.text || "").length, 0);
574
- const available = Math.max(0.5, (bottomY || 7.0) - startY);
575
- const estimatedAtMin = elements.reduce((sum, el) => {
576
- const size = el.kind === "section" ? 12.8 : 11.5;
577
- return sum + estimateTextHeight(el.text, Math.max(1.8, widthIn / 2), size, 1.02) + 0.025;
578
- }, 0);
579
- return widthIn >= 4.4 && (elements.length >= 18 || charCount >= 2400 || estimatedAtMin > available * 1.35);
580
- }
581
-
582
- function chooseDenseBodyStyle() {
583
- return { bodySize: 11.5, sectionSize: 12.8, lineSpacing: 1.02, gap: 0.025 };
584
- }
585
-
586
- // ── Font role helpers ───────────────────────────────────────────────────────
587
-
588
- /**
589
- * Build font role map from template capabilities.
590
- * Maps YAML field names to pptxgenjs option names.
591
- */
592
- function buildFontRoles(templateObj) {
593
- if (!templateObj || !templateObj.capabilities || !templateObj.capabilities.font_roles) {
594
- return {};
595
- }
596
-
597
- const roles = {};
598
- for (const [name, def] of Object.entries(templateObj.capabilities.font_roles)) {
599
- roles[name] = {
600
- font: def.font,
601
- size: def.size,
602
- color: (def.color || "#000000").replace("#", ""),
603
- align: def.align || "left",
604
- charSpacing: def.char_spacing,
605
- lineSpacing: def.line_spacing,
606
- bold: def.bold,
607
- spaceAfter: def.space_after,
608
- bulletType: def.bullet_type,
609
- bulletChar: def.bullet_char,
610
- bulletFont: def.bullet_font,
611
- numberType: def.number_type,
612
- marL: def.marL,
613
- indent: def.indent,
614
- fill: def.fill ? def.fill.replace("#", "") : undefined,
615
- borderColor: def.border_color ? def.border_color.replace("#", "") : undefined,
616
- borderWidth: def.border_width,
617
- };
618
- }
619
- return roles;
620
- }
621
-
622
- // ── Decoration rendering ────────────────────────────────────────────────────
623
-
624
- /**
625
- * Add decoration elements to a pptxgenjs slide.
626
- * Note: slide_number is intentionally omitted — the reference template has none.
627
- */
628
- function addDecorations(slide, decorations, fontRoles) {
629
- if (!decorations || !Array.isArray(decorations)) return;
630
-
631
- for (const d of decorations) {
632
- if (d.type === "image") {
633
- slide.addImage({
634
- path: decorAssetPath(d),
635
- x: d.x || 0,
636
- y: d.y || 0,
637
- w: d.w || 1,
638
- h: d.h || 1,
639
- rotate: d.rotate || undefined,
640
- altText: d.asset || "template-image",
641
- });
642
-
643
- } else if (d.type === "rect" || d.type === "roundRect" || d.type === "pill") {
644
- // Solid color block / rounded card / full-radius pill. Optional text label.
645
- const shape = d.type === "rect" ? "rect" : "roundRect";
646
- const opts = {
647
- x: d.x || 0, y: d.y || 0, w: d.w || 1, h: d.h || 0.5,
648
- };
649
- if (d.fill) opts.fill = { color: hex(d.fill), transparency: d.alpha || 0 };
650
- else opts.fill = { type: "none" };
651
- if (d.line) opts.line = { color: hex(d.line), width: d.line_width || 1 };
652
- else opts.line = { type: "none" };
653
- if (shape === "roundRect") opts.rectRadius = d.type === "pill" ? (d.h || 0.5) / 2 : (d.radius != null ? d.radius : 0.12);
654
- slide.addShape(shape, opts);
655
- if (d.text) {
656
- slide.addText(d.text, {
657
- x: d.x || 0, y: d.y || 0, w: d.w || 1, h: d.h || 0.5,
658
- fontFace: d.font || FONT_BOLD, fontSize: d.size || 12,
659
- color: hex(d.text_color || "#FFFFFF"), bold: !!d.bold,
660
- align: d.align || "center", valign: "middle",
661
- charSpacing: d.char_spacing != null ? d.char_spacing : CHAR_SPACING,
662
- });
663
- }
664
-
665
- } else if (d.type === "ellipse" || d.type === "ring") {
666
- const opts = { x: d.x || 0, y: d.y || 0, w: d.w || 1, h: d.h || (d.w || 1) };
667
- if (d.type === "ring" || !d.fill) {
668
- opts.fill = { type: "none" };
669
- opts.line = { color: hex(d.line || d.color || "#FFFFFF"), width: d.line_width || 2 };
670
- } else {
671
- opts.fill = { color: hex(d.fill), transparency: d.alpha || 0 };
672
- opts.line = { type: "none" };
673
- }
674
- slide.addShape("ellipse", opts);
675
-
676
- } else if (d.type === "text") {
677
- slide.addText(d.text || "", {
678
- x: d.x || 0, y: d.y || 0, w: d.w || 4, h: d.h || 1,
679
- fontFace: d.font || FONT_BOLD, fontSize: d.size || 14,
680
- color: hex(d.color || "#000000"), bold: !!d.bold,
681
- align: d.align || "left", valign: d.valign || "top",
682
- charSpacing: d.char_spacing != null ? d.char_spacing : CHAR_SPACING,
683
- transparency: d.transparency != null ? d.transparency : undefined,
684
- });
685
-
686
- } else if (d.type === "line") {
687
- slide.addShape("rect", {
688
- x: d.x || 0,
689
- y: d.y || 0,
690
- w: d.w || 1,
691
- h: 0,
692
- line: { color: (d.color || "#000000").replace("#", ""), width: d.width || 1 },
693
- });
694
-
695
- } else if (d.type === "confidential_mark") {
696
- const role = fontRoles.confidential_mark || {};
697
- const mX = d.x || 0, mY = d.y || 0, mW = d.w || 1, mH = d.h || 0.3;
698
- const bColor = role.borderColor || "C00000";
699
- const bPt = role.borderWidth || 1;
700
- slide.addShape("rect", {
701
- x: mX, y: mY, w: mW, h: mH,
702
- line: { color: bColor, width: bPt },
703
- });
704
- slide.addText("\u5C0D \u5916 \u79D8", {
705
- x: mX, y: mY, w: mW, h: mH,
706
- fontFace: role.font || FONT_MEDIUM,
707
- fontSize: role.size || 14,
708
- color: role.color || "C00000",
709
- align: role.align || "center",
710
- valign: "middle",
711
- });
712
-
713
- } else if (d.type === "disclaimer") {
714
- const role = fontRoles.disclaimer || {};
715
- slide.addText(
716
- d.text || DEFAULT_DISCLAIMER,
717
- {
718
- x: d.x || 0,
719
- y: d.y || 0,
720
- w: d.w || 1,
721
- h: d.h || 0.2,
722
- fontFace: role.font || FONT_LIGHT,
723
- fontSize: role.size || 6,
724
- color: role.color || "666666",
725
- align: role.align || "left",
726
- }
727
- );
728
- }
729
- // slide_number intentionally removed — reference template has none
730
- }
731
- }
732
-
733
- // ── Body shape rendering (individual shapes per line) ────────────────────
734
-
735
- /**
736
- * Add body items as individual shapes to a slide.
737
- * Each section header and bullet item is a separate positioned shape.
738
- *
739
- * @param {object} slide - pptxgenjs slide
740
- * @param {Array} items - AST items (section, bullet, numbered, text)
741
- * @param {number} startY - Starting y position
742
- * @param {number} maxX - Max width for positioning
743
- * @returns {number} The y position after the last item
744
- */
745
- function addBodyShapes(slide, items, startY, maxX, bottomY, originX) {
746
- const denseFlow = shouldUseDenseBodyFlow(items, maxX, startY, bottomY || 7.0);
747
- const columns = denseFlow ? 2 : 1;
748
- const colGap = denseFlow ? 0.16 : 0;
749
- const colW = (maxX - colGap * (columns - 1)) / columns;
750
- let col = 0;
751
- let y = startY;
752
- // Template regions have always drawn body text at the template's own left
753
- // margin. A placed box carries its own, and passes it here.
754
- const baseX = originX != null ? originX : SEC_HEADER_X;
755
- const bodyIndent = denseFlow ? 0.13 : (BULLET_X - SEC_HEADER_X);
756
- const BODY_FULL_W = 10.188;
757
- const scale = colW / BODY_FULL_W;
758
- const secW = denseFlow ? Math.max(1.4, colW - 0.04) : SEC_HEADER_W * scale;
759
- const bulletW = denseFlow ? Math.max(1.2, colW - bodyIndent - 0.02) : BULLET_W * scale;
760
- let numberedCounter = 0;
761
- const style = denseFlow ? chooseDenseBodyStyle() : chooseBodyStyle(items, bulletW, startY, bottomY || 7.0);
762
-
763
- function colX() { return baseX + col * (colW + colGap); }
764
- function secX() { return colX(); }
765
- function bulletX() { return colX() + bodyIndent; }
766
- function maybeAdvanceColumn(nextHeight) {
767
- if (!denseFlow || col >= columns - 1) return;
768
- if (y + nextHeight > (bottomY || 7.0)) {
769
- col++;
770
- y = startY;
771
- }
772
- }
773
-
774
- for (const item of items) {
775
- if (item.type === "section") {
776
- const sectionH = estimateTextHeight(item.heading, secW, style.sectionSize, style.lineSpacing);
777
- const cardH = estimateSectionHeight(item, secW, bulletW, style);
778
- maybeAdvanceColumn(Math.min(cardH, sectionH + 0.2));
779
- addSectionCard(slide, secX() - 0.035, y - 0.03, Math.max(secW, bulletW + bodyIndent) + 0.07, cardH);
780
- // Section header — separate shape, black, 1.5 line spacing
781
- slide.addText(mdRuns(item.heading, {
782
- fontFace: SEC_HEADER_FONT,
783
- fontSize: style.sectionSize,
784
- color: SEC_HEADER_COLOR,
785
- charSpacing: CHAR_SPACING,
786
- }), {
787
- x: secX(),
788
- y: y,
789
- w: secW,
790
- h: sectionH,
791
- lineSpacingMultiple: style.lineSpacing,
792
- });
793
- y += sectionH + style.gap;
794
-
795
- // Numbered children with (1)(2)(3) format
796
- if (item.children) {
797
- numberedCounter = 0;
798
- for (const child of item.children) {
799
- numberedCounter++;
800
- const numPrefix = `(${numberedCounter}) `;
801
- const text = numPrefix + cleanMd(child.text);
802
- const h = estimateTextHeight(text, bulletW, style.bodySize, style.lineSpacing);
803
- maybeAdvanceColumn(h);
804
- slide.addText([
805
- { text: numPrefix, options: { fontFace: FONT_MEDIUM, fontSize: style.bodySize, color: "000000", charSpacing: CHAR_SPACING } },
806
- ...mdRuns(child.text, { fontFace: FONT_MEDIUM, fontSize: style.bodySize, color: "000000", charSpacing: CHAR_SPACING }),
807
- ], {
808
- x: bulletX(),
809
- y: y,
810
- w: bulletW,
811
- h,
812
- lineSpacingMultiple: style.lineSpacing,
813
- });
814
- y += h + style.gap;
815
- }
816
- }
817
- y += 0.08;
818
-
819
- } else if (item.type === "bullet") {
820
- const h = estimateTextHeight(item.text, bulletW, style.bodySize, style.lineSpacing);
821
- maybeAdvanceColumn(h);
822
- // Bullet item — green prefix + black text
823
- slide.addText([
824
- { text: BULLET_PREFIX, options: { fontFace: FONT_BOLD, fontSize: style.bodySize, color: BULLET_COLOR, charSpacing: CHAR_SPACING } },
825
- ...mdRuns(item.text, { fontFace: FONT_MEDIUM, fontSize: style.bodySize, color: "000000", charSpacing: CHAR_SPACING }),
826
- ], {
827
- x: bulletX(),
828
- y: y,
829
- w: bulletW,
830
- h,
831
- lineSpacingMultiple: style.lineSpacing,
832
- });
833
- y += h + style.gap;
834
-
835
- // Children (numbered sub-items)
836
- if (item.children) {
837
- numberedCounter = 0;
838
- for (const child of item.children) {
839
- numberedCounter++;
840
- const numPrefix = `(${numberedCounter}) `;
841
- const text = numPrefix + cleanMd(child.text);
842
- const childH = estimateTextHeight(text, bulletW, style.bodySize, style.lineSpacing);
843
- maybeAdvanceColumn(childH);
844
- slide.addText([
845
- { text: numPrefix, options: { fontFace: FONT_MEDIUM, fontSize: style.bodySize, color: "000000", charSpacing: CHAR_SPACING } },
846
- ...mdRuns(child.text, { fontFace: FONT_MEDIUM, fontSize: style.bodySize, color: "000000", charSpacing: CHAR_SPACING }),
847
- ], {
848
- x: bulletX(),
849
- y: y,
850
- w: bulletW,
851
- h: childH,
852
- lineSpacingMultiple: style.lineSpacing,
853
- });
854
- y += childH + style.gap;
855
- }
856
- }
857
-
858
- } else if (item.type === "numbered") {
859
- numberedCounter++;
860
- const numPrefix = `(${numberedCounter}) `;
861
- const text = numPrefix + cleanMd(item.text);
862
- const h = estimateTextHeight(text, bulletW, style.bodySize, style.lineSpacing);
863
- maybeAdvanceColumn(h);
864
- slide.addText([
865
- { text: numPrefix, options: { fontFace: FONT_MEDIUM, fontSize: style.bodySize, color: "000000", charSpacing: CHAR_SPACING } },
866
- ...mdRuns(item.text, { fontFace: FONT_MEDIUM, fontSize: style.bodySize, color: "000000", charSpacing: CHAR_SPACING }),
867
- ], {
868
- x: bulletX(),
869
- y: y,
870
- w: bulletW,
871
- h,
872
- lineSpacingMultiple: style.lineSpacing,
873
- });
874
- y += h + style.gap;
875
-
876
- } else if (item.type === "text") {
877
- const h = estimateTextHeight(item.text, bulletW, style.bodySize, style.lineSpacing);
878
- maybeAdvanceColumn(h);
879
- slide.addText(mdRuns(item.text, {
880
- fontFace: FONT_MEDIUM,
881
- fontSize: style.bodySize,
882
- color: "000000",
883
- charSpacing: CHAR_SPACING,
884
- }), {
885
- x: bulletX(),
886
- y: y,
887
- w: bulletW,
888
- h,
889
- lineSpacingMultiple: style.lineSpacing,
890
- });
891
- y += h + style.gap;
892
- }
893
- }
894
-
895
- return y;
896
- }
897
-
898
- /**
899
- * Add summary group content as individual shapes.
900
- * Uses narrow width (~4.3" for headers, ~4.1" for bullets).
901
- */
902
- function addSummaryShapes(slide, content, region) {
903
- let y = region.y || 1.04;
904
-
905
- // Group heading
906
- if (content.heading) {
907
- slide.addText(mdRuns(content.heading, {
908
- fontFace: SEC_HEADER_FONT,
909
- fontSize: SEC_HEADER_SIZE,
910
- color: SEC_HEADER_COLOR,
911
- charSpacing: CHAR_SPACING,
912
- }), {
913
- x: region.x || 0.39,
914
- y: y,
915
- w: SUMMARY_HEADER_W,
916
- h: SEC_HEADER_H,
917
- });
918
- y += SEC_HEADER_H + 0.08;
919
- }
920
-
921
- // Items
922
- if (content.items) {
923
- for (const item of content.items) {
924
- if (item.type === "section") {
925
- // Section header
926
- slide.addText(mdRuns(item.heading, {
927
- fontFace: SEC_HEADER_FONT,
928
- fontSize: SEC_HEADER_SIZE,
929
- color: SEC_HEADER_COLOR,
930
- charSpacing: CHAR_SPACING,
931
- }), {
932
- x: region.x || 0.39,
933
- y: y,
934
- w: SUMMARY_HEADER_W,
935
- h: SEC_HEADER_H,
936
- });
937
- y += SEC_HEADER_H + 0.05;
938
-
939
- // Children as bullet items
940
- if (item.children) {
941
- for (const child of item.children) {
942
- slide.addText([
943
- { text: BULLET_PREFIX, options: { fontFace: FONT_BOLD, fontSize: SUMMARY_BULLET_SIZE, color: BULLET_COLOR, charSpacing: CHAR_SPACING } },
944
- ...mdRuns(child.text, { fontFace: FONT_MEDIUM, fontSize: SUMMARY_BULLET_SIZE, color: "000000", charSpacing: CHAR_SPACING }),
945
- ], {
946
- x: 0.59,
947
- y: y,
948
- w: SUMMARY_BULLET_W,
949
- h: SUMMARY_BULLET_H,
950
- lineSpacingMultiple: SUMMARY_BULLET_LINE_SPACING,
951
- });
952
- y += SUMMARY_BULLET_Y_SPACING;
953
- }
954
- }
955
-
956
- } else if (item.type === "bullet") {
957
- slide.addText([
958
- { text: BULLET_PREFIX, options: { fontFace: FONT_BOLD, fontSize: SUMMARY_BULLET_SIZE, color: BULLET_COLOR, charSpacing: CHAR_SPACING } },
959
- ...mdRuns(item.text, { fontFace: FONT_MEDIUM, fontSize: SUMMARY_BULLET_SIZE, color: "000000", charSpacing: CHAR_SPACING }),
960
- ], {
961
- x: 0.59,
962
- y: y,
963
- w: SUMMARY_BULLET_W,
964
- h: SUMMARY_BULLET_H,
965
- lineSpacingMultiple: SUMMARY_BULLET_LINE_SPACING,
966
- });
967
- y += SUMMARY_BULLET_Y_SPACING;
968
-
969
- if (item.children) {
970
- for (const child of item.children) {
971
- slide.addText([
972
- { text: BULLET_PREFIX, options: { fontFace: FONT_BOLD, fontSize: SUMMARY_BULLET_SIZE, color: BULLET_COLOR, charSpacing: CHAR_SPACING } },
973
- ...mdRuns(child.text, { fontFace: FONT_MEDIUM, fontSize: SUMMARY_BULLET_SIZE, color: "000000", charSpacing: CHAR_SPACING }),
974
- ], {
975
- x: 0.59,
976
- y: y,
977
- w: SUMMARY_BULLET_W,
978
- h: SUMMARY_BULLET_H,
979
- lineSpacingMultiple: SUMMARY_BULLET_LINE_SPACING,
980
- });
981
- y += SUMMARY_BULLET_Y_SPACING;
982
- }
983
- }
984
-
985
- } else if (item.type === "numbered") {
986
- slide.addText([
987
- { text: BULLET_PREFIX, options: { fontFace: FONT_BOLD, fontSize: SUMMARY_BULLET_SIZE, color: BULLET_COLOR, charSpacing: CHAR_SPACING } },
988
- ...mdRuns(item.text, { fontFace: FONT_MEDIUM, fontSize: SUMMARY_BULLET_SIZE, color: "000000", charSpacing: CHAR_SPACING }),
989
- ], {
990
- x: 0.59,
991
- y: y,
992
- w: SUMMARY_BULLET_W,
993
- h: SUMMARY_BULLET_H,
994
- lineSpacingMultiple: SUMMARY_BULLET_LINE_SPACING,
995
- });
996
- y += SUMMARY_BULLET_Y_SPACING;
997
- }
998
- }
999
- }
1000
- }
1001
-
1002
- // ── TOC rendering (separate shapes per item) ─────────────────────────────
1003
-
1004
- /**
1005
- * Add TOC items as separate text shapes, matching TEMPLATE-PPTX.pptx exactly.
1006
- * Each item is: "N. text" in the bold face at 18pt, w=7.5, h=0.55, spaced 0.65" apart.
1007
- */
1008
- function addTocShapes(slide, items) {
1009
- let y = TOC_Y_START;
1010
- let num = 1;
1011
-
1012
- for (const item of items) {
1013
- const text = `${num}. ${cleanMd(item.text || item.heading || "")}`;
1014
- slide.addText(text, {
1015
- x: TOC_X,
1016
- y: y,
1017
- w: TOC_W,
1018
- h: TOC_H,
1019
- fontFace: TOC_FONT,
1020
- fontSize: TOC_SIZE,
1021
- color: TOC_COLOR,
1022
- charSpacing: CHAR_SPACING,
1023
- });
1024
- y += TOC_Y_SPACING;
1025
- num++;
1026
- }
1027
- }
1028
-
1029
- /**
1030
- * Check if a slide is a TOC slide by inspecting the title region content.
1031
- */
1032
- function isTocSlide(regions) {
1033
- const title = regions.title;
1034
- if (!title || typeof title.content !== "string") return false;
1035
- return title.content.includes("목차");
1036
- }
1037
-
1038
- function adjustedRegionsForImageColumn(regions) {
1039
- const body = regions.body;
1040
- const image = regions.image;
1041
- if (!body || !image || !body.content || !image.content) return regions;
1042
- if (body.content.type !== "body" || !["image", "image-grid"].includes(image.content.type)) return regions;
1043
-
1044
- const bodyX = body.x || 0;
1045
- const bodyW = body.w || 10.188;
1046
- const imageX = image.x || 0;
1047
- const gap = 0.25;
1048
- if (imageX <= bodyX || imageX >= bodyX + bodyW) return regions;
1049
-
1050
- const denseImageGrid = image.content.type === "image-grid" && Array.isArray(image.content.images) && image.content.images.length >= 6;
1051
- return {
1052
- ...regions,
1053
- body: {
1054
- ...body,
1055
- w: Math.max(0.5, imageX - bodyX - gap),
1056
- },
1057
- image: denseImageGrid ? {
1058
- ...image,
1059
- y: Math.min(image.y || 1.5, 1.08),
1060
- h: Math.max(image.h || 3.0, 5.85),
1061
- } : image,
1062
- figure_caption: denseImageGrid && regions.figure_caption ? {
1063
- ...regions.figure_caption,
1064
- y: Math.max(regions.figure_caption.y || 4.55, 7.02),
1065
- } : regions.figure_caption,
1066
- };
1067
- }
1068
-
1069
- // ── Region rendering ────────────────────────────────────────────────────────
1070
-
1071
- /**
1072
- * Add a region as a positioned element on the slide.
1073
- *
1074
- * Content types:
1075
- * - string: title, main-box, notes
1076
- * - { type: "body" } bullet/section/numbered items → individual shapes
1077
- * - { type: "kpi-table" } table with headers and rows
1078
- * - { type: "image" } image element
1079
- * - { type: "figure-caption" } figure caption (auto-numbered "도 N.")
1080
- * - { type: "table-caption" } table caption (auto-numbered "표 N.")
1081
- * - { type: "summary-group" } heading + items → individual shapes
1082
- */
1083
- function addRegion(slide, name, region, fontRoles, pageH, regionBottom, isToc, sourceDir) {
1084
- if (!region) return;
1085
-
1086
- const content = region.content;
1087
- if (content === undefined || content === null) return;
1088
- if (typeof content === "object" && !content.type) return;
1089
-
1090
- const roleName = region.font_role || region.heading_role || region.sub_item_role;
1091
- const role = fontRoles[roleName] || {};
1092
-
1093
- // ── String content (title, main-box, notes) ────────────────────────
1094
- if (typeof content === "string") {
1095
- const opts = {
1096
- x: region.x || 0,
1097
- y: region.y || 0,
1098
- w: region.w || 4,
1099
- h: region.h || ((regionBottom || (pageH - 0.5)) - (region.y || 0)),
1100
- fontFace: role.font || FONT_BOLD,
1101
- fontSize: role.size || 16,
1102
- color: (role.color || "000000").replace("#", ""),
1103
- align: region.align || role.align || "left",
1104
- valign: region.valign || "top",
1105
- };
1106
-
1107
- if (role.charSpacing != null) opts.charSpacing = role.charSpacing;
1108
- if (role.lineSpacing) opts.lineSpacingMultiple = role.lineSpacing;
1109
-
1110
- // Border (main_box)
1111
- if (region.border) {
1112
- opts.line = {
1113
- color: (region.border.color || "#000000").replace("#", ""),
1114
- width: region.border.width || 1,
1115
- };
1116
- }
1117
-
1118
- // Autofit
1119
- if (region.autofit === "resize") opts.autoFit = true;
1120
- else if (region.autofit === "shrink") opts.shrinkText = true;
1121
-
1122
- slide.addText(mdRuns(content, {
1123
- fontFace: opts.fontFace,
1124
- fontSize: opts.fontSize,
1125
- color: opts.color,
1126
- ...(opts.charSpacing != null ? { charSpacing: opts.charSpacing } : {}),
1127
- }), name === "title" ? { ...opts, objectName: "title@legacy" } : opts);
1128
- return;
1129
- }
1130
-
1131
- // ── Body content → TOC shapes or individual shapes ──────────────────
1132
- if (content.type === "body") {
1133
- if (isToc) {
1134
- addTocShapes(slide, content.items || []);
1135
- } else {
1136
- const startY = region.y || 1.044;
1137
- addBodyShapes(slide, content.items || [], startY, region.w || 10.188, regionBottom || pageH - 0.5, region.originX);
1138
- }
1139
- return;
1140
- }
1141
-
1142
- // ── KPI Table ──────────────────────────────────────────────────────
1143
- if (content.type === "kpi-table" && content.chart) {
1144
- renderChart(slide, content, region, PLAIN_CHART_STYLE, regionBottom);
1145
- return;
1146
- }
1147
- if (content.type === "kpi-table") {
1148
- const numeric = numericColumns(content.headers || [], content.rows || []);
1149
- const metrics = tableMetrics((content.rows || []).length + 1, region.y || 0, regionBottom,
1150
- { rowH: 0.35, maxRowH: 0.55, headerSize: 14, dataSize: 14 });
1151
- const headerRole = fontRoles[region.font_role_header] || fontRoles.table_header;
1152
- const dataRole = fontRoles[region.font_role_data] || fontRoles.table_data;
1153
-
1154
- const tableData = [];
1155
-
1156
- if (content.headers && content.headers.length > 0) {
1157
- tableData.push(
1158
- content.headers.map((h) => ({
1159
- text: cleanMd(h),
1160
- options: {
1161
- bold: false,
1162
- fontSize: headerRole ? headerRole.size : 14,
1163
- fontFace: headerRole ? headerRole.font : FONT_BOLD,
1164
- color: headerRole ? headerRole.color : "000000",
1165
- align: numeric[content.headers.indexOf(h)] ? "right" : (headerRole ? headerRole.align : "left"),
1166
- valign: "middle",
1167
- ...(headerRole && headerRole.charSpacing != null
1168
- ? { charSpacing: headerRole.charSpacing }
1169
- : {}),
1170
- ...(headerRole && headerRole.fill
1171
- ? { fill: { color: headerRole.fill.replace("#", "") } }
1172
- : {}),
1173
- },
1174
- }))
1175
- );
1176
- }
1177
-
1178
- if (content.rows) {
1179
- for (const row of content.rows) {
1180
- tableData.push(
1181
- row.map((cell, ci) => linkedTableCell(cell, {
1182
- fontSize: dataRole ? dataRole.size : 14,
1183
- fontFace: dataRole ? dataRole.font : FONT_MEDIUM,
1184
- color: dataRole ? dataRole.color : "000000",
1185
- align: numeric[ci] ? "right" : (dataRole ? dataRole.align : "left"),
1186
- valign: "middle",
1187
- ...(dataRole && dataRole.charSpacing != null
1188
- ? { charSpacing: dataRole.charSpacing }
1189
- : {}),
1190
- }))
1191
- );
1192
- }
1193
- }
1194
-
1195
- const numCols = (content.headers && content.headers.length) || 1;
1196
- const tblX = region.x || 0;
1197
- const tblY = region.y || 0;
1198
- const tblW = region.w || 4;
1199
- slide.addTable(tableData, {
1200
- x: tblX,
1201
- y: tblY,
1202
- w: tblW,
1203
- border: { pt: 1.5, color: "000000" },
1204
- colW: numCols > 0 && content.headers ? proportionalWidths(content.headers, content.rows || [], tblW) : Array(numCols).fill(tblW / numCols),
1205
- margin: [3.6, 7.2, 3.6, 7.2],
1206
- rowH: metrics.rowH,
1207
- });
1208
- return;
1209
- }
1210
-
1211
- // ── Image ──────────────────────────────────────────────────────────
1212
- if (content.type === "image") {
1213
- const imgPath = resolveImagePath(content.src, sourceDir);
1214
- const fit = containBox(
1215
- region.x || 0,
1216
- region.y || 0,
1217
- region.w || 2,
1218
- region.h || 1,
1219
- readImageSize(imgPath),
1220
- );
1221
- slide.addImage({
1222
- path: imgPath,
1223
- ...fit,
1224
- altText: content.caption || path.basename(content.src || imgPath),
1225
- });
1226
- return;
1227
- }
1228
-
1229
- if (content.type === "image-grid") {
1230
- const images = Array.isArray(content.images) ? content.images : [];
1231
- const count = images.length;
1232
- if (count === 0) return;
1233
- const cols = count <= 2 ? count : 2;
1234
- const rows = Math.ceil(count / cols);
1235
- const gap = 0.06;
1236
- const baseX = region.x || 0;
1237
- const baseY = region.y || 0;
1238
- const baseW = region.w || 4;
1239
- const baseH = region.h || 3;
1240
- const cellW = (baseW - gap * (cols - 1)) / cols;
1241
- const cellH = (baseH - gap * (rows - 1)) / rows;
1242
- images.forEach((image, idx) => {
1243
- const imgPath = resolveImagePath(image.src, sourceDir);
1244
- const col = idx % cols;
1245
- const row = Math.floor(idx / cols);
1246
- const fit = containBox(
1247
- baseX + col * (cellW + gap),
1248
- baseY + row * (cellH + gap),
1249
- cellW,
1250
- cellH,
1251
- readImageSize(imgPath),
1252
- );
1253
- slide.addImage({
1254
- path: imgPath,
1255
- ...fit,
1256
- altText: image.caption || path.basename(image.src || imgPath),
1257
- });
1258
- });
1259
- return;
1260
- }
1261
-
1262
- // ── Figure Caption ────────────────────────────────────────────────
1263
- if (content.type === "figure-caption") {
1264
- const num = content.number || 1;
1265
- const prefix = content.prefix || "도";
1266
- const captionText = content.caption ? `${prefix} ${num}. ${cleanMd(content.caption)}` : `${prefix} ${num}.`;
1267
- const captionRole = fontRoles.figure_caption || {};
1268
- const captionW = region.w || 4;
1269
- const captionSize = captionRole.size || 16;
1270
- const captionSpacing = captionRole.lineSpacing || 1.3;
1271
- slide.addText(captionText, {
1272
- x: region.x || 0,
1273
- y: region.y || 0,
1274
- w: captionW,
1275
- // A caption that wraps needs a box tall enough to hold every line, or it
1276
- // overflows its frame. The declared region height is the floor, not the cap.
1277
- h: Math.max(
1278
- region.h || 0.456,
1279
- estimateTextHeight(captionText, captionW, captionSize, captionSpacing)
1280
- ),
1281
- fontFace: captionRole.font || FONT_MEDIUM,
1282
- fontSize: captionSize,
1283
- color: (captionRole.color || "000000").replace("#", ""),
1284
- align: region.align || captionRole.align || "center",
1285
- charSpacing: captionRole.charSpacing != null ? captionRole.charSpacing : CHAR_SPACING,
1286
- lineSpacingMultiple: captionRole.lineSpacing || 1.3,
1287
- });
1288
- return;
1289
- }
1290
-
1291
- // ── Table Caption ─────────────────────────────────────────────────
1292
- if (content.type === "table-caption") {
1293
- const num = content.number || 1;
1294
- const prefix = content.prefix || "표";
1295
- const captionText = content.caption ? `${prefix} ${num}. ${cleanMd(content.caption)}` : `${prefix} ${num}.`;
1296
- const captionRole = fontRoles.table_caption || {};
1297
- const captionW = region.w || 4;
1298
- const captionSize = captionRole.size || 16;
1299
- const captionSpacing = captionRole.lineSpacing || 1.3;
1300
- slide.addText(captionText, {
1301
- x: region.x || 0,
1302
- y: region.y || 0,
1303
- w: captionW,
1304
- // Same rule as the figure caption: the declared region height is the
1305
- // floor, not the cap, or a wrapping caption overflows its frame.
1306
- h: Math.max(
1307
- region.h || 0.456,
1308
- estimateTextHeight(captionText, captionW, captionSize, captionSpacing)
1309
- ),
1310
- fontFace: captionRole.font || FONT_MEDIUM,
1311
- fontSize: captionSize,
1312
- color: (captionRole.color || "000000").replace("#", ""),
1313
- align: region.align || captionRole.align || "center",
1314
- charSpacing: captionRole.charSpacing != null ? captionRole.charSpacing : CHAR_SPACING,
1315
- lineSpacingMultiple: captionRole.lineSpacing || 1.3,
1316
- });
1317
- return;
1318
- }
1319
-
1320
- // ── Summary Group → individual shapes ──────────────────────────────
1321
- if (content.type === "summary-group") {
1322
- addSummaryShapes(slide, content, region);
1323
- return;
1324
- }
1325
- }
1326
-
1327
- // ── Rich card, KPI and table rendering (templates with the rich-blocks capability) ──
1328
-
1329
- /** Split a title string into runs, emphasizing **word** in the primary color. */
1330
- function azureTitleRuns(text, P) {
1331
- return text.split(/(\*\*[^*]+\*\*)/g).filter(Boolean).map((p) =>
1332
- p.startsWith("**") && p.endsWith("**")
1333
- ? { text: p.slice(2, -2), options: { color: hex(P.primary) } }
1334
- : { text: p, options: {} }
1335
- );
1336
- }
1337
-
1338
- /** Strip leftover markdown markers (### heading, list dashes, **bold**, `code`)
1339
- * from inline text, returning a clean plain string. */
1340
- function cleanMd(s) {
1341
- return String(s || "")
1342
- .replace(/^#{1,6}\s+/, "")
1343
- .replace(/^\s*[*-]\s+/, "")
1344
- .replace(/\*\*(.+?)\*\*/g, "$1")
1345
- .replace(/(?<![\w*])\*([^*\s](?:[^*]*[^*\s])?)\*(?![\w*])/gu, "$1")
1346
- .replace(/`/g, "")
1347
- .trim();
1348
- }
1349
-
1350
- /** Convert inline markdown in `text` to pptxgenjs styled runs: **x** → a bold
1351
- * run, plain segments → normal runs. Leading heading/list markers and backticks
1352
- * are stripped. `runOpts` styles every run; bold runs additionally set bold.
1353
- * Guarantees no raw "**", "###", or backtick reaches the rendered <a:t>. */
1354
- function mdRuns(text, runOpts = {}) {
1355
- const clean = String(text || "")
1356
- .replace(/^#{1,6}\s+/, "")
1357
- .replace(/^\s*[*-]\s+/, "")
1358
- .replace(/`/g, "");
1359
- // **x** is bold; *x* (a journal or book name) is italic.
1360
- const parts = clean.split(/(\*\*[^*]+\*\*|(?<![\w*])\*[^*\s](?:[^*]*[^*\s])?\*(?![\w*]))/gu).filter((p) => p !== "");
1361
- if (parts.length === 0) return [{ text: "", options: { ...runOpts } }];
1362
- return parts.map((p) =>
1363
- p.startsWith("**") && p.endsWith("**")
1364
- ? { text: p.slice(2, -2), options: { ...runOpts, bold: true } }
1365
- : p.length > 2 && p.startsWith("*") && p.endsWith("*")
1366
- ? { text: p.slice(1, -1), options: { ...runOpts, italic: true } }
1367
- : { text: p, options: { ...runOpts } }
1368
- );
1369
- }
1370
-
1371
- /** Convert body items into up to 4 cards: {heading, lines[]}.
1372
- * Handles both authoring styles:
1373
- * - `### Title` (parsed as `text`) followed by `- **point**` (a `section`) → one card
1374
- * titled by the heading, the section folded into the body.
1375
- * - bare `- **Title**` sections → one card each (heading = bold title). */
1376
- function bodyToCards(items) {
1377
- const cards = [];
1378
- let cur = null;
1379
- for (const item of items || []) {
1380
- if (item.type === "text" && item.text) {
1381
- cur = { heading: cleanMd(item.text), lines: [] };
1382
- cards.push(cur);
1383
- } else if (item.type === "section" || item.type === "bullet") {
1384
- const head = cleanMd(item.heading || item.text || "");
1385
- const kids = (item.children || []).map((c) => cleanMd(c.text)).filter(Boolean);
1386
- if (cur && cur.lines.length === 0 && cur.heading) {
1387
- // fold this section under the preceding heading card
1388
- if (head) cur.lines.push(head);
1389
- kids.forEach((k) => cur.lines.push(" " + k));
1390
- } else {
1391
- cur = { heading: head, lines: kids };
1392
- cards.push(cur);
1393
- }
1394
- } else if (item.type === "numbered" && item.text) {
1395
- if (cur) cur.lines.push(cleanMd(item.text));
1396
- else { cur = { heading: "", lines: [cleanMd(item.text)] }; cards.push(cur); }
1397
- }
1398
- }
1399
- return cards.slice(0, 4);
1400
- }
1401
-
1402
- // Card geometry shared by drawing and sizing, so a card is exactly as tall as its text
1403
- // (template tokens card.*; reassigned in render()).
1404
- let CARD_PAD = LEGACY_TOKENS.card.pad;
1405
- let CARD_CHIP = LEGACY_TOKENS.card.chip;
1406
- let CARD_MIN_H = LEGACY_TOKENS.card.minH;
1407
- let CARD_GAP = LEGACY_TOKENS.card.gap;
1408
- let CARD_RADIUS = LEGACY_TOKENS.card.radius;
1409
-
1410
- // Primary reading text stays at or above the 12 pt floor of the design laws.
1411
- function cardBodySize(card) {
1412
- return card.lines && card.lines.length > 4 ? 12 : 13;
1413
- }
1414
-
1415
- // Card text height: the conservative wrap count, but line boxes at their real
1416
- // leading (estimateTextHeight pads every paragraph, which left short cards hollow).
1417
- function cardTextHeight(text, innerW, fontSize, lineSpacing) {
1418
- return (estimateWrappedLines(text, innerW, fontSize) * fontSize * lineSpacing * 1.2) / 72;
1419
- }
1420
-
1421
- function cardHeadingHeight(card, innerW) {
1422
- return card.heading ? cardTextHeight(card.heading, innerW, 15, 1.05) + 0.06 : 0;
1423
- }
1424
-
1425
- function cardBodyHeight(card, innerW) {
1426
- if (card.bodyRuns && card.bodyRuns.length) return card.bodyHeight || 0;
1427
- const fs = cardBodySize(card);
1428
- return (card.lines || []).reduce((sum, line) => sum + cardTextHeight(line, innerW, fs, 1.3), 0.1);
1429
- }
1430
-
1431
- /** Height a card needs for its chip, heading and body at the width it is drawn. */
1432
- function azureCardHeight(card, w) {
1433
- const innerW = w - 2 * CARD_PAD;
1434
- const head = card.heading ? 0.18 + Math.max(0.4, cardHeadingHeight(card, innerW)) + 0.04 : 0.18;
1435
- return CARD_PAD + CARD_CHIP + head + cardBodyHeight(card, innerW) + CARD_PAD;
1436
- }
1437
-
1438
- /**
1439
- * The height a row of cards is drawn at: the tallest card's content, never taller
1440
- * than the region the template reserves and never shorter than CARD_MIN_H. A fixed
1441
- * region height left short cards mostly empty; the space below a short row is free
1442
- * for the takeaway, and the craft gate reports a slide that stays thin.
1443
- */
1444
- function fittedCardHeight(cards, w, regionH) {
1445
- const need = Math.max(...cards.map((c) => azureCardHeight(c, w)));
1446
- return Math.min(regionH, Math.max(CARD_MIN_H, need));
1447
- }
1448
-
1449
- /** Draw one rounded card with a numbered chip, heading, and body lines. */
1450
- function drawAzureCard(slide, x, y, w, h, card, idx, P, emphasized) {
1451
- const bg = emphasized ? hex(P.primary_deep) : hex(P.tint);
1452
- const headColor = emphasized ? "FFFFFF" : hex(P.ink);
1453
- const bodyColor = emphasized ? hex(P.emphasisTextColor) : hex(P.ink_muted);
1454
- slide.addShape("roundRect", { x, y, w, h, rectRadius: CARD_RADIUS, fill: { color: bg }, line: { type: "none" } });
1455
- const pad = CARD_PAD;
1456
- const innerW = w - 2 * pad;
1457
- // numbered chip
1458
- const chip = CARD_CHIP;
1459
- slide.addShape("roundRect", {
1460
- x: x + pad, y: y + pad, w: chip, h: chip, rectRadius: 0.12,
1461
- fill: { color: emphasized ? "FFFFFF" : hex(P.primary) }, line: { type: "none" },
1462
- });
1463
- // Number sits in a text box whose rect is identical to the chip rect, with
1464
- // margin:0 and tight line spacing so the numeral reads dead-centre.
1465
- slide.addText(String(idx + 1).padStart(2, "0"), {
1466
- x: x + pad, y: y + pad, w: chip, h: chip, align: "center", valign: "middle",
1467
- fontFace: P.titleFont, fontSize: 15, bold: true,
1468
- color: emphasized ? hex(P.primary_deep) : "FFFFFF",
1469
- margin: 0, lineSpacingMultiple: 1,
1470
- });
1471
- const headH = cardHeadingHeight(card, innerW);
1472
- if (card.heading) {
1473
- slide.addText(card.heading, {
1474
- x: x + pad, y: y + pad + chip + 0.18, w: innerW, h: Math.max(0.4, headH),
1475
- fontFace: P.titleFont, fontSize: 15, bold: true, color: headColor, align: "left", valign: "top",
1476
- charSpacing: -0.3,
1477
- });
1478
- }
1479
- const bodyY = y + pad + chip + 0.18 + (card.heading ? Math.max(0.4, headH) + 0.04 : 0);
1480
- const bodyH = Math.max(0.3, h - (bodyY - y) - 0.18);
1481
- if (card.bodyRuns && card.bodyRuns.length) {
1482
- slide.addText(card.bodyRuns, {
1483
- x: x + pad, y: bodyY, w: innerW, h: bodyH,
1484
- color: bodyColor, align: "left", valign: "top", lineSpacingMultiple: card.lineSpacing || 1.28, charSpacing: -0.2,
1485
- });
1486
- } else if (card.lines && card.lines.length) {
1487
- // Shrink body font when there are many lines so it never exceeds the frame.
1488
- const fs = cardBodySize(card);
1489
- slide.addText(card.lines.join("\n"), {
1490
- x: x + pad, y: bodyY, w: innerW, h: bodyH,
1491
- fontFace: P.bodyFont, fontSize: fs, color: bodyColor, align: "left", valign: "top",
1492
- lineSpacingMultiple: 1.3, charSpacing: -0.2,
1493
- });
1494
- }
1495
- }
1496
-
1497
- /** Render content/main body as a row of cards, as tall as the longest card needs. */
1498
- function renderAzureCards(slide, items, region, P) {
1499
- const cards = bodyToCards(items);
1500
- if (!cards.length) return;
1501
- const n = cards.length;
1502
- const x0 = region.x || 0.6, y0 = region.y || 1.6, w = region.w || 12.1;
1503
- const gap = CARD_GAP;
1504
- const cardW = (w - (n - 1) * gap) / n;
1505
- const h = fittedCardHeight(cards, cardW, region.h || 3.0);
1506
- cards.forEach((c, i) => {
1507
- drawAzureCard(slide, x0 + i * (cardW + gap), y0, cardW, h, c, i, P, n >= 3 && i === n - 1);
1508
- });
1509
- return y0 + h;
1510
- }
1511
-
1512
- /** Flatten body/summary items (sections + children + bullets) into styled runs.
1513
- * `scale` (≤1) shrinks fonts to fit a fixed card height. */
1514
- function itemsToRuns(items, P, scale = 1) {
1515
- const s = (v) => Math.max(8, Math.round(v * scale * 10) / 10);
1516
- const runs = [];
1517
- for (const it of items || []) {
1518
- if (it.type === "section") {
1519
- runs.push({ text: cleanMd(it.heading || ""), options: { bold: true, fontFace: P.titleFont, fontSize: s(14), color: hex(P.ink), breakLine: true } });
1520
- for (const c of it.children || []) {
1521
- runs.push({ text: " " + cleanMd(c.text || ""), options: { fontFace: P.bodyFont, fontSize: s(12.5), color: hex(P.ink_muted), breakLine: true } });
1522
- }
1523
- } else if (it.text) {
1524
- runs.push({ text: (it.type === "numbered" ? " " : "• ") + cleanMd(it.text), options: { fontFace: P.bodyFont, fontSize: s(13), color: hex(P.ink_muted), breakLine: true } });
1525
- }
1526
- }
1527
- return runs;
1528
- }
1529
-
1530
- /** Estimate the rendered height of a group's items at a given font scale,
1531
- * using the same conservative metric inventory respects (estimateTextHeight). */
1532
- function estimateGroupHeight(items, innerW, scale, lineSpacing) {
1533
- let hsum = 0;
1534
- for (const it of items || []) {
1535
- if (it.type === "section") {
1536
- hsum += estimateTextHeight(it.heading || "", innerW, 14 * scale, lineSpacing);
1537
- for (const c of it.children || []) hsum += estimateTextHeight(" " + (c.text || ""), innerW - 0.1, 12.5 * scale, lineSpacing);
1538
- } else if (it.text) {
1539
- hsum += estimateTextHeight(it.text, innerW, 13 * scale, lineSpacing);
1540
- }
1541
- }
1542
- return hsum;
1543
- }
1544
-
1545
- /** The height a group's runs take at their real leading, for sizing (not fitting) the card. */
1546
- function groupTextHeight(items, innerW, scale, lineSpacing) {
1547
- let hsum = 0.1;
1548
- for (const it of items || []) {
1549
- if (it.type === "section") {
1550
- hsum += cardTextHeight(it.heading || "", innerW, 14 * scale, lineSpacing);
1551
- for (const c of it.children || []) hsum += cardTextHeight(" " + (c.text || ""), innerW - 0.1, 12.5 * scale, lineSpacing);
1552
- } else if (it.text) {
1553
- hsum += cardTextHeight("• " + it.text, innerW, 13 * scale, lineSpacing);
1554
- }
1555
- }
1556
- return hsum;
1557
- }
1558
-
1559
- /** A summary group as a card: the largest font scale (1 down to 0.55) whose text fits
1560
- * `maxH`, and the height that text needs at that scale. */
1561
- function groupCard(content, w, maxH, P) {
1562
- const innerW = w - 2 * CARD_PAD;
1563
- const heading = cleanMd(content.heading || "");
1564
- const headH = heading ? 0.18 + Math.max(0.4, cardHeadingHeight({ heading }, innerW)) + 0.04 : 0.18;
1565
- const fixed = CARD_PAD + CARD_CHIP + headH + 0.18;
1566
- let scale = 0.55, ls = 1.12;
1567
- for (const s of [1, 0.92, 0.85, 0.78, 0.72, 0.66, 0.6, 0.55]) {
1568
- if (estimateGroupHeight(content.items, innerW, s, s < 1 ? 1.12 : 1.28) <= maxH - fixed) { scale = s; ls = s < 1 ? 1.12 : 1.28; break; }
1569
- }
1570
- const bodyHeight = groupTextHeight(content.items, innerW, scale, ls);
1571
- return {
1572
- card: { heading, bodyRuns: itemsToRuns(content.items, P, scale), lineSpacing: ls, bodyHeight },
1573
- need: Math.min(maxH, fixed + bodyHeight + CARD_PAD - 0.18),
1574
- };
1575
- }
1576
-
1577
- /** Render a single summary-group as one card, at `opts.height` (shared by the
1578
- * groups of one slide) or at the height its own text needs. */
1579
- function renderAzureGroupCard(slide, content, region, P, idx, height) {
1580
- const w = region.w || 5.6, maxH = region.h || 2.4;
1581
- const { card, need } = groupCard(content, w, maxH, P);
1582
- const h = Math.min(maxH, Math.max(CARD_MIN_H, height || need));
1583
- drawAzureCard(slide, region.x || 0.6, region.y || 1.6, w, h, card, idx, P, false);
1584
- }
1585
-
1586
- /** Render a general data table (palette-styled): primary header, zebra tint rows. */
1587
- // ── Tables and charts that fill their region ────────────────────────────────
1588
-
1589
- // A cell reads as a number when, after units and signs, only digits remain.
1590
- const NUMERIC_CELL = /^(?:[▲▼△▽]\s*)?[+\-−±]?\s*[\d.,]+\s*(?:%p?|배|x|pt|bp|[가-힣]{1,3}|[A-Za-z]{1,3})?$/u;
1591
- const isNumericCell = (text) => NUMERIC_CELL.test(cleanMd(String(text)).trim());
1592
-
1593
- /** Columns whose data cells are all numbers are right-aligned; a dash for a missing value is blank. */
1594
- function numericColumns(headers, rows) {
1595
- return headers.map((_, ci) => {
1596
- const cells = rows.map((r) => r[ci]).filter((c) => c != null && !/^[\s—–\-]*$/u.test(cleanMd(String(c))));
1597
- return cells.length > 0 && cells.every(isNumericCell);
1598
- });
1599
- }
1600
-
1601
- /** Column widths proportional to the longest cell, Hangul counted wider, with a floor. */
1602
- function proportionalWidths(headers, rows, totalW) {
1603
- const len = (t) => [...cleanMd(String(t || ""))].reduce((n, ch) => n + (/[\u3131-\uD7A3]/u.test(ch) ? 1.7 : 1), 0);
1604
- const want = headers.map((h, ci) => Math.max(len(h), ...rows.map((r) => len(r[ci])), 4));
1605
- const floor = Math.min(0.9, totalW / headers.length);
1606
- const sum = want.reduce((a, b) => a + b, 0);
1607
- let widths = want.map((w) => Math.max(floor, (w / sum) * totalW));
1608
- const scale = totalW / widths.reduce((a, b) => a + b, 0);
1609
- widths = widths.map((w) => w * scale);
1610
- return widths;
1611
- }
1612
-
1613
- /**
1614
- * Row height and font size for a table that should use the room it has: rows
1615
- * grow toward `bottom` (up to a comfortable maximum) instead of leaving the lower
1616
- * half of the slide empty, and a roomy table gets a larger font.
1617
- */
1618
- function tableMetrics(rowCount, y, bottom, base) {
1619
- const room = Math.max(0, (bottom || y + rowCount * base.rowH) - y);
1620
- const rowH = Math.min(base.maxRowH, Math.max(base.rowH, (room * 0.92) / rowCount));
1621
- const scale = rowH >= 0.55 ? 1.2 : rowH >= 0.47 ? 1.1 : 1;
1622
- return { rowH, headerSize: +(base.headerSize * scale).toFixed(1), dataSize: +(base.dataSize * scale).toFixed(1) };
1623
- }
1624
-
1625
- function renderAzureTable(slide, content, region, P, bottom) {
1626
- const headers = content.headers || [];
1627
- const rows = content.rows || [];
1628
- if (!headers.length) return;
1629
- const x = region.x || 0.6, y = region.y || 1.6, w = region.w || 6.0;
1630
- const numeric = numericColumns(headers, rows);
1631
- const m = tableMetrics(rows.length + 1, y, bottom, { rowH: 0.4, maxRowH: 0.72, headerSize: 12, dataSize: 11.5 });
1632
- const tableRows = [];
1633
- tableRows.push(headers.map((h, ci) => ({
1634
- text: cleanMd(h),
1635
- options: { bold: true, color: "FFFFFF", fill: { color: hex(P.primary) }, fontFace: P.titleFont, fontSize: m.headerSize, align: numeric[ci] ? "right" : "left", valign: "middle" },
1636
- })));
1637
- rows.forEach((r, ri) => {
1638
- tableRows.push(r.map((c, ci) => linkedTableCell(c, {
1639
- color: hex(P.ink), fill: { color: ri % 2 ? "FFFFFF" : hex(P.tint) }, fontFace: P.bodyFont, fontSize: m.dataSize,
1640
- align: numeric[ci] ? "right" : "left", valign: "middle", bold: ci === 0 && !numeric[0],
1641
- })));
1642
- });
1643
- slide.addTable(tableRows, {
1644
- x, y, w, colW: proportionalWidths(headers, rows, w),
1645
- border: { type: "solid", color: hex(P.line), pt: 0.5 }, rowH: m.rowH, margin: [0.04, 0.12, 0.04, 0.12], autoPage: false,
1646
- });
1647
- }
1648
-
1649
- /** Parse "1,234", "▲12.5%", "−3" into a number; anything else is null. */
1650
- function chartNumber(text) {
1651
- const t = cleanMd(String(text || "")).trim().replace(/[,\s]/g, "").replace(/^[▲△+]/u, "").replace(/^[▼▽−]/u, "-");
1652
- const m = t.match(/^-?\d+(?:\.\d+)?/);
1653
- return m ? parseFloat(m[0]) : null;
1654
- }
1655
-
1656
- const CHART_TYPE = { bar: "bar", column: "bar", stacked: "bar", line: "line", area: "area", pie: "pie", doughnut: "doughnut" };
1657
-
1658
- /**
1659
- * A native PowerPoint chart (editable in PowerPoint: right-click > Edit Data)
1660
- * from a `::: chart` block. It takes the whole region down to `bottom`.
1661
- */
1662
- function renderChart(slide, content, region, style, bottom) {
1663
- const headers = content.headers || [];
1664
- const rows = content.rows || [];
1665
- const spec = content.chart || {};
1666
- const kind = CHART_TYPE[spec.type] || "bar";
1667
- const labels = rows.map((r) => cleanMd(String(r[0] || "")));
1668
- const series = headers.slice(1).map((name, si) => ({
1669
- name: cleanMd(String(name)),
1670
- labels,
1671
- // A missing cell stays null: pptxgenjs writes it as a blank point, and the line breaks there instead of dropping to zero.
1672
- values: rows.map((r) => chartNumber(r[si + 1])),
1673
- }));
1674
- // Data labels keep the decimals the table writes: "18.0" stays 18.0 beside a table that says 18.0.
1675
- const decimals = Math.min(3, Math.max(0, ...rows.flatMap((r) => r.slice(1).map((v) => ((/\.(\d+)/u.exec(cleanMd(String(v == null ? "" : v)).replace(/,/gu, "")) || [, ""])[1]).length))));
1676
- const x = region.x || 0.6, y = region.y || 1.6, w = region.w || 8;
1677
- const h = Math.max(1.6, ((bottom || y + (region.h || 3.2)) - y));
1678
- const colors = style.series.map((c) => hex(c));
1679
- const round = kind === "pie" || kind === "doughnut";
1680
- const data = round ? series.slice(0, 1) : series;
1681
- // Crowding, estimated in points: a category label wider than its slot is slanted; side-by-side
1682
- // value labels wider than their bars collide, so the values are read off a shown axis instead.
1683
- const ems = (t) => [...String(t)].reduce((a, ch) => a + (/[\u3131-\uD7A3]/u.test(ch) ? 0.94 : /\s/u.test(ch) ? 0.28 : 0.56), 0);
1684
- const labelPt = style.labelSize || 11;
1685
- const slot = (w * 72 * 0.85) / Math.max(1, labels.length);
1686
- // A renderer adds space between Hangul and digits ("25 년 2Q"), so a label needs a quarter of its slot spare.
1687
- // A horizontal bar chart lists its categories down the left side; slanted there, LibreOffice skips some of them.
1688
- const slanted = !round && kind !== "line" && spec.type !== "bar" && Math.max(0, ...labels.map(ems)) * labelPt > slot * 0.75;
1689
- const clustered = kind === "bar" && spec.type !== "stacked" && data.length > 1;
1690
- const valueW = Math.max(0, ...data.flatMap((d) => d.values.map((v) => ems(Number(v).toLocaleString("en-US"))))) * labelPt;
1691
- // Several lines share one band of the plot, so a value printed over each point lands on its neighbours'.
1692
- const crowded = !round && ((clustered && valueW > (slot / 1.6 / data.length) * 1.1) || (kind === "line" && data.length > 1));
1693
- const values = data.flatMap((d) => d.values).filter((v) => v !== null);
1694
- // Horizontal bars of several series stack thin bars down each row; once a bar is thinner than its value label, the labels touch.
1695
- const horizontal = !round && spec.type === "bar";
1696
- const dataPt = style.labelSize || (round ? 12 : 10);
1697
- const barPt = (h * 72 - 54) / Math.max(1, labels.length) / (data.length + 0.6);
1698
- const thin = horizontal && data.length > 1 && spec.labels !== false && barPt < dataPt * 1.2;
1699
- // A narrow horizontal bar chart gets few axis numbers, each with room to stand level; left to itself, LibreOffice slants a crowded value axis.
1700
- const top = Math.max(0, ...values), low = Math.min(0, ...values);
1701
- const tickW = ems(Math.round(Math.max(top, -low)).toLocaleString("en-US")) * dataPt;
1702
- const catW = Math.min(w * 72 * 0.4, Math.max(0, ...labels.map(ems)) * labelPt + 8);
1703
- const ticks = Math.floor((w * 72 - catW - 16) / (tickW * 2));
1704
- const nice = (step) => { const p = 10 ** Math.floor(Math.log10(step)); return [1, 2, 2.5, 5, 10].find((m) => m * p >= step) * p; };
1705
- const majorUnit = horizontal && top > low && ticks < 6 ? nice((top - low) / Math.max(1, ticks - 1)) : null;
1706
- const zeroBased = !round && values.length > 0 && values.every((v) => v >= 0);
1707
- // The unit stands once: a legend whose series names carry it already says it, so the axis title goes;
1708
- // otherwise it is set level (a rotated title stacks Hangul a glyph a line and reads tiny; 360 degrees, since
1709
- // pptxgenjs writes no angle for 0 and the axis default is vertical). Amendments 8.
1710
- const unitShown = spec.unit && data.length > 1 && data.every((d) => String(d.name || "").includes(spec.unit));
1711
- const axisTitle = spec.unit && !unitShown && !(Boolean(style.valAxisHidden) && !crowded && !thin);
1712
- slide.addChart(kind, data, {
1713
- x, y, w, h,
1714
- barDir: spec.type === "bar" ? "bar" : "col",
1715
- barGrouping: spec.type === "stacked" ? "stacked" : "clustered",
1716
- barGapWidthPct: 60,
1717
- chartColors: round ? labels.map((_, i) => colors[i % colors.length]) : colors,
1718
- showLegend: round || data.length > 1,
1719
- legendPos: round ? "r" : "t",
1720
- legendFontFace: style.bodyFont, legendFontSize: 11, legendColor: hex(style.ink),
1721
- showValue: !round && spec.labels !== false && !crowded && !thin,
1722
- showPercent: round && spec.labels !== false, showLabel: false,
1723
- dataLabelFontFace: style.bodyFont, dataLabelFontSize: style.labelSize || (round ? 12 : 10),
1724
- dataLabelColor: round ? "FFFFFF" : hex(style.ink),
1725
- dataLabelPosition: round ? "ctr" : kind === "line" ? "t" : "outEnd",
1726
- dataLabelFormatCode: round ? "0%" : decimals ? `#,##0.${"0".repeat(decimals)}` : "#,##0",
1727
- catAxisLabelFontFace: style.bodyFont, catAxisLabelFontSize: style.labelSize || 11, catAxisLabelColor: hex(style.ink),
1728
- valAxisLabelFontFace: style.bodyFont, valAxisLabelFontSize: style.labelSize || 10, valAxisLabelColor: hex(style.ink_muted),
1729
- valAxisLabelFormatCode: "#,##0",
1730
- // A pack with direct labels and no gridlines drops the value axis: the labels carry the values.
1731
- valAxisHidden: Boolean(style.valAxisHidden) && !crowded && !thin,
1732
- ...(majorUnit ? { valAxisMajorUnit: majorUnit } : {}),
1733
- // With negative values the zero line runs through the plot, so the category labels move to the axis minimum, off the bars.
1734
- ...(horizontal && low < 0 ? { catAxisLabelPos: "low" } : {}),
1735
- // Blank points leave a gap, never a joined or zero point.
1736
- displayBlanksAs: "gap",
1737
- ...(style.valMax ? { valAxisMaxVal: style.valMax } : {}),
1738
- ...(zeroBased ? { valAxisMinVal: 0 } : {}),
1739
- ...(slanted ? { catAxisLabelRotate: -45 } : {}),
1740
- catAxisLineShow: true, catAxisLineColor: hex(style.line),
1741
- valGridLine: style.grid === false && !crowded && !thin ? { style: "none" } : { color: hex(style.line), size: 0.5 },
1742
- valAxisLineShow: false,
1743
- lineSize: 2.5, lineDataSymbol: "circle", lineDataSymbolSize: 7,
1744
- holeSize: 58,
1745
- ...(axisTitle ? { showValAxisTitle: true, valAxisTitle: spec.unit, valAxisTitleRotate: 360, valAxisTitleFontSize: style.labelSize || 10, valAxisTitleColor: hex(style.ink_muted), valAxisTitleFontFace: style.bodyFont } : {}),
1746
- ...(spec.title ? { showTitle: true, title: spec.title, titleFontFace: style.titleFont, titleFontSize: 13, titleColor: hex(style.ink) } : {}),
1747
- });
1748
- }
1749
-
1750
- /** A main-box as a tinted callout sized to its text, not an outlined frame. */
1751
- function renderAzureCallout(slide, text, region, P) {
1752
- const x = region.x || 0.84, y = region.y || 5.8, w = region.w || 11.6;
1753
- const lines = Math.max(1, Math.ceil(cleanMd(text).length / Math.max(20, w * 9)));
1754
- const h = Math.min(region.h || 1.0, 0.28 + lines * 0.3);
1755
- slide.addShape("roundRect", { x, y, w, h, rectRadius: 0.1, fill: { color: hex(P.tint) }, line: { type: "none" } });
1756
- slide.addText(cleanMd(text), {
1757
- x: x + 0.24, y, w: w - 0.48, h, fontFace: P.bodyFont, fontSize: 13, bold: true,
1758
- color: hex(P.primary_deep), align: "left", valign: "middle", margin: 0,
1759
- });
1760
- }
1761
-
1762
- /** Render a kpi-table as a row of KPI cards (value + label); first card filled. */
1763
- function renderAzureKpi(slide, content, region, P) {
1764
- const cards = kpiCards(content);
1765
- const values = cards.map((c) => c.value);
1766
- const labels = cards.map((c) => c.label);
1767
- const n = Math.min(values.length, 4);
1768
- if (!n) return;
1769
- const x0 = region.x || 0.6, y0 = region.y || 1.6, w = region.w || 12.1, h = region.h || 1.7;
1770
- const gap = KPI_GAP;
1771
- const cardW = (w - (n - 1) * gap) / n;
1772
- for (let i = 0; i < n; i++) {
1773
- const fill = i === 0;
1774
- const x = x0 + i * (cardW + gap);
1775
- slide.addShape("roundRect", {
1776
- x, y: y0, w: cardW, h, rectRadius: 0.16,
1777
- fill: { color: fill ? hex(P.primary) : "FFFFFF" },
1778
- line: fill ? { type: "none" } : { color: hex(P.line), width: 1 },
1779
- });
1780
- slide.addText(cleanMd(values[i]), {
1781
- x: x + 0.28, y: y0 + 0.20, w: cardW - 0.56, h: 0.8,
1782
- fontFace: P.titleFont, fontSize: 30, bold: true,
1783
- color: fill ? "FFFFFF" : hex(P.primary), align: "left", valign: "middle", charSpacing: -1, margin: 0,
1784
- });
1785
- slide.addText(cleanMd(labels[i]).toUpperCase(), {
1786
- x: x + 0.30, y: y0 + h - 0.5, w: cardW - 0.56, h: 0.32,
1787
- fontFace: P.bodyFont, fontSize: 9.5, bold: false,
1788
- color: fill ? hex(P.emphasisTextColor) : hex(P.ink_muted), align: "left", valign: "middle", charSpacing: 0.4, margin: 0,
1789
- });
1790
- }
1791
- }
1792
-
1793
- /** A pipe table reads as KPI in two shapes:
1794
- * - TALL: 2 cols of value|label pairs, ≤4 pairs, value cell short/metric-like.
1795
- * - WIDE: 3–4 cols, a single data row of short metric values (labels = header).
1796
- * Anything else (multi-row, long cells) is a real data table. */
1797
-
1798
-
1799
- /** Normalize a kpi-table into [{value,label}] cards for both KPI shapes. */
1800
- /**
1801
- * Is there room to draw this as KPI badges?
1802
- *
1803
- * A badge stacks a value over a label and reads as one glance, which stops
1804
- * working the moment the card is narrower than its own words: in a column half
1805
- * the slide wide, four badges leave 1.4in each and a label like "영업이익" wraps
1806
- * to one character per line. Below the floor the same data is drawn as a table,
1807
- * which narrows gracefully.
1808
- */
1809
- function kpiFits(content, widthIn) {
1810
- const cards = kpiCards(content).length;
1811
- return cards > 0 && (widthIn || 0) / cards >= KPI_MIN_CARD_WIDTH_IN;
1812
- }
1813
-
1814
- function kpiCards(content) {
1815
- const headers = content.headers || [];
1816
- const rows = content.rows || [];
1817
- if (headers.length === 2) {
1818
- return [headers, ...rows].slice(0, 4).map((p) => ({ value: p[0], label: p[1] }));
1819
- }
1820
- const row = rows[0] || [];
1821
- // A second body row is each figure's basis or comparison ("전년 대비 +12%", "목표 50%").
1822
- const basis = rows[1] || [];
1823
- return headers.slice(0, 6).map((lab, i) => ({ value: row[i] != null ? row[i] : "", label: lab, ...(basis[i] ? { note: basis[i] } : {}) }));
1824
- }
1825
-
1826
- /** Azure region dispatch. Returns true if it fully handled the region.
1827
- * opts.hasImage = slide also has a populated image region (→ never card the body). */
1828
- function renderAzureRegion(slide, layout, name, region, fontRoles, P, opts = {}) {
1829
- const content = region.content;
1830
- if (content == null) return false;
1831
- if (name === "main_box" && typeof content === "string" && content.trim()) {
1832
- // Below a card row that came out shorter than its region, the takeaway follows
1833
- // the cards instead of leaving a band of empty slide between them.
1834
- const follow = opts.flow && opts.flow.cardsBottom != null ? opts.flow.cardsBottom + 0.32 : null;
1835
- renderAzureCallout(slide, content, follow != null && follow < (region.y || 5.8) ? { ...region, y: follow } : region, P);
1836
- return true;
1837
- }
1838
- if (layout === "cover" && name === "title" && typeof content === "string" && content.includes("**")) {
1839
- const role = fontRoles.cover_title || {};
1840
- slide.addText(azureTitleRuns(content, P), {
1841
- objectName: "title@legacy",
1842
- x: region.x || 0, y: region.y || 0, w: region.w || 8, h: region.h || 1,
1843
- fontFace: role.font || P.titleFont, fontSize: role.size || 48, bold: role.bold !== false,
1844
- align: role.align || "left", valign: "middle",
1845
- charSpacing: role.charSpacing != null ? role.charSpacing : -1, lineSpacingMultiple: role.lineSpacing || 1.08,
1846
- });
1847
- return true;
1848
- }
1849
- if (typeof content === "object") {
1850
- if (content.type === "body" && (layout === "content" || layout === "main")) {
1851
- // Cards ONLY for section-structured bodies (≥2 ### sections) with no image.
1852
- // Prose bullets, or any body sharing the slide with an image, render as a
1853
- // normal text column (fall through to addRegion) so nothing is cramped.
1854
- const sections = (content.items || []).filter((i) => i.type === "section");
1855
- if (sections.length >= 2 && !opts.hasImage) {
1856
- const bottom = renderAzureCards(slide, content.items, region, P);
1857
- if (opts.flow) opts.flow.cardsBottom = bottom;
1858
- return true;
1859
- }
1860
- return false;
1861
- }
1862
- if (content.type === "kpi-table") {
1863
- if (content.chart) {
1864
- // Pie and doughnut slices carry white labels, so they use the darker tones only.
1865
- const round = ["pie", "doughnut"].includes(content.chart.type);
1866
- const series = round ? [P.primary, P.primary_deep, P.azure, P.ink_muted] : [P.primary, P.azure_soft, P.primary_deep, P.ink_muted];
1867
- renderChart(slide, content, region, { ...P, series }, opts.bottom);
1868
- }
1869
- else if (looksLikeKpi(content) && kpiFits(content, region.w)) {
1870
- renderAzureKpi(slide, content, region, P);
1871
- }
1872
- else renderAzureTable(slide, content, region, P, opts.bottom);
1873
- return true;
1874
- }
1875
- if (content.type === "summary-group") {
1876
- const idx = name === "group_bottom" ? 1 : 0;
1877
- renderAzureGroupCard(slide, content, region, P, idx, opts.groupHeight);
1878
- return true;
1879
- }
1880
- }
1881
- return false;
1882
- }
1883
-
1884
- // ── Placements (author-positioned boxes and shapes) ─────────────────────────
1885
-
1886
- /** Region name a placed block should be rendered as. */
1887
- function partRegionName(blockType) {
1888
- switch (blockType) {
1889
- case "title": return "title";
1890
- case "kpi-table": return "table";
1891
- case "image": return "image";
1892
- case "figure-caption": return "figure_caption";
1893
- case "table-caption": return "table_caption";
1894
- default: return "body";
1895
- }
1896
- }
1897
-
1898
- /** font_role a placed block falls back to when its box names none. */
1899
- function defaultPartRole(blockType) {
1900
- switch (blockType) {
1901
- case "title": return "section_title";
1902
- case "figure-caption": return "figure_caption";
1903
- case "table-caption": return "table_caption";
1904
- case "notes": return "disclaimer";
1905
- default: return "body_text";
1906
- }
1907
- }
1908
-
1909
- function estimatePartHeight(content, widthIn, role) {
1910
- const size = role.size || 13;
1911
- const spacing = role.lineSpacing || 1.3;
1912
- if (typeof content === "string") {
1913
- return estimateTextHeight(content, widthIn, size, spacing) + 0.08;
1914
- }
1915
- if (content && content.type === "body") {
1916
- const text = (content.items || []).map((i) => i.heading || i.text || "").join("\n");
1917
- return estimateTextHeight(text, widthIn, size, spacing) + 0.12;
1918
- }
1919
- return 0.5;
1920
- }
1921
-
1922
- /**
1923
- * Turn a shape placement into the decoration element addDecorations reads.
1924
- *
1925
- * A rule is drawn as a zero-height rect whose stroke is the visible mark, so it
1926
- * reads its colour and thickness from `color`/`width` while every other
1927
- * primitive reads `line`/`line_width`. Authors write one spelling — `line=` and
1928
- * `lw=` — and the difference is absorbed here.
1929
- */
1930
- function shapeToDecoration(placement, sourceDir) {
1931
- const isRule = placement.shape === "line";
1932
- const element = {
1933
- type: placement.shape,
1934
- x: placement.x, y: placement.y, w: placement.w, h: placement.h,
1935
- };
1936
- for (const [key, value] of Object.entries(placement)) {
1937
- if (["kind", "z", "shape", "x", "y", "w", "h"].includes(key)) continue;
1938
- if (key === "lw") element[isRule ? "width" : "line_width"] = value;
1939
- else if (key === "line" && isRule) element.color = value;
1940
- else if (key === "src") element.assetPath = resolveImagePath(value, sourceDir);
1941
- else element[key] = value;
1942
- }
1943
- return element;
1944
- }
1945
-
1946
- /**
1947
- * Render one placed box by flowing its blocks down the box.
1948
- *
1949
- * Every block but the last takes the height its content needs; the last takes
1950
- * whatever is left, so a heading followed by body fills the box rather than
1951
- * floating in its top edge. Nothing here consults the auto-nudge rules: a box
1952
- * lands exactly where the author put it, and the QA gate reports the consequence.
1953
- */
1954
- function renderPlacementBox(slide, placement, ctx) {
1955
- const blocks = placement.blocks || [];
1956
- if (blocks.length === 0) return;
1957
-
1958
- // Columns replace the body region, so they render in the template's own idiom.
1959
- // An explicit box is literal: the author asked for this content, here.
1960
- const useRich = ctx.rich && placement.z === "content";
1961
- const bottom = placement.y + (placement.h != null ? placement.h : 1.0);
1962
- let y = placement.y;
1963
-
1964
- blocks.forEach((block, i) => {
1965
- const remaining = Math.max(0.2, bottom - y);
1966
- const roleName = placement.role || defaultPartRole(block.type);
1967
- const role = ctx.fontRoles[roleName] || {};
1968
- const content = extractContent(block);
1969
- const isLast = i === blocks.length - 1;
1970
- const h = isLast
1971
- ? remaining
1972
- : Math.min(remaining, Math.max(0.2, estimatePartHeight(content, placement.w, role)));
1973
-
1974
- const region = {
1975
- x: placement.x, y, w: placement.w, h,
1976
- content,
1977
- font_role: roleName,
1978
- originX: placement.x,
1979
- ...(placement.align ? { align: placement.align } : {}),
1980
- ...(placement.valign ? { valign: placement.valign } : {}),
1981
- };
1982
-
1983
- const name = partRegionName(block.type);
1984
- const rendered = useRich &&
1985
- renderAzureRegion(slide, ctx.layout, name, region, ctx.fontRoles, ctx.P, {});
1986
- if (!rendered) {
1987
- addRegion(slide, name, region, ctx.fontRoles, ctx.pageH, y + h, false, ctx.sourceDir);
1988
- }
1989
- y += h;
1990
- });
1991
- }
1992
-
1993
- function renderPlacements(slide, placements, band, ctx) {
1994
- for (const placement of placements) {
1995
- if (placement.z !== band) continue;
1996
- if (placement.kind === "shape") {
1997
- addDecorations(slide, [shapeToDecoration(placement, ctx.sourceDir)], ctx.fontRoles);
1998
- } else {
1999
- renderPlacementBox(slide, placement, ctx);
2000
- }
2001
- }
2002
- }
2003
-
2004
- // ── Main render function ────────────────────────────────────────────────────
2005
-
2006
- /**
2007
- * Render the full resolved spec to a PPTX file.
2008
- *
2009
- * @param {object} resolved - Resolved spec from layout-resolver
2010
- * @param {object} templateObj - Template object from template-registry
2011
- * @param {string} outputPath - Where to write the .pptx file
2012
- * @returns {Promise<string>} Resolves with the output path
2013
- */
2014
- /**
2015
- * The deck-wide `notice:` (for example "예시 데이터 — 실제 수치로 바꿔 주세요") as a
2016
- * coloured tag at the bottom left of every slide, cover included, so a sample or
2017
- * draft deck can never be mistaken for a sourced one. A 9 pt grey footnote was easy
2018
- * to miss; the tag keeps its own fill and text colour (template palette
2019
- * `notice_fill` / `notice_ink`, default a light red with dark red text, 6:1).
2020
- */
2021
- const NOTICE_FILL = "FDECEA";
2022
- const NOTICE_INK = "A21B12";
2023
- let NOTICE = { ...LEGACY_TOKENS.notice };
2024
-
2025
- function addNotice(slide, text, pageW, pageH, pal) {
2026
- const label = cleanMd(text);
2027
- const fontSize = NOTICE.size;
2028
- const textW = (weightedTextLength(label) * fontSize * 0.98) / 72;
2029
- const w = Math.min(pageW * 0.55, textW + 0.46);
2030
- const h = NOTICE.h;
2031
- const x = NOTICE.x, y = pageH - h - NOTICE.bottom;
2032
- const fill = ((pal && pal.notice_fill) || NOTICE_FILL).replace("#", "");
2033
- const ink = ((pal && pal.notice_ink) || NOTICE_INK).replace("#", "");
2034
- slide.addShape("roundRect", { x, y, w, h, rectRadius: 0.15, fill: { color: fill }, line: { type: "none" }, objectName: "lit-notice tag" });
2035
- slide.addText(label, {
2036
- objectName: "lit-notice text",
2037
- x: x + 0.16, y, w: w - 0.32, h,
2038
- fontFace: FONT_BOLD, fontSize, bold: true, color: ink,
2039
- align: "left", valign: "middle", margin: 0, fit: "shrink",
2040
- });
2041
- }
2042
-
2043
- /**
2044
- * Give the first object drawn on a slide that has no name of its own the name `family@<id>`, so a
2045
- * checker can read the layout family the source asked for and compare it with what it measures.
2046
- */
2047
- function stampFamily(slide, family) {
2048
- const at = { addText: 1, addShape: 1, addImage: 0, addTable: 1, addChart: 2 };
2049
- const originals = {};
2050
- let done = false;
2051
- const restore = () => { for (const m of Object.keys(originals)) slide[m] = originals[m]; };
2052
- for (const [method, index] of Object.entries(at)) {
2053
- originals[method] = slide[method];
2054
- slide[method] = (...args) => {
2055
- if (!(args[index] && args[index].objectName)) {
2056
- restore();
2057
- done = true;
2058
- args[index] = { ...(args[index] || {}), objectName: `family@${family}` };
2059
- }
2060
- return originals[method].apply(slide, args);
2061
- };
2062
- }
2063
- /** Whether a shape took the name; unwraps the slide either way. */
2064
- return () => { restore(); return done; };
2065
- }
2066
-
2067
- async function render(resolved, templateObj, outputPath) {
2068
- const pack = (templateObj && templateObj.pack) || null;
2069
- if (pack && !pack.legacy) return require("./render-pack").renderPack(resolved, templateObj, outputPath);
2070
- applyTokens(pack && pack.tokens);
2071
- const fontRoles = buildFontRoles(templateObj);
2072
-
2073
- // Brand-neutralize: derive font/spacing/accent from the template, falling back
2074
- // to Pretendard when a template names no family.
2075
- const tpl = (templateObj && templateObj.template) || {};
2076
- const tplFonts = tpl.fonts || {};
2077
- const tplType = tpl.global_typography || {};
2078
- FONT_BOLD = tplFonts.title || "Pretendard";
2079
- FONT_MEDIUM = tplFonts.body || "Pretendard";
2080
- FONT_LIGHT = tplFonts.light || "Pretendard";
2081
- CHAR_SPACING = tplType.char_spacing != null ? tplType.char_spacing : -0.7;
2082
- SEC_HEADER_FONT = FONT_BOLD;
2083
- TOC_FONT = FONT_BOLD;
2084
- BULLET_COLOR = (tplType.bullet_color || "1D4ED8").replace("#", "");
2085
- SECTION_ACCENT = (tplType.section_accent || "1D4ED8").replace("#", "");
2086
-
2087
- // Rich card/KPI/divider rendering — palette-driven, for templates with the rich-blocks
2088
- // capability. Tokens come from the template palette.
2089
- const rich = Boolean(pack && (pack.capabilities || []).includes("rich-blocks"));
2090
- const pal = tpl.palette || {};
2091
- PLAIN_CHART_STYLE = {
2092
- series: [pal.ink || "#3C3836", pal.accent_green_2 || pal.primary || "#689D6A", pal.accent_amber || "#D79921", pal.accent_purple || "#B16286"],
2093
- ink: pal.ink || "#3C3836", ink_muted: pal.ink_muted || "#6E6256", line: pal.line || "#CBC2B5",
2094
- titleFont: FONT_BOLD, bodyFont: FONT_MEDIUM,
2095
- };
2096
- const P = {
2097
- titleFont: FONT_BOLD, bodyFont: FONT_MEDIUM,
2098
- primary: pal.primary || "#1D4ED8", primary_deep: pal.primary_deep || "#0B2E6F",
2099
- ink: pal.ink || "#0E1B2C", ink_muted: pal.ink_muted || "#51607A",
2100
- tint: pal.tint || "#EEF4FF", line: pal.line || "#D5DEEC", azure_soft: pal.azure_soft || "#93C5FD", azure: pal.azure || "#3B82F6",
2101
- emphasisTextColor: pal.emphasis_text || "#C9D8F5",
2102
- };
2103
-
2104
- const dims =
2105
- (templateObj && templateObj.template && templateObj.template.dimensions) || {};
2106
- const pageW = dims.width || 10.833;
2107
- const pageH = dims.height || 7.5;
2108
-
2109
- // Loaded here, not at module load, so AST-only and --list-* runs never install.
2110
- const PptxGenJS = runtimeRequire("pptxgenjs");
2111
- const pptx = new PptxGenJS();
2112
- pptx.defineLayout({ name: "A4_LANDSCAPE", width: pageW, height: pageH });
2113
- pptx.layout = "A4_LANDSCAPE";
2114
-
2115
- const title = (resolved.deck && resolved.deck.title) || "Presentation";
2116
- pptx.title = title;
2117
- const sourceDir = resolved.sourceDir;
2118
- const cramStress = isCramStressDeck(resolved);
2119
- const deckMeta = (resolved.deck && resolved.deck.metadata) || {};
2120
- const notice = typeof deckMeta.notice === "string" && deckMeta.notice.trim() ? deckMeta.notice.trim() : null;
2121
-
2122
- for (const slideSpec of resolved.slides || []) {
2123
- const slide = pptx.addSlide();
2124
- stampFamily(slide, slideSpec.family || slideSpec.layout);
2125
-
2126
- // Draw order is a band at a time: template decorations, then anything the
2127
- // author put under the content, then the template's regions, then the
2128
- // columns that replaced the body, then anything sitting on top.
2129
- addDecorations(slide, slideSpec.decorations, fontRoles);
2130
-
2131
- const placements = slideSpec.placements || [];
2132
- const placementCtx = {
2133
- rich, P, fontRoles, pageH, sourceDir,
2134
- layout: slideSpec.layout,
2135
- };
2136
- renderPlacements(slide, placements, "under", placementCtx);
2137
-
2138
- const regions = adjustedRegionsForImageColumn(slideSpec.regions || {});
2139
- if (cramStress && ["content", "main"].includes(slideSpec.layout) && regions.body) {
2140
- renderCramStressSlide(slide, { ...slideSpec, regions }, pageW, pageH, sourceDir);
2141
- continue;
2142
- }
2143
-
2144
- // Calculate bottom boundary for regions without explicit h
2145
- const bottomBoundary = {};
2146
- for (const [name, region] of Object.entries(regions)) {
2147
- let bottom = pageH - 0.5;
2148
- for (const [otherName, otherRegion] of Object.entries(regions)) {
2149
- if (otherName === name || otherName === "title") continue;
2150
- if (name === "body" && ["image", "figure_caption"].includes(otherName)) continue;
2151
- if (otherRegion.y && otherRegion.y > (region.y || 0) && otherRegion.h) {
2152
- const candidateBottom = otherRegion.y - 0.15;
2153
- if (candidateBottom < bottom) bottom = candidateBottom;
2154
- }
2155
- }
2156
- bottomBoundary[name] = bottom;
2157
- }
2158
-
2159
- const tocSlide = isTocSlide(regions);
2160
- const hasImage = Object.entries(regions).some(([n, r]) =>
2161
- (n === "image" || n === "figure") && r.content &&
2162
- (r.content.type === "image" || r.content.type === "image-grid"));
2163
-
2164
- // Summary groups sit side by side, so they share the height the fuller one needs.
2165
- const groups = Object.values(regions).filter((r) => r.content && r.content.type === "summary-group");
2166
- const groupHeight = rich && groups.length
2167
- ? Math.max(...groups.map((r) => groupCard(r.content, r.w || 5.6, r.h || 2.4, P).need))
2168
- : null;
2169
-
2170
- const flow = {};
2171
- for (const [name, region] of Object.entries(regions)) {
2172
- if (rich && renderAzureRegion(slide, slideSpec.layout, name, region, fontRoles, P, { hasImage, bottom: bottomBoundary[name], groupHeight, flow })) continue;
2173
- addRegion(slide, name, region, fontRoles, pageH, bottomBoundary[name], tocSlide, sourceDir);
2174
- }
2175
-
2176
- renderPlacements(slide, placements, "content", placementCtx);
2177
- renderPlacements(slide, placements, "over", placementCtx);
2178
- if (notice) addNotice(slide, notice, pageW, pageH, pal);
2179
- }
2180
-
2181
- await writeTagged(pptx, outputPath);
2182
- return outputPath;
2183
- }
2184
-
2185
- const HANGUL = /[\u1100-\u11FF\u3130-\u318F\uAC00-\uD7A3]/u;
2186
-
2187
- /**
2188
- * Korean text runs carry their language: pptxgenjs writes lang="en-US" on every run, and a renderer then
2189
- * applies Latin rules to Hangul (LibreOffice on a host whose system locale is not Korean adds space
2190
- * between Hangul and digits: "주 2일" set as "주 2 일"). A run that holds Hangul is ko-KR with en-US as its
2191
- * alternate language; a chart that holds Hangul names ko-KR for its text. Latin-only runs keep en-US.
2192
- */
2193
- function tagLanguages(name, xml) {
2194
- if (/^ppt\/slides\/slide\d+\.xml$/u.test(name)) {
2195
- return xml.replace(/<a:r><a:rPr\b([^>]*?)(\/?>)([\s\S]*?)<a:t>([^<]*)<\/a:t><\/a:r>/gu, (m, attrs, close, mid, text) => {
2196
- if (!HANGUL.test(text)) return m;
2197
- const rest = attrs.replace(/\s(?:lang|altLang)="[^"]*"/gu, "");
2198
- return `<a:r><a:rPr lang="ko-KR" altLang="en-US"${rest}${close}${mid}<a:t>${text}</a:t></a:r>`;
2199
- });
2200
- }
2201
- if (/^ppt\/charts\/chart\d+\.xml$/u.test(name) && HANGUL.test(xml)) {
2202
- let out = xml.replace(/<a:defRPr\b(?![^>]*\blang=)/gu, '<a:defRPr lang="ko-KR" altLang="en-US"')
2203
- .replace(/<a:endParaRPr lang="en-US"/gu, '<a:endParaRPr lang="ko-KR" altLang="en-US"');
2204
- if (!/<c:lang\b/u.test(out)) out = out.replace(/(<c:date1904 val="[01]"\/>)/u, '$1<c:lang val="ko-KR"/>');
2205
- return out;
2206
- }
2207
- return xml;
2208
- }
2209
-
2210
- /** Write a deck with its Korean runs and charts tagged (see tagLanguages); `edit` may rewrite a part first. */
2211
- async function writeTagged(pptx, outputPath, edit = (name, xml) => xml) {
2212
- const JSZip = runtimeRequire("jszip");
2213
- const zip = await JSZip.loadAsync(await pptx.write({ outputType: "nodebuffer" }));
2214
- for (const name of Object.keys(zip.files).filter((n) => /^ppt\/(slides\/slide|charts\/chart|theme\/theme)\d+\.xml$/u.test(n))) {
2215
- const xml = await zip.file(name).async("string");
2216
- zip.file(name, tagLanguages(name, edit(name, xml)));
2217
- }
2218
- fs.writeFileSync(outputPath, await zip.generateAsync({ type: "nodebuffer", compression: "DEFLATE" }));
2219
- }
2220
-
2221
- // ── Tonality packs ──────────────────────────────────────────────────────────
2222
- //
2223
- // A pack deck is drawn by render-pack.js. It reuses the helpers below, and the font globals the
2224
- // free placement boxes read are switched to the pack's faces before it draws.
2225
-
2226
- function usePackFonts(titleFont, bodyFont, tokens) {
2227
- FONT_BOLD = titleFont;
2228
- FONT_MEDIUM = bodyFont;
2229
- FONT_LIGHT = bodyFont;
2230
- CHAR_SPACING = 0;
2231
- applyTokens(tokens);
2232
- }
2233
-
2234
- module.exports = {
2235
- render,
2236
- shared: {
2237
- hex, cleanMd, mdRuns, linkedTableCell, resolveImagePath, readImageSize, containBox,
2238
- kpiCards, numericColumns, proportionalWidths, renderChart, stampFamily, renderPlacements, usePackFonts, writeTagged,
2239
- },
2240
- };