@litfamily/litgravity 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +38 -0
- package/LICENSE +22 -0
- package/README.md +187 -2
- package/README_ko-KR.md +188 -0
- package/bin/litgravity.mjs +123 -0
- package/lib/agy.mjs +54 -0
- package/lib/bundle.mjs +141 -0
- package/lib/doctor.mjs +184 -0
- package/lib/guard.mjs +12 -0
- package/lib/host-tools.mjs +69 -0
- package/lib/install.mjs +130 -0
- package/lib/list.mjs +39 -0
- package/lib/models.mjs +36 -0
- package/lib/paths.mjs +28 -0
- package/lib/runtime.mjs +81 -0
- package/lib/safe-write.mjs +55 -0
- package/lib/statusline.mjs +99 -0
- package/lib/uninstall.mjs +60 -0
- package/lib/update-check.mjs +28 -0
- package/package.json +51 -4
- package/plugin/agents/.gitkeep +0 -0
- package/plugin/agents/korean-prose-editor.md +62 -0
- package/plugin/agents/korean-style-analyzer.md +59 -0
- package/plugin/agents/librarian-researcher.md +60 -0
- package/plugin/agents/lit-executor.md +61 -0
- package/plugin/agents/lit-planner.md +68 -0
- package/plugin/agents/lit-verifier.md +58 -0
- package/plugin/agents/meaning-preservation-auditor.md +57 -0
- package/plugin/agents/native-flow-reviewer.md +56 -0
- package/plugin/agents/polish-orchestrator.md +60 -0
- package/plugin/agents/qa-runner.md +53 -0
- package/plugin/agents/quality-reviewer.md +58 -0
- package/plugin/hooks/lib/boundary.mjs +106 -0
- package/plugin/hooks/lib/common.mjs +208 -0
- package/plugin/hooks/lib/continuation.mjs +157 -0
- package/plugin/hooks/lib/motion.mjs +142 -0
- package/plugin/hooks/lib/policy.mjs +149 -0
- package/plugin/hooks/lib/prose.mjs +79 -0
- package/plugin/hooks/lib/redact.mjs +23 -0
- package/plugin/hooks/lib/reentry.mjs +93 -0
- package/plugin/hooks/lib/routes.mjs +173 -0
- package/plugin/hooks/lib/transcript.mjs +48 -0
- package/plugin/hooks/post-invocation.mjs +18 -0
- package/plugin/hooks/post-tool-use.mjs +30 -0
- package/plugin/hooks/pre-invocation.mjs +62 -0
- package/plugin/hooks/pre-tool-use.mjs +112 -0
- package/plugin/hooks/session-start.mjs +31 -0
- package/plugin/hooks/stop.mjs +44 -0
- package/plugin/hooks.json +56 -0
- package/plugin/hud/render.mjs +602 -0
- package/plugin/hud/statusline.mjs +20 -0
- package/plugin/lib/host-exec.mjs +133 -0
- package/plugin/lib/python-pick.mjs +63 -0
- package/plugin/plugin.json +6 -0
- package/plugin/rules/AGENTS.md +30 -0
- package/plugin/skills/autoconference/LICENSE +21 -0
- package/plugin/skills/autoconference/PROVENANCE.md +26 -0
- package/plugin/skills/autoconference/SKILL.md +137 -0
- package/plugin/skills/autoconference/assets/conference_template.md +93 -0
- package/plugin/skills/autoconference/assets/report_template.md +59 -0
- package/plugin/skills/autoconference/assets/synthesis_template.md +52 -0
- package/plugin/skills/autoconference/modes/analyze.md +181 -0
- package/plugin/skills/autoconference/modes/core.md +244 -0
- package/plugin/skills/autoconference/modes/debate.md +240 -0
- package/plugin/skills/autoconference/modes/plan.md +220 -0
- package/plugin/skills/autoconference/modes/resume.md +172 -0
- package/plugin/skills/autoconference/modes/ship.md +247 -0
- package/plugin/skills/autoconference/modes/survey.md +218 -0
- package/plugin/skills/autoconference/references/agent-prompts.md +488 -0
- package/plugin/skills/autoconference/references/conference-protocol.md +332 -0
- package/plugin/skills/autoconference/references/convergence-guide.md +157 -0
- package/plugin/skills/autoconference/references/core-principles.md +93 -0
- package/plugin/skills/autoconference/references/crash-recovery.md +137 -0
- package/plugin/skills/autoconference/references/results-logging.md +200 -0
- package/plugin/skills/autoconference/references/visualization-guide.md +83 -0
- package/plugin/skills/autoconference/scripts/check_conference.sh +184 -0
- package/plugin/skills/autoconference/scripts/init_conference.py +392 -0
- package/plugin/skills/autoconference/scripts/style_presets.py +142 -0
- package/plugin/skills/autoconference/templates/code-performance.md +82 -0
- package/plugin/skills/autoconference/templates/debate-mode.md +58 -0
- package/plugin/skills/autoconference/templates/prompt-optimization.md +81 -0
- package/plugin/skills/autoconference/templates/quick-conference.md +70 -0
- package/plugin/skills/autoconference/templates/research-synthesis.md +76 -0
- package/plugin/skills/autoconference/templates/survey-mode.md +70 -0
- package/plugin/skills/autoresearch/LICENSE +21 -0
- package/plugin/skills/autoresearch/PROVENANCE.md +22 -0
- package/plugin/skills/autoresearch/SKILL.md +204 -0
- package/plugin/skills/autoresearch/assets/report_template.md +58 -0
- package/plugin/skills/autoresearch/assets/research_template.md +46 -0
- package/plugin/skills/autoresearch/assets/results_template.tsv +1 -0
- package/plugin/skills/autoresearch/modes/core.md +148 -0
- package/plugin/skills/autoresearch/modes/debug.md +175 -0
- package/plugin/skills/autoresearch/modes/fix.md +126 -0
- package/plugin/skills/autoresearch/modes/learn.md +77 -0
- package/plugin/skills/autoresearch/modes/plan.md +177 -0
- package/plugin/skills/autoresearch/modes/predict.md +170 -0
- package/plugin/skills/autoresearch/modes/reason.md +131 -0
- package/plugin/skills/autoresearch/modes/scenario.md +118 -0
- package/plugin/skills/autoresearch/modes/security.md +206 -0
- package/plugin/skills/autoresearch/modes/ship.md +39 -0
- package/plugin/skills/autoresearch/references/core-principles.md +91 -0
- package/plugin/skills/autoresearch/references/evaluator-contract.md +134 -0
- package/plugin/skills/autoresearch/references/investigation-techniques.md +149 -0
- package/plugin/skills/autoresearch/references/owasp-checklist.md +175 -0
- package/plugin/skills/autoresearch/references/persona-templates.md +171 -0
- package/plugin/skills/autoresearch/references/results-logging.md +100 -0
- package/plugin/skills/autoresearch/references/scenario-dimensions.md +186 -0
- package/plugin/skills/autoresearch/references/stride-model.md +192 -0
- package/plugin/skills/autoresearch/references/stuck-detection.md +105 -0
- package/plugin/skills/autoresearch/references/type-checklists.md +156 -0
- package/plugin/skills/autoresearch/references/upstream-family-contract.md +120 -0
- package/plugin/skills/autoresearch/references/visualization-guide.md +84 -0
- package/plugin/skills/autoresearch/scripts/check_progress.sh +293 -0
- package/plugin/skills/autoresearch/scripts/init_research.py +380 -0
- package/plugin/skills/autoresearch/scripts/run_with_deadline.py +207 -0
- package/plugin/skills/autoresearch/scripts/style_presets.py +156 -0
- package/plugin/skills/browser-drive/SKILL.md +138 -0
- package/plugin/skills/browser-drive/references/blocker-codes.md +31 -0
- package/plugin/skills/browser-drive/references/cleanup-receipts.md +52 -0
- package/plugin/skills/browser-drive/references/credential-and-approval-boundaries.md +49 -0
- package/plugin/skills/browser-drive/references/playwright-recipes.md +75 -0
- package/plugin/skills/browser-drive/references/snapshot-act-loop.md +65 -0
- package/plugin/skills/browser-drive/scripts/capability-probe.mjs +483 -0
- package/plugin/skills/browser-drive/scripts/secret-shapes.mjs +56 -0
- package/plugin/skills/browser-drive/templates/drive.cjs +52 -0
- package/plugin/skills/comment-checker/SKILL.md +144 -0
- package/plugin/skills/comment-checker/references/comment-policy.md +109 -0
- package/plugin/skills/debugging/SKILL.md +187 -0
- package/plugin/skills/debugging/references/methodology/00-setup.md +115 -0
- package/plugin/skills/debugging/references/methodology/02-investigate.md +107 -0
- package/plugin/skills/debugging/references/methodology/04-oracle-triple.md +116 -0
- package/plugin/skills/debugging/references/methodology/05-escalate.md +73 -0
- package/plugin/skills/debugging/references/methodology/06-fix.md +111 -0
- package/plugin/skills/debugging/references/methodology/08-qa.md +87 -0
- package/plugin/skills/debugging/references/methodology/09-cleanup.md +162 -0
- package/plugin/skills/debugging/references/methodology/partial-runtime-evidence.md +186 -0
- package/plugin/skills/debugging/references/runtimes/bundled-js-binary.md +359 -0
- package/plugin/skills/debugging/references/runtimes/go.md +204 -0
- package/plugin/skills/debugging/references/runtimes/native-binary.md +406 -0
- package/plugin/skills/debugging/references/runtimes/node.md +227 -0
- package/plugin/skills/debugging/references/runtimes/python.md +215 -0
- package/plugin/skills/debugging/references/runtimes/rust.md +205 -0
- package/plugin/skills/debugging/references/tools/ghidra.md +150 -0
- package/plugin/skills/debugging/references/tools/playwright-cli.md +179 -0
- package/plugin/skills/debugging/references/tools/pwndbg.md +223 -0
- package/plugin/skills/debugging/references/tools/pwntools.md +217 -0
- package/plugin/skills/deep-interview/SKILL.md +305 -0
- package/plugin/skills/deep-interview/references/headless-and-resume.md +35 -0
- package/plugin/skills/deep-interview/references/question-craft.md +76 -0
- package/plugin/skills/deep-interview/references/scoring-and-gates.md +69 -0
- package/plugin/skills/deep-interview/scripts/render-progress.mjs +165 -0
- package/plugin/skills/deep-interview/templates/context.md +38 -0
- package/plugin/skills/deep-interview/templates/spec.md +68 -0
- package/plugin/skills/deep-interview/templates/state.json +35 -0
- package/plugin/skills/frontend-ui-ux/ATTRIBUTION.md +23 -0
- package/plugin/skills/frontend-ui-ux/LICENSE +21 -0
- package/plugin/skills/frontend-ui-ux/PROVENANCE.json +38 -0
- package/plugin/skills/frontend-ui-ux/SKILL.md +153 -0
- package/plugin/skills/frontend-ui-ux/SOURCE-MANIFEST.json +1060 -0
- package/plugin/skills/frontend-ui-ux/THIRD-PARTY-NOTICE.txt +14 -0
- package/plugin/skills/frontend-ui-ux/data/design-intelligence.json +1 -0
- package/plugin/skills/frontend-ui-ux/examples/design-contract.example.json +186 -0
- package/plugin/skills/frontend-ui-ux/examples/phase-3-readme-ab/README.md +9 -0
- package/plugin/skills/frontend-ui-ux/references/_canonical-corpus/legal/frontend-ATTRIBUTION.md +217 -0
- package/plugin/skills/frontend-ui-ux/references/_canonical-corpus/legal/frontend-LICENSE-Apache-2.0.txt +201 -0
- package/plugin/skills/frontend-ui-ux/references/_canonical-corpus/legal/root-LICENSE +21 -0
- package/plugin/skills/frontend-ui-ux/references/_canonical-corpus/manifest.json +873 -0
- package/plugin/skills/frontend-ui-ux/references/adaptive-layout.md +103 -0
- package/plugin/skills/frontend-ui-ux/references/brand-and-imagery.md +96 -0
- package/plugin/skills/frontend-ui-ux/references/complete-contract.md +415 -0
- package/plugin/skills/frontend-ui-ux/references/composition.md +93 -0
- package/plugin/skills/frontend-ui-ux/references/craft-floor.md +203 -0
- package/plugin/skills/frontend-ui-ux/references/creative-directions.md +96 -0
- package/plugin/skills/frontend-ui-ux/references/default-editorial-pixel.json +27 -0
- package/plugin/skills/frontend-ui-ux/references/design/README.md +248 -0
- package/plugin/skills/frontend-ui-ux/references/design/_INDEX.md +191 -0
- package/plugin/skills/frontend-ui-ux/references/design/airbnb.md +393 -0
- package/plugin/skills/frontend-ui-ux/references/design/airtable.md +92 -0
- package/plugin/skills/frontend-ui-ux/references/design/apple.md +250 -0
- package/plugin/skills/frontend-ui-ux/references/design/aside.md +209 -0
- package/plugin/skills/frontend-ui-ux/references/design/binance.md +348 -0
- package/plugin/skills/frontend-ui-ux/references/design/bmw.md +183 -0
- package/plugin/skills/frontend-ui-ux/references/design/brutalist-skill.md +92 -0
- package/plugin/skills/frontend-ui-ux/references/design/bugatti.md +271 -0
- package/plugin/skills/frontend-ui-ux/references/design/cal.md +262 -0
- package/plugin/skills/frontend-ui-ux/references/design/claude.md +315 -0
- package/plugin/skills/frontend-ui-ux/references/design/clay.md +307 -0
- package/plugin/skills/frontend-ui-ux/references/design/clickhouse.md +284 -0
- package/plugin/skills/frontend-ui-ux/references/design/clone-from-url.md +65 -0
- package/plugin/skills/frontend-ui-ux/references/design/cohere.md +269 -0
- package/plugin/skills/frontend-ui-ux/references/design/coinbase.md +132 -0
- package/plugin/skills/frontend-ui-ux/references/design/composio.md +310 -0
- package/plugin/skills/frontend-ui-ux/references/design/cursor.md +312 -0
- package/plugin/skills/frontend-ui-ux/references/design/design-system-architecture.md +244 -0
- package/plugin/skills/frontend-ui-ux/references/design/elevenlabs.md +268 -0
- package/plugin/skills/frontend-ui-ux/references/design/expo.md +284 -0
- package/plugin/skills/frontend-ui-ux/references/design/ferrari.md +317 -0
- package/plugin/skills/frontend-ui-ux/references/design/figma.md +223 -0
- package/plugin/skills/frontend-ui-ux/references/design/framer.md +249 -0
- package/plugin/skills/frontend-ui-ux/references/design/gpt-tasteskill.md +74 -0
- package/plugin/skills/frontend-ui-ux/references/design/hashicorp.md +281 -0
- package/plugin/skills/frontend-ui-ux/references/design/ibm.md +335 -0
- package/plugin/skills/frontend-ui-ux/references/design/image-to-code-skill.md +1228 -0
- package/plugin/skills/frontend-ui-ux/references/design/imagegen-brandkit.md +798 -0
- package/plugin/skills/frontend-ui-ux/references/design/imagegen-frontend-mobile.md +1465 -0
- package/plugin/skills/frontend-ui-ux/references/design/imagegen-frontend-web.md +987 -0
- package/plugin/skills/frontend-ui-ux/references/design/intercom.md +149 -0
- package/plugin/skills/frontend-ui-ux/references/design/kraken.md +128 -0
- package/plugin/skills/frontend-ui-ux/references/design/lamborghini.md +291 -0
- package/plugin/skills/frontend-ui-ux/references/design/layout-skill.md +107 -0
- package/plugin/skills/frontend-ui-ux/references/design/lazyweb.md +77 -0
- package/plugin/skills/frontend-ui-ux/references/design/linear.app.md +370 -0
- package/plugin/skills/frontend-ui-ux/references/design/lovable.md +301 -0
- package/plugin/skills/frontend-ui-ux/references/design/mastercard.md +368 -0
- package/plugin/skills/frontend-ui-ux/references/design/meta.md +369 -0
- package/plugin/skills/frontend-ui-ux/references/design/minimalist-skill.md +85 -0
- package/plugin/skills/frontend-ui-ux/references/design/minimax.md +260 -0
- package/plugin/skills/frontend-ui-ux/references/design/mintlify.md +329 -0
- package/plugin/skills/frontend-ui-ux/references/design/miro.md +111 -0
- package/plugin/skills/frontend-ui-ux/references/design/mistral.ai.md +264 -0
- package/plugin/skills/frontend-ui-ux/references/design/mongodb.md +269 -0
- package/plugin/skills/frontend-ui-ux/references/design/nike.md +366 -0
- package/plugin/skills/frontend-ui-ux/references/design/notion.md +312 -0
- package/plugin/skills/frontend-ui-ux/references/design/nvidia.md +296 -0
- package/plugin/skills/frontend-ui-ux/references/design/ollama.md +270 -0
- package/plugin/skills/frontend-ui-ux/references/design/opencode.ai.md +284 -0
- package/plugin/skills/frontend-ui-ux/references/design/output-skill.md +49 -0
- package/plugin/skills/frontend-ui-ux/references/design/pinterest.md +233 -0
- package/plugin/skills/frontend-ui-ux/references/design/playstation.md +367 -0
- package/plugin/skills/frontend-ui-ux/references/design/posthog.md +259 -0
- package/plugin/skills/frontend-ui-ux/references/design/raycast.md +271 -0
- package/plugin/skills/frontend-ui-ux/references/design/react-dev-tooling-skill.md +230 -0
- package/plugin/skills/frontend-ui-ux/references/design/redesign-skill.md +178 -0
- package/plugin/skills/frontend-ui-ux/references/design/renault.md +314 -0
- package/plugin/skills/frontend-ui-ux/references/design/replicate.md +264 -0
- package/plugin/skills/frontend-ui-ux/references/design/resend.md +306 -0
- package/plugin/skills/frontend-ui-ux/references/design/revolut.md +188 -0
- package/plugin/skills/frontend-ui-ux/references/design/runwayml.md +247 -0
- package/plugin/skills/frontend-ui-ux/references/design/sanity.md +360 -0
- package/plugin/skills/frontend-ui-ux/references/design/sentry.md +265 -0
- package/plugin/skills/frontend-ui-ux/references/design/shopify.md +353 -0
- package/plugin/skills/frontend-ui-ux/references/design/soft-skill.md +98 -0
- package/plugin/skills/frontend-ui-ux/references/design/spacex.md +197 -0
- package/plugin/skills/frontend-ui-ux/references/design/spotify.md +249 -0
- package/plugin/skills/frontend-ui-ux/references/design/starbucks.md +583 -0
- package/plugin/skills/frontend-ui-ux/references/design/stitch-design-example.md +121 -0
- package/plugin/skills/frontend-ui-ux/references/design/stitch-skill.md +184 -0
- package/plugin/skills/frontend-ui-ux/references/design/stripe.md +325 -0
- package/plugin/skills/frontend-ui-ux/references/design/supabase.md +258 -0
- package/plugin/skills/frontend-ui-ux/references/design/superhuman.md +255 -0
- package/plugin/skills/frontend-ui-ux/references/design/taste-skill.md +1206 -0
- package/plugin/skills/frontend-ui-ux/references/design/tesla.md +289 -0
- package/plugin/skills/frontend-ui-ux/references/design/theverge.md +342 -0
- package/plugin/skills/frontend-ui-ux/references/design/together.ai.md +266 -0
- package/plugin/skills/frontend-ui-ux/references/design/uber.md +298 -0
- package/plugin/skills/frontend-ui-ux/references/design/vercel.md +313 -0
- package/plugin/skills/frontend-ui-ux/references/design/vodafone.md +426 -0
- package/plugin/skills/frontend-ui-ux/references/design/voltagent.md +326 -0
- package/plugin/skills/frontend-ui-ux/references/design/warp.md +256 -0
- package/plugin/skills/frontend-ui-ux/references/design/webflow.md +95 -0
- package/plugin/skills/frontend-ui-ux/references/design/wired.md +281 -0
- package/plugin/skills/frontend-ui-ux/references/design/wise.md +176 -0
- package/plugin/skills/frontend-ui-ux/references/design/x.ai.md +260 -0
- package/plugin/skills/frontend-ui-ux/references/design/zapier.md +331 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/EVIDENCE.md +97 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/README.md +48 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/UPSTREAM.md +80 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/lane-a-direction.md +64 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/lane-b-execution.md +65 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/lane-c-review.md +65 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/lane-d-memory.md +83 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/orchestration.md +80 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/routing.md +79 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/LICENSE +21 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/agents/accessibility-reviewer.md +83 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/agents/content-writer.md +132 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/agents/design-builder.md +109 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/agents/design-critic.md +89 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/agents/design-lead.md +113 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/agents/design-scout.md +78 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/agents/design-strategist.md +121 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/agents/heuristic-evaluator.md +268 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/agents/inspiration-scout.md +107 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/agents/motion-designer.md +120 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/accessible-content/reference.md +101 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/adaptive-interfaces/reference.md +109 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/cognitive-accessibility/reference.md +107 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/design-debate/reference.md +199 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/design-debt-tracker/reference.md +174 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/design-handoff/reference.md +125 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/design-md/reference.md +106 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/design-retrospective/reference.md +266 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/design-review/reference.md +123 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/design-system-alignment/reference.md +120 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/designpowers-critique/reference.md +164 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/heuristic-evaluation/reference.md +85 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/inclusive-personas/reference.md +98 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/inspiration-scouting/reference.md +165 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/interaction-design/reference.md +122 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/motion-choreography/reference.md +81 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/research-planning/reference.md +96 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/responsive-patterns/reference.md +77 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/synthetic-user-testing/reference.md +192 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/taste-feedback/reference.md +165 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/taste-report/reference.md +78 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/token-architecture/reference.md +75 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/ui-composition/reference.md +117 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/usability-testing/reference.md +78 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/verification-before-shipping/reference.md +125 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/voice-and-tone/reference.md +79 -0
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/writing-design-plans/reference.md +119 -0
- package/plugin/skills/frontend-ui-ux/references/evidence-review.md +119 -0
- package/plugin/skills/frontend-ui-ux/references/implementation-platforms.md +115 -0
- package/plugin/skills/frontend-ui-ux/references/inclusive-interface.md +98 -0
- package/plugin/skills/frontend-ui-ux/references/interaction-motion.md +48 -0
- package/plugin/skills/frontend-ui-ux/references/motion-guide.md +153 -0
- package/plugin/skills/frontend-ui-ux/references/operating-lanes.md +101 -0
- package/plugin/skills/frontend-ui-ux/references/perfection/README.md +160 -0
- package/plugin/skills/frontend-ui-ux/references/perfection/react-perf-tooling.md +127 -0
- package/plugin/skills/frontend-ui-ux/references/performance-delivery.md +91 -0
- package/plugin/skills/frontend-ui-ux/references/product-direction.md +92 -0
- package/plugin/skills/frontend-ui-ux/references/production-interview.md +71 -0
- package/plugin/skills/frontend-ui-ux/references/redesign-playbook.md +103 -0
- package/plugin/skills/frontend-ui-ux/references/slop-register.md +139 -0
- package/plugin/skills/frontend-ui-ux/references/system-foundations.md +90 -0
- package/plugin/skills/frontend-ui-ux/references/taste-direction.md +79 -0
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/README.md +659 -0
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/charts.csv +26 -0
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/colors.csv +162 -0
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/icons.csv +106 -0
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/landing.csv +35 -0
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/products.csv +162 -0
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/react-performance.csv +45 -0
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/stacks/astro.csv +54 -0
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/stacks/flutter.csv +53 -0
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/stacks/html-tailwind.csv +56 -0
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/stacks/jetpack-compose.csv +53 -0
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/stacks/nextjs.csv +53 -0
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/stacks/nuxt-ui.csv +51 -0
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/stacks/nuxtjs.csv +59 -0
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/stacks/react-native.csv +52 -0
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/stacks/react.csv +54 -0
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/stacks/shadcn.csv +61 -0
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/stacks/svelte.csv +54 -0
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/stacks/swiftui.csv +51 -0
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/stacks/vue.csv +50 -0
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/styles.csv +85 -0
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/typography.csv +74 -0
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/ui-reasoning.csv +162 -0
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/ux-guidelines.csv +100 -0
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/web-interface.csv +31 -0
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/scripts/core.py +262 -0
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/scripts/design_system.py +1148 -0
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/scripts/search.py +114 -0
- package/plugin/skills/frontend-ui-ux/references/visual-language.md +90 -0
- package/plugin/skills/frontend-ui-ux/references/visual-reconstruction.md +55 -0
- package/plugin/skills/frontend-ui-ux/schemas/design-contract-v1alpha1.schema.json +306 -0
- package/plugin/skills/frontend-ui-ux/schemas/design-contract-v1beta1.schema.json +291 -0
- package/plugin/skills/frontend-ui-ux/schemas/design-contract-v1beta2.schema.json +311 -0
- package/plugin/skills/frontend-ui-ux/scripts/chrome-driver.mjs +216 -0
- package/plugin/skills/frontend-ui-ux/scripts/design-contract-format.mjs +286 -0
- package/plugin/skills/frontend-ui-ux/scripts/design-contract-inventory-rules.mjs +354 -0
- package/plugin/skills/frontend-ui-ux/scripts/design-contract-rules.mjs +361 -0
- package/plugin/skills/frontend-ui-ux/scripts/design-contract-surface-rules.mjs +313 -0
- package/plugin/skills/frontend-ui-ux/scripts/design-data.mjs +68 -0
- package/plugin/skills/frontend-ui-ux/scripts/errors.mjs +12 -0
- package/plugin/skills/frontend-ui-ux/scripts/import-design-intelligence.mjs +124 -0
- package/plugin/skills/frontend-ui-ux/scripts/interface-probe-page.mjs +1534 -0
- package/plugin/skills/frontend-ui-ux/scripts/interface-probe-rules.mjs +141 -0
- package/plugin/skills/frontend-ui-ux/scripts/interface-probe-server.mjs +57 -0
- package/plugin/skills/frontend-ui-ux/scripts/interface-probe-static.mjs +129 -0
- package/plugin/skills/frontend-ui-ux/scripts/interface-probe.mjs +289 -0
- package/plugin/skills/frontend-ui-ux/scripts/json-boundary.mjs +63 -0
- package/plugin/skills/frontend-ui-ux/scripts/query-design-intelligence.mjs +106 -0
- package/plugin/skills/frontend-ui-ux/scripts/search.mjs +43 -0
- package/plugin/skills/frontend-ui-ux/scripts/source-replay.mjs +153 -0
- package/plugin/skills/frontend-ui-ux/scripts/strict-json.mjs +143 -0
- package/plugin/skills/frontend-ui-ux/scripts/validate-design-contract.mjs +52 -0
- package/plugin/skills/frontend-ui-ux/scripts/verify-corpus.mjs +90 -0
- package/plugin/skills/lit-brainstorm/SKILL.md +228 -0
- package/plugin/skills/lit-brainstorm/references/convergence-matrices.md +39 -0
- package/plugin/skills/lit-brainstorm/references/idea-lenses.md +71 -0
- package/plugin/skills/lit-brainstorm/references/lane-prompts.md +35 -0
- package/plugin/skills/lit-brainstorm/references/scoring-rubric.md +33 -0
- package/plugin/skills/lit-brainstorm/references/session-walkthrough.md +58 -0
- package/plugin/skills/lit-brainstorm/references/technique-catalog.md +41 -0
- package/plugin/skills/lit-brainstorm/references/techniques-generate.md +50 -0
- package/plugin/skills/lit-brainstorm/references/techniques-reframe.md +30 -0
- package/plugin/skills/lit-brainstorm/references/techniques-structure.md +36 -0
- package/plugin/skills/lit-brainstorm/templates/handoff-packet.md +23 -0
- package/plugin/skills/lit-brainstorm/templates/session-board.md +45 -0
- package/plugin/skills/lit-brainstorm/templates/shortlist.md +31 -0
- package/plugin/skills/lit-burnoff/SKILL.md +222 -0
- package/plugin/skills/lit-burnoff/references/behavior-preserving-cleanup.md +75 -0
- package/plugin/skills/lit-burnoff/references/prose-and-docs.md +31 -0
- package/plugin/skills/lit-burnoff/references/slop-categories.md +75 -0
- package/plugin/skills/lit-burnoff/templates/report.md +17 -0
- package/plugin/skills/lit-burnoff-file/SKILL.md +177 -0
- package/plugin/skills/lit-burnoff-file/references/triage-examples.md +76 -0
- package/plugin/skills/lit-burnoff-file/templates/report.md +17 -0
- package/plugin/skills/lit-code/SKILL.md +239 -0
- package/plugin/skills/lit-code/references/core/agy-surfaces-and-verification.md +95 -0
- package/plugin/skills/lit-code/references/core/cross-language-stack.md +74 -0
- package/plugin/skills/lit-code/references/core/file-size-ceiling.md +133 -0
- package/plugin/skills/lit-code/references/core/language-jump-table.md +143 -0
- package/plugin/skills/lit-code/references/core/post-write-review.md +77 -0
- package/plugin/skills/lit-code/references/core/shared-rules.md +92 -0
- package/plugin/skills/lit-code/references/core/tdd-discipline.md +82 -0
- package/plugin/skills/lit-code/references/engineering-risk-signals.md +123 -0
- package/plugin/skills/lit-code/references/go/README.md +104 -0
- package/plugin/skills/lit-code/references/go/backend-stack.md +717 -0
- package/plugin/skills/lit-code/references/go/bootstrap.md +350 -0
- package/plugin/skills/lit-code/references/go/bubbletea-v2.md +356 -0
- package/plugin/skills/lit-code/references/go/cobra-stack.md +446 -0
- package/plugin/skills/lit-code/references/go/concurrency.md +443 -0
- package/plugin/skills/lit-code/references/go/data-modeling.md +372 -0
- package/plugin/skills/lit-code/references/go/error-handling.md +379 -0
- package/plugin/skills/lit-code/references/go/golangci-strict.md +285 -0
- package/plugin/skills/lit-code/references/go/grpc-connect.md +458 -0
- package/plugin/skills/lit-code/references/go/libraries.md +327 -0
- package/plugin/skills/lit-code/references/go/one-liners.md +223 -0
- package/plugin/skills/lit-code/references/go/sqlc-pgx.md +517 -0
- package/plugin/skills/lit-code/references/go/testing.md +453 -0
- package/plugin/skills/lit-code/references/go/type-patterns.md +347 -0
- package/plugin/skills/lit-code/references/observability-contracts.md +106 -0
- package/plugin/skills/lit-code/references/python/README.md +313 -0
- package/plugin/skills/lit-code/references/python/async-anyio.md +487 -0
- package/plugin/skills/lit-code/references/python/data-modeling.md +264 -0
- package/plugin/skills/lit-code/references/python/data-processing.md +156 -0
- package/plugin/skills/lit-code/references/python/error-handling.md +300 -0
- package/plugin/skills/lit-code/references/python/fastapi-stack.md +368 -0
- package/plugin/skills/lit-code/references/python/httpx2-optimization.md +445 -0
- package/plugin/skills/lit-code/references/python/libraries.md +342 -0
- package/plugin/skills/lit-code/references/python/one-liners.md +290 -0
- package/plugin/skills/lit-code/references/python/orjson-stack.md +389 -0
- package/plugin/skills/lit-code/references/python/pydantic-ai.md +335 -0
- package/plugin/skills/lit-code/references/python/pyproject-strict.md +265 -0
- package/plugin/skills/lit-code/references/python/textual-tui.md +243 -0
- package/plugin/skills/lit-code/references/python/type-patterns.md +258 -0
- package/plugin/skills/lit-code/references/rust/README.md +338 -0
- package/plugin/skills/lit-code/references/rust/async-tokio.md +324 -0
- package/plugin/skills/lit-code/references/rust/axum-stack.md +563 -0
- package/plugin/skills/lit-code/references/rust/cargo-strict.md +357 -0
- package/plugin/skills/lit-code/references/rust/clap-stack.md +482 -0
- package/plugin/skills/lit-code/references/rust/concurrency.md +396 -0
- package/plugin/skills/lit-code/references/rust/libraries.md +467 -0
- package/plugin/skills/lit-code/references/rust/one-liners.md +294 -0
- package/plugin/skills/lit-code/references/rust/proptest-insta.md +418 -0
- package/plugin/skills/lit-code/references/rust/type-state.md +496 -0
- package/plugin/skills/lit-code/references/rust/unsafe-discipline.md +282 -0
- package/plugin/skills/lit-code/references/rust/zero-cost-safety.md +546 -0
- package/plugin/skills/lit-code/references/rust-ub/README.md +294 -0
- package/plugin/skills/lit-code/references/rust-ub/miri-sanitizers-loom.md +477 -0
- package/plugin/skills/lit-code/references/rust-ub/ub-taxonomy.md +302 -0
- package/plugin/skills/lit-code/references/typescript/README.md +191 -0
- package/plugin/skills/lit-code/references/typescript/backend-hono.md +703 -0
- package/plugin/skills/lit-code/references/typescript/bootstrap.md +185 -0
- package/plugin/skills/lit-code/references/typescript/data-modeling.md +244 -0
- package/plugin/skills/lit-code/references/typescript/error-handling.md +219 -0
- package/plugin/skills/lit-code/references/typescript/tsconfig-strict.md +193 -0
- package/plugin/skills/lit-code/references/typescript/type-patterns.md +290 -0
- package/plugin/skills/lit-code/scripts/go/check-no-excuse-rules.sh +173 -0
- package/plugin/skills/lit-code/scripts/go/new-project.py +138 -0
- package/plugin/skills/lit-code/scripts/go/templates/.editorconfig +13 -0
- package/plugin/skills/lit-code/scripts/go/templates/.golangci.yml +95 -0
- package/plugin/skills/lit-code/scripts/go/templates/AGENTS.md.tmpl +24 -0
- package/plugin/skills/lit-code/scripts/go/templates/README.md.tmpl +12 -0
- package/plugin/skills/lit-code/scripts/go/templates/Taskfile.yml +40 -0
- package/plugin/skills/lit-code/scripts/go/templates/ci.yml +37 -0
- package/plugin/skills/lit-code/scripts/go/templates/config.go +24 -0
- package/plugin/skills/lit-code/scripts/go/templates/gitignore +15 -0
- package/plugin/skills/lit-code/scripts/go/templates/main.go.tmpl +22 -0
- package/plugin/skills/lit-code/scripts/go/templates/run.go +15 -0
- package/plugin/skills/lit-code/scripts/python/check-no-excuse-rules.py +687 -0
- package/plugin/skills/lit-code/scripts/python/new-project.py +172 -0
- package/plugin/skills/lit-code/scripts/python/new-script.py +116 -0
- package/plugin/skills/lit-code/scripts/rust/check-no-excuse-rules.py +296 -0
- package/plugin/skills/lit-code/scripts/rust/check-no-excuse-rules.sh +158 -0
- package/plugin/skills/lit-code/scripts/rust/new-project.py +175 -0
- package/plugin/skills/lit-code/scripts/typescript/check-no-excuse-rules.ts +344 -0
- package/plugin/skills/lit-code/scripts/typescript/new-project.ts +174 -0
- package/plugin/skills/lit-commit/SKILL.md +148 -0
- package/plugin/skills/lit-commit/references/safe-git-operations.md +154 -0
- package/plugin/skills/lit-comprehend/SKILL.md +244 -0
- package/plugin/skills/lit-comprehend/assets/explainer-scaffold.html +257 -0
- package/plugin/skills/lit-comprehend/references/artifact-template.md +173 -0
- package/plugin/skills/lit-comprehend/references/micro-worlds.md +174 -0
- package/plugin/skills/lit-comprehend/scripts/verify-explainer.mjs +357 -0
- package/plugin/skills/lit-crucible/SKILL.md +151 -0
- package/plugin/skills/lit-crucible/references/adversarial-workflow.md +134 -0
- package/plugin/skills/lit-crucible/references/lane-briefs.md +69 -0
- package/plugin/skills/lit-crucible/templates/crucible.md +37 -0
- package/plugin/skills/lit-diagram-drawer/NOTICE +33 -0
- package/plugin/skills/lit-diagram-drawer/SKILL.md +177 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-architecture-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-architecture-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-architecture-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-bar-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-bar-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-bar-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-beeswarm-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-beeswarm-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-beeswarm-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-bubble-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-bubble-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-bubble-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-bump-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-bump-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-bump-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-data-flow-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-data-flow-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-data-flow-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-datalake-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-datalake-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-datalake-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-db-schema-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-db-schema-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-db-schema-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-dependency-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-dependency-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-dependency-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-deployment-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-deployment-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-deployment-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-dp-integration-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-dp-integration-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-dp-integration-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-dp-security-matrix-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-dp-security-matrix-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-dp-security-matrix-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-er-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-er-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-er-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-fishbone-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-fishbone-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-fishbone-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-flowchart-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-flowchart-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-flowchart-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-gantt-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-gantt-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-gantt-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-heatmap-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-heatmap-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-heatmap-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-high-level-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-high-level-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-high-level-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-high-level-vertical-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-high-level-vertical-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-high-level-vertical-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-import-drawio-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-import-drawio-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-import-drawio-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-import-excalidraw-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-import-excalidraw-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-import-excalidraw-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-import-mermaid-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-import-mermaid-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-import-mermaid-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-it-state-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-it-state-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-it-state-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-journey-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-journey-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-journey-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-kanban-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-kanban-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-kanban-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-layers-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-layers-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-layers-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-line-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-line-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-line-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-loop-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-loop-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-loop-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-loop-terminal-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-loop-terminal-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-loop-terminal-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-marimekko-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-marimekko-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-marimekko-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-medallion-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-medallion-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-medallion-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-nested-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-nested-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-nested-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-org-chart-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-org-chart-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-org-chart-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-paved-road-animated-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-paved-road-animated-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-paved-road-animated-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-polar-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-polar-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-polar-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-policy-trace-animated-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-policy-trace-animated-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-policy-trace-animated-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-process-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-process-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-process-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-pyramid-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-pyramid-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-pyramid-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-quadrant-consultant-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-quadrant-consultant-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-quadrant-consultant-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-quadrant-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-quadrant-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-quadrant-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-queue-animated-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-queue-animated-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-queue-animated-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-radar-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-radar-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-radar-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-ridgeline-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-ridgeline-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-ridgeline-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-sankey-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-sankey-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-sankey-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-scatter-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-scatter-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-scatter-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-sequence-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-sequence-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-sequence-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-sequence-oauth-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-sequence-oauth-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-sequence-oauth-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-slopegraph-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-slopegraph-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-slopegraph-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-state-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-state-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-state-lifecycle-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-state-lifecycle-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-state-lifecycle-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-state-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-story-map-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-story-map-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-story-map-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-streamgraph-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-streamgraph-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-streamgraph-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-swimlane-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-swimlane-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-swimlane-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-timeline-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-timeline-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-timeline-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-tree-block-decomposition-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-tree-block-decomposition-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-tree-block-decomposition-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-tree-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-tree-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-tree-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-treemap-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-treemap-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-treemap-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-uml-class-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-uml-class-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-uml-class-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-venn-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-venn-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-venn-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-wardley-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-wardley-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-wardley-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-waterfall-dark.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-waterfall-full.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-waterfall-light.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/fonts/OFL.txt +94 -0
- package/plugin/skills/lit-diagram-drawer/assets/fonts/PretendardVariable.woff2 +0 -0
- package/plugin/skills/lit-diagram-drawer/assets/fonts/provenance.json +22 -0
- package/plugin/skills/lit-diagram-drawer/assets/icons.html +231 -0
- package/plugin/skills/lit-diagram-drawer/assets/index.html +1 -0
- package/plugin/skills/lit-diagram-drawer/assets/licenses/devicon-MIT.txt +20 -0
- package/plugin/skills/lit-diagram-drawer/assets/licenses/diagram-design-MIT.txt +21 -0
- package/plugin/skills/lit-diagram-drawer/assets/licenses/log-z-MIT.txt +21 -0
- package/plugin/skills/lit-diagram-drawer/assets/licenses/simple-icons-CC0.md +30 -0
- package/plugin/skills/lit-diagram-drawer/assets/licenses/tabler-MIT.txt +21 -0
- package/plugin/skills/lit-diagram-drawer/examples/01-service-architecture/after.html +1 -0
- package/plugin/skills/lit-diagram-drawer/examples/01-service-architecture/brief.md +33 -0
- package/plugin/skills/lit-diagram-drawer/examples/01-service-architecture/constructed-naive-foil.html +1 -0
- package/plugin/skills/lit-diagram-drawer/examples/02-release-decision/after.html +1 -0
- package/plugin/skills/lit-diagram-drawer/examples/02-release-decision/brief.md +18 -0
- package/plugin/skills/lit-diagram-drawer/examples/02-release-decision/constructed-naive-foil.html +1 -0
- package/plugin/skills/lit-diagram-drawer/examples/03-data-retention/after.html +1 -0
- package/plugin/skills/lit-diagram-drawer/examples/03-data-retention/brief.md +19 -0
- package/plugin/skills/lit-diagram-drawer/examples/03-data-retention/constructed-naive-foil.html +1 -0
- package/plugin/skills/lit-diagram-drawer/examples/04-oauth-sequence/after.html +1 -0
- package/plugin/skills/lit-diagram-drawer/examples/04-oauth-sequence/brief.md +17 -0
- package/plugin/skills/lit-diagram-drawer/examples/04-oauth-sequence/constructed-naive-foil.html +1 -0
- package/plugin/skills/lit-diagram-drawer/examples/05-review-lanes/after.html +1 -0
- package/plugin/skills/lit-diagram-drawer/examples/05-review-lanes/brief.md +17 -0
- package/plugin/skills/lit-diagram-drawer/examples/05-review-lanes/constructed-naive-foil.html +1 -0
- package/plugin/skills/lit-diagram-drawer/examples/06-rollout-gates/after.html +1 -0
- package/plugin/skills/lit-diagram-drawer/examples/06-rollout-gates/brief.md +17 -0
- package/plugin/skills/lit-diagram-drawer/examples/06-rollout-gates/constructed-naive-foil.html +1 -0
- package/plugin/skills/lit-diagram-drawer/examples/07-deployment-boundary/after.html +1 -0
- package/plugin/skills/lit-diagram-drawer/examples/07-deployment-boundary/brief.md +19 -0
- package/plugin/skills/lit-diagram-drawer/examples/07-deployment-boundary/constructed-naive-foil.html +1 -0
- package/plugin/skills/lit-diagram-drawer/examples/08-policy-traces/after.html +1 -0
- package/plugin/skills/lit-diagram-drawer/examples/08-policy-traces/brief.md +20 -0
- package/plugin/skills/lit-diagram-drawer/examples/08-policy-traces/constructed-naive-foil.html +1 -0
- package/plugin/skills/lit-diagram-drawer/references/accessibility.md +37 -0
- package/plugin/skills/lit-diagram-drawer/references/drawing-rules.md +86 -0
- package/plugin/skills/lit-diagram-drawer/references/export.md +34 -0
- package/plugin/skills/lit-diagram-drawer/references/failure-codes.md +66 -0
- package/plugin/skills/lit-diagram-drawer/references/import-drawio.md +21 -0
- package/plugin/skills/lit-diagram-drawer/references/import-excalidraw.md +14 -0
- package/plugin/skills/lit-diagram-drawer/references/import-mermaid.md +18 -0
- package/plugin/skills/lit-diagram-drawer/references/import-schema.md +28 -0
- package/plugin/skills/lit-diagram-drawer/references/korean-typography.md +34 -0
- package/plugin/skills/lit-diagram-drawer/references/motion.md +29 -0
- package/plugin/skills/lit-diagram-drawer/references/office-pptx-docx.md +42 -0
- package/plugin/skills/lit-diagram-drawer/references/output-spec.md +48 -0
- package/plugin/skills/lit-diagram-drawer/references/playbooks.md +67 -0
- package/plugin/skills/lit-diagram-drawer/references/primitive-annotation.md +12 -0
- package/plugin/skills/lit-diagram-drawer/references/primitive-icons.md +21 -0
- package/plugin/skills/lit-diagram-drawer/references/primitive-sketchy.md +11 -0
- package/plugin/skills/lit-diagram-drawer/references/primitive-terminal.md +11 -0
- package/plugin/skills/lit-diagram-drawer/references/profiles.md +24 -0
- package/plugin/skills/lit-diagram-drawer/references/semantic-patterns.md +27 -0
- package/plugin/skills/lit-diagram-drawer/references/style-guide.md +67 -0
- package/plugin/skills/lit-diagram-drawer/references/type-architecture.md +51 -0
- package/plugin/skills/lit-diagram-drawer/references/type-bar.md +51 -0
- package/plugin/skills/lit-diagram-drawer/references/type-beeswarm.md +49 -0
- package/plugin/skills/lit-diagram-drawer/references/type-bubble.md +49 -0
- package/plugin/skills/lit-diagram-drawer/references/type-bump.md +49 -0
- package/plugin/skills/lit-diagram-drawer/references/type-catalog.json +1433 -0
- package/plugin/skills/lit-diagram-drawer/references/type-data-flow.md +51 -0
- package/plugin/skills/lit-diagram-drawer/references/type-datalake.md +49 -0
- package/plugin/skills/lit-diagram-drawer/references/type-db-schema.md +49 -0
- package/plugin/skills/lit-diagram-drawer/references/type-dependency.md +49 -0
- package/plugin/skills/lit-diagram-drawer/references/type-deployment.md +49 -0
- package/plugin/skills/lit-diagram-drawer/references/type-dp-integration.md +49 -0
- package/plugin/skills/lit-diagram-drawer/references/type-dp-security-matrix.md +49 -0
- package/plugin/skills/lit-diagram-drawer/references/type-er.md +49 -0
- package/plugin/skills/lit-diagram-drawer/references/type-fishbone.md +49 -0
- package/plugin/skills/lit-diagram-drawer/references/type-flowchart.md +49 -0
- package/plugin/skills/lit-diagram-drawer/references/type-gantt.md +49 -0
- package/plugin/skills/lit-diagram-drawer/references/type-heatmap.md +53 -0
- package/plugin/skills/lit-diagram-drawer/references/type-high-level-vertical.md +53 -0
- package/plugin/skills/lit-diagram-drawer/references/type-high-level.md +53 -0
- package/plugin/skills/lit-diagram-drawer/references/type-import-drawio.md +53 -0
- package/plugin/skills/lit-diagram-drawer/references/type-import-excalidraw.md +53 -0
- package/plugin/skills/lit-diagram-drawer/references/type-import-mermaid.md +53 -0
- package/plugin/skills/lit-diagram-drawer/references/type-it-state.md +54 -0
- package/plugin/skills/lit-diagram-drawer/references/type-journey.md +54 -0
- package/plugin/skills/lit-diagram-drawer/references/type-kanban.md +54 -0
- package/plugin/skills/lit-diagram-drawer/references/type-layers.md +54 -0
- package/plugin/skills/lit-diagram-drawer/references/type-line.md +54 -0
- package/plugin/skills/lit-diagram-drawer/references/type-loop-terminal.md +53 -0
- package/plugin/skills/lit-diagram-drawer/references/type-loop.md +54 -0
- package/plugin/skills/lit-diagram-drawer/references/type-marimekko.md +54 -0
- package/plugin/skills/lit-diagram-drawer/references/type-medallion.md +54 -0
- package/plugin/skills/lit-diagram-drawer/references/type-nested.md +59 -0
- package/plugin/skills/lit-diagram-drawer/references/type-org-chart.md +58 -0
- package/plugin/skills/lit-diagram-drawer/references/type-paved-road-animated.md +72 -0
- package/plugin/skills/lit-diagram-drawer/references/type-polar.md +67 -0
- package/plugin/skills/lit-diagram-drawer/references/type-policy-trace-animated.md +69 -0
- package/plugin/skills/lit-diagram-drawer/references/type-process.md +58 -0
- package/plugin/skills/lit-diagram-drawer/references/type-pyramid.md +59 -0
- package/plugin/skills/lit-diagram-drawer/references/type-quadrant-consultant.md +60 -0
- package/plugin/skills/lit-diagram-drawer/references/type-quadrant.md +57 -0
- package/plugin/skills/lit-diagram-drawer/references/type-queue-animated.md +63 -0
- package/plugin/skills/lit-diagram-drawer/references/type-radar.md +57 -0
- package/plugin/skills/lit-diagram-drawer/references/type-ridgeline.md +63 -0
- package/plugin/skills/lit-diagram-drawer/references/type-sankey.md +68 -0
- package/plugin/skills/lit-diagram-drawer/references/type-scatter.md +60 -0
- package/plugin/skills/lit-diagram-drawer/references/type-sequence-oauth.md +66 -0
- package/plugin/skills/lit-diagram-drawer/references/type-sequence.md +63 -0
- package/plugin/skills/lit-diagram-drawer/references/type-slopegraph.md +65 -0
- package/plugin/skills/lit-diagram-drawer/references/type-state-lifecycle.md +53 -0
- package/plugin/skills/lit-diagram-drawer/references/type-state.md +59 -0
- package/plugin/skills/lit-diagram-drawer/references/type-story-map.md +52 -0
- package/plugin/skills/lit-diagram-drawer/references/type-streamgraph.md +53 -0
- package/plugin/skills/lit-diagram-drawer/references/type-swimlane.md +52 -0
- package/plugin/skills/lit-diagram-drawer/references/type-timeline.md +52 -0
- package/plugin/skills/lit-diagram-drawer/references/type-tree-block-decomposition.md +57 -0
- package/plugin/skills/lit-diagram-drawer/references/type-tree.md +54 -0
- package/plugin/skills/lit-diagram-drawer/references/type-treemap.md +54 -0
- package/plugin/skills/lit-diagram-drawer/references/type-uml-class.md +52 -0
- package/plugin/skills/lit-diagram-drawer/references/type-venn.md +51 -0
- package/plugin/skills/lit-diagram-drawer/references/type-wardley.md +52 -0
- package/plugin/skills/lit-diagram-drawer/references/type-waterfall.md +54 -0
- package/plugin/skills/lit-diagram-drawer/references/verifier-guide.md +76 -0
- package/plugin/skills/lit-diagram-drawer/scripts/block-registry.mjs +43 -0
- package/plugin/skills/lit-diagram-drawer/scripts/brief-contract.mjs +94 -0
- package/plugin/skills/lit-diagram-drawer/scripts/check-visible-text.mjs +15 -0
- package/plugin/skills/lit-diagram-drawer/scripts/diagram-craft-rules.mjs +14 -0
- package/plugin/skills/lit-diagram-drawer/scripts/diagram-metrics.mjs +219 -0
- package/plugin/skills/lit-diagram-drawer/scripts/diagram-runtime-lock/package.json +9 -0
- package/plugin/skills/lit-diagram-drawer/scripts/diagram-runtime.mjs +277 -0
- package/plugin/skills/lit-diagram-drawer/scripts/doctor.mjs +25 -0
- package/plugin/skills/lit-diagram-drawer/scripts/drawio-model.mjs +162 -0
- package/plugin/skills/lit-diagram-drawer/scripts/drawio-source.mjs +147 -0
- package/plugin/skills/lit-diagram-drawer/scripts/drawio-xml.mjs +148 -0
- package/plugin/skills/lit-diagram-drawer/scripts/export.mjs +119 -0
- package/plugin/skills/lit-diagram-drawer/scripts/import-common.mjs +85 -0
- package/plugin/skills/lit-diagram-drawer/scripts/import-drawio.mjs +48 -0
- package/plugin/skills/lit-diagram-drawer/scripts/import-excalidraw.mjs +234 -0
- package/plugin/skills/lit-diagram-drawer/scripts/import-mermaid.mjs +104 -0
- package/plugin/skills/lit-diagram-drawer/scripts/mermaid-common.mjs +115 -0
- package/plugin/skills/lit-diagram-drawer/scripts/mermaid-er.mjs +70 -0
- package/plugin/skills/lit-diagram-drawer/scripts/mermaid-flowchart.mjs +178 -0
- package/plugin/skills/lit-diagram-drawer/scripts/mermaid-sequence.mjs +137 -0
- package/plugin/skills/lit-diagram-drawer/scripts/mermaid-state.mjs +80 -0
- package/plugin/skills/lit-diagram-drawer/scripts/office-safety.mjs +54 -0
- package/plugin/skills/lit-diagram-drawer/scripts/runtime-probes.mjs +11 -0
- package/plugin/skills/lit-diagram-drawer/scripts/verify-all.mjs +85 -0
- package/plugin/skills/lit-diagram-drawer/scripts/verify-brief.mjs +16 -0
- package/plugin/skills/lit-diagram-drawer/scripts/verify-diagram.mjs +27 -0
- package/plugin/skills/lit-diagram-drawer/scripts/verify-motion.mjs +12 -0
- package/plugin/skills/lit-diagram-drawer/scripts/verify-type.mjs +48 -0
- package/plugin/skills/lit-diagram-drawer/scripts/visual-quality-geometry.mjs +226 -0
- package/plugin/skills/lit-diagram-drawer/scripts/visual-quality.mjs +147 -0
- package/plugin/skills/lit-docx/NOTICE +35 -0
- package/plugin/skills/lit-docx/SKILL.md +137 -0
- package/plugin/skills/lit-docx/references/build-loop.md +96 -0
- package/plugin/skills/lit-docx/references/components.md +287 -0
- package/plugin/skills/lit-docx/references/direction-step.md +339 -0
- package/plugin/skills/lit-docx/references/examples/01-report-ko.md +166 -0
- package/plugin/skills/lit-docx/references/examples/02-brief-ko.md +96 -0
- package/plugin/skills/lit-docx/references/examples/03-manual-ko.md +170 -0
- package/plugin/skills/lit-docx/references/examples/04-proposal-ko.md +141 -0
- package/plugin/skills/lit-docx/references/examples/05-memo-en.md +56 -0
- package/plugin/skills/lit-docx/references/examples/06-journal-en.md +129 -0
- package/plugin/skills/lit-docx/references/examples/07-report-en.md +123 -0
- package/plugin/skills/lit-docx/references/examples/08-proposal-en.md +122 -0
- package/plugin/skills/lit-docx/references/examples/09-memo-ko.md +40 -0
- package/plugin/skills/lit-docx/references/frontmatter_schema.md +94 -0
- package/plugin/skills/lit-docx/references/journal_style_spec.md +89 -0
- package/plugin/skills/lit-docx/references/markdown_quality_checklist.md +43 -0
- package/plugin/skills/lit-docx/references/page-composition.md +319 -0
- package/plugin/skills/lit-docx/references/slop_phrase_list.yaml +58 -0
- package/plugin/skills/lit-docx/references/slop_rules.md +88 -0
- package/plugin/skills/lit-docx/references/tonalities/brief.md +170 -0
- package/plugin/skills/lit-docx/references/tonalities/journal.md +173 -0
- package/plugin/skills/lit-docx/references/tonalities/manual.md +182 -0
- package/plugin/skills/lit-docx/references/tonalities/memo.md +171 -0
- package/plugin/skills/lit-docx/references/tonalities/proposal.md +181 -0
- package/plugin/skills/lit-docx/references/tonalities/report.md +199 -0
- package/plugin/skills/lit-docx/scripts/clean_markdown.py +95 -0
- package/plugin/skills/lit-docx/scripts/convert_md_to_docx.py +1395 -0
- package/plugin/skills/lit-docx/scripts/convert_md_to_pdf.py +301 -0
- package/plugin/skills/lit-docx/scripts/convert_pdf.py +139 -0
- package/plugin/skills/lit-docx/scripts/docx_design.py +2449 -0
- package/plugin/skills/lit-docx/scripts/docx_layout.py +959 -0
- package/plugin/skills/lit-docx/scripts/edit_docx.py +306 -0
- package/plugin/skills/lit-docx/scripts/embed_images.py +78 -0
- package/plugin/skills/lit-docx/scripts/generate_docx_templates.py +500 -0
- package/plugin/skills/lit-docx/scripts/pdf_fonts.py +83 -0
- package/plugin/skills/lit-docx/scripts/qa_docx.py +234 -0
- package/plugin/skills/lit-docx/scripts/slop_lint.py +573 -0
- package/plugin/skills/lit-docx/scripts/visual_audit.py +48 -0
- package/plugin/skills/lit-docx/templates/docx/acs.docx +0 -0
- package/plugin/skills/lit-docx/templates/docx/elsevier.docx +0 -0
- package/plugin/skills/lit-docx/templates/docx/ieee.docx +0 -0
- package/plugin/skills/lit-docx/templates/docx/korean-generic.docx +0 -0
- package/plugin/skills/lit-docx/templates/docx/nature.docx +0 -0
- package/plugin/skills/lit-docx/templates/latex/acs/README.md +5 -0
- package/plugin/skills/lit-docx/templates/latex/acs/template.tex +41 -0
- package/plugin/skills/lit-docx/templates/latex/elsevier/README.md +5 -0
- package/plugin/skills/lit-docx/templates/latex/elsevier/template.tex +42 -0
- package/plugin/skills/lit-docx/templates/latex/ieee/README.md +5 -0
- package/plugin/skills/lit-docx/templates/latex/ieee/template.tex +41 -0
- package/plugin/skills/lit-docx/templates/latex/korean-generic/README.md +5 -0
- package/plugin/skills/lit-docx/templates/latex/korean-generic/template.tex +41 -0
- package/plugin/skills/lit-docx/templates/latex/nature/README.md +5 -0
- package/plugin/skills/lit-docx/templates/latex/nature/template.tex +41 -0
- package/plugin/skills/lit-docx/templates/registry.yaml +1366 -0
- package/plugin/skills/lit-docx/templates/tonalities/brief.yaml +28 -0
- package/plugin/skills/lit-docx/templates/tonalities/journal.yaml +25 -0
- package/plugin/skills/lit-docx/templates/tonalities/manual.yaml +26 -0
- package/plugin/skills/lit-docx/templates/tonalities/memo.yaml +26 -0
- package/plugin/skills/lit-docx/templates/tonalities/proposal.yaml +26 -0
- package/plugin/skills/lit-docx/templates/tonalities/report.yaml +26 -0
- package/plugin/skills/lit-handoff/LICENSE +21 -0
- package/plugin/skills/lit-handoff/SKILL.md +176 -0
- package/plugin/skills/lit-handoff/evals/evals.json +244 -0
- package/plugin/skills/lit-handoff/examples/HANDOFF-example-generic-auth-refactor.md +97 -0
- package/plugin/skills/lit-handoff/reference/PROVENANCE.md +17 -0
- package/plugin/skills/lit-handoff/reference/canonical-handoff.md +199 -0
- package/plugin/skills/lit-handoff/scripts/verify-closure.mjs +50 -0
- package/plugin/skills/lit-handoff/templates/HANDOFF.md +121 -0
- package/plugin/skills/lit-humanizer/NOTICE +160 -0
- package/plugin/skills/lit-humanizer/SKILL.md +226 -0
- package/plugin/skills/lit-humanizer/assets/always-on-rule.md +11 -0
- package/plugin/skills/lit-humanizer/assets/report-skeleton.md +29 -0
- package/plugin/skills/lit-humanizer/assets/slide-text-skeleton.md +28 -0
- package/plugin/skills/lit-humanizer/bench/prompts.md +81 -0
- package/plugin/skills/lit-humanizer/examples/accessibility-note/after.md +7 -0
- package/plugin/skills/lit-humanizer/examples/accessibility-note/before.md +9 -0
- package/plugin/skills/lit-humanizer/examples/api-reference/after.md +10 -0
- package/plugin/skills/lit-humanizer/examples/api-reference/before.md +14 -0
- package/plugin/skills/lit-humanizer/examples/changelog/after.md +8 -0
- package/plugin/skills/lit-humanizer/examples/changelog/before.md +12 -0
- package/plugin/skills/lit-humanizer/examples/code-comments/after.md +11 -0
- package/plugin/skills/lit-humanizer/examples/code-comments/before.md +19 -0
- package/plugin/skills/lit-humanizer/examples/commit/after.md +7 -0
- package/plugin/skills/lit-humanizer/examples/commit/before.md +5 -0
- package/plugin/skills/lit-humanizer/examples/data-release/after.md +9 -0
- package/plugin/skills/lit-humanizer/examples/data-release/before.md +11 -0
- package/plugin/skills/lit-humanizer/examples/english-essay/after.md +5 -0
- package/plugin/skills/lit-humanizer/examples/english-essay/before.md +9 -0
- package/plugin/skills/lit-humanizer/examples/incident-update/after.md +9 -0
- package/plugin/skills/lit-humanizer/examples/incident-update/before.md +9 -0
- package/plugin/skills/lit-humanizer/examples/ko-essay/after.md +5 -0
- package/plugin/skills/lit-humanizer/examples/ko-essay/before.md +11 -0
- package/plugin/skills/lit-humanizer/examples/ko-report/after.md +9 -0
- package/plugin/skills/lit-humanizer/examples/ko-report/before.md +19 -0
- package/plugin/skills/lit-humanizer/examples/ko-slide/after.md +21 -0
- package/plugin/skills/lit-humanizer/examples/ko-slide/before.md +23 -0
- package/plugin/skills/lit-humanizer/examples/meeting-brief/after.md +9 -0
- package/plugin/skills/lit-humanizer/examples/meeting-brief/before.md +11 -0
- package/plugin/skills/lit-humanizer/examples/policy-faq/after.md +16 -0
- package/plugin/skills/lit-humanizer/examples/policy-faq/before.md +16 -0
- package/plugin/skills/lit-humanizer/examples/pr/after.md +17 -0
- package/plugin/skills/lit-humanizer/examples/pr/before.md +19 -0
- package/plugin/skills/lit-humanizer/examples/project-update/after.md +10 -0
- package/plugin/skills/lit-humanizer/examples/project-update/before.md +9 -0
- package/plugin/skills/lit-humanizer/examples/readme/after.md +19 -0
- package/plugin/skills/lit-humanizer/examples/readme/before.md +23 -0
- package/plugin/skills/lit-humanizer/examples/report/after.md +9 -0
- package/plugin/skills/lit-humanizer/examples/report/before.md +19 -0
- package/plugin/skills/lit-humanizer/examples/research-abstract/after.md +1 -0
- package/plugin/skills/lit-humanizer/examples/research-abstract/before.md +7 -0
- package/plugin/skills/lit-humanizer/examples/slides/after.md +16 -0
- package/plugin/skills/lit-humanizer/examples/slides/before.md +19 -0
- package/plugin/skills/lit-humanizer/examples/troubleshooting/after.md +13 -0
- package/plugin/skills/lit-humanizer/examples/troubleshooting/before.md +13 -0
- package/plugin/skills/lit-humanizer/fixtures/ko-metrics-golden.json +51 -0
- package/plugin/skills/lit-humanizer/fixtures/office/minimal.docx +0 -0
- package/plugin/skills/lit-humanizer/fixtures/office/minimal.pptx +0 -0
- package/plugin/skills/lit-humanizer/fixtures/pledge-cases.json +1341 -0
- package/plugin/skills/lit-humanizer/fixtures/pos-real.txt +26 -0
- package/plugin/skills/lit-humanizer/fixtures/rule-cases.json +312 -0
- package/plugin/skills/lit-humanizer/motion-guide.md +125 -0
- package/plugin/skills/lit-humanizer/references/code-patterns.md +324 -0
- package/plugin/skills/lit-humanizer/references/deliverable-channels.md +123 -0
- package/plugin/skills/lit-humanizer/references/en-patterns-checklist.md +44 -0
- package/plugin/skills/lit-humanizer/references/en-patterns-content.md +245 -0
- package/plugin/skills/lit-humanizer/references/en-patterns-structure.md +389 -0
- package/plugin/skills/lit-humanizer/references/en-patterns.md +58 -0
- package/plugin/skills/lit-humanizer/references/ko-metrics.md +39 -0
- package/plugin/skills/lit-humanizer/references/ko-patterns-a-d.md +667 -0
- package/plugin/skills/lit-humanizer/references/ko-patterns-e-j.md +391 -0
- package/plugin/skills/lit-humanizer/references/ko-patterns.md +40 -0
- package/plugin/skills/lit-humanizer/references/litgravity-fidelity-checklist.md +83 -0
- package/plugin/skills/lit-humanizer/references/litgravity-rewrite-rules.md +74 -0
- package/plugin/skills/lit-humanizer/references/litgravity-style-patterns.md +57 -0
- package/plugin/skills/lit-humanizer/references/prompt-injection-handling.md +29 -0
- package/plugin/skills/lit-humanizer/references/rewrite-playbook.md +67 -0
- package/plugin/skills/lit-humanizer/references/taxonomy.md +190 -0
- package/plugin/skills/lit-humanizer/rules.json +938 -0
- package/plugin/skills/lit-humanizer/scripts/artifact-text.mjs +41 -0
- package/plugin/skills/lit-humanizer/scripts/core.mjs +313 -0
- package/plugin/skills/lit-humanizer/scripts/detect.mjs +79 -0
- package/plugin/skills/lit-humanizer/scripts/extract_office_text.py +109 -0
- package/plugin/skills/lit-humanizer/scripts/ko-metrics.mjs +147 -0
- package/plugin/skills/lit-humanizer/scripts/scan-input.mjs +57 -0
- package/plugin/skills/lit-humanizer/scripts/test-fixtures.mjs +217 -0
- package/plugin/skills/lit-humanizer/scripts/test-ko-metrics.mjs +28 -0
- package/plugin/skills/lit-init/SKILL.md +189 -0
- package/plugin/skills/lit-init/references/deep-repository-map.md +95 -0
- package/plugin/skills/lit-init/templates/agents-child.md +20 -0
- package/plugin/skills/lit-init/templates/agents-root.md +35 -0
- package/plugin/skills/lit-loop/SKILL.md +217 -0
- package/plugin/skills/lit-loop/references/adversarial-classes.md +27 -0
- package/plugin/skills/lit-loop/references/ledger-and-records.md +47 -0
- package/plugin/skills/lit-plan/SKILL.md +220 -0
- package/plugin/skills/lit-plan/references/agy-surfaces.md +29 -0
- package/plugin/skills/lit-plan/references/intent-routes.md +118 -0
- package/plugin/skills/lit-plan/references/plan-contract.md +112 -0
- package/plugin/skills/lit-plan/references/review-gates.md +51 -0
- package/plugin/skills/lit-plan/references/risk-and-recovery.md +56 -0
- package/plugin/skills/lit-plan/references/start-work-handoff-contract.md +66 -0
- package/plugin/skills/lit-plan/scripts/check-plan.mjs +163 -0
- package/plugin/skills/lit-plan/templates/draft.md +41 -0
- package/plugin/skills/lit-plan/templates/plan.md +101 -0
- package/plugin/skills/lit-pptx/NOTICE +35 -0
- package/plugin/skills/lit-pptx/SKILL.md +147 -0
- package/plugin/skills/lit-pptx/assets/azure/circle-lg.png +0 -0
- package/plugin/skills/lit-pptx/assets/azure/circle-md.png +0 -0
- package/plugin/skills/lit-pptx/assets/azure/circle-sm.png +0 -0
- package/plugin/skills/lit-pptx/assets/example-a.png +0 -0
- package/plugin/skills/lit-pptx/assets/example-b.png +0 -0
- package/plugin/skills/lit-pptx/assets/example-c.png +0 -0
- package/plugin/skills/lit-pptx/fonts/a2z/A2Z-Black.otf +0 -0
- package/plugin/skills/lit-pptx/fonts/a2z/A2Z-Bold.otf +0 -0
- package/plugin/skills/lit-pptx/fonts/a2z/A2Z-Light.otf +0 -0
- package/plugin/skills/lit-pptx/fonts/a2z/A2Z-Medium.otf +0 -0
- package/plugin/skills/lit-pptx/fonts/a2z/A2Z-Regular.otf +0 -0
- package/plugin/skills/lit-pptx/fonts/a2z/OFL.txt +94 -0
- package/plugin/skills/lit-pptx/fonts/a2z/SOURCE.md +29 -0
- package/plugin/skills/lit-pptx/fonts/pretendard/OFL.txt +94 -0
- package/plugin/skills/lit-pptx/fonts/pretendard/Pretendard-Bold.otf +0 -0
- package/plugin/skills/lit-pptx/fonts/pretendard/Pretendard-Regular.otf +0 -0
- package/plugin/skills/lit-pptx/fonts/provenance.json +78 -0
- package/plugin/skills/lit-pptx/references/agents/analyst.md +71 -0
- package/plugin/skills/lit-pptx/references/agents/antithesis.md +77 -0
- package/plugin/skills/lit-pptx/references/agents/architect.md +57 -0
- package/plugin/skills/lit-pptx/references/agents/critic.md +58 -0
- package/plugin/skills/lit-pptx/references/agents/synthesizer.md +56 -0
- package/plugin/skills/lit-pptx/references/agents/thesis.md +53 -0
- package/plugin/skills/lit-pptx/references/anti-slop-checklist.md +157 -0
- package/plugin/skills/lit-pptx/references/authoring-guide.md +341 -0
- package/plugin/skills/lit-pptx/references/build-loop.md +117 -0
- package/plugin/skills/lit-pptx/references/consensus-protocol.md +123 -0
- package/plugin/skills/lit-pptx/references/data-display-cookbook.md +153 -0
- package/plugin/skills/lit-pptx/references/density-and-fill.md +232 -0
- package/plugin/skills/lit-pptx/references/design-system-azure.md +90 -0
- package/plugin/skills/lit-pptx/references/direction-step.md +245 -0
- package/plugin/skills/lit-pptx/references/examples/01-pitch-signal-ko.md +211 -0
- package/plugin/skills/lit-pptx/references/examples/02-pitch-studio-ko.md +147 -0
- package/plugin/skills/lit-pptx/references/examples/03-business-review-ledger-ko.md +199 -0
- package/plugin/skills/lit-pptx/references/examples/04-business-review-night-en.md +203 -0
- package/plugin/skills/lit-pptx/references/examples/05-research-talk-paper-en.md +178 -0
- package/plugin/skills/lit-pptx/references/examples/06-lecture-chalk-ko.md +199 -0
- package/plugin/skills/lit-pptx/references/examples/07-data-review-night-en.md +192 -0
- package/plugin/skills/lit-pptx/references/examples/08-image-led-atlas-ko.md +175 -0
- package/plugin/skills/lit-pptx/references/examples/09-briefing-gazette-ko.md +204 -0
- package/plugin/skills/lit-pptx/references/examples/10-status-update-ledger-ko.md +179 -0
- package/plugin/skills/lit-pptx/references/examples/11-portfolio-studio-en.md +164 -0
- package/plugin/skills/lit-pptx/references/examples/12-research-tutorial-chalk-en.md +174 -0
- package/plugin/skills/lit-pptx/references/interview-protocol.md +132 -0
- package/plugin/skills/lit-pptx/references/layout-families.md +298 -0
- package/plugin/skills/lit-pptx/references/stages/autopilot.md +88 -0
- package/plugin/skills/lit-pptx/references/stages/interview.md +84 -0
- package/plugin/skills/lit-pptx/references/stages/plan.md +83 -0
- package/plugin/skills/lit-pptx/references/title-treatments.md +165 -0
- package/plugin/skills/lit-pptx/references/tonalities/atlas.md +152 -0
- package/plugin/skills/lit-pptx/references/tonalities/chalk.md +163 -0
- package/plugin/skills/lit-pptx/references/tonalities/gazette.md +173 -0
- package/plugin/skills/lit-pptx/references/tonalities/ledger.md +178 -0
- package/plugin/skills/lit-pptx/references/tonalities/night.md +174 -0
- package/plugin/skills/lit-pptx/references/tonalities/paper.md +167 -0
- package/plugin/skills/lit-pptx/references/tonalities/signal.md +157 -0
- package/plugin/skills/lit-pptx/references/tonalities/studio.md +162 -0
- package/plugin/skills/lit-pptx/scripts/compile-deck.js +464 -0
- package/plugin/skills/lit-pptx/scripts/craft_extras.py +1033 -0
- package/plugin/skills/lit-pptx/scripts/deck_craft.py +363 -0
- package/plugin/skills/lit-pptx/scripts/embed_fonts.py +215 -0
- package/plugin/skills/lit-pptx/scripts/forbidden-terms.json +55 -0
- package/plugin/skills/lit-pptx/scripts/layout_inventory.py +418 -0
- package/plugin/skills/lit-pptx/scripts/learn_template.py +446 -0
- package/plugin/skills/lit-pptx/scripts/lib/derive-palette.js +176 -0
- package/plugin/skills/lit-pptx/scripts/lib/directive-parser.js +244 -0
- package/plugin/skills/lit-pptx/scripts/lib/font-map.js +79 -0
- package/plugin/skills/lit-pptx/scripts/lib/gen-bg.js +86 -0
- package/plugin/skills/lit-pptx/scripts/lib/gen-gradient-assets.js +37 -0
- package/plugin/skills/lit-pptx/scripts/lib/grid-resolver.js +521 -0
- package/plugin/skills/lit-pptx/scripts/lib/layout-resolver.js +1119 -0
- package/plugin/skills/lit-pptx/scripts/lib/markdown-loader.js +138 -0
- package/plugin/skills/lit-pptx/scripts/lib/render-adapter-html.js +356 -0
- package/plugin/skills/lit-pptx/scripts/lib/render-adapter-pptx.js +2240 -0
- package/plugin/skills/lit-pptx/scripts/lib/render-pack.js +3559 -0
- package/plugin/skills/lit-pptx/scripts/lib/runtime-require.js +28 -0
- package/plugin/skills/lit-pptx/scripts/lib/slide-ast.js +565 -0
- package/plugin/skills/lit-pptx/scripts/lib/spec-validator.js +94 -0
- package/plugin/skills/lit-pptx/scripts/lib/template-registry.js +679 -0
- package/plugin/skills/lit-pptx/scripts/office-runtime-lock/package-lock.json +793 -0
- package/plugin/skills/lit-pptx/scripts/office-runtime-lock/package.json +12 -0
- package/plugin/skills/lit-pptx/scripts/office-runtime-lock/requirements.lock +15 -0
- package/plugin/skills/lit-pptx/scripts/office-runtime.mjs +279 -0
- package/plugin/skills/lit-pptx/scripts/office_data.py +493 -0
- package/plugin/skills/lit-pptx/scripts/office_runtime_bootstrap.py +73 -0
- package/plugin/skills/lit-pptx/scripts/ooxml_integrity.py +199 -0
- package/plugin/skills/lit-pptx/scripts/package.json +4 -0
- package/plugin/skills/lit-pptx/scripts/qa_deck.py +795 -0
- package/plugin/skills/lit-pptx/scripts/render_pages.py +116 -0
- package/plugin/skills/lit-pptx/scripts/validate_pptx.py +230 -0
- package/plugin/skills/lit-pptx/specs/markdown-slide-spec-v1.md +275 -0
- package/plugin/skills/lit-pptx/specs/markdown-slide-spec-v2.md +263 -0
- package/plugin/skills/lit-pptx/specs/slide-ast-v1.schema.json +229 -0
- package/plugin/skills/lit-pptx/specs/slide-ast-v2.schema.json +144 -0
- package/plugin/skills/lit-pptx/specs/template-enrollment-contract.md +405 -0
- package/plugin/skills/lit-pptx/templates/enrolled/AZURE-A2Z/capabilities.yaml +146 -0
- package/plugin/skills/lit-pptx/templates/enrolled/AZURE-A2Z/layout-mapping.yaml +454 -0
- package/plugin/skills/lit-pptx/templates/enrolled/AZURE-A2Z/template.yaml +40 -0
- package/plugin/skills/lit-pptx/templates/enrolled/AZURE-PRO/capabilities.yaml +154 -0
- package/plugin/skills/lit-pptx/templates/enrolled/AZURE-PRO/layout-mapping.yaml +475 -0
- package/plugin/skills/lit-pptx/templates/enrolled/AZURE-PRO/template.yaml +40 -0
- package/plugin/skills/lit-pptx/templates/enrolled/BOILERPLATE-A2Z/capabilities.yaml +179 -0
- package/plugin/skills/lit-pptx/templates/enrolled/BOILERPLATE-A2Z/layout-mapping.yaml +299 -0
- package/plugin/skills/lit-pptx/templates/enrolled/BOILERPLATE-A2Z/template.yaml +45 -0
- package/plugin/skills/lit-pptx/templates/enrolled/BOILERPLATE-PRETENDARD/capabilities.yaml +181 -0
- package/plugin/skills/lit-pptx/templates/enrolled/BOILERPLATE-PRETENDARD/layout-mapping.yaml +299 -0
- package/plugin/skills/lit-pptx/templates/enrolled/BOILERPLATE-PRETENDARD/template.yaml +44 -0
- package/plugin/skills/lit-pptx/templates/tonalities/atlas/pack.yaml +92 -0
- package/plugin/skills/lit-pptx/templates/tonalities/chalk/pack.yaml +97 -0
- package/plugin/skills/lit-pptx/templates/tonalities/gazette/pack.yaml +93 -0
- package/plugin/skills/lit-pptx/templates/tonalities/ledger/pack.yaml +94 -0
- package/plugin/skills/lit-pptx/templates/tonalities/night/pack.yaml +93 -0
- package/plugin/skills/lit-pptx/templates/tonalities/paper/pack.yaml +98 -0
- package/plugin/skills/lit-pptx/templates/tonalities/signal/pack.yaml +94 -0
- package/plugin/skills/lit-pptx/templates/tonalities/studio/pack.yaml +92 -0
- package/plugin/skills/lit-recap/SKILL.md +168 -0
- package/plugin/skills/lit-recap/references/recap-shapes.md +166 -0
- package/plugin/skills/lit-recap/references/source-reading.md +105 -0
- package/plugin/skills/lit-recap/references/stale-state-checks.md +74 -0
- package/plugin/skills/lit-scientific-visualization/LICENSE +21 -0
- package/plugin/skills/lit-scientific-visualization/SKILL.md +165 -0
- package/plugin/skills/lit-scientific-visualization/assets/color_palettes.py +197 -0
- package/plugin/skills/lit-scientific-visualization/assets/nature.mplstyle +75 -0
- package/plugin/skills/lit-scientific-visualization/assets/presentation.mplstyle +74 -0
- package/plugin/skills/lit-scientific-visualization/assets/publication.mplstyle +78 -0
- package/plugin/skills/lit-scientific-visualization/evals/evals.json +158 -0
- package/plugin/skills/lit-scientific-visualization/references/canonical-workflow.md +278 -0
- package/plugin/skills/lit-scientific-visualization/references/color_palettes.md +380 -0
- package/plugin/skills/lit-scientific-visualization/references/journal_requirements.md +359 -0
- package/plugin/skills/lit-scientific-visualization/references/matplotlib_examples.md +608 -0
- package/plugin/skills/lit-scientific-visualization/references/mdanalysis_martini_visualization.md +85 -0
- package/plugin/skills/lit-scientific-visualization/references/publication_guidelines.md +217 -0
- package/plugin/skills/lit-scientific-visualization/references/seaborn_for_publications.md +293 -0
- package/plugin/skills/lit-scientific-visualization/scripts/figure_export.py +238 -0
- package/plugin/skills/lit-scientific-visualization/scripts/sciviz-runtime-requirements.lock +23 -0
- package/plugin/skills/lit-scientific-visualization/scripts/sciviz-runtime.mjs +230 -0
- package/plugin/skills/lit-scientific-visualization/scripts/style_presets.py +467 -0
- package/plugin/skills/lit-scientific-visualization/tests/test_figure_export.py +51 -0
- package/plugin/skills/lit-scientific-visualization/tests/test_style_presets.py +114 -0
- package/plugin/skills/lit-team/SKILL.md +118 -0
- package/plugin/skills/lit-team/references/member-briefs.md +67 -0
- package/plugin/skills/lit-team/references/team-orchestration.md +129 -0
- package/plugin/skills/lit-team/scripts/owner-lock.mjs +330 -0
- package/plugin/skills/lit-team/scripts/secure-path.mjs +24 -0
- package/plugin/skills/lit-team/scripts/state-root.mjs +55 -0
- package/plugin/skills/lit-team/scripts/team.mjs +629 -0
- package/plugin/skills/lit-typographic-motion/SKILL.md +196 -0
- package/plugin/skills/lit-typographic-motion/engine/NOTICE +23 -0
- package/plugin/skills/lit-typographic-motion/engine/THIRD_PARTY_NOTICES +62 -0
- package/plugin/skills/lit-typographic-motion/engine/audio/beat_grid.py +56 -0
- package/plugin/skills/lit-typographic-motion/engine/audio/requirements.lock +1084 -0
- package/plugin/skills/lit-typographic-motion/engine/core/constants.mjs +246 -0
- package/plugin/skills/lit-typographic-motion/engine/core/contrast.mjs +90 -0
- package/plugin/skills/lit-typographic-motion/engine/core/events.mjs +46 -0
- package/plugin/skills/lit-typographic-motion/engine/core/flash.mjs +211 -0
- package/plugin/skills/lit-typographic-motion/engine/core/gate-rules.mjs +550 -0
- package/plugin/skills/lit-typographic-motion/engine/core/presets.mjs +123 -0
- package/plugin/skills/lit-typographic-motion/engine/core/text.mjs +100 -0
- package/plugin/skills/lit-typographic-motion/engine/core/timeline.mjs +142 -0
- package/plugin/skills/lit-typographic-motion/engine/core/util.mjs +167 -0
- package/plugin/skills/lit-typographic-motion/engine/core/voices.mjs +19 -0
- package/plugin/skills/lit-typographic-motion/engine/models/word-timing.json +198 -0
- package/plugin/skills/lit-typographic-motion/engine/node/analysis.mjs +108 -0
- package/plugin/skills/lit-typographic-motion/engine/node/brief.mjs +158 -0
- package/plugin/skills/lit-typographic-motion/engine/node/chrome.mjs +331 -0
- package/plugin/skills/lit-typographic-motion/engine/node/cover-assets.mjs +102 -0
- package/plugin/skills/lit-typographic-motion/engine/node/cover-capture.mjs +209 -0
- package/plugin/skills/lit-typographic-motion/engine/node/cover-gate.mjs +347 -0
- package/plugin/skills/lit-typographic-motion/engine/node/cover-image.mjs +141 -0
- package/plugin/skills/lit-typographic-motion/engine/node/cover-sheet.mjs +76 -0
- package/plugin/skills/lit-typographic-motion/engine/node/cover-treatment.mjs +106 -0
- package/plugin/skills/lit-typographic-motion/engine/node/cover-worker.mjs +32 -0
- package/plugin/skills/lit-typographic-motion/engine/node/cover.mjs +374 -0
- package/plugin/skills/lit-typographic-motion/engine/node/coverage.mjs +83 -0
- package/plugin/skills/lit-typographic-motion/engine/node/done.mjs +170 -0
- package/plugin/skills/lit-typographic-motion/engine/node/encode.mjs +105 -0
- package/plugin/skills/lit-typographic-motion/engine/node/frame-worker.mjs +36 -0
- package/plugin/skills/lit-typographic-motion/engine/node/look.mjs +164 -0
- package/plugin/skills/lit-typographic-motion/engine/node/pipeline.mjs +593 -0
- package/plugin/skills/lit-typographic-motion/engine/node/png.mjs +112 -0
- package/plugin/skills/lit-typographic-motion/engine/node/report.mjs +66 -0
- package/plugin/skills/lit-typographic-motion/engine/node/runtime.mjs +349 -0
- package/plugin/skills/lit-typographic-motion/engine/node/session.mjs +145 -0
- package/plugin/skills/lit-typographic-motion/engine/node/sound-cli.mjs +60 -0
- package/plugin/skills/lit-typographic-motion/engine/node/sound.mjs +642 -0
- package/plugin/skills/lit-typographic-motion/engine/node/stage-capture.mjs +179 -0
- package/plugin/skills/lit-typographic-motion/engine/node/stage-gate.mjs +122 -0
- package/plugin/skills/lit-typographic-motion/engine/node/stage-qa.mjs +295 -0
- package/plugin/skills/lit-typographic-motion/engine/node/stage-serve.mjs +283 -0
- package/plugin/skills/lit-typographic-motion/engine/node/stage.mjs +503 -0
- package/plugin/skills/lit-typographic-motion/engine/node/stills.mjs +100 -0
- package/plugin/skills/lit-typographic-motion/engine/node/treatment.mjs +344 -0
- package/plugin/skills/lit-typographic-motion/engine/node/webp.mjs +146 -0
- package/plugin/skills/lit-typographic-motion/engine/node/ws-server.mjs +132 -0
- package/plugin/skills/lit-typographic-motion/engine/package-lock.json +25 -0
- package/plugin/skills/lit-typographic-motion/engine/package.json +10 -0
- package/plugin/skills/lit-typographic-motion/engine/stage/cover-init.js +37 -0
- package/plugin/skills/lit-typographic-motion/engine/stage/init.js +288 -0
- package/plugin/skills/lit-typographic-motion/engine/stage/loop-kit.js +106 -0
- package/plugin/skills/lit-typographic-motion/engine/stage/qa.js +157 -0
- package/plugin/skills/lit-typographic-motion/engine/stage/stage-kit.js +701 -0
- package/plugin/skills/lit-typographic-motion/engine/web/boot.mjs +123 -0
- package/plugin/skills/lit-typographic-motion/engine/web/engine.mjs +281 -0
- package/plugin/skills/lit-typographic-motion/engine/web/gl.mjs +319 -0
- package/plugin/skills/lit-typographic-motion/engine/web/glsl-common.mjs +78 -0
- package/plugin/skills/lit-typographic-motion/engine/web/index.html +6 -0
- package/plugin/skills/lit-typographic-motion/engine/web/lines.mjs +112 -0
- package/plugin/skills/lit-typographic-motion/engine/web/passes/crt.mjs +98 -0
- package/plugin/skills/lit-typographic-motion/engine/web/passes/dither.mjs +49 -0
- package/plugin/skills/lit-typographic-motion/engine/web/passes/glitch.mjs +77 -0
- package/plugin/skills/lit-typographic-motion/engine/web/passes/swiss-grid.mjs +61 -0
- package/plugin/skills/lit-typographic-motion/engine/web/passes/terminal-ui.mjs +88 -0
- package/plugin/skills/lit-typographic-motion/engine/web/passes/tidal-gradient.mjs +86 -0
- package/plugin/skills/lit-typographic-motion/engine/web/post.mjs +165 -0
- package/plugin/skills/lit-typographic-motion/engine/web/scale.mjs +15 -0
- package/plugin/skills/lit-typographic-motion/engine/web/scene.mjs +82 -0
- package/plugin/skills/lit-typographic-motion/engine/web/scenes/end-card.mjs +30 -0
- package/plugin/skills/lit-typographic-motion/engine/web/scenes/index.mjs +16 -0
- package/plugin/skills/lit-typographic-motion/engine/web/scenes/karaoke-line.mjs +47 -0
- package/plugin/skills/lit-typographic-motion/engine/web/scenes/kinetic-list.mjs +45 -0
- package/plugin/skills/lit-typographic-motion/engine/web/scenes/number-counter.mjs +29 -0
- package/plugin/skills/lit-typographic-motion/engine/web/scenes/signature.mjs +73 -0
- package/plugin/skills/lit-typographic-motion/engine/web/scenes/title-slam.mjs +73 -0
- package/plugin/skills/lit-typographic-motion/engine/web/stroke.mjs +236 -0
- package/plugin/skills/lit-typographic-motion/engine/web/type.mjs +180 -0
- package/plugin/skills/lit-typographic-motion/fonts/archivo/Archivo-w100-400.ttf +0 -0
- package/plugin/skills/lit-typographic-motion/fonts/archivo/Archivo-w100-700.ttf +0 -0
- package/plugin/skills/lit-typographic-motion/fonts/archivo/Archivo-w100-900.ttf +0 -0
- package/plugin/skills/lit-typographic-motion/fonts/archivo/Archivo-w125-400.ttf +0 -0
- package/plugin/skills/lit-typographic-motion/fonts/archivo/Archivo-w125-700.ttf +0 -0
- package/plugin/skills/lit-typographic-motion/fonts/archivo/Archivo-w125-900.ttf +0 -0
- package/plugin/skills/lit-typographic-motion/fonts/archivo/Archivo-w75-400.ttf +0 -0
- package/plugin/skills/lit-typographic-motion/fonts/archivo/Archivo-w75-700.ttf +0 -0
- package/plugin/skills/lit-typographic-motion/fonts/archivo/Archivo-w75-900.ttf +0 -0
- package/plugin/skills/lit-typographic-motion/fonts/archivo/OFL.txt +93 -0
- package/plugin/skills/lit-typographic-motion/fonts/jetbrains-mono/JetBrainsMono-wght-latin.woff2 +0 -0
- package/plugin/skills/lit-typographic-motion/fonts/jetbrains-mono/OFL.txt +93 -0
- package/plugin/skills/lit-typographic-motion/fonts/manifest.json +455 -0
- package/plugin/skills/lit-typographic-motion/fonts/silkscreen/OFL.txt +93 -0
- package/plugin/skills/lit-typographic-motion/fonts/silkscreen/Silkscreen-Bold.ttf +0 -0
- package/plugin/skills/lit-typographic-motion/fonts/silkscreen/Silkscreen-Regular.ttf +0 -0
- package/plugin/skills/lit-typographic-motion/fonts/stroke/CREDITS +42 -0
- package/plugin/skills/lit-typographic-motion/fonts/stroke/EMSAllure.svg +216 -0
- package/plugin/skills/lit-typographic-motion/fonts/stroke/EMSFelix.svg +216 -0
- package/plugin/skills/lit-typographic-motion/fonts/stroke/EMSOsmotron.svg +216 -0
- package/plugin/skills/lit-typographic-motion/fonts/stroke/EMSReadability.svg +216 -0
- package/plugin/skills/lit-typographic-motion/fonts/stroke/EMSTech.svg +217 -0
- package/plugin/skills/lit-typographic-motion/fonts/stroke/OFL.txt +91 -0
- package/plugin/skills/lit-typographic-motion/fonts/vt323/OFL.txt +93 -0
- package/plugin/skills/lit-typographic-motion/fonts/vt323/VT323-Regular.ttf +0 -0
- package/plugin/skills/lit-typographic-motion/recipes/negatives/card-scenes/expected.json +16 -0
- package/plugin/skills/lit-typographic-motion/recipes/negatives/card-scenes/index.html +27 -0
- package/plugin/skills/lit-typographic-motion/recipes/negatives/reset-sweep/expected.json +16 -0
- package/plugin/skills/lit-typographic-motion/recipes/negatives/reset-sweep/index.html +17 -0
- package/plugin/skills/lit-typographic-motion/recipes/negatives/still-glow/expected.json +17 -0
- package/plugin/skills/lit-typographic-motion/recipes/negatives/still-glow/index.html +18 -0
- package/plugin/skills/lit-typographic-motion/recipes/negatives/title-slam/expected.json +17 -0
- package/plugin/skills/lit-typographic-motion/recipes/negatives/title-slam/index.html +30 -0
- package/plugin/skills/lit-typographic-motion/recipes/orbit-loop/expected.json +67 -0
- package/plugin/skills/lit-typographic-motion/recipes/orbit-loop/index.html +152 -0
- package/plugin/skills/lit-typographic-motion/recipes/painted-light/expected.json +95 -0
- package/plugin/skills/lit-typographic-motion/recipes/painted-light/index.html +202 -0
- package/plugin/skills/lit-typographic-motion/recipes/weight-tide/expected.json +67 -0
- package/plugin/skills/lit-typographic-motion/recipes/weight-tide/index.html +100 -0
- package/plugin/skills/lit-typographic-motion/references/brief-schema.md +119 -0
- package/plugin/skills/lit-typographic-motion/references/cover.md +473 -0
- package/plugin/skills/lit-typographic-motion/references/craft-loop.md +100 -0
- package/plugin/skills/lit-typographic-motion/references/engine-contract.md +124 -0
- package/plugin/skills/lit-typographic-motion/references/look.md +157 -0
- package/plugin/skills/lit-typographic-motion/references/runtime.md +100 -0
- package/plugin/skills/lit-typographic-motion/references/sound.md +121 -0
- package/plugin/skills/lit-typographic-motion/references/stage.md +239 -0
- package/plugin/skills/lit-typographic-motion/references/style-bibles.md +130 -0
- package/plugin/skills/lit-typographic-motion/references/treatment.md +166 -0
- package/plugin/skills/lit-typographic-motion/references/type-craft.md +87 -0
- package/plugin/skills/lit-typographic-motion/scripts/motion-doctor.mjs +99 -0
- package/plugin/skills/lit-typographic-motion/scripts/motion-runtime.mjs +95 -0
- package/plugin/skills/lit-typographic-motion/scripts/motion.mjs +165 -0
- package/plugin/skills/litgoal/SKILL.md +267 -0
- package/plugin/skills/litgoal/references/close-gate.md +28 -0
- package/plugin/skills/litgoal/references/host-goal-binding.md +32 -0
- package/plugin/skills/litgoal/scripts/check-goal.mjs +116 -0
- package/plugin/skills/litgoal/templates/goal.json +23 -0
- package/plugin/skills/litresearch/ATTRIBUTION.md +42 -0
- package/plugin/skills/litresearch/SKILL.md +229 -0
- package/plugin/skills/litresearch/references/disputed-claims.md +103 -0
- package/plugin/skills/litresearch/references/lane-operations.md +96 -0
- package/plugin/skills/litresearch/references/ledger-and-evidence.md +120 -0
- package/plugin/skills/litresearch/references/pitfalls.md +56 -0
- package/plugin/skills/litresearch/references/query-craft.md +67 -0
- package/plugin/skills/litresearch/references/question-playbooks.md +74 -0
- package/plugin/skills/litresearch/references/report-formats.md +136 -0
- package/plugin/skills/litresearch/references/source-verdict-checklist.md +81 -0
- package/plugin/skills/litresearch/references/worked-examples.md +36 -0
- package/plugin/skills/litwork/SKILL.md +190 -0
- package/plugin/skills/litwork/references/execution-details.md +93 -0
- package/plugin/skills/litwork/references/qa-channel-recipes.md +83 -0
- package/plugin/skills/litwork/references/tier-and-criteria.md +68 -0
- package/plugin/skills/litwork/templates/notes.md +29 -0
- package/plugin/skills/lsp/SKILL.md +166 -0
- package/plugin/skills/lsp/references/cli-recipes.md +154 -0
- package/plugin/skills/lsp/references/runtime-triage.md +122 -0
- package/plugin/skills/lsp/scripts/diagnostics.mjs +340 -0
- package/plugin/skills/lsp/scripts/tsserver-query.mjs +83 -0
- package/plugin/skills/lsp-setup/SKILL.md +241 -0
- package/plugin/skills/lsp-setup/references/bash/README.md +92 -0
- package/plugin/skills/lsp-setup/references/c-cpp/README.md +92 -0
- package/plugin/skills/lsp-setup/references/csharp/README.md +93 -0
- package/plugin/skills/lsp-setup/references/dart/README.md +88 -0
- package/plugin/skills/lsp-setup/references/elixir/README.md +87 -0
- package/plugin/skills/lsp-setup/references/go/README.md +93 -0
- package/plugin/skills/lsp-setup/references/haskell/README.md +89 -0
- package/plugin/skills/lsp-setup/references/java/README.md +89 -0
- package/plugin/skills/lsp-setup/references/julia/README.md +85 -0
- package/plugin/skills/lsp-setup/references/kotlin/README.md +88 -0
- package/plugin/skills/lsp-setup/references/lua/README.md +92 -0
- package/plugin/skills/lsp-setup/references/php/README.md +92 -0
- package/plugin/skills/lsp-setup/references/python/README.md +104 -0
- package/plugin/skills/lsp-setup/references/ruby/README.md +90 -0
- package/plugin/skills/lsp-setup/references/rust/README.md +91 -0
- package/plugin/skills/lsp-setup/references/swift/README.md +91 -0
- package/plugin/skills/lsp-setup/references/terraform/README.md +92 -0
- package/plugin/skills/lsp-setup/references/typescript/README.md +109 -0
- package/plugin/skills/lsp-setup/references/yaml/README.md +93 -0
- package/plugin/skills/lsp-setup/references/zig/README.md +81 -0
- package/plugin/skills/lsp-setup/scripts/detect-lsp.mjs +129 -0
- package/plugin/skills/lsp-setup/scripts/lsp-server-table.mjs +192 -0
- package/plugin/skills/lsp-setup/scripts/verify-lsp.mjs +203 -0
- package/plugin/skills/readme-studio/SKILL.md +111 -0
- package/plugin/skills/readme-studio/references/decoration-and-navigation.md +55 -0
- package/plugin/skills/readme-studio/references/facts-and-assembly.md +19 -0
- package/plugin/skills/readme-studio/references/production-interview.md +11 -0
- package/plugin/skills/readme-studio/references/render-and-deliver.md +44 -0
- package/plugin/skills/readme-studio/references/type-and-background.md +23 -0
- package/plugin/skills/readme-studio/scripts/readme-runtime-lock/package-lock.json +133 -0
- package/plugin/skills/readme-studio/scripts/readme-runtime-lock/package.json +6 -0
- package/plugin/skills/readme-studio/scripts/readme-runtime.mjs +77 -0
- package/plugin/skills/readme-studio/scripts/validate-readme-facts.mjs +28 -0
- package/plugin/skills/readme-studio/templates/cover-source.json +21 -0
- package/plugin/skills/readme-studio/templates/hyperframes-cover/index.html +30 -0
- package/plugin/skills/readme-studio/templates/hyperframes-cover/index.motion.json +1 -0
- package/plugin/skills/readme-studio/templates/hyperframes-cover/package-lock.json +2017 -0
- package/plugin/skills/readme-studio/templates/hyperframes-cover/package.json +8 -0
- package/plugin/skills/readme-studio/templates/readme-cover-section.md +75 -0
- package/plugin/skills/readme-studio/templates/readme-facts.json +4 -0
- package/plugin/skills/readme-studio/templates/remotion-cover/package-lock.json +3783 -0
- package/plugin/skills/readme-studio/templates/remotion-cover/package.json +7 -0
- package/plugin/skills/readme-studio/templates/remotion-cover/src/index.tsx +36 -0
- package/plugin/skills/readme-studio/templates/typography/package-lock.json +133 -0
- package/plugin/skills/readme-studio/templates/typography/package.json +6 -0
- package/plugin/skills/readme-studio/templates/typography/safe-files.mjs +57 -0
- package/plugin/skills/readme-studio/templates/typography/shape-text-to-svg.mjs +63 -0
- package/plugin/skills/refactor/SKILL.md +228 -0
- package/plugin/skills/refactor/references/evidence-and-stops.md +107 -0
- package/plugin/skills/refactor/references/language-and-surface-checks.md +90 -0
- package/plugin/skills/refactor/references/parallel-dispatch.md +66 -0
- package/plugin/skills/refactor/references/phase-templates.md +172 -0
- package/plugin/skills/refactor/references/safe-change-playbook.md +151 -0
- package/plugin/skills/review-work/SKILL.md +227 -0
- package/plugin/skills/review-work/references/agy-plugin-review.md +38 -0
- package/plugin/skills/review-work/references/lane-briefs.md +62 -0
- package/plugin/skills/review-work/references/lane-context.md +44 -0
- package/plugin/skills/review-work/references/lane-goal.md +51 -0
- package/plugin/skills/review-work/references/lane-output-examples.md +79 -0
- package/plugin/skills/review-work/references/lane-qa.md +54 -0
- package/plugin/skills/review-work/references/lane-quality.md +39 -0
- package/plugin/skills/review-work/references/lane-security.md +38 -0
- package/plugin/skills/review-work/references/plan-review-checklist.md +142 -0
- package/plugin/skills/review-work/references/review-rules.md +54 -0
- package/plugin/skills/review-work/references/verdict-templates.md +152 -0
- package/plugin/skills/review-work/references/worked-reviews.md +85 -0
- package/plugin/skills/review-work/scripts/check-lanes.mjs +109 -0
- package/plugin/skills/rules/SKILL.md +175 -0
- package/plugin/skills/rules/references/loading-facts.md +55 -0
- package/plugin/skills/rules/templates/receipt.md +34 -0
- package/plugin/skills/start-work/SKILL.md +191 -0
- package/plugin/skills/start-work/references/admission-and-selection.md +39 -0
- package/plugin/skills/start-work/references/delegation-and-recovery.md +63 -0
- package/plugin/skills/start-work/references/execution-templates.md +131 -0
- package/plugin/skills/start-work/references/final-wave.md +47 -0
- package/plugin/skills/start-work/references/gate-details.md +79 -0
- package/plugin/skills/start-work/scripts/ledger-append.mjs +58 -0
- package/plugin/skills/start-work/scripts/next-row.mjs +99 -0
- package/plugin/skills/structural-search/SKILL.md +223 -0
- package/plugin/skills/structural-search/references/diagnostics.md +289 -0
- package/plugin/skills/structural-search/references/patterns-and-rules.md +356 -0
- package/plugin/skills/structural-search/references/rewrite-safety.md +230 -0
- package/plugin/skills/visual-qa/SKILL.md +136 -0
- package/plugin/skills/visual-qa/references/breakage-catalogue.md +70 -0
- package/plugin/skills/visual-qa/references/capture-playbook.md +96 -0
- package/plugin/skills/visual-qa/references/complete-contract.md +411 -0
- package/plugin/skills/visual-qa/references/korean-and-mixed-script-checks.md +50 -0
- package/plugin/skills/visual-qa/references/reviewer-charters.md +70 -0
- package/plugin/skills/visual-qa/schemas/design-contract-v1alpha1.schema.json +305 -0
- package/plugin/skills/visual-qa/schemas/design-contract-v1beta1.schema.json +291 -0
- package/plugin/skills/visual-qa/schemas/design-contract-v1beta2.schema.json +311 -0
- package/plugin/skills/visual-qa/schemas/evidence-manifest-v1alpha1.schema.json +235 -0
- package/plugin/skills/visual-qa/schemas/evidence-manifest-v1beta1.schema.json +208 -0
- package/plugin/skills/visual-qa/schemas/review-receipt-v1alpha1.schema.json +66 -0
- package/plugin/skills/visual-qa/scripts/ansi.ts +17 -0
- package/plugin/skills/visual-qa/scripts/cli.mjs +101 -0
- package/plugin/skills/visual-qa/scripts/cli.ts +96 -0
- package/plugin/skills/visual-qa/scripts/design-contract-shape.mjs +448 -0
- package/plugin/skills/visual-qa/scripts/east-asian-width.ts +72 -0
- package/plugin/skills/visual-qa/scripts/errors.mjs +12 -0
- package/plugin/skills/visual-qa/scripts/evidence-io.mjs +184 -0
- package/plugin/skills/visual-qa/scripts/evidence-semantic.mjs +95 -0
- package/plugin/skills/visual-qa/scripts/evidence-shape.mjs +163 -0
- package/plugin/skills/visual-qa/scripts/evidence.mjs +421 -0
- package/plugin/skills/visual-qa/scripts/image-diff.mjs +89 -0
- package/plugin/skills/visual-qa/scripts/image-diff.ts +109 -0
- package/plugin/skills/visual-qa/scripts/png-chunks.mjs +107 -0
- package/plugin/skills/visual-qa/scripts/png-crc.ts +27 -0
- package/plugin/skills/visual-qa/scripts/png-decode.mjs +143 -0
- package/plugin/skills/visual-qa/scripts/png-decode.ts +206 -0
- package/plugin/skills/visual-qa/scripts/png-synth.ts +57 -0
- package/plugin/skills/visual-qa/scripts/review-rules.mjs +137 -0
- package/plugin/skills/visual-qa/scripts/strict-json.mjs +143 -0
- package/plugin/skills/visual-qa/scripts/terminal-text.mjs +117 -0
- package/plugin/skills/visual-qa/scripts/tui-check.mjs +74 -0
- package/plugin/skills/visual-qa/scripts/tui-grid.ts +88 -0
- package/plugin/skills/visual-qa/scripts/types.ts +54 -0
- package/plugin/skills/wikify/LICENSE +21 -0
- package/plugin/skills/wikify/PROVENANCE.md +31 -0
- package/plugin/skills/wikify/SKILL.md +245 -0
- package/plugin/skills/wikify/assets/home-template.md +44 -0
- package/plugin/skills/wikify/assets/maintenance-report-template.md +46 -0
- package/plugin/skills/wikify/assets/paper-source-note-template.md +137 -0
- package/plugin/skills/wikify/assets/source-note-template.md +45 -0
- package/plugin/skills/wikify/assets/wiki-rules-template.md +117 -0
- package/plugin/skills/wikify/modes/ingest.md +40 -0
- package/plugin/skills/wikify/modes/init.md +50 -0
- package/plugin/skills/wikify/modes/lint.md +43 -0
- package/plugin/skills/wikify/modes/query.md +35 -0
- package/plugin/skills/wikify/modes/save.md +43 -0
- package/plugin/skills/wikify/references/bridge-and-promotion.md +70 -0
- package/plugin/skills/wikify/references/capture-review-protocol.md +78 -0
- package/plugin/skills/wikify/references/knowledge-script-contract.md +95 -0
- package/plugin/skills/wikify/references/lint-and-maintenance.md +83 -0
- package/plugin/skills/wikify/references/paper-notes.md +56 -0
- package/plugin/skills/wikify/references/query-protocol.md +58 -0
- package/plugin/skills/wikify/references/source-notes-and-citations.md +71 -0
- package/plugin/skills/wikify/references/wiki-layout.md +152 -0
- package/plugin/skills/wikify/scripts/wikify-knowledge.mjs +483 -0
|
@@ -0,0 +1,2240 @@
|
|
|
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
|
+
};
|